From ab5ba46c553c15818c6fd7893b6e947dbeb6f83c Mon Sep 17 00:00:00 2001 From: David Giller <8336210+ki3v@users.noreply.github.com> Date: Thu, 7 Sep 2023 10:13:19 -0700 Subject: [PATCH] Refine page error test Reduce size of RAM test using JSR to markbad Add git-generated version number to binary Start including binary in releases, not repo --- .gitignore | 5 ++++- Makefile | 34 ++++++++++++++++++++++++---------- apple2.asm | 5 ++++- apple2.bin | Bin 2048 -> 0 bytes inc/a2macros.inc | 17 +++++++++++++++++ inc/marchu.asm | 17 +++++++++++++++-- inc/marchu_zpsp.asm | 31 +++++++++++-------------------- 7 files changed, 75 insertions(+), 34 deletions(-) delete mode 100644 apple2.bin diff --git a/.gitignore b/.gitignore index 29d1814..1be4fef 100644 --- a/.gitignore +++ b/.gitignore @@ -5,4 +5,7 @@ cfg/ # *.bin *.map 341-0020-00.f8 -*.sym \ No newline at end of file +*.sym +version.inc +*.bin +!a2vmemnoram.bin \ No newline at end of file diff --git a/Makefile b/Makefile index 8590a6b..26be00e 100644 --- a/Makefile +++ b/Makefile @@ -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 \ No newline at end of file +.PHONY: all test clean showver version.inc run debug \ No newline at end of file diff --git a/apple2.asm b/apple2.asm index 4de3ce4..72f1bdd 100644 --- a/apple2.asm +++ b/apple2.asm @@ -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 @@ -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 diff --git a/apple2.bin b/apple2.bin deleted file mode 100644 index 830b5e5082e77c03ec256fd3f1598daa8a2109cc..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2048 zcmc&#Z)jUp6hAL{f6{h;;t=er!UJXNU_!qLA_(~)nvI8KtS~wdp2LkyMDc?l`xInv zlqZ4a+fqa>k7ndnYtzl?QkcH9NtXALHkTwF>-@0IVOcww-KN;2G0%Hn(vc5U!7si9 z?(dxYJLlbV?m6dua>H=O_2>~Zy3362FsI%zr%srLjLgxsHL@8UGHvo0BLt&y;Nu{~ zL5zb$9wJDebk@cA+hT$IZuDIZI^&aQf1F68{sw|L&_7ooe~bW-5q$(Wa#TO$P&HEo zUC1%*Yx)*-3G?Wf$&Ic;s*Zq~0Fhn8fwrOR?_L*4`C&upuOo+UGxB41<;Z>Jktu$n zzP5>KJeJ5lS= zkV#pQE*3okC6Z;si7=8ki=SOVjY)V#veL>kRP> zy~>b}p&^F+4DDk`X6QMF0u1e8D8i5rI|cHka;x#Lskq+QCKV%3QeipkJG;{HQDfW? z@J=Lb#cc#opeyJ}o7|bzsnPO(&CbUSlDU?1lS7MJezPejH|4R`P2py)Ql75XGV?{m z7*$j*f-G+u0UVJdEhB;hbisnWrzwBXl+QGk0cN+8pD$!8nfY3-f~vV1Ai#Xo0xU*t zkiXc(?{*8>ZsA2HNFCZ&Oz?Ju9ZcXm!u#DqsY_4|`FzYO*rcw?zqaU6h?pUyltbBE zCW~shY7NaTqoQ@`I?60&Q6^ilGK*-gL<0oM9+nuzTD*oTnFW-ulo!xM>S8K|YGpKW z<3>IY_(S$KcETwS&{C6YEj8*ldxQ8>^zuP4hjz6u>9;Ve!&Nm*z21>XW~rLX!a=`D zDgI5msu(m5fgxQz)zmx~V%!WzZ&0%R53s3u)Uk*f3Jl49N)wau9w?B8O3OWZjI|i{ zXkOf>@pO~s_5x3b$z;N-ae9pLR=5P0^N>fb<_N6&&k7UV-X5S{1W^+w1lr3n*mi^2 zmpb;@f3`1>yB*?>36I9*Ipx_u-P!Utj<;2_gRntT$g?whQ)b&0J>a(VHu+A6ynKPT z&+$WE<+CPj`*y_wf6b~Dmgc^mFE30lSXEkq?&Z!*yJcWmw^$*tOJ>&%0xN1TcI*A8 z`6LF}>*(}C@ht=~3(q1?%(DG=4bTtMCz%emg2>b1JfKzJ()0tnnQ@rvFZYlgbUabp zLd;TLYEf7Bbb1qJLR=T+;g%9;$?vtWk9Lc4rYZRPc0Kj@Bq3 z7qeC@x^MT7-A|N)iDEEOPAn!CRIS{OaM)p|Pm~YrPNpg5VwSqiELVf)dz0yYN3+s< z9nB8+pR_bf1wO)q5D`F(h#*CzK|aY33Q1v5Op1e2QVQ{e4+%sFi9`%ZM2ZAtzmNBD y;3STxW-ea(=JL1ST}fx==CipxxSh&|k2`i?YdV!HRg^C;EoQ;_A0F6XzrO&mhdEOK diff --git a/inc/a2macros.inc b/inc/a2macros.inc index 9eb12b8..da69a1e 100644 --- a/inc/a2macros.inc +++ b/inc/a2macros.inc @@ -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 diff --git a/inc/marchu.asm b/inc/marchu.asm index 94ada2b..69dd7bd 100644 --- a/inc/marchu.asm +++ b/inc/marchu.asm @@ -69,6 +69,19 @@ 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 @@ -76,8 +89,8 @@ FIRST_PAGE = $02 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 diff --git a/inc/marchu_zpsp.asm b/inc/marchu_zpsp.asm index eac7b96..26b6ba1 100644 --- a/inc/marchu_zpsp.asm +++ b/inc/marchu_zpsp.asm @@ -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 @@ -241,39 +241,30 @@ 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 @@ -281,7 +272,7 @@ zp_good: .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