FPGA GBA cart

This is an archive of a topic from NESdev BBS, taken in mid-October 2019 before a server upgrade.
View original topic
FPGA GBA cart
by on (#233695)
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?

Attachment:
IMG_20190205_1824026.jpg
IMG_20190205_1824026.jpg [ 2.79 MiB | Viewed 4629 times ]


Wondering if it may have something to do with this (from http://problemkaputt.de/gbatek.htm#gbacartridges):

Quote:
"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! :)
Re: FPGA GBA cart
by on (#233776)
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? :?
Re: FPGA GBA cart
by on (#233842)
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:
Re: FPGA GBA cart
by on (#234011)
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
Re: FPGA GBA cart
by on (#234121)
There's an FPGA GBA core that doesn't quite work yet but maybe there's enough there to give you some ideas?