src/field/lucky_wheels.c
Lucky Wheels, Tolbi's game of chance: the player bets game tickets on paylines, pulls the lever up to five times and locks wheels between pulls to line up matching symbols. More…
#include "field/lucky_wheels.h"#include "item_ids.h"#include "macros.h"#include "resource_ids.h"#include "battle/battle.h"#include "battle/battle_effect_state.h"#include "battle/blitter.h"#include "battle_effect/stubs.h"#include "field/lucky_wheels_lzpack.h"#include "field/map_grid.h"#include "game/main_routine_state.h"#include "game/stubs.h"#include "sound/stubs.h"#include "window/stubs.h"#include "text/msg_ids.h"#include "palette_scale.c"
Structures
| Name | Description | |
|---|---|---|
struct | LUCKY_WHEEL | One of Lucky Wheels' five wheels: how far it has turned, its 21 symbols, whether it is held, and the countdown to its stop (-1 until one starts). |
struct | LUCKY_WHEELS_STATE | Lucky Wheels' state in LUCKY_WHEELS_HEAP_SLOT: its wheels, phase, bet and spins, keys, timer, winning lines, sprites, windows and the scanline offsets that shade the wheels. |
Macros
| Name | Description | |
|---|---|---|
#define | LUCKY_WHEELS_SPARKS ((PARTICLE *)RamMapGridMetatileBuffer) | The sparks of the jackpot, kept in the map metatile buffer. |
#define | LUCKY_WHEELS_HEAP_SLOT HEAP_SLOT_LUCKY_GAME | Lucky Wheels' own state (LUCKY_WHEELS_STATE), in the heap slot Lucky Dice keeps its screen in, beside the battle effect slots it borrows. |
#define | LUCKY_WHEELS_CANVAS_SIZE (256 * 128) | The paylines' canvas: 256 x 128 pixels of 8-bit colour, shown on BG2 from its tile 212 in the rows of its map from LUCKY_WHEELS_CANVAS_TOP_ROW to LUCKY_WHEELS_CANVAS_BOTTOM_ROW; the rows above and below show a clear tile, in the part of BG1's map below the screen that fdLuckyWheelsRun clears. |
#define | LUCKY_WHEELS_CANVAS_FIRST_TILE 212 | |
#define | LUCKY_WHEELS_CANVAS_TOP_ROW 2 | |
#define | LUCKY_WHEELS_CANVAS_BOTTOM_ROW 16 | |
#define | LUCKY_WHEELS_CANVAS_TILES | |
#define | LUCKY_WHEELS_CANVAS_CLEAR_TILE 191 | |
#define | LUCKY_WHEELS_SPARK_COLORS 64 | The canvas's first 64 colours, its sparks', from a Djinn sprite sheet's palette and cycled through others while a win shows. |
#define | LUCKY_WHEELS_LINE_COLOR 64 | The paylines' green on the canvas, colour 64, and its lighter centre. |
#define | LUCKY_WHEELS_LINE_LIGHT (LUCKY_WHEELS_LINE_COLOR + 1) | |
#define | LUCKY_WHEELS_MACHINE_PALETTE 10 | The machine's picture: its 16 colours in BG palette 10, and its tiles from tile 424 of BG1's characters, all but those of the opening the wheels show through, which BG1's map fills with a clear tile. |
#define | LUCKY_WHEELS_MACHINE_TILE 424 | |
#define | LUCKY_WHEELS_CLEAR_TILE 422 | |
#define | LUCKY_WHEELS_IN_OPENING (column, row) | The machine's opening, in map metatiles: columns 5 to 24 and rows 3 to 13. |
#define | LUCKY_WHEELS_ICON_COLORS 240 | The icons' picture begins with its 240 colours, the sprites' first 240, then its 435 tiles of 256 colours. |
#define | LUCKY_WHEELS_ICON_TILES 435 | |
#define | LUCKY_WHEELS_JACKPOT_PALETTE 15 | The jackpot banner's and the title letters' sprite palette. |
#define | PALETTE_BYTES (PALETTE_COLORS * 2) | A palette's 16 colours in bytes, as each 16-colour picture's resource begins. |
#define | LUCKY_WHEELS_TITLE_FIRST_TURNED (LANGUAGE == LANGUAGE_SPANISH) | The Spanish title's first letter is its last letter's tile turned over both ways, drawn 16 pixels left and 8 down. |
#define | LINE_STEP_ONE (1 << 8) | A line's step along its shorter axis, in 256ths of a pixel. |
#define | LUCKY_WHEELS_WHEEL_COUNT 5 | The machine's five wheels; the cursor's next place, past the last wheel, is the lever. |
#define | LUCKY_WHEELS_LEVER LUCKY_WHEELS_WHEEL_COUNT | |
#define | LUCKY_WHEELS_LEVER_PULL_FRAMES 48 | Pulling the lever: 48 frames down and back up, then 8 settling; only then can the wheels be stopped. |
#define | LUCKY_WHEELS_LEVER_SETTLE_FRAMES 8 | |
#define | LUCKY_WHEELS_LEVER_FRAMES | |
#define | LUCKY_WHEELS_LEVER_X 208 | The lever sprite's place at rest, in screen pixels, and how far it is pulled down. |
#define | LUCKY_WHEELS_LEVER_Y 40 | |
#define | LUCKY_WHEELS_LEVER_PULL 64 | |
#define | LUCKY_WHEELS_AUTO_STOP_FRAMES 32 | Left alone, the spinning wheels stop one every 32 frames; R stops one at once. |
#define | LUCKY_WHEELS_WIN_PAUSE 60 | The pause, in frames, after a winning spin before the win is shown, and after the last spin loses before the game ends. |
#define | LUCKY_WHEELS_LOSS_PAUSE 45 | |
#define | LUCKY_WHEELS_STOP_WINDOW_FRAME 4 | The stop prompt's window opens, and then its sound plays, this many frames into a spin. |
#define | LUCKY_WHEELS_STOP_PROMPT_FRAME 16 | |
#define | LUCKY_WHEELS_LAMP_TILES 96 | Where each picture of icons.png starts in sprite tiles, in OAM's 32-byte steps (a 256-colour tile is two): the sprite sheet is 32 pixels wide, so a picture starts at the tile numbered as its row. |
#define | LUCKY_WHEELS_HELD_LAMP_TILES 128 | A held wheel's lamp. |
#define | LUCKY_WHEELS_CORNER_LIGHT_TILES 224 | |
#define | LUCKY_WHEELS_FRAME_LIGHT_TILES 232 | |
#define | LUCKY_WHEELS_LEVER_TILES 256 | |
#define | LUCKY_WHEELS_LINE_TILES 272 | A payline's gem, not bet on. |
#define | LUCKY_WHEELS_LIT_LINE_TILES 464 | A payline's gem, bet on. |
#define | LUCKY_WHEELS_LEVER_SLOT_TILES 320 | The slot the lever runs in, drawn in eight pieces 16 pixels tall down beside the wheels from (LUCKY_WHEELS_LEVER_SLOT_X, LUCKY_WHEELS_LEVER_SLOT_Y). |
#define | LUCKY_WHEELS_LEVER_SLOT_PIECES 8 | |
#define | LUCKY_WHEELS_LEVER_SLOT_X 206 | |
#define | LUCKY_WHEELS_LEVER_SLOT_Y 12 | |
#define | LUCKY_WHEELS_HAND_TILES 496 | The cursor's hand. |
#define | LUCKY_WHEELS_PULL_TILES 528 | A pull's number, the current one large. |
#define | LUCKY_WHEELS_ARROW_TILES 688 | The cursor's blinking arrows. |
#define | LUCKY_WHEELS_WHEEL_SYMBOLS 21 | The symbols round a wheel, each 16 pixels tall: a wheel turns once in 336 pixels, 8 a frame, and stops only with a symbol centred on a line. |
#define | LUCKY_WHEELS_SYMBOL_HEIGHT 16 | |
#define | LUCKY_WHEELS_WHEEL_TURN | |
#define | LUCKY_WHEELS_SPIN_SPEED 8 | |
#define | LUCKY_WHEELS_PAYLINES 7 | The seven paylines: the two diagonals (0 and 6) and the five rows between. |
#define | LUCKY_WHEELS_MIDDLE_LINE 3 | |
#define | LUCKY_WHEELS_BET_MAX 4 | |
#define | LUCKY_WHEELS_PULLS 5 | The pulls of the lever a bet buys: "You have only 5 chances to pull the lever." |
#define | LUCKY_WHEELS_WILD_SYMBOL LUCKY_WHEELS_MOON | The symbol that matches any other on a payline. |
#define | LUCKY_WHEELS_FADE_TICKS 16 | The machine fades in and out over 16 ticks, a sixteenth of full brightness a tick; the win flashes the screen darker over as many. |
#define | LUCKY_WHEELS_CYCLE_TICKS 16 | The win cycles the background through five palettes, 16 ticks each. |
#define | LUCKY_WHEELS_CYCLE_PALETTES 5 | |
#define | LUCKY_WHEELS_BURST_SPARKS 256 | The jackpot sparks: four bursts of 256 in turn, one every eight ticks. |
#define | LUCKY_WHEELS_SPARK_COUNT (4 * LUCKY_WHEELS_BURST_SPARKS) | |
#define | LUCKY_WHEELS_SPARK_SHRINK_TICKS 12 | A spark's size steps down every 12 ticks of its life, from 2 or 3 to 1. |
#define | LUCKY_WHEELS_REPEAT_DELAY 12 | A held direction moves the cursor once, waits 12 frames, then moves it again every 4 frames. |
#define | LUCKY_WHEELS_REPEAT_INTERVAL 4 | |
#define | LUCKY_WHEELS_MACHINE_LIGHTS 14 | the machine's lights |
#define | LUCKY_WHEELS_CORNER_LIGHTS 4 | the first of them, at its corners |
#define | LUCKY_WHEELS_WHEELS_TOP 23 | The screen lines of the wheels' top and bottom edges, and the lines from each that fdLuckyWheelsSetUpBetting shades. |
#define | LUCKY_WHEELS_WHEELS_BOTTOM 110 | |
#define | LUCKY_WHEELS_SHADE_LINES 40 | |
#define | LUCKY_WHEELS_SHADE_LEVEL 6 | The darkening at the wheels' very edges, in BLDY's sixteenths. |
#define | LUCKY_WHEELS_PLACED_SYMBOLS 8 | The places on each wheel given a set symbol after the random fill: one of each plain symbol, then three moons. |
#define | PACK_WINDOW_SIZE 1024 | The LZ packer: a window of PACK_WINDOW_SIZE bytes with a hash chain for each byte value, PACK_LOOKAHEAD bytes read ahead of the one being packed and the PACK_HISTORY behind it kept in the chains, and matches of up to PACK_MATCH_MAX bytes at most PACK_DISTANCE_MAX back. |
#define | PACK_WINDOW_MASK (PACK_WINDOW_SIZE - 1) | |
#define | PACK_BYTE_VALUES 256 | |
#define | PACK_LOOKAHEAD 672 | |
#define | PACK_HISTORY 60 | |
#define | PACK_DISTANCE_MAX 63 | |
#define | PACK_SHORT_MATCH_MAX 16 | A match of up to 16 bytes takes two bytes; a longer one three, its length less 17 in the third, up to PACK_MATCH_MAX. |
#define | PACK_MATCH_MAX 272 | |
#define | PACK_FIRST_FLAG (1 << 7) | A group's flag byte is read from its top bit down, a bit an item. |
#define | PACK_CODE_DISTANCE_HIGH (~0xfff) | A match's code, a halfword written high byte first: its distance's bits from 8 up in bits 12 to 15, its length less one in bits 8 to 11 for a short match, and its distance's low byte. |
#define | PACK_CODE_LENGTH 0xf00 | |
#define | PACK_CODE_DISTANCE_LOW 0xff |
Enumerations
| Name | Description | |
|---|---|---|
enum | LUCKY_WHEELS_SYMBOL { LUCKY_WHEELS_SHIRT, LUCKY_WHEELS_HEART, LUCKY_WHEELS_BOOT, L … } | The wheels' symbols, in icons.png's order. |
enum | LUCKY_WHEELS_PHASE { LUCKY_WHEELS_BETTING, LUCKY_WHEELS_SPINNING, LUCKY_WHEELS_WO … } | Lucky Wheels' phases (LUCKY_WHEELS_STATE.phase). |
enum | LUCKY_WHEELS_PROMPT { LUCKY_WHEELS_PROMPT_NONE, LUCKY_WHEELS_PROMPT_ALL_HELD, LUCK … } | The prompt the top window shows while wheels are locked (LUCKY_WHEELS_STATE.prompt), so that it is drawn again only when it changes. |
Functions
| Name | Description | |
|---|---|---|
Sint32 | fdLuckyWheelsStart (void) | Plays Lucky Wheels: blanks the screen, seeds the random numbers with the play time and runs the game. |
void | fdLuckyWheelsTransferCanvas (void) | A VBlank-pass event: on a VBlank after the canvas is ready (transferPending), sends the canvas to its tiles in VRAM (LUCKY_WHEELS_CANVAS_TILES), then clears it or fades it into trails as transferMode says. |
void | fdLuckyWheelsDarkenStep (void) | Darkens the screen one step: lowers each channel of the machine's 16 colours and of the icons' by 1. |
void | fdLuckyWheelsStepSparkColors (Sint32 resource) | Moves the sparks' colours one step toward the palette of resource; the backdrop colour is not written back. |
static __inline__ Uint32 | fdLuckyWheelsCanvasOffset (Uint32 x, Uint32 y) | The byte of the canvas's pixel (x, y): its tiles run 32 to a row, 64 bytes each. |
void | fdLuckyWheelsDrawCanvasLine ( Sint32 x0, Sint32 y0, Sint32 x1, Sint32 y1, Sint32 color) | Draws a line from (x0, y0) to (x1, y1) on the 256 x 128 8bpp canvas (32 tiles across), writing only over lower colour numbers. |
void | fdLuckyWheelsUpdate (void) | Lucky Wheels' VBlank event: reads the keys, runs the game's phase (betting, spinning and stopping the wheels, scoring the paylines, choosing wheels to hold, showing a win) and builds all 128 sprites: the cursor, the title letters of a win, the frame, the hold lamps, the spin counter, the paylines, the wheel symbols, the lever and the bottom bar. |
void | fdLuckyWheelsSetUpBetting (void) | Sets up the bouncing title letters of a win, the brightness wave of the screen's lines and the betting window, and starts at betting. |
void | fdLuckyWheelsRun (void) | Lucky Wheels: loads its backgrounds, sprites and palettes, fills each of the five wheels with 21 random symbols, among them each plain symbol and three moons, then runs until the player leaves: fading in, drawing the paylines on the canvas while betting or winning, and the jackpot's sparks and colour cycle while showing a win. |
void | fdLZPackResetChains (void) | Empties the LZ packer's hash chains and numbers its window nodes. |
void | fdLZPackInsertSlotNode (Sint32 index) | Adds window position index to the chain of the byte it holds. |
void | fdLZPackRemoveSlotNode (Sint32 slot) | Removes window position slot from its chain. |
void | fdLZPackReadInput (Sint32 start, Sint32 count, const Uint8 *input) | Reads count more input bytes into the window from position start, dropping the bytes they replace from their chains; past the end of the input the positions are marked empty (-1). |
void | fdLZPackCopyBufferedBytes (Uint8 *dest) | Appends the finished group (a flag byte and up to eight items) to the output. |
static __inline__ void | fdLZPackFindWindowMatch (Sint32 start) | Finds the longest earlier match (up to PACK_MATCH_MAX bytes, at most PACK_DISTANCE_MAX back) for the bytes at window position start; matchLen stays 1 for none. |
Sint32 | fdLZPackPackData (const Uint8 *input, Uint8 *dest, Sint32 size) | Unused: packs size bytes of input into dest with a small LZ scheme and returns the packed size. |
Variables
| Name | Description | |
|---|---|---|
const Uint16 | LuckyWheelsSparkPictures [] | Where each spark picture (a square 2 to 20 pixels on a side) starts: size s (1 to 10) is a square 2s pixels a side, after the smaller squares' pixels. |
const Uint8 | LuckyWheelsSymbolPrizes [] | The prize of each wheel symbol (LUCKY_WHEELS_PRIZE), kept in MainRoutineStateWork.holdings.wonPrizes for each winning line. |
const Uint8 | LuckyWheelsTitleLetterTiles [LUCKY_WHEELS_TITLE_LETTERS] | The tile of each title letter, the letter's place in its sprite sheet: jackpot.png holds Jackpot! and jackpot_ja.png ジャックポト!. |
const Uint8 | LuckyWheelsMachineSpriteX [LUCKY_WHEELS_MACHINE_LIGHTS] | The positions of the machine's lights, in screen pixels: its four corners first, then the lights along its frame. |
const Uint8 | LuckyWheelsMachineSpriteY [LUCKY_WHEELS_MACHINE_LIGHTS] | |
const Uint8 | LuckyWheelsTitleLetterWidths [LUCKY_WHEELS_TITLE_LETTERS] | The advance of each title letter, in pixels, from LUCKY_WHEELS_TITLE_X. |
Description
Lucky Wheels, Tolbi's game of chance: the player bets game tickets on paylines, pulls the lever up to five times and locks wheels between pulls to line up matching symbols. It draws its own wheels and paylines, and keeps an unused LZ packer.
Macros in detail
LUCKY_WHEELS_SPARKS
#define LUCKY_WHEELS_SPARKS ((PARTICLE *)RamMapGridMetatileBuffer)
The sparks of the jackpot, kept in the map metatile buffer.
Referenced by fdLuckyWheelsRun() and fdLuckyWheelsSetUpBetting().
Definition at line 23 of file lucky_wheels.c.
LUCKY_WHEELS_HEAP_SLOT
#define LUCKY_WHEELS_HEAP_SLOT HEAP_SLOT_LUCKY_GAME
Lucky Wheels' own state (LUCKY_WHEELS_STATE), in the heap slot Lucky Dice
keeps its screen in, beside the battle effect slots it borrows.
Referenced by fdLuckyWheelsRun(), fdLuckyWheelsSetUpBetting() and fdLuckyWheelsUpdate().
Definition at line 27 of file lucky_wheels.c.
LUCKY_WHEELS_CANVAS_SIZE
#define LUCKY_WHEELS_CANVAS_SIZE (256 * 128)
The paylines' canvas: 256 x 128 pixels of 8-bit colour, shown on BG2 from its
tile 212 in the rows of its map from LUCKY_WHEELS_CANVAS_TOP_ROW to
LUCKY_WHEELS_CANVAS_BOTTOM_ROW; the rows above and below show a clear tile,
in the part of BG1's map below the screen that fdLuckyWheelsRun clears.
Referenced by fdLuckyWheelsRun() and fdLuckyWheelsTransferCanvas().
Definition at line 33 of file lucky_wheels.c.
LUCKY_WHEELS_CANVAS_FIRST_TILE
#define LUCKY_WHEELS_CANVAS_FIRST_TILE 212
Referenced by fdLuckyWheelsRun().
Definition at line 34 of file lucky_wheels.c.
LUCKY_WHEELS_CANVAS_TOP_ROW
#define LUCKY_WHEELS_CANVAS_TOP_ROW 2
Referenced by fdLuckyWheelsRun().
Definition at line 35 of file lucky_wheels.c.
LUCKY_WHEELS_CANVAS_BOTTOM_ROW
#define LUCKY_WHEELS_CANVAS_BOTTOM_ROW 16
Referenced by fdLuckyWheelsRun().
Definition at line 36 of file lucky_wheels.c.
LUCKY_WHEELS_CANVAS_TILES
#define LUCKY_WHEELS_CANVAS_TILES
Referenced by fdLuckyWheelsRun() and fdLuckyWheelsTransferCanvas().
Definition at line 37 of file lucky_wheels.c.
LUCKY_WHEELS_CANVAS_CLEAR_TILE
#define LUCKY_WHEELS_CANVAS_CLEAR_TILE 191
Referenced by fdLuckyWheelsRun().
Definition at line 39 of file lucky_wheels.c.
LUCKY_WHEELS_SPARK_COLORS
#define LUCKY_WHEELS_SPARK_COLORS 64
The canvas's first 64 colours, its sparks', from a Djinn sprite sheet's palette and cycled through others while a win shows.
Referenced by fdLuckyWheelsRun() and fdLuckyWheelsStepSparkColors().
Definition at line 42 of file lucky_wheels.c.
LUCKY_WHEELS_LINE_COLOR
#define LUCKY_WHEELS_LINE_COLOR 64
The paylines' green on the canvas, colour 64, and its lighter centre.
Referenced by fdLuckyWheelsRun().
Definition at line 44 of file lucky_wheels.c.
LUCKY_WHEELS_LINE_LIGHT
#define LUCKY_WHEELS_LINE_LIGHT (LUCKY_WHEELS_LINE_COLOR + 1)
Referenced by fdLuckyWheelsRun().
Definition at line 45 of file lucky_wheels.c.
LUCKY_WHEELS_MACHINE_PALETTE
#define LUCKY_WHEELS_MACHINE_PALETTE 10
The machine's picture: its 16 colours in BG palette 10, and its tiles from tile 424 of BG1's characters, all but those of the opening the wheels show through, which BG1's map fills with a clear tile.
Referenced by fdLuckyWheelsDarkenStep() and fdLuckyWheelsRun().
Definition at line 49 of file lucky_wheels.c.
LUCKY_WHEELS_MACHINE_TILE
#define LUCKY_WHEELS_MACHINE_TILE 424
Referenced by fdLuckyWheelsRun().
Definition at line 50 of file lucky_wheels.c.
LUCKY_WHEELS_CLEAR_TILE
#define LUCKY_WHEELS_CLEAR_TILE 422
Referenced by fdLuckyWheelsRun().
Definition at line 51 of file lucky_wheels.c.
LUCKY_WHEELS_IN_OPENING
#define LUCKY_WHEELS_IN_OPENING(column, row)
The machine's opening, in map metatiles: columns 5 to 24 and rows 3 to 13.
Referenced by fdLuckyWheelsRun().
Definition at line 53 of file lucky_wheels.c.
LUCKY_WHEELS_ICON_COLORS
#define LUCKY_WHEELS_ICON_COLORS 240
The icons' picture begins with its 240 colours, the sprites' first 240, then its 435 tiles of 256 colours.
Referenced by fdLuckyWheelsDarkenStep() and fdLuckyWheelsRun().
Definition at line 57 of file lucky_wheels.c.
LUCKY_WHEELS_ICON_TILES
#define LUCKY_WHEELS_ICON_TILES 435
Referenced by fdLuckyWheelsRun().
Definition at line 58 of file lucky_wheels.c.
LUCKY_WHEELS_JACKPOT_PALETTE
#define LUCKY_WHEELS_JACKPOT_PALETTE 15
The jackpot banner's and the title letters' sprite palette.
Referenced by fdLuckyWheelsRun() and fdLuckyWheelsUpdate().
Definition at line 60 of file lucky_wheels.c.
PALETTE_BYTES
#define PALETTE_BYTES (PALETTE_COLORS * 2)
A palette's 16 colours in bytes, as each 16-colour picture's resource begins.
Referenced by fdLuckyWheelsRun().
Definition at line 62 of file lucky_wheels.c.
LUCKY_WHEELS_TITLE_FIRST_TURNED
#define LUCKY_WHEELS_TITLE_FIRST_TURNED (LANGUAGE == LANGUAGE_SPANISH)
The Spanish title's first letter is its last letter's tile turned over both ways, drawn 16 pixels left and 8 down.
Referenced by fdLuckyWheelsUpdate().
Definition at line 65 of file lucky_wheels.c.
LINE_STEP_ONE
#define LINE_STEP_ONE (1 << 8)
A line's step along its shorter axis, in 256ths of a pixel.
Referenced by fdLuckyWheelsDrawCanvasLine().
Definition at line 220 of file lucky_wheels.c.
LUCKY_WHEELS_WHEEL_COUNT
#define LUCKY_WHEELS_WHEEL_COUNT 5
The machine's five wheels; the cursor's next place, past the last wheel, is the lever.
Referenced by fdLuckyWheelsRun() and fdLuckyWheelsUpdate().
Definition at line 312 of file lucky_wheels.c.
LUCKY_WHEELS_LEVER
#define LUCKY_WHEELS_LEVER LUCKY_WHEELS_WHEEL_COUNT
Referenced by fdLuckyWheelsUpdate().
Definition at line 313 of file lucky_wheels.c.
LUCKY_WHEELS_LEVER_PULL_FRAMES
#define LUCKY_WHEELS_LEVER_PULL_FRAMES 48
Pulling the lever: 48 frames down and back up, then 8 settling; only then can the wheels be stopped.
Referenced by fdLuckyWheelsUpdate().
Definition at line 316 of file lucky_wheels.c.
LUCKY_WHEELS_LEVER_SETTLE_FRAMES
#define LUCKY_WHEELS_LEVER_SETTLE_FRAMES 8
Definition at line 317 of file lucky_wheels.c.
LUCKY_WHEELS_LEVER_FRAMES
#define LUCKY_WHEELS_LEVER_FRAMES
Referenced by fdLuckyWheelsUpdate().
Definition at line 318 of file lucky_wheels.c.
LUCKY_WHEELS_LEVER_X
#define LUCKY_WHEELS_LEVER_X 208
The lever sprite's place at rest, in screen pixels, and how far it is pulled down.
Referenced by fdLuckyWheelsUpdate().
Definition at line 322 of file lucky_wheels.c.
LUCKY_WHEELS_LEVER_Y
#define LUCKY_WHEELS_LEVER_Y 40
Referenced by fdLuckyWheelsUpdate().
Definition at line 323 of file lucky_wheels.c.
LUCKY_WHEELS_LEVER_PULL
#define LUCKY_WHEELS_LEVER_PULL 64
Referenced by fdLuckyWheelsUpdate().
Definition at line 324 of file lucky_wheels.c.
LUCKY_WHEELS_AUTO_STOP_FRAMES
#define LUCKY_WHEELS_AUTO_STOP_FRAMES 32
Left alone, the spinning wheels stop one every 32 frames; R stops one at once.
Referenced by fdLuckyWheelsUpdate().
Definition at line 327 of file lucky_wheels.c.
LUCKY_WHEELS_WIN_PAUSE
#define LUCKY_WHEELS_WIN_PAUSE 60
The pause, in frames, after a winning spin before the win is shown, and after the last spin loses before the game ends.
Referenced by fdLuckyWheelsUpdate().
Definition at line 330 of file lucky_wheels.c.
LUCKY_WHEELS_LOSS_PAUSE
#define LUCKY_WHEELS_LOSS_PAUSE 45
Referenced by fdLuckyWheelsUpdate().
Definition at line 331 of file lucky_wheels.c.
LUCKY_WHEELS_STOP_WINDOW_FRAME
#define LUCKY_WHEELS_STOP_WINDOW_FRAME 4
The stop prompt's window opens, and then its sound plays, this many frames into a spin.
Referenced by fdLuckyWheelsUpdate().
Definition at line 334 of file lucky_wheels.c.
LUCKY_WHEELS_STOP_PROMPT_FRAME
#define LUCKY_WHEELS_STOP_PROMPT_FRAME 16
Referenced by fdLuckyWheelsUpdate().
Definition at line 335 of file lucky_wheels.c.
LUCKY_WHEELS_LAMP_TILES
#define LUCKY_WHEELS_LAMP_TILES 96
Where each picture of icons.png starts in sprite tiles, in OAM's 32-byte
steps (a 256-colour tile is two): the sprite sheet is 32 pixels wide, so a
picture starts at the tile numbered as its row. The six symbols are 16 apart
from 0.
A wheel's lamp, not held.
Referenced by fdLuckyWheelsUpdate().
Definition at line 343 of file lucky_wheels.c.
LUCKY_WHEELS_HELD_LAMP_TILES
#define LUCKY_WHEELS_HELD_LAMP_TILES 128
A held wheel's lamp.
Referenced by fdLuckyWheelsUpdate().
Definition at line 345 of file lucky_wheels.c.
LUCKY_WHEELS_CORNER_LIGHT_TILES
#define LUCKY_WHEELS_CORNER_LIGHT_TILES 224
Referenced by fdLuckyWheelsUpdate().
Definition at line 346 of file lucky_wheels.c.
LUCKY_WHEELS_FRAME_LIGHT_TILES
#define LUCKY_WHEELS_FRAME_LIGHT_TILES 232
Referenced by fdLuckyWheelsUpdate().
Definition at line 347 of file lucky_wheels.c.
LUCKY_WHEELS_LEVER_TILES
#define LUCKY_WHEELS_LEVER_TILES 256
Referenced by fdLuckyWheelsUpdate().
Definition at line 348 of file lucky_wheels.c.
LUCKY_WHEELS_LINE_TILES
#define LUCKY_WHEELS_LINE_TILES 272
A payline's gem, not bet on.
Referenced by fdLuckyWheelsUpdate().
Definition at line 350 of file lucky_wheels.c.
LUCKY_WHEELS_LIT_LINE_TILES
#define LUCKY_WHEELS_LIT_LINE_TILES 464
A payline's gem, bet on.
Referenced by fdLuckyWheelsUpdate().
Definition at line 352 of file lucky_wheels.c.
LUCKY_WHEELS_LEVER_SLOT_TILES
#define LUCKY_WHEELS_LEVER_SLOT_TILES 320
The slot the lever runs in, drawn in eight pieces 16 pixels tall down beside
the wheels from (LUCKY_WHEELS_LEVER_SLOT_X, LUCKY_WHEELS_LEVER_SLOT_Y).
Referenced by fdLuckyWheelsUpdate().
Definition at line 355 of file lucky_wheels.c.
LUCKY_WHEELS_LEVER_SLOT_PIECES
#define LUCKY_WHEELS_LEVER_SLOT_PIECES 8
Referenced by fdLuckyWheelsUpdate().
Definition at line 356 of file lucky_wheels.c.
LUCKY_WHEELS_LEVER_SLOT_X
#define LUCKY_WHEELS_LEVER_SLOT_X 206
Referenced by fdLuckyWheelsUpdate().
Definition at line 357 of file lucky_wheels.c.
LUCKY_WHEELS_LEVER_SLOT_Y
#define LUCKY_WHEELS_LEVER_SLOT_Y 12
Referenced by fdLuckyWheelsUpdate().
Definition at line 358 of file lucky_wheels.c.
LUCKY_WHEELS_HAND_TILES
#define LUCKY_WHEELS_HAND_TILES 496
The cursor's hand.
Referenced by fdLuckyWheelsUpdate().
Definition at line 360 of file lucky_wheels.c.
LUCKY_WHEELS_PULL_TILES
#define LUCKY_WHEELS_PULL_TILES 528
A pull's number, the current one large.
Referenced by fdLuckyWheelsUpdate().
Definition at line 362 of file lucky_wheels.c.
LUCKY_WHEELS_ARROW_TILES
#define LUCKY_WHEELS_ARROW_TILES 688
The cursor's blinking arrows.
Referenced by fdLuckyWheelsUpdate().
Definition at line 364 of file lucky_wheels.c.
LUCKY_WHEELS_WHEEL_SYMBOLS
#define LUCKY_WHEELS_WHEEL_SYMBOLS 21
The symbols round a wheel, each 16 pixels tall: a wheel turns once in 336 pixels, 8 a frame, and stops only with a symbol centred on a line.
Referenced by fdLuckyWheelsRun() and fdLuckyWheelsUpdate().
Definition at line 367 of file lucky_wheels.c.
LUCKY_WHEELS_SYMBOL_HEIGHT
#define LUCKY_WHEELS_SYMBOL_HEIGHT 16
Referenced by fdLuckyWheelsRun() and fdLuckyWheelsUpdate().
Definition at line 368 of file lucky_wheels.c.
LUCKY_WHEELS_WHEEL_TURN
#define LUCKY_WHEELS_WHEEL_TURN
Referenced by fdLuckyWheelsUpdate().
Definition at line 369 of file lucky_wheels.c.
LUCKY_WHEELS_SPIN_SPEED
#define LUCKY_WHEELS_SPIN_SPEED 8
Referenced by fdLuckyWheelsUpdate().
Definition at line 371 of file lucky_wheels.c.
LUCKY_WHEELS_PAYLINES
#define LUCKY_WHEELS_PAYLINES 7
The seven paylines: the two diagonals (0 and 6) and the five rows between.
Referenced by fdLuckyWheelsRun() and fdLuckyWheelsUpdate().
Definition at line 373 of file lucky_wheels.c.
LUCKY_WHEELS_MIDDLE_LINE
#define LUCKY_WHEELS_MIDDLE_LINE 3
Referenced by fdLuckyWheelsRun() and fdLuckyWheelsUpdate().
Definition at line 374 of file lucky_wheels.c.
LUCKY_WHEELS_BET_MAX
#define LUCKY_WHEELS_BET_MAX 4
Referenced by fdLuckyWheelsUpdate().
Definition at line 375 of file lucky_wheels.c.
LUCKY_WHEELS_PULLS
#define LUCKY_WHEELS_PULLS 5
The pulls of the lever a bet buys: "You have only 5 chances to pull the lever."
Referenced by fdLuckyWheelsUpdate().
Definition at line 378 of file lucky_wheels.c.
LUCKY_WHEELS_WILD_SYMBOL
#define LUCKY_WHEELS_WILD_SYMBOL LUCKY_WHEELS_MOON
The symbol that matches any other on a payline.
Referenced by fdLuckyWheelsRun() and fdLuckyWheelsUpdate().
Definition at line 392 of file lucky_wheels.c.
LUCKY_WHEELS_FADE_TICKS
#define LUCKY_WHEELS_FADE_TICKS 16
The machine fades in and out over 16 ticks, a sixteenth of full brightness a tick; the win flashes the screen darker over as many.
Referenced by fdLuckyWheelsRun().
Definition at line 395 of file lucky_wheels.c.
LUCKY_WHEELS_CYCLE_TICKS
#define LUCKY_WHEELS_CYCLE_TICKS 16
The win cycles the background through five palettes, 16 ticks each.
Referenced by fdLuckyWheelsRun().
Definition at line 398 of file lucky_wheels.c.
LUCKY_WHEELS_CYCLE_PALETTES
#define LUCKY_WHEELS_CYCLE_PALETTES 5
Referenced by fdLuckyWheelsRun().
Definition at line 399 of file lucky_wheels.c.
LUCKY_WHEELS_BURST_SPARKS
#define LUCKY_WHEELS_BURST_SPARKS 256
The jackpot sparks: four bursts of 256 in turn, one every eight ticks.
Referenced by fdLuckyWheelsRun().
Definition at line 402 of file lucky_wheels.c.
LUCKY_WHEELS_SPARK_COUNT
#define LUCKY_WHEELS_SPARK_COUNT (4 * LUCKY_WHEELS_BURST_SPARKS)
Referenced by fdLuckyWheelsRun() and fdLuckyWheelsSetUpBetting().
Definition at line 403 of file lucky_wheels.c.
LUCKY_WHEELS_SPARK_SHRINK_TICKS
#define LUCKY_WHEELS_SPARK_SHRINK_TICKS 12
A spark's size steps down every 12 ticks of its life, from 2 or 3 to 1.
Referenced by fdLuckyWheelsRun().
Definition at line 405 of file lucky_wheels.c.
LUCKY_WHEELS_REPEAT_DELAY
#define LUCKY_WHEELS_REPEAT_DELAY 12
A held direction moves the cursor once, waits 12 frames, then moves it again every 4 frames.
Referenced by fdLuckyWheelsUpdate().
Definition at line 408 of file lucky_wheels.c.
LUCKY_WHEELS_REPEAT_INTERVAL
#define LUCKY_WHEELS_REPEAT_INTERVAL 4
Referenced by fdLuckyWheelsUpdate().
Definition at line 409 of file lucky_wheels.c.
LUCKY_WHEELS_MACHINE_LIGHTS
#define LUCKY_WHEELS_MACHINE_LIGHTS 14
the machine's lights
Referenced by fdLuckyWheelsUpdate(), LuckyWheelsMachineSpriteX and LuckyWheelsMachineSpriteY.
Definition at line 517 of file lucky_wheels.c.
LUCKY_WHEELS_CORNER_LIGHTS
#define LUCKY_WHEELS_CORNER_LIGHTS 4
the first of them, at its corners
Referenced by fdLuckyWheelsUpdate().
Definition at line 518 of file lucky_wheels.c.
LUCKY_WHEELS_WHEELS_TOP
#define LUCKY_WHEELS_WHEELS_TOP 23
The screen lines of the wheels' top and bottom edges, and the lines from each
that fdLuckyWheelsSetUpBetting shades.
Referenced by fdLuckyWheelsSetUpBetting().
Definition at line 1359 of file lucky_wheels.c.
LUCKY_WHEELS_WHEELS_BOTTOM
#define LUCKY_WHEELS_WHEELS_BOTTOM 110
Referenced by fdLuckyWheelsSetUpBetting().
Definition at line 1360 of file lucky_wheels.c.
LUCKY_WHEELS_SHADE_LINES
#define LUCKY_WHEELS_SHADE_LINES 40
Referenced by fdLuckyWheelsSetUpBetting().
Definition at line 1361 of file lucky_wheels.c.
LUCKY_WHEELS_SHADE_LEVEL
#define LUCKY_WHEELS_SHADE_LEVEL 6
The darkening at the wheels' very edges, in BLDY's sixteenths.
Referenced by fdLuckyWheelsSetUpBetting().
Definition at line 1363 of file lucky_wheels.c.
LUCKY_WHEELS_PLACED_SYMBOLS
#define LUCKY_WHEELS_PLACED_SYMBOLS 8
The places on each wheel given a set symbol after the random fill: one of each plain symbol, then three moons.
Referenced by fdLuckyWheelsRun().
Definition at line 1437 of file lucky_wheels.c.
PACK_WINDOW_SIZE
#define PACK_WINDOW_SIZE 1024
The LZ packer: a window of PACK_WINDOW_SIZE bytes with a hash chain for each
byte value, PACK_LOOKAHEAD bytes read ahead of the one being packed and the
PACK_HISTORY behind it kept in the chains, and matches of up to
PACK_MATCH_MAX bytes at most PACK_DISTANCE_MAX back.
Referenced by fdLZPackReadInput() and fdLZPackResetChains().
Definition at line 1920 of file lucky_wheels.c.
PACK_WINDOW_MASK
#define PACK_WINDOW_MASK (PACK_WINDOW_SIZE - 1)
Referenced by fdLZPackFindWindowMatch(), fdLZPackPackData() and fdLZPackReadInput().
Definition at line 1921 of file lucky_wheels.c.
PACK_BYTE_VALUES
#define PACK_BYTE_VALUES 256
Referenced by fdLZPackResetChains().
Definition at line 1922 of file lucky_wheels.c.
PACK_LOOKAHEAD
#define PACK_LOOKAHEAD 672
Referenced by fdLZPackPackData() and fdLZPackReadInput().
Definition at line 1923 of file lucky_wheels.c.
PACK_HISTORY
#define PACK_HISTORY 60
Referenced by fdLZPackReadInput().
Definition at line 1924 of file lucky_wheels.c.
PACK_DISTANCE_MAX
#define PACK_DISTANCE_MAX 63
Referenced by fdLZPackFindWindowMatch().
Definition at line 1925 of file lucky_wheels.c.
PACK_SHORT_MATCH_MAX
#define PACK_SHORT_MATCH_MAX 16
A match of up to 16 bytes takes two bytes; a longer one three, its length
less 17 in the third, up to PACK_MATCH_MAX.
Referenced by fdLZPackPackData().
Definition at line 1928 of file lucky_wheels.c.
PACK_MATCH_MAX
#define PACK_MATCH_MAX 272
Referenced by fdLZPackFindWindowMatch().
Definition at line 1929 of file lucky_wheels.c.
PACK_FIRST_FLAG
#define PACK_FIRST_FLAG (1 << 7)
A group's flag byte is read from its top bit down, a bit an item.
Referenced by fdLZPackPackData().
Definition at line 1931 of file lucky_wheels.c.
PACK_CODE_DISTANCE_HIGH
#define PACK_CODE_DISTANCE_HIGH (~0xfff)
A match's code, a halfword written high byte first: its distance's bits from 8 up in bits 12 to 15, its length less one in bits 8 to 11 for a short match, and its distance's low byte.
Referenced by fdLZPackPackData().
Definition at line 1935 of file lucky_wheels.c.
PACK_CODE_LENGTH
#define PACK_CODE_LENGTH 0xf00
Referenced by fdLZPackPackData().
Definition at line 1936 of file lucky_wheels.c.
PACK_CODE_DISTANCE_LOW
#define PACK_CODE_DISTANCE_LOW 0xff
Referenced by fdLZPackPackData().
Definition at line 1937 of file lucky_wheels.c.
Enumerations in detail
LUCKY_WHEELS_SYMBOL
enum LUCKY_WHEELS_SYMBOL
The wheels' symbols, in icons.png's order.
| Enumerator | Value | Description |
|---|---|---|
LUCKY_WHEELS_SHIRT | ||
LUCKY_WHEELS_HEART | ||
LUCKY_WHEELS_BOOT | ||
LUCKY_WHEELS_STAR | ||
LUCKY_WHEELS_RING | ||
LUCKY_WHEELS_MOON |
Definition at line 381 of file lucky_wheels.c.
LUCKY_WHEELS_PHASE
enum LUCKY_WHEELS_PHASE
Lucky Wheels' phases (LUCKY_WHEELS_STATE.phase).
| Enumerator | Value | Description |
|---|---|---|
LUCKY_WHEELS_BETTING | 0 | Up and Down change the bet, A spins, B leaves |
LUCKY_WHEELS_SPINNING | 1 | the wheels spin until R or time stops each |
LUCKY_WHEELS_WON | 2 | a payline won: a pause |
LUCKY_WHEELS_SHOWING_WIN | 3 | the win is shown until A |
LUCKY_WHEELS_CHOOSING_HOLDS | 5 | choose wheels to lock, or pull the lever |
LUCKY_WHEELS_DONE | 10 | the game ends |
LUCKY_WHEELS_NO_WIN | 11 | no payline won: A to choose wheels to lock |
LUCKY_WHEELS_OUT_OF_SPINS | 20 | the fifth and last pull lost: a pause, then the end |
Definition at line 424 of file lucky_wheels.c.
LUCKY_WHEELS_PROMPT
enum LUCKY_WHEELS_PROMPT
The prompt the top window shows while wheels are locked
(LUCKY_WHEELS_STATE.prompt), so that it is drawn again only when it changes.
| Enumerator | Value | Description |
|---|---|---|
LUCKY_WHEELS_PROMPT_NONE | 0 | |
LUCKY_WHEELS_PROMPT_ALL_HELD | 1 | "If you lock all the slots,", its first line |
LUCKY_WHEELS_PROMPT_ALL_HELD_BOTH_LINES | 2 | then "you can't pull the lever!" under it |
LUCKY_WHEELS_PROMPT_START | 3 | ":Start machine", on the lever |
LUCKY_WHEELS_PROMPT_HOLD | 4 | ":Stop", on a spinning wheel |
LUCKY_WHEELS_PROMPT_RELEASE | 5 | ":Spin", on a locked wheel |
LUCKY_WHEELS_PROMPT_PULL_LEVER | 1 | on a no-win pull: "to lock, pull the lever!" |
Definition at line 443 of file lucky_wheels.c.
Functions in detail
fdLuckyWheelsStart
Sint32 fdLuckyWheelsStart(void)
Plays Lucky Wheels: blanks the screen, seeds the random numbers with the play time and runs the game. Returns 0.
References fdLuckyWheelsRun(), MainRoutineStateWork, RandWork, Sint32 and sySoundPlayStub().
Definition at line 69 of file lucky_wheels.c.
fdLuckyWheelsTransferCanvas
void fdLuckyWheelsTransferCanvas(void)
A VBlank-pass event: on a VBlank after the canvas is ready (transferPending),
sends the canvas to its tiles in VRAM (LUCKY_WHEELS_CANVAS_TILES), then
clears it or fades it into trails as transferMode says.
References syColorBufferHalveNonzero(), syColorBufferScaleNonzeroThreeQuarters(), syDMAXCopy() and syWordsFill().
Referenced by fdLuckyWheelsRun().
Definition at line 83 of file lucky_wheels.c.
fdLuckyWheelsDarkenStep
void fdLuckyWheelsDarkenStep(void)
Darkens the screen one step: lowers each channel of the machine's 16 colours and of the icons' by 1.
References Sint32.
Referenced by fdLuckyWheelsRun().
Definition at line 126 of file lucky_wheels.c.
fdLuckyWheelsStepSparkColors
void fdLuckyWheelsStepSparkColors(Sint32 resource)
Moves the sparks' colours one step toward the palette of resource; the backdrop colour is not written back.
References Sint32, syDMAXCopy() and syResourceGetTableEntry().
Referenced by fdLuckyWheelsRun().
Definition at line 173 of file lucky_wheels.c.
fdLuckyWheelsCanvasOffset
static __inline__ Uint32 fdLuckyWheelsCanvasOffset(Uint32 x, Uint32 y)
The byte of the canvas's pixel (x, y): its tiles run 32 to a row, 64 bytes each.
Referenced by fdLuckyWheelsDrawCanvasLine().
Definition at line 214 of file lucky_wheels.c.
fdLuckyWheelsDrawCanvasLine
void fdLuckyWheelsDrawCanvasLine( Sint32 x0, Sint32 y0, Sint32 x1, Sint32 y1, Sint32 color)
Draws a line from (x0, y0) to (x1, y1) on the 256 x 128 8bpp canvas (32 tiles across), writing only over lower colour numbers.
References fdLuckyWheelsCanvasOffset() and Sint32.
Referenced by fdLuckyWheelsRun().
Definition at line 224 of file lucky_wheels.c.
fdLuckyWheelsUpdate
void fdLuckyWheelsUpdate(void)
Lucky Wheels' VBlank event: reads the keys, runs the game's phase (betting, spinning and stopping the wheels, scoring the paylines, choosing wheels to hold, showing a win) and builds all 128 sprites: the cursor, the title letters of a win, the frame, the hold lamps, the spin counter, the paylines, the wheel symbols, the lever and the bottom bar.
References DebugPaused, gmPartyInventoryCountItemStub(), gmPartyInventoryRemoveStub(), line, LuckyWheelsMachineSpriteX, LuckyWheelsMachineSpriteY, LuckyWheelsSymbolPrizes, LuckyWheelsTitleLetterTiles, MainRoutineStateWork, mnTextDrawMessageAsTilesStub(), mnTextDrawNumberInWindowStub(), mnWindowCloseStub(), mnWindowCreateStub(), PerData, Sint32, syDMAXCopy(), syRandom(), sySin() and sySoundPlayStub().
Referenced by fdLuckyWheelsRun().
Definition at line 543 of file lucky_wheels.c.
fdLuckyWheelsSetUpBetting
void fdLuckyWheelsSetUpBetting(void)
Sets up the bouncing title letters of a win, the brightness wave of the screen's lines and the betting window, and starts at betting.
References LuckyWheelsTitleLetterWidths, mnTextDrawMessageAsTilesStub(), mnWindowCreateStub(), Sint32, syCos() and width.
Referenced by fdLuckyWheelsRun().
Definition at line 1367 of file lucky_wheels.c.
fdLuckyWheelsRun
void fdLuckyWheelsRun(void)
Lucky Wheels: loads its backgrounds, sprites and palettes, fills each of the five wheels with 21 random symbols, among them each plain symbol and three moons, then runs until the player leaves: fading in, drawing the paylines on the canvas while betting or winning, and the jackpot's sparks and colour cycle while showing a win. Then fades out and frees its memory.
References BgScrollWork, btEffectBuildBlitterStub(), fdLuckyWheelsDarkenStep(), fdLuckyWheelsDrawCanvasLine(), fdLuckyWheelsSetUpBetting(), fdLuckyWheelsStepSparkColors(), fdLuckyWheelsTransferCanvas(), fdLuckyWheelsUpdate(), fdPaletteScaleRGB555(), gmPartyInventoryCountItemStub(), HeapSlots, LuckyWheelsSparkPictures, MainRoutineStateWork, mnTextDrawMessageAsTilesStub(), mnWindowCreateStub(), mnWindowSystemInitFieldStub(), OamCopyEnabled, Sint32, syCloseEvent(), syCos(), syDecompressTaggedLZ(), syDMAXCopy(), syHeapSlotAllocate(), syHeapSlotAllocateEWRAM(), syHeapSlotRelease(), syInitEvent(), syRandom(), syResourceGetTableEntry(), syResourceReservedNoOperation(), sySetEvent(), sySin(), sySynch(), syWordsClear() and syWordsFill().
Referenced by fdLuckyWheelsStart().
Definition at line 1444 of file lucky_wheels.c.
fdLZPackResetChains
void fdLZPackResetChains(void)
Empties the LZ packer's hash chains and numbers its window nodes.
References Sint32.
Referenced by fdLZPackPackData().
Definition at line 1940 of file lucky_wheels.c.
fdLZPackInsertSlotNode
void fdLZPackInsertSlotNode(Sint32 index)
Adds window position index to the chain of the byte it holds.
Referenced by fdLZPackReadInput().
Definition at line 1958 of file lucky_wheels.c.
fdLZPackRemoveSlotNode
void fdLZPackRemoveSlotNode(Sint32 slot)
Removes window position slot from its chain.
References Sint32.
Referenced by fdLZPackReadInput().
Definition at line 1971 of file lucky_wheels.c.
fdLZPackReadInput
void fdLZPackReadInput(Sint32 start, Sint32 count, const Uint8 *input)
Reads count more input bytes into the window from position start, dropping the bytes they replace from their chains; past the end of the input the positions are marked empty (-1).
References fdLZPackInsertSlotNode(), fdLZPackRemoveSlotNode(), Sint32 and state.
Referenced by fdLZPackPackData().
Definition at line 1986 of file lucky_wheels.c.
fdLZPackCopyBufferedBytes
void fdLZPackCopyBufferedBytes(Uint8 *dest)
Appends the finished group (a flag byte and up to eight items) to the output.
Referenced by fdLZPackPackData().
Definition at line 2043 of file lucky_wheels.c.
fdLZPackFindWindowMatch
static __inline__ void fdLZPackFindWindowMatch(Sint32 start)
Finds the longest earlier match (up to PACK_MATCH_MAX bytes, at most
PACK_DISTANCE_MAX back) for the bytes at window position start; matchLen
stays 1 for none.
References Sint32.
Referenced by fdLZPackPackData().
Definition at line 2058 of file lucky_wheels.c.
fdLZPackPackData
Sint32 fdLZPackPackData(const Uint8 *input, Uint8 *dest, Sint32 size)
Unused: packs size bytes of input into dest with a small LZ scheme and returns the packed size. Each group starts with a flag byte, a set bit marking a match: two bytes of distance and length (lengths 2 to 16), or three for lengths up to 272; a match is put off by one byte when the next position matches further. A zero match ends the stream.
References fdLZPackCopyBufferedBytes(), fdLZPackFindWindowMatch(), fdLZPackReadInput(), fdLZPackResetChains(), MapGridMetatileBuffer and Sint32.
Definition at line 2137 of file lucky_wheels.c.
Variables in detail
LuckyWheelsSparkPictures
const Uint16 LuckyWheelsSparkPictures[]
Where each spark picture (a square 2 to 20 pixels on a side) starts: size s (1 to 10) is a square 2s pixels a side, after the smaller squares' pixels.
Referenced by fdLuckyWheelsRun().
Definition at line 491 of file lucky_wheels.c.
LuckyWheelsSymbolPrizes
const Uint8 LuckyWheelsSymbolPrizes[]
The prize of each wheel symbol (LUCKY_WHEELS_PRIZE), kept in
MainRoutineStateWork.holdings.wonPrizes for each winning line.
Referenced by fdLuckyWheelsUpdate().
Definition at line 496 of file lucky_wheels.c.
LuckyWheelsTitleLetterTiles
const Uint8 LuckyWheelsTitleLetterTiles[LUCKY_WHEELS_TITLE_LETTERS]
The tile of each title letter, the letter's place in its sprite sheet:
jackpot.png holds Jackpot! and jackpot_ja.png ジャックポト!.
Referenced by fdLuckyWheelsUpdate().
Definition at line 507 of file lucky_wheels.c.
LuckyWheelsMachineSpriteX
const Uint8 LuckyWheelsMachineSpriteX[LUCKY_WHEELS_MACHINE_LIGHTS]
The positions of the machine's lights, in screen pixels: its four corners first, then the lights along its frame.
Referenced by fdLuckyWheelsUpdate().
Definition at line 521 of file lucky_wheels.c.
LuckyWheelsMachineSpriteY
const Uint8 LuckyWheelsMachineSpriteY[LUCKY_WHEELS_MACHINE_LIGHTS]
Referenced by fdLuckyWheelsUpdate().
Definition at line 523 of file lucky_wheels.c.
LuckyWheelsTitleLetterWidths
const Uint8 LuckyWheelsTitleLetterWidths[LUCKY_WHEELS_TITLE_LETTERS]
The advance of each title letter, in pixels, from LUCKY_WHEELS_TITLE_X. The
last letter's advance is never used; Japanese leaves it out (0).
Referenced by fdLuckyWheelsSetUpBetting().
Definition at line 528 of file lucky_wheels.c.