From be31cfb503b00e6f493d217287c1f592aec4820b Mon Sep 17 00:00:00 2001 From: DirtBagXon Date: Sat, 13 Mar 2021 15:56:18 +0000 Subject: [PATCH] Add fix for Badlands, Road Blaster and Bega's Battle on the RPi --- src/cpu/mc6809.cpp | 6 +++--- src/cpu/nes6502.cpp | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/cpu/mc6809.cpp b/src/cpu/mc6809.cpp index 282ae6d4..15ac5296 100644 --- a/src/cpu/mc6809.cpp +++ b/src/cpu/mc6809.cpp @@ -226,7 +226,7 @@ static unsigned char fetch_buffer[MC6809_FETCH_BUFFER_SIZE]; /* le caractère 8-bit du MC6809 impose l'utilisation de char pour la manipulation des opcodes qui sont des octets signés */ -static char *op; +static signed char *op; static int ad; static int *regist[4], *exreg[16]; static int illegal_instruction_flag; @@ -2004,7 +2004,7 @@ unsigned int mc6809_StepExec(unsigned int ncycles) /* on remplit le buffer de fetch */ FetchInstr(pc, fetch_buffer); - op=(char*) fetch_buffer; + op=(signed char*) fetch_buffer; /* on décode l'instruction */ r=(*(op++))&0xFF; @@ -2049,7 +2049,7 @@ int mc6809_TimeExec(mc6809_clock_t time_limit) /* on remplit le buffer de fetch */ FetchInstr(pc, fetch_buffer); - op=(char*) fetch_buffer; + op=(signed char*) fetch_buffer; /* on décode l'instruction */ r=(*(op++))&0xFF; diff --git a/src/cpu/nes6502.cpp b/src/cpu/nes6502.cpp index 9fc72c8b..ec202b51 100644 --- a/src/cpu/nes6502.cpp +++ b/src/cpu/nes6502.cpp @@ -295,10 +295,10 @@ if (condition) \ { \ IMMEDIATE_BYTE(btemp); \ - if (((int8) btemp + (PC & 0x00FF)) & 0x100) \ + if (((int8_t) btemp + (PC & 0x00FF)) & 0x100) \ ADD_CYCLES(1); \ ADD_CYCLES(3); \ - PC += ((int8) btemp); \ + PC += ((int8_t) btemp); \ } \ else \ { \