aboutsummaryrefslogtreecommitdiffstats
path: root/src/gb.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* gb: boot ROM (BIOS) supportgbc dev2026-07-171-7/+56
| | | | | | | | | Add optional boot ROM emulation. When a boot ROM image is loaded, gb_reset starts execution at PC=0 with power-on register state instead of the documented post-boot state; the ROM overlays low memory (with the CGB 0x0100-0x01FF header hole showing the cartridge through) until the game writes 0xFF50 to hand off. gb_load_bootrom() accepts 256-byte (DMG) or 2304-byte (CGB) images.
* main/gb: --keys button-script harness + serial_no_eof for OSK testinggbc dev2026-07-161-3/+5
| | | | | | | | --keys "udlrabse." plays scripted joypad taps (each char = one button held 10 frames then released 10, so the guest sees a clean edge); pairs with --headless --shot to drive on-screen input and capture the result. When --keys is active, serial-RX EOF stays pending instead of sending $04, so a shell blocked on read waits for OSK input instead of exiting.
* serial: deliver EOF (0x04) on stdin end for headless consolegbc dev2026-07-161-1/+7
| | | | | | read()==0 completes the external-clock transfer with SB=0x04 (EOT), so a gbos program's readc() sees EOF instead of polling forever. Enables cat/wc-style tools and lets the shell exit on Ctrl-D / pipe end.
* serial: clean RX path for headless consolegbc dev2026-07-161-8/+14
| | | | | | - external-clock transfers (SC=$80) deliver a stdin byte into SB without echoing to stdout, and stay pending when no input is available -> programs can poll for input cleanly. internal-clock (SC=$81) stays pure TX.
* serial: headless mode tying serial port to stdio for OS debugginggbc dev2026-07-151-3/+18
| | | | | | | | - --headless: no rendering/TUI; serial TX -> stdout, RX <- stdin (nonblocking) - generalize serial: serial_out_fd/serial_in_fd on the GB; internal-clock transfer now shifts in a real RX byte (from stdin) instead of always 0xFF - paced to native speed by default, --uncapped for turbo; pipes/scripts cleanly - README: document headless serial console
* apu: register-level emulation of 0xFF10-0xFF3F (fixes music fades)gbc dev2026-07-151-2/+14
| | | | | | | | | The APU was a black hole: reads returned 0xFF, writes were dropped. That hangs any game that fades music out by decrementing the NR50/rAUDVOL volume register until it reads 0 (Pokemon's StopMusic spin-wait) - the write never stuck, the read never hit 0, infinite loop. Store the 48 sound registers and return them with the standard hardware read-back OR-masks (NR50 mask 0x00 = exact readback). No synthesis, just correct register behavior.
* core emulator: SM83 CPU, MMU, timer, PPU, CGB supportgbc dev2026-07-041-0/+201
Passes blargg cpu_instrs (all 11), instr_timing, mem_timing.