Commit Graph

153 Commits

Author SHA1 Message Date
Lior Halphon 73a54049d2 Accurate PPU access timings 2019-01-19 19:32:26 +02:00
Lior Halphon 4536581a6e Fixed a bug where modifying RTC data would corrupt cartridge RAM data. Fixes #136 2019-01-18 02:36:14 +02:00
Lior Halphon 312478e509 CGB palettes are not accessible during Mode 3, closes #84 2019-01-14 22:22:46 +02:00
Lior Halphon 879d3b607d Removed verified TODO 2019-01-14 20:32:52 +02:00
Lior Halphon 7b36ee10a4 Merge branch 'master' into sgb 2019-01-05 19:00:22 +02:00
Lior Halphon 612cd07fb3 Fixed emulation of echo RAM 2018-12-12 23:44:00 +02:00
Lior Halphon ea09dfc888 Fixed multiplayer SGB mode 2018-12-04 23:46:30 +02:00
Lior Halphon 7735d638c6 Multiplayer SGB APIs/SGB detection 2018-11-12 00:37:06 +02:00
Lior Halphon 44891d5c4a Initial code to support SGB, command “parsing”, replacement SGB boot ROM 2018-11-11 01:16:32 +02:00
Lior Halphon 11c148c851 Starting G/HDMA directly takes one more M-cycle (More research required) 2018-09-15 00:48:31 +03:00
Lior Halphon f7b882f0e8 Whoops 2018-07-22 02:10:26 +03:00
Lior Halphon b7426f93c0 Randomize object palettes. Slightly more accurate emulation of FF4C. 2018-07-20 23:23:47 +03:00
Lior Halphon 2e9e3424ec Document some revision differences 2018-07-14 21:52:54 +03:00
Lior Halphon a7aabca618 Starting to add CGB-C support 2018-07-03 21:43:46 +03:00
Lior Halphon d81c23cb16 Fixed HDMA regression 2018-06-16 23:52:24 +03:00
Lior Halphon 45c73e0175 Replaced the is_cgb bool with a more future compatible model enum. Removed the GB_init_cgb API and replaced it with an extended GB_init and GB_switch_model_and_reset APIs that now receive a model parameter. Increased the struct version. 2018-06-16 13:59:33 +03:00
Lior Halphon 6532aef089 Correct emulation of the DMG stat write bug 2018-05-26 18:06:40 +03:00
Lior Halphon 9693b2de6a Refined the STAT bug behavior. Still not perfect. 2018-05-26 17:06:49 +03:00
Lior Halphon 855ffb490a A HBlank interrupt cannot occur in the last M-cycle of HBlank. Correct emulation of STAT access conflicts on the CGB (Test: CPU-E, single speed only). Fixes a minor graphical glitch in Pokémon Puzzle Challenge. 2018-05-25 23:42:36 +03:00
Lior Halphon 713dc02e46 A bit tacky, but T-cycle accurate emulation of LYC write conflicts on the CGB. Only single speed mode verified. Closes #54 2018-05-11 12:38:55 +03:00
Lior Halphon f1ec42d4ba H/GDMA was 4 times faster than it should have been. Made it also more accurate. Fixes #56 2018-04-13 14:41:39 +03:00
Lior Halphon 0c86ff1ee4 More CGB revision quirks 2018-04-06 04:00:37 +03:00
Lior Halphon e163026ca9 The STAT bug does not occur during the glitched mode 0 2018-04-02 01:05:32 +03:00
Lior Halphon 7671648fca Simplified a function 2018-03-27 19:06:36 +03:00
Lior Halphon 4cbade9a88 Function name change 2018-03-27 15:55:12 +03:00
Lior Halphon 4986930511 Mostly complete emulation of the OAM bug. Passes oam_bug-2. 2018-03-27 15:46:00 +03:00
Lior Halphon 18e32d1755 Merge branch 'master' into timing
# Conflicts:
#	Core/gb.c
2018-03-22 22:37:35 +02:00
Lior Halphon 577e23925b Fixed sources-dmgABCXmgbS 2018-03-22 20:09:01 +02:00
Lior Halphon b702d56547 Merge branch 'master' into timing
# Conflicts:
#	Core/display.c
#	Core/z80_cpu.c
2018-03-01 21:22:33 +02:00
Lior Halphon b02e40d5a2 Refinement to that last fix 2018-02-25 23:23:55 +02:00
Lior Halphon 90a943d05a Emulate an HDMA quirk required to properly emulate Aevilia 2018-02-25 22:32:41 +02:00
Lior Halphon ef670986c6 Rewrote PPU (currently only emulates DMG correctly) to use the new timing mechanism. Removed “future interrupts” (No longer required because SameBoy is now T-cycle based) 2018-02-25 00:48:45 +02:00
Lior Halphon 42ab746a66 Starting to remove the delayed interrupts hack – done for timer interrupt, broken for display interrupts 2018-02-23 15:33:44 +02:00
Lior Halphon c48097a484 Convert div counter to the SM mechanism 2018-02-23 13:16:05 +02:00
Lior Halphon 9802ca41dd Components not affected by CGB’s double speed mode now operate in 8MHz mode to theoretically make advance_cycles(gb, 1) safe. 2018-02-20 21:17:12 +02:00
Lior Halphon f79af39ea2 More accurate emulation of the APU’s analog characteristics 2018-02-16 18:01:50 +02:00
Lior Halphon 441781cbe9 Libretro .o files are now in the build/obj folder and are suffixed with _libretro (since they have different compilation flags). This also lets us rename gbmemory.c/h back to its original name. 2017-10-12 19:42:30 +03:00
twinaphex a7db98c22e Memory needs to be uniquely named for Android 2017-10-09 11:36:55 -05:00
twinaphex 09f4edda57 Comment out debugger code - add HAVE_DEBUGGER ifdef 2017-10-09 11:36:53 -05:00
Lior Halphon b9bdd6c49c Merge branch 'master' into new_apu 2017-09-10 02:33:40 +03:00
Lior Halphon 1e90400916 Reimplemented delayed/future interrupts, currently correct only for CGB. 2017-09-09 13:32:12 +03:00
Lior Halphon ba0e66a5b7 Merge branch 'master' into new_apu 2017-09-04 18:41:13 +03:00
Lior Halphon 9b490396bb Fixed timing when turning the LCD display on during double speed mode 2017-09-02 23:26:45 +03:00
Lior Halphon e7d5cdbb42 Merge branch 'master' into new_apu 2017-08-20 01:37:33 +03:00
Lior Halphon cbbaf2ee84 Refined Window behavior once more, Fixes #12 (While not breaking Donkey Kong or 007) 2017-08-20 01:34:12 +03:00
Lior Halphon d43daed6a6 Merge branch 'master' into new_apu 2017-08-12 21:43:09 +03:00
Lior Halphon 7df4e56454 KEY1 is only writable in CGB mode; screen should be black is LCD is on while in stop mode. 2017-08-12 21:42:47 +03:00
Lior Halphon baccf336d7 Complete rewrite of the APU. Channel 3 is complete and passes all the relevant tests from blargg’s suite, as well as PCM34-based tests. Actual sound output is basic and limited, though. 2017-07-21 19:06:55 +03:00
Lior Halphon c4ccbd5cce Improved serial interrupt timing, fixes boot_sclk_align. 2017-06-23 17:58:04 +03:00
Lior Halphon c59272d46d Misc minor fixes, fixes several Mooneye-GB tests 2017-06-21 20:39:23 +03:00
Lior Halphon abf7efcc5a Fixed lcdon_write_timing. 2017-06-18 21:27:07 +03:00
Lior Halphon 86c9f9d89d Updated SameBoy to pass Mooneye-GB’s lcdon_timing test (on a DMG), as well as refined related CBG behaviors. 2017-06-17 22:17:58 +03:00
Lior Halphon d72807dd67 Implemented LCD first-frame-skip behavior, fixes a visual glitch in Pokémon Pinball 2017-06-03 16:42:42 +03:00
Lior Halphon c766704267 More accurate FPS capping that tracks time correctly even when the screen is off. Should also support restarting the LCD during blank to increase FPS to 63. 2017-04-21 16:00:53 +03:00
Lior Halphon fb55c35f87 New APIs, Document.m no longer requires GB_INTERNAL, fixed a bug where the sprite viewer showed incorrect sprites for some CGB exclusive games. 2017-04-19 23:26:39 +03:00
Lior Halphon a925ef130d Stabilizing API: New joypad, debugger and reset APIs; internal APIs and direct struct access are no longer available without defining GB_INTERNAL. The SDL port uses the new “public” APIs, as well as most of the non-debug Cocoa code. 2017-04-17 20:16:17 +03:00
Lior Halphon 55e54d9499 Refinements to DMG STAT write interrupt bug. Fixes stat_irq_blocking on DMG. 2017-02-25 21:56:46 +02:00
Lior Halphon dbd04f09e8 HBlank HDMA should start instantly when starting during HBlank. Fixes 3-D Ultra Pinball. 2017-02-25 15:42:59 +02:00
Lior Halphon a420cfd798 HUC1’s RAM Enable only controls writing 2017-02-23 00:27:08 +02:00
Lior Halphon 91513ced22 Minor adjustment to LCD timing after enabling it. 2017-02-20 14:20:45 +02:00
Lior Halphon 421d3b27f5 Correct emulation of HUC1 banks higher than 0x1F 2017-02-16 21:07:35 +02:00
Lior Halphon 4b6fda0cb6 Simplified HDMA and fixed the reading of the HDMA5 register 2017-02-08 21:58:15 +02:00
Lior Halphon d5c9a52337 Fixed: HDMA registers were not being updated during transfer 2017-02-07 00:24:26 +02:00
Lior Halphon 22c34e1095 Serial API 2016-11-12 01:58:53 +02:00
Lior Halphon 47aaf44017 Rumble API 2016-10-22 15:37:03 +03:00
Lior Halphon 2d51d13479 Various optimizations 2016-10-22 02:18:29 +03:00
Lior Halphon 11f8c41305 Basic HUC3 support 2016-10-17 18:51:43 +03:00
Lior Halphon fa35869bc4 Implemented DMG STAT-write interrupt bug, fixed Road Rash and Zero no Densetsu (These game do not work on CGBs) 2016-10-11 13:37:43 +03:00
Lior Halphon ab5f66795a Gameboy Camera API 2016-10-02 17:14:58 +03:00
Lior Halphon b3b041a151 Basic GB Camera support (Emulate only MBC, enough for the ROM to boot). 2016-10-02 03:40:11 +03:00
Lior Halphon 4904277f0d Corrected behavior of palette registers in DMG mode. This affected a broken Game & Watch Gallery 2 ROM that was previously used in the automation test. 2016-10-01 22:10:44 +03:00
Lior Halphon 4a2bec239a MBC2 RAM support was completely broken. 2016-09-30 23:34:06 +03:00
Lior Halphon 258500bda3 Merge branch 'master' into rateless_apu 2016-09-23 18:53:38 +03:00
Lior Halphon 42c01a21b2 Fixed crash when accessing MBC RAM on a cartridge that "has RAM", but it's 0-sized. 2016-09-22 01:52:40 +03:00
Lior Halphon 594aea2d5a APU is now being run lazily 2016-09-13 17:33:48 +03:00
Lior Halphon ff7b8a6854 Removed doubles, reorganized code a bit 2016-09-13 16:57:16 +03:00
Lior Halphon 603b8969ab Correct (disconnected) serial emulation. 2016-09-06 13:13:14 +03:00
Lior Halphon a746c726ee Added basic automatic ROM tester 2016-09-03 03:39:32 +03:00
Lior Halphon ee4907949b Support for RTC latching. Fixes #4. 2016-08-21 22:33:57 +03:00
Lior Halphon bebb5c7a41 Correctly emulating the unused OAM memory in DMG mode 2016-08-06 18:58:44 +03:00
Lior Halphon cc8664b0a8 Correctly emulating a disconnected serial cable 2016-08-06 18:57:33 +03:00
Lior Halphon d03a1fbd16 Fixed TMA writing while reloading. 2016-08-06 14:36:33 +03:00
Lior Halphon 85a33ed8ef Emulating DMA delay correctly 2016-08-06 14:24:43 +03:00
Lior Halphon 8dd5462525 Correct DMA timing 2016-08-06 13:57:38 +03:00
Lior Halphon 0f98ac5ff9 Emulate TIMA reloading 2016-08-06 13:56:29 +03:00
Lior Halphon 55cbe5d4d0 Accuracy improvements to timers 2016-08-06 00:24:12 +03:00
Lior Halphon d098458ee4 Major improvements to accuracy: Fixed instruction timing, DMA timing, and IO reg masking. Passes most of mooneye-gb acceptance tests. 2016-08-05 16:36:38 +03:00
Lior Halphon 47e3300b66 Improved DMA accuracy, mooneyegb test ROMs no longer crash miserably. (but still fail) 2016-08-03 23:31:10 +03:00
Lior Halphon 185e71fe12 Improvements to IR API, since timing is VERY important 2016-07-21 01:03:13 +03:00
Lior Halphon 1d35c04ab1 Infrared API 2016-07-18 22:11:18 +03:00
Lior Halphon c6bafe3fc3 Rewrote MBC support 2016-07-09 17:34:55 +03:00
Lior Halphon 78a809795e Renaming MBC constants 2016-07-09 14:45:25 +03:00
Lior Halphon de4983099a Added (conditional) r/w watchpoints. Fixed a bug where breakpoint condition syntax is not checked. Added != operator. 2016-07-07 00:29:25 +03:00
Lior Halphon 70bd90740a Mass name and type changes. Save states are now compatible between 32- and 64-bit systems. Maybe. 2016-06-18 20:29:11 +03:00
Lior Halphon 64832e0e9e HDMA accuracy improvement 2016-06-18 16:51:25 +03:00
Lior Halphon b8bc84db4e Corrected read of HDMA5, fixing A Bug's Life 2016-04-15 01:26:48 +03:00
Lior Halphon de95e6f6fc Fixed incorrect DMA validity check, fixing The Smurfs 3 2016-04-09 15:00:29 +03:00
Lior Halphon 80d03f3c91 Added ROM-bank wrapping support, making bootleg game "Pocket Monster Adventures" boot.
(Although this game is better not booting)
2016-04-09 02:18:09 +03:00
Lior Halphon 3e135a7c00 More accurate emulation of the DMG-emulation-mode registers. 2016-04-05 23:21:51 +03:00
Lior Halphon cda6621dc2 Fixed mask for TAC and STAT 2016-04-04 22:12:00 +03:00