;; Zero Page

;; LZ4 addresses

LZ4_SRC		= $00
LZ4_DST		= $02
LZ4_END		= $04
WHICH_LOAD	= $05
COUNT		= $06
MENU_BASE	= $06
MENU_HIGHLIGHT	= $07
DELTA		= $08


;; Zero page monitor routines addresses

WNDLFT	= $20
WNDWDTH	= $21
WNDTOP	= $22
WNDBTM	= $23
CH	= $24
CV	= $25
GBASL	= $26
GBASH	= $27
BASL	= $28
BASH	= $29
H2	= $2C
V2	= $2D
MASK	= $2E
COLOR_MASK = $2F
COLOR	= $30


SEEDL	= $4e
SEEDH	= $4f
XMAX		= $50

	BEAST_X		= $51	; L1
	BEAST_Y		= $52	; L1
	BEAST_GAIT	= $53	; L1
	BEAST_COUNT	= $54	; L1
	BEAST_STATE	= $55
		B_STANDING	=	$00
		B_RUNNING	=	$01
		B_FALLING	=	$02
		B_DEAD		=	$03
	BEAST_DIRECTION	= $56	; L1



FRAMEL		= $60
FRAMEH		= $61
WAITING         = $62
LETTERL         = $63
LETTERH         = $64
LETTERX         = $65
LETTERY         = $66
LETTERD         = $67
LETTER          = $68
BLARGH          = $69

AY_REGISTERS	= $70
A_FINE_TONE	= $70
A_COARSE_TONE	= $71
B_FINE_TONE	= $72
B_COARSE_TONE	= $73
C_FINE_TONE	= $74
C_COARSE_TONE	= $75
NOISE		= $76
ENABLE		= $77
PT3_MIXER_VAL	= $77
A_VOLUME	= $78
B_VOLUME	= $79
C_VOLUME	= $7A
ENVELOPE_FINE	= $7B
ENVELOPE_COARSE	= $7C
ENVELOPE_SHAPE  = $7D

PATTERN_L       = $7E
PATTERN_H       = $7F
ORNAMENT_L      = $80
ORNAMENT_H      = $81
SAMPLE_L        = $82
SAMPLE_H        = $83

LOOP            = $84
MB_VALUE        = $85
MB_ADDR_L	= $86
MB_ADDR_H	= $87
DONE_PLAYING    = $88
DONE_SONG       = $89
PT3_TEMP	= $8A


; More zero-page addresses
; we try not to conflict with anything DOS, MONITOR or BASIC related

HAVE_GUN	= $BC		; C2 jail+

FIRST_SHIELD	= $BD
COLLISION_X	= $BE
COLLISION_Y	= $BF

DOOR_STATUS	= $C0
DOOR_STATUS_H	= $C1
DOOR_X		= $C2
DOOR_X_H	= $C3
DOOR_Y		= $C4
DOOR_Y_H	= $C5
DOOR_XMIN	= $C6
DOOR_XMIN_H	= $C7
DOOR_XMAX	= $C8
DOOR_XMAX_H	= $C9

BEAST_ZAPPING	= $CA		; 1
BEAST_DEAD	= $CB		; 1
VENT_OPEN	= $CC		; 2
INTRO_REPEAT	= $CD		; INTRO


LASER_TEMP	= $CE		; 2+
LEFT_SHOOT_TARGET = $CF		; ALL
RIGHT_SHOOT_TARGET = $D0	; ALL


LEFT_WALK_LIMIT	= $D1		; ALL
RIGHT_WALK_LIMIT= $D2		; ALL
LEFT_SHOOT_LIMIT= $D3		; ALL
RIGHT_SHOOT_LIMIT=$D4		; ALL

NUM_DOORS	= $D5		; 2+

GUN_FIRE	= $D6		; 2+

GUN_STATE	= $D7		; 2+

BLAST_OUT	= $D8		; 2+

SHIELD_OUT	= $D9		; 2+

ALIEN_OUT	= $DA		; 2+

LASER_OUT	= $DB		; 2+

GUN_CHARGE	= $DC		; 2+

MONSTER_AI	= $DD		; C1 underwater
ACTION_COUNT	= $DD		; C4

BG_BEAST	= $DE		; C1
ACTION_TRIGGERED= $DE		; C4

ON_ELEVATOR	= $DF		; ALL

LEFT_LIMIT	= $E0		; ALL
RIGHT_LIMIT	= $E1		; ALL

CONSOLE_Y	= $E2		; C1 underwater
EXIT_COUNT	= $E2		; C1 pool
WHICH_SLUG	= $E2		; C1
TELEPORTING	= $E2		; C2 jail

WHICH_CAVE	= $E3		; C1,C5
WHICH_JAIL	= $E3		; C2
WHICH_ROOM	= $E3		; C4

MONSTER_GRAB	= $E4		; C1 underwater
BEAST_OUT	= $E4		; C1

GAME_OVER	= $E5		; ALL
DNA_OUT		= $E5		; INTRO
MESSAGE_CURRENT	= $E5		; INTRO


DNA_PROGRESS	= $E6		; INTRO
TIME_COUNT	= $E6		; INTRO
EQUAKE_PROGRESS = $E6		; C1
DUDE_OUT	= $E6		; C2
FALLING		= $E6		; C3
CHARGER_COUNT	= $E6		; C4
FOREGROUND_COUNT= $E6		; C15

EARTH_OFFSET	= $E7		; ALL??
DNA_COUNT	= $E7		; INTRO
CURSOR_COUNT	= $E7		; INTRO
PARTICLE_COUNT	= $E7		; INTRO
MESSAGE_COUNT	= $E7		; INTRO

MONSTER_WHICH	= $E8		; C1 underwater
BOULDER_X	= $E8		; C1
LITTLEGUY_OUT	= $E8		; C2 cage
CART_X		= $E8		; C2 jail
FALLING_Y	= $E8		; C3

BOULDER_Y	= $E9		; C1
SHOOTING_TOP	= $E9		; C1 cage
DUDE_X		= $E9		; C2 jail

STATE_NO_KEYPRESS		= $80
STATE_CROUCHING			= $40
STATE_RUNNING			= $20

PHYSICIST_STATE	= $EA
	P_STANDING		= $00
	P_WALKING		= $01
	P_RUNNING		= $02 | STATE_RUNNING
	P_CROUCHING		= $03 | STATE_CROUCHING
	P_KICKING		= $04
	P_JUMPING		= $05 | STATE_NO_KEYPRESS
	P_COLLAPSING		= $06 | STATE_NO_KEYPRESS
	P_FALLING_SIDEWAYS	= $07 | STATE_NO_KEYPRESS
	P_SWINGING		= $08 | STATE_NO_KEYPRESS
	P_ELEVATING_UP		= $09
	P_ELEVATING_DOWN	= $0A
	P_SHOOTING		= $0B
	P_FALLING_DOWN		= $0C | STATE_NO_KEYPRESS
	P_IMPALED		= $0D | STATE_NO_KEYPRESS
	P_CROUCH_SHOOTING	= $0E | STATE_CROUCHING
	P_CROUCH_KICKING	= $0F | STATE_CROUCHING
	P_DISINTEGRATING	= $10 | STATE_NO_KEYPRESS

BUBBLES_Y	=	$EB	; C1 underwater
BEFORE_SWING	=	$EB	; C1
SHOOTING_BOTTOM	=	$EB	; C2 cage
CART_OUT	=	$EB	; C2 jail

CUTFRAME	=	$EC
DISP_PAGE	=	$ED	; ALL
DRAW_PAGE	=	$EE	; ALL
OFFSET		=	$EF

INTRO_LOOPL	=	$F0	; INTRO
PHYSICIST_X	=	$F0	; ALL

INTRO_LOOPH	=	$F1	; INTRO
PHYSICIST_Y	=	$F1	; ALL

SPRITETEMP	=	$F2	; ALL
XPOS		=	$F3	; ALL
YPOS		=	$F4	; ALL
DIRECTION	=	$F5	; ALL
GAIT		=	$F6	; ALL

INTRO_LOOPER	=	$F7	; INTRO
TENTACLE_X	=	$F7	; C1
CAGE_GUARD	=	$F7	; C2 cage
CITY_MOVIE_SEEN =	$F7	; C2 jail
BROKEN_GLASS	=	$F7	; C15 final

ELEVATOR_CYCLE	=	$F8	; INTRO
STATIC_LOOPER	=	$F8	; INTRO
LEVELEND_PROGRESS =	$F8	; C1
SWING_PROGRESS	=	$F8	; C1
TENTACLE_PROGRESS =	$F8	; C1
CAGE_OFFSET	=	$F8	; C2 cage
JAIL_POWER_ON	=	$F8	; C2 jail
VENT_END_COUNT	=	$F8	; C3
BRIDGE_COLLAPSE	=	$F8	; C15

ELEVATOR_COUNT	=	$F9	; INTRO
TENTACLE_GRAB	=	$F9	; C1
CAGE_AMPLITUDE	=	$F9	; C2 cage
ELEVATOR_OFFSET	=	$F9	; C2 jail
VENT_DEATH	=	$F9	; C3
BG_SCROLL	=	$F9	; C4


TEMP		=	$FA
TEMPY		=	$FB
INL		=	$FC
INH		=	$FD
OUTL		=	$FE
OUTH		=	$FF
