Closed HerrZatacke closed 4 years ago
Just created a working WIP rewrite in https://github.com/mofosyne/arduino-gameboy-printer-emulator/commit/516f0e5319e6044c25b4b92c8812aa1feaf8b38d you might find it interesting to read and maybe suggest anything else I can do to make it easier for you to use.
It's still under work, but key point is:
Other arch difference:
(1<<x)
, I use a sliding bitmask, which is hopefully more efficient.Other consideration:
650B*2
a pop, its not a good use of space.V2 now completed and merged to master.
Speed up transfer - print wait time reduced
Allow other operations to happen "during" print - circular buffer and stripped down ISR done
Get Other games except the camera working as well - more game supported now
Hi there, As promised, here my thoughts/questions regarding a few optimizations:
Speed up transfer
As this project seems to do it, the actual transfer period (not the fake waiting time) is almost double as fast, which I do not really understand why.
Allow other operations to happen "during" print
Is it possible to have code being executed in the
loop()
function for a longer period e.g. saving lot of data to flash or updating an attached display without causing the GameBoy to go to showError #2
. So:Serial.print()
it and during that period keep the GameBoy "waiting" until the printer is ready again.As far as I understand, the internal RAM of an Arduino is even too small to store one image (2Kb vs 6Kb required), so the "flushing" would need to happen multiple times during receiving one image (if that's even possible)?
Just another thought... would it be possible to send a "busy" signal to the GameBoy by just using some additional "electronic" parts? Where you would "turn on" an additional circuit that responds to the GameBoy's "inquiry" commands while the Arduino is busy?
Get Other games except the camera working as well.
Maybe the issue has to do with compression? I found a description of the algorithm here. Here is is also mentioned that Pokemon uses said compression.