;****************************************************************************
;*	Mario Kart							    *
;*			Variable data module				    *
;*							1992.07.13	    *
;****************************************************************************
;		glb	Sec_data
		glb	Tan_data
		glb	Common_BG,BG_CHECK_DATA
		glb	Goal_data
		glb	Max_speed_perform,Accel_perform
		glb	Steering_perform,Resist_perform
		glb	BG_CHECK_DATA,ROM_checker_8
		glb	Max_speed_perform,Accel_perform,Steering_perform
;----------------------------------------------------------------------------
objdata		sect	rel
;----------------------------------------------------------------------------
Max_speed_perform
		word	Mario_max,Luigi_max
		word	Koopa_max,Peach_max
		word	Kong_max,Nokonoko_max
		word	Kinopio_max,Yossy_max
Koopa_max	equ	03b0h
Kong_max	equ	03b0h
Mario_max	equ	0390h
Luigi_max	equ     0390h
;Nokonoko_max	equ	0380h
Nokonoko_max	equ	0360h
;Kinopio_max	equ     0380h
Kinopio_max	equ     0360h
Peach_max	equ	0370h
Yossy_max	equ     0370h
;----------------------------------------------------------------------------
Accel_perform
		word	Mario_accel,Luigi_accel
		word	Koopa_accel,Peach_accel
		word	Kong_accel,Nokonoko_accel
		word	Kinopio_accel,Yossy_accel
Mario_accel
Luigi_accel
		byte	020h,060h,040h,080h,0c0h,0c0h,0c0h,080h
		byte	080h,040h,020h,018h,010h,008h,004h,004h
Peach_accel
Yossy_accel
		byte	040h,0c0h,0ffh,0ffh,0c0h,0c0h,0c0h,080h
		byte	080h,040h,040h,020h,008h,004h,002h,002h
Nokonoko_accel
Kinopio_accel
		byte	040h,040h,060h,080h,080h,0c0h,0c0h,080h
		byte	080h,040h,020h,018h,010h,008h,004h,008h
Koopa_accel
Kong_accel
		byte	020h,020h,020h,020h,040h,040h,060h,060h
		byte	080h,080h,0a0h,0a0h,010h,008h,008h,008h
;----------------------------------------------------------------------------
Resist_perform
		word	Mario_resist,Luigi_resist
		word	Koopa_resist,Peach_resist
		word	Kong_resist,Nokonoko_resist
		word	Kinopio_resist,Yossy_resist
;			Citcuit,Obake,Castle,Grass,Sand1,Sand2,Dart,Ice
;			Bridge,Jari,Sand,Rock,Snow,Grass,Water,Mud
Mario_resist
Luigi_resist
		byte	SA_D,RO_D,SN_A,GR_C,WT_D,MD_D
Koopa_resist
Kong_resist
		byte	SA_C,RO_B,SN_B,GR_D,WT_A,MD_C
Peach_resist
Yossy_resist
		byte	SA_B,RO_C,SN_D,GR_A,WT_B,MD_B
Nokonoko_resist
Kinopio_resist
		byte	SA_A,RO_A,SN_C,GR_B,WT_C,MD_A
;----------------------------------------------------------------------------
L_00		equ	0ffh
SA_A		equ	028h
SA_B		equ	027h
SA_C		equ	026h
SA_D		equ	025h
;
RO_A		equ	015h
RO_B		equ	014h
RO_C		equ	013h
RO_D		equ	012h
;
GR_A		equ	026h	
GR_B		equ	025h
GR_C		equ	024h
GR_D		equ	023h
;
SN_A		equ	022h
SN_B		equ	021h
SN_C		equ	020h
SN_D		equ	01fh
;
WT_A		equ	027h
WT_B		equ	026h
WT_C		equ	025h
WT_D		equ	024h
;
MD_A		equ	02ch
MD_B		equ	02bh
MD_C		equ	02ah
MD_D		equ	029h
;----------------------------------------------------------------------------
Steering_perform
		word	Mario_steering,Luigi_steering
		word	Koopa_steering,Peach_steering
		word	Kong_steering,Nokonoko_steering
		word	Kinopio_steering,Yossy_steering
Mario_steering
Luigi_steering
		word	0995h			;accel area
		byte	098h,068h,070h		
		word	0a80h			;braking area
		byte	0a0h,078h,080h
		word	0b00h			;drift area
		byte	0b0h,088h,090h
Peach_steering
Yossy_steering
		word	0995h
		byte	098h,058h,080h
		word	0a80h			;drift
		byte	0a0h,068h,070h
		word	0b00h			;ice
		byte	0b0h,070h,080h
Nokonoko_steering
Kinopio_steering
		word	0900h
		byte	0a0h,070h,090h
		word	0a40h			;drift
		byte	0b0h,080h,0a0h
		word	0ac0h			;ice
		byte	0a0h,090h,0c0h
Koopa_steering
Kong_steering
		word	0900h
		byte	080h,058h,088h
		word	0a40h			;drift
		byte	090h,068h,098h
		word	0ac0h			;ice
		byte	0a0h,078h,0a8h
;----------------------------------------------------------------------------
Goal_data
		;				for each course
		;		00h,01	goal line data(y axis)----dot
		;		bit15 =direction bit
		;		00=up
		;		01=down
		;		02h,03h goal base address(y*40h+x)----panel
		;		04h,05h	width (x&y)---------------panel
;cource00(circuit01)
		word	01b0h
		word	010h*40h+000h
		byte	0ch,1ch	
;cource01(obake01)
		word	0120h
		word	010h*40h+000h
		byte	0ch,06h	
;cource02(grass01)
		word	0240h
		word    01bh*40h+035h
		byte	00bh,10h	
;cource03(castle01)
		word	0160h
		word    010h*40h+000h
		byte	0ch,0ch	
;cource04(ice01)
		word	01f0h
		word    01ch*40h+02ch
		byte	014h,08h	
;cource05(star01)
		word	01b0h
		word    018h*40h+000h
		byte	00ah,06h	
;cource06(sand01)
		word	0120h
		word    00fh*40h+026h
		byte	01ah,06h	
;cource07(circuit02)
		word	0230h
		word	020h*40h+030h
		byte	010h,08h	
;cource08(obake02)
		word	0120h
		word	010h*40h+000h
		byte	0ch,06h	
;cource09(castle02)
		word	0130h
		word	010h*40h+034h
		byte	0ch,06h	
;cource0a(dart02)
		word	0290h
		word    025h*40h+000h
		byte	00bh,08h	
;cource0b(grass02)
		word	0210h
		word    01ah*40h+000h
		byte	010h,10h	
;cource0c(ice02)
		word	0210h
		word    01ch*40h+000h
		byte	020h,08h	
;cource0d(sand02)
		word	0100h
		word    004h*40h+000h
		byte	01ch,14h	
;cource0e(circuit03)
		word	0230h
		word	020h*40h+035h
		byte	0bh,06h	
;cource0f(circuit04)
		word	01a0h
		word	017h*40h+030h
		byte	10h,06h	
;cource10(obake03)
		word	0240h
		word	020h*40h+038h
		byte	08h,08h	
;cource11(castle03)
		word	0290h
		word	026h*40h+034h
		byte	00ch,006h
;cource12(dart03)
		word	0230h
		word	01fh*40h+028h
		byte	18h,06h	
;cource13(grass03)
		word	0200h
		word	01ch*40h+000h
		byte	0fh,08h	
;----------------------------------------------------------------------------
BG_check_address
		word	Obake_bg,Circuit_bg,Grass_bg
		word	Dart_bg,Ice_bg,Sand_bg,Castle_bg
		word	Star_bg
Common_bg	equ	000h
Circuit_bg	equ	040h	;+0c0h
Obake_bg	equ	100h	;+026h
Grass_bg	equ	126h	;+080h
Castle_bg	equ     1a6h	;+05ch
Ice_bg		equ	202h	;+07bh
Dart_bg		equ	27dh	;+064h
Sand_bg		equ	2e1h	;+080h
Star_bg		equ	361h	;(+06h)...end   367h
;----------------------------------------------------------------------------
editer		sect	rel
;----------------------------------------------------------------------------
BG_CHECK_DATA
Common_BG			;		(0c0h-0ffh)
	byte  14h,14h,14h,14h,14h,14h,14h,14h,14h,14h,14h,14h,14h,14h,14h,14h
	byte  40h,40h,40h,40h,40h,40h,40h,40h,40h,40h,40h,40h,40h,40h,40h,40h
	byte  16h,16h,16h,16h,16h,16h,16h,16h,16h,16h,16h,16h,16h,16h,16h,16h
	byte  80h,80h,80h,80h,10h,10h,10h,10h,10h,10h,18h,18h,18h,18h,1ah,40h
Circuit_BG
	byte  26h,40h,40h,54h,40h,54h,40h,40h,54h,40h,40h,40h,54h,40h,40h,40h
	byte  40h,40h,40h,54h,40h,40h,40h,40h,40h,40h,54h,40h,40h,40h,40h,40h
	byte  40h,40h,40h,54h,54h,40h,40h,40h,40h,40h,40h,54h,54h,40h,40h,40h
	byte  40h,40h,40h,54h,40h,40h,40h,54h,40h,40h,40h,40h,40h,40h,40h,40h
	byte  40h,40h,40h,40h,54h,26h,26h,26h,26h,54h,54h,54h,54h,52h,52h,52h
	byte  52h,52h,40h,40h,40h,40h,40h,40h,40h,40h,40h,40h,40h,40h,40h,40h
	byte  40h,40h,54h,40h,54h,40h,54h,40h,40h,54h,40h,54h,40h,54h,40h,40h
	byte  40h,40h,54h,40h,54h,40h,54h,40h,40h,54h,40h,54h,40h,54h,40h,40h
	byte  40h,40h,40h,40h,54h,40h,40h,40h,40h,54h,54h,40h,40h,40h,40h,54h
	byte  40h,40h,40h,40h,40h,40h,40h,40h,40h,40h,40h,40h,40h,40h,40h,40h
	byte  40h,40h,40h,40h,40h,40h,40h,40h,40h,40h,40h,40h,40h,40h,40h,40h
	byte  40h,40h,40h,40h,40h,40h,40h,40h,40h,40h,40h,40h,40h,40h,40h,40h
Obake_BG;---(use 00h-1fh)
	byte  20h,42h,40h,42h,42h,40h,42h,42h,40h,42h,40h,42h,42h,42h,40h,40h
	byte  40h,40h,40h,40h,40h,40h,40h,40h,40h,40h,40h,1eh,1eh,1eh,40h,82h
	byte  4eh,4eh,4eh,4eh,4eh,4eh,20h,20h,20h
Grass_BG;---(use 00h-7fh)
	byte  5ah,46h,46h,5ah,5ah,46h,46h,5ah,5ah,46h,46h,46h,46h,46h,46h,46h
	byte  46h,52h,46h,5ah,5ah,46h,46h,46h,46h,46h,46h,5ah,5ah,46h,46h,46h
	byte  5ah,5ah,46h,46h,5ah,46h,46h,46h,5ah,46h,46h,5ah,46h,46h,46h,5ah
	byte  5ah,5ah,46h,46h,5ah,46h,46h,46h,5ah,46h,46h,5ah,46h,46h,46h,5ah
	byte  46h,5ah,5ah,46h,46h,5ah,5ah,46h,46h,5ah,5ah,46h,46h,5ah,46h,5ah
	byte  46h,5ah,5ah,46h,46h,5ah,5ah,46h,46h,5ah,5ah,46h,5ah,46h,5ah,46h
	byte  46h,46h,22h,5ah,5ah,5ah,5ah,5ah,5ah,5ah,5ah,5ah,1eh,1eh,1eh,1eh
	byte  50h,50h,50h,22h,5ah,5ah,5ah,5ah,5ah,5ah,5ah,5ah,5ah,5ah,5ah,5ah
Castle_BG
	byte  44h,24h,24h,24h,44h,44h,44h,44h,44h,44h,80h,80h,80h,80h,44h,44h
	byte  44h,44h,44h,44h,44h,44h,80h,80h,80h,80h,44h,44h,44h,44h,44h,44h
	byte  44h,44h,44h,44h,44h,44h,44h,44h,44h,44h,44h,44h,44h,44h,44h,44h
	byte  44h,44h,44h,44h,44h,44h,44h,44h,44h,44h,44h,44h,44h,44h,44h,44h
	byte  44h,44h,44h,44h,44h,44h,44h,44h,44h,44h,44h,44h,4eh,44h,44h,44h
	byte  44h,44h,44h,44h,44h,44h,44h,44h,24h,44h,44h,44h
Ice_BG
	byte  58h,26h,4eh,4eh,4eh,4eh,4eh,4eh,4eh,4eh,22h,58h,58h,58h,58h,58h
	byte  4eh,4eh,58h,4eh,4eh,4eh,4eh,4eh,58h,4eh,4eh,4eh,58h,4eh,4eh,58h
	byte  4eh,58h,4eh,4eh,4eh,4eh,58h,4eh,4eh,4eh,4eh,4eh,4eh,58h,4eh,4eh
	byte  4eh,4eh,4eh,4eh,4eh,4eh,4eh,4eh,4eh,4eh,4eh,4eh,4eh,4eh,4eh,4eh
	byte  4eh,4eh,4eh,22h,22h,4eh,4eh,4eh,4eh,4eh,4eh,22h,22h,4eh,4eh,4eh
	byte  22h,4eh,4eh,22h,22h,4eh,4eh,22h,22h,22h,4eh,4eh,4eh,4eh,22h,22h
	byte  22h,22h,4eh,4eh,4eh,4eh,4eh,22h,22h,4eh,4eh,4eh,4eh,22h,22h,22h
	byte  58h,58h,58h,58h,58h,58h,58h,58h,58h,4eh,84h,4eh,4eh,4eh
Dart_BG
	byte  56h,4ch,4ch,4ch,4ch,4ch,4ch,4ch,4ch,4ch,4ch,4ch,4ch,4ch,56h,56h
	byte  4ch,4ch,4ch,4ch,4ch,4ch,4ch,4ch,4ch,4ch,4ch,4ch,4ch,4ch,56h,56h
	byte  4ch,4ch,4ch,4ch,4ch,4ch,4ch,4ch,4ch,4ch,4ch,4ch,4ch,4ch,56h,56h
	byte  4ch,4ch,4ch,4ch,4ch,4ch,4ch,4ch,4ch,4ch,4ch,4ch,4ch,4ch,56h,56h
	byte  12h,1ch,12h,12h,1ch,12h,12h,1ch,1ch,1ch,12h,12h,1ch,1ch,1ch,12h
	byte  58h,4ch,4ch,52h,52h,56h,56h,5eh,5eh,5eh,5eh,5eh,5eh,5eh,5eh,5eh
	byte  5eh,5eh,5eh,5eh
Sand_BG
	byte  22h,22h,22h,22h,5ch,5ch,5ch,5ch,5ch,5ch,5ch,5ch,5ch,5ch,5ch,5ch
	byte  5ch,5ch,5ch,5ch,5ch,5ch,5ch,4ah,5ch,48h,48h,48h,48h,5ch,48h,5ch
	byte  5ch,5ch,48h,5ch,48h,48h,48h,5ch,5ch,5ch,48h,5ch,5ch,48h,5ch,5ch
	byte  5ch,48h,48h,48h,48h,5ch,48h,5ch,48h,5ch,5ch,5ch,5ch,5ch,5ch,5ch
	byte  5ch,5ch,48h,48h,5ch,5ch,5ch,5ch,48h,48h,48h,48h,48h,5ch,5ch,5ch
	byte  5ch,5ch,48h,48h,5ch,5ch,5ch,5ch,5ch,5ch,5ch,48h,48h,5ch,48h,5ch
	byte  4ah,4ah,4ah,4ah,4ah,4ah,4ah,4ah,4ah,4ah,4ah,4ah,4ah,4ah,4ah,4ah
	byte  4ah,4ah,4ah,4ah,5ah,5ah,5ah,5ah,5ah,5ah,5ah,5ah,5ah,4ah,4ah,4ah
Star_BG
	byte  20h,40h,40h,40h,40h,40h,40h,40h,40h,40h,40h,28h
;----------------------------------------------------------------------------
Tan_data
                byte      000H,000H,000H,000H,001H,001H,001H,001H
                byte      001H,001H,002H,002H,002H,002H,002H,002H
                byte      003H,003H,003H,003H,003H,003H,003H,004H
                byte      004H,004H,004H,004H,004H,005H,005H,005H
                byte      005H,005H,005H,006H,006H,006H,006H,006H
                byte      006H,006H,007H,007H,007H,007H,007H,007H
                byte      008H,008H,008H,008H,008H,008H,008H,009H
                byte      009H,009H,009H,009H,009H,00AH,00AH,00AH
                byte      00AH,00AH,00AH,00AH,00BH,00BH,00BH,00BH
                byte      00BH,00BH,00BH,00CH,00CH,00CH,00CH,00CH
                byte      00CH,00CH,00DH,00DH,00DH,00DH,00DH,00DH
                byte      00DH,00EH,00EH,00EH,00EH,00EH,00EH,00EH
                byte      00FH,00FH,00FH,00FH,00FH,00FH,00FH,010H
                byte      010H,010H,010H,010H,010H,010H,011H,011H
                byte      011H,011H,011H,011H,011H,011H,012H,012H
                byte      012H,012H,012H,012H,012H,013H,013H,013H
                byte      013H,013H,013H,013H,013H,014H,014H,014H
                byte      014H,014H,014H,014H,014H,015H,015H,015H
                byte      015H,015H,015H,015H,015H,015H,016H,016H
                byte      016H,016H,016H,016H,016H,016H,017H,017H
                byte      017H,017H,017H,017H,017H,017H,017H,018H
                byte      018H,018H,018H,018H,018H,018H,018H,018H
                byte      019H,019H,019H,019H,019H,019H,019H,019H
                byte      019H,019H,01AH,01AH,01AH,01AH,01AH,01AH
                byte      01AH,01AH,01AH,01BH,01BH,01BH,01BH,01BH
                byte      01BH,01BH,01BH,01BH,01BH,01CH,01CH,01CH
                byte      01CH,01CH,01CH,01CH,01CH,01CH,01CH,01CH
                byte      01DH,01DH,01DH,01DH,01DH,01DH,01DH,01DH
                byte      01DH,01DH,01DH,01EH,01EH,01EH,01EH,01EH
                byte      01EH,01EH,01EH,01EH,01EH,01EH,01FH,01FH
                byte      01FH,01FH,01FH,01FH,01FH,01FH,01FH,01FH
                byte      01FH,01FH,020H,020H,020H,020H,020H,020H
ROM_checker_8
		byte	   01h,09h,06h,03h,00h,09h,00h,02h
		end
	