Adapted to cc65 assembler coding conventions
Assembler statements are written in lowercase.
This commit is contained in:
@@ -23,41 +23,41 @@
|
|||||||
; ---------------------------------------------------------------------------
|
; ---------------------------------------------------------------------------
|
||||||
; A little light 6502 housekeeping
|
; A little light 6502 housekeeping
|
||||||
|
|
||||||
_init: LDX #$FF ; Initialize stack pointer to $01FF
|
_init: ldx #$FF ; Initialize stack pointer to $01FF
|
||||||
TXS
|
txs
|
||||||
CLD ; Clear decimal mode
|
cld ; Clear decimal mode
|
||||||
|
|
||||||
; ---------------------------------------------------------------------------
|
; ---------------------------------------------------------------------------
|
||||||
; Initialize screen width
|
; Initialize screen width
|
||||||
; TODO: Can initialization be done in a more idiomatic way?
|
; TODO: Can initialization be done in a more idiomatic way?
|
||||||
; TODO: Create function for changing screen width
|
; TODO: Create function for changing screen width
|
||||||
LDA #$18
|
lda #$18
|
||||||
STA SCR_LINELEN
|
sta SCR_LINELEN
|
||||||
|
|
||||||
; ---------------------------------------------------------------------------
|
; ---------------------------------------------------------------------------
|
||||||
; Set cc65 argument stack pointer
|
; Set cc65 argument stack pointer
|
||||||
|
|
||||||
LDA #<(__RAM_START__ + __RAM_SIZE__)
|
lda #<(__RAM_START__ + __RAM_SIZE__)
|
||||||
STA sp
|
sta sp
|
||||||
LDA #>(__RAM_START__ + __RAM_SIZE__)
|
lda #>(__RAM_START__ + __RAM_SIZE__)
|
||||||
STA sp+1
|
sta sp+1
|
||||||
|
|
||||||
; ---------------------------------------------------------------------------
|
; ---------------------------------------------------------------------------
|
||||||
; Initialize memory storage
|
; Initialize memory storage
|
||||||
; copydata seems to be only necessary for special systems
|
; copydata seems to be only necessary for special systems
|
||||||
|
|
||||||
JSR zerobss ; Clear BSS segment
|
jsr zerobss ; Clear BSS segment
|
||||||
; JSR copydata ; Initialize DATA segment
|
; jsr copydata ; Initialize DATA segment
|
||||||
JSR initlib ; Run constructors
|
jsr initlib ; Run constructors
|
||||||
|
|
||||||
; ---------------------------------------------------------------------------
|
; ---------------------------------------------------------------------------
|
||||||
; Call main()
|
; Call main()
|
||||||
|
|
||||||
JSR _main
|
jsr _main
|
||||||
|
|
||||||
; ---------------------------------------------------------------------------
|
; ---------------------------------------------------------------------------
|
||||||
; Back from main (this is also the _exit entry): force a software break
|
; Back from main (this is also the _exit entry): force a software break
|
||||||
|
|
||||||
_exit: JSR donelib ; Run destructors
|
_exit: jsr donelib ; Run destructors
|
||||||
BRK
|
brk
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user