INCDIR "Include:" INCLUDE whdload.i _base SLAVE_HEADER ;ws_Security + ws_ID dc.w 10 ;ws_Version dc.w WHDLF_NoError|WHDLF_ClearMem ;ws_flags dc.l $80000 ;ws_BaseMemSize dc.l 0 ;ws_ExecInstall dc.w _Start-_base ;ws_GameLoader dc.w _dir-_base ;ws_CurrentDir dc.w 0 ;ws_DontCache _keydebug dc.b 0 ;ws_keydebug _keyexit dc.b $59 ;ws_keyexit = F10 _expmem dc.l 0 dc.w _name-_base ;ws_name dc.w _copy-_base ;ws_copy dc.w _info-_base ;ws_info _dir dc.b "data",0 _name dc.b "Mean Streets",0 _copy dc.b "1990 US Gold",0 _info dc.b "installed & fixed by Bored Seal",10 dc.b "V1.2 (17-Feb-2006)",0 even _Start lea (_resload,pc),a1 move.l a0,(a1) ;save for later using move.l a0,a2 lea filename,a0 lea $200,a1 move.l a1,-(sp) jsr (resload_LoadFile,a2) move.l (sp),a0 jsr (resload_CRC16,a2) move.l (sp)+,a0 move.l d0,-(sp) suba.l a1,a1 jsr resload_Relocate(a2) move.l (sp)+,d0 lea $100,a0 ;snoop mode fix move.l #$fffffffe,(a0) move.l a0,$dff080 cmp.w #$c82e,d0 beq German cmp.w #$8a,d0 beq French cmp.w #$1d99,d0 bne Unsupported English move.w #$4e75,$63c8 ;BFD access move.w #$4e75,$63e6 move.w #$4ef9,$5d8a pea LoadFile move.l (sp)+,$5d8c move.w #$4ef9,$61ca pea SaveGame move.l (sp)+,$61cc move.w #$4ef9,$618c pea LoadGame move.l (sp)+,$618e move.w #$4ef9,$5d4c pea Relocate move.l (sp)+,$5d4e move.w #$4eb9,$678e ;fix keyboard pea KBDelay move.l (sp)+,$6790 move.w #$4eb9,$59c0 pea Patch_ENG move.l (sp)+,$59c2 jmp $200 German move.w #$4e75,$642a ;BFD access move.w #$4e75,$6448 move.w #$4ef9,$5dec pea LoadFile move.l (sp)+,$5dee move.w #$4ef9,$622c pea SaveGame move.l (sp)+,$622e move.w #$4ef9,$61ee pea LoadGame move.l (sp)+,$61f0 move.w #$4ef9,$5dae pea Relocate move.l (sp)+,$5db0 move.w #$4eb9,$67f0 ;fix keyboard pea KBDelay move.l (sp)+,$67f2 move.w #$4eb9,$5a22 pea Patch_GER move.l (sp)+,$5a24 jmp $200 French move.w #$4e75,$6418 ;BFD access move.w #$4e75,$6436 move.w #$4ef9,$5dda pea LoadFile move.l (sp)+,$5ddc move.w #$4ef9,$621a pea SaveGame move.l (sp)+,$621c move.w #$4ef9,$61dc pea LoadGame move.l (sp)+,$61de move.w #$4ef9,$5d9c pea Relocate move.l (sp)+,$5d9e move.w #$4eb9,$67de ;fix keyboard pea KBDelay move.l (sp)+,$67e0 move.w #$4eb9,$5a10 pea Patch_FRE move.l (sp)+,$5a12 jmp $200 Patch_GER lea $5a46,a0 cmp.l #$61000102,$c93a ;FRONT.PRG bne go move.w #$6002,$c93a ;manual protection jmp (a6) Patch_FRE lea $5a34,a0 cmp.l #$61000102,$ca0a ;FRONT.PRG bne go move.w #$6002,$ca0a ;manual protection jmp (a6) Patch_ENG lea $59e4,a0 cmp.l #$61000102,$c8e6 ;FRONT.PRG bne go move.w #$6002,$c8e6 ;manual protection ; move.w #$4e75,$d1b8 ;fix snoop bug - disable delays go jmp (a6) Relocate LEA ($18,A0),A0 MOVE.L (A0)+,D0 CMPI.W #$3E9,D0 BNE.B ccr1 MOVE.L (A0)+,D0 LSL.L #2,D0 LEA (A0,D0.L),A1 MOVE.L (A1)+,D0 CMPI.W #$3EC,D0 BNE.B ccr0 ADDQ.W #8,A1 MOVE.L A0,D1 lab1 MOVE.L (A1)+,D0 BEQ.B ccr0 LEA (A0,D0.L),A2 ADD.L D1,(A2) BRA.B lab1 ccr0 MOVE.W #0,CCR RTS ccr1 MOVE.W #1,CCR RTS KBDelay moveq #2,d1 BM_1 move.w d1,-(sp) move.b $dff006,d1 ; VPOS BM_2 cmp.b $dff006,d1 beq BM_2 move.w (sp)+,d1 dbf d1,BM_1 clr.b $bfec01 rts LoadGame lea $700f8,a0 ;correct adress movem.l d0-d2/a0-a2,-(sp) sub.l #$6d5,d0 ;substract offset mulu.w #$200,d0 move.l #$200,d1 ;size of savegame moveq #1,d2 move.l (_resload,pc),a2 jsr (resload_DiskLoad,a2) movem.l (sp)+,d0-d2/a0-a2 rts SaveGame movem.l d0-d2/a0-a2,-(sp) sub.l #$6d5,d0 ;substract offset mulu.w #$200,d0 move.l d0,d1 move.l #$200,d0 move.l a0,a1 lea savedisk,a0 move.l (_resload,pc),a2 jsr (resload_SaveFileOffset,a2) movem.l (sp)+,d0-d2/a0-a2 rts LoadFile movem.l d1/a0-a2,-(sp) move.l (a0)+,a1 ;destination bsr FixName ;correct filename move.l (_resload,pc),a2 jsr (resload_LoadFile,a2) movem.l (sp)+,d1/a0-a2 ;result: d0=filesize rts FixName cmp.w #'A:',(a0) bne next lea 3(a0),a0 ;skip "A:\" path next cmp.b #$5c,(a0) bne fixpath lea 1(a0),a0 ;skip "\" path fixpath move.l a0,a2 ;save filename adr replace tst.b (a2) ;end of filename string? beq done cmp.b #$5c,(a2) bne nextletter move.b #'/',(a2) ;insert correct "/" path nextletter lea 1(a2),a2 bra replace done rts Unsupported pea TDREASON_WRONGVER move.l (_resload),-(a7) add.l #resload_Abort,(a7) rts _resload dc.l 0 filename dc.b "boot.prg",0 savedisk dc.b "Disk.1",0