add some comments for jimmy <3

This commit is contained in:
2019-04-04 18:00:32 +11:00
parent 1d53530544
commit f92b2a52a8

View File

@@ -2,24 +2,24 @@
!source "basic-boot.s" !source "basic-boot.s"
+start_at $0900 +start_at $0900
sei ; no interrupts pls sei ; no interrupts pls
ldx #$00 ; Screen colours ldx #$00 ; screen colours
stx bdcol stx bdcol
ldx #$08 ldx #$08
stx bgcol stx bgcol
jsr $e544 ; clear screen jsr $e544 ; clear screen
lda #> message ; print message lda #> message ; push the location of the text
pha pha ; to display onto the stack
lda #< message lda #< message
pha pha
jsr print_string jsr print_string ; call the actual print subroutine
pla pla
pla pla
;ldx #$01 ; start triangle wave ;ldx #$01 ; start triangle wave
;ldy #$11 ;ldy #$11
;stx ch1_freq_hi ;stx ch1_freq_hi
;sty ch1_freq_lo ;sty ch1_freq_lo
@@ -27,31 +27,33 @@
;stx ch1_ctl ;stx ch1_ctl
.loop .loop
inc bdcol inc bdcol ; flashing gobbledygook garbage (scat)
lda inputb ; Scans the keyboard buffer lda inputb ; Scans the keyboard buffer
cmp #$EF ; If user presses Space ($ef) then quit cmp #$EF ; If user presses Space ($ef) then quit
bne .loop bne .loop
ldx #$08 ; kill sound ldx #$08 ; kill sound
stx ch1_ctl stx ch1_ctl
rts rts
print_string: print_string:
tsx tsx ; load the stack pointer
inx ; traverse upwards to our arguments
inx inx
inx inx
inx lda stack, x ; copy the arguments on the stack
lda stack, x sta PSL + 1 ; on top of the instruction that
sta PSL + 1 inx ; needs to point to the text
inx
lda stack, x lda stack, x
sta PSL + 2 sta PSL + 2
ldx #$00 ldx #$00
PSL lda message, x
cmp #$0 ; return on null terminator PSL lda $0000, x ; this instruction's operand is
; modified by the code above
cmp #$0 ; return on null terminator
beq + beq +
sta screen + rowlen, x sta screen + rowlen, x
inx inx