Skip to content

Commit

Permalink
Refine page error test
Browse files Browse the repository at this point in the history
Reduce size of RAM test using JSR to markbad
Add git-generated version number to binary
Start including binary in releases, not repo
  • Loading branch information
ki3v committed Sep 7, 2023
1 parent 262a093 commit ab5ba46
Show file tree
Hide file tree
Showing 7 changed files with 75 additions and 34 deletions.
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,7 @@ cfg/
# *.bin
*.map
341-0020-00.f8
*.sym
*.sym
version.inc
*.bin
!a2vmemnoram.bin
34 changes: 24 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,34 +5,48 @@ OUTPUT = apple2.bin

RAMSIZE = 16K

ASSEMBLE = cl65 -t apple2 -C a2_f8rom.cfg -I ./inc -l $(@:%.bin=%.lst) -Ln $(@:%.bin=%.sym)

VERSION_STR = $(shell git describe --tags --long --always --dirty=-L --broken=-X | tr a-z A-Z)
ifeq ("x$(VERSION_STR)", "x")
VERSION_STR := LOCAL_BUILD
endif

ASSEMBLE = cl65 -t apple2 -C a2_f8rom.cfg -I ./inc -l $(@:%.bin=%.lst) -Ln $(@:%.bin=%.sym) $(QUICKTEST)

CHECKSUM = sha1sum --tag

all: apple2.bin a2vmemnoram.bin

%.bin: %.asm Makefile a2_f8rom.cfg
$(ASSEMBLE) -o $@ $<
%.bin: %.asm Makefile a2_f8rom.cfg | version.inc
$(ASSEMBLE) -o $@ $<
-@$(CHECKSUM) $@

# $(ASSEMBLE) -o $@ $<
version.inc:
@echo ".define VERSION_STR \"$(VERSION_STR)\"" > $@


apple2.bin: inc/marchu_zpsp.asm inc/marchu.asm inc/a2console.asm inc/a2macros.inc inc/a2constants.inc

debug: $(OUTPUT)
ln -sf $< 341-0020-00.f8
$(MAME) apple2p -ramsize $(RAMSIZE) -keepaspect -volume -10 -window -resolution 800x600 -skip_gameinfo -debug -debugger osx
QUICKTEST :=

DEBUGGER := none

debug: DEBUGGER := osx
debug: QUICKTEST := -D QUICKTEST=1
debug: run

# debug: $(OUTPUT)
# ln -sf $< 341-0020-00.f8
# $(MAME) apple2p -ramsize $(RAMSIZE) -keepaspect -volume -10 -window -resolution 800x600 -skip_gameinfo -debug -debugger osx

run: $(OUTPUT)
ln -sf $< 341-0020-00.f8
$(MAME) apple2p -ramsize $(RAMSIZE) -keepaspect -volume -10 -window -resolution 800x600 -skip_gameinfo -debug -debugger none
$(MAME) apple2p -ramsize $(RAMSIZE) -keepaspect -volume -10 -window -resolution 800x600 -skip_gameinfo -debug -debugger $(DEBUGGER)

clean:
rm -f *.lst *.o *.map *.sym
rm -f *.lst *.o *.map *.sym version.inc

showver:
@git describe --tags --long --always --dirty=-L --broken=-X

.PHONY: all test clean showver
.PHONY: all test clean showver version.inc run debug
5 changes: 4 additions & 1 deletion apple2.asm
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,10 @@
; 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.

.list off
.listbytes unlimited
.feature org_per_seg
.feature leading_dot_in_identifiers
.include "version.inc"
.include "inc/a2constants.inc"
.include "inc/a2macros.inc"
.list on
Expand Down Expand Up @@ -104,7 +106,8 @@ test_ram:

.proc show_banner
jsr con_cls
puts_centered_at 22, "APPLE DEAD TEST BY KI3V AND ADRIAN BLACK"
; puts_centered_at 22, "APPLE DEAD TEST BY KI3V AND ADRIAN BLACK"
puts_centered_at 22, .concat( "APPLE DEAD TEST - ", VERSION_STR )
puts_centered_at 23, "TESTING RAM FROM $0200 TO $XXFF"
m_con_goto 23, 31
LDA mu_page_end
Expand Down
Binary file removed apple2.bin
Binary file not shown.
17 changes: 17 additions & 0 deletions inc/a2macros.inc
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,23 @@
.byte 0
.endmacro

.macro inverse_text
.repeat 26, I
.charmap 'A'+I,'A'&$7F+I
.endrepeat
.endmac

.macro normal_text
.repeat 26, I
.charmap 'A'+I,'A'|$80+I
.endrepeat
.endmac
; .macro .inverse string
; .repeat .strlen( string ), i
; .byte .strat( string, i ) & %00111111
; .endrepeat
; .endmacro

; doesn't modify A
.macro inline_beep_xy length, period
.local outer, inner
Expand Down
17 changes: 15 additions & 2 deletions inc/marchu.asm
Original file line number Diff line number Diff line change
Expand Up @@ -69,15 +69,28 @@ FIRST_PAGE = $02

.macro checkbad
beq :+
jsr markbad

; STY mu_ysave
; LDY mu_ptr_hi ; get the page number as index into results array
; ORA results,Y ; collect any bad bits
; STA results,Y ; store the accumulated errors back to the results array
; ORA all_errs ; also store one value that collects all of the bad bits found
; STA all_errs
; LDY mu_ysave
:
.endmac

.proc markbad
STY mu_ysave
LDY mu_ptr_hi ; get the page number as index into results array
ORA results,Y ; collect any bad bits
STA results,Y ; store the accumulated errors back to the results array
ORA all_errs ; also store one value that collects all of the bad bits found
STA all_errs
LDY mu_ysave
:
.endmac
RTS
.endproc

; marchU
; returns bitmask of bad bits in A
Expand Down
31 changes: 11 additions & 20 deletions inc/marchu_zpsp.asm
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ zp_good:
; inline_print pt_msg, TXTLINE21+((40-(pt_end-pt_msg-1))/2)

.proc page_test
; lda #$FF ; simulate error
; ldx #$F0 ; simulate error
; jmp page_error

LDA #0 ; write zero to zp location 0
Expand All @@ -241,47 +241,38 @@ zp_good:
DEY
BNE wz

wr: LDA #$FF
STA $0100,Y ; write to the pages
LDA $00,Y ; check the zp address
wr: STA $0100,Y ; write to the pages
LDX $00,Y ; check the zp address
BNE page_error
LDA #$FF
STA $0200,Y
LDA $00,Y ; check the zp address
LDX $00,Y ; check the zp address
BNE page_error
LDA #$FF
STA $0400,Y
LDA $00,Y ; check the zp address
LDX $00,Y ; check the zp address
BNE page_error
LDA #$FF
STA $0800,Y
LDA $00,Y ; check the zp address
LDX $00,Y ; check the zp address
BNE page_error
LDA #$FF
STA $1000,Y
LDA $00,Y ; check the zp address
LDX $00,Y ; check the zp address
BNE page_error
LDA #$FF
STA $2000,Y
LDA $00,Y ; check the zp address
LDX $00,Y ; check the zp address
BNE page_error
LDA #$FF
STA $4000,Y
LDA $00,Y ; check the zp address
LDX $00,Y ; check the zp address
BNE page_error
LDA #$FF
STA $8000,Y
LDA $00,Y ; check the zp address
LDX $00,Y ; check the zp address
BNE page_error
LDA #$FF
INY
BNE wr

JMP page_ok
.endproc

.proc page_error
TAX ; bat bit mask is in A, save it to X
; TAX ; bat bit mask is in A, save it to X
TXS ; then save it in the SP

STA TXTSET ; text mode
Expand Down

0 comments on commit ab5ba46

Please sign in to comment.