Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ;
- ; +-------------------------------------------------------------------------+
- ; | This file has been generated by The Interactive Disassembler (IDA) |
- ; | Copyright (c) 2011 Hex-Rays, <support@hex-rays.com> |
- ; | License info: 48-327F-7274-B7 |
- ; | ESET spol. s r.o. |
- ; +-------------------------------------------------------------------------+
- ;
- ; Input MD5 : 10BD63309F0A6A4FF639D7EE1F78A015
- ; Input CRC32 : 055E2965
- ; File Name : Z:\home\masta\Downloads\tkgrtg
- ; Format : Amiga hunk file
- ; Processor: 68K
- ; Target Assembler: 680x0 Assembler in MRI compatible mode
- ; This file should be compiled with "as -M"
- ; ===========================================================================
- ; Segment type: Pure code
- ; segment "CODE"
- ; =============== S U B R O U T I N E =======================================
- global OpenLibs
- OpenLibs: ; DATA XREF: ahi_init+E2o ahi_end+24o ...
- movea.l (loc_4).w,a6
- loc_4: ; DATA XREF: OpenLibsr
- move.l a6,(_SysBase).l
- suba.l a1,a1
- jsr -$126(a6)
- movea.l d0,a4
- moveq #$24,d0 ; '$'
- lea (DOSName).l,a1 ; "dos.library"
- jsr -$228(a6)
- move.l d0,(_DOSBase).l
- beq.s loc_4C
- loc_26: ; DATA XREF: DATA:00012D4Co
- ; DATA:0001CDACo ...
- move.l $AC(a4),d0
- beq.s loc_6A
- move.l a6,-(sp)
- loc_2E:
- movea.l (_DOSBase).l,a6
- jsr -$36(a6)
- loc_38: ; DATA XREF: DATA:0001CEF0o
- ; DATA:0001CF9Eo ...
- move.l d0,(_stdin).l
- jsr -$3C(a6)
- move.l d0,(_stdout).l
- movea.l (sp)+,a6
- bra.s loc_B8
- ; ---------------------------------------------------------------------------
- loc_4C: ; CODE XREF: OpenLibs+24j
- ; DATA XREF: DATA:mnu_MYMASTERMENUo ...
- move.l #unk_38007,d7
- jsr -$6C(a6)
- tst.l $AC(a4)
- bne.s loc_66
- bsr.w getWbMsg
- movea.l d0,a2
- bsr.w repWbMsg
- loc_66: ; CODE XREF: OpenLibs+5Aj
- moveq #$14,d0
- rts
- ; ---------------------------------------------------------------------------
- loc_6A: ; CODE XREF: OpenLibs+2Aj
- bsr.w getWbMsg
- move.l d0,(_WBenchMsg).l
- movea.l (_DOSBase).l,a6
- move.l #_AppWindow,d1 ; "CON:0/0/640/200/TKGRTG Output/WAIT/SIMP"...
- move.l #$3ED,d2
- jsr -$1E(a6)
- move.l d0,(WbOutput).l
- bne.s loc_96
- moveq #$14,d2
- bra.s exit2
- ; ---------------------------------------------------------------------------
- loc_96: ; CODE XREF: OpenLibs+90j
- move.l d0,(_stdin).l
- loc_9C: ; DATA XREF: DATA:00012D54o
- ; DATA:00012D94o
- move.l d0,(_stdout).l
- move.l d0,$9C(a4)
- move.l d0,$A0(a4)
- lsl.l #2,d0
- movea.l d0,a0
- move.l 8(a0),d0
- beq.s loc_B8
- move.l d0,$A4(a4)
- loc_B8: ; CODE XREF: OpenLibs+4Aj OpenLibs+B2j
- bsr.s sub_BE
- moveq #0,d2
- bra.s exit2
- ; End of function OpenLibs
- ; =============== S U B R O U T I N E =======================================
- sub_BE: ; CODE XREF: OpenLibs:loc_B8p
- ; FUNCTION CHUNK AT 00000B36 SIZE 00000082 BYTES
- movea.l (_SysBase).l,a6
- moveq #$24,d0 ; '$'
- loc_C6: ; DATA XREF: DATA:00012E14o
- lea (intname).l,a1 ; "intuition.library"
- jsr -$228(a6)
- move.l d0,(_IntuitionBase).l
- beq.s closelibs
- bsr.w loadconfig
- bsr.w ahi_init
- bsr.w rtg_init
- beq.s closelibs
- bsr.w initstuff
- bsr.w Timer_Open
- jsr _InitLowLevel
- bra.w menu
- ; ---------------------------------------------------------------------------
- exit2: ; CODE XREF: OpenLibs+94j OpenLibs+BCj ...
- movea.l (_DOSBase).l,a6
- loc_FE: ; DATA XREF: DATA:00012E0Co
- move.l (WbOutput).l,d1
- beq.s loc_10A
- jsr -$24(a6)
- loc_10A: ; CODE XREF: sub_BE+46j
- movea.l a6,a1
- movea.l (_SysBase).l,a6
- jsr -$19E(a6)
- movea.l (_WBenchMsg).l,a2
- move.l a2,d0
- beq.s loc_122
- bsr.s repWbMsg
- loc_122: ; CODE XREF: sub_BE+60j
- movea.l (_SysBase).l,a6
- suba.l a1,a1
- jsr -$126(a6)
- movea.l d0,a4
- movea.l $B0(a4),a5
- suba.l #4,a5
- movea.l a5,sp
- moveq #0,d0
- rts
- ; ---------------------------------------------------------------------------
- failed: ; DATA XREF: DATA:00012D9Co
- moveq #$FFFFFFEC,d2
- closelibs: ; CODE XREF: sub_BE+18j sub_BE+26j ...
- jsr _CloseLowLevel
- bsr.w Timer_Close
- bsr.w rtg_end
- tst.w (ahi_sound).l
- beq.s loc_15C
- bsr.w ahi_end
- loc_15C: ; CODE XREF: sub_BE+98j
- movea.l (_SysBase).l,a6
- move.l (_IntuitionBase).l,d0
- beq.s loc_170
- movea.l d0,a1
- jsr -$19E(a6)
- loc_170: ; CODE XREF: sub_BE+AAj
- tst.l d2
- beq.s loc_176
- bra.s exit2
- ; ---------------------------------------------------------------------------
- loc_176: ; CODE XREF: sub_BE+B4j
- moveq #$14,d0
- rts
- ; End of function sub_BE
- ; =============== S U B R O U T I N E =======================================
- repWbMsg: ; CODE XREF: OpenLibs+62p sub_BE+62p
- jsr -$84(a6)
- movea.l a2,a1
- jsr -$17A(a6)
- rts
- ; End of function repWbMsg
- ; =============== S U B R O U T I N E =======================================
- getWbMsg: ; CODE XREF: OpenLibs+5Cp
- ; OpenLibs:loc_6Ap
- lea $5C(a4),a0
- jsr -$180(a6)
- loc_18E: ; DATA XREF: DATA:00012D5Co
- lea $5C(a4),a0
- jsr -$174(a6)
- rts
- ; End of function getWbMsg
- ; =============== S U B R O U T I N E =======================================
- rtg_init: ; CODE XREF: sub_BE+22p
- movea.l (_SysBase).l,a6
- lea (rtgname).l,a1 ; "rtgmaster.library"
- moveq #$E,d0
- jsr -$228(a6)
- move.l d0,(_RtgBase).l
- beq.w loc_27E
- movea.l d0,a6
- lea (srtags).l,a0
- jsr -$60(a6)
- move.l d0,(gamescreenreq).l
- beq.w rtg_error
- lea (textsrtags).l,a0
- jsr -$60(a6)
- move.l d0,(textscreenreq).l
- beq.w rtg_error
- loc_1DE: ; DATA XREF: DATA:00012DF4o
- movea.l (gamescreenreq).l,a0
- lea (sctags).l,a1
- jsr -$1E(a6)
- move.l d0,(gamescreen).l
- loc_1F4: ; DATA XREF: DATA:00012D8Co
- ; DATA:00012E34o ...
- beq.w loc_29E
- movea.l (gamescreen).l,a0
- jsr -$13E(a6)
- move.l d0,(rtgport).l
- beq.w loc_2AA
- movea.l (gamescreen).l,a0
- lea (gs_gdatatags).l,a1 ; "€"
- jsr -$48(a6)
- movea.l (gamescreenreq).l,a0
- jsr -$66(a6)
- clr.l (gamescreenreq).l
- movea.l (gamescreen).l,a0
- lea (gamepal).l,a1
- jsr -$30(a6)
- loc_23C: ; CODE XREF: rtg_init+128j
- movea.l (gamescreen).l,a0
- jsr -$36(a6)
- move.l d0,(vidm_mainbuffer_ptr).l
- beq.s loc_2B6
- loc_24E: ; CODE XREF: rtg_init+138j
- movea.l (gamescreen).l,a0
- moveq #2,d0
- loc_256: ; DATA XREF: DATA:00012DFCo
- jsr -$42(a6)
- move.l d0,(vidm_fontbuffer_ptr).l
- beq.s loc_2C6
- movea.l (gamescreen).l,a0
- lea (clearpointer).l,a1
- moveq #$10,d0
- move.l d0,d1
- moveq #$FFFFFFF1,d2
- moveq #$FFFFFFF9,d3
- jsr -$120(a6)
- moveq #1,d0
- rts
- ; ---------------------------------------------------------------------------
- loc_27E: ; CODE XREF: rtg_init+18j
- lea (es_openlibfail).l,a1
- lea (error_report_args).l,a3
- move.l #rtgname,(a3) ; "rtgmaster.library"
- move.l #$E,4(a3)
- bsr.w error_report
- bra.s rtg_error
- ; ---------------------------------------------------------------------------
- loc_29E: ; CODE XREF: rtg_init:loc_1F4j
- lea (es_openrtgscreenfail).l,a1
- bsr.w error_report
- bra.s rtg_error
- ; ---------------------------------------------------------------------------
- loc_2AA: ; CODE XREF: rtg_init+70j
- lea (es_initrtgrdcmpfail).l,a1
- bsr.w error_report
- bra.s rtg_error
- ; ---------------------------------------------------------------------------
- loc_2B6: ; CODE XREF: rtg_init+B4j
- lea (es_lockrtgscreenfail).l,a1
- bsr.w error_report
- bne.w loc_23C
- bra.s rtg_error
- ; ---------------------------------------------------------------------------
- loc_2C6: ; CODE XREF: rtg_init+C8j
- lea (es_getbufadrfail).l,a1
- bsr.w error_report
- bne.w loc_24E
- bra.w *+4
- rtg_error: ; CODE XREF: rtg_init+2Ej rtg_init+42j ...
- moveq #0,d0
- ; End of function rtg_init
- ; =============== S U B R O U T I N E =======================================
- rtg_end: ; CODE XREF: sub_BE+8Ep
- move.l d0,-(sp)
- movea.l (_RtgBase).l,a6
- move.l (textscreenreq).l,d0
- beq.s loc_322
- movea.l d0,a0
- jsr -$66(a6)
- clr.l (textscreenreq).l
- tst.l (vidm_mainbuffer_ptr).l
- beq.s loc_30E
- movea.l (gamescreen).l,a0
- jsr -$3C(a6)
- clr.l (vidm_mainbuffer_ptr).l
- loc_30E: ; CODE XREF: rtg_end+22j
- move.l (gamescreen).l,d0
- beq.s loc_322
- movea.l d0,a0
- jsr -$24(a6)
- clr.l (gamescreen).l
- loc_322: ; CODE XREF: rtg_end+Ej rtg_end+3Aj
- move.l (gamescreenreq).l,d0
- beq.s loc_336
- movea.l d0,a0
- jsr -$66(a6)
- loc_330: ; DATA XREF: DATA:SCROLLSHADESo
- clr.l (gamescreenreq).l
- loc_336: ; CODE XREF: rtg_end+4Ej
- movea.l (_SysBase).l,a6
- move.l (_RtgBase).l,d0
- beq.s loc_350
- movea.l d0,a1
- jsr -$19E(a6)
- clr.l (_RtgBase).l
- loc_350: ; CODE XREF: rtg_end+68j
- move.l (sp)+,d0
- rts
- ; End of function rtg_end
- ; =============== S U B R O U T I N E =======================================
- rtg_set_gs_pal: ; CODE XREF: menu_readmainmenu+7Ap
- ; mnu_viewcredz+8p ...
- movem.l d0-a0/a2-a6,-(sp)
- movea.l (_RtgBase).l,a6
- movea.l (gamescreen).l,a0
- jsr -$30(a6)
- movem.l (sp)+,d0-a0/a2-a6
- rts
- ; End of function rtg_set_gs_pal
- ; =============== S U B R O U T I N E =======================================
- rtg_gs_cls: ; CODE XREF: mnu_clearscreenp
- ; mnu_init+24p ...
- movem.l d0-d3/a0-a1/a6,-(sp)
- movea.l (_RtgBase).l,a6
- movea.l (gamescreen).l,a0
- suba.l a1,a1
- moveq #0,d0
- moveq #0,d1
- move.l (gs_width).l,d2
- move.l (gs_height).l,d3
- jsr -$C0(a6)
- movea.l (gamescreen).l,a0
- jsr -$AE(a6)
- movem.l (sp)+,d0-d3/a0-a1/a6
- rts
- ; End of function rtg_gs_cls
- ; =============== S U B R O U T I N E =======================================
- rtg_initmenuscreen: ; CODE XREF: rtg_initmenuscreen+58j
- ; sub_BB8+13Ep
- movea.l (_RtgBase).l,a6
- movea.l (gamescreen).l,a0
- moveq #0,d0
- jsr -$42(a6)
- move.l d0,(vidm_mainbuffer_ptr).l
- beq.s loc_3F2
- movea.l (gamescreen).l,a0
- suba.l a1,a1
- moveq #0,d0
- moveq #0,d1
- move.l (gs_width).l,d2
- move.l (gs_height).l,d3
- jsr -$C0(a6)
- movea.l (gamescreen).l,a0
- jsr -$AE(a6)
- movea.l (gamescreen).l,a0
- moveq #0,d0
- jsr -$2A(a6)
- rts
- ; ---------------------------------------------------------------------------
- loc_3F2: ; CODE XREF: rtg_initmenuscreen+18j
- lea (es_getbufadrfail).l,a1
- bsr.w error_report
- bne.s rtg_initmenuscreen
- loc_3FE: ; DATA XREF: DATA:00012E44o
- bra.w cleanup
- ; End of function rtg_initmenuscreen
- ; =============== S U B R O U T I N E =======================================
- rtg_copyborder: ; CODE XREF: PLAYTHEGAME+18p
- ; changescreensize+82p
- movea.l (_RtgBase).l,a6
- movea.l (gamescreen).l,a0
- movea.l (vidm_mainbuffer_ptr).l,a1
- lea (border8).l,a2
- moveq #0,d0
- move.l (gs_height).l,d1
- sub.w #$18,d1
- move.l #$140,d2
- move.l #$10,d3
- moveq #0,d4
- moveq #0,d5
- jsr -$90(a6)
- movea.l (gamescreen).l,a0
- suba.l a1,a1
- movea.w #1,a2
- moveq #0,d0
- moveq #0,d1
- moveq #0,d2
- moveq #0,d3
- move.l #$140,d4
- move.l #$100,d5
- move.l #$C0,d6 ; 'À'
- jsr -$BA(a6)
- clr.w (OldAmmo).l
- clr.w (OldEnergy).l
- rts
- ; End of function rtg_copyborder
- ; =============== S U B R O U T I N E =======================================
- rtg_initbuf3: ; CODE XREF: PLAYTHEGAME+1Cp
- movea.l (_RtgBase).l,a6
- movea.l (gamescreen).l,a0
- movea.w #2,a1
- moveq #0,d0
- moveq #0,d1
- move.l (gs_width).l,d2
- move.l (gs_height).l,d3
- jsr -$C0(a6)
- movea.l (gamescreen).l,a0
- moveq #2,d0
- jsr -$42(a6)
- move.l d0,(vidm_fontbuffer_ptr).l
- movea.l (gamescreen).l,a0
- loc_4AE: ; DATA XREF: DATA:memlisto
- movea.l (vidm_fontbuffer_ptr).l,a1
- lea (borderchars8).l,a2
- moveq #0,d0
- moveq #0,d1
- move.l #$140,d2
- moveq #$1E,d3
- moveq #0,d4
- moveq #0,d5
- jsr -$90(a6)
- movea.l (gamescreen).l,a0
- moveq #2,d0
- jsr -$42(a6)
- move.l d0,(vidm_fontbuffer_ptr).l
- movea.l (gamescreen).l,a0
- movea.l (vidm_fontbuffer_ptr).l,a1
- lea (SCROLLCHARS).l,a2
- moveq #0,d0
- moveq #$1F,d1
- move.l #$140,d2
- moveq #$3C,d3 ; '<'
- moveq #0,d4
- moveq #0,d5
- jsr -$90(a6)
- rts
- ; End of function rtg_initbuf3
- ; =============== S U B R O U T I N E =======================================
- rtg_clearbuffer: ; CODE XREF: PLAYTHEGAME+4p
- ; PLAYTHEGAME+Ap
- movea.l (_RtgBase).l,a6
- movea.l (gamescreen).l,a0
- moveq #0,d0
- moveq #0,d1
- move.l (gs_width).l,d2
- move.l (gs_height).l,d3
- jsr -$C0(a6)
- rts
- ; End of function rtg_clearbuffer
- ; =============== S U B R O U T I N E =======================================
- rtg_16b_aligned_test: ; CODE XREF: PLAYTHEGAME:loc_1F5Ep
- cmpi.w #1,(screencopy).l
- bne.s locret_556
- move.l (vidm_mainbuffer_ptr).l,d0
- move.l d0,d6
- lsr.l #4,d0
- lsl.l #4,d0
- cmp.l d0,d6
- beq.s locret_556
- lea (es_alignfail).l,a1
- lea (error_report_args).l,a3
- move.l d6,(a3)
- bsr.w error_report
- locret_556: ; CODE XREF: rtg_16b_aligned_test+8j
- ; rtg_16b_aligned_test+18j
- rts
- ; End of function rtg_16b_aligned_test
- ; =============== S U B R O U T I N E =======================================
- draw_character: ; CODE XREF: draw_string+28p
- move.l d2,d3
- lsr.l #4,d3
- move.l d2,d4
- and.l #$F,d4
- mulu.w #$500,d3
- lsl.l #3,d4
- lea (xen_font).l,a1
- adda.l d3,a1
- adda.l d4,a1
- movea.l (fastbuffer_ptr).l,a0
- mulu.l (gs_bytesperrow).l,d1
- adda.l d0,a0
- adda.l d1,a0
- moveq #9,d7
- loc_588: ; CODE XREF: draw_character+48j
- move.l (a1),d0
- or.l d0,(a0)
- move.l 4(a1),d0
- or.l d0,4(a0)
- adda.l #$80,a1 ; '€'
- adda.l (gs_bytesperrow).l,a0
- dbf d7,loc_588
- rts
- ; End of function draw_character
- ; =============== S U B R O U T I N E =======================================
- draw_string: ; CODE XREF: mnu_viewcredz+1Ep
- ; mnu_viewcredz+34p
- movem.l d2-d4/d6-d7/a1,-(sp)
- ext.l d0
- ext.l d1
- move.l d0,d6
- loc_5B0: ; CODE XREF: draw_string+1Ej
- ; draw_string+34j
- moveq #0,d2
- move.b (a0)+,d2
- beq.s loc_5DC
- cmpi.b #$A,d2
- bne.s loc_5C6
- move.l d6,d0
- add.l #8,d1
- bra.s loc_5B0
- ; ---------------------------------------------------------------------------
- loc_5C6: ; CODE XREF: draw_string+14j
- movem.l d0-d1/a0,-(sp)
- sub.b #$20,d2 ; ' '
- bsr.s draw_character
- movem.l (sp)+,d0-d1/a0
- add.l #7,d0
- bra.s loc_5B0
- ; ---------------------------------------------------------------------------
- loc_5DC: ; CODE XREF: draw_string+Ej
- movem.l (sp)+,d2-d4/d6-d7/a1
- rts
- ; End of function draw_string
- ; =============== S U B R O U T I N E =======================================
- ahi_init: ; CODE XREF: sub_BE+1Ep
- lea (AHI_PORT).l,a0
- clr.l (a0)+
- clr.l (a0)+
- clr.l (a0)+
- movea.l (_SysBase).l,a6
- jsr -$29A(a6)
- lea (AHI_PORT).l,a0
- move.l d0,(a0)
- beq.s loc_668
- movea.l d0,a0
- moveq #$50,d0 ; 'P'
- jsr -$28E(a6)
- lea (AHI_IOR).l,a0
- move.l d0,(a0)
- beq.s loc_65C
- lea (AHI_NAME).l,a0 ; "ahi.device"
- movea.l d0,a1
- move.w #4,$30(a1)
- move.l #$FF,d0
- moveq #0,d1
- jsr -$1BC(a6)
- lea (AHI_DEVICE).l,a0
- move.l d0,(a0)
- bne.s loc_644
- movea.l (AHI_IOR).l,a0
- loc_63E: ; DATA XREF: DATA:00012DCCo
- ; DATA:00012DD4o ...
- move.l $14(a0),d0
- bra.s loc_674
- ; ---------------------------------------------------------------------------
- loc_644: ; CODE XREF: ahi_init+54j
- lea (es_openahidevicefail).l,a1
- lea (error_report_args).l,a3
- move.l #4,(a3)
- bsr.w error_report
- bra.s loc_672
- ; ---------------------------------------------------------------------------
- loc_65C: ; CODE XREF: ahi_init+30j
- lea (es_createiorequest).l,a1
- bsr.w error_report
- bra.s loc_672
- ; ---------------------------------------------------------------------------
- loc_668: ; CODE XREF: ahi_init+1Ej
- lea (es_createmsgportfail).l,a1
- bsr.w error_report
- loc_672: ; CODE XREF: ahi_init+78j ahi_init+84j
- moveq #0,d0
- loc_674: ; CODE XREF: ahi_init+60j
- move.l d0,(_AHIBase).l
- beq.w ahi_error
- movea.l d0,a6
- move.l (audioid).l,d0
- move.l d0,(ahi_tstid).l
- move.l d0,(ahi_audioid).l
- move.l (mixfreq).l,(ahi_mixfreq).l
- lea (ahi_bestmode_tags2).l,a1
- jsr -$72(a6)
- cmpi.l #$FFFFFFFF,d0
- bne.s loc_6B2
- bsr.w ahi_getaudiomode
- loc_6B2: ; CODE XREF: ahi_init+CAj
- lea (ahi_tags).l,a1
- jsr -$2A(a6)
- move.l d0,(AudioCtrl).l
- beq.s loc_6FE
- pea (OpenLibs).w
- pea (1).w
- pea ($80000050).l
- move.l #(loc_FFFC+4),-(sp)
- pea ($80000057).l
- movea.l (_AHIBase).l,a6
- movea.l (AudioCtrl).l,a2
- movea.l sp,a1
- jsr -$3C(a6)
- lea $14(sp),sp
- st (ahi_sound).l
- moveq #1,d0
- rts
- ; ---------------------------------------------------------------------------
- loc_6FE: ; CODE XREF: ahi_init+E0j
- lea (es_allocaudiofail).l,a1
- bsr.w error_report
- bra.w *+4
- ahi_error: ; CODE XREF: ahi_init+98j
- moveq #0,d0
- ; End of function ahi_init
- ; =============== S U B R O U T I N E =======================================
- ahi_end: ; CODE XREF: sub_BE+9Ap
- move.l d0,-(sp)
- move.l (_AHIBase).l,d0
- beq.s loc_75C
- movea.l d0,a6
- movea.l (ahi_req1).l,a0
- jsr -$84(a6)
- clr.l (ahi_req1).l
- move.l (AudioCtrl).l,d0
- beq.s loc_75C
- pea (OpenLibs).w
- pea (OpenLibs).w
- pea ($80000050).l
- movea.l d0,a2
- movea.l sp,a1
- jsr -$3C(a6)
- lea $C(sp),sp
- movea.l (AudioCtrl).l,a2
- jsr -$30(a6)
- clr.l (AudioCtrl).l
- loc_75C: ; CODE XREF: ahi_end+8j ahi_end+22j
- clr.l (_AHIBase).l
- movea.l (_SysBase).l,a6
- lea (AHI_DEVICE).l,a1
- tst.l (a1)
- bne.s loc_78C
- subq.l #1,(a1)
- movea.l (AHI_IOR).l,a1
- jsr -$1C2(a6)
- lea (AHI_IOR).l,a1
- movea.l (a1),a0
- clr.l (a1)
- jsr -$294(a6)
- loc_78C: ; CODE XREF: ahi_end+62j
- lea (AHI_PORT).l,a1
- movea.l (a1),a0
- clr.l (a1)
- jsr -$2A0(a6)
- move.l (sp)+,d0
- rts
- ; End of function ahi_end
- ; =============== S U B R O U T I N E =======================================
- ahi_getaudiomode: ; CODE XREF: ahi_init+CCp
- ; menu_changeconfig+24j
- movea.l (_AHIBase).l,a6
- suba.l a0,a0
- jsr -$78(a6)
- move.l d0,(ahi_req1).l
- beq.s loc_7E8
- movea.l d0,a0
- lea (AHIReqTags).l,a1
- jsr -$7E(a6)
- tst.l d0
- beq.s loc_7E8
- movea.l (ahi_req1).l,a0
- move.l 0(a0),d0
- move.l 4(a0),d1
- loc_7D0: ; DATA XREF: DATA:00012D7Co
- ; DATA:00012E1Co
- move.l d0,(ahi_audioid).l
- move.l d1,(ahi_mixfreq).l
- move.l d0,(audioid).l
- move.l d1,(mixfreq).l
- loc_7E8: ; CODE XREF: ahi_getaudiomode+12j
- ; ahi_getaudiomode+22j
- movea.l (ahi_req1).l,a0
- jsr -$84(a6)
- clr.l (ahi_req1).l
- rts
- ; End of function ahi_getaudiomode
- ; =============== S U B R O U T I N E =======================================
- ahi_loadsamp: ; CODE XREF: load_sfx+24p
- movem.l d0-a6,-(sp)
- movea.l (_AHIBase).l,a6
- move.l d1,-(sp)
- move.l d0,-(sp)
- pea (0).w
- move.l (ahisampnr).l,d0
- moveq #0,d1
- movea.l sp,a0
- movea.l (AudioCtrl).l,a2
- jsr -$5A(a6)
- addq.l #1,(ahisampnr).l
- lea $C(sp),sp
- movem.l (sp)+,d0-a6
- rts
- ; End of function ahi_loadsamp
- ; =============== S U B R O U T I N E =======================================
- ahi_MakeSomeNoise: ; CODE XREF: MakeSomeNoise+196p
- ; MakeSomeNoise+204p ...
- tst.w (ahi_sound).l
- beq.s locret_89E
- movem.l d0-a6,-(sp)
- movea.l (_AHIBase).l,a6
- move.l d6,d0
- move.l #$1F40,d1
- movea.l (AudioCtrl).l,a2
- moveq #1,d2
- jsr -$48(a6)
- move.l d6,d0
- lsl.l #8,d7
- lsl.l #2,d7
- move.l d7,d1
- move.l #$8000,d2
- movea.l (AudioCtrl).l,a2
- moveq #1,d3
- jsr -$42(a6)
- move.l d6,d0
- moveq #0,d1
- move.w d5,d1
- moveq #0,d2
- moveq #0,d3
- movea.l (AudioCtrl).l,a2
- moveq #1,d4
- jsr -$4E(a6)
- move.l d6,d0
- moveq #$FFFFFFFF,d1
- moveq #0,d2
- moveq #0,d3
- movea.l (AudioCtrl).l,a2
- moveq #0,d4
- jsr -$4E(a6)
- movem.l (sp)+,d0-a6
- locret_89E: ; CODE XREF: ahi_MakeSomeNoise+6j
- rts
- ; End of function ahi_MakeSomeNoise
- ; =============== S U B R O U T I N E =======================================
- ahi_soundfunccode: ; DATA XREF: DATA:0001D6B2o
- movem.l d0-a6,-(sp)
- move.w (a1),d0
- beq.s loc_8E0
- cmpi.w #1,d0
- beq.s loc_908
- cmpi.w #2,d0
- beq.s loc_930
- cmpi.w #3,d0
- beq.w loc_958
- cmpi.w #4,d0
- beq.w loc_980
- cmpi.w #5,d0
- beq.w loc_9A6
- cmpi.w #6,d0
- beq.w loc_9CA
- cmpi.w #7,d0
- beq.w loc_9EE
- bra.w loc_A10
- ; ---------------------------------------------------------------------------
- loc_8E0: ; CODE XREF: ahi_soundfunccode+6j
- tst.b (playnull0).l
- beq.s loc_8F2
- clr.b (playnull0).l
- bra.w loc_A10
- ; ---------------------------------------------------------------------------
- loc_8F2: ; CODE XREF: ahi_soundfunccode+46j
- st (playnull0).l
- clr.w (word_167D8).l
- clr.w (word_167BA).l
- bra.w loc_A10
- ; ---------------------------------------------------------------------------
- loc_908: ; CODE XREF: ahi_soundfunccode+Cj
- tst.b (playnull1).l
- beq.s loc_91A
- clr.b (playnull1).l
- bra.w loc_A10
- ; ---------------------------------------------------------------------------
- loc_91A: ; CODE XREF: ahi_soundfunccode+6Ej
- st (playnull1).l
- clr.w (word_167DC).l
- clr.w (word_167BE).l
- bra.w loc_A10
- ; ---------------------------------------------------------------------------
- loc_930: ; CODE XREF: ahi_soundfunccode+12j
- tst.w (playnull2).l
- beq.s loc_942
- clr.b (playnull2).l
- bra.w loc_A10
- ; ---------------------------------------------------------------------------
- loc_942: ; CODE XREF: ahi_soundfunccode+96j
- st (playnull2).l
- clr.w (word_167E0).l
- clr.w (word_167C2).l
- bra.w loc_A10
- ; ---------------------------------------------------------------------------
- loc_958: ; CODE XREF: ahi_soundfunccode+18j
- tst.w (playnull3).l
- beq.s loc_96A
- ; End of function ahi_soundfunccode
- ; =============== S U B R O U T I N E =======================================
- sub_960: ; DATA XREF: DATA:00012E04o
- ; DATA:00012E24o
- clr.b (playnull3).l
- bra.w loc_A10
- ; ---------------------------------------------------------------------------
- loc_96A: ; CODE XREF: ahi_soundfunccode+BEj
- st (playnull3).l
- clr.w (word_167E4).l
- clr.w (word_167C6).l
- bra.w loc_A10
- ; ---------------------------------------------------------------------------
- loc_980: ; CODE XREF: ahi_soundfunccode+20j
- tst.w (playnull4).l
- beq.s loc_992
- clr.b (playnull4).l
- bra.w loc_A10
- ; ---------------------------------------------------------------------------
- loc_992: ; CODE XREF: sub_960+26j
- st (playnull4).l
- clr.w (word_167E8).l
- clr.w (word_167CA).l
- bra.s loc_A10
- ; ---------------------------------------------------------------------------
- loc_9A6: ; CODE XREF: ahi_soundfunccode+28j
- tst.w (playnull5).l
- beq.s loc_9B6
- clr.b (playnull5).l
- bra.s loc_A10
- ; ---------------------------------------------------------------------------
- loc_9B6: ; CODE XREF: sub_960+4Cj
- st (playnull5).l
- clr.w (word_167EC).l
- clr.w (word_167CE).l
- bra.s loc_A10
- ; ---------------------------------------------------------------------------
- loc_9CA: ; CODE XREF: ahi_soundfunccode+30j
- tst.w (playnull6).l
- beq.s loc_9DA
- clr.b (playnull6).l
- bra.s loc_A10
- ; ---------------------------------------------------------------------------
- loc_9DA: ; CODE XREF: sub_960+70j
- st (playnull6).l
- clr.w (word_167F0).l
- clr.w (word_167D2).l
- bra.s loc_A10
- ; ---------------------------------------------------------------------------
- loc_9EE: ; CODE XREF: ahi_soundfunccode+38j
- tst.w (playnull7).l
- beq.s loc_9FE
- clr.b (playnull7).l
- bra.s loc_A10
- ; ---------------------------------------------------------------------------
- loc_9FE: ; CODE XREF: sub_960+94j
- st (playnull7).l
- clr.w (word_167F4).l
- clr.w (word_167D6).l
- loc_A10: ; CODE XREF: ahi_soundfunccode+3Cj
- ; ahi_soundfunccode+4Ej ...
- movem.l (sp)+,d0-a6
- rts
- ; End of function sub_960
- ; =============== S U B R O U T I N E =======================================
- error_report: ; CODE XREF: rtg_init+100p
- ; rtg_init+10Cp ...
- movem.l d1/a0/a2/a6,-(sp)
- movea.l (_IntuitionBase).l,a6
- suba.l a0,a0
- movea.l a0,a2
- jsr -$24C(a6)
- movem.l (sp)+,d1/a0/a2/a6
- rts
- ; End of function error_report
- ; =============== S U B R O U T I N E =======================================
- initstuff: ; CODE XREF: sub_BE+28p
- lea (PLR1_GunSelected).l,a1
- move.w #0,loc_6960-PLR1_GunSelected(a1)
- st (PLR2KEYS).l
- clr.b (PLR2PATH).l
- clr.b (PLR2MOUSE).l
- clr.b (PLR2JOY).l
- bsr.s memory_get
- movea.l (consttab_ptr).l,a0
- moveq #1,d0
- move.w #$1FFF,d1
- loc_A60: ; CODE XREF: initstuff+5Aj
- move.l #$100000,d2
- divs.l d0,d2
- move.l #$10000000,d3
- divs.l d2,d3
- move.l d3,(a0)+
- asr.l #1,d2
- sub.l #$A00,d2
- muls.l d3,d2
- asr.l #6,d2
- move.l d2,(a0)+
- addq.w #1,d0
- dbf d1,loc_A60
- rts
- ; End of function initstuff
- ; =============== S U B R O U T I N E =======================================
- memory_get: ; CODE XREF: initstuff+24p
- movea.l (_SysBase).l,a6
- move.l #(loc_FFFC+4),d0
- move.l #400000,d1
- move.l #unk_186A0,d2
- jsr -$2B8(a6)
- move.l d0,(fastmempool).l
- beq.w freemem
- movea.l #memlist,a4
- loc_ABA: ; CODE XREF: memory_get+34j
- ; memory_get+3Aj
- move.l (a4)+,d0
- beq.s loc_ACA
- movea.l (a4)+,a5
- tst.l (a5)
- bne.s loc_ABA
- bsr.s mem_alloc
- move.l d0,(a5)
- bra.s loc_ABA
- ; ---------------------------------------------------------------------------
- loc_ACA: ; CODE XREF: memory_get+2Ej
- move.l (depthtable_ptr).l,d0
- add.l #$140,d0
- move.l d0,(enddepthtab_ptr).l
- rts
- ; End of function memory_get
- ; =============== S U B R O U T I N E =======================================
- mem_alloc: ; CODE XREF: memory_get+36p
- ; load_file+82p ...
- movem.l d1-d2/a0-a3/a6,-(sp)
- loc_AE2: ; CODE XREF: mem_alloc+3Aj
- movea.l (_SysBase).l,a6
- move.l d0,d2
- movea.l (fastmempool).l,a0
- jsr -$2C4(a6)
- tst.l d0
- beq.s loc_AFE
- movem.l (sp)+,d1-d2/a0-a3/a6
- rts
- ; ---------------------------------------------------------------------------
- loc_AFE: ; CODE XREF: mem_alloc+18j
- lea (es_allocmemfail).l,a1
- lea (error_report_args).l,a3
- move.l d2,(a3)
- bsr.w error_report
- tst.l d0
- beq.w cleanup
- move.l d2,d0
- bra.s loc_AE2
- ; End of function mem_alloc
- ; =============== S U B R O U T I N E =======================================
- mem_free: ; CODE XREF: sub_BB8+154p sub_BB8+164p ...
- movem.l d1/a1/a6,-(sp)
- movea.l (_SysBase).l,a6
- movea.l (fastmempool).l,a0
- jsr -$2CA(a6)
- movem.l (sp)+,d1/a1/a6
- clr.l (a1)
- rts
- ; End of function mem_free
- ; ---------------------------------------------------------------------------
- ; START OF FUNCTION CHUNK FOR sub_BE
- menu: ; CODE XREF: sub_BE+36j
- moveq #0,d0
- move.w (screencopy).l,d0
- bsr.w config_screencopy
- move.b #$6E,(mors).l ; 'n'
- movea.l (_SysBase).l,a6
- move.l (gs_bytesperrow).l,d0
- mulu.l (gs_height).l,d0
- add.l #$C,d0
- move.l #(loc_FFFC+4),d1
- jsr -$2AC(a6)
- move.l d0,(realrealfastbuffer_ptr).l
- add.l #$C,d0
- move.l d0,(fastbuffer_ptr).l
- move.l d0,(realfastbuffer_ptr).l
- beq.w freemem
- move.l (gs_bytesperrow).l,d0
- mulu.l (gs_height).l,d0
- move.l #(loc_FFFC+4),d1
- jsr -$2AC(a6)
- move.l d0,(fastbuffer2_ptr).l
- beq.w freemem
- lea ((IVEWONTEXT+$5A0)).l,a0
- jsr load_file
- ; END OF FUNCTION CHUNK FOR sub_BE
- ; =============== S U B R O U T I N E =======================================
- sub_BB8: ; DATA XREF: DATA:00012D84o
- move.l d0,(linkfile_ptr).l
- lea (LEVELTEXTNAME).l,a0 ; "progdir:includes/TEXT_FILE"
- jsr load_file
- move.l d0,(LEVELTEXT).l
- lea (VBLANKInt).l,a1
- moveq #5,d0
- jsr -$A8(a6)
- bsr.w mnu_setscreen
- move.l sp,(mnu_mainstack).l
- bsr.w mnu_viewcredz
- tst.w (ahi_sound).l
- beq.s loc_BF8
- jsr load_sfx
- loc_BF8: ; CODE XREF: sub_BB8+38j
- jsr load_walls
- jsr load_floors
- lea (backpicname).l,a0 ; "progdir:includes/rawbackpacked"
- jsr load_file
- move.l d0,(BackPicture_ptr).l
- jsr load_objects
- bsr.w menu_defaultgame
- bsr.w keyb_clearkeybuf
- bsr.w mnu_setscreen
- menu_start: ; CODE XREF: sub_BB8+1DEj
- cmpi.b #$73,(mors).l ; 's'
- beq.s loc_C48
- cmpi.b #$6D,(mors).l ; 'm'
- beq.s loc_C42
- bsr.w menu_readmainmenu
- bra.s game_start
- ; ---------------------------------------------------------------------------
- loc_C42: ; CODE XREF: sub_BB8+82j
- bsr.w menu_master
- bra.s game_start
- ; ---------------------------------------------------------------------------
- loc_C48: ; CODE XREF: sub_BB8+78j
- bsr.w menu_slave
- game_start: ; CODE XREF: sub_BB8+88j sub_BB8+8Ej
- tst.b (SHOULDQUIT).l
- bne.w cleanup
- clr.b (FINISHEDLEVEL).l
- clr.w (PLR1s_angpos).l
- clr.w (PLR2s_angpos).l
- clr.w (PLR1_angpos).l
- clr.w (PLR2_angpos).l
- clr.b (PLR1_GunSelected).l
- clr.b (PLR2_GunSelected).l
- clr.b (NASTY).l
- movea.l #MASTERPLAYERONEHEALTH,a0
- movea.l #MASTERPLAYERONESHIELD,a1
- movea.l #PLAYERONEHEALTH,a2
- movea.l #PLAYERONESHIELD,a3
- movea.l #PLAYERTWOHEALTH,a4
- movea.l #PLAYERTWOSHIELD,a5
- move.l (a0),(a2)+
- move.l (a0)+,(a4)+
- move.l (a0),(a2)+
- move.l (a0)+,(a4)+
- move.l (a0),(a2)+
- move.l (a0)+,(a4)+
- move.l (a0),(a2)+
- move.l (a0)+,(a4)+
- move.l (a0),(a2)+
- move.l (a0)+,(a4)+
- move.l (a0),(a2)+
- move.l (a0)+,(a4)+
- move.l (a0),(a2)+
- move.l (a0)+,(a4)+
- move.l (a0),(a2)+
- move.l (a0)+,(a4)+
- move.l (a0),(a2)+
- move.l (a0)+,(a4)+
- move.l (a0),(a2)+
- move.l (a0)+,(a4)+
- move.l (a0),(a2)+
- move.l (a0)+,(a4)+
- move.l (a1),(a3)+
- move.l (a1)+,(a5)+
- move.l (a1),(a3)+
- move.l (a1)+,(a5)+
- move.l (a1),(a3)+
- move.l (a1)+,(a5)+
- move.l (a1),(a3)+
- move.l (a1)+,(a5)+
- move.l (a1),(a3)+
- move.l (a1)+,(a5)+
- move.l (a1),(a3)+
- move.l (a1)+,(a5)+
- bsr.w keyb_clearkeybuf
- bsr.w PLAYTHEGAME
- bsr.w rtg_initmenuscreen
- movea.l (_SysBase).l,a6
- move.l (links_size).l,d0
- movea.l (links_ptr).l,a1
- bsr.w mem_free
- move.l (flylinks_size).l,d0
- movea.l (flylinks_ptr).l,a1
- bsr.w mem_free
- move.l (leveldata_size).l,d0
- movea.l (leveldata_ptr).l,a1
- bsr.w mem_free
- move.l (levelgraphics_size).l,d0
- movea.l (levelgraphics_ptr).l,a1
- bsr.w mem_free
- move.l (levelclips_size).l,d0
- movea.l (levelclips_ptr).l,a1
- bsr.w mem_free
- tst.b (FINISHEDLEVEL).l
- beq.s loc_D92
- movea.l #MASTERPLAYERONEHEALTH,a0
- movea.l #MASTERPLAYERONESHIELD,a1
- movea.l #PLAYERONEHEALTH,a2
- movea.l #PLAYERONESHIELD,a3
- move.l (a2)+,(a0)+
- move.l (a2)+,(a0)+
- move.l (a2)+,(a0)+
- move.l (a2)+,(a0)+
- move.l (a2)+,(a0)+
- move.l (a2)+,(a0)+
- move.l (a2)+,(a0)+
- move.l (a2)+,(a0)+
- move.l (a2)+,(a0)+
- move.l (a2)+,(a0)+
- move.l (a2)+,(a0)+
- move.l (a3)+,(a1)+
- move.l (a3)+,(a1)+
- move.l (a3)+,(a1)+
- move.l (a3)+,(a1)+
- move.l (a3)+,(a1)+
- move.l (a3)+,(a1)+
- loc_D92: ; CODE XREF: sub_BB8+19Ej
- bsr.w mnu_setscreen
- bra.w menu_start
- ; ---------------------------------------------------------------------------
- cleanup: ; CODE XREF: rtg_initmenuscreen:loc_3FEj
- ; mem_alloc+34j ...
- jsr CLOSETWEENSCRN
- movea.l (_SysBase).l,a6
- lea (VBLANKInt).l,a1
- moveq #5,d0
- jsr -$AE(a6)
- freemem: ; CODE XREF: memory_get+22j
- ; sub_BE+AC8j ...
- movea.l (_SysBase).l,a6
- movea.l (fastmempool).l,a0
- tst.l a0
- beq.s loc_DC6
- jsr -$2BE(a6)
- loc_DC6: ; CODE XREF: sub_BB8+208j
- movea.l (realrealfastbuffer_ptr).l,a1
- tst.l a1
- beq.s loc_DE2
- jsr -$2B2(a6)
- movea.l (fastbuffer2_ptr).l,a1
- tst.l a1
- beq.s loc_DE2
- jsr -$2B2(a6)
- loc_DE2: ; CODE XREF: sub_BB8+216j sub_BB8+224j
- bra.w closelibs
- ; End of function sub_BB8
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement