Page 1 of 1

SWI flag preservation

Posted: Fri Aug 12, 2016 5:02 pm
by JonAbbott
Although SWI flag preservation is implemented for OS and OS extension SWI's (refer to the bottom of the JIT Phase 3 post), there's currently no flag preservation for 3rd party and User Modules (ie bit 19 set on the SWI instruction).

This hasn't appeared to be a problem to date, until I debugged Silverball and discovered it's reliant on flag preservation across it's 3rd party Module SWI's.

Implementing flag preservation for these Modules however isn't straightforward as the flag corruption is occurring between the Module exiting and the SWI dispatch exiting. Simply preserving flags across SWI dispatch (as was implemented for OS SWI's) has it's own problems in that any Modules which purposely return flags then wouldn't work - I'll implement it this way, until I can figure out how to preserve flags properly. Hopefully it doesn't break any games.