2013-12-13 21:24:03 +00:00
|
|
|
.export print_a
|
|
|
|
.export print_a_inverse
|
|
|
|
.export print_cr
|
|
|
|
.export cls
|
|
|
|
.export beep
|
|
|
|
.exportzp screen_current_row
|
|
|
|
.exportzp screen_current_col
|
|
|
|
|
2013-12-27 13:57:56 +00:00
|
|
|
screen_current_col = $24 ; CH - Horizontal cursor-position (0-39)
|
|
|
|
screen_current_row = $25 ; CV - Vertical cursor-position (0-23)
|
2013-12-13 21:24:03 +00:00
|
|
|
|
2015-08-28 12:38:50 +00:00
|
|
|
|
|
|
|
.code
|
|
|
|
|
2013-12-27 13:57:56 +00:00
|
|
|
; use Apple 2 monitor ROM function to display 1 char
|
|
|
|
; inputs: A should be set to ASCII char to display
|
|
|
|
; outputs: none
|
2013-12-13 21:24:03 +00:00
|
|
|
print_a:
|
2013-12-27 13:57:56 +00:00
|
|
|
ora #$80 ; turn ASCII into Apple 2 screen codes
|
2015-02-16 16:50:26 +00:00
|
|
|
cmp #$e0 ; is it lower case?
|
|
|
|
bcc @check_line_feed
|
|
|
|
ldx $fbb3 ; check machine version
|
|
|
|
cpx #$06 ; is it at least an //e?
|
|
|
|
beq @check_line_feed
|
|
|
|
and #$df ; convert to upper case
|
|
|
|
@check_line_feed:
|
|
|
|
cmp #$8a ; is it a line feed?
|
2013-12-13 21:24:03 +00:00
|
|
|
bne @not_line_feed
|
2015-02-16 16:50:26 +00:00
|
|
|
lda #$8d ; replace with a carriage return
|
2013-12-13 21:24:03 +00:00
|
|
|
@not_line_feed:
|
|
|
|
jmp $fded
|
|
|
|
|
2013-12-27 13:57:56 +00:00
|
|
|
; use Apple 2 monitor ROM function to move to new line
|
|
|
|
; inputs: none
|
|
|
|
; outputs: none
|
2013-12-13 21:24:03 +00:00
|
|
|
print_cr:
|
|
|
|
jmp $fd8e
|
|
|
|
|
2015-08-28 12:38:50 +00:00
|
|
|
; use Apple 2 monitor ROM function to clear the screen
|
2013-12-27 13:57:56 +00:00
|
|
|
; inputs: none
|
|
|
|
; outputs: none
|
2013-12-13 21:24:03 +00:00
|
|
|
cls:
|
2013-12-27 13:57:56 +00:00
|
|
|
jmp $fc58
|
2013-12-13 21:24:03 +00:00
|
|
|
|
2015-08-28 12:38:50 +00:00
|
|
|
; use Apple 2 monitor ROM function to make a 'beep' noise
|
2013-12-27 13:57:56 +00:00
|
|
|
; inputs: none
|
|
|
|
; outputs: none
|
2013-12-13 21:24:03 +00:00
|
|
|
beep:
|
|
|
|
jmp $fbdd
|
2013-12-27 13:57:56 +00:00
|
|
|
|
2013-12-13 21:24:03 +00:00
|
|
|
print_a_inverse:
|
2013-12-27 13:57:56 +00:00
|
|
|
and #$7F ; turn off top bits
|
2013-12-13 21:24:03 +00:00
|
|
|
jsr $fded
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-12-27 13:57:56 +00:00
|
|
|
; -- LICENSE FOR a2print.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 --
|