

;*************************************************
;	object macro
;*************************************************
M2dOBJdata	macro
	db	1		; program code
	dw	\1&0ffffh	; program address
	db	\2		; animation SEQ number
	dw	\3		; position X
	dw	\4		; position Y
	dw	\5		; speed X
	dw	\6		; speed Y
	db	\7
	endm
;----------------------------------
Mdataend	macro
	db	0
	endm
;----------------------------------
Mady	macro
	tya
	clc
	adc	#\1
	tay
	endm
;----------------------------------
Mmessage macro
	ldx	#(\2)*256+\1
	jsl	OBJ_print
	endm
;----------------------------------
Mdispdigit macro
	ldy	#(\2)*256+\1
	jsl	OBJ_digit
	endm	
;----------------------------------




;*************************************************
;	0bank memory (RAM)
;*************************************************

;---------------------------------------------------------------------
continue_status		equ	objcontrol+0
;---------------------------------------------------------------------
sprite_offset		equ	objcontrol+8
register		equ	objcontrol+10
sprite_register		equ	objcontrol+12
sprite_start		equ	objcontrol+14
SEQaddr			equ	objcontrol+16	; 4byte
OBJaddr			equ	objcontrol+20	; 4byte
;---------------------------------------------------------------------
debugcounter		equ	objcontrol+24

Xlinklist_free		equ	objcontrol+30
Xlinklist_root		equ	objcontrol+32
;---------------------------------------------------------------------
word_free		equ	objcontrol+34
word_root		equ	objcontrol+38
word_object		equ	objcontrol+42
;---------------------------------------------------------------------
word_object_size	equ	64
word_object_total	equ	3
;---------------------------------------------------------------------

;*************************************************
;	Structure
;*************************************************
;=================================================
; 2D object
;=================================================
_backward	equ	0	; 34byte
_forward	equ	2	;
_program	equ	4	; JSL (program code )
				; Low
				; High
				; Bank
_velocityF	equ	8	
_angle		equ	10
_positionX	equ	12
_axisX		equ	14
_positionY	equ	16
_axisY		equ	18
_velocityX	equ	20
_velocityY	equ	22
;=================================================
; 2D sprite animation object
;=================================================
_SEQaddress	equ	24	;2byte
_SEQbank	equ	26	;2byte
_OBJaddress	equ	28	;2byte
_animeNO	equ	30	;2byte
_anime_pointer	equ	32	;2byte
_anime_counter	equ	34	;2byte
_obj_pointer	equ	36	;2byte
_STR_pointer	equ	40	;2byte
_STR_counter	equ	42	;2byte

;=================================================

;*************************************************
;	Key
;*************************************************

;-------------------------------
button_B	equ	8000h
button_Y	equ	4000h
button_select	equ	2000h
button_start	equ	1000h
button_up	equ	0800h
button_down	equ	0400h
button_left	equ	0200h
button_right	equ	0100h
;-------------------------------
button_A	equ	0080h
button_X	equ	0040h
button_L	equ	0020h
button_R	equ	0010h
;-------------------------------

;*************************************************
;	Alpha
;*************************************************


obj_p0	equ	0000h
obj_p1	equ	0200h
obj_p2	equ	0400h
obj_p3	equ	0600h
obj_p4	equ	0800h
obj_p5	equ	0a00h
obj_p6	equ	0c00h
obj_p7	equ	0e00h


;*************************************************
;	Alpha
;*************************************************

_a	equ	0ah
_b	equ	0bh
_c	equ	0ch
_d	equ	0dh
_e	equ	0eh
_f	equ	0fh
_g	equ	10h
_h	equ	11h
_i	equ	12h
_j	equ	13h
_k	equ	14h
_l	equ	15h
_m	equ	16h
_n	equ	17h
_o	equ	18h
_p	equ	19h
_q	equ	1ah
_r	equ	1bh
_s	equ	1ch
_t	equ	1dh
_u	equ	1eh
_v	equ	1fh
_w	equ	20h
_x	equ	21h
_y	equ	22h
_z	equ	23h

ed	equ	0ffh

;==================================================
