Demo ROM which demonstrates this: dizworld.sfc before vs. dizworld.sfc after
Code: Select all
.a16
.i16
sta a:$4202 ; WRMPYA = z (spurious write to $4303)
nop ; needed because writing $4303 again too fast will cause an erroneous result
ldx z:pv_scale+0
stx a:$4203 ; WRMPYB = scale a (spurious write to $4304)
There is also an old comment from Near explaining that trying to multiply with a divide in flight causes a bad result that isn't emulated by anything. I guess the same goes for a multiply during a multiply.
Also, thanks to Undisbeliever for helping me figure this out.
Edit: added hardware capture screenshots of what it looks like on boot, also fixed ROM links.
Before the nop was added: After the nop was added: Probably we should write a test ROM to investigate this and spit out the results, but for now this ROM is a quick litmus test that indicates something not emulated.
In the screenshot taken, it looks as if the mode 7 A coefficient result is getting all 0s instead of whatever the intended scale was. If you move around there's a lot of variety to the results, hard to describe. It might be something like $4203 only starts if ready and otherwise we're just changing the operand halfway through the computation.