SCTRL macro nr, bps1, bps0, sin, sout, rint
	move.b #(bps1<<7)+(bps0<<6)+(sin<<5)+(sout<<4)+(rint<<3), ($A100013+((nr-1)*3))
	endm

WaitFrame macro
;	tst.b (VSync)
;    beq.s *-6
;    subq.b #1, (Vsync)
    stop #$2500
	endm
	
align macro 
	cnop 0,\1 
	endm
	
; EQUATES


timer1      Equ $FFE000

RLEData		EQU $FF1000
VDPControl 	EQU $C00004 ; VDP control port
VDPData    	EQU $C00000 ; VDP data port
VRAM_Flags 	EQU $FFE004 ; VRAM Flags for nametable
Palette     EQU $FFE008 
JoyPad1		EQU $A10003 ; Joypad 1 data :V

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; RAM LAYOUT

ProgramStart    EQU $FF0000 ; Program start
RAM             EQU $FFF000 ; 1280 bytes of memory
RAM_VINT        EQU $FFF500 ; Vertical Interrupt Routine
RAM_HINT        EQU $FFF700 ; Horizontal Interrupt Routine
Stack           EQU $FFF800 ; Until RAM end is the stack. DONT TOUCH, FGT