Closed Lana-chan closed 1 year ago
Better late than never I guess? I noticed that the framerate tanks when the camera is on. Maybe something could be done about that later. Still, it more than gets the job done. Thanks!
I'll refrain from merging the v0.5-hotfix version, as that's supposed to be, well, stable. If I make any new releases it would probably be based on the master branch anyway.
the slowness may be because of a delay i had to introduce while the camera is being polled:
i tried doing it other ways such as keeping the buffer and not polling the camera while i couldn't instead, so that the rest of the code could run, but in doing so it introduced a lot more instability and crashes. there might be ways to mitigate both the need for the delay and keep it stable, but i haven't found it.
i don't know much about the DSi hardware, i just know how to plug different pieces of code together :)
I see. Perhaps the camera could be configured to capture at a lower resolution so the DMA copy won't take so long. But there's very little documentation on how the hardware actually works so :shrug:
Ah, here we go: https://problemkaputt.de/gbatek.htm#dsicameras
And in arm7/source/aptina.c, tweaking MODE_OUTPUT_WIDTH_A and MODE_OUTPUT_HEIGHT_A might be the way to limit the size of the picture so that the DMA transfer can be done quickly.
I'm not going to actually do that right now, just noting it down for future reference. =)
originally PR #195, github closed that one because i moved my branches downstream
see also #196 for same functionality on the stable v0.5.2 branch
"it works, mostly!"™
very dirty hack, mostly based off: https://gbdev.io/pandocs/Gameboy_Camera.html https://github.com/Epicpkmn11/dsi-camera/ https://github.com/mgba-emu/mgba/blob/master/src/gb/mbc/pocket-cam.c