diff --git a/jacme/jimmy.s b/jacme/jimmy.s index cbaffad..c25a4ee 100644 --- a/jacme/jimmy.s +++ b/jacme/jimmy.s @@ -2,24 +2,24 @@ !source "basic-boot.s" +start_at $0900 - sei ; no interrupts pls + sei ; no interrupts pls - ldx #$00 ; Screen colours + ldx #$00 ; screen colours stx bdcol ldx #$08 stx bgcol - jsr $e544 ; clear screen + jsr $e544 ; clear screen - lda #> message ; print message - pha + lda #> message ; push the location of the text + pha ; to display onto the stack lda #< message pha - jsr print_string + jsr print_string ; call the actual print subroutine pla pla - ;ldx #$01 ; start triangle wave + ;ldx #$01 ; start triangle wave ;ldy #$11 ;stx ch1_freq_hi ;sty ch1_freq_lo @@ -27,31 +27,33 @@ ;stx ch1_ctl .loop - inc bdcol + inc bdcol ; flashing gobbledygook garbage (scat) - lda inputb ; Scans the keyboard buffer - cmp #$EF ; If user presses Space ($ef) then quit + lda inputb ; Scans the keyboard buffer + cmp #$EF ; If user presses Space ($ef) then quit bne .loop - ldx #$08 ; kill sound + ldx #$08 ; kill sound stx ch1_ctl rts print_string: - tsx + tsx ; load the stack pointer + inx ; traverse upwards to our arguments inx inx - inx - lda stack, x - sta PSL + 1 - inx + lda stack, x ; copy the arguments on the stack + sta PSL + 1 ; on top of the instruction that + inx ; needs to point to the text lda stack, x sta PSL + 2 - 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 + sta screen + rowlen, x inx