Commit Graph
118 Commits
Author SHA1 Message Date
Matthew Laux 005fb5ed3b remove small loop "optimization", no longer necessary and was messing up games that waited on cp [hl] to change 2026-08-19 20:45:14 -05:00
Matthew Laux 9395b336e9 make wram_base and hram_base required, make dmg_new take RAM arrays, simplify and de-hack stack paths 2026-08-12 19:49:00 -05:00
Matthew Laux 9bc30ce809 use watch cursor for JIT init 2026-08-08 00:51:27 -05:00
Matthew Laux a86b4bf3eb Merge branch 'optimize-lcd' into optimize-bank-switch 2026-08-07 20:06:54 -05:00
Matthew Laux 9142963262 migrate to 4k page size - bank switch optimization pt 2 2026-08-07 20:06:24 -05:00
Matthew Laux 084e45c920 WIP bank switch optimize 2026-08-07 19:25:35 -05:00
Matthew Laux 24f33dbfb4 add a warning for virtual memory being turned on 2026-08-06 23:22:08 -05:00
Matthew Laux df3b9e0b7c vertical scroll optimization part 1 2026-08-05 20:46:01 -05:00
Matthew Laux 53c8c5b656 clean up gitignore 2026-08-04 01:19:23 -05:00
Matthew Laux 9eab2e1f2f be a better Mac citizen and reorganize emulator.c
* aloow opening ROMs from finder when the app is already open
* set "Missing application name resource" in saves/cache files
* show alert when opening a cache file
2026-08-04 01:05:41 -05:00
Matthew Laux 112b6fb487 make 1x B&W mode dithered instead of threshold 2026-07-31 19:51:33 -05:00
Matthew Laux 7437b26fc7 fix bug with menu shortcuts also triggering input, fix stray text being drawn outside of window, make status font smaller 2026-07-31 17:35:25 -05:00
Matthew Laux 9f4ffc0506 new folder structure, save list of compiled block addresses to precompile next time, 2.2.0 2026-07-30 22:14:28 -05:00
Matthew Laux bd509d708b support 2 and 4 bit screens 2026-07-30 16:46:23 -05:00
Matthew Laux f621a0d703 use GetKeys to avoid wasting time in GetNextEvent, use shared memory access helpers instead of inlining 2026-07-27 16:42:16 -05:00
Matthew Laux 42acc41a0d WIP compiler improvements 2026-07-27 11:24:31 -05:00
Matthew Laux 4430d07ab7 change audio back to generating at interrupt time, this sounds better 2026-07-24 23:51:48 -05:00
Matthew Laux ceeb2a6cc7 asm version of bg tile inner loop, optimize multiplies in audio 2026-07-24 22:03:40 -05:00
Matthew Laux 4e25b82397 new menu layout! remove preferences dialog 2026-07-24 16:09:50 -05:00
Matthew Laux 71bb51ec88 instruction optimization round 1 2026-07-14 17:52:49 -05:00
Matthew Laux 75d52dc882 optimize LCD by only drawing changed rows 2026-07-13 17:31:40 -05:00
Matthew Laux 5464e0721f remove STAT throttling, add a menu option instead 2026-07-12 17:39:17 -05:00
Matthew Laux ed37a7c185 half-remove cycles_per_exit, optimize STAT interrupts, but will remove 2026-07-12 17:18:06 -05:00
Matthew Laux 7610d3ce96 biased page tables, scaled index on 68020+, interrupt fixes (that may or may not have actually improved compatibility) 2026-07-08 20:12:32 -05:00
Matthew Laux f3e872c53b fix patches.h conflicting with system Patches.h 2026-02-16 17:20:17 -06:00
Tanner Fokkens de2b956a7f Disable changing double speed in-game. 2026-02-10 23:51:49 -08:00
Matthew Laux 1eb1209097 optimize register usage for write, add patch system 2026-02-03 18:29:48 -06:00
Matthew Laux d43868a279 add menu items to resedit, v1.4.0 2026-02-01 20:02:14 -06:00
Tanner Fokkens c5fb8064aa Fix CGB detection: set A=0x11 for CGB mode 2026-02-01 01:12:15 -08:00
Matthew Laux 93ae963ea5 reset ly_read_cycle (fixes pokemon crystal infinite loop) 2026-02-01 00:58:48 -08:00
Tanner Fokkens 83054f8e45 Add Ignore Double Speed option for CGB performance
Games running in double-speed mode (8MHz) cause the emulator to execute
twice as many instructions per frame. This option ignores the double-speed
flag, treating all execution as normal speed for better performance on
slower Macs while maintaining correct frame timing.

- Add menu toggle in Options menu
- Save/load preference to resource file
- Check flag in dmg_sync_hw() when calculating PPU cycles
2026-02-01 00:58:48 -08:00
Tanner Fokkens 6b4225aa8f Optimize CGB rendering with LUT-based color lookup
- Add combined cgb_color_lut[16][4] to eliminate per-pixel conditional
  branches and multiply operations in final draw functions
- Add tile_decode_cgb[256] LUT to replace 8-iteration bit extraction
  loops with 2 table lookups
- Add dirty palette tracking (bg_palette_dirty, obj_palette_dirty) to
  skip expensive Color2Index calls when palettes haven't changed
- Replace multiply-based pixel_shift calculation with 4-byte LUT

Also fixes test harness to initialize JIT_CTX_GB_SP for slow path
stack operations.
2026-02-01 00:58:48 -08:00
Tanner Fokkens 9bb5705759 Add Game Boy Color support
- New CGB state management (cgb.c/cgb.h)
  - VRAM banking (VBK register)
  - WRAM banking (SVBK register, banks 1-7)
  - Speed switching (KEY1 register)
  - HDMA transfers (HDMA1-5 registers)
  - CGB palette registers (BCPS/BCPD, OCPS/OCPD)

- CGB rendering (lcd_cgb.c, lcd_mac_cgb.c)
  - Tile attributes from VRAM bank 1
  - Per-tile palettes, H/V flip, priority
  - 8 background and 8 sprite palettes
  - RGB555 to Mac indexed color conversion

- JIT initialization sets A=$11 for CGB mode detection

- UI: "Run as GBC" menu option, .gbc file filter

Working: Tetris DX, Pokemon Gold
Known issues: Crystal, SMB Deluxe, LADX hang at boot
2026-02-01 00:57:25 -08:00
Matthew Laux 5282a16639 reenable palettes menu 2026-01-31 21:25:20 -06:00
Matthew Laux 77dd744b1e reset ly_read_cycle (fixes pokemon crystal infinite loop) 2026-01-31 20:44:24 -06:00
Matthew Laux 3a78378b1f add palette picker 2026-01-28 23:16:35 -06:00
Matthew Laux 806728a708 remove unused cpu struct 2026-01-28 13:56:38 -06:00
Matthew Laux 5066768fd7 bump to version 1.3.0, rearrange menus a bit, make sure menus are always up-to-date 2026-01-28 13:45:48 -06:00
Tanner Fokkens 681ba098ae Replace autosave toggle with manual Write Savefile (Cmd+S) 2026-01-26 23:05:11 -08:00
Tanner Fokkens 6b447d425f This is an menu-toggle autosave feature. It saves every minute, but only when cart RAM has been marked dirty. This hopefully avoids excessive disk writes. The old way, every 15 seconds regardless of SRAM state, was causing a lot of stuttering on real hardware. 2026-01-26 20:53:28 -08:00
Matthew Laux 23f752af23 move timing functions to their own file, LY wait on registers too 2026-01-25 22:16:22 -06:00
Matthew Laux 31d6caed10 auto-save every 15 sec, save on game quit, not emulator quit 2026-01-25 21:24:48 -06:00
Matthew Laux 4994c3e0f2 still was freeing an array that i had changed to bss oops 2026-01-24 21:22:15 -06:00
Matthew Laux efc5a38732 allow changing frame skip in-game. 1-pixel dialog adjustment lol 2026-01-24 20:54:20 -06:00
Matthew Laux 1cbad8b28f second round of polish. v1.2.0 2026-01-24 20:30:13 -06:00
Matthew Laux 7ec78c3267 first round of final tweaks before release 2026-01-24 17:37:15 -06:00
Matthew Laux 8b78a9345b sync audio with GB execution - still not sure if i like this better 2026-01-24 02:20:26 -06:00
Matthew Laux 935beefee6 optimize LCD rendering more by using slightly larger buffer horizontally to handle X scroll position 2026-01-22 01:05:20 -06:00
Matthew Laux 230a9c929b write a README, add screenshots, audio tweaks with band limited square waves 2026-01-17 00:14:05 -06:00
Matthew Laux 3072fc3df3 tweak memory warning 2026-01-15 19:46:51 -06:00