120 Commits

Author SHA1 Message Date
paulb-nl
016f45bc7b 3D LUT for color correction. Fix OAM in save state. (#282)
* Move Cart RAM to SDRAM

Used the SDRAM controller from the NES core

* 3D LUT for color correction. Load custom LUT

* Add custom LUTs

* Fix OAM saving to save state
2026-04-13 15:23:58 +08:00
Keith Conger
71fcc15472 MegaDuck Laptop Support (#281) 2026-04-02 15:02:53 +08:00
Mark Johnson
1b131a0de1 Timer module rewrite, APU clocked from timer (#280)
* Rework timer modules to resolve #101

Sound clock is passed to the APU but is not currently being used. Work needed to match this up.

* Rename APU frame clock.

* VHDL-2008 fix.

* Fix APU clock to 1x CPU clock.

* Clarify machine cycles in timer.

* Whitespace

* Add APU channel enables for debugging.

* Fix timer generated sound clk

R14 - Audio issues remain for 2X CPU games

* Fix issue with 2x gameboy APU sound clock

R22

* Re-implement sound clocking in timer module.

R25, Remove old code N.B. Likely a bug still here.

* Fix timer generated APU clock to 4 MiHz cycle.

R27

* Tidy up.

Remove attribution in timer module since doing a full rewrite.

* Disabling TAC can generate a clock-edge

Thanks to @paulb-nl for pointing out

* Prevent name clash

* Rework timer modules to resolve #101

Sound clock is passed to the APU but is not currently being used. Work needed to match this up.

* Rename APU frame clock.

* VHDL-2008 fix.

* Fix APU clock to 1x CPU clock.

* Clarify machine cycles in timer.

* Whitespace

* Add APU channel enables for debugging.

* Fix timer generated sound clk

R14 - Audio issues remain for 2X CPU games

* Fix issue with 2x gameboy APU sound clock

R22

* Re-implement sound clocking in timer module.

R25, Remove old code N.B. Likely a bug still here.

* Fix timer generated APU clock to 4 MiHz cycle.

R27

* Tidy up.

Remove attribution in timer module since doing a full rewrite.

* Disabling TAC can generate a clock-edge

Thanks to @paulb-nl for pointing out

* Prevent name clash

* Remove unused variable

* Set en_len_r on same cycle as en_len

* Buffer en_len to en_len_r properly

* Remove debug tools
2026-03-22 21:32:35 +08:00
Keith Conger
f36baf98ad insideGadgets Keyboard and Mouse emulation (#279) 2026-03-20 14:27:49 +08:00
Keith Conger
ef2ca135d5 Workboy (#278)
* Workboy emulation

* Update ReadMe.md
2026-02-18 13:44:10 +08:00
paulb-nl
05246601b3 SGB: wait for the last write before updating attr_file (#275)
This avoids displaying the wrong colors before all writes are done.
2025-11-24 22:52:34 +08:00
paulb-nl
ee8bf4c29f Add option for extra sprites
Maximum of 6 extra sprites per line
Extra sprites are fetched during mode2 to not break mode3 timing
2025-06-15 09:32:45 +02:00
paulb-nl
e246605341 OAM: Change data bus to 16bit
-Add shared buffers for X/Y and Tile index/attributes
-X/Y buffers during mode2 are not updated when OAM dma is active
(Needed for strikethrough.gb test glitch)
2025-06-10 17:43:50 +02:00
paulb-nl
95ea2d77a5 Improve GBC color correction
Color LUT for mix of 2 colors with 2 stage gamma
2025-05-11 13:07:44 +02:00
paulb-nl
179ec75a80 GBC bootrom is also disabled with bit 0 only 2025-05-11 13:04:59 +02:00
paulb-nl
460addc5bc HDMA: transfer stops only if target address overflows at $FFFF (#261)
Fixes hang in F1 Championship Season 2000
2025-01-08 20:55:27 +08:00
paulb-nl
fe5758fd33 Add option to remove audio pops (#257)
Some audio can be inaccurate with this option enabled.
2024-09-05 13:42:36 +08:00
paulb-nl
7c576b02e8 Fix noise channel pitch (#254)
`noi_fcnt` was off by one
2024-08-12 18:31:39 +08:00
paulb-nl
1258e99207 Video: Background fetching changes for accurate Window glitches
- WX=0 scrolling glitches
- WX=166 glitch
- Extra pixel glitch when Window is disabled mid-screen
- Start delay when enabling Window during WX trigger
2024-06-16 14:38:22 +02:00
paulb-nl
ef8e1765c8 GBC: WRAM bank should not read 1 when set to 0. 2024-06-16 14:32:04 +02:00
paulb-nl
22da38ae41 Fix Rom mask for non power of 2 sizes (GBVideoPlayer) 2024-06-16 14:29:32 +02:00
paulb-nl
5f02cb3b23 SGB: Fix joypad_id not updating after MLT_REQ (Dai-2-ji) 2024-06-16 14:26:52 +02:00
Mark Johnson
4b06b66006 Fix #241 (#243)
Tidy up noise channel implementation
2023-05-24 04:03:05 +08:00
Mark Johnson
4031b6c2ce Save state slot fix #174. (#240)
Thanks to @RobertPeip
2023-05-01 06:39:17 +08:00
Mark Johnson
7b5598090e Reimplement APU DACs with disable decays (#239)
* Reimplement APU DACs with disable decays

* Whitespace alignment
2023-04-30 00:24:00 +08:00
Mark Johnson
fb923961c6 Fix bug with sound panning. (#237) 2023-04-15 21:05:04 +08:00
Mark Johnson
8ea9404b24 Adjust whitespace 2023-04-15 00:33:42 +01:00
Mark Johnson
4950b4643b Rewrite wave table. 2023-04-15 00:32:49 +01:00
Mark Johnson
8619d4ed1f Fix noise when rapidly turning APU DACs on and off. 2023-04-15 00:29:57 +01:00
Mark Johnson
2fb9af272e Rewrite output mixer.
Tweak DAC outputs to map more accurately.
2023-04-15 00:27:49 +01:00
Mark Johnson
e860fb5178 Refactor sound channels 2023-03-26 23:11:58 +01:00
Mark Johnson
ff7db6a614 Add bootrom compiler flow (#231)
* Add makefile for bootrom compilation


Add flag for SameBoy compilation, separate asm sources

Also adds WIndows make switches
Replace SameBoy PB12 encoding with old encoding

GameBoy logo still not 100%
Clarify Makefile, add image compilation


Remove sameboy source

* Remove DMG emulation of CGB games


Remove unused variable.


Change logo extension


Remove rgbgfx option

Nintendo logo correct now
Explicitly define slice

* Remove palette selection for CGB games

* Old-style Gameboy logo

* Add GBA menu option for built-in CGB rom

* Restore original DMG scrolling animation

* Add original CGB bios checksum verification

* Add fastboot option to DMG/CGB bootroms, create new OSD submenu

Also add further checksums for CGB0 bootrom and equivalent checksum C code. Grouped together all bootrom items into new submenu. Removed redundant bootroms (AGB, fastboot)

* Update README and give SameBoy attribution

Clean up checksum + make

* Incorporate latest SameBoy boot changes

Gives correct register values on boot

* Update readme

* Add AGB alternative boot color

---------

Co-authored-by: Mark Johnson <mark.ai.johnson@pm.me>
2023-02-13 00:13:19 +08:00
paulb-nl
17d89ade42 gbc_snd: fix warning 2022-12-29 17:18:19 +01:00
paulb-nl
2439aa4747 Delay blanking the screen for GBC
Repeat last frame when the LCD is disabled for a short time only.
2022-12-29 17:13:53 +01:00
paulb-nl
746cb8e9c0 Megaduck audio fixes
NR33 & NR34 were switched.
NR32 swizzled volume bits.
2022-12-25 15:51:16 +01:00
paulb-nl
11750b0230 HDMA fixes
-Let CPU finish a read/write before pausing the CPU.
-Assert hdma_rd after the 4 cycle (1 Mcycle) delay to allow the CPU to
finish the read/write.
-Stop HDMA transfer when target address overflows
2022-12-23 17:49:41 +01:00
paulb-nl
a6f94d6463 Fix wave channel buzzing sound
Keep outputting the last read sample when the DAC is disabled.
The first sample output when playing starts is the last read sample.
2022-11-26 19:31:52 +01:00
paulb-nl
310be30d76 Implement KEY0 and OPRI registers 2022-11-26 16:13:39 +01:00
Mark Johnson
d7863e1417 Fix output multiplier sign handling (#222) 2022-11-14 20:14:19 +08:00
Mark Johnson
405815d40e Fix APU DAC handling (#217)
* Fix output muting bug.

Channel volume 0b000 to 0b111 is a 1 to 8 multiplier.

* Make all apu channels 4 bits wide.

Reverts default suppressed value.

* Map DAC value correctly (implemented in Mixer)

* Update comment for clarity.
2022-11-07 00:50:22 +08:00
paulb-nl
f1cd3472b0 MBC3: Pause RTC subsecond counter when halted. (rtc3test) (#214)
Also change to 32768Hz clock enable for RTC
2022-10-17 16:17:35 +08:00
paulb-nl
d25e0d64e7 Add Wisdom Tree / Mani 161 mappers & mapper selection. 2022-08-06 17:33:46 +02:00
paulb-nl
c9e40b3514 Add loading of custom Game Boy bootroms 2022-07-22 21:22:57 +02:00
paulb-nl
623c3c0e05 Video: Window start fixes (Ant Soldiers, Mealybug tests) 2022-07-22 21:15:45 +02:00
Jamie Blanks
9a27220b15 add rumble support (#202) 2022-04-28 23:22:39 +08:00
Jamie Blanks
3cea62ca86 Add MegaDuck system support (#201) 2022-04-17 16:25:10 +08:00
Jamie Blanks
51266a0f41 fix top line of shadows (#195) 2022-01-30 07:36:00 +08:00
Jamie Blanks
720cae3e30 add option to drop shadow like DMG screen (#193) 2022-01-17 22:52:03 +08:00
paulb-nl
2797679a0f Fixes for separate WRAM bus on GBC (Aladdin) 2021-11-21 17:06:37 +01:00
paulb-nl
20524d7b56 Fix SDRAM not being refreshed when paused during cart access 2021-11-07 09:29:22 +01:00
paulb-nl
62a515ada5 MBC5: RAM enable is 8 bits 2021-10-31 20:44:37 +01:00
paulb-nl
3cd86e3c8f SGB: Fix joypad id decrement
Fixes sgb-mlt-test & Gamera - Daikaijuu Kuuchuu Kessen
2021-10-31 20:42:34 +01:00
paulb-nl
5084751906 Rework cartridge bus & add open bus behavior (#182)
Fix freezes in Tokyo Disneyland - Fantasy Tour (Minnie's house) &
Daiku no Gen-san - Kachikachi no Tonkachi ga Kachi (Stage 1-4)
2021-10-24 23:25:21 +08:00
paulb-nl
894b7aea8d Fix nCS signal (Super Mario Land 2) (#179) 2021-10-01 22:23:58 +08:00
paulb-nl
5f0bf9dd3a Add Sachen mapper 2021-09-08 17:06:10 +02:00