[Rpcemu] PATCH: Implement OS_Reset "0x0ff"

Reuben Thomas rrt at sc3d.org
Wed Oct 31 09:49:13 PDT 2018


On Wed, 31 Oct 2018 at 11:49, Ralph Corderoy <ralph at inputplus.co.uk> wrote:

> Hi Reuben,
>
> Couple of minor comments.
>
> > +     /* Intercept OS_Reset to check for turning off
> > +        https://www.riscosopen.org/wiki/documentation/show/OS_Reset
> > +     */
> > +     if (swinum == SWI_OS_Reset) {
> > +             if (arm.reg[0] == 0x46464F26) { /* 0x0ff */
>
> It's "&0ff", not 0x0ff.
>

Thanks (corrected to "&OFF"; a case where the code lagged behind the
comment). Indeed, the online documentation at
https://www.riscosopen.org/wiki/documentation/show/OS_Reset has the right
hex but the wrong ASCII.


> Use `else if' as the previous if being true might not result in the
> exit().
>

Fixed. Arguably the whole opSWI function would benefit from switching on
swinum and only then applying other conditions; the logic is a little
tortuous at the moment.

New version attached.

-- 
https://rrt.sc3d.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.riscos.info/pipermail/rpcemu/attachments/20181031/78f441eb/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: os_reset.patch
Type: text/x-patch
Size: 1112 bytes
Desc: not available
URL: <http://www.riscos.info/pipermail/rpcemu/attachments/20181031/78f441eb/attachment.bin>


More information about the RPCEmu mailing list