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
- I want to digitise some A3010 software - ONLY COPY (Gen:5)
- RISC OS ports website (News:5)
- For Swaps/Trade Acorn User/Archi World Magazine Collection (Gen:5)
- More Acorn Magazine nostalgia (News:)
- RISC OS London Show 2018 (News:)
- NetSurf or Iconbar? (Site:3)
- September News round-up (News:)
- DDE tools updated to DDE28c (News:)
- Orpheus hits crowdfunding target (News:2)
- Orpheus launch crowdfunding campaign (News:5)
Latest postings RSS Feeds
RSS 2.0 | 1.0 | 0.9
Atom 0.3
Misc RDF | CDF
Site Search
 
Article archives
The Icon Bar: Programming: Some OS_Byte corrupt flags
 
  Some OS_Byte corrupt flags
  sirbod (00:45 28/8/2015)
 
Jon Abbott Message #123709, posted by sirbod at 00:45, 28/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 ]
 

The Icon Bar: Programming: Some OS_Byte corrupt flags