Skip to content
🌋️
Alchemy
Theme: Weyard
Theme: Modern
Mode: Auto
Mode: Light
Mode: Dark
Alchemy
Source
Reference
Loading...
Searching...
No Matches
runtime.c
Go to the documentation of this file.
1
/// @file
2
/// The runtime object: what every other part of the game stands on. Power-up
3
/// and the interrupt handlers, the frame wait and VBlank, input, the register
4
/// write queue, fades, the sprite lists and VRAM cache, the task scheduler,
5
/// maths, debug text, the heap, the 3D transform, saving and the link cable.
6
///
7
/// runtime_internal.h holds what every part shares (its includes); the code
8
/// is in the files under runtime/, included here in the order it has in the
9
/// ROM. Camelot's own files are not recoverable: the ROM shows one object, and
10
/// these parts are ours, cut where one family ends and the next begins.
11
/// README.md in this folder gives the words and prefixes the parts use. Where
12
/// to start:
13
///
14
/// Power-up system.c: System_Initialize
15
/// Frames frame.c: WaitFrames, System_VBlankHandler,
16
/// Runtime_SetIrqHandler; scheduler.c:
17
/// Scheduler_AddOrUpdateCallback
18
/// Screen fade.c: Fade_Start; render.c: Render_BuildOamList;
19
/// vram_cache.c: VramCache_Load
20
/// Memory heap.c: Runtime_AllocateHeapBlock, MemAlloc
21
/// 3D transform.c: SceneTransform_ApplyRotationTranslation,
22
/// Render_ProjectPoint
23
/// Saving save.c: SaveState_WriteRecord,
24
/// SaveState_ReadRecordPayload
25
/// Link cable serial.c: SerialRuntime_Initialize,
26
/// SerialRuntime_ExchangePayloads
27
28
#include "
runtime_internal.h
"
29
30
// The runtime object's code, in ROM order. Each part is compiled here, as
31
// part of this one object, never on its own: the order of these includes is
32
// the order of the code in the ROM.
33
#include "
runtime/system.c
"
34
#include "
runtime/frame.c
"
35
#include "
runtime/io_queue.c
"
36
#include "
runtime/fade.c
"
37
#include "
runtime/render.c
"
38
#include "
runtime/vram_cache.c
"
39
#include "
runtime/scheduler.c
"
40
#include "
runtime/math.c
"
41
#include "
runtime/text.c
"
42
#include "
runtime/heap.c
"
43
#include "
runtime/transform.c
"
44
#include "
runtime/decompress.c
"
45
#include "
runtime/save.c
"
46
#include "
runtime/serial.c
"
fade.c
Screen fades through the blend registers.
frame.c
Interrupt handlers, the frame wait, key repeat and the VBlank handler.
heap.c
The heap: its two bump allocators and named slots.
io_queue.c
The register write queue that VBlank carries out after each finished frame.
math.c
Random numbers, angles and square roots.
render.c
The frame's sprite lists: affine matrices, depth slots and the OAM build.
decompress.c
Resource decoding and pixel buffer shading, through RAM copies of ARM code.
save.c
Saving: flash sectors, records and the save workspace.
runtime_internal.h
What every part of the runtime object shares: its includes and the library call two parts make.
scheduler.c
The task scheduler: per-frame and VBlank routines in order.
serial.c
The link cable: payload exchange, block transfers and the link test.
system.c
Power-up, the cartridge's language, the build stamp and code loading.
text.c
Number text, the debug text screen and the window graphics.
transform.c
The 3D transform, its stack, the look-at matrix and the projection.
vram_cache.c
The sprite VRAM cache: blocks, entries and loading pictures.
src
runtime
runtime.c