taylus / gbdotnet

An incomplete Game Boy emulator written in .NET Core
4 stars 0 forks source link

Implement boot ROM #13

Closed taylus closed 4 years ago

taylus commented 4 years ago

Initializes stack, I/O devices, and scrolls the Nintendo logo on the screen + plays the "ding" sound.

Is this necessary? I don't think bgb does it (ROMs don't do the Nintendo scroll startup thingy). For legal reasons maybe? Emulators don't need to do all of this stuff (e.g. checking for the Nintendo logo on the cart, checking headers/checksum, etc), but it would be cool to see the scrolling Nintendo logo.

https://gist.github.com/drhelius/6063288

http://bgb.bircd.org/pandocs.htm#powerupsequence

https://knight.sc/reverse%20engineering/2018/11/19/game-boy-boot-sequence.html

I would recommend actually using the boot-rom to start debugging your CPU as it's quite simple, self-contained and very well documented, so if you can execute the boot-rom correctly then that means your implementation for a number of instructions is probably correct.

https://www.reddit.com/r/EmuDev/comments/ar6t44/how_does_gameboy_rom_work/egl71eh/

It sounds like if you use the boot ROM then you start execution at $0000 and run it, then once it's done running you remove it from the Game Boy's memory map so all of the ROM's bank 0 is exposed. If you don't run the boot ROM, then you have to set up some registers like the SP yourself (the same way the boot ROM does) and start executing the game ROM at $0100.

taylus commented 4 years ago

This was implemented in #26 https://github.com/taylus/gbdotnet/blob/a4a0ddb6a1faeac8e3bbc7604fb9cffd4dac7e09/GBDotNet.Core/Memory/MemoryBus.cs#L39-L57

boot_rom_logo_scroll