;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
;
; Shared Subroutines 1.0, by imamelia
;
; This patch inserts a lot of common subroutines into your ROM so that you can
; use them without having to copy-paste them.  Some examples are GetDrawInfo,
; SubOffscreen, and the Map16 tile-generating subroutine.
;
;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

header
lorom

incsrc subroutinedefs_xkas.asm

!FreespaceU = $81F500  ;was 81E2B0

org !FreespaceU
; This is the starting address for the subroutines.  All "JSL [insert subroutine here]" commands should
; be JSLing to this bank.

autoclean JML GetDrawInfoMain		; GetDrawInfo: sets up some variables for a sprite GFX routine
autoclean JML SubOffscreenX0		; SubOffscreen: checks if a sprite is offscreen, sets offscreen flag if necessary
autoclean JML SubHorizPosMain		; SubHor(i)zPos: checks which horizontal side of a sprite the player is on; stores the horizontal distance between them to $0F
autoclean JML SubVertPosMain		; SubVertPos: checks which vertical side of a sprite the player is on; stores the vertical distance between them to $0E
autoclean JML SubSetMap16Main		; Sub(l)SetMap16: changes one Map16 tile to another
autoclean JML SubOffscreenX3		; SubOffscreen: checks if a sprite is offscreen, sets offscreen flag if necessary


freecode

incsrc subroutinemaincode.asm


