Skip to content

Commit

Permalink
Handle R47 relocation of kernal signature (#109)
Browse files Browse the repository at this point in the history
* Handle R47 relocation of kernal signature

* needs to be here, too
  • Loading branch information
mooinglemur authored Mar 13, 2024
1 parent bc66a45 commit d693db1
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 8 deletions.
13 changes: 9 additions & 4 deletions src/hypercalls.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
13 changes: 9 additions & 4 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit d693db1

Please sign in to comment.