Dark Cloud 2 has a function mgLoadTextureZ__FiP8TM2_head
The purpose of this function is to upload 4HH and 4HL font sheets into the upper 8 bits of the z buffer
However the game has a bug, it incorrectly calculates the size of the transfer
Because 4HH/4HL are measured in pixels per byte, the correct calculation is something like:
(width * height) / 2 / 16
But the game calculates
(width * height * bpp) / 16
This causes a transfer that is 8x it's actual size and thus the DMAC to run off the end of the stack
This seems to work on real hw/emulation but the current runtime seems to give up the transfer after the first GIF IMAGE instead.
Dark Cloud 2 has a function
mgLoadTextureZ__FiP8TM2_headThe purpose of this function is to upload 4HH and 4HL font sheets into the upper 8 bits of the z buffer
However the game has a bug, it incorrectly calculates the size of the transfer
Because 4HH/4HL are measured in pixels per byte, the correct calculation is something like:
(width * height) / 2 / 16But the game calculates
(width * height * bpp) / 16This causes a transfer that is 8x it's actual size and thus the DMAC to run off the end of the stack
This seems to work on real hw/emulation but the current runtime seems to give up the transfer after the first GIF IMAGE instead.