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