mirror of
https://github.com/holub/mame
synced 2025-05-24 23:05:32 +03:00
![]() Sent: Fri 9/26/2008 10:15 AM To: submit@mamedev.org Cc: Philip Bennett Subject: fix for Cube Quest Line CPU emulation I found a bug in the emulation of the Cube Quest Line CPU. Proof of bug: After looking at .diff, Assume 'ci' is 1, and assume 'r' and 's' are both 0xFFF (0xFFF equals -1, as these numbers are 12-bit signed). The result should be mathematically equivalent to -1 - (-1) which is 0. ~0xFFF is 0xF000, so you'd have 0xF000 + 0x0FFF + 1 which equals 0x10000 but since 'res' is 16-bits this is truncated to 0x0. 'C' then becomes 0 and 'V' becomes 1 (as I recall). The result of 0 is correct, but the flags are wrong; V should be 0 and C should be 1. Under my proposed fix, you'd have 0x000 + 0x0FFF + 1, which equals 0x1000, so the lower 12 bits are 0 (correct) and C is 1 and V is 0 (correct). I discovered this bug while disassembling the line CPU's ROM. |
||
---|---|---|
docs | ||
src | ||
.gitattributes | ||
makefile |