mirror of
https://github.com/RevCurtisP/C02.git
synced 2025-02-21 03:29:25 +00:00
C64/VIC20 - Clear stop key flag on exit
This commit is contained in:
parent
4958e3c432
commit
e8777b6077
@ -22,6 +22,7 @@ TEMP2 EQU $65 ;Temporary Variable [Floating Point Accumulator]
|
|||||||
TEMP3 EQU $67 ;Temporary Variable [Floating Point Accumulator]
|
TEMP3 EQU $67 ;Temporary Variable [Floating Point Accumulator]
|
||||||
TMPPTR EQU $69 ;Temporary Pointer [Floating Point Argument]
|
TMPPTR EQU $69 ;Temporary Pointer [Floating Point Argument]
|
||||||
; $6A-$70 ;[Floating Point Argument]
|
; $6A-$70 ;[Floating Point Argument]
|
||||||
|
.STKEY EQU $91 ;Stop Key flag
|
||||||
RDSEED EQU $A2 ;Random Seed [Software Jiffy Clock (Low Byte)]
|
RDSEED EQU $A2 ;Random Seed [Software Jiffy Clock (Low Byte)]
|
||||||
; $FB-$FE ;Unused Zero Page for Applications
|
; $FB-$FE ;Unused Zero Page for Applications
|
||||||
|
|
||||||
@ -35,7 +36,7 @@ BLKEND EQU $0336 ;Block Start [Unused Byte]
|
|||||||
BLKLEN EQU $0338 ;Block Length [Unused Byte]
|
BLKLEN EQU $0338 ;Block Length [Unused Byte]
|
||||||
|
|
||||||
RANDOM EQU $0339 ;Random Number Storage [Unused Byte]
|
RANDOM EQU $0339 ;Random Number Storage [Unused Byte]
|
||||||
STKSAV EQU $033A ;Machine Stack Storage [Unused Byte]
|
.STKSAV EQU $033A ;Machine Stack Storage [Unused Byte]
|
||||||
; $033B ;Free Byte for User Programs
|
; $033B ;Free Byte for User Programs
|
||||||
TBFFR EQU $033C ;Cassette I/O Buffer
|
TBFFR EQU $033C ;Cassette I/O Buffer
|
||||||
|
|
||||||
@ -61,10 +62,12 @@ BASIC: DC $0C, $08 ;Pointer to Next Line
|
|||||||
DC $00, $00 ;End of Basic Program
|
DC $00, $00 ;End of Basic Program
|
||||||
|
|
||||||
START: TSX ;Get Stack Pointer
|
START: TSX ;Get Stack Pointer
|
||||||
STX STKSAV ;and Save for Exit
|
STX .STKSAV ;and Save for Exit
|
||||||
JMP MAIN ;Execute Program
|
JMP MAIN ;Execute Program
|
||||||
|
|
||||||
EXIT: LDX STKSAV ;Retrieve Saved Stack Pointer
|
EXIT: LDA #0 ;Clear Stop Key Flag
|
||||||
|
STA .STKEY
|
||||||
|
LDX .STKSAV ;Retrieve Saved Stack Pointer
|
||||||
TXS ;and Restore It
|
TXS ;and Restore It
|
||||||
RTS
|
RTS
|
||||||
|
|
||||||
|
@ -1,10 +1,12 @@
|
|||||||
;c02 Program Initialization Code for Vic-20 - Common Code
|
;c02 Program Initialization Code for Vic-20 - Common Code
|
||||||
|
|
||||||
START: TSX ;Get Stack Pointer
|
START: TSX ;Get Stack Pointer
|
||||||
STX STKSAV ;and Save for Exit
|
STX .STKSAV ;and Save for Exit
|
||||||
JMP MAIN ;Execute Program
|
JMP MAIN ;Execute Program
|
||||||
|
|
||||||
EXIT: LDX STKSAV ;Retrieve Saved Stack Pointer
|
EXIT: LDA #0 ;Clear Stop Key Flag
|
||||||
|
STA .STKEY
|
||||||
|
LDX .STKSAV ;Retrieve Saved Stack Pointer
|
||||||
TXS ;and Restore It
|
TXS ;and Restore It
|
||||||
RTS ;Return to BASIC
|
RTS ;Return to BASIC
|
||||||
|
|
||||||
|
@ -6,8 +6,8 @@ ESCKEY EQU $03 ;Escape/Stop Key (RUN/STOP)
|
|||||||
RTNKEY EQU $0D ;Return/Enter Key (RETURN)
|
RTNKEY EQU $0D ;Return/Enter Key (RETURN)
|
||||||
|
|
||||||
;Zero Page Locations
|
;Zero Page Locations
|
||||||
XMBANK EQU $0A ;Extended Memory Bank [Load/Verify Flag]
|
XMADDR EQU $0A ;Extended Memory Address [VERCKB and COUNT]
|
||||||
XMADDR EQU $0B ;Extended Memory Address [Array Index/Flags]
|
XMBANK EQU $0C ;Extended Memory Bank [DIMFLG and VALTYP]
|
||||||
; $16 ;[Temporary String Stack Pointer]
|
; $16 ;[Temporary String Stack Pointer]
|
||||||
SRCPTR EQU $17 ;Source Pointer [Temporary String Space Pointer]
|
SRCPTR EQU $17 ;Source Pointer [Temporary String Space Pointer]
|
||||||
DSTPTR EQU $19 ;Destination Pointer [Temporary String Stack]
|
DSTPTR EQU $19 ;Destination Pointer [Temporary String Stack]
|
||||||
@ -22,6 +22,7 @@ TEMP2 EQU $65 ;Temporary Variable [Floating Point Accumulator]
|
|||||||
TEMP3 EQU $67 ;Temporary Variable [Floating Point Accumulator]
|
TEMP3 EQU $67 ;Temporary Variable [Floating Point Accumulator]
|
||||||
TMPPTR EQU $69 ;Temporary Pointer [Floating Point Argument]
|
TMPPTR EQU $69 ;Temporary Pointer [Floating Point Argument]
|
||||||
; $6A-$70 ;[Floating Point Argument]
|
; $6A-$70 ;[Floating Point Argument]
|
||||||
|
.STKEY EQU $91 ;Stop Key flag
|
||||||
RDSEED EQU $A2 ;Random Seed [Software Jiffy Clock (Low Byte)
|
RDSEED EQU $A2 ;Random Seed [Software Jiffy Clock (Low Byte)
|
||||||
; $FB-$FE ;Unused Zero Page for Applications
|
; $FB-$FE ;Unused Zero Page for Applications
|
||||||
|
|
||||||
@ -38,7 +39,7 @@ BLKEND EQU $0336 ;Block Start [Unused Byte]
|
|||||||
BLKLEN EQU $0338 ;Block Length [Unused Byte]
|
BLKLEN EQU $0338 ;Block Length [Unused Byte]
|
||||||
|
|
||||||
RANDOM EQU $0339 ;Random Number Storage [Unused Byte]
|
RANDOM EQU $0339 ;Random Number Storage [Unused Byte]
|
||||||
STKSAV EQU $033A ;Machine Stack Storage [Unused Byte]
|
.STKSAV EQU $033A ;Machine Stack Storage [Unused Byte]
|
||||||
USER11 EQU $033B ;Free Byte for User Programs
|
USER11 EQU $033B ;Free Byte for User Programs
|
||||||
TBFFR EQU $033C ;Cassette I/O Buffer
|
TBFFR EQU $033C ;Cassette I/O Buffer
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user