Advertisement
Guest User

ab3d tk

a guest
Apr 24th, 2018
193
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2.  
  3. ;
  4. ; +-------------------------------------------------------------------------+
  5. ; |   This file has been generated by The Interactive Disassembler (IDA)    |
  6. ; |       Copyright (c) 2011 Hex-Rays, <support@hex-rays.com>       |
  7. ; |          License info: 48-327F-7274-B7              |
  8. ; |                ESET spol. s r.o.                |
  9. ; +-------------------------------------------------------------------------+
  10. ;
  11. ; Input MD5   : 10BD63309F0A6A4FF639D7EE1F78A015
  12. ; Input CRC32 : 055E2965
  13.  
  14. ; File Name   : Z:\home\masta\Downloads\tkgrtg
  15. ; Format      : Amiga hunk file
  16.  
  17. ; Processor:        68K
  18. ; Target Assembler: 680x0 Assembler in MRI compatible mode
  19. ; This file should be compiled with "as -M"
  20.  
  21. ; ===========================================================================
  22.  
  23. ; Segment type: Pure code
  24. ; segment "CODE"
  25.  
  26. ; =============== S U B R O U T I N E =======================================
  27.  
  28.  
  29.         global OpenLibs
  30. OpenLibs:               ; DATA XREF: ahi_init+E2o ahi_end+24o ...
  31.         movea.l (loc_4).w,a6
  32.  
  33. loc_4:                  ; DATA XREF: OpenLibsr
  34.         move.l  a6,(_SysBase).l
  35.         suba.l  a1,a1
  36.         jsr -$126(a6)
  37.         movea.l d0,a4
  38.         moveq   #$24,d0 ; '$'
  39.         lea (DOSName).l,a1  ; "dos.library"
  40.         jsr -$228(a6)
  41.         move.l  d0,(_DOSBase).l
  42.         beq.s   loc_4C
  43.  
  44. loc_26:                 ; DATA XREF: DATA:00012D4Co
  45.                     ; DATA:0001CDACo ...
  46.         move.l  $AC(a4),d0
  47.         beq.s   loc_6A
  48.         move.l  a6,-(sp)
  49.  
  50. loc_2E:
  51.         movea.l (_DOSBase).l,a6
  52.         jsr -$36(a6)
  53.  
  54. loc_38:                 ; DATA XREF: DATA:0001CEF0o
  55.                     ; DATA:0001CF9Eo ...
  56.         move.l  d0,(_stdin).l
  57.         jsr -$3C(a6)
  58.         move.l  d0,(_stdout).l
  59.         movea.l (sp)+,a6
  60.         bra.s   loc_B8
  61. ; ---------------------------------------------------------------------------
  62.  
  63. loc_4C:                 ; CODE XREF: OpenLibs+24j
  64.                     ; DATA XREF: DATA:mnu_MYMASTERMENUo ...
  65.         move.l  #unk_38007,d7
  66.         jsr -$6C(a6)
  67.         tst.l   $AC(a4)
  68.         bne.s   loc_66
  69.         bsr.w   getWbMsg
  70.         movea.l d0,a2
  71.         bsr.w   repWbMsg
  72.  
  73. loc_66:                 ; CODE XREF: OpenLibs+5Aj
  74.         moveq   #$14,d0
  75.         rts
  76. ; ---------------------------------------------------------------------------
  77.  
  78. loc_6A:                 ; CODE XREF: OpenLibs+2Aj
  79.         bsr.w   getWbMsg
  80.         move.l  d0,(_WBenchMsg).l
  81.         movea.l (_DOSBase).l,a6
  82.         move.l  #_AppWindow,d1  ; "CON:0/0/640/200/TKGRTG Output/WAIT/SIMP"...
  83.         move.l  #$3ED,d2
  84.         jsr -$1E(a6)
  85.         move.l  d0,(WbOutput).l
  86.         bne.s   loc_96
  87.         moveq   #$14,d2
  88.         bra.s   exit2
  89. ; ---------------------------------------------------------------------------
  90.  
  91. loc_96:                 ; CODE XREF: OpenLibs+90j
  92.         move.l  d0,(_stdin).l
  93.  
  94. loc_9C:                 ; DATA XREF: DATA:00012D54o
  95.                     ; DATA:00012D94o
  96.         move.l  d0,(_stdout).l
  97.         move.l  d0,$9C(a4)
  98.         move.l  d0,$A0(a4)
  99.         lsl.l   #2,d0
  100.         movea.l d0,a0
  101.         move.l  8(a0),d0
  102.         beq.s   loc_B8
  103.         move.l  d0,$A4(a4)
  104.  
  105. loc_B8:                 ; CODE XREF: OpenLibs+4Aj OpenLibs+B2j
  106.         bsr.s   sub_BE
  107.         moveq   #0,d2
  108.         bra.s   exit2
  109. ; End of function OpenLibs
  110.  
  111.  
  112. ; =============== S U B R O U T I N E =======================================
  113.  
  114.  
  115. sub_BE:                 ; CODE XREF: OpenLibs:loc_B8p
  116.  
  117. ; FUNCTION CHUNK AT 00000B36 SIZE 00000082 BYTES
  118.  
  119.         movea.l (_SysBase).l,a6
  120.         moveq   #$24,d0 ; '$'
  121.  
  122. loc_C6:                 ; DATA XREF: DATA:00012E14o
  123.         lea (intname).l,a1  ; "intuition.library"
  124.         jsr -$228(a6)
  125.         move.l  d0,(_IntuitionBase).l
  126.         beq.s   closelibs
  127.         bsr.w   loadconfig
  128.         bsr.w   ahi_init
  129.         bsr.w   rtg_init
  130.         beq.s   closelibs
  131.         bsr.w   initstuff
  132.         bsr.w   Timer_Open
  133.         jsr _InitLowLevel
  134.         bra.w   menu
  135. ; ---------------------------------------------------------------------------
  136.  
  137. exit2:                  ; CODE XREF: OpenLibs+94j OpenLibs+BCj ...
  138.         movea.l (_DOSBase).l,a6
  139.  
  140. loc_FE:                 ; DATA XREF: DATA:00012E0Co
  141.         move.l  (WbOutput).l,d1
  142.         beq.s   loc_10A
  143.         jsr -$24(a6)
  144.  
  145. loc_10A:                ; CODE XREF: sub_BE+46j
  146.         movea.l a6,a1
  147.         movea.l (_SysBase).l,a6
  148.         jsr -$19E(a6)
  149.         movea.l (_WBenchMsg).l,a2
  150.         move.l  a2,d0
  151.         beq.s   loc_122
  152.         bsr.s   repWbMsg
  153.  
  154. loc_122:                ; CODE XREF: sub_BE+60j
  155.         movea.l (_SysBase).l,a6
  156.         suba.l  a1,a1
  157.         jsr -$126(a6)
  158.         movea.l d0,a4
  159.         movea.l $B0(a4),a5
  160.         suba.l  #4,a5
  161.         movea.l a5,sp
  162.         moveq   #0,d0
  163.         rts
  164. ; ---------------------------------------------------------------------------
  165.  
  166. failed:                 ; DATA XREF: DATA:00012D9Co
  167.         moveq   #$FFFFFFEC,d2
  168.  
  169. closelibs:              ; CODE XREF: sub_BE+18j sub_BE+26j ...
  170.         jsr _CloseLowLevel
  171.         bsr.w   Timer_Close
  172.         bsr.w   rtg_end
  173.         tst.w   (ahi_sound).l
  174.         beq.s   loc_15C
  175.         bsr.w   ahi_end
  176.  
  177. loc_15C:                ; CODE XREF: sub_BE+98j
  178.         movea.l (_SysBase).l,a6
  179.         move.l  (_IntuitionBase).l,d0
  180.         beq.s   loc_170
  181.         movea.l d0,a1
  182.         jsr -$19E(a6)
  183.  
  184. loc_170:                ; CODE XREF: sub_BE+AAj
  185.         tst.l   d2
  186.         beq.s   loc_176
  187.         bra.s   exit2
  188. ; ---------------------------------------------------------------------------
  189.  
  190. loc_176:                ; CODE XREF: sub_BE+B4j
  191.         moveq   #$14,d0
  192.         rts
  193. ; End of function sub_BE
  194.  
  195.  
  196. ; =============== S U B R O U T I N E =======================================
  197.  
  198.  
  199. repWbMsg:               ; CODE XREF: OpenLibs+62p sub_BE+62p
  200.         jsr -$84(a6)
  201.         movea.l a2,a1
  202.         jsr -$17A(a6)
  203.         rts
  204. ; End of function repWbMsg
  205.  
  206.  
  207. ; =============== S U B R O U T I N E =======================================
  208.  
  209.  
  210. getWbMsg:               ; CODE XREF: OpenLibs+5Cp
  211.                     ; OpenLibs:loc_6Ap
  212.         lea $5C(a4),a0
  213.         jsr -$180(a6)
  214.  
  215. loc_18E:                ; DATA XREF: DATA:00012D5Co
  216.         lea $5C(a4),a0
  217.         jsr -$174(a6)
  218.         rts
  219. ; End of function getWbMsg
  220.  
  221.  
  222. ; =============== S U B R O U T I N E =======================================
  223.  
  224.  
  225. rtg_init:               ; CODE XREF: sub_BE+22p
  226.         movea.l (_SysBase).l,a6
  227.         lea (rtgname).l,a1  ; "rtgmaster.library"
  228.         moveq   #$E,d0
  229.         jsr -$228(a6)
  230.         move.l  d0,(_RtgBase).l
  231.         beq.w   loc_27E
  232.         movea.l d0,a6
  233.         lea (srtags).l,a0
  234.         jsr -$60(a6)
  235.         move.l  d0,(gamescreenreq).l
  236.         beq.w   rtg_error
  237.         lea (textsrtags).l,a0
  238.         jsr -$60(a6)
  239.         move.l  d0,(textscreenreq).l
  240.         beq.w   rtg_error
  241.  
  242. loc_1DE:                ; DATA XREF: DATA:00012DF4o
  243.         movea.l (gamescreenreq).l,a0
  244.         lea (sctags).l,a1
  245.         jsr -$1E(a6)
  246.         move.l  d0,(gamescreen).l
  247.  
  248. loc_1F4:                ; DATA XREF: DATA:00012D8Co
  249.                     ; DATA:00012E34o ...
  250.         beq.w   loc_29E
  251.         movea.l (gamescreen).l,a0
  252.         jsr -$13E(a6)
  253.         move.l  d0,(rtgport).l
  254.         beq.w   loc_2AA
  255.         movea.l (gamescreen).l,a0
  256.         lea (gs_gdatatags).l,a1 ; "€"
  257.         jsr -$48(a6)
  258.         movea.l (gamescreenreq).l,a0
  259.         jsr -$66(a6)
  260.         clr.l   (gamescreenreq).l
  261.         movea.l (gamescreen).l,a0
  262.         lea (gamepal).l,a1
  263.         jsr -$30(a6)
  264.  
  265. loc_23C:                ; CODE XREF: rtg_init+128j
  266.         movea.l (gamescreen).l,a0
  267.         jsr -$36(a6)
  268.         move.l  d0,(vidm_mainbuffer_ptr).l
  269.         beq.s   loc_2B6
  270.  
  271. loc_24E:                ; CODE XREF: rtg_init+138j
  272.         movea.l (gamescreen).l,a0
  273.         moveq   #2,d0
  274.  
  275. loc_256:                ; DATA XREF: DATA:00012DFCo
  276.         jsr -$42(a6)
  277.         move.l  d0,(vidm_fontbuffer_ptr).l
  278.         beq.s   loc_2C6
  279.         movea.l (gamescreen).l,a0
  280.         lea (clearpointer).l,a1
  281.         moveq   #$10,d0
  282.         move.l  d0,d1
  283.         moveq   #$FFFFFFF1,d2
  284.         moveq   #$FFFFFFF9,d3
  285.         jsr -$120(a6)
  286.         moveq   #1,d0
  287.         rts
  288. ; ---------------------------------------------------------------------------
  289.  
  290. loc_27E:                ; CODE XREF: rtg_init+18j
  291.         lea (es_openlibfail).l,a1
  292.         lea (error_report_args).l,a3
  293.         move.l  #rtgname,(a3)   ; "rtgmaster.library"
  294.         move.l  #$E,4(a3)
  295.         bsr.w   error_report
  296.         bra.s   rtg_error
  297. ; ---------------------------------------------------------------------------
  298.  
  299. loc_29E:                ; CODE XREF: rtg_init:loc_1F4j
  300.         lea (es_openrtgscreenfail).l,a1
  301.         bsr.w   error_report
  302.         bra.s   rtg_error
  303. ; ---------------------------------------------------------------------------
  304.  
  305. loc_2AA:                ; CODE XREF: rtg_init+70j
  306.         lea (es_initrtgrdcmpfail).l,a1
  307.         bsr.w   error_report
  308.         bra.s   rtg_error
  309. ; ---------------------------------------------------------------------------
  310.  
  311. loc_2B6:                ; CODE XREF: rtg_init+B4j
  312.         lea (es_lockrtgscreenfail).l,a1
  313.         bsr.w   error_report
  314.         bne.w   loc_23C
  315.         bra.s   rtg_error
  316. ; ---------------------------------------------------------------------------
  317.  
  318. loc_2C6:                ; CODE XREF: rtg_init+C8j
  319.         lea (es_getbufadrfail).l,a1
  320.         bsr.w   error_report
  321.         bne.w   loc_24E
  322.         bra.w   *+4
  323.  
  324. rtg_error:              ; CODE XREF: rtg_init+2Ej rtg_init+42j ...
  325.         moveq   #0,d0
  326. ; End of function rtg_init
  327.  
  328.  
  329. ; =============== S U B R O U T I N E =======================================
  330.  
  331.  
  332. rtg_end:                ; CODE XREF: sub_BE+8Ep
  333.         move.l  d0,-(sp)
  334.         movea.l (_RtgBase).l,a6
  335.         move.l  (textscreenreq).l,d0
  336.         beq.s   loc_322
  337.         movea.l d0,a0
  338.         jsr -$66(a6)
  339.         clr.l   (textscreenreq).l
  340.         tst.l   (vidm_mainbuffer_ptr).l
  341.         beq.s   loc_30E
  342.         movea.l (gamescreen).l,a0
  343.         jsr -$3C(a6)
  344.         clr.l   (vidm_mainbuffer_ptr).l
  345.  
  346. loc_30E:                ; CODE XREF: rtg_end+22j
  347.         move.l  (gamescreen).l,d0
  348.         beq.s   loc_322
  349.         movea.l d0,a0
  350.         jsr -$24(a6)
  351.         clr.l   (gamescreen).l
  352.  
  353. loc_322:                ; CODE XREF: rtg_end+Ej rtg_end+3Aj
  354.         move.l  (gamescreenreq).l,d0
  355.         beq.s   loc_336
  356.         movea.l d0,a0
  357.         jsr -$66(a6)
  358.  
  359. loc_330:                ; DATA XREF: DATA:SCROLLSHADESo
  360.         clr.l   (gamescreenreq).l
  361.  
  362. loc_336:                ; CODE XREF: rtg_end+4Ej
  363.         movea.l (_SysBase).l,a6
  364.         move.l  (_RtgBase).l,d0
  365.         beq.s   loc_350
  366.         movea.l d0,a1
  367.         jsr -$19E(a6)
  368.         clr.l   (_RtgBase).l
  369.  
  370. loc_350:                ; CODE XREF: rtg_end+68j
  371.         move.l  (sp)+,d0
  372.         rts
  373. ; End of function rtg_end
  374.  
  375.  
  376. ; =============== S U B R O U T I N E =======================================
  377.  
  378.  
  379. rtg_set_gs_pal:             ; CODE XREF: menu_readmainmenu+7Ap
  380.                     ; mnu_viewcredz+8p ...
  381.         movem.l d0-a0/a2-a6,-(sp)
  382.         movea.l (_RtgBase).l,a6
  383.         movea.l (gamescreen).l,a0
  384.         jsr -$30(a6)
  385.         movem.l (sp)+,d0-a0/a2-a6
  386.         rts
  387. ; End of function rtg_set_gs_pal
  388.  
  389.  
  390. ; =============== S U B R O U T I N E =======================================
  391.  
  392.  
  393. rtg_gs_cls:             ; CODE XREF: mnu_clearscreenp
  394.                     ; mnu_init+24p ...
  395.         movem.l d0-d3/a0-a1/a6,-(sp)
  396.         movea.l (_RtgBase).l,a6
  397.         movea.l (gamescreen).l,a0
  398.         suba.l  a1,a1
  399.         moveq   #0,d0
  400.         moveq   #0,d1
  401.         move.l  (gs_width).l,d2
  402.         move.l  (gs_height).l,d3
  403.         jsr -$C0(a6)
  404.         movea.l (gamescreen).l,a0
  405.         jsr -$AE(a6)
  406.         movem.l (sp)+,d0-d3/a0-a1/a6
  407.         rts
  408. ; End of function rtg_gs_cls
  409.  
  410.  
  411. ; =============== S U B R O U T I N E =======================================
  412.  
  413.  
  414. rtg_initmenuscreen:         ; CODE XREF: rtg_initmenuscreen+58j
  415.                     ; sub_BB8+13Ep
  416.         movea.l (_RtgBase).l,a6
  417.         movea.l (gamescreen).l,a0
  418.         moveq   #0,d0
  419.         jsr -$42(a6)
  420.         move.l  d0,(vidm_mainbuffer_ptr).l
  421.         beq.s   loc_3F2
  422.         movea.l (gamescreen).l,a0
  423.         suba.l  a1,a1
  424.         moveq   #0,d0
  425.         moveq   #0,d1
  426.         move.l  (gs_width).l,d2
  427.         move.l  (gs_height).l,d3
  428.         jsr -$C0(a6)
  429.         movea.l (gamescreen).l,a0
  430.         jsr -$AE(a6)
  431.         movea.l (gamescreen).l,a0
  432.         moveq   #0,d0
  433.         jsr -$2A(a6)
  434.         rts
  435. ; ---------------------------------------------------------------------------
  436.  
  437. loc_3F2:                ; CODE XREF: rtg_initmenuscreen+18j
  438.         lea (es_getbufadrfail).l,a1
  439.         bsr.w   error_report
  440.         bne.s   rtg_initmenuscreen
  441.  
  442. loc_3FE:                ; DATA XREF: DATA:00012E44o
  443.         bra.w   cleanup
  444. ; End of function rtg_initmenuscreen
  445.  
  446.  
  447. ; =============== S U B R O U T I N E =======================================
  448.  
  449.  
  450. rtg_copyborder:             ; CODE XREF: PLAYTHEGAME+18p
  451.                     ; changescreensize+82p
  452.         movea.l (_RtgBase).l,a6
  453.         movea.l (gamescreen).l,a0
  454.         movea.l (vidm_mainbuffer_ptr).l,a1
  455.         lea (border8).l,a2
  456.         moveq   #0,d0
  457.         move.l  (gs_height).l,d1
  458.         sub.w   #$18,d1
  459.         move.l  #$140,d2
  460.         move.l  #$10,d3
  461.         moveq   #0,d4
  462.         moveq   #0,d5
  463.         jsr -$90(a6)
  464.         movea.l (gamescreen).l,a0
  465.         suba.l  a1,a1
  466.         movea.w #1,a2
  467.         moveq   #0,d0
  468.         moveq   #0,d1
  469.         moveq   #0,d2
  470.         moveq   #0,d3
  471.         move.l  #$140,d4
  472.         move.l  #$100,d5
  473.         move.l  #$C0,d6 ; 'À'
  474.         jsr -$BA(a6)
  475.         clr.w   (OldAmmo).l
  476.         clr.w   (OldEnergy).l
  477.         rts
  478. ; End of function rtg_copyborder
  479.  
  480.  
  481. ; =============== S U B R O U T I N E =======================================
  482.  
  483.  
  484. rtg_initbuf3:               ; CODE XREF: PLAYTHEGAME+1Cp
  485.         movea.l (_RtgBase).l,a6
  486.         movea.l (gamescreen).l,a0
  487.         movea.w #2,a1
  488.         moveq   #0,d0
  489.         moveq   #0,d1
  490.         move.l  (gs_width).l,d2
  491.         move.l  (gs_height).l,d3
  492.         jsr -$C0(a6)
  493.         movea.l (gamescreen).l,a0
  494.         moveq   #2,d0
  495.         jsr -$42(a6)
  496.         move.l  d0,(vidm_fontbuffer_ptr).l
  497.         movea.l (gamescreen).l,a0
  498.  
  499. loc_4AE:                ; DATA XREF: DATA:memlisto
  500.         movea.l (vidm_fontbuffer_ptr).l,a1
  501.         lea (borderchars8).l,a2
  502.         moveq   #0,d0
  503.         moveq   #0,d1
  504.         move.l  #$140,d2
  505.         moveq   #$1E,d3
  506.         moveq   #0,d4
  507.         moveq   #0,d5
  508.         jsr -$90(a6)
  509.         movea.l (gamescreen).l,a0
  510.         moveq   #2,d0
  511.         jsr -$42(a6)
  512.         move.l  d0,(vidm_fontbuffer_ptr).l
  513.         movea.l (gamescreen).l,a0
  514.         movea.l (vidm_fontbuffer_ptr).l,a1
  515.         lea (SCROLLCHARS).l,a2
  516.         moveq   #0,d0
  517.         moveq   #$1F,d1
  518.         move.l  #$140,d2
  519.         moveq   #$3C,d3 ; '<'
  520.         moveq   #0,d4
  521.         moveq   #0,d5
  522.         jsr -$90(a6)
  523.         rts
  524. ; End of function rtg_initbuf3
  525.  
  526.  
  527. ; =============== S U B R O U T I N E =======================================
  528.  
  529.  
  530. rtg_clearbuffer:            ; CODE XREF: PLAYTHEGAME+4p
  531.                     ; PLAYTHEGAME+Ap
  532.         movea.l (_RtgBase).l,a6
  533.         movea.l (gamescreen).l,a0
  534.         moveq   #0,d0
  535.         moveq   #0,d1
  536.         move.l  (gs_width).l,d2
  537.         move.l  (gs_height).l,d3
  538.         jsr -$C0(a6)
  539.         rts
  540. ; End of function rtg_clearbuffer
  541.  
  542.  
  543. ; =============== S U B R O U T I N E =======================================
  544.  
  545.  
  546. rtg_16b_aligned_test:           ; CODE XREF: PLAYTHEGAME:loc_1F5Ep
  547.         cmpi.w  #1,(screencopy).l
  548.         bne.s   locret_556
  549.         move.l  (vidm_mainbuffer_ptr).l,d0
  550.         move.l  d0,d6
  551.         lsr.l   #4,d0
  552.         lsl.l   #4,d0
  553.         cmp.l   d0,d6
  554.         beq.s   locret_556
  555.         lea (es_alignfail).l,a1
  556.         lea (error_report_args).l,a3
  557.         move.l  d6,(a3)
  558.         bsr.w   error_report
  559.  
  560. locret_556:             ; CODE XREF: rtg_16b_aligned_test+8j
  561.                     ; rtg_16b_aligned_test+18j
  562.         rts
  563. ; End of function rtg_16b_aligned_test
  564.  
  565.  
  566. ; =============== S U B R O U T I N E =======================================
  567.  
  568.  
  569. draw_character:             ; CODE XREF: draw_string+28p
  570.         move.l  d2,d3
  571.         lsr.l   #4,d3
  572.         move.l  d2,d4
  573.         and.l   #$F,d4
  574.         mulu.w  #$500,d3
  575.         lsl.l   #3,d4
  576.         lea (xen_font).l,a1
  577.         adda.l  d3,a1
  578.         adda.l  d4,a1
  579.         movea.l (fastbuffer_ptr).l,a0
  580.         mulu.l  (gs_bytesperrow).l,d1
  581.         adda.l  d0,a0
  582.         adda.l  d1,a0
  583.         moveq   #9,d7
  584.  
  585. loc_588:                ; CODE XREF: draw_character+48j
  586.         move.l  (a1),d0
  587.         or.l    d0,(a0)
  588.         move.l  4(a1),d0
  589.         or.l    d0,4(a0)
  590.         adda.l  #$80,a1 ; '€'
  591.         adda.l  (gs_bytesperrow).l,a0
  592.         dbf d7,loc_588
  593.         rts
  594. ; End of function draw_character
  595.  
  596.  
  597. ; =============== S U B R O U T I N E =======================================
  598.  
  599.  
  600. draw_string:                ; CODE XREF: mnu_viewcredz+1Ep
  601.                     ; mnu_viewcredz+34p
  602.         movem.l d2-d4/d6-d7/a1,-(sp)
  603.         ext.l   d0
  604.         ext.l   d1
  605.         move.l  d0,d6
  606.  
  607. loc_5B0:                ; CODE XREF: draw_string+1Ej
  608.                     ; draw_string+34j
  609.         moveq   #0,d2
  610.         move.b  (a0)+,d2
  611.         beq.s   loc_5DC
  612.         cmpi.b  #$A,d2
  613.         bne.s   loc_5C6
  614.         move.l  d6,d0
  615.         add.l   #8,d1
  616.         bra.s   loc_5B0
  617. ; ---------------------------------------------------------------------------
  618.  
  619. loc_5C6:                ; CODE XREF: draw_string+14j
  620.         movem.l d0-d1/a0,-(sp)
  621.         sub.b   #$20,d2 ; ' '
  622.         bsr.s   draw_character
  623.         movem.l (sp)+,d0-d1/a0
  624.         add.l   #7,d0
  625.         bra.s   loc_5B0
  626. ; ---------------------------------------------------------------------------
  627.  
  628. loc_5DC:                ; CODE XREF: draw_string+Ej
  629.         movem.l (sp)+,d2-d4/d6-d7/a1
  630.         rts
  631. ; End of function draw_string
  632.  
  633.  
  634. ; =============== S U B R O U T I N E =======================================
  635.  
  636.  
  637. ahi_init:               ; CODE XREF: sub_BE+1Ep
  638.         lea (AHI_PORT).l,a0
  639.         clr.l   (a0)+
  640.         clr.l   (a0)+
  641.         clr.l   (a0)+
  642.         movea.l (_SysBase).l,a6
  643.         jsr -$29A(a6)
  644.         lea (AHI_PORT).l,a0
  645.         move.l  d0,(a0)
  646.         beq.s   loc_668
  647.         movea.l d0,a0
  648.         moveq   #$50,d0 ; 'P'
  649.         jsr -$28E(a6)
  650.         lea (AHI_IOR).l,a0
  651.         move.l  d0,(a0)
  652.         beq.s   loc_65C
  653.         lea (AHI_NAME).l,a0 ; "ahi.device"
  654.         movea.l d0,a1
  655.         move.w  #4,$30(a1)
  656.         move.l  #$FF,d0
  657.         moveq   #0,d1
  658.         jsr -$1BC(a6)
  659.         lea (AHI_DEVICE).l,a0
  660.         move.l  d0,(a0)
  661.         bne.s   loc_644
  662.         movea.l (AHI_IOR).l,a0
  663.  
  664. loc_63E:                ; DATA XREF: DATA:00012DCCo
  665.                     ; DATA:00012DD4o ...
  666.         move.l  $14(a0),d0
  667.         bra.s   loc_674
  668. ; ---------------------------------------------------------------------------
  669.  
  670. loc_644:                ; CODE XREF: ahi_init+54j
  671.         lea (es_openahidevicefail).l,a1
  672.         lea (error_report_args).l,a3
  673.         move.l  #4,(a3)
  674.         bsr.w   error_report
  675.         bra.s   loc_672
  676. ; ---------------------------------------------------------------------------
  677.  
  678. loc_65C:                ; CODE XREF: ahi_init+30j
  679.         lea (es_createiorequest).l,a1
  680.         bsr.w   error_report
  681.         bra.s   loc_672
  682. ; ---------------------------------------------------------------------------
  683.  
  684. loc_668:                ; CODE XREF: ahi_init+1Ej
  685.         lea (es_createmsgportfail).l,a1
  686.         bsr.w   error_report
  687.  
  688. loc_672:                ; CODE XREF: ahi_init+78j ahi_init+84j
  689.         moveq   #0,d0
  690.  
  691. loc_674:                ; CODE XREF: ahi_init+60j
  692.         move.l  d0,(_AHIBase).l
  693.         beq.w   ahi_error
  694.         movea.l d0,a6
  695.         move.l  (audioid).l,d0
  696.         move.l  d0,(ahi_tstid).l
  697.         move.l  d0,(ahi_audioid).l
  698.         move.l  (mixfreq).l,(ahi_mixfreq).l
  699.         lea (ahi_bestmode_tags2).l,a1
  700.         jsr -$72(a6)
  701.         cmpi.l  #$FFFFFFFF,d0
  702.         bne.s   loc_6B2
  703.         bsr.w   ahi_getaudiomode
  704.  
  705. loc_6B2:                ; CODE XREF: ahi_init+CAj
  706.         lea (ahi_tags).l,a1
  707.         jsr -$2A(a6)
  708.         move.l  d0,(AudioCtrl).l
  709.         beq.s   loc_6FE
  710.         pea (OpenLibs).w
  711.         pea (1).w
  712.         pea ($80000050).l
  713.         move.l  #(loc_FFFC+4),-(sp)
  714.         pea ($80000057).l
  715.         movea.l (_AHIBase).l,a6
  716.         movea.l (AudioCtrl).l,a2
  717.         movea.l sp,a1
  718.         jsr -$3C(a6)
  719.         lea $14(sp),sp
  720.         st  (ahi_sound).l
  721.         moveq   #1,d0
  722.         rts
  723. ; ---------------------------------------------------------------------------
  724.  
  725. loc_6FE:                ; CODE XREF: ahi_init+E0j
  726.         lea (es_allocaudiofail).l,a1
  727.         bsr.w   error_report
  728.         bra.w   *+4
  729.  
  730. ahi_error:              ; CODE XREF: ahi_init+98j
  731.         moveq   #0,d0
  732. ; End of function ahi_init
  733.  
  734.  
  735. ; =============== S U B R O U T I N E =======================================
  736.  
  737.  
  738. ahi_end:                ; CODE XREF: sub_BE+9Ap
  739.         move.l  d0,-(sp)
  740.         move.l  (_AHIBase).l,d0
  741.         beq.s   loc_75C
  742.         movea.l d0,a6
  743.         movea.l (ahi_req1).l,a0
  744.         jsr -$84(a6)
  745.         clr.l   (ahi_req1).l
  746.         move.l  (AudioCtrl).l,d0
  747.         beq.s   loc_75C
  748.         pea (OpenLibs).w
  749.         pea (OpenLibs).w
  750.         pea ($80000050).l
  751.         movea.l d0,a2
  752.         movea.l sp,a1
  753.         jsr -$3C(a6)
  754.         lea $C(sp),sp
  755.         movea.l (AudioCtrl).l,a2
  756.         jsr -$30(a6)
  757.         clr.l   (AudioCtrl).l
  758.  
  759. loc_75C:                ; CODE XREF: ahi_end+8j ahi_end+22j
  760.         clr.l   (_AHIBase).l
  761.         movea.l (_SysBase).l,a6
  762.         lea (AHI_DEVICE).l,a1
  763.         tst.l   (a1)
  764.         bne.s   loc_78C
  765.         subq.l  #1,(a1)
  766.         movea.l (AHI_IOR).l,a1
  767.         jsr -$1C2(a6)
  768.         lea (AHI_IOR).l,a1
  769.         movea.l (a1),a0
  770.         clr.l   (a1)
  771.         jsr -$294(a6)
  772.  
  773. loc_78C:                ; CODE XREF: ahi_end+62j
  774.         lea (AHI_PORT).l,a1
  775.         movea.l (a1),a0
  776.         clr.l   (a1)
  777.         jsr -$2A0(a6)
  778.         move.l  (sp)+,d0
  779.         rts
  780. ; End of function ahi_end
  781.  
  782.  
  783. ; =============== S U B R O U T I N E =======================================
  784.  
  785.  
  786. ahi_getaudiomode:           ; CODE XREF: ahi_init+CCp
  787.                     ; menu_changeconfig+24j
  788.         movea.l (_AHIBase).l,a6
  789.         suba.l  a0,a0
  790.         jsr -$78(a6)
  791.         move.l  d0,(ahi_req1).l
  792.         beq.s   loc_7E8
  793.         movea.l d0,a0
  794.         lea (AHIReqTags).l,a1
  795.         jsr -$7E(a6)
  796.         tst.l   d0
  797.         beq.s   loc_7E8
  798.         movea.l (ahi_req1).l,a0
  799.         move.l  0(a0),d0
  800.         move.l  4(a0),d1
  801.  
  802. loc_7D0:                ; DATA XREF: DATA:00012D7Co
  803.                     ; DATA:00012E1Co
  804.         move.l  d0,(ahi_audioid).l
  805.         move.l  d1,(ahi_mixfreq).l
  806.         move.l  d0,(audioid).l
  807.         move.l  d1,(mixfreq).l
  808.  
  809. loc_7E8:                ; CODE XREF: ahi_getaudiomode+12j
  810.                     ; ahi_getaudiomode+22j
  811.         movea.l (ahi_req1).l,a0
  812.         jsr -$84(a6)
  813.         clr.l   (ahi_req1).l
  814.         rts
  815. ; End of function ahi_getaudiomode
  816.  
  817.  
  818. ; =============== S U B R O U T I N E =======================================
  819.  
  820.  
  821. ahi_loadsamp:               ; CODE XREF: load_sfx+24p
  822.         movem.l d0-a6,-(sp)
  823.         movea.l (_AHIBase).l,a6
  824.         move.l  d1,-(sp)
  825.         move.l  d0,-(sp)
  826.         pea (0).w
  827.         move.l  (ahisampnr).l,d0
  828.         moveq   #0,d1
  829.         movea.l sp,a0
  830.         movea.l (AudioCtrl).l,a2
  831.         jsr -$5A(a6)
  832.         addq.l  #1,(ahisampnr).l
  833.         lea $C(sp),sp
  834.         movem.l (sp)+,d0-a6
  835.         rts
  836. ; End of function ahi_loadsamp
  837.  
  838.  
  839. ; =============== S U B R O U T I N E =======================================
  840.  
  841.  
  842. ahi_MakeSomeNoise:          ; CODE XREF: MakeSomeNoise+196p
  843.                     ; MakeSomeNoise+204p ...
  844.         tst.w   (ahi_sound).l
  845.         beq.s   locret_89E
  846.         movem.l d0-a6,-(sp)
  847.         movea.l (_AHIBase).l,a6
  848.         move.l  d6,d0
  849.         move.l  #$1F40,d1
  850.         movea.l (AudioCtrl).l,a2
  851.         moveq   #1,d2
  852.         jsr -$48(a6)
  853.         move.l  d6,d0
  854.         lsl.l   #8,d7
  855.         lsl.l   #2,d7
  856.         move.l  d7,d1
  857.         move.l  #$8000,d2
  858.         movea.l (AudioCtrl).l,a2
  859.         moveq   #1,d3
  860.         jsr -$42(a6)
  861.         move.l  d6,d0
  862.         moveq   #0,d1
  863.         move.w  d5,d1
  864.         moveq   #0,d2
  865.         moveq   #0,d3
  866.         movea.l (AudioCtrl).l,a2
  867.         moveq   #1,d4
  868.         jsr -$4E(a6)
  869.         move.l  d6,d0
  870.         moveq   #$FFFFFFFF,d1
  871.         moveq   #0,d2
  872.         moveq   #0,d3
  873.         movea.l (AudioCtrl).l,a2
  874.         moveq   #0,d4
  875.         jsr -$4E(a6)
  876.         movem.l (sp)+,d0-a6
  877.  
  878. locret_89E:             ; CODE XREF: ahi_MakeSomeNoise+6j
  879.         rts
  880. ; End of function ahi_MakeSomeNoise
  881.  
  882.  
  883. ; =============== S U B R O U T I N E =======================================
  884.  
  885.  
  886. ahi_soundfunccode:          ; DATA XREF: DATA:0001D6B2o
  887.         movem.l d0-a6,-(sp)
  888.         move.w  (a1),d0
  889.         beq.s   loc_8E0
  890.         cmpi.w  #1,d0
  891.         beq.s   loc_908
  892.         cmpi.w  #2,d0
  893.         beq.s   loc_930
  894.         cmpi.w  #3,d0
  895.         beq.w   loc_958
  896.         cmpi.w  #4,d0
  897.         beq.w   loc_980
  898.         cmpi.w  #5,d0
  899.         beq.w   loc_9A6
  900.         cmpi.w  #6,d0
  901.         beq.w   loc_9CA
  902.         cmpi.w  #7,d0
  903.         beq.w   loc_9EE
  904.         bra.w   loc_A10
  905. ; ---------------------------------------------------------------------------
  906.  
  907. loc_8E0:                ; CODE XREF: ahi_soundfunccode+6j
  908.         tst.b   (playnull0).l
  909.         beq.s   loc_8F2
  910.         clr.b   (playnull0).l
  911.         bra.w   loc_A10
  912. ; ---------------------------------------------------------------------------
  913.  
  914. loc_8F2:                ; CODE XREF: ahi_soundfunccode+46j
  915.         st  (playnull0).l
  916.         clr.w   (word_167D8).l
  917.         clr.w   (word_167BA).l
  918.         bra.w   loc_A10
  919. ; ---------------------------------------------------------------------------
  920.  
  921. loc_908:                ; CODE XREF: ahi_soundfunccode+Cj
  922.         tst.b   (playnull1).l
  923.         beq.s   loc_91A
  924.         clr.b   (playnull1).l
  925.         bra.w   loc_A10
  926. ; ---------------------------------------------------------------------------
  927.  
  928. loc_91A:                ; CODE XREF: ahi_soundfunccode+6Ej
  929.         st  (playnull1).l
  930.         clr.w   (word_167DC).l
  931.         clr.w   (word_167BE).l
  932.         bra.w   loc_A10
  933. ; ---------------------------------------------------------------------------
  934.  
  935. loc_930:                ; CODE XREF: ahi_soundfunccode+12j
  936.         tst.w   (playnull2).l
  937.         beq.s   loc_942
  938.         clr.b   (playnull2).l
  939.         bra.w   loc_A10
  940. ; ---------------------------------------------------------------------------
  941.  
  942. loc_942:                ; CODE XREF: ahi_soundfunccode+96j
  943.         st  (playnull2).l
  944.         clr.w   (word_167E0).l
  945.         clr.w   (word_167C2).l
  946.         bra.w   loc_A10
  947. ; ---------------------------------------------------------------------------
  948.  
  949. loc_958:                ; CODE XREF: ahi_soundfunccode+18j
  950.         tst.w   (playnull3).l
  951.         beq.s   loc_96A
  952. ; End of function ahi_soundfunccode
  953.  
  954.  
  955. ; =============== S U B R O U T I N E =======================================
  956.  
  957.  
  958. sub_960:                ; DATA XREF: DATA:00012E04o
  959.                     ; DATA:00012E24o
  960.         clr.b   (playnull3).l
  961.         bra.w   loc_A10
  962. ; ---------------------------------------------------------------------------
  963.  
  964. loc_96A:                ; CODE XREF: ahi_soundfunccode+BEj
  965.         st  (playnull3).l
  966.         clr.w   (word_167E4).l
  967.         clr.w   (word_167C6).l
  968.         bra.w   loc_A10
  969. ; ---------------------------------------------------------------------------
  970.  
  971. loc_980:                ; CODE XREF: ahi_soundfunccode+20j
  972.         tst.w   (playnull4).l
  973.         beq.s   loc_992
  974.         clr.b   (playnull4).l
  975.         bra.w   loc_A10
  976. ; ---------------------------------------------------------------------------
  977.  
  978. loc_992:                ; CODE XREF: sub_960+26j
  979.         st  (playnull4).l
  980.         clr.w   (word_167E8).l
  981.         clr.w   (word_167CA).l
  982.         bra.s   loc_A10
  983. ; ---------------------------------------------------------------------------
  984.  
  985. loc_9A6:                ; CODE XREF: ahi_soundfunccode+28j
  986.         tst.w   (playnull5).l
  987.         beq.s   loc_9B6
  988.         clr.b   (playnull5).l
  989.         bra.s   loc_A10
  990. ; ---------------------------------------------------------------------------
  991.  
  992. loc_9B6:                ; CODE XREF: sub_960+4Cj
  993.         st  (playnull5).l
  994.         clr.w   (word_167EC).l
  995.         clr.w   (word_167CE).l
  996.         bra.s   loc_A10
  997. ; ---------------------------------------------------------------------------
  998.  
  999. loc_9CA:                ; CODE XREF: ahi_soundfunccode+30j
  1000.         tst.w   (playnull6).l
  1001.         beq.s   loc_9DA
  1002.         clr.b   (playnull6).l
  1003.         bra.s   loc_A10
  1004. ; ---------------------------------------------------------------------------
  1005.  
  1006. loc_9DA:                ; CODE XREF: sub_960+70j
  1007.         st  (playnull6).l
  1008.         clr.w   (word_167F0).l
  1009.         clr.w   (word_167D2).l
  1010.         bra.s   loc_A10
  1011. ; ---------------------------------------------------------------------------
  1012.  
  1013. loc_9EE:                ; CODE XREF: ahi_soundfunccode+38j
  1014.         tst.w   (playnull7).l
  1015.         beq.s   loc_9FE
  1016.         clr.b   (playnull7).l
  1017.         bra.s   loc_A10
  1018. ; ---------------------------------------------------------------------------
  1019.  
  1020. loc_9FE:                ; CODE XREF: sub_960+94j
  1021.         st  (playnull7).l
  1022.         clr.w   (word_167F4).l
  1023.         clr.w   (word_167D6).l
  1024.  
  1025. loc_A10:                ; CODE XREF: ahi_soundfunccode+3Cj
  1026.                     ; ahi_soundfunccode+4Ej ...
  1027.         movem.l (sp)+,d0-a6
  1028.         rts
  1029. ; End of function sub_960
  1030.  
  1031.  
  1032. ; =============== S U B R O U T I N E =======================================
  1033.  
  1034.  
  1035. error_report:               ; CODE XREF: rtg_init+100p
  1036.                     ; rtg_init+10Cp ...
  1037.         movem.l d1/a0/a2/a6,-(sp)
  1038.         movea.l (_IntuitionBase).l,a6
  1039.         suba.l  a0,a0
  1040.         movea.l a0,a2
  1041.         jsr -$24C(a6)
  1042.         movem.l (sp)+,d1/a0/a2/a6
  1043.         rts
  1044. ; End of function error_report
  1045.  
  1046.  
  1047. ; =============== S U B R O U T I N E =======================================
  1048.  
  1049.  
  1050. initstuff:              ; CODE XREF: sub_BE+28p
  1051.         lea (PLR1_GunSelected).l,a1
  1052.         move.w  #0,loc_6960-PLR1_GunSelected(a1)
  1053.         st  (PLR2KEYS).l
  1054.         clr.b   (PLR2PATH).l
  1055.         clr.b   (PLR2MOUSE).l
  1056.         clr.b   (PLR2JOY).l
  1057.         bsr.s   memory_get
  1058.         movea.l (consttab_ptr).l,a0
  1059.         moveq   #1,d0
  1060.         move.w  #$1FFF,d1
  1061.  
  1062. loc_A60:                ; CODE XREF: initstuff+5Aj
  1063.         move.l  #$100000,d2
  1064.         divs.l  d0,d2
  1065.         move.l  #$10000000,d3
  1066.         divs.l  d2,d3
  1067.         move.l  d3,(a0)+
  1068.         asr.l   #1,d2
  1069.         sub.l   #$A00,d2
  1070.         muls.l  d3,d2
  1071.         asr.l   #6,d2
  1072.         move.l  d2,(a0)+
  1073.         addq.w  #1,d0
  1074.         dbf d1,loc_A60
  1075.         rts
  1076. ; End of function initstuff
  1077.  
  1078.  
  1079. ; =============== S U B R O U T I N E =======================================
  1080.  
  1081.  
  1082. memory_get:             ; CODE XREF: initstuff+24p
  1083.         movea.l (_SysBase).l,a6
  1084.         move.l  #(loc_FFFC+4),d0
  1085.         move.l  #400000,d1
  1086.         move.l  #unk_186A0,d2
  1087.         jsr -$2B8(a6)
  1088.         move.l  d0,(fastmempool).l
  1089.         beq.w   freemem
  1090.         movea.l #memlist,a4
  1091.  
  1092. loc_ABA:                ; CODE XREF: memory_get+34j
  1093.                     ; memory_get+3Aj
  1094.         move.l  (a4)+,d0
  1095.         beq.s   loc_ACA
  1096.         movea.l (a4)+,a5
  1097.         tst.l   (a5)
  1098.         bne.s   loc_ABA
  1099.         bsr.s   mem_alloc
  1100.         move.l  d0,(a5)
  1101.         bra.s   loc_ABA
  1102. ; ---------------------------------------------------------------------------
  1103.  
  1104. loc_ACA:                ; CODE XREF: memory_get+2Ej
  1105.         move.l  (depthtable_ptr).l,d0
  1106.         add.l   #$140,d0
  1107.         move.l  d0,(enddepthtab_ptr).l
  1108.         rts
  1109. ; End of function memory_get
  1110.  
  1111.  
  1112. ; =============== S U B R O U T I N E =======================================
  1113.  
  1114.  
  1115. mem_alloc:              ; CODE XREF: memory_get+36p
  1116.                     ; load_file+82p ...
  1117.         movem.l d1-d2/a0-a3/a6,-(sp)
  1118.  
  1119. loc_AE2:                ; CODE XREF: mem_alloc+3Aj
  1120.         movea.l (_SysBase).l,a6
  1121.         move.l  d0,d2
  1122.         movea.l (fastmempool).l,a0
  1123.         jsr -$2C4(a6)
  1124.         tst.l   d0
  1125.         beq.s   loc_AFE
  1126.         movem.l (sp)+,d1-d2/a0-a3/a6
  1127.         rts
  1128. ; ---------------------------------------------------------------------------
  1129.  
  1130. loc_AFE:                ; CODE XREF: mem_alloc+18j
  1131.         lea (es_allocmemfail).l,a1
  1132.         lea (error_report_args).l,a3
  1133.         move.l  d2,(a3)
  1134.         bsr.w   error_report
  1135.         tst.l   d0
  1136.         beq.w   cleanup
  1137.         move.l  d2,d0
  1138.         bra.s   loc_AE2
  1139. ; End of function mem_alloc
  1140.  
  1141.  
  1142. ; =============== S U B R O U T I N E =======================================
  1143.  
  1144.  
  1145. mem_free:               ; CODE XREF: sub_BB8+154p sub_BB8+164p ...
  1146.         movem.l d1/a1/a6,-(sp)
  1147.         movea.l (_SysBase).l,a6
  1148.         movea.l (fastmempool).l,a0
  1149.         jsr -$2CA(a6)
  1150.         movem.l (sp)+,d1/a1/a6
  1151.         clr.l   (a1)
  1152.         rts
  1153. ; End of function mem_free
  1154.  
  1155. ; ---------------------------------------------------------------------------
  1156. ; START OF FUNCTION CHUNK FOR sub_BE
  1157.  
  1158. menu:                   ; CODE XREF: sub_BE+36j
  1159.         moveq   #0,d0
  1160.         move.w  (screencopy).l,d0
  1161.         bsr.w   config_screencopy
  1162.         move.b  #$6E,(mors).l ; 'n'
  1163.         movea.l (_SysBase).l,a6
  1164.         move.l  (gs_bytesperrow).l,d0
  1165.         mulu.l  (gs_height).l,d0
  1166.         add.l   #$C,d0
  1167.         move.l  #(loc_FFFC+4),d1
  1168.         jsr -$2AC(a6)
  1169.         move.l  d0,(realrealfastbuffer_ptr).l
  1170.         add.l   #$C,d0
  1171.         move.l  d0,(fastbuffer_ptr).l
  1172.         move.l  d0,(realfastbuffer_ptr).l
  1173.         beq.w   freemem
  1174.         move.l  (gs_bytesperrow).l,d0
  1175.         mulu.l  (gs_height).l,d0
  1176.         move.l  #(loc_FFFC+4),d1
  1177.         jsr -$2AC(a6)
  1178.         move.l  d0,(fastbuffer2_ptr).l
  1179.         beq.w   freemem
  1180.         lea ((IVEWONTEXT+$5A0)).l,a0
  1181.         jsr load_file
  1182. ; END OF FUNCTION CHUNK FOR sub_BE
  1183.  
  1184. ; =============== S U B R O U T I N E =======================================
  1185.  
  1186.  
  1187. sub_BB8:                ; DATA XREF: DATA:00012D84o
  1188.         move.l  d0,(linkfile_ptr).l
  1189.         lea (LEVELTEXTNAME).l,a0 ; "progdir:includes/TEXT_FILE"
  1190.         jsr load_file
  1191.         move.l  d0,(LEVELTEXT).l
  1192.         lea (VBLANKInt).l,a1
  1193.         moveq   #5,d0
  1194.         jsr -$A8(a6)
  1195.         bsr.w   mnu_setscreen
  1196.         move.l  sp,(mnu_mainstack).l
  1197.         bsr.w   mnu_viewcredz
  1198.         tst.w   (ahi_sound).l
  1199.         beq.s   loc_BF8
  1200.         jsr load_sfx
  1201.  
  1202. loc_BF8:                ; CODE XREF: sub_BB8+38j
  1203.         jsr load_walls
  1204.         jsr load_floors
  1205.         lea (backpicname).l,a0 ; "progdir:includes/rawbackpacked"
  1206.         jsr load_file
  1207.         move.l  d0,(BackPicture_ptr).l
  1208.         jsr load_objects
  1209.         bsr.w   menu_defaultgame
  1210.         bsr.w   keyb_clearkeybuf
  1211.         bsr.w   mnu_setscreen
  1212.  
  1213. menu_start:             ; CODE XREF: sub_BB8+1DEj
  1214.         cmpi.b  #$73,(mors).l ; 's'
  1215.         beq.s   loc_C48
  1216.         cmpi.b  #$6D,(mors).l ; 'm'
  1217.         beq.s   loc_C42
  1218.         bsr.w   menu_readmainmenu
  1219.         bra.s   game_start
  1220. ; ---------------------------------------------------------------------------
  1221.  
  1222. loc_C42:                ; CODE XREF: sub_BB8+82j
  1223.         bsr.w   menu_master
  1224.         bra.s   game_start
  1225. ; ---------------------------------------------------------------------------
  1226.  
  1227. loc_C48:                ; CODE XREF: sub_BB8+78j
  1228.         bsr.w   menu_slave
  1229.  
  1230. game_start:             ; CODE XREF: sub_BB8+88j sub_BB8+8Ej
  1231.         tst.b   (SHOULDQUIT).l
  1232.         bne.w   cleanup
  1233.         clr.b   (FINISHEDLEVEL).l
  1234.         clr.w   (PLR1s_angpos).l
  1235.         clr.w   (PLR2s_angpos).l
  1236.         clr.w   (PLR1_angpos).l
  1237.         clr.w   (PLR2_angpos).l
  1238.         clr.b   (PLR1_GunSelected).l
  1239.         clr.b   (PLR2_GunSelected).l
  1240.         clr.b   (NASTY).l
  1241.         movea.l #MASTERPLAYERONEHEALTH,a0
  1242.         movea.l #MASTERPLAYERONESHIELD,a1
  1243.         movea.l #PLAYERONEHEALTH,a2
  1244.         movea.l #PLAYERONESHIELD,a3
  1245.         movea.l #PLAYERTWOHEALTH,a4
  1246.         movea.l #PLAYERTWOSHIELD,a5
  1247.         move.l  (a0),(a2)+
  1248.         move.l  (a0)+,(a4)+
  1249.         move.l  (a0),(a2)+
  1250.         move.l  (a0)+,(a4)+
  1251.         move.l  (a0),(a2)+
  1252.         move.l  (a0)+,(a4)+
  1253.         move.l  (a0),(a2)+
  1254.         move.l  (a0)+,(a4)+
  1255.         move.l  (a0),(a2)+
  1256.         move.l  (a0)+,(a4)+
  1257.         move.l  (a0),(a2)+
  1258.         move.l  (a0)+,(a4)+
  1259.         move.l  (a0),(a2)+
  1260.         move.l  (a0)+,(a4)+
  1261.         move.l  (a0),(a2)+
  1262.         move.l  (a0)+,(a4)+
  1263.         move.l  (a0),(a2)+
  1264.         move.l  (a0)+,(a4)+
  1265.         move.l  (a0),(a2)+
  1266.         move.l  (a0)+,(a4)+
  1267.         move.l  (a0),(a2)+
  1268.         move.l  (a0)+,(a4)+
  1269.         move.l  (a1),(a3)+
  1270.         move.l  (a1)+,(a5)+
  1271.         move.l  (a1),(a3)+
  1272.         move.l  (a1)+,(a5)+
  1273.         move.l  (a1),(a3)+
  1274.         move.l  (a1)+,(a5)+
  1275.         move.l  (a1),(a3)+
  1276.         move.l  (a1)+,(a5)+
  1277.         move.l  (a1),(a3)+
  1278.         move.l  (a1)+,(a5)+
  1279.         move.l  (a1),(a3)+
  1280.         move.l  (a1)+,(a5)+
  1281.         bsr.w   keyb_clearkeybuf
  1282.         bsr.w   PLAYTHEGAME
  1283.         bsr.w   rtg_initmenuscreen
  1284.         movea.l (_SysBase).l,a6
  1285.         move.l  (links_size).l,d0
  1286.         movea.l (links_ptr).l,a1
  1287.         bsr.w   mem_free
  1288.         move.l  (flylinks_size).l,d0
  1289.         movea.l (flylinks_ptr).l,a1
  1290.         bsr.w   mem_free
  1291.         move.l  (leveldata_size).l,d0
  1292.         movea.l (leveldata_ptr).l,a1
  1293.         bsr.w   mem_free
  1294.         move.l  (levelgraphics_size).l,d0
  1295.         movea.l (levelgraphics_ptr).l,a1
  1296.         bsr.w   mem_free
  1297.         move.l  (levelclips_size).l,d0
  1298.         movea.l (levelclips_ptr).l,a1
  1299.         bsr.w   mem_free
  1300.         tst.b   (FINISHEDLEVEL).l
  1301.         beq.s   loc_D92
  1302.         movea.l #MASTERPLAYERONEHEALTH,a0
  1303.         movea.l #MASTERPLAYERONESHIELD,a1
  1304.         movea.l #PLAYERONEHEALTH,a2
  1305.         movea.l #PLAYERONESHIELD,a3
  1306.         move.l  (a2)+,(a0)+
  1307.         move.l  (a2)+,(a0)+
  1308.         move.l  (a2)+,(a0)+
  1309.         move.l  (a2)+,(a0)+
  1310.         move.l  (a2)+,(a0)+
  1311.         move.l  (a2)+,(a0)+
  1312.         move.l  (a2)+,(a0)+
  1313.         move.l  (a2)+,(a0)+
  1314.         move.l  (a2)+,(a0)+
  1315.         move.l  (a2)+,(a0)+
  1316.         move.l  (a2)+,(a0)+
  1317.         move.l  (a3)+,(a1)+
  1318.         move.l  (a3)+,(a1)+
  1319.         move.l  (a3)+,(a1)+
  1320.         move.l  (a3)+,(a1)+
  1321.         move.l  (a3)+,(a1)+
  1322.         move.l  (a3)+,(a1)+
  1323.  
  1324. loc_D92:                ; CODE XREF: sub_BB8+19Ej
  1325.         bsr.w   mnu_setscreen
  1326.         bra.w   menu_start
  1327. ; ---------------------------------------------------------------------------
  1328.  
  1329. cleanup:                ; CODE XREF: rtg_initmenuscreen:loc_3FEj
  1330.                     ; mem_alloc+34j ...
  1331.         jsr CLOSETWEENSCRN
  1332.         movea.l (_SysBase).l,a6
  1333.         lea (VBLANKInt).l,a1
  1334.         moveq   #5,d0
  1335.         jsr -$AE(a6)
  1336.  
  1337. freemem:                ; CODE XREF: memory_get+22j
  1338.                     ; sub_BE+AC8j ...
  1339.         movea.l (_SysBase).l,a6
  1340.         movea.l (fastmempool).l,a0
  1341.         tst.l   a0
  1342.         beq.s   loc_DC6
  1343.         jsr -$2BE(a6)
  1344.  
  1345. loc_DC6:                ; CODE XREF: sub_BB8+208j
  1346.         movea.l (realrealfastbuffer_ptr).l,a1
  1347.         tst.l   a1
  1348.         beq.s   loc_DE2
  1349.         jsr -$2B2(a6)
  1350.         movea.l (fastbuffer2_ptr).l,a1
  1351.         tst.l   a1
  1352.         beq.s   loc_DE2
  1353.         jsr -$2B2(a6)
  1354.  
  1355. loc_DE2:                ; CODE XREF: sub_BB8+216j sub_BB8+224j
  1356.         bra.w   closelibs
  1357. ; End of function sub_BB8
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement