Skip to content

[Dark Cloud 2] Broken DMA GIF IMAGE transfer #123

@tealalchemist

Description

@tealalchemist

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingrunime

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions