log in | register | forums
Show:
Go:
Forums
Username:

Password:

User accounts
Register new account
Forgot password
Forum stats
List of members
Search the forums

Advanced search
Recent discussions
- !OBrowse reviewed (News:10)
- Aemulor (Gen:16)
- DDE reaches release 28 and above (News:)
- Elesar quicks dispels stormy clouds (News:2)
- RISC OS London Show 2017 - Notes from the talks (News:2)
- RISC OS London Show 2017 (News:)
- RISC OS London Show 2017 - Pictures (News:)
- October News (News:2)
- Retrospective thoughts on 12 months of Titanium ownership (News:4)
- RISC OS London Show 2017 (News:1)
Latest postings RSS Feeds
RSS 2.0 | 1.0 | 0.9
Atom 0.3
Misc RDF | CDF
Site Search
 
Article archives
Acorn Arcade forums: Programming: Some OS_Byte corrupt flags
 
  Some OS_Byte corrupt flags
  sirbod (23:45 27/8/2015)
 
Jon Abbott Message #123709, posted by sirbod at 23:45, 27/8/2015
Member
Posts: 563
Whilst trying to track down why some games corrupt the screen, I finally tracked it down to reliance on a bug in RISCOS:

OS_Byte 19 always clears C

The PRM doesn't mention C, so I believe it should be preserved across the SWI.

I've confirmed C is always cleared on Arthur, RO2, RO3.11, RO3.71 and RO5 RC14 (which is obviously allowed) and I suspect it's cleared on all RO versions.

Z and N flags are preserved.

This got me wondering if this was a wider issue with OS_Byte, so I started testing all OS_Byte on RO3.11:

0..4 - clear C
5 - sets C
6..19 - clear C (Cascade relies on this behaviour for 19)
20 - sets C
21 - clears C
25 - sets C
70..71 - set C
106..117 - clears C
118..120 - set C
121 - clears C
122 - set C
124..128 - clears C
129,0,255 - clears C
129,1,0 - sets C
129,128,255 - clears C
134..135 - set C

EDIT: I'm not going to test any further, it looks like C isn't preserved across OS_Byte - unless I missed that in the PRM, I'm guessing it's a bug, possibly introduced due to OS_Byte 138, 145, 152 and 153 needing to alter C

EDIT2: For the purposes of ADFFS, I think I'll preserve C across all OS_Byte except for 138, 145, 152 and 153 and forcibly clear C across 19 to match pre-RO5 - which is the root cause of the problem I'm seeing in some games.

[Edited by sirbod at 16:21, 16/11/2016]
  ^[ Log in to reply ]
 

Acorn Arcade forums: Programming: Some OS_Byte corrupt flags