OpenSNES
Modern Open-Source SNES Development SDK
Loading...
Searching...
No Matches
game.h File Reference

What the screens of shard_dash share: the layout, the rules, the run's result. More...

#include <snes.h>

Go to the source code of this file.

Macros

VRAM (word addresses): three maps, then each layer's tiles on a $1000 boundary
#define SPR_VRAM   0x4000
#define VRAM_BG1_GFX   0x1000
#define VRAM_BG1_MAP   0x0000
#define VRAM_BG2_GFX   0x2000
#define VRAM_BG2_MAP   0x0400
#define VRAM_BG3_FONT   0x3000
#define VRAM_BG3_MAP   0x0800
The rules
#define GOAL   5
#define RESULT_WAIT   900
#define TIME_LIMIT   1800
Values of game_screen
#define SCREEN_PLAY   1
#define SCREEN_RESULT   2
#define SCREEN_TITLE   0

Functions

void playRun (void)
 One round: returns when the goal is reached or the clock is out.
void resultRun (void)
 The result screen: saves a win, shows it, returns on START or after RESULT_WAIT.
void titleRun (void)
 The title screen: returns when START is pressed.

Variables

u8 game_screen
 Which screen runs (the tests read it by name).
u16 pump_frames
 Frames the pump ran since power-on: it runs in fades, waits and loads too.
u8 run_new_best
 The last round: 1 if it beat the saved best.
u16 run_time
 The last round: frames from the start to the last shard (or TIME_LIMIT).
u8 run_won
 The last round: 1 if the goal was reached before the clock.

Detailed Description

What the screens of shard_dash share: the layout, the rules, the run's result.

Macro Definition Documentation

◆ GOAL

#define GOAL   5

shards to collect

◆ RESULT_WAIT

#define RESULT_WAIT   900

frames the result stays before the title returns

◆ SCREEN_PLAY

#define SCREEN_PLAY   1

◆ SCREEN_RESULT

#define SCREEN_RESULT   2

◆ SCREEN_TITLE

#define SCREEN_TITLE   0

◆ SPR_VRAM

#define SPR_VRAM   0x4000

sprite tiles

◆ TIME_LIMIT

#define TIME_LIMIT   1800

frames on the clock: 30 s at 60 Hz

◆ VRAM_BG1_GFX

#define VRAM_BG1_GFX   0x1000

◆ VRAM_BG1_MAP

#define VRAM_BG1_MAP   0x0000

the play square

◆ VRAM_BG2_GFX

#define VRAM_BG2_GFX   0x2000

◆ VRAM_BG2_MAP

#define VRAM_BG2_MAP   0x0400

the logo

◆ VRAM_BG3_FONT

#define VRAM_BG3_FONT   0x3000

◆ VRAM_BG3_MAP

#define VRAM_BG3_MAP   0x0800

the text

Function Documentation

◆ playRun()

void playRun ( void )

One round: returns when the goal is reached or the clock is out.

< the play square

< frames on the clock: 30 s at 60 Hz

< Kit walking down: frames 0-4

< shards to collect

< frames on the clock: 30 s at 60 Hz

< shards to collect

◆ resultRun()

void resultRun ( void )

The result screen: saves a win, shows it, returns on START or after RESULT_WAIT.

< the logo

< frames the result stays before the title returns

◆ titleRun()

void titleRun ( void )

The title screen: returns when START is pressed.

< the logo

Variable Documentation

◆ game_screen

u8 game_screen
extern

Which screen runs (the tests read it by name).

◆ pump_frames

u16 pump_frames
extern

Frames the pump ran since power-on: it runs in fades, waits and loads too.

◆ run_new_best

u8 run_new_best
extern

The last round: 1 if it beat the saved best.

◆ run_time

u16 run_time
extern

The last round: frames from the start to the last shard (or TIME_LIMIT).

◆ run_won

u8 run_won
extern

The last round: 1 if the goal was reached before the clock.