emailler/drivers/vic20print.s

95 lines
1.9 KiB
ArmAsm
Raw Normal View History

2013-12-13 21:24:03 +00:00
.export print_a
.export print_cr
.export cls
.export beep
.export print_a_inverse
.import timer_read
.exportzp screen_current_row
.exportzp screen_current_col
screen_current_row = $d6
screen_current_col = $d3
2013-12-13 21:24:03 +00:00
; use VIC 20 Kernel ROM function to print a character to the screen
; inputs: A contains petscii value of character to print
; outputs: none
2013-12-13 21:24:03 +00:00
print_a = $ffd2
2013-12-13 21:24:03 +00:00
.bss
2013-12-13 21:24:03 +00:00
beep_timer: .res 1
2013-12-13 21:24:03 +00:00
.code
; use VIC 20 Kernel ROM function to move to a new line
; inputs: none
; outputs: none
2013-12-13 21:24:03 +00:00
print_cr:
lda #13
jmp print_a
; use VIC 20 Kernel ROM function to clear the screen
; inputs: none
; outputs: none
2013-12-13 21:24:03 +00:00
cls:
lda #147 ; 'CLR/HOME'
jmp print_a
2013-12-13 21:24:03 +00:00
; currently does nothing (should make a 'beep noise')
; inputs: none
; outputs: none
2013-12-13 21:24:03 +00:00
beep:
lda $900e
ora #15
sta $900e ; set volume
2013-12-13 21:24:03 +00:00
; turn on osc. 3
2013-12-13 21:24:03 +00:00
lda #$FF
sta $900c
; pause for qtr second
2013-12-13 21:24:03 +00:00
jsr timer_read
stx beep_timer
inc beep_timer
inc beep_timer
: jsr timer_read
2013-12-13 21:24:03 +00:00
cpx beep_timer
bne :-
; turn off osc. 3
2013-12-13 21:24:03 +00:00
lda #$00
sta $900c
rts
; print a single char in inverse text:
2013-12-13 21:24:03 +00:00
print_a_inverse:
pha
lda #18 ; inverse mode on
2013-12-13 21:24:03 +00:00
jsr print_a
pla
jsr print_a
lda #146 ; inverse mode off
2013-12-13 21:24:03 +00:00
jmp print_a
; The contents of this file are subject to the Mozilla Public License
; Version 1.1 (the "License"); you may not use this file except in
; compliance with the License. You may obtain a copy of the License at
; http://www.mozilla.org/MPL/
;
2013-12-13 21:24:03 +00:00
; Software distributed under the License is distributed on an "AS IS"
; basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
; License for the specific language governing rights and limitations
; under the License.
;
2013-12-13 21:24:03 +00:00
; The Original Code is ip65.
;
2013-12-13 21:24:03 +00:00
; The Initial Developer of the Original Code is Jonno Downes,
; jonno@jamtronix.com.
; Portions created by the Initial Developer are Copyright (C) 2009
; Jonno Downes. All Rights Reserved.
2013-12-13 21:24:03 +00:00
; -- LICENSE END --