Difference between revisions of "OSBYTE &A3"

From BeebWiki
Jump to: navigation, search
(Added font control.)
 
(17 intermediate revisions by 3 users not shown)
Line 1: Line 1:
 
[[Category:OSBYTE]]
 
[[Category:OSBYTE]]
===OSBYTE &A3 (163) - Application support===
+
{{PageTitle|OSBYTE &A3 (163) - Application support}}__TOC__
 
   On entry:
 
   On entry:
 
     X = application identifier
 
     X = application identifier
         X=128 Electron Plus 1
+
         X=128     Electron Plus 1
         X=242 Graphics Extension Support
+
        X=129-135 Font control
         X=243 65Tube
+
        X=192    Acornsoft Pascal
         X=255 VIEW
+
        X=241    Acornsoft LOGO
 +
         X=242     Graphics Extension Support
 +
         X=243     65Tube
 +
        X=253    Cause a reset
 +
        X=254    unknown
 +
         X=255     Acornsoft View family
 
     Y = parameter
 
     Y = parameter
 
   On exit:
 
   On exit:
Line 12: Line 17:
 
     Y = return value
 
     Y = return value
  
===X=128 Plus 1 Support===
+
==X=&80 (128) Plus 1 Support==
 
   On entry:
 
   On entry:
 
     Y=0 enable printer/ADC
 
     Y=0 enable printer/ADC
Line 25: Line 30:
 
       X=default language in X, b7 set if no default language
 
       X=default language in X, b7 set if no default language
  
===X=242 Graphics Extension Support (GSX, RISC OS)===
+
==X=&81 to &87 (129 to 135) Font control (OS 1.50)==
 +
  On entry:
 +
  X=&80+font number (1 to 7, i.e. char codes DIV 32)
 +
    Y=0 set font page soft (RAM)
 +
    Y=1 set font page hard (ROM)
 +
    Y=2 copy current page to RAM (no effect if soft)
 +
    Y=3 copy ROM page to RAM
 +
    Y>3 set font page soft and RAM page number to Y
 +
    Y=??? set font uses SROM bank
 +
  On exit:
 +
    X,Y preserved
 +
 
 +
==X=&C0 (192) Acornsoft Pascal==
 +
  On entry:
 +
    Y=0    enter language ROM of twin ROM set
 +
    Y=1
 +
    Y=2
 +
    Y=3
 +
 
 +
Acornsoft Pascal is supplied as two 16K ROMs, one is the language code, and
 +
the other is support code, including the *Command parser. When the *PASCAL
 +
command is matched, or if the support code is entered as a language it,
 +
issues OSBYTE 163,192,0 to cause the other ROM to start itself.
 +
 
 +
==X=&F1 (241) Acornsoft LOGO==
 +
  On entry:
 +
    Y=0    enter language ROM of twin ROM set
 +
    Y=1
 +
    Y=2
 +
    Y=3
 +
    Y=4
 +
 
 +
Acornsoft LOGO is supplied as two 16K ROMs, one is the language code, and
 +
the other is support code, including the *Command parser. When the *LOGO
 +
command is matched, or if the support code is entered as a language it,
 +
issues OSBYTE 163,241,0 to cause the other ROM to start itself.
 +
 
 +
==X=&F2 (242) Graphics Extension Support (GSX, RISC OS)==
 
   On entry:
 
   On entry:
 
     Y=0    resets the dot-dash pattern and length to defaults
 
     Y=0    resets the dot-dash pattern and length to defaults
Line 32: Line 74:
 
     Y=65    return status returns
 
     Y=65    return status returns
 
   On exit:
 
   On exit:
 +
    if X=Y=0 then the ROM is fitted but disabled
 
     X=b0..5 current dot dash pattern repeat length (0 means 64)
 
     X=b0..5 current dot dash pattern repeat length (0 means 64)
       b6    if set flood fill is always active
+
       b6    if set flood fill is turned on
 
       b7    if set GXR ROM is turned on
 
       b7    if set GXR ROM is turned on
 
     Y=number of pages allocated to sprites
 
     Y=number of pages allocated to sprites
 
   On entry:
 
   On entry:
     Y=66    return info on current sprite returns
+
     Y=66    return info on currently selected sprite
 
   On exit:
 
   On exit:
 +
    if X=Y=0 then the ROM is fitted but disabled, or no sprite is selected
 
     X=pixel width  
 
     X=pixel width  
 
     Y=pixel height
 
     Y=pixel height
    if X=Y=0 then the ROM is not fitted, or no sprite is selected
 
  
===X=243 65Tube emulator===
+
If the GXR ROM is absent, the call returns X=&FF and Y preserved. A call to OSBYTE &A3,242,65
 +
can determine if GSX is absent, present but disabled, or present and enabled:
 +
 
 +
  On entry: A=&A3, X=242, Y=65
 +
  On exit:  Y=65 - GSX ROM absent (Y preserved if ROM is absent)
 +
            Y<64 - GSX ROM is present (not possible to have more
 +
                  than 64 pages of workspace)
 +
                  X.b7=0 - GSX ROM disabled
 +
                  X.b7=1 - GSX ROM enabled
 +
 
 +
==X=&F3 (243) 65Tube emulator==
 
   On entry:
 
   On entry:
 
     Y=4    find code address
 
     Y=4    find code address
Line 55: Line 108:
 
     Called on Tube reset to ask for any startup command.
 
     Called on Tube reset to ask for any startup command.
  
===X=255 VIEW family workspace flag===
+
==X=&FD (253) Cause a Reset==
 
   On entry:
 
   On entry:
     Y=&01  read View's ROM workspace byte at &DF0+num
+
     Y=[[OSBYTE &FD]] reset type:
    Y=&81  set View's ROM workspace byte at &DF0+num to &80
+
      0 = Soft Reset (Break)
 +
      1 = Power-On Reset
 +
      2 = Hard Reset (Ctrl-Break)
 
   On exit:
 
   On exit:
     X=View's ROM workspace byte at &DF0+num
+
     Will only exit if the call is not implemented.
 +
 
 +
  Implemented by [http://mdfs.net/Software/BBC/SROM/Tools/ RSTROM] and other ROMs.
 +
  See also [[Reset from software]].
  
 +
==X=&FE (254) Unknown==
 +
  This call is checked for by 65Tube.
 
   On entry:
 
   On entry:
     Y=&02  read ViewSheet's ROM workspace byte at &DF0+num
+
     Y=unknown
 
   On exit:
 
   On exit:
     X=ViewSheet's ROM workspace byte at &DF0+num
+
     On 65Tube, X and Y returned preserved.
  
 +
==X=&FF (255) Acornsoft View family workspace flag==
 
   On entry:
 
   On entry:
     Y=&03   read ViewStore's ROM workspace byte at &DF0+num
+
     Y<&80   read ROM's workspace byte at &DF0+romnum
     Y=&83   set ViewStore's ROM workspace byte at &DF0+num to &80
+
    Y>&7F  set bit 7 of ROM's workspace byte at &DF0+romnum
 +
   
 +
    Y=&01/&81 read/set View's ROM workspace byte
 +
     Y=&02/&82 read/set ViewSheet's ROM workspace byte
 +
    Y=&03/&83 read/set ViewStore's ROM workspace byte
 +
    Y=&04/&84 read/set ViewSpell's ROM workspace byte
 
   On exit:
 
   On exit:
     X=ViewStore's ROM workspace byte at &DF0+num
+
     X=undefined (preserved)
 +
    Y=ROM's workspace byte at &DF0+romnum
 +
   
 +
    Some versions of ViewSheet and ViewSpell do not implement the
 +
    call to set the workspace byte. On 65Tube, X and Y are returned
 +
    preserved, indicating the ROMs are not present.
 +
 
 +
The View family ROMs set their workspace byte to zero on reset, so
 +
this call normally returns &00 or &80. This allows callers to find
 +
if the View ROMs are present and perform actions such as calling them
 +
with their *Command without the risk of the command not being recognised
 +
and causing a disk access and a Bad command error.
 +
 
 +
The following code demonstrates using the calls.
 +
 
 +
  10 A%=163:X%=255
 +
  20 FOR Y%=1 TO 4
 +
  30  U%=((USR&FFF4)AND&FF0000)DIV65536
 +
  40  READ A$:PRINT A$;" ";
 +
  50  IF U%<>Y% THEN PRINT "present" ELSE PRINT "absent"
 +
  60 NEXT Y%
 +
  70 DATA VIEW,ViewSheet,ViewStore,ViewSpell
  
  On entry:
+
  A%=163:X%=255:Y%=1:IF ((USR&FFF4)AND&FF0000)DIV65536<>1 THEN *WORD
    Y=&04  read ViewSpell's ROM workspace byte at &DF0+num
 
  On exit:
 
    X=ViewSpell's ROM workspace byte at &DF0+num
 
  
 
==See Also==
 
==See Also==
 
* http://mdfs.net/Docs/Comp/BBC/Osbyte80
 
* http://mdfs.net/Docs/Comp/BBC/Osbyte80
 +
* [[Reset from software]]
  
 
[[User:Jgharston|Jgharston]] 22:16, 26 May 2009 (UTC)
 
[[User:Jgharston|Jgharston]] 22:16, 26 May 2009 (UTC)
 +
[[User:Jgharston|Jgharston]] ([[User talk:Jgharston|talk]]) 02:26, 24 November 2020 (CET)
 +
[[User:Jgharston|Jgharston]] ([[User talk:Jgharston|talk]]) 00:24, 24 November 2022 (CET)

Latest revision as of 15:23, 22 December 2023

OSBYTE &A3 (163) - Application support
 On entry:
   X = application identifier
       X=128     Electron Plus 1
       X=129-135 Font control
       X=192     Acornsoft Pascal
       X=241     Acornsoft LOGO
       X=242     Graphics Extension Support
       X=243     65Tube
       X=253     Cause a reset
       X=254     unknown
       X=255     Acornsoft View family
   Y = parameter
 On exit:
   X = return value
   Y = return value

X=&80 (128) Plus 1 Support

 On entry:
   Y=0 enable printer/ADC
   Y=1 disable printer/ADC
   Y=2 enable serial port
   Y=3 disable serial port
   Y=4 restore ROM table
 On exit:
   If Y<4 on entry,
     X=0 if enabled, X<>0 if disabled
   If Y=4 on entry,
     X=default language in X, b7 set if no default language

X=&81 to &87 (129 to 135) Font control (OS 1.50)

 On entry:
 X=&80+font number (1 to 7, i.e. char codes DIV 32)
   Y=0 set font page soft (RAM)
   Y=1 set font page hard (ROM)
   Y=2 copy current page to RAM (no effect if soft)
   Y=3 copy ROM page to RAM
   Y>3 set font page soft and RAM page number to Y
   Y=??? set font uses SROM bank
 On exit:
   X,Y preserved

X=&C0 (192) Acornsoft Pascal

 On entry:
   Y=0     enter language ROM of twin ROM set
   Y=1
   Y=2
   Y=3

Acornsoft Pascal is supplied as two 16K ROMs, one is the language code, and the other is support code, including the *Command parser. When the *PASCAL command is matched, or if the support code is entered as a language it, issues OSBYTE 163,192,0 to cause the other ROM to start itself.

 On entry:
   Y=0     enter language ROM of twin ROM set
   Y=1
   Y=2
   Y=3
   Y=4

Acornsoft LOGO is supplied as two 16K ROMs, one is the language code, and the other is support code, including the *Command parser. When the *LOGO command is matched, or if the support code is entered as a language it, issues OSBYTE 163,241,0 to cause the other ROM to start itself.

X=&F2 (242) Graphics Extension Support (GSX, RISC OS)

 On entry:
   Y=0     resets the dot-dash pattern and length to defaults
   Y=1..64 set dot dash pattern repeat length
 On entry:
   Y=65    return status returns
 On exit:
   if X=Y=0 then the ROM is fitted but disabled
   X=b0..5 current dot dash pattern repeat length (0 means 64)
     b6    if set flood fill is turned on
     b7    if set GXR ROM is turned on
   Y=number of pages allocated to sprites
 On entry:
   Y=66    return info on currently selected sprite
 On exit:
   if X=Y=0 then the ROM is fitted but disabled, or no sprite is selected
   X=pixel width 
   Y=pixel height

If the GXR ROM is absent, the call returns X=&FF and Y preserved. A call to OSBYTE &A3,242,65 can determine if GSX is absent, present but disabled, or present and enabled:

 On entry: A=&A3, X=242, Y=65
 On exit:  Y=65 - GSX ROM absent (Y preserved if ROM is absent)
           Y<64 - GSX ROM is present (not possible to have more
                  than 64 pages of workspace)
                  X.b7=0 - GSX ROM disabled
                  X.b7=1 - GSX ROM enabled

X=&F3 (243) 65Tube emulator

 On entry:
   Y=4     find code address
 On exit:
   if Y<>0, XY=address to jump to
   Called on Tube reset, *BASIC and NMIs to ask for any code entry address.
 On entry:
   Y=6     find *command to execute
 On exit:
   if Y<>0, XY=>*command to execute
   Called on Tube reset to ask for any startup command.

X=&FD (253) Cause a Reset

 On entry:
   Y=OSBYTE &FD reset type:
     0 = Soft Reset (Break)
     1 = Power-On Reset
     2 = Hard Reset (Ctrl-Break)
 On exit:
   Will only exit if the call is not implemented.
 
 Implemented by RSTROM and other ROMs.
 See also Reset from software.

X=&FE (254) Unknown

 This call is checked for by 65Tube.
 On entry:
   Y=unknown
 On exit:
   On 65Tube, X and Y returned preserved.

X=&FF (255) Acornsoft View family workspace flag

 On entry:
   Y<&80   read ROM's workspace byte at &DF0+romnum
   Y>&7F   set bit 7 of ROM's workspace byte at &DF0+romnum
   
   Y=&01/&81 read/set View's ROM workspace byte
   Y=&02/&82 read/set ViewSheet's ROM workspace byte
   Y=&03/&83 read/set ViewStore's ROM workspace byte
   Y=&04/&84 read/set ViewSpell's ROM workspace byte
 On exit:
   X=undefined (preserved)
   Y=ROM's workspace byte at &DF0+romnum
   
   Some versions of ViewSheet and ViewSpell do not implement the
   call to set the workspace byte. On 65Tube, X and Y are returned
   preserved, indicating the ROMs are not present.

The View family ROMs set their workspace byte to zero on reset, so this call normally returns &00 or &80. This allows callers to find if the View ROMs are present and perform actions such as calling them with their *Command without the risk of the command not being recognised and causing a disk access and a Bad command error.

The following code demonstrates using the calls.

  10 A%=163:X%=255
  20 FOR Y%=1 TO 4
  30   U%=((USR&FFF4)AND&FF0000)DIV65536
  40   READ A$:PRINT A$;" ";
  50   IF U%<>Y% THEN PRINT "present" ELSE PRINT "absent"
  60 NEXT Y%
  70 DATA VIEW,ViewSheet,ViewStore,ViewSpell
  A%=163:X%=255:Y%=1:IF ((USR&FFF4)AND&FF0000)DIV65536<>1 THEN *WORD

See Also

Jgharston 22:16, 26 May 2009 (UTC) Jgharston (talk) 02:26, 24 November 2020 (CET) Jgharston (talk) 00:24, 24 November 2022 (CET)