2013-12-13 21:24:03 +00:00
|
|
|
.export print_a
|
|
|
|
.export print_cr
|
|
|
|
.export cls
|
|
|
|
.export beep
|
|
|
|
.export print_a_inverse
|
|
|
|
|
|
|
|
.exportzp screen_current_row
|
|
|
|
.exportzp screen_current_col
|
|
|
|
|
2013-12-27 13:57:56 +00:00
|
|
|
screen_current_row = $d6
|
|
|
|
screen_current_col = $d3
|
2013-12-13 21:24:03 +00:00
|
|
|
|
2013-12-27 13:57:56 +00:00
|
|
|
; use C64 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-27 13:57:56 +00:00
|
|
|
|
2013-12-13 21:24:03 +00:00
|
|
|
.bss
|
2013-12-27 13:57:56 +00:00
|
|
|
|
2013-12-13 21:24:03 +00:00
|
|
|
beep_timer: .res 1
|
|
|
|
|
2013-12-27 13:57:56 +00:00
|
|
|
|
2013-12-13 21:24:03 +00:00
|
|
|
.code
|
|
|
|
|
2013-12-27 13:57:56 +00:00
|
|
|
; use C64 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
|
|
|
|
|
2013-12-27 13:57:56 +00:00
|
|
|
; use C64 Kernel ROM function to clear the screen
|
|
|
|
; inputs: none
|
|
|
|
; outputs: none
|
2013-12-13 21:24:03 +00:00
|
|
|
cls:
|
2013-12-27 13:57:56 +00:00
|
|
|
lda #147 ; 'CLR/HOME'
|
|
|
|
jmp print_a
|
2013-12-13 21:24:03 +00:00
|
|
|
|
2013-12-27 13:57:56 +00:00
|
|
|
; currently does nothing (should make a 'beep noise')
|
|
|
|
; inputs: none
|
|
|
|
; outputs: none
|
2013-12-13 21:24:03 +00:00
|
|
|
beep:
|
|
|
|
lda #15
|
2013-12-27 13:57:56 +00:00
|
|
|
sta $d418 ; set volume
|
2013-12-13 21:24:03 +00:00
|
|
|
|
|
|
|
lda #0
|
|
|
|
sta $d405
|
|
|
|
lda #240
|
|
|
|
sta $d406
|
|
|
|
lda #8
|
|
|
|
sta $d403
|
|
|
|
|
2013-12-27 13:57:56 +00:00
|
|
|
; tone values for voice 1
|
2013-12-13 21:24:03 +00:00
|
|
|
lda #48
|
|
|
|
sta $d400
|
|
|
|
lda #28
|
|
|
|
sta $d401
|
|
|
|
|
2013-12-27 13:57:56 +00:00
|
|
|
; enable tone register
|
2013-12-13 21:24:03 +00:00
|
|
|
lda #65
|
|
|
|
sta $d404
|
|
|
|
|
|
|
|
; pause for qtr second
|
2013-12-27 13:57:56 +00:00
|
|
|
lda $dd06
|
2013-12-13 21:24:03 +00:00
|
|
|
sta beep_timer
|
2013-12-27 13:57:56 +00:00
|
|
|
inc beep_timer ; time counts backwards
|
|
|
|
: lda $dd06
|
2013-12-13 21:24:03 +00:00
|
|
|
cmp beep_timer
|
|
|
|
bne :-
|
|
|
|
|
2013-12-27 13:57:56 +00:00
|
|
|
; disable tone register
|
2013-12-13 21:24:03 +00:00
|
|
|
lda #65
|
|
|
|
sta $d404
|
|
|
|
lda #0
|
2013-12-27 13:57:56 +00:00
|
|
|
sta $d418 ; set volume
|
2013-12-13 21:24:03 +00:00
|
|
|
rts
|
|
|
|
|
2013-12-27 13:57:56 +00:00
|
|
|
; print a single char in inverse text:
|
2013-12-13 21:24:03 +00:00
|
|
|
print_a_inverse:
|
|
|
|
pha
|
2013-12-27 13:57:56 +00:00
|
|
|
lda #18 ; inverse mode on
|
2013-12-13 21:24:03 +00:00
|
|
|
jsr print_a
|
|
|
|
pla
|
|
|
|
jsr print_a
|
2013-12-27 13:57:56 +00:00
|
|
|
lda #146 ; inverse mode off
|
2013-12-13 21:24:03 +00:00
|
|
|
jmp print_a
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-12-27 13:57:56 +00:00
|
|
|
; -- LICENSE FOR c64print.s --
|
2013-12-13 21:24:03 +00:00
|
|
|
; 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-27 13:57:56 +00:00
|
|
|
;
|
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-27 13:57:56 +00:00
|
|
|
;
|
2013-12-13 21:24:03 +00:00
|
|
|
; The Original Code is ip65.
|
2013-12-27 13:57:56 +00:00
|
|
|
;
|
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
|
2013-12-27 13:57:56 +00:00
|
|
|
; Jonno Downes. All Rights Reserved.
|
2013-12-13 21:24:03 +00:00
|
|
|
; -- LICENSE END --
|