FPGA GBA cart

Discussion of programming and development for the original Game Boy and Game Boy Color.
Post Reply
User avatar
uXe
Posts: 27
Joined: Sun Nov 25, 2012 5:28 am
Location: Adelaide, Australia

FPGA GBA cart

Post by uXe » Tue Feb 05, 2019 3:22 am

I'm attempting an FPGA implementation for a basic GBA cart - have gotten as far as the Nintendo logo almost working but becoming garbled towards the end... does this look indicative of something in particular?
IMG_20190205_1824026.jpg
Wondering if it may have something to do with this (from http://problemkaputt.de/gbatek.htm#gbacartridges):
"09Eh Bit 0,1 - Cartridge Key Number MSBs
This is part of the above Nintendo Logo area, and must be commonly set to F8h, however, Bit 0-1 may be set to other values.
During startup, the BIOS performs some dummy-reads from a stream of pre-defined addresses, even though these reads seem to be meaningless, they might be intended to unlock a read-protection inside of commercial cartridge. There are 16 pre-defined address streams - selected by a 4bit key number - of which the upper two bits are gained from 800009Eh Bit 0-1, and the lower two bits from a checksum across header bytes 09Dh..0B7h (bytewise XORed, divided by 40h)."
What are these pre-defined addresses? and what data is expected in return?

Thanks for any insights! :)

User avatar
uXe
Posts: 27
Joined: Sun Nov 25, 2012 5:28 am
Location: Adelaide, Australia

Re: FPGA GBA cart

Post by uXe » Wed Feb 06, 2019 6:27 am

OK... managed to progress past this - the Nintendo® logo appears fine (just needed to tweak the code to ignore RD when CS is not low - hadn't even occurred to me RD would toggle regardless of CS!), next problem is, logo fades away to a white screen, and then nothing.

Some Google searches mentioned something about Flash memory settings causing a white screen like this in emulators - is the GBA looking for some response from Flash before it will continue? are there some registers I can set to remedy this? :?

User avatar
uXe
Posts: 27
Joined: Sun Nov 25, 2012 5:28 am
Location: Adelaide, Australia

Re: FPGA GBA cart

Post by uXe » Wed Feb 06, 2019 7:58 pm

Still poking around in the dark on this... have tried coming at it from a few different angles, but there is something happening at the point the logo fades away and the game should start that I am missing?! Need something I can step through that outlines the sequence of events at startup? :cry:

User avatar
uXe
Posts: 27
Joined: Sun Nov 25, 2012 5:28 am
Location: Adelaide, Australia

Re: FPGA GBA cart

Post by uXe » Sun Feb 10, 2019 4:12 am

After several painful days I have thoroughly learned a valuable lesson: "Don't do asynchronous edge detection, ever. Remember: Keep It Synchronous, Stupid." (from https://www.doulos.com/knowhow/fpga/synchronisation/)

Here is the latest verilog - would be eternally grateful for any optimisations that could be found? (there's still a lot I want to add in, but seems like it is right at the breaking point with just what is there now)

https://github.com/uXeBoy/GBA

https://www.youtube.com/watch?v=IXGc9o0PByI

User avatar
Reed Solomon
Posts: 7
Joined: Wed Dec 01, 2010 9:43 pm

Re: FPGA GBA cart

Post by Reed Solomon » Mon Feb 11, 2019 10:47 am

There's an FPGA GBA core that doesn't quite work yet but maybe there's enough there to give you some ideas?

Post Reply