Skip to content

Commit

Permalink
Can press a key to skip the pause screens
Browse files Browse the repository at this point in the history
Improved print macros
  • Loading branch information
ki3v committed Sep 6, 2023
1 parent 470c714 commit 5562420
Show file tree
Hide file tree
Showing 5 changed files with 52 additions and 24 deletions.
20 changes: 11 additions & 9 deletions apple2.asm
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ romstart:
JSR count_ram ; count how much RAM is installed

jsr show_banner
puts_centered_at TXTLINE24, "ZERO/STACK PAGES OK"
puts_centered_at 24, "ZERO/STACK PAGES OK"
jsr show_charset

ldx #$40 ; cycles
Expand All @@ -77,13 +77,13 @@ test_ram:
.define charset_line_size 32
.macro m_show_charset_lines
.repeat 256/charset_line_size, line
m_con_goto .ident(.concat("TXTLINE",.string(line+5))),(40-charset_line_size)/2-charset_line_size*line
m_con_goto line+5,(40-charset_line_size)/2-charset_line_size*line
jsr show_charset_line
.endrepeat
.endmacro

.proc show_charset
puts_centered_at TXTLINE1, "CHARACTER SET"
puts_centered_at 1, "CHARACTER SET"
ldy #0
m_show_charset_lines
rts
Expand All @@ -104,9 +104,9 @@ test_ram:

.proc show_banner
jsr con_cls
puts_centered_at TXTLINE22, "APPLE DEAD TEST BY KI3V AND ADRIAN BLACK"
puts_centered_at TXTLINE23, "TESTING RAM FROM $0200 TO $XXFF"
m_con_goto TXTLINE23, 31
puts_centered_at 22, "APPLE DEAD TEST BY KI3V AND ADRIAN BLACK"
puts_centered_at 23, "TESTING RAM FROM $0200 TO $XXFF"
m_con_goto 23, 31
LDA mu_page_end
SEC
SBC #1
Expand All @@ -115,9 +115,11 @@ test_ram:
.endproc

.proc delay_seconds
sta KBDSTRB
asl ; double the number, since we actually count in half-seconds
loop: PHA
inline_delay_cycles_ay 500000
; inline_delay_cycles_ay 500000
inline_delay_with_cancel 500000
PLA
SEC
SBC #1
Expand All @@ -129,8 +131,8 @@ loop: PHA
.include "inc/marchu.asm"
.include "inc/a2console.asm"

tst_tbl:.BYTE $80,$40,$20,$10, $08,$04,$02,$01, $00,$FF,$A5,$5A
; tst_tbl:.BYTE $80 ; while debugging, shorten the test value list
; tst_tbl:.BYTE $80,$40,$20,$10, $08,$04,$02,$01, $00,$FF,$A5,$5A
tst_tbl:.BYTE $80 ; while debugging, shorten the test value list
tst_tbl_end = *

; banner_msg:
Expand Down
Binary file modified apple2.bin
Binary file not shown.
2 changes: 1 addition & 1 deletion inc/a2console.asm
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@
; Y = row
; doesn't touch X
.proc con_goto
pha ; save A
pha ; save A (column) on stack
tya
asl ; multiply Y by 2
tay
Expand Down
48 changes: 37 additions & 11 deletions inc/a2macros.inc
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,23 @@ inner: DEY
bcs :- ; 3 cycles
.endmacro

; this macro can delay for an approximate specified number of clock cycles up to 983,040
; downside is it destroys A and Y
.macro inline_delay_with_cancel cycles
.local n, done
n = cycles/15
lda #>n
ldy #<n
: bit KBD ; 4 cycles
bmi done ; 2 cycles
cpy #1 ; 2 cycles
dey ; 2 cycles
sbc #0 ; 2 cycles
bcs :- ; 3 cycles
done:
; bit KBDSTRB
.endmacro

.macro inline_cls
LDA #$A0 ; A0 is the black character on the Apple II and II plus
LDY #$00 ; clear the screen
Expand Down Expand Up @@ -100,26 +117,35 @@ pexit:
.popseg
.endmacro

.macro puts_at loc, message
; line is one-based, col is zero-based... sorry
.macro puts_at line, col, message
.local loc
loc = .ident(.concat("TXTLINE",.string(line)))+col
jsr con_puts_embedded
.word loc
scrcode message
.byte 0
.endmacro

.macro puts_centered_at lineloc, message
.local msg, loc, end
jsr con_puts_embedded
.word lineloc+((40-(end-msg))/2)
msg: scrcode message
end: .byte 0
.macro puts_centered_at line, message
puts_at line, (40-.strlen(message))/2, message

; .local msg, loc, end
; jsr con_puts_embedded
; .word lineloc+((40-(end-msg))/2)
; msg: scrcode message
; end: .byte 0
.endmacro

.macro m_con_goto line, col
; .local loc
; loc = .ident(.concat("TXTLINE",.string(line))) + col
lda #<(line+col)
.local loc
loc = .ident(.concat("TXTLINE",.string(line))) + col
lda #<(loc)
sta con_loc
lda #>(line+col)
lda #>(loc)
sta con_loc+1
; lda #<(line+col)
; sta con_loc
; lda #>(line+col)
; sta con_loc+1
.endmacro
6 changes: 3 additions & 3 deletions inc/marchu.asm
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ FIRST_PAGE = $02
.proc init_results
lda #0
sta all_errs
tya
tay
lp: sta results,Y
iny
bne lp
Expand Down Expand Up @@ -249,8 +249,8 @@ FIRST_PAGE = $02
.proc show_report
sta TXTSET ; turn on text
jsr show_banner
puts_at TXTLINE1, "GITHUB.COM/MISTERBLACK1/APPLEII_DEADTEST"
puts_at TXTLINE3, "PAGE"
puts_at 1,0, "GITHUB.COM/MISTERBLACK1/APPLEII_DEADTEST"
puts_at 3,0, "PAGE"

ldx #15
next_head_line:
Expand Down

0 comments on commit 5562420

Please sign in to comment.