Chilly Willy wrote: ↑Tue Jan 31, 2023 10:14 pm
The frame buffer always writes the data to the dram, except when a single byte of 0x00 is written. Byte writes of 0x00 are ignored. So in a sense, the plain frame buffer is an overwrite buffer when considered at a byte level. To clear the frame buffer, you have to write WORDS of 0x0000 instead of bytes of 0x00.
The overwrite buffer is like the frame buffer, but ignores all bytes of 0x00, even if written as a word. So writing 0xNN00 writes the NN, but ignores the 00. Likewise, 0x00NN ignores the 00 and writes the NN. 0x0000 means the entire word write is ignored. So the overwrite buffer is a true overwrite buffer.
The purpose of an overwrite buffer is to have transparent areas of the sprite not draw into the frame buffer. If you copy the sprite using byte writes, either the frame buffer or the overwrite buffer can be used as they will act the same. If you copy the sprite using words for better performance, 0 bytes WILL be written, not leaving transparent areas in the sprite. For sprite drawing with words, use the overwrite buffer to get transparent areas, even with word writes.
Thanks Chilly! I'm still going to wrestle with this to learn more. Maybe this is a dumb question but where can I find resources for learning how to program for the SH2 and or in general the 32x? I'm thinking for assembly mainly i guess, since assembly can be different with each processor. Some of the links that used to be the "golden sources" are no longer available.
I'm also still wrapping my head around bit operations in general. In reviewing Vic's Tilemapper project in his description he mentioned he uses bit shifting for smoother scrolling. And i'm thinking, how does that work!? And why is that better than say each tick increment x/y coordinates by specified amount.
Now as for updates on my progress
1) Distilled version of the latest/greatest toolchain from D32xr code base - CHECK
2) Sprite Drawing functions that are not tied to Doom - CHECK
3) Ability to pull bitmap and palette data from a single .bmp - CHECK
4) Sound and Music working - CHECK
5) Knowledge of how to create Sound and Music formats that work with the toolchain - CHECK
6) Yatssd integrated into project - CHECK
7) Sprite placement within the map/world even when camera isn't at that location - CHECK
Basic AI - CHECK
9) Printing text for dialogs/menus/etc - CHECK (This seemed to be more challenging than i thought! Had to use Yatssd Hw32 Initilization before Text would even show up. Couldn't really use Doom method since it seemed pretty tethered to the Doom rom)
What's next?
1) More cleaning up to do
2) Build animated sprite functionality
3) Build out collision detection
4) Build out framework for game workflow (Game Start, Start/Options menu, Play, In Game Menus, Map transitions, Map to Battle and Battle to Map transitions, Story line, etc)
Hoping at that point I'll have a nice framework that: A) I can share with the community to tinker with. B) Start building my game from