Add ZIP rev K.

This commit is contained in:
Eric Smith 2023-07-01 14:52:18 -06:00
parent 06d5238abf
commit dfba493013
3 changed files with 156 additions and 43 deletions

View File

@ -5,6 +5,7 @@ all: zip1.lst zip1.bin zip1-check \
zip3b.lst zip3b.bin zip3b-check \
zip3f.lst zip3f.bin zip3f-check \
zip3h.lst zip3h.bin zip3h-check \
zip3k.lst zip3k.bin zip3k-check \
ezip2a.lst ezip2a.bin ezip2a-check \
ezip2b.lst ezip2b.bin ezip2b-check \
ezip2c.lst ezip2c.bin ezip2c-check \
@ -86,6 +87,16 @@ zip3h-check: zip3h.bin
echo "7523c44811190cbce363eaf9ed04f67780794a86d849470acd5e0b8b6bb4d6a7 zip3h.bin" | sha256sum -c -
zip3k.p zip3k.lst: zip-late.asm
asl zip-late.asm -o zip3k.p -L -OLIST zip3k.lst -D iver='$$030b'
zip3k.bin: zip3k.p
p2bin -r '$$0900-$$27ff' zip3k.p
zip3k-check: zip3k.bin
echo "0fd531fb0366bff94fdc1e4e95fee8ca77d2a513d3dbb5ddc4fd518acbeb0c60 zip3k.bin" | sha256sum -c -
ezip2a.p ezip2a.lst: ezip.asm
asl ezip.asm -o ezip2a.p -L -OLIST ezip2a.lst -D iver='$$0201'

View File

@ -7,40 +7,42 @@
cpu 6502
iver2a equ $0201 ; 2A has exactly four save positions per disk, will only
; The differences between revisions stated here is not comprehensizve.
iver2a equ $0201 ; Has exactly four save positions per disk, will only
; work for games that have up to 32 KiB saves.
; released with A Mind Forever Voyaging r77 850814
; Released with A Mind Forever Voyaging r77 850814
iver2b equ $0202 ; 2B allows disks to have three or four save positions,
iver2b equ $0202 ; Allows disks to have three or four save positions,
; supporting games with up to 46 KiB saves.
; 2B forces CSWL to be COUT1 at start.
; 2B adds "be patient" message to verify.
; 2B radically changes implementation of get_prop_addr,
; Forces CSWL to be COUT1 at start.
; Adds "be patient" message to verify.
; Radically changes implementation of get_prop_addr,
; purpose unknown.
; 2B changes random number generator, purpose unknown.
; 2B changes subroutine Seb96, purpose unknown.
; 2B changes some constants in save and restore,
; Changes random number generator, purpose unknown.
; Changes subroutine Seb96, purpose unknown.
; Changes some constants in save and restore,
; purpose unknown.
; released with Trinity r11 860509
; Released with Trinity r11 860509
iver2c equ $0203 ; 2C makes a change to deselecting output stream 3
iver2c equ $0203 ; Changes deselecting output stream 3
; (table), to prevent table stream stack underflow.
; 2C changes data tables used by random number generator,
; Changes data tables used by random number generator,
; purpose unknown.
; released with Bureaucracy r86 870212
; Released with Bureaucracy r86 870212
iver2d equ $0204 ; 2D changes spaces to tabs in save messages (probably
iver2d equ $0204 ; Changes spaces to tabs in save messages (probably
; by mistake).
; 2D changes a constant in scan_table, purpose unknown.
; released with Bureaucracy r116 870602
; Changes a constant in scan_table, purpose unknown.
; Released with Bureaucracy r116 870602
; No Apple II games with EZIP versions 2E through 2G have been found
iver2h equ $0208 ; 2H removes several calls to HOME.
; 2H changes the tabs in messages back to spaces.
; 2H adds two extra carriage returns at the end of
iver2h equ $0208 ; Removes several calls to HOME.
; Changes the tabs in messages back to spaces.
; Adds two extra carriage returns at the end of
; some messages.
; released with Nord and Bert r19 870723
; Released with Nord and Bert r19 870723
char_tab equ $09
@ -501,8 +503,7 @@ Sd03a: stx Z0e
ldy #rwts_sec_buf_size
bne .lp2a
.loop2: lda rwts_sec_buf,y
.lp2a:
eor rwts_sec_buf-1,y
.lp2a: eor rwts_sec_buf-1,y
tax
lda nib_tab,x
ldx Z0e
@ -791,7 +792,7 @@ denib_tab equ *-$96
; $01 = write 16-sector
; $80 = read 18-sector
rwts_inner:
sta rwts_cmd ; command
sta rwts_cmd
lda #$02
sta Dd475
asl

View File

@ -310,6 +310,7 @@ home equ $fc58
clreol equ $fc9c
rdkey equ $fd0c
cout equ $fded
cout1 equ $fdf0
bell equ $ff3a
org $0900
@ -391,9 +392,9 @@ S093a: stx Z6e
; write secondary buffer (reverse order)
tya
ldy #rwts_sec_buf_size
bne .lp2Z
bne .lp2a
.loop2: lda rwts_sec_buf,y
.lp2Z: eor rwts_sec_buf-1,y
.lp2a: eor rwts_sec_buf-1,y
tax
lda nib_tab,x
ldx Z6e
@ -449,6 +450,8 @@ write_21:
; +6 jsr
if iver<=iver3h
post_nibble:
ldy #$00
.loop1: ldx #rwts_sec_buf_size
@ -465,6 +468,8 @@ post_nibble:
bne .loop2
rts
endif
read_data_field_16:
ldy #$20
@ -525,7 +530,8 @@ read_data_field_16:
bpl .loop12
cmp #$aa ; check for data field epilogue 2nd byte
beq read_address_field_success
read_data_field_16_fail: sec
read_data_field_16_fail:
sec
rts
@ -592,7 +598,7 @@ seek_track:
sta Z6e
sec
sbc Z6c
beq .fwd4
beq .fwd5
bcs .fwd1
eor #$ff
inc D0d3e
@ -603,9 +609,9 @@ seek_track:
bcc .fwd3
lda Z6d
.fwd3: cmp #$0c
bcs denib_tab
bcs .fwd4
tay
sec
.fwd4: sec
jsr .subr1
lda motor_on_time_tab,y
jsr delay
@ -616,7 +622,7 @@ seek_track:
jsr delay
inc Z6d
bne .loop1
.fwd4: jsr delay
.fwd5: jsr delay
clc
.subr1: lda D0d3e
.subr2: and #$03
@ -628,6 +634,13 @@ seek_track:
.rtn: rts
if iver>=iver3k
align $0100,$00
endif
if iver<=iver3h
delay: ldx #$11
.loop1: dex
bne .loop1
@ -639,6 +652,28 @@ delay: ldx #$11
bne delay
rts
endif
if iver>=iver3k
S0cfc: sta Z6c
jsr S0d1f
lda D0d3e,y
bit Z6a
bmi L0d0b
lda D0d46,y
L0d0b: sta D0d3e
lda Z6c
bit Z6a
bmi L0d19
sta D0d46,y
bpl L0d1c
L0d19: sta D0d3e,y
L0d1c: jmp seek_track
endif
motor_on_time_tab:
fcb $01,$30,$28,$24,$20,$1e,$1d,$1c
@ -675,6 +710,24 @@ denib_tab equ *-$96
fcb $3e,$3f
if iver>=iver3k
align $0100,$00
delay: ldx #$11
.loop1: dex
bne .loop1
inc Z73
bne .fwd1
inc Z74
.fwd1: sec
sbc #$01
bne delay
rts
endif
; On entry:
; A = command
; $00 = read 16-sector
@ -803,18 +856,31 @@ L0cc2: ldy rwts_sector ; logical sector number
lda D0835,y ; map to physical sector number via interleave table in boot1
cmp Z70 ; does it match physical sector number?
bne L0c80 ; no
plp
bcs L0ceb
jsr read_data_field_16
if iver<=iver3h
php
bcs L0c80
plp
else
bcc L0d08
clc
php
bcc L0c80
L0d08:
endif
ldx #$00
stx Z6d
jsr post_nibble
ldx D0d50
L0cdf: lda #$00
clc
bcc L0ce5
@ -836,6 +902,8 @@ S0cf4: asl
rts
if iver<=iver3h
S0cfc: sta Z6c
jsr S0d1f
lda D0d3e,y
@ -851,6 +919,8 @@ L0d0b: sta D0d3e
L0d19: sta D0d3e,y
L0d1c: jmp seek_track
endif
S0d1f: txa
lsr
@ -875,6 +945,28 @@ S0d26: pha
.fwd1: sta D0d3e,y
.rtn: rts
if iver>=iver3k
post_nibble:
ldy #$00
.loop1: ldx #rwts_sec_buf_size
.loop2: dex
bmi .loop1
lda rwts_pri_buf,y
lsr rwts_sec_buf,x
rol
lsr rwts_sec_buf,x
rol
sta (rwts_buf),y
iny
cpy Z6d
bne .loop2
rts
endif
D0d3e: fcb $00,$00,$00,$00,$00,$00,$00,$00
D0d46: fcb $00,$00,$00,$00,$00,$00,$00,$00
D0d4e: fcb $00
@ -1077,7 +1169,7 @@ S0e91: prt_msg position
lda Zf1
jsr S0e02
.loop2: jsr S11c5
cmp #$0d
cmp #char_cr
beq .fwd3
sec
sbc #'1'
@ -1103,10 +1195,10 @@ S0e91: prt_msg position
lda D0e34
jsr S0e02
.loop3: jsr S11c5
cmp #$0d
cmp #char_cr
beq .fwd6
sec
sbc #$31
sbc #'1'
cmp #$07
bcc .fwd7
jsr bell
@ -2233,6 +2325,14 @@ op_show_status:
sta cursrh
pla
sta cur80h
if iver>=iver3k
ldx D172b
beq .fwd13
sta cursrh
.fwd13:
endif
jsr vtab
ldx #$ff
stx Zdf
@ -2263,6 +2363,13 @@ interp_start:
sta Z60
sta Z61
if iver>=iver3k
lda #cout1>>8
sta cswl+1
lda #cout1&$ff
sta cswl
endif
ldx #$00
stx rwts_sector
stx Zec
@ -2514,14 +2621,8 @@ op_c0_ff:
cmp #$e0
bcs .fwd6
jmp L19b3
.fwd6:
if iver==iver3f
ldx #$94
else
ldx #$85
endif
ldy #$1b
.fwd6: ldx #D1b94&$ff
ldy #D1b94>>8
and #$1f
cmp #$0c
bcc L1935
@ -2917,7 +3018,7 @@ D1b62: fdb int_err_04 ; [illegal]
; VAR instructions (0-4 operands), opcodes $e0..$ff
fdb op_call
D1b94: fdb op_call
fdb op_storew
fdb op_storeb
fdb op_put_prop