home *** CD-ROM | disk | FTP | other *** search
- *
- * ROMCall.asm - Fake call from ROM
- *
-
- SECTION text,CODE
-
- XDEF _ROMCall,_InitROMCall
-
- *
- * Find an RTS instruction somewhere in ROM.
- *
-
- _InitROMCall:
- lea $01000000,a0
- move.l -$14(a0),d0 ; Get ROM size
- neg.l d0
- lea 0(a0,d0.l),a1 ; Pointer to start of ROM
- loop: cmp.w #$4e75,(a1)+
- bne.s loop ; Maybe we should check that we
- ; don't search past the end of
- ; ROM here, but there should
- ; really be an RTS *somewhere* in
- ; ROM.
- subq.l #2,a1
- move.l a1,_ROMRTS(a4)
- rts
-
- *
- * Fake a ROM call
- *
-
- _ROMCall:
- move.l _ROMRTS(a4),-(a7)
- jmp (a5)
-
- SECTION __MERGED,BSS
-
- XDEF _ROMRTS
-
- _ROMRTS: ds.l 1
-
- END
-