diff --git a/src/hypercalls.cpp b/src/hypercalls.cpp index 95cc4eb..8331801 100644 --- a/src/hypercalls.cpp +++ b/src/hypercalls.cpp @@ -42,10 +42,15 @@ static bool is_kernal() { const uint8_t rom_bank = memory_get_rom_bank(); - return debug_read6502(0xfff6, rom_bank) == 'M' && // only for KERNAL - debug_read6502(0xfff7, rom_bank) == 'I' && - debug_read6502(0xfff8, rom_bank) == 'S' && - debug_read6502(0xfff9, rom_bank) == 'T'; + // only for KERNAL + return (debug_read6502(0xfff6, rom_bank) == 'M' && + debug_read6502(0xfff7, rom_bank) == 'I' && + debug_read6502(0xfff8, rom_bank) == 'S' && + debug_read6502(0xfff9, rom_bank) == 'T') + || (debug_read6502(0xc008, rom_bank) == 'M' && + debug_read6502(0xc009, rom_bank) == 'I' && + debug_read6502(0xc00a, rom_bank) == 'S' && + debug_read6502(0xc00b, rom_bank) == 'T'); } static bool init_kernal_status() diff --git a/src/main.cpp b/src/main.cpp index 861d937..d9c79f1 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -151,10 +151,15 @@ void machine_toggle_warp() static bool is_kernal() { - return read6502(0xfff6) == 'M' && // only for KERNAL - read6502(0xfff7) == 'I' && - read6502(0xfff8) == 'S' && - read6502(0xfff9) == 'T'; + // only for KERNAL + return (read6502(0xfff6) == 'M' && + read6502(0xfff7) == 'I' && + read6502(0xfff8) == 'S' && + read6502(0xfff9) == 'T') + || (read6502(0xc008) == 'M' && + read6502(0xc009) == 'I' && + read6502(0xc00a) == 'S' && + read6502(0xc00b) == 'T'); } #undef main