lgblgblgb / xemu

Emulations (running on Linux/Unix/Windows/macOS, utilizing SDL2) of some - mainly - 8 bit machines, including the Commodore LCD, Commodore 65, and the MEGA65 as well.
https://github.com/lgblgblgb/xemu/wiki
GNU General Public License v2.0
208 stars 32 forks source link

MEGA65: VIC-IV raster IRQs do not work in V400 mode #283

Closed lgblgblgb closed 3 years ago

lgblgblgb commented 3 years ago

Raster IRQs seem not work in V400 mode. The problem may be related to the incomplete/bad implementation of testing raster for interrupt condition which operates for "logical raster" and such. Affected examples:

lgblgblgb commented 3 years ago

The commit above maybe very bad fix, but at least it cures the problem at the first sight. Clearly, this raster compare thingy should be cleaned-up (also IIRC, MEGA65 has a bit for using precise or "normal" rasters which is not implemented, I guess).

lgblgblgb commented 3 years ago

@hernandp What's your opinion about this "fix"? ;)

Basically it was just change if (!(ycounter & 1)) to if (!(ycounter & 1) || EFFECTIVE_V400). But in any way (maybe not the scope in this issue ...) this should be rethought in my opinion, like there is a way to use "native" and "legacy" rasters for comparing on MEGA65 (IIRC ...). Surely there can be other issues as well. My awkward fix is more about to have raster IRQs in V400 mode at all, it's not that it's also precise where it happens, etc ;)

hernandp commented 3 years ago

Cool. I approve this 100% : check interrupts on every raster (physical == logical in V400).
But as you say maybe we can rethink of a better approach looking at the raster comparison registers of the MEGA65.

lgblgblgb commented 3 years ago

OK. I think I close this issue for now, any further plan of this would require more drastic change(s) than a few character worth of actual patch.