Home » Archimedes archive » Acorn User » AU 1997-05 B.adf » Regulars » StarInfo/clouds/Brown/s/satcode

StarInfo/clouds/Brown/s/satcode

This website contains an archive of files for the Acorn Electron, BBC Micro, Acorn Archimedes, Commodore 16 and Commodore 64 computers, which Dominic Ford has rescued from his private collection of floppy disks and cassettes.

Some of these files were originally commercial releases in the 1980s and 1990s, but they are now widely available online. I assume that copyright over them is no longer being asserted. If you own the copyright and would like files to be removed, please contact me.

Tape/disk: Home » Archimedes archive » Acorn User » AU 1997-05 B.adf » Regulars
Filename: StarInfo/clouds/Brown/s/satcode
Read OK:
File size: 05E1 bytes
Load address: 0000
Exec address: 0000
File contents
OS_WriteC		EQU	&0
OS_Byte			EQU	&6
OS_File			EQU	&8
OS_Mouse		EQU	&1C
OS_ReadVduVariables	EQU	&31
OS_ReadMonotonicTime	EQU	&42

; some things which really should be defined as constants
screen_width		EQU	320
shift_1			EQU	8
shift_2			EQU	6


	AREA |satinfo$$data|, DATA

sat_getscreenbaseinfo
	DCD 0
	DCD 0
	DCD 0
	DCD 0


	AREA |satcode$$code|, CODE, READONLY

	EXPORT sat_screenmode
	EXPORT sat_getscreenbase
	EXPORT sat_loadfile
	EXPORT sat_savefile
	EXPORT sat_mouseop
	EXPORT sat_timeop



sat_loadfile
	stmfd sp!,{r4,r5,lr}
	mov r2,r1
	mov r1,r0
	mov r0,#16
	mov r3,#0
	swi OS_File
	ldmfd sp!,{r4,r5,pc}



sat_savefile
	stmfd sp!,{r4,r5,r6,lr}
	mov r6,r2
	mov r5,r1
	mov r4,r0
	mov r0,#10		; reason code (save)
	mov r1,r4		; *name (r0 on entry)
	mov r2,#&FF0
	orr r2,r2,#&00D		; just to get &FFD into a reg!
	mov r4,r5		; start address (r1 on entry)
	add r5,r4,r6		; size (r2 on entry)
	swi OS_File
	ldmfd sp!,{r4,r5,r6,pc}




sat_screenmode
	mov r1,r0
	mov r0,#22
	swi OS_WriteC
	mov r0,r1
	swi OS_WriteC
	movs pc,lr



sat_getscreenbase
	adrl r0,sat_getscreenbaseinfo
	mov r1,#149	; hardware screen start
	mvn r2,#0	; NOT -1
	stmia r0,{r1,r2}
	mov r1,r0
	swi OS_ReadVduVariables
	ldr r0,[r0]	; eech, but apparently ok
	movs pc,lr



; r0 - &x
; r1 - &y
; r2 - &button
sat_mouseop
	stmfd sp!,{r4-r6,lr}
	mov r4,r0
	mov r5,r1
	mov r6,r2
	swi OS_Mouse
	str r0,[r4]
	str r1,[r5]
	str r2,[r6]
	ldmfd sp!,{r4-r6,pc}



; exit r0 - time in cs
sat_timeop
	swi OS_ReadMonotonicTime
	movs pc,r14



	END
00000000  0a 4f 53 5f 57 72 69 74  65 43 09 09 45 51 55 09  |.OS_WriteC..EQU.|
00000010  26 30 0a 4f 53 5f 42 79  74 65 09 09 09 45 51 55  |&0.OS_Byte...EQU|
00000020  09 26 36 0a 4f 53 5f 46  69 6c 65 09 09 09 45 51  |.&6.OS_File...EQ|
00000030  55 09 26 38 0a 4f 53 5f  4d 6f 75 73 65 09 09 45  |U.&8.OS_Mouse..E|
00000040  51 55 09 26 31 43 0a 4f  53 5f 52 65 61 64 56 64  |QU.&1C.OS_ReadVd|
00000050  75 56 61 72 69 61 62 6c  65 73 09 45 51 55 09 26  |uVariables.EQU.&|
00000060  33 31 0a 4f 53 5f 52 65  61 64 4d 6f 6e 6f 74 6f  |31.OS_ReadMonoto|
00000070  6e 69 63 54 69 6d 65 09  45 51 55 09 26 34 32 0a  |nicTime.EQU.&42.|
00000080  0a 3b 20 73 6f 6d 65 20  74 68 69 6e 67 73 20 77  |.; some things w|
00000090  68 69 63 68 20 72 65 61  6c 6c 79 20 73 68 6f 75  |hich really shou|
000000a0  6c 64 20 62 65 20 64 65  66 69 6e 65 64 20 61 73  |ld be defined as|
000000b0  20 63 6f 6e 73 74 61 6e  74 73 0a 73 63 72 65 65  | constants.scree|
000000c0  6e 5f 77 69 64 74 68 09  09 45 51 55 09 33 32 30  |n_width..EQU.320|
000000d0  0a 73 68 69 66 74 5f 31  09 09 09 45 51 55 09 38  |.shift_1...EQU.8|
000000e0  0a 73 68 69 66 74 5f 32  09 09 09 45 51 55 09 36  |.shift_2...EQU.6|
000000f0  0a 0a 0a 09 41 52 45 41  20 7c 73 61 74 69 6e 66  |....AREA |satinf|
00000100  6f 24 24 64 61 74 61 7c  2c 20 44 41 54 41 0a 0a  |o$$data|, DATA..|
00000110  73 61 74 5f 67 65 74 73  63 72 65 65 6e 62 61 73  |sat_getscreenbas|
00000120  65 69 6e 66 6f 0a 09 44  43 44 20 30 0a 09 44 43  |einfo..DCD 0..DC|
00000130  44 20 30 0a 09 44 43 44  20 30 0a 09 44 43 44 20  |D 0..DCD 0..DCD |
00000140  30 0a 0a 0a 09 41 52 45  41 20 7c 73 61 74 63 6f  |0....AREA |satco|
00000150  64 65 24 24 63 6f 64 65  7c 2c 20 43 4f 44 45 2c  |de$$code|, CODE,|
00000160  20 52 45 41 44 4f 4e 4c  59 0a 0a 09 45 58 50 4f  | READONLY...EXPO|
00000170  52 54 20 73 61 74 5f 73  63 72 65 65 6e 6d 6f 64  |RT sat_screenmod|
00000180  65 0a 09 45 58 50 4f 52  54 20 73 61 74 5f 67 65  |e..EXPORT sat_ge|
00000190  74 73 63 72 65 65 6e 62  61 73 65 0a 09 45 58 50  |tscreenbase..EXP|
000001a0  4f 52 54 20 73 61 74 5f  6c 6f 61 64 66 69 6c 65  |ORT sat_loadfile|
000001b0  0a 09 45 58 50 4f 52 54  20 73 61 74 5f 73 61 76  |..EXPORT sat_sav|
000001c0  65 66 69 6c 65 0a 09 45  58 50 4f 52 54 20 73 61  |efile..EXPORT sa|
000001d0  74 5f 6d 6f 75 73 65 6f  70 0a 09 45 58 50 4f 52  |t_mouseop..EXPOR|
000001e0  54 20 73 61 74 5f 74 69  6d 65 6f 70 0a 0a 0a 0a  |T sat_timeop....|
000001f0  73 61 74 5f 6c 6f 61 64  66 69 6c 65 0a 09 73 74  |sat_loadfile..st|
00000200  6d 66 64 20 73 70 21 2c  7b 72 34 2c 72 35 2c 6c  |mfd sp!,{r4,r5,l|
00000210  72 7d 0a 09 6d 6f 76 20  72 32 2c 72 31 0a 09 6d  |r}..mov r2,r1..m|
00000220  6f 76 20 72 31 2c 72 30  0a 09 6d 6f 76 20 72 30  |ov r1,r0..mov r0|
00000230  2c 23 31 36 0a 09 6d 6f  76 20 72 33 2c 23 30 0a  |,#16..mov r3,#0.|
00000240  09 73 77 69 20 4f 53 5f  46 69 6c 65 0a 09 6c 64  |.swi OS_File..ld|
00000250  6d 66 64 20 73 70 21 2c  7b 72 34 2c 72 35 2c 70  |mfd sp!,{r4,r5,p|
00000260  63 7d 0a 0a 0a 0a 73 61  74 5f 73 61 76 65 66 69  |c}....sat_savefi|
00000270  6c 65 0a 09 73 74 6d 66  64 20 73 70 21 2c 7b 72  |le..stmfd sp!,{r|
00000280  34 2c 72 35 2c 72 36 2c  6c 72 7d 0a 09 6d 6f 76  |4,r5,r6,lr}..mov|
00000290  20 72 36 2c 72 32 0a 09  6d 6f 76 20 72 35 2c 72  | r6,r2..mov r5,r|
000002a0  31 0a 09 6d 6f 76 20 72  34 2c 72 30 0a 09 6d 6f  |1..mov r4,r0..mo|
000002b0  76 20 72 30 2c 23 31 30  09 09 3b 20 72 65 61 73  |v r0,#10..; reas|
000002c0  6f 6e 20 63 6f 64 65 20  28 73 61 76 65 29 0a 09  |on code (save)..|
000002d0  6d 6f 76 20 72 31 2c 72  34 09 09 3b 20 2a 6e 61  |mov r1,r4..; *na|
000002e0  6d 65 20 28 72 30 20 6f  6e 20 65 6e 74 72 79 29  |me (r0 on entry)|
000002f0  0a 09 6d 6f 76 20 72 32  2c 23 26 46 46 30 0a 09  |..mov r2,#&FF0..|
00000300  6f 72 72 20 72 32 2c 72  32 2c 23 26 30 30 44 09  |orr r2,r2,#&00D.|
00000310  09 3b 20 6a 75 73 74 20  74 6f 20 67 65 74 20 26  |.; just to get &|
00000320  46 46 44 20 69 6e 74 6f  20 61 20 72 65 67 21 0a  |FFD into a reg!.|
00000330  09 6d 6f 76 20 72 34 2c  72 35 09 09 3b 20 73 74  |.mov r4,r5..; st|
00000340  61 72 74 20 61 64 64 72  65 73 73 20 28 72 31 20  |art address (r1 |
00000350  6f 6e 20 65 6e 74 72 79  29 0a 09 61 64 64 20 72  |on entry)..add r|
00000360  35 2c 72 34 2c 72 36 09  09 3b 20 73 69 7a 65 20  |5,r4,r6..; size |
00000370  28 72 32 20 6f 6e 20 65  6e 74 72 79 29 0a 09 73  |(r2 on entry)..s|
00000380  77 69 20 4f 53 5f 46 69  6c 65 0a 09 6c 64 6d 66  |wi OS_File..ldmf|
00000390  64 20 73 70 21 2c 7b 72  34 2c 72 35 2c 72 36 2c  |d sp!,{r4,r5,r6,|
000003a0  70 63 7d 0a 0a 0a 0a 0a  73 61 74 5f 73 63 72 65  |pc}.....sat_scre|
000003b0  65 6e 6d 6f 64 65 0a 09  6d 6f 76 20 72 31 2c 72  |enmode..mov r1,r|
000003c0  30 0a 09 6d 6f 76 20 72  30 2c 23 32 32 0a 09 73  |0..mov r0,#22..s|
000003d0  77 69 20 4f 53 5f 57 72  69 74 65 43 0a 09 6d 6f  |wi OS_WriteC..mo|
000003e0  76 20 72 30 2c 72 31 0a  09 73 77 69 20 4f 53 5f  |v r0,r1..swi OS_|
000003f0  57 72 69 74 65 43 0a 09  6d 6f 76 73 20 70 63 2c  |WriteC..movs pc,|
00000400  6c 72 0a 0a 0a 0a 73 61  74 5f 67 65 74 73 63 72  |lr....sat_getscr|
00000410  65 65 6e 62 61 73 65 0a  09 61 64 72 6c 20 72 30  |eenbase..adrl r0|
00000420  2c 73 61 74 5f 67 65 74  73 63 72 65 65 6e 62 61  |,sat_getscreenba|
00000430  73 65 69 6e 66 6f 0a 09  6d 6f 76 20 72 31 2c 23  |seinfo..mov r1,#|
00000440  31 34 39 09 3b 20 68 61  72 64 77 61 72 65 20 73  |149.; hardware s|
00000450  63 72 65 65 6e 20 73 74  61 72 74 0a 09 6d 76 6e  |creen start..mvn|
00000460  20 72 32 2c 23 30 09 3b  20 4e 4f 54 20 2d 31 0a  | r2,#0.; NOT -1.|
00000470  09 73 74 6d 69 61 20 72  30 2c 7b 72 31 2c 72 32  |.stmia r0,{r1,r2|
00000480  7d 0a 09 6d 6f 76 20 72  31 2c 72 30 0a 09 73 77  |}..mov r1,r0..sw|
00000490  69 20 4f 53 5f 52 65 61  64 56 64 75 56 61 72 69  |i OS_ReadVduVari|
000004a0  61 62 6c 65 73 0a 09 6c  64 72 20 72 30 2c 5b 72  |ables..ldr r0,[r|
000004b0  30 5d 09 3b 20 65 65 63  68 2c 20 62 75 74 20 61  |0].; eech, but a|
000004c0  70 70 61 72 65 6e 74 6c  79 20 6f 6b 0a 09 6d 6f  |pparently ok..mo|
000004d0  76 73 20 70 63 2c 6c 72  0a 0a 0a 0a 3b 20 72 30  |vs pc,lr....; r0|
000004e0  20 2d 20 26 78 0a 3b 20  72 31 20 2d 20 26 79 0a  | - &x.; r1 - &y.|
000004f0  3b 20 72 32 20 2d 20 26  62 75 74 74 6f 6e 0a 73  |; r2 - &button.s|
00000500  61 74 5f 6d 6f 75 73 65  6f 70 0a 09 73 74 6d 66  |at_mouseop..stmf|
00000510  64 20 73 70 21 2c 7b 72  34 2d 72 36 2c 6c 72 7d  |d sp!,{r4-r6,lr}|
00000520  0a 09 6d 6f 76 20 72 34  2c 72 30 0a 09 6d 6f 76  |..mov r4,r0..mov|
00000530  20 72 35 2c 72 31 0a 09  6d 6f 76 20 72 36 2c 72  | r5,r1..mov r6,r|
00000540  32 0a 09 73 77 69 20 4f  53 5f 4d 6f 75 73 65 0a  |2..swi OS_Mouse.|
00000550  09 73 74 72 20 72 30 2c  5b 72 34 5d 0a 09 73 74  |.str r0,[r4]..st|
00000560  72 20 72 31 2c 5b 72 35  5d 0a 09 73 74 72 20 72  |r r1,[r5]..str r|
00000570  32 2c 5b 72 36 5d 0a 09  6c 64 6d 66 64 20 73 70  |2,[r6]..ldmfd sp|
00000580  21 2c 7b 72 34 2d 72 36  2c 70 63 7d 0a 0a 0a 0a  |!,{r4-r6,pc}....|
00000590  3b 20 65 78 69 74 20 72  30 20 2d 20 74 69 6d 65  |; exit r0 - time|
000005a0  20 69 6e 20 63 73 0a 73  61 74 5f 74 69 6d 65 6f  | in cs.sat_timeo|
000005b0  70 0a 09 73 77 69 20 4f  53 5f 52 65 61 64 4d 6f  |p..swi OS_ReadMo|
000005c0  6e 6f 74 6f 6e 69 63 54  69 6d 65 0a 09 6d 6f 76  |notonicTime..mov|
000005d0  73 20 70 63 2c 72 31 34  0a 0a 0a 0a 09 45 4e 44  |s pc,r14.....END|
000005e0  0a                                                |.|
000005e1