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
- Elsear brings super-fast Networking to Risc PC/A7000/A7000+ (News:)
- Latest hardware upgrade from RISCOSbits (News:)
- Code GCC produces that makes you cry #12684 (Prog:39)
- Rougol November 2024 meeting on monday (News:)
- Announcing the TIB 2024 Advent Calendar (News:)
- Drag'n'Drop 14i1 edition reviewed (News:)
- WROCC November 2024 talk o...ay - Andrew Rawnsley (ROD) (News:2)
- October 2024 News Summary (News:3)
- RISC OS London Show Report 2024 (News:1)
- RISC OS London Show 2024 - pictures (News:2)
Latest postings RSS Feeds
RSS 2.0 | 1.0 | 0.9
Atom 0.3
Misc RDF | CDF
 
View on Mastodon
@www.iconbar.com@rss-parrot.net
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