-
Current Progress & Future PLans
03/28/2017 at 12:48 • 0 commentsSo whilst I am awaiting the first real PCB revision from OSH Park I thought I would take the time to elaborate a little on how the project is going & speculate on what features the end result might have...
How's it going?
Not to bad really, emulation speed now peaks at about 5.5 FPS this was achieved by switching out the digitalWriteFast calls with direct port manipulation this has allowed ~1us random read and write SRAM operations and ~800ns sequential reads and writes. The SRAM is capable of much fast though at ~20ns for both reads and writes. The limiting factor seems to be the number of port operations that need to be done to to achieve either a read or a write. I'm hoping to reduce this number by shuffling the pins around to allow more of the address and data lines to share common ports.
ROM's now start and play correctly, well that's a bit of an exaggeration I've only actually testing Mario Kart successfully I have also tried Pokemon emerald but that ROM gets the emulated CPU stuck in a loop for some reason? Randomly reading bytes from a file on an SD card is proving painfully slow and is crippling emulation speed so some sort of flash buffer seems to be in order something along the lines of:
1) Select the game.
2) Copy game to flash
3) Start emulation from the flash not the SD Card.
User buttons are now implemented and working correctly I was able to navigate the menus in Mario Kart without issue. Unfortunately I cant continue the sound implementation until the new PCB's turn up.
Future features:
I would really like add gameboy colour compatibility as in my mind part for what makes a gameboy advance a gameboy advance is the backward compatibility with the gameboy color games.
I suspect I will run out of IO before hand but I would like add a cartridge connector so the emulator can play games directly from original cartridges this also has the nice benefit of allowing the emulator to copy original cartridges to the SD Cart to play later.
Cheat menu in the on screen display maybe?
If anyone has any suggestions on features please feel free to leave a comment.
-
Shift Register Failure
03/17/2017 at 22:49 • 0 commentsThe Problems:
So after assembling the SRAM PCB I was greeted with a multitude of problems ranging from bad jumper wire connections to shift register voltage sag. Once I had shortened all the wires and replaced the pin headers with soldered joints I did manage to get a single run through of the bios but my relief was short lived.. I'm not sure exactly what the issue with the shift registers is but after the first run the memory checks failed every time at semi-random locations in memory, after some poking around with the oscilloscope I found that one or two of the address lines that where supposed to be logic high (roughly VCC) where in fact struggling to manages 1/3 of VCC roughly 1V out of 3V3 this seems to be related to higher than expected current draw on certain address lines at any given address.... weird as this information appears to be non existent in the data sheet and I apparently wrongly assumed the address lines would be of a constant high impedance, sort of like an op-amp but no such luck.
The Solution (kinda)
Shift registers desoldered and slung back in the parts draw with a reluctant shrug I decided to try connecting the address lines directly to the Teensy, not ideal as this uses up a lot of the IO but I needed a sanity check. Result!! worked a charm first time and every time after, I have now tweaked the code a little to gain a little extra speed and the result of my labours is a peak FPS of 4.5 as apposed the 0.01 of the SD card page file. There is still some gains to be had by using direct port manipulation and combining multiple digitalWriteFast calls on a port into a single port update but that is for another day.