;****************************************************************************
;*     		work for mario-kart	                                    *
;*						1992.06.03	            *
;****************************************************************************0
button_status		equ	020h	;set button status 		00h=a con
;
button_stock		equ	024h	;pre 1 frame button status
button_trigger		equ	028h	;buttun trigger 		  ;
;
game_status		equ	02ch	
					;00h=grandprix
					;02h=VS
					;04h=time tyial
					;06h=battle
game_mode		equ	02eh	
					;00h=2 player
					;02h=1 player upper
					;04h=1 player lower
game_level		equ	030h
					;00h=50cc
					;02h=100cc
					;04h=150cc
;NMI USE WORK
NMI_flag		equ	044h	;NMI control flag	chaeck NIM status
nmi_work1		equ	090h
nmi_work2		equ	046h
;
game_selecta		equ	032h
					;00=non select
					;02h=racing
					;04h=title
					;06h=kart select
					;08h=name input
					;0ah=result
					;0ch=record
					;0eh=battle
					;10h=edit 01
					;12h=edit 02
					;14h=edit 03
nmi_counter		equ	034h	
					;this counter will increce
					;whenever NMI occers!!!
game_index		equ	036h
					;main&NMI control index
irq_index		equ	0d0h
;
frame_counter		equ	038h
					;1 frame counter ;
				;this counter works as racing status on
				;if it is pause statsu then this counter stop
race_status		equ	03ah
					;00h=initial game mode
					;02h=opening fade in
					;04h=final count down
					;06h=nomal game status
					;08h=ending fade out
sprite_countA		equ	03ch
					;set oamdata  counter
sprite_countB		equ	03eh
					;set oamdata  counter
;----------------------------------------------------------------------------
sound_port		equ	040h
sound_00		equ	040h
sound_01		equ	041h
sound_02		equ	042h
sound_03		equ	043h
;----------------------------------------------------------------------------
sound_size		equ	0d2h
;----------------------------------------------------------------------------
fade_control		equ     048h	;fade coun control data
					;0ffh=nomal status
					;80h>>>8fh=fade in
					;0fh>>>01h=fade out
					;00h=branking
;---------------------------------------------------------------------------
;scroll_h,v & center_x,y	needs double buffer
;			for display screen B (not nessesaly for A) 
;		00h=screen A 02=screen B 04h=double buffer for screen B
scroll_h		equ	04ch	;scroll h position  (2byte) 
scroll_v		equ	052h	;scroll v position         ;
;
center_x		equ	058h    ;rotation center x position
center_y		equ	05eh	;	;	 y 	;
;
back_2h			equ	064h	;back screen scroll h (2byte)
back_2v			equ	06ah    ;          ;        v    ;
back_3h			equ	070h	;back screen scroll h (2byte)
back_3v			equ	076h    ;          ;        v    ;
;---------------camera's condition-------------------------------------------
camera_distance		equ	07ch	;camera-focus didistance
camera_pitch		equ	080h	;camera angle of elevation(pitching)
camera_zoom		equ	084h	;camera lenz view angle
;---------------camera's condition--------private data-----------------------
camera_x		equ	088h	;camera focus's  x position
camera_y		equ	08ch	;    	 ; 	 y    ;
;;camera_z		equ	090h	;    	 ;  	 y    ;*********90h use later
camera_direction 	equ	094h	;camera's direction(yowing)
camera_raster		equ	098h	;camera focus raster number
virtual_center		equ	09ch	;screen virtual center's raster
horizon			equ	0a0h	;screen's horizon raster
camera_mode		equ	0a4h	;camera's control mode
camera_index		equ	0a8h	;camera follow kart index(mycar fix)
					;00=dont follow
camera_control		equ	0ach	;camera control status
					;b15=dont move
				;b14=dont rotate
				;b13=camera moving (individualy)to mark pos
				;b12=camera moving (individualy)to index pos
camera_flip		equ	0d4h	;screen flip status

slot_sound_counter 	equ	0d8h	;	;
camera_drift		equ	0dch
				;difference between force direc to camera
					;use for spin!!
;---------------object character transport-----------------------------------
trans_counter		equ	04ah	;1byte transport counter
trans_counter_A		equ	0e0h
trans_counter_B		equ	0e2h
;trans_data		equ	0e0h
;rom_bank		equ	0e8h
;rom_address		equ	0f0h	;each 2byte * 2pattern
;vram_address		equ	0f8h	;each 2byte * 2pattern
;---------------------------------------------------------------------------
;		0b0h---0cfh	yajima used
;----------------------------------------------------------------------------
decimal_timer		equ	0100h
second_timer		equ	0102h
minute_timer		equ	0104h
;
old_game_index		equ	0106h
;*******		equ	0108h		;used later
;
official_flag		equ	010ah
screenA_official 	equ	010ah
screenB_official 	equ	010ch
;
rank_index		equ	010eh		;for 8 karts rank index
					;  from 10eh to 11fh
bgm_flag		equ	0120h		;b15	1...fadeout bgm
					;b14	1...trans BGM data
clear_driver		equ	0122h	;----------------------free
;
map_number		equ	0124h		;playing map number
map_type		equ	0126h		;obake=00,circuit=01,,,,,,,
;
fanfare_counter		equ	0128h	
;  
mark_index		equ	012eh
mark_buffer		equ	0130h		;it almost use 1,2 or 3...
;
reset_status		equ	0140h	;		
				;00000h=power on
				;08000h=hard wear reset
				;04000h=soft wear reset
signal_counter		equ	0142h		;	signal ON-OFF timer
;
				;select screen cursor pointa
goalin_number		equ	0144h
				;screen light value (0-0fh)
game_counter		equ	0146h
demo_counter		equ	game_counter
				;game simple counter
area_number		equ	0148h
				;course total number 
goal_line		equ	014ah
				;gaol line y position
lap_number		equ	014ch
				;total lap number

;---------------equ	014eh				;useed later
;				;00h=non pose
;				;02h=pose trigger
;				;04h=nomal pose
world_number		equ	0150h	;00,01,02,03
				;world select
map_pointer		equ	0152h	;00,02,04,06,0a
				;map counter
player_count		equ	0154h	;player number
				;03..02..01..00
player1_count		equ	player_count
player2_count		equ	0156h
;
race_init		equ	0158h	;race initial status
				;00h world renewal
				;02h map renewal
				;04h no map change init
				;06h race ending init
item_flag		equ	015ah
				;00h=item mode
				;ffh=no item mode
fade_speed		equ	015eh	;fade in out speed
fade_data		equ	0160h	;set data for 2100h 
;
pose_status		equ	0162h	;b15=pose lebel
pause_status		equ	0162h	;b15=pose lebel
				;b14=pose start trigger
				;b13=pose end trigger
pose_index		equ	0164h	;player index whose started pose
pause_index		equ	0164h	;player index whose started pose
;
win_count		equ	0166h	;+00h for player1
				;+02h for player2
window_color		equ	016ah	;for set 2131h(Color bias)
red_color		equ	016ch	;for red bias
green_color		equ	016eh	;for green bias
blue_color		equ	0170h	;for blue bias
;
camera_counter		equ	0172h	;screen mode change counter
				;if counter not zero then cant display OBJ
				;		and cant change camera mode
game_mode_stock		equ	0174h
camera_mode_stock	equ	game_mode_stock
;
se_status		equ	0176h	;00=up&down--engine
					;02=up--engine down--doppler
					;04=up--doppler down--engine
					;06=up&down--doppler
old_doppler_dist 	equ	0178h	;check enemy sound doppler effects
;
window_mask		equ	0108h
window_through		equ	014eh
window_switch		equ	017ah
;
over_flag		equ	017eh		;time over counter	
;

;---------------------------------------------------------------------------
;		e00h-f7fh(free)			f80h-fffh(yajima use)
;---------------------------------------------------------------------------
player_coin		equ	0e00h	;coins number
				;+00h=P1 +02h=P2
player1_coin		equ	player_coin
player2_coin		equ	0e02h
se_level		equ	0e04h		;+00h for upper play
						;+02h for lower play
bgm_trigger		equ	0e08h
;se_trigger		equ	0e0ah
bgm_pointer		equ	0e0ch
bgm_status		equ	0e0eh		;0000h nomal
						;0001h fast
						;ffffh goal
ultra_index		equ	0e10h
finallap_counter	equ	0e12h
doppler_driver		equ	0e14h
old_doppler_driver 	equ	0e16h
bgm_buffer		equ	0e18h
;
engine_sound_data	equ	0e20h
max_power		equ	0e20h
engine_accel_l		equ	0e22h
engine_accel_h		equ	0e24h
engine_brake		equ	0e26h
engine_resist		equ	0e28h
engine_drift		equ	0e2ah
;
obj_type		equ	0e30h
;
o_demo_flag		equ	0e32h
o_demo_pattern		equ	0e34h
o_demo_checker		equ	0e36h
o_demo_counter		equ	0e38h
mode_stock		equ	0e3ah
status_stock		equ	0e3ch
level_stock		equ	0e3eh
driver1_stock		equ	0e40h
driver2_stock		equ	0e42h
world_stock		equ	0e44h
;
trigger_pointer		equ	0e46h		;set initial sound trigger
trigger_buffer		equ	0e48h		;need 04h
;
trans_A_counter		equ	0e4ch
trans_B_counter		equ	0e4eh
;
ending_flag		equ	0e50h
ending_pattern		equ	0e52h
ending_counter		equ	0e54h
ending_status		equ	0e56h
						;ffffh on ISPK!!!
special_pause		equ	0e5ch		
;
pause_wait		equ	0e5eh
g_kart_flag		equ	0e60h		;0000 gost kart OFF
						;ffff    ;      ON
timeattack_rival	equ	0e62h		;rival number
ghost_kart		equ	0e64h		;     ;
timeattack_flag		equ	0e66h
						;00h=player only at timeattack
						;ffff=player VS comp
rom_checker		equ	0e68h
						;0000h=4M ROM
						;ffffh=8M ROM
se_pointer		equ	0e6ah
se_buffer		equ	0e6ch		;6ch,6eh,70h,72h
pan_buffer		equ	0e74h		;74h,76h,78h,7ah
;
color_trans_flag	equ	0e8ah		;00h not trans
						;ffff trans 200h color
time_checker		equ	0e8ch		;
;
goalin_pointer		equ	0e8eh
goalin_buffer		equ	0e90h		;00,02,.....0e(90h-9fh)
;
obj_trans_buffer	equ	0ea0h		;ea0h---effh
						;obj transport data
						;+00h=VRAM address
						;+02h=bank
						;+03h=address
						;+05h=trans value
laptime_buffer		equ	0f32h		;0-1eh(play1) 1f-3ch(play2)
;						; end 0f6dh
debug_rom_flag		equ	0f6eh		;initialize only power on!!!
						;0000h ROM >>> drive data
						;ffffk S-RAM>>>drive data
				
point_rank		equ	0f70h			;from f70h---f7fh
;---------------------------------------------------------------------------
m_win_count		equ	1f30h		;+00 for 1p 
b_win_count		equ	1f34h		;+02 for 2p
win_sum			equ	1f38h
;---------------------------------------------------------------------------
clear_rank		equ	1f3ah		;for p1*00h
						;for p2*06h
;---------------------------------------------------------------------------
;		YAJIMA WORK
;---------------------------------------------------------------------------
trans_map       equ     1d0ch
;---------------------------------------------------------------------------
;               180h-1ffh	;yamamoto use
;----------------------------------------------------------------------------
