Skip to content

Latest commit

 

History

History
82 lines (81 loc) · 3.91 KB

TODO.md

File metadata and controls

82 lines (81 loc) · 3.91 KB

TODO

  • Implement a basic ROM loader
  • Get familiar with the GBC architecture
  • Work on basic CPU emulation
  • Get basic GUI up and running
  • Work on I/O emulation
  • Figure out which data to render to GUI
  • Debug the bad BG rendering using BGB as a comparison
  • Look into bad instruction in CPU test
    • Use BGB to compare the flow
  • Look into inconsistent rendering
  • Migrate to software rendering
  • Move debugger into CPU
    • Wrap all memory operations to be able to break on reads/writes in debugger
    • Not possible: we would not be able to pass the Cpu into the Debugger
  • Implement timer
  • Individual tests that are failing: 1-4, 11
    • Test 1
    • Test 2
      • Fix: Implement CPU timer
    • Test 3
      • Fix: 16-bit SP/HL imm8 instructions use 8-bit carry and half-carry rules
    • Test 4
      • Fix: faulty half-carry logic for ADC and SBC
    • Test 9
      • Fix 1: Flags not updated for CPL, CCF, and SCF
      • Fix 2: Added the rotate A (non-CB) instruction variants
    • Test 11
      • Fix 1: SWAP (HL) was reading from SP
      • Fix 2: DAA (above)
  • Narrow down bug with instr_timing test
    • Break at 0xC352
    • ret at 0xC355 is never hit -- somewhere in between, the ROM is reset (?)
    • Fix: turned out that the size for LdMemCA was incorrect...
  • Get regular OAM DMA working
  • Basic window rendering
  • Get sprite rendering working
    • Find good test ROM (Dr. Mario and Tetris)
  • Fix sprite overlap rendering
    • Get the first 10 sprites in the line
      • CGB: in OAM order
      • DMG: in x-pos order
    • Map these into sprite objects for simpler manipulation (?)
    • Pass the list of sprites to each sprite pixel fetch call
    • If pixel has color index 0, try the next sprite in priority order
  • Buffer up serial writes and expose as API on Gameboy
    • This way, we can run tests in-line w/o calling into the CLI
  • Add option to load boot ROM (cartridge must be present)
  • Resizeable and scalable window
  • Fix partial sprite rendering at boundaries
    • For example, in Kirby, moving Kirby to the top of the screen leads to it disappearing partially
  • Get OAM HDMA working
  • Get MBC5 controller working
  • Implement HDMA
  • Speed change might need to be handled explicitly
  • Save state support
    • CPU: serialize as-is w/ register file
    • Memory: serialize as-is
    • Controller: serialize everything except the ROM and cartridge RAM
      • Load the ROM from the cartridge
      • If the cartridge has battery-backed RAM, create the backing file on save state load
    • PPU: serialize as-is, including the frame buffer
    • Timer: serialize as-is
    • DMA: as-is
  • Get MBC3 controller working
  • Implement RTC logic for relevant MBCs
  • WASM build
    • Identify areas where we will need conditional compilation
    • Get a basic WASM build working for the lib
    • Simple example of emulator running in JS (no rendering)
  • FPS counter
    • Static linking SDL2 TTF library does not seem to work on Windows
    • Find an alternative approach
  • Split instruction handling into steps and allow all other peripherals to advance (interrupts, timer, PPU, sound, etc.)
    • For example, if the arg. is in memory, fetch the arg and return control back to the core Gameboy loop. On next CPU step, execute the instruction.
  • Add basic logging throughout
  • Get correct serial timing for interrupt handling
  • Implement pixel FIFO