From 2fd5c6c79b89465f9f3c261bef7dc33b346d2d7b Mon Sep 17 00:00:00 2001 From: Jorj Bauer Date: Sat, 15 Jan 2022 17:39:32 -0500 Subject: [PATCH] work on the test --- tests/diskii-woz-test.asm | 431 ++++++++++++++++++++++++++------------ 1 file changed, 299 insertions(+), 132 deletions(-) diff --git a/tests/diskii-woz-test.asm b/tests/diskii-woz-test.asm index 07ec8b6..fc900ec 100644 --- a/tests/diskii-woz-test.asm +++ b/tests/diskii-woz-test.asm @@ -22,8 +22,35 @@ .endrep .endmacro +.struct iob_t + type .byte ; table type (always $01) + slot .byte ; slot (<<4) + drive .byte ; drive (1/2) + volume .byte ; volume ($00 = all) + track .byte + sector .byte + dct .word ; low/hi pointer to a DCT + data .word ; low/hi pointer to sector data + unused .word + bytes .word ; # bytes to read/write ($00 == 256) + command .byte ; 0=seek, 1=read, 2=write, 4=fmt + retval .byte ; return code + retvol .byte ; return volume + retslot .byte ; return slot + retdrive .byte ; return drive +.endstruct + a_cr = $0d ; Carriage return. +RWTS_GETIOB = $03E3 ; low returned in Y, high A ($B7E8 is the normal IOB) +RWTS = $03D9 ; needs IOB address in Y/A +DOS33_IOB = $B7E8 +IOB = DOS33_IOB +DOS33_SECBUF = $B4BB ; $B4BB-B5BA + +RWTS_WRTDIR = $B037 ; hidden routine in DOS to call RWTS (cf. AAL Vol2, iss 8) +RWTS_WRTCMD = $B041 ; ... which wants to call write by default and we modify it to do something else + F8ROM_YXHEX = $F940 F8ROM_AXHEX = $F941 F8ROM_XHEX = $F944 ; print X register in hex -- kills X,A @@ -50,30 +77,30 @@ DISK_MODEW = $C08F ;; Zero-page addresses used - ;; 00/01: storage pointer for loops in nybble code - ;; 02/03: second storage pointer for loops in nybble code - ;; 04/05: lookup table indexer for the _trans table - ;; FA/FB: DST pointer for memset - ;; FC/FD: pointer to sector buffer - ;; FF: scratch, used when erasing a track -ZP_STORPTR = $00 -ZP_STOR2 = $02 -ZP_TRANSP = $04 -DST = $FA -ZP_SECTP = $FC -ZP_SCRATCH = $FF - + ;; Totally free and clear: 6,7,8,9; eb,ec,ed,ee,ef;fa,fb,fc,fd +ZP_STORPTR = $06 ;06,07 +ZP_STOR2 = $08 ;08,09 +ZP_SCRATCH = $eb ;just eb +ZP_TRANSP = $ec ;ec,ed +DST = $ee ;ee,ef +ZP_SECTP = $fa ;fa,fb +ZP_PRINT = $fc ;fc, fd + .segment "CODE" START JMP Entry Entry + PHP ;save interrupt state + SEI ;disable interrupts + JSR F8ROM_INIT JSR F8ROM_HOME - LDY #>STARTMSG - LDA #ENDMSG ; All done, tell the user - LDA #SECDATA JSR F8ROM_AHEX LDA #SECDATAMSG - LDA #NYBDATA JSR F8ROM_AHEX LDA #NYBDATAMSG - LDA #WPMSG - LDA #WRITEMSG - LDA #NYBDATA ; set up ZP_STORPTR to the start of NYBDATA STA ZP_STORPTR+1 LDA #SECTORMSG - LDA #SECTORMSG2 - LDA #SECTORMSG3 - LDA #SECTORMSG4 - LDA #SECTORMSG5 - LDA #SECDATA + STA ZP_STORPTR+1 + LDA #DOS33_SECBUF + STA ZP_STOR2+1 + LDA #