/*
	This script file is part of the Sonic 3 A.I.R. script software distribution.
	Copyright (C) 2017-2024 by Eukaryot

	Published under the GNU GPLv3 open source software license, see license.txt
	or https://www.gnu.org/licenses/gpl-3.0.en.html
*/



// 0xfffff100 .. 0xfffff4ff
//  -> Level layout, 32x32 bytes


define bluespheres.position.x				= u16[0xffffe422]	// Upper byte = full grid position, lower byte = position between grid points
define bluespheres.position.y				= u16[0xffffe424]
define bluespheres.direction				=  u8[0xffffe426]
define bluespheres.movement_speed			= s16[0xffffe428]	// Current movement speed, can be negative when going backwards
define bluespheres.next_direction			=  s8[0xffffe42a]
define bluespheres.hitting_bumper			=  u8[0xffffe42b]
define bluespheres.going_forward			=  u8[0xffffe431]
define bluespheres.jumping_flags.player1	=  u8[0xffffe432]	// 0x80: forced spring jump, 0x01: manual player jump
define bluespheres.stage_exit_animation		=  u8[0xffffe433]	// Counting up during fade to white with fast stage rotation, after collecting the emerald
define bluespheres.blue_remaining			= u16[0xffffe438]
define bluespheres.rings_collected			= u16[0xffffe43a]
define bluespheres.bs_hud_dirty				=  u8[0xffffe43c]
define bluespheres.rings_flags				=  u8[0xffffe43d]	// See below
define bluespheres.speedup_countdown		= u16[0xffffe43e]
define bluespheres.jumping_flags.player2	=  u8[0xffffe440]	// 0x80: forced spring jump, 0x01: manual player jump
define bluespheres.rings_remaining			= u16[0xffffe442]
define bluespheres.current_gamespeed		= u16[0xffffe444]	// Current game speed, which is the limit for movement speed
define bluespheres.lifted_height			= u16[0xffffe44a]	// Height of lifted spheres when all blue spheres were collected
define bluespheres.stage_exit_state			=  u8[0xffffe44c]	// 0: Stage is still going, 1: Lifting the remaining spheres, 2: Wait time before the jingle, 3: Player approaching the emerald, 4: Fade to white / exiting the stage
define bluespheres.emerald_jingle_countdown	=  u8[0xffffe44d]	// Timer until emerald jingle plays
define bluespheres.started_running			=  u8[0xffffe450]

define bluespheres.backup.zone_act			= u16[0xffffef6a]	// Stores current zone and act while in a special stage
define bluespheres.backup.zone				=  u8[0xffffef6a]	// Stores current zone while in a special stage
define bluespheres.backup.act				=  u8[0xffffef6b]	// Stores current act while in a special stage

// 0xffffffa2 .. 0xffffffa5
//  -> Seed for generated stages

define bluespheres.minigame_mode			=  u8[0xffffffd4]	// This is 1 when in lock-on mode with something other than Sonic 3 (or Sonic 2)

// Rings flags:
//  - 0x01 = Continue for 50 rings was granted
//  - 0x02 = 1-up for 100 rings was granted
//  - 0x04 = 1-up for 200 rings was granted
//  - 0x80 = Rings display in HUD needs to be refreshed
