; Kickwork 3.1
; ------------
; OS3.1 rework by Ratte
; optimized by StingRay
; based on Piru´s Kickwork1.3
start:
bsr.b patch ; Kickwork-Magic ->
lsr.l #2,d2 ; Org.Code from
clr.b $60(a0,d2.w) ; $2457d6/$fc57d6
rts ; back to OS3.1
patch:
tst.w $6a(a3) ; TDU_TRACK
bne.w end ; Track 00 ?
cmp.b #$1,$69(a3) ; TDU_SECTOR
bhi.b end ; Sector 00 or 01?
tst.b $69(a3) ; Check for
beq.b sector00 ; Sector 00
sector01:
lea $78(a3),a0 ; TDU_DATA
move.l (a0),a0 ; BUFFER-POINTER
lea bb_data(pc),a1
move.l a0,d0 ; save a0
lea -$200(a0),a0
cmpm.l (a1)+,(a0)+
bne.b end
cmpm.l (a1)+,(a0)+
bne.b end
cmpm.l (a1)+,(a0)+
bne.b end
move.l d0,a0 ; restore a0
move.l a0,a1
cmp.l #$11114ef9,(A1)+ ; Sector 01 KickHeader ?
bne.b end ; If not EXIT
cmp.l #$00fc00d2,(a1)+ ; Sector 01 KickHeader ?
bne.b end ; If not EXIT
cmp.l #$0000ffff,(a1) ; Sector 01 KickHeader ?
bne.b end ; If not EXIT
moveq #128-1,d0 ; Fill Sector 01
loop1: clr.l (a0)+ ; with
dbf d0,loop1 ; zeros
bra.b end ; leave patch
sector00:
lea $78(a3),a0 ; TDU_DATA
move.l (a0),a0 ; BUFFER-POINTER
move.l a0,a1
cmp.l #"KICK",(a1)+ ; KICK-Disk ?
bne.b end ; If not EXIT
cmp.l #"WORK",(a1)+ ; KICKWORK-Disk ?
bne.b end ; If not EXIT
tst.l (a1) ; Triple-Check
bne.b end ; If not EXIT
moveq #$17,d0
lea bb_data(pc),a1
loop2:
move.l (a1)+,(a0)+ ; Copy OS2.x Bootblock
dbf d0,loop2 ; to the buffer
moveq #$67,d0 ; and fill
loop3:
clr.l (a0)+ ; the rest
dbf d0,loop3 ; with zeros
end:
move.l d4,a0 ; Restore A0
rts
bb_data: ; OS2.x Bootblock
dc.l $444f5300
dc.l $e33d0e73
dc.l $00000370
dc.l $43fa003e
dc.l $70254eae
dc.l $fdd84a80
dc.l $670c2240
dc.l $08e90006
dc.l $00224eae
dc.l $fe6243fa
dc.l $00184eae
dc.l $ffa04a80
dc.l $670a2040
dc.l $20680016
dc.l $70004e75
dc.l $70ff4e75
dc.l $646f732e
dc.l $6c696272
dc.l $61727900
dc.l $65787061
dc.l $6e73696f
dc.l $6e2e6c69
dc.l $62726172
dc.l $79000000