tjbs-base-asm-with-data-bank-management

by tjb0607

Game: N/A

Description: Base ASM file for copy/pasting - with data bank management

; Base ASM file - feel free to copy/paste this and use this for your own code.
; This is the version with data bank management - be careful to ALWAYS plb before every rtl!!!

	LDA $100	; \ only run in gamemode 14
	EOR #$14	; |
	ORA $9D		; | and when the game isn't paused
	BEQ +		; |
	RTL		; |
	+		; /

	PHB		; \ push old data bank to stack, and set data bank to current program bank
	PHK		; | this allows inline data using db
	PLB		; / !! WARNING!! YOU *MUST* ALWAYS PLB BEFORE YOU RTL
	
; YOUR CODE HERE
	
	PLB
	RTL
back to listings