SWI flag preservation

Discuss development specific to the Pi version of ADFFS
Post Reply
JonAbbott
Posts: 1739
Joined: Thu Apr 11, 2013 12:13 pm
Location: Essex

SWI flag preservation

Post by JonAbbott » Fri Aug 12, 2016 5:02 pm

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.

Post Reply