10 Commits

Author SHA1 Message Date
Tanner Fokkens
4decd1de16 Fix ld sp,hl/imm16 to use page table for switchable WRAM banks
ld sp,hl and ld sp,imm16 computed the native SP pointer using a fixed
  base (dmg->main_ram), which always resolved to WRAM bank 1 for the
  $D000-$DFFF range. On CGB, this range is switchable (banks 1-7 via
  SVBK). Games like Pokemon Crystal that use the SP trick to bulk-copy
  data from switchable WRAM to VRAM would read from the wrong bank,
  causing VRAM tile corruption.

  Use the read page table at runtime instead, which is kept in sync with
  the current WRAM bank by cgb_update_wram_bank().
2026-02-06 13:08:37 -08:00
Matthew Laux
882ace0d13 make LY read faster, revert wack HALT change 2026-01-25 20:53:56 -06:00
Matthew Laux
ebb343cdbd support stack in HRAM (fixes DK '94) 2026-01-25 19:03:28 -06:00
Matthew Laux
8e17d86cfc use git sha for version info 2026-01-22 01:18:46 -06:00
Matthew Laux
d627b7265b re-add SP range detection, avoid copying lcd pixels twice 2026-01-21 21:20:42 -06:00
Matthew Laux
e9000a3c84 rewrite stack for the millionth time 2026-01-15 21:09:57 -06:00
Matthew Laux
814a9ccf0b dmg_write16 instead of two dmg_write for stack ops 2026-01-13 23:40:28 -06:00
Matthew Laux
9f91bd7526 add 1x scale, audio refactor and fix wave frequency issue, remove crazy SP detection and always go through dmg_read/write 2026-01-13 21:47:25 -06:00
Matthew Laux
f472ce46bd use 68k ccr instead of GB flag format. it's getting crashy 2026-01-09 00:42:26 -06:00
Matthew Laux
9969a0b483 split out stack funcs to separate file, start on key mappings dialog 2026-01-07 23:27:33 -06:00