home *** CD-ROM | disk | FTP | other *** search
/ Amiga ACS 1997 #3 / amigaacscoverdisc / games / installers / superwonderboy / src / swboysrc / swboyhd.asm < prev   
Assembly Source File  |  1997-05-25  |  1KB  |  91 lines

  1. ; *** Super WonderBoy Hard Disk Loader V1.0
  2. ; *** Written by Jean-François Fabre
  3.  
  4. ; *** Needs 1.5MB of memory to run
  5. ; *** 1.5MB of fast memory to be able to quit.
  6.  
  7.  
  8.     include    "/lib/libs.i"
  9.     include    "/lib/macros.i"
  10.     include    "/lib/refs.i"
  11.  
  12. _loader:
  13.     Mac_printf    "Super Wonderboy HD Loader V1.0"
  14.     Mac_printf    "Programmed by Jean-François Fabre © 1997"
  15.  
  16.     JSRABS    LoadDisks
  17.     JSRABS    TransfRoutines
  18.  
  19.     moveq.l    #0,D0
  20.     move.l    #CACRF_CopyBack,D1
  21.     JSRABS    Degrade
  22.  
  23.     GO_SUPERVISOR
  24.     SAVE_OSDATA    $80000
  25.     move    #$2700,SR
  26.  
  27.     GETUSRADDR    BootGame
  28.     move.l    D0,A0
  29.     jmp    (A0)
  30.     
  31. _UserPatchRoutines:
  32.     cnop    0,4
  33.  
  34. BootGame:
  35.     JSRGEN    InitTrackDisk
  36.     
  37.     move.w    #2,$1C(A1)
  38.     move.l    #$80C00,$2C(A1)
  39.     move.l    #$33400,$24(A1)
  40.     move.l    #$400,$28(A1)
  41.     JSRGEN    TrackLoadFast
  42.  
  43.     PATCHUSRJMP    $D03C,PatchLoad
  44.     PATCHUSRJSR    $CC22,KbInt
  45.  
  46.     ; **** boot stuff and patch
  47.  
  48.     JSRGEN    FlushCachesHard
  49.  
  50.     nop    
  51.     nop
  52.     JMP    $400.W
  53.     nop
  54.     nop
  55.  
  56. KbInt:
  57.     lea    $CCE5,A0
  58.     cmp.b    #$59,D1
  59.     bne    noquit$
  60.     JSRGEN    InGameExit
  61. noquit$
  62.     rts
  63.  
  64. PatchLoad:
  65.     STORE_REGS
  66.  
  67.     mulu    #$200,D0
  68.     move.l    D0,A0
  69.     moveq.l    #0,D0
  70.     JSRGEN    GetDiskPointer
  71.     add.l    D0,A0
  72.  
  73. copy$
  74.     move.b    (A0)+,(A1)+
  75.     subq.l    #1,D1
  76.     bne    copy$
  77.  
  78.     RESTORE_REGS
  79.     move.l    (A7)+,A0    ; original game
  80.     rts
  81.  
  82.  
  83. _user_pbuffer:
  84.     dc.l    0
  85. _general_pbuffer:
  86.     dc.l    0
  87. _EndUserPatchRoutines:
  88.  
  89.     HD_PARAMS    "swboy.d","CON:20/20/350/200/Super WonderBoy HD Loader",STD_DISK_SIZE,1
  90.  
  91.