mirror of
https://github.com/bobbimanners/Applecorn.git
synced 2024-06-25 00:31:11 +00:00
Even more code cleanup!
This commit is contained in:
parent
9552ae0d29
commit
81fb379a01
BIN
applecorn.po
BIN
applecorn.po
Binary file not shown.
|
@ -98,6 +98,8 @@ XFADDR MAC
|
||||||
* Macro to backup STRTL/STRTH then load XFADDR
|
* Macro to backup STRTL/STRTH then load XFADDR
|
||||||
* Called by code running in aux mem
|
* Called by code running in aux mem
|
||||||
XFADDRAUX MAC
|
XFADDRAUX MAC
|
||||||
|
TSX
|
||||||
|
STX $0101 ; Save alt SP
|
||||||
PHA
|
PHA
|
||||||
LDA STRTL
|
LDA STRTL
|
||||||
STA STRTBCKL
|
STA STRTBCKL
|
||||||
|
|
26
auxmem.s
26
auxmem.s
|
@ -286,11 +286,6 @@ FINDHND PHX
|
||||||
STX ZP1 ; Points to filename
|
STX ZP1 ; Points to filename
|
||||||
STY ZP1+1
|
STY ZP1+1
|
||||||
|
|
||||||
TSX ; Stash alt ZP
|
|
||||||
STX $0101
|
|
||||||
|
|
||||||
PLA
|
|
||||||
PHA
|
|
||||||
CMP #$00 ; A=$00 = close
|
CMP #$00 ; A=$00 = close
|
||||||
BEQ :CLOSE
|
BEQ :CLOSE
|
||||||
|
|
||||||
|
@ -311,8 +306,8 @@ FINDHND PHX
|
||||||
STA $C004 ; Write main
|
STA $C004 ; Write main
|
||||||
STY MOSFILE ; Length (Pascal string)
|
STY MOSFILE ; Length (Pascal string)
|
||||||
STA $C005 ; Write aux
|
STA $C005 ; Write aux
|
||||||
>>> XFADDRAUX,OFILE
|
|
||||||
PLA ; Recover options
|
PLA ; Recover options
|
||||||
|
>>> XFADDRAUX,OFILE
|
||||||
:S1 >>> XFMAIN
|
:S1 >>> XFMAIN
|
||||||
|
|
||||||
:CLOSE STA $C004 ; Write main
|
:CLOSE STA $C004 ; Write main
|
||||||
|
@ -353,8 +348,6 @@ BPUTHND PHX
|
||||||
STA $C004 ; Write to main memory
|
STA $C004 ; Write to main memory
|
||||||
STY MOSFILE ; File reference number
|
STY MOSFILE ; File reference number
|
||||||
STA $C005 ; Write to aux memory
|
STA $C005 ; Write to aux memory
|
||||||
TSX ; Stash alt SP in $0101
|
|
||||||
STX $0101
|
|
||||||
>>> XFADDRAUX,FILEPUT
|
>>> XFADDRAUX,FILEPUT
|
||||||
PLA ; Char to write
|
PLA ; Char to write
|
||||||
PHA
|
PHA
|
||||||
|
@ -373,8 +366,6 @@ BGETHND PHX
|
||||||
STA $C004 ; Write to main memory
|
STA $C004 ; Write to main memory
|
||||||
STY MOSFILE ; File ref number
|
STY MOSFILE ; File ref number
|
||||||
STA $C005 ; Write to aux memory
|
STA $C005 ; Write to aux memory
|
||||||
TSX ; Stash alt SP in $0101
|
|
||||||
STX $0101
|
|
||||||
>>> XFADDRAUX,FILEGET
|
>>> XFADDRAUX,FILEGET
|
||||||
>>> XFMAIN
|
>>> XFMAIN
|
||||||
OSBGETRET
|
OSBGETRET
|
||||||
|
@ -493,9 +484,6 @@ FILEHND PHX
|
||||||
STY MOSFILE ; Length (Pascal string)
|
STY MOSFILE ; Length (Pascal string)
|
||||||
STA $C005 ; Write aux
|
STA $C005 ; Write aux
|
||||||
|
|
||||||
TSX
|
|
||||||
STX $0101 ; Store alt SP in $0101
|
|
||||||
|
|
||||||
PLA ; Get action back
|
PLA ; Get action back
|
||||||
PHA
|
PHA
|
||||||
BEQ :S1 ; A=00 -> SAVE
|
BEQ :S1 ; A=00 -> SAVE
|
||||||
|
@ -1231,9 +1219,7 @@ STARHELP LDA #<:MSG
|
||||||
STARQUIT >>> XFADDRAUX,QUIT
|
STARQUIT >>> XFADDRAUX,QUIT
|
||||||
>>> XFMAIN
|
>>> XFMAIN
|
||||||
|
|
||||||
STARCAT TSX
|
STARCAT >>> XFADDRAUX,CATALOG
|
||||||
STX $0101 ; Stash alt SP
|
|
||||||
>>> XFADDRAUX,CATALOG
|
|
||||||
>>> XFMAIN
|
>>> XFMAIN
|
||||||
STARCATRET
|
STARCATRET
|
||||||
>>> ENTAUX
|
>>> ENTAUX
|
||||||
|
@ -1241,9 +1227,7 @@ STARCATRET
|
||||||
|
|
||||||
* Print one block of a catalog. Called by CATALOG
|
* Print one block of a catalog. Called by CATALOG
|
||||||
* Block is in AUXBLK
|
* Block is in AUXBLK
|
||||||
PRONEBLK LDX $0101 ; Recover alt SP
|
PRONEBLK >>> ENTAUX
|
||||||
TXS
|
|
||||||
|
|
||||||
LDA AUXBLK+4 ; Get storage type
|
LDA AUXBLK+4 ; Get storage type
|
||||||
AND #$E0 ; Mask 3 MSBs
|
AND #$E0 ; Mask 3 MSBs
|
||||||
CMP #$E0
|
CMP #$E0
|
||||||
|
@ -1334,8 +1318,6 @@ STARDIR LDA ZP1 ; Move ZP1->ZP3 (OSWRCH uses ZP1)
|
||||||
STA $C004 ; Write main
|
STA $C004 ; Write main
|
||||||
STX MOSFILE ; Length byte
|
STX MOSFILE ; Length byte
|
||||||
STA $C005 ; Write aux
|
STA $C005 ; Write aux
|
||||||
TSX
|
|
||||||
STX $0101 ; Stash alt SP
|
|
||||||
>>> XFADDRAUX,SETPFX
|
>>> XFADDRAUX,SETPFX
|
||||||
>>> XFMAIN
|
>>> XFMAIN
|
||||||
STARDIRRET
|
STARDIRRET
|
||||||
|
@ -1368,8 +1350,6 @@ CHKEOF STA $C004 ; Write main mem
|
||||||
STX MOSFILE ; File reference number
|
STX MOSFILE ; File reference number
|
||||||
STA $C005 ; Write aux mem
|
STA $C005 ; Write aux mem
|
||||||
>>> XFADDRAUX,FILEEOF
|
>>> XFADDRAUX,FILEEOF
|
||||||
TSX ; Stash alt SP in $0101
|
|
||||||
STX $0101
|
|
||||||
>>> XFMAIN
|
>>> XFMAIN
|
||||||
CHKEOFRET
|
CHKEOFRET
|
||||||
>>> ENTAUX
|
>>> ENTAUX
|
||||||
|
|
17
loader.s
17
loader.s
|
@ -3,6 +3,10 @@
|
||||||
*
|
*
|
||||||
* Applecorn loader code
|
* Applecorn loader code
|
||||||
|
|
||||||
|
* Loads Acorn ROM file (16KB) from disk and writes it
|
||||||
|
* to aux memory starting at $08000. Copies Applecorn MOS
|
||||||
|
* to aux memory starting at AUXMOS1 and jumps to it.
|
||||||
|
* (Note that the MOS code will relocate itself to $D000.)
|
||||||
START STZ :BLOCKS
|
START STZ :BLOCKS
|
||||||
LDX #$00
|
LDX #$00
|
||||||
:L1 LDA HELLO,X ; Signon message
|
:L1 LDA HELLO,X ; Signon message
|
||||||
|
@ -100,15 +104,10 @@ START STZ :BLOCKS
|
||||||
EOR #$A5 ; Checksum
|
EOR #$A5 ; Checksum
|
||||||
STA RSTV+2
|
STA RSTV+2
|
||||||
|
|
||||||
TSX
|
TSX ; Save SP at $0100
|
||||||
STX $0100 ; Store SP at $0100
|
STX $0100
|
||||||
LDA #<AUXMOS1 ; Start address in aux, for XFER
|
>>> XFADDR,AUXMOS1
|
||||||
STA STRTL
|
>>> XFAUX
|
||||||
LDA #>AUXMOS1
|
|
||||||
STA STRTH
|
|
||||||
SEC ; Main -> Aux
|
|
||||||
BIT $FF58 ; Set V; Use page zero and stack in aux
|
|
||||||
JMP XFER ; Jump to copied MOS code in Aux
|
|
||||||
|
|
||||||
:BLOCKS DB 0 ; Counter for blocks read
|
:BLOCKS DB 0 ; Counter for blocks read
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user