;*--------------------------------------------------------------------------- ; :Program. 9finger.asm ; :Contents. Slave for "9 finger's" from Spaceballs ; :Author. WEPL ; :Version. $Id: 9finger.asm 1.3 2003/10/14 15:56:02 wepl Exp wepl $ ; :History. 13.11.96 - 24.11.96 ; 28.11.96 trackloader delay changed ('60) ; 16.06.97 soundtracker playback fixed ; slave version 2 ; 21.06.97 rts on stfix added ; 24.06.97 keyboard routine fixed ; 15.08.97 update for key managment ; 30.08.97 keyboard external ; 23.08.99 reworked for whdload v10, interlace bug fixed ; 14.10.03 loading delay changed/rewritten for NTSC display ; sprite bug removed ; :Requires. - ; :Copyright. Public Domain ; :Language. 68000 Assembler ; :Translator. Barfly V2.9 ; :To Do. ;---------------------------------------------------------------------------* INCDIR Includes: INCLUDE whdload.i INCLUDE whdmacros.i OUTPUT "dwart:spaceballs/9 fingers/9finger.slave" BOPT O+ ;enable optimizing BOPT OG+ ;enable optimizing BOPT ODd- ;disable mul optimizing BOPT ODe- ;disable mul optimizing BOPT w4- ;disable 64k warnings SUPER STRUCTURE globals,$100 LONG _resload WORD _disk ;====================================================================== _base SLAVE_HEADER ;ws_Security + ws_ID dc.w 10 ;ws_Version dc.w WHDLF_Disk|WHDLF_NoError ;ws_flags dc.l $fb000 ;ws_BaseMemSize dc.l $400 ;ws_ExecInstall dc.w _start-_base ;ws_GameLoader dc.w 0 ;ws_CurrentDir dc.w 0 ;ws_DontCache _keydebug dc.b 0 ;ws_keydebug _keyexit dc.b $59 ;ws_keyexit = F10 _expmem dc.l $4b000 ;ws_ExpMem dc.w _name-_base ;ws_name dc.w _copy-_base ;ws_copy dc.w _info-_base ;ws_info ;============================================================================ IFND .passchk DOSCMD "WDate >T:date" .passchk ENDC _name dc.b "9 fingers",0 _copy dc.b "1990 Spaceballs",0 _info dc.b "Installed by Wepl",10 dc.b "Version 1.3 " INCBIN "T:date" dc.b 0 EVEN ;============================================================================ _start ; A0 = resident loader ;============================================================================ move.l a0,(_resload) ;save for later use move.l a0,a2 ;a2 = _resload _restart2 move.w #1,(_disk) ;actual disk number ;enable caches move.l #WCPUF_Base_WT!WCPUF_Exp_WT!WCPUF_Slave_CB!WCPUF_IC!WCPUF_DC!WCPUF_NWA!WCPUF_SB!WCPUF_BC!WCPUF_SS,d0 move.l #WCPUF_All,d1 jsr (resload_SetCPU,a2) ;install keyboard quitter bsr _SetupKeyboard ;load main lea $80000,a6 ;a6 = exp mem move.l #$1600,d0 ;offset move.l #$1600*16,d1 ;length moveq #1,d2 ;disk move.l a6,a0 ;destination jsr (resload_DiskLoad,a2) lea (-16,a6),a0 move.l a6,(a0)+ ;exp mem clr.l (a0)+ ;??? move.w #-1,(a0)+ ;??? jsr (8,a6) ;decrunch lea $2000,a6 ;a6 = main lea (-$200,a6),a7 move.l a7,a0 .clr clr.l (a0)+ cmp.l a0,a6 bne .clr ;fix soundtracker playback move.l a6,a0 move.l a6,a1 add.l #$1600*16,a1 bsr _dbffix and.w #~INTF_PORTS,$38b6(a6) ;preserve int on patch $5f8(a6),_trackload ;loader patch $4f2(a6),_disk2 ;disk 2 check and wait patch $430(a6),_restart patchs $1c2(a6),_iwait ;interlace lof wait ;remove writing to sprite registers moveq #15,d0 lea $2000+$db46,a0 .spr move.l #$1fe<<16,(a0)+ dbf d0,.spr ;disable caches move.l #WCPUF_Base_NCS!WCPUF_Exp_NCS!WCPUF_Slave_NCS!WCPUF_IC!WCPUF_DC,d0 move.l #WCPUF_All,d1 jsr (resload_SetCPU,a2) jmp (a6) ;--------------- _iwait bsr _waitvb addq.l #2,(a7) btst #7,$dff004 ;original rts ;--------------- _restart move.w #$7fff-INTF_PORTS,_custom+intena move.w #4*50,d0 ;wait n secs .wait bsr _waitvb dbf d0,.wait move.l (_resload),a2 bra _restart2 ;--------------- _disk2 addq.w #1,(_disk) rts ;--------------- ; d0 = starttrack ; d1 = amount tracks ; a0 = address _trackload mulu #11*512,d0 ;offset mulu #11*512,d1 ;size move.w (_disk),d2 move.l d1,d3 ;D3 = size move.l (_resload),a1 move.l a0,a2 ;A2 = destination cmp.l #200000,d1 blo .nodelay move.l (_expmem),a0 ;destination jsr (resload_DiskLoad,a1) move.l (_expmem),a0 ;A0 = source .loop moveq #10,d0 .wait bsr _waitvb dbf d0,.wait move.w #$1600/4-1,d0 .copy move.l (a0)+,(a2)+ dbf d0,.copy sub.l #$1600,d3 bhi .loop rts .nodelay jmp (resload_DiskLoad,a1) ;-------------------------------- _waitvb waitvb rts ;-------------------------------- _exit pea TDREASON_OK.w bra _end _debug pea TDREASON_DEBUG.w _end move.l (_resload),-(a7) add.l #resload_Abort,(a7) rts ;====================================================================== INCDIR Sources:whdload INCLUDE keyboard.s INCLUDE dbffix.s ;====================================================================== END