Web64 C Compiler User Manual
Version: 2026-09-29
Copyright (c) 2026 Mika Jussila, Siteledger Solutions Oy
This manual separates the Web64 C compiler and SDK reference from the broader IDE manual. The larger IDE workflow context remains in Web64 IDE User Manual.
Web64 C compiler and virtual headers
Web64 IDE includes the browser-native Web64 C compiler. Existing projects that omit compiler-profile fields retain the web64-c-v0.1 dialect and web64-static-v0 ABI byte-for-byte where no bug fix applies. New C projects use the web64-c90 freestanding dialect and web64-stack-v1 ABI. Strict ansi-c90 is also available when Web64 language extensions should be diagnosed. This manual describes all three profiles and their shared C64 lowering, hardware, asset, multi-translation-unit, and mixed C/assembly contracts.
The C compiler is not cc65. It does not use cc65 object files, linker scripts, or a native toolchain. Web64 C lowers supported C modules into Web64 assembler-compatible source, then the existing browser-local assembler produces the PRG, symbols, line maps, diagnostics, and memory ranges.
When the optional Generated Assembly workspace is enabled and opened, the IDE exposes that lowering result as structured, read-only instruction rows with encoded bytes, addresses, and original C source provenance. Display formatting and lookup indexes are created lazily for the active compile revision; enabling the setting alone does not add projection work to live C editing. Source breakpoints use stable lowering provenance where available and are remapped after regenerated addresses move. See Generated Assembly machine view for the complete workflow and machine-breakpoint distinction.
C project model
A C project is made from virtual project records, not host paths. Typical records are:
main.c
include/game.h
assets/generated.h
assets/sprites/player.spr
assets/maps/level1.map
The build graph classifies .c files as C modules, .h files as C headers, assembly files as assembly modules, and asset files as binary or generated records. Build Targets select the exact C and assembly translation units linked into each PRG. C modules are ordered before assembly modules so generated C labels, compiler-created ABI slots, and handwritten assembly labels share the final assembler symbol namespace.
Web64 C emits a startup label that calls the configured C entry function. A Build Target rooted at main.c does not need a placeholder assembly translation unit. Legacy/single-target C projects may still contain the IDE's root main.asm; leave that file empty unless it intentionally provides assembly support. If a mixed project deliberately supplies its own assembly startup, call the C entry yourself, for example jsr _main for a C function named main, and select only the intended startup module in the target.
C labels are emitted with underscore names. A C function named main becomes _main in assembly. Direct calls to normal C functions emit jsr _name; calls to names that already start with asm_ are treated as direct assembly labels.
C configuration
The new-project C configuration is:
{
"enabled": false,
"dialect": "web64-c90",
"abi": "web64-stack-v1",
"entry": "main.c",
"includePaths": ["include", "assets"],
"stdout": "screen",
"stdin": "keyboard",
"runtimeProfile": "freestanding",
"stack": { "size": 512, "address": null },
"compilerBackend": "web64-native"
}
Persisted projects without dialect or abi fields normalize to web64-c-v0.1 plus web64-static-v0; this is the compatibility profile. web64-c90 enables the C90 translation phases and Web64 extensions. ansi-c90 uses the same backend but reports extensions such as //, _fastcall, _Bool, and inline assembly as errors. web64-stack-v1 supplies recursive automatic frames, variadic layout, and wide parameters/returns. The stack region defaults to the highest safe RAM below I/O and is included in overlap diagnostics and the memory-layout report.
Supported stdout backends are screen, kernal, debug, and none. Supported stdin backends are keyboard, kernal, debug, and none. Use none for freestanding routines that do not need the tiny runtime I/O shims. runtimeProfile currently supports tiny and freestanding.
Compatibility and non-regression contract
The C90 rollout does not route compatibility projects through the stack ABI. A program accepted by web64-c-v0.1 keeps its established semantics, generated bytes, size, cycle ceilings, and helper closure unless a classified compiler bug fix requires a change. Golden assembly/PRG fixtures cover fixed-point operations, arrays, asset access, loops, C/assembly calls, raster kernels, and generated-table consumers. Integer-only and fixed-only projects may not gain floating, stack, recursion, or generic arithmetic helpers.
The executable release gates compare generated output and classify every intentional difference as improved, equivalent, or justified. They also exercise real project classes and fail when code-size, deterministic-cycle, runtime-dependency, or zero-page ownership ceilings regress. C90 code uses the same specialized immediate, direct-index, hardware-register, and fixed-point lowering whenever standard semantics permit it.
Supported C subset
Web64 C is a freestanding implementation with an explicit 6502 data model. Its implemented C90-profile surface includes:
- Fully lowered 8-bit and 16-bit integer scalars,
_Bool, 16-bit pointers, constant-valuedenumdeclarations, typedef-backed SDK aliases, and fixed-layout structs/unions supported by Web64 aggregate metadata. - File-scope globals, parameters, prototypes,
extern, andstaticinternal linkage. Automatic locals may be declared in the function body, nested compound statements such asif,while,do,switch, and standalone blocks, or aforinitializer. Inner blocks andforscopes may shadow outer names; each declaration receives a distinct deterministic function-owned storage label. Static functions and objects receive module-private assembler labels, while conflicting definitions in the same scope are errors. - Scalar assignments, increments/decrements, casts, integer promotion, arithmetic, comparisons, bitwise/logical expressions, fixed-size multidimensional arrays with constant/runtime indexes,
sizeof, supported member access, and typed pointer reads and writes. - Direct declared calls, supported bundled-runtime calls,
return,if/else,while,do/while,for,break,continue, and Web64-nativeswitchdispatch with case fallthrough. _fastcallfor the documented register-call shapes, the compatibility static-slot ABI, and the C90 software-stack ABI with recursive automatic storage, caller cleanup, variadic arguments, named function-pointer objects, and hidden-pointer wide returns.const,volatile, andregisterqualifiers on supported declarations. C volatile objects are marked in generated assembly so optimizer passes preserve observable accesses.- C90 trigraph replacement, line splicing, comment replacement, preprocessing tokens, line-preserving conditional groups, object-like and function-like macros,
#,##,#define,#undef, include guards, and active#errordirectives. - Governed
#pragmadiagnostics, diagnostic-only__attribute__((unused))and__attribute__((noreturn)), and inline assembly throughasm("..."),asm volatile("..."), or__asm__("..."). - Bundled and project-local virtual includes plus decimal,
0xhexadecimal, and dollar-sign hexadecimal integer constants.
Local names follow lexical C scope and their initializers execute whenever control reaches the declaration. Under web64-stack-v1, automatic objects occupy recursive software-stack frames. Under web64-static-v0, each declaration retains its legacy static function-owned slot and generated functions remain non-reentrant.
Undeclared identifiers and undeclared custom functions are errors. Calls to the bundled runtime and names beginning with asm_ retain their legacy implicit-call behavior for existing projects. Unsupported statements, types, signatures, and annotations produce diagnostics instead of being silently accepted.
Constant operands and constant conditions
See 6502 cost model and hot-loop performance for choosing between inexpensive frame work and acceptable setup work.
Typed byte expressions with a compile-time constant use specialized lowering for +, -, &, |, and ^. Commutative operations accept the constant on either side and use a 6502 immediate operand; value - constant uses immediate SBC. constant - value uses an order-preserving sequence and may need one byte temporary, but it avoids the generic stack spill. The constant may be a literal, numeric define, or folded constant expression. This lowering also applies when the dynamic operand is a function result, so it does not use the stack or a zero-page temporary merely to hold the constant. Byte identities such as value + 0, value - 0, value | 0, value ^ 0, and value & 0xff retain evaluation of value but omit the redundant arithmetic instruction.
Constant conditions are folded when the typed expression is side-effect-free. while (true) therefore emits the loop body and back edge without loading and testing 1. Calls, volatile accesses, and other observable expressions are still evaluated; for example, while (rand()) retains the call and conditional branch.
With the temporary/register optimization pass enabled, eligible byte compound updates at a fixed address plus an unsigned byte index use absolute indexed addressing. This includes |=, &=, ^=, += and -= with foldable constant offsets. Index side effects are evaluated once, typed narrowing and 16-bit address wrapping are preserved, and volatile targets still receive exactly one read and one write. Signed/wide indexes and unproven mutable pointers retain the general path.
Non-literal 16-bit comparisons now materialize and compare both operand bytes for ==, !=, <, <=, >, and >=. Signed ordering biases both high bytes before comparison, while unsigned ordering compares them directly. Eight-bit integer operands receive the target's normal signed int promotion before mixed-width ordering, including int16_t with uint8_t and int8_t with int16_t. Compound word operands such as target > position + 256 carry through the high byte correctly. Byte-only comparisons retain their immediate and single-byte fast paths.
With the temporary/register optimization pass enabled, side-effect-free words in fixed storage can be consumed directly instead of being copied to temporary words. This includes non-volatile globals, statics and direct packed-struct fields in comparisons, truth tests, word returns and call arguments. A comparison uses this shortcut only when both operands are safe; calls, pointer dereferences, volatile objects and live stack-frame references retain their conservative evaluation paths. Ordinary call arguments still enter their normal snapshot or caller-owned slot before the next argument is evaluated. Volatile word values read both bytes once in address order, including tests against zero. Explicit narrowing and signed casts retain their typed meaning, and !/!! tests the complete operand even when its result is stored in one byte.
For example:
while (true) {
*((uint8_t*)VIC_BORDER) = rand() & 0x0f;
}
lowers to the following core sequence. Generated label suffixes vary by source location.
__web64_c_while_...:
jsr _rand
and #0xf
sta 0xd020
jmp __web64_c_while_...
The immediate-operand and constant-condition rules are part of typed C lowering and do not require enabling an optional optimizer pass.
6502 cost model and hot-loop performance
How do I optimize this per-frame C code in Web64? Start with the target and the actual hot path: Web64-C executes on the Commodore 64's MOS 6510, a 6502-family CPU with an approximately 1 MHz budget, not a modern host CPU. Frame/runtime work is cycle constrained. VIC-II display activity and IRQ work share that budget; the full frame is not all available to application code. The emulator host being fast does not make generated C64 instructions free.
For hot-loop optimization, establish which work repeats before changing arithmetic.
The CPU has no native hardware integer multiply, divide or modulo instructions. Repeated non-power-of-two operations such as value % 37, % 12, / 24 or % 10 may therefore be expensive in a hot loop. They are valid C, not errors, and a one-time setup calculation is often entirely reasonable. Do not mechanically remove every division or change a game's ranges merely to replace % 12 with & 15; that changes the result.
Current Web64-C behavior matters more than a generic rule of thumb:
- Constant expressions can fold at compile time. In supported typed 16-bit integer
paths, multiplication by zero, one, minus one or powers of two lowers inline. Some other constant multiplies use budget-checked shift/add chains; a constant multiply is not a promise of one instruction or of a helper call.
- Unsigned division/remainder by a constant power of two lower to logical shifts
or masks. Signed division needs truncation-toward-zero bias, and signed remainder retains the dividend's sign. A signed x / 8 is not generally interchangeable with x >> 3, nor is signed remainder generally interchangeable with a mask.
- Other integer division/remainder operations can retain dependency-selected
arithmetic helpers. Width, signedness, expression context and optimizer settings affect the output. Do not assume arbitrary constant divisors get a cheap reciprocal-multiply transformation. Inspect the actual Generated ASM.
- Fixed-point helpers have their own documented specializations; use their
fixed-point contracts, not integer substitutions.
For repeated bounded transforms, consider a lookup table if its RAM/ROM footprint is justified. An incremental counter or cached result can avoid recomputing the same quotient, digit conversion, layout or address each frame. For example, a counter already constrained to 0..11 can wrap with increment/compare/reset; that is not a general replacement for arbitrary value % 12. Preserve exact semantics, ranges, overflow behavior and side effects before measuring a change.
Separate cold initialization/setup from hot per-frame work. Avoid redrawing unchanged HUD values or rebuilding every screen/color RAM cell each frame; update dirty cells or changed rows, and keep animation updates separate from static layout. Use uint8_t, int8_t, uint16_t and wider types deliberately. Web64's int is 16-bit; byte storage does not prevent C integer promotion. Signedness and intermediate width can change both results and cost.
Expensive initialization may be acceptable, but visible partial construction usually is not. Prepare state before revealing it, keep the old screen visible while safe independent data is prepared, or deliberately blank the display during a transition and restore it only when screen, colors and charset state agree. Choose a strategy compatible with the project's VIC bank, memory ownership and interrupts. An off-screen buffer is optional, not a universal double-buffering requirement; account for the memory and reveal/copy cost. Do not blank or disable interrupts indiscriminately just to hide slow per-frame work.
Measure important paths with Generated ASM and the opt-in Cycle / Raster Profiler. Distinguish observed instruction/stall costs from inferred routine attribution, use the matching build, and compare representative branch paths. Manual cycle counts must include branch/page-cross behavior and display/IRQ interference where relevant. Source-level operation counts alone are not performance measurements. MCP can discover this guidance and inspect generated/build contracts; profiling and emulator execution remain normal human IDE actions, not new MCP controls.
Switch statements
Web64 C supports compact integer switch dispatch for state machines, menus, and asset-kind routing. The compiler emits a linear compare/branch sequence and generated labels such as __web64_c_case0_... and __web64_c_switchend_...; it does not pull in the cc64 runtime switch helper or cc65 code movement.
uint8_t mode;
uint8_t color;
void main(void) {
switch (mode) {
case 0:
color = 6;
break;
case 1:
color = 14;
break;
default:
color = 1;
break;
}
}
Case labels must resolve to numeric constants or defines. Duplicate case values and duplicate default labels are errors. Fallthrough is preserved when a case omits break.
Pragmas, attributes, and calling conventions
Web64 C uses a registry for pragmas and attributes so source annotations either map to a known Web64 behavior or produce a stable diagnostic.
Supported or recognized forms are:
| Form | Current behavior |
|---|---|
#pragma charset("encoding") | Selects ascii, petscii, screencode, petscii_mixed, or screencode_mixed compile-time encoding for subsequent string literals. ascii is the default and restores ordinary C bytes. No conversion helper is linked. |
#pragma web64 ... | Recognized as a Web64-owned control surface and reported with c-pragma-web64-registry until a specific behavior-changing control is implemented. |
#pragma warn(...) and #pragma cc64 ... | Compatibility no-op warnings. |
#pragma optimize(...) | Recognized as an optimization-control request; project build settings and optimizer trace remain authoritative. |
#pragma bss-name, data-name, rodata-name, code-name | Rejected with c-unsupported-pragma; Web64 does not execute native cc65 segment/linker behavior. |
_fastcall | Accepted as a source-level hint for currently supported declarations/functions. |
cdecl / __cdecl__ | Native cc65 cdecl remains rejected with c-cdecl-deferred. Web64's independent stack ABI is selected by project configuration, not a cc65 annotation. |
interrupt / __interrupt__ | Rejected with c-interrupt-deferred until vector and register preservation policy is implemented. |
__attribute__((unused)) | Diagnostic-only recognized annotation. |
__attribute__((noreturn)) | Diagnostic-only control-flow annotation. |
Unknown attributes are errors. This is intentional: Web64 C should not suggest that cc65 or hosted C annotation semantics are active unless the browser-local compiler has executable support for them.
Compile-time C64 string encoding
The setting applies to subsequent string literals, including literal call arguments, and can be reset with #pragma charset("ascii"). It changes emitted bytes, not the VIC-II font selection or the bytes received from the keyboard.
| Encoding | Printable source mapping | Intended use |
|---|---|---|
ascii | No conversion; the default | Ordinary byte strings and explicitly supplied data |
screencode | Both A-Z and a-z become 1-26; other byte values remain unchanged | Existing uppercase-font screen strings; compatibility behavior is retained |
petscii | a-z become 65-90; other byte values remain unchanged | Existing uppercase PETSCII-compatible strings; compatibility behavior is retained |
screencode_mixed | a-z become 1-26, A-Z become 65-90; full assembler mixed-screen punctuation mapping | Direct screen RAM text displayed with the lower/uppercase character ROM font |
petscii_mixed | a-z become $41-$5a, A-Z become $c1-$da; _ becomes $a4 | Mixed-case PETSCII strings, matching the assembler's petscii_mixed encoding |
The two explicit mixed modes match the assembler for printable source characters. In screencode_mixed, @ is screen byte $00, [, \\, ], ^ are $1b-$1e, and _ is $64. Spaces and digits retain their familiar bytes. The glyph shown for a punctuation byte depends on the selected C64 charset; these modes are byte-oriented C64 mappings, not a Unicode font translator.
Numeric escapes such as \x41, \xff, \101 and \0 are literal target bytes in every mode. Named control escapes such as \n, \r and \t also retain their C byte values (10, 13 and 9). Escaped printable punctuation, including \\, still follows the selected character mapping. High-byte literals have the same representation in arrays and pooled call arguments; they are not expanded to UTF-8.
#pragma charset("screencode_mixed")
const char title[] = "Document Editor";
const char rows[] = "Open\377Save\377Close"; /* application-defined $ff separator */
#pragma charset("ascii")
The generated arrays already contain screen codes, so no startup loop or conversion routine is linked. Only use a separator such as $ff if the receiving routine explicitly implements it. C hex escapes consume all following hex digits: \xffClose includes the C in the escape. The fixed three-digit octal form \377 avoids that ambiguity. In mixed screen codes lowercase j is byte 10, so a screen-text routine cannot also treat byte 10 as an unambiguous line delimiter. Likewise, @ produces byte 0; a normal NUL-terminated C string routine stops there. Use a length-aware renderer when all screen-code values must be displayable.
Quoted character constants such as 'A', 'a' and '\n' are not affected. Unknown encoding names produce explicit errors; the C64 encoding modes also reject source characters beyond their byte-oriented mapping. The directive is #pragma charset, not #pragma charmode.
Adjacent string literals compose into one string in arrays and ordinary or nested call arguments, including literals produced by macros. Each fragment is decoded separately before composition, so "\xff" "Close" emits the exact $ff separator followed by the encoded word; the C cannot become part of the preceding hex escape. Whitespace, comments and source-line breaks may separate fragments without inserting bytes. This permits long messages to remain readable in source without a runtime concatenation step.
Include resolution
C includes are virtual includes. These forms are accepted:
#include <stdint.h>
#include <c64.h>
#include "include/game.h"
#include "assets/generated.h"
The resolver rejects absolute host paths such as C:/..., /home/..., \\server\..., and file: URLs. Put headers into the Web64 virtual filesystem and include them by project-relative path.
The C90 profiles apply trigraph replacement, escaped-newline splicing, comment replacement, conditional preprocessing, macro replacement, stringification, token pasting, and tokenization before the specialized declaration parser. Conditional groups preserve line positions for diagnostics, and bundled headers use include guards so repeated or transitive includes do not duplicate declarations. Host compiler extensions and host filesystem preprocessing are never imported implicitly.
Function-like statement macros can use the usual do { ... } while (0) form. They remain a single controlled statement in if (...) MACRO(...); else ..., while and for bodies. Macro authors must still avoid evaluating an argument more than once when that argument can have side effects; wrapping statements does not itself make repeated argument use safe.
assets/generated.h is generated from project asset records at compile time. It exposes deterministic C-safe start/end labels, _size constants, and numeric _kind constants. Asset records keep their browser-local generated-record placement metadata; no native linker script or object segment is introduced.
Bundled virtual headers
Web64 C bundles a small read-only SDK. These headers are resolved from web64://c/include/... before project-local include lookup, except assets/generated.h, which is regenerated from the current project asset records during the build.
| Header | Includes |
|---|---|
stdint.h | Exact 8/16/32-bit aliases, intptr_t/uintptr_t, intmax_t/uintmax_t, least/fast aliases, and supported integer limits. The stack ABI supports 32-bit arithmetic, arguments, and returns; the compatibility ABI retains its 8/16-bit call boundary. |
stddef.h | 16-bit size_t, signed 16-bit ptrdiff_t, and NULL. |
limits.h | Implementation limits for the 8-bit char, 16-bit short/int, and 32-bit long data model. |
float.h | IEEE binary32/binary64 storage characteristics. Constant expressions are folded; nonconstant floating arithmetic currently emits c-floating-runtime-unsupported rather than incorrect integer lowering. |
stdarg.h | Stack-ABI va_list, va_start, va_arg, and va_end lowering over declaration-order argument slots. |
stdbool.h | bool mapped to _Bool, true, false, and __bool_true_false_are_defined. Stores to _Bool normalize to exactly zero or one. |
string.h | Executable tiny-runtime implementations of memchr, memcmp, memcpy, overlap-safe memmove, memset, strcat, strchr, strcmp, strcpy, strcspn, strlen, strncat, strncmp, strncpy, strpbrk, strrchr, strspn, and strstr. |
stdio.h | Executable blocking getchar, puts/putchar, plus restricted compiler-lowered printf; unsupported file I/O and fprintf/sprintf names are absent from callable headers. |
stdlib.h | Executable abort, 16-bit abs, whitespace/sign-aware decimal atoi, byte-valued rand, and seedable srand; RAND_MAX is 0x00ff. |
ctype.h | Executable ASCII isalnum, isalpha, iscntrl, isdigit, isgraph, islower, isprint, ispunct, isspace, isupper, isxdigit, tolower, and toupper. |
libc.h | Aggregate convenience header that includes stddef.h, stdio.h, stdlib.h, string.h, and ctype.h; it contains no CC64 fixed-address declarations. |
c64.h | C64 memory map constants, typed register structs, pointer aliases, VIC-II, sprite, SID, CIA, keyboard, joyport, color, screen, and KERNAL constants. |
c64lib/common.h | Dependency-linked Web64-native memory copy, fill, screen fill, RLE, and optional Exomizer P39 decrunch routines. |
c64lib/chipset.h | CIA, memory-banking, nine-bit raster, and sprite-position compatibility declarations. |
c64lib/bitmap.h | Official six-byte bitmap tile-configuration layout. |
c64lib/vic2.h | Familiar c64lib VIC-II names mapped onto the Web64 c64.h hardware contract. |
c64lib/sprites.h | Sprite register-address and mask helpers plus the chipset positioning routines. |
c64lib/text.h | Character output, hexadecimal output, 40x25 scrolling, 2x2 tile drawing, and the stateful Tile2 runtime. |
c64lib/copper64.h | Four-byte copper-list entries, the 22 official handler IDs, and adapted start/stop routines. |
c64lib/magic-desk.h | Magic Desk cartridge target and bank-copy declarations. |
c64lib/64spec.h | Browser-native assertions and the machine-readable test-result block. |
conio.h | cc65-familiar console/color macro shim over Web64 screen/stdout helpers. |
joystick.h | cc65-familiar joystick macro shim over the Web64 joyport helper surface. |
6502.h | CPU memory-access and simple opcode macro shim through Web64 inline assembly. |
cbm.h | Dependency-linked low-level KERNAL status, channel, load, and save wrappers. |
joy.h | Joystick helper declaration for joy_read(). |
sprite.h | Sprite helper declarations for sprite_enable(), sprite_set_pos(), and sprite_set_color(). |
web64.h | Small Web64 helper declarations for delays, random byte reads, screen clearing/cursor output, text output, byte plotting, and zero-parameter void calls by address. |
web64/assets.h | Web64 Asset Model v1 public typedefs, kind/mode/flag macros, immutable descriptor structs, and mutable runtime instance structs. |
web64/disk.h | Dependency-linked whole-file and streaming disk I/O, disk markers, and IDE-assisted disk-set requests. |
assets/generated.h | Generated C declarations for project assets and media, including deterministic asset descriptors and disk/file/set constants. |
The headers are intentionally compact. Every function declared by the bundled standard-library headers above has either an executable dependency-selected runtime implementation or the documented compiler lowering. Including them does not make the full cc65 or hosted C library available. Runtime-owned parameter slots are emitted once for a whole multi-module build, so repeated guarded includes and calls from multiple translation units do not create duplicate labels. The Web64 SDK tree opens headers as read-only web64://c/include/... documents. It also exposes bundled assembler .inc files as read-only web64://asm/include/... documents in assembly and mixed projects. Both document types retain per-file cursor/scroll state, support navigation and search, and can be copied into include/ when a project-specific editable variant is needed.
Standard headers use extern function declarations because the implementation is outside the header. extern does not assign a fixed address. Calling memcpy, for example, selects web64-runtime/string.asm; including string.h without calling a string function adds no string runtime code. libc.h is retained for source compatibility as an aggregate include, but new code may include the specific standard headers it uses.
The memory helpers use indexed 256-byte page kernels with bounded tails. memset, memcpy, and memmove preserve zero-length behavior and return the original destination; memmove retains forward/backward overlap safety. Each helper links only its own parameter storage and reachable implementation, so memcpy no longer accidentally includes memset. Public declarations and ordinary C calling conventions are unchanged. Native Web64 game libraries retain their separate exact-width _web64_rt windows and direct assembly entry points.
c64lib compatibility from C
c64lib headers are available only when the matching compatibility module is selected for the active Build Target. Dependencies are automatic: Text selects Common and Chipset; copper64 selects Common and Chipset; Magic Desk selects Common and Chipset; and 64spec selects Common and Text. A missing module produces a build diagnostic instead of silently accepting a declaration that cannot link. Merely selecting a module or including one of its headers adds no runtime bytes; a routine is linked only when referenced.
The C-facing routines use the target's canonical Web64 ABI. New C/c64lib targets default to web64-stack-v1 unless the target explicitly selects another ABI. Legacy web64-static-v0 targets keep their existing static parameter slots. Web64 does not introduce a second c64lib calling convention. Handwritten optimized routines that use another register contract require a thin assembly wrapper.
#include <stdint.h>
#include <c64.h>
#include <c64lib/common.h>
#include <c64lib/chipset.h>
void main(void) {
c64lib_fill_screen((void*)0x0400, 32);
c64lib_set_vic_bank(C64LIB_BANK_0);
VIC->border_color = COLOR_BLUE;
while (1) {
}
}
The copper64 C list uses immutable four-byte C64libCopperEntry records. Call c64lib_disable_cia_interrupts() before c64lib_copper_start() when CIA interrupt sources would conflict. The V3 dispatcher installs through the KERNAL IRQ vector and implements all 22 handler IDs with direct dispatch. Timing contracts distinguish double-IRQ stabilized handlers, line-sequenced handlers, byte-semantic handlers, and PAL/NTSC raster-transition handlers; full raster bars remain badline-sensitive. C callbacks from a copper JSR entry must go through the assembly web64_c64lib_guarded_c_callback wrapper; arbitrary C runtime calls are not implicitly IRQ-safe.
The complete classification, source pins, migration rules, limitations, and license notices are in Web64-native c64lib compatibility. The machine-readable release contract is c64lib-compatibility-v3.json.
Dependency-linked disk I/O
Include <web64/disk.h> for high-level disk access. Literal names can use WEB64_DISK_NAME("NAME"), which supplies both pointer and byte length without a runtime strlen.
#include <stdint.h>
#include <web64/disk.h>
uint8_t load_level(void) {
return web64_disk_load(WEB64_DISK_NAME("LEVEL1"), 8, 0x4000);
}
uint8_t save_game(void) {
return web64_disk_save(WEB64_DISK_NAME("SAVEGAME"), 8, 0x5000, 0x5100);
}
web64_disk_load returns the KERNAL status and records the loaded end address for web64_disk_last_end. web64_disk_save saves [start_address, end_address). web64_disk_require verifies a generated USR marker before a level load. web64_disk_request writes an assisted swap request but does not replace marker verification in portable code.
Streaming I/O uses a caller-chosen logical file and explicit device number. A program can keep its application disk on device 8 while opening document files on device 9; logical file numbers and device numbers are independent. Open the channel, read or write bytes, then close it. web64_file_read stores a byte only after successful channel selection and input. WEB64_DISK_STATUS_EOI can accompany the final valid byte and is not equivalent to device-not-present.
uint8_t value;
uint8_t status = web64_file_open(WEB64_DISK_NAME("TABLE,S,R"), 2, 8, 2);
if (status == WEB64_DISK_OK && web64_disk_last_error() == 0) {
/* Check this drive's DOS channel 15 before treating OPEN as success. */
do {
status = web64_file_read(2, &value);
if (web64_disk_last_error() != 0) break;
if (status != WEB64_DISK_OK && status != WEB64_DISK_STATUS_EOI) break;
/* value is valid here, including on the final EOI byte */
} while (status == WEB64_DISK_OK);
}
web64_file_close(2);
Native disk errors have three independent domains; check all relevant domains before adopting data or reporting a successful save:
- The existing API return is unchanged: READST transport flags, a received byte, or the loaded end address, according to the function.
uint16_t web64_disk_last_error(void)anduint16_t cbm_k_last_error(void)expose separate high-level-disk and direct-CBM KERNAL-call results. Zero means carry clear; a failure is$0100 | A. Bit 8 distinguishes every carry-set failure, including STOP with accumulator zero. The low byte is the original KERNAL accumulator, not a READST flag.- The responding drive's DOS channel 15 reports filesystem results such as 26 write-protected, 62 file not found, 63 file exists and 72 disk full. KERNAL OPEN can succeed with READST zero while DOS reports file not found. READST or the last-error accessor alone is therefore not a filesystem-success test.
The high-level latch is replaced by load/save/require/file-open/file-read/file-write operations. The direct-CBM latch is replaced by OPEN, CHKIN, CHKOUT, CHRIN, CHROUT, LOAD and SAVE. Each family is independent. READST, last-error accessors, CLOSE and CLRCHN do not erase the prior checked call error; cleanup has no defined KERNAL carry-error result. Read the relevant latch immediately after the operation, before another checked operation in that family. Failed input does not publish an error code as file data. On successful input, READST EOI ($40) still accompanies a valid final byte.
For printer output, check READST after transfer and final cleanup as well as after OPEN; the KERNAL carry-error accessor alone does not report printer sink failures. Emulated output backends retain write, flush and close failures. In KERNAL-trap mode, READST exposes even errors discovered only while closing the host output file, and a new job can recover after the sink is corrected. These failures are not drive DOS error numbers.
Virtual IEC has a remaining limitation: a host sink failure discovered only at CLOSE can leave guest READST zero, and merely changing the output path after a bus transfer failure does not reinitialize the bus. Zero READST therefore does not universally prove that printer output was persisted. A successful channel CLOSE is also not a page-eject command: printer-model controls and finishing/capturing a partially printed page are separate concerns. No browser printer capture/download interface is implied by the KERNAL wrappers.
web64_file_read and web64_file_write select the logical channel on each call and leave it selected. For a measured streaming workload, direct <cbm.h> calls can select once and transfer multiple bytes; check each transfer, then call CLRCHN before returning to keyboard/default-screen I/O. GETIN reads the currently selected input, not necessarily the keyboard. KERNAL IEC transfers are synchronous.
For recoverable document replacement, write a distinct unused temporary file, close it, inspect DOS status and verify its complete contents. Rename the old file to a distinct unused backup, then promote the verified temporary file. Check DOS status after each rename and preserve recoverable names on failure. This is not atomic replacement: power loss can leave the old document under its backup name. Do not silently scratch a user's existing temporary/backup file or use destructive overwrite to bypass a disk-full error. Keep the active document unchanged until a separately staged load has passed format, capacity, content and EOF validation.
Include <cbm.h> for direct KERNAL control when the high-level contract is not suitable. Its wrappers preserve stable C signatures while calling the ROM vectors. The linker emits only referenced wrappers and their parameter slots. Disk development metadata never consumes C64 program memory unless the program includes and calls the corresponding API.
Web64 fixed-point math
web64/fixed.h provides the browser-native Web64 fixed-point math surface. The public storage types are ordinary integer-backed C types so they can live in globals, structs, arrays, project files, generated assembly, and debugger metadata without a native object ABI.
| Type | Storage | Meaning |
|---|---|---|
web64_fix8_8 | signed 16-bit word | 8 integer bits and 8 fractional bits, scale 256. |
web64_ufix8_8 | unsigned 16-bit word | Unsigned 8.8 values, scale 256. |
web64_fix16_16 | signed 32-bit long | 16.16 constants, conversions, floor/to-int/fraction, and wrapping add/sub macros only. |
web64_ufix16_16 | unsigned 32-bit long | Unsigned 16.16 storage with the same macro-only v1 policy. |
web64_angle8 | unsigned 8-bit byte | One full turn is 256 units: 0=0, 64=90, 128=180, 192=270 degrees. |
Common 8.8 constants and conversions are macros. They do not pull fixed runtime modules by themselves.
| Name | Behavior |
|---|---|
WEB64_FIX8_ONE, WEB64_FIX8_HALF, WEB64_FIX8_MIN, WEB64_FIX8_MAX | Fixed 8.8 constants. |
WEB64_FIX8_FROM_INT(value) | Convert an integer value to 8.8. Typed 8-bit inputs lower directly to a zero fraction byte and the source integer byte, without a shift loop or helper call. |
WEB64_FIX8_TO_INT(value) | Convert 8.8 to integer by taking the high byte. |
WEB64_FIX8_FRACTION(value) | Return the low fractional byte. |
WEB64_FIX8_FROM_RATIO(n, d) | Compile-time ratio conversion; constant zero divisors report c-divide-by-zero. |
web64_fix8_floor, web64_fix8_ceil, web64_fix8_round | Macro-backed integer-style conversions. |
web64_fix8_add_wrap, web64_fix8_sub_wrap | Wrapping 16-bit fixed add/subtract macros. |
For a typed uint8_t or int8_t source, WEB64_FIX8_FROM_INT is recognized as byte placement rather than emitted as a shift sequence. The source byte becomes the integer byte and the fraction byte is cleared; the source is loaded first so assigning through overlapping storage remains correct:
lda source
sta destination+1
lda #0
sta destination
Implementation-backed 8.8 helpers are dependency-selected. Calling one helper pulls only the runtime module family it needs.
| Helper family | Public names | Runtime module |
|---|---|---|
| Multiply and interpolation | web64_fix8_mul, web64_fix8_mul_round, web64_ufix8_mul, web64_fix8_lerp | web64-runtime/fixed-mul.asm |
| Division | web64_fix8_div, web64_ufix8_div | web64-runtime/fixed-div.asm |
| Saturating/core helpers | web64_fix8_add_sat, web64_fix8_sub_sat, web64_fix8_abs, web64_fix8_min, web64_fix8_max, web64_fix8_clamp | web64-runtime/fixed-saturate.asm |
| Trigonometry | web64_sin8, web64_cos8 | web64-runtime/fixed-trig.asm |
| Vector/motion | web64_fixvec2_add, web64_fixvec2_sub, web64_fixvec2_scale, web64_motion2d_integrate | web64-runtime/fixed-vector.asm; scale also selects fixed multiply. |
The header also provides short 8.8 aliases for these implementation-backed helpers: f8_mul_round, f8_div, uf8_mul, uf8_div, f8_lerp, f8_abs, f8_min, f8_max, f8_clamp, f8_add_sat, f8_sub_sat, f8_sin, f8_cos, v2f8_add, v2f8_sub, v2f8_scale, and m2d_int. These are preprocessor aliases to the web64_* names, so they keep the same ABI, semantics, and runtime dependency selection. The f8/uf8 prefixes are reserved for the current 8.8 tier; future 16.16 helpers can use distinct 16.16 names.
Signed multiply truncates toward zero from the signed widened product. web64_fix8_mul_round rounds nearest half away from zero. Unsigned multiply selects the middle product bytes, equivalent to (a * b) >> 8. Division uses a widened numerator equivalent to a * 256 / b; dynamic fixed division by zero returns 0, while constant zero divisors in ratio macros are diagnostics. Overflow wraps for ordinary fixed storage and wrapping helpers; use the saturating helpers when clamp-to-range behavior is wanted. web64_fix8_lerp(a, b, amount) uses amount/256, so amount=255 is close to b but not exactly b.
The standard trig table is a deterministic 256-entry signed 8.8 full-wave sine table. web64_sin8(angle) returns the table value. web64_cos8(angle) uses the same table with a 64-unit phase offset. The exact endpoints include web64_sin8(64) == 0x0100, web64_sin8(192) == 0xff00, web64_cos8(0) == 0x0100, and web64_cos8(128) == 0xff00.
The editor's Insert > Table and Insert > Matrix tools import the same canonical quantizer used to build this compiler table. Signed and unsigned 8.8 output therefore uses identical scale-256 words and nearest/half-away-from-zero rounding. A 256-step generated sine table with amplitude 1, center 0, phase 0, and web64_fix8_8 output is bit-for-bit identical to the compiler's web64_sin8 table. Generated cyclic tables exclude the repeated turn endpoint, matching web64_angle8 values 0..255. These tools perform offline source generation only; they do not add runtime helpers, hidden assets, or program-memory metadata.
Fixed 16.16 support is intentionally smaller in v1. Use the WEB64_FIX16_* constants, integer/ratio conversion macros, floor/to-int/fraction macros, and wrapping add/sub macros for storage and constant-scale data. There are no public 16.16 multiply/divide helper names until executable 6502 helpers and differential tests exist.
Use named helpers for fixed multiply and division. Direct fixed-point operators such as web64_sin8(phase) * radius are rejected by the v1 compiler with c-unsupported-fixed-point-operator; write the operation explicitly:
#include <web64/fixed.h>
web64_fix8_8 x = WEB64_FIX8_FROM_INT(120);
web64_fix8_8 velocity = WEB64_FIX8_FROM_RATIO(3, 2);
void step(void) {
x = web64_fix8_add_wrap(x, velocity);
*(uint8_t*)0xd000 = WEB64_FIX8_TO_INT(x);
}
#include <web64/fixed.h>
web64_angle8 phase;
web64_fix8_8 radius = WEB64_FIX8_FROM_INT(24);
web64_fix8_8 offset;
void step(void) {
phase = phase + 2;
offset = web64_fix8_mul(web64_sin8(phase), radius);
*(uint8_t*)0xd000 = 160 + WEB64_FIX8_TO_INT(offset);
}
The fixed-point optimizer has a gated specialization pass. Constant helper calls fold to direct word materialization. Typed dynamic 8.8 operations by 0, 1, -1, and positive or negative powers of two lower to word copies, negation, or shifts when the transformation preserves the helper contract; dynamic web64_fix8_abs lowers to a sign test plus two's-complement negate and retains the INT16_MIN wrap result. Signed right shifts add an explicit negative-value bias so multiply by a reciprocal power of two and divide by a whole power of two still truncate toward zero. Unsigned division by a reciprocal power of two lowers to a wrapping left shift. A zero identity is used only when the discarded operand has no side effects. The runtime helper is removed only when every surviving lowered call requires it. Fixed specialization no longer reparses source: typed lowering records the decision and final lowered imports drive exact runtime closure.
The public examples repository contains source-backed projects for this section: c-fixed-subpixel-scroll, c-fixed-sine-lerp, and c-fixed-motion. These are portable .web64proj records and are compiled by the fixed-point regression harness.
c64.h hardware definitions
c64.h is the main low-level C64 hardware header. It exposes the same hardware through three compatible forms:
- Numeric addresses such as
VIC_BORDERfor explicit pointer casts, inline assembly, and address arithmetic. - Volatile register structures such as
VIC->border_color,SID->voice1_control, andCIA1->pra. - Typed matrix views such as
C64_SCREEN_ROWS[row][column].
All hardware structure members are volatile. A read or write therefore remains an observable hardware access and is not removed or merged by the optimizer.
Memory map and typed memory views
| Name | Value | Meaning |
|---|---|---|
C64_RAM_BASE | $0000 | Start of the 64 KiB CPU address space. |
C64_BASIC_START | $0801 | Conventional BASIC-start address used by BASIC-stub PRGs. |
C64_SCREEN_RAM | $0400 | Default 40x25 screen character RAM. |
C64_COLOR_RAM | $D800 | 40x25 color nybble RAM. |
C64_CHAR_ROM | $D000 | Character ROM address when the CPU memory configuration maps it in. |
C64_SCREEN_WIDTH | 40 | Default screen width in character cells. |
C64_SCREEN_HEIGHT | 25 | Default screen height in character cells. |
C64_SCREEN_CELL_COUNT | 1000 | Number of default screen/color cells. |
C64_IO_BASE | $D000 | Start of the I/O window when I/O is mapped in. |
C64_KERNAL_ROM | $E000 | Start of KERNAL ROM when mapped in. |
c64_reg8_t is the common unsigned 8-bit register type. The memory structures are:
typedef unsigned char c64_reg8_t;
typedef struct c64_cpu_port_registers {
volatile c64_reg8_t data_direction;
volatile c64_reg8_t data;
} c64_cpu_port_registers;
typedef struct c64_screen_ram {
volatile c64_reg8_t cells[1000];
} c64_screen_ram;
typedef struct c64_color_ram {
volatile c64_reg8_t cells[1000];
} c64_color_ram;
The corresponding typed aliases are:
| Name | Type/address | Use |
|---|---|---|
C64_CPU_PORT | volatile c64_cpu_port_registers* at $0000 | data_direction controls the 6510 port direction and data controls memory banking. |
C64_SCREEN | volatile c64_screen_ram* at C64_SCREEN_RAM | Flat access through C64_SCREEN->cells[index]. |
C64_COLOR | volatile c64_color_ram* at C64_COLOR_RAM | Flat access through C64_COLOR->cells[index]. |
C64_SCREEN_ROWS | volatile unsigned char (*)[40] | Matrix access through C64_SCREEN_ROWS[row][column]. |
C64_COLOR_ROWS | volatile unsigned char (*)[40] | Matrix access through C64_COLOR_ROWS[row][column]. |
C64_CHAR_ROM_GLYPHS | const unsigned char (*)[8] | Character-row access through C64_CHAR_ROM_GLYPHS[character][row]. |
The character ROM shares addresses with I/O. Change the 6510 memory configuration before reading C64_CHAR_ROM_GLYPHS, then restore it before accessing VIC-II, SID, CIA, or color RAM.
VIC-II structure
c64_vicii_registers maps $D000-$D02E in hardware register order:
typedef struct c64_vicii_registers {
volatile c64_reg8_t sprite0_x;
volatile c64_reg8_t sprite0_y;
volatile c64_reg8_t sprite1_x;
volatile c64_reg8_t sprite1_y;
volatile c64_reg8_t sprite2_x;
volatile c64_reg8_t sprite2_y;
volatile c64_reg8_t sprite3_x;
volatile c64_reg8_t sprite3_y;
volatile c64_reg8_t sprite4_x;
volatile c64_reg8_t sprite4_y;
volatile c64_reg8_t sprite5_x;
volatile c64_reg8_t sprite5_y;
volatile c64_reg8_t sprite6_x;
volatile c64_reg8_t sprite6_y;
volatile c64_reg8_t sprite7_x;
volatile c64_reg8_t sprite7_y;
volatile c64_reg8_t sprite_x_msb;
volatile c64_reg8_t control1;
volatile c64_reg8_t raster;
volatile c64_reg8_t lightpen_x;
volatile c64_reg8_t lightpen_y;
volatile c64_reg8_t sprite_enable;
volatile c64_reg8_t control2;
volatile c64_reg8_t sprite_y_expand;
volatile c64_reg8_t memory_setup;
volatile c64_reg8_t interrupt_status;
volatile c64_reg8_t interrupt_enable;
volatile c64_reg8_t sprite_priority;
volatile c64_reg8_t sprite_multicolor;
volatile c64_reg8_t sprite_x_expand;
volatile c64_reg8_t sprite_collision;
volatile c64_reg8_t data_collision;
volatile c64_reg8_t border_color;
volatile c64_reg8_t background_color0;
volatile c64_reg8_t background_color1;
volatile c64_reg8_t background_color2;
volatile c64_reg8_t background_color3;
volatile c64_reg8_t sprite_multicolor0;
volatile c64_reg8_t sprite_multicolor1;
volatile c64_reg8_t sprite0_color;
volatile c64_reg8_t sprite1_color;
volatile c64_reg8_t sprite2_color;
volatile c64_reg8_t sprite3_color;
volatile c64_reg8_t sprite4_color;
volatile c64_reg8_t sprite5_color;
volatile c64_reg8_t sprite6_color;
volatile c64_reg8_t sprite7_color;
} c64_vicii_registers;
VICII is a volatile c64_vicii_registers* at VIC_BASE ($D000); VIC is its shorter alias. Sprite X/Y members cover sprites 0-7. sprite_x_msb supplies bit 8 for all sprite X positions. control1, control2, and memory_setup control display mode, scrolling, raster bit 8, and VIC memory selection. Collision members are hardware collision latches.
Every VIC-II register also has a numeric address:
| Register group | Numeric constants |
|---|---|
| Base | VIC_BASE |
| Sprite positions | VIC_SPRITE0_X, VIC_SPRITE0_Y, VIC_SPRITE1_X, VIC_SPRITE1_Y, VIC_SPRITE2_X, VIC_SPRITE2_Y, VIC_SPRITE3_X, VIC_SPRITE3_Y, VIC_SPRITE4_X, VIC_SPRITE4_Y, VIC_SPRITE5_X, VIC_SPRITE5_Y, VIC_SPRITE6_X, VIC_SPRITE6_Y, VIC_SPRITE7_X, VIC_SPRITE7_Y, VIC_SPRITE_X_MSB |
| Display and raster | VIC_CONTROL1, VIC_RASTER, VIC_LIGHTPEN_X, VIC_LIGHTPEN_Y, VIC_CONTROL2, VIC_MEMORY_SETUP |
| Sprite controls | VIC_SPRITE_ENABLE, VIC_SPRITE_Y_EXPAND, VIC_SPRITE_PRIORITY, VIC_SPRITE_MULTICOLOR, VIC_SPRITE_X_EXPAND |
| Interrupt/collision | VIC_INTERRUPT_STATUS, VIC_INTERRUPT_ENABLE, VIC_SPRITE_COLLISION, VIC_DATA_COLLISION |
| Border/background | VIC_BORDER, VIC_BACKGROUND, VIC_BACKGROUND0, VIC_BACKGROUND1, VIC_BACKGROUND2, VIC_BACKGROUND3 |
| Shared sprite colors | VIC_SPRITE_MULTICOLOR0, VIC_SPRITE_MULTICOLOR1 |
| Per-sprite colors | VIC_SPRITE0_COLOR, VIC_SPRITE1_COLOR, VIC_SPRITE2_COLOR, VIC_SPRITE3_COLOR, VIC_SPRITE4_COLOR, VIC_SPRITE5_COLOR, VIC_SPRITE6_COLOR, VIC_SPRITE7_COLOR |
| Sprite pointers | VIC_SPRITE_POINTER_BASE points at the default screen's eight sprite pointer bytes at $07F8. |
Convenience aliases preserve familiar naming:
| Alias | Equivalent |
|---|---|
VIC_BORDER_COLOR | VIC_BORDER |
VIC_BACKGROUND_COLOR | VIC_BACKGROUND |
VIC_SPRITE_POINTERS | VIC_SPRITE_POINTER_BASE |
BORDER_COLOR | VIC->border_color |
BACKGROUND_COLOR | VIC->background_color0 |
SPRITE_ENABLE | VIC->sprite_enable |
SPRITE_MULTICOLOR | VIC->sprite_multicolor |
The 16 VIC-II palette values are:
| Value | Primary name | Compatibility alias |
|---|---|---|
0 | VIC_COLOR_BLACK | COLOR_BLACK |
1 | VIC_COLOR_WHITE | COLOR_WHITE |
2 | VIC_COLOR_RED | COLOR_RED |
3 | VIC_COLOR_CYAN | COLOR_CYAN |
4 | VIC_COLOR_PURPLE | COLOR_PURPLE |
5 | VIC_COLOR_GREEN | COLOR_GREEN |
6 | VIC_COLOR_BLUE | COLOR_BLUE |
7 | VIC_COLOR_YELLOW | COLOR_YELLOW |
8 | VIC_COLOR_ORANGE | COLOR_ORANGE |
9 | VIC_COLOR_BROWN | COLOR_BROWN |
10 | VIC_COLOR_LIGHT_RED | COLOR_LIGHTRED |
11 | VIC_COLOR_DARK_GRAY | COLOR_GRAY1 |
12 | VIC_COLOR_GRAY | COLOR_GRAY2 |
13 | VIC_COLOR_LIGHT_GREEN | COLOR_LIGHTGREEN |
14 | VIC_COLOR_LIGHT_BLUE | COLOR_LIGHTBLUE |
15 | VIC_COLOR_LIGHT_GRAY | COLOR_GRAY3 |
SID structures
c64_sid_voice_registers describes one seven-register voice and is useful when a routine receives or creates a pointer to a voice base:
typedef struct c64_sid_voice_registers {
volatile c64_reg8_t freq_lo;
volatile c64_reg8_t freq_hi;
volatile c64_reg8_t pulse_lo;
volatile c64_reg8_t pulse_hi;
volatile c64_reg8_t control;
volatile c64_reg8_t attack_decay;
volatile c64_reg8_t sustain_release;
} c64_sid_voice_registers;
c64_sid_registers maps the complete SID block at $D400:
typedef struct c64_sid_registers {
volatile c64_reg8_t voice1_freq_lo;
volatile c64_reg8_t voice1_freq_hi;
volatile c64_reg8_t voice1_pulse_lo;
volatile c64_reg8_t voice1_pulse_hi;
volatile c64_reg8_t voice1_control;
volatile c64_reg8_t voice1_attack_decay;
volatile c64_reg8_t voice1_sustain_release;
volatile c64_reg8_t voice2_freq_lo;
volatile c64_reg8_t voice2_freq_hi;
volatile c64_reg8_t voice2_pulse_lo;
volatile c64_reg8_t voice2_pulse_hi;
volatile c64_reg8_t voice2_control;
volatile c64_reg8_t voice2_attack_decay;
volatile c64_reg8_t voice2_sustain_release;
volatile c64_reg8_t voice3_freq_lo;
volatile c64_reg8_t voice3_freq_hi;
volatile c64_reg8_t voice3_pulse_lo;
volatile c64_reg8_t voice3_pulse_hi;
volatile c64_reg8_t voice3_control;
volatile c64_reg8_t voice3_attack_decay;
volatile c64_reg8_t voice3_sustain_release;
volatile c64_reg8_t filter_cutoff_lo;
volatile c64_reg8_t filter_cutoff_hi;
volatile c64_reg8_t filter_resonance;
volatile c64_reg8_t volume_filter_mode;
volatile c64_reg8_t pot_x;
volatile c64_reg8_t pot_y;
volatile c64_reg8_t osc3_random;
volatile c64_reg8_t env3;
} c64_sid_registers;
SID is a volatile c64_sid_registers* at SID_BASE. The first 21 registers are three identical seven-register voices. filter_cutoff_lo, filter_cutoff_hi, and filter_resonance configure the filter; volume_filter_mode combines master volume and filter mode bits. pot_x, pot_y, osc3_random, and env3 are readback registers.
Numeric SID addresses are:
| Group | Constants |
|---|---|
| Base | SID_BASE |
| Voice 1 | SID_VOICE1_FREQ_LO, SID_VOICE1_FREQ_HI, SID_VOICE1_PULSE_LO, SID_VOICE1_PULSE_HI, SID_VOICE1_CONTROL, SID_VOICE1_ATTACK_DECAY, SID_VOICE1_SUSTAIN_RELEASE |
| Voice 2 | SID_VOICE2_FREQ_LO, SID_VOICE2_FREQ_HI, SID_VOICE2_PULSE_LO, SID_VOICE2_PULSE_HI, SID_VOICE2_CONTROL, SID_VOICE2_ATTACK_DECAY, SID_VOICE2_SUSTAIN_RELEASE |
| Voice 3 | SID_VOICE3_FREQ_LO, SID_VOICE3_FREQ_HI, SID_VOICE3_PULSE_LO, SID_VOICE3_PULSE_HI, SID_VOICE3_CONTROL, SID_VOICE3_ATTACK_DECAY, SID_VOICE3_SUSTAIN_RELEASE |
| Filter/output | SID_FILTER_CUTOFF_LO, SID_FILTER_CUTOFF_HI, SID_FILTER_RESONANCE, SID_VOLUME_FILTER_MODE |
| Readback | SID_POT_X, SID_POT_Y, SID_OSC3_RANDOM, SID_ENV3 |
Control-register bit constants are SID_GATE, SID_SYNC, SID_RING_MOD, SID_TEST, SID_WAVE_TRIANGLE, SID_WAVE_SAW, SID_WAVE_PULSE, and SID_WAVE_NOISE. Combine one or more waveform bits with gate/control bits using |.
CIA, keyboard, and joystick structure
c64_cia_registers maps either CIA at $DC00 or $DD00:
typedef struct c64_cia_registers {
volatile c64_reg8_t pra;
volatile c64_reg8_t prb;
volatile c64_reg8_t ddra;
volatile c64_reg8_t ddrb;
volatile c64_reg8_t timer_a_lo;
volatile c64_reg8_t timer_a_hi;
volatile c64_reg8_t timer_b_lo;
volatile c64_reg8_t timer_b_hi;
volatile c64_reg8_t tod_10ths;
volatile c64_reg8_t tod_seconds;
volatile c64_reg8_t tod_minutes;
volatile c64_reg8_t tod_hours;
volatile c64_reg8_t serial_data;
volatile c64_reg8_t interrupt_control;
volatile c64_reg8_t control_a;
volatile c64_reg8_t control_b;
} c64_cia_registers;
CIA1 and CIA2 are typed volatile c64_cia_registers* aliases at CIA1_BASE and CIA2_BASE. pra/prb are the two data ports, ddra/ddrb select input or output per bit, timer members form the two 16-bit timers, tod_* is the time-of-day clock, and the final four members handle serial I/O, interrupts, and timer control.
Every CIA register also has a numeric address:
| CIA 1 | CIA 2 |
|---|---|
CIA1_PRA | CIA2_PRA |
CIA1_PRB | CIA2_PRB |
CIA1_DDRA | CIA2_DDRA |
CIA1_DDRB | CIA2_DDRB |
CIA1_TIMER_A_LO | CIA2_TIMER_A_LO |
CIA1_TIMER_A_HI | CIA2_TIMER_A_HI |
CIA1_TIMER_B_LO | CIA2_TIMER_B_LO |
CIA1_TIMER_B_HI | CIA2_TIMER_B_HI |
CIA1_TOD_10THS | CIA2_TOD_10THS |
CIA1_TOD_SECONDS | CIA2_TOD_SECONDS |
CIA1_TOD_MINUTES | CIA2_TOD_MINUTES |
CIA1_TOD_HOURS | CIA2_TOD_HOURS |
CIA1_SERIAL_DATA | CIA2_SERIAL_DATA |
CIA1_INTERRUPT_CONTROL | CIA2_INTERRUPT_CONTROL |
CIA1_CONTROL_A | CIA2_CONTROL_A |
CIA1_CONTROL_B | CIA2_CONTROL_B |
The keyboard matrix aliases are KEYBOARD_COLUMN_PORT, KEYBOARD_ROW_PORT, KEYBOARD_COLUMN_DDR, KEYBOARD_ROW_DDR, and KEYBOARD_ACTIVE_MASK.
JOYPORT_1 and JOYPORT_2 expose the CIA port addresses used by the two joystick ports. The input masks are JOY_UP, JOY_DOWN, JOY_LEFT, JOY_RIGHT, and JOY_FIRE. Joystick bits are active-low: JOY_ACTIVE_LOW is zero and JOY_RELEASED_MASK has all five input bits set.
The direct port-2 predicates JOY2_UP(), JOY2_DOWN(), JOY2_LEFT(), JOY2_RIGHT(), and JOY2_FIRE() read CIA1->pra. The value predicates JOY_UP_P(v), JOY_DOWN_P(v), JOY_LEFT_P(v), JOY_RIGHT_P(v), and JOY_FIRE_P(v) test a previously sampled port byte. A true predicate means pressed.
KERNAL entry points
The header provides numeric entry addresses rather than C wrappers. Call them through a compatible assembly wrapper or a supported zero-parameter indirect call only when the KERNAL ABI matches:
| Name | Address | Purpose |
|---|---|---|
KERNAL_SCNKEY | $FF9F | Scan the keyboard matrix. |
KERNAL_READST | $FFB7 | Read the current I/O status byte. |
KERNAL_SETLFS | $FFBA | Set logical file, device, and secondary address. |
KERNAL_SETNAM | $FFBD | Set filename pointer and length. |
KERNAL_OPEN | $FFC0 | Open a logical file. |
KERNAL_CLOSE | $FFC3 | Close a logical file. |
KERNAL_CHKIN | $FFC6 | Select an input channel. |
KERNAL_CHKOUT | $FFC9 | Select an output channel. |
KERNAL_CLRCHN | $FFCC | Restore default I/O channels. |
KERNAL_CHRIN | $FFCF | Read a character from the current input channel. |
KERNAL_CHROUT | $FFD2 | Write the accumulator to the current output channel. |
KERNAL_LOAD | $FFD5 | Load or verify through the configured logical file. |
KERNAL_SAVE | $FFD8 | Save a memory range through the configured logical file. |
KERNAL_GETIN | $FFE4 | Read one buffered input byte. |
KERNAL_PLOT | $FFF0 | Read or set the cursor position according to the carry flag. |
The KERNAL routines use register parameters, carry/status results, and shared KERNAL state. Prefer the Web64 SDK or an explicit assembly wrapper for calls that require parameters; a raw C function-pointer cast does not synthesize the KERNAL register ABI.
Web64 helper headers
The helper headers combine compiler-recognized operations, macros, and dependency-selected runtime functions. They are intended for compact C64 projects and provide direct register, KERNAL, SID, disk, graphics, input, timing, and utility interfaces.
#include <stdint.h>
#include <joy.h>
#include <sprite.h>
#include <web64.h>
uint8_t joy;
uint8_t rnd;
void main(void) {
clrscr();
gotoxy(0, 0);
cprintf("READY");
sprite_enable(1);
sprite_set_pos(0, 300, 100);
sprite_set_color(0, VIC_COLOR_LIGHT_GRAY);
joy = joy_read();
rnd = random8();
if (!(joy & JOY_FIRE)) {
plot_pixel(0x0400, 42);
}
delay_frames(2);
delay_ms(40);
}
plot_pixel(address, value) is byte-oriented in the current helper ABI: pass the target bitmap, screen, color, or other memory address explicitly. delay_ms() is frame-based and approximate.
VoidCall(addr) calls a zero-parameter void function at a literal, generated, or runtime 16-bit address:
#include <web64.h>
#include <assets/generated.h>
void main(void) {
VoidCall(title_play_address);
}
A constant address lowers to one absolute JSR. The address must refer to an initialized routine whose calling convention takes no parameters.
VoidCall is a function-like macro, so every .c translation unit that uses it must include <web64.h> itself; an include in another .c file is not project-global. A missing include produces c-implicit-function-declaration on the call line and blocks the build instead of emitting an unresolved _VoidCall. Repeating the exact macro definition produces a non-blocking c-macro-redefinition-identical warning for backwards compatibility. A different replacement definition produces the blocking c-macro-redefinition error. Warnings remain visible but do not prevent Start; only error diagnostics make a build unrunnable.
C runtime header examples
#include <stdint.h>
#include <stdbool.h>
#include <stddef.h>
uint8_t lives = 3;
bool running = true;
void main(void) {
lives--;
}
stdio.h declares blocking getchar, puts, and putchar for the tiny runtime, plus restricted compiler-lowered printf for string-literal formats with %d values. getchar waits on C64 KERNAL GETIN, does not echo, and returns the raw unsigned input byte widened to int; live keyboard input therefore does not return EOF. It performs no ASCII, PETSCII, or screen-code conversion. #pragma charset instead rewrites source string literals at compile time before a call such as puts, so it has no effect on bytes received by getchar. Input and output use their configured stdin and stdout backends, and each runtime module is linked only when a surviving call needs it. File I/O declarations and fprintf/sprintf are intentionally absent until they have executable implementations.
Screen and color RAM example
#include <stdint.h>
#include <c64.h>
void main(void) {
*(volatile uint8_t *)VIC_BORDER = VIC_COLOR_BLUE;
*(volatile uint8_t *)VIC_BACKGROUND = VIC_COLOR_BLACK;
*(volatile uint8_t *)C64_SCREEN_RAM = 1;
*(volatile uint8_t *)C64_COLOR_RAM = VIC_COLOR_WHITE;
}
The typed register aliases from c64.h can express chip register writes more clearly:
#include <c64.h>
void main(void) {
VIC->border_color = VIC_COLOR_BLUE;
VIC->background_color0 = VIC_COLOR_BLACK;
}
Joystick and sprite helper example
#include <stdint.h>
#include <joy.h>
#include <sprite.h>
uint8_t joy;
void main(void) {
sprite_enable(1);
sprite_set_pos(0, 80, 100);
sprite_set_color(0, VIC_COLOR_LIGHT_GRAY);
joy = joy_read();
if (!(joy & JOY_FIRE)) {
BACKGROUND_COLOR = VIC_COLOR_RED;
}
}
SID register example
#include <stdint.h>
#include <c64.h>
void main(void) {
*(volatile uint8_t *)SID_VOICE1_FREQ_LO = 0x11;
*(volatile uint8_t *)SID_VOICE1_FREQ_HI = 0x25;
*(volatile uint8_t *)SID_VOICE1_ATTACK_DECAY = 0x09;
*(volatile uint8_t *)SID_VOICE1_SUSTAIN_RELEASE = 0xf0;
*(volatile uint8_t *)SID_VOLUME_FILTER_MODE = 0x0f;
*(volatile uint8_t *)SID_VOICE1_CONTROL = 0x21;
}
0x21 is SID_WAVE_SAW | SID_GATE. Prefer the named constants in project code; immediate register values remain useful when matching a datasheet or an existing assembly routine exactly.
Web64 asset access from C
assets/generated.h is produced from the virtual project asset records at compile time. It is the supported C-facing contract for browser-local assets: C code can refer to deterministic labels, sizes, asset-kind constants, typed data aliases, read-only flags, and the implemented Asset Model v1 descriptor declarations/constants without hard-coding assembler names by hand.
Asset filenames normally retain their existing C-safe symbol stem. When linked assets intentionally share a stem, as with a CharPad import containing a charset, blockset, and map, Web64 assigns role-qualified public C prefixes such as _charset, _blockset, and _tilemap. The assembly payload labels remain _chars, _blocks, and _map, so existing generated .inc files and mixed C/assembly projects remain compatible while every alias, size macro, view, and descriptor in assets/generated.h stays unique.
The generated header makes asset labels visible to the C compiler and final assembler namespace. When generated C actually references an asset data label, a C-only build embeds that payload once on demand. A hybrid build reuses an existing assembly label or .incbin instead of emitting a duplicate. Descriptor- and size-only references do not embed payload bytes. Browser-local asset files remain the canonical project records; generated .inc and .sid outputs remain derived assets where the IDE pipeline creates them. SID Tracker generates one .sid binary and one .inc, not a duplicate .bin.
web64/assets.h and assets/generated.h expose the current Asset Model v1 descriptor shapes and generated descriptor constants for source-backed charsets/chars, sprite banks, blocksets, maps, and SID files. Descriptor member reads lower to project metadata constants, while a data-member or data-label reference selects the payload for embedding. These headers define the asset data contract; applying sprites or maps, decompression, overlays, and loader policy remain explicit project/runtime operations unless a documented helper provides them.
A Sprite Editor .spritepair.json record is descriptor-only. The C asset bridge uses the same shared schema validator as the editor, resolves the multicolor base and mono overlay banks, and emits a Web64SpriteOverlayAsset referencing both Web64SpriteAsset descriptors. It never embeds the JSON text. Missing or duplicate layer paths, wrong modes, zero/unequal frame counts, and more than 256 frames are build diagnostics. Referencing pair metadata alone links no runtime; using web64_sprite_render_asset_pair() selects only the direct sprite module, while <web64/sprite-mux.h> selects its independent PAL mux module.
Web64SpriteOverlayBinding records the installed frame-zero VIC pointers; the application remains responsible for copying and 64-byte-aligning both banks in the active VIC bank. Direct pair rendering validates both frame indices and pointer arithmetic atomically. PAL scheduling uses caller-owned 1–24-layer double buffers, 24-byte prepared display-list entries, and 16-bit scheduled raster positions, so line 300 cannot alias line 44. Commit prepares complete owned-slot VIC control snapshots and the IRQ consumes them through patched absolute-indexed low/high windows. Reuse admission reserves ceil((300 + 48 * layers + 63) / 63) PAL lines: seven for one layer and eight for an atomic pair. Alignment-swept fast intervals peak at 283/337 cycles; KERNAL entry plus the demonstrated acknowledgement wrapper yields 336/390-cycle end-to-end paths, still leaving the full 63-cycle safety line. The 49-cycle next-event dispatcher tail is faster than the bundled Copper64 76-cycle normal irqHandlersReturn + fetchNext reference segment. The preserving service keeps A/X/Y intact, while web64_sprite_mux_irq_service_fast() is available when an enclosing dispatcher already owns that register envelope. IRQ service follows the mux-owned armed boundary/event identity instead of treating the delayed current raster as the originating compare. The mux preserves unowned hardware slots, publishes only at the armed line-300 boundary, and leaves vector installation, interrupt acknowledgement/chaining, the game tick, and RTI to application code. The standalone sprite-multiplexer-overlay example verifies motion in every accepted logical entry over 120 consecutive complete PAL frames.
Supported C asset records are project-local records whose kind is one of asset, binary, blob, sprite, spritebank, spriteanimation, charset, char, tile, block, blockset, tilemap, map, sid, or source. Typical file extensions are .bin, .raw, .dat, .spr, .chr, .ch8, .blk, .blocks, .map, .w64map, and .sid. A .w64sid record is editable composition source, not a runtime C asset. Its generated .sid is selected for assets/generated.h; an older generated .bin remains a fallback only when the project has no generated .sid. Unsupported kinds produce a c-unsupported-asset-kind diagnostic instead of becoming silent zero addresses.
The built-in kind constants are provided by web64/assets.h and re-used by assets/generated.h:
#define WEB64_ASSET_MODEL_VERSION 0x0001
#define WEB64_GENERATED_ASSETS_VERSION 0x0001
#define WEB64_ASSET_ADDRESS_NONE 0x0000
#define WEB64_ASSET_REF_NONE 0x0000
#define WEB64_SPRITE_BLOCK_NONE 0xff
#define WEB64_ASSET_KIND_BINARY 1
#define WEB64_ASSET_KIND_CHAR 2
#define WEB64_ASSET_KIND_CHARSET 3
#define WEB64_ASSET_KIND_SPRITE_MONO 4
#define WEB64_ASSET_KIND_SPRITE_MC 5
#define WEB64_ASSET_KIND_SPRITE_OVERLAY 6
#define WEB64_ASSET_KIND_BLOCK 7
#define WEB64_ASSET_KIND_BLOCKSET 8
#define WEB64_ASSET_KIND_MAP 9
#define WEB64_ASSET_KIND_SID 10
#define WEB64_ASSET_KIND_SOURCE 11
Asset paths are converted into C-safe symbols from the file basename with the extension removed. Non-identifier characters become _, and names that do not start with a C identifier character are prefixed. For example, assets/sprites/player.spr becomes player, while assets/sprites/player ship.spr becomes player_ship. Duplicate basenames that normalize to the same C symbol produce c-duplicate-asset-symbol.
The physical data labels match the names generated by the IDE asset editors: <symbol>_chars for charsets, <symbol>_sprites for sprite banks, <symbol>_blocks for block sets, <symbol>_map for maps, and <symbol>_sid for SID files. Payload labels are flat mutable unsigned char[] declarations, so games can update material maps, collected-object cells, animation data, and other RAM-backed asset bytes directly while retaining compatibility with byte indexing, memcpy, assembly labels, and pointer arithmetic. Historical base names remain C aliases, so existing source using player continues to address player_sprites. End labels and typed Asset Model descriptors remain read-only metadata. The metadata contract retains the historical start/end names while also exposing the physical data/dataEnd labels to build tools.
Assets whose dimensions are known also receive mutable multidimensional views:
| Asset | Typed view | Shape |
|---|---|---|
| Charset | <data-label>_glyphs | [character][8-byte row] |
| Sprite bank | <data-label>_frames | [frame][64-byte slot] |
| Block set | <data-label>_grid | [block][row][column] |
| Map | <data-label>_rows | [row][column] |
Each family also has a <data-label>_view alias, a <data-label>_rank constant, and dimension-count constants such as _row_count, _column_count, _frame_count, or _character_count. Map views use uint16_t cells when the map's index width is two bytes; all other listed views use unsigned char. The views contain no copied data and create no C64 storage: they are typed projections over the same original payload label.
#include <stdint.h>
#include <assets/generated.h>
uint8_t block = level_map_rows[player_y][player_x];
uint8_t character = terrain_blocks_grid[block][tile_y][tile_x];
uint8_t pixels = font_chars_glyphs[character][pixel_row];
uint8_t sprite_data = player_sprites_frames[walk_frame][sprite_byte];
Runtime indexes use Web64-C's multidimensional row-major addressing. Constant indexes fold to direct payload offsets. As with ordinary Web64-C arrays, generated views do not add runtime bounds checks. Use the emitted descriptor and dimension constants when indexes can originate outside trusted game data.
For a sprite asset named player.spr, the generated header includes:
#define WEB64_ASSET_KIND_SPRITE_MC 5
extern unsigned char player_sprites[];
#define player player_sprites
extern const unsigned char player_sprites_end[];
#define player_end player_sprites_end
#define player_size 128
#define player_sprites_size player_size
#define player_kind 5
#define player_data player_sprites
#define player_bytes player_sprites
#define player_readonly 0
#define player_mutable 1
#define player_sprites_frames ((unsigned char (*)[64])player_sprites)
#define player_sprites_view player_sprites_frames
#define player_sprites_rank 2
#define player_sprites_frame_count 2
#define player_sprites_byte_count 64
Use the editor data label or _data/_bytes aliases when a routine needs an asset pointer. Use _size in initializers, conditions, copy loops, and bounds checks. Use _kind when one C source handles multiple generated assets.
#include <stdint.h>
#include <assets/generated.h>
uint16_t player_size_bytes = player_size;
const unsigned char *player_ptr = player_data;
void main(void) {
if (player_kind == WEB64_ASSET_KIND_SPRITE_MC) {
asm_load_player_sprite();
}
}
A binary/blob asset follows the same rules:
#include <stdint.h>
#include <assets/generated.h>
const unsigned char *blob_ptr = example_blob_data;
uint16_t blob_size = example_blob_size;
void main(void) {
if (example_blob_size) {
asm_use_blob();
}
}
Generated payload arrays and their typed views are writable in C. The compiler accepts a function call directly in a flat or multidimensional subscript and evaluates each index call once. The array object itself is still not assignable, and generated end labels and descriptor objects remain read-only.
#include <assets/generated.h>
unsigned char *ok = example_blob_data;
uint16_t next_offset(void);
uint8_t next_row(void);
uint8_t next_column(void);
void main(void) {
ok = example_blob_bytes; /* supported */
example_blob[next_offset()] = 1; /* supported; next_offset runs once */
level_map_rows[next_row()][next_column()] = 0;
example_blob = ok; /* diagnostic: an array object is not assignable */
}
For supported descriptor families, assets/generated.h also includes <web64/assets.h>, declares a typed <symbol>_asset descriptor, creates a <symbol>_descriptor alias, and emits constants derived from the source asset metadata. Descriptor member reads such as title_asset.load_address lower directly to constants and do not allocate a descriptor block or embed the payload by themselves. Referencing the descriptor's data member, a generated data label, or a _data/_bytes alias selects that payload for on-demand embedding when no project assembly label already supplies it.
#include <stdint.h>
#include <assets/generated.h>
uint16_t font_chars = font_char_count;
uint8_t font_multicolor = (font_mode == 2);
uint16_t player_frames = player_frame_count;
uint8_t player_payload = player_payload_bytes_per_frame; /* 63 visible bytes */
uint8_t player_record = player_bytes_per_frame; /* 64 stored bytes */
uint8_t terrain_cell_bytes = terrain_bytes_per_block;
uint16_t level_cells = level1_cell_count;
uint8_t level_index_width = level1_index_width;
void main(void) {
if (player_frames && level_cells) {
asm_prepare_assets();
}
}
The generated descriptor declarations have these public shapes where implemented:
extern const Web64CharsetAsset font_asset;
#define font_descriptor font_asset
#define font_char_count 256
#define font_bytes_per_char 8
#define font_mode 2
extern const Web64SpriteAsset player_asset;
#define player_descriptor player_asset
#define player_frame_count 2
#define player_bytes_per_frame 64
#define player_payload_bytes_per_frame 63
extern const Web64BlockSetAsset terrain_asset;
#define terrain_descriptor terrain_asset
#define terrain_bytes_per_block 6
extern const Web64MapAsset level1_asset;
#define level1_descriptor level1_asset
#define level1_cell_count 240
#define level1_index_width 2
extern const Web64SidAsset title_asset;
extern const unsigned char title_sid[];
#define title_descriptor title_asset
#define title_file_size 2980
#define title_c64_data_offset 124
#define title_c64_data_size 2856
#define title_c64_data (title_sid + 124)
#define title_payload (title_sid + 124)
#define title_payload_size 2856
#define title_load_address 4096
#define title_init_address 4096
#define title_play_address 4160
#define title_song_count 1
web64/assets.h defines descriptor and instance structs such as Web64CharAsset, Web64CharsetAsset, Web64SpriteAsset, Web64SpriteOverlayAsset, Web64BlockAsset, Web64BlockSetAsset, Web64MapAsset, Web64SidAsset, Web64Sprite, Web64SpriteOverlay, and Web64MapView. Web64SidAsset describes the complete PSID file and its C64 payload offset/size, load/init/play addresses, song selection, speed flags, and SID flags. Descriptor references use explicit 16-bit Web64AssetAddress payload-label addresses and Web64AssetRef descriptor-label addresses rather than public generated-label pointer initializers. Zero is reserved as WEB64_ASSET_ADDRESS_NONE/WEB64_ASSET_REF_NONE. Published SDK records continue to use explicit uint8_t kind, mode, cell-type, flag, and boolean fields so their ABI remains source- and assembler-readable; user records may use the bit-field contract below. Public enum ABI remains deferred.
In a hybrid project, assembly may explicitly import the complete SID file under the generated <symbol>_sid label:
title_sid:
.incbin "assets/music/title.sid"
The explicit import is optional for C-only projects because a C reference to title_payload selects title_sid for on-demand embedding. If the hybrid assembly already defines title_sid, the compiler reuses it.
#include <string.h>
#include <assets/generated.h>
void load_title_music(void) {
memcpy((void*)title_asset.load_address,
title_payload,
title_asset.c64_data_size);
}
title_asset.file_size and title_sid describe the complete PSID file, including its 124-byte header. Copying that pair directly to load_address is incorrect. The generated title_payload pointer skips c64_data_offset, and c64_data_size copies only bytes intended for C64 memory.
After the SID payload has been loaded and initialized, its generated zero-parameter play address can be called directly from C:
(*(void (*)(void))title_play_address)();
Constant targets lower to one absolute JSR; runtime uint16_t targets use a self-modifying call-site operand. An undeclared target such as title_play_address without #include <assets/generated.h> produces c-undeclared-identifier during C lowering instead of becoming a late undefined assembly symbol. Indirect calls with parameters remain diagnosed because an unknown target cannot use Web64's callee-owned ordinary parameter slots.
The same rule applies to copy arguments. A fabricated name such as enemy_sprites_any_symbol_blahblah produces c-undeclared-identifier on the C source line. A rejected call emits no partial argument pushes, so an invalid copy cannot silently corrupt the 6502 hardware stack.
The generated SID .inc can be imported by the assembly side of the same hybrid project. All macros from assets/generated.h are compile-time C metadata and are not re-emitted as assembler definitions; the generated .inc remains the assembly-side definition source. This prevents duplicate symbols when a loaded project contains an older generated .inc, while C expressions still fold the current asset-manifest values. Saving the W64SID asset regenerates both derived files; legacy tracker-generated includes are recognized by their generated-file marker, while genuine manual include overrides remain preserved.
The C-facing <symbol>_size is the complete PSID file size, while the W64SID assembly include retains its established <symbol>_size payload-size meaning. Use the unambiguous <symbol>_file_size and <symbol>_c64_data_size names when code needs to distinguish the complete PSID from its C64 payload.
The kind constants are descriptor categories, not broad payload buckets: char, charset, mono sprite, multicolor sprite, sprite overlay, block, block set, map, SID, source, and binary. Web64MapCellType reserves WEB64_MAP_CELL_CHAR and defines current block maps as WEB64_MAP_CELL_BLOCK. Sprite descriptor mode describes payload encoding; mutable Web64Sprite.flags controls the VIC-II instance bit, and helpers must reject applying an instance mode that does not match the asset payload. Sprite multicolor descriptor fields are defaults/compatibility metadata for the global $d025/$d026 registers, not per-instance storage. Source-backed v1 block payloads are row-major char-index bytes only; color/attribute layers stay absent until an explicit binary layout or separate addresses are implemented.
Use memcpy to copy a referenced payload to its runtime C64 address. Graphics labels use the same names shown by their IDE-generated assembly includes:
#include <string.h>
#include <assets/generated.h>
void main(void) {
memcpy((void*)0x2800, bumps_chars, bumps_size);
memcpy((void*)0x3000, c_joy_sprites, c_joy_size);
memcpy((void*)0x3100, bank_2_sprites, bank_2_size);
memcpy((void*)0x3400, enemy_sprites, enemy_size);
memcpy((void*)title_load_address,
title_payload,
title_asset.c64_data_size);
}
For explicit fixed placement, compression, loaders, or cycle-sensitive copies, assembly remains available and may define the same physical data label. The generated C projection detects that definition and does not append another copy of the asset.
Generated asset labels participate in the C build graph. The IDE build output view marks assets/generated.h as a read-only generated header and records asset-label dependencies from the header to the backing project asset. Descriptor-only access must not select asset helper runtime modules. Duplicate C-safe symbols, unsupported placement/address policies, stale generated metadata, and unsupported asset kinds are reported as diagnostics when detected.
Inline assembly example
#include <c64.h>
void wait_raster(void) {
asm("wait:\n lda $d012\n cmp #$80\n bne wait");
}
void irq_guard(void) {
asm volatile(R"(
sei
lda #$00
sta $d020
cli
)");
}
Inline assembly is emitted directly into the generated assembly module. Supported forms include asm("..."), asm volatile("..."), __asm__("..."), adjacent C string fragments, and simple R"(...)" raw string literals. GCC-style operand constraints and named operand substitution are not part of the current Web64 C subset; use constants, labels, or normal C statements around the assembly block. Keep labels unique if the inline block can be emitted more than once.
Mixed C and assembly
Use C for game state, control flow, data structures, hardware setup, SDK/runtime calls, and asset-driven logic. Use assembly where exact addressing modes, cycle counts, interrupt entry/exit, custom loaders, established music players, or a deliberately custom register contract matter.
void main(void) {
asm_init_irq();
}
A call to asm_init_irq() emits jsr asm_init_irq, so a project assembly file can define:
asm_init_irq:
sei
rts
Use this boundary for raster IRQs, music players, fast sprite movement, decompression, asset copies, and other routines that are better expressed directly in 6502 assembly.
Handwritten native assembly may also call any registered, externally visible Web64 runtime entry by its underscore-prefixed label. Selected assembly translation units participate in the same registry-driven exact-closure analysis as generated C, so the call below links only the sprite-multiplexer module and the dependencies declared for that entry:
example_irq_service:
jsr _web64_sprite_mux_irq_service_fast
rts
A declaration in a C header does not link code by itself. The selected assembly reference is the dependency evidence; comments are ignored, and a project assembly file that deliberately defines the same registered entry remains authoritative instead of receiving a duplicate runtime implementation. Entries with _web64_rt argument windows publish their named labels for assembly callers, while zero-argument and deliberately register-oriented entries can be called directly as shown above.
Declaring and passing parameters to assembly routines
Web64 C treats names beginning with asm_ as direct, unmangled assembly labels. The C call:
asm_copy_sprite();
emits:
jsr asm_copy_sprite
Declare the routine in a project header so the C source has a stable name, then define the same unmangled label in an .asm file:
/* game.h */
void asm_copy_sprite(void);
; routines.asm
asm_copy_sprite:
; assembly body
rts
Always provide a prototype when an assembly routine accepts arguments or returns a value. Under web64-static-v0, a prototyped ordinary asm_ call uses exact-width deterministic parameter labels: arguments are evaluated left-to-right, staged safely, and written immediately before JSR. Under web64-stack-v1, assembly callees receive the same software-stack frame layout as generated C and must follow the documented frame/cleanup contract; use _fastcall when a small register boundary is preferable. Byte arguments occupy one byte, word/pointer arguments occupy two little-endian bytes, and stack-ABI wide arguments occupy their declared width.
/* game.h */
#include <stdint.h>
void asm_set_sprite_color(uint8_t slot, uint8_t color);
#include "game.h"
void main(void) {
asm_set_sprite_color(0, 1);
}
; routines.asm
VIC_SPRITE0_COLOR = $d027
asm_set_sprite_color:
ldx __web64_fn_asm_set_sprite_color_param_slot_0
lda __web64_fn_asm_set_sprite_color_param_color_1
sta VIC_SPRITE0_COLOR,x
rts
The slot naming contract is __web64_fn_<function>_param_<parameter>_<base36-index>. A 16-bit parameter's low byte is at the label and its high byte is at label+1. Ordinary slots are static function-owned storage, so calls are non-reentrant and not interrupt-safe. A byte return value is placed in A; a 16-bit integer or pointer return uses A for the low byte and X for the high byte.
For a smaller direct-register boundary, declare a supported _fastcall shape. One byte argument arrives in A, one word/pointer argument arrives in A/X, and two byte arguments arrive in A then X:
_fastcall void asm_set_sprite_color_fast(uint8_t slot, uint8_t color);
asm_set_sprite_color_fast:
tay
txa
sta $d027,y
rts
Unsupported _fastcall signatures produce diagnostics. Shared C globals remain appropriate for persistent command blocks, multi-field return state, IRQ-facing mailboxes, and data that must remain visible between calls; external C globals use underscore labels such as _sprite_state. Legacy undeclared zero-argument asm_ calls remain accepted for existing projects, but arguments and return values require a declaration so the compiler can apply the correct ABI.
Web64 C expression and ABI contract
The expression frontend tokenizes, types, and parses expressions before lowering. Supported expressions include integer, floating, character, and string literals; identifiers; groups; casts; direct and indirect declared calls; prefix/postfix increment and decrement; unary +, -, ~, and !; compile-time sizeof; binary arithmetic, shifts, comparisons, bitwise/logical operators; comma and conditional ?:; supported assignments; fixed-size multidimensional indexes; typed pointer dereference; and struct/union member access backed by Web64 aggregate metadata. Floating constants and constant arithmetic are stored as IEEE binary32/binary64. Nonconstant floating conversion, arithmetic, comparison, and truth testing remain explicit errors until the software floating runtime is implemented.
Bit-fields
Web64-C supports named and unnamed bit-fields with 8- or 16-bit integer base types, including uint8_t, int8_t, uint16_t, int16_t, and their supported C integer spellings. Struct layout remains packed and padding-free. Consecutive bit-fields with the same allocation-unit width share that unit from least-significant bit upward in declaration order. A change between 8- and 16-bit base widths begins a new unit, as does a field that does not fit. An unnamed zero-width field ends the current unit. Union bit-fields all begin at bit zero.
typedef struct {
int8_t *pattern_array;
uint8_t *timing_array;
Enemy *enemy_struct;
Actor *actor_ptr;
uint16_t index : 10;
uint16_t negate_x : 1;
uint16_t negate_y : 1;
uint16_t flag_3 : 1;
uint16_t flag_4 : 1;
uint16_t flag_5 : 1;
uint16_t flag_6 : 1;
} Glenn;
In the Web64 ABI, the four pointers above occupy eight bytes and the final seven fields share one little-endian 16-bit unit, so sizeof(Glenn) is 10. index occupies bits 0-9 and the flags occupy bits 10-15. This layout is deliberate and assembler-visible; do not assume another C compiler chooses the same implementation-defined packing order.
Dot and arrow access, assignment, compound assignment, and prefix/postfix increment and decrement preserve the other bits in the allocation unit. Signed fields are sign-extended when read, and stored values are truncated to the declared width. Positional aggregate initializers initialize named bit-fields in declaration order and do not consume a value for unnamed fields. A bit-field is not an addressable object: unary & and sizeof on an individual bit-field diagnose. A bit-field write is an inline read-modify-write sequence and is not automatically interrupt-atomic.
Bit-field extraction and insertion are emitted inline and add no runtime dependency. Merely enabling compiler support adds no generated instructions, data, call overhead, or linked bytes to code that does not declare or access bit-fields. Ordinary aggregate members retain their existing direct byte/word loads and stores under both web64-static-v0 and web64-stack-v1.
Scalar 32-bit integer members retain all four bytes in constant global/local aggregate initializers and standalone direct or pointer-member assignments. Supported assignment values are integer constants, scalar integer variables, and matching-width calls (wide call boundaries require web64-stack-v1). Narrow signed values are extended from their captured value without rereading a volatile source; pointer destinations remain stable across a value call that changes the pointer. Other wide member expressions, explicit noninteger wide member initializers, and wide member assignment-as-an-expression produce blocking diagnostics instead of partial writes. This bounded store support does not add general wide aggregate-expression reads, aggregate copies, or runtime aggregate initializer lists; byte/word member behavior and both ABIs are unchanged.
Multidimensional arrays
Web64-C stores fixed-size arrays in standard C row-major order. Every dimension is an integer constant expression. Only the outermost dimension may be omitted, and only when an initializer supplies its size:
uint8_t map[25][40];
uint16_t frames[][2] = {
{0x1000, 0x1100},
{0x1200, 0x1300}
};
char labels[][8] = {"PLAYER", "ENEMY"};
Nested braces, brace elision, partial rows, and character-row strings are accepted. Unspecified elements are zero-filled and excess elements diagnose. Global arrays are emitted directly in row-major data. Local arrays use Web64-C's function-owned storage; an initializer is executed again whenever control reaches the declaration.
Each subscript removes one array dimension. In map[row][column], map[row] is a complete 40-byte row and the second subscript selects its byte. sizeof(map), sizeof(map[row]), and sizeof(map[row][column]) therefore produce 1000, 40, and 1 without evaluating index expressions. sizeof(uint16_t[2][3]) produces 12. size_t is the Web64 16-bit unsigned size type.
Arrays decay to pointers to their first element in value contexts, while sizeof and unary & preserve the complete array type. For a multidimensional array, the first element is a row:
uint8_t read_cell(uint8_t rows[][40], uint8_t y, uint8_t x) {
return rows[y][x];
}
uint8_t (*row)[40] = map + 4;
Array parameters adjust to pointer-to-array parameters. The equivalent explicit declaration is uint8_t (*rows)[40]. Pointer addition and subtraction scale by the complete pointee size, so advancing the pointer above advances 40 bytes. Arrays of structs, runtime-indexed struct elements, and multidimensional array members are supported.
Generated addressing folds constant indexes into direct label+offset operands. Runtime indexes use 16-bit row-major offsets; stride 1 removes scaling, power-of-two strides use shifts, and other constant strides use inline shift/add sequences. Function calls are valid index expressions for reads and writes, including generated asset views, and are evaluated once per subscript while the partial address is preserved. Runtime bounds checks are not inserted. Variable-length arrays and designated initializers are not supported and produce diagnostics. Individual objects must fit the 16-bit Web64 object-size model.
The integer model uses 8-bit _Bool, uint8_t, int8_t, char, and unsigned char; 16-bit uint16_t, int16_t, short, int, unsigned int, size_t, ptrdiff_t, and pointers; and 32-bit long, unsigned long, int32_t, and uint32_t. Plain char is signed. Integer promotions and usual arithmetic conversions use this rank/width model; signed byte identifiers, array elements, aggregate members, and function results are sign-extended before 16-bit arithmetic. Constant 16-bit multiply by 0, 1, -1, or a power of two lowers inline. Unsigned divide/remainder by a power of two use a logical shift or mask; signed divide uses a bias plus arithmetic shift to retain truncation toward zero, and signed remainder retains the dividend's sign. Other multiply/divide/remainder expressions keep the dependency-selected verified helpers. Thirty-two-bit add, subtract, bitwise operations, comparisons, shifts, multiply, divide, and remainder are lowered directly or through dependency-selected long helpers. The compatibility ABI rejects wide call boundaries; the stack ABI accepts wide objects and returns them through a hidden caller-provided pointer.
Function calls are clobber boundaries. Both ABIs evaluate arguments in declaration order. web64-static-v0 retains byte-exact temporary staging into deterministic function-owned parameter labels, including the established six-byte mixed-width (uint16_t, uint8_t, uint16_t, uint8_t) layout. web64-stack-v1 pushes contiguous argument bytes onto a downward software stack and lets the caller reclaim them after return. Its stack pointer is the zero-page pair $02/$03, and its frame pointer is $04/$05. Frames whose maximum local/parameter offset is below 256 use compact LDY #offset plus (frame),Y; larger valid frames use the wide address fallback and produce a performance warning. Caller cleanup can be combined with surrounding stack adjustments without changing callee code.
For variadic functions, argument zero occupies the lowest argument address and later arguments follow at increasing addresses. Default promotions are applied before materialization. va_start points immediately after the final fixed parameter, va_arg reads the requested promoted width and advances the pointer, and va_end has no runtime work. Fixed stack parameters and variadic slots therefore use the same declaration-order layout. The stack region and $02-$18 compiler-owned zero-page range are validated against project declarations and assembled memory ranges.
_fastcall remains available for zero arguments, one word/pointer argument in A/X, or two byte arguments in A then X. Ordinary byte returns use A and word/pointer returns use A/X. Stack-ABI values wider than two bytes use a hidden return pointer. Byte-returning compatibility helpers such as rand, putchar, and puts clear X for older callers. printf supports literal formats with %d arguments; unsupported specifiers and mismatched counts diagnose.
Function results may be a single-level pointer T *, const T * or T const *, where T is a supported scalar, void or a known aggregate typedef. Definitions and prototypes retain the pointee type and const qualification; the pointer itself remains a 16-bit A/X result and may be advanced. Writes through a const result and implicit conversion to a mutable pointer diagnose. Cast a void * result to a concrete pointer type before dereferencing it. Pointer-level qualifiers, volatile/restrict pointees and multiple pointer levels in return declarations remain unsupported and produce located errors. For a returned aggregate pointer, first store it in a named typed local and use local->field; computed call()->field access is not currently supported.
In the size profile, eligible compiler-owned stack-frame accesses may omit unnecessary Y and N/Z flag preservation when control-flow analysis proves those values unused. Both branch paths and loops are checked; unknown calls, opaque assembly and unsupported accesses retain conservative sequences. Each memory access remains in place once, including volatile accesses. This optimization adds no helper calls, RAM or ABI changes and leaves debug, balanced, speed and frame profiles unchanged.
The hidden return pointer is present even for a function with no C parameters. Wide results are delivered to the typed destination before any integer narrowing; assigning a 32-bit return to a byte or word keeps the low 8 or 16 bits, rather than interpreting A/X as a wide return. Direct and indirect calls, local destinations, indexed arrays, nested returns, and discarded wide calls preserve the same caller-cleanup contract. Floating-point storage returns preserve all four or eight representation bytes; this does not add nonconstant floating-point arithmetic or conversions.
Registered runtime argument windows (_web64_rt)
Web64 v2 adds _web64_rt for a bounded set of externally implemented SDK runtime declarations. It is not a general user-function attribute: C definitions, static declarations, variadic declarations, unregistered names, registry-signature mismatches, and combinations with _fastcall are errors. Ordinary user C and both existing C ABIs otherwise remain unchanged.
The native runtime registry owns the ordered argument names and exact byte widths. Every linked _web64_rt entry places one contiguous little-endian window immediately before the unchanged entry label and publishes these assembler symbols:
_function__arg_windowis the first byte of the window, and_function__arg_window_sizeis its exact byte count._function__arg_<name>names an argument, while_function__argNis its positional alias._function__arg_<name>__widthand_function__arg_<name>__offsetpublish its exact width and offset.- Existing
__web64_fn_<function>_param_<name>_<index>labels alias the same bytes, preserving handwritten callers that already used the documented generated parameter labels.
For example, web64_actor_batch_cull_fast(view, viewport, visible, status) publishes an eight-byte window at _web64_actor_batch_cull_fast__arg_window; its four named pointer arguments occupy offsets 0, 2, 4, and 6, and _web64_actor_batch_cull_fast follows at window address + 8. Handwritten assembly may populate the named labels and JSR _web64_actor_batch_cull_fast without reconstructing an offset convention.
Web64-C evaluates arguments from left to right. When every expression is proven safe for direct placement, it writes each exact byte directly to the named window and calls the runtime entry. If an argument has a C-visible side effect or otherwise cannot be safely placed while the window is incomplete, the compiler retains the ordinary stable materialization path and only publishes the window after every expression has been evaluated. The called kernel sees the same absolute parameter bytes either way.
Argument windows are caller-writable and callee-read-only for the duration of a call. They are mainline, per-function, and non-reentrant: populate the complete window before JSR, and do not call the same entry from an interrupt or nested argument evaluation until the first call has consumed it. A/X/Y/flags and each registry record's published scratch remain caller-save. The runtime still does not allocate game state, copy assets, apply palettes, begin/commit mux frames, or own interrupts.
The initial v2 registry pilot covers actor-batch phase and adapter entries, web64_sprite_mux_submit(), and the four web64_world_shift_*() primitives. Only the called entry's window participates in exact closure; uncalled windows add zero bytes. Both web64-static-v0 and web64-stack-v1 use the same external runtime-window contract. Direct-label performance measurements start at the runtime entry and exclude C argument marshalling; _web64_rt overhead is measured separately.
Function-pointer casts, named function-pointer objects, function-pointer typedefs, and callback parameters retain return/parameter signatures. Constant targets lower to direct absolute JSR; runtime targets patch a call-site operand immediately before JSR $ffff. Under web64-stack-v1, indirect calls materialize typed arguments and hidden wide-return pointers exactly like direct calls. The compatibility ABI keeps its established zero-argument indirect-call restriction. Unresolved identifiers and mismatched argument counts are blocking diagnostics.
Under web64-stack-v1, automatic locals and parameters use recursive frames and direct/mutual recursion is allowed within the configured stack bound. Static locals retain static duration outside those frames. Under web64-static-v0, locals and parameters remain function-owned static storage and recursive call cycles diagnose. The compatibility ABI reserves $02-$09; the stack ABI reserves $02-$18 for stack/frame pointers and pseudo-registers. Both reserve $fb-$fe for argument/pointer scratch. Conflicting __web64_zeropage(address) declarations are rejected and all ownership is exposed by the memory-layout report.
Across translation units, external functions and objects retain underscore-prefixed public labels. static definitions receive deterministic module-private labels. Multiple external definitions and conflicting assembler-visible macro definitions are errors. A configured entry must have external linkage; static main is rejected. A helper-only C build with no external entry remains a warning for compatibility with mixed projects that provide their own assembly startup.
Inline assembly is supported through string forms such as asm("..."), asm volatile("..."), and __asm__("..."). Inline assembly labels share the generated assembler symbol namespace; local labels beginning with @ are scoped by the compiler, duplicate labels diagnose, and collisions with generated C/runtime labels diagnose. Inline assembly is a clobber boundary; preserve values explicitly when crossing it.
#pragma charset performs compile-time string encoding. Supported #pragma warn, #pragma cc64, and #pragma optimize forms produce stable compatibility or optimization-control diagnostics. Segment/linker-effect pragmas such as bss-name, data-name, rodata-name, and code-name are unsupported diagnostics because Web64 does not run a native linker script.
Optimizer safety contract
Web64-C normalizes persisted and IDE settings into the versioned debug, balanced, size, speed, and frame profiles. debug disables optimization; the other profiles enable their documented pass gates and enforce build/function growth plus optional worst-case-cycle budgets. speed minimizes aggregate executed cycles, while frame requires bounded worst-case critical-path evidence and reports unknown when loops, indirect calls, or other path costs cannot be proven. Every pass reports its gate, proof, cost decision, and whether it transformed output or only analyzed it.
The optimizer uses authoritative logical 6502 records with calibrated byte and best/worst cycle costs. Typed IR models functions, blocks, values, canonical array/pointer shapes, ranges, calls, ordered volatile/hardware effects, unknown pointer aliases, and opaque assembly fences. The IR currently crosses a verified legacy-emitter bridge: scalar/CFG transforms and downstream analyses are retained in reports, while only individually verified typed-lowering/emitter and local backend rewrites mutate generated code. The report therefore keeps outputMutation: false until the typed selector passes the same both-ABI checkpoint.
Implemented emitted-code optimizations include local duplicate load/store/compare cleanup, safe temporary reload removal, jump/dead-record cleanup, ABI-owned zero-page addressing, profitable typed 16-bit constant arithmetic, fixed-point specializations, and constant builtin materialization. Literal strlen, constant signed abs, and constant ASCII ctype predicates/conversions can disappear before runtime composition. Exact public/private/data runtime closure is then rooted only in surviving lowered imports; raw-source scans and the former fixed-point preparse are not dependency authorities. Hardware-register and C volatile accesses remain ordered, opaque inline assembly is a fence, and analysis-only call/frame, placement, loop, and frame candidates are never reported as emitted transformations.
Compiler compatibility appendix
| Category | Status | Notes |
|---|---|---|
| Parser-backed scalar arithmetic and bitwise expressions | Implemented | Covered by the compiler regression suite and deterministic expression fuzzer. |
*, /, % | Implemented | Lower through dependency-selected arithmetic helper runtime modules. Divide by constant zero and INT_MIN / -1 diagnose. |
| Casts and integer promotions | Implemented for the shipped scalar subset | Explicit casts preserve width/signedness; unsupported cast shapes diagnose. |
| C90 translation and preprocessing | Implemented for the compiler profile | Trigraphs, line splicing, comment replacement, conditional groups, object/function macros, stringification, token pasting, #undef, and active #error are supported. |
| Declarations and linkage | Implemented for the shipped scalar/aggregate subset | Prototypes, lexical block locals, for initializer declarations, shadowing, parameters, extern, internal-linkage static, enums, and guarded multi-translation-unit headers are supported. Same-scope and duplicate external definitions diagnose. |
Nested calls and _fastcall runtime calls | Implemented | Call results are spilled across later calls according to the Web64 C ABI contract. |
printf %d materialization | Implemented | String-literal formats with matching %d arguments are supported. |
Arrays, decay, and sizeof | Implemented for fixed-size arrays | Multidimensional globals/locals, positional initializers, inferred outer dimensions, runtime indexes, row pointers, pointer-to-array parameters, array members, and unevaluated sizeof are supported. VLAs and designated initializers diagnose. |
| Aggregates, bit-fields, member access, and pointer aliases | Implemented for fixed-layout Web64 records | Structs use declaration-order byte offsets without implicit padding; unions overlay at offset zero. 8/16-bit integer bit-fields use the documented deterministic LSB-first allocation units. Arrays of aggregates and multidimensional aggregate members use the same row-major addressing model. |
| Bundled standard-library declarations | Implemented | Every callable declaration in string.h, stdio.h, stdlib.h, and ctype.h has executable runtime code or documented compiler lowering. |
| Typed pointers | Implemented for supported scalar, aggregate, and array pointees | 16-bit pointers preserve pointee shape, pointer-to-array indexes use row strides, and pointer addition/subtraction scales by pointee size. Other broad pointer operations remain limited. |
| Inline assembly | Implemented with Web64 scoping rules | GCC/ca65 operand constraints and native optimizer behavior are not implemented. |
| Runtime dependency selection | Exact public/private/data closure in optimized profiles | Final lowered imports root the native registry's recursive closure; raw-source evidence is diagnostic-only and cannot add code. |
| Recursion and reentrancy | Stack ABI implemented; compatibility ABI diagnosed | web64-stack-v1 uses recursive automatic frames. web64-static-v0 retains function-owned slots and diagnoses call cycles. |
| Native cc65 objects, libraries, linker configs, and host paths | Not applicable | Web64 is browser-local and lowers to Web64 assembler-compatible source. |
| 32-bit integer ABI and arithmetic | Implemented by web64-stack-v1 | Four-byte arithmetic uses direct lowering and adaptive multiply/divide helpers; wide returns use hidden caller pointers. |
| Floating point | Constant/storage subset | IEEE binary32/binary64 constants, constant arithmetic, copies, parameters, and hidden-pointer returns are represented; nonconstant arithmetic/conversion/comparison diagnoses until the software runtime is complete. |
Interrupt functions, native cc65 cdecl, full hosted libc, flexible arrays, and VLAs | Deferred or unsupported | These remain explicit diagnostics or outside the freestanding profile. |
Verified public examples
The governed web64-examples repository is the public example suite for Web64 C v1. c-compiler-conformance/c-compiler-conformance.web64proj prints PASS/FAIL for arithmetic, shifts, bitwise expressions, casts, nested calls, _fastcall runtime calls, and printf argument handling. tutorials/README.md links runnable projects for SDK headers, generated assets/generated.h, C64 register aliases, joystick helpers, sprite helpers, mixed C/ASM symbol behavior, runtime dependency boundaries, and unsupported-syntax diagnostics.
Web64 Game Runtime quick reference
The Game Runtime is composition-first. It never owns main(), never installs a hidden frame tick, and never links unrelated subsystems merely because a neighboring header was included. Call only the primitives your game needs, in the order your game loop owns.
| Need | Include | Primary calls/macros | Runtime closure | Does not imply |
|---|---|---|---|---|
| Shared Q12.4 positions and compact boxes | <web64/game.h> | WEB64_POS_FROM_PX, WEB64_POS_TO_PX, Web64GameBox | Header-only macros and types | Motion, collision, animation, sprites, actors |
| Hardware disk loading | <web64/loader.h> | web64_loader_init, web64_loader_read, web64_loader_load_raw, web64_loader_load_packed, web64_loader_unpack | Independently linked transport, raw, packed and decoder kernels | IRQ/vector ownership, music, display, caches, background loading, automatic KERNAL fallback |
| One-axis acceleration/braking and position integration | <web64/motion.h> | web64_motion_axis, web64_motion_steer_s16, web64_motion_integrate, web64_motion_clamp, web64_motion_wrap | Motion helpers only when called; literal cases may specialize inline | Collision, animation, sprites, actors |
| Bitmap setup and drawing | <web64/bitmap.h> | web64_bitmap_init, web64_bitmap_plot*, web64_bitmap_line*, web64_bitmap_rect*, web64_bitmap_ellipse*, web64_bitmap_flood_fill* | Only the called setup, pixel, line, shape, or flood module | Palette validity, hidden workspace, recursion, automatic screen/Color RAM palette rewrites |
| Authored delta/duration trajectories | <web64/trajectory.h> | web64_trajectory_validate, web64_trajectory_init*, web64_trajectory_step*, web64_trajectory_step_batch*, WEB64_TRAJECTORY_APPLY_* | Scalar execution exact-links web64-runtime/game-trajectory.asm; batch execution adds web64-runtime/game-trajectory-batch.asm and reuses the scalar module's private preparation/divider dependency; declarations, storage, and projection macros link neither | Actor ownership, Motion integration, collision, animation, sprites, mux |
| Material-map and AABB collision | <web64/collision.h> | web64_collision_material_at, web64_collision_probe_*, web64_collision_sweep_*, web64_collision_find_material_rect, web64_collision_map_write | Collision helpers only when called | Motion state, animation, rendering policy |
| Deterministic frame-tick animation | <web64/animation.h> | web64_animation_init, web64_animation_play, web64_animation_queue, web64_animation_tick, web64_animation_take_events | Animation player only | Motion, collision, sprite renderer |
| Direct eight-sprite and native pair rendering | <web64/sprite-runtime.h> | web64_sprite_renderer_init, web64_sprite_render, web64_sprite_render_asset_pair, web64_sprite_apply_overlay_palette, web64_sprite_render_attachment | web64-runtime/game-sprites.asm only | Animation playback, actors, multiplexer |
| PAL sprite multiplexing | <web64/sprite-mux.h> | WEB64_SPRITE_MUX_STORAGE, web64_sprite_mux_init, web64_sprite_mux_begin_frame, web64_sprite_mux_submit*, web64_sprite_mux_commit, web64_sprite_mux_irq_service, web64_sprite_mux_irq_service_fast | web64-runtime/game-sprite-mux.asm only | Direct renderer, IRQ vector/acknowledgement/RTI, hidden asset copying |
| Fixed-size actor pools | <web64/actors.h> | WEB64_ACTOR_POOL*, web64_actor_activate, web64_actor_deactivate | Actor helper only when activation/deactivation is called | Collision, animation, sprites, multiplexer |
| Open actor-batch pipeline | <web64/actor-batch.h> | web64_actor_batch_integrate_*, web64_actor_batch_animation_tick, web64_actor_batch_cull, web64_actor_batch_pairs_x, web64_actor_batch_build_commands, web64_actor_commands_*, web64_actor_batch_run_mux | Only the called phase or fused adapter and its exact dependencies | Allocation, a hidden game loop, hidden buffers, IRQ installation, asset copying |
| Optional fused helpers | <web64/game-compose.h> | web64_compose_motion_axis_integrate, web64_actor_motion_step | Exactly the primitives named by the helper | A framework update loop |
Typical explicit game-loop order:
- Read input and set intent/facing state.
- Apply motion primitives, or step authored trajectories and explicitly project their Q12.4 result into the game-owned Motion/Actor position storage.
- Run collision probes or sweeps, then apply game-owned responses.
- Tick animation players using the caller-owned frame tick.
- Render direct sprite states, or build and commit the next mux schedule.
- At the application-owned raster IRQ, acknowledge the source and call preserving
web64_sprite_mux_irq_service(), or callweb64_sprite_mux_irq_service_fast()when the enclosing dispatcher already preserved A/X/Y, before chaining or executingRTI.
Game Runtime flag groups:
| Group | Constants | Meaning |
|---|---|---|
| Material properties | WEB64_MATERIAL_SOLID, WEB64_MATERIAL_ONE_WAY, WEB64_MATERIAL_LADDER, WEB64_MATERIAL_HAZARD, WEB64_MATERIAL_TRIGGER, WEB64_MATERIAL_COLLECTIBLE, WEB64_MATERIAL_MODIFIER, WEB64_MATERIAL_USER | Bits stored in the 256-entry material-property table. |
| Collision contacts | WEB64_CONTACT_LEFT, WEB64_CONTACT_RIGHT, WEB64_CONTACT_CEILING, WEB64_CONTACT_FLOOR, WEB64_CONTACT_LADDER, WEB64_CONTACT_HAZARD, WEB64_CONTACT_TRIGGER, WEB64_CONTACT_COLLECTIBLE | Bits returned by collision probes, sweeps, and events. |
| Motion contacts | WEB64_MOTION_HIT_MIN_X, WEB64_MOTION_HIT_MAX_X, WEB64_MOTION_HIT_MIN_Y, WEB64_MOTION_HIT_MAX_Y | Boundary bits returned by clamp helpers. |
| Trajectory controls | WEB64_TRAJECTORY_NEGATE_X, WEB64_TRAJECTORY_NEGATE_Y, WEB64_TRAJECTORY_LOOP, WEB64_TRAJECTORY_PING_PONG, WEB64_TRAJECTORY_REVERSE | Per-instance traversal and mirroring over shared immutable pattern bytes. |
| Trajectory events/status | WEB64_TRAJECTORY_EVENT_SEGMENT, WEB64_TRAJECTORY_EVENT_LOOP, WEB64_TRAJECTORY_EVENT_DIRECTION, WEB64_TRAJECTORY_EVENT_COMPLETE, WEB64_TRAJECTORY_STATUS_* | Explicit deterministic transition events and checked-call outcomes. |
| Animation modes | WEB64_ANIMATION_LOOP, WEB64_ANIMATION_ONCE, WEB64_ANIMATION_PINGPONG, WEB64_ANIMATION_HOLD, WEB64_ANIMATION_HIDE | Sequence playback behavior. |
| Animation play policy/status | WEB64_ANIMATION_PLAY_IF_CHANGED, WEB64_ANIMATION_PLAY_RESTART, WEB64_ANIMATION_STATUS_COMPLETE, WEB64_ANIMATION_STATUS_HIDDEN | Caller-selected sequence switching and returned playback state. |
| Sprite flags | WEB64_SPRITE_VISIBLE, WEB64_SPRITE_MULTICOLOR, WEB64_SPRITE_EXPAND_X, WEB64_SPRITE_EXPAND_Y, WEB64_SPRITE_BEHIND | Direct renderer logical sprite-state bits. |
| Sprite mux status | WEB64_SPRITE_MUX_BUSY, WEB64_SPRITE_MUX_CAPACITY, WEB64_SPRITE_MUX_INVALID_FRAME, WEB64_SPRITE_MUX_PALETTE_MISMATCH, WEB64_SPRITE_MUX_UNSCHEDULABLE, WEB64_SPRITE_MUX_UNSUPPORTED_STANDARD | Explicit submission, scheduling, palette, and PAL/NTSC outcomes. |
| Actor storage options | WEB64_ACTOR_STORAGE_NONE, WEB64_ACTOR_STORAGE_ANIMATION, WEB64_ACTOR_STORAGE_SPRITE_BINDING | Storage-layout declarations only; they do not link animation or sprite runtime code. |
| Actor-batch pipeline facts | WEB64_ACTOR_MUX_PIPELINE_BOUNDS_STABLE, ANIMATION_TICKS_READY, DENSE_ACTIVE_IDS, ANIMATION_PRETICKED, PAIRS_PRECOMPUTED, STABLE_TOPOLOGY, STABLE_ORDER_IDENTITY, DENSE_MOTION_PREINTEGRATED | Caller-proven preparation facts that select measured fast paths. Supplying a false fact violates the _fast precondition; checked phase entry points retain validation. |
Hardware Loader Runtime
For synchronous raw/packed loading, the C and ASM ABI, transactional workspace, IRQ/music coexistence, SAVE/reinitialization and native disk authoring, see Web64 Hardware Loader Runtime. Its caller-owned memory and exact-link contracts apply to arbitrary applications, not only games.
Native Cartridge Runtime
For managed logical ROM resources and the expert physical bank/window API across Standard 8K, Standard 16K, Magic Desk and EasyFlash, see Web64 Native Cartridge Runtime. It documents C and web64/cartridge.inc assembly calls, generated resource handles, declared RAM ownership, status codes, and interrupt constraints.
Bitmap Drawing Runtime
The <web64/bitmap.h> runtime targets VIC-II standard bitmap memory: logical 320×200 hires pixels use indices 0–1 and logical 160×200 multicolor pixels use indices 0–3. Web64Bitmap is caller-owned and records the bitmap base, screen base, mode, background, VIC bank, D018 setup, and configured flag. web64_bitmap_configure() validates the VIC-visible layout without touching memory; web64_bitmap_init() additionally clears the bitmap, applies the caller palette, and activates the mode. Palette calls are explicit. Drawing calls never infer or rewrite palette assignments.
Imported PNG bitmaps in C
Import Bitmap... produces an editable charset and a character-index map. The charset contains reusable eight-byte bitmap cells; the map determines their position in the image. The import also creates a video-matrix plane and, for multicolor images, a Color RAM plane. Copying only <name>_charset to bitmap RAM copies the unique patterns once and cannot reproduce the displayed map.
After importing a 320×200 hires PNG named backdrop, save the project and use this C path. Include assets/generated.h and inspect its actual generated symbol names if the asset name differs. This example uses VIC bank 0, bitmap RAM at $2000, and screen RAM at $0400; keep the program and other assets clear of those addresses.
#include <stdint.h>
#include <web64/bitmap.h>
#include <assets/generated.h>
#define BITMAP_RAM ((uint8_t *)0x2000)
#define SCREEN_RAM ((uint8_t *)0x0400)
Web64Bitmap picture;
void main(void) {
if (web64_bitmap_configure(&picture, BITMAP_RAM, SCREEN_RAM,
WEB64_BITMAP_MODE_HIRES) != WEB64_BITMAP_OK) return;
if (web64_bitmap_load_map(&picture, &backdrop_tilemap_asset,
&backdrop_charset_asset) != WEB64_BITMAP_OK) return;
picture.background = backdrop_charset_background_color;
if (web64_bitmap_activate(&picture) != WEB64_BITMAP_OK) return;
while (1) {}
}
web64_bitmap_load_map expands the map's one- or two-byte cell indexes into bitmap RAM and copies the imported video-matrix plane to screen RAM. For a multicolor PNG, select WEB64_BITMAP_MODE_MULTICOLOR; the same helper also copies its Color RAM plane to $d800. The generated charset background-color constant supplies the import's shared background. The helper accepts a complete 40×25 bitmap-character map. Use the Map Editor's linked charset mode and assets/generated.h to confirm the mode and symbol names.
Assembly callers can include web64/bitmap.inc and use web64_rt_prepare_bitmap_load_map bitmap, map, charset to fill the six-byte _web64_rt argument window, or web64_rt_call_bitmap_load_map bitmap, map, charset to prepare it and call the routine. The editor's right sidebar shows these macro arguments as you type.
Checked plot, get, horizontal/vertical line, general line, rectangle, filled rectangle, and ellipse calls validate context, logical coordinates, pixel index, and operation. Their _fast counterparts require those preconditions. Replace and XOR are available for ordinary drawing. Dot and circle are transparent aliases for plot and equal-radius ellipse. The optimized general-line path canonicalizes endpoint order, selects a mode/operation/major-axis/minor-direction kernel, and advances the physical bitmap cursor incrementally. The independent benchmark covers both ABIs, both modes, shallow and steep octants, reverse endpoints, and horizontal lines; the maximum 319×199 hires diagonal measures 19,218 cycles under web64-static-v0 and 19,219 under web64-stack-v1, inside the 19,267-cycle acceptance gate.
web64_bitmap_flood_fill() and _fast() are intentionally replace-only in v1. Connectivity is four-neighbor against the logical source index read at the seed. The caller supplies a bounded Web64BitmapFloodWorkspace; there is no recursion and no hidden allocation. The checked entry validates the complete surface, seed, replacement, workspace descriptor, span extent, address wrap, and overlap with the context, bitmap, screen RAM, workspace descriptor, and Color RAM before mutation where possible. Each span is recorded before it is painted. Aligned span discovery and replacement compare and write complete bitmap bytes using the hires $00/$ff or multicolor $00/$55/$aa/$ff repeated-index patterns; adjacent byte columns advance by eight physical bitmap bytes, while irregular boundaries retain masked logical-pixel handling. If capacity is exhausted, every recorded span is restored through the same byte-oriented path to the original source index, workspace.used remains at the deterministic exhausted count, and status WEB64_BITMAP_WORKSPACE_EXHAUSTED is returned. Flood fill modifies bitmap bytes only and never changes screen RAM or Color RAM; the replacement index must already be valid for every affected cell palette.
WEB64_BITMAP_FLOOD_STORAGE(name, capacity) declares caller-owned span storage plus its descriptor, and WEB64_BITMAP_FLOOD_WORKSPACE_INIT(name, capacity) initializes the descriptor at run time. The flood benchmark is deliberately separate from line timing and covers small, fragmented, corridor, large-open, and near-full-screen regions for checked and fast calls in both bitmap modes, with an independent four-neighbor oracle and screen/Color RAM invariants.
Trajectory Pattern Runtime
A Web64TrajectoryPattern stores shared immutable 3-byte segments: signed pixel delta_x, signed pixel delta_y, and a 1–255-frame duration. Each caller-owned 19-byte Web64TrajectoryState carries independent Q12.4 position, traversal index/direction, prepared quotient/remainder, and centered error state. Forward, reverse, loop, ping-pong, X/Y mirroring, exact transition events, one-frame segments, and maximum-duration segments use the same public representation. Every segment reaches its exact mathematical endpoint; repeated loops cannot accumulate interpolation drift.
The optional first-class .w64traj authoring asset and independent Canvas Trajectory Editor compile to the same raw triplets; they do not change this runtime. The generated .traj contains no anchor, map, appearance, editor, or world metadata, and can be used from arbitrary caller coordinates by C, assembly, or custom code. The authoring source is never a runtime dependency. See Trajectory assets and Trajectory Editor for the generated-family and Tiled interchange workflow.
The selected 6502 strategy is measured generated-table hybrid preparation plus centered DDA. Duration one is direct, powers of two use shifts, duration three uses a complete generated quotient/remainder table (258 bytes), durations 5, 6, and 7 use compact fractional tables (10, 12, and 14 bytes), and duration 31 uses 5 integer bytes plus 62 fractional bytes. Other bounded durations retain exact arithmetic fallbacks. The fixed shared table set is therefore 361 bytes and the public state remains 19 bytes. On the representative 1,846-frame strategy gate the production hybrid measures 185,085 cycles, versus 202,494 for the zero-table hybrid, 207,028 for ordinary fixed preparation, and 245,959 plus 512 table bytes for reciprocal assistance. The tables are deterministically generated and exact-link only with scalar execution or the batch private-divider dependency; including declarations or allocating public trajectory storage links no table or runtime bytes.
web64_trajectory_step_batch() and web64_trajectory_step_batch_fast() advance up to 255 contiguous states in stable input order and write one event byte per state. The checked entry preflights the complete non-null, non-wrapping, non-overlapping state and event spans plus every state before mutation. The fast entry requires already validated lockstep states that share one immutable pattern, segment index, phase, and traversal mode; per-state X/Y negation may differ. Its RAM-resident self-modifying kernel is mainline-only and non-reentrant. It retains only patched operand addresses, detects caller-buffer relocation, and reconstructs every semantic decision from the public 19-byte states, so C or assembly may inspect or mutate those states between calls.
The strengthened eight-actor performance gate measures one direct-label batch call, excluding C argument marshalling and host-side pointer relocation while including JSR/RTS, transition preparation, public writes, and any required cold operand repatch. Its complete 24-variant matrix covers both C ABIs, four code origins, stable caller buffers, and both adverse $fb/$fc state/event low-byte arrangements. The current worst stable call is 3,481 cycles and the worst cold relocation/repatch call is 3,786 cycles. Both are below the 3,931-cycle practical acceptance gate (20% of a 19,656-cycle PAL frame); the cold case retains 145 cycles of headroom. The 4,914-cycle 25% line remains the absolute rejection ceiling, not the acceptance target.
Interoperability is explicit and additive. WEB64_TRAJECTORY_APPLY_BODY() projects a state into an existing Web64Motion2D; WEB64_TRAJECTORY_APPLY_POSITION() projects into caller-owned Actor Batch X/Y arrays. Both are transparent header-only assignments: they allocate nothing, hide no mirror, and link no adapter. Both ABI builds are byte-identical to spelling the same four public-buffer assignments by hand, so the convenience boundary adds no instructions, bytes, or calls. The scalar executor depends on no Actor, Motion, Sprite, or Mux module. Batch execution exact-links only game-trajectory.asm and game-trajectory-batch.asm; no Actor, Sprite, or Mux runtime is pulled in. A verified mixed pipeline steps trajectory state, publishes it into Actor SoA storage, culls, builds public sprite commands, and submits them to the mux with exactly five unique closures and neither redundant actor-motion nor direct-sprite code. Games may instead consume the same state from assembly or render it through the direct sprite runtime, as the standalone example does.
Every parameterized trajectory entry follows _web64_rt. web64/trajectory.inc owns the packed layout offsets, limits, masks, event bits, status constants, and standard web64_rt_prepare_trajectory_* / web64_rt_call_trajectory_* helpers; compatible web64_trajectory_prepare_* / web64_trajectory_call_* aliases remain. web64/runtime.inc is the optional whole-registry catalog for callable labels and exact-width named argument windows. The trajectory helpers expand to ordinary assembly, add no hidden storage or adapter, and unused helpers link no runtime. The independent Kick-compatible scalar oracle uses the same pointer-based public state contract. Across an origin/alignment sweep it measures 716,485 cycles. Web64 measures at most 676,801 cycles under web64-static-v0 and 676,782 under web64-stack-v1, including legitimate direct-label preparation and calls but excluding C argument marshalling: 39,684 cycles (5.539%) and 39,703 cycles (5.541%) of headroom. The trajectory-patterns example runs eight independently phased instances sharing one pattern, exercises every X/Y negation combination plus loop/ping-pong behavior, exposes the state to an assembly reader, and exact-links only game-trajectory.asm plus the deliberately selected direct sprite renderer. Its trajectory-patterns-asm companion uses a setup-only fast batch window in the native hot loop and proves the helpers preserve the existing sub-20% PAL measurements.
Native overlay pairs and PAL sprite multiplexing
A .spritepair.json file is an editor/compiler descriptor, not a runtime byte payload. The compiler applies the Sprite Editor shared validator, resolves one multicolor base bank and one mono overlay bank, and emits a Web64SpriteOverlayAsset that references both Web64SpriteAsset descriptors. Missing layers, duplicate paths, wrong modes, zero or unequal frame counts, and counts above 256 are compile diagnostics. Merely compiling pair metadata links no runtime and embeds no JSON bytes.
Web64SpriteOverlayBinding adds only the installed frame-zero VIC pointer values. The application must copy both 64-byte-aligned layer banks into the active VIC bank. web64_sprite_render_asset_pair() validates both independent frame indices and pointer additions before touching VIC state, applies descriptor colors, shares position/expansion/priority, forces the base to multicolor and overlay to mono, and places the overlay in the higher-precedence VIC slot. web64_sprite_apply_overlay_palette() is the explicit $d025/$d026 write.
The PAL mux is caller-owned and double buffered. Capacity is 1–24 physical layers; a pair consumes two and is always accepted or dropped atomically. begin_frame() opens the inactive buffer, submissions are ordered by descending priority then submission order, and commit() publishes one pending schedule. event_line, end_line, and per-slot interval ends are 16-bit raster positions, so line 300 cannot alias line 44. Commit converts accepted entries into 24-byte prepared display-list records, including complete owned-slot VIC control snapshots. Stable-topology adapters may publish a deterministic layout generation and refresh that schedule without rebuilding it. stable_identity_x_low is a public proof byte: the fused adapter sets it only after proving the viewport's entire representable VIC X range is below 256; stable commit may then omit the cumulative X-high scan. A generic or high-X schedule leaves it clear and uses the complete scan. The raster IRQ uses patched absolute-indexed low/high windows and direct stores rather than recomputing masks. Schedules with at most ten accepted entries patch only the live low operand window; larger capacities retain the complete low/high patcher. Reuse admission reserves ceil((300 + 48 * layers + 63) / 63) PAL lines: seven for one layer and eight for an atomic pair. The measured worst aligned fast intervals are 283 and 337 cycles; modeled KERNAL entry plus the example acknowledgement wrapper brings the end-to-end paths to 336 and 390 cycles, below the 378/441-cycle budgets that remain after the full 63-cycle safety line. The 49-cycle Web64 handler-tail-to-next-compare path beats the bundled Copper64 normal irqHandlersReturn plus fetchNext reference path of 76 cycles for that equivalent dispatch segment. IRQ dispatch follows the mux-owned armed compare identity, so entry latency cannot confuse line 300 with a later current raster value. A pending schedule is consumed only by the armed PAL line-300 boundary; without another commit, the active schedule repeats. NTSC initialization returns WEB64_SPRITE_MUX_UNSUPPORTED_STANDARD.
The mux updates only its owned hardware slots and owned bits in $d010/$d015/$d017/$d01b/$d01c/$d01d, plus their coordinates, colors, and pointer entries. $d025/$d026 are the active mux shared palette. The application retains the IRQ vector, source identification and $d019/CIA acknowledgement, chaining, game tick, and RTI. web64_sprite_mux_irq_service() preserves A/X/Y; web64_sprite_mux_irq_service_fast() clobbers them and is for a wrapper such as the KERNAL $0314 dispatcher that already owns the register envelope. Both paths use module-local absolute scratch rather than compiler zero page $02-$17 or call scratch $fb-$fe.
See the standalone sprite-multiplexer-overlay project in web64-examples for nine moving native overlay pairs rendered as eighteen physical layers. A compact unsigned 32-sample sine lookup supplies smooth side-to-side X coordinates at quarter-turn phase offsets, so the rows weave without linking the Motion runtime. Three pairs simultaneously fill the six owned slots and six later pairs exercise repeated two-slot reuse. Every pair supplies independent four-frame base and overlay indices; the runtime converts both pointers, preserves shared geometry, forces a multicolor base and mono overlay, and assigns the overlay higher VIC precedence. The final low-priority pair is dropped as one logical entry and two physical layers. Its live PAL gate requires 120 consecutive complete frames with no cherry-picking, exact frame/tick progression, the bounded bidirectional lookup wave and all four base/overlay frames in every active pair, at least forty bright mono-overlay pixels in every pair region, stable reserved HUD bytes, and the same deterministic atomic drop.
Open actor-batch runtime
Web64ActorBatchView points at the existing caller-owned active IDs and Q12.4 position, velocity, geometry, category, and mask arrays. Animation, sprite bindings, visible records, coherent X order, actor pairs, resolved render commands, bounds, and status remain separate public buffers. Capacities and actor IDs are at most 255. Native overlay pairs carry independent base and overlay frames but remain one atomic render command. Checked calls validate before mutation; _fast calls accept documented prepared layouts and use the same buffers. Every phase is an exact-closure module, so selecting motion does not link culling, pair generation, commands, or either renderer.
The X-sweep repairs caller-owned order deterministically by left edge and actor ID, applies symmetric category/mask filtering and half-open AABBs, emits each overlapping pair once, and reports predictable buffer overflow. Culling preserves active-ID order and emits only positions representable by the explicit camera viewport. Command building resolves all frame and pointer arithmetic before append, so a bad layer cannot expose half a pair. The direct adapter sorts by priority and stable order, touches only its owned slots, and gives an overlay the higher VIC precedence. The mux adapter submits resolved commands but never begins or commits a frame. Neither adapter copies sprite bytes or writes the shared palette implicitly.
web64_actor_batch_run_mux_fast() is the production fused adapter for callers that can prove the pipeline facts in Web64ActorMuxPipeline.flags. Bounds, animation preparation, pair results, stable topology/order, and preintegrated motion can be supplied or retained openly by the application; no private runtime mirror replaces them. Its self-modifying kernels are RAM-resident, mainline-only, non-reentrant, and include operand preparation in their measured cost. The matching web64/actor-batch.inc publishes every structure offset, flag, status, entry label, and _web64_rt argument-window symbol for native or Kick-compatible assembly consumers.
The canonical 24-actor workload has 18 visible actors, four overlay pairs, motion, animation, culling, pair output, public commands, and mux output. The frozen competent KickAssembler baseline is 15,338 cycles. The complete Web64 fused direct-label path, including legitimate internal preparation and JSR/RTS but excluding C argument marshalling, measures 14,908 cycles under web64-static-v0 and 14,914 under web64-stack-v1: 430 and 424 cycles of headroom (2.80% and 2.76%) with byte-identical semantic output. The original 9,828-cycle figure remains an aspirational research target, not a release gate. The independent _web64_rt measurement reduces the six-call C-facing overhead from 756 to 252 cycles under both ABIs.
Open _web64_rt runtime ABI
All 163 parameterized native web64_* runtime functions use registry-generated exact-width named argument windows. This includes hardware loading, disk and file I/O, cartridge resources, fixed-point math, asset copying, bitmap drawing, motion, collision, animation, direct sprites, sprite multiplexing, actors, actor batches, trajectories, and World. Ordinary application C remains ordinary C: the bundled external declarations select the runtime convention, pure arguments are written directly into the window, and side-effectful expressions retain stable ordinary marshalling. The 10 parameterless native runtime entry points need no window and retain their direct labels.
Every native Web64 runtime family now has a self-contained assembly include such as web64/fixed.inc, web64/actor-batch.inc, or web64/world.inc. Registry-generated web64_rt_prepare_* helpers fill complete exact-width named windows, while web64_rt_call_* helpers prepare and call the unchanged underscore-prefixed entry; parameterless entries receive the call form only. C-owned structs and buffers pass directly by emitted labels such as _view, with no copy or private mirror. The expansion is byte-identical to handwritten window stores plus JSR, and an unused family include links zero runtime bytes. web64/runtime.inc remains the optional whole-registry metadata catalog. Windows are public, adjacent to their entries, mainline-only, and non-reentrant unless an entry documents otherwise. No ABI call allocates memory, copies an asset implicitly, installs an interrupt, or hides caller-owned state.
The standalone actor-batch-arena example keeps 32 actors in open SoA storage, moves all 32 through an application-owned sine/velocity adapter, renders an 18-actor hot cohort with four independently animated native overlay pairs, reserves direct HUD slots 0–1, and gives the mux slots 2–7. Its stable PAL frame accepts nine logical entries and 13 physical layers, deterministically drops nine entries/nine layers, and repeatedly reuses slots. The executable gate completed 120 consecutive live PAL frames with all 18 visible actors observed moving, zero busy-frame submissions, correct atomic pair precedence, stable HUD bytes, and a measured 12,487-cycle application frame workload.
Runtime kernel performance and compatibility
The September 2026 runtime optimization campaign changes internal kernels, not public layouts or calling conventions. C under both supported ABIs and direct assembly use the same entries, exact-width windows, generated prepare/call helpers, and caller-owned state. Mainline helpers remain non-reentrant; no new IRQ ownership or scratch allowance is implied.
| Operation and measured case | Direct-label cycles before → after | Conditions |
|---|---|---|
| Hires plot at (319,199) | 1,002 → 304 | Fast replace, includes address/mask preparation and JSR/RTS |
| Animation sequence 2, step 3 transition | 1,525 → 814 static; 1,518 → 814 stack | Same 11-byte player, 4-byte sequence and step records |
| AABB high-bit category overlap | 964 → 448 | Native byte-mask intersection, unchanged half-open bounds |
| Material-map row 255 | 16,301 → 759 | 16-byte stride; bounded full-width row multiplication |
| Direct sprite slot 7, unchanged cache | 415 → 252 | Same 51-byte renderer and dirty-write behavior |
These are executed 6502 kernel measurements, not whole-game frame rates. C argument marshalling is additional: 52 cycles for the hires plot, 12 for the animation tick, 24 for the AABB call, 40 for the material lookup, and 58 for the sprite call in these fixtures. Explicit immediate-load/absolute-store ASM window preparation costs 42, 12, 24, 36, and 54 cycles respectively. Neither call boundary is hidden in the runtime comparison.
Bitmap addressing no longer walks preceding character rows, and animation addressing no longer walks preceding four-byte records. The direct sprite path adds one independently exact-linked 8-byte mask table while reducing total isolated closure by 5 bytes; renderer initialization alone does not link that table. Slot 0 costs eight extra cycles, while the other slots improve. No large generic lookup table or per-instance storage was added.
Web64CollisionMap row addressing honors the full 16-bit height and row stride. A pre-existing truncation made row 256 alias row 0; rows above 255 now access their correct cells. Out-of-range coordinates still return the configured outside material. The fixed address kernel adds 16 code bytes and costs five extra cycles for the measured row-1 case, in exchange for correctness and bounded work on taller maps.
The unchanged Ascender hybrid C/ASM example shrinks from 12,428 to 12,307 PRG bytes. Its sampled headless update/render maximum falls from 18,615 to 17,933 cycles, excluding raster idle. A separate real VICE run presents all 180 sampled PAL frames without a missed page flip, compared with two missed presentations with the baseline runtime. Canonical per-presentation screen/sprite output and native charset bytes remain identical; this is a bounded regression test, not a guarantee for every possible play session. The Mirror Pulse example also retains canonical rendering while shrinking by 59 bytes in both ABI rendering fixtures. Its published URL-loading demo disk is maintained separately and need not match the latest build.
Web64 Game Runtime World module quick reference
World is an independently linked module family within Web64 Game Runtime, alongside Motion, Collision, Animation, Sprites, and Actors. It streams already-linked native Web64 asset planes into screen RAM and Color RAM, but it does not own main(), the frame tick, IRQ policy, camera policy, collision meaning, or game rules.
| Need | Include | Primary calls/macros | Runtime closure | Does not imply |
|---|---|---|---|---|
| Shared world/camera/view types | <web64/world.h> | Web64WorldCamera, Web64WorldView, Web64WorldRect, WEB64_WORLD_PIXEL_TO_CELL, WEB64_WORLD_SUBPIXEL_TO_PIXEL/CELL/FINE | Header-only macros and types | Static rendering, scrolling, mutation, collision, sprites |
| Video-mode setup | <web64/world.h> | web64_world_apply_video_mode | World video helper only | Renderer, scroller, other Game Runtime modules |
| Static native-map rendering | <web64/world.h> | web64_world_draw_char_view, web64_world_draw_block2_view | World render helper only | Scroller, collision policy, sprites |
| Screen-only rendering | <web64/world.h> | web64_world_draw_char_view_screen, web64_world_draw_block2_view_screen, WEB64_WORLD_COLOR_NONE | Specialized render code with no color/material setup, reads, or writes | Color RAM or a material plane |
| Offscreen strip primitives | <web64/world.h> | web64_world_stream_column, web64_world_stream_row, web64_world_shift_* | World scroll helpers only | Permission to modify the screen currently selected by VIC-II; Motion, Collision, Animation, Sprites, Actors |
| Screen-only strip and mutation helpers | <web64/world.h> | web64_world_stream_column_screen, web64_world_stream_row_screen, web64_world_shift_*_screen, web64_world_mutate_cell_screen | Specialized screen-only helpers | Color RAM, material planes, collision policy |
| Fine-scroll camera math | <web64/world.h> | web64_world_scroll_x, web64_world_scroll_y, web64_world_camera_sync_x/y, web64_world_camera_vic_fine_x/y | World scroll helper only | Rendering, user input, motion, collision, IRQ installation |
| Buffered smooth-scrolling templates | generated src/world-scroll.asm | asm_world_scroll_init, asm_world_scroll_step | Exact project-local renderer plus explicitly called modules | Visible-screen shifts, in-loop Color RAM rewrites, framework-owned input/tick policy |
| Visible mutation | <web64/world.h> | web64_world_mutate_cell | World mutation helper only | Collectible/hazard/gameplay policy |
| Native asset wrappers | project tree | .w64chr, .w64blk, .w64map, .w64spr | Editable first-class asset files with deterministic generated outputs | Legacy .chr, .blk, .map, .spr conversion loss |
Game Runtime World-module template families:
- World Static Map
- World Horizontal Scroller
- World Subpixel Motion Scroller
- World Vertical Scroller
- World Bidirectional Scroller
- World Multicolor Platformer
- World + Motion and Sprites
The moving templates use transactional double buffering and never modify the displayed VIC screen. A complete next viewport is rendered into the hidden page; D018, D016, and D011 are staged and committed together at the frame boundary. Physical page ownership is released only after presentation, so a high-speed or subpixel caller cannot render into a page that is still visible. Horizontal movement uses 38-column geometry and vertical movement uses verified 25-row geometry. Default buffered templates fill Color RAM once with a stable region color and perform no in-loop Color RAM writes; the static renderer and explicitly scheduled public APIs retain exact per-cell color support. Stopping and reversal preserve the exact partial fine phase.
The Subpixel Motion template keeps its authoritative camera position in Motion Q12.4 and passes that position through web64_world_camera_sync_x(). Its PAL-safe profile visibly demonstrates 0.125-4.0 pixels/frame, progressive acceleration and braking, reversal through zero, and deterministic settling without feeding rounded renderer coordinates back into physics. The renderer consumes up to four integer scroll steps per game tick so its displayed position tracks the Motion target instead of lagging behind it.
The executable benchmark measures complete sustained edge-to-edge movement using stable region Color RAM in the transactional buffered templates. Worst frames are 14,499 cycles horizontal (62.041% below the frozen 38,196-cycle path), 17,708 vertical (51.305% below 36,365), 15,223 bidirectional (60.145% below 38,196), and 14,746 multicolor bidirectional (61.394% below 38,196). The composed 0.125-4.0-pixel Motion + World update peaks at 16,083 cycles. Displayed-screen writes and in-loop Color RAM writes are zero; idle frames also perform zero screen writes. The equivalent public per-cell horizontal boundary path uses 31,485 cycles versus 37,156 for the repository c64lib tile2 compatibility path, a 15.263% advantage while both write 880 screen and 880 Color RAM cells.
Reference and print links:
web64/loader.h— printable listingweb64/loader.inc— printable listingweb64/assets.h— printable listingweb64/assets.inc— printable listingweb64/disk.h— printable listingweb64/disk.inc— printable listingweb64/fixed.h— printable listingweb64/fixed.inc— printable listingweb64/game.h— printable listingweb64/motion.h— printable listingweb64/motion.inc— printable listingweb64/bitmap.h— printable listingweb64/bitmap.inc— printable listingweb64/trajectory.h— printable listingweb64/trajectory.inc— printable listingweb64/collision.h— printable listingweb64/collision.inc— printable listingweb64/animation.h— printable listingweb64/animation.inc— printable listingweb64/sprite-runtime.h— printable listingweb64/sprite-runtime.inc— printable listingweb64/sprite-mux.h— printable listingweb64/sprite-mux.inc— printable listingweb64/actor-batch.h— printable listingweb64/actor-batch.inc— printable listingweb64/runtime.inc— printable listingweb64/actors.h— printable listingweb64/actors.inc— printable listingweb64/game-compose.h— printable listingweb64/world.h— printable listingweb64/world.inc— printable listing
Web64 SDK header index
For exact printable source, use the raw links below or open the Web64 SDK Header Printouts page.
| Header | Summary | Declarations | Printout |
|---|---|---|---|
6502.h | Inline assembly and direct-memory convenience macros for 6502-centric C code. | 6 symbols | raw |
assets/generated.h | Project-generated asset declarations exported into C builds from the current asset manifest. | 0 symbols | raw |
c64.h | Typed C64 hardware register blocks, memory map constants, colors, and device pointer macros. | 229 symbols | raw |
c64lib/64spec.h | Browser-native c64lib assertion and machine-readable test-result declarations. | 17 symbols | raw |
c64lib/bitmap.h | Official six-byte c64lib bitmap tile-configuration layout adapted for C. | 2 symbols | raw |
c64lib/chipset.h | Web64-native c64lib CIA, memory-banking, raster, VIC-II, and sprite compatibility declarations. | 36 symbols | raw |
c64lib/common.h | Web64-native c64lib memory copy, fill, RLE, and optional Exomizer P39 compatibility routines. | 8 symbols | raw |
c64lib/copper64.h | Adapted copper64 four-byte display-list entries, handler identifiers, and start/stop routines. | 25 symbols | raw |
c64lib/magic-desk.h | Magic Desk cartridge target, bank-selection, and browser-native loader declarations. | 7 symbols | raw |
c64lib/sprites.h | c64lib-compatible sprite register-address and mask helpers over the Web64 chipset module. | 4 symbols | raw |
c64lib/text.h | Web64-native c64lib text, hexadecimal output, scrolling, and stateful 2x2 Tile2 routines. | 18 symbols | raw |
c64lib/vic2.h | c64lib-compatible VIC-II register names mapped to the typed Web64 C64 header. | 7 symbols | raw |
cbm.h | Dependency-linked low-level KERNAL channel, load, save, and status wrappers. | 26 symbols | raw |
conio.h | cc65-style screen and text helpers mapped onto the Web64 SDK surface. | 31 symbols | raw |
ctype.h | ASCII-oriented character classification and case-conversion declarations backed by the Web64 runtime. | 13 symbols | raw |
float.h | Web64 SDK header. | 29 symbols | raw |
joy.h | Minimal joystick helper for reading the active C64 port state. | 1 symbols | raw |
joystick.h | cc65-familiar joystick constants and helpers without native driver loading. | 5 symbols | raw |
libc.h | Aggregate convenience header over the dependency-linked Web64 standard library surface. | 2 symbols | raw |
limits.h | Web64 SDK header. | 16 symbols | raw |
peekpoke.h | PEEK/POKE helper macros for byte and word memory access. | 4 symbols | raw |
sprite.h | Small sprite helper API for position, color, and enable writes. | 3 symbols | raw |
stdarg.h | Web64 SDK header. | 6 symbols | raw |
stdbool.h | Boolean language aliases and constants. | 4 symbols | raw |
stddef.h | Core pointer-sized typedefs and NULL. | 5 symbols | raw |
stdint.h | Fixed-width integer typedefs and limit macros. | 29 symbols | raw |
stdio.h | Tiny stdio surface: blocking raw-byte getchar, putchar, puts, and compiler-lowered literal printf. | 5 symbols | raw |
stdlib.h | Tiny stdlib surface: abs, atoi, rand, srand, and abort. | 6 symbols | raw |
string.h | Byte and C-string manipulation declarations backed by the Web64 runtime. | 18 symbols | raw |
web64.h | General Web64 SDK helpers for timing, text, randomness, simple drawing, and zero-parameter void calls by address. | 10 symbols | raw |
web64/actor-batch.h | Open caller-owned actor SoA phases, pair/visible/command buffers, direct and mux adapters, fused prepared pipeline, and checked/fast entry points. | 178 symbols | raw |
web64/actor-batch.inc | Assembly ABI constants, exact structure offsets, flags, status values, and standard runtime prepare/call macros. | 0 symbols | raw |
web64/actors.h | Compile-time actor-pool storage macros plus activation and compaction helpers. | 17 symbols | raw |
web64/actors.inc | Registry-generated Actor-pool runtime prepare/call macros for native assembly. | 0 symbols | raw |
web64/animation.h | Independent deterministic animation-bank playback state, sequence control, completion status, and step events. | 16 symbols | raw |
web64/animation.inc | Registry-generated Animation runtime prepare/call macros for native assembly. | 0 symbols | raw |
web64/assets.h | Public Web64 Asset Model v1 descriptor types and constants for generated asset metadata. | 62 symbols | raw |
web64/assets.inc | Registry-generated Web64 Asset Model runtime prepare/call macros for native assembly. | 0 symbols | raw |
web64/bitmap.h | Caller-owned C64 hires and multicolor bitmap setup, logical-pixel drawing primitives, optimized line kernels, and bounded replace-only scanline flood fill. | 49 symbols | raw |
web64/bitmap.inc | Bitmap layouts, constants, and registry-generated native assembly prepare/call macros. | 0 symbols | raw |
web64/cartridge.h | Web64 SDK header. | 25 symbols | raw |
web64/cartridge.inc | Web64 SDK header. | 0 symbols | raw |
web64/collision.h | Independent material-map and AABB collision probes, swept contacts, interaction queues, and map mutation helpers. | 30 symbols | raw |
web64/collision.inc | Registry-generated Collision runtime prepare/call macros for native assembly. | 0 symbols | raw |
web64/disk.h | Dependency-linked disk load/save, streaming file I/O, disk markers, and IDE-assisted disk swap requests. | 21 symbols | raw |
web64/disk.inc | Registry-generated disk and file-I/O runtime prepare/call macros for native assembly. | 0 symbols | raw |
web64/fixed.h | 8.8 fixed-point, secondary 16.16 macros, angle8 trig helpers, and vector/motion declarations. | 81 symbols | raw |
web64/fixed.inc | Registry-generated fixed-point runtime prepare/call macros for native assembly. | 0 symbols | raw |
web64/game-compose.h | Opt-in composition macros for proven hot primitive combinations without introducing a framework update loop. | 3 symbols | raw |
web64/game.h | Shared Game Runtime numeric contract, Q12.4 conversion macros, and compact point/delta/box structs. | 12 symbols | raw |
web64/loader-decoder-runtime.inc | Web64 SDK header. | 0 symbols | raw |
web64/loader-packed-runtime.inc | Web64 SDK header. | 0 symbols | raw |
web64/loader-raw-runtime.inc | Web64 SDK header. | 0 symbols | raw |
web64/loader-state-runtime.inc | Web64 SDK header. | 0 symbols | raw |
web64/loader-transport-runtime.inc | Web64 SDK header. | 0 symbols | raw |
web64/loader.h | Synchronous hardware loading and transactional W64X installation with caller-owned RAM, IRQ and lifecycle. | 29 symbols | raw |
web64/loader.inc | Exact-width native ASM loader argument windows, request offsets and convenience macros. | 0 symbols | raw |
web64/motion.h | Independent subpixel motion primitives for acceleration, braking, clamping, wrapping, gravity, and integration. | 17 symbols | raw |
web64/motion.inc | Registry-generated Motion runtime prepare/call macros for native assembly. | 0 symbols | raw |
web64/reu.h | Web64 SDK header. | 23 symbols | raw |
web64/reu.inc | Web64 SDK header. | 0 symbols | raw |
web64/runtime.inc | Registry-generated _web64_rt entry and exact-width named argument-window reference for native and Kick-compatible assembly callers. | 0 symbols | raw |
web64/sprite-mux.h | Caller-owned PAL schedule storage, deterministic atomic submissions, double-buffer publication, explicit status, and application-chained IRQ service. | 20 symbols | raw |
web64/sprite-mux.inc | Registry-generated sprite-multiplexer prepare/call macros, including parameterless IRQ-service calls, for native assembly. | 0 symbols | raw |
web64/sprite-runtime.h | Independent direct eight-sprite renderer with 9-bit X, dirty writes, camera projection, native overlay-asset pairs, and raw attachment helpers. | 14 symbols | raw |
web64/sprite-runtime.inc | Registry-generated direct-sprite runtime prepare/call macros for native assembly. | 0 symbols | raw |
web64/trajectory.h | Compact deterministic waypoint patterns, caller-owned Q12.4 execution state, exact scalar and synchronized-batch stepping, and transparent Motion/Actor projection. | 45 symbols | raw |
web64/trajectory.inc | Assembly ABI constants, exact packed offsets, standard runtime prepare/call macros, compatible trajectory aliases, descriptor/storage emitters, and position-copy helpers. | 0 symbols | raw |
web64/world.h | Independent Game Runtime World-module camera, viewport, native asset streaming, static rendering, fine-scroll, and visible mutation declarations. | 14 symbols | raw |
web64/world.inc | Registry-generated World runtime prepare/call macros for native assembly. | 0 symbols | raw |
Web64 SDK reference
6502.h
Inline assembly and direct-memory convenience macros for 6502-centric C code.
Included headers: <stdint.h>.
Macros:
| Name | Value | Description |
|---|---|---|
PEEK(address) | (*(volatile uint8_t*)(address)) | Macro constant exported by the header. |
POKE(address, value) | (*(volatile uint8_t*)(address) = (uint8_t)(value)) | Macro constant exported by the header. |
PEEKW(address) | (*(volatile uint16_t*)(address)) | Macro constant exported by the header. |
POKEW(address, value) | (*(volatile uint16_t*)(address) = (uint16_t)(value)) | Macro constant exported by the header. |
CLI | __asm__("cli") | Macro constant exported by the header. |
SEI | __asm__("sei") | Macro constant exported by the header. |
Header listing:
#ifndef WEB64_6502_H
#define WEB64_6502_H
#include <stdint.h>
#define PEEK(address) (*(volatile uint8_t*)(address))
#define POKE(address, value) (*(volatile uint8_t*)(address) = (uint8_t)(value))
#define PEEKW(address) (*(volatile uint16_t*)(address))
#define POKEW(address, value) (*(volatile uint16_t*)(address) = (uint16_t)(value))
#define CLI() __asm__("cli")
#define SEI() __asm__("sei")
#endif
assets/generated.h
Project-generated asset declarations exported into C builds from the current asset manifest.
Included headers: <web64/assets.h>.
Header listing:
#ifndef WEB64_ASSETS_GENERATED_H
#define WEB64_ASSETS_GENERATED_H
#include <web64/assets.h>
#endif
c64.h
Typed C64 hardware register blocks, memory map constants, colors, and device pointer macros.
Typedefs:
| Name | Declaration | Description |
|---|---|---|
c64_reg8_t | typedef unsigned char c64_reg8_t; | C64-specific alias type used by the hardware headers. |
Structs:
| Name | Description | Field summary |
|---|---|---|
c64_cpu_port_registers | Memory-mapped register layout exported by <c64.h>. | volatile c64_reg8_t data_direction, volatile c64_reg8_t data |
c64_screen_ram | Typed memory block overlay for a C64 RAM region. | volatile c64_reg8_t cells[1000] |
c64_color_ram | Typed memory block overlay for a C64 RAM region. | volatile c64_reg8_t cells[1000] |
c64_vicii_registers | VIC-II registers. | 47 fields: volatile c64_reg8_t sprite0_x, volatile c64_reg8_t sprite0_y, volatile c64_reg8_t sprite1_x, volatile c64_reg8_t sprite1_y, ... |
c64_sid_voice_registers | SID registers. | 7 fields: volatile c64_reg8_t freq_lo, volatile c64_reg8_t freq_hi, volatile c64_reg8_t pulse_lo, volatile c64_reg8_t pulse_hi, ... |
c64_sid_registers | Memory-mapped register layout exported by <c64.h>. | 29 fields: volatile c64_reg8_t voice1_freq_lo, volatile c64_reg8_t voice1_freq_hi, volatile c64_reg8_t voice1_pulse_lo, volatile c64_reg8_t voice1_pulse_hi, ... |
c64_cia_registers | CIA, keyboard, and joyport registers. | 16 fields: volatile c64_reg8_t pra, volatile c64_reg8_t prb, volatile c64_reg8_t ddra, volatile c64_reg8_t ddrb, ... |
Macros:
| Name | Value | Description |
|---|---|---|
C64_RAM_BASE | 0x0000 | Common C64 memory map. |
C64_BASIC_START | 0x0801 | C64 memory-map or device-register constant. |
C64_SCREEN_RAM | 0x0400 | C64 memory-map or device-register constant. |
C64_COLOR_RAM | 0xd800 | C64 memory-map or device-register constant. |
C64_CHAR_ROM | 0xd000 | C64 memory-map or device-register constant. |
C64_SCREEN_WIDTH | 40 | C64 memory-map or device-register constant. |
C64_SCREEN_HEIGHT | 25 | C64 memory-map or device-register constant. |
C64_SCREEN_CELL_COUNT | 1000 | C64 memory-map or device-register constant. |
C64_IO_BASE | 0xd000 | C64 memory-map or device-register constant. |
C64_KERNAL_ROM | 0xe000 | C64 memory-map or device-register constant. |
C64_CPU_PORT | ((volatile c64_cpu_port_registers*)0x0000) | C64 memory-map or device-register constant. |
C64_SCREEN | ((volatile c64_screen_ram*)C64_SCREEN_RAM) | C64 memory-map or device-register constant. |
C64_COLOR | ((volatile c64_color_ram*)C64_COLOR_RAM) | C64 memory-map or device-register constant. |
C64_SCREEN_ROWS | ((volatile unsigned char (*)[40])C64_SCREEN_RAM) | C64 memory-map or device-register constant. |
C64_COLOR_ROWS | ((volatile unsigned char (*)[40])C64_COLOR_RAM) | C64 memory-map or device-register constant. |
C64_CHAR_ROM_GLYPHS | ((const unsigned char (*)[8])C64_CHAR_ROM) | C64 memory-map or device-register constant. |
VIC_BASE | 0xd000 | C64 memory-map or device-register constant. |
VIC_SPRITE0_X | 0xd000 | C64 memory-map or device-register constant. |
VIC_SPRITE0_Y | 0xd001 | C64 memory-map or device-register constant. |
VIC_SPRITE1_X | 0xd002 | C64 memory-map or device-register constant. |
VIC_SPRITE1_Y | 0xd003 | C64 memory-map or device-register constant. |
VIC_SPRITE2_X | 0xd004 | C64 memory-map or device-register constant. |
VIC_SPRITE2_Y | 0xd005 | C64 memory-map or device-register constant. |
VIC_SPRITE3_X | 0xd006 | C64 memory-map or device-register constant. |
VIC_SPRITE3_Y | 0xd007 | C64 memory-map or device-register constant. |
VIC_SPRITE4_X | 0xd008 | C64 memory-map or device-register constant. |
VIC_SPRITE4_Y | 0xd009 | C64 memory-map or device-register constant. |
VIC_SPRITE5_X | 0xd00a | C64 memory-map or device-register constant. |
VIC_SPRITE5_Y | 0xd00b | C64 memory-map or device-register constant. |
VIC_SPRITE6_X | 0xd00c | C64 memory-map or device-register constant. |
VIC_SPRITE6_Y | 0xd00d | C64 memory-map or device-register constant. |
VIC_SPRITE7_X | 0xd00e | C64 memory-map or device-register constant. |
VIC_SPRITE7_Y | 0xd00f | C64 memory-map or device-register constant. |
VIC_SPRITE_X_MSB | 0xd010 | C64 memory-map or device-register constant. |
VIC_CONTROL1 | 0xd011 | C64 memory-map or device-register constant. |
VIC_RASTER | 0xd012 | C64 memory-map or device-register constant. |
VIC_LIGHTPEN_X | 0xd013 | C64 memory-map or device-register constant. |
VIC_LIGHTPEN_Y | 0xd014 | C64 memory-map or device-register constant. |
VIC_SPRITE_ENABLE | 0xd015 | C64 memory-map or device-register constant. |
VIC_CONTROL2 | 0xd016 | C64 memory-map or device-register constant. |
VIC_SPRITE_Y_EXPAND | 0xd017 | C64 memory-map or device-register constant. |
VIC_MEMORY_SETUP | 0xd018 | C64 memory-map or device-register constant. |
VIC_INTERRUPT_STATUS | 0xd019 | C64 memory-map or device-register constant. |
VIC_INTERRUPT_ENABLE | 0xd01a | C64 memory-map or device-register constant. |
VIC_SPRITE_PRIORITY | 0xd01b | C64 memory-map or device-register constant. |
VIC_SPRITE_MULTICOLOR | 0xd01c | C64 memory-map or device-register constant. |
VIC_SPRITE_X_EXPAND | 0xd01d | C64 memory-map or device-register constant. |
VIC_SPRITE_COLLISION | 0xd01e | C64 memory-map or device-register constant. |
VIC_DATA_COLLISION | 0xd01f | C64 memory-map or device-register constant. |
VIC_BORDER | 0xd020 | C64 memory-map or device-register constant. |
VIC_BACKGROUND | 0xd021 | C64 memory-map or device-register constant. |
VIC_BACKGROUND0 | 0xd021 | C64 memory-map or device-register constant. |
VIC_BACKGROUND1 | 0xd022 | C64 memory-map or device-register constant. |
VIC_BACKGROUND2 | 0xd023 | C64 memory-map or device-register constant. |
VIC_BACKGROUND3 | 0xd024 | C64 memory-map or device-register constant. |
VIC_SPRITE_MULTICOLOR0 | 0xd025 | C64 memory-map or device-register constant. |
VIC_SPRITE_MULTICOLOR1 | 0xd026 | C64 memory-map or device-register constant. |
VIC_SPRITE0_COLOR | 0xd027 | C64 memory-map or device-register constant. |
VIC_SPRITE1_COLOR | 0xd028 | C64 memory-map or device-register constant. |
VIC_SPRITE2_COLOR | 0xd029 | C64 memory-map or device-register constant. |
VIC_SPRITE3_COLOR | 0xd02a | C64 memory-map or device-register constant. |
VIC_SPRITE4_COLOR | 0xd02b | C64 memory-map or device-register constant. |
VIC_SPRITE5_COLOR | 0xd02c | C64 memory-map or device-register constant. |
VIC_SPRITE6_COLOR | 0xd02d | C64 memory-map or device-register constant. |
VIC_SPRITE7_COLOR | 0xd02e | C64 memory-map or device-register constant. |
VIC_COLOR_BLACK | 0x00 | C64 memory-map or device-register constant. |
VIC_COLOR_WHITE | 0x01 | C64 memory-map or device-register constant. |
VIC_COLOR_RED | 0x02 | C64 memory-map or device-register constant. |
VIC_COLOR_CYAN | 0x03 | C64 memory-map or device-register constant. |
VIC_COLOR_PURPLE | 0x04 | C64 memory-map or device-register constant. |
VIC_COLOR_GREEN | 0x05 | C64 memory-map or device-register constant. |
VIC_COLOR_BLUE | 0x06 | C64 memory-map or device-register constant. |
VIC_COLOR_YELLOW | 0x07 | C64 memory-map or device-register constant. |
VIC_COLOR_ORANGE | 0x08 | C64 memory-map or device-register constant. |
VIC_COLOR_BROWN | 0x09 | C64 memory-map or device-register constant. |
VIC_COLOR_LIGHT_RED | 0x0a | C64 memory-map or device-register constant. |
VIC_COLOR_DARK_GRAY | 0x0b | C64 memory-map or device-register constant. |
VIC_COLOR_GRAY | 0x0c | C64 memory-map or device-register constant. |
VIC_COLOR_LIGHT_GREEN | 0x0d | C64 memory-map or device-register constant. |
VIC_COLOR_LIGHT_BLUE | 0x0e | C64 memory-map or device-register constant. |
VIC_COLOR_LIGHT_GRAY | 0x0f | C64 memory-map or device-register constant. |
COLOR_BLACK | VIC_COLOR_BLACK | Color alias constant for VIC palette values. |
COLOR_WHITE | VIC_COLOR_WHITE | Color alias constant for VIC palette values. |
COLOR_RED | VIC_COLOR_RED | Color alias constant for VIC palette values. |
COLOR_CYAN | VIC_COLOR_CYAN | Color alias constant for VIC palette values. |
COLOR_PURPLE | VIC_COLOR_PURPLE | Color alias constant for VIC palette values. |
COLOR_GREEN | VIC_COLOR_GREEN | Color alias constant for VIC palette values. |
COLOR_BLUE | VIC_COLOR_BLUE | Color alias constant for VIC palette values. |
COLOR_YELLOW | VIC_COLOR_YELLOW | Color alias constant for VIC palette values. |
COLOR_ORANGE | VIC_COLOR_ORANGE | Color alias constant for VIC palette values. |
COLOR_BROWN | VIC_COLOR_BROWN | Color alias constant for VIC palette values. |
COLOR_LIGHTRED | VIC_COLOR_LIGHT_RED | Color alias constant for VIC palette values. |
COLOR_GRAY1 | VIC_COLOR_DARK_GRAY | Color alias constant for VIC palette values. |
COLOR_GRAY2 | VIC_COLOR_GRAY | Color alias constant for VIC palette values. |
COLOR_LIGHTGREEN | VIC_COLOR_LIGHT_GREEN | Color alias constant for VIC palette values. |
COLOR_LIGHTBLUE | VIC_COLOR_LIGHT_BLUE | Color alias constant for VIC palette values. |
COLOR_GRAY3 | VIC_COLOR_LIGHT_GRAY | Color alias constant for VIC palette values. |
VIC_SPRITE_POINTER_BASE | 0x07f8 | C64 memory-map or device-register constant. |
VICII | ((volatile c64_vicii_registers*)VIC_BASE) | Typed pointer or expression macro. |
VIC | VICII | Macro constant exported by the header. |
SID_BASE | 0xd400 | C64 memory-map or device-register constant. |
SID_VOICE1_FREQ_LO | 0xd400 | C64 memory-map or device-register constant. |
SID_VOICE1_FREQ_HI | 0xd401 | C64 memory-map or device-register constant. |
SID_VOICE1_PULSE_LO | 0xd402 | C64 memory-map or device-register constant. |
SID_VOICE1_PULSE_HI | 0xd403 | C64 memory-map or device-register constant. |
SID_VOICE1_CONTROL | 0xd404 | C64 memory-map or device-register constant. |
SID_VOICE1_ATTACK_DECAY | 0xd405 | C64 memory-map or device-register constant. |
SID_VOICE1_SUSTAIN_RELEASE | 0xd406 | C64 memory-map or device-register constant. |
SID_VOICE2_FREQ_LO | 0xd407 | C64 memory-map or device-register constant. |
SID_VOICE2_FREQ_HI | 0xd408 | C64 memory-map or device-register constant. |
SID_VOICE2_PULSE_LO | 0xd409 | C64 memory-map or device-register constant. |
SID_VOICE2_PULSE_HI | 0xd40a | C64 memory-map or device-register constant. |
SID_VOICE2_CONTROL | 0xd40b | C64 memory-map or device-register constant. |
SID_VOICE2_ATTACK_DECAY | 0xd40c | C64 memory-map or device-register constant. |
SID_VOICE2_SUSTAIN_RELEASE | 0xd40d | C64 memory-map or device-register constant. |
SID_VOICE3_FREQ_LO | 0xd40e | C64 memory-map or device-register constant. |
SID_VOICE3_FREQ_HI | 0xd40f | C64 memory-map or device-register constant. |
SID_VOICE3_PULSE_LO | 0xd410 | C64 memory-map or device-register constant. |
SID_VOICE3_PULSE_HI | 0xd411 | C64 memory-map or device-register constant. |
SID_VOICE3_CONTROL | 0xd412 | C64 memory-map or device-register constant. |
SID_VOICE3_ATTACK_DECAY | 0xd413 | C64 memory-map or device-register constant. |
SID_VOICE3_SUSTAIN_RELEASE | 0xd414 | C64 memory-map or device-register constant. |
SID_FILTER_CUTOFF_LO | 0xd415 | C64 memory-map or device-register constant. |
SID_FILTER_CUTOFF_HI | 0xd416 | C64 memory-map or device-register constant. |
SID_FILTER_RESONANCE | 0xd417 | C64 memory-map or device-register constant. |
SID_VOLUME_FILTER_MODE | 0xd418 | C64 memory-map or device-register constant. |
SID_POT_X | 0xd419 | C64 memory-map or device-register constant. |
SID_POT_Y | 0xd41a | C64 memory-map or device-register constant. |
SID_OSC3_RANDOM | 0xd41b | C64 memory-map or device-register constant. |
SID_ENV3 | 0xd41c | C64 memory-map or device-register constant. |
SID_WAVE_TRIANGLE | 0x10 | C64 memory-map or device-register constant. |
SID_WAVE_SAW | 0x20 | C64 memory-map or device-register constant. |
SID_WAVE_PULSE | 0x40 | C64 memory-map or device-register constant. |
SID_WAVE_NOISE | 0x80 | C64 memory-map or device-register constant. |
SID_GATE | 0x01 | C64 memory-map or device-register constant. |
SID_SYNC | 0x02 | C64 memory-map or device-register constant. |
SID_RING_MOD | 0x04 | C64 memory-map or device-register constant. |
SID_TEST | 0x08 | C64 memory-map or device-register constant. |
SID | ((volatile c64_sid_registers*)SID_BASE) | Typed pointer or expression macro. |
CIA1_BASE | 0xdc00 | CIA, keyboard, and joyport registers. |
CIA1_PRA | 0xdc00 | C64 memory-map or device-register constant. |
CIA1_PRB | 0xdc01 | C64 memory-map or device-register constant. |
CIA1_DDRA | 0xdc02 | C64 memory-map or device-register constant. |
CIA1_DDRB | 0xdc03 | C64 memory-map or device-register constant. |
CIA1_TIMER_A_LO | 0xdc04 | C64 memory-map or device-register constant. |
CIA1_TIMER_A_HI | 0xdc05 | C64 memory-map or device-register constant. |
CIA1_TIMER_B_LO | 0xdc06 | C64 memory-map or device-register constant. |
CIA1_TIMER_B_HI | 0xdc07 | C64 memory-map or device-register constant. |
CIA1_TOD_10THS | 0xdc08 | C64 memory-map or device-register constant. |
CIA1_TOD_SECONDS | 0xdc09 | C64 memory-map or device-register constant. |
CIA1_TOD_MINUTES | 0xdc0a | C64 memory-map or device-register constant. |
CIA1_TOD_HOURS | 0xdc0b | C64 memory-map or device-register constant. |
CIA1_SERIAL_DATA | 0xdc0c | C64 memory-map or device-register constant. |
CIA1_INTERRUPT_CONTROL | 0xdc0d | C64 memory-map or device-register constant. |
CIA1_CONTROL_A | 0xdc0e | C64 memory-map or device-register constant. |
CIA1_CONTROL_B | 0xdc0f | C64 memory-map or device-register constant. |
CIA2_BASE | 0xdd00 | C64 memory-map or device-register constant. |
CIA2_PRA | 0xdd00 | C64 memory-map or device-register constant. |
CIA2_PRB | 0xdd01 | C64 memory-map or device-register constant. |
CIA2_DDRA | 0xdd02 | C64 memory-map or device-register constant. |
CIA2_DDRB | 0xdd03 | C64 memory-map or device-register constant. |
CIA2_TIMER_A_LO | 0xdd04 | C64 memory-map or device-register constant. |
CIA2_TIMER_A_HI | 0xdd05 | C64 memory-map or device-register constant. |
CIA2_TIMER_B_LO | 0xdd06 | C64 memory-map or device-register constant. |
CIA2_TIMER_B_HI | 0xdd07 | C64 memory-map or device-register constant. |
CIA2_TOD_10THS | 0xdd08 | C64 memory-map or device-register constant. |
CIA2_TOD_SECONDS | 0xdd09 | C64 memory-map or device-register constant. |
CIA2_TOD_MINUTES | 0xdd0a | C64 memory-map or device-register constant. |
CIA2_TOD_HOURS | 0xdd0b | C64 memory-map or device-register constant. |
CIA2_SERIAL_DATA | 0xdd0c | C64 memory-map or device-register constant. |
CIA2_INTERRUPT_CONTROL | 0xdd0d | C64 memory-map or device-register constant. |
CIA2_CONTROL_A | 0xdd0e | C64 memory-map or device-register constant. |
CIA2_CONTROL_B | 0xdd0f | C64 memory-map or device-register constant. |
CIA1 | ((volatile c64_cia_registers*)CIA1_BASE) | Typed pointer or expression macro. |
CIA2 | ((volatile c64_cia_registers*)CIA2_BASE) | Typed pointer or expression macro. |
KEYBOARD_COLUMN_PORT | 0xdc00 | Macro constant exported by the header. |
KEYBOARD_ROW_PORT | 0xdc01 | Macro constant exported by the header. |
KEYBOARD_COLUMN_DDR | 0xdc02 | Macro constant exported by the header. |
KEYBOARD_ROW_DDR | 0xdc03 | Macro constant exported by the header. |
KEYBOARD_ACTIVE_MASK | 0xff | Macro constant exported by the header. |
JOYPORT_1 | 0xdc01 | Macro constant exported by the header. |
JOYPORT_2 | 0xdc00 | Macro constant exported by the header. |
JOY_UP | 0x01 | Joystick masks are active-low: (sample & JOY_FIRE) == 0 means pressed. |
JOY_DOWN | 0x02 | Macro constant exported by the header. |
JOY_LEFT | 0x04 | Macro constant exported by the header. |
JOY_RIGHT | 0x08 | Macro constant exported by the header. |
JOY_FIRE | 0x10 | Macro constant exported by the header. |
JOY_ACTIVE_LOW | 0x00 | Macro constant exported by the header. |
JOY_RELEASED_MASK | 0x1f | Macro constant exported by the header. |
JOY2_UP | (!(CIA1->pra & JOY_UP)) | Macro constant exported by the header. |
JOY2_DOWN | (!(CIA1->pra & JOY_DOWN)) | Macro constant exported by the header. |
JOY2_LEFT | (!(CIA1->pra & JOY_LEFT)) | Macro constant exported by the header. |
JOY2_RIGHT | (!(CIA1->pra & JOY_RIGHT)) | Macro constant exported by the header. |
JOY2_FIRE | (!(CIA1->pra & JOY_FIRE)) | Macro constant exported by the header. |
JOY_UP_P(v) | (!((v) & JOY_UP)) | Macro constant exported by the header. |
JOY_DOWN_P(v) | (!((v) & JOY_DOWN)) | Macro constant exported by the header. |
JOY_LEFT_P(v) | (!((v) & JOY_LEFT)) | Macro constant exported by the header. |
JOY_RIGHT_P(v) | (!((v) & JOY_RIGHT)) | Macro constant exported by the header. |
JOY_FIRE_P(v) | (!((v) & JOY_FIRE)) | Macro constant exported by the header. |
VIC_BORDER_COLOR | VIC_BORDER | Convenience aliases. |
VIC_BACKGROUND_COLOR | VIC_BACKGROUND | C64 memory-map or device-register constant. |
VIC_SPRITE_POINTERS | VIC_SPRITE_POINTER_BASE | C64 memory-map or device-register constant. |
BORDER_COLOR | VIC->border_color | Macro constant exported by the header. |
BACKGROUND_COLOR | VIC->background_color0 | Macro constant exported by the header. |
SPRITE_ENABLE | VIC->sprite_enable | Macro constant exported by the header. |
SPRITE_MULTICOLOR | VIC->sprite_multicolor | Macro constant exported by the header. |
KERNAL_CHROUT | 0xffd2 | Common KERNAL entry points. |
KERNAL_CHRIN | 0xffcf | Macro constant exported by the header. |
KERNAL_READST | 0xffb7 | Macro constant exported by the header. |
KERNAL_OPEN | 0xffc0 | Macro constant exported by the header. |
KERNAL_CLOSE | 0xffc3 | Macro constant exported by the header. |
KERNAL_CHKIN | 0xffc6 | Macro constant exported by the header. |
KERNAL_CHKOUT | 0xffc9 | Macro constant exported by the header. |
KERNAL_CLRCHN | 0xffcc | Macro constant exported by the header. |
KERNAL_GETIN | 0xffe4 | Macro constant exported by the header. |
KERNAL_SCNKEY | 0xff9f | Macro constant exported by the header. |
KERNAL_PLOT | 0xfff0 | Macro constant exported by the header. |
KERNAL_SETLFS | 0xffba | Macro constant exported by the header. |
KERNAL_SETNAM | 0xffbd | Macro constant exported by the header. |
KERNAL_LOAD | 0xffd5 | Macro constant exported by the header. |
KERNAL_SAVE | 0xffd8 | Macro constant exported by the header. |
Header listing:
#ifndef WEB64_C64_H
#define WEB64_C64_H
/* Common C64 memory map. */
#define C64_RAM_BASE 0x0000
#define C64_BASIC_START 0x0801
#define C64_SCREEN_RAM 0x0400
#define C64_COLOR_RAM 0xd800
#define C64_CHAR_ROM 0xd000
#define C64_SCREEN_WIDTH 40
#define C64_SCREEN_HEIGHT 25
#define C64_SCREEN_CELL_COUNT 1000
#define C64_IO_BASE 0xd000
#define C64_KERNAL_ROM 0xe000
typedef unsigned char c64_reg8_t;
typedef struct c64_cpu_port_registers {
volatile c64_reg8_t data_direction;
volatile c64_reg8_t data;
} c64_cpu_port_registers;
typedef struct c64_screen_ram {
volatile c64_reg8_t cells[1000];
} c64_screen_ram;
typedef struct c64_color_ram {
volatile c64_reg8_t cells[1000];
} c64_color_ram;
#define C64_CPU_PORT ((volatile c64_cpu_port_registers*)0x0000)
#define C64_SCREEN ((volatile c64_screen_ram*)C64_SCREEN_RAM)
#define C64_COLOR ((volatile c64_color_ram*)C64_COLOR_RAM)
#define C64_SCREEN_ROWS ((volatile unsigned char (*)[40])C64_SCREEN_RAM)
#define C64_COLOR_ROWS ((volatile unsigned char (*)[40])C64_COLOR_RAM)
#define C64_CHAR_ROM_GLYPHS ((const unsigned char (*)[8])C64_CHAR_ROM)
/* VIC-II registers. */
typedef struct c64_vicii_registers {
volatile c64_reg8_t sprite0_x;
volatile c64_reg8_t sprite0_y;
volatile c64_reg8_t sprite1_x;
volatile c64_reg8_t sprite1_y;
volatile c64_reg8_t sprite2_x;
volatile c64_reg8_t sprite2_y;
volatile c64_reg8_t sprite3_x;
volatile c64_reg8_t sprite3_y;
volatile c64_reg8_t sprite4_x;
volatile c64_reg8_t sprite4_y;
volatile c64_reg8_t sprite5_x;
volatile c64_reg8_t sprite5_y;
volatile c64_reg8_t sprite6_x;
volatile c64_reg8_t sprite6_y;
volatile c64_reg8_t sprite7_x;
volatile c64_reg8_t sprite7_y;
volatile c64_reg8_t sprite_x_msb;
volatile c64_reg8_t control1;
volatile c64_reg8_t raster;
volatile c64_reg8_t lightpen_x;
volatile c64_reg8_t lightpen_y;
volatile c64_reg8_t sprite_enable;
volatile c64_reg8_t control2;
volatile c64_reg8_t sprite_y_expand;
volatile c64_reg8_t memory_setup;
volatile c64_reg8_t interrupt_status;
volatile c64_reg8_t interrupt_enable;
volatile c64_reg8_t sprite_priority;
volatile c64_reg8_t sprite_multicolor;
volatile c64_reg8_t sprite_x_expand;
volatile c64_reg8_t sprite_collision;
volatile c64_reg8_t data_collision;
volatile c64_reg8_t border_color;
volatile c64_reg8_t background_color0;
volatile c64_reg8_t background_color1;
volatile c64_reg8_t background_color2;
volatile c64_reg8_t background_color3;
volatile c64_reg8_t sprite_multicolor0;
volatile c64_reg8_t sprite_multicolor1;
volatile c64_reg8_t sprite0_color;
volatile c64_reg8_t sprite1_color;
volatile c64_reg8_t sprite2_color;
volatile c64_reg8_t sprite3_color;
volatile c64_reg8_t sprite4_color;
volatile c64_reg8_t sprite5_color;
volatile c64_reg8_t sprite6_color;
volatile c64_reg8_t sprite7_color;
} c64_vicii_registers;
#define VIC_BASE 0xd000
#define VIC_SPRITE0_X 0xd000
#define VIC_SPRITE0_Y 0xd001
#define VIC_SPRITE1_X 0xd002
#define VIC_SPRITE1_Y 0xd003
#define VIC_SPRITE2_X 0xd004
#define VIC_SPRITE2_Y 0xd005
#define VIC_SPRITE3_X 0xd006
#define VIC_SPRITE3_Y 0xd007
#define VIC_SPRITE4_X 0xd008
#define VIC_SPRITE4_Y 0xd009
#define VIC_SPRITE5_X 0xd00a
#define VIC_SPRITE5_Y 0xd00b
#define VIC_SPRITE6_X 0xd00c
#define VIC_SPRITE6_Y 0xd00d
#define VIC_SPRITE7_X 0xd00e
#define VIC_SPRITE7_Y 0xd00f
#define VIC_SPRITE_X_MSB 0xd010
#define VIC_CONTROL1 0xd011
#define VIC_RASTER 0xd012
#define VIC_LIGHTPEN_X 0xd013
#define VIC_LIGHTPEN_Y 0xd014
#define VIC_SPRITE_ENABLE 0xd015
#define VIC_CONTROL2 0xd016
#define VIC_SPRITE_Y_EXPAND 0xd017
#define VIC_MEMORY_SETUP 0xd018
#define VIC_INTERRUPT_STATUS 0xd019
#define VIC_INTERRUPT_ENABLE 0xd01a
#define VIC_SPRITE_PRIORITY 0xd01b
#define VIC_SPRITE_MULTICOLOR 0xd01c
#define VIC_SPRITE_X_EXPAND 0xd01d
#define VIC_SPRITE_COLLISION 0xd01e
#define VIC_DATA_COLLISION 0xd01f
#define VIC_BORDER 0xd020
#define VIC_BACKGROUND 0xd021
#define VIC_BACKGROUND0 0xd021
#define VIC_BACKGROUND1 0xd022
#define VIC_BACKGROUND2 0xd023
#define VIC_BACKGROUND3 0xd024
#define VIC_SPRITE_MULTICOLOR0 0xd025
#define VIC_SPRITE_MULTICOLOR1 0xd026
#define VIC_SPRITE0_COLOR 0xd027
#define VIC_SPRITE1_COLOR 0xd028
#define VIC_SPRITE2_COLOR 0xd029
#define VIC_SPRITE3_COLOR 0xd02a
#define VIC_SPRITE4_COLOR 0xd02b
#define VIC_SPRITE5_COLOR 0xd02c
#define VIC_SPRITE6_COLOR 0xd02d
#define VIC_SPRITE7_COLOR 0xd02e
#define VIC_COLOR_BLACK 0x00
#define VIC_COLOR_WHITE 0x01
#define VIC_COLOR_RED 0x02
#define VIC_COLOR_CYAN 0x03
#define VIC_COLOR_PURPLE 0x04
#define VIC_COLOR_GREEN 0x05
#define VIC_COLOR_BLUE 0x06
#define VIC_COLOR_YELLOW 0x07
#define VIC_COLOR_ORANGE 0x08
#define VIC_COLOR_BROWN 0x09
#define VIC_COLOR_LIGHT_RED 0x0a
#define VIC_COLOR_DARK_GRAY 0x0b
#define VIC_COLOR_GRAY 0x0c
#define VIC_COLOR_LIGHT_GREEN 0x0d
#define VIC_COLOR_LIGHT_BLUE 0x0e
#define VIC_COLOR_LIGHT_GRAY 0x0f
#define COLOR_BLACK VIC_COLOR_BLACK
#define COLOR_WHITE VIC_COLOR_WHITE
#define COLOR_RED VIC_COLOR_RED
#define COLOR_CYAN VIC_COLOR_CYAN
#define COLOR_PURPLE VIC_COLOR_PURPLE
#define COLOR_GREEN VIC_COLOR_GREEN
#define COLOR_BLUE VIC_COLOR_BLUE
#define COLOR_YELLOW VIC_COLOR_YELLOW
#define COLOR_ORANGE VIC_COLOR_ORANGE
#define COLOR_BROWN VIC_COLOR_BROWN
#define COLOR_LIGHTRED VIC_COLOR_LIGHT_RED
#define COLOR_GRAY1 VIC_COLOR_DARK_GRAY
#define COLOR_GRAY2 VIC_COLOR_GRAY
#define COLOR_LIGHTGREEN VIC_COLOR_LIGHT_GREEN
#define COLOR_LIGHTBLUE VIC_COLOR_LIGHT_BLUE
#define COLOR_GRAY3 VIC_COLOR_LIGHT_GRAY
#define VIC_SPRITE_POINTER_BASE 0x07f8
#define VICII ((volatile c64_vicii_registers*)VIC_BASE)
#define VIC VICII
/* SID registers. */
typedef struct c64_sid_voice_registers {
volatile c64_reg8_t freq_lo;
volatile c64_reg8_t freq_hi;
volatile c64_reg8_t pulse_lo;
volatile c64_reg8_t pulse_hi;
volatile c64_reg8_t control;
volatile c64_reg8_t attack_decay;
volatile c64_reg8_t sustain_release;
} c64_sid_voice_registers;
typedef struct c64_sid_registers {
volatile c64_reg8_t voice1_freq_lo;
volatile c64_reg8_t voice1_freq_hi;
volatile c64_reg8_t voice1_pulse_lo;
volatile c64_reg8_t voice1_pulse_hi;
volatile c64_reg8_t voice1_control;
volatile c64_reg8_t voice1_attack_decay;
volatile c64_reg8_t voice1_sustain_release;
volatile c64_reg8_t voice2_freq_lo;
volatile c64_reg8_t voice2_freq_hi;
volatile c64_reg8_t voice2_pulse_lo;
volatile c64_reg8_t voice2_pulse_hi;
volatile c64_reg8_t voice2_control;
volatile c64_reg8_t voice2_attack_decay;
volatile c64_reg8_t voice2_sustain_release;
volatile c64_reg8_t voice3_freq_lo;
volatile c64_reg8_t voice3_freq_hi;
volatile c64_reg8_t voice3_pulse_lo;
volatile c64_reg8_t voice3_pulse_hi;
volatile c64_reg8_t voice3_control;
volatile c64_reg8_t voice3_attack_decay;
volatile c64_reg8_t voice3_sustain_release;
volatile c64_reg8_t filter_cutoff_lo;
volatile c64_reg8_t filter_cutoff_hi;
volatile c64_reg8_t filter_resonance;
volatile c64_reg8_t volume_filter_mode;
volatile c64_reg8_t pot_x;
volatile c64_reg8_t pot_y;
volatile c64_reg8_t osc3_random;
volatile c64_reg8_t env3;
} c64_sid_registers;
#define SID_BASE 0xd400
#define SID_VOICE1_FREQ_LO 0xd400
#define SID_VOICE1_FREQ_HI 0xd401
#define SID_VOICE1_PULSE_LO 0xd402
#define SID_VOICE1_PULSE_HI 0xd403
#define SID_VOICE1_CONTROL 0xd404
#define SID_VOICE1_ATTACK_DECAY 0xd405
#define SID_VOICE1_SUSTAIN_RELEASE 0xd406
#define SID_VOICE2_FREQ_LO 0xd407
#define SID_VOICE2_FREQ_HI 0xd408
#define SID_VOICE2_PULSE_LO 0xd409
#define SID_VOICE2_PULSE_HI 0xd40a
#define SID_VOICE2_CONTROL 0xd40b
#define SID_VOICE2_ATTACK_DECAY 0xd40c
#define SID_VOICE2_SUSTAIN_RELEASE 0xd40d
#define SID_VOICE3_FREQ_LO 0xd40e
#define SID_VOICE3_FREQ_HI 0xd40f
#define SID_VOICE3_PULSE_LO 0xd410
#define SID_VOICE3_PULSE_HI 0xd411
#define SID_VOICE3_CONTROL 0xd412
#define SID_VOICE3_ATTACK_DECAY 0xd413
#define SID_VOICE3_SUSTAIN_RELEASE 0xd414
#define SID_FILTER_CUTOFF_LO 0xd415
#define SID_FILTER_CUTOFF_HI 0xd416
#define SID_FILTER_RESONANCE 0xd417
#define SID_VOLUME_FILTER_MODE 0xd418
#define SID_POT_X 0xd419
#define SID_POT_Y 0xd41a
#define SID_OSC3_RANDOM 0xd41b
#define SID_ENV3 0xd41c
#define SID_WAVE_TRIANGLE 0x10
#define SID_WAVE_SAW 0x20
#define SID_WAVE_PULSE 0x40
#define SID_WAVE_NOISE 0x80
#define SID_GATE 0x01
#define SID_SYNC 0x02
#define SID_RING_MOD 0x04
#define SID_TEST 0x08
/* CIA, keyboard, and joyport registers. */
typedef struct c64_cia_registers {
volatile c64_reg8_t pra;
volatile c64_reg8_t prb;
volatile c64_reg8_t ddra;
volatile c64_reg8_t ddrb;
volatile c64_reg8_t timer_a_lo;
volatile c64_reg8_t timer_a_hi;
volatile c64_reg8_t timer_b_lo;
volatile c64_reg8_t timer_b_hi;
volatile c64_reg8_t tod_10ths;
volatile c64_reg8_t tod_seconds;
volatile c64_reg8_t tod_minutes;
volatile c64_reg8_t tod_hours;
volatile c64_reg8_t serial_data;
volatile c64_reg8_t interrupt_control;
volatile c64_reg8_t control_a;
volatile c64_reg8_t control_b;
} c64_cia_registers;
#define SID ((volatile c64_sid_registers*)SID_BASE)
/* CIA, keyboard, and joyport registers. */
#define CIA1_BASE 0xdc00
#define CIA1_PRA 0xdc00
#define CIA1_PRB 0xdc01
#define CIA1_DDRA 0xdc02
#define CIA1_DDRB 0xdc03
#define CIA1_TIMER_A_LO 0xdc04
#define CIA1_TIMER_A_HI 0xdc05
#define CIA1_TIMER_B_LO 0xdc06
#define CIA1_TIMER_B_HI 0xdc07
#define CIA1_TOD_10THS 0xdc08
#define CIA1_TOD_SECONDS 0xdc09
#define CIA1_TOD_MINUTES 0xdc0a
#define CIA1_TOD_HOURS 0xdc0b
#define CIA1_SERIAL_DATA 0xdc0c
#define CIA1_INTERRUPT_CONTROL 0xdc0d
#define CIA1_CONTROL_A 0xdc0e
#define CIA1_CONTROL_B 0xdc0f
#define CIA2_BASE 0xdd00
#define CIA2_PRA 0xdd00
#define CIA2_PRB 0xdd01
#define CIA2_DDRA 0xdd02
#define CIA2_DDRB 0xdd03
#define CIA2_TIMER_A_LO 0xdd04
#define CIA2_TIMER_A_HI 0xdd05
#define CIA2_TIMER_B_LO 0xdd06
#define CIA2_TIMER_B_HI 0xdd07
#define CIA2_TOD_10THS 0xdd08
#define CIA2_TOD_SECONDS 0xdd09
#define CIA2_TOD_MINUTES 0xdd0a
#define CIA2_TOD_HOURS 0xdd0b
#define CIA2_SERIAL_DATA 0xdd0c
#define CIA2_INTERRUPT_CONTROL 0xdd0d
#define CIA2_CONTROL_A 0xdd0e
#define CIA2_CONTROL_B 0xdd0f
#define CIA1 ((volatile c64_cia_registers*)CIA1_BASE)
#define CIA2 ((volatile c64_cia_registers*)CIA2_BASE)
#define KEYBOARD_COLUMN_PORT 0xdc00
#define KEYBOARD_ROW_PORT 0xdc01
#define KEYBOARD_COLUMN_DDR 0xdc02
#define KEYBOARD_ROW_DDR 0xdc03
#define KEYBOARD_ACTIVE_MASK 0xff
#define JOYPORT_1 0xdc01
#define JOYPORT_2 0xdc00
/* Joystick masks are active-low: (sample & JOY_FIRE) == 0 means pressed. */
#define JOY_UP 0x01
#define JOY_DOWN 0x02
#define JOY_LEFT 0x04
#define JOY_RIGHT 0x08
#define JOY_FIRE 0x10
#define JOY_ACTIVE_LOW 0x00
#define JOY_RELEASED_MASK 0x1f
#define JOY2_UP() (!(CIA1->pra & JOY_UP))
#define JOY2_DOWN() (!(CIA1->pra & JOY_DOWN))
#define JOY2_LEFT() (!(CIA1->pra & JOY_LEFT))
#define JOY2_RIGHT() (!(CIA1->pra & JOY_RIGHT))
#define JOY2_FIRE() (!(CIA1->pra & JOY_FIRE))
#define JOY_UP_P(v) (!((v) & JOY_UP))
#define JOY_DOWN_P(v) (!((v) & JOY_DOWN))
#define JOY_LEFT_P(v) (!((v) & JOY_LEFT))
#define JOY_RIGHT_P(v) (!((v) & JOY_RIGHT))
#define JOY_FIRE_P(v) (!((v) & JOY_FIRE))
/* Convenience aliases. */
#define VIC_BORDER_COLOR VIC_BORDER
#define VIC_BACKGROUND_COLOR VIC_BACKGROUND
#define VIC_SPRITE_POINTERS VIC_SPRITE_POINTER_BASE
#define BORDER_COLOR VIC->border_color
#define BACKGROUND_COLOR VIC->background_color0
#define SPRITE_ENABLE VIC->sprite_enable
#define SPRITE_MULTICOLOR VIC->sprite_multicolor
/* Common KERNAL entry points. */
#define KERNAL_CHROUT 0xffd2
#define KERNAL_CHRIN 0xffcf
#define KERNAL_READST 0xffb7
#define KERNAL_OPEN 0xffc0
#define KERNAL_CLOSE 0xffc3
#define KERNAL_CHKIN 0xffc6
#define KERNAL_CHKOUT 0xffc9
#define KERNAL_CLRCHN 0xffcc
#define KERNAL_GETIN 0xffe4
#define KERNAL_SCNKEY 0xff9f
#define KERNAL_PLOT 0xfff0
#define KERNAL_SETLFS 0xffba
#define KERNAL_SETNAM 0xffbd
#define KERNAL_LOAD 0xffd5
#define KERNAL_SAVE 0xffd8
#endif
c64lib/64spec.h
Browser-native c64lib assertion and machine-readable test-result declarations.
Included headers: <stdint.h>.
Functions:
| Name | Prototype | Description | Typical use |
|---|---|---|---|
c64lib_64spec_reset | void c64lib_64spec_reset(void) | Resets the machine-readable 64spec counters before a test run. | c64lib_64spec_reset(); |
c64lib_64spec_assert_equal | void c64lib_64spec_assert_equal(uint8_t actual, uint8_t expected) | Records a passed or failed byte equality assertion in the active 64spec result block. | c64lib_64spec_assert_equal(actual, expected); |
c64lib_64spec_assert_not_equal | void c64lib_64spec_assert_not_equal(uint8_t actual, uint8_t expected) | Records whether two byte values differ. | c64lib_64spec_assert_not_equal(actual, expected); |
c64lib_64spec_assert_unsigned_less | void c64lib_64spec_assert_unsigned_less(uint8_t actual, uint8_t expected) | Records an unsigned less-than assertion. | c64lib_64spec_assert_unsigned_less(actual, expected); |
c64lib_64spec_assert_unsigned_less_or_equal | void c64lib_64spec_assert_unsigned_less_or_equal(uint8_t actual, uint8_t expected) | Records an unsigned less-than-or-equal assertion. | c64lib_64spec_assert_unsigned_less_or_equal(actual, expected); |
c64lib_64spec_assert_unsigned_greater | void c64lib_64spec_assert_unsigned_greater(uint8_t actual, uint8_t expected) | Records an unsigned greater-than assertion. | c64lib_64spec_assert_unsigned_greater(actual, expected); |
c64lib_64spec_assert_unsigned_greater_or_equal | void c64lib_64spec_assert_unsigned_greater_or_equal(uint8_t actual, uint8_t expected) | Records an unsigned greater-than-or-equal assertion. | c64lib_64spec_assert_unsigned_greater_or_equal(actual, expected); |
c64lib_64spec_assert_mask_set | void c64lib_64spec_assert_mask_set(uint8_t actual, uint8_t mask) | Records whether every selected bit is set. | c64lib_64spec_assert_mask_set(value, mask); |
c64lib_64spec_assert_mask_clear | void c64lib_64spec_assert_mask_clear(uint8_t actual, uint8_t mask) | Records whether every selected bit is clear. | c64lib_64spec_assert_mask_clear(value, mask); |
c64lib_64spec_assert_bytes_equal | void c64lib_64spec_assert_bytes_equal(const uint8_t *actual, const uint8_t *expected, uint16_t count) | Compares two byte ranges and records equality. | c64lib_64spec_assert_bytes_equal(actual, expected, count); |
c64lib_64spec_assert_bytes_not_equal | void c64lib_64spec_assert_bytes_not_equal(const uint8_t *actual, const uint8_t *expected, uint16_t count) | Compares two byte ranges and records that at least one byte differs. | c64lib_64spec_assert_bytes_not_equal(actual, expected, count); |
c64lib_64spec_finish | void c64lib_64spec_finish(void) | Finalizes the machine-readable 64spec result status. | c64lib_64spec_finish(); |
Structs:
| Name | Description | Field summary |
|---|---|---|
C64lib64specResult | Public struct declared by <c64lib/64spec.h>. | uint8_t magic[2], uint8_t status, uint16_t passed, uint16_t failed |
Macros:
| Name | Value | Description |
|---|---|---|
C64LIB_64SPEC_STATUS_IDLE | 0 | Macro constant exported by the header. |
C64LIB_64SPEC_STATUS_RUNNING | 1 | Macro constant exported by the header. |
C64LIB_64SPEC_STATUS_PASSED | 2 | Macro constant exported by the header. |
C64LIB_64SPEC_STATUS_FAILED | 3 | Macro constant exported by the header. |
Header listing:
#ifndef WEB64_C64LIB_64SPEC_H
#define WEB64_C64LIB_64SPEC_H
#include <stdint.h>
#define C64LIB_64SPEC_STATUS_IDLE 0
#define C64LIB_64SPEC_STATUS_RUNNING 1
#define C64LIB_64SPEC_STATUS_PASSED 2
#define C64LIB_64SPEC_STATUS_FAILED 3
typedef struct {
uint8_t magic[2];
uint8_t status;
uint16_t passed;
uint16_t failed;
} C64lib64specResult;
void c64lib_64spec_reset(void);
void c64lib_64spec_assert_equal(uint8_t actual, uint8_t expected);
void c64lib_64spec_assert_not_equal(uint8_t actual, uint8_t expected);
void c64lib_64spec_assert_unsigned_less(uint8_t actual, uint8_t expected);
void c64lib_64spec_assert_unsigned_less_or_equal(uint8_t actual, uint8_t expected);
void c64lib_64spec_assert_unsigned_greater(uint8_t actual, uint8_t expected);
void c64lib_64spec_assert_unsigned_greater_or_equal(uint8_t actual, uint8_t expected);
void c64lib_64spec_assert_mask_set(uint8_t actual, uint8_t mask);
void c64lib_64spec_assert_mask_clear(uint8_t actual, uint8_t mask);
void c64lib_64spec_assert_bytes_equal(const uint8_t *actual, const uint8_t *expected, uint16_t count);
void c64lib_64spec_assert_bytes_not_equal(const uint8_t *actual, const uint8_t *expected, uint16_t count);
void c64lib_64spec_finish(void);
extern volatile C64lib64specResult c64lib_64spec_result;
#endif
c64lib/bitmap.h
Official six-byte c64lib bitmap tile-configuration layout adapted for C.
Included headers: <stdint.h>.
Structs:
| Name | Description | Field summary |
|---|---|---|
C64libBitmapTileConfig | Public struct declared by <c64lib/bitmap.h>. | 6 fields: uint8_t tile_width, uint8_t tile_height, uint8_t left, uint8_t right, ... |
Macros:
| Name | Value | Description |
|---|---|---|
C64LIB_BITMAP_TILE_CONFIG_SIZE | 6 | Macro constant exported by the header. |
Header listing:
#ifndef WEB64_C64LIB_BITMAP_H
#define WEB64_C64LIB_BITMAP_H
#include <stdint.h>
#define C64LIB_BITMAP_TILE_CONFIG_SIZE 6
typedef struct {
uint8_t tile_width;
uint8_t tile_height;
uint8_t left;
uint8_t right;
uint8_t top;
uint8_t bottom;
} C64libBitmapTileConfig;
#endif
c64lib/chipset.h
Web64-native c64lib CIA, memory-banking, raster, VIC-II, and sprite compatibility declarations.
Included headers: <stdint.h>.
Functions:
| Name | Prototype | Description | Typical use |
|---|---|---|---|
c64lib_set_vic_bank | void c64lib_set_vic_bank(uint8_t bank) | Selects one of the four VIC-II 16 KiB banks through CIA 2. | c64lib_set_vic_bank(C64LIB_BANK_1); |
c64lib_disable_cia_interrupts | void c64lib_disable_cia_interrupts(void) | Masks CIA 1 and CIA 2 interrupt sources before installing a custom raster interrupt owner. | c64lib_disable_cia_interrupts(); |
c64lib_configure_memory | void c64lib_configure_memory(uint8_t config) | Writes the low three MOS 6510 processor-port memory-configuration bits while preserving the remaining bits. | c64lib_configure_memory(C64LIB_RAM_IO_KERNAL); |
c64lib_set_raster | void c64lib_set_raster(uint16_t raster) | Sets the complete nine-bit VIC-II raster compare value. | c64lib_set_raster(250); |
c64lib_detect_ntsc | uint8_t c64lib_detect_ntsc(void) | Returns nonzero when VIC-II timing is detected as NTSC. | uint8_t ntsc = c64lib_detect_ntsc(); |
c64lib_sprite_set_x | void c64lib_sprite_set_x(uint8_t sprite, uint16_t x) | Sets a sprite X coordinate and updates the corresponding ninth-bit register flag. | c64lib_sprite_set_x(0, 280); |
c64lib_sprite_set_y | void c64lib_sprite_set_y(uint8_t sprite, uint8_t y) | Sets a sprite Y coordinate. | c64lib_sprite_set_y(0, 120); |
c64lib_sprite_set_position | void c64lib_sprite_set_position(uint8_t sprite, uint16_t x, uint8_t y) | Sets a sprite X coordinate including its ninth bit and its byte-sized Y coordinate. | c64lib_sprite_set_position(0, 280, 120); |
Macros:
| Name | Value | Description | |
|---|---|---|---|
C64LIB_RAM_RAM_RAM | 0 | Macro constant exported by the header. | |
C64LIB_RAM_CHAR_RAM | 1 | Macro constant exported by the header. | |
C64LIB_RAM_CHAR_KERNAL | 2 | Macro constant exported by the header. | |
C64LIB_BASIC_CHAR_KERNAL | 3 | Macro constant exported by the header. | |
C64LIB_RAM_IO_RAM | 5 | Macro constant exported by the header. | |
C64LIB_RAM_IO_KERNAL | 6 | Macro constant exported by the header. | |
C64LIB_BASIC_IO_KERNAL | 7 | Macro constant exported by the header. | |
C64LIB_BANK_0 | 3 | Macro constant exported by the header. | |
C64LIB_BANK_1 | 2 | Macro constant exported by the header. | |
C64LIB_BANK_2 | 1 | Macro constant exported by the header. | |
C64LIB_BANK_3 | 0 | Macro constant exported by the header. | |
C64LIB_STANDARD_TEXT_MODE | 0 | Macro constant exported by the header. | |
C64LIB_MULTICOLOR_TEXT_MODE | 1 | Macro constant exported by the header. | |
C64LIB_STANDARD_BITMAP_MODE | 2 | Macro constant exported by the header. | |
C64LIB_MULTICOLOR_BITMAP_MODE | 3 | Macro constant exported by the header. | |
C64LIB_EXTENDED_TEXT_MODE | 4 | Macro constant exported by the header. | |
C64LIB_IRQ_LIGHTPEN | 8 | Macro constant exported by the header. | |
C64LIB_IRQ_SPRITE_SPRITE | 4 | Macro constant exported by the header. | |
C64LIB_IRQ_SPRITE_BACKGROUND | 2 | Macro constant exported by the header. | |
C64LIB_IRQ_RASTER | 1 | Macro constant exported by the header. | |
C64LIB_JOY_UP | 1 | Macro constant exported by the header. | |
C64LIB_JOY_DOWN | 2 | Macro constant exported by the header. | |
C64LIB_JOY_LEFT | 4 | Macro constant exported by the header. | |
C64LIB_JOY_RIGHT | 8 | Macro constant exported by the header. | |
C64LIB_JOY_FIRE | 16 | Macro constant exported by the header. | |
C64LIB_TEXT_OFFSET(x, y) | ((uint16_t)(x) + ((uint16_t)(y) * 40u)) | Typed pointer or expression macro. | |
C64LIB_TEXT_MEMORY(screen_slot, charset_slot) | `((uint8_t)(((screen_slot) << 4) \ | ((charset_slot) << 1)))` | Typed pointer or expression macro. |
C64LIB_BITMAP_MEMORY(screen_slot, bitmap_slot) | `((uint8_t)(((screen_slot) << 4) \ | ((bitmap_slot) << 3)))` | Typed pointer or expression macro. |
Header listing:
#ifndef WEB64_C64LIB_CHIPSET_H
#define WEB64_C64LIB_CHIPSET_H
#include <stdint.h>
#define C64LIB_RAM_RAM_RAM 0
#define C64LIB_RAM_CHAR_RAM 1
#define C64LIB_RAM_CHAR_KERNAL 2
#define C64LIB_BASIC_CHAR_KERNAL 3
#define C64LIB_RAM_IO_RAM 5
#define C64LIB_RAM_IO_KERNAL 6
#define C64LIB_BASIC_IO_KERNAL 7
#define C64LIB_BANK_0 3
#define C64LIB_BANK_1 2
#define C64LIB_BANK_2 1
#define C64LIB_BANK_3 0
#define C64LIB_STANDARD_TEXT_MODE 0
#define C64LIB_MULTICOLOR_TEXT_MODE 1
#define C64LIB_STANDARD_BITMAP_MODE 2
#define C64LIB_MULTICOLOR_BITMAP_MODE 3
#define C64LIB_EXTENDED_TEXT_MODE 4
#define C64LIB_IRQ_LIGHTPEN 8
#define C64LIB_IRQ_SPRITE_SPRITE 4
#define C64LIB_IRQ_SPRITE_BACKGROUND 2
#define C64LIB_IRQ_RASTER 1
#define C64LIB_JOY_UP 1
#define C64LIB_JOY_DOWN 2
#define C64LIB_JOY_LEFT 4
#define C64LIB_JOY_RIGHT 8
#define C64LIB_JOY_FIRE 16
#define C64LIB_TEXT_OFFSET(x, y) ((uint16_t)(x) + ((uint16_t)(y) * 40u))
#define C64LIB_TEXT_MEMORY(screen_slot, charset_slot) ((uint8_t)(((screen_slot) << 4) | ((charset_slot) << 1)))
#define C64LIB_BITMAP_MEMORY(screen_slot, bitmap_slot) ((uint8_t)(((screen_slot) << 4) | ((bitmap_slot) << 3)))
void c64lib_set_vic_bank(uint8_t bank);
void c64lib_disable_cia_interrupts(void);
void c64lib_configure_memory(uint8_t config);
void c64lib_set_raster(uint16_t raster);
uint8_t c64lib_detect_ntsc(void);
void c64lib_sprite_set_x(uint8_t sprite, uint16_t x);
void c64lib_sprite_set_y(uint8_t sprite, uint8_t y);
void c64lib_sprite_set_position(uint8_t sprite, uint16_t x, uint8_t y);
#endif
c64lib/common.h
Web64-native c64lib memory copy, fill, RLE, and optional Exomizer P39 compatibility routines.
Included headers: <stdint.h>, <stddef.h>.
Functions:
| Name | Prototype | Description | Typical use |
|---|---|---|---|
c64lib_decompress_rle | void c64lib_decompress_rle(const uint8_t *source, uint8_t *destination) | Expands a c64lib-compatible RLE stream terminated by its end marker into destination memory. | c64lib_decompress_rle(packed, screen); |
c64lib_exomizer_decrunch | void c64lib_exomizer_decrunch(const uint8_t *source_end) | Decrunches a backward Exomizer 3.1.2 P39 mem stream. source_end points one byte past the stream. | c64lib_exomizer_decrunch(...) |
c64lib_copy_large_forward | void c64lib_copy_large_forward(const void *source, void *destination, uint16_t count) | Copies a byte range from its beginning toward its end. | c64lib_copy_large_forward(source, destination, count); |
c64lib_copy_large_backward | void c64lib_copy_large_backward(const void *source, void *destination, uint16_t count) | Copies a byte range from its end toward its beginning for overlap-safe downward movement. | c64lib_copy_large_backward(source, destination, count); |
c64lib_fill_memory | void c64lib_fill_memory(void *destination, uint8_t value, uint16_t count) | Fills an arbitrary byte range with one value. | c64lib_fill_memory(buffer, 0, sizeof(buffer)); |
c64lib_fill_screen | void c64lib_fill_screen(void *destination, uint8_t value) | Fills exactly 1000 bytes from the supplied screen address. | c64lib_fill_screen((void*)0x0400, 32); |
c64lib_rotate_memory_right | void c64lib_rotate_memory_right(void *address, uint8_t count) | Rotates each byte in a memory range right by one bit. | c64lib_rotate_memory_right(data, count); |
Macros:
| Name | Value | Description |
|---|---|---|
WEB64_C64LIB_COMPAT_VERSION | 2 | Macro constant exported by the header. |
Header listing:
#ifndef WEB64_C64LIB_COMMON_H
#define WEB64_C64LIB_COMMON_H
#include <stdint.h>
#include <stddef.h>
#define WEB64_C64LIB_COMPAT_VERSION 2
void c64lib_decompress_rle(const uint8_t *source, uint8_t *destination);
/* Decrunches a backward Exomizer 3.1.2 P39 mem stream. source_end points one byte past the stream. */
void c64lib_exomizer_decrunch(const uint8_t *source_end);
void c64lib_copy_large_forward(const void *source, void *destination, uint16_t count);
void c64lib_copy_large_backward(const void *source, void *destination, uint16_t count);
void c64lib_fill_memory(void *destination, uint8_t value, uint16_t count);
void c64lib_fill_screen(void *destination, uint8_t value);
void c64lib_rotate_memory_right(void *address, uint8_t count);
#endif
c64lib/copper64.h
Adapted copper64 four-byte display-list entries, handler identifiers, and start/stop routines.
Included headers: <stdint.h>.
Structs:
| Name | Description | Field summary |
|---|---|---|
C64libCopperEntry | Public struct declared by <c64lib/copper64.h>. | uint8_t control, uint8_t raster, uint8_t arg1, uint8_t arg2 |
Macros:
| Name | Value | Description |
|---|---|---|
C64LIB_IRQH_BORDER_COL | 1 | Macro constant exported by the header. |
C64LIB_IRQH_BG_COL_0 | 2 | Macro constant exported by the header. |
C64LIB_IRQH_BG_COL_1 | 3 | Macro constant exported by the header. |
C64LIB_IRQH_BG_COL_2 | 4 | Macro constant exported by the header. |
C64LIB_IRQH_BG_COL_3 | 5 | Macro constant exported by the header. |
C64LIB_IRQH_BORDER_BG_0_COL | 6 | Macro constant exported by the header. |
C64LIB_IRQH_BORDER_BG_0_DIFF | 7 | Macro constant exported by the header. |
C64LIB_IRQH_MEM_BANK | 8 | Macro constant exported by the header. |
C64LIB_IRQH_MODE_MEM | 9 | Macro constant exported by the header. |
C64LIB_IRQH_JSR | 10 | Macro constant exported by the header. |
C64LIB_IRQH_MODE_HIRES_BITMAP | 11 | Macro constant exported by the header. |
C64LIB_IRQH_MODE_MULTIC_BITMAP | 12 | Macro constant exported by the header. |
C64LIB_IRQH_MODE_HIRES_TEXT | 13 | Macro constant exported by the header. |
C64LIB_IRQH_MODE_MULTIC_TEXT | 14 | Macro constant exported by the header. |
C64LIB_IRQH_MODE_EXTENDED_TEXT | 15 | Macro constant exported by the header. |
C64LIB_IRQH_FULL_RASTER_BAR | 16 | Macro constant exported by the header. |
C64LIB_IRQH_BG_RASTER_BAR | 17 | Macro constant exported by the header. |
C64LIB_IRQH_HSCROLL | 18 | Macro constant exported by the header. |
C64LIB_IRQH_HSCROLL_MAP | 19 | Macro constant exported by the header. |
C64LIB_IRQH_MEMORY_CONTROL | 20 | Macro constant exported by the header. |
C64LIB_IRQH_VSCROLL | 21 | Macro constant exported by the header. |
C64LIB_IRQH_VSCROLL_NTSC | 22 | Macro constant exported by the header. |
C64LIB_IRQH_SKIP | 0 | Macro constant exported by the header. |
C64LIB_IRQH_LOOP | 255 | Macro constant exported by the header. |
Header listing:
#ifndef WEB64_C64LIB_COPPER64_H
#define WEB64_C64LIB_COPPER64_H
#include <stdint.h>
#define C64LIB_IRQH_BORDER_COL 1
#define C64LIB_IRQH_BG_COL_0 2
#define C64LIB_IRQH_BG_COL_1 3
#define C64LIB_IRQH_BG_COL_2 4
#define C64LIB_IRQH_BG_COL_3 5
#define C64LIB_IRQH_BORDER_BG_0_COL 6
#define C64LIB_IRQH_BORDER_BG_0_DIFF 7
#define C64LIB_IRQH_MEM_BANK 8
#define C64LIB_IRQH_MODE_MEM 9
#define C64LIB_IRQH_JSR 10
#define C64LIB_IRQH_MODE_HIRES_BITMAP 11
#define C64LIB_IRQH_MODE_MULTIC_BITMAP 12
#define C64LIB_IRQH_MODE_HIRES_TEXT 13
#define C64LIB_IRQH_MODE_MULTIC_TEXT 14
#define C64LIB_IRQH_MODE_EXTENDED_TEXT 15
#define C64LIB_IRQH_FULL_RASTER_BAR 16
#define C64LIB_IRQH_BG_RASTER_BAR 17
#define C64LIB_IRQH_HSCROLL 18
#define C64LIB_IRQH_HSCROLL_MAP 19
#define C64LIB_IRQH_MEMORY_CONTROL 20
#define C64LIB_IRQH_VSCROLL 21
#define C64LIB_IRQH_VSCROLL_NTSC 22
#define C64LIB_IRQH_SKIP 0
#define C64LIB_IRQH_LOOP 255
typedef struct { uint8_t control; uint8_t raster; uint8_t arg1; uint8_t arg2; } C64libCopperEntry;
void c64lib_copper_start(const C64libCopperEntry *list);
void c64lib_copper_stop(void);
#endif
c64lib/magic-desk.h
Magic Desk cartridge target, bank-selection, and browser-native loader declarations.
Included headers: <stdint.h>.
Functions:
| Name | Prototype | Description | Typical use |
|---|---|---|---|
c64lib_magic_desk_set_target | void c64lib_magic_desk_set_target(void *target) | Sets the RAM destination for the next Magic Desk bank-copy operation. | c64lib_magic_desk_set_target((void*)0x4000); |
c64lib_magic_desk_copy | void c64lib_magic_desk_copy(uint8_t first_bank, uint16_t size) | Copies a byte range from consecutive Magic Desk banks into the current target address. | c64lib_magic_desk_copy(firstBank, size); |
Macros:
| Name | Value | Description |
|---|---|---|
C64LIB_MAGIC_DESK_BANK_SELECT | 0xde00u | Macro constant exported by the header. |
C64LIB_MAGIC_DESK_WINDOW | 0x8000u | Macro constant exported by the header. |
C64LIB_MAGIC_DESK_BANK_SIZE | 0x2000u | Macro constant exported by the header. |
C64LIB_MAGIC_DESK_CARTRIDGE_TYPE | 19u | Macro constant exported by the header. |
c64lib_magic_desk_load | c64lib_magic_desk_copy | Macro constant exported by the header. |
Header listing:
#ifndef WEB64_C64LIB_MAGIC_DESK_H
#define WEB64_C64LIB_MAGIC_DESK_H
#include <stdint.h>
#define C64LIB_MAGIC_DESK_BANK_SELECT 0xde00u
#define C64LIB_MAGIC_DESK_WINDOW 0x8000u
#define C64LIB_MAGIC_DESK_BANK_SIZE 0x2000u
#define C64LIB_MAGIC_DESK_CARTRIDGE_TYPE 19u
void c64lib_magic_desk_set_target(void *target);
void c64lib_magic_desk_copy(uint8_t first_bank, uint16_t size);
#define c64lib_magic_desk_load c64lib_magic_desk_copy
#endif
c64lib/sprites.h
c64lib-compatible sprite register-address and mask helpers over the Web64 chipset module.
Included headers: <c64lib/chipset.h>.
Macros:
| Name | Value | Description |
|---|---|---|
C64LIB_SPRITE_MASK(sprite) | ((uint8_t)(1u << (sprite))) | Typed pointer or expression macro. |
C64LIB_SPRITE_X_REGISTER(sprite) | ((volatile uint8_t*)(0xd000u + ((uint16_t)(sprite) * 2u))) | Typed pointer or expression macro. |
C64LIB_SPRITE_Y_REGISTER(sprite) | ((volatile uint8_t*)(0xd001u + ((uint16_t)(sprite) * 2u))) | Typed pointer or expression macro. |
C64LIB_SPRITE_COLOR_REGISTER(sprite) | ((volatile uint8_t*)(0xd027u + (sprite))) | Typed pointer or expression macro. |
Header listing:
#ifndef WEB64_C64LIB_SPRITES_H
#define WEB64_C64LIB_SPRITES_H
#include <c64lib/chipset.h>
#define C64LIB_SPRITE_MASK(sprite) ((uint8_t)(1u << (sprite)))
#define C64LIB_SPRITE_X_REGISTER(sprite) ((volatile uint8_t*)(0xd000u + ((uint16_t)(sprite) * 2u)))
#define C64LIB_SPRITE_Y_REGISTER(sprite) ((volatile uint8_t*)(0xd001u + ((uint16_t)(sprite) * 2u)))
#define C64LIB_SPRITE_COLOR_REGISTER(sprite) ((volatile uint8_t*)(0xd027u + (sprite)))
#endif
c64lib/text.h
Web64-native c64lib text, hexadecimal output, scrolling, and stateful 2x2 Tile2 routines.
Included headers: <stdint.h>.
Functions:
| Name | Prototype | Description | Typical use |
|---|---|---|---|
c64lib_text_putxy | void c64lib_text_putxy(const char *text, uint8_t x, uint8_t y, uint8_t color) | Writes a zero-terminated text string at a screen position with a Color RAM value. | c64lib_text_putxy("READY", 2, 2, COLOR_WHITE); |
c64lib_text_hex8 | void c64lib_text_hex8(uint8_t value, uint8_t x, uint8_t y, uint8_t color) | Writes a byte as two hexadecimal characters at a screen position with a Color RAM value. | c64lib_text_hex8(value, 2, 2, COLOR_WHITE); |
c64lib_increment_text | void c64lib_increment_text(uint8_t *text, uint8_t count, uint8_t increment) | Adds a byte increment to each character in a zero-terminated mutable text buffer. | c64lib_increment_text(text, 1); |
c64lib_copy_screen_block | void c64lib_copy_screen_block(const uint8_t *source, uint8_t width, uint8_t height, uint16_t screen_target, const uint8_t *color_source, uint16_t color_target) | Copies a rectangular screen region and applies caller-provided character color values. | c64lib_copy_screen_block(source, screen, colors, width, height); |
c64lib_scroll1x1 | void c64lib_scroll1x1(uint16_t screen_address) | Scrolls a 40x25 character matrix upward by one character row. | c64lib_scroll1x1(0x0400); |
c64lib_shift_left | void c64lib_shift_left(uint16_t address, uint8_t start_row, uint8_t end_row) | Shifts a bounded screen and Color RAM region left by one character. | c64lib_shift_left(screen, colors, width, height); |
c64lib_shift_right | void c64lib_shift_right(uint16_t address, uint8_t start_row, uint8_t end_row) | Shifts a bounded screen and Color RAM region right by one character. | c64lib_shift_right(screen, colors, width, height); |
c64lib_shift_up | void c64lib_shift_up(uint16_t address, uint8_t start_row, uint8_t end_row) | Shifts a bounded screen and Color RAM region up by one character row. | c64lib_shift_up(screen, colors, width, height); |
c64lib_shift_down | void c64lib_shift_down(uint16_t address, uint8_t start_row, uint8_t end_row) | Shifts a bounded screen and Color RAM region down by one character row. | c64lib_shift_down(screen, colors, width, height); |
c64lib_draw_tile2 | void c64lib_draw_tile2(const uint8_t *characters, uint16_t screen_address, uint16_t color_address, uint8_t color) | Writes one 2x2 character tile and its color into caller-selected screen and Color RAM addresses. | c64lib_draw_tile2(tile, screen, colorRam, color); |
c64lib_tile2_init | void c64lib_tile2_init(const C64libTile2Config *config) | Function declared by <c64lib/text.h>. | c64lib_tile2_init(...) |
c64lib_tile2_render | void c64lib_tile2_render(void) | Function declared by <c64lib/text.h>. | c64lib_tile2_render(...) |
c64lib_tile2_scroll_left | void c64lib_tile2_scroll_left(void) | Function declared by <c64lib/text.h>. | c64lib_tile2_scroll_left(...) |
c64lib_tile2_scroll_right | void c64lib_tile2_scroll_right(void) | Function declared by <c64lib/text.h>. | c64lib_tile2_scroll_right(...) |
c64lib_tile2_scroll_up | void c64lib_tile2_scroll_up(void) | Function declared by <c64lib/text.h>. | c64lib_tile2_scroll_up(...) |
c64lib_tile2_scroll_down | void c64lib_tile2_scroll_down(void) | Function declared by <c64lib/text.h>. | c64lib_tile2_scroll_down(...) |
c64lib_tile2_material_at | uint8_t c64lib_tile2_material_at(uint8_t x, uint8_t y) | Function declared by <c64lib/text.h>. | c64lib_tile2_material_at(...) |
Structs:
| Name | Description | Field summary |
|---|---|---|
C64libTile2Config | Public struct declared by <c64lib/text.h>. | 19 fields: const uint8_t *map, const uint8_t *tile_planes, const uint8_t *block_colors, const uint8_t *block_materials, ... |
Header listing:
#ifndef WEB64_C64LIB_TEXT_H
#define WEB64_C64LIB_TEXT_H
#include <stdint.h>
void c64lib_text_putxy(const char *text, uint8_t x, uint8_t y, uint8_t color);
void c64lib_text_hex8(uint8_t value, uint8_t x, uint8_t y, uint8_t color);
void c64lib_increment_text(uint8_t *text, uint8_t count, uint8_t increment);
void c64lib_copy_screen_block(const uint8_t *source, uint8_t width, uint8_t height, uint16_t screen_target, const uint8_t *color_source, uint16_t color_target);
void c64lib_scroll1x1(uint16_t screen_address);
void c64lib_shift_left(uint16_t address, uint8_t start_row, uint8_t end_row);
void c64lib_shift_right(uint16_t address, uint8_t start_row, uint8_t end_row);
void c64lib_shift_up(uint16_t address, uint8_t start_row, uint8_t end_row);
void c64lib_shift_down(uint16_t address, uint8_t start_row, uint8_t end_row);
void c64lib_draw_tile2(const uint8_t *characters, uint16_t screen_address, uint16_t color_address, uint8_t color);
typedef struct {
const uint8_t *map;
const uint8_t *tile_planes;
const uint8_t *block_colors;
const uint8_t *block_materials;
const uint8_t *map_colors;
const uint8_t *map_materials;
uint8_t *screen;
uint8_t *color_ram;
uint8_t *row_offsets_lo;
uint8_t *row_offsets_hi;
uint8_t map_width;
uint8_t map_height;
uint8_t screen_width;
uint8_t screen_height;
uint8_t start_row;
uint8_t end_row;
uint16_t map_x;
uint16_t map_y;
uint8_t default_color;
} C64libTile2Config;
void c64lib_tile2_init(const C64libTile2Config *config);
void c64lib_tile2_render(void);
void c64lib_tile2_scroll_left(void);
void c64lib_tile2_scroll_right(void);
void c64lib_tile2_scroll_up(void);
void c64lib_tile2_scroll_down(void);
uint8_t c64lib_tile2_material_at(uint8_t x, uint8_t y);
#endif
c64lib/vic2.h
c64lib-compatible VIC-II register names mapped to the typed Web64 C64 header.
Included headers: <c64lib/chipset.h>, <c64.h>.
Macros:
| Name | Value | Description |
|---|---|---|
C64LIB_VIC2 | VIC_BASE | Macro constant exported by the header. |
C64LIB_RASTER | VIC_RASTER | Macro constant exported by the header. |
C64LIB_CONTROL_1 | VIC_CONTROL1 | Macro constant exported by the header. |
C64LIB_CONTROL_2 | VIC_CONTROL2 | Macro constant exported by the header. |
C64LIB_MEMORY_CONTROL | VIC_MEMORY_CONTROL | Macro constant exported by the header. |
C64LIB_BORDER_COLOR | VIC_BORDER | Macro constant exported by the header. |
C64LIB_BACKGROUND_COLOR_0 | VIC_BACKGROUND0 | Macro constant exported by the header. |
Header listing:
#ifndef WEB64_C64LIB_VIC2_H
#define WEB64_C64LIB_VIC2_H
#include <c64lib/chipset.h>
#include <c64.h>
#define C64LIB_VIC2 VIC_BASE
#define C64LIB_RASTER VIC_RASTER
#define C64LIB_CONTROL_1 VIC_CONTROL1
#define C64LIB_CONTROL_2 VIC_CONTROL2
#define C64LIB_MEMORY_CONTROL VIC_MEMORY_CONTROL
#define C64LIB_BORDER_COLOR VIC_BORDER
#define C64LIB_BACKGROUND_COLOR_0 VIC_BACKGROUND0
#endif
cbm.h
Dependency-linked low-level KERNAL channel, load, save, and status wrappers.
Included headers: <stdint.h>, <c64.h>.
Functions:
| Name | Prototype | Description | Typical use | |
|---|---|---|---|---|
cbm_k_readst | uint8_t cbm_k_readst(void) | Returns the current KERNAL I/O status byte. | status = cbm_k_readst(); | |
cbm_k_last_error | uint16_t cbm_k_last_error(void) | 0 on success; otherwise 0x0100 \ | KERNAL A (including STOP code 0). | cbm_k_last_error(...) |
cbm_k_setlfs | void cbm_k_setlfs(uint8_t logical_file, uint8_t device, uint8_t secondary) | Configures KERNAL logical file, device, and secondary address values. | cbm_k_setlfs(2, 8, 2); | |
cbm_k_setnam | void cbm_k_setnam(const char *name, uint8_t length) | Configures the KERNAL filename pointer and length. | cbm_k_setnam(WEB64_DISK_NAME("LEVEL1")); | |
cbm_k_open | uint8_t cbm_k_open(void) | Opens the KERNAL logical file configured by SETNAM/SETLFS and returns the status byte. | status = cbm_k_open(); | |
cbm_k_close | void cbm_k_close(uint8_t logical_file) | Closes a KERNAL logical file number. | cbm_k_close(2); | |
cbm_k_chkin | uint8_t cbm_k_chkin(uint8_t logical_file) | Selects an open logical file as the KERNAL input channel and returns the KERNAL status. | status = cbm_k_chkin(2); | |
cbm_k_chkout | uint8_t cbm_k_chkout(uint8_t logical_file) | Selects an open logical file as the KERNAL output channel and returns the KERNAL status. | status = cbm_k_chkout(2); | |
cbm_k_clrchn | void cbm_k_clrchn(void) | Restores the default KERNAL input and output channels. | cbm_k_clrchn(); | |
cbm_k_chrin | uint8_t cbm_k_chrin(void) | Reads one byte from the selected KERNAL input channel. | value = cbm_k_chrin(); | |
cbm_k_chrout | void cbm_k_chrout(uint8_t value) | Writes one byte to the selected KERNAL output channel. | cbm_k_chrout(value); | |
cbm_k_load | uint16_t cbm_k_load(uint8_t verify, uint16_t address) | Calls KERNAL LOAD or VERIFY using the name and device configured by SETNAM/SETLFS, returning the end address. | end = cbm_k_load(0, 0x4000); | |
cbm_k_save | uint8_t cbm_k_save(uint16_t start_address, uint16_t end_address) | Calls KERNAL SAVE for the configured name/device and address range. | status = cbm_k_save(0x4000, 0x4800); |
Macros:
| Name | Value | Description |
|---|---|---|
CHRIN | KERNAL_CHRIN | Macro constant exported by the header. |
CHROUT | KERNAL_CHROUT | Macro constant exported by the header. |
GETIN | KERNAL_GETIN | Macro constant exported by the header. |
READST | KERNAL_READST | Macro constant exported by the header. |
LOAD | KERNAL_LOAD | Macro constant exported by the header. |
SAVE | KERNAL_SAVE | Macro constant exported by the header. |
SETLFS | KERNAL_SETLFS | Macro constant exported by the header. |
SETNAM | KERNAL_SETNAM | Macro constant exported by the header. |
OPEN | KERNAL_OPEN | Macro constant exported by the header. |
CLOSE | KERNAL_CLOSE | Macro constant exported by the header. |
CHKIN | KERNAL_CHKIN | Macro constant exported by the header. |
CHKOUT | KERNAL_CHKOUT | Macro constant exported by the header. |
CLRCHN | KERNAL_CLRCHN | Macro constant exported by the header. |
Header listing:
#ifndef WEB64_CBM_H
#define WEB64_CBM_H
#include <stdint.h>
#include <c64.h>
#define CHRIN KERNAL_CHRIN
#define CHROUT KERNAL_CHROUT
#define GETIN KERNAL_GETIN
#define READST KERNAL_READST
#define LOAD KERNAL_LOAD
#define SAVE KERNAL_SAVE
#define SETLFS KERNAL_SETLFS
#define SETNAM KERNAL_SETNAM
#define OPEN KERNAL_OPEN
#define CLOSE KERNAL_CLOSE
#define CHKIN KERNAL_CHKIN
#define CHKOUT KERNAL_CHKOUT
#define CLRCHN KERNAL_CLRCHN
uint8_t cbm_k_readst(void);
/* 0 on success; otherwise 0x0100 | KERNAL A (including STOP code 0). */
uint16_t cbm_k_last_error(void);
void cbm_k_setlfs(uint8_t logical_file, uint8_t device, uint8_t secondary);
void cbm_k_setnam(const char *name, uint8_t length);
uint8_t cbm_k_open(void);
void cbm_k_close(uint8_t logical_file);
uint8_t cbm_k_chkin(uint8_t logical_file);
uint8_t cbm_k_chkout(uint8_t logical_file);
void cbm_k_clrchn(void);
uint8_t cbm_k_chrin(void);
void cbm_k_chrout(uint8_t value);
uint16_t cbm_k_load(uint8_t verify, uint16_t address);
uint8_t cbm_k_save(uint16_t start_address, uint16_t end_address);
#endif
conio.h
cc65-style screen and text helpers mapped onto the Web64 SDK surface.
Included headers: <stdint.h>, <c64.h>, <web64.h>.
Functions:
| Name | Prototype | Description | Typical use |
|---|---|---|---|
cputc | _fastcall int cputc(int ch) | Function declared by <conio.h>. (fastcall) | cputc(...) |
cputs | _fastcall int cputs(char *text) | Function declared by <conio.h>. (fastcall) | cputs(...) |
textcolor | _fastcall int textcolor(int color) | Function declared by <conio.h>. (fastcall) | textcolor(...) |
bordercolor | _fastcall int bordercolor(int color) | Function declared by <conio.h>. (fastcall) | bordercolor(...) |
bgcolor | _fastcall int bgcolor(int color) | Function declared by <conio.h>. (fastcall) | bgcolor(...) |
wherex | _fastcall int wherex(void) | Function declared by <conio.h>. (fastcall) | wherex(...) |
wherey | _fastcall int wherey(void) | Function declared by <conio.h>. (fastcall) | wherey(...) |
cputhex8 | _fastcall int cputhex8(int value) | Function declared by <conio.h>. (fastcall) | cputhex8(...) |
Macros:
| Name | Value | Description |
|---|---|---|
COLOR_BLACK | VIC_COLOR_BLACK | Color alias constant for VIC palette values. |
COLOR_WHITE | VIC_COLOR_WHITE | Color alias constant for VIC palette values. |
COLOR_RED | VIC_COLOR_RED | Color alias constant for VIC palette values. |
COLOR_CYAN | VIC_COLOR_CYAN | Color alias constant for VIC palette values. |
COLOR_PURPLE | VIC_COLOR_PURPLE | Color alias constant for VIC palette values. |
COLOR_GREEN | VIC_COLOR_GREEN | Color alias constant for VIC palette values. |
COLOR_BLUE | VIC_COLOR_BLUE | Color alias constant for VIC palette values. |
COLOR_YELLOW | VIC_COLOR_YELLOW | Color alias constant for VIC palette values. |
COLOR_ORANGE | VIC_COLOR_ORANGE | Color alias constant for VIC palette values. |
COLOR_BROWN | VIC_COLOR_BROWN | Color alias constant for VIC palette values. |
COLOR_LIGHTRED | VIC_COLOR_LIGHT_RED | Color alias constant for VIC palette values. |
COLOR_GRAY1 | VIC_COLOR_DARK_GRAY | Color alias constant for VIC palette values. |
COLOR_GRAY2 | VIC_COLOR_GRAY | Color alias constant for VIC palette values. |
COLOR_LIGHTGREEN | VIC_COLOR_LIGHT_GREEN | Color alias constant for VIC palette values. |
COLOR_LIGHTBLUE | VIC_COLOR_LIGHT_BLUE | Color alias constant for VIC palette values. |
COLOR_GRAY3 | VIC_COLOR_LIGHT_GRAY | Color alias constant for VIC palette values. |
CH_ENTER | 13 | Macro constant exported by the header. |
CH_ESC | 27 | Macro constant exported by the header. |
CH_DEL | 20 | Macro constant exported by the header. |
CH_CURS_LEFT | 157 | Macro constant exported by the header. |
CH_CURS_RIGHT | 29 | Macro constant exported by the header. |
CH_CURS_UP | 145 | Macro constant exported by the header. |
CH_CURS_DOWN | 17 | Macro constant exported by the header. |
Header listing:
#ifndef WEB64_CONIO_H
#define WEB64_CONIO_H
#include <stdint.h>
#include <c64.h>
#include <web64.h>
#define COLOR_BLACK VIC_COLOR_BLACK
#define COLOR_WHITE VIC_COLOR_WHITE
#define COLOR_RED VIC_COLOR_RED
#define COLOR_CYAN VIC_COLOR_CYAN
#define COLOR_PURPLE VIC_COLOR_PURPLE
#define COLOR_GREEN VIC_COLOR_GREEN
#define COLOR_BLUE VIC_COLOR_BLUE
#define COLOR_YELLOW VIC_COLOR_YELLOW
#define COLOR_ORANGE VIC_COLOR_ORANGE
#define COLOR_BROWN VIC_COLOR_BROWN
#define COLOR_LIGHTRED VIC_COLOR_LIGHT_RED
#define COLOR_GRAY1 VIC_COLOR_DARK_GRAY
#define COLOR_GRAY2 VIC_COLOR_GRAY
#define COLOR_LIGHTGREEN VIC_COLOR_LIGHT_GREEN
#define COLOR_LIGHTBLUE VIC_COLOR_LIGHT_BLUE
#define COLOR_GRAY3 VIC_COLOR_LIGHT_GRAY
extern _fastcall int cputc(int ch);
extern _fastcall int cputs(char *text);
extern _fastcall int textcolor(int color);
extern _fastcall int bordercolor(int color);
extern _fastcall int bgcolor(int color);
extern _fastcall int wherex(void);
extern _fastcall int wherey(void);
extern _fastcall int cputhex8(int value);
#define CH_ENTER 13
#define CH_ESC 27
#define CH_DEL 20
#define CH_CURS_LEFT 157
#define CH_CURS_RIGHT 29
#define CH_CURS_UP 145
#define CH_CURS_DOWN 17
#endif
ctype.h
ASCII-oriented character classification and case-conversion declarations backed by the Web64 runtime.
Functions:
| Name | Prototype | Description | Typical use |
|---|---|---|---|
isdigit | _fastcall int isdigit(int c) | Returns nonzero when the byte is an ASCII decimal digit. (fastcall) | if (isdigit(ch)) { ... } |
isalnum | _fastcall int isalnum(int c) | Returns nonzero when the byte is an ASCII letter or digit. (fastcall) | if (isalnum(ch)) { ... } |
isalpha | _fastcall int isalpha(int c) | Returns nonzero when the byte is an ASCII letter. (fastcall) | if (isalpha(ch)) { ... } |
iscntrl | _fastcall int iscntrl(int c) | Function declared by <ctype.h>. (fastcall) | iscntrl(...) |
isspace | _fastcall int isspace(int c) | Returns nonzero when the byte is an ASCII whitespace character. (fastcall) | if (isspace(ch)) { ... } |
isgraph | _fastcall int isgraph(int c) | Function declared by <ctype.h>. (fastcall) | isgraph(...) |
islower | _fastcall int islower(int c) | Returns nonzero when the byte is a lowercase ASCII letter. (fastcall) | if (islower(ch)) { ... } |
isprint | _fastcall int isprint(int c) | Function declared by <ctype.h>. (fastcall) | isprint(...) |
ispunct | _fastcall int ispunct(int c) | Function declared by <ctype.h>. (fastcall) | ispunct(...) |
isupper | _fastcall int isupper(int c) | Returns nonzero when the byte is an uppercase ASCII letter. (fastcall) | if (isupper(ch)) { ... } |
isxdigit | _fastcall int isxdigit(int c) | Function declared by <ctype.h>. (fastcall) | isxdigit(...) |
tolower | _fastcall int tolower(int c) | Converts an uppercase ASCII letter to lowercase when applicable. (fastcall) | ch = tolower(ch); |
toupper | _fastcall int toupper(int c) | Converts a lowercase ASCII letter to uppercase when applicable. (fastcall) | ch = toupper(ch); |
Header listing:
#ifndef WEB64_CTYPE_H
#define WEB64_CTYPE_H
/* Web64 tiny ctype parameter: c is the byte character/classification value in A for _fastcall calls. */
extern _fastcall int isdigit(int c);
extern _fastcall int isalnum(int c);
extern _fastcall int isalpha(int c);
extern _fastcall int iscntrl(int c);
extern _fastcall int isspace(int c);
extern _fastcall int isgraph(int c);
extern _fastcall int islower(int c);
extern _fastcall int isprint(int c);
extern _fastcall int ispunct(int c);
extern _fastcall int isupper(int c);
extern _fastcall int isxdigit(int c);
extern _fastcall int tolower(int c);
extern _fastcall int toupper(int c);
#endif
float.h
Web64 SDK header <float.h>.
Macros:
| Name | Value | Description |
|---|---|---|
FLT_RADIX | 2 | Macro constant exported by the header. |
FLT_ROUNDS | 1 | Macro constant exported by the header. |
FLT_MANT_DIG | 24 | Macro constant exported by the header. |
DBL_MANT_DIG | 53 | Macro constant exported by the header. |
LDBL_MANT_DIG | 53 | Macro constant exported by the header. |
FLT_DIG | 6 | Macro constant exported by the header. |
DBL_DIG | 15 | Macro constant exported by the header. |
LDBL_DIG | 15 | Macro constant exported by the header. |
FLT_MIN_EXP | (-125) | Macro constant exported by the header. |
DBL_MIN_EXP | (-1021) | Macro constant exported by the header. |
LDBL_MIN_EXP | (-1021) | Macro constant exported by the header. |
FLT_MIN_10_EXP | (-37) | Macro constant exported by the header. |
DBL_MIN_10_EXP | (-307) | Macro constant exported by the header. |
LDBL_MIN_10_EXP | (-307) | Macro constant exported by the header. |
FLT_MAX_EXP | 128 | Macro constant exported by the header. |
DBL_MAX_EXP | 1024 | Macro constant exported by the header. |
LDBL_MAX_EXP | 1024 | Macro constant exported by the header. |
FLT_MAX_10_EXP | 38 | Macro constant exported by the header. |
DBL_MAX_10_EXP | 308 | Macro constant exported by the header. |
LDBL_MAX_10_EXP | 308 | Macro constant exported by the header. |
FLT_MAX | 3.402823466e+38F | Macro constant exported by the header. |
DBL_MAX | 1.7976931348623157e+308 | Macro constant exported by the header. |
LDBL_MAX | 1.7976931348623157e+308L | Macro constant exported by the header. |
FLT_EPSILON | 1.192092896e-7F | Macro constant exported by the header. |
DBL_EPSILON | 2.2204460492503131e-16 | Macro constant exported by the header. |
LDBL_EPSILON | 2.2204460492503131e-16L | Macro constant exported by the header. |
FLT_MIN | 1.175494351e-38F | Macro constant exported by the header. |
DBL_MIN | 2.2250738585072014e-308 | Macro constant exported by the header. |
LDBL_MIN | 2.2250738585072014e-308L | Macro constant exported by the header. |
Header listing:
#ifndef WEB64_FLOAT_H
#define WEB64_FLOAT_H
#define FLT_RADIX 2
#define FLT_ROUNDS 1
#define FLT_MANT_DIG 24
#define DBL_MANT_DIG 53
#define LDBL_MANT_DIG 53
#define FLT_DIG 6
#define DBL_DIG 15
#define LDBL_DIG 15
#define FLT_MIN_EXP (-125)
#define DBL_MIN_EXP (-1021)
#define LDBL_MIN_EXP (-1021)
#define FLT_MIN_10_EXP (-37)
#define DBL_MIN_10_EXP (-307)
#define LDBL_MIN_10_EXP (-307)
#define FLT_MAX_EXP 128
#define DBL_MAX_EXP 1024
#define LDBL_MAX_EXP 1024
#define FLT_MAX_10_EXP 38
#define DBL_MAX_10_EXP 308
#define LDBL_MAX_10_EXP 308
#define FLT_MAX 3.402823466e+38F
#define DBL_MAX 1.7976931348623157e+308
#define LDBL_MAX 1.7976931348623157e+308L
#define FLT_EPSILON 1.192092896e-7F
#define DBL_EPSILON 2.2204460492503131e-16
#define LDBL_EPSILON 2.2204460492503131e-16L
#define FLT_MIN 1.175494351e-38F
#define DBL_MIN 2.2250738585072014e-308
#define LDBL_MIN 2.2250738585072014e-308L
#endif
joy.h
Minimal joystick helper for reading the active C64 port state.
Included headers: <stdint.h>, <c64.h>.
Functions:
| Name | Prototype | Description | Typical use |
|---|---|---|---|
joy_read | uint8_t joy_read(void) | Reads the current joystick bitfield from the configured port helper. | uint8_t state = joy_read(); |
Header listing:
#ifndef WEB64_JOY_H
#define WEB64_JOY_H
#include <stdint.h>
#include <c64.h>
uint8_t joy_read(void);
#endif
joystick.h
cc65-familiar joystick constants and helpers without native driver loading.
Included headers: <stdint.h>, <c64.h>.
Functions:
| Name | Prototype | Description | Typical use |
|---|---|---|---|
joy_read | _fastcall uint8_t joy_read(uint8_t port) | Reads the current joystick bitfield from the configured port helper. (fastcall) | uint8_t state = joy_read(); |
web64_joy_read | _fastcall uint8_t web64_joy_read(uint8_t port) | Web64 SDK runtime helper. (fastcall) | web64_joy_read(...) |
Macros:
| Name | Value | Description |
|---|---|---|
JOY_1 | 1 | Macro constant exported by the header. |
JOY_2 | 2 | Macro constant exported by the header. |
JOY_BTN_1 | JOY_FIRE | Macro constant exported by the header. |
Header listing:
#ifndef WEB64_JOYSTICK_H
#define WEB64_JOYSTICK_H
#include <stdint.h>
#include <c64.h>
#define JOY_1 1
#define JOY_2 2
#define JOY_BTN_1 JOY_FIRE
/* Raw active-low CIA sample: zero input bit = pressed; one = released. */
/* Use JOY_1 or JOY_2. Example: uint8_t joy = web64_joy_read(JOY_2); */
/* if ((joy & JOY_FIRE) == 0) { ... } JOY_LEFT/JOY_RIGHT use the same test. */
extern _fastcall uint8_t joy_read(uint8_t port);
extern _fastcall uint8_t web64_joy_read(uint8_t port);
#endif
libc.h
Aggregate convenience header over the dependency-linked Web64 standard library surface.
Included headers: <stddef.h>, <stdio.h>, <stdlib.h>, <string.h>, <ctype.h>.
Macros:
| Name | Value | Description |
|---|---|---|
INT_MAX | 0x7fff | Web64 aggregate convenience header. Implementations are linked only when called. |
INT_MIN | 0x8000 | Macro constant exported by the header. |
Header listing:
#ifndef WEB64_LIBC_H
#define WEB64_LIBC_H
/* Web64 aggregate convenience header. Implementations are linked only when called. */
#include <stddef.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#define INT_MAX 0x7fff
#define INT_MIN 0x8000
#endif
limits.h
Web64 SDK header <limits.h>.
Macros:
| Name | Value | Description |
|---|---|---|
CHAR_BIT | 8 | Macro constant exported by the header. |
SCHAR_MIN | (-127-1) | Macro constant exported by the header. |
SCHAR_MAX | 127 | Macro constant exported by the header. |
UCHAR_MAX | 255U | Macro constant exported by the header. |
CHAR_MIN | SCHAR_MIN | Macro constant exported by the header. |
CHAR_MAX | SCHAR_MAX | Macro constant exported by the header. |
MB_LEN_MAX | 1 | Macro constant exported by the header. |
SHRT_MIN | (-32767-1) | Macro constant exported by the header. |
SHRT_MAX | 32767 | Macro constant exported by the header. |
USHRT_MAX | 65535U | Macro constant exported by the header. |
INT_MIN | (-32767-1) | Macro constant exported by the header. |
INT_MAX | 32767 | Macro constant exported by the header. |
UINT_MAX | 65535U | Macro constant exported by the header. |
LONG_MIN | (-2147483647L-1L) | Macro constant exported by the header. |
LONG_MAX | 2147483647L | Macro constant exported by the header. |
ULONG_MAX | 4294967295UL | Macro constant exported by the header. |
Header listing:
#ifndef WEB64_LIMITS_H
#define WEB64_LIMITS_H
#define CHAR_BIT 8
#define SCHAR_MIN (-127-1)
#define SCHAR_MAX 127
#define UCHAR_MAX 255U
#define CHAR_MIN SCHAR_MIN
#define CHAR_MAX SCHAR_MAX
#define MB_LEN_MAX 1
#define SHRT_MIN (-32767-1)
#define SHRT_MAX 32767
#define USHRT_MAX 65535U
#define INT_MIN (-32767-1)
#define INT_MAX 32767
#define UINT_MAX 65535U
#define LONG_MIN (-2147483647L-1L)
#define LONG_MAX 2147483647L
#define ULONG_MAX 4294967295UL
#endif
peekpoke.h
PEEK/POKE helper macros for byte and word memory access.
Included headers: <stdint.h>.
Macros:
| Name | Value | Description |
|---|---|---|
PEEK(address) | (*(volatile uint8_t*)(address)) | Macro constant exported by the header. |
POKE(address, value) | (*(volatile uint8_t*)(address) = (uint8_t)(value)) | Macro constant exported by the header. |
PEEKW(address) | (*(volatile uint16_t*)(address)) | Macro constant exported by the header. |
POKEW(address, value) | (*(volatile uint16_t*)(address) = (uint16_t)(value)) | Macro constant exported by the header. |
Header listing:
#ifndef WEB64_PEEKPOKE_H
#define WEB64_PEEKPOKE_H
#include <stdint.h>
#define PEEK(address) (*(volatile uint8_t*)(address))
#define POKE(address, value) (*(volatile uint8_t*)(address) = (uint8_t)(value))
#define PEEKW(address) (*(volatile uint16_t*)(address))
#define POKEW(address, value) (*(volatile uint16_t*)(address) = (uint16_t)(value))
#endif
sprite.h
Small sprite helper API for position, color, and enable writes.
Included headers: <stdint.h>, <c64.h>.
Functions:
| Name | Prototype | Description | Typical use |
|---|---|---|---|
sprite_set_pos | void sprite_set_pos(uint8_t sprite_id, uint16_t x, uint8_t y) | Writes a hardware sprite position, including X MSB handling. | sprite_set_pos(0, x, y); |
sprite_enable | void sprite_enable(uint8_t mask) | Sets the VIC sprite enable mask through the helper runtime. | sprite_enable(0x03); |
sprite_set_color | void sprite_set_color(uint8_t sprite_id, uint8_t color) | Writes a sprite color register for the selected hardware sprite. | sprite_set_color(0, COLOR_BLUE); |
Header listing:
#ifndef WEB64_SPRITE_H
#define WEB64_SPRITE_H
#include <stdint.h>
#include <c64.h>
void sprite_set_pos(uint8_t sprite_id, uint16_t x, uint8_t y);
void sprite_enable(uint8_t mask);
void sprite_set_color(uint8_t sprite_id, uint8_t color);
#endif
stdarg.h
Web64 SDK header <stdarg.h>.
Functions:
| Name | Prototype | Description | Typical use |
|---|---|---|---|
__web64_va_start | void __web64_va_start(va_list ap, void *last) | Function declared by <stdarg.h>. | __web64_va_start(...) |
__web64_va_arg | unsigned long __web64_va_arg(va_list ap, unsigned int size) | Function declared by <stdarg.h>. | __web64_va_arg(...) |
__web64_va_end | void __web64_va_end(va_list ap) | Function declared by <stdarg.h>. | __web64_va_end(...) |
Macros:
| Name | Value | Description |
|---|---|---|
va_start(ap, last) | __web64_va_start(ap, last) | Macro constant exported by the header. |
va_arg(ap, type) | ((type)__web64_va_arg(ap, sizeof(type))) | Typed pointer or expression macro. |
va_end(ap) | __web64_va_end(ap) | Macro constant exported by the header. |
Header listing:
#ifndef WEB64_STDARG_H
#define WEB64_STDARG_H
typedef unsigned char *va_list;
void __web64_va_start(va_list ap, void *last);
unsigned long __web64_va_arg(va_list ap, unsigned int size);
void __web64_va_end(va_list ap);
#define va_start(ap, last) __web64_va_start(ap, last)
#define va_arg(ap, type) ((type)__web64_va_arg(ap, sizeof(type)))
#define va_end(ap) __web64_va_end(ap)
#endif
stdbool.h
Boolean language aliases and constants.
Macros:
| Name | Value | Description |
|---|---|---|
bool | _Bool | Macro constant exported by the header. |
true | 1 | Boolean literal alias. |
false | 0 | Boolean literal alias. |
__bool_true_false_are_defined | 1 | Confirms that boolean macros are available. |
Header listing:
#ifndef WEB64_STDBOOL_H
#define WEB64_STDBOOL_H
#define bool _Bool
#define true 1
#define false 0
#define __bool_true_false_are_defined 1
#endif
stddef.h
Core pointer-sized typedefs and NULL.
Typedefs:
| Name | Declaration | Description |
|---|---|---|
size_t | typedef unsigned int size_t; | Unsigned byte-count type for object sizes and lengths. |
ptrdiff_t | typedef signed int ptrdiff_t; | Signed pointer-difference type. |
wchar_t | typedef unsigned int wchar_t; | Alias for unsigned int. |
Macros:
| Name | Value | Description |
|---|---|---|
NULL | ((void*)0) | Null pointer constant. |
offsetof(type, member) | ((size_t)&(((type*)0)->member)) | Typed pointer or expression macro. |
Header listing:
#ifndef WEB64_STDDEF_H
#define WEB64_STDDEF_H
typedef unsigned int size_t;
typedef signed int ptrdiff_t;
typedef unsigned int wchar_t;
#define NULL ((void*)0)
#define offsetof(type, member) ((size_t)&(((type*)0)->member))
#endif
stdint.h
Fixed-width integer typedefs and limit macros.
Typedefs:
| Name | Declaration | Description |
|---|---|---|
uint8_t | typedef unsigned char uint8_t; | Unsigned 8-bit integer type. |
uint16_t | typedef unsigned int uint16_t; | Unsigned 16-bit integer type. |
uint32_t | typedef unsigned long uint32_t; | Unsigned 32-bit integer type. |
int8_t | typedef signed char int8_t; | Signed 8-bit integer type. |
int16_t | typedef signed int int16_t; | Signed 16-bit integer type. |
int32_t | typedef signed long int32_t; | Signed 32-bit integer type. |
intptr_t | typedef int16_t intptr_t; | Alias for int16_t. |
uintptr_t | typedef uint16_t uintptr_t; | Alias for uint16_t. |
intmax_t | typedef int32_t intmax_t; | Alias for int32_t. |
uintmax_t | typedef uint32_t uintmax_t; | Alias for uint32_t. |
int_least8_t | typedef int8_t int_least8_t; | Alias for int8_t. |
uint_least8_t | typedef uint8_t uint_least8_t; | Alias for uint8_t. |
int_least16_t | typedef int16_t int_least16_t; | Alias for int16_t. |
uint_least16_t | typedef uint16_t uint_least16_t; | Alias for uint16_t. |
int_least32_t | typedef int32_t int_least32_t; | Alias for int32_t. |
uint_least32_t | typedef uint32_t uint_least32_t; | Alias for uint32_t. |
int_fast8_t | typedef int8_t int_fast8_t; | Alias for int8_t. |
uint_fast8_t | typedef uint8_t uint_fast8_t; | Alias for uint8_t. |
int_fast16_t | typedef int16_t int_fast16_t; | Alias for int16_t. |
uint_fast16_t | typedef uint16_t uint_fast16_t; | Alias for uint16_t. |
int_fast32_t | typedef int32_t int_fast32_t; | Alias for int32_t. |
uint_fast32_t | typedef uint32_t uint_fast32_t; | Alias for uint32_t. |
Macros:
| Name | Value | Description |
|---|---|---|
INT8_MIN | 0x80 | Macro constant exported by the header. |
INT8_MAX | 0x7f | Macro constant exported by the header. |
UINT8_MAX | 0xff | Macro constant exported by the header. |
INT16_MIN | 0x8000 | Macro constant exported by the header. |
INT16_MAX | 0x7fff | Macro constant exported by the header. |
UINT16_MAX | 0xffff | Macro constant exported by the header. |
UINT32_MAX | 0xffffffffUL | Macro constant exported by the header. |
Header listing:
#ifndef WEB64_STDINT_H
#define WEB64_STDINT_H
typedef unsigned char uint8_t;
typedef unsigned int uint16_t;
typedef unsigned long uint32_t;
typedef signed char int8_t;
typedef signed int int16_t;
typedef signed long int32_t;
typedef int16_t intptr_t;
typedef uint16_t uintptr_t;
typedef int32_t intmax_t;
typedef uint32_t uintmax_t;
typedef int8_t int_least8_t;
typedef uint8_t uint_least8_t;
typedef int16_t int_least16_t;
typedef uint16_t uint_least16_t;
typedef int32_t int_least32_t;
typedef uint32_t uint_least32_t;
typedef int8_t int_fast8_t;
typedef uint8_t uint_fast8_t;
typedef int16_t int_fast16_t;
typedef uint16_t uint_fast16_t;
typedef int32_t int_fast32_t;
typedef uint32_t uint_fast32_t;
#define INT8_MIN 0x80
#define INT8_MAX 0x7f
#define UINT8_MAX 0xff
#define INT16_MIN 0x8000
#define INT16_MAX 0x7fff
#define UINT16_MAX 0xffff
#define UINT32_MAX 0xffffffffUL
#endif
stdio.h
Tiny stdio surface: blocking raw-byte getchar, putchar, puts, and compiler-lowered literal printf.
Functions:
| Name | Prototype | Description | Typical use |
|---|---|---|---|
getchar | _fastcall int getchar(void) | Blocks until the C64 KERNAL input buffer returns a byte, without echo or character-set conversion. (fastcall) | int key = getchar(); |
putchar | _fastcall int putchar(int c) | Writes one character to the current text output. (fastcall) | putchar('A'); |
puts | _fastcall int puts(const char *str) | Writes a zero-terminated string and a trailing newline. (fastcall) | puts("READY"); |
printf | int printf(const char *format, ...) | Formats a literal format string through the compiler-lowered Web64 printf subset. | printf("SCORE %d", score); |
Macros:
| Name | Value | Description |
|---|---|---|
EOF | 0xffff | End-of-file or error return value constant. |
Header listing:
#ifndef WEB64_STDIO_H
#define WEB64_STDIO_H
#define EOF 0xffff
/* Web64 tiny stdio surface: getchar/putchar/puts are runtime calls; printf is compiler-lowered for literal formats with %d values. */
extern _fastcall int getchar(void);
extern _fastcall int putchar(int c);
extern _fastcall int puts(const char *str);
extern int printf(const char *format, ...);
#endif
stdlib.h
Tiny stdlib surface: abs, atoi, rand, srand, and abort.
Functions:
| Name | Prototype | Description | Typical use |
|---|---|---|---|
abs | int abs(int j) | Returns the absolute value of a signed integer. | int magnitude = abs(value); |
atoi | int atoi(const char *s) | Parses a decimal C string into an integer. | int number = atoi(text); |
rand | _fastcall int rand(void) | Returns a small pseudo-random integer up to RAND_MAX. (fastcall) | uint8_t value = rand() & 0x0f; |
srand | _fastcall void srand(unsigned int seed) | Seeds the runtime random generator. (fastcall) | srand(0x1234); |
abort | void abort(void) | Stops execution immediately through the runtime abort path. | if (fatal) abort(); |
Macros:
| Name | Value | Description |
|---|---|---|
RAND_MAX | 0x00ff | Largest value returned by the active random helper. |
Header listing:
#ifndef WEB64_STDLIB_H
#define WEB64_STDLIB_H
#define RAND_MAX 0x00ff
/* Web64 tiny stdlib parameters: j=value, s=C string pointer, seed=byte random seed. */
extern int abs(int j);
extern int atoi(const char *s);
extern _fastcall int rand(void);
extern _fastcall void srand(unsigned int seed);
void abort(void);
#endif
string.h
Byte and C-string manipulation declarations backed by the Web64 runtime.
Included headers: <stddef.h>.
Functions:
| Name | Prototype | Description | Typical use |
|---|---|---|---|
memchr | void * memchr(const void *s, int c, size_t n) | Scans the first n bytes for a byte value and returns its address when found. | char *hit = memchr(buffer, 0, count); |
memcmp | int memcmp(const void *s1, const void *s2, size_t n) | Compares two byte ranges and returns less than, equal to, or greater than zero. | if (memcmp(a, b, size) == 0) { ... } |
memcpy | void * memcpy(void *s1, const void *s2, size_t n) | Copies n bytes from source to destination without overlap handling. | memcpy(dest, src, size); |
memmove | void * memmove(void *s1, const void *s2, size_t n) | Copies n bytes while allowing overlapping ranges. | memmove(dest, src, size); |
memset | void * memset(void *s, int c, size_t n) | Fills n bytes with a constant byte value. | memset(screen, 32, 1000); |
strcat | char * strcat(char *s1, const char *s2) | Appends one C string to another destination buffer. | strcat(buffer, suffix); |
strchr | char * strchr(const char *s, int c) | Finds the first matching character in a C string. | char *p = strchr(text, ':'); |
strcmp | int strcmp(const char *s1, const char *s2) | Lexicographically compares two C strings. | if (strcmp(a, b) == 0) { ... } |
strcpy | char * strcpy(char *s1, const char *s2) | Copies a source C string including the trailing zero byte. | strcpy(dest, src); |
strcspn | size_t strcspn(const char *s1, const char *s2) | Counts bytes until any reject character appears. | size_t prefix = strcspn(text, ",;"); |
strlen | size_t strlen(const char *s) | Returns the byte length of a zero-terminated C string. | size_t len = strlen(text); |
strncat | char * strncat(char *s1, const char *s2, size_t n) | Appends at most n bytes from a C string. | strncat(buffer, suffix, limit); |
strncmp | int strncmp(const char *s1, const char *s2, size_t n) | Compares at most n bytes of two C strings. | if (strncmp(text, "SYS", 3) == 0) { ... } |
strncpy | char * strncpy(char *s1, const char *s2, size_t n) | Copies at most n bytes from a C string. | strncpy(dest, src, limit); |
strpbrk | char * strpbrk(const char *s1, const char *s2) | Finds the first character that belongs to a search set. | char *p = strpbrk(text, ":="); |
strrchr | char * strrchr(const char *s, int c) | Finds the last matching character in a C string. | char *ext = strrchr(path, '.'); |
strspn | size_t strspn(const char *s1, const char *s2) | Counts bytes from the start while all bytes belong to an allowed set. | size_t prefix = strspn(text, "0123456789"); |
strstr | char * strstr(const char *s1, const char *s2) | Finds one C string within another. | char *hit = strstr(text, "SID"); |
Header listing:
#ifndef WEB64_STRING_H
#define WEB64_STRING_H
#include <stddef.h>
/* Web64 tiny string runtime parameters: s/s1=destination pointer, s2=source/search pointer, c=byte value, n=count. */
extern void *memchr(const void *s, int c, size_t n);
extern int memcmp(const void *s1, const void *s2, size_t n);
extern void *memcpy(void *s1, const void *s2, size_t n);
extern void *memmove(void *s1, const void *s2, size_t n);
extern void *memset(void *s, int c, size_t n);
extern char *strcat(char *s1, const char *s2);
extern char *strchr(const char *s, int c);
extern int strcmp(const char *s1, const char *s2);
extern char *strcpy(char *s1, const char *s2);
extern size_t strcspn(const char *s1, const char *s2);
extern size_t strlen(const char *s);
extern char *strncat(char *s1, const char *s2, size_t n);
extern int strncmp(const char *s1, const char *s2, size_t n);
extern char *strncpy(char *s1, const char *s2, size_t n);
extern char *strpbrk(const char *s1, const char *s2);
extern char *strrchr(const char *s, int c);
extern size_t strspn(const char *s1, const char *s2);
extern char *strstr(const char *s1, const char *s2);
#endif
web64.h
General Web64 SDK helpers for timing, text, randomness, simple drawing, and zero-parameter void calls by address.
Included headers: <stdint.h>, <c64.h>.
Functions:
| Name | Prototype | Description | Typical use |
|---|---|---|---|
delay_frames | void delay_frames(uint8_t frames) | Waits for a number of video frames. | delay_frames(5); |
delay_ms | void delay_ms(uint16_t milliseconds) | Waits approximately the requested number of milliseconds. | delay_ms(250); |
random8 | uint8_t random8(void) | Returns an 8-bit random value from the Web64 helper runtime. | uint8_t value = random8(); |
clrscr | void clrscr(void) | Clears the active text screen. | clrscr(); |
gotoxy | void gotoxy(uint8_t x, uint8_t y) | Moves the text cursor to an X,Y character position. | gotoxy(10, 12); |
cprintf | void cprintf(const char *text) | Prints a C string through the current Web64 text output path. | cprintf("HELLO"); |
plot_pixel | void plot_pixel(uint16_t address, uint8_t value) | Writes a byte value to a caller-chosen bitmap or memory address. | plot_pixel(address, value); |
Macros:
| Name | Value | Description |
|---|---|---|
VoidCall(addr) | (*(void (*)(void))(addr))() | Macro constant exported by the header. |
CURSOFF | (*(volatile uint8_t*)0x00cc = 1) | Macro constant exported by the header. |
CURSON | (*(volatile uint8_t*)0x00cc = 0) | Macro constant exported by the header. |
Header listing:
#ifndef WEB64_CORE_H
#define WEB64_CORE_H
#include <stdint.h>
#include <c64.h>
#define VoidCall(addr) (*(void (*)(void))(addr))()
#define CURSOFF() (*(volatile uint8_t*)0x00cc = 1)
#define CURSON() (*(volatile uint8_t*)0x00cc = 0)
void delay_frames(uint8_t frames);
void delay_ms(uint16_t milliseconds);
uint8_t random8(void);
void clrscr(void);
void gotoxy(uint8_t x, uint8_t y);
void cprintf(const char *text);
void plot_pixel(uint16_t address, uint8_t value);
#endif
web64/actor-batch.h
Open caller-owned actor SoA phases, pair/visible/command buffers, direct and mux adapters, fused prepared pipeline, and checked/fast entry points.
Included headers: <web64/actors.h>, <web64/sprite-mux.h>.
Functions:
| Name | Prototype | Description | Typical use |
|---|---|---|---|
web64_actor_sprite_bind_raw | _web64_rt uint8_t web64_actor_sprite_bind_raw(Web64ActorSpriteSet *sprites, uint8_t actor, uint8_t pointer_base, uint16_t frame_count, uint8_t color, uint8_t flags, uint8_t priority) | Web64 SDK runtime helper. | web64_actor_sprite_bind_raw(...) |
web64_actor_sprite_bind_asset | _web64_rt uint8_t web64_actor_sprite_bind_asset(Web64ActorSpriteSet *sprites, uint8_t actor, const Web64SpriteAsset *asset, uint8_t pointer_base, uint8_t flags, uint8_t priority) | Web64 SDK runtime helper. | web64_actor_sprite_bind_asset(...) |
web64_actor_sprite_bind_asset_pair | _web64_rt uint8_t web64_actor_sprite_bind_asset_pair(Web64ActorSpriteSet *sprites, uint8_t actor, const Web64SpriteOverlayBinding *binding, uint8_t flags, uint8_t priority) | Web64 SDK runtime helper. | web64_actor_sprite_bind_asset_pair(...) |
web64_actor_sprite_unbind | _web64_rt void web64_actor_sprite_unbind(Web64ActorSpriteSet *sprites, uint8_t actor) | Web64 SDK runtime helper. | web64_actor_sprite_unbind(...) |
web64_actor_batch_integrate_x | _web64_rt uint8_t web64_actor_batch_integrate_x(const Web64ActorBatchView *view, Web64ActorBatchStatus *status) | _web64_rt uses registry-generated named absolute argument windows; see runtime.inc and actor-batch.inc. | web64_actor_batch_integrate_x(...) |
web64_actor_batch_integrate_x_fast | _web64_rt uint8_t web64_actor_batch_integrate_x_fast(const Web64ActorBatchView *view, Web64ActorBatchStatus *status) | Web64 SDK runtime helper. | web64_actor_batch_integrate_x_fast(...) |
web64_actor_batch_integrate_y | _web64_rt uint8_t web64_actor_batch_integrate_y(const Web64ActorBatchView *view, Web64ActorBatchStatus *status) | Web64 SDK runtime helper. | web64_actor_batch_integrate_y(...) |
web64_actor_batch_integrate_y_fast | _web64_rt uint8_t web64_actor_batch_integrate_y_fast(const Web64ActorBatchView *view, Web64ActorBatchStatus *status) | Web64 SDK runtime helper. | web64_actor_batch_integrate_y_fast(...) |
web64_actor_batch_integrate_xy | _web64_rt uint8_t web64_actor_batch_integrate_xy(const Web64ActorBatchView *view, Web64ActorBatchStatus *status) | Web64 SDK runtime helper. | web64_actor_batch_integrate_xy(...) |
web64_actor_batch_integrate_xy_fast | _web64_rt uint8_t web64_actor_batch_integrate_xy_fast(const Web64ActorBatchView *view, Web64ActorBatchStatus *status) | Web64 SDK runtime helper. | web64_actor_batch_integrate_xy_fast(...) |
web64_actor_batch_animation_tick | _web64_rt uint8_t web64_actor_batch_animation_tick(const Web64ActorBatchView *view, Web64ActorAnimationBatch *animation, Web64ActorBatchStatus *status) | Web64 SDK runtime helper. | web64_actor_batch_animation_tick(...) |
web64_actor_batch_animation_tick_fast | _web64_rt uint8_t web64_actor_batch_animation_tick_fast(const Web64ActorBatchView *view, Web64ActorAnimationBatch *animation, Web64ActorBatchStatus *status) | Web64 SDK runtime helper. | web64_actor_batch_animation_tick_fast(...) |
web64_actor_batch_cull | _web64_rt uint8_t web64_actor_batch_cull(const Web64ActorBatchView *view, const Web64ActorViewport *viewport, Web64ActorVisibleBuffer *visible, Web64ActorBatchStatus *status) | Web64 SDK runtime helper. | web64_actor_batch_cull(...) |
web64_actor_batch_cull_fast | _web64_rt uint8_t web64_actor_batch_cull_fast(const Web64ActorBatchView *view, const Web64ActorViewport *viewport, Web64ActorVisibleBuffer *visible, Web64ActorBatchStatus *status) | Web64 SDK runtime helper. | web64_actor_batch_cull_fast(...) |
web64_actor_batch_pairs_x | _web64_rt uint8_t web64_actor_batch_pairs_x(const Web64ActorBatchView *view, Web64ActorPairWorkspace *workspace, Web64ActorPairBuffer *pairs, Web64ActorBatchStatus *status) | Web64 SDK runtime helper. | web64_actor_batch_pairs_x(...) |
web64_actor_batch_pairs_x_fast | _web64_rt uint8_t web64_actor_batch_pairs_x_fast(const Web64ActorBatchView *view, Web64ActorPairWorkspace *workspace, Web64ActorPairBuffer *pairs, Web64ActorBatchStatus *status) | Web64 SDK runtime helper. | web64_actor_batch_pairs_x_fast(...) |
web64_actor_batch_build_commands | _web64_rt uint8_t web64_actor_batch_build_commands(const Web64ActorBatchView *view, const Web64ActorVisibleBuffer *visible, const Web64ActorSpriteSet *sprites, Web64ActorCommandBuffer *commands, Web64ActorBatchStatus *status) | Web64 SDK runtime helper. | web64_actor_batch_build_commands(...) |
web64_actor_batch_build_commands_fast | _web64_rt uint8_t web64_actor_batch_build_commands_fast(const Web64ActorBatchView *view, const Web64ActorVisibleBuffer *visible, const Web64ActorSpriteSet *sprites, Web64ActorCommandBuffer *commands, Web64ActorBatchStatus *status) | Web64 SDK runtime helper. | web64_actor_batch_build_commands_fast(...) |
web64_actor_commands_render_direct | _web64_rt uint8_t web64_actor_commands_render_direct(Web64SpriteRenderer *renderer, const Web64ActorCommandBuffer *commands, uint8_t owned_slots, Web64ActorBatchStatus *status) | Web64 SDK runtime helper. | web64_actor_commands_render_direct(...) |
web64_actor_commands_render_direct_fast | _web64_rt uint8_t web64_actor_commands_render_direct_fast(Web64SpriteRenderer *renderer, const Web64ActorCommandBuffer *commands, uint8_t owned_slots, Web64ActorBatchStatus *status) | Web64 SDK runtime helper. | web64_actor_commands_render_direct_fast(...) |
web64_actor_commands_submit_mux | _web64_rt uint8_t web64_actor_commands_submit_mux(Web64SpriteMultiplexer *mux, const Web64ActorCommandBuffer *commands, Web64ActorBatchStatus *status) | Web64 SDK runtime helper. | web64_actor_commands_submit_mux(...) |
web64_actor_commands_submit_mux_fast | _web64_rt uint8_t web64_actor_commands_submit_mux_fast(Web64SpriteMultiplexer *mux, const Web64ActorCommandBuffer *commands, Web64ActorBatchStatus *status) | Web64 SDK runtime helper. | web64_actor_commands_submit_mux_fast(...) |
web64_actor_batch_run_mux | _web64_rt uint8_t web64_actor_batch_run_mux(const Web64ActorMuxPipeline *pipeline) | Web64 SDK runtime helper. | web64_actor_batch_run_mux(...) |
web64_actor_batch_run_mux_fast | _web64_rt uint8_t web64_actor_batch_run_mux_fast(const Web64ActorMuxPipeline *pipeline) | Web64 SDK runtime helper. | web64_actor_batch_run_mux_fast(...) |
Structs:
| Name | Description | Field summary |
|---|---|---|
Web64ActorBatchView | Runtime-facing Web64 helper struct. | 23 fields: uint8_t *active_ids, uint8_t *active, uint8_t *active_count, uint8_t capacity, ... |
Web64ActorSpriteSet | Public struct declared by <web64/actor-batch.h>. | 21 fields: uint8_t *kind, Web64AssetRef *asset, uint8_t *base_pointer, uint8_t *overlay_pointer, ... |
Web64ActorVisibleEntry | Public struct declared by <web64/actor-batch.h>. | 9 fields: uint8_t actor, uint16_t x, uint8_t y, uint8_t order, ... |
Web64ActorPair | Public struct declared by <web64/actor-batch.h>. | 7 fields: uint8_t actor_a, uint8_t actor_b, } Web64ActorPair, typedef struct { uint8_t *sorted_ids, ... |
Web64ActorPairBuffer | Public struct declared by <web64/actor-batch.h>. | 10 fields: Web64ActorPair *pairs, uint8_t capacity, uint8_t count, uint8_t overflow, ... |
Web64ActorRenderCommand | Public struct declared by <web64/actor-batch.h>. | 20 fields: uint8_t actor, uint16_t x, uint8_t y, uint8_t base_pointer, ... |
Web64ActorMuxPipeline | Public struct declared by <web64/actor-batch.h>. | 20 fields: Web64ActorBatchView *view, Web64ActorAnimationBatch *animation, Web64ActorViewport *viewport, Web64ActorVisibleBuffer *visible, ... |
Macros:
| Name | Value | Description |
|---|---|---|
WEB64_ACTOR_BATCH_ABI_VERSION | 2 | Macro constant exported by the header. |
WEB64_ACTOR_BATCH_OK | 0 | Macro constant exported by the header. |
WEB64_ACTOR_BATCH_INVALID_ARGUMENT | 1 | Macro constant exported by the header. |
WEB64_ACTOR_BATCH_CAPACITY | 2 | Macro constant exported by the header. |
WEB64_ACTOR_BATCH_INVALID_ID | 4 | Macro constant exported by the header. |
WEB64_ACTOR_BATCH_INVALID_FRAME | 8 | Macro constant exported by the header. |
WEB64_ACTOR_BATCH_POINTER_OVERFLOW | 16 | Macro constant exported by the header. |
WEB64_ACTOR_BATCH_PALETTE_MISMATCH | 32 | Macro constant exported by the header. |
WEB64_ACTOR_BATCH_INVALID_BINDING | 64 | Macro constant exported by the header. |
WEB64_ACTOR_BATCH_UNSUPPORTED | 128 | Macro constant exported by the header. |
WEB64_ACTOR_SPRITE_NONE | 0 | Macro constant exported by the header. |
WEB64_ACTOR_SPRITE_RAW_SINGLE | 1 | Macro constant exported by the header. |
WEB64_ACTOR_SPRITE_ASSET_SINGLE | 2 | Macro constant exported by the header. |
WEB64_ACTOR_SPRITE_ASSET_PAIR | 3 | Macro constant exported by the header. |
WEB64_ACTOR_RENDER_SINGLE | 1 | Macro constant exported by the header. |
WEB64_ACTOR_RENDER_PAIR | 2 | Macro constant exported by the header. |
WEB64_ACTOR_MUX_PIPELINE_BOUNDS_STABLE | 1 | Macro constant exported by the header. |
WEB64_ACTOR_MUX_PIPELINE_ANIMATION_TICKS_READY | 2 | Macro constant exported by the header. |
WEB64_ACTOR_MUX_PIPELINE_DENSE_ACTIVE_IDS | 4 | Macro constant exported by the header. |
WEB64_ACTOR_MUX_PIPELINE_ANIMATION_PRETICKED | 8 | Macro constant exported by the header. |
WEB64_ACTOR_MUX_PIPELINE_PAIRS_PRECOMPUTED | 16 | Macro constant exported by the header. |
WEB64_ACTOR_MUX_PIPELINE_STABLE_TOPOLOGY | 32 | Macro constant exported by the header. |
WEB64_ACTOR_MUX_PIPELINE_STABLE_ORDER_IDENTITY | 64 | Macro constant exported by the header. |
WEB64_ACTOR_MUX_PIPELINE_DENSE_MOTION_PREINTEGRATED | 128 | Macro constant exported by the header. |
WEB64_ACTOR_VIEW_ACTIVE_IDS | 0 | Macro constant exported by the header. |
WEB64_ACTOR_VIEW_ACTIVE | 2 | Macro constant exported by the header. |
WEB64_ACTOR_VIEW_ACTIVE_COUNT | 4 | Macro constant exported by the header. |
WEB64_ACTOR_VIEW_CAPACITY | 6 | Macro constant exported by the header. |
WEB64_ACTOR_VIEW_X | 7 | Macro constant exported by the header. |
WEB64_ACTOR_VIEW_Y | 9 | Macro constant exported by the header. |
WEB64_ACTOR_VIEW_VX | 11 | Macro constant exported by the header. |
WEB64_ACTOR_VIEW_VY | 13 | Macro constant exported by the header. |
WEB64_ACTOR_VIEW_WIDTH | 15 | Macro constant exported by the header. |
WEB64_ACTOR_VIEW_HEIGHT | 17 | Macro constant exported by the header. |
WEB64_ACTOR_VIEW_CATEGORY | 19 | Macro constant exported by the header. |
WEB64_ACTOR_VIEW_MASK | 21 | Macro constant exported by the header. |
WEB64_ACTOR_VIEW_SIZE | 23 | Macro constant exported by the header. |
WEB64_ACTOR_ANIMATION_BANK | 0 | Macro constant exported by the header. |
WEB64_ACTOR_ANIMATION_SEQUENCE | 2 | Macro constant exported by the header. |
WEB64_ACTOR_ANIMATION_QUEUED | 4 | Macro constant exported by the header. |
WEB64_ACTOR_ANIMATION_STEP | 6 | Macro constant exported by the header. |
WEB64_ACTOR_ANIMATION_TICKS | 8 | Macro constant exported by the header. |
WEB64_ACTOR_ANIMATION_FRAME | 10 | Macro constant exported by the header. |
WEB64_ACTOR_ANIMATION_OVERLAY_FRAME | 12 | Macro constant exported by the header. |
WEB64_ACTOR_ANIMATION_EVENTS | 14 | Macro constant exported by the header. |
WEB64_ACTOR_ANIMATION_STATUS | 16 | Macro constant exported by the header. |
WEB64_ACTOR_ANIMATION_DIRECTION | 18 | Macro constant exported by the header. |
WEB64_ACTOR_ANIMATION_SIZE | 20 | Macro constant exported by the header. |
WEB64_ACTOR_SPRITE_SET_KIND | 0 | Macro constant exported by the header. |
WEB64_ACTOR_SPRITE_SET_ASSET | 2 | Macro constant exported by the header. |
WEB64_ACTOR_SPRITE_SET_BASE_POINTER | 4 | Macro constant exported by the header. |
WEB64_ACTOR_SPRITE_SET_OVERLAY_POINTER | 6 | Macro constant exported by the header. |
WEB64_ACTOR_SPRITE_SET_FRAME_COUNT | 8 | Macro constant exported by the header. |
WEB64_ACTOR_SPRITE_SET_BASE_COLOR | 10 | Macro constant exported by the header. |
WEB64_ACTOR_SPRITE_SET_OVERLAY_COLOR | 12 | Macro constant exported by the header. |
WEB64_ACTOR_SPRITE_SET_MULTICOLOR_1 | 14 | Macro constant exported by the header. |
WEB64_ACTOR_SPRITE_SET_MULTICOLOR_2 | 16 | Macro constant exported by the header. |
WEB64_ACTOR_SPRITE_SET_FLAGS | 18 | Macro constant exported by the header. |
WEB64_ACTOR_SPRITE_SET_PRIORITY | 20 | Macro constant exported by the header. |
WEB64_ACTOR_SPRITE_SET_BASE_FRAME | 22 | Macro constant exported by the header. |
WEB64_ACTOR_SPRITE_SET_OVERLAY_FRAME | 24 | Macro constant exported by the header. |
WEB64_ACTOR_SPRITE_SET_CAPACITY | 26 | Macro constant exported by the header. |
WEB64_ACTOR_SPRITE_SET_SIZE | 27 | Macro constant exported by the header. |
WEB64_ACTOR_VIEWPORT_WORLD_X | 0 | Macro constant exported by the header. |
WEB64_ACTOR_VIEWPORT_WORLD_Y | 2 | Macro constant exported by the header. |
WEB64_ACTOR_VIEWPORT_VIC_ORIGIN_X | 4 | Macro constant exported by the header. |
WEB64_ACTOR_VIEWPORT_VIC_ORIGIN_Y | 6 | Macro constant exported by the header. |
WEB64_ACTOR_VIEWPORT_WIDTH | 7 | Macro constant exported by the header. |
WEB64_ACTOR_VIEWPORT_HEIGHT | 9 | Macro constant exported by the header. |
WEB64_ACTOR_VIEWPORT_SIZE | 11 | Macro constant exported by the header. |
WEB64_ACTOR_VISIBLE_ENTRY_ACTOR | 0 | Macro constant exported by the header. |
WEB64_ACTOR_VISIBLE_ENTRY_X | 1 | Macro constant exported by the header. |
WEB64_ACTOR_VISIBLE_ENTRY_Y | 3 | Macro constant exported by the header. |
WEB64_ACTOR_VISIBLE_ENTRY_ORDER | 4 | Macro constant exported by the header. |
WEB64_ACTOR_VISIBLE_ENTRY_SIZE | 5 | Macro constant exported by the header. |
WEB64_ACTOR_VISIBLE_BUFFER_ENTRIES | 0 | Macro constant exported by the header. |
WEB64_ACTOR_VISIBLE_BUFFER_CAPACITY | 2 | Macro constant exported by the header. |
WEB64_ACTOR_VISIBLE_BUFFER_COUNT | 3 | Macro constant exported by the header. |
WEB64_ACTOR_VISIBLE_BUFFER_DROPPED | 4 | Macro constant exported by the header. |
WEB64_ACTOR_VISIBLE_BUFFER_SIZE | 5 | Macro constant exported by the header. |
WEB64_ACTOR_PAIR_ACTOR_A | 0 | Macro constant exported by the header. |
WEB64_ACTOR_PAIR_ACTOR_B | 1 | Macro constant exported by the header. |
WEB64_ACTOR_PAIR_SIZE | 2 | Macro constant exported by the header. |
WEB64_ACTOR_PAIR_WORKSPACE_SORTED_IDS | 0 | Macro constant exported by the header. |
WEB64_ACTOR_PAIR_WORKSPACE_COUNT | 2 | Macro constant exported by the header. |
WEB64_ACTOR_PAIR_WORKSPACE_CAPACITY | 3 | Macro constant exported by the header. |
WEB64_ACTOR_PAIR_WORKSPACE_INITIALIZED | 4 | Macro constant exported by the header. |
WEB64_ACTOR_PAIR_WORKSPACE_SIZE | 5 | Macro constant exported by the header. |
WEB64_ACTOR_PAIR_BUFFER_PAIRS | 0 | Macro constant exported by the header. |
WEB64_ACTOR_PAIR_BUFFER_CAPACITY | 2 | Macro constant exported by the header. |
WEB64_ACTOR_PAIR_BUFFER_COUNT | 3 | Macro constant exported by the header. |
WEB64_ACTOR_PAIR_BUFFER_OVERFLOW | 4 | Macro constant exported by the header. |
WEB64_ACTOR_PAIR_BUFFER_SIZE | 5 | Macro constant exported by the header. |
WEB64_ACTOR_BOUNDS_WORKSPACE_LEFT | 0 | Macro constant exported by the header. |
WEB64_ACTOR_BOUNDS_WORKSPACE_RIGHT | 2 | Macro constant exported by the header. |
WEB64_ACTOR_BOUNDS_WORKSPACE_TOP | 4 | Macro constant exported by the header. |
WEB64_ACTOR_BOUNDS_WORKSPACE_BOTTOM | 6 | Macro constant exported by the header. |
WEB64_ACTOR_BOUNDS_WORKSPACE_CAPACITY | 8 | Macro constant exported by the header. |
WEB64_ACTOR_BOUNDS_WORKSPACE_SIZE | 9 | Macro constant exported by the header. |
WEB64_ACTOR_COMMAND_ACTOR | 0 | Macro constant exported by the header. |
WEB64_ACTOR_COMMAND_X | 1 | Macro constant exported by the header. |
WEB64_ACTOR_COMMAND_Y | 3 | Macro constant exported by the header. |
WEB64_ACTOR_COMMAND_BASE_POINTER | 4 | Macro constant exported by the header. |
WEB64_ACTOR_COMMAND_OVERLAY_POINTER | 5 | Macro constant exported by the header. |
WEB64_ACTOR_COMMAND_BASE_COLOR | 6 | Macro constant exported by the header. |
WEB64_ACTOR_COMMAND_OVERLAY_COLOR | 7 | Macro constant exported by the header. |
WEB64_ACTOR_COMMAND_FLAGS | 8 | Macro constant exported by the header. |
WEB64_ACTOR_COMMAND_PRIORITY | 9 | Macro constant exported by the header. |
WEB64_ACTOR_COMMAND_LAYERS | 10 | Macro constant exported by the header. |
WEB64_ACTOR_COMMAND_MULTICOLOR_1 | 11 | Macro constant exported by the header. |
WEB64_ACTOR_COMMAND_MULTICOLOR_2 | 12 | Macro constant exported by the header. |
WEB64_ACTOR_COMMAND_ORDER | 13 | Macro constant exported by the header. |
WEB64_ACTOR_COMMAND_SIZE | 14 | Macro constant exported by the header. |
WEB64_ACTOR_COMMAND_BUFFER_COMMANDS | 0 | Macro constant exported by the header. |
WEB64_ACTOR_COMMAND_BUFFER_CAPACITY | 2 | Macro constant exported by the header. |
WEB64_ACTOR_COMMAND_BUFFER_COUNT | 3 | Macro constant exported by the header. |
WEB64_ACTOR_COMMAND_BUFFER_ACCEPTED_LAYERS | 4 | Macro constant exported by the header. |
WEB64_ACTOR_COMMAND_BUFFER_DROPPED_ENTRIES | 5 | Macro constant exported by the header. |
WEB64_ACTOR_COMMAND_BUFFER_DROPPED_LAYERS | 6 | Macro constant exported by the header. |
WEB64_ACTOR_COMMAND_BUFFER_SIZE | 7 | Macro constant exported by the header. |
WEB64_ACTOR_MUX_PIPELINE_VIEW | 0 | Macro constant exported by the header. |
WEB64_ACTOR_MUX_PIPELINE_ANIMATION | 2 | Macro constant exported by the header. |
WEB64_ACTOR_MUX_PIPELINE_VIEWPORT | 4 | Macro constant exported by the header. |
WEB64_ACTOR_MUX_PIPELINE_VISIBLE | 6 | Macro constant exported by the header. |
WEB64_ACTOR_MUX_PIPELINE_BOUNDS | 8 | Macro constant exported by the header. |
WEB64_ACTOR_MUX_PIPELINE_PAIR_WORKSPACE | 10 | Macro constant exported by the header. |
WEB64_ACTOR_MUX_PIPELINE_PAIRS | 12 | Macro constant exported by the header. |
WEB64_ACTOR_MUX_PIPELINE_SPRITES | 14 | Macro constant exported by the header. |
WEB64_ACTOR_MUX_PIPELINE_COMMANDS | 16 | Macro constant exported by the header. |
WEB64_ACTOR_MUX_PIPELINE_MUX | 18 | Macro constant exported by the header. |
WEB64_ACTOR_MUX_PIPELINE_STATUS | 20 | Macro constant exported by the header. |
WEB64_ACTOR_MUX_PIPELINE_FLAGS | 22 | Macro constant exported by the header. |
WEB64_ACTOR_MUX_PIPELINE_SIZE | 23 | Macro constant exported by the header. |
WEB64_ACTOR_STATUS_PROCESSED | 0 | Macro constant exported by the header. |
WEB64_ACTOR_STATUS_EMITTED | 1 | Macro constant exported by the header. |
WEB64_ACTOR_STATUS_DROPPED_ENTRIES | 2 | Macro constant exported by the header. |
WEB64_ACTOR_STATUS_EMITTED_LAYERS | 3 | Macro constant exported by the header. |
WEB64_ACTOR_STATUS_DROPPED_LAYERS | 4 | Macro constant exported by the header. |
WEB64_ACTOR_STATUS_PAIRS | 5 | Macro constant exported by the header. |
WEB64_ACTOR_STATUS_REASONS | 6 | Macro constant exported by the header. |
WEB64_ACTOR_STATUS_SIZE | 7 | Macro constant exported by the header. |
WEB64_ACTOR_ANIMATION_STORAGE(name, capacity) | Web64ActorAnimationBatch name; uint16_t name##_bank[capacity]; uint8_t name##_sequence[capacity]; uint8_t name##_queued[capacity]; uint8_t name##_step[capacity]; uint8_t name##_ticks[capacity]; uint8_t name##_frame[capacity]; uint8_t name##_overlay_frame[capacity]; uint8_t name##_events[capacity]; uint8_t name##_status[capacity]; uint8_t name##_direction[capacity] | Macro constant exported by the header. |
WEB64_ACTOR_SPRITE_SET_STORAGE(name, capacity) | Web64ActorSpriteSet name; uint8_t name##_kind[capacity]; uint16_t name##_asset[capacity]; uint8_t name##_base_pointer[capacity]; uint8_t name##_overlay_pointer[capacity]; uint16_t name##_frame_count[capacity]; uint8_t name##_base_color[capacity]; uint8_t name##_overlay_color[capacity]; uint8_t name##_multicolor_1[capacity]; uint8_t name##_multicolor_2[capacity]; uint8_t name##_flags[capacity]; uint8_t name##_priority[capacity]; uint8_t name##_base_frame[capacity]; uint8_t name##_overlay_frame[capacity] | Macro constant exported by the header. |
WEB64_ACTOR_VISIBLE_STORAGE(name, capacity) | Web64ActorVisibleBuffer name; Web64ActorVisibleEntry name##_entries[capacity] | Macro constant exported by the header. |
WEB64_ACTOR_PAIR_STORAGE(name, actor_capacity, pair_capacity) | Web64ActorPairWorkspace name##_workspace; uint8_t name##_sorted_ids[actor_capacity]; Web64ActorPairBuffer name##_pairs; Web64ActorPair name##_pair_entries[pair_capacity] | Macro constant exported by the header. |
WEB64_ACTOR_BOUNDS_STORAGE(name, capacity) | Web64ActorBoundsWorkspace name; uint8_t name##_left[capacity]; uint8_t name##_right[capacity]; uint8_t name##_top[capacity]; uint8_t name##_bottom[capacity] | Macro constant exported by the header. |
WEB64_ACTOR_COMMAND_STORAGE(name, capacity) | Web64ActorCommandBuffer name; Web64ActorRenderCommand name##_commands[capacity] | Macro constant exported by the header. |
Header listing:
#ifndef WEB64_ACTOR_BATCH_H
#define WEB64_ACTOR_BATCH_H
#include <web64/actors.h>
#include <web64/sprite-mux.h>
#define WEB64_ACTOR_BATCH_ABI_VERSION 2
#define WEB64_ACTOR_BATCH_OK 0
#define WEB64_ACTOR_BATCH_INVALID_ARGUMENT 1
#define WEB64_ACTOR_BATCH_CAPACITY 2
#define WEB64_ACTOR_BATCH_INVALID_ID 4
#define WEB64_ACTOR_BATCH_INVALID_FRAME 8
#define WEB64_ACTOR_BATCH_POINTER_OVERFLOW 16
#define WEB64_ACTOR_BATCH_PALETTE_MISMATCH 32
#define WEB64_ACTOR_BATCH_INVALID_BINDING 64
#define WEB64_ACTOR_BATCH_UNSUPPORTED 128
#define WEB64_ACTOR_SPRITE_NONE 0
#define WEB64_ACTOR_SPRITE_RAW_SINGLE 1
#define WEB64_ACTOR_SPRITE_ASSET_SINGLE 2
#define WEB64_ACTOR_SPRITE_ASSET_PAIR 3
#define WEB64_ACTOR_RENDER_SINGLE 1
#define WEB64_ACTOR_RENDER_PAIR 2
#define WEB64_ACTOR_MUX_PIPELINE_BOUNDS_STABLE 1
#define WEB64_ACTOR_MUX_PIPELINE_ANIMATION_TICKS_READY 2
#define WEB64_ACTOR_MUX_PIPELINE_DENSE_ACTIVE_IDS 4
#define WEB64_ACTOR_MUX_PIPELINE_ANIMATION_PRETICKED 8
#define WEB64_ACTOR_MUX_PIPELINE_PAIRS_PRECOMPUTED 16
#define WEB64_ACTOR_MUX_PIPELINE_STABLE_TOPOLOGY 32
#define WEB64_ACTOR_MUX_PIPELINE_STABLE_ORDER_IDENTITY 64
#define WEB64_ACTOR_MUX_PIPELINE_DENSE_MOTION_PREINTEGRATED 128
#define WEB64_ACTOR_VIEW_ACTIVE_IDS 0
#define WEB64_ACTOR_VIEW_ACTIVE 2
#define WEB64_ACTOR_VIEW_ACTIVE_COUNT 4
#define WEB64_ACTOR_VIEW_CAPACITY 6
#define WEB64_ACTOR_VIEW_X 7
#define WEB64_ACTOR_VIEW_Y 9
#define WEB64_ACTOR_VIEW_VX 11
#define WEB64_ACTOR_VIEW_VY 13
#define WEB64_ACTOR_VIEW_WIDTH 15
#define WEB64_ACTOR_VIEW_HEIGHT 17
#define WEB64_ACTOR_VIEW_CATEGORY 19
#define WEB64_ACTOR_VIEW_MASK 21
#define WEB64_ACTOR_VIEW_SIZE 23
#define WEB64_ACTOR_ANIMATION_BANK 0
#define WEB64_ACTOR_ANIMATION_SEQUENCE 2
#define WEB64_ACTOR_ANIMATION_QUEUED 4
#define WEB64_ACTOR_ANIMATION_STEP 6
#define WEB64_ACTOR_ANIMATION_TICKS 8
#define WEB64_ACTOR_ANIMATION_FRAME 10
#define WEB64_ACTOR_ANIMATION_OVERLAY_FRAME 12
#define WEB64_ACTOR_ANIMATION_EVENTS 14
#define WEB64_ACTOR_ANIMATION_STATUS 16
#define WEB64_ACTOR_ANIMATION_DIRECTION 18
#define WEB64_ACTOR_ANIMATION_SIZE 20
#define WEB64_ACTOR_SPRITE_SET_KIND 0
#define WEB64_ACTOR_SPRITE_SET_ASSET 2
#define WEB64_ACTOR_SPRITE_SET_BASE_POINTER 4
#define WEB64_ACTOR_SPRITE_SET_OVERLAY_POINTER 6
#define WEB64_ACTOR_SPRITE_SET_FRAME_COUNT 8
#define WEB64_ACTOR_SPRITE_SET_BASE_COLOR 10
#define WEB64_ACTOR_SPRITE_SET_OVERLAY_COLOR 12
#define WEB64_ACTOR_SPRITE_SET_MULTICOLOR_1 14
#define WEB64_ACTOR_SPRITE_SET_MULTICOLOR_2 16
#define WEB64_ACTOR_SPRITE_SET_FLAGS 18
#define WEB64_ACTOR_SPRITE_SET_PRIORITY 20
#define WEB64_ACTOR_SPRITE_SET_BASE_FRAME 22
#define WEB64_ACTOR_SPRITE_SET_OVERLAY_FRAME 24
#define WEB64_ACTOR_SPRITE_SET_CAPACITY 26
#define WEB64_ACTOR_SPRITE_SET_SIZE 27
#define WEB64_ACTOR_VIEWPORT_WORLD_X 0
#define WEB64_ACTOR_VIEWPORT_WORLD_Y 2
#define WEB64_ACTOR_VIEWPORT_VIC_ORIGIN_X 4
#define WEB64_ACTOR_VIEWPORT_VIC_ORIGIN_Y 6
#define WEB64_ACTOR_VIEWPORT_WIDTH 7
#define WEB64_ACTOR_VIEWPORT_HEIGHT 9
#define WEB64_ACTOR_VIEWPORT_SIZE 11
#define WEB64_ACTOR_VISIBLE_ENTRY_ACTOR 0
#define WEB64_ACTOR_VISIBLE_ENTRY_X 1
#define WEB64_ACTOR_VISIBLE_ENTRY_Y 3
#define WEB64_ACTOR_VISIBLE_ENTRY_ORDER 4
#define WEB64_ACTOR_VISIBLE_ENTRY_SIZE 5
#define WEB64_ACTOR_VISIBLE_BUFFER_ENTRIES 0
#define WEB64_ACTOR_VISIBLE_BUFFER_CAPACITY 2
#define WEB64_ACTOR_VISIBLE_BUFFER_COUNT 3
#define WEB64_ACTOR_VISIBLE_BUFFER_DROPPED 4
#define WEB64_ACTOR_VISIBLE_BUFFER_SIZE 5
#define WEB64_ACTOR_PAIR_ACTOR_A 0
#define WEB64_ACTOR_PAIR_ACTOR_B 1
#define WEB64_ACTOR_PAIR_SIZE 2
#define WEB64_ACTOR_PAIR_WORKSPACE_SORTED_IDS 0
#define WEB64_ACTOR_PAIR_WORKSPACE_COUNT 2
#define WEB64_ACTOR_PAIR_WORKSPACE_CAPACITY 3
#define WEB64_ACTOR_PAIR_WORKSPACE_INITIALIZED 4
#define WEB64_ACTOR_PAIR_WORKSPACE_SIZE 5
#define WEB64_ACTOR_PAIR_BUFFER_PAIRS 0
#define WEB64_ACTOR_PAIR_BUFFER_CAPACITY 2
#define WEB64_ACTOR_PAIR_BUFFER_COUNT 3
#define WEB64_ACTOR_PAIR_BUFFER_OVERFLOW 4
#define WEB64_ACTOR_PAIR_BUFFER_SIZE 5
#define WEB64_ACTOR_BOUNDS_WORKSPACE_LEFT 0
#define WEB64_ACTOR_BOUNDS_WORKSPACE_RIGHT 2
#define WEB64_ACTOR_BOUNDS_WORKSPACE_TOP 4
#define WEB64_ACTOR_BOUNDS_WORKSPACE_BOTTOM 6
#define WEB64_ACTOR_BOUNDS_WORKSPACE_CAPACITY 8
#define WEB64_ACTOR_BOUNDS_WORKSPACE_SIZE 9
#define WEB64_ACTOR_COMMAND_ACTOR 0
#define WEB64_ACTOR_COMMAND_X 1
#define WEB64_ACTOR_COMMAND_Y 3
#define WEB64_ACTOR_COMMAND_BASE_POINTER 4
#define WEB64_ACTOR_COMMAND_OVERLAY_POINTER 5
#define WEB64_ACTOR_COMMAND_BASE_COLOR 6
#define WEB64_ACTOR_COMMAND_OVERLAY_COLOR 7
#define WEB64_ACTOR_COMMAND_FLAGS 8
#define WEB64_ACTOR_COMMAND_PRIORITY 9
#define WEB64_ACTOR_COMMAND_LAYERS 10
#define WEB64_ACTOR_COMMAND_MULTICOLOR_1 11
#define WEB64_ACTOR_COMMAND_MULTICOLOR_2 12
#define WEB64_ACTOR_COMMAND_ORDER 13
#define WEB64_ACTOR_COMMAND_SIZE 14
#define WEB64_ACTOR_COMMAND_BUFFER_COMMANDS 0
#define WEB64_ACTOR_COMMAND_BUFFER_CAPACITY 2
#define WEB64_ACTOR_COMMAND_BUFFER_COUNT 3
#define WEB64_ACTOR_COMMAND_BUFFER_ACCEPTED_LAYERS 4
#define WEB64_ACTOR_COMMAND_BUFFER_DROPPED_ENTRIES 5
#define WEB64_ACTOR_COMMAND_BUFFER_DROPPED_LAYERS 6
#define WEB64_ACTOR_COMMAND_BUFFER_SIZE 7
#define WEB64_ACTOR_MUX_PIPELINE_VIEW 0
#define WEB64_ACTOR_MUX_PIPELINE_ANIMATION 2
#define WEB64_ACTOR_MUX_PIPELINE_VIEWPORT 4
#define WEB64_ACTOR_MUX_PIPELINE_VISIBLE 6
#define WEB64_ACTOR_MUX_PIPELINE_BOUNDS 8
#define WEB64_ACTOR_MUX_PIPELINE_PAIR_WORKSPACE 10
#define WEB64_ACTOR_MUX_PIPELINE_PAIRS 12
#define WEB64_ACTOR_MUX_PIPELINE_SPRITES 14
#define WEB64_ACTOR_MUX_PIPELINE_COMMANDS 16
#define WEB64_ACTOR_MUX_PIPELINE_MUX 18
#define WEB64_ACTOR_MUX_PIPELINE_STATUS 20
#define WEB64_ACTOR_MUX_PIPELINE_FLAGS 22
#define WEB64_ACTOR_MUX_PIPELINE_SIZE 23
#define WEB64_ACTOR_STATUS_PROCESSED 0
#define WEB64_ACTOR_STATUS_EMITTED 1
#define WEB64_ACTOR_STATUS_DROPPED_ENTRIES 2
#define WEB64_ACTOR_STATUS_EMITTED_LAYERS 3
#define WEB64_ACTOR_STATUS_DROPPED_LAYERS 4
#define WEB64_ACTOR_STATUS_PAIRS 5
#define WEB64_ACTOR_STATUS_REASONS 6
#define WEB64_ACTOR_STATUS_SIZE 7
typedef struct { uint8_t *active_ids; uint8_t *active; uint8_t *active_count; uint8_t capacity; web64_pos_t *x; web64_pos_t *y; web64_vel_t *vx; web64_vel_t *vy; uint8_t *width; uint8_t *height; uint8_t *category; uint8_t *mask; } Web64ActorBatchView;
typedef struct { uint16_t *bank; uint8_t *sequence; uint8_t *queued; uint8_t *step; uint8_t *ticks; uint8_t *frame; uint8_t *overlay_frame; uint8_t *events; uint8_t *status; uint8_t *direction; } Web64ActorAnimationBatch;
typedef struct { uint8_t *kind; Web64AssetRef *asset; uint8_t *base_pointer; uint8_t *overlay_pointer; uint16_t *frame_count; uint8_t *base_color; uint8_t *overlay_color; uint8_t *multicolor_1; uint8_t *multicolor_2; uint8_t *flags; uint8_t *priority; uint8_t *base_frame; uint8_t *overlay_frame; uint8_t capacity; } Web64ActorSpriteSet;
typedef struct { uint16_t world_x; uint16_t world_y; uint16_t vic_origin_x; uint8_t vic_origin_y; uint16_t width; uint16_t height; } Web64ActorViewport;
typedef struct { uint8_t actor; uint16_t x; uint8_t y; uint8_t order; } Web64ActorVisibleEntry;
typedef struct { Web64ActorVisibleEntry *entries; uint8_t capacity; uint8_t count; uint8_t dropped; } Web64ActorVisibleBuffer;
typedef struct { uint8_t actor_a; uint8_t actor_b; } Web64ActorPair;
typedef struct { uint8_t *sorted_ids; uint8_t count; uint8_t capacity; uint8_t initialized; } Web64ActorPairWorkspace;
typedef struct { Web64ActorPair *pairs; uint8_t capacity; uint8_t count; uint8_t overflow; } Web64ActorPairBuffer;
typedef struct { uint8_t *left; uint8_t *right; uint8_t *top; uint8_t *bottom; uint8_t capacity; } Web64ActorBoundsWorkspace;
typedef struct { uint8_t actor; uint16_t x; uint8_t y; uint8_t base_pointer; uint8_t overlay_pointer; uint8_t base_color; uint8_t overlay_color; uint8_t flags; uint8_t priority; uint8_t layers; uint8_t multicolor_1; uint8_t multicolor_2; uint8_t order; } Web64ActorRenderCommand;
typedef struct { Web64ActorRenderCommand *commands; uint8_t capacity; uint8_t count; uint8_t accepted_layers; uint8_t dropped_entries; uint8_t dropped_layers; } Web64ActorCommandBuffer;
typedef struct { Web64ActorBatchView *view; Web64ActorAnimationBatch *animation; Web64ActorViewport *viewport; Web64ActorVisibleBuffer *visible; Web64ActorBoundsWorkspace *bounds; Web64ActorPairWorkspace *pair_workspace; Web64ActorPairBuffer *pairs; Web64ActorSpriteSet *sprites; Web64ActorCommandBuffer *commands; Web64SpriteMultiplexer *mux; Web64ActorBatchStatus *status; uint8_t flags; } Web64ActorMuxPipeline;
typedef struct { uint8_t processed; uint8_t emitted; uint8_t dropped_entries; uint8_t emitted_layers; uint8_t dropped_layers; uint8_t pairs; uint8_t reasons; } Web64ActorBatchStatus;
#define WEB64_ACTOR_ANIMATION_STORAGE(name, capacity) Web64ActorAnimationBatch name; uint16_t name##_bank[capacity]; uint8_t name##_sequence[capacity]; uint8_t name##_queued[capacity]; uint8_t name##_step[capacity]; uint8_t name##_ticks[capacity]; uint8_t name##_frame[capacity]; uint8_t name##_overlay_frame[capacity]; uint8_t name##_events[capacity]; uint8_t name##_status[capacity]; uint8_t name##_direction[capacity]
#define WEB64_ACTOR_SPRITE_SET_STORAGE(name, capacity) Web64ActorSpriteSet name; uint8_t name##_kind[capacity]; uint16_t name##_asset[capacity]; uint8_t name##_base_pointer[capacity]; uint8_t name##_overlay_pointer[capacity]; uint16_t name##_frame_count[capacity]; uint8_t name##_base_color[capacity]; uint8_t name##_overlay_color[capacity]; uint8_t name##_multicolor_1[capacity]; uint8_t name##_multicolor_2[capacity]; uint8_t name##_flags[capacity]; uint8_t name##_priority[capacity]; uint8_t name##_base_frame[capacity]; uint8_t name##_overlay_frame[capacity]
#define WEB64_ACTOR_VISIBLE_STORAGE(name, capacity) Web64ActorVisibleBuffer name; Web64ActorVisibleEntry name##_entries[capacity]
#define WEB64_ACTOR_PAIR_STORAGE(name, actor_capacity, pair_capacity) Web64ActorPairWorkspace name##_workspace; uint8_t name##_sorted_ids[actor_capacity]; Web64ActorPairBuffer name##_pairs; Web64ActorPair name##_pair_entries[pair_capacity]
#define WEB64_ACTOR_BOUNDS_STORAGE(name, capacity) Web64ActorBoundsWorkspace name; uint8_t name##_left[capacity]; uint8_t name##_right[capacity]; uint8_t name##_top[capacity]; uint8_t name##_bottom[capacity]
#define WEB64_ACTOR_COMMAND_STORAGE(name, capacity) Web64ActorCommandBuffer name; Web64ActorRenderCommand name##_commands[capacity]
_web64_rt uint8_t web64_actor_sprite_bind_raw(Web64ActorSpriteSet *sprites, uint8_t actor, uint8_t pointer_base, uint16_t frame_count, uint8_t color, uint8_t flags, uint8_t priority);
_web64_rt uint8_t web64_actor_sprite_bind_asset(Web64ActorSpriteSet *sprites, uint8_t actor, const Web64SpriteAsset *asset, uint8_t pointer_base, uint8_t flags, uint8_t priority);
_web64_rt uint8_t web64_actor_sprite_bind_asset_pair(Web64ActorSpriteSet *sprites, uint8_t actor, const Web64SpriteOverlayBinding *binding, uint8_t flags, uint8_t priority);
_web64_rt void web64_actor_sprite_unbind(Web64ActorSpriteSet *sprites, uint8_t actor);
/* _web64_rt uses registry-generated named absolute argument windows; see runtime.inc and actor-batch.inc. */
_web64_rt uint8_t web64_actor_batch_integrate_x(const Web64ActorBatchView *view, Web64ActorBatchStatus *status);
_web64_rt uint8_t web64_actor_batch_integrate_x_fast(const Web64ActorBatchView *view, Web64ActorBatchStatus *status);
_web64_rt uint8_t web64_actor_batch_integrate_y(const Web64ActorBatchView *view, Web64ActorBatchStatus *status);
_web64_rt uint8_t web64_actor_batch_integrate_y_fast(const Web64ActorBatchView *view, Web64ActorBatchStatus *status);
_web64_rt uint8_t web64_actor_batch_integrate_xy(const Web64ActorBatchView *view, Web64ActorBatchStatus *status);
_web64_rt uint8_t web64_actor_batch_integrate_xy_fast(const Web64ActorBatchView *view, Web64ActorBatchStatus *status);
_web64_rt uint8_t web64_actor_batch_animation_tick(const Web64ActorBatchView *view, Web64ActorAnimationBatch *animation, Web64ActorBatchStatus *status);
_web64_rt uint8_t web64_actor_batch_animation_tick_fast(const Web64ActorBatchView *view, Web64ActorAnimationBatch *animation, Web64ActorBatchStatus *status);
_web64_rt uint8_t web64_actor_batch_cull(const Web64ActorBatchView *view, const Web64ActorViewport *viewport, Web64ActorVisibleBuffer *visible, Web64ActorBatchStatus *status);
_web64_rt uint8_t web64_actor_batch_cull_fast(const Web64ActorBatchView *view, const Web64ActorViewport *viewport, Web64ActorVisibleBuffer *visible, Web64ActorBatchStatus *status);
_web64_rt uint8_t web64_actor_batch_pairs_x(const Web64ActorBatchView *view, Web64ActorPairWorkspace *workspace, Web64ActorPairBuffer *pairs, Web64ActorBatchStatus *status);
_web64_rt uint8_t web64_actor_batch_pairs_x_fast(const Web64ActorBatchView *view, Web64ActorPairWorkspace *workspace, Web64ActorPairBuffer *pairs, Web64ActorBatchStatus *status);
_web64_rt uint8_t web64_actor_batch_build_commands(const Web64ActorBatchView *view, const Web64ActorVisibleBuffer *visible, const Web64ActorSpriteSet *sprites, Web64ActorCommandBuffer *commands, Web64ActorBatchStatus *status);
_web64_rt uint8_t web64_actor_batch_build_commands_fast(const Web64ActorBatchView *view, const Web64ActorVisibleBuffer *visible, const Web64ActorSpriteSet *sprites, Web64ActorCommandBuffer *commands, Web64ActorBatchStatus *status);
_web64_rt uint8_t web64_actor_commands_render_direct(Web64SpriteRenderer *renderer, const Web64ActorCommandBuffer *commands, uint8_t owned_slots, Web64ActorBatchStatus *status);
_web64_rt uint8_t web64_actor_commands_render_direct_fast(Web64SpriteRenderer *renderer, const Web64ActorCommandBuffer *commands, uint8_t owned_slots, Web64ActorBatchStatus *status);
_web64_rt uint8_t web64_actor_commands_submit_mux(Web64SpriteMultiplexer *mux, const Web64ActorCommandBuffer *commands, Web64ActorBatchStatus *status);
_web64_rt uint8_t web64_actor_commands_submit_mux_fast(Web64SpriteMultiplexer *mux, const Web64ActorCommandBuffer *commands, Web64ActorBatchStatus *status);
_web64_rt uint8_t web64_actor_batch_run_mux(const Web64ActorMuxPipeline *pipeline);
_web64_rt uint8_t web64_actor_batch_run_mux_fast(const Web64ActorMuxPipeline *pipeline);
#endif
web64/actor-batch.inc
Assembly ABI constants, exact structure offsets, flags, status values, and standard runtime prepare/call macros.
Header listing:
; Web64 v2 actor-batch public ABI v2
; Mainline-only prepared kernels. Buffers and assets remain caller-owned.
; Linked _web64_rt entries publish _function__arg_<name>, _function__argN,
; exact __width/__offset constants, and _function__arg_window_size before _function.
; Populate the complete named window before JSR. Each function window is non-reentrant.
WEB64_ACTOR_BATCH_ABI_VERSION = 2
WEB64_ACTOR_BATCH_OK = 0
WEB64_ACTOR_BATCH_INVALID_ARGUMENT = 1
WEB64_ACTOR_BATCH_CAPACITY = 2
WEB64_ACTOR_BATCH_INVALID_ID = 4
WEB64_ACTOR_BATCH_INVALID_FRAME = 8
WEB64_ACTOR_BATCH_POINTER_OVERFLOW = 16
WEB64_ACTOR_BATCH_PALETTE_MISMATCH = 32
WEB64_ACTOR_BATCH_INVALID_BINDING = 64
WEB64_ACTOR_BATCH_UNSUPPORTED = 128
WEB64_ACTOR_SPRITE_NONE = 0
WEB64_ACTOR_SPRITE_RAW_SINGLE = 1
WEB64_ACTOR_SPRITE_ASSET_SINGLE = 2
WEB64_ACTOR_SPRITE_ASSET_PAIR = 3
WEB64_ACTOR_RENDER_SINGLE = 1
WEB64_ACTOR_RENDER_PAIR = 2
WEB64_ACTOR_MUX_PIPELINE_BOUNDS_STABLE = 1
WEB64_ACTOR_MUX_PIPELINE_ANIMATION_TICKS_READY = 2
WEB64_ACTOR_MUX_PIPELINE_DENSE_ACTIVE_IDS = 4
WEB64_ACTOR_MUX_PIPELINE_ANIMATION_PRETICKED = 8
WEB64_ACTOR_MUX_PIPELINE_PAIRS_PRECOMPUTED = 16
WEB64_ACTOR_MUX_PIPELINE_STABLE_TOPOLOGY = 32
WEB64_ACTOR_MUX_PIPELINE_STABLE_ORDER_IDENTITY = 64
WEB64_ACTOR_MUX_PIPELINE_DENSE_MOTION_PREINTEGRATED = 128
WEB64_ACTOR_VIEW_ACTIVE_IDS = 0
WEB64_ACTOR_VIEW_ACTIVE = 2
WEB64_ACTOR_VIEW_ACTIVE_COUNT = 4
WEB64_ACTOR_VIEW_CAPACITY = 6
WEB64_ACTOR_VIEW_X = 7
WEB64_ACTOR_VIEW_Y = 9
WEB64_ACTOR_VIEW_VX = 11
WEB64_ACTOR_VIEW_VY = 13
WEB64_ACTOR_VIEW_WIDTH = 15
WEB64_ACTOR_VIEW_HEIGHT = 17
WEB64_ACTOR_VIEW_CATEGORY = 19
WEB64_ACTOR_VIEW_MASK = 21
WEB64_ACTOR_VIEW_SIZE = 23
WEB64_ACTOR_ANIMATION_BANK = 0
WEB64_ACTOR_ANIMATION_SEQUENCE = 2
WEB64_ACTOR_ANIMATION_QUEUED = 4
WEB64_ACTOR_ANIMATION_STEP = 6
WEB64_ACTOR_ANIMATION_TICKS = 8
WEB64_ACTOR_ANIMATION_FRAME = 10
WEB64_ACTOR_ANIMATION_OVERLAY_FRAME = 12
WEB64_ACTOR_ANIMATION_EVENTS = 14
WEB64_ACTOR_ANIMATION_STATUS = 16
WEB64_ACTOR_ANIMATION_DIRECTION = 18
WEB64_ACTOR_ANIMATION_SIZE = 20
WEB64_ACTOR_SPRITE_SET_KIND = 0
WEB64_ACTOR_SPRITE_SET_ASSET = 2
WEB64_ACTOR_SPRITE_SET_BASE_POINTER = 4
WEB64_ACTOR_SPRITE_SET_OVERLAY_POINTER = 6
WEB64_ACTOR_SPRITE_SET_FRAME_COUNT = 8
WEB64_ACTOR_SPRITE_SET_BASE_COLOR = 10
WEB64_ACTOR_SPRITE_SET_OVERLAY_COLOR = 12
WEB64_ACTOR_SPRITE_SET_MULTICOLOR_1 = 14
WEB64_ACTOR_SPRITE_SET_MULTICOLOR_2 = 16
WEB64_ACTOR_SPRITE_SET_FLAGS = 18
WEB64_ACTOR_SPRITE_SET_PRIORITY = 20
WEB64_ACTOR_SPRITE_SET_BASE_FRAME = 22
WEB64_ACTOR_SPRITE_SET_OVERLAY_FRAME = 24
WEB64_ACTOR_SPRITE_SET_CAPACITY = 26
WEB64_ACTOR_SPRITE_SET_SIZE = 27
WEB64_ACTOR_VIEWPORT_WORLD_X = 0
WEB64_ACTOR_VIEWPORT_WORLD_Y = 2
WEB64_ACTOR_VIEWPORT_VIC_ORIGIN_X = 4
WEB64_ACTOR_VIEWPORT_VIC_ORIGIN_Y = 6
WEB64_ACTOR_VIEWPORT_WIDTH = 7
WEB64_ACTOR_VIEWPORT_HEIGHT = 9
WEB64_ACTOR_VIEWPORT_SIZE = 11
WEB64_ACTOR_VISIBLE_ENTRY_ACTOR = 0
WEB64_ACTOR_VISIBLE_ENTRY_X = 1
WEB64_ACTOR_VISIBLE_ENTRY_Y = 3
WEB64_ACTOR_VISIBLE_ENTRY_ORDER = 4
WEB64_ACTOR_VISIBLE_ENTRY_SIZE = 5
WEB64_ACTOR_VISIBLE_BUFFER_ENTRIES = 0
WEB64_ACTOR_VISIBLE_BUFFER_CAPACITY = 2
WEB64_ACTOR_VISIBLE_BUFFER_COUNT = 3
WEB64_ACTOR_VISIBLE_BUFFER_DROPPED = 4
WEB64_ACTOR_VISIBLE_BUFFER_SIZE = 5
WEB64_ACTOR_PAIR_ACTOR_A = 0
WEB64_ACTOR_PAIR_ACTOR_B = 1
WEB64_ACTOR_PAIR_SIZE = 2
WEB64_ACTOR_PAIR_WORKSPACE_SORTED_IDS = 0
WEB64_ACTOR_PAIR_WORKSPACE_COUNT = 2
WEB64_ACTOR_PAIR_WORKSPACE_CAPACITY = 3
WEB64_ACTOR_PAIR_WORKSPACE_INITIALIZED = 4
WEB64_ACTOR_PAIR_WORKSPACE_SIZE = 5
WEB64_ACTOR_PAIR_BUFFER_PAIRS = 0
WEB64_ACTOR_PAIR_BUFFER_CAPACITY = 2
WEB64_ACTOR_PAIR_BUFFER_COUNT = 3
WEB64_ACTOR_PAIR_BUFFER_OVERFLOW = 4
WEB64_ACTOR_PAIR_BUFFER_SIZE = 5
WEB64_ACTOR_BOUNDS_WORKSPACE_LEFT = 0
WEB64_ACTOR_BOUNDS_WORKSPACE_RIGHT = 2
WEB64_ACTOR_BOUNDS_WORKSPACE_TOP = 4
WEB64_ACTOR_BOUNDS_WORKSPACE_BOTTOM = 6
WEB64_ACTOR_BOUNDS_WORKSPACE_CAPACITY = 8
WEB64_ACTOR_BOUNDS_WORKSPACE_SIZE = 9
WEB64_ACTOR_COMMAND_ACTOR = 0
WEB64_ACTOR_COMMAND_X = 1
WEB64_ACTOR_COMMAND_Y = 3
WEB64_ACTOR_COMMAND_BASE_POINTER = 4
WEB64_ACTOR_COMMAND_OVERLAY_POINTER = 5
WEB64_ACTOR_COMMAND_BASE_COLOR = 6
WEB64_ACTOR_COMMAND_OVERLAY_COLOR = 7
WEB64_ACTOR_COMMAND_FLAGS = 8
WEB64_ACTOR_COMMAND_PRIORITY = 9
WEB64_ACTOR_COMMAND_LAYERS = 10
WEB64_ACTOR_COMMAND_MULTICOLOR_1 = 11
WEB64_ACTOR_COMMAND_MULTICOLOR_2 = 12
WEB64_ACTOR_COMMAND_ORDER = 13
WEB64_ACTOR_COMMAND_SIZE = 14
WEB64_ACTOR_COMMAND_BUFFER_COMMANDS = 0
WEB64_ACTOR_COMMAND_BUFFER_CAPACITY = 2
WEB64_ACTOR_COMMAND_BUFFER_COUNT = 3
WEB64_ACTOR_COMMAND_BUFFER_ACCEPTED_LAYERS = 4
WEB64_ACTOR_COMMAND_BUFFER_DROPPED_ENTRIES = 5
WEB64_ACTOR_COMMAND_BUFFER_DROPPED_LAYERS = 6
WEB64_ACTOR_COMMAND_BUFFER_SIZE = 7
WEB64_ACTOR_MUX_PIPELINE_VIEW = 0
WEB64_ACTOR_MUX_PIPELINE_ANIMATION = 2
WEB64_ACTOR_MUX_PIPELINE_VIEWPORT = 4
WEB64_ACTOR_MUX_PIPELINE_VISIBLE = 6
WEB64_ACTOR_MUX_PIPELINE_BOUNDS = 8
WEB64_ACTOR_MUX_PIPELINE_PAIR_WORKSPACE = 10
WEB64_ACTOR_MUX_PIPELINE_PAIRS = 12
WEB64_ACTOR_MUX_PIPELINE_SPRITES = 14
WEB64_ACTOR_MUX_PIPELINE_COMMANDS = 16
WEB64_ACTOR_MUX_PIPELINE_MUX = 18
WEB64_ACTOR_MUX_PIPELINE_STATUS = 20
WEB64_ACTOR_MUX_PIPELINE_FLAGS = 22
WEB64_ACTOR_MUX_PIPELINE_SIZE = 23
WEB64_ACTOR_STATUS_PROCESSED = 0
WEB64_ACTOR_STATUS_EMITTED = 1
WEB64_ACTOR_STATUS_DROPPED_ENTRIES = 2
WEB64_ACTOR_STATUS_EMITTED_LAYERS = 3
WEB64_ACTOR_STATUS_DROPPED_LAYERS = 4
WEB64_ACTOR_STATUS_PAIRS = 5
WEB64_ACTOR_STATUS_REASONS = 6
WEB64_ACTOR_STATUS_SIZE = 7
; Web64 _web64_rt C/assembly call helpers for <web64/actor-batch.h>
; Generated from native runtime registry v8; do not hand-edit.
; Arguments are immediate assembly expressions. Pass C globals with their emitted labels.
; Prepare helpers write the complete exact-width window and clobber A only.
; Call helpers prepare the window, JSR the public entry, and inherit its clobber/return contract.
; Helpers allocate no storage. Including this file, or leaving a helper unused, links zero runtime bytes.
WEB64_RT_ACTOR_BATCH_CALL_COUNT = 24
WEB64_RT_ACTOR_BATCH_WINDOW_CALL_COUNT = 24
; web64_actor_batch_animation_tick: 6-byte window; entry _web64_actor_batch_animation_tick
.macro web64_rt_prepare_actor_batch_animation_tick view, animation, status
lda #<view
sta _web64_actor_batch_animation_tick__arg_view
lda #>view
sta _web64_actor_batch_animation_tick__arg_view+1
lda #<animation
sta _web64_actor_batch_animation_tick__arg_animation
lda #>animation
sta _web64_actor_batch_animation_tick__arg_animation+1
lda #<status
sta _web64_actor_batch_animation_tick__arg_status
lda #>status
sta _web64_actor_batch_animation_tick__arg_status+1
.endmacro
.macro web64_rt_call_actor_batch_animation_tick view, animation, status
web64_rt_prepare_actor_batch_animation_tick view, animation, status
jsr _web64_actor_batch_animation_tick
.endmacro
; web64_actor_batch_animation_tick_fast: 6-byte window; entry _web64_actor_batch_animation_tick_fast
.macro web64_rt_prepare_actor_batch_animation_tick_fast view, animation, status
lda #<view
sta _web64_actor_batch_animation_tick_fast__arg_view
lda #>view
sta _web64_actor_batch_animation_tick_fast__arg_view+1
lda #<animation
sta _web64_actor_batch_animation_tick_fast__arg_animation
lda #>animation
sta _web64_actor_batch_animation_tick_fast__arg_animation+1
lda #<status
sta _web64_actor_batch_animation_tick_fast__arg_status
lda #>status
sta _web64_actor_batch_animation_tick_fast__arg_status+1
.endmacro
.macro web64_rt_call_actor_batch_animation_tick_fast view, animation, status
web64_rt_prepare_actor_batch_animation_tick_fast view, animation, status
jsr _web64_actor_batch_animation_tick_fast
.endmacro
; web64_actor_batch_build_commands: 10-byte window; entry _web64_actor_batch_build_commands
.macro web64_rt_prepare_actor_batch_build_commands view, visible, sprites, commands, status
lda #<view
sta _web64_actor_batch_build_commands__arg_view
lda #>view
sta _web64_actor_batch_build_commands__arg_view+1
lda #<visible
sta _web64_actor_batch_build_commands__arg_visible
lda #>visible
sta _web64_actor_batch_build_commands__arg_visible+1
lda #<sprites
sta _web64_actor_batch_build_commands__arg_sprites
lda #>sprites
sta _web64_actor_batch_build_commands__arg_sprites+1
lda #<commands
sta _web64_actor_batch_build_commands__arg_commands
lda #>commands
sta _web64_actor_batch_build_commands__arg_commands+1
lda #<status
sta _web64_actor_batch_build_commands__arg_status
lda #>status
sta _web64_actor_batch_build_commands__arg_status+1
.endmacro
.macro web64_rt_call_actor_batch_build_commands view, visible, sprites, commands, status
web64_rt_prepare_actor_batch_build_commands view, visible, sprites, commands, status
jsr _web64_actor_batch_build_commands
.endmacro
; web64_actor_batch_build_commands_fast: 10-byte window; entry _web64_actor_batch_build_commands_fast
.macro web64_rt_prepare_actor_batch_build_commands_fast view, visible, sprites, commands, status
lda #<view
sta _web64_actor_batch_build_commands_fast__arg_view
lda #>view
sta _web64_actor_batch_build_commands_fast__arg_view+1
lda #<visible
sta _web64_actor_batch_build_commands_fast__arg_visible
lda #>visible
sta _web64_actor_batch_build_commands_fast__arg_visible+1
lda #<sprites
sta _web64_actor_batch_build_commands_fast__arg_sprites
lda #>sprites
sta _web64_actor_batch_build_commands_fast__arg_sprites+1
lda #<commands
sta _web64_actor_batch_build_commands_fast__arg_commands
lda #>commands
sta _web64_actor_batch_build_commands_fast__arg_commands+1
lda #<status
sta _web64_actor_batch_build_commands_fast__arg_status
lda #>status
sta _web64_actor_batch_build_commands_fast__arg_status+1
.endmacro
.macro web64_rt_call_actor_batch_build_commands_fast view, visible, sprites, commands, status
web64_rt_prepare_actor_batch_build_commands_fast view, visible, sprites, commands, status
jsr _web64_actor_batch_build_commands_fast
.endmacro
; web64_actor_batch_cull: 8-byte window; entry _web64_actor_batch_cull
.macro web64_rt_prepare_actor_batch_cull view, viewport, visible, status
lda #<view
sta _web64_actor_batch_cull__arg_view
lda #>view
sta _web64_actor_batch_cull__arg_view+1
lda #<viewport
sta _web64_actor_batch_cull__arg_viewport
lda #>viewport
sta _web64_actor_batch_cull__arg_viewport+1
lda #<visible
sta _web64_actor_batch_cull__arg_visible
lda #>visible
sta _web64_actor_batch_cull__arg_visible+1
lda #<status
sta _web64_actor_batch_cull__arg_status
lda #>status
sta _web64_actor_batch_cull__arg_status+1
.endmacro
.macro web64_rt_call_actor_batch_cull view, viewport, visible, status
web64_rt_prepare_actor_batch_cull view, viewport, visible, status
jsr _web64_actor_batch_cull
.endmacro
; web64_actor_batch_cull_fast: 8-byte window; entry _web64_actor_batch_cull_fast
.macro web64_rt_prepare_actor_batch_cull_fast view, viewport, visible, status
lda #<view
sta _web64_actor_batch_cull_fast__arg_view
lda #>view
sta _web64_actor_batch_cull_fast__arg_view+1
lda #<viewport
sta _web64_actor_batch_cull_fast__arg_viewport
lda #>viewport
sta _web64_actor_batch_cull_fast__arg_viewport+1
lda #<visible
sta _web64_actor_batch_cull_fast__arg_visible
lda #>visible
sta _web64_actor_batch_cull_fast__arg_visible+1
lda #<status
sta _web64_actor_batch_cull_fast__arg_status
lda #>status
sta _web64_actor_batch_cull_fast__arg_status+1
.endmacro
.macro web64_rt_call_actor_batch_cull_fast view, viewport, visible, status
web64_rt_prepare_actor_batch_cull_fast view, viewport, visible, status
jsr _web64_actor_batch_cull_fast
.endmacro
; web64_actor_batch_integrate_x: 4-byte window; entry _web64_actor_batch_integrate_x
.macro web64_rt_prepare_actor_batch_integrate_x view, status
lda #<view
sta _web64_actor_batch_integrate_x__arg_view
lda #>view
sta _web64_actor_batch_integrate_x__arg_view+1
lda #<status
sta _web64_actor_batch_integrate_x__arg_status
lda #>status
sta _web64_actor_batch_integrate_x__arg_status+1
.endmacro
.macro web64_rt_call_actor_batch_integrate_x view, status
web64_rt_prepare_actor_batch_integrate_x view, status
jsr _web64_actor_batch_integrate_x
.endmacro
; web64_actor_batch_integrate_x_fast: 4-byte window; entry _web64_actor_batch_integrate_x_fast
.macro web64_rt_prepare_actor_batch_integrate_x_fast view, status
lda #<view
sta _web64_actor_batch_integrate_x_fast__arg_view
lda #>view
sta _web64_actor_batch_integrate_x_fast__arg_view+1
lda #<status
sta _web64_actor_batch_integrate_x_fast__arg_status
lda #>status
sta _web64_actor_batch_integrate_x_fast__arg_status+1
.endmacro
.macro web64_rt_call_actor_batch_integrate_x_fast view, status
web64_rt_prepare_actor_batch_integrate_x_fast view, status
jsr _web64_actor_batch_integrate_x_fast
.endmacro
; web64_actor_batch_integrate_xy: 4-byte window; entry _web64_actor_batch_integrate_xy
.macro web64_rt_prepare_actor_batch_integrate_xy view, status
lda #<view
sta _web64_actor_batch_integrate_xy__arg_view
lda #>view
sta _web64_actor_batch_integrate_xy__arg_view+1
lda #<status
sta _web64_actor_batch_integrate_xy__arg_status
lda #>status
sta _web64_actor_batch_integrate_xy__arg_status+1
.endmacro
.macro web64_rt_call_actor_batch_integrate_xy view, status
web64_rt_prepare_actor_batch_integrate_xy view, status
jsr _web64_actor_batch_integrate_xy
.endmacro
; web64_actor_batch_integrate_xy_fast: 4-byte window; entry _web64_actor_batch_integrate_xy_fast
.macro web64_rt_prepare_actor_batch_integrate_xy_fast view, status
lda #<view
sta _web64_actor_batch_integrate_xy_fast__arg_view
lda #>view
sta _web64_actor_batch_integrate_xy_fast__arg_view+1
lda #<status
sta _web64_actor_batch_integrate_xy_fast__arg_status
lda #>status
sta _web64_actor_batch_integrate_xy_fast__arg_status+1
.endmacro
.macro web64_rt_call_actor_batch_integrate_xy_fast view, status
web64_rt_prepare_actor_batch_integrate_xy_fast view, status
jsr _web64_actor_batch_integrate_xy_fast
.endmacro
; web64_actor_batch_integrate_y: 4-byte window; entry _web64_actor_batch_integrate_y
.macro web64_rt_prepare_actor_batch_integrate_y view, status
lda #<view
sta _web64_actor_batch_integrate_y__arg_view
lda #>view
sta _web64_actor_batch_integrate_y__arg_view+1
lda #<status
sta _web64_actor_batch_integrate_y__arg_status
lda #>status
sta _web64_actor_batch_integrate_y__arg_status+1
.endmacro
.macro web64_rt_call_actor_batch_integrate_y view, status
web64_rt_prepare_actor_batch_integrate_y view, status
jsr _web64_actor_batch_integrate_y
.endmacro
; web64_actor_batch_integrate_y_fast: 4-byte window; entry _web64_actor_batch_integrate_y_fast
.macro web64_rt_prepare_actor_batch_integrate_y_fast view, status
lda #<view
sta _web64_actor_batch_integrate_y_fast__arg_view
lda #>view
sta _web64_actor_batch_integrate_y_fast__arg_view+1
lda #<status
sta _web64_actor_batch_integrate_y_fast__arg_status
lda #>status
sta _web64_actor_batch_integrate_y_fast__arg_status+1
.endmacro
.macro web64_rt_call_actor_batch_integrate_y_fast view, status
web64_rt_prepare_actor_batch_integrate_y_fast view, status
jsr _web64_actor_batch_integrate_y_fast
.endmacro
; web64_actor_batch_pairs_x: 8-byte window; entry _web64_actor_batch_pairs_x
.macro web64_rt_prepare_actor_batch_pairs_x view, workspace, pairs, status
lda #<view
sta _web64_actor_batch_pairs_x__arg_view
lda #>view
sta _web64_actor_batch_pairs_x__arg_view+1
lda #<workspace
sta _web64_actor_batch_pairs_x__arg_workspace
lda #>workspace
sta _web64_actor_batch_pairs_x__arg_workspace+1
lda #<pairs
sta _web64_actor_batch_pairs_x__arg_pairs
lda #>pairs
sta _web64_actor_batch_pairs_x__arg_pairs+1
lda #<status
sta _web64_actor_batch_pairs_x__arg_status
lda #>status
sta _web64_actor_batch_pairs_x__arg_status+1
.endmacro
.macro web64_rt_call_actor_batch_pairs_x view, workspace, pairs, status
web64_rt_prepare_actor_batch_pairs_x view, workspace, pairs, status
jsr _web64_actor_batch_pairs_x
.endmacro
; web64_actor_batch_pairs_x_fast: 8-byte window; entry _web64_actor_batch_pairs_x_fast
.macro web64_rt_prepare_actor_batch_pairs_x_fast view, workspace, pairs, status
lda #<view
sta _web64_actor_batch_pairs_x_fast__arg_view
lda #>view
sta _web64_actor_batch_pairs_x_fast__arg_view+1
lda #<workspace
sta _web64_actor_batch_pairs_x_fast__arg_workspace
lda #>workspace
sta _web64_actor_batch_pairs_x_fast__arg_workspace+1
lda #<pairs
sta _web64_actor_batch_pairs_x_fast__arg_pairs
lda #>pairs
sta _web64_actor_batch_pairs_x_fast__arg_pairs+1
lda #<status
sta _web64_actor_batch_pairs_x_fast__arg_status
lda #>status
sta _web64_actor_batch_pairs_x_fast__arg_status+1
.endmacro
.macro web64_rt_call_actor_batch_pairs_x_fast view, workspace, pairs, status
web64_rt_prepare_actor_batch_pairs_x_fast view, workspace, pairs, status
jsr _web64_actor_batch_pairs_x_fast
.endmacro
; web64_actor_batch_run_mux: 2-byte window; entry _web64_actor_batch_run_mux
.macro web64_rt_prepare_actor_batch_run_mux pipeline
lda #<pipeline
sta _web64_actor_batch_run_mux__arg_pipeline
lda #>pipeline
sta _web64_actor_batch_run_mux__arg_pipeline+1
.endmacro
.macro web64_rt_call_actor_batch_run_mux pipeline
web64_rt_prepare_actor_batch_run_mux pipeline
jsr _web64_actor_batch_run_mux
.endmacro
; web64_actor_batch_run_mux_fast: 2-byte window; entry _web64_actor_batch_run_mux_fast
.macro web64_rt_prepare_actor_batch_run_mux_fast pipeline
lda #<pipeline
sta _web64_actor_batch_run_mux_fast__arg_pipeline
lda #>pipeline
sta _web64_actor_batch_run_mux_fast__arg_pipeline+1
.endmacro
.macro web64_rt_call_actor_batch_run_mux_fast pipeline
web64_rt_prepare_actor_batch_run_mux_fast pipeline
jsr _web64_actor_batch_run_mux_fast
.endmacro
; web64_actor_commands_render_direct: 7-byte window; entry _web64_actor_commands_render_direct
.macro web64_rt_prepare_actor_commands_render_direct renderer, commands, owned_slots, status
lda #<renderer
sta _web64_actor_commands_render_direct__arg_renderer
lda #>renderer
sta _web64_actor_commands_render_direct__arg_renderer+1
lda #<commands
sta _web64_actor_commands_render_direct__arg_commands
lda #>commands
sta _web64_actor_commands_render_direct__arg_commands+1
lda #owned_slots
sta _web64_actor_commands_render_direct__arg_owned_slots
lda #<status
sta _web64_actor_commands_render_direct__arg_status
lda #>status
sta _web64_actor_commands_render_direct__arg_status+1
.endmacro
.macro web64_rt_call_actor_commands_render_direct renderer, commands, owned_slots, status
web64_rt_prepare_actor_commands_render_direct renderer, commands, owned_slots, status
jsr _web64_actor_commands_render_direct
.endmacro
; web64_actor_commands_render_direct_fast: 7-byte window; entry _web64_actor_commands_render_direct_fast
.macro web64_rt_prepare_actor_commands_render_direct_fast renderer, commands, owned_slots, status
lda #<renderer
sta _web64_actor_commands_render_direct_fast__arg_renderer
lda #>renderer
sta _web64_actor_commands_render_direct_fast__arg_renderer+1
lda #<commands
sta _web64_actor_commands_render_direct_fast__arg_commands
lda #>commands
sta _web64_actor_commands_render_direct_fast__arg_commands+1
lda #owned_slots
sta _web64_actor_commands_render_direct_fast__arg_owned_slots
lda #<status
sta _web64_actor_commands_render_direct_fast__arg_status
lda #>status
sta _web64_actor_commands_render_direct_fast__arg_status+1
.endmacro
.macro web64_rt_call_actor_commands_render_direct_fast renderer, commands, owned_slots, status
web64_rt_prepare_actor_commands_render_direct_fast renderer, commands, owned_slots, status
jsr _web64_actor_commands_render_direct_fast
.endmacro
; web64_actor_commands_submit_mux: 6-byte window; entry _web64_actor_commands_submit_mux
.macro web64_rt_prepare_actor_commands_submit_mux mux, commands, status
lda #<mux
sta _web64_actor_commands_submit_mux__arg_mux
lda #>mux
sta _web64_actor_commands_submit_mux__arg_mux+1
lda #<commands
sta _web64_actor_commands_submit_mux__arg_commands
lda #>commands
sta _web64_actor_commands_submit_mux__arg_commands+1
lda #<status
sta _web64_actor_commands_submit_mux__arg_status
lda #>status
sta _web64_actor_commands_submit_mux__arg_status+1
.endmacro
.macro web64_rt_call_actor_commands_submit_mux mux, commands, status
web64_rt_prepare_actor_commands_submit_mux mux, commands, status
jsr _web64_actor_commands_submit_mux
.endmacro
; web64_actor_commands_submit_mux_fast: 6-byte window; entry _web64_actor_commands_submit_mux_fast
.macro web64_rt_prepare_actor_commands_submit_mux_fast mux, commands, status
lda #<mux
sta _web64_actor_commands_submit_mux_fast__arg_mux
lda #>mux
sta _web64_actor_commands_submit_mux_fast__arg_mux+1
lda #<commands
sta _web64_actor_commands_submit_mux_fast__arg_commands
lda #>commands
sta _web64_actor_commands_submit_mux_fast__arg_commands+1
lda #<status
sta _web64_actor_commands_submit_mux_fast__arg_status
lda #>status
sta _web64_actor_commands_submit_mux_fast__arg_status+1
.endmacro
.macro web64_rt_call_actor_commands_submit_mux_fast mux, commands, status
web64_rt_prepare_actor_commands_submit_mux_fast mux, commands, status
jsr _web64_actor_commands_submit_mux_fast
.endmacro
; web64_actor_sprite_bind_asset: 8-byte window; entry _web64_actor_sprite_bind_asset
.macro web64_rt_prepare_actor_sprite_bind_asset sprites, actor, asset, pointer_base, flags, priority
lda #<sprites
sta _web64_actor_sprite_bind_asset__arg_sprites
lda #>sprites
sta _web64_actor_sprite_bind_asset__arg_sprites+1
lda #actor
sta _web64_actor_sprite_bind_asset__arg_actor
lda #<asset
sta _web64_actor_sprite_bind_asset__arg_asset
lda #>asset
sta _web64_actor_sprite_bind_asset__arg_asset+1
lda #pointer_base
sta _web64_actor_sprite_bind_asset__arg_pointer_base
lda #flags
sta _web64_actor_sprite_bind_asset__arg_flags
lda #priority
sta _web64_actor_sprite_bind_asset__arg_priority
.endmacro
.macro web64_rt_call_actor_sprite_bind_asset sprites, actor, asset, pointer_base, flags, priority
web64_rt_prepare_actor_sprite_bind_asset sprites, actor, asset, pointer_base, flags, priority
jsr _web64_actor_sprite_bind_asset
.endmacro
; web64_actor_sprite_bind_asset_pair: 7-byte window; entry _web64_actor_sprite_bind_asset_pair
.macro web64_rt_prepare_actor_sprite_bind_asset_pair sprites, actor, binding, flags, priority
lda #<sprites
sta _web64_actor_sprite_bind_asset_pair__arg_sprites
lda #>sprites
sta _web64_actor_sprite_bind_asset_pair__arg_sprites+1
lda #actor
sta _web64_actor_sprite_bind_asset_pair__arg_actor
lda #<binding
sta _web64_actor_sprite_bind_asset_pair__arg_binding
lda #>binding
sta _web64_actor_sprite_bind_asset_pair__arg_binding+1
lda #flags
sta _web64_actor_sprite_bind_asset_pair__arg_flags
lda #priority
sta _web64_actor_sprite_bind_asset_pair__arg_priority
.endmacro
.macro web64_rt_call_actor_sprite_bind_asset_pair sprites, actor, binding, flags, priority
web64_rt_prepare_actor_sprite_bind_asset_pair sprites, actor, binding, flags, priority
jsr _web64_actor_sprite_bind_asset_pair
.endmacro
; web64_actor_sprite_bind_raw: 9-byte window; entry _web64_actor_sprite_bind_raw
.macro web64_rt_prepare_actor_sprite_bind_raw sprites, actor, pointer_base, frame_count, color, flags, priority
lda #<sprites
sta _web64_actor_sprite_bind_raw__arg_sprites
lda #>sprites
sta _web64_actor_sprite_bind_raw__arg_sprites+1
lda #actor
sta _web64_actor_sprite_bind_raw__arg_actor
lda #pointer_base
sta _web64_actor_sprite_bind_raw__arg_pointer_base
lda #<frame_count
sta _web64_actor_sprite_bind_raw__arg_frame_count
lda #>frame_count
sta _web64_actor_sprite_bind_raw__arg_frame_count+1
lda #color
sta _web64_actor_sprite_bind_raw__arg_color
lda #flags
sta _web64_actor_sprite_bind_raw__arg_flags
lda #priority
sta _web64_actor_sprite_bind_raw__arg_priority
.endmacro
.macro web64_rt_call_actor_sprite_bind_raw sprites, actor, pointer_base, frame_count, color, flags, priority
web64_rt_prepare_actor_sprite_bind_raw sprites, actor, pointer_base, frame_count, color, flags, priority
jsr _web64_actor_sprite_bind_raw
.endmacro
; web64_actor_sprite_unbind: 3-byte window; entry _web64_actor_sprite_unbind
.macro web64_rt_prepare_actor_sprite_unbind sprites, actor
lda #<sprites
sta _web64_actor_sprite_unbind__arg_sprites
lda #>sprites
sta _web64_actor_sprite_unbind__arg_sprites+1
lda #actor
sta _web64_actor_sprite_unbind__arg_actor
.endmacro
.macro web64_rt_call_actor_sprite_unbind sprites, actor
web64_rt_prepare_actor_sprite_unbind sprites, actor
jsr _web64_actor_sprite_unbind
.endmacro
web64/actors.h
Compile-time actor-pool storage macros plus activation and compaction helpers.
Included headers: <web64/game.h>, <web64/animation.h>, <web64/sprite-runtime.h>.
Functions:
| Name | Prototype | Description | Typical use |
|---|---|---|---|
web64_actor_activate | _web64_rt uint8_t web64_actor_activate(uint8_t *active, uint8_t *active_ids, uint8_t *active_count, uint8_t capacity, uint8_t actor) | Marks an actor active, appends it to the compact active-ID list, and returns nonzero on success. | web64_actor_activate(active, active_ids, &active_count, capacity, actor); |
web64_actor_deactivate | _web64_rt uint8_t web64_actor_deactivate(uint8_t *active, uint8_t *active_ids, uint8_t *active_count, uint8_t actor) | Marks an actor inactive and removes it from the compact active-ID list without linking animation or sprite code. | web64_actor_deactivate(active, active_ids, &active_count, actor); |
Macros:
| Name | Value | Description |
|---|---|---|
WEB64_ACTOR_NONE | 0xff | Macro constant exported by the header. |
WEB64_ACTOR_STORAGE_NONE | 0 | Macro constant exported by the header. |
WEB64_ACTOR_STORAGE_ANIMATION | 1 | Macro constant exported by the header. |
WEB64_ACTOR_STORAGE_SPRITE_BINDING | 2 | Macro constant exported by the header. |
WEB64_ACTOR_POOL_CORE(name, capacity) | int16_t name##_x[capacity]; int16_t name##_y[capacity]; int16_t name##_vx[capacity]; int16_t name##_vy[capacity]; uint8_t name##_width[capacity]; uint8_t name##_height[capacity]; uint8_t name##_category[capacity]; uint8_t name##_mask[capacity]; uint8_t name##_state[capacity]; uint8_t name##_facing[capacity]; uint8_t name##_active[capacity]; uint8_t name##_active_ids[capacity]; uint8_t name##_active_count | Macro constant exported by the header. |
WEB64_ACTOR_POOL_ANIMATION_STORAGE(name, capacity) | Web64AnimationPlayer name##_animation[capacity] | Macro constant exported by the header. |
WEB64_ACTOR_POOL_SPRITE_STORAGE(name, capacity) | uint8_t name##_sprite_slot[capacity]; uint8_t name##_sprite_frame[capacity]; uint8_t name##_sprite_flags[capacity] | Macro constant exported by the header. |
WEB64_ACTOR_POOL_OPTIONAL_ANIMATION(name, capacity) | WEB64_ACTOR_POOL_ANIMATION_STORAGE(name, capacity) | Macro constant exported by the header. |
WEB64_ACTOR_POOL_OPTIONAL_SPRITES(name, capacity) | WEB64_ACTOR_POOL_SPRITE_STORAGE(name, capacity) | Macro constant exported by the header. |
WEB64_ACTOR_POOL_OPTIONAL_ANIMATION_SPRITES(name, capacity) | WEB64_ACTOR_POOL_ANIMATION_STORAGE(name, capacity); WEB64_ACTOR_POOL_SPRITE_STORAGE(name, capacity) | Macro constant exported by the header. |
WEB64_ACTOR_POOL_DECLARE(name, capacity, optional_storage) | WEB64_ACTOR_POOL_CORE(name, capacity); optional_storage(name, capacity) | Macro constant exported by the header. |
WEB64_ACTOR_POOL(name, capacity) | WEB64_ACTOR_POOL_CORE(name, capacity) | Macro constant exported by the header. |
WEB64_ACTOR_POOL_WITH_ANIMATION(name, capacity) | WEB64_ACTOR_POOL_CORE(name, capacity); WEB64_ACTOR_POOL_ANIMATION_STORAGE(name, capacity) | Macro constant exported by the header. |
WEB64_ACTOR_POOL_WITH_SPRITES(name, capacity) | WEB64_ACTOR_POOL_CORE(name, capacity); WEB64_ACTOR_POOL_SPRITE_STORAGE(name, capacity) | Macro constant exported by the header. |
WEB64_ACTOR_POOL_WITH_ANIMATION_SPRITES(name, capacity) | WEB64_ACTOR_POOL_CORE(name, capacity); WEB64_ACTOR_POOL_ANIMATION_STORAGE(name, capacity); WEB64_ACTOR_POOL_SPRITE_STORAGE(name, capacity) | Macro constant exported by the header. |
Header listing:
#ifndef WEB64_ACTORS_H
#define WEB64_ACTORS_H
#include <web64/game.h>
#include <web64/animation.h>
#include <web64/sprite-runtime.h>
#define WEB64_ACTOR_NONE 0xff
#define WEB64_ACTOR_STORAGE_NONE 0
#define WEB64_ACTOR_STORAGE_ANIMATION 1
#define WEB64_ACTOR_STORAGE_SPRITE_BINDING 2
#define WEB64_ACTOR_POOL_CORE(name, capacity) int16_t name##_x[capacity]; int16_t name##_y[capacity]; int16_t name##_vx[capacity]; int16_t name##_vy[capacity]; uint8_t name##_width[capacity]; uint8_t name##_height[capacity]; uint8_t name##_category[capacity]; uint8_t name##_mask[capacity]; uint8_t name##_state[capacity]; uint8_t name##_facing[capacity]; uint8_t name##_active[capacity]; uint8_t name##_active_ids[capacity]; uint8_t name##_active_count
#define WEB64_ACTOR_POOL_ANIMATION_STORAGE(name, capacity) Web64AnimationPlayer name##_animation[capacity]
#define WEB64_ACTOR_POOL_SPRITE_STORAGE(name, capacity) uint8_t name##_sprite_slot[capacity]; uint8_t name##_sprite_frame[capacity]; uint8_t name##_sprite_flags[capacity]
#define WEB64_ACTOR_POOL_OPTIONAL_NONE(name, capacity)
#define WEB64_ACTOR_POOL_OPTIONAL_ANIMATION(name, capacity) WEB64_ACTOR_POOL_ANIMATION_STORAGE(name, capacity)
#define WEB64_ACTOR_POOL_OPTIONAL_SPRITES(name, capacity) WEB64_ACTOR_POOL_SPRITE_STORAGE(name, capacity)
#define WEB64_ACTOR_POOL_OPTIONAL_ANIMATION_SPRITES(name, capacity) WEB64_ACTOR_POOL_ANIMATION_STORAGE(name, capacity); WEB64_ACTOR_POOL_SPRITE_STORAGE(name, capacity)
#define WEB64_ACTOR_POOL_DECLARE(name, capacity, optional_storage) WEB64_ACTOR_POOL_CORE(name, capacity); optional_storage(name, capacity)
#define WEB64_ACTOR_POOL(name, capacity) WEB64_ACTOR_POOL_CORE(name, capacity)
#define WEB64_ACTOR_POOL_WITH_ANIMATION(name, capacity) WEB64_ACTOR_POOL_CORE(name, capacity); WEB64_ACTOR_POOL_ANIMATION_STORAGE(name, capacity)
#define WEB64_ACTOR_POOL_WITH_SPRITES(name, capacity) WEB64_ACTOR_POOL_CORE(name, capacity); WEB64_ACTOR_POOL_SPRITE_STORAGE(name, capacity)
#define WEB64_ACTOR_POOL_WITH_ANIMATION_SPRITES(name, capacity) WEB64_ACTOR_POOL_CORE(name, capacity); WEB64_ACTOR_POOL_ANIMATION_STORAGE(name, capacity); WEB64_ACTOR_POOL_SPRITE_STORAGE(name, capacity)
_web64_rt uint8_t web64_actor_activate(uint8_t *active, uint8_t *active_ids, uint8_t *active_count, uint8_t capacity, uint8_t actor);
_web64_rt uint8_t web64_actor_deactivate(uint8_t *active, uint8_t *active_ids, uint8_t *active_count, uint8_t actor);
#endif
web64/actors.inc
Registry-generated Actor-pool runtime prepare/call macros for native assembly.
Header listing:
; Web64 _web64_rt C/assembly call helpers for <web64/actors.h>
; Generated from native runtime registry v8; do not hand-edit.
; Arguments are immediate assembly expressions. Pass C globals with their emitted labels.
; Prepare helpers write the complete exact-width window and clobber A only.
; Call helpers prepare the window, JSR the public entry, and inherit its clobber/return contract.
; Helpers allocate no storage. Including this file, or leaving a helper unused, links zero runtime bytes.
WEB64_RT_ACTORS_CALL_COUNT = 2
WEB64_RT_ACTORS_WINDOW_CALL_COUNT = 2
; web64_actor_activate: 8-byte window; entry _web64_actor_activate
.macro web64_rt_prepare_actor_activate active, active_ids, active_count, capacity, actor
lda #<active
sta _web64_actor_activate__arg_active
lda #>active
sta _web64_actor_activate__arg_active+1
lda #<active_ids
sta _web64_actor_activate__arg_active_ids
lda #>active_ids
sta _web64_actor_activate__arg_active_ids+1
lda #<active_count
sta _web64_actor_activate__arg_active_count
lda #>active_count
sta _web64_actor_activate__arg_active_count+1
lda #capacity
sta _web64_actor_activate__arg_capacity
lda #actor
sta _web64_actor_activate__arg_actor
.endmacro
.macro web64_rt_call_actor_activate active, active_ids, active_count, capacity, actor
web64_rt_prepare_actor_activate active, active_ids, active_count, capacity, actor
jsr _web64_actor_activate
.endmacro
; web64_actor_deactivate: 7-byte window; entry _web64_actor_deactivate
.macro web64_rt_prepare_actor_deactivate active, active_ids, active_count, actor
lda #<active
sta _web64_actor_deactivate__arg_active
lda #>active
sta _web64_actor_deactivate__arg_active+1
lda #<active_ids
sta _web64_actor_deactivate__arg_active_ids
lda #>active_ids
sta _web64_actor_deactivate__arg_active_ids+1
lda #<active_count
sta _web64_actor_deactivate__arg_active_count
lda #>active_count
sta _web64_actor_deactivate__arg_active_count+1
lda #actor
sta _web64_actor_deactivate__arg_actor
.endmacro
.macro web64_rt_call_actor_deactivate active, active_ids, active_count, actor
web64_rt_prepare_actor_deactivate active, active_ids, active_count, actor
jsr _web64_actor_deactivate
.endmacro
web64/animation.h
Independent deterministic animation-bank playback state, sequence control, completion status, and step events.
Included headers: <stdint.h>.
Functions:
| Name | Prototype | Description | Typical use |
|---|---|---|---|
web64_animation_init | _web64_rt void web64_animation_init(Web64AnimationPlayer *player, uint16_t bank) | Initializes an animation player against an immutable animation bank. | web64_animation_init(&player, (uint16_t)bank); |
web64_animation_play | _web64_rt void web64_animation_play(Web64AnimationPlayer *player, uint8_t sequence, uint8_t policy) | Starts a sequence using the requested play policy, optionally keeping the current sequence when unchanged. | web64_animation_play(&player, SEQ_WALK, WEB64_ANIMATION_PLAY_IF_CHANGED); |
web64_animation_queue | _web64_rt void web64_animation_queue(Web64AnimationPlayer *player, uint8_t sequence) | Queues a sequence to start after the current one-shot sequence completes. | web64_animation_queue(&player, SEQ_IDLE); |
web64_animation_tick | _web64_rt uint8_t web64_animation_tick(Web64AnimationPlayer *player) | Advances deterministic frame-tick playback and returns player status flags. | status = web64_animation_tick(&player); |
web64_animation_take_events | _web64_rt uint8_t web64_animation_take_events(Web64AnimationPlayer *player) | Returns and clears accumulated animation step events. | events = web64_animation_take_events(&player); |
Structs:
| Name | Description | Field summary |
|---|---|---|
Web64AnimationStep | Public struct declared by <web64/animation.h>. | 8 fields: uint8_t frame, uint8_t duration, uint8_t event, uint8_t overlay_frame, ... |
Web64AnimationBank | Public struct declared by <web64/animation.h>. | 13 fields: uint16_t sequences, uint8_t count, } Web64AnimationBank, typedef struct { uint16_t bank, ... |
Macros:
| Name | Value | Description |
|---|---|---|
WEB64_ANIMATION_LOOP | 1 | Macro constant exported by the header. |
WEB64_ANIMATION_ONCE | 2 | Macro constant exported by the header. |
WEB64_ANIMATION_PINGPONG | 4 | Macro constant exported by the header. |
WEB64_ANIMATION_HOLD | 8 | Macro constant exported by the header. |
WEB64_ANIMATION_HIDE | 16 | Macro constant exported by the header. |
WEB64_ANIMATION_PLAY_IF_CHANGED | 1 | Macro constant exported by the header. |
WEB64_ANIMATION_PLAY_RESTART | 2 | Macro constant exported by the header. |
WEB64_ANIMATION_STATUS_COMPLETE | 1 | Macro constant exported by the header. |
WEB64_ANIMATION_STATUS_HIDDEN | 2 | Macro constant exported by the header. |
Header listing:
#ifndef WEB64_ANIMATION_H
#define WEB64_ANIMATION_H
#include <stdint.h>
#define WEB64_ANIMATION_LOOP 1
#define WEB64_ANIMATION_ONCE 2
#define WEB64_ANIMATION_PINGPONG 4
#define WEB64_ANIMATION_HOLD 8
#define WEB64_ANIMATION_HIDE 16
#define WEB64_ANIMATION_PLAY_IF_CHANGED 1
#define WEB64_ANIMATION_PLAY_RESTART 2
#define WEB64_ANIMATION_STATUS_COMPLETE 1
#define WEB64_ANIMATION_STATUS_HIDDEN 2
typedef struct { uint8_t frame; uint8_t duration; uint8_t event; uint8_t overlay_frame; } Web64AnimationStep;
typedef struct { uint16_t steps; uint8_t count; uint8_t flags; } Web64AnimationSequence;
typedef struct { uint16_t sequences; uint8_t count; } Web64AnimationBank;
typedef struct { uint16_t bank; uint8_t sequence; uint8_t queued; uint8_t step; uint8_t ticks; uint8_t frame; uint8_t overlay_frame; uint8_t events; uint8_t status; int8_t direction; } Web64AnimationPlayer;
_web64_rt void web64_animation_init(Web64AnimationPlayer *player, uint16_t bank);
_web64_rt void web64_animation_play(Web64AnimationPlayer *player, uint8_t sequence, uint8_t policy);
_web64_rt void web64_animation_queue(Web64AnimationPlayer *player, uint8_t sequence);
_web64_rt uint8_t web64_animation_tick(Web64AnimationPlayer *player);
_web64_rt uint8_t web64_animation_take_events(Web64AnimationPlayer *player);
#endif
web64/animation.inc
Registry-generated Animation runtime prepare/call macros for native assembly.
Header listing:
; Web64 _web64_rt C/assembly call helpers for <web64/animation.h>
; Generated from native runtime registry v8; do not hand-edit.
; Arguments are immediate assembly expressions. Pass C globals with their emitted labels.
; Prepare helpers write the complete exact-width window and clobber A only.
; Call helpers prepare the window, JSR the public entry, and inherit its clobber/return contract.
; Helpers allocate no storage. Including this file, or leaving a helper unused, links zero runtime bytes.
WEB64_RT_ANIMATION_CALL_COUNT = 5
WEB64_RT_ANIMATION_WINDOW_CALL_COUNT = 5
; web64_animation_init: 4-byte window; entry _web64_animation_init
.macro web64_rt_prepare_animation_init player, bank
lda #<player
sta _web64_animation_init__arg_player
lda #>player
sta _web64_animation_init__arg_player+1
lda #<bank
sta _web64_animation_init__arg_bank
lda #>bank
sta _web64_animation_init__arg_bank+1
.endmacro
.macro web64_rt_call_animation_init player, bank
web64_rt_prepare_animation_init player, bank
jsr _web64_animation_init
.endmacro
; web64_animation_play: 4-byte window; entry _web64_animation_play
.macro web64_rt_prepare_animation_play player, sequence, policy
lda #<player
sta _web64_animation_play__arg_player
lda #>player
sta _web64_animation_play__arg_player+1
lda #sequence
sta _web64_animation_play__arg_sequence
lda #policy
sta _web64_animation_play__arg_policy
.endmacro
.macro web64_rt_call_animation_play player, sequence, policy
web64_rt_prepare_animation_play player, sequence, policy
jsr _web64_animation_play
.endmacro
; web64_animation_queue: 3-byte window; entry _web64_animation_queue
.macro web64_rt_prepare_animation_queue player, sequence
lda #<player
sta _web64_animation_queue__arg_player
lda #>player
sta _web64_animation_queue__arg_player+1
lda #sequence
sta _web64_animation_queue__arg_sequence
.endmacro
.macro web64_rt_call_animation_queue player, sequence
web64_rt_prepare_animation_queue player, sequence
jsr _web64_animation_queue
.endmacro
; web64_animation_take_events: 2-byte window; entry _web64_animation_take_events
.macro web64_rt_prepare_animation_take_events player
lda #<player
sta _web64_animation_take_events__arg_player
lda #>player
sta _web64_animation_take_events__arg_player+1
.endmacro
.macro web64_rt_call_animation_take_events player
web64_rt_prepare_animation_take_events player
jsr _web64_animation_take_events
.endmacro
; web64_animation_tick: 2-byte window; entry _web64_animation_tick
.macro web64_rt_prepare_animation_tick player
lda #<player
sta _web64_animation_tick__arg_player
lda #>player
sta _web64_animation_tick__arg_player+1
.endmacro
.macro web64_rt_call_animation_tick player
web64_rt_prepare_animation_tick player
jsr _web64_animation_tick
.endmacro
web64/assets.h
Public Web64 Asset Model v1 descriptor types and constants for generated asset metadata.
Included headers: <stdint.h>.
Functions:
| Name | Prototype | Description | Typical use |
|---|---|---|---|
web64_asset_copy | _web64_rt void web64_asset_copy(uint8_t *destination, const uint8_t *source, uint16_t length) | Web64 SDK runtime helper. | web64_asset_copy(...) |
web64_asset_copy_char | _web64_rt uint8_t web64_asset_copy_char(uint8_t *destination, const Web64CharAsset *asset) | Web64 SDK runtime helper. | web64_asset_copy_char(...) |
web64_asset_copy_charset | _web64_rt uint8_t web64_asset_copy_charset(uint8_t *destination, const Web64CharsetAsset *asset) | Web64 SDK runtime helper. | web64_asset_copy_charset(...) |
web64_asset_copy_sprite | _web64_rt uint8_t web64_asset_copy_sprite(uint8_t *destination, const Web64SpriteAsset *asset) | Web64 SDK runtime helper. | web64_asset_copy_sprite(...) |
web64_asset_copy_sprite_pair | _web64_rt uint8_t web64_asset_copy_sprite_pair(uint8_t *base_destination, uint8_t *overlay_destination, const Web64SpriteOverlayAsset *asset) | Web64 SDK runtime helper. | web64_asset_copy_sprite_pair(...) |
web64_asset_copy_block | _web64_rt uint8_t web64_asset_copy_block(uint8_t *destination, const Web64BlockAsset *asset) | Web64 SDK runtime helper. | web64_asset_copy_block(...) |
web64_asset_copy_blockset | _web64_rt uint8_t web64_asset_copy_blockset(uint8_t *destination, const Web64BlockSetAsset *asset) | Web64 SDK runtime helper. | web64_asset_copy_blockset(...) |
web64_asset_copy_map_plane | _web64_rt uint8_t web64_asset_copy_map_plane(uint8_t *destination, const Web64MapAsset *asset, uint8_t plane) | Web64 SDK runtime helper. | web64_asset_copy_map_plane(...) |
web64_asset_copy_sid_payload | _web64_rt uint8_t web64_asset_copy_sid_payload(uint8_t *destination, const Web64SidAsset *asset) | Web64 SDK runtime helper. | web64_asset_copy_sid_payload(...) |
Typedefs:
| Name | Declaration | Description |
|---|---|---|
Web64AssetKind | typedef uint8_t Web64AssetKind; | Web64 SDK public alias type. |
Web64SpriteMode | typedef uint8_t Web64SpriteMode; | Web64 SDK public alias type. |
Web64MapCellType | typedef uint8_t Web64MapCellType; | Web64 SDK public alias type. |
Web64AssetFlags | typedef uint8_t Web64AssetFlags; | Web64 SDK public alias type. |
Web64Bool | typedef uint8_t Web64Bool; | Web64 SDK public alias type. |
Web64AssetAddress | typedef uint16_t Web64AssetAddress; | Web64 SDK public alias type. |
Web64AssetRef | typedef uint16_t Web64AssetRef; | Web64 SDK public alias type. |
Structs:
| Name | Description | Field summary |
|---|---|---|
Web64CharAsset | Descriptor struct used by generated asset metadata or runtime helpers. | 12 fields: Web64AssetAddress data, uint8_t width_pixels, uint8_t height_pixels, uint8_t bytes_per_char, ... |
Web64SpriteAsset | Descriptor struct used by generated asset metadata or runtime helpers. | 21 fields: Web64AssetAddress data, uint16_t byte_size, uint16_t frame_count, uint8_t bytes_per_frame, ... |
Web64BlockAsset | Descriptor struct used by generated asset metadata or runtime helpers. | 16 fields: Web64AssetAddress data, uint16_t byte_size, uint8_t width_chars, uint8_t height_chars, ... |
Web64MapAsset | Descriptor struct used by generated asset metadata or runtime helpers. | 23 fields: Web64AssetAddress cells, Web64AssetAddress colors, Web64AssetAddress attributes, Web64AssetRef source, ... |
Web64Sprite | Runtime-facing Web64 helper struct. | 16 fields: Web64AssetRef asset, uint16_t x, uint8_t y, uint8_t frame, ... |
Web64MapView | Runtime-facing Web64 helper struct. | 8 fields: Web64AssetRef asset, uint16_t map_x, uint16_t map_y, uint8_t screen_x, ... |
Macros:
| Name | Value | Description |
|---|---|---|
WEB64_ASSET_MODEL_VERSION | 0x0001 | Macro constant exported by the header. |
WEB64_GENERATED_ASSETS_VERSION | 0x0001 | Macro constant exported by the header. |
WEB64_ASSET_ADDRESS_NONE | 0x0000 | Macro constant exported by the header. |
WEB64_ASSET_REF_NONE | 0x0000 | Macro constant exported by the header. |
WEB64_SPRITE_BLOCK_NONE | 0xff | Macro constant exported by the header. |
WEB64_ASSET_KIND_BINARY | 1 | Web64 asset kind discriminator constant. |
WEB64_ASSET_KIND_CHAR | 2 | Web64 asset kind discriminator constant. |
WEB64_ASSET_KIND_CHARSET | 3 | Web64 asset kind discriminator constant. |
WEB64_ASSET_KIND_SPRITE_MONO | 4 | Web64 asset kind discriminator constant. |
WEB64_ASSET_KIND_SPRITE_MC | 5 | Web64 asset kind discriminator constant. |
WEB64_ASSET_KIND_SPRITE_OVERLAY | 6 | Web64 asset kind discriminator constant. |
WEB64_ASSET_KIND_BLOCK | 7 | Web64 asset kind discriminator constant. |
WEB64_ASSET_KIND_BLOCKSET | 8 | Web64 asset kind discriminator constant. |
WEB64_ASSET_KIND_MAP | 9 | Web64 asset kind discriminator constant. |
WEB64_ASSET_KIND_SID | 10 | Web64 asset kind discriminator constant. |
WEB64_ASSET_KIND_SOURCE | 11 | Web64 asset kind discriminator constant. |
WEB64_SPRITE_MODE_MONO | 1 | Sprite asset storage mode constant. |
WEB64_SPRITE_MODE_MULTICOLOR | 2 | Sprite asset storage mode constant. |
WEB64_MAP_CELL_CHAR | 1 | Map cell-type discriminator constant. |
WEB64_MAP_CELL_BLOCK | 2 | Map cell-type discriminator constant. |
WEB64_SPRITE_FLAG_ENABLED | 1 | Web64 sprite runtime flag bit. |
WEB64_SPRITE_FLAG_MULTICOLOR | 2 | Web64 sprite runtime flag bit. |
WEB64_SPRITE_FLAG_EXPAND_X | 4 | Web64 sprite runtime flag bit. |
WEB64_SPRITE_FLAG_EXPAND_Y | 8 | Web64 sprite runtime flag bit. |
WEB64_SPRITE_FLAG_BEHIND_BACKGROUND | 16 | Web64 sprite runtime flag bit. |
WEB64_CHAR_FLAG_MULTICOLOR | 1 | Web64 character asset flag bit. |
WEB64_BLOCK_FLAG_HAS_COLORS | 1 | Web64 block asset flag bit. |
WEB64_BLOCK_FLAG_HAS_ATTRIBUTES | 2 | Web64 block asset flag bit. |
WEB64_MAP_FLAG_BLOCK_CELLS | 1 | Web64 map asset flag bit. |
WEB64_MAP_FLAG_HAS_COLORS | 2 | Web64 map asset flag bit. |
WEB64_MAP_FLAG_HAS_ATTRIBUTES | 4 | Web64 map asset flag bit. |
WEB64_MAP_FLAG_HAS_SCREEN | 8 | Web64 map asset flag bit. |
WEB64_ASSET_COPY_OK | 0 | Macro constant exported by the header. |
WEB64_ASSET_COPY_INVALID_DESCRIPTOR | 1 | Macro constant exported by the header. |
WEB64_ASSET_COPY_INVALID_PLANE | 2 | Macro constant exported by the header. |
WEB64_ASSET_COPY_LENGTH_OVERFLOW | 4 | Macro constant exported by the header. |
WEB64_MAP_PLANE_CELLS | 0 | Macro constant exported by the header. |
WEB64_MAP_PLANE_COLORS | 1 | Macro constant exported by the header. |
WEB64_MAP_PLANE_ATTRIBUTES | 2 | Macro constant exported by the header. |
WEB64_MAP_PLANE_SCREEN | 3 | Macro constant exported by the header. |
Header listing:
#ifndef WEB64_ASSETS_H
#define WEB64_ASSETS_H
#include <stdint.h>
#define WEB64_ASSET_MODEL_VERSION 0x0001
#define WEB64_GENERATED_ASSETS_VERSION 0x0001
#define WEB64_ASSET_ADDRESS_NONE 0x0000
#define WEB64_ASSET_REF_NONE 0x0000
#define WEB64_SPRITE_BLOCK_NONE 0xff
#define WEB64_ASSET_KIND_BINARY 1
#define WEB64_ASSET_KIND_CHAR 2
#define WEB64_ASSET_KIND_CHARSET 3
#define WEB64_ASSET_KIND_SPRITE_MONO 4
#define WEB64_ASSET_KIND_SPRITE_MC 5
#define WEB64_ASSET_KIND_SPRITE_OVERLAY 6
#define WEB64_ASSET_KIND_BLOCK 7
#define WEB64_ASSET_KIND_BLOCKSET 8
#define WEB64_ASSET_KIND_MAP 9
#define WEB64_ASSET_KIND_SID 10
#define WEB64_ASSET_KIND_SOURCE 11
#define WEB64_SPRITE_MODE_MONO 1
#define WEB64_SPRITE_MODE_MULTICOLOR 2
#define WEB64_MAP_CELL_CHAR 1
#define WEB64_MAP_CELL_BLOCK 2
#define WEB64_SPRITE_FLAG_ENABLED 1
#define WEB64_SPRITE_FLAG_MULTICOLOR 2
#define WEB64_SPRITE_FLAG_EXPAND_X 4
#define WEB64_SPRITE_FLAG_EXPAND_Y 8
#define WEB64_SPRITE_FLAG_BEHIND_BACKGROUND 16
#define WEB64_CHAR_FLAG_MULTICOLOR 1
#define WEB64_BLOCK_FLAG_HAS_COLORS 1
#define WEB64_BLOCK_FLAG_HAS_ATTRIBUTES 2
#define WEB64_MAP_FLAG_BLOCK_CELLS 1
#define WEB64_MAP_FLAG_HAS_COLORS 2
#define WEB64_MAP_FLAG_HAS_ATTRIBUTES 4
#define WEB64_MAP_FLAG_HAS_SCREEN 8
#define WEB64_ASSET_COPY_OK 0
#define WEB64_ASSET_COPY_INVALID_DESCRIPTOR 1
#define WEB64_ASSET_COPY_INVALID_PLANE 2
#define WEB64_ASSET_COPY_LENGTH_OVERFLOW 4
#define WEB64_MAP_PLANE_CELLS 0
#define WEB64_MAP_PLANE_COLORS 1
#define WEB64_MAP_PLANE_ATTRIBUTES 2
#define WEB64_MAP_PLANE_SCREEN 3
typedef uint8_t Web64AssetKind;
typedef uint8_t Web64SpriteMode;
typedef uint8_t Web64MapCellType;
typedef uint8_t Web64AssetFlags;
typedef uint8_t Web64Bool;
typedef uint16_t Web64AssetAddress;
typedef uint16_t Web64AssetRef;
typedef struct { Web64AssetAddress data; uint8_t width_pixels; uint8_t height_pixels; uint8_t bytes_per_char; uint8_t mode; uint8_t default_color; } Web64CharAsset;
typedef struct { Web64AssetAddress data; uint16_t byte_size; uint16_t char_count; uint8_t bytes_per_char; uint8_t mode; } Web64CharsetAsset;
typedef struct { Web64AssetAddress data; uint16_t byte_size; uint16_t frame_count; uint8_t bytes_per_frame; uint8_t payload_bytes_per_frame; uint8_t width_pixels; uint8_t height_pixels; uint8_t mode; uint8_t default_color; uint8_t multicolor_1; uint8_t multicolor_2; uint8_t data_block; } Web64SpriteAsset;
typedef struct { Web64AssetRef base; Web64AssetRef overlay; uint16_t frame_count; uint8_t base_color; uint8_t overlay_color; uint8_t multicolor_1; uint8_t multicolor_2; uint8_t flags; } Web64SpriteOverlayAsset;
typedef struct { Web64AssetAddress data; uint16_t byte_size; uint8_t width_chars; uint8_t height_chars; uint8_t char_index_width; uint8_t flags; } Web64BlockAsset;
typedef struct { Web64AssetAddress data; Web64AssetRef charset; uint16_t byte_size; uint16_t block_count; uint8_t width_chars; uint8_t height_chars; uint16_t bytes_per_block; uint8_t index_width; uint8_t flags; } Web64BlockSetAsset;
typedef struct { Web64AssetAddress cells; Web64AssetAddress colors; Web64AssetAddress attributes; Web64AssetRef source; uint16_t width; uint16_t height; uint16_t cell_count; uint8_t cell_type; uint8_t index_width; uint8_t flags; Web64AssetAddress screen; } Web64MapAsset;
typedef struct { Web64AssetAddress data; uint16_t file_size; uint16_t c64_data_offset; uint16_t c64_data_size; uint16_t load_address; uint16_t init_address; uint16_t play_address; uint16_t song_count; uint16_t start_song; uint32_t speed_flags; uint16_t flags; } Web64SidAsset;
_web64_rt void web64_asset_copy(uint8_t *destination, const uint8_t *source, uint16_t length);
_web64_rt uint8_t web64_asset_copy_char(uint8_t *destination, const Web64CharAsset *asset);
_web64_rt uint8_t web64_asset_copy_charset(uint8_t *destination, const Web64CharsetAsset *asset);
_web64_rt uint8_t web64_asset_copy_sprite(uint8_t *destination, const Web64SpriteAsset *asset);
_web64_rt uint8_t web64_asset_copy_sprite_pair(uint8_t *base_destination, uint8_t *overlay_destination, const Web64SpriteOverlayAsset *asset);
_web64_rt uint8_t web64_asset_copy_block(uint8_t *destination, const Web64BlockAsset *asset);
_web64_rt uint8_t web64_asset_copy_blockset(uint8_t *destination, const Web64BlockSetAsset *asset);
_web64_rt uint8_t web64_asset_copy_map_plane(uint8_t *destination, const Web64MapAsset *asset, uint8_t plane);
_web64_rt uint8_t web64_asset_copy_sid_payload(uint8_t *destination, const Web64SidAsset *asset);
typedef struct { Web64AssetRef asset; uint16_t x; uint8_t y; uint8_t frame; uint8_t hardware_sprite; uint8_t data_block; uint8_t color; uint8_t flags; } Web64Sprite;
typedef struct { Web64AssetRef asset; uint16_t x; uint8_t y; uint8_t frame; uint8_t base_hardware_sprite; uint8_t overlay_hardware_sprite; uint8_t flags; } Web64SpriteOverlay;
typedef struct { Web64AssetRef asset; uint16_t map_x; uint16_t map_y; uint8_t screen_x; uint8_t screen_y; uint8_t viewport_width; uint8_t viewport_height; uint8_t flags; } Web64MapView;
#endif
web64/assets.inc
Registry-generated Web64 Asset Model runtime prepare/call macros for native assembly.
Header listing:
; Web64 _web64_rt C/assembly call helpers for <web64/assets.h>
; Generated from native runtime registry v8; do not hand-edit.
; Arguments are immediate assembly expressions. Pass C globals with their emitted labels.
; Prepare helpers write the complete exact-width window and clobber A only.
; Call helpers prepare the window, JSR the public entry, and inherit its clobber/return contract.
; Helpers allocate no storage. Including this file, or leaving a helper unused, links zero runtime bytes.
WEB64_RT_ASSETS_CALL_COUNT = 9
WEB64_RT_ASSETS_WINDOW_CALL_COUNT = 9
; web64_asset_copy: 6-byte window; entry _web64_asset_copy
.macro web64_rt_prepare_asset_copy destination, source, length
lda #<destination
sta _web64_asset_copy__arg_destination
lda #>destination
sta _web64_asset_copy__arg_destination+1
lda #<source
sta _web64_asset_copy__arg_source
lda #>source
sta _web64_asset_copy__arg_source+1
lda #<length
sta _web64_asset_copy__arg_length
lda #>length
sta _web64_asset_copy__arg_length+1
.endmacro
.macro web64_rt_call_asset_copy destination, source, length
web64_rt_prepare_asset_copy destination, source, length
jsr _web64_asset_copy
.endmacro
; web64_asset_copy_block: 4-byte window; entry _web64_asset_copy_block
.macro web64_rt_prepare_asset_copy_block destination, asset
lda #<destination
sta _web64_asset_copy_block__arg_destination
lda #>destination
sta _web64_asset_copy_block__arg_destination+1
lda #<asset
sta _web64_asset_copy_block__arg_asset
lda #>asset
sta _web64_asset_copy_block__arg_asset+1
.endmacro
.macro web64_rt_call_asset_copy_block destination, asset
web64_rt_prepare_asset_copy_block destination, asset
jsr _web64_asset_copy_block
.endmacro
; web64_asset_copy_blockset: 4-byte window; entry _web64_asset_copy_blockset
.macro web64_rt_prepare_asset_copy_blockset destination, asset
lda #<destination
sta _web64_asset_copy_blockset__arg_destination
lda #>destination
sta _web64_asset_copy_blockset__arg_destination+1
lda #<asset
sta _web64_asset_copy_blockset__arg_asset
lda #>asset
sta _web64_asset_copy_blockset__arg_asset+1
.endmacro
.macro web64_rt_call_asset_copy_blockset destination, asset
web64_rt_prepare_asset_copy_blockset destination, asset
jsr _web64_asset_copy_blockset
.endmacro
; web64_asset_copy_char: 4-byte window; entry _web64_asset_copy_char
.macro web64_rt_prepare_asset_copy_char destination, asset
lda #<destination
sta _web64_asset_copy_char__arg_destination
lda #>destination
sta _web64_asset_copy_char__arg_destination+1
lda #<asset
sta _web64_asset_copy_char__arg_asset
lda #>asset
sta _web64_asset_copy_char__arg_asset+1
.endmacro
.macro web64_rt_call_asset_copy_char destination, asset
web64_rt_prepare_asset_copy_char destination, asset
jsr _web64_asset_copy_char
.endmacro
; web64_asset_copy_charset: 4-byte window; entry _web64_asset_copy_charset
.macro web64_rt_prepare_asset_copy_charset destination, asset
lda #<destination
sta _web64_asset_copy_charset__arg_destination
lda #>destination
sta _web64_asset_copy_charset__arg_destination+1
lda #<asset
sta _web64_asset_copy_charset__arg_asset
lda #>asset
sta _web64_asset_copy_charset__arg_asset+1
.endmacro
.macro web64_rt_call_asset_copy_charset destination, asset
web64_rt_prepare_asset_copy_charset destination, asset
jsr _web64_asset_copy_charset
.endmacro
; web64_asset_copy_map_plane: 5-byte window; entry _web64_asset_copy_map_plane
.macro web64_rt_prepare_asset_copy_map_plane destination, asset, plane
lda #<destination
sta _web64_asset_copy_map_plane__arg_destination
lda #>destination
sta _web64_asset_copy_map_plane__arg_destination+1
lda #<asset
sta _web64_asset_copy_map_plane__arg_asset
lda #>asset
sta _web64_asset_copy_map_plane__arg_asset+1
lda #plane
sta _web64_asset_copy_map_plane__arg_plane
.endmacro
.macro web64_rt_call_asset_copy_map_plane destination, asset, plane
web64_rt_prepare_asset_copy_map_plane destination, asset, plane
jsr _web64_asset_copy_map_plane
.endmacro
; web64_asset_copy_sid_payload: 4-byte window; entry _web64_asset_copy_sid_payload
.macro web64_rt_prepare_asset_copy_sid_payload destination, asset
lda #<destination
sta _web64_asset_copy_sid_payload__arg_destination
lda #>destination
sta _web64_asset_copy_sid_payload__arg_destination+1
lda #<asset
sta _web64_asset_copy_sid_payload__arg_asset
lda #>asset
sta _web64_asset_copy_sid_payload__arg_asset+1
.endmacro
.macro web64_rt_call_asset_copy_sid_payload destination, asset
web64_rt_prepare_asset_copy_sid_payload destination, asset
jsr _web64_asset_copy_sid_payload
.endmacro
; web64_asset_copy_sprite: 4-byte window; entry _web64_asset_copy_sprite
.macro web64_rt_prepare_asset_copy_sprite destination, asset
lda #<destination
sta _web64_asset_copy_sprite__arg_destination
lda #>destination
sta _web64_asset_copy_sprite__arg_destination+1
lda #<asset
sta _web64_asset_copy_sprite__arg_asset
lda #>asset
sta _web64_asset_copy_sprite__arg_asset+1
.endmacro
.macro web64_rt_call_asset_copy_sprite destination, asset
web64_rt_prepare_asset_copy_sprite destination, asset
jsr _web64_asset_copy_sprite
.endmacro
; web64_asset_copy_sprite_pair: 6-byte window; entry _web64_asset_copy_sprite_pair
.macro web64_rt_prepare_asset_copy_sprite_pair base_destination, overlay_destination, asset
lda #<base_destination
sta _web64_asset_copy_sprite_pair__arg_base_destination
lda #>base_destination
sta _web64_asset_copy_sprite_pair__arg_base_destination+1
lda #<overlay_destination
sta _web64_asset_copy_sprite_pair__arg_overlay_destination
lda #>overlay_destination
sta _web64_asset_copy_sprite_pair__arg_overlay_destination+1
lda #<asset
sta _web64_asset_copy_sprite_pair__arg_asset
lda #>asset
sta _web64_asset_copy_sprite_pair__arg_asset+1
.endmacro
.macro web64_rt_call_asset_copy_sprite_pair base_destination, overlay_destination, asset
web64_rt_prepare_asset_copy_sprite_pair base_destination, overlay_destination, asset
jsr _web64_asset_copy_sprite_pair
.endmacro
web64/bitmap.h
Caller-owned C64 hires and multicolor bitmap setup, logical-pixel drawing primitives, optimized line kernels, and bounded replace-only scanline flood fill.
Included headers: <stdint.h>, <web64/assets.h>.
Functions:
| Name | Prototype | Description | Typical use |
|---|---|---|---|
web64_bitmap_configure | _web64_rt uint8_t web64_bitmap_configure(Web64Bitmap *bitmap, uint8_t *pixels, uint8_t *screen, uint8_t mode) | Web64 SDK runtime helper. | web64_bitmap_configure(...) |
web64_bitmap_activate | _web64_rt uint8_t web64_bitmap_activate(const Web64Bitmap *bitmap) | Web64 SDK runtime helper. | web64_bitmap_activate(...) |
web64_bitmap_clear | _web64_rt uint8_t web64_bitmap_clear(Web64Bitmap *bitmap, uint8_t pixel) | Web64 SDK runtime helper. | web64_bitmap_clear(...) |
web64_bitmap_palette_uniform | _web64_rt uint8_t web64_bitmap_palette_uniform(Web64Bitmap *bitmap, const Web64BitmapPalette *palette) | Web64 SDK runtime helper. | web64_bitmap_palette_uniform(...) |
web64_bitmap_palette_cell | _web64_rt uint8_t web64_bitmap_palette_cell(Web64Bitmap *bitmap, uint8_t column, uint8_t row, const Web64BitmapPalette *palette) | Web64 SDK runtime helper. | web64_bitmap_palette_cell(...) |
web64_bitmap_init | _web64_rt uint8_t web64_bitmap_init(Web64Bitmap *bitmap, uint8_t *pixels, uint8_t *screen, uint8_t mode, const Web64BitmapPalette *palette) | Web64 SDK runtime helper. | web64_bitmap_init(...) |
web64_bitmap_load_map | _web64_rt uint8_t web64_bitmap_load_map(Web64Bitmap *bitmap, const Web64MapAsset *map, const Web64CharsetAsset *charset) | Expand a 40x25 imported character map into bitmap RAM and copy its screen/Color RAM planes. Configure first; activate after loading. | web64_bitmap_load_map(...) |
web64_bitmap_plot | _web64_rt uint8_t web64_bitmap_plot(Web64Bitmap *bitmap, int16_t x, int16_t y, uint8_t pixel, uint8_t operation) | Web64 SDK runtime helper. | web64_bitmap_plot(...) |
web64_bitmap_plot_fast | _web64_rt uint8_t web64_bitmap_plot_fast(Web64Bitmap *bitmap, uint16_t x, uint8_t y, uint8_t pixel, uint8_t operation) | Web64 SDK runtime helper. | web64_bitmap_plot_fast(...) |
web64_bitmap_get | _web64_rt uint8_t web64_bitmap_get(const Web64Bitmap *bitmap, int16_t x, int16_t y) | Web64 SDK runtime helper. | web64_bitmap_get(...) |
web64_bitmap_get_fast | _web64_rt uint8_t web64_bitmap_get_fast(const Web64Bitmap *bitmap, uint16_t x, uint8_t y) | Web64 SDK runtime helper. | web64_bitmap_get_fast(...) |
web64_bitmap_hline | _web64_rt uint8_t web64_bitmap_hline(Web64Bitmap *bitmap, int16_t x, int16_t y, uint16_t width, uint8_t pixel, uint8_t operation) | Web64 SDK runtime helper. | web64_bitmap_hline(...) |
web64_bitmap_hline_fast | _web64_rt uint8_t web64_bitmap_hline_fast(Web64Bitmap *bitmap, uint16_t x, uint8_t y, uint16_t width, uint8_t pixel, uint8_t operation) | Web64 SDK runtime helper. | web64_bitmap_hline_fast(...) |
web64_bitmap_vline | _web64_rt uint8_t web64_bitmap_vline(Web64Bitmap *bitmap, int16_t x, int16_t y, uint16_t height, uint8_t pixel, uint8_t operation) | Web64 SDK runtime helper. | web64_bitmap_vline(...) |
web64_bitmap_vline_fast | _web64_rt uint8_t web64_bitmap_vline_fast(Web64Bitmap *bitmap, uint16_t x, uint8_t y, uint16_t height, uint8_t pixel, uint8_t operation) | Web64 SDK runtime helper. | web64_bitmap_vline_fast(...) |
web64_bitmap_line | _web64_rt uint8_t web64_bitmap_line(Web64Bitmap *bitmap, int16_t x0, int16_t y0, int16_t x1, int16_t y1, uint8_t pixel, uint8_t operation) | Web64 SDK runtime helper. | web64_bitmap_line(...) |
web64_bitmap_line_fast | _web64_rt uint8_t web64_bitmap_line_fast(Web64Bitmap *bitmap, uint16_t x0, uint8_t y0, uint16_t x1, uint8_t y1, uint8_t pixel, uint8_t operation) | Web64 SDK runtime helper. | web64_bitmap_line_fast(...) |
web64_bitmap_rect | _web64_rt uint8_t web64_bitmap_rect(Web64Bitmap *bitmap, int16_t x, int16_t y, uint16_t width, uint16_t height, uint8_t pixel, uint8_t operation) | Web64 SDK runtime helper. | web64_bitmap_rect(...) |
web64_bitmap_rect_fast | _web64_rt uint8_t web64_bitmap_rect_fast(Web64Bitmap *bitmap, uint16_t x, uint8_t y, uint16_t width, uint8_t height, uint8_t pixel, uint8_t operation) | Web64 SDK runtime helper. | web64_bitmap_rect_fast(...) |
web64_bitmap_fill_rect | _web64_rt uint8_t web64_bitmap_fill_rect(Web64Bitmap *bitmap, int16_t x, int16_t y, uint16_t width, uint16_t height, uint8_t pixel, uint8_t operation) | Web64 SDK runtime helper. | web64_bitmap_fill_rect(...) |
web64_bitmap_fill_rect_fast | _web64_rt uint8_t web64_bitmap_fill_rect_fast(Web64Bitmap *bitmap, uint16_t x, uint8_t y, uint16_t width, uint8_t height, uint8_t pixel, uint8_t operation) | Web64 SDK runtime helper. | web64_bitmap_fill_rect_fast(...) |
web64_bitmap_ellipse | _web64_rt uint8_t web64_bitmap_ellipse(Web64Bitmap *bitmap, int16_t center_x, int16_t center_y, uint16_t radius_x, uint16_t radius_y, uint8_t pixel, uint8_t operation) | Web64 SDK runtime helper. | web64_bitmap_ellipse(...) |
web64_bitmap_ellipse_fast | _web64_rt uint8_t web64_bitmap_ellipse_fast(Web64Bitmap *bitmap, uint16_t center_x, uint8_t center_y, uint16_t radius_x, uint8_t radius_y, uint8_t pixel, uint8_t operation) | Web64 SDK runtime helper. | web64_bitmap_ellipse_fast(...) |
web64_bitmap_flood_fill | _web64_rt uint8_t web64_bitmap_flood_fill(Web64Bitmap *bitmap, int16_t seed_x, int16_t seed_y, uint8_t replacement, Web64BitmapFloodWorkspace *workspace) | Web64 SDK runtime helper. | web64_bitmap_flood_fill(...) |
web64_bitmap_flood_fill_fast | _web64_rt uint8_t web64_bitmap_flood_fill_fast(Web64Bitmap *bitmap, uint16_t seed_x, uint8_t seed_y, uint8_t replacement, Web64BitmapFloodWorkspace *workspace) | Web64 SDK runtime helper. | web64_bitmap_flood_fill_fast(...) |
Structs:
| Name | Description | Field summary |
|---|---|---|
Web64Bitmap | Public struct declared by <web64/bitmap.h>. | 7 fields: uint16_t pixels, uint16_t screen, uint8_t mode, uint8_t background, ... |
Web64BitmapPalette | Public struct declared by <web64/bitmap.h>. | uint8_t color0, uint8_t color1, uint8_t color2, uint8_t color3 |
Web64BitmapFloodSpan | Public struct declared by <web64/bitmap.h>. | uint16_t first_x, uint16_t last_x, uint8_t y |
Web64BitmapFloodWorkspace | Public struct declared by <web64/bitmap.h>. | Web64BitmapFloodSpan *spans, uint16_t capacity, uint16_t used |
Macros:
| Name | Value | Description |
|---|---|---|
WEB64_BITMAP_MODE_HIRES | 0 | Macro constant exported by the header. |
WEB64_BITMAP_MODE_MULTICOLOR | 1 | Macro constant exported by the header. |
WEB64_BITMAP_OP_REPLACE | 0 | Macro constant exported by the header. |
WEB64_BITMAP_OP_XOR | 1 | Macro constant exported by the header. |
WEB64_BITMAP_OK | 0 | Macro constant exported by the header. |
WEB64_BITMAP_CLIPPED | 1 | Macro constant exported by the header. |
WEB64_BITMAP_INVALID_CONTEXT | 2 | Macro constant exported by the header. |
WEB64_BITMAP_INVALID_LAYOUT | 4 | Macro constant exported by the header. |
WEB64_BITMAP_INVALID_PIXEL | 8 | Macro constant exported by the header. |
WEB64_BITMAP_INVALID_OPERATION | 16 | Macro constant exported by the header. |
WEB64_BITMAP_PALETTE_CONFLICT | 32 | Macro constant exported by the header. |
WEB64_BITMAP_INVALID_ARGUMENT | 64 | Macro constant exported by the header. |
WEB64_BITMAP_WORKSPACE_EXHAUSTED | 128 | Macro constant exported by the header. |
WEB64_BITMAP_PIXEL_INVALID | 0xff | Macro constant exported by the header. |
WEB64_BITMAP_FLOOD_STORAGE(name, capacity) | Web64BitmapFloodSpan name##_span_storage[(capacity)]; Web64BitmapFloodWorkspace name | Macro constant exported by the header. |
WEB64_BITMAP_FLOOD_WORKSPACE_INIT(name, span_count) | (name).spans = name##_span_storage; (name).capacity = (span_count); (name).used = 0 | Macro constant exported by the header. |
web64_bitmap_dot(bitmap, x, y, pixel, operation) | web64_bitmap_plot((bitmap), (x), (y), (pixel), (operation)) | Macro constant exported by the header. |
web64_bitmap_dot_fast(bitmap, x, y, pixel, operation) | web64_bitmap_plot_fast((bitmap), (x), (y), (pixel), (operation)) | Macro constant exported by the header. |
web64_bitmap_circle(bitmap, center_x, center_y, radius, pixel, operation) | web64_bitmap_ellipse((bitmap), (center_x), (center_y), (radius), (radius), (pixel), (operation)) | Macro constant exported by the header. |
web64_bitmap_circle_fast(bitmap, center_x, center_y, radius, pixel, operation) | web64_bitmap_ellipse_fast((bitmap), (center_x), (center_y), (radius), (radius), (pixel), (operation)) | Macro constant exported by the header. |
Header listing:
#ifndef WEB64_BITMAP_H
#define WEB64_BITMAP_H
#include <stdint.h>
#include <web64/assets.h>
#define WEB64_BITMAP_MODE_HIRES 0
#define WEB64_BITMAP_MODE_MULTICOLOR 1
#define WEB64_BITMAP_OP_REPLACE 0
#define WEB64_BITMAP_OP_XOR 1
#define WEB64_BITMAP_OK 0
#define WEB64_BITMAP_CLIPPED 1
#define WEB64_BITMAP_INVALID_CONTEXT 2
#define WEB64_BITMAP_INVALID_LAYOUT 4
#define WEB64_BITMAP_INVALID_PIXEL 8
#define WEB64_BITMAP_INVALID_OPERATION 16
#define WEB64_BITMAP_PALETTE_CONFLICT 32
#define WEB64_BITMAP_INVALID_ARGUMENT 64
#define WEB64_BITMAP_WORKSPACE_EXHAUSTED 128
#define WEB64_BITMAP_PIXEL_INVALID 0xff
typedef struct {
uint16_t pixels;
uint16_t screen;
uint8_t mode;
uint8_t background;
uint8_t vic_bank;
uint8_t memory_setup;
uint8_t flags;
} Web64Bitmap;
typedef struct {
uint8_t color0;
uint8_t color1;
uint8_t color2;
uint8_t color3;
} Web64BitmapPalette;
typedef struct {
uint16_t first_x;
uint16_t last_x;
uint8_t y;
} Web64BitmapFloodSpan;
typedef struct {
Web64BitmapFloodSpan *spans;
uint16_t capacity;
uint16_t used;
} Web64BitmapFloodWorkspace;
#define WEB64_BITMAP_FLOOD_STORAGE(name, capacity) Web64BitmapFloodSpan name##_span_storage[(capacity)]; Web64BitmapFloodWorkspace name
#define WEB64_BITMAP_FLOOD_WORKSPACE_INIT(name, span_count) (name).spans = name##_span_storage; (name).capacity = (span_count); (name).used = 0
_web64_rt uint8_t web64_bitmap_configure(Web64Bitmap *bitmap, uint8_t *pixels, uint8_t *screen, uint8_t mode);
_web64_rt uint8_t web64_bitmap_activate(const Web64Bitmap *bitmap);
_web64_rt uint8_t web64_bitmap_clear(Web64Bitmap *bitmap, uint8_t pixel);
_web64_rt uint8_t web64_bitmap_palette_uniform(Web64Bitmap *bitmap, const Web64BitmapPalette *palette);
_web64_rt uint8_t web64_bitmap_palette_cell(Web64Bitmap *bitmap, uint8_t column, uint8_t row, const Web64BitmapPalette *palette);
_web64_rt uint8_t web64_bitmap_init(Web64Bitmap *bitmap, uint8_t *pixels, uint8_t *screen, uint8_t mode, const Web64BitmapPalette *palette);
/* Expand a 40x25 imported character map into bitmap RAM and copy its screen/Color RAM planes. Configure first; activate after loading. */
_web64_rt uint8_t web64_bitmap_load_map(Web64Bitmap *bitmap, const Web64MapAsset *map, const Web64CharsetAsset *charset);
_web64_rt uint8_t web64_bitmap_plot(Web64Bitmap *bitmap, int16_t x, int16_t y, uint8_t pixel, uint8_t operation);
_web64_rt uint8_t web64_bitmap_plot_fast(Web64Bitmap *bitmap, uint16_t x, uint8_t y, uint8_t pixel, uint8_t operation);
_web64_rt uint8_t web64_bitmap_get(const Web64Bitmap *bitmap, int16_t x, int16_t y);
_web64_rt uint8_t web64_bitmap_get_fast(const Web64Bitmap *bitmap, uint16_t x, uint8_t y);
_web64_rt uint8_t web64_bitmap_hline(Web64Bitmap *bitmap, int16_t x, int16_t y, uint16_t width, uint8_t pixel, uint8_t operation);
_web64_rt uint8_t web64_bitmap_hline_fast(Web64Bitmap *bitmap, uint16_t x, uint8_t y, uint16_t width, uint8_t pixel, uint8_t operation);
_web64_rt uint8_t web64_bitmap_vline(Web64Bitmap *bitmap, int16_t x, int16_t y, uint16_t height, uint8_t pixel, uint8_t operation);
_web64_rt uint8_t web64_bitmap_vline_fast(Web64Bitmap *bitmap, uint16_t x, uint8_t y, uint16_t height, uint8_t pixel, uint8_t operation);
_web64_rt uint8_t web64_bitmap_line(Web64Bitmap *bitmap, int16_t x0, int16_t y0, int16_t x1, int16_t y1, uint8_t pixel, uint8_t operation);
_web64_rt uint8_t web64_bitmap_line_fast(Web64Bitmap *bitmap, uint16_t x0, uint8_t y0, uint16_t x1, uint8_t y1, uint8_t pixel, uint8_t operation);
_web64_rt uint8_t web64_bitmap_rect(Web64Bitmap *bitmap, int16_t x, int16_t y, uint16_t width, uint16_t height, uint8_t pixel, uint8_t operation);
_web64_rt uint8_t web64_bitmap_rect_fast(Web64Bitmap *bitmap, uint16_t x, uint8_t y, uint16_t width, uint8_t height, uint8_t pixel, uint8_t operation);
_web64_rt uint8_t web64_bitmap_fill_rect(Web64Bitmap *bitmap, int16_t x, int16_t y, uint16_t width, uint16_t height, uint8_t pixel, uint8_t operation);
_web64_rt uint8_t web64_bitmap_fill_rect_fast(Web64Bitmap *bitmap, uint16_t x, uint8_t y, uint16_t width, uint8_t height, uint8_t pixel, uint8_t operation);
_web64_rt uint8_t web64_bitmap_ellipse(Web64Bitmap *bitmap, int16_t center_x, int16_t center_y, uint16_t radius_x, uint16_t radius_y, uint8_t pixel, uint8_t operation);
_web64_rt uint8_t web64_bitmap_ellipse_fast(Web64Bitmap *bitmap, uint16_t center_x, uint8_t center_y, uint16_t radius_x, uint8_t radius_y, uint8_t pixel, uint8_t operation);
_web64_rt uint8_t web64_bitmap_flood_fill(Web64Bitmap *bitmap, int16_t seed_x, int16_t seed_y, uint8_t replacement, Web64BitmapFloodWorkspace *workspace);
_web64_rt uint8_t web64_bitmap_flood_fill_fast(Web64Bitmap *bitmap, uint16_t seed_x, uint8_t seed_y, uint8_t replacement, Web64BitmapFloodWorkspace *workspace);
#define web64_bitmap_dot(bitmap, x, y, pixel, operation) web64_bitmap_plot((bitmap), (x), (y), (pixel), (operation))
#define web64_bitmap_dot_fast(bitmap, x, y, pixel, operation) web64_bitmap_plot_fast((bitmap), (x), (y), (pixel), (operation))
#define web64_bitmap_circle(bitmap, center_x, center_y, radius, pixel, operation) web64_bitmap_ellipse((bitmap), (center_x), (center_y), (radius), (radius), (pixel), (operation))
#define web64_bitmap_circle_fast(bitmap, center_x, center_y, radius, pixel, operation) web64_bitmap_ellipse_fast((bitmap), (center_x), (center_y), (radius), (radius), (pixel), (operation))
#endif
web64/bitmap.inc
Bitmap layouts, constants, and registry-generated native assembly prepare/call macros.
Header listing:
; Web64 Bitmap Drawing Runtime public layouts and constants.
; Runtime call helpers are appended from the authoritative native registry.
WEB64_BITMAP_MODE_HIRES = 0
WEB64_BITMAP_MODE_MULTICOLOR = 1
WEB64_BITMAP_OP_REPLACE = 0
WEB64_BITMAP_OP_XOR = 1
WEB64_BITMAP_OK = 0
WEB64_BITMAP_CLIPPED = 1
WEB64_BITMAP_INVALID_CONTEXT = 2
WEB64_BITMAP_INVALID_LAYOUT = 4
WEB64_BITMAP_INVALID_PIXEL = 8
WEB64_BITMAP_INVALID_OPERATION = 16
WEB64_BITMAP_PALETTE_CONFLICT = 32
WEB64_BITMAP_INVALID_ARGUMENT = 64
WEB64_BITMAP_WORKSPACE_EXHAUSTED = 128
WEB64_BITMAP_PIXEL_INVALID = $ff
WEB64_BITMAP_PIXELS = 0
WEB64_BITMAP_SCREEN = 2
WEB64_BITMAP_MODE = 4
WEB64_BITMAP_BACKGROUND = 5
WEB64_BITMAP_VIC_BANK = 6
WEB64_BITMAP_MEMORY_SETUP = 7
WEB64_BITMAP_FLAGS = 8
WEB64_BITMAP_SIZE = 9
WEB64_BITMAP_PALETTE_COLOR0 = 0
WEB64_BITMAP_PALETTE_COLOR1 = 1
WEB64_BITMAP_PALETTE_COLOR2 = 2
WEB64_BITMAP_PALETTE_COLOR3 = 3
WEB64_BITMAP_PALETTE_SIZE = 4
WEB64_BITMAP_FLOOD_SPAN_FIRST_X = 0
WEB64_BITMAP_FLOOD_SPAN_LAST_X = 2
WEB64_BITMAP_FLOOD_SPAN_Y = 4
WEB64_BITMAP_FLOOD_SPAN_SIZE = 5
WEB64_BITMAP_FLOOD_WORKSPACE_SPANS = 0
WEB64_BITMAP_FLOOD_WORKSPACE_CAPACITY = 2
WEB64_BITMAP_FLOOD_WORKSPACE_USED = 4
WEB64_BITMAP_FLOOD_WORKSPACE_SIZE = 6
; Web64 _web64_rt C/assembly call helpers for <web64/bitmap.h>
; Generated from native runtime registry v8; do not hand-edit.
; Arguments are immediate assembly expressions. Pass C globals with their emitted labels.
; Prepare helpers write the complete exact-width window and clobber A only.
; Call helpers prepare the window, JSR the public entry, and inherit its clobber/return contract.
; Helpers allocate no storage. Including this file, or leaving a helper unused, links zero runtime bytes.
WEB64_RT_BITMAP_CALL_COUNT = 25
WEB64_RT_BITMAP_WINDOW_CALL_COUNT = 25
; web64_bitmap_activate: 2-byte window; entry _web64_bitmap_activate
.macro web64_rt_prepare_bitmap_activate bitmap
lda #<bitmap
sta _web64_bitmap_activate__arg_bitmap
lda #>bitmap
sta _web64_bitmap_activate__arg_bitmap+1
.endmacro
.macro web64_rt_call_bitmap_activate bitmap
web64_rt_prepare_bitmap_activate bitmap
jsr _web64_bitmap_activate
.endmacro
; web64_bitmap_clear: 3-byte window; entry _web64_bitmap_clear
.macro web64_rt_prepare_bitmap_clear bitmap, pixel
lda #<bitmap
sta _web64_bitmap_clear__arg_bitmap
lda #>bitmap
sta _web64_bitmap_clear__arg_bitmap+1
lda #pixel
sta _web64_bitmap_clear__arg_pixel
.endmacro
.macro web64_rt_call_bitmap_clear bitmap, pixel
web64_rt_prepare_bitmap_clear bitmap, pixel
jsr _web64_bitmap_clear
.endmacro
; web64_bitmap_configure: 7-byte window; entry _web64_bitmap_configure
.macro web64_rt_prepare_bitmap_configure bitmap, pixels, screen, mode
lda #<bitmap
sta _web64_bitmap_configure__arg_bitmap
lda #>bitmap
sta _web64_bitmap_configure__arg_bitmap+1
lda #<pixels
sta _web64_bitmap_configure__arg_pixels
lda #>pixels
sta _web64_bitmap_configure__arg_pixels+1
lda #<screen
sta _web64_bitmap_configure__arg_screen
lda #>screen
sta _web64_bitmap_configure__arg_screen+1
lda #mode
sta _web64_bitmap_configure__arg_mode
.endmacro
.macro web64_rt_call_bitmap_configure bitmap, pixels, screen, mode
web64_rt_prepare_bitmap_configure bitmap, pixels, screen, mode
jsr _web64_bitmap_configure
.endmacro
; web64_bitmap_ellipse: 12-byte window; entry _web64_bitmap_ellipse
.macro web64_rt_prepare_bitmap_ellipse bitmap, center_x, center_y, radius_x, radius_y, pixel, operation
lda #<bitmap
sta _web64_bitmap_ellipse__arg_bitmap
lda #>bitmap
sta _web64_bitmap_ellipse__arg_bitmap+1
lda #<center_x
sta _web64_bitmap_ellipse__arg_center_x
lda #>center_x
sta _web64_bitmap_ellipse__arg_center_x+1
lda #<center_y
sta _web64_bitmap_ellipse__arg_center_y
lda #>center_y
sta _web64_bitmap_ellipse__arg_center_y+1
lda #<radius_x
sta _web64_bitmap_ellipse__arg_radius_x
lda #>radius_x
sta _web64_bitmap_ellipse__arg_radius_x+1
lda #<radius_y
sta _web64_bitmap_ellipse__arg_radius_y
lda #>radius_y
sta _web64_bitmap_ellipse__arg_radius_y+1
lda #pixel
sta _web64_bitmap_ellipse__arg_pixel
lda #operation
sta _web64_bitmap_ellipse__arg_operation
.endmacro
.macro web64_rt_call_bitmap_ellipse bitmap, center_x, center_y, radius_x, radius_y, pixel, operation
web64_rt_prepare_bitmap_ellipse bitmap, center_x, center_y, radius_x, radius_y, pixel, operation
jsr _web64_bitmap_ellipse
.endmacro
; web64_bitmap_ellipse_fast: 10-byte window; entry _web64_bitmap_ellipse_fast
.macro web64_rt_prepare_bitmap_ellipse_fast bitmap, center_x, center_y, radius_x, radius_y, pixel, operation
lda #<bitmap
sta _web64_bitmap_ellipse_fast__arg_bitmap
lda #>bitmap
sta _web64_bitmap_ellipse_fast__arg_bitmap+1
lda #<center_x
sta _web64_bitmap_ellipse_fast__arg_center_x
lda #>center_x
sta _web64_bitmap_ellipse_fast__arg_center_x+1
lda #center_y
sta _web64_bitmap_ellipse_fast__arg_center_y
lda #<radius_x
sta _web64_bitmap_ellipse_fast__arg_radius_x
lda #>radius_x
sta _web64_bitmap_ellipse_fast__arg_radius_x+1
lda #radius_y
sta _web64_bitmap_ellipse_fast__arg_radius_y
lda #pixel
sta _web64_bitmap_ellipse_fast__arg_pixel
lda #operation
sta _web64_bitmap_ellipse_fast__arg_operation
.endmacro
.macro web64_rt_call_bitmap_ellipse_fast bitmap, center_x, center_y, radius_x, radius_y, pixel, operation
web64_rt_prepare_bitmap_ellipse_fast bitmap, center_x, center_y, radius_x, radius_y, pixel, operation
jsr _web64_bitmap_ellipse_fast
.endmacro
; web64_bitmap_fill_rect: 12-byte window; entry _web64_bitmap_fill_rect
.macro web64_rt_prepare_bitmap_fill_rect bitmap, x, y, width, height, pixel, operation
lda #<bitmap
sta _web64_bitmap_fill_rect__arg_bitmap
lda #>bitmap
sta _web64_bitmap_fill_rect__arg_bitmap+1
lda #<x
sta _web64_bitmap_fill_rect__arg_x
lda #>x
sta _web64_bitmap_fill_rect__arg_x+1
lda #<y
sta _web64_bitmap_fill_rect__arg_y
lda #>y
sta _web64_bitmap_fill_rect__arg_y+1
lda #<width
sta _web64_bitmap_fill_rect__arg_width
lda #>width
sta _web64_bitmap_fill_rect__arg_width+1
lda #<height
sta _web64_bitmap_fill_rect__arg_height
lda #>height
sta _web64_bitmap_fill_rect__arg_height+1
lda #pixel
sta _web64_bitmap_fill_rect__arg_pixel
lda #operation
sta _web64_bitmap_fill_rect__arg_operation
.endmacro
.macro web64_rt_call_bitmap_fill_rect bitmap, x, y, width, height, pixel, operation
web64_rt_prepare_bitmap_fill_rect bitmap, x, y, width, height, pixel, operation
jsr _web64_bitmap_fill_rect
.endmacro
; web64_bitmap_fill_rect_fast: 10-byte window; entry _web64_bitmap_fill_rect_fast
.macro web64_rt_prepare_bitmap_fill_rect_fast bitmap, x, y, width, height, pixel, operation
lda #<bitmap
sta _web64_bitmap_fill_rect_fast__arg_bitmap
lda #>bitmap
sta _web64_bitmap_fill_rect_fast__arg_bitmap+1
lda #<x
sta _web64_bitmap_fill_rect_fast__arg_x
lda #>x
sta _web64_bitmap_fill_rect_fast__arg_x+1
lda #y
sta _web64_bitmap_fill_rect_fast__arg_y
lda #<width
sta _web64_bitmap_fill_rect_fast__arg_width
lda #>width
sta _web64_bitmap_fill_rect_fast__arg_width+1
lda #height
sta _web64_bitmap_fill_rect_fast__arg_height
lda #pixel
sta _web64_bitmap_fill_rect_fast__arg_pixel
lda #operation
sta _web64_bitmap_fill_rect_fast__arg_operation
.endmacro
.macro web64_rt_call_bitmap_fill_rect_fast bitmap, x, y, width, height, pixel, operation
web64_rt_prepare_bitmap_fill_rect_fast bitmap, x, y, width, height, pixel, operation
jsr _web64_bitmap_fill_rect_fast
.endmacro
; web64_bitmap_flood_fill: 9-byte window; entry _web64_bitmap_flood_fill
.macro web64_rt_prepare_bitmap_flood_fill bitmap, seed_x, seed_y, replacement, workspace
lda #<bitmap
sta _web64_bitmap_flood_fill__arg_bitmap
lda #>bitmap
sta _web64_bitmap_flood_fill__arg_bitmap+1
lda #<seed_x
sta _web64_bitmap_flood_fill__arg_seed_x
lda #>seed_x
sta _web64_bitmap_flood_fill__arg_seed_x+1
lda #<seed_y
sta _web64_bitmap_flood_fill__arg_seed_y
lda #>seed_y
sta _web64_bitmap_flood_fill__arg_seed_y+1
lda #replacement
sta _web64_bitmap_flood_fill__arg_replacement
lda #<workspace
sta _web64_bitmap_flood_fill__arg_workspace
lda #>workspace
sta _web64_bitmap_flood_fill__arg_workspace+1
.endmacro
.macro web64_rt_call_bitmap_flood_fill bitmap, seed_x, seed_y, replacement, workspace
web64_rt_prepare_bitmap_flood_fill bitmap, seed_x, seed_y, replacement, workspace
jsr _web64_bitmap_flood_fill
.endmacro
; web64_bitmap_flood_fill_fast: 8-byte window; entry _web64_bitmap_flood_fill_fast
.macro web64_rt_prepare_bitmap_flood_fill_fast bitmap, seed_x, seed_y, replacement, workspace
lda #<bitmap
sta _web64_bitmap_flood_fill_fast__arg_bitmap
lda #>bitmap
sta _web64_bitmap_flood_fill_fast__arg_bitmap+1
lda #<seed_x
sta _web64_bitmap_flood_fill_fast__arg_seed_x
lda #>seed_x
sta _web64_bitmap_flood_fill_fast__arg_seed_x+1
lda #seed_y
sta _web64_bitmap_flood_fill_fast__arg_seed_y
lda #replacement
sta _web64_bitmap_flood_fill_fast__arg_replacement
lda #<workspace
sta _web64_bitmap_flood_fill_fast__arg_workspace
lda #>workspace
sta _web64_bitmap_flood_fill_fast__arg_workspace+1
.endmacro
.macro web64_rt_call_bitmap_flood_fill_fast bitmap, seed_x, seed_y, replacement, workspace
web64_rt_prepare_bitmap_flood_fill_fast bitmap, seed_x, seed_y, replacement, workspace
jsr _web64_bitmap_flood_fill_fast
.endmacro
; web64_bitmap_get: 6-byte window; entry _web64_bitmap_get
.macro web64_rt_prepare_bitmap_get bitmap, x, y
lda #<bitmap
sta _web64_bitmap_get__arg_bitmap
lda #>bitmap
sta _web64_bitmap_get__arg_bitmap+1
lda #<x
sta _web64_bitmap_get__arg_x
lda #>x
sta _web64_bitmap_get__arg_x+1
lda #<y
sta _web64_bitmap_get__arg_y
lda #>y
sta _web64_bitmap_get__arg_y+1
.endmacro
.macro web64_rt_call_bitmap_get bitmap, x, y
web64_rt_prepare_bitmap_get bitmap, x, y
jsr _web64_bitmap_get
.endmacro
; web64_bitmap_get_fast: 5-byte window; entry _web64_bitmap_get_fast
.macro web64_rt_prepare_bitmap_get_fast bitmap, x, y
lda #<bitmap
sta _web64_bitmap_get_fast__arg_bitmap
lda #>bitmap
sta _web64_bitmap_get_fast__arg_bitmap+1
lda #<x
sta _web64_bitmap_get_fast__arg_x
lda #>x
sta _web64_bitmap_get_fast__arg_x+1
lda #y
sta _web64_bitmap_get_fast__arg_y
.endmacro
.macro web64_rt_call_bitmap_get_fast bitmap, x, y
web64_rt_prepare_bitmap_get_fast bitmap, x, y
jsr _web64_bitmap_get_fast
.endmacro
; web64_bitmap_hline: 10-byte window; entry _web64_bitmap_hline
.macro web64_rt_prepare_bitmap_hline bitmap, x, y, width, pixel, operation
lda #<bitmap
sta _web64_bitmap_hline__arg_bitmap
lda #>bitmap
sta _web64_bitmap_hline__arg_bitmap+1
lda #<x
sta _web64_bitmap_hline__arg_x
lda #>x
sta _web64_bitmap_hline__arg_x+1
lda #<y
sta _web64_bitmap_hline__arg_y
lda #>y
sta _web64_bitmap_hline__arg_y+1
lda #<width
sta _web64_bitmap_hline__arg_width
lda #>width
sta _web64_bitmap_hline__arg_width+1
lda #pixel
sta _web64_bitmap_hline__arg_pixel
lda #operation
sta _web64_bitmap_hline__arg_operation
.endmacro
.macro web64_rt_call_bitmap_hline bitmap, x, y, width, pixel, operation
web64_rt_prepare_bitmap_hline bitmap, x, y, width, pixel, operation
jsr _web64_bitmap_hline
.endmacro
; web64_bitmap_hline_fast: 9-byte window; entry _web64_bitmap_hline_fast
.macro web64_rt_prepare_bitmap_hline_fast bitmap, x, y, width, pixel, operation
lda #<bitmap
sta _web64_bitmap_hline_fast__arg_bitmap
lda #>bitmap
sta _web64_bitmap_hline_fast__arg_bitmap+1
lda #<x
sta _web64_bitmap_hline_fast__arg_x
lda #>x
sta _web64_bitmap_hline_fast__arg_x+1
lda #y
sta _web64_bitmap_hline_fast__arg_y
lda #<width
sta _web64_bitmap_hline_fast__arg_width
lda #>width
sta _web64_bitmap_hline_fast__arg_width+1
lda #pixel
sta _web64_bitmap_hline_fast__arg_pixel
lda #operation
sta _web64_bitmap_hline_fast__arg_operation
.endmacro
.macro web64_rt_call_bitmap_hline_fast bitmap, x, y, width, pixel, operation
web64_rt_prepare_bitmap_hline_fast bitmap, x, y, width, pixel, operation
jsr _web64_bitmap_hline_fast
.endmacro
; web64_bitmap_init: 9-byte window; entry _web64_bitmap_init
.macro web64_rt_prepare_bitmap_init bitmap, pixels, screen, mode, palette
lda #<bitmap
sta _web64_bitmap_init__arg_bitmap
lda #>bitmap
sta _web64_bitmap_init__arg_bitmap+1
lda #<pixels
sta _web64_bitmap_init__arg_pixels
lda #>pixels
sta _web64_bitmap_init__arg_pixels+1
lda #<screen
sta _web64_bitmap_init__arg_screen
lda #>screen
sta _web64_bitmap_init__arg_screen+1
lda #mode
sta _web64_bitmap_init__arg_mode
lda #<palette
sta _web64_bitmap_init__arg_palette
lda #>palette
sta _web64_bitmap_init__arg_palette+1
.endmacro
.macro web64_rt_call_bitmap_init bitmap, pixels, screen, mode, palette
web64_rt_prepare_bitmap_init bitmap, pixels, screen, mode, palette
jsr _web64_bitmap_init
.endmacro
; web64_bitmap_line: 12-byte window; entry _web64_bitmap_line
.macro web64_rt_prepare_bitmap_line bitmap, x0, y0, x1, y1, pixel, operation
lda #<bitmap
sta _web64_bitmap_line__arg_bitmap
lda #>bitmap
sta _web64_bitmap_line__arg_bitmap+1
lda #<x0
sta _web64_bitmap_line__arg_x0
lda #>x0
sta _web64_bitmap_line__arg_x0+1
lda #<y0
sta _web64_bitmap_line__arg_y0
lda #>y0
sta _web64_bitmap_line__arg_y0+1
lda #<x1
sta _web64_bitmap_line__arg_x1
lda #>x1
sta _web64_bitmap_line__arg_x1+1
lda #<y1
sta _web64_bitmap_line__arg_y1
lda #>y1
sta _web64_bitmap_line__arg_y1+1
lda #pixel
sta _web64_bitmap_line__arg_pixel
lda #operation
sta _web64_bitmap_line__arg_operation
.endmacro
.macro web64_rt_call_bitmap_line bitmap, x0, y0, x1, y1, pixel, operation
web64_rt_prepare_bitmap_line bitmap, x0, y0, x1, y1, pixel, operation
jsr _web64_bitmap_line
.endmacro
; web64_bitmap_line_fast: 10-byte window; entry _web64_bitmap_line_fast
.macro web64_rt_prepare_bitmap_line_fast bitmap, x0, y0, x1, y1, pixel, operation
lda #<bitmap
sta _web64_bitmap_line_fast__arg_bitmap
lda #>bitmap
sta _web64_bitmap_line_fast__arg_bitmap+1
lda #<x0
sta _web64_bitmap_line_fast__arg_x0
lda #>x0
sta _web64_bitmap_line_fast__arg_x0+1
lda #y0
sta _web64_bitmap_line_fast__arg_y0
lda #<x1
sta _web64_bitmap_line_fast__arg_x1
lda #>x1
sta _web64_bitmap_line_fast__arg_x1+1
lda #y1
sta _web64_bitmap_line_fast__arg_y1
lda #pixel
sta _web64_bitmap_line_fast__arg_pixel
lda #operation
sta _web64_bitmap_line_fast__arg_operation
.endmacro
.macro web64_rt_call_bitmap_line_fast bitmap, x0, y0, x1, y1, pixel, operation
web64_rt_prepare_bitmap_line_fast bitmap, x0, y0, x1, y1, pixel, operation
jsr _web64_bitmap_line_fast
.endmacro
; web64_bitmap_load_map: 6-byte window; entry _web64_bitmap_load_map
.macro web64_rt_prepare_bitmap_load_map bitmap, map, charset
lda #<bitmap
sta _web64_bitmap_load_map__arg_bitmap
lda #>bitmap
sta _web64_bitmap_load_map__arg_bitmap+1
lda #<map
sta _web64_bitmap_load_map__arg_map
lda #>map
sta _web64_bitmap_load_map__arg_map+1
lda #<charset
sta _web64_bitmap_load_map__arg_charset
lda #>charset
sta _web64_bitmap_load_map__arg_charset+1
.endmacro
.macro web64_rt_call_bitmap_load_map bitmap, map, charset
web64_rt_prepare_bitmap_load_map bitmap, map, charset
jsr _web64_bitmap_load_map
.endmacro
; web64_bitmap_palette_cell: 6-byte window; entry _web64_bitmap_palette_cell
.macro web64_rt_prepare_bitmap_palette_cell bitmap, column, row, palette
lda #<bitmap
sta _web64_bitmap_palette_cell__arg_bitmap
lda #>bitmap
sta _web64_bitmap_palette_cell__arg_bitmap+1
lda #column
sta _web64_bitmap_palette_cell__arg_column
lda #row
sta _web64_bitmap_palette_cell__arg_row
lda #<palette
sta _web64_bitmap_palette_cell__arg_palette
lda #>palette
sta _web64_bitmap_palette_cell__arg_palette+1
.endmacro
.macro web64_rt_call_bitmap_palette_cell bitmap, column, row, palette
web64_rt_prepare_bitmap_palette_cell bitmap, column, row, palette
jsr _web64_bitmap_palette_cell
.endmacro
; web64_bitmap_palette_uniform: 4-byte window; entry _web64_bitmap_palette_uniform
.macro web64_rt_prepare_bitmap_palette_uniform bitmap, palette
lda #<bitmap
sta _web64_bitmap_palette_uniform__arg_bitmap
lda #>bitmap
sta _web64_bitmap_palette_uniform__arg_bitmap+1
lda #<palette
sta _web64_bitmap_palette_uniform__arg_palette
lda #>palette
sta _web64_bitmap_palette_uniform__arg_palette+1
.endmacro
.macro web64_rt_call_bitmap_palette_uniform bitmap, palette
web64_rt_prepare_bitmap_palette_uniform bitmap, palette
jsr _web64_bitmap_palette_uniform
.endmacro
; web64_bitmap_plot: 8-byte window; entry _web64_bitmap_plot
.macro web64_rt_prepare_bitmap_plot bitmap, x, y, pixel, operation
lda #<bitmap
sta _web64_bitmap_plot__arg_bitmap
lda #>bitmap
sta _web64_bitmap_plot__arg_bitmap+1
lda #<x
sta _web64_bitmap_plot__arg_x
lda #>x
sta _web64_bitmap_plot__arg_x+1
lda #<y
sta _web64_bitmap_plot__arg_y
lda #>y
sta _web64_bitmap_plot__arg_y+1
lda #pixel
sta _web64_bitmap_plot__arg_pixel
lda #operation
sta _web64_bitmap_plot__arg_operation
.endmacro
.macro web64_rt_call_bitmap_plot bitmap, x, y, pixel, operation
web64_rt_prepare_bitmap_plot bitmap, x, y, pixel, operation
jsr _web64_bitmap_plot
.endmacro
; web64_bitmap_plot_fast: 7-byte window; entry _web64_bitmap_plot_fast
.macro web64_rt_prepare_bitmap_plot_fast bitmap, x, y, pixel, operation
lda #<bitmap
sta _web64_bitmap_plot_fast__arg_bitmap
lda #>bitmap
sta _web64_bitmap_plot_fast__arg_bitmap+1
lda #<x
sta _web64_bitmap_plot_fast__arg_x
lda #>x
sta _web64_bitmap_plot_fast__arg_x+1
lda #y
sta _web64_bitmap_plot_fast__arg_y
lda #pixel
sta _web64_bitmap_plot_fast__arg_pixel
lda #operation
sta _web64_bitmap_plot_fast__arg_operation
.endmacro
.macro web64_rt_call_bitmap_plot_fast bitmap, x, y, pixel, operation
web64_rt_prepare_bitmap_plot_fast bitmap, x, y, pixel, operation
jsr _web64_bitmap_plot_fast
.endmacro
; web64_bitmap_rect: 12-byte window; entry _web64_bitmap_rect
.macro web64_rt_prepare_bitmap_rect bitmap, x, y, width, height, pixel, operation
lda #<bitmap
sta _web64_bitmap_rect__arg_bitmap
lda #>bitmap
sta _web64_bitmap_rect__arg_bitmap+1
lda #<x
sta _web64_bitmap_rect__arg_x
lda #>x
sta _web64_bitmap_rect__arg_x+1
lda #<y
sta _web64_bitmap_rect__arg_y
lda #>y
sta _web64_bitmap_rect__arg_y+1
lda #<width
sta _web64_bitmap_rect__arg_width
lda #>width
sta _web64_bitmap_rect__arg_width+1
lda #<height
sta _web64_bitmap_rect__arg_height
lda #>height
sta _web64_bitmap_rect__arg_height+1
lda #pixel
sta _web64_bitmap_rect__arg_pixel
lda #operation
sta _web64_bitmap_rect__arg_operation
.endmacro
.macro web64_rt_call_bitmap_rect bitmap, x, y, width, height, pixel, operation
web64_rt_prepare_bitmap_rect bitmap, x, y, width, height, pixel, operation
jsr _web64_bitmap_rect
.endmacro
; web64_bitmap_rect_fast: 10-byte window; entry _web64_bitmap_rect_fast
.macro web64_rt_prepare_bitmap_rect_fast bitmap, x, y, width, height, pixel, operation
lda #<bitmap
sta _web64_bitmap_rect_fast__arg_bitmap
lda #>bitmap
sta _web64_bitmap_rect_fast__arg_bitmap+1
lda #<x
sta _web64_bitmap_rect_fast__arg_x
lda #>x
sta _web64_bitmap_rect_fast__arg_x+1
lda #y
sta _web64_bitmap_rect_fast__arg_y
lda #<width
sta _web64_bitmap_rect_fast__arg_width
lda #>width
sta _web64_bitmap_rect_fast__arg_width+1
lda #height
sta _web64_bitmap_rect_fast__arg_height
lda #pixel
sta _web64_bitmap_rect_fast__arg_pixel
lda #operation
sta _web64_bitmap_rect_fast__arg_operation
.endmacro
.macro web64_rt_call_bitmap_rect_fast bitmap, x, y, width, height, pixel, operation
web64_rt_prepare_bitmap_rect_fast bitmap, x, y, width, height, pixel, operation
jsr _web64_bitmap_rect_fast
.endmacro
; web64_bitmap_vline: 10-byte window; entry _web64_bitmap_vline
.macro web64_rt_prepare_bitmap_vline bitmap, x, y, height, pixel, operation
lda #<bitmap
sta _web64_bitmap_vline__arg_bitmap
lda #>bitmap
sta _web64_bitmap_vline__arg_bitmap+1
lda #<x
sta _web64_bitmap_vline__arg_x
lda #>x
sta _web64_bitmap_vline__arg_x+1
lda #<y
sta _web64_bitmap_vline__arg_y
lda #>y
sta _web64_bitmap_vline__arg_y+1
lda #<height
sta _web64_bitmap_vline__arg_height
lda #>height
sta _web64_bitmap_vline__arg_height+1
lda #pixel
sta _web64_bitmap_vline__arg_pixel
lda #operation
sta _web64_bitmap_vline__arg_operation
.endmacro
.macro web64_rt_call_bitmap_vline bitmap, x, y, height, pixel, operation
web64_rt_prepare_bitmap_vline bitmap, x, y, height, pixel, operation
jsr _web64_bitmap_vline
.endmacro
; web64_bitmap_vline_fast: 9-byte window; entry _web64_bitmap_vline_fast
.macro web64_rt_prepare_bitmap_vline_fast bitmap, x, y, height, pixel, operation
lda #<bitmap
sta _web64_bitmap_vline_fast__arg_bitmap
lda #>bitmap
sta _web64_bitmap_vline_fast__arg_bitmap+1
lda #<x
sta _web64_bitmap_vline_fast__arg_x
lda #>x
sta _web64_bitmap_vline_fast__arg_x+1
lda #y
sta _web64_bitmap_vline_fast__arg_y
lda #<height
sta _web64_bitmap_vline_fast__arg_height
lda #>height
sta _web64_bitmap_vline_fast__arg_height+1
lda #pixel
sta _web64_bitmap_vline_fast__arg_pixel
lda #operation
sta _web64_bitmap_vline_fast__arg_operation
.endmacro
.macro web64_rt_call_bitmap_vline_fast bitmap, x, y, height, pixel, operation
web64_rt_prepare_bitmap_vline_fast bitmap, x, y, height, pixel, operation
jsr _web64_bitmap_vline_fast
.endmacro
web64/cartridge.h
Web64 SDK header <web64/cartridge.h>.
Included headers: <stdint.h>.
Structs:
| Name | Description | Field summary |
|---|---|---|
web64_cart_transfer | Public struct declared by <web64/cartridge.h>. | 11 fields: uint8_t profile, uint8_t bank, uint8_t window, uint16_t offset, ... |
web64_cart_resource_result | Public struct declared by <web64/cartridge.h>. | uint16_t completed |
Macros:
| Name | Value | Description |
|---|---|---|
WEB64_CART_PROFILE_STANDARD_8K | 0 | Macro constant exported by the header. |
WEB64_CART_PROFILE_STANDARD_16K | 1 | Macro constant exported by the header. |
WEB64_CART_PROFILE_MAGIC_DESK | 2 | Macro constant exported by the header. |
WEB64_CART_PROFILE_EASYFLASH | 3 | Macro constant exported by the header. |
WEB64_CART_ROML | 0 | Macro constant exported by the header. |
WEB64_CART_ROMH | 1 | Macro constant exported by the header. |
WEB64_CART_OK | 0 | Macro constant exported by the header. |
WEB64_CART_PROFILE | 1 | Macro constant exported by the header. |
WEB64_CART_BANK | 2 | Macro constant exported by the header. |
WEB64_CART_MODE | 3 | Macro constant exported by the header. |
WEB64_CART_RANGE | 4 | Macro constant exported by the header. |
WEB64_CART_DESTINATION | 5 | Macro constant exported by the header. |
WEB64_CART_BUSY | 6 | Macro constant exported by the header. |
WEB64_CART_NOT_INITIALIZED | 7 | Macro constant exported by the header. |
WEB64_CART_RESOURCE | 8 | Macro constant exported by the header. |
WEB64_CART_DIRECTORY | 9 | Macro constant exported by the header. |
WEB64_CART_UNSAFE | 10 | Macro constant exported by the header. |
WEB64_CART_MAX_TRANSFER | 256 | Macro constant exported by the header. |
WEB64_CART_MODE_BOOT | 0 | Macro constant exported by the header. |
WEB64_CART_MODE_OFF | 4 | Macro constant exported by the header. |
WEB64_CART_MODE_ULTIMAX | 5 | Macro constant exported by the header. |
WEB64_CART_MODE_8K | 6 | Macro constant exported by the header. |
WEB64_CART_MODE_16K | 7 | Macro constant exported by the header. |
Header listing:
#ifndef WEB64_CARTRIDGE_H
#define WEB64_CARTRIDGE_H
#include <stdint.h>
#define WEB64_CART_PROFILE_STANDARD_8K 0
#define WEB64_CART_PROFILE_STANDARD_16K 1
#define WEB64_CART_PROFILE_MAGIC_DESK 2
#define WEB64_CART_PROFILE_EASYFLASH 3
#define WEB64_CART_ROML 0
#define WEB64_CART_ROMH 1
#define WEB64_CART_OK 0
#define WEB64_CART_PROFILE 1
#define WEB64_CART_BANK 2
#define WEB64_CART_MODE 3
#define WEB64_CART_RANGE 4
#define WEB64_CART_DESTINATION 5
#define WEB64_CART_BUSY 6
#define WEB64_CART_NOT_INITIALIZED 7
#define WEB64_CART_RESOURCE 8
#define WEB64_CART_DIRECTORY 9
#define WEB64_CART_UNSAFE 10
#define WEB64_CART_MAX_TRANSFER 256
#define WEB64_CART_MODE_BOOT 0
#define WEB64_CART_MODE_OFF 4
#define WEB64_CART_MODE_ULTIMAX 5
#define WEB64_CART_MODE_8K 6
#define WEB64_CART_MODE_16K 7
typedef struct { uint8_t profile; uint8_t bank; uint8_t window; uint16_t offset; uint8_t *destination; uint16_t length; } web64_cart_transfer;
typedef struct { uint8_t resource; uint32_t offset; uint8_t *destination; uint16_t length; } web64_cart_resource_request;
typedef struct { uint16_t completed; } web64_cart_resource_result;
_web64_rt uint8_t web64_cart_select_bank(uint8_t profile, uint8_t bank);
_web64_rt uint8_t web64_cart_set_mode(uint8_t profile, uint8_t mode);
_web64_rt uint8_t web64_cart_copy(const web64_cart_transfer *request);
_web64_rt uint8_t web64_cart_read(const web64_cart_transfer *request);
_web64_rt uint8_t web64_cart_resources_init(void);
_web64_rt uint8_t web64_cart_resource_read(const web64_cart_resource_request *request, web64_cart_resource_result *result);
_web64_rt uint8_t web64_cart_resource_copy(const web64_cart_resource_request *request, web64_cart_resource_result *result);
#endif
web64/cartridge.inc
Web64 SDK header <web64/cartridge.inc>.
Header listing:
WEB64_CART_PROFILE_STANDARD_8K = 0
WEB64_CART_PROFILE_STANDARD_16K = 1
WEB64_CART_PROFILE_MAGIC_DESK = 2
WEB64_CART_PROFILE_EASYFLASH = 3
WEB64_CART_ROML = 0
WEB64_CART_ROMH = 1
WEB64_CART_OK = 0
WEB64_CART_PROFILE = 1
WEB64_CART_BANK = 2
WEB64_CART_MODE = 3
WEB64_CART_RANGE = 4
WEB64_CART_DESTINATION = 5
WEB64_CART_BUSY = 6
WEB64_CART_NOT_INITIALIZED = 7
WEB64_CART_RESOURCE = 8
WEB64_CART_DIRECTORY = 9
WEB64_CART_UNSAFE = 10
WEB64_CART_MAX_TRANSFER = 256
WEB64_CART_TRANSFER_PROFILE = 0
WEB64_CART_TRANSFER_BANK = 1
WEB64_CART_TRANSFER_WINDOW = 2
WEB64_CART_TRANSFER_OFFSET = 3
WEB64_CART_TRANSFER_DESTINATION = 5
WEB64_CART_TRANSFER_LENGTH = 7
WEB64_CART_TRANSFER_SIZE = 9
WEB64_CART_RESOURCE_REQUEST_RESOURCE = 0
WEB64_CART_RESOURCE_REQUEST_OFFSET = 1
WEB64_CART_RESOURCE_REQUEST_DESTINATION = 5
WEB64_CART_RESOURCE_REQUEST_LENGTH = 7
WEB64_CART_RESOURCE_REQUEST_SIZE = 9
WEB64_CART_RESOURCE_RESULT_COMPLETED = 0
WEB64_CART_RESOURCE_RESULT_SIZE = 2
WEB64_CART_MODE_BOOT = 0
WEB64_CART_MODE_OFF = 4
WEB64_CART_MODE_ULTIMAX = 5
WEB64_CART_MODE_8K = 6
WEB64_CART_MODE_16K = 7
; Web64 _web64_rt C/assembly call helpers for <web64/cartridge.h>
; Generated from native runtime registry v8; do not hand-edit.
; Arguments are immediate assembly expressions. Pass C globals with their emitted labels.
; Prepare helpers write the complete exact-width window and clobber A only.
; Call helpers prepare the window, JSR the public entry, and inherit its clobber/return contract.
; Helpers allocate no storage. Including this file, or leaving a helper unused, links zero runtime bytes.
WEB64_RT_CARTRIDGE_CALL_COUNT = 7
WEB64_RT_CARTRIDGE_WINDOW_CALL_COUNT = 7
; web64_cart_copy: 2-byte window; entry _web64_cart_copy
.macro web64_rt_prepare_cart_copy request
lda #<request
sta _web64_cart_copy__arg_request
lda #>request
sta _web64_cart_copy__arg_request+1
.endmacro
.macro web64_rt_call_cart_copy request
web64_rt_prepare_cart_copy request
jsr _web64_cart_copy
.endmacro
; web64_cart_read: 2-byte window; entry _web64_cart_read
.macro web64_rt_prepare_cart_read request
lda #<request
sta _web64_cart_read__arg_request
lda #>request
sta _web64_cart_read__arg_request+1
.endmacro
.macro web64_rt_call_cart_read request
web64_rt_prepare_cart_read request
jsr _web64_cart_read
.endmacro
; web64_cart_resource_copy: 4-byte window; entry _web64_cart_resource_copy
.macro web64_rt_prepare_cart_resource_copy request, result
lda #<request
sta _web64_cart_resource_copy__arg_request
lda #>request
sta _web64_cart_resource_copy__arg_request+1
lda #<result
sta _web64_cart_resource_copy__arg_result
lda #>result
sta _web64_cart_resource_copy__arg_result+1
.endmacro
.macro web64_rt_call_cart_resource_copy request, result
web64_rt_prepare_cart_resource_copy request, result
jsr _web64_cart_resource_copy
.endmacro
; web64_cart_resource_read: 4-byte window; entry _web64_cart_resource_read
.macro web64_rt_prepare_cart_resource_read request, result
lda #<request
sta _web64_cart_resource_read__arg_request
lda #>request
sta _web64_cart_resource_read__arg_request+1
lda #<result
sta _web64_cart_resource_read__arg_result
lda #>result
sta _web64_cart_resource_read__arg_result+1
.endmacro
.macro web64_rt_call_cart_resource_read request, result
web64_rt_prepare_cart_resource_read request, result
jsr _web64_cart_resource_read
.endmacro
; web64_cart_resources_init: 0-byte window; entry _web64_cart_resources_init
.macro web64_rt_prepare_cart_resources_init
.endmacro
.macro web64_rt_call_cart_resources_init
web64_rt_prepare_cart_resources_init
jsr _web64_cart_resources_init
.endmacro
; web64_cart_select_bank: 2-byte window; entry _web64_cart_select_bank
.macro web64_rt_prepare_cart_select_bank profile, bank
lda #profile
sta _web64_cart_select_bank__arg_profile
lda #bank
sta _web64_cart_select_bank__arg_bank
.endmacro
.macro web64_rt_call_cart_select_bank profile, bank
web64_rt_prepare_cart_select_bank profile, bank
jsr _web64_cart_select_bank
.endmacro
; web64_cart_set_mode: 2-byte window; entry _web64_cart_set_mode
.macro web64_rt_prepare_cart_set_mode profile, mode
lda #profile
sta _web64_cart_set_mode__arg_profile
lda #mode
sta _web64_cart_set_mode__arg_mode
.endmacro
.macro web64_rt_call_cart_set_mode profile, mode
web64_rt_prepare_cart_set_mode profile, mode
jsr _web64_cart_set_mode
.endmacro
web64/collision.h
Independent material-map and AABB collision probes, swept contacts, interaction queues, and map mutation helpers.
Included headers: <web64/game.h>.
Functions:
| Name | Prototype | Description | Typical use |
|---|---|---|---|
web64_collision_material_at | _web64_rt uint8_t web64_collision_material_at(const Web64CollisionMap *map, uint16_t pixel_x, uint16_t pixel_y) | Reads the material at a 16-bit pixel position through a collision-map view. | material = web64_collision_material_at(&map, x, y); |
web64_collision_material_flags | _web64_rt uint8_t web64_collision_material_flags(const Web64CollisionMap *map, uint8_t material) | Looks up property flags for a material byte. | flags = web64_collision_material_flags(&map, material); |
web64_collision_probe_point | _web64_rt uint8_t web64_collision_probe_point(const Web64CollisionMap *map, uint16_t pixel_x, uint16_t pixel_y, uint8_t material_mask) | Checks a single pixel point against a material mask. | hit = web64_collision_probe_point(&map, x, y, WEB64_MATERIAL_LADDER); |
web64_collision_probe_edge | _web64_rt uint8_t web64_collision_probe_edge(const Web64CollisionMap *map, uint16_t pixel_x, uint16_t pixel_y0, uint16_t pixel_y1, uint8_t material_mask) | Checks a vertical edge against a material mask. | hit = web64_collision_probe_edge(&map, x, y0, y1, WEB64_MATERIAL_SOLID); |
web64_collision_probe_span | _web64_rt uint8_t web64_collision_probe_span(const Web64CollisionMap *map, uint16_t pixel_x0, uint16_t pixel_x1, uint16_t pixel_y, uint8_t material_mask) | Checks a horizontal span against a material mask. | hit = web64_collision_probe_span(&map, x0, x1, y, WEB64_MATERIAL_SOLID); |
web64_collision_find_material_rect | _web64_rt uint16_t web64_collision_find_material_rect(uint8_t *materials, uint8_t row_stride, uint8_t first_column, uint8_t last_column, uint8_t first_row, uint8_t last_row, uint8_t material) | Scans a row-major material rectangle and returns packed column/row coordinates, or $ffff when absent. | hit = web64_collision_find_material_rect(materials, 40, x0, x1, y0, y1, MAT_EGG); |
web64_collision_sweep_x | _web64_rt uint8_t web64_collision_sweep_x(const Web64CollisionMap *map, Web64Aabb *box, Web64CollisionSweepX *sweep) | Resolves one horizontal swept AABB pass and reports contact/material flags. | contacts = web64_collision_sweep_x(&map, &box, &sweep); |
web64_collision_sweep_y | _web64_rt uint8_t web64_collision_sweep_y(const Web64CollisionMap *map, Web64Aabb *box, Web64CollisionSweepY *sweep) | Resolves one vertical swept AABB pass and reports contact/material flags. | contacts = web64_collision_sweep_y(&map, &box, &sweep); |
web64_collision_aabb | _web64_rt uint8_t web64_collision_aabb(const Web64Aabb *a, const Web64Aabb *b) | Tests two AABBs using category and mask filtering. | hit = web64_collision_aabb(&player_box, &enemy_box); |
web64_collision_event_push | _web64_rt uint8_t web64_collision_event_push(Web64CollisionQueue *queue, const Web64CollisionEvent *event) | Adds a collision event to a fixed queue and reports overflow instead of allocating memory. | web64_collision_event_push(&queue, &event); |
web64_collision_map_write | _web64_rt void web64_collision_map_write(uint8_t *plane, uint16_t row_stride, uint8_t column, uint8_t row, uint8_t value) | Writes one map/material/screen plane cell through explicit row-stride addressing. | web64_collision_map_write(materials, width, column, row, 0); |
Structs:
| Name | Description | Field summary |
|---|---|---|
Web64CollisionMap | Public struct declared by <web64/collision.h>. | 14 fields: uint16_t materials, uint16_t properties, uint16_t width, uint16_t height, ... |
Web64CollisionSweepX | Public struct declared by <web64/collision.h>. | 13 fields: uint16_t previous_x, uint16_t desired_x, uint8_t material_mask, uint8_t contacts, ... |
Web64CollisionEvent | Public struct declared by <web64/collision.h>. | 12 fields: uint16_t cell, uint8_t column, uint8_t row, uint8_t material, ... |
Macros:
| Name | Value | Description |
|---|---|---|
WEB64_MATERIAL_SOLID | 1 | Macro constant exported by the header. |
WEB64_MATERIAL_ONE_WAY | 2 | Macro constant exported by the header. |
WEB64_MATERIAL_LADDER | 4 | Macro constant exported by the header. |
WEB64_MATERIAL_HAZARD | 8 | Macro constant exported by the header. |
WEB64_MATERIAL_TRIGGER | 16 | Macro constant exported by the header. |
WEB64_MATERIAL_COLLECTIBLE | 32 | Macro constant exported by the header. |
WEB64_MATERIAL_MODIFIER | 64 | Macro constant exported by the header. |
WEB64_MATERIAL_USER | 128 | Macro constant exported by the header. |
WEB64_CONTACT_LEFT | 1 | Macro constant exported by the header. |
WEB64_CONTACT_RIGHT | 2 | Macro constant exported by the header. |
WEB64_CONTACT_CEILING | 4 | Macro constant exported by the header. |
WEB64_CONTACT_FLOOR | 8 | Macro constant exported by the header. |
WEB64_CONTACT_LADDER | 16 | Macro constant exported by the header. |
WEB64_CONTACT_HAZARD | 32 | Macro constant exported by the header. |
WEB64_CONTACT_TRIGGER | 64 | Macro constant exported by the header. |
WEB64_CONTACT_COLLECTIBLE | 128 | Macro constant exported by the header. |
Header listing:
#ifndef WEB64_COLLISION_H
#define WEB64_COLLISION_H
#include <web64/game.h>
#define WEB64_MATERIAL_SOLID 1
#define WEB64_MATERIAL_ONE_WAY 2
#define WEB64_MATERIAL_LADDER 4
#define WEB64_MATERIAL_HAZARD 8
#define WEB64_MATERIAL_TRIGGER 16
#define WEB64_MATERIAL_COLLECTIBLE 32
#define WEB64_MATERIAL_MODIFIER 64
#define WEB64_MATERIAL_USER 128
#define WEB64_CONTACT_LEFT 1
#define WEB64_CONTACT_RIGHT 2
#define WEB64_CONTACT_CEILING 4
#define WEB64_CONTACT_FLOOR 8
#define WEB64_CONTACT_LADDER 16
#define WEB64_CONTACT_HAZARD 32
#define WEB64_CONTACT_TRIGGER 64
#define WEB64_CONTACT_COLLECTIBLE 128
typedef struct { uint16_t materials; uint16_t properties; uint16_t width; uint16_t height; uint16_t row_stride; uint8_t tile_shift; uint8_t outside_material; } Web64CollisionMap;
typedef struct { uint16_t x; uint16_t y; uint8_t width; uint8_t height; uint8_t category; uint8_t mask; } Web64Aabb;
typedef struct { uint16_t previous_x; uint16_t desired_x; uint8_t material_mask; uint8_t contacts; uint8_t material; uint8_t properties; } Web64CollisionSweepX;
typedef struct { uint16_t previous_y; uint16_t desired_y; uint8_t material_mask; uint8_t contacts; uint8_t material; uint8_t properties; } Web64CollisionSweepY;
typedef struct { uint16_t cell; uint8_t column; uint8_t row; uint8_t material; uint8_t properties; uint8_t contacts; uint8_t actor; } Web64CollisionEvent;
typedef struct { uint16_t events; uint8_t capacity; uint8_t count; uint8_t overflow; } Web64CollisionQueue;
_web64_rt uint8_t web64_collision_material_at(const Web64CollisionMap *map, uint16_t pixel_x, uint16_t pixel_y);
_web64_rt uint8_t web64_collision_material_flags(const Web64CollisionMap *map, uint8_t material);
_web64_rt uint8_t web64_collision_probe_point(const Web64CollisionMap *map, uint16_t pixel_x, uint16_t pixel_y, uint8_t material_mask);
_web64_rt uint8_t web64_collision_probe_edge(const Web64CollisionMap *map, uint16_t pixel_x, uint16_t pixel_y0, uint16_t pixel_y1, uint8_t material_mask);
_web64_rt uint8_t web64_collision_probe_span(const Web64CollisionMap *map, uint16_t pixel_x0, uint16_t pixel_x1, uint16_t pixel_y, uint8_t material_mask);
_web64_rt uint16_t web64_collision_find_material_rect(uint8_t *materials, uint8_t row_stride, uint8_t first_column, uint8_t last_column, uint8_t first_row, uint8_t last_row, uint8_t material);
_web64_rt uint8_t web64_collision_sweep_x(const Web64CollisionMap *map, Web64Aabb *box, Web64CollisionSweepX *sweep);
_web64_rt uint8_t web64_collision_sweep_y(const Web64CollisionMap *map, Web64Aabb *box, Web64CollisionSweepY *sweep);
_web64_rt uint8_t web64_collision_aabb(const Web64Aabb *a, const Web64Aabb *b);
_web64_rt uint8_t web64_collision_event_push(Web64CollisionQueue *queue, const Web64CollisionEvent *event);
_web64_rt void web64_collision_map_write(uint8_t *plane, uint16_t row_stride, uint8_t column, uint8_t row, uint8_t value);
#endif
web64/collision.inc
Registry-generated Collision runtime prepare/call macros for native assembly.
Header listing:
; Web64 _web64_rt C/assembly call helpers for <web64/collision.h>
; Generated from native runtime registry v8; do not hand-edit.
; Arguments are immediate assembly expressions. Pass C globals with their emitted labels.
; Prepare helpers write the complete exact-width window and clobber A only.
; Call helpers prepare the window, JSR the public entry, and inherit its clobber/return contract.
; Helpers allocate no storage. Including this file, or leaving a helper unused, links zero runtime bytes.
WEB64_RT_COLLISION_CALL_COUNT = 11
WEB64_RT_COLLISION_WINDOW_CALL_COUNT = 11
; web64_collision_aabb: 4-byte window; entry _web64_collision_aabb
.macro web64_rt_prepare_collision_aabb a, b
lda #<a
sta _web64_collision_aabb__arg_a
lda #>a
sta _web64_collision_aabb__arg_a+1
lda #<b
sta _web64_collision_aabb__arg_b
lda #>b
sta _web64_collision_aabb__arg_b+1
.endmacro
.macro web64_rt_call_collision_aabb a, b
web64_rt_prepare_collision_aabb a, b
jsr _web64_collision_aabb
.endmacro
; web64_collision_event_push: 4-byte window; entry _web64_collision_event_push
.macro web64_rt_prepare_collision_event_push queue, event
lda #<queue
sta _web64_collision_event_push__arg_queue
lda #>queue
sta _web64_collision_event_push__arg_queue+1
lda #<event
sta _web64_collision_event_push__arg_event
lda #>event
sta _web64_collision_event_push__arg_event+1
.endmacro
.macro web64_rt_call_collision_event_push queue, event
web64_rt_prepare_collision_event_push queue, event
jsr _web64_collision_event_push
.endmacro
; web64_collision_find_material_rect: 8-byte window; entry _web64_collision_find_material_rect
.macro web64_rt_prepare_collision_find_material_rect materials, row_stride, first_column, last_column, first_row, last_row, material
lda #<materials
sta _web64_collision_find_material_rect__arg_materials
lda #>materials
sta _web64_collision_find_material_rect__arg_materials+1
lda #row_stride
sta _web64_collision_find_material_rect__arg_row_stride
lda #first_column
sta _web64_collision_find_material_rect__arg_first_column
lda #last_column
sta _web64_collision_find_material_rect__arg_last_column
lda #first_row
sta _web64_collision_find_material_rect__arg_first_row
lda #last_row
sta _web64_collision_find_material_rect__arg_last_row
lda #material
sta _web64_collision_find_material_rect__arg_material
.endmacro
.macro web64_rt_call_collision_find_material_rect materials, row_stride, first_column, last_column, first_row, last_row, material
web64_rt_prepare_collision_find_material_rect materials, row_stride, first_column, last_column, first_row, last_row, material
jsr _web64_collision_find_material_rect
.endmacro
; web64_collision_map_write: 7-byte window; entry _web64_collision_map_write
.macro web64_rt_prepare_collision_map_write plane, row_stride, column, row, value
lda #<plane
sta _web64_collision_map_write__arg_plane
lda #>plane
sta _web64_collision_map_write__arg_plane+1
lda #<row_stride
sta _web64_collision_map_write__arg_row_stride
lda #>row_stride
sta _web64_collision_map_write__arg_row_stride+1
lda #column
sta _web64_collision_map_write__arg_column
lda #row
sta _web64_collision_map_write__arg_row
lda #value
sta _web64_collision_map_write__arg_value
.endmacro
.macro web64_rt_call_collision_map_write plane, row_stride, column, row, value
web64_rt_prepare_collision_map_write plane, row_stride, column, row, value
jsr _web64_collision_map_write
.endmacro
; web64_collision_material_at: 6-byte window; entry _web64_collision_material_at
.macro web64_rt_prepare_collision_material_at map, pixel_x, pixel_y
lda #<map
sta _web64_collision_material_at__arg_map
lda #>map
sta _web64_collision_material_at__arg_map+1
lda #<pixel_x
sta _web64_collision_material_at__arg_pixel_x
lda #>pixel_x
sta _web64_collision_material_at__arg_pixel_x+1
lda #<pixel_y
sta _web64_collision_material_at__arg_pixel_y
lda #>pixel_y
sta _web64_collision_material_at__arg_pixel_y+1
.endmacro
.macro web64_rt_call_collision_material_at map, pixel_x, pixel_y
web64_rt_prepare_collision_material_at map, pixel_x, pixel_y
jsr _web64_collision_material_at
.endmacro
; web64_collision_material_flags: 3-byte window; entry _web64_collision_material_flags
.macro web64_rt_prepare_collision_material_flags map, material
lda #<map
sta _web64_collision_material_flags__arg_map
lda #>map
sta _web64_collision_material_flags__arg_map+1
lda #material
sta _web64_collision_material_flags__arg_material
.endmacro
.macro web64_rt_call_collision_material_flags map, material
web64_rt_prepare_collision_material_flags map, material
jsr _web64_collision_material_flags
.endmacro
; web64_collision_probe_edge: 9-byte window; entry _web64_collision_probe_edge
.macro web64_rt_prepare_collision_probe_edge map, pixel_x, pixel_y0, pixel_y1, material_mask
lda #<map
sta _web64_collision_probe_edge__arg_map
lda #>map
sta _web64_collision_probe_edge__arg_map+1
lda #<pixel_x
sta _web64_collision_probe_edge__arg_pixel_x
lda #>pixel_x
sta _web64_collision_probe_edge__arg_pixel_x+1
lda #<pixel_y0
sta _web64_collision_probe_edge__arg_pixel_y0
lda #>pixel_y0
sta _web64_collision_probe_edge__arg_pixel_y0+1
lda #<pixel_y1
sta _web64_collision_probe_edge__arg_pixel_y1
lda #>pixel_y1
sta _web64_collision_probe_edge__arg_pixel_y1+1
lda #material_mask
sta _web64_collision_probe_edge__arg_material_mask
.endmacro
.macro web64_rt_call_collision_probe_edge map, pixel_x, pixel_y0, pixel_y1, material_mask
web64_rt_prepare_collision_probe_edge map, pixel_x, pixel_y0, pixel_y1, material_mask
jsr _web64_collision_probe_edge
.endmacro
; web64_collision_probe_point: 7-byte window; entry _web64_collision_probe_point
.macro web64_rt_prepare_collision_probe_point map, pixel_x, pixel_y, material_mask
lda #<map
sta _web64_collision_probe_point__arg_map
lda #>map
sta _web64_collision_probe_point__arg_map+1
lda #<pixel_x
sta _web64_collision_probe_point__arg_pixel_x
lda #>pixel_x
sta _web64_collision_probe_point__arg_pixel_x+1
lda #<pixel_y
sta _web64_collision_probe_point__arg_pixel_y
lda #>pixel_y
sta _web64_collision_probe_point__arg_pixel_y+1
lda #material_mask
sta _web64_collision_probe_point__arg_material_mask
.endmacro
.macro web64_rt_call_collision_probe_point map, pixel_x, pixel_y, material_mask
web64_rt_prepare_collision_probe_point map, pixel_x, pixel_y, material_mask
jsr _web64_collision_probe_point
.endmacro
; web64_collision_probe_span: 9-byte window; entry _web64_collision_probe_span
.macro web64_rt_prepare_collision_probe_span map, pixel_x0, pixel_x1, pixel_y, material_mask
lda #<map
sta _web64_collision_probe_span__arg_map
lda #>map
sta _web64_collision_probe_span__arg_map+1
lda #<pixel_x0
sta _web64_collision_probe_span__arg_pixel_x0
lda #>pixel_x0
sta _web64_collision_probe_span__arg_pixel_x0+1
lda #<pixel_x1
sta _web64_collision_probe_span__arg_pixel_x1
lda #>pixel_x1
sta _web64_collision_probe_span__arg_pixel_x1+1
lda #<pixel_y
sta _web64_collision_probe_span__arg_pixel_y
lda #>pixel_y
sta _web64_collision_probe_span__arg_pixel_y+1
lda #material_mask
sta _web64_collision_probe_span__arg_material_mask
.endmacro
.macro web64_rt_call_collision_probe_span map, pixel_x0, pixel_x1, pixel_y, material_mask
web64_rt_prepare_collision_probe_span map, pixel_x0, pixel_x1, pixel_y, material_mask
jsr _web64_collision_probe_span
.endmacro
; web64_collision_sweep_x: 6-byte window; entry _web64_collision_sweep_x
.macro web64_rt_prepare_collision_sweep_x map, box, sweep
lda #<map
sta _web64_collision_sweep_x__arg_map
lda #>map
sta _web64_collision_sweep_x__arg_map+1
lda #<box
sta _web64_collision_sweep_x__arg_box
lda #>box
sta _web64_collision_sweep_x__arg_box+1
lda #<sweep
sta _web64_collision_sweep_x__arg_sweep
lda #>sweep
sta _web64_collision_sweep_x__arg_sweep+1
.endmacro
.macro web64_rt_call_collision_sweep_x map, box, sweep
web64_rt_prepare_collision_sweep_x map, box, sweep
jsr _web64_collision_sweep_x
.endmacro
; web64_collision_sweep_y: 6-byte window; entry _web64_collision_sweep_y
.macro web64_rt_prepare_collision_sweep_y map, box, sweep
lda #<map
sta _web64_collision_sweep_y__arg_map
lda #>map
sta _web64_collision_sweep_y__arg_map+1
lda #<box
sta _web64_collision_sweep_y__arg_box
lda #>box
sta _web64_collision_sweep_y__arg_box+1
lda #<sweep
sta _web64_collision_sweep_y__arg_sweep
lda #>sweep
sta _web64_collision_sweep_y__arg_sweep+1
.endmacro
.macro web64_rt_call_collision_sweep_y map, box, sweep
web64_rt_prepare_collision_sweep_y map, box, sweep
jsr _web64_collision_sweep_y
.endmacro
web64/disk.h
Dependency-linked disk load/save, streaming file I/O, disk markers, and IDE-assisted disk swap requests.
Included headers: <stdint.h>.
Functions:
| Name | Prototype | Description | Typical use | |
|---|---|---|---|---|
web64_disk_load | _web64_rt uint8_t web64_disk_load(const char *name, uint8_t length, uint8_t device, uint16_t address) | Loads a named PRG or data file through KERNAL LOAD into the requested C64 address. | status = web64_disk_load(WEB64_DISK_NAME("LEVEL1"), 8, 0x4000); | |
web64_disk_save | _web64_rt uint8_t web64_disk_save(const char *name, uint8_t length, uint8_t device, uint16_t start_address, uint16_t end_address) | Saves a C64 memory range to a named PRG through KERNAL SAVE. | status = web64_disk_save(WEB64_DISK_NAME("SAVEGAME"), 8, 0x4000, 0x4100); | |
web64_disk_require | _web64_rt uint8_t web64_disk_require(const char *marker_name, uint8_t marker_length, uint8_t device) | Checks that a generated disk marker exists on the requested drive. | status = web64_disk_require(WEB64_DISK_NAME("@W64-SIDE-B"), 8); | |
web64_disk_request | _web64_rt void web64_disk_request(uint8_t disk_index) | Requests an IDE-assisted zero-based disk-set index through the Web64 mailbox. | web64_disk_request(1); | |
web64_disk_last_end | uint16_t web64_disk_last_end(void) | Returns the end address produced by the most recent successful web64_disk_load. | uint16_t end = web64_disk_last_end(); | |
web64_disk_last_error | uint16_t web64_disk_last_error(void) | Separate from READST and DOS channel 15; 0 or 0x0100 \ | KERNAL A. | web64_disk_last_error(...) |
web64_file_open | _web64_rt uint8_t web64_file_open(const char *name, uint8_t length, uint8_t logical_file, uint8_t device, uint8_t secondary) | Opens a named KERNAL logical file for streaming input or output. | status = web64_file_open(WEB64_DISK_NAME("DATA"), 2, 8, 2); | |
web64_file_close | _web64_rt uint8_t web64_file_close(uint8_t logical_file) | Closes a streaming logical file and restores the default KERNAL channels. | status = web64_file_close(2); | |
web64_file_read | _web64_rt uint8_t web64_file_read(uint8_t logical_file, void *destination) | Reads one byte from an open logical file into the destination and returns the KERNAL status. | status = web64_file_read(2, &value); | |
web64_file_write | _web64_rt uint8_t web64_file_write(uint8_t logical_file, uint8_t value) | Writes one byte to an open logical file and returns the KERNAL status. | status = web64_file_write(2, value); |
Typedefs:
| Name | Declaration | Description |
|---|---|---|
Web64DiskStatus | typedef uint8_t Web64DiskStatus; | Web64 SDK public alias type. |
Structs:
| Name | Description | Field summary |
|---|---|---|
Web64DiskDescriptor | Public struct declared by <web64/disk.h>. | uint8_t index, uint8_t unit, const char *marker_name, uint8_t marker_length |
Web64DiskFileDescriptor | Public struct declared by <web64/disk.h>. | const char *name, uint8_t name_length, uint8_t type |
Macros:
| Name | Value | Description |
|---|---|---|
WEB64_DISK_OK | 0x00 | Macro constant exported by the header. |
WEB64_DISK_STATUS_TIMEOUT_WRITE | 0x01 | Macro constant exported by the header. |
WEB64_DISK_STATUS_TIMEOUT_READ | 0x02 | Macro constant exported by the header. |
WEB64_DISK_STATUS_EOI | 0x40 | Macro constant exported by the header. |
WEB64_DISK_STATUS_DEVICE_NOT_PRESENT | 0x80 | Macro constant exported by the header. |
WEB64_DISK_REQUEST_MAGIC_ADDRESS | 0x02fe | Macro constant exported by the header. |
WEB64_DISK_REQUEST_ID_ADDRESS | 0x02ff | Macro constant exported by the header. |
WEB64_DISK_NAME(text) | (text), ((uint8_t)(sizeof(text) - 1)) | Macro constant exported by the header. |
Header listing:
#ifndef WEB64_DISK_H
#define WEB64_DISK_H
#include <stdint.h>
#define WEB64_DISK_OK 0x00
#define WEB64_DISK_STATUS_TIMEOUT_WRITE 0x01
#define WEB64_DISK_STATUS_TIMEOUT_READ 0x02
#define WEB64_DISK_STATUS_EOI 0x40
#define WEB64_DISK_STATUS_DEVICE_NOT_PRESENT 0x80
#define WEB64_DISK_REQUEST_MAGIC_ADDRESS 0x02fe
#define WEB64_DISK_REQUEST_ID_ADDRESS 0x02ff
#define WEB64_DISK_NAME(text) (text), ((uint8_t)(sizeof(text) - 1))
typedef uint8_t Web64DiskStatus;
typedef struct Web64DiskDescriptor {
uint8_t index;
uint8_t unit;
const char *marker_name;
uint8_t marker_length;
} Web64DiskDescriptor;
typedef struct Web64DiskFileDescriptor {
const char *name;
uint8_t name_length;
uint8_t type;
} Web64DiskFileDescriptor;
_web64_rt uint8_t web64_disk_load(const char *name, uint8_t length, uint8_t device, uint16_t address);
_web64_rt uint8_t web64_disk_save(const char *name, uint8_t length, uint8_t device, uint16_t start_address, uint16_t end_address);
_web64_rt uint8_t web64_disk_require(const char *marker_name, uint8_t marker_length, uint8_t device);
_web64_rt void web64_disk_request(uint8_t disk_index);
uint16_t web64_disk_last_end(void);
/* Separate from READST and DOS channel 15; 0 or 0x0100 | KERNAL A. */
uint16_t web64_disk_last_error(void);
_web64_rt uint8_t web64_file_open(const char *name, uint8_t length, uint8_t logical_file, uint8_t device, uint8_t secondary);
_web64_rt uint8_t web64_file_close(uint8_t logical_file);
_web64_rt uint8_t web64_file_read(uint8_t logical_file, void *destination);
_web64_rt uint8_t web64_file_write(uint8_t logical_file, uint8_t value);
#endif
web64/disk.inc
Registry-generated disk and file-I/O runtime prepare/call macros for native assembly.
Header listing:
; Web64 _web64_rt C/assembly call helpers for <web64/disk.h>
; Generated from native runtime registry v8; do not hand-edit.
; Arguments are immediate assembly expressions. Pass C globals with their emitted labels.
; Prepare helpers write the complete exact-width window and clobber A only.
; Call helpers prepare the window, JSR the public entry, and inherit its clobber/return contract.
; Helpers allocate no storage. Including this file, or leaving a helper unused, links zero runtime bytes.
WEB64_RT_DISK_CALL_COUNT = 10
WEB64_RT_DISK_WINDOW_CALL_COUNT = 8
; web64_disk_last_end: parameterless entry _web64_disk_last_end
.macro web64_rt_call_disk_last_end
jsr _web64_disk_last_end
.endmacro
; web64_disk_last_error: parameterless entry _web64_disk_last_error
.macro web64_rt_call_disk_last_error
jsr _web64_disk_last_error
.endmacro
; web64_disk_load: 6-byte window; entry _web64_disk_load
.macro web64_rt_prepare_disk_load name, length, device, address
lda #<name
sta _web64_disk_load__arg_name
lda #>name
sta _web64_disk_load__arg_name+1
lda #length
sta _web64_disk_load__arg_length
lda #device
sta _web64_disk_load__arg_device
lda #<address
sta _web64_disk_load__arg_address
lda #>address
sta _web64_disk_load__arg_address+1
.endmacro
.macro web64_rt_call_disk_load name, length, device, address
web64_rt_prepare_disk_load name, length, device, address
jsr _web64_disk_load
.endmacro
; web64_disk_request: 1-byte window; entry _web64_disk_request
.macro web64_rt_prepare_disk_request disk_index
lda #disk_index
sta _web64_disk_request__arg_disk_index
.endmacro
.macro web64_rt_call_disk_request disk_index
web64_rt_prepare_disk_request disk_index
jsr _web64_disk_request
.endmacro
; web64_disk_require: 4-byte window; entry _web64_disk_require
.macro web64_rt_prepare_disk_require marker_name, marker_length, device
lda #<marker_name
sta _web64_disk_require__arg_marker_name
lda #>marker_name
sta _web64_disk_require__arg_marker_name+1
lda #marker_length
sta _web64_disk_require__arg_marker_length
lda #device
sta _web64_disk_require__arg_device
.endmacro
.macro web64_rt_call_disk_require marker_name, marker_length, device
web64_rt_prepare_disk_require marker_name, marker_length, device
jsr _web64_disk_require
.endmacro
; web64_disk_save: 8-byte window; entry _web64_disk_save
.macro web64_rt_prepare_disk_save name, length, device, start_address, end_address
lda #<name
sta _web64_disk_save__arg_name
lda #>name
sta _web64_disk_save__arg_name+1
lda #length
sta _web64_disk_save__arg_length
lda #device
sta _web64_disk_save__arg_device
lda #<start_address
sta _web64_disk_save__arg_start_address
lda #>start_address
sta _web64_disk_save__arg_start_address+1
lda #<end_address
sta _web64_disk_save__arg_end_address
lda #>end_address
sta _web64_disk_save__arg_end_address+1
.endmacro
.macro web64_rt_call_disk_save name, length, device, start_address, end_address
web64_rt_prepare_disk_save name, length, device, start_address, end_address
jsr _web64_disk_save
.endmacro
; web64_file_close: 1-byte window; entry _web64_file_close
.macro web64_rt_prepare_file_close logical_file
lda #logical_file
sta _web64_file_close__arg_logical_file
.endmacro
.macro web64_rt_call_file_close logical_file
web64_rt_prepare_file_close logical_file
jsr _web64_file_close
.endmacro
; web64_file_open: 6-byte window; entry _web64_file_open
.macro web64_rt_prepare_file_open name, length, logical_file, device, secondary
lda #<name
sta _web64_file_open__arg_name
lda #>name
sta _web64_file_open__arg_name+1
lda #length
sta _web64_file_open__arg_length
lda #logical_file
sta _web64_file_open__arg_logical_file
lda #device
sta _web64_file_open__arg_device
lda #secondary
sta _web64_file_open__arg_secondary
.endmacro
.macro web64_rt_call_file_open name, length, logical_file, device, secondary
web64_rt_prepare_file_open name, length, logical_file, device, secondary
jsr _web64_file_open
.endmacro
; web64_file_read: 3-byte window; entry _web64_file_read
.macro web64_rt_prepare_file_read logical_file, destination
lda #logical_file
sta _web64_file_read__arg_logical_file
lda #<destination
sta _web64_file_read__arg_destination
lda #>destination
sta _web64_file_read__arg_destination+1
.endmacro
.macro web64_rt_call_file_read logical_file, destination
web64_rt_prepare_file_read logical_file, destination
jsr _web64_file_read
.endmacro
; web64_file_write: 2-byte window; entry _web64_file_write
.macro web64_rt_prepare_file_write logical_file, value
lda #logical_file
sta _web64_file_write__arg_logical_file
lda #value
sta _web64_file_write__arg_value
.endmacro
.macro web64_rt_call_file_write logical_file, value
web64_rt_prepare_file_write logical_file, value
jsr _web64_file_write
.endmacro
web64/fixed.h
8.8 fixed-point, secondary 16.16 macros, angle8 trig helpers, and vector/motion declarations.
Included headers: <stdint.h>.
Functions:
| Name | Prototype | Description | Typical use |
|---|---|---|---|
web64_fix8_mul | _web64_rt web64_fix8_8 web64_fix8_mul(web64_fix8_8 a, web64_fix8_8 b) | Multiplies signed 8.8 fixed-point values and truncates toward zero. | speed = web64_fix8_mul(speed, factor); |
web64_fix8_mul_round | _web64_rt web64_fix8_8 web64_fix8_mul_round(web64_fix8_8 a, web64_fix8_8 b) | Multiplies signed 8.8 values and rounds to nearest, half away from zero. | speed = web64_fix8_mul_round(speed, factor); |
web64_fix8_div | _web64_rt web64_fix8_8 web64_fix8_div(web64_fix8_8 a, web64_fix8_8 b) | Divides signed 8.8 fixed-point values through the runtime helper ABI. | ratio = web64_fix8_div(a, b); |
web64_sin8 | _web64_rt web64_fix8_8 web64_sin8(web64_angle8 angle) | Returns sine as signed 8.8 fixed-point for an angle8 turn fraction. | web64_fix8_8 dy = web64_sin8(angle); |
web64_cos8 | _web64_rt web64_fix8_8 web64_cos8(web64_angle8 angle) | Returns cosine as signed 8.8 fixed-point for an angle8 turn fraction. | web64_fix8_8 dx = web64_cos8(angle); |
web64_ufix8_mul | _web64_rt web64_ufix8_8 web64_ufix8_mul(web64_ufix8_8 a, web64_ufix8_8 b) | Multiplies unsigned 8.8 fixed-point values. | value = web64_ufix8_mul(a, b); |
web64_ufix8_div | _web64_rt web64_ufix8_8 web64_ufix8_div(web64_ufix8_8 a, web64_ufix8_8 b) | Divides unsigned 8.8 fixed-point values. | value = web64_ufix8_div(a, b); |
web64_fix8_lerp | _web64_rt web64_fix8_8 web64_fix8_lerp(web64_fix8_8 a, web64_fix8_8 b, uint8_t amount) | Interpolates between two signed 8.8 values using an 8-bit amount. | value = web64_fix8_lerp(a, b, amount); |
web64_fix8_abs | _web64_rt web64_fix8_8 web64_fix8_abs(web64_fix8_8 value) | Returns the absolute value of a signed 8.8 fixed-point value. | speed = web64_fix8_abs(speed); |
web64_fix8_min | _web64_rt web64_fix8_8 web64_fix8_min(web64_fix8_8 a, web64_fix8_8 b) | Returns the smaller of two signed 8.8 values. | limit = web64_fix8_min(a, b); |
web64_fix8_max | _web64_rt web64_fix8_8 web64_fix8_max(web64_fix8_8 a, web64_fix8_8 b) | Returns the larger of two signed 8.8 values. | limit = web64_fix8_max(a, b); |
web64_fix8_clamp | _web64_rt web64_fix8_8 web64_fix8_clamp(web64_fix8_8 value, web64_fix8_8 min_value, web64_fix8_8 max_value) | Clamps a signed 8.8 value between two limits. | speed = web64_fix8_clamp(speed, min, max); |
web64_fix8_add_sat | _web64_rt web64_fix8_8 web64_fix8_add_sat(web64_fix8_8 a, web64_fix8_8 b) | Adds signed 8.8 values and saturates at the public min/max bounds. | speed = web64_fix8_add_sat(speed, delta); |
web64_fix8_sub_sat | _web64_rt web64_fix8_8 web64_fix8_sub_sat(web64_fix8_8 a, web64_fix8_8 b) | Subtracts signed 8.8 values and saturates at the public min/max bounds. | speed = web64_fix8_sub_sat(speed, delta); |
web64_fixvec2_add | _web64_rt void web64_fixvec2_add(Web64FixVec2 *out, const Web64FixVec2 *a, const Web64FixVec2 *b) | Adds two 8.8 vector values into an output vector. | web64_fixvec2_add(&out, &a, &b); |
web64_fixvec2_sub | _web64_rt void web64_fixvec2_sub(Web64FixVec2 *out, const Web64FixVec2 *a, const Web64FixVec2 *b) | Subtracts one 8.8 vector from another into an output vector. | web64_fixvec2_sub(&out, &a, &b); |
web64_fixvec2_scale | _web64_rt void web64_fixvec2_scale(Web64FixVec2 *out, const Web64FixVec2 *value, web64_fix8_8 scale) | Scales a 2D 8.8 vector by an 8.8 scalar. | web64_fixvec2_scale(&out, &velocity, scale); |
web64_motion2d_integrate | _web64_rt void web64_motion2d_integrate(Web64Motion2D *motion) | Updates position and velocity using the 8.8 motion helper contract. | web64_motion2d_integrate(&motion); |
Typedefs:
| Name | Declaration | Description |
|---|---|---|
web64_fix8_8 | typedef int16_t web64_fix8_8; | Web64 fixed-point ABI contract v1. 8.8 layout: high byte is integer part, low byte is fraction; signed range -128.0..+127.99609375. 16.16 layout: high word is integer part, low word is fraction; this secondary tier exposes no-runtime constants, conversions, floor/to-int, and wrapping add/sub macros. 16.16 multiply/divide helpers are intentionally absent until executable 6502 implementations and tests exist. Default add/sub helpers wrap; saturation, rounding, and checked/debug behavior use explicit public names. web64_fix8_mul truncates toward zero; web64_fix8_mul_round rounds nearest with half ties away from zero. web64_fix8_div reports compile-time zero divisors and returns 0 for dynamic zero in v1. web64_fix8_lerp uses amount/256; amount 255 approaches b but is not endpoint-exact. web64_angle8 maps 0..255 to one full turn; sin/cos return signed 8.8 from a 256-entry full-wave table. Trig endpoints are exact: sin(64)=0x0100 and sin(192)=0xff00; cosine is sine(angle+64). Negative conversions, floor, ceil, and shift-derived lowering must be emitted from this contract, not host-language shifts. WEB64_FIX8_FROM_INT keeps standard shift semantics; typed 8-bit inputs lower directly to fraction=0/integer=value byte placement. Runtime helper modules are dependency-selected by referenced helper family. Vector helpers accept overlapping out/a/b pointers; invalid pointers are caller error. |
web64_ufix8_8 | typedef uint16_t web64_ufix8_8; | Unsigned 8.8 fixed-point storage type. |
web64_fix16_16 | typedef int32_t web64_fix16_16; | Signed 16.16 fixed-point storage type. |
web64_ufix16_16 | typedef uint32_t web64_ufix16_16; | Unsigned 16.16 fixed-point storage type. |
web64_angle8 | typedef uint8_t web64_angle8; | 8-bit full-turn angle type where 256 steps equal one rotation. |
Structs:
| Name | Description | Field summary |
|---|---|---|
Web64FixVec2 | Two-axis signed 8.8 vector used by the fixed-point helpers. | 6 fields: web64_fix8_8 x, web64_fix8_8 y, } Web64FixVec2, typedef struct { Web64FixVec2 position, ... |
Macros:
| Name | Value | Description |
|---|---|---|
WEB64_FIX8_ONE | 0x0100 | Fixed-point constant or conversion macro. |
WEB64_FIX8_HALF | 0x0080 | Fixed-point constant or conversion macro. |
WEB64_FIX8_MIN | 0x8000 | Fixed-point constant or conversion macro. |
WEB64_FIX8_MAX | 0x7fff | Fixed-point constant or conversion macro. |
WEB64_FIX8_FROM_RAW(value) | ((web64_fix8_8)(value)) | Fixed-point constant or conversion macro. |
WEB64_FIX8_RAW(value) | ((uint16_t)(value)) | Fixed-point constant or conversion macro. |
WEB64_FIX8_FROM_INT(value) | ((value) << 8) | Fixed-point constant or conversion macro. |
WEB64_FIX8_TO_INT(value) | ((value) >> 8) | Fixed-point constant or conversion macro. |
WEB64_FIX8_FRACTION(value) | ((value) & 0x00ff) | Fixed-point constant or conversion macro. |
WEB64_FIX8_FROM_RATIO(numerator, denominator) | (((numerator) << 8) / (denominator)) | Fixed-point constant or conversion macro. |
web64_fix8_from_int(value) | WEB64_FIX8_FROM_INT(value) | Macro constant exported by the header. |
web64_fix8_to_int(value) | WEB64_FIX8_TO_INT(value) | Macro constant exported by the header. |
web64_fix8_floor(value) | ((value) & 0xff00) | Typed pointer or expression macro. |
web64_fix8_round(value) | (((value) + 0x0080) & 0xff00) | Typed pointer or expression macro. |
web64_fix8_ceil(value) | (((value) + 0x00ff) & 0xff00) | Typed pointer or expression macro. |
web64_fix8_add_wrap(a, b) | ((web64_fix8_8)((a) + (b))) | Typed pointer or expression macro. |
web64_fix8_sub_wrap(a, b) | ((web64_fix8_8)((a) - (b))) | Typed pointer or expression macro. |
WEB64_UFIX8_FROM_RAW(value) | ((web64_ufix8_8)(value)) | Typed pointer or expression macro. |
WEB64_UFIX8_RAW(value) | ((uint16_t)(value)) | Typed pointer or expression macro. |
WEB64_UFIX8_FROM_INT(value) | ((web64_ufix8_8)((value) << 8)) | Typed pointer or expression macro. |
WEB64_UFIX8_TO_INT(value) | ((uint8_t)((value) >> 8)) | Typed pointer or expression macro. |
WEB64_UFIX8_FRACTION(value) | ((value) & 0x00ff) | Typed pointer or expression macro. |
WEB64_UFIX8_FROM_RATIO(numerator, denominator) | (((uint16_t)(numerator) << 8) / (denominator)) | Typed pointer or expression macro. |
web64_ufix8_from_int(value) | WEB64_UFIX8_FROM_INT(value) | Macro constant exported by the header. |
web64_ufix8_to_int(value) | WEB64_UFIX8_TO_INT(value) | Macro constant exported by the header. |
web64_ufix8_add_wrap(a, b) | ((web64_ufix8_8)((a) + (b))) | Typed pointer or expression macro. |
web64_ufix8_sub_wrap(a, b) | ((web64_ufix8_8)((a) - (b))) | Typed pointer or expression macro. |
WEB64_FIX16_ONE | 0x00010000 | Fixed-point constant or conversion macro. |
WEB64_FIX16_HALF | 0x00008000 | Fixed-point constant or conversion macro. |
WEB64_FIX16_MIN | 0x80000000 | Fixed-point constant or conversion macro. |
WEB64_FIX16_MAX | 0x7fffffff | Fixed-point constant or conversion macro. |
WEB64_FIX16_FROM_INT(value) | ((web64_fix16_16)(value) << 16) | Fixed-point constant or conversion macro. |
WEB64_FIX16_TO_INT(value) | ((value) >> 16) | Fixed-point constant or conversion macro. |
WEB64_FIX16_FRACTION(value) | ((value) & 0x0000ffff) | Fixed-point constant or conversion macro. |
WEB64_FIX16_FROM_RATIO(numerator, denominator) | (((web64_fix16_16)(numerator) << 16) / (denominator)) | Fixed-point constant or conversion macro. |
web64_fix16_from_int(value) | WEB64_FIX16_FROM_INT(value) | Macro constant exported by the header. |
web64_fix16_to_int(value) | WEB64_FIX16_TO_INT(value) | Macro constant exported by the header. |
web64_fix16_floor(value) | ((value) & 0xffff0000) | Typed pointer or expression macro. |
web64_fix16_add_wrap(a, b) | ((web64_fix16_16)((a) + (b))) | Typed pointer or expression macro. |
web64_fix16_sub_wrap(a, b) | ((web64_fix16_16)((a) - (b))) | Typed pointer or expression macro. |
f8_mul_round | web64_fix8_mul_round | Short 8.8 helper aliases. |
f8_div | web64_fix8_div | Short fixed-point helper alias macro. |
uf8_mul | web64_ufix8_mul | Short fixed-point helper alias macro. |
uf8_div | web64_ufix8_div | Short fixed-point helper alias macro. |
f8_lerp | web64_fix8_lerp | Short fixed-point helper alias macro. |
f8_abs | web64_fix8_abs | Short fixed-point helper alias macro. |
f8_min | web64_fix8_min | Short fixed-point helper alias macro. |
f8_max | web64_fix8_max | Short fixed-point helper alias macro. |
f8_clamp | web64_fix8_clamp | Short fixed-point helper alias macro. |
f8_add_sat | web64_fix8_add_sat | Short fixed-point helper alias macro. |
f8_sub_sat | web64_fix8_sub_sat | Short fixed-point helper alias macro. |
f8_sin | web64_sin8 | Short fixed-point helper alias macro. |
f8_cos | web64_cos8 | Short fixed-point helper alias macro. |
v2f8_add | web64_fixvec2_add | Short fixed-point helper alias macro. |
v2f8_sub | web64_fixvec2_sub | Short fixed-point helper alias macro. |
v2f8_scale | web64_fixvec2_scale | Short fixed-point helper alias macro. |
m2d_int | web64_motion2d_integrate | Short fixed-point helper alias macro. |
Header listing:
#ifndef WEB64_FIXED_H
#define WEB64_FIXED_H
#include <stdint.h>
/* Web64 fixed-point ABI contract v1.
8.8 layout: high byte is integer part, low byte is fraction; signed range -128.0..+127.99609375.
16.16 layout: high word is integer part, low word is fraction; this secondary tier exposes no-runtime constants, conversions, floor/to-int, and wrapping add/sub macros.
16.16 multiply/divide helpers are intentionally absent until executable 6502 implementations and tests exist.
Default add/sub helpers wrap; saturation, rounding, and checked/debug behavior use explicit public names.
web64_fix8_mul truncates toward zero; web64_fix8_mul_round rounds nearest with half ties away from zero.
web64_fix8_div reports compile-time zero divisors and returns 0 for dynamic zero in v1.
web64_fix8_lerp uses amount/256; amount 255 approaches b but is not endpoint-exact.
web64_angle8 maps 0..255 to one full turn; sin/cos return signed 8.8 from a 256-entry full-wave table.
Trig endpoints are exact: sin(64)=0x0100 and sin(192)=0xff00; cosine is sine(angle+64).
Negative conversions, floor, ceil, and shift-derived lowering must be emitted from this contract, not host-language shifts.
WEB64_FIX8_FROM_INT keeps standard shift semantics; typed 8-bit inputs lower directly to fraction=0/integer=value byte placement.
Runtime helper modules are dependency-selected by referenced helper family.
Vector helpers accept overlapping out/a/b pointers; invalid pointers are caller error.
*/
typedef int16_t web64_fix8_8;
typedef uint16_t web64_ufix8_8;
typedef int32_t web64_fix16_16;
typedef uint32_t web64_ufix16_16;
typedef uint8_t web64_angle8;
typedef struct { web64_fix8_8 x; web64_fix8_8 y; } Web64FixVec2;
typedef struct { Web64FixVec2 position; Web64FixVec2 velocity; Web64FixVec2 acceleration; } Web64Motion2D;
#define WEB64_FIX8_ONE 0x0100
#define WEB64_FIX8_HALF 0x0080
#define WEB64_FIX8_MIN 0x8000
#define WEB64_FIX8_MAX 0x7fff
#define WEB64_FIX8_FROM_RAW(value) ((web64_fix8_8)(value))
#define WEB64_FIX8_RAW(value) ((uint16_t)(value))
#define WEB64_FIX8_FROM_INT(value) ((value) << 8)
#define WEB64_FIX8_TO_INT(value) ((value) >> 8)
#define WEB64_FIX8_FRACTION(value) ((value) & 0x00ff)
#define WEB64_FIX8_FROM_RATIO(numerator, denominator) (((numerator) << 8) / (denominator))
#define web64_fix8_from_int(value) WEB64_FIX8_FROM_INT(value)
#define web64_fix8_to_int(value) WEB64_FIX8_TO_INT(value)
#define web64_fix8_floor(value) ((value) & 0xff00)
#define web64_fix8_round(value) (((value) + 0x0080) & 0xff00)
#define web64_fix8_ceil(value) (((value) + 0x00ff) & 0xff00)
#define web64_fix8_add_wrap(a, b) ((web64_fix8_8)((a) + (b)))
#define web64_fix8_sub_wrap(a, b) ((web64_fix8_8)((a) - (b)))
#define WEB64_UFIX8_FROM_RAW(value) ((web64_ufix8_8)(value))
#define WEB64_UFIX8_RAW(value) ((uint16_t)(value))
#define WEB64_UFIX8_FROM_INT(value) ((web64_ufix8_8)((value) << 8))
#define WEB64_UFIX8_TO_INT(value) ((uint8_t)((value) >> 8))
#define WEB64_UFIX8_FRACTION(value) ((value) & 0x00ff)
#define WEB64_UFIX8_FROM_RATIO(numerator, denominator) (((uint16_t)(numerator) << 8) / (denominator))
#define web64_ufix8_from_int(value) WEB64_UFIX8_FROM_INT(value)
#define web64_ufix8_to_int(value) WEB64_UFIX8_TO_INT(value)
#define web64_ufix8_add_wrap(a, b) ((web64_ufix8_8)((a) + (b)))
#define web64_ufix8_sub_wrap(a, b) ((web64_ufix8_8)((a) - (b)))
#define WEB64_FIX16_ONE 0x00010000
#define WEB64_FIX16_HALF 0x00008000
#define WEB64_FIX16_MIN 0x80000000
#define WEB64_FIX16_MAX 0x7fffffff
#define WEB64_FIX16_FROM_INT(value) ((web64_fix16_16)(value) << 16)
#define WEB64_FIX16_TO_INT(value) ((value) >> 16)
#define WEB64_FIX16_FRACTION(value) ((value) & 0x0000ffff)
#define WEB64_FIX16_FROM_RATIO(numerator, denominator) (((web64_fix16_16)(numerator) << 16) / (denominator))
#define web64_fix16_from_int(value) WEB64_FIX16_FROM_INT(value)
#define web64_fix16_to_int(value) WEB64_FIX16_TO_INT(value)
#define web64_fix16_floor(value) ((value) & 0xffff0000)
#define web64_fix16_add_wrap(a, b) ((web64_fix16_16)((a) + (b)))
#define web64_fix16_sub_wrap(a, b) ((web64_fix16_16)((a) - (b)))
_web64_rt web64_fix8_8 web64_fix8_mul(web64_fix8_8 a, web64_fix8_8 b);
_web64_rt web64_fix8_8 web64_fix8_mul_round(web64_fix8_8 a, web64_fix8_8 b);
_web64_rt web64_fix8_8 web64_fix8_div(web64_fix8_8 a, web64_fix8_8 b);
_web64_rt web64_fix8_8 web64_sin8(web64_angle8 angle);
_web64_rt web64_fix8_8 web64_cos8(web64_angle8 angle);
_web64_rt web64_ufix8_8 web64_ufix8_mul(web64_ufix8_8 a, web64_ufix8_8 b);
_web64_rt web64_ufix8_8 web64_ufix8_div(web64_ufix8_8 a, web64_ufix8_8 b);
_web64_rt web64_fix8_8 web64_fix8_lerp(web64_fix8_8 a, web64_fix8_8 b, uint8_t amount);
_web64_rt web64_fix8_8 web64_fix8_abs(web64_fix8_8 value);
_web64_rt web64_fix8_8 web64_fix8_min(web64_fix8_8 a, web64_fix8_8 b);
_web64_rt web64_fix8_8 web64_fix8_max(web64_fix8_8 a, web64_fix8_8 b);
_web64_rt web64_fix8_8 web64_fix8_clamp(web64_fix8_8 value, web64_fix8_8 min_value, web64_fix8_8 max_value);
_web64_rt web64_fix8_8 web64_fix8_add_sat(web64_fix8_8 a, web64_fix8_8 b);
_web64_rt web64_fix8_8 web64_fix8_sub_sat(web64_fix8_8 a, web64_fix8_8 b);
_web64_rt void web64_fixvec2_add(Web64FixVec2 *out, const Web64FixVec2 *a, const Web64FixVec2 *b);
_web64_rt void web64_fixvec2_sub(Web64FixVec2 *out, const Web64FixVec2 *a, const Web64FixVec2 *b);
_web64_rt void web64_fixvec2_scale(Web64FixVec2 *out, const Web64FixVec2 *value, web64_fix8_8 scale);
_web64_rt void web64_motion2d_integrate(Web64Motion2D *motion);
/* Short 8.8 helper aliases. */
#define f8_mul_round web64_fix8_mul_round
#define f8_div web64_fix8_div
#define uf8_mul web64_ufix8_mul
#define uf8_div web64_ufix8_div
#define f8_lerp web64_fix8_lerp
#define f8_abs web64_fix8_abs
#define f8_min web64_fix8_min
#define f8_max web64_fix8_max
#define f8_clamp web64_fix8_clamp
#define f8_add_sat web64_fix8_add_sat
#define f8_sub_sat web64_fix8_sub_sat
#define f8_sin web64_sin8
#define f8_cos web64_cos8
#define v2f8_add web64_fixvec2_add
#define v2f8_sub web64_fixvec2_sub
#define v2f8_scale web64_fixvec2_scale
#define m2d_int web64_motion2d_integrate
#endif
web64/fixed.inc
Registry-generated fixed-point runtime prepare/call macros for native assembly.
Header listing:
; Web64 _web64_rt C/assembly call helpers for <web64/fixed.h>
; Generated from native runtime registry v8; do not hand-edit.
; Arguments are immediate assembly expressions. Pass C globals with their emitted labels.
; Prepare helpers write the complete exact-width window and clobber A only.
; Call helpers prepare the window, JSR the public entry, and inherit its clobber/return contract.
; Helpers allocate no storage. Including this file, or leaving a helper unused, links zero runtime bytes.
WEB64_RT_FIXED_CALL_COUNT = 18
WEB64_RT_FIXED_WINDOW_CALL_COUNT = 18
; web64_cos8: 1-byte window; entry _web64_cos8
.macro web64_rt_prepare_cos8 angle
lda #angle
sta _web64_cos8__arg_angle
.endmacro
.macro web64_rt_call_cos8 angle
web64_rt_prepare_cos8 angle
jsr _web64_cos8
.endmacro
; web64_fix8_abs: 2-byte window; entry _web64_fix8_abs
.macro web64_rt_prepare_fix8_abs value
lda #<value
sta _web64_fix8_abs__arg_value
lda #>value
sta _web64_fix8_abs__arg_value+1
.endmacro
.macro web64_rt_call_fix8_abs value
web64_rt_prepare_fix8_abs value
jsr _web64_fix8_abs
.endmacro
; web64_fix8_add_sat: 4-byte window; entry _web64_fix8_add_sat
.macro web64_rt_prepare_fix8_add_sat a, b
lda #<a
sta _web64_fix8_add_sat__arg_a
lda #>a
sta _web64_fix8_add_sat__arg_a+1
lda #<b
sta _web64_fix8_add_sat__arg_b
lda #>b
sta _web64_fix8_add_sat__arg_b+1
.endmacro
.macro web64_rt_call_fix8_add_sat a, b
web64_rt_prepare_fix8_add_sat a, b
jsr _web64_fix8_add_sat
.endmacro
; web64_fix8_clamp: 6-byte window; entry _web64_fix8_clamp
.macro web64_rt_prepare_fix8_clamp value, min_value, max_value
lda #<value
sta _web64_fix8_clamp__arg_value
lda #>value
sta _web64_fix8_clamp__arg_value+1
lda #<min_value
sta _web64_fix8_clamp__arg_min_value
lda #>min_value
sta _web64_fix8_clamp__arg_min_value+1
lda #<max_value
sta _web64_fix8_clamp__arg_max_value
lda #>max_value
sta _web64_fix8_clamp__arg_max_value+1
.endmacro
.macro web64_rt_call_fix8_clamp value, min_value, max_value
web64_rt_prepare_fix8_clamp value, min_value, max_value
jsr _web64_fix8_clamp
.endmacro
; web64_fix8_div: 4-byte window; entry _web64_fix8_div
.macro web64_rt_prepare_fix8_div a, b
lda #<a
sta _web64_fix8_div__arg_a
lda #>a
sta _web64_fix8_div__arg_a+1
lda #<b
sta _web64_fix8_div__arg_b
lda #>b
sta _web64_fix8_div__arg_b+1
.endmacro
.macro web64_rt_call_fix8_div a, b
web64_rt_prepare_fix8_div a, b
jsr _web64_fix8_div
.endmacro
; web64_fix8_lerp: 5-byte window; entry _web64_fix8_lerp
.macro web64_rt_prepare_fix8_lerp a, b, amount
lda #<a
sta _web64_fix8_lerp__arg_a
lda #>a
sta _web64_fix8_lerp__arg_a+1
lda #<b
sta _web64_fix8_lerp__arg_b
lda #>b
sta _web64_fix8_lerp__arg_b+1
lda #amount
sta _web64_fix8_lerp__arg_amount
.endmacro
.macro web64_rt_call_fix8_lerp a, b, amount
web64_rt_prepare_fix8_lerp a, b, amount
jsr _web64_fix8_lerp
.endmacro
; web64_fix8_max: 4-byte window; entry _web64_fix8_max
.macro web64_rt_prepare_fix8_max a, b
lda #<a
sta _web64_fix8_max__arg_a
lda #>a
sta _web64_fix8_max__arg_a+1
lda #<b
sta _web64_fix8_max__arg_b
lda #>b
sta _web64_fix8_max__arg_b+1
.endmacro
.macro web64_rt_call_fix8_max a, b
web64_rt_prepare_fix8_max a, b
jsr _web64_fix8_max
.endmacro
; web64_fix8_min: 4-byte window; entry _web64_fix8_min
.macro web64_rt_prepare_fix8_min a, b
lda #<a
sta _web64_fix8_min__arg_a
lda #>a
sta _web64_fix8_min__arg_a+1
lda #<b
sta _web64_fix8_min__arg_b
lda #>b
sta _web64_fix8_min__arg_b+1
.endmacro
.macro web64_rt_call_fix8_min a, b
web64_rt_prepare_fix8_min a, b
jsr _web64_fix8_min
.endmacro
; web64_fix8_mul: 4-byte window; entry _web64_fix8_mul
.macro web64_rt_prepare_fix8_mul a, b
lda #<a
sta _web64_fix8_mul__arg_a
lda #>a
sta _web64_fix8_mul__arg_a+1
lda #<b
sta _web64_fix8_mul__arg_b
lda #>b
sta _web64_fix8_mul__arg_b+1
.endmacro
.macro web64_rt_call_fix8_mul a, b
web64_rt_prepare_fix8_mul a, b
jsr _web64_fix8_mul
.endmacro
; web64_fix8_mul_round: 4-byte window; entry _web64_fix8_mul_round
.macro web64_rt_prepare_fix8_mul_round a, b
lda #<a
sta _web64_fix8_mul_round__arg_a
lda #>a
sta _web64_fix8_mul_round__arg_a+1
lda #<b
sta _web64_fix8_mul_round__arg_b
lda #>b
sta _web64_fix8_mul_round__arg_b+1
.endmacro
.macro web64_rt_call_fix8_mul_round a, b
web64_rt_prepare_fix8_mul_round a, b
jsr _web64_fix8_mul_round
.endmacro
; web64_fix8_sub_sat: 4-byte window; entry _web64_fix8_sub_sat
.macro web64_rt_prepare_fix8_sub_sat a, b
lda #<a
sta _web64_fix8_sub_sat__arg_a
lda #>a
sta _web64_fix8_sub_sat__arg_a+1
lda #<b
sta _web64_fix8_sub_sat__arg_b
lda #>b
sta _web64_fix8_sub_sat__arg_b+1
.endmacro
.macro web64_rt_call_fix8_sub_sat a, b
web64_rt_prepare_fix8_sub_sat a, b
jsr _web64_fix8_sub_sat
.endmacro
; web64_fixvec2_add: 6-byte window; entry _web64_fixvec2_add
.macro web64_rt_prepare_fixvec2_add out, a, b
lda #<out
sta _web64_fixvec2_add__arg_out
lda #>out
sta _web64_fixvec2_add__arg_out+1
lda #<a
sta _web64_fixvec2_add__arg_a
lda #>a
sta _web64_fixvec2_add__arg_a+1
lda #<b
sta _web64_fixvec2_add__arg_b
lda #>b
sta _web64_fixvec2_add__arg_b+1
.endmacro
.macro web64_rt_call_fixvec2_add out, a, b
web64_rt_prepare_fixvec2_add out, a, b
jsr _web64_fixvec2_add
.endmacro
; web64_fixvec2_scale: 6-byte window; entry _web64_fixvec2_scale
.macro web64_rt_prepare_fixvec2_scale out, value, scale
lda #<out
sta _web64_fixvec2_scale__arg_out
lda #>out
sta _web64_fixvec2_scale__arg_out+1
lda #<value
sta _web64_fixvec2_scale__arg_value
lda #>value
sta _web64_fixvec2_scale__arg_value+1
lda #<scale
sta _web64_fixvec2_scale__arg_scale
lda #>scale
sta _web64_fixvec2_scale__arg_scale+1
.endmacro
.macro web64_rt_call_fixvec2_scale out, value, scale
web64_rt_prepare_fixvec2_scale out, value, scale
jsr _web64_fixvec2_scale
.endmacro
; web64_fixvec2_sub: 6-byte window; entry _web64_fixvec2_sub
.macro web64_rt_prepare_fixvec2_sub out, a, b
lda #<out
sta _web64_fixvec2_sub__arg_out
lda #>out
sta _web64_fixvec2_sub__arg_out+1
lda #<a
sta _web64_fixvec2_sub__arg_a
lda #>a
sta _web64_fixvec2_sub__arg_a+1
lda #<b
sta _web64_fixvec2_sub__arg_b
lda #>b
sta _web64_fixvec2_sub__arg_b+1
.endmacro
.macro web64_rt_call_fixvec2_sub out, a, b
web64_rt_prepare_fixvec2_sub out, a, b
jsr _web64_fixvec2_sub
.endmacro
; web64_motion2d_integrate: 2-byte window; entry _web64_motion2d_integrate
.macro web64_rt_prepare_motion2d_integrate motion
lda #<motion
sta _web64_motion2d_integrate__arg_motion
lda #>motion
sta _web64_motion2d_integrate__arg_motion+1
.endmacro
.macro web64_rt_call_motion2d_integrate motion
web64_rt_prepare_motion2d_integrate motion
jsr _web64_motion2d_integrate
.endmacro
; web64_sin8: 1-byte window; entry _web64_sin8
.macro web64_rt_prepare_sin8 angle
lda #angle
sta _web64_sin8__arg_angle
.endmacro
.macro web64_rt_call_sin8 angle
web64_rt_prepare_sin8 angle
jsr _web64_sin8
.endmacro
; web64_ufix8_div: 4-byte window; entry _web64_ufix8_div
.macro web64_rt_prepare_ufix8_div a, b
lda #<a
sta _web64_ufix8_div__arg_a
lda #>a
sta _web64_ufix8_div__arg_a+1
lda #<b
sta _web64_ufix8_div__arg_b
lda #>b
sta _web64_ufix8_div__arg_b+1
.endmacro
.macro web64_rt_call_ufix8_div a, b
web64_rt_prepare_ufix8_div a, b
jsr _web64_ufix8_div
.endmacro
; web64_ufix8_mul: 4-byte window; entry _web64_ufix8_mul
.macro web64_rt_prepare_ufix8_mul a, b
lda #<a
sta _web64_ufix8_mul__arg_a
lda #>a
sta _web64_ufix8_mul__arg_a+1
lda #<b
sta _web64_ufix8_mul__arg_b
lda #>b
sta _web64_ufix8_mul__arg_b+1
.endmacro
.macro web64_rt_call_ufix8_mul a, b
web64_rt_prepare_ufix8_mul a, b
jsr _web64_ufix8_mul
.endmacro
web64/game-compose.h
Opt-in composition macros for proven hot primitive combinations without introducing a framework update loop.
Included headers: <web64/motion.h>.
Macros:
| Name | Value | Description |
|---|---|---|
web64_compose_motion_axis_integrate(position, velocity, intent, accel, brake, max_speed) | velocity = web64_motion_axis(velocity, intent, accel, brake, max_speed); web64_motion_integrate(&(position), velocity) | Macro constant exported by the header. |
web64_compose_actor_motion_step(x, y, vx, vy) | web64_motion_integrate(&(x), vx); web64_motion_integrate(&(y), vy) | Macro constant exported by the header. |
web64_actor_motion_step(x, y, vx, vy) | (web64_motion_integrate(&(x), (vx)), web64_motion_integrate(&(y), (vy))) | Macro constant exported by the header. |
Header listing:
#ifndef WEB64_GAME_COMPOSE_H
#define WEB64_GAME_COMPOSE_H
#include <web64/motion.h>
#define web64_compose_motion_axis_integrate(position, velocity, intent, accel, brake, max_speed) velocity = web64_motion_axis(velocity, intent, accel, brake, max_speed); web64_motion_integrate(&(position), velocity)
#define web64_compose_actor_motion_step(x, y, vx, vy) web64_motion_integrate(&(x), vx); web64_motion_integrate(&(y), vy)
#define web64_actor_motion_step(x, y, vx, vy) (web64_motion_integrate(&(x), (vx)), web64_motion_integrate(&(y), (vy)))
#endif
web64/game.h
Shared Game Runtime numeric contract, Q12.4 conversion macros, and compact point/delta/box structs.
Included headers: <stdint.h>.
Typedefs:
| Name | Declaration | Description |
|---|---|---|
web64_pos_t | typedef uint16_t web64_pos_t; | Alias for uint16_t. |
web64_vel_t | typedef int16_t web64_vel_t; | Alias for int16_t. |
Structs:
| Name | Description | Field summary |
|---|---|---|
Web64GamePoint | Public struct declared by <web64/game.h>. | 5 fields: web64_pos_t x, web64_pos_t y, } Web64GamePoint, typedef struct { web64_vel_t x, ... |
Web64GameBox | Public struct declared by <web64/game.h>. | uint16_t x, uint16_t y, uint8_t width, uint8_t height |
Macros:
| Name | Value | Description |
|---|---|---|
WEB64_SUBPIXEL_BITS | 4 | Macro constant exported by the header. |
WEB64_SUBPIXEL_ONE | ((uint16_t)(1U << WEB64_SUBPIXEL_BITS)) | Typed pointer or expression macro. |
WEB64_ADDRESS(pointer) | ((uint16_t)(pointer)) | Typed pointer or expression macro. |
WEB64_POS_FROM_PX(value) | ((web64_pos_t)((uint16_t)(value) << WEB64_SUBPIXEL_BITS)) | Typed pointer or expression macro. |
WEB64_POS_TO_PX(value) | ((uint16_t)(value) >> WEB64_SUBPIXEL_BITS) | Typed pointer or expression macro. |
WEB64_POS_FRACTION(value) | ((uint8_t)((value) & (WEB64_SUBPIXEL_ONE - 1U))) | Typed pointer or expression macro. |
WEB64_VEL_FROM_PX(value) | ((web64_vel_t)((int16_t)(value) << WEB64_SUBPIXEL_BITS)) | Typed pointer or expression macro. |
WEB64_VEL_TO_PX(value) | ((int16_t)(value) >> WEB64_SUBPIXEL_BITS) | Typed pointer or expression macro. |
Header listing:
#ifndef WEB64_GAME_H
#define WEB64_GAME_H
#include <stdint.h>
#ifndef WEB64_SUBPIXEL_BITS
#define WEB64_SUBPIXEL_BITS 4
#endif
#if WEB64_SUBPIXEL_BITS < 1 || WEB64_SUBPIXEL_BITS > 6
#error WEB64_SUBPIXEL_BITS must be between 1 and 6
#endif
#define WEB64_SUBPIXEL_ONE ((uint16_t)(1U << WEB64_SUBPIXEL_BITS))
#define WEB64_ADDRESS(pointer) ((uint16_t)(pointer))
#define WEB64_POS_FROM_PX(value) ((web64_pos_t)((uint16_t)(value) << WEB64_SUBPIXEL_BITS))
#define WEB64_POS_TO_PX(value) ((uint16_t)(value) >> WEB64_SUBPIXEL_BITS)
#define WEB64_POS_FRACTION(value) ((uint8_t)((value) & (WEB64_SUBPIXEL_ONE - 1U)))
#define WEB64_VEL_FROM_PX(value) ((web64_vel_t)((int16_t)(value) << WEB64_SUBPIXEL_BITS))
#define WEB64_VEL_TO_PX(value) ((int16_t)(value) >> WEB64_SUBPIXEL_BITS)
typedef uint16_t web64_pos_t;
typedef int16_t web64_vel_t;
typedef struct { web64_pos_t x; web64_pos_t y; } Web64GamePoint;
typedef struct { web64_vel_t x; web64_vel_t y; } Web64GameDelta;
typedef struct { uint16_t x; uint16_t y; uint8_t width; uint8_t height; } Web64GameBox;
#endif
web64/loader-decoder-runtime.inc
Web64 SDK header <web64/loader-decoder-runtime.inc>.
Header listing:
; Caller-owned RAM image: define WEB64_LOADER_DECODER_ADDRESS, include once and copy before use.
web64_loader_decoder_image:
; Altered Exomizer 3.1.2 backward P39/M255 decruncher.
; Copyright (c) 2002-2020 Magnus Lind and contributors.
;
; This software is provided 'as-is', without any express or implied warranty.
; In no event will the authors be held liable for any damages arising from
; the use of this software.
;
; Permission is granted to anyone to use this software for any purpose,
; including commercial applications, and to alter it and redistribute it
; freely, subject to the following restrictions:
; 1. The origin of this software must not be misrepresented; you must not
; claim that you wrote the original software. An acknowledgment in product
; documentation is appreciated but not required.
; 2. Altered source versions must be plainly marked as such and must not be
; represented as the original software.
; 3. This notice may not be removed or altered from a source distribution.
; Neither the Exomizer name nor copyright-holder names may endorse derived
; products without prior written permission.
;
; This altered Web64 port adds bounded input/output/history, scratch-only
; decoding and error unwinding. It is not the original Exomizer source.
__w64ld_unpack__image:
__w64ld_unpack = __w64ld_unpack__image - web64_loader_decoder_image + WEB64_LOADER_DECODER_ADDRESS
tsx
stx __w64ld_unpack_sp
lda __w64ld_source_end
sta __w64ld_exo_read+1
lda __w64ld_source_end+1
sta __w64ld_exo_read+2
jsr __w64ld_exo_decrunch
lda __w64ld_output_left
ora __w64ld_output_left+1
beq __w64ld_unpack_ok__image
jmp __w64ld_unpack_bad
__w64ld_unpack_ok__image:
__w64ld_unpack_ok = __w64ld_unpack_ok__image - web64_loader_decoder_image + WEB64_LOADER_DECODER_ADDRESS
lda #0
rts
__w64ld_exo_get_byte__image:
__w64ld_exo_get_byte = __w64ld_exo_get_byte__image - web64_loader_decoder_image + WEB64_LOADER_DECODER_ADDRESS
php
lda __w64loader_abort_requested
beq __w64ld_not_aborted__image
jmp __w64ld_unpack_bad
__w64ld_not_aborted__image:
__w64ld_not_aborted = __w64ld_not_aborted__image - web64_loader_decoder_image + WEB64_LOADER_DECODER_ADDRESS
lda __w64ld_input_left
bne __w64ld_input_low__image
lda __w64ld_input_left+1
bne __w64ld_input_high__image
jmp __w64ld_unpack_bad
__w64ld_input_high__image:
__w64ld_input_high = __w64ld_input_high__image - web64_loader_decoder_image + WEB64_LOADER_DECODER_ADDRESS
dec __w64ld_input_left+1
__w64ld_input_low__image:
__w64ld_input_low = __w64ld_input_low__image - web64_loader_decoder_image + WEB64_LOADER_DECODER_ADDRESS
dec __w64ld_input_left
lda __w64ld_exo_read+1
bne __w64ld_exo_get_dec_low__image
dec __w64ld_exo_read+2
__w64ld_exo_get_dec_low__image:
__w64ld_exo_get_dec_low = __w64ld_exo_get_dec_low__image - web64_loader_decoder_image + WEB64_LOADER_DECODER_ADDRESS
dec __w64ld_exo_read+1
__w64ld_exo_read__image:
__w64ld_exo_read = __w64ld_exo_read__image - web64_loader_decoder_image + WEB64_LOADER_DECODER_ADDRESS
lda $ffff
plp
rts
__w64ld_exo_get_bits__image:
__w64ld_exo_get_bits = __w64ld_exo_get_bits__image - web64_loader_decoder_image + WEB64_LOADER_DECODER_ADDRESS
adc #$80
asl
bpl __w64ld_exo_gb_skip__image
__w64ld_exo_gb_next__image:
__w64ld_exo_gb_next = __w64ld_exo_gb_next__image - web64_loader_decoder_image + WEB64_LOADER_DECODER_ADDRESS
asl $66
bne __w64ld_exo_gb_ok__image
pha
jsr __w64ld_exo_get_byte
rol
sta $66
pla
__w64ld_exo_gb_ok__image:
__w64ld_exo_gb_ok = __w64ld_exo_gb_ok__image - web64_loader_decoder_image + WEB64_LOADER_DECODER_ADDRESS
rol
bmi __w64ld_exo_gb_next__image
__w64ld_exo_gb_skip__image:
__w64ld_exo_gb_skip = __w64ld_exo_gb_skip__image - web64_loader_decoder_image + WEB64_LOADER_DECODER_ADDRESS
bvs __w64ld_exo_gb_get_hi__image
rts
__w64ld_exo_gb_get_hi__image:
__w64ld_exo_gb_get_hi = __w64ld_exo_gb_get_hi__image - web64_loader_decoder_image + WEB64_LOADER_DECODER_ADDRESS
sec
sta $64
jmp __w64ld_exo_get_byte
__w64ld_exo_decrunch__image:
__w64ld_exo_decrunch = __w64ld_exo_decrunch__image - web64_loader_decoder_image + WEB64_LOADER_DECODER_ADDRESS
ldx #3
__w64ld_exo_init_zp__image:
__w64ld_exo_init_zp = __w64ld_exo_init_zp__image - web64_loader_decoder_image + WEB64_LOADER_DECODER_ADDRESS
jsr __w64ld_exo_get_byte
sta $65,x
dex
bne __w64ld_exo_init_zp__image
; Stream trailer is checked by the container layer. Restore into scratch,
; never into the address named by untrusted stream bytes.
lda __w64ld_output_end
sta $67
lda __w64ld_output_end+1
sta $68
ldy #0
clc
__w64ld_exo_table_gen__image:
__w64ld_exo_table_gen = __w64ld_exo_table_gen__image - web64_loader_decoder_image + WEB64_LOADER_DECODER_ADDRESS
tax
tya
and #$0f
sta __w64ld_exo_table+52,y
beq __w64ld_exo_table_shortcut__image
txa
adc __w64ld_exo_table+51,y
sta __w64ld_exo_table+52,y
lda $61
adc __w64ld_exo_table+103,y
__w64ld_exo_table_shortcut__image:
__w64ld_exo_table_shortcut = __w64ld_exo_table_shortcut__image - web64_loader_decoder_image + WEB64_LOADER_DECODER_ADDRESS
sta __w64ld_exo_table+104,y
lda #1
sta $61
lda #$78
jsr __w64ld_exo_get_bits
lsr
tax
beq __w64ld_exo_rolled__image
php
__w64ld_exo_rolle__image:
__w64ld_exo_rolle = __w64ld_exo_rolle__image - web64_loader_decoder_image + WEB64_LOADER_DECODER_ADDRESS
asl $61
sec
ror
dex
bne __w64ld_exo_rolle__image
plp
__w64ld_exo_rolled__image:
__w64ld_exo_rolled = __w64ld_exo_rolled__image - web64_loader_decoder_image + WEB64_LOADER_DECODER_ADDRESS
ror
sta __w64ld_exo_table,y
bmi __w64ld_exo_no_fixup__image
lda $61
stx $61
.byte $24
__w64ld_exo_no_fixup__image:
__w64ld_exo_no_fixup = __w64ld_exo_no_fixup__image - web64_loader_decoder_image + WEB64_LOADER_DECODER_ADDRESS
txa
iny
cpy #52
bne __w64ld_exo_table_gen__image
ror $65
sec
ldy $67
stx $67
stx $64
__w64ld_exo_literal_start__image:
__w64ld_exo_literal_start = __w64ld_exo_literal_start__image - web64_loader_decoder_image + WEB64_LOADER_DECODER_ADDRESS
tya
bne __w64ld_exo_no_hi_decr__image
dec $68
dec $63
__w64ld_exo_no_hi_decr__image:
__w64ld_exo_no_hi_decr = __w64ld_exo_no_hi_decr__image - web64_loader_decoder_image + WEB64_LOADER_DECODER_ADDRESS
dey
jsr __w64ld_exo_get_byte
jsr __w64ld_checked_store
__w64ld_exo_next_round__image:
__w64ld_exo_next_round = __w64ld_exo_next_round__image - web64_loader_decoder_image + WEB64_LOADER_DECODER_ADDRESS
ror $65
dex
lda $66
__w64ld_exo_no_literal__image:
__w64ld_exo_no_literal = __w64ld_exo_no_literal__image - web64_loader_decoder_image + WEB64_LOADER_DECODER_ADDRESS
asl
bne __w64ld_exo_nofetch__image
jsr __w64ld_exo_get_byte
rol
__w64ld_exo_nofetch__image:
__w64ld_exo_nofetch = __w64ld_exo_nofetch__image - web64_loader_decoder_image + WEB64_LOADER_DECODER_ADDRESS
inx
bcc __w64ld_exo_no_literal__image
sta $66
beq __w64ld_exo_literal_start__image
cpx #$11
bcs __w64ld_exo_exit_or_literal__image
lda __w64ld_exo_table-1,x
jsr __w64ld_exo_get_bits
adc __w64ld_exo_table+51,x
sta $60
lda $64
adc __w64ld_exo_table+103,x
sta $61
ldx $60
lda #0
bit $65
bmi __w64ld_exo_test_reuse__image
__w64ld_exo_no_reuse__image:
__w64ld_exo_no_reuse = __w64ld_exo_no_reuse__image - web64_loader_decoder_image + WEB64_LOADER_DECODER_ADDRESS
sta $64
lda #$e1
cpx #3
bcs __w64ld_exo_offset_next__image
lda __w64ld_exo_table_bit-1,x
__w64ld_exo_offset_next__image:
__w64ld_exo_offset_next = __w64ld_exo_offset_next__image - web64_loader_decoder_image + WEB64_LOADER_DECODER_ADDRESS
asl $66
bne __w64ld_exo_offset_ok__image
tax
jsr __w64ld_exo_get_byte
rol
sta $66
txa
__w64ld_exo_offset_ok__image:
__w64ld_exo_offset_ok = __w64ld_exo_offset_ok__image - web64_loader_decoder_image + WEB64_LOADER_DECODER_ADDRESS
rol
bcs __w64ld_exo_offset_next__image
tax
lda __w64ld_exo_table,x
jsr __w64ld_exo_get_bits
adc __w64ld_exo_table+52,x
sta $62
lda $64
adc __w64ld_exo_table+104,x
adc $68
sta $63
ldx $60
__w64ld_copy_sequence__image:
__w64ld_copy_sequence = __w64ld_copy_sequence__image - web64_loader_decoder_image + WEB64_LOADER_DECODER_ADDRESS
jsr __w64ld_checked_sequence
__w64ld_exo_copy_next__image:
__w64ld_exo_copy_next = __w64ld_exo_copy_next__image - web64_loader_decoder_image + WEB64_LOADER_DECODER_ADDRESS
tya
bne __w64ld_exo_copy_skip_hi__image
dec $68
dec $63
__w64ld_exo_copy_skip_hi__image:
__w64ld_exo_copy_skip_hi = __w64ld_exo_copy_skip_hi__image - web64_loader_decoder_image + WEB64_LOADER_DECODER_ADDRESS
dey
bcs __w64ld_exo_get_literal__image
lda ($62),y
__w64ld_exo_literal_gotten__image:
__w64ld_exo_literal_gotten = __w64ld_exo_literal_gotten__image - web64_loader_decoder_image + WEB64_LOADER_DECODER_ADDRESS
; The complete bounded sequence was reserved before its first write.
sta ($67),y
dex
bne __w64ld_exo_copy_next__image
lda $61
stx $64
beq __w64ld_exo_next_round__image
dec $61
jmp __w64ld_exo_copy_next
__w64ld_exo_test_reuse__image:
__w64ld_exo_test_reuse = __w64ld_exo_test_reuse__image - web64_loader_decoder_image + WEB64_LOADER_DECODER_ADDRESS
bvs __w64ld_exo_no_reuse__image
asl $66
bne __w64ld_exo_reuse_ok__image
pha
jsr __w64ld_exo_get_byte
rol
sta $66
pla
__w64ld_exo_reuse_ok__image:
__w64ld_exo_reuse_ok = __w64ld_exo_reuse_ok__image - web64_loader_decoder_image + WEB64_LOADER_DECODER_ADDRESS
rol
beq __w64ld_exo_no_reuse__image
bne __w64ld_copy_sequence__image
__w64ld_exo_exit_or_literal__image:
__w64ld_exo_exit_or_literal = __w64ld_exo_exit_or_literal__image - web64_loader_decoder_image + WEB64_LOADER_DECODER_ADDRESS
beq __w64ld_exo_exit__image
jsr __w64ld_exo_get_byte
sta $61
jsr __w64ld_exo_get_byte
tax
stx $60
jsr __w64ld_checked_literals
bcs __w64ld_exo_copy_next__image
__w64ld_exo_exit__image:
__w64ld_exo_exit = __w64ld_exo_exit__image - web64_loader_decoder_image + WEB64_LOADER_DECODER_ADDRESS
rts
__w64ld_exo_get_literal__image:
__w64ld_exo_get_literal = __w64ld_exo_get_literal__image - web64_loader_decoder_image + WEB64_LOADER_DECODER_ADDRESS
jsr __w64ld_exo_get_byte
bcs __w64ld_exo_literal_gotten__image
__w64ld_exo_table_bit__image:
__w64ld_exo_table_bit = __w64ld_exo_table_bit__image - web64_loader_decoder_image + WEB64_LOADER_DECODER_ADDRESS
.byte $8c,$e2
__w64ld_exo_table__image:
__w64ld_exo_table = __w64ld_exo_table__image - web64_loader_decoder_image + WEB64_LOADER_DECODER_ADDRESS
.byte 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.byte 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.byte 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.byte 0,0,0,0
.byte 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.byte 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.byte 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.byte 0,0,0,0
.byte 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.byte 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.byte 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.byte 0,0,0,0
__w64ld_checked_store__image:
__w64ld_checked_store = __w64ld_checked_store__image - web64_loader_decoder_image + WEB64_LOADER_DECODER_ADDRESS
php
pha
lda __w64ld_output_left
bne __w64ld_output_low__image
lda __w64ld_output_left+1
beq __w64ld_unpack_bad__image
dec __w64ld_output_left+1
__w64ld_output_low__image:
__w64ld_output_low = __w64ld_output_low__image - web64_loader_decoder_image + WEB64_LOADER_DECODER_ADDRESS
dec __w64ld_output_left
pla
sta ($67),y
plp
rts
__w64ld_unpack_bad__image:
__w64ld_unpack_bad = __w64ld_unpack_bad__image - web64_loader_decoder_image + WEB64_LOADER_DECODER_ADDRESS
ldx __w64ld_unpack_sp
txs
lda #10
rts
__w64ld_unpack_sp__image:
__w64ld_unpack_sp = __w64ld_unpack_sp__image - web64_loader_decoder_image + WEB64_LOADER_DECODER_ADDRESS
.byte 0
__w64ld_source_end__image:
__w64ld_source_end = __w64ld_source_end__image - web64_loader_decoder_image + WEB64_LOADER_DECODER_ADDRESS
.word 0
__w64ld_input_left__image:
__w64ld_input_left = __w64ld_input_left__image - web64_loader_decoder_image + WEB64_LOADER_DECODER_ADDRESS
.word 0
__w64ld_output_left__image:
__w64ld_output_left = __w64ld_output_left__image - web64_loader_decoder_image + WEB64_LOADER_DECODER_ADDRESS
.word 0
; Validate once per match: source and destination descend together, so a
; positive, bounded history distance stays valid for every byte in the match.
; Compare one-past addresses before the copy loop decrements Y. Preserve X/Y/P.
__w64ld_checked_sequence__image:
__w64ld_checked_sequence = __w64ld_checked_sequence__image - web64_loader_decoder_image + WEB64_LOADER_DECODER_ADDRESS
php
lda $61
bne __w64ld_match_bad__image
lda $60
beq __w64ld_match_bad__image
tya
clc
adc $62
sta __w64ld_match_address
lda $63
adc #0
bcc __w64ld_match_no_wrap__image
; Exactly $10000 is a valid one-past bound, never an address to read.
ora __w64ld_match_address
ora __w64ld_output_end
ora __w64ld_output_end+1
beq __w64ld_match_ok__image
jmp __w64ld_unpack_bad
__w64ld_match_no_wrap__image:
__w64ld_match_no_wrap = __w64ld_match_no_wrap__image - web64_loader_decoder_image + WEB64_LOADER_DECODER_ADDRESS
sta __w64ld_match_address+1
cmp $68
bcc __w64ld_match_bad__image
bne __w64ld_match_after_cursor__image
tya
cmp __w64ld_match_address
bcs __w64ld_match_bad__image
__w64ld_match_after_cursor__image:
__w64ld_match_after_cursor = __w64ld_match_after_cursor__image - web64_loader_decoder_image + WEB64_LOADER_DECODER_ADDRESS
lda __w64ld_output_end
ora __w64ld_output_end+1
beq __w64ld_match_ok__image
lda __w64ld_match_address+1
cmp __w64ld_output_end+1
bcc __w64ld_match_ok__image
bne __w64ld_match_bad__image
lda __w64ld_match_address
cmp __w64ld_output_end
bcc __w64ld_match_ok__image
beq __w64ld_match_ok__image
__w64ld_match_bad__image:
__w64ld_match_bad = __w64ld_match_bad__image - web64_loader_decoder_image + WEB64_LOADER_DECODER_ADDRESS
jmp __w64ld_unpack_bad
__w64ld_match_ok__image:
__w64ld_match_ok = __w64ld_match_ok__image - web64_loader_decoder_image + WEB64_LOADER_DECODER_ADDRESS
jmp __w64ld_reserve_sequence
__w64ld_checked_literals__image:
__w64ld_checked_literals = __w64ld_checked_literals__image - web64_loader_decoder_image + WEB64_LOADER_DECODER_ADDRESS
php
; The IDE's P39/M255 encoder bounds literal runs as well as matches.
lda $61
bne __w64ld_match_bad__image
cpx #0
beq __w64ld_match_bad__image
__w64ld_reserve_sequence__image:
__w64ld_reserve_sequence = __w64ld_reserve_sequence__image - web64_loader_decoder_image + WEB64_LOADER_DECODER_ADDRESS
sec
lda __w64ld_output_left
sbc $60
sta __w64ld_output_left
lda __w64ld_output_left+1
sbc #0
bcc __w64ld_match_bad__image
sta __w64ld_output_left+1
plp
rts
__w64ld_output_end__image:
__w64ld_output_end = __w64ld_output_end__image - web64_loader_decoder_image + WEB64_LOADER_DECODER_ADDRESS
.word 0
__w64ld_match_address__image:
__w64ld_match_address = __w64ld_match_address__image - web64_loader_decoder_image + WEB64_LOADER_DECODER_ADDRESS
.word 0
__w64ld_end__image:
__w64ld_end = __w64ld_end__image - web64_loader_decoder_image + WEB64_LOADER_DECODER_ADDRESS
web64_loader_decoder_image_end:
web64_loader_decoder_image_size = web64_loader_decoder_image_end - web64_loader_decoder_image
web64/loader-packed-runtime.inc
Web64 SDK header <web64/loader-packed-runtime.inc>.
Header listing:
; Caller-owned RAM image: define WEB64_LOADER_PACKED_ADDRESS, include once and copy before use.
web64_loader_packed_image:
; Synchronous W64X checked installation. Caller owns bank configuration and IRQ.
; Fixed scratch: $fb-$fe and the decoder's separately registered $60-$68.
__w64lp_begin__image:
__w64lp_begin = __w64lp_begin__image - web64_loader_packed_image + WEB64_LOADER_PACKED_ADDRESS
; _web64_rt exact-width named argument window for web64_loader_unpack
_web64_loader_unpack__arg_window__image:
_web64_loader_unpack__arg_window = _web64_loader_unpack__arg_window__image - web64_loader_packed_image + WEB64_LOADER_PACKED_ADDRESS
_web64_loader_unpack__arg_window_size = 2
_web64_loader_unpack__arg0 = _web64_loader_unpack__arg_request
_web64_loader_unpack__arg_request__width = 2
_web64_loader_unpack__arg_request__offset = 0
_web64_loader_unpack__arg_request__image:
_web64_loader_unpack__arg_request = _web64_loader_unpack__arg_request__image - web64_loader_packed_image + WEB64_LOADER_PACKED_ADDRESS
__web64_fn_web64_loader_unpack_param_request_0__image:
__web64_fn_web64_loader_unpack_param_request_0 = __web64_fn_web64_loader_unpack_param_request_0__image - web64_loader_packed_image + WEB64_LOADER_PACKED_ADDRESS
.word 0
_web64_loader_unpack__image:
_web64_loader_unpack = _web64_loader_unpack__image - web64_loader_packed_image + WEB64_LOADER_PACKED_ADDRESS
cld
lda __w64loader_phase
beq __w64lp_idle__image
lda #15
rts
__w64lp_idle__image:
__w64lp_idle = __w64lp_idle__image - web64_loader_packed_image + WEB64_LOADER_PACKED_ADDRESS
lda #1
sta __w64loader_phase
lda #0
sta __w64loader_abort_requested
sta __w64loader_nested
__w64lp_from_load__image:
__w64lp_from_load = __w64lp_from_load__image - web64_loader_packed_image + WEB64_LOADER_PACKED_ADDRESS
lda _web64_loader_unpack__arg_request
sta $fb
lda _web64_loader_unpack__arg_request+1
sta $fb+1
ldy #12
__w64lp_read_request__image:
__w64lp_read_request = __w64lp_read_request__image - web64_loader_packed_image + WEB64_LOADER_PACKED_ADDRESS
lda ($fb),y
sta __w64lp_request,y
dey
bpl __w64lp_read_request__image
lda __w64lp_length
ora __w64lp_length+1
bne __w64loader_placed_packed_macro_1_ok__image
lda #8
jmp __w64lp_exit
__w64loader_placed_packed_macro_1_ok__image:
__w64loader_placed_packed_macro_1_ok = __w64loader_placed_packed_macro_1_ok__image - web64_loader_packed_image + WEB64_LOADER_PACKED_ADDRESS
lda __w64lp_stage+1
cmp #2
bcs __w64loader_placed_packed_macro_2_ok__image
lda #8
jmp __w64lp_exit
__w64loader_placed_packed_macro_2_ok__image:
__w64loader_placed_packed_macro_2_ok = __w64loader_placed_packed_macro_2_ok__image - web64_loader_packed_image + WEB64_LOADER_PACKED_ADDRESS
sec
lda __w64lp_length
sbc __w64lp_one
sta __w64lp_stage_end
lda __w64lp_length+1
sbc __w64lp_one+1
sta __w64lp_stage_end+1
clc
lda __w64lp_stage
adc __w64lp_stage_end
sta __w64lp_stage_end
lda __w64lp_stage+1
adc __w64lp_stage_end+1
sta __w64lp_stage_end+1
bcc __w64loader_placed_packed_macro_3_ok__image
lda #8
jmp __w64lp_exit
__w64loader_placed_packed_macro_3_ok__image:
__w64loader_placed_packed_macro_3_ok = __w64loader_placed_packed_macro_3_ok__image - web64_loader_packed_image + WEB64_LOADER_PACKED_ADDRESS
lda __w64lp_capacity
ora __w64lp_capacity+1
bne __w64loader_placed_packed_macro_4_ok__image
lda #8
jmp __w64lp_exit
__w64loader_placed_packed_macro_4_ok__image:
__w64loader_placed_packed_macro_4_ok = __w64loader_placed_packed_macro_4_ok__image - web64_loader_packed_image + WEB64_LOADER_PACKED_ADDRESS
lda __w64lp_destination+1
cmp #2
bcs __w64loader_placed_packed_macro_5_ok__image
lda #8
jmp __w64lp_exit
__w64loader_placed_packed_macro_5_ok__image:
__w64loader_placed_packed_macro_5_ok = __w64loader_placed_packed_macro_5_ok__image - web64_loader_packed_image + WEB64_LOADER_PACKED_ADDRESS
sec
lda __w64lp_capacity
sbc __w64lp_one
sta __w64lp_destination_end
lda __w64lp_capacity+1
sbc __w64lp_one+1
sta __w64lp_destination_end+1
clc
lda __w64lp_destination
adc __w64lp_destination_end
sta __w64lp_destination_end
lda __w64lp_destination+1
adc __w64lp_destination_end+1
sta __w64lp_destination_end+1
bcc __w64loader_placed_packed_macro_6_ok__image
lda #8
jmp __w64lp_exit
__w64loader_placed_packed_macro_6_ok__image:
__w64loader_placed_packed_macro_6_ok = __w64loader_placed_packed_macro_6_ok__image - web64_loader_packed_image + WEB64_LOADER_PACKED_ADDRESS
lda __w64lp_workspace_capacity
ora __w64lp_workspace_capacity+1
bne __w64loader_placed_packed_macro_7_ok__image
lda #8
jmp __w64lp_exit
__w64loader_placed_packed_macro_7_ok__image:
__w64loader_placed_packed_macro_7_ok = __w64loader_placed_packed_macro_7_ok__image - web64_loader_packed_image + WEB64_LOADER_PACKED_ADDRESS
lda __w64lp_workspace+1
cmp #2
bcs __w64loader_placed_packed_macro_8_ok__image
lda #8
jmp __w64lp_exit
__w64loader_placed_packed_macro_8_ok__image:
__w64loader_placed_packed_macro_8_ok = __w64loader_placed_packed_macro_8_ok__image - web64_loader_packed_image + WEB64_LOADER_PACKED_ADDRESS
sec
lda __w64lp_workspace_capacity
sbc __w64lp_one
sta __w64lp_workspace_end
lda __w64lp_workspace_capacity+1
sbc __w64lp_one+1
sta __w64lp_workspace_end+1
clc
lda __w64lp_workspace
adc __w64lp_workspace_end
sta __w64lp_workspace_end
lda __w64lp_workspace+1
adc __w64lp_workspace_end+1
sta __w64lp_workspace_end+1
bcc __w64loader_placed_packed_macro_9_ok__image
lda #8
jmp __w64lp_exit
__w64loader_placed_packed_macro_9_ok__image:
__w64loader_placed_packed_macro_9_ok = __w64loader_placed_packed_macro_9_ok__image - web64_loader_packed_image + WEB64_LOADER_PACKED_ADDRESS
lda __w64lp_stage_end+1
cmp __w64lp_destination+1
bne __w64loader_placed_packed_macro_11_done__image
lda __w64lp_stage_end
cmp __w64lp_destination
__w64loader_placed_packed_macro_11_done__image:
__w64loader_placed_packed_macro_11_done = __w64loader_placed_packed_macro_11_done__image - web64_loader_packed_image + WEB64_LOADER_PACKED_ADDRESS
bcc __w64loader_placed_packed_macro_10_ok__image
lda __w64lp_destination_end+1
cmp __w64lp_stage+1
bne __w64loader_placed_packed_macro_12_done__image
lda __w64lp_destination_end
cmp __w64lp_stage
__w64loader_placed_packed_macro_12_done__image:
__w64loader_placed_packed_macro_12_done = __w64loader_placed_packed_macro_12_done__image - web64_loader_packed_image + WEB64_LOADER_PACKED_ADDRESS
bcc __w64loader_placed_packed_macro_10_ok__image
lda #9
jmp __w64lp_exit
__w64loader_placed_packed_macro_10_ok__image:
__w64loader_placed_packed_macro_10_ok = __w64loader_placed_packed_macro_10_ok__image - web64_loader_packed_image + WEB64_LOADER_PACKED_ADDRESS
lda __w64lp_stage_end+1
cmp __w64lp_workspace+1
bne __w64loader_placed_packed_macro_14_done__image
lda __w64lp_stage_end
cmp __w64lp_workspace
__w64loader_placed_packed_macro_14_done__image:
__w64loader_placed_packed_macro_14_done = __w64loader_placed_packed_macro_14_done__image - web64_loader_packed_image + WEB64_LOADER_PACKED_ADDRESS
bcc __w64loader_placed_packed_macro_13_ok__image
lda __w64lp_workspace_end+1
cmp __w64lp_stage+1
bne __w64loader_placed_packed_macro_15_done__image
lda __w64lp_workspace_end
cmp __w64lp_stage
__w64loader_placed_packed_macro_15_done__image:
__w64loader_placed_packed_macro_15_done = __w64loader_placed_packed_macro_15_done__image - web64_loader_packed_image + WEB64_LOADER_PACKED_ADDRESS
bcc __w64loader_placed_packed_macro_13_ok__image
lda #9
jmp __w64lp_exit
__w64loader_placed_packed_macro_13_ok__image:
__w64loader_placed_packed_macro_13_ok = __w64loader_placed_packed_macro_13_ok__image - web64_loader_packed_image + WEB64_LOADER_PACKED_ADDRESS
lda __w64lp_workspace_end+1
cmp __w64lp_destination+1
bne __w64loader_placed_packed_macro_17_done__image
lda __w64lp_workspace_end
cmp __w64lp_destination
__w64loader_placed_packed_macro_17_done__image:
__w64loader_placed_packed_macro_17_done = __w64loader_placed_packed_macro_17_done__image - web64_loader_packed_image + WEB64_LOADER_PACKED_ADDRESS
bcc __w64loader_placed_packed_macro_16_ok__image
lda __w64lp_destination_end+1
cmp __w64lp_workspace+1
bne __w64loader_placed_packed_macro_18_done__image
lda __w64lp_destination_end
cmp __w64lp_workspace
__w64loader_placed_packed_macro_18_done__image:
__w64loader_placed_packed_macro_18_done = __w64loader_placed_packed_macro_18_done__image - web64_loader_packed_image + WEB64_LOADER_PACKED_ADDRESS
bcc __w64loader_placed_packed_macro_16_ok__image
lda #9
jmp __w64lp_exit
__w64loader_placed_packed_macro_16_ok__image:
__w64loader_placed_packed_macro_16_ok = __w64loader_placed_packed_macro_16_ok__image - web64_loader_packed_image + WEB64_LOADER_PACKED_ADDRESS
lda __w64lp_stage_end+1
cmp __w64lp_code_start+1
bne __w64loader_placed_packed_macro_20_done__image
lda __w64lp_stage_end
cmp __w64lp_code_start
__w64loader_placed_packed_macro_20_done__image:
__w64loader_placed_packed_macro_20_done = __w64loader_placed_packed_macro_20_done__image - web64_loader_packed_image + WEB64_LOADER_PACKED_ADDRESS
bcc __w64loader_placed_packed_macro_19_ok__image
lda __w64lp_code_last+1
cmp __w64lp_stage+1
bne __w64loader_placed_packed_macro_21_done__image
lda __w64lp_code_last
cmp __w64lp_stage
__w64loader_placed_packed_macro_21_done__image:
__w64loader_placed_packed_macro_21_done = __w64loader_placed_packed_macro_21_done__image - web64_loader_packed_image + WEB64_LOADER_PACKED_ADDRESS
bcc __w64loader_placed_packed_macro_19_ok__image
lda #9
jmp __w64lp_exit
__w64loader_placed_packed_macro_19_ok__image:
__w64loader_placed_packed_macro_19_ok = __w64loader_placed_packed_macro_19_ok__image - web64_loader_packed_image + WEB64_LOADER_PACKED_ADDRESS
lda __w64lp_destination_end+1
cmp __w64lp_code_start+1
bne __w64loader_placed_packed_macro_23_done__image
lda __w64lp_destination_end
cmp __w64lp_code_start
__w64loader_placed_packed_macro_23_done__image:
__w64loader_placed_packed_macro_23_done = __w64loader_placed_packed_macro_23_done__image - web64_loader_packed_image + WEB64_LOADER_PACKED_ADDRESS
bcc __w64loader_placed_packed_macro_22_ok__image
lda __w64lp_code_last+1
cmp __w64lp_destination+1
bne __w64loader_placed_packed_macro_24_done__image
lda __w64lp_code_last
cmp __w64lp_destination
__w64loader_placed_packed_macro_24_done__image:
__w64loader_placed_packed_macro_24_done = __w64loader_placed_packed_macro_24_done__image - web64_loader_packed_image + WEB64_LOADER_PACKED_ADDRESS
bcc __w64loader_placed_packed_macro_22_ok__image
lda #9
jmp __w64lp_exit
__w64loader_placed_packed_macro_22_ok__image:
__w64loader_placed_packed_macro_22_ok = __w64loader_placed_packed_macro_22_ok__image - web64_loader_packed_image + WEB64_LOADER_PACKED_ADDRESS
lda __w64lp_workspace_end+1
cmp __w64lp_code_start+1
bne __w64loader_placed_packed_macro_26_done__image
lda __w64lp_workspace_end
cmp __w64lp_code_start
__w64loader_placed_packed_macro_26_done__image:
__w64loader_placed_packed_macro_26_done = __w64loader_placed_packed_macro_26_done__image - web64_loader_packed_image + WEB64_LOADER_PACKED_ADDRESS
bcc __w64loader_placed_packed_macro_25_ok__image
lda __w64lp_code_last+1
cmp __w64lp_workspace+1
bne __w64loader_placed_packed_macro_27_done__image
lda __w64lp_code_last
cmp __w64lp_workspace
__w64loader_placed_packed_macro_27_done__image:
__w64loader_placed_packed_macro_27_done = __w64loader_placed_packed_macro_27_done__image - web64_loader_packed_image + WEB64_LOADER_PACKED_ADDRESS
bcc __w64loader_placed_packed_macro_25_ok__image
lda #9
jmp __w64lp_exit
__w64loader_placed_packed_macro_25_ok__image:
__w64loader_placed_packed_macro_25_ok = __w64loader_placed_packed_macro_25_ok__image - web64_loader_packed_image + WEB64_LOADER_PACKED_ADDRESS
lda __w64lp_stage_end+1
cmp __w64lp_decoder_start+1
bne __w64loader_placed_packed_macro_29_done__image
lda __w64lp_stage_end
cmp __w64lp_decoder_start
__w64loader_placed_packed_macro_29_done__image:
__w64loader_placed_packed_macro_29_done = __w64loader_placed_packed_macro_29_done__image - web64_loader_packed_image + WEB64_LOADER_PACKED_ADDRESS
bcc __w64loader_placed_packed_macro_28_ok__image
lda __w64lp_decoder_last+1
cmp __w64lp_stage+1
bne __w64loader_placed_packed_macro_30_done__image
lda __w64lp_decoder_last
cmp __w64lp_stage
__w64loader_placed_packed_macro_30_done__image:
__w64loader_placed_packed_macro_30_done = __w64loader_placed_packed_macro_30_done__image - web64_loader_packed_image + WEB64_LOADER_PACKED_ADDRESS
bcc __w64loader_placed_packed_macro_28_ok__image
lda #9
jmp __w64lp_exit
__w64loader_placed_packed_macro_28_ok__image:
__w64loader_placed_packed_macro_28_ok = __w64loader_placed_packed_macro_28_ok__image - web64_loader_packed_image + WEB64_LOADER_PACKED_ADDRESS
lda __w64lp_destination_end+1
cmp __w64lp_decoder_start+1
bne __w64loader_placed_packed_macro_32_done__image
lda __w64lp_destination_end
cmp __w64lp_decoder_start
__w64loader_placed_packed_macro_32_done__image:
__w64loader_placed_packed_macro_32_done = __w64loader_placed_packed_macro_32_done__image - web64_loader_packed_image + WEB64_LOADER_PACKED_ADDRESS
bcc __w64loader_placed_packed_macro_31_ok__image
lda __w64lp_decoder_last+1
cmp __w64lp_destination+1
bne __w64loader_placed_packed_macro_33_done__image
lda __w64lp_decoder_last
cmp __w64lp_destination
__w64loader_placed_packed_macro_33_done__image:
__w64loader_placed_packed_macro_33_done = __w64loader_placed_packed_macro_33_done__image - web64_loader_packed_image + WEB64_LOADER_PACKED_ADDRESS
bcc __w64loader_placed_packed_macro_31_ok__image
lda #9
jmp __w64lp_exit
__w64loader_placed_packed_macro_31_ok__image:
__w64loader_placed_packed_macro_31_ok = __w64loader_placed_packed_macro_31_ok__image - web64_loader_packed_image + WEB64_LOADER_PACKED_ADDRESS
lda __w64lp_workspace_end+1
cmp __w64lp_decoder_start+1
bne __w64loader_placed_packed_macro_35_done__image
lda __w64lp_workspace_end
cmp __w64lp_decoder_start
__w64loader_placed_packed_macro_35_done__image:
__w64loader_placed_packed_macro_35_done = __w64loader_placed_packed_macro_35_done__image - web64_loader_packed_image + WEB64_LOADER_PACKED_ADDRESS
bcc __w64loader_placed_packed_macro_34_ok__image
lda __w64lp_decoder_last+1
cmp __w64lp_workspace+1
bne __w64loader_placed_packed_macro_36_done__image
lda __w64lp_decoder_last
cmp __w64lp_workspace
__w64loader_placed_packed_macro_36_done__image:
__w64loader_placed_packed_macro_36_done = __w64loader_placed_packed_macro_36_done__image - web64_loader_packed_image + WEB64_LOADER_PACKED_ADDRESS
bcc __w64loader_placed_packed_macro_34_ok__image
lda #9
jmp __w64lp_exit
__w64loader_placed_packed_macro_34_ok__image:
__w64loader_placed_packed_macro_34_ok = __w64loader_placed_packed_macro_34_ok__image - web64_loader_packed_image + WEB64_LOADER_PACKED_ADDRESS
lda __w64lp_length+1
bne __w64lp_header_size_ok__image
lda __w64lp_length
cmp #23
bcs __w64loader_placed_packed_macro_37_ok__image
lda #6
jmp __w64lp_exit
__w64loader_placed_packed_macro_37_ok__image:
__w64loader_placed_packed_macro_37_ok = __w64loader_placed_packed_macro_37_ok__image - web64_loader_packed_image + WEB64_LOADER_PACKED_ADDRESS
__w64lp_header_size_ok__image:
__w64lp_header_size_ok = __w64lp_header_size_ok__image - web64_loader_packed_image + WEB64_LOADER_PACKED_ADDRESS
lda __w64lp_stage
sta $fb
lda __w64lp_stage+1
sta $fb+1
ldy #4
__w64lp_magic_loop__image:
__w64lp_magic_loop = __w64lp_magic_loop__image - web64_loader_packed_image + WEB64_LOADER_PACKED_ADDRESS
lda ($fb),y
cmp __w64lp_magic,y
beq __w64loader_placed_packed_macro_38_ok__image
lda #4
jmp __w64lp_exit
__w64loader_placed_packed_macro_38_ok__image:
__w64loader_placed_packed_macro_38_ok = __w64loader_placed_packed_macro_38_ok__image - web64_loader_packed_image + WEB64_LOADER_PACKED_ADDRESS
dey
bpl __w64lp_magic_loop__image
ldy #5
lda ($fb),y
sta __w64lp_count
bne __w64loader_placed_packed_macro_39_ok__image
lda #4
jmp __w64lp_exit
__w64loader_placed_packed_macro_39_ok__image:
__w64loader_placed_packed_macro_39_ok = __w64loader_placed_packed_macro_39_ok__image - web64_loader_packed_image + WEB64_LOADER_PACKED_ADDRESS
cmp #65
bcc __w64loader_placed_packed_macro_40_ok__image
lda #4
jmp __w64lp_exit
__w64loader_placed_packed_macro_40_ok__image:
__w64loader_placed_packed_macro_40_ok = __w64loader_placed_packed_macro_40_ok__image - web64_loader_packed_image + WEB64_LOADER_PACKED_ADDRESS
lda __w64lp_block
cmp #255
beq __w64lp_selection_ok__image
cmp __w64lp_count
bcc __w64loader_placed_packed_macro_41_ok__image
lda #13
jmp __w64lp_exit
__w64loader_placed_packed_macro_41_ok__image:
__w64loader_placed_packed_macro_41_ok = __w64loader_placed_packed_macro_41_ok__image - web64_loader_packed_image + WEB64_LOADER_PACKED_ADDRESS
__w64lp_selection_ok__image:
__w64lp_selection_ok = __w64lp_selection_ok__image - web64_loader_packed_image + WEB64_LOADER_PACKED_ADDRESS
ldy #6
lda ($fb),y
cmp __w64lp_length
beq __w64loader_placed_packed_macro_42_ok__image
lda #6
jmp __w64lp_exit
__w64loader_placed_packed_macro_42_ok__image:
__w64loader_placed_packed_macro_42_ok = __w64loader_placed_packed_macro_42_ok__image - web64_loader_packed_image + WEB64_LOADER_PACKED_ADDRESS
iny
lda ($fb),y
cmp __w64lp_length+1
beq __w64loader_placed_packed_macro_43_ok__image
lda #6
jmp __w64lp_exit
__w64loader_placed_packed_macro_43_ok__image:
__w64loader_placed_packed_macro_43_ok = __w64loader_placed_packed_macro_43_ok__image - web64_loader_packed_image + WEB64_LOADER_PACKED_ADDRESS
sec
lda __w64lp_length
sbc __w64lp_two
sta __w64lp_crc_length
lda __w64lp_length+1
sbc __w64lp_two+1
sta __w64lp_crc_length+1
lda __w64lp_crc_length
sta __w64lp_payload_end
lda __w64lp_crc_length+1
sta __w64lp_payload_end+1
jsr __w64lp_crc
ldy #0
lda ($fb),y
cmp __w64lp_crc_value
beq __w64loader_placed_packed_macro_44_ok__image
lda #5
jmp __w64lp_exit
__w64loader_placed_packed_macro_44_ok__image:
__w64loader_placed_packed_macro_44_ok = __w64loader_placed_packed_macro_44_ok__image - web64_loader_packed_image + WEB64_LOADER_PACKED_ADDRESS
iny
lda ($fb),y
cmp __w64lp_crc_value+1
beq __w64loader_placed_packed_macro_45_ok__image
lda #5
jmp __w64lp_exit
__w64loader_placed_packed_macro_45_ok__image:
__w64loader_placed_packed_macro_45_ok = __w64loader_placed_packed_macro_45_ok__image - web64_loader_packed_image + WEB64_LOADER_PACKED_ADDRESS
lda #<(8)
sta __w64lp_next_offset
lda #>(8)
sta __w64lp_next_offset+1
ldx __w64lp_count
__w64lp_directory_size__image:
__w64lp_directory_size = __w64lp_directory_size__image - web64_loader_packed_image + WEB64_LOADER_PACKED_ADDRESS
clc
lda __w64lp_next_offset
adc __w64lp_record_size
sta __w64lp_next_offset
lda __w64lp_next_offset+1
adc __w64lp_record_size+1
sta __w64lp_next_offset+1
dex
bne __w64lp_directory_size__image
lda __w64lp_next_offset+1
cmp __w64lp_payload_end+1
bne __w64loader_placed_packed_macro_46_done__image
lda __w64lp_next_offset
cmp __w64lp_payload_end
__w64loader_placed_packed_macro_46_done__image:
__w64loader_placed_packed_macro_46_done = __w64loader_placed_packed_macro_46_done__image - web64_loader_packed_image + WEB64_LOADER_PACKED_ADDRESS
bcc __w64loader_placed_packed_macro_47_ok__image
lda #6
jmp __w64lp_exit
__w64loader_placed_packed_macro_47_ok__image:
__w64loader_placed_packed_macro_47_ok = __w64loader_placed_packed_macro_47_ok__image - web64_loader_packed_image + WEB64_LOADER_PACKED_ADDRESS
lda #<(0)
sta __w64lp_used
lda #>(0)
sta __w64lp_used+1
lda #0
sta __w64lp_index
__w64lp_validate_record__image:
__w64lp_validate_record = __w64lp_validate_record__image - web64_loader_packed_image + WEB64_LOADER_PACKED_ADDRESS
jsr __w64lp_record
lda __w64lp_decoded_length
ora __w64lp_decoded_length+1
bne __w64loader_placed_packed_macro_48_ok__image
lda #7
jmp __w64lp_exit
__w64loader_placed_packed_macro_48_ok__image:
__w64loader_placed_packed_macro_48_ok = __w64loader_placed_packed_macro_48_ok__image - web64_loader_packed_image + WEB64_LOADER_PACKED_ADDRESS
sec
lda __w64lp_decoded_length
sbc __w64lp_one
sta __w64lp_decoded_end
lda __w64lp_decoded_length+1
sbc __w64lp_one+1
sta __w64lp_decoded_end+1
clc
lda __w64lp_decoded_end
adc __w64lp_record_destination
sta __w64lp_decoded_end
lda __w64lp_decoded_end+1
adc __w64lp_record_destination+1
sta __w64lp_decoded_end+1
bcc __w64loader_placed_packed_macro_49_ok__image
lda #7
jmp __w64lp_exit
__w64loader_placed_packed_macro_49_ok__image:
__w64loader_placed_packed_macro_49_ok = __w64loader_placed_packed_macro_49_ok__image - web64_loader_packed_image + WEB64_LOADER_PACKED_ADDRESS
lda __w64lp_record_offset+1
cmp __w64lp_next_offset+1
bne __w64loader_placed_packed_macro_50_done__image
lda __w64lp_record_offset
cmp __w64lp_next_offset
__w64loader_placed_packed_macro_50_done__image:
__w64loader_placed_packed_macro_50_done = __w64loader_placed_packed_macro_50_done__image - web64_loader_packed_image + WEB64_LOADER_PACKED_ADDRESS
beq __w64loader_placed_packed_macro_51_ok__image
lda #6
jmp __w64lp_exit
__w64loader_placed_packed_macro_51_ok__image:
__w64loader_placed_packed_macro_51_ok = __w64loader_placed_packed_macro_51_ok__image - web64_loader_packed_image + WEB64_LOADER_PACKED_ADDRESS
lda __w64lp_packed_length+1
bne __w64lp_stream_min_ok__image
lda __w64lp_packed_length
cmp #3
bcs __w64loader_placed_packed_macro_52_ok__image
lda #6
jmp __w64lp_exit
__w64loader_placed_packed_macro_52_ok__image:
__w64loader_placed_packed_macro_52_ok = __w64loader_placed_packed_macro_52_ok__image - web64_loader_packed_image + WEB64_LOADER_PACKED_ADDRESS
__w64lp_stream_min_ok__image:
__w64lp_stream_min_ok = __w64lp_stream_min_ok__image - web64_loader_packed_image + WEB64_LOADER_PACKED_ADDRESS
clc
lda __w64lp_next_offset
adc __w64lp_packed_length
sta __w64lp_next_offset
lda __w64lp_next_offset+1
adc __w64lp_packed_length+1
sta __w64lp_next_offset+1
bcc __w64loader_placed_packed_macro_53_ok__image
lda #6
jmp __w64lp_exit
__w64loader_placed_packed_macro_53_ok__image:
__w64loader_placed_packed_macro_53_ok = __w64loader_placed_packed_macro_53_ok__image - web64_loader_packed_image + WEB64_LOADER_PACKED_ADDRESS
lda __w64lp_payload_end+1
cmp __w64lp_next_offset+1
bne __w64loader_placed_packed_macro_54_done__image
lda __w64lp_payload_end
cmp __w64lp_next_offset
__w64loader_placed_packed_macro_54_done__image:
__w64loader_placed_packed_macro_54_done = __w64loader_placed_packed_macro_54_done__image - web64_loader_packed_image + WEB64_LOADER_PACKED_ADDRESS
bcs __w64loader_placed_packed_macro_55_ok__image
lda #6
jmp __w64lp_exit
__w64loader_placed_packed_macro_55_ok__image:
__w64loader_placed_packed_macro_55_ok = __w64loader_placed_packed_macro_55_ok__image - web64_loader_packed_image + WEB64_LOADER_PACKED_ADDRESS
sec
lda __w64lp_next_offset
sbc __w64lp_two
sta $fb
lda __w64lp_next_offset+1
sbc __w64lp_two+1
sta $fb+1
clc
lda $fb
adc __w64lp_stage
sta $fb
lda $fb+1
adc __w64lp_stage+1
sta $fb+1
clc
lda __w64lp_decoded_end
adc __w64lp_one
sta __w64lp_decoded_after
lda __w64lp_decoded_end+1
adc __w64lp_one+1
sta __w64lp_decoded_after+1
ldy #0
lda ($fb),y
cmp __w64lp_decoded_after
beq __w64loader_placed_packed_macro_56_ok__image
lda #4
jmp __w64lp_exit
__w64loader_placed_packed_macro_56_ok__image:
__w64loader_placed_packed_macro_56_ok = __w64loader_placed_packed_macro_56_ok__image - web64_loader_packed_image + WEB64_LOADER_PACKED_ADDRESS
iny
lda ($fb),y
cmp __w64lp_decoded_after+1
beq __w64loader_placed_packed_macro_57_ok__image
lda #4
jmp __w64lp_exit
__w64loader_placed_packed_macro_57_ok__image:
__w64loader_placed_packed_macro_57_ok = __w64loader_placed_packed_macro_57_ok__image - web64_loader_packed_image + WEB64_LOADER_PACKED_ADDRESS
jsr __w64lp_selected
bne __w64lp_validated_record__image
lda __w64lp_record_destination+1
cmp __w64lp_destination+1
bne __w64loader_placed_packed_macro_58_done__image
lda __w64lp_record_destination
cmp __w64lp_destination
__w64loader_placed_packed_macro_58_done__image:
__w64loader_placed_packed_macro_58_done = __w64loader_placed_packed_macro_58_done__image - web64_loader_packed_image + WEB64_LOADER_PACKED_ADDRESS
bcs __w64loader_placed_packed_macro_59_ok__image
lda #8
jmp __w64lp_exit
__w64loader_placed_packed_macro_59_ok__image:
__w64loader_placed_packed_macro_59_ok = __w64loader_placed_packed_macro_59_ok__image - web64_loader_packed_image + WEB64_LOADER_PACKED_ADDRESS
lda __w64lp_destination_end+1
cmp __w64lp_decoded_end+1
bne __w64loader_placed_packed_macro_60_done__image
lda __w64lp_destination_end
cmp __w64lp_decoded_end
__w64loader_placed_packed_macro_60_done__image:
__w64loader_placed_packed_macro_60_done = __w64loader_placed_packed_macro_60_done__image - web64_loader_packed_image + WEB64_LOADER_PACKED_ADDRESS
bcs __w64loader_placed_packed_macro_61_ok__image
lda #8
jmp __w64lp_exit
__w64loader_placed_packed_macro_61_ok__image:
__w64loader_placed_packed_macro_61_ok = __w64loader_placed_packed_macro_61_ok__image - web64_loader_packed_image + WEB64_LOADER_PACKED_ADDRESS
clc
lda __w64lp_used
adc __w64lp_decoded_length
sta __w64lp_used
lda __w64lp_used+1
adc __w64lp_decoded_length+1
sta __w64lp_used+1
bcc __w64loader_placed_packed_macro_62_ok__image
lda #9
jmp __w64lp_exit
__w64loader_placed_packed_macro_62_ok__image:
__w64loader_placed_packed_macro_62_ok = __w64loader_placed_packed_macro_62_ok__image - web64_loader_packed_image + WEB64_LOADER_PACKED_ADDRESS
lda __w64lp_workspace_capacity+1
cmp __w64lp_used+1
bne __w64loader_placed_packed_macro_63_done__image
lda __w64lp_workspace_capacity
cmp __w64lp_used
__w64loader_placed_packed_macro_63_done__image:
__w64loader_placed_packed_macro_63_done = __w64loader_placed_packed_macro_63_done__image - web64_loader_packed_image + WEB64_LOADER_PACKED_ADDRESS
bcs __w64loader_placed_packed_macro_64_ok__image
lda #9
jmp __w64lp_exit
__w64loader_placed_packed_macro_64_ok__image:
__w64loader_placed_packed_macro_64_ok = __w64loader_placed_packed_macro_64_ok__image - web64_loader_packed_image + WEB64_LOADER_PACKED_ADDRESS
__w64lp_validated_record__image:
__w64lp_validated_record = __w64lp_validated_record__image - web64_loader_packed_image + WEB64_LOADER_PACKED_ADDRESS
inc __w64lp_index
lda __w64lp_index
cmp __w64lp_count
beq __w64lp_records_valid__image
jmp __w64lp_validate_record
__w64lp_records_valid__image:
__w64lp_records_valid = __w64lp_records_valid__image - web64_loader_packed_image + WEB64_LOADER_PACKED_ADDRESS
lda __w64lp_next_offset+1
cmp __w64lp_payload_end+1
bne __w64loader_placed_packed_macro_65_done__image
lda __w64lp_next_offset
cmp __w64lp_payload_end
__w64loader_placed_packed_macro_65_done__image:
__w64loader_placed_packed_macro_65_done = __w64loader_placed_packed_macro_65_done__image - web64_loader_packed_image + WEB64_LOADER_PACKED_ADDRESS
beq __w64loader_placed_packed_macro_66_ok__image
lda #6
jmp __w64lp_exit
__w64loader_placed_packed_macro_66_ok__image:
__w64loader_placed_packed_macro_66_ok = __w64loader_placed_packed_macro_66_ok__image - web64_loader_packed_image + WEB64_LOADER_PACKED_ADDRESS
lda __w64lp_workspace
sta __w64lp_work_cursor
lda __w64lp_workspace+1
sta __w64lp_work_cursor+1
lda #0
sta __w64lp_index
__w64lp_decode_record__image:
__w64lp_decode_record = __w64lp_decode_record__image - web64_loader_packed_image + WEB64_LOADER_PACKED_ADDRESS
jsr __w64lp_selected
beq __w64lp_decode_selected__image
jmp __w64lp_decoded_record
__w64lp_decode_selected__image:
__w64lp_decode_selected = __w64lp_decode_selected__image - web64_loader_packed_image + WEB64_LOADER_PACKED_ADDRESS
jsr __w64lp_record
clc
lda __w64lp_record_offset
adc __w64lp_packed_length
sta __w64ld_source_end
lda __w64lp_record_offset+1
adc __w64lp_packed_length+1
sta __w64ld_source_end+1
clc
lda __w64ld_source_end
adc __w64lp_stage
sta __w64ld_source_end
lda __w64ld_source_end+1
adc __w64lp_stage+1
sta __w64ld_source_end+1
lda __w64lp_packed_length
sta __w64ld_input_left
lda __w64lp_packed_length+1
sta __w64ld_input_left+1
lda __w64lp_decoded_length
sta __w64ld_output_left
lda __w64lp_decoded_length+1
sta __w64ld_output_left+1
clc
lda __w64lp_work_cursor
adc __w64lp_decoded_length
sta __w64ld_output_end
lda __w64lp_work_cursor+1
adc __w64lp_decoded_length+1
sta __w64ld_output_end+1
jsr __w64ld_unpack
beq __w64loader_placed_packed_macro_67_ok__image
lda #10
jmp __w64lp_exit
__w64loader_placed_packed_macro_67_ok__image:
__w64loader_placed_packed_macro_67_ok = __w64loader_placed_packed_macro_67_ok__image - web64_loader_packed_image + WEB64_LOADER_PACKED_ADDRESS
lda __w64ld_input_left
ora __w64ld_input_left+1
beq __w64loader_placed_packed_macro_68_ok__image
lda #10
jmp __w64lp_exit
__w64loader_placed_packed_macro_68_ok__image:
__w64loader_placed_packed_macro_68_ok = __w64loader_placed_packed_macro_68_ok__image - web64_loader_packed_image + WEB64_LOADER_PACKED_ADDRESS
lda __w64lp_work_cursor
sta $fb
lda __w64lp_work_cursor+1
sta $fb+1
lda __w64lp_decoded_length
sta __w64lp_crc_length
lda __w64lp_decoded_length+1
sta __w64lp_crc_length+1
jsr __w64lp_crc
lda __w64lp_crc_value+1
cmp __w64lp_decoded_crc+1
bne __w64loader_placed_packed_macro_69_done__image
lda __w64lp_crc_value
cmp __w64lp_decoded_crc
__w64loader_placed_packed_macro_69_done__image:
__w64loader_placed_packed_macro_69_done = __w64loader_placed_packed_macro_69_done__image - web64_loader_packed_image + WEB64_LOADER_PACKED_ADDRESS
beq __w64loader_placed_packed_macro_70_ok__image
lda #5
jmp __w64lp_exit
__w64loader_placed_packed_macro_70_ok__image:
__w64loader_placed_packed_macro_70_ok = __w64loader_placed_packed_macro_70_ok__image - web64_loader_packed_image + WEB64_LOADER_PACKED_ADDRESS
lda $fb
sta __w64lp_work_cursor
lda $fb+1
sta __w64lp_work_cursor+1
__w64lp_decoded_record__image:
__w64lp_decoded_record = __w64lp_decoded_record__image - web64_loader_packed_image + WEB64_LOADER_PACKED_ADDRESS
inc __w64lp_index
lda __w64lp_index
cmp __w64lp_count
beq __w64lp_decode_complete__image
jmp __w64lp_decode_record
__w64lp_decode_complete__image:
__w64lp_decode_complete = __w64lp_decode_complete__image - web64_loader_packed_image + WEB64_LOADER_PACKED_ADDRESS
; Transaction boundary: all requested decoded CRCs are now verified.
; No fallible validation/decompression remains after the first live write.
; Atomically close the abort window without changing the caller's I flag.
php
sei
lda __w64loader_abort_requested
beq __w64lp_commit_allowed__image
plp
lda #11
jmp __w64lp_exit
__w64lp_commit_allowed__image:
__w64lp_commit_allowed = __w64lp_commit_allowed__image - web64_loader_packed_image + WEB64_LOADER_PACKED_ADDRESS
lda #2
sta __w64loader_phase
plp
lda __w64lp_workspace
sta __w64lp_work_cursor
lda __w64lp_workspace+1
sta __w64lp_work_cursor+1
lda #0
sta __w64lp_index
__w64lp_commit_record__image:
__w64lp_commit_record = __w64lp_commit_record__image - web64_loader_packed_image + WEB64_LOADER_PACKED_ADDRESS
jsr __w64lp_selected
bne __w64lp_committed_record__image
jsr __w64lp_record
lda __w64lp_work_cursor
sta $fb
lda __w64lp_work_cursor+1
sta $fb+1
lda __w64lp_record_destination
sta $fd
lda __w64lp_record_destination+1
sta $fd+1
ldy #0
ldx __w64lp_decoded_length+1
beq __w64lp_copy_tail__image
__w64lp_copy_page__image:
__w64lp_copy_page = __w64lp_copy_page__image - web64_loader_packed_image + WEB64_LOADER_PACKED_ADDRESS
lda ($fb),y
sta ($fd),y
iny
bne __w64lp_copy_page__image
inc $fc
inc $fe
dex
bne __w64lp_copy_page__image
__w64lp_copy_tail__image:
__w64lp_copy_tail = __w64lp_copy_tail__image - web64_loader_packed_image + WEB64_LOADER_PACKED_ADDRESS
ldx __w64lp_decoded_length
beq __w64lp_copy_done__image
__w64lp_copy_byte__image:
__w64lp_copy_byte = __w64lp_copy_byte__image - web64_loader_packed_image + WEB64_LOADER_PACKED_ADDRESS
lda ($fb),y
sta ($fd),y
iny
dex
bne __w64lp_copy_byte__image
__w64lp_copy_done__image:
__w64lp_copy_done = __w64lp_copy_done__image - web64_loader_packed_image + WEB64_LOADER_PACKED_ADDRESS
clc
lda __w64lp_work_cursor
adc __w64lp_decoded_length
sta __w64lp_work_cursor
lda __w64lp_work_cursor+1
adc __w64lp_decoded_length+1
sta __w64lp_work_cursor+1
__w64lp_committed_record__image:
__w64lp_committed_record = __w64lp_committed_record__image - web64_loader_packed_image + WEB64_LOADER_PACKED_ADDRESS
inc __w64lp_index
lda __w64lp_index
cmp __w64lp_count
bne __w64lp_commit_record__image
lda #0
__w64lp_exit__image:
__w64lp_exit = __w64lp_exit__image - web64_loader_packed_image + WEB64_LOADER_PACKED_ADDRESS
sta __w64loader_status
cmp #0
beq __w64lp_exit_status__image
lda __w64loader_abort_requested
beq __w64lp_exit_status__image
lda #11
sta __w64loader_status
__w64lp_exit_status__image:
__w64lp_exit_status = __w64lp_exit_status__image - web64_loader_packed_image + WEB64_LOADER_PACKED_ADDRESS
lda #0
sta __w64loader_phase
lda __w64loader_status
rts
; Z set for ALL or the requested block; otherwise Z clear.
__w64lp_selected__image:
__w64lp_selected = __w64lp_selected__image - web64_loader_packed_image + WEB64_LOADER_PACKED_ADDRESS
lda __w64lp_block
cmp #255
beq __w64lp_selected_return__image
cmp __w64lp_index
__w64lp_selected_return__image:
__w64lp_selected_return = __w64lp_selected_return__image - web64_loader_packed_image + WEB64_LOADER_PACKED_ADDRESS
rts
__w64lp_record__image:
__w64lp_record = __w64lp_record__image - web64_loader_packed_image + WEB64_LOADER_PACKED_ADDRESS
clc
lda __w64lp_stage
adc __w64lp_header_size
sta $fb
lda __w64lp_stage+1
adc __w64lp_header_size+1
sta $fb+1
ldx __w64lp_index
beq __w64lp_record_read__image
__w64lp_record_seek__image:
__w64lp_record_seek = __w64lp_record_seek__image - web64_loader_packed_image + WEB64_LOADER_PACKED_ADDRESS
clc
lda $fb
adc __w64lp_record_size
sta $fb
lda $fb+1
adc __w64lp_record_size+1
sta $fb+1
dex
bne __w64lp_record_seek__image
__w64lp_record_read__image:
__w64lp_record_read = __w64lp_record_read__image - web64_loader_packed_image + WEB64_LOADER_PACKED_ADDRESS
ldy #9
__w64lp_record_read_loop__image:
__w64lp_record_read_loop = __w64lp_record_read_loop__image - web64_loader_packed_image + WEB64_LOADER_PACKED_ADDRESS
lda ($fb),y
sta __w64lp_record_data,y
dey
bpl __w64lp_record_read_loop__image
rts
__w64lp_crc__image:
__w64lp_crc = __w64lp_crc__image - web64_loader_packed_image + WEB64_LOADER_PACKED_ADDRESS
lda #0
sta __w64lp_crc_hi_page+1
sta __w64lp_crc_lo_page+1
ldy #0
lda __w64lp_crc_length+1
beq __w64lp_crc_tail_setup__image
__w64lp_crc_page__image:
__w64lp_crc_page = __w64lp_crc_page__image - web64_loader_packed_image + WEB64_LOADER_PACKED_ADDRESS
; Four-byte page kernel: CRC state travels through immediate operands.
; Each page is exactly 256 bytes; the bounded tail remains bytewise.
lda ($fb),y
__w64lp_crc_hi_page__image:
__w64lp_crc_hi_page = __w64lp_crc_hi_page__image - web64_loader_packed_image + WEB64_LOADER_PACKED_ADDRESS
eor #0
tax
__w64lp_crc_lo_page__image:
__w64lp_crc_lo_page = __w64lp_crc_lo_page__image - web64_loader_packed_image + WEB64_LOADER_PACKED_ADDRESS
lda #0
eor __w64lp_crc_high,x
sta __w64lp_crc_hi_p1+1
lda __w64lp_crc_low,x
sta __w64lp_crc_lo_p1+1
iny
lda ($fb),y
__w64lp_crc_hi_p1__image:
__w64lp_crc_hi_p1 = __w64lp_crc_hi_p1__image - web64_loader_packed_image + WEB64_LOADER_PACKED_ADDRESS
eor #0
tax
__w64lp_crc_lo_p1__image:
__w64lp_crc_lo_p1 = __w64lp_crc_lo_p1__image - web64_loader_packed_image + WEB64_LOADER_PACKED_ADDRESS
lda #0
eor __w64lp_crc_high,x
sta __w64lp_crc_hi_p2+1
lda __w64lp_crc_low,x
sta __w64lp_crc_lo_p2+1
iny
lda ($fb),y
__w64lp_crc_hi_p2__image:
__w64lp_crc_hi_p2 = __w64lp_crc_hi_p2__image - web64_loader_packed_image + WEB64_LOADER_PACKED_ADDRESS
eor #0
tax
__w64lp_crc_lo_p2__image:
__w64lp_crc_lo_p2 = __w64lp_crc_lo_p2__image - web64_loader_packed_image + WEB64_LOADER_PACKED_ADDRESS
lda #0
eor __w64lp_crc_high,x
sta __w64lp_crc_hi_p3+1
lda __w64lp_crc_low,x
sta __w64lp_crc_lo_p3+1
iny
lda ($fb),y
__w64lp_crc_hi_p3__image:
__w64lp_crc_hi_p3 = __w64lp_crc_hi_p3__image - web64_loader_packed_image + WEB64_LOADER_PACKED_ADDRESS
eor #0
tax
__w64lp_crc_lo_p3__image:
__w64lp_crc_lo_p3 = __w64lp_crc_lo_p3__image - web64_loader_packed_image + WEB64_LOADER_PACKED_ADDRESS
lda #0
eor __w64lp_crc_high,x
sta __w64lp_crc_hi_page+1
lda __w64lp_crc_low,x
sta __w64lp_crc_lo_page+1
iny
bne __w64lp_crc_page__image
inc $fc
dec __w64lp_crc_length+1
bne __w64lp_crc_page__image
__w64lp_crc_tail_setup__image:
__w64lp_crc_tail_setup = __w64lp_crc_tail_setup__image - web64_loader_packed_image + WEB64_LOADER_PACKED_ADDRESS
lda __w64lp_crc_hi_page+1
sta __w64lp_crc_hi_tail+1
lda __w64lp_crc_lo_page+1
sta __w64lp_crc_lo_tail+1
cpy __w64lp_crc_length
beq __w64lp_crc_done__image
__w64lp_crc_byte__image:
__w64lp_crc_byte = __w64lp_crc_byte__image - web64_loader_packed_image + WEB64_LOADER_PACKED_ADDRESS
lda ($fb),y
__w64lp_crc_hi_tail__image:
__w64lp_crc_hi_tail = __w64lp_crc_hi_tail__image - web64_loader_packed_image + WEB64_LOADER_PACKED_ADDRESS
eor #0
tax
__w64lp_crc_lo_tail__image:
__w64lp_crc_lo_tail = __w64lp_crc_lo_tail__image - web64_loader_packed_image + WEB64_LOADER_PACKED_ADDRESS
lda #0
eor __w64lp_crc_high,x
sta __w64lp_crc_hi_tail+1
lda __w64lp_crc_low,x
sta __w64lp_crc_lo_tail+1
iny
cpy __w64lp_crc_length
bne __w64lp_crc_byte__image
__w64lp_crc_done__image:
__w64lp_crc_done = __w64lp_crc_done__image - web64_loader_packed_image + WEB64_LOADER_PACKED_ADDRESS
lda __w64lp_crc_hi_tail+1
sta __w64lp_crc_value+1
lda __w64lp_crc_lo_tail+1
sta __w64lp_crc_value
tya
clc
adc $fb
sta $fb
bcc __w64lp_crc_return__image
inc $fc
__w64lp_crc_return__image:
__w64lp_crc_return = __w64lp_crc_return__image - web64_loader_packed_image + WEB64_LOADER_PACKED_ADDRESS
rts
__w64lp_magic__image:
__w64lp_magic = __w64lp_magic__image - web64_loader_packed_image + WEB64_LOADER_PACKED_ADDRESS
.byte 87,54,52,88,1
__w64lp_one__image:
__w64lp_one = __w64lp_one__image - web64_loader_packed_image + WEB64_LOADER_PACKED_ADDRESS
.word 1
__w64lp_two__image:
__w64lp_two = __w64lp_two__image - web64_loader_packed_image + WEB64_LOADER_PACKED_ADDRESS
.word 2
__w64lp_header_size__image:
__w64lp_header_size = __w64lp_header_size__image - web64_loader_packed_image + WEB64_LOADER_PACKED_ADDRESS
.word 8
__w64lp_record_size__image:
__w64lp_record_size = __w64lp_record_size__image - web64_loader_packed_image + WEB64_LOADER_PACKED_ADDRESS
.word 10
__w64lp_code_start__image:
__w64lp_code_start = __w64lp_code_start__image - web64_loader_packed_image + WEB64_LOADER_PACKED_ADDRESS
.word __w64lp_begin
__w64lp_code_last__image:
__w64lp_code_last = __w64lp_code_last__image - web64_loader_packed_image + WEB64_LOADER_PACKED_ADDRESS
.word __w64lp_end-1
__w64lp_decoder_start__image:
__w64lp_decoder_start = __w64lp_decoder_start__image - web64_loader_packed_image + WEB64_LOADER_PACKED_ADDRESS
.word __w64ld_unpack
__w64lp_decoder_last__image:
__w64lp_decoder_last = __w64lp_decoder_last__image - web64_loader_packed_image + WEB64_LOADER_PACKED_ADDRESS
.word __w64ld_end-1
__w64lp_request__image:
__w64lp_request = __w64lp_request__image - web64_loader_packed_image + WEB64_LOADER_PACKED_ADDRESS
__w64lp_stage__image:
__w64lp_stage = __w64lp_stage__image - web64_loader_packed_image + WEB64_LOADER_PACKED_ADDRESS
.word 0
__w64lp_length__image:
__w64lp_length = __w64lp_length__image - web64_loader_packed_image + WEB64_LOADER_PACKED_ADDRESS
.word 0
__w64lp_destination__image:
__w64lp_destination = __w64lp_destination__image - web64_loader_packed_image + WEB64_LOADER_PACKED_ADDRESS
.word 0
__w64lp_capacity__image:
__w64lp_capacity = __w64lp_capacity__image - web64_loader_packed_image + WEB64_LOADER_PACKED_ADDRESS
.word 0
__w64lp_workspace__image:
__w64lp_workspace = __w64lp_workspace__image - web64_loader_packed_image + WEB64_LOADER_PACKED_ADDRESS
.word 0
__w64lp_workspace_capacity__image:
__w64lp_workspace_capacity = __w64lp_workspace_capacity__image - web64_loader_packed_image + WEB64_LOADER_PACKED_ADDRESS
.word 0
__w64lp_block__image:
__w64lp_block = __w64lp_block__image - web64_loader_packed_image + WEB64_LOADER_PACKED_ADDRESS
.byte 0
__w64lp_stage_end__image:
__w64lp_stage_end = __w64lp_stage_end__image - web64_loader_packed_image + WEB64_LOADER_PACKED_ADDRESS
.word 0
__w64lp_destination_end__image:
__w64lp_destination_end = __w64lp_destination_end__image - web64_loader_packed_image + WEB64_LOADER_PACKED_ADDRESS
.word 0
__w64lp_workspace_end__image:
__w64lp_workspace_end = __w64lp_workspace_end__image - web64_loader_packed_image + WEB64_LOADER_PACKED_ADDRESS
.word 0
__w64lp_payload_end__image:
__w64lp_payload_end = __w64lp_payload_end__image - web64_loader_packed_image + WEB64_LOADER_PACKED_ADDRESS
.word 0
__w64lp_next_offset__image:
__w64lp_next_offset = __w64lp_next_offset__image - web64_loader_packed_image + WEB64_LOADER_PACKED_ADDRESS
.word 0
__w64lp_used__image:
__w64lp_used = __w64lp_used__image - web64_loader_packed_image + WEB64_LOADER_PACKED_ADDRESS
.word 0
__w64lp_work_cursor__image:
__w64lp_work_cursor = __w64lp_work_cursor__image - web64_loader_packed_image + WEB64_LOADER_PACKED_ADDRESS
.word 0
__w64lp_decoded_end__image:
__w64lp_decoded_end = __w64lp_decoded_end__image - web64_loader_packed_image + WEB64_LOADER_PACKED_ADDRESS
.word 0
__w64lp_decoded_after__image:
__w64lp_decoded_after = __w64lp_decoded_after__image - web64_loader_packed_image + WEB64_LOADER_PACKED_ADDRESS
.word 0
__w64lp_count__image:
__w64lp_count = __w64lp_count__image - web64_loader_packed_image + WEB64_LOADER_PACKED_ADDRESS
.byte 0
__w64lp_index__image:
__w64lp_index = __w64lp_index__image - web64_loader_packed_image + WEB64_LOADER_PACKED_ADDRESS
.byte 0
__w64lp_record_data__image:
__w64lp_record_data = __w64lp_record_data__image - web64_loader_packed_image + WEB64_LOADER_PACKED_ADDRESS
__w64lp_record_destination__image:
__w64lp_record_destination = __w64lp_record_destination__image - web64_loader_packed_image + WEB64_LOADER_PACKED_ADDRESS
.word 0
__w64lp_decoded_length__image:
__w64lp_decoded_length = __w64lp_decoded_length__image - web64_loader_packed_image + WEB64_LOADER_PACKED_ADDRESS
.word 0
__w64lp_record_offset__image:
__w64lp_record_offset = __w64lp_record_offset__image - web64_loader_packed_image + WEB64_LOADER_PACKED_ADDRESS
.word 0
__w64lp_packed_length__image:
__w64lp_packed_length = __w64lp_packed_length__image - web64_loader_packed_image + WEB64_LOADER_PACKED_ADDRESS
.word 0
__w64lp_decoded_crc__image:
__w64lp_decoded_crc = __w64lp_decoded_crc__image - web64_loader_packed_image + WEB64_LOADER_PACKED_ADDRESS
.word 0
__w64lp_crc_length__image:
__w64lp_crc_length = __w64lp_crc_length__image - web64_loader_packed_image + WEB64_LOADER_PACKED_ADDRESS
.word 0
__w64lp_crc_value__image:
__w64lp_crc_value = __w64lp_crc_value__image - web64_loader_packed_image + WEB64_LOADER_PACKED_ADDRESS
.word 0
__w64lp_crc_low__image:
__w64lp_crc_low = __w64lp_crc_low__image - web64_loader_packed_image + WEB64_LOADER_PACKED_ADDRESS
.byte 0,33,66,99,132,165,198,231,8,41,74,107,140,173,206,239,49,16,115,82,181,148,247,214,57,24,123,90,189,156,255,222,98,67,32,1,230,199,164,133,106,75,40,9,238,207,172,141,83,114,17,48,215,246,149,180,91,122,25,56,223,254,157,188,196,229,134,167,64,97,2,35,204,237,142,175,72,105,10,43,245,212,183,150,113,80,51,18,253,220,191,158,121,88,59,26,166,135,228,197,34,3,96,65,174,143,236,205,42,11,104,73,151,182,213,244,19,50,81,112,159,190,221,252,27,58,89,120,136,169,202,235,12,45,78,111,128,161,194,227,4,37,70,103,185,152,251,218,61,28,127,94,177,144,243,210,53,20,119,86,234,203,168,137,110,79,44,13,226,195,160,129,102,71,36,5,219,250,153,184,95,126,29,60,211,242,145,176,87,118,21,52,76,109,14,47,200,233,138,171,68,101,6,39,192,225,130,163,125,92,63,30,249,216,187,154,117,84,55,22,241,208,179,146,46,15,108,77,170,139,232,201,38,7,100,69,162,131,224,193,31,62,93,124,155,186,217,248,23,54,85,116,147,178,209,240
__w64lp_crc_high__image:
__w64lp_crc_high = __w64lp_crc_high__image - web64_loader_packed_image + WEB64_LOADER_PACKED_ADDRESS
.byte 0,16,32,48,64,80,96,112,129,145,161,177,193,209,225,241,18,2,50,34,82,66,114,98,147,131,179,163,211,195,243,227,36,52,4,20,100,116,68,84,165,181,133,149,229,245,197,213,54,38,22,6,118,102,86,70,183,167,151,135,247,231,215,199,72,88,104,120,8,24,40,56,201,217,233,249,137,153,169,185,90,74,122,106,26,10,58,42,219,203,251,235,155,139,187,171,108,124,76,92,44,60,12,28,237,253,205,221,173,189,141,157,126,110,94,78,62,46,30,14,255,239,223,207,191,175,159,143,145,129,177,161,209,193,241,225,16,0,48,32,80,64,112,96,131,147,163,179,195,211,227,243,2,18,34,50,66,82,98,114,181,165,149,133,245,229,213,197,52,36,20,4,116,100,84,68,167,183,135,151,231,247,199,215,38,54,6,22,102,118,70,86,217,201,249,233,153,137,185,169,88,72,120,104,24,8,56,40,203,219,235,251,139,155,171,187,74,90,106,122,10,26,42,58,253,237,221,205,189,173,157,141,124,108,92,76,60,44,28,12,239,255,207,223,175,191,143,159,110,126,78,94,46,62,14,30
__w64lp_end__image:
__w64lp_end = __w64lp_end__image - web64_loader_packed_image + WEB64_LOADER_PACKED_ADDRESS
web64_loader_packed_image_end:
web64_loader_packed_image_size = web64_loader_packed_image_end - web64_loader_packed_image
web64/loader-raw-runtime.inc
Web64 SDK header <web64/loader-raw-runtime.inc>.
Header listing:
; Caller-owned RAM image: define WEB64_LOADER_RAW_ADDRESS, include once and copy before use.
web64_loader_raw_image:
__w64lr_begin__image:
__w64lr_begin = __w64lr_begin__image - web64_loader_raw_image + WEB64_LOADER_RAW_ADDRESS
; _web64_rt exact-width named argument window for web64_loader_read
_web64_loader_read__arg_window__image:
_web64_loader_read__arg_window = _web64_loader_read__arg_window__image - web64_loader_raw_image + WEB64_LOADER_RAW_ADDRESS
_web64_loader_read__arg_window_size = 7
_web64_loader_read__arg0 = _web64_loader_read__arg_name
_web64_loader_read__arg_name__width = 2
_web64_loader_read__arg_name__offset = 0
_web64_loader_read__arg_name__image:
_web64_loader_read__arg_name = _web64_loader_read__arg_name__image - web64_loader_raw_image + WEB64_LOADER_RAW_ADDRESS
__web64_fn_web64_loader_read_param_name_0__image:
__web64_fn_web64_loader_read_param_name_0 = __web64_fn_web64_loader_read_param_name_0__image - web64_loader_raw_image + WEB64_LOADER_RAW_ADDRESS
.word 0
_web64_loader_read__arg1 = _web64_loader_read__arg_length
_web64_loader_read__arg_length__width = 1
_web64_loader_read__arg_length__offset = 2
_web64_loader_read__arg_length__image:
_web64_loader_read__arg_length = _web64_loader_read__arg_length__image - web64_loader_raw_image + WEB64_LOADER_RAW_ADDRESS
__web64_fn_web64_loader_read_param_length_1__image:
__web64_fn_web64_loader_read_param_length_1 = __web64_fn_web64_loader_read_param_length_1__image - web64_loader_raw_image + WEB64_LOADER_RAW_ADDRESS
.byte 0
_web64_loader_read__arg2 = _web64_loader_read__arg_stage
_web64_loader_read__arg_stage__width = 2
_web64_loader_read__arg_stage__offset = 3
_web64_loader_read__arg_stage__image:
_web64_loader_read__arg_stage = _web64_loader_read__arg_stage__image - web64_loader_raw_image + WEB64_LOADER_RAW_ADDRESS
__web64_fn_web64_loader_read_param_stage_2__image:
__web64_fn_web64_loader_read_param_stage_2 = __web64_fn_web64_loader_read_param_stage_2__image - web64_loader_raw_image + WEB64_LOADER_RAW_ADDRESS
.word 0
_web64_loader_read__arg3 = _web64_loader_read__arg_capacity
_web64_loader_read__arg_capacity__width = 2
_web64_loader_read__arg_capacity__offset = 5
_web64_loader_read__arg_capacity__image:
_web64_loader_read__arg_capacity = _web64_loader_read__arg_capacity__image - web64_loader_raw_image + WEB64_LOADER_RAW_ADDRESS
__web64_fn_web64_loader_read_param_capacity_3__image:
__web64_fn_web64_loader_read_param_capacity_3 = __web64_fn_web64_loader_read_param_capacity_3__image - web64_loader_raw_image + WEB64_LOADER_RAW_ADDRESS
.word 0
_web64_loader_read__image:
_web64_loader_read = _web64_loader_read__image - web64_loader_raw_image + WEB64_LOADER_RAW_ADDRESS
cld
lda __w64loader_phase
beq __w64lr_idle__image
lda #15
rts
__w64lr_idle__image:
__w64lr_idle = __w64lr_idle__image - web64_loader_raw_image + WEB64_LOADER_RAW_ADDRESS
lda #0
sta __w64loader_nested
sta __w64loader_abort_requested
__w64lr_read_body__image:
__w64lr_read_body = __w64lr_read_body__image - web64_loader_raw_image + WEB64_LOADER_RAW_ADDRESS
lda __w64loader_ready
bne __w64loader_placed_raw_macro_1_ok__image
lda #12
jmp __w64lr_result
__w64loader_placed_raw_macro_1_ok__image:
__w64loader_placed_raw_macro_1_ok = __w64loader_placed_raw_macro_1_ok__image - web64_loader_raw_image + WEB64_LOADER_RAW_ADDRESS
lda __w64lt_fastloadstatus
bne __w64loader_placed_raw_macro_2_ok__image
lda #12
jmp __w64lr_result
__w64loader_placed_raw_macro_2_ok__image:
__w64loader_placed_raw_macro_2_ok = __w64loader_placed_raw_macro_2_ok__image - web64_loader_raw_image + WEB64_LOADER_RAW_ADDRESS
; No hidden banking/vector changes in the fluid read path. RAM and I/O
; must be visible, with the caller's IRQ clock running.
lda $01
and #7
cmp #5
beq __w64loader_placed_raw_macro_3_ok__image
lda #13
jmp __w64lr_result
__w64loader_placed_raw_macro_3_ok__image:
__w64loader_placed_raw_macro_3_ok = __w64loader_placed_raw_macro_3_ok__image - web64_loader_raw_image + WEB64_LOADER_RAW_ADDRESS
php
pla
and #4
beq __w64loader_placed_raw_macro_4_ok__image
lda #13
jmp __w64lr_result
__w64loader_placed_raw_macro_4_ok__image:
__w64loader_placed_raw_macro_4_ok = __w64loader_placed_raw_macro_4_ok__image - web64_loader_raw_image + WEB64_LOADER_RAW_ADDRESS
lda _web64_loader_read__arg_length
bne __w64loader_placed_raw_macro_5_ok__image
lda #13
jmp __w64lr_result
__w64loader_placed_raw_macro_5_ok__image:
__w64loader_placed_raw_macro_5_ok = __w64loader_placed_raw_macro_5_ok__image - web64_loader_raw_image + WEB64_LOADER_RAW_ADDRESS
cmp #17
bcc __w64loader_placed_raw_macro_6_ok__image
lda #13
jmp __w64lr_result
__w64loader_placed_raw_macro_6_ok__image:
__w64loader_placed_raw_macro_6_ok = __w64loader_placed_raw_macro_6_ok__image - web64_loader_raw_image + WEB64_LOADER_RAW_ADDRESS
lda _web64_loader_read__arg_capacity
ora _web64_loader_read__arg_capacity+1
bne __w64loader_placed_raw_macro_7_ok__image
lda #8
jmp __w64lr_result
__w64loader_placed_raw_macro_7_ok__image:
__w64loader_placed_raw_macro_7_ok = __w64loader_placed_raw_macro_7_ok__image - web64_loader_raw_image + WEB64_LOADER_RAW_ADDRESS
sec
lda _web64_loader_read__arg_capacity
sbc #1
sta __w64lr_last
lda _web64_loader_read__arg_capacity+1
sbc #0
sta __w64lr_last+1
clc
lda __w64lr_last
adc _web64_loader_read__arg_stage
sta __w64lr_last
lda __w64lr_last+1
adc _web64_loader_read__arg_stage+1
sta __w64lr_last+1
bcc __w64loader_placed_raw_macro_8_ok__image
lda #8
jmp __w64lr_result
__w64loader_placed_raw_macro_8_ok__image:
__w64loader_placed_raw_macro_8_ok = __w64loader_placed_raw_macro_8_ok__image - web64_loader_raw_image + WEB64_LOADER_RAW_ADDRESS
lda _web64_loader_read__arg_stage+1
cmp #2
bcs __w64loader_placed_raw_macro_9_ok__image
lda #8
jmp __w64lr_result
__w64loader_placed_raw_macro_9_ok__image:
__w64loader_placed_raw_macro_9_ok = __w64loader_placed_raw_macro_9_ok__image - web64_loader_raw_image + WEB64_LOADER_RAW_ADDRESS
cmp #$e0
bcs __w64lr_ram_range__image
lda __w64lr_last+1
cmp #$d0
bcc __w64loader_placed_raw_macro_10_ok__image
lda #8
jmp __w64lr_result
__w64loader_placed_raw_macro_10_ok__image:
__w64loader_placed_raw_macro_10_ok = __w64loader_placed_raw_macro_10_ok__image - web64_loader_raw_image + WEB64_LOADER_RAW_ADDRESS
__w64lr_ram_range__image:
__w64lr_ram_range = __w64lr_ram_range__image - web64_loader_raw_image + WEB64_LOADER_RAW_ADDRESS
; Sector receive storage cannot also be the accumulating file buffer.
lda __w64loader_sector_page
cmp _web64_loader_read__arg_stage+1
bcc __w64lr_sector_separate__image
cmp __w64lr_last+1
beq __w64lr_sector_collision__image
bcs __w64lr_sector_separate__image
__w64lr_sector_collision__image:
__w64lr_sector_collision = __w64lr_sector_collision__image - web64_loader_raw_image + WEB64_LOADER_RAW_ADDRESS
lda #9
jmp __w64lr_result
__w64lr_sector_separate__image:
__w64lr_sector_separate = __w64lr_sector_separate__image - web64_loader_raw_image + WEB64_LOADER_RAW_ADDRESS
lda _web64_loader_read__arg_name
sta $fb
lda _web64_loader_read__arg_name+1
sta $fc
ldy #0
__w64lr_filename_loop__image:
__w64lr_filename_loop = __w64lr_filename_loop__image - web64_loader_raw_image + WEB64_LOADER_RAW_ADDRESS
lda ($fb),y
bne __w64loader_placed_raw_macro_11_ok__image
lda #13
jmp __w64lr_result
__w64loader_placed_raw_macro_11_ok__image:
__w64loader_placed_raw_macro_11_ok = __w64loader_placed_raw_macro_11_ok__image - web64_loader_raw_image + WEB64_LOADER_RAW_ADDRESS
sta __w64lr_filename,y
iny
cpy _web64_loader_read__arg_length
bne __w64lr_filename_loop__image
lda #0
sta __w64lr_filename,y
sta __w64lr_size
sta __w64lr_size+1
sta __w64lr_origin
sta __w64lr_origin+1
lda #1
sta __w64loader_phase
lda _web64_loader_read__arg_stage
sta __w64lr_store+1
lda _web64_loader_read__arg_stage+1
sta __w64lr_store+2
jsr __w64loader_sample_clock
sta __w64lt_wait_start
; The filename has been copied. Reuse call scratch for the immutable clock
; address, avoiding two subroutine envelopes around every received byte.
lda __w64loader_sample_clock+1
sta $fb
lda __w64loader_sample_clock+2
sta $fc
ldx #<__w64lr_filename
ldy #>__w64lr_filename
jsr __w64lt_openfile
bcc __w64lr_opened__image
jmp __w64lr_transport_failure
__w64lr_opened__image:
__w64lr_opened = __w64lr_opened__image - web64_loader_raw_image + WEB64_LOADER_RAW_ADDRESS
ldy #0
lda ($fb),y
sta __w64lt_wait_start
jsr __w64lt_getbyte
bcc __w64lr_origin_low__image
jmp __w64lr_short_header
__w64lr_origin_low__image:
__w64lr_origin_low = __w64lr_origin_low__image - web64_loader_raw_image + WEB64_LOADER_RAW_ADDRESS
sta __w64lr_origin
ldy #0
lda ($fb),y
sta __w64lt_wait_start
jsr __w64lt_getbyte
bcc __w64lr_origin_high__image
jmp __w64lr_short_header
__w64lr_origin_high__image:
__w64lr_origin_high = __w64lr_origin_high__image - web64_loader_raw_image + WEB64_LOADER_RAW_ADDRESS
sta __w64lr_origin+1
__w64lr_byte_loop__image:
__w64lr_byte_loop = __w64lr_byte_loop__image - web64_loader_raw_image + WEB64_LOADER_RAW_ADDRESS
ldy #0
lda ($fb),y
sta __w64lt_wait_start
jsr __w64lt_getbyte
bcs __w64lr_end__image
tax
lda __w64loader_abort_requested
bne __w64lr_transport_failure__image
lda __w64lr_size+1
cmp _web64_loader_read__arg_capacity+1
bne __w64lr_store_byte__image
lda __w64lr_size
cmp _web64_loader_read__arg_capacity
bne __w64lr_store_byte__image
jsr __w64lt_abort
lda #6
jmp __w64lr_result
__w64lr_store_byte__image:
__w64lr_store_byte = __w64lr_store_byte__image - web64_loader_raw_image + WEB64_LOADER_RAW_ADDRESS
txa
__w64lr_store__image:
__w64lr_store = __w64lr_store__image - web64_loader_raw_image + WEB64_LOADER_RAW_ADDRESS
sta $ffff
inc __w64lr_store+1
bne __w64lr_store_next__image
inc __w64lr_store+2
__w64lr_store_next__image:
__w64lr_store_next = __w64lr_store_next__image - web64_loader_raw_image + WEB64_LOADER_RAW_ADDRESS
inc __w64lr_size
bne __w64lr_byte_loop__image
inc __w64lr_size+1
jmp __w64lr_byte_loop
__w64lr_end__image:
__w64lr_end = __w64lr_end__image - web64_loader_raw_image + WEB64_LOADER_RAW_ADDRESS
cmp #0
bne __w64lr_drive_error__image
lda __w64loader_abort_requested
bne __w64lr_transport_failure__image
beq __w64lr_result__image
__w64lr_short_header__image:
__w64lr_short_header = __w64lr_short_header__image - web64_loader_raw_image + WEB64_LOADER_RAW_ADDRESS
cmp #0
bne __w64lr_drive_error__image
lda #2
bne __w64lr_result__image
__w64lr_drive_error__image:
__w64lr_drive_error = __w64lr_drive_error__image - web64_loader_raw_image + WEB64_LOADER_RAW_ADDRESS
cmp #2
bne __w64lr_not_missing__image
lda __w64lt_fastloadstatus
beq __w64lr_transport_failure__image
lda #1
bne __w64lr_result__image
__w64lr_not_missing__image:
__w64lr_not_missing = __w64lr_not_missing__image - web64_loader_raw_image + WEB64_LOADER_RAW_ADDRESS
cmp #4
bne __w64lr_transport_failure__image
lda #3
bne __w64lr_result__image
__w64lr_transport_failure__image:
__w64lr_transport_failure = __w64lr_transport_failure__image - web64_loader_raw_image + WEB64_LOADER_RAW_ADDRESS
jsr __w64lt_abort
lda #0
sta __w64loader_ready
lda __w64loader_abort_requested
beq __w64lr_not_aborted__image
lda #11
bne __w64lr_result__image
__w64lr_not_aborted__image:
__w64lr_not_aborted = __w64lr_not_aborted__image - web64_loader_raw_image + WEB64_LOADER_RAW_ADDRESS
lda #2
__w64lr_result__image:
__w64lr_result = __w64lr_result__image - web64_loader_raw_image + WEB64_LOADER_RAW_ADDRESS
sta __w64loader_status
lda __w64loader_nested
bne __w64lr_nested_return__image
lda #0
sta __w64loader_phase
__w64lr_nested_return__image:
__w64lr_nested_return = __w64lr_nested_return__image - web64_loader_raw_image + WEB64_LOADER_RAW_ADDRESS
lda __w64loader_status
rts
_web64_loader_last_size__image:
_web64_loader_last_size = _web64_loader_last_size__image - web64_loader_raw_image + WEB64_LOADER_RAW_ADDRESS
lda __w64lr_size
ldx __w64lr_size+1
rts
_web64_loader_last_origin__image:
_web64_loader_last_origin = _web64_loader_last_origin__image - web64_loader_raw_image + WEB64_LOADER_RAW_ADDRESS
lda __w64lr_origin
ldx __w64lr_origin+1
rts
__w64lr_size__image:
__w64lr_size = __w64lr_size__image - web64_loader_raw_image + WEB64_LOADER_RAW_ADDRESS
.word 0
__w64lr_origin__image:
__w64lr_origin = __w64lr_origin__image - web64_loader_raw_image + WEB64_LOADER_RAW_ADDRESS
.word 0
__w64lr_last__image:
__w64lr_last = __w64lr_last__image - web64_loader_raw_image + WEB64_LOADER_RAW_ADDRESS
.word 0
__w64lr_filename__image:
__w64lr_filename = __w64lr_filename__image - web64_loader_raw_image + WEB64_LOADER_RAW_ADDRESS
.fill 17,0
__w64lr_end_address__image:
__w64lr_end_address = __w64lr_end_address__image - web64_loader_raw_image + WEB64_LOADER_RAW_ADDRESS
web64_loader_raw_image_end:
web64_loader_raw_image_size = web64_loader_raw_image_end - web64_loader_raw_image
web64/loader-state-runtime.inc
Web64 SDK header <web64/loader-state-runtime.inc>.
Header listing:
; Caller-owned RAM image: define WEB64_LOADER_STATE_ADDRESS, include once and copy before use.
web64_loader_state_image:
_web64_loader_status__image:
_web64_loader_status = _web64_loader_status__image - web64_loader_state_image + WEB64_LOADER_STATE_ADDRESS
lda __w64loader_status
rts
_web64_loader_abort__image:
_web64_loader_abort = _web64_loader_abort__image - web64_loader_state_image + WEB64_LOADER_STATE_ADDRESS
; IRQ-safe request only. A commit already in progress is irrevocable.
lda __w64loader_phase
cmp #1
bne __w64loader_abort_idle__image
sta __w64loader_abort_requested
__w64loader_abort_idle__image:
__w64loader_abort_idle = __w64loader_abort_idle__image - web64_loader_state_image + WEB64_LOADER_STATE_ADDRESS
rts
__w64loader_status__image:
__w64loader_status = __w64loader_status__image - web64_loader_state_image + WEB64_LOADER_STATE_ADDRESS
.byte 0
__w64loader_phase__image:
__w64loader_phase = __w64loader_phase__image - web64_loader_state_image + WEB64_LOADER_STATE_ADDRESS
.byte 0
__w64loader_nested__image:
__w64loader_nested = __w64loader_nested__image - web64_loader_state_image + WEB64_LOADER_STATE_ADDRESS
.byte 0
__w64loader_abort_requested__image:
__w64loader_abort_requested = __w64loader_abort_requested__image - web64_loader_state_image + WEB64_LOADER_STATE_ADDRESS
.byte 0
web64_loader_state_image_end:
web64_loader_state_image_size = web64_loader_state_image_end - web64_loader_state_image
web64/loader-transport-runtime.inc
Web64 SDK header <web64/loader-transport-runtime.inc>.
Header listing:
; Caller-owned RAM image: define WEB64_LOADER_TRANSPORT_ADDRESS, include once and copy before use.
web64_loader_transport_image:
__w64loader_transport_begin__image:
__w64loader_transport_begin = __w64loader_transport_begin__image - web64_loader_transport_image + WEB64_LOADER_TRANSPORT_ADDRESS
; Altered Covert Bitops Loadersystem 2.29, one-bit long-name 1541 protocol.
; Copyright (c) 2002-2019 Lasse Oorni
;
; Permission is hereby granted, free of charge, to any person obtaining a
; copy of this software and associated documentation files (the "Software"),
; to deal in the Software without restriction, including without limitation
; the rights to use, copy, modify, merge, publish, distribute, sublicense,
; and/or sell copies of the Software, and to permit persons to whom the
; Software is furnished to do so, subject to the following conditions:
;
; The above copyright notice and this permission notice shall be included in
; all copies or substantial portions of the Software.
;
; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
; IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
; FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
; THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
; LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
; FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
; DEALINGS IN THE SOFTWARE.
;
; Web64 adds bounded cancellation/recovery and explicit RAM/lifecycle policy;
; this is an altered port, not the original source. See loader-licenses.md.
__w64lt_TWOBIT_PROTOCOL = $0
__w64lt_LONG_NAMES = $1
__w64lt_BORDER_FLASHING = $0
__w64lt_LOAD_UNDER_IO = $0
__w64lt_LOADFILE_UNPACKED = $0
__w64lt_LOADFILE_EXOMIZER = $0
__w64lt_LOADFILE_PUCRUNCH = $0
__w64lt_LITERAL_SEQUENCES_NOT_USED = $0
__w64lt_FORWARD_DECRUNCHING = $0
__w64lt_MAX_SEQUENCE_LENGTH_256 = $0
__w64lt_EXOMIZER_VERSION_3 = $0
__w64lt_RETRIES = $5
__w64lt_loadbuffer = $ff00
__w64lt_zpbase = $74
__w64lt_zpbase2 = $76
; C64 code is ordinary linked ASM; drive aliases refer to drive RAM only.
__w64lt_runtime_image__image:
__w64lt_runtime_image = __w64lt_runtime_image__image - web64_loader_transport_image + WEB64_LOADER_TRANSPORT_ADDRESS
__w64lt_loadtempreg = __w64lt_zpbase2+0
__w64lt_bufferstatus = __w64lt_zpbase2+1
__w64lt_fileopen = __w64lt_zpbase2+2
__w64lt_fastloadstatus = __w64lt_zpbase2+3
__w64lt_destlo = __w64lt_zpbase+0
__w64lt_desthi = __w64lt_zpbase+1
__w64lt_MW_LENGTH = 32
__w64lt_status = $90
__w64lt_messages = $9d
__w64lt_fa = $ba
__w64lt_acsbf = $01
__w64lt_trkbf = $08
__w64lt_sctbf = $09
__w64lt_iddrv0 = $12
__w64lt_drvtemp = $06
__w64lt_id = $16
__w64lt_buf = $0400
__w64lt_drvstart = $0500
__w64lt_drv_sendtblhigh = $0700
__w64lt_initialize = $d005
__w64lt_ciout = $ffa8
__w64lt_listen = $ffb1
__w64lt_second = $ff93
__w64lt_unlsn = $ffae
__w64lt_talk = $ffb4
__w64lt_tksa = $ff96
__w64lt_untlk = $ffab
__w64lt_acptr = $ffa5
__w64lt_chkin = $ffc6
__w64lt_chkout = $ffc9
__w64lt_chrin = $ffcf
__w64lt_chrout = $ffd2
__w64lt_close = $ffc3
__w64lt_open = $ffc0
__w64lt_setmsg = $ff90
__w64lt_setnam = $ffbd
__w64lt_setlfs = $ffba
__w64lt_clrchn = $ffcc
__w64lt_getin = $ffe4
__w64lt_load = $ffd5
__w64lt_save = $ffd8
__w64lt_image_openfile__image:
__w64lt_image_openfile = __w64lt_image_openfile__image - web64_loader_transport_image + WEB64_LOADER_TRANSPORT_ADDRESS
__w64lt_openfile = __w64lt_image_openfile
lda __w64lt_fileopen
beq __w64lt_image_open_ok__image
rts
__w64lt_image_open_ok__image:
__w64lt_image_open_ok = __w64lt_image_open_ok__image - web64_loader_transport_image + WEB64_LOADER_TRANSPORT_ADDRESS
__w64lt_open_ok = __w64lt_image_open_ok
stx __w64lt_destlo
sty __w64lt_desthi
inc __w64lt_fileopen
lda __w64lt_usefastload
bne __w64lt_image_fastopen__image
__w64lt_image_slowopen__image:
__w64lt_image_slowopen = __w64lt_image_slowopen__image - web64_loader_transport_image + WEB64_LOADER_TRANSPORT_ADDRESS
__w64lt_slowopen = __w64lt_image_slowopen
tay
jsr __w64lt_kernalon
__w64lt_image_slowopen_nameloop__image:
__w64lt_image_slowopen_nameloop = __w64lt_image_slowopen_nameloop__image - web64_loader_transport_image + WEB64_LOADER_TRANSPORT_ADDRESS
__w64lt_slowopen_nameloop = __w64lt_image_slowopen_nameloop
iny
lda (__w64lt_destlo),y
bne __w64lt_image_slowopen_nameloop__image
tya
ldx __w64lt_destlo
ldy __w64lt_desthi
jsr __w64lt_setnam
lda #$02
ldy #$00
jsr __w64lt_setlfsdevice
jsr __w64lt_open
ldx #$02
jsr __w64lt_chkin
jmp __w64lt_kernaloff
__w64lt_image_fastopen__image:
__w64lt_image_fastopen = __w64lt_image_fastopen__image - web64_loader_transport_image + WEB64_LOADER_TRANSPORT_ADDRESS
__w64lt_fastopen = __w64lt_image_fastopen
jsr __w64lt_initfastload
ldy #$00
__w64lt_image_fastload_sendouter__image:
__w64lt_image_fastload_sendouter = __w64lt_image_fastload_sendouter__image - web64_loader_transport_image + WEB64_LOADER_TRANSPORT_ADDRESS
__w64lt_fastload_sendouter = __w64lt_image_fastload_sendouter
lda (__w64lt_destlo),y
sta __w64lt_loadtempreg
pha
ldx #$08
__w64lt_image_fastload_sendinner__image:
__w64lt_image_fastload_sendinner = __w64lt_image_fastload_sendinner__image - web64_loader_transport_image + WEB64_LOADER_TRANSPORT_ADDRESS
__w64lt_fastload_sendinner = __w64lt_image_fastload_sendinner
bit $dd00
bpl __w64lt_image_send_wait__image
bvs __w64lt_image_send_ready__image
__w64lt_image_send_wait__image:
__w64lt_image_send_wait = __w64lt_image_send_wait__image - web64_loader_transport_image + WEB64_LOADER_TRANSPORT_ADDRESS
jsr __w64lt_wait
bcc __w64lt_image_fastload_sendinner__image
pla
jmp __w64lt_abort
__w64lt_image_send_ready__image:
__w64lt_image_send_ready = __w64lt_image_send_ready__image - web64_loader_transport_image + WEB64_LOADER_TRANSPORT_ADDRESS
lsr __w64lt_loadtempreg
lda #$10
ora $dd00
bcc __w64lt_image_fastload_zerobit__image
eor #$30
__w64lt_image_fastload_zerobit__image:
__w64lt_image_fastload_zerobit = __w64lt_image_fastload_zerobit__image - web64_loader_transport_image + WEB64_LOADER_TRANSPORT_ADDRESS
__w64lt_fastload_zerobit = __w64lt_image_fastload_zerobit
sta $dd00
lda #$c0
__w64lt_image_fastload_sendack__image:
__w64lt_image_fastload_sendack = __w64lt_image_fastload_sendack__image - web64_loader_transport_image + WEB64_LOADER_TRANSPORT_ADDRESS
__w64lt_fastload_sendack = __w64lt_image_fastload_sendack
bit $dd00
beq __w64lt_image_ack_ready__image
jsr __w64lt_wait
bcc __w64lt_image_fastload_sendack__image
pla
jmp __w64lt_abort
__w64lt_image_ack_ready__image:
__w64lt_image_ack_ready = __w64lt_image_ack_ready__image - web64_loader_transport_image + WEB64_LOADER_TRANSPORT_ADDRESS
lda #$ff-$30
and $dd00
sta $dd00
dex
bne __w64lt_image_fastload_sendinner__image
iny
pla
bne __w64lt_image_fastload_sendouter__image
sta $d07a
__w64lt_image_fastload_predelay__image:
__w64lt_image_fastload_predelay = __w64lt_image_fastload_predelay__image - web64_loader_transport_image + WEB64_LOADER_TRANSPORT_ADDRESS
__w64lt_fastload_predelay = __w64lt_image_fastload_predelay
dex
bne __w64lt_image_fastload_predelay__image
__w64lt_image_fastload_fillbuffer__image:
__w64lt_image_fastload_fillbuffer = __w64lt_image_fastload_fillbuffer__image - web64_loader_transport_image + WEB64_LOADER_TRANSPORT_ADDRESS
__w64lt_fastload_fillbuffer = __w64lt_image_fastload_fillbuffer
ldx __w64lt_fileopen
beq __w64lt_image_fileclosed__image
pha
sta $d07a
__w64lt_image_fastload_fbwait__image:
__w64lt_image_fastload_fbwait = __w64lt_image_fastload_fbwait__image - web64_loader_transport_image + WEB64_LOADER_TRANSPORT_ADDRESS
__w64lt_fastload_fbwait = __w64lt_image_fastload_fbwait
bit $dd00
bvs __w64lt_image_fb_ready__image
jsr __w64lt_wait
bcc __w64lt_image_fastload_fbwait__image
pla
jmp __w64lt_abort
__w64lt_image_fb_ready__image:
__w64lt_image_fb_ready = __w64lt_image_fb_ready__image - web64_loader_transport_image + WEB64_LOADER_TRANSPORT_ADDRESS
pha
pla
pha
pla
nop
__w64lt_image_fastload_fillbufferloop__image:
__w64lt_image_fastload_fillbufferloop = __w64lt_image_fastload_fillbufferloop__image - web64_loader_transport_image + WEB64_LOADER_TRANSPORT_ADDRESS
__w64lt_fastload_fillbufferloop = __w64lt_image_fastload_fillbufferloop
nop
nop
ldx #$08
__w64lt_image_fastload_bitloop__image:
__w64lt_image_fastload_bitloop = __w64lt_image_fastload_bitloop__image - web64_loader_transport_image + WEB64_LOADER_TRANSPORT_ADDRESS
__w64lt_fastload_bitloop = __w64lt_image_fastload_bitloop
nop
; Four extra NOPs cover the drive's ATN cancellation checks on each bit.
; This is the actual IEC settling window, not an emulator-only shortcut.
nop
nop
nop
nop
lda #$10
eor $dd00
sta $dd00
asl
__w64lt_image_fastload_store__image:
__w64lt_image_fastload_store = __w64lt_image_fastload_store__image - web64_loader_transport_image + WEB64_LOADER_TRANSPORT_ADDRESS
__w64lt_fastload_store = __w64lt_image_fastload_store
ror __w64lt_loadbuffer
dex
bne __w64lt_image_fastload_bitloop__image
inc __w64lt_fastload_store+1
bne __w64lt_image_fastload_fillbufferloop__image
__w64lt_image_fillbuffer_common__image:
__w64lt_image_fillbuffer_common = __w64lt_image_fillbuffer_common__image - web64_loader_transport_image + WEB64_LOADER_TRANSPORT_ADDRESS
__w64lt_fillbuffer_common = __w64lt_image_fillbuffer_common
lda #$02
sta __w64lt_bufferstatus
ldx #$ff
__w64lt_buffer_head__image:
__w64lt_buffer_head = __w64lt_buffer_head__image - web64_loader_transport_image + WEB64_LOADER_TRANSPORT_ADDRESS
lda __w64lt_loadbuffer
bne __w64lt_image_fastload_fullbuffer__image
__w64lt_buffer_tail__image:
__w64lt_buffer_tail = __w64lt_buffer_tail__image - web64_loader_transport_image + WEB64_LOADER_TRANSPORT_ADDRESS
ldx __w64lt_loadbuffer+1
bne __w64lt_image_fastload_noloadend__image
stx __w64lt_fileopen
__w64lt_buffer_error__image:
__w64lt_buffer_error = __w64lt_buffer_error__image - web64_loader_transport_image + WEB64_LOADER_TRANSPORT_ADDRESS
lda __w64lt_loadbuffer+2
sta __w64lt_fileclosed+1
__w64lt_image_fastload_noloadend__image:
__w64lt_image_fastload_noloadend = __w64lt_image_fastload_noloadend__image - web64_loader_transport_image + WEB64_LOADER_TRANSPORT_ADDRESS
__w64lt_fastload_noloadend = __w64lt_image_fastload_noloadend
__w64lt_image_fastload_fullbuffer__image:
__w64lt_image_fastload_fullbuffer = __w64lt_image_fastload_fullbuffer__image - web64_loader_transport_image + WEB64_LOADER_TRANSPORT_ADDRESS
__w64lt_fastload_fullbuffer = __w64lt_image_fastload_fullbuffer
stx __w64lt_fastload_endcmp+1
pla
clc
bcc __w64lt_image_getbyte_restx__image
__w64lt_image_fileclosed__image:
__w64lt_image_fileclosed = __w64lt_image_fileclosed__image - web64_loader_transport_image + WEB64_LOADER_TRANSPORT_ADDRESS
__w64lt_fileclosed = __w64lt_image_fileclosed
lda #$00
sec
bcs __w64lt_image_getbyte_restx__image
__w64lt_image_getbyte__image:
__w64lt_image_getbyte = __w64lt_image_getbyte__image - web64_loader_transport_image + WEB64_LOADER_TRANSPORT_ADDRESS
__w64lt_getbyte = __w64lt_image_getbyte
stx __w64lt_getbyte_restx+1
__w64lt_image_getbyte_usefastload__image:
__w64lt_image_getbyte_usefastload = __w64lt_image_getbyte_usefastload__image - web64_loader_transport_image + WEB64_LOADER_TRANSPORT_ADDRESS
__w64lt_getbyte_usefastload = __w64lt_image_getbyte_usefastload
lda #$00
beq __w64lt_image_slowload_getbyte__image
__w64lt_image_fastload_getbyte__image:
__w64lt_image_fastload_getbyte = __w64lt_image_fastload_getbyte__image - web64_loader_transport_image + WEB64_LOADER_TRANSPORT_ADDRESS
__w64lt_fastload_getbyte = __w64lt_image_fastload_getbyte
ldx __w64lt_bufferstatus
__w64lt_buffer_read__image:
__w64lt_buffer_read = __w64lt_buffer_read__image - web64_loader_transport_image + WEB64_LOADER_TRANSPORT_ADDRESS
lda __w64lt_loadbuffer,x
__w64lt_image_fastload_endcmp__image:
__w64lt_image_fastload_endcmp = __w64lt_image_fastload_endcmp__image - web64_loader_transport_image + WEB64_LOADER_TRANSPORT_ADDRESS
__w64lt_fastload_endcmp = __w64lt_image_fastload_endcmp
cpx #$00
bcs __w64lt_image_fastload_fillbuffer__image
inc __w64lt_bufferstatus
__w64lt_image_getbyte_restx__image:
__w64lt_image_getbyte_restx = __w64lt_image_getbyte_restx__image - web64_loader_transport_image + WEB64_LOADER_TRANSPORT_ADDRESS
__w64lt_getbyte_restx = __w64lt_image_getbyte_restx
ldx #$00
rts
__w64lt_image_slowload_getbyte__image:
__w64lt_image_slowload_getbyte = __w64lt_image_slowload_getbyte__image - web64_loader_transport_image + WEB64_LOADER_TRANSPORT_ADDRESS
__w64lt_slowload_getbyte = __w64lt_image_slowload_getbyte
lda __w64lt_fileopen
beq __w64lt_image_fileclosed__image
jsr __w64lt_kernalon
jsr __w64lt_chrin
ldx __w64lt_status
bne __w64lt_image_slowload_eof__image
jsr __w64lt_kernaloff
clc
bcc __w64lt_image_getbyte_restx__image
__w64lt_image_slowload_eof__image:
__w64lt_image_slowload_eof = __w64lt_image_slowload_eof__image - web64_loader_transport_image + WEB64_LOADER_TRANSPORT_ADDRESS
__w64lt_slowload_eof = __w64lt_image_slowload_eof
pha
txa
and #$03
sta __w64lt_fileclosed+1
dec __w64lt_fileopen
sty __w64lt_getbyte_resty+1
jsr __w64lt_close_kernaloff
__w64lt_image_getbyte_resty__image:
__w64lt_image_getbyte_resty = __w64lt_image_getbyte_resty__image - web64_loader_transport_image + WEB64_LOADER_TRANSPORT_ADDRESS
__w64lt_getbyte_resty = __w64lt_image_getbyte_resty
ldy #$00
pla
ldx __w64lt_fileclosed+1
cpx #$01
bcc __w64lt_image_getbyte_restx__image
txa
bcs __w64lt_image_getbyte_restx__image
__w64lt_image_setlfsdevice__image:
__w64lt_image_setlfsdevice = __w64lt_image_setlfsdevice__image - web64_loader_transport_image + WEB64_LOADER_TRANSPORT_ADDRESS
__w64lt_setlfsdevice = __w64lt_image_setlfsdevice
ldx __w64lt_fa
jmp __w64lt_setlfs
__w64lt_image_kernalon__image:
__w64lt_image_kernalon = __w64lt_image_kernalon__image - web64_loader_transport_image + WEB64_LOADER_TRANSPORT_ADDRESS
__w64lt_kernalon = __w64lt_image_kernalon
ldx $01
stx __w64lt_kernaloff+1
ldx #$36
stx $01
rts
__w64lt_image_close_kernaloff__image:
__w64lt_image_close_kernaloff = __w64lt_image_close_kernaloff__image - web64_loader_transport_image + WEB64_LOADER_TRANSPORT_ADDRESS
__w64lt_close_kernaloff = __w64lt_image_close_kernaloff
lda #$02
jsr __w64lt_close
jsr __w64lt_clrchn
__w64lt_image_kernaloff__image:
__w64lt_image_kernaloff = __w64lt_image_kernaloff__image - web64_loader_transport_image + WEB64_LOADER_TRANSPORT_ADDRESS
__w64lt_kernaloff = __w64lt_image_kernaloff
ldx #$36
stx $01
__w64lt_image_il_ok__image:
__w64lt_image_il_ok = __w64lt_image_il_ok__image - web64_loader_transport_image + WEB64_LOADER_TRANSPORT_ADDRESS
__w64lt_il_ok = __w64lt_image_il_ok
rts
__w64lt_image_initfastload__image:
__w64lt_image_initfastload = __w64lt_image_initfastload__image - web64_loader_transport_image + WEB64_LOADER_TRANSPORT_ADDRESS
__w64lt_initfastload = __w64lt_image_initfastload
lda __w64lt_usefastload
beq __w64lt_image_il_ok__image
lda __w64lt_fastloadstatus
bne __w64lt_image_il_ok__image
inc __w64lt_fastloadstatus
lda #<__w64lt_drivecode
ldx #>__w64lt_drivecode
ldy #(__w64lt_drvend-__w64lt_drvstart+__w64lt_MW_LENGTH-1)/__w64lt_MW_LENGTH
__w64lt_image_ifl_begin__image:
__w64lt_image_ifl_begin = __w64lt_image_ifl_begin__image - web64_loader_transport_image + WEB64_LOADER_TRANSPORT_ADDRESS
__w64lt_ifl_begin = __w64lt_image_ifl_begin
sta __w64lt_ifl_senddata+1
stx __w64lt_ifl_senddata+2
sty __w64lt_loadtempreg
jsr __w64lt_kernalon
lda #>__w64lt_drvstart
sta __w64lt_ifl_mwstring+1
ldy #$00
sty __w64lt_ifl_mwstring+2
beq __w64lt_image_ifl_nextpacket__image
__w64lt_image_ifl_sendmw__image:
__w64lt_image_ifl_sendmw = __w64lt_image_ifl_sendmw__image - web64_loader_transport_image + WEB64_LOADER_TRANSPORT_ADDRESS
__w64lt_ifl_sendmw = __w64lt_image_ifl_sendmw
lda __w64lt_ifl_mwstring,x
jsr __w64lt_ciout
dex
bpl __w64lt_image_ifl_sendmw__image
ldx #__w64lt_MW_LENGTH
__w64lt_image_ifl_senddata__image:
__w64lt_image_ifl_senddata = __w64lt_image_ifl_senddata__image - web64_loader_transport_image + WEB64_LOADER_TRANSPORT_ADDRESS
__w64lt_ifl_senddata = __w64lt_image_ifl_senddata
lda __w64lt_drivecode,y
jsr __w64lt_ciout
iny
bne __w64lt_image_ifl_notover__image
inc __w64lt_ifl_senddata+2
__w64lt_image_ifl_notover__image:
__w64lt_image_ifl_notover = __w64lt_image_ifl_notover__image - web64_loader_transport_image + WEB64_LOADER_TRANSPORT_ADDRESS
__w64lt_ifl_notover = __w64lt_image_ifl_notover
inc __w64lt_ifl_mwstring+2
bne __w64lt_image_ifl_notover2__image
inc __w64lt_ifl_mwstring+1
__w64lt_image_ifl_notover2__image:
__w64lt_image_ifl_notover2 = __w64lt_image_ifl_notover2__image - web64_loader_transport_image + WEB64_LOADER_TRANSPORT_ADDRESS
__w64lt_ifl_notover2 = __w64lt_image_ifl_notover2
dex
bne __w64lt_image_ifl_senddata__image
jsr __w64lt_unlsn
__w64lt_image_ifl_nextpacket__image:
__w64lt_image_ifl_nextpacket = __w64lt_image_ifl_nextpacket__image - web64_loader_transport_image + WEB64_LOADER_TRANSPORT_ADDRESS
__w64lt_ifl_nextpacket = __w64lt_image_ifl_nextpacket
lda __w64lt_fa
jsr __w64lt_listen
lda __w64lt_status
and #$80
bne __w64lt_image_ifl_error__image
lda #$6f
jsr __w64lt_second
ldx #$05
dec __w64lt_loadtempreg
bpl __w64lt_image_ifl_sendmw__image
__w64lt_image_ifl_sendme__image:
__w64lt_image_ifl_sendme = __w64lt_image_ifl_sendme__image - web64_loader_transport_image + WEB64_LOADER_TRANSPORT_ADDRESS
__w64lt_ifl_sendme = __w64lt_image_ifl_sendme
lda __w64lt_ifl_mestring-1,x
jsr __w64lt_ciout
dex
bne __w64lt_image_ifl_sendme__image
jsr __w64lt_unlsn
__w64lt_image_ifl_error__image:
__w64lt_image_ifl_error = __w64lt_image_ifl_error__image - web64_loader_transport_image + WEB64_LOADER_TRANSPORT_ADDRESS
__w64lt_ifl_error = __w64lt_image_ifl_error
jmp __w64lt_kernaloff
__w64lt_image_drivecode__image:
__w64lt_image_drivecode = __w64lt_image_drivecode__image - web64_loader_transport_image + WEB64_LOADER_TRANSPORT_ADDRESS
__w64lt_drivecode = __w64lt_image_drivecode
__w64lt_image_drvmain__image:
__w64lt_image_drvmain = __w64lt_image_drvmain__image - web64_loader_transport_image + WEB64_LOADER_TRANSPORT_ADDRESS
__w64lt_drvmain = __w64lt_image_drvmain - __w64lt_image_drivecode + __w64lt_drvstart
cli
lda #$00
__w64lt_image_drv_1800ac0__image:
__w64lt_image_drv_1800ac0 = __w64lt_image_drv_1800ac0__image - web64_loader_transport_image + WEB64_LOADER_TRANSPORT_ADDRESS
__w64lt_drv_1800ac0 = __w64lt_image_drv_1800ac0 - __w64lt_image_drivecode + __w64lt_drvstart
sta $1800
ldx #$00
__w64lt_image_drv_nameloop__image:
__w64lt_image_drv_nameloop = __w64lt_image_drv_nameloop__image - web64_loader_transport_image + WEB64_LOADER_TRANSPORT_ADDRESS
__w64lt_drv_nameloop = __w64lt_image_drv_nameloop - __w64lt_image_drivecode + __w64lt_drvstart
ldy #$08
__w64lt_image_drv_namebitloop__image:
__w64lt_image_drv_namebitloop = __w64lt_image_drv_namebitloop__image - web64_loader_transport_image + WEB64_LOADER_TRANSPORT_ADDRESS
__w64lt_drv_namebitloop = __w64lt_image_drv_namebitloop - __w64lt_image_drivecode + __w64lt_drvstart
__w64lt_image_drv_1800ac1__image:
__w64lt_image_drv_1800ac1 = __w64lt_image_drv_1800ac1__image - web64_loader_transport_image + WEB64_LOADER_TRANSPORT_ADDRESS
__w64lt_drv_1800ac1 = __w64lt_image_drv_1800ac1 - __w64lt_image_drivecode + __w64lt_drvstart
lda $1800
bpl __w64lt_image_drv_noquit__image
jmp __w64lt_drv_quit
__w64lt_image_drv_noquit__image:
__w64lt_image_drv_noquit = __w64lt_image_drv_noquit__image - web64_loader_transport_image + WEB64_LOADER_TRANSPORT_ADDRESS
__w64lt_drv_noquit = __w64lt_image_drv_noquit - __w64lt_image_drivecode + __w64lt_drvstart
and #$05
beq __w64lt_image_drv_namebitloop__image
lsr
lda #$02
bcc __w64lt_image_drv_namezero__image
lda #$08
__w64lt_image_drv_namezero__image:
__w64lt_image_drv_namezero = __w64lt_image_drv_namezero__image - web64_loader_transport_image + WEB64_LOADER_TRANSPORT_ADDRESS
__w64lt_drv_namezero = __w64lt_image_drv_namezero - __w64lt_image_drivecode + __w64lt_drvstart
ror __w64lt_drv_filename,x
__w64lt_image_drv_1800ac2__image:
__w64lt_image_drv_1800ac2 = __w64lt_image_drv_1800ac2__image - web64_loader_transport_image + WEB64_LOADER_TRANSPORT_ADDRESS
__w64lt_drv_1800ac2 = __w64lt_image_drv_1800ac2 - __w64lt_image_drivecode + __w64lt_drvstart
sta $1800
__w64lt_image_drv_namewait__image:
__w64lt_image_drv_namewait = __w64lt_image_drv_namewait__image - web64_loader_transport_image + WEB64_LOADER_TRANSPORT_ADDRESS
__w64lt_drv_namewait = __w64lt_image_drv_namewait - __w64lt_image_drivecode + __w64lt_drvstart
__w64lt_image_drv_1800ac3__image:
__w64lt_image_drv_1800ac3 = __w64lt_image_drv_1800ac3__image - web64_loader_transport_image + WEB64_LOADER_TRANSPORT_ADDRESS
__w64lt_drv_1800ac3 = __w64lt_image_drv_1800ac3 - __w64lt_image_drivecode + __w64lt_drvstart
lda $1800
bmi __w64lt_image_drv_quit__image
and #$05
cmp #$05
beq __w64lt_image_drv_namewait__image
lda #$00
__w64lt_image_drv_1800ac4__image:
__w64lt_image_drv_1800ac4 = __w64lt_image_drv_1800ac4__image - web64_loader_transport_image + WEB64_LOADER_TRANSPORT_ADDRESS
__w64lt_drv_1800ac4 = __w64lt_image_drv_1800ac4 - __w64lt_image_drivecode + __w64lt_drvstart
sta $1800
dey
bne __w64lt_image_drv_namebitloop__image
sei
inx
lda __w64lt_drv_filename-1,x
bne __w64lt_image_drv_nameloop__image
lda #$08
__w64lt_image_drv_1800ac5__image:
__w64lt_image_drv_1800ac5 = __w64lt_image_drv_1800ac5__image - web64_loader_transport_image + WEB64_LOADER_TRANSPORT_ADDRESS
__w64lt_drv_1800ac5 = __w64lt_image_drv_1800ac5 - __w64lt_image_drivecode + __w64lt_drvstart
sta $1800
__w64lt_image_drv_dirtrk__image:
__w64lt_image_drv_dirtrk = __w64lt_image_drv_dirtrk__image - web64_loader_transport_image + WEB64_LOADER_TRANSPORT_ADDRESS
__w64lt_drv_dirtrk = __w64lt_image_drv_dirtrk - __w64lt_image_drivecode + __w64lt_drvstart
ldx $1000
__w64lt_image_drv_dirsct__image:
__w64lt_image_drv_dirsct = __w64lt_image_drv_dirsct__image - web64_loader_transport_image + WEB64_LOADER_TRANSPORT_ADDRESS
__w64lt_drv_dirsct = __w64lt_image_drv_dirsct - __w64lt_image_drivecode + __w64lt_drvstart
ldy $1000
__w64lt_image_drv_dirloop__image:
__w64lt_image_drv_dirloop = __w64lt_image_drv_dirloop__image - web64_loader_transport_image + WEB64_LOADER_TRANSPORT_ADDRESS
__w64lt_drv_dirloop = __w64lt_image_drv_dirloop - __w64lt_image_drivecode + __w64lt_drvstart
jsr __w64lt_drv_readsector
bcs __w64lt_image_drv_readerror__image
ldy #$02
__w64lt_image_drv_nextfile__image:
__w64lt_image_drv_nextfile = __w64lt_image_drv_nextfile__image - web64_loader_transport_image + WEB64_LOADER_TRANSPORT_ADDRESS
__w64lt_drv_nextfile = __w64lt_image_drv_nextfile - __w64lt_image_drivecode + __w64lt_drvstart
lda __w64lt_buf,y
and #$83
cmp #$82
bne __w64lt_image_drv_notfound__image
ldx #$03
sty __w64lt_drv_namelda+1
lda #$a0
sta __w64lt_buf+19,y
__w64lt_image_drv_namecmploop__image:
__w64lt_image_drv_namecmploop = __w64lt_image_drv_namecmploop__image - web64_loader_transport_image + WEB64_LOADER_TRANSPORT_ADDRESS
__w64lt_drv_namecmploop = __w64lt_image_drv_namecmploop - __w64lt_image_drivecode + __w64lt_drvstart
lda __w64lt_drv_filename-3,x
cmp #$2a
beq __w64lt_image_drv_found__image
__w64lt_image_drv_namelda__image:
__w64lt_image_drv_namelda = __w64lt_image_drv_namelda__image - web64_loader_transport_image + WEB64_LOADER_TRANSPORT_ADDRESS
__w64lt_drv_namelda = __w64lt_image_drv_namelda - __w64lt_image_drivecode + __w64lt_drvstart
lda __w64lt_buf,x
cmp __w64lt_drv_filename-3,x
bne __w64lt_image_drv_namedone__image
inx
bne __w64lt_image_drv_namecmploop__image
__w64lt_image_drv_namedone__image:
__w64lt_image_drv_namedone = __w64lt_image_drv_namedone__image - web64_loader_transport_image + WEB64_LOADER_TRANSPORT_ADDRESS
__w64lt_drv_namedone = __w64lt_image_drv_namedone - __w64lt_image_drivecode + __w64lt_drvstart
cmp #$a0
bne __w64lt_image_drv_notfound__image
lda __w64lt_drv_filename-3,x
beq __w64lt_image_drv_found__image
__w64lt_image_drv_notfound__image:
__w64lt_image_drv_notfound = __w64lt_image_drv_notfound__image - web64_loader_transport_image + WEB64_LOADER_TRANSPORT_ADDRESS
__w64lt_drv_notfound = __w64lt_image_drv_notfound - __w64lt_image_drivecode + __w64lt_drvstart
tya
clc
adc #$20
tay
bcc __w64lt_image_drv_nextfile__image
ldy __w64lt_buf+1
ldx __w64lt_buf
bne __w64lt_image_drv_dirloop__image
__w64lt_image_drv_filenotfound__image:
__w64lt_image_drv_filenotfound = __w64lt_image_drv_filenotfound__image - web64_loader_transport_image + WEB64_LOADER_TRANSPORT_ADDRESS
__w64lt_drv_filenotfound = __w64lt_image_drv_filenotfound - __w64lt_image_drivecode + __w64lt_drvstart
ldx #$02
bne __w64lt_image_drv_loadend__image
__w64lt_image_drv_readerror__image:
__w64lt_image_drv_readerror = __w64lt_image_drv_readerror__image - web64_loader_transport_image + WEB64_LOADER_TRANSPORT_ADDRESS
; Completion codes, not a wire-protocol change: missing filename differs
; from an exhausted sector job and drive-not-ready (job status $0f).
ldx #$03
cmp #$0f
bne __w64lt_image_drv_loadend__image
ldx #$04
__w64lt_image_drv_loadend__image:
__w64lt_image_drv_loadend = __w64lt_image_drv_loadend__image - web64_loader_transport_image + WEB64_LOADER_TRANSPORT_ADDRESS
__w64lt_drv_loadend = __w64lt_image_drv_loadend - __w64lt_image_drivecode + __w64lt_drvstart
stx __w64lt_buf+2
lda #$00
sta __w64lt_buf
sta __w64lt_buf+1
beq __w64lt_image_drv_sendblk__image
__w64lt_image_drv_quit__image:
__w64lt_image_drv_quit = __w64lt_image_drv_quit__image - web64_loader_transport_image + WEB64_LOADER_TRANSPORT_ADDRESS
__w64lt_drv_quit = __w64lt_image_drv_quit - __w64lt_image_drivecode + __w64lt_drvstart
__w64lt_image_drv_drivetype__image:
__w64lt_image_drv_drivetype = __w64lt_image_drv_drivetype__image - web64_loader_transport_image + WEB64_LOADER_TRANSPORT_ADDRESS
__w64lt_drv_drivetype = __w64lt_image_drv_drivetype - __w64lt_image_drivecode + __w64lt_drvstart
ldx #$00
bne __w64lt_image_drv_quitnot1541__image
lda #$1a
sta $1802
jmp __w64lt_initialize
__w64lt_image_drv_quitnot1541__image:
__w64lt_image_drv_quitnot1541 = __w64lt_image_drv_quitnot1541__image - web64_loader_transport_image + WEB64_LOADER_TRANSPORT_ADDRESS
__w64lt_drv_quitnot1541 = __w64lt_image_drv_quitnot1541 - __w64lt_image_drivecode + __w64lt_drvstart
rts
__w64lt_image_drv_found__image:
__w64lt_image_drv_found = __w64lt_image_drv_found__image - web64_loader_transport_image + WEB64_LOADER_TRANSPORT_ADDRESS
__w64lt_drv_found = __w64lt_image_drv_found - __w64lt_image_drivecode + __w64lt_drvstart
iny
__w64lt_image_drv_nextsect__image:
__w64lt_image_drv_nextsect = __w64lt_image_drv_nextsect__image - web64_loader_transport_image + WEB64_LOADER_TRANSPORT_ADDRESS
__w64lt_drv_nextsect = __w64lt_image_drv_nextsect - __w64lt_image_drivecode + __w64lt_drvstart
ldx __w64lt_buf,y
beq __w64lt_image_drv_loadend__image
lda __w64lt_buf+1,y
tay
jsr __w64lt_drv_readsector
bcs __w64lt_image_drv_readerror__image
__w64lt_image_drv_sendblk__image:
__w64lt_image_drv_sendblk = __w64lt_image_drv_sendblk__image - web64_loader_transport_image + WEB64_LOADER_TRANSPORT_ADDRESS
__w64lt_drv_sendblk = __w64lt_image_drv_sendblk - __w64lt_image_drivecode + __w64lt_drvstart
lda #$04
ldx #$00
__w64lt_image_drv_1800ac6__image:
__w64lt_image_drv_1800ac6 = __w64lt_image_drv_1800ac6__image - web64_loader_transport_image + WEB64_LOADER_TRANSPORT_ADDRESS
__w64lt_drv_1800ac6 = __w64lt_image_drv_1800ac6 - __w64lt_image_drivecode + __w64lt_drvstart
stx $1800
__w64lt_image_drv_sendloop__image:
__w64lt_image_drv_sendloop = __w64lt_image_drv_sendloop__image - web64_loader_transport_image + WEB64_LOADER_TRANSPORT_ADDRESS
__w64lt_drv_sendloop = __w64lt_image_drv_sendloop - __w64lt_image_drivecode + __w64lt_drvstart
ldx __w64lt_buf
__w64lt_image_drv_zpac1__image:
__w64lt_image_drv_zpac1 = __w64lt_image_drv_zpac1__image - web64_loader_transport_image + WEB64_LOADER_TRANSPORT_ADDRESS
__w64lt_drv_zpac1 = __w64lt_image_drv_zpac1 - __w64lt_image_drivecode + __w64lt_drvstart
stx __w64lt_drvtemp
tay
__w64lt_image_drv_sendloop_bitpair__image:
__w64lt_image_drv_sendloop_bitpair = __w64lt_image_drv_sendloop_bitpair__image - web64_loader_transport_image + WEB64_LOADER_TRANSPORT_ADDRESS
__w64lt_drv_sendloop_bitpair = __w64lt_image_drv_sendloop_bitpair - __w64lt_image_drivecode + __w64lt_drvstart
ldx #$00
__w64lt_image_drv_zpac2__image:
__w64lt_image_drv_zpac2 = __w64lt_image_drv_zpac2__image - web64_loader_transport_image + WEB64_LOADER_TRANSPORT_ADDRESS
__w64lt_drv_zpac2 = __w64lt_image_drv_zpac2 - __w64lt_image_drivecode + __w64lt_drvstart
lsr __w64lt_drvtemp
bcs __w64lt_image_drv_sendloop_wait1__image
ldx #$02
__w64lt_image_drv_sendloop_wait1__image:
__w64lt_image_drv_sendloop_wait1 = __w64lt_image_drv_sendloop_wait1__image - web64_loader_transport_image + WEB64_LOADER_TRANSPORT_ADDRESS
__w64lt_drv_sendloop_wait1 = __w64lt_image_drv_sendloop_wait1 - __w64lt_image_drivecode + __w64lt_drvstart
__w64lt_image_drv_1800ac7__image:
__w64lt_image_drv_1800ac7 = __w64lt_image_drv_1800ac7__image - web64_loader_transport_image + WEB64_LOADER_TRANSPORT_ADDRESS
__w64lt_drv_1800ac7 = __w64lt_image_drv_1800ac7 - __w64lt_image_drivecode + __w64lt_drvstart
bit $1800
bmi __w64lt_image_drv_send_cancel__image
bne __w64lt_image_drv_sendloop_wait1__image
__w64lt_image_drv_1800ac8__image:
__w64lt_image_drv_1800ac8 = __w64lt_image_drv_1800ac8__image - web64_loader_transport_image + WEB64_LOADER_TRANSPORT_ADDRESS
__w64lt_drv_1800ac8 = __w64lt_image_drv_1800ac8 - __w64lt_image_drivecode + __w64lt_drvstart
stx $1800
ldx #$00
__w64lt_image_drv_zpac3__image:
__w64lt_image_drv_zpac3 = __w64lt_image_drv_zpac3__image - web64_loader_transport_image + WEB64_LOADER_TRANSPORT_ADDRESS
__w64lt_drv_zpac3 = __w64lt_image_drv_zpac3 - __w64lt_image_drivecode + __w64lt_drvstart
lsr __w64lt_drvtemp
bcs __w64lt_image_drv_sendloop_wait2__image
ldx #$02
__w64lt_image_drv_sendloop_wait2__image:
__w64lt_image_drv_sendloop_wait2 = __w64lt_image_drv_sendloop_wait2__image - web64_loader_transport_image + WEB64_LOADER_TRANSPORT_ADDRESS
__w64lt_drv_sendloop_wait2 = __w64lt_image_drv_sendloop_wait2 - __w64lt_image_drivecode + __w64lt_drvstart
__w64lt_image_drv_1800ac9__image:
__w64lt_image_drv_1800ac9 = __w64lt_image_drv_1800ac9__image - web64_loader_transport_image + WEB64_LOADER_TRANSPORT_ADDRESS
__w64lt_drv_1800ac9 = __w64lt_image_drv_1800ac9 - __w64lt_image_drivecode + __w64lt_drvstart
bit $1800
bmi __w64lt_image_drv_send_cancel__image
beq __w64lt_image_drv_sendloop_wait2__image
__w64lt_image_drv_1800ac10__image:
__w64lt_image_drv_1800ac10 = __w64lt_image_drv_1800ac10__image - web64_loader_transport_image + WEB64_LOADER_TRANSPORT_ADDRESS
__w64lt_drv_1800ac10 = __w64lt_image_drv_1800ac10 - __w64lt_image_drivecode + __w64lt_drvstart
stx $1800
dey
bne __w64lt_image_drv_sendloop_bitpair__image
inc __w64lt_drv_sendloop+1
bne __w64lt_image_drv_sendloop__image
__w64lt_image_drv_sendloop_endwait__image:
__w64lt_image_drv_sendloop_endwait = __w64lt_image_drv_sendloop_endwait__image - web64_loader_transport_image + WEB64_LOADER_TRANSPORT_ADDRESS
__w64lt_drv_sendloop_endwait = __w64lt_image_drv_sendloop_endwait - __w64lt_image_drivecode + __w64lt_drvstart
__w64lt_image_drv_1800ac11__image:
__w64lt_image_drv_1800ac11 = __w64lt_image_drv_1800ac11__image - web64_loader_transport_image + WEB64_LOADER_TRANSPORT_ADDRESS
__w64lt_drv_1800ac11 = __w64lt_image_drv_1800ac11 - __w64lt_image_drivecode + __w64lt_drvstart
bit $1800
bmi __w64lt_image_drv_send_cancel__image
bne __w64lt_image_drv_sendloop_endwait__image
asl
__w64lt_image_drv_1800ac12__image:
__w64lt_image_drv_1800ac12 = __w64lt_image_drv_1800ac12__image - web64_loader_transport_image + WEB64_LOADER_TRANSPORT_ADDRESS
__w64lt_drv_1800ac12 = __w64lt_image_drv_1800ac12 - __w64lt_image_drivecode + __w64lt_drvstart
sta $1800
lda __w64lt_buf
ora __w64lt_buf+1
bne __w64lt_image_drv_nextsect__image
jmp __w64lt_drvmain
__w64lt_image_drv_send_cancel__image:
__w64lt_image_drv_send_cancel = __w64lt_image_drv_send_cancel__image - web64_loader_transport_image + WEB64_LOADER_TRANSPORT_ADDRESS
jmp __w64lt_drv_quit
__w64lt_image_drv_readsector__image:
__w64lt_image_drv_readsector = __w64lt_image_drv_readsector__image - web64_loader_transport_image + WEB64_LOADER_TRANSPORT_ADDRESS
__w64lt_drv_readsector = __w64lt_image_drv_readsector - __w64lt_image_drivecode + __w64lt_drvstart
jsr __w64lt_drv_led
__w64lt_image_drv_readtrk__image:
__w64lt_image_drv_readtrk = __w64lt_image_drv_readtrk__image - web64_loader_transport_image + WEB64_LOADER_TRANSPORT_ADDRESS
__w64lt_drv_readtrk = __w64lt_image_drv_readtrk - __w64lt_image_drivecode + __w64lt_drvstart
stx $1000
__w64lt_image_drv_readsct__image:
__w64lt_image_drv_readsct = __w64lt_image_drv_readsct__image - web64_loader_transport_image + WEB64_LOADER_TRANSPORT_ADDRESS
__w64lt_drv_readsct = __w64lt_image_drv_readsct - __w64lt_image_drivecode + __w64lt_drvstart
sty $1000
lda #__w64lt_RETRIES
sta __w64lt_drv_retry_count
__w64lt_image_drv_retry__image:
__w64lt_image_drv_retry = __w64lt_image_drv_retry__image - web64_loader_transport_image + WEB64_LOADER_TRANSPORT_ADDRESS
__w64lt_drv_retry = __w64lt_image_drv_retry - __w64lt_image_drivecode + __w64lt_drvstart
lda #$80
ldx #1
__w64lt_image_drv_execjsr__image:
__w64lt_image_drv_execjsr = __w64lt_image_drv_execjsr__image - web64_loader_transport_image + WEB64_LOADER_TRANSPORT_ADDRESS
__w64lt_drv_execjsr = __w64lt_image_drv_execjsr - __w64lt_image_drivecode + __w64lt_drvstart
jsr __w64lt_drv_1541exec
cmp #$02
bcc __w64lt_image_drv_success__image
dec __w64lt_drv_retry_count
bne __w64lt_image_drv_retry__image
pha
jsr __w64lt_drv_led
pla
sec
rts
__w64lt_image_drv_success__image:
__w64lt_image_drv_success = __w64lt_image_drv_success__image - web64_loader_transport_image + WEB64_LOADER_TRANSPORT_ADDRESS
__w64lt_drv_success = __w64lt_image_drv_success - __w64lt_image_drivecode + __w64lt_drvstart
sei
clc
__w64lt_image_drv_led__image:
__w64lt_image_drv_led = __w64lt_image_drv_led__image - web64_loader_transport_image + WEB64_LOADER_TRANSPORT_ADDRESS
__w64lt_drv_led = __w64lt_image_drv_led - __w64lt_image_drivecode + __w64lt_drvstart
lda #$08
__w64lt_image_drv_ledac1__image:
__w64lt_image_drv_ledac1 = __w64lt_image_drv_ledac1__image - web64_loader_transport_image + WEB64_LOADER_TRANSPORT_ADDRESS
__w64lt_drv_ledac1 = __w64lt_image_drv_ledac1 - __w64lt_image_drivecode + __w64lt_drvstart
eor $1c00
__w64lt_image_drv_ledac2__image:
__w64lt_image_drv_ledac2 = __w64lt_image_drv_ledac2__image - web64_loader_transport_image + WEB64_LOADER_TRANSPORT_ADDRESS
__w64lt_drv_ledac2 = __w64lt_image_drv_ledac2 - __w64lt_image_drivecode + __w64lt_drvstart
sta $1c00
rts
__w64lt_image_drv_1541exec__image:
__w64lt_image_drv_1541exec = __w64lt_image_drv_1541exec__image - web64_loader_transport_image + WEB64_LOADER_TRANSPORT_ADDRESS
__w64lt_drv_1541exec = __w64lt_image_drv_1541exec - __w64lt_image_drivecode + __w64lt_drvstart
sta $01
cli
__w64lt_image_drv_1541execwait__image:
__w64lt_image_drv_1541execwait = __w64lt_image_drv_1541execwait__image - web64_loader_transport_image + WEB64_LOADER_TRANSPORT_ADDRESS
__w64lt_drv_1541execwait = __w64lt_image_drv_1541execwait - __w64lt_image_drivecode + __w64lt_drvstart
lda $01
bmi __w64lt_image_drv_1541execwait__image
pha
lda __w64lt_id
sta __w64lt_iddrv0
lda __w64lt_id+1
sta __w64lt_iddrv0+1
pla
rts
__w64lt_image_drv_fdexec__image:
__w64lt_image_drv_fdexec = __w64lt_image_drv_fdexec__image - web64_loader_transport_image + WEB64_LOADER_TRANSPORT_ADDRESS
__w64lt_drv_fdexec = __w64lt_image_drv_fdexec - __w64lt_image_drivecode + __w64lt_drvstart
jsr $ff54
lda $03
rts
__w64lt_image_drv_1541dirtrk__image:
__w64lt_image_drv_1541dirtrk = __w64lt_image_drv_1541dirtrk__image - web64_loader_transport_image + WEB64_LOADER_TRANSPORT_ADDRESS
__w64lt_drv_1541dirtrk = __w64lt_image_drv_1541dirtrk - __w64lt_image_drivecode + __w64lt_drvstart
.byte 18
__w64lt_image_drv_1541dirsct__image:
__w64lt_image_drv_1541dirsct = __w64lt_image_drv_1541dirsct__image - web64_loader_transport_image + WEB64_LOADER_TRANSPORT_ADDRESS
__w64lt_drv_1541dirsct = __w64lt_image_drv_1541dirsct - __w64lt_image_drivecode + __w64lt_drvstart
.byte 1
__w64lt_image_drv_1581dirsct__image:
__w64lt_image_drv_1581dirsct = __w64lt_image_drv_1581dirsct__image - web64_loader_transport_image + WEB64_LOADER_TRANSPORT_ADDRESS
__w64lt_drv_1581dirsct = __w64lt_image_drv_1581dirsct - __w64lt_image_drivecode + __w64lt_drvstart
.byte 3
__w64lt_image_drv_filename__image:
__w64lt_image_drv_filename = __w64lt_image_drv_filename__image - web64_loader_transport_image + WEB64_LOADER_TRANSPORT_ADDRESS
__w64lt_drv_filename = __w64lt_image_drv_filename - __w64lt_image_drivecode + __w64lt_drvstart
.fill 17,0
__w64lt_image_drv_retry_count__image:
__w64lt_image_drv_retry_count = __w64lt_image_drv_retry_count__image - web64_loader_transport_image + WEB64_LOADER_TRANSPORT_ADDRESS
__w64lt_drv_retry_count = __w64lt_image_drv_retry_count - __w64lt_image_drivecode + __w64lt_drvstart
.byte 0
__w64lt_image_drvend__image:
__w64lt_image_drvend = __w64lt_image_drvend__image - web64_loader_transport_image + WEB64_LOADER_TRANSPORT_ADDRESS
__w64lt_drvend = __w64lt_image_drvend - __w64lt_image_drivecode + __w64lt_drvstart
__w64lt_image_ifl_mwstring__image:
__w64lt_image_ifl_mwstring = __w64lt_image_ifl_mwstring__image - web64_loader_transport_image + WEB64_LOADER_TRANSPORT_ADDRESS
__w64lt_ifl_mwstring = __w64lt_image_ifl_mwstring
.byte __w64lt_MW_LENGTH,$00,$00,87,45,77
__w64lt_image_ifl_mestring__image:
__w64lt_image_ifl_mestring = __w64lt_image_ifl_mestring__image - web64_loader_transport_image + WEB64_LOADER_TRANSPORT_ADDRESS
__w64lt_ifl_mestring = __w64lt_image_ifl_mestring
.byte >__w64lt_drvstart, <__w64lt_drvstart, 69,45,77
__w64lt_image_usefastload__image:
__w64lt_image_usefastload = __w64lt_image_usefastload__image - web64_loader_transport_image + WEB64_LOADER_TRANSPORT_ADDRESS
__w64lt_usefastload = __w64lt_image_usefastload
.byte 0
__w64lt_image_useserial__image:
__w64lt_image_useserial = __w64lt_image_useserial__image - web64_loader_transport_image + WEB64_LOADER_TRANSPORT_ADDRESS
__w64lt_useserial = __w64lt_image_useserial
.byte 1
__w64lt_image_wait__image:
__w64lt_image_wait = __w64lt_image_wait__image - web64_loader_transport_image + WEB64_LOADER_TRANSPORT_ADDRESS
__w64lt_wait = __w64lt_image_wait
pha
lda __w64loader_abort_requested
beq __w64lt_image_wait_clock__image
pla
sec
rts
__w64lt_image_wait_clock__image:
__w64lt_image_wait_clock = __w64lt_image_wait_clock__image - web64_loader_transport_image + WEB64_LOADER_TRANSPORT_ADDRESS
__w64lt_wait_clock_read__image:
__w64lt_wait_clock_read = __w64lt_wait_clock_read__image - web64_loader_transport_image + WEB64_LOADER_TRANSPORT_ADDRESS
lda $ffff
sec
sbc __w64lt_wait_start
cmp #3
pla
rts
__w64lt_image_wait_start__image:
__w64lt_image_wait_start = __w64lt_image_wait_start__image - web64_loader_transport_image + WEB64_LOADER_TRANSPORT_ADDRESS
__w64lt_wait_start = __w64lt_image_wait_start
.byte 0
__w64lt_image_abort__image:
__w64lt_image_abort = __w64lt_image_abort__image - web64_loader_transport_image + WEB64_LOADER_TRANSPORT_ADDRESS
__w64lt_abort = __w64lt_image_abort
lda #0
sta __w64lt_fileopen
sta __w64lt_fastloadstatus
; Release CLK/DATA and pulse ATN so the drive returns to DOS.
lda $dd00
and #$c7
ora #8
sta $dd00
ldx #0
__w64lt_image_abort_delay__image:
__w64lt_image_abort_delay = __w64lt_image_abort_delay__image - web64_loader_transport_image + WEB64_LOADER_TRANSPORT_ADDRESS
dex
bne __w64lt_image_abort_delay__image
lda $dd00
and #$f7
sta $dd00
lda #2
sta __w64lt_fileclosed+1
sec
rts
__w64lt_runtime_image_end__image:
__w64lt_runtime_image_end = __w64lt_runtime_image_end__image - web64_loader_transport_image + WEB64_LOADER_TRANSPORT_ADDRESS
; _web64_rt exact-width named argument window for web64_loader_init
_web64_loader_init__arg_window__image:
_web64_loader_init__arg_window = _web64_loader_init__arg_window__image - web64_loader_transport_image + WEB64_LOADER_TRANSPORT_ADDRESS
_web64_loader_init__arg_window_size = 5
_web64_loader_init__arg0 = _web64_loader_init__arg_device
_web64_loader_init__arg_device__width = 1
_web64_loader_init__arg_device__offset = 0
_web64_loader_init__arg_device__image:
_web64_loader_init__arg_device = _web64_loader_init__arg_device__image - web64_loader_transport_image + WEB64_LOADER_TRANSPORT_ADDRESS
__web64_fn_web64_loader_init_param_device_0__image:
__web64_fn_web64_loader_init_param_device_0 = __web64_fn_web64_loader_init_param_device_0__image - web64_loader_transport_image + WEB64_LOADER_TRANSPORT_ADDRESS
.byte 0
_web64_loader_init__arg1 = _web64_loader_init__arg_sector
_web64_loader_init__arg_sector__width = 2
_web64_loader_init__arg_sector__offset = 1
_web64_loader_init__arg_sector__image:
_web64_loader_init__arg_sector = _web64_loader_init__arg_sector__image - web64_loader_transport_image + WEB64_LOADER_TRANSPORT_ADDRESS
__web64_fn_web64_loader_init_param_sector_1__image:
__web64_fn_web64_loader_init_param_sector_1 = __web64_fn_web64_loader_init_param_sector_1__image - web64_loader_transport_image + WEB64_LOADER_TRANSPORT_ADDRESS
.word 0
_web64_loader_init__arg2 = _web64_loader_init__arg_ticks
_web64_loader_init__arg_ticks__width = 2
_web64_loader_init__arg_ticks__offset = 3
_web64_loader_init__arg_ticks__image:
_web64_loader_init__arg_ticks = _web64_loader_init__arg_ticks__image - web64_loader_transport_image + WEB64_LOADER_TRANSPORT_ADDRESS
__web64_fn_web64_loader_init_param_ticks_2__image:
__web64_fn_web64_loader_init_param_ticks_2 = __web64_fn_web64_loader_init_param_ticks_2__image - web64_loader_transport_image + WEB64_LOADER_TRANSPORT_ADDRESS
.word 0
_web64_loader_init__image:
_web64_loader_init = _web64_loader_init__image - web64_loader_transport_image + WEB64_LOADER_TRANSPORT_ADDRESS
cld
lda __w64loader_phase
beq __w64loader_init_idle__image
lda #15
rts
__w64loader_init_idle__image:
__w64loader_init_idle = __w64loader_init_idle__image - web64_loader_transport_image + WEB64_LOADER_TRANSPORT_ADDRESS
; A failed fresh initialization never leaves an older drive configuration
; apparently ready. Validate all caller-owned RAM before patching operands.
lda #0
sta __w64loader_ready
sta __w64loader_configured
sta __w64lt_usefastload
sta __w64lt_getbyte_usefastload+1
lda _web64_loader_init__arg_device
cmp #8
bcc __w64loader_init_invalid__image
cmp #31
bcs __w64loader_init_invalid__image
lda _web64_loader_init__arg_sector
bne __w64loader_init_invalid__image
lda _web64_loader_init__arg_sector+1
cmp #2
bcc __w64loader_init_invalid__image
cmp #$ff
beq __w64loader_init_invalid__image
cmp #$d0
bcc __w64loader_init_sector_ok__image
cmp #$e0
bcc __w64loader_init_invalid__image
__w64loader_init_sector_ok__image:
__w64loader_init_sector_ok = __w64loader_init_sector_ok__image - web64_loader_transport_image + WEB64_LOADER_TRANSPORT_ADDRESS
cmp #>__w64loader_transport_begin
bcc __w64loader_init_sector_owned__image
cmp #>(__w64loader_transport_end-1)+1
bcc __w64loader_init_invalid__image
__w64loader_init_sector_owned__image:
__w64loader_init_sector_owned = __w64loader_init_sector_owned__image - web64_loader_transport_image + WEB64_LOADER_TRANSPORT_ADDRESS
lda _web64_loader_init__arg_ticks+1
cmp #2
bcc __w64loader_init_invalid__image
cmp _web64_loader_init__arg_sector+1
beq __w64loader_init_invalid__image
cmp #>__w64loader_transport_begin
bcc __w64loader_init_clock_owned__image
cmp #>(__w64loader_transport_end-1)+1
bcc __w64loader_init_invalid__image
jmp __w64loader_init_clock_owned
__w64loader_init_invalid__image:
__w64loader_init_invalid = __w64loader_init_invalid__image - web64_loader_transport_image + WEB64_LOADER_TRANSPORT_ADDRESS
lda #13
sta __w64loader_status
rts
__w64loader_init_clock_owned__image:
__w64loader_init_clock_owned = __w64loader_init_clock_owned__image - web64_loader_transport_image + WEB64_LOADER_TRANSPORT_ADDRESS
cmp #$d0
bcc __w64loader_init_clock_ram__image
cmp #$e0
bcc __w64loader_init_invalid__image
__w64loader_init_clock_ram__image:
__w64loader_init_clock_ram = __w64loader_init_clock_ram__image - web64_loader_transport_image + WEB64_LOADER_TRANSPORT_ADDRESS
lda _web64_loader_init__arg_ticks
clc
adc #1
tay
lda _web64_loader_init__arg_ticks+1
adc #0
bcs __w64loader_init_invalid__image
cmp _web64_loader_init__arg_sector+1
beq __w64loader_init_invalid__image
cmp #>__w64loader_transport_begin
bcc __w64loader_init_clock_high_owned__image
cmp #>(__w64loader_transport_end-1)+1
bcc __w64loader_init_invalid__image
__w64loader_init_clock_high_owned__image:
__w64loader_init_clock_high_owned = __w64loader_init_clock_high_owned__image - web64_loader_transport_image + WEB64_LOADER_TRANSPORT_ADDRESS
cmp #$d0
bcc __w64loader_init_clock_ok__image
cmp #$e0
bcc __w64loader_init_invalid__image
cmp #$ff
bne __w64loader_init_clock_ok__image
cpy #$fa
bcs __w64loader_init_invalid__image
__w64loader_init_clock_ok__image:
__w64loader_init_clock_ok = __w64loader_init_clock_ok__image - web64_loader_transport_image + WEB64_LOADER_TRANSPORT_ADDRESS
sta __w64lt_wait_clock_read+2
sta __w64loader_sample_clock+2
sty __w64lt_wait_clock_read+1
sty __w64loader_sample_clock+1
lda _web64_loader_init__arg_device
sta __w64loader_device
lda _web64_loader_init__arg_sector+1
sta __w64loader_sector_page
sta __w64lt_fastload_store+2
sta __w64lt_buffer_head+2
sta __w64lt_buffer_tail+2
sta __w64lt_buffer_error+2
sta __w64lt_buffer_read+2
; The caller supplies a monotonic 16-bit IRQ frame clock. Only its high
; byte is sampled by the preserved approximately 10–15 PAL second timeout.
lda #0
sta __w64loader_detected_type
jsr __w64loader_rom_enter
jsr __w64lt_initloader
lda __w64loader_detected_type
bne __w64loader_init_unsupported__image
lda __w64lt_usefastload
beq __w64loader_init_unavailable__image
lda #1
sta __w64loader_configured
jsr __w64lt_initfastload
jmp __w64loader_upload_result
__w64loader_init_unsupported__image:
__w64loader_init_unsupported = __w64loader_init_unsupported__image - web64_loader_transport_image + WEB64_LOADER_TRANSPORT_ADDRESS
lda #14
bne __w64loader_init_return__image
__w64loader_init_unavailable__image:
__w64loader_init_unavailable = __w64loader_init_unavailable__image - web64_loader_transport_image + WEB64_LOADER_TRANSPORT_ADDRESS
lda #3
bne __w64loader_init_return__image
_web64_loader_reinitialize_after_save__image:
_web64_loader_reinitialize_after_save = _web64_loader_reinitialize_after_save__image - web64_loader_transport_image + WEB64_LOADER_TRANSPORT_ADDRESS
cld
lda __w64loader_phase
beq __w64loader_reinit_idle__image
lda #15
rts
__w64loader_reinit_idle__image:
__w64loader_reinit_idle = __w64loader_reinit_idle__image - web64_loader_transport_image + WEB64_LOADER_TRANSPORT_ADDRESS
lda __w64loader_configured
beq __w64loader_reinit_unconfigured__image
lda #0
sta __w64loader_ready
sta __w64lt_fastloadstatus
sta __w64lt_fileopen
jsr __w64loader_rom_enter
jsr __w64lt_initfastload
__w64loader_upload_result__image:
__w64loader_upload_result = __w64loader_upload_result__image - web64_loader_transport_image + WEB64_LOADER_TRANSPORT_ADDRESS
lda $90
and #$c0
bne __w64loader_init_unavailable__image
lda #1
sta __w64loader_ready
lda #0
__w64loader_init_return__image:
__w64loader_init_return = __w64loader_init_return__image - web64_loader_transport_image + WEB64_LOADER_TRANSPORT_ADDRESS
sta __w64loader_status
lda __w64loader_old_port
sta $01
lda __w64loader_old_messages
sta $9d
lda __w64loader_status
rts
__w64loader_reinit_unconfigured__image:
__w64loader_reinit_unconfigured = __w64loader_reinit_unconfigured__image - web64_loader_transport_image + WEB64_LOADER_TRANSPORT_ADDRESS
lda #12
sta __w64loader_status
rts
_web64_loader_shutdown__image:
_web64_loader_shutdown = _web64_loader_shutdown__image - web64_loader_transport_image + WEB64_LOADER_TRANSPORT_ADDRESS
lda __w64loader_phase
beq __w64loader_shutdown_idle__image
lda #15
rts
__w64loader_shutdown_idle__image:
__w64loader_shutdown_idle = __w64loader_shutdown_idle__image - web64_loader_transport_image + WEB64_LOADER_TRANSPORT_ADDRESS
jsr __w64lt_abort
lda #0
sta __w64loader_ready
sta __w64loader_status
rts
__w64loader_rom_enter__image:
__w64loader_rom_enter = __w64loader_rom_enter__image - web64_loader_transport_image + WEB64_LOADER_TRANSPORT_ADDRESS
lda $01
sta __w64loader_old_port
lda #$36
sta $01
lda $9d
sta __w64loader_old_messages
lda #0
sta $9d
sta __w64loader_abort_requested
sta $90
lda __w64loader_device
sta $ba
rts
__w64loader_sample_clock__image:
__w64loader_sample_clock = __w64loader_sample_clock__image - web64_loader_transport_image + WEB64_LOADER_TRANSPORT_ADDRESS
lda $ffff
rts
__w64loader_ready__image:
__w64loader_ready = __w64loader_ready__image - web64_loader_transport_image + WEB64_LOADER_TRANSPORT_ADDRESS
.byte 0
__w64loader_configured__image:
__w64loader_configured = __w64loader_configured__image - web64_loader_transport_image + WEB64_LOADER_TRANSPORT_ADDRESS
.byte 0
__w64loader_detected_type__image:
__w64loader_detected_type = __w64loader_detected_type__image - web64_loader_transport_image + WEB64_LOADER_TRANSPORT_ADDRESS
.byte 0
__w64loader_device__image:
__w64loader_device = __w64loader_device__image - web64_loader_transport_image + WEB64_LOADER_TRANSPORT_ADDRESS
.byte 0
__w64loader_sector_page__image:
__w64loader_sector_page = __w64loader_sector_page__image - web64_loader_transport_image + WEB64_LOADER_TRANSPORT_ADDRESS
.byte 0
__w64loader_old_port__image:
__w64loader_old_port = __w64loader_old_port__image - web64_loader_transport_image + WEB64_LOADER_TRANSPORT_ADDRESS
.byte 0
__w64loader_old_messages__image:
__w64loader_old_messages = __w64loader_old_messages__image - web64_loader_transport_image + WEB64_LOADER_TRANSPORT_ADDRESS
.byte 0
; Covert Bitops Loadersystem 2.29 / Lasse Oorni (MIT).
; One-bit, long-name configuration; see loader-licenses.md.
__w64lt_init_image__image:
__w64lt_init_image = __w64lt_init_image__image - web64_loader_transport_image + WEB64_LOADER_TRANSPORT_ADDRESS
__w64lt_image_initloader__image:
__w64lt_image_initloader = __w64lt_image_initloader__image - web64_loader_transport_image + WEB64_LOADER_TRANSPORT_ADDRESS
__w64lt_initloader = __w64lt_image_initloader
sta $d07f
lda #$00
sta __w64lt_messages
sta __w64lt_fastloadstatus
sta __w64lt_fileopen
__w64lt_image_il_detectdrive__image:
__w64lt_image_il_detectdrive = __w64lt_image_il_detectdrive__image - web64_loader_transport_image + WEB64_LOADER_TRANSPORT_ADDRESS
__w64lt_il_detectdrive = __w64lt_image_il_detectdrive
lda #$aa
sta $a5
lda #<__w64lt_il_drivecode
ldx #>__w64lt_il_drivecode
ldy #(__w64lt_il_driveend-__w64lt_il_drivecode+__w64lt_MW_LENGTH-1)/__w64lt_MW_LENGTH
jsr __w64lt_ifl_begin
lda __w64lt_status
and #$80
bne __w64lt_image_il_noserial__image
ldx #$00
ldy #$00
__w64lt_image_il_delay__image:
__w64lt_image_il_delay = __w64lt_image_il_delay__image - web64_loader_transport_image + WEB64_LOADER_TRANSPORT_ADDRESS
__w64lt_il_delay = __w64lt_image_il_delay
inx
bne __w64lt_image_il_delay__image
iny
bpl __w64lt_image_il_delay__image
lda __w64lt_fa
jsr __w64lt_listen
lda #$6f
jsr __w64lt_second
ldx #$05
__w64lt_image_il_ddsendmr__image:
__w64lt_image_il_ddsendmr = __w64lt_image_il_ddsendmr__image - web64_loader_transport_image + WEB64_LOADER_TRANSPORT_ADDRESS
__w64lt_il_ddsendmr = __w64lt_image_il_ddsendmr
lda __w64lt_il_mrstring,x
jsr __w64lt_ciout
dex
bpl __w64lt_image_il_ddsendmr__image
jsr __w64lt_unlsn
lda __w64lt_fa
jsr __w64lt_talk
lda #$6f
jsr __w64lt_tksa
lda #$00
jsr __w64lt_acptr
pha
jsr __w64lt_acptr
tax
jsr __w64lt_untlk
pla
cmp #$aa
beq __w64lt_image_il_fastloadok__image
lda $a5
cmp #$aa
bne __w64lt_image_il_nofastload__image
__w64lt_image_il_noserial__image:
__w64lt_image_il_noserial = __w64lt_image_il_noserial__image - web64_loader_transport_image + WEB64_LOADER_TRANSPORT_ADDRESS
__w64lt_il_noserial = __w64lt_image_il_noserial
dec __w64lt_useserial
__w64lt_image_il_nofastload__image:
__w64lt_image_il_nofastload = __w64lt_image_il_nofastload__image - web64_loader_transport_image + WEB64_LOADER_TRANSPORT_ADDRESS
__w64lt_il_nofastload = __w64lt_image_il_nofastload
rts
__w64lt_image_il_fastloadok__image:
__w64lt_image_il_fastloadok = __w64lt_image_il_fastloadok__image - web64_loader_transport_image + WEB64_LOADER_TRANSPORT_ADDRESS
__w64lt_il_fastloadok = __w64lt_image_il_fastloadok
stx __w64loader_detected_type
cpx #0
beq __w64lt_image_il_supported__image
rts
__w64lt_image_il_supported__image:
__w64lt_image_il_supported = __w64lt_image_il_supported__image - web64_loader_transport_image + WEB64_LOADER_TRANSPORT_ADDRESS
sta __w64lt_usefastload
sta __w64lt_getbyte_usefastload+1
stx __w64lt_il_drivetype+1
stx __w64lt_drv_drivetype+1-__w64lt_drvstart+__w64lt_drivecode
; Non-1541 families were rejected above; $1800 requires no patch table.
__w64lt_image_il_skippatch1800__image:
__w64lt_image_il_skippatch1800 = __w64lt_image_il_skippatch1800__image - web64_loader_transport_image + WEB64_LOADER_TRANSPORT_ADDRESS
__w64lt_il_skippatch1800 = __w64lt_image_il_skippatch1800
__w64lt_image_il_drivetype__image:
__w64lt_image_il_drivetype = __w64lt_image_il_drivetype__image - web64_loader_transport_image + WEB64_LOADER_TRANSPORT_ADDRESS
__w64lt_il_drivetype = __w64lt_image_il_drivetype
ldx #$00
lda __w64lt_il_dirtrklo,x
sta __w64lt_drv_dirtrk+1-__w64lt_drvstart+__w64lt_drivecode
lda __w64lt_il_dirtrkhi,x
sta __w64lt_drv_dirtrk+2-__w64lt_drvstart+__w64lt_drivecode
lda __w64lt_il_dirsctlo,x
sta __w64lt_drv_dirsct+1-__w64lt_drvstart+__w64lt_drivecode
lda __w64lt_il_dirscthi,x
sta __w64lt_drv_dirsct+2-__w64lt_drvstart+__w64lt_drivecode
lda __w64lt_il_execlo,x
sta __w64lt_drv_execjsr+1-__w64lt_drvstart+__w64lt_drivecode
lda __w64lt_il_exechi,x
sta __w64lt_drv_execjsr+2-__w64lt_drvstart+__w64lt_drivecode
lda __w64lt_il_jobtrklo,x
sta __w64lt_drv_readtrk+1-__w64lt_drvstart+__w64lt_drivecode
clc
adc #$01
sta __w64lt_drv_readsct+1-__w64lt_drvstart+__w64lt_drivecode
lda __w64lt_il_jobtrkhi,x
sta __w64lt_drv_readtrk+2-__w64lt_drvstart+__w64lt_drivecode
adc #$00
sta __w64lt_drv_readsct+2-__w64lt_drvstart+__w64lt_drivecode
lda __w64lt_il_zp,x
sta __w64lt_drv_zpac1+1-__w64lt_drvstart+__w64lt_drivecode
sta __w64lt_drv_zpac2+1-__w64lt_drvstart+__w64lt_drivecode
sta __w64lt_drv_zpac3+1-__w64lt_drvstart+__w64lt_drivecode
lda __w64lt_il_ledenabled,x
sta __w64lt_drv_led-__w64lt_drvstart+__w64lt_drivecode
lda __w64lt_il_ledbit,x
sta __w64lt_drv_led+1-__w64lt_drvstart+__w64lt_drivecode
lda __w64lt_il_ledadrhi,x
sta __w64lt_drv_ledac1+2-__w64lt_drvstart+__w64lt_drivecode
sta __w64lt_drv_ledac2+2-__w64lt_drvstart+__w64lt_drivecode
rts
__w64lt_image_il_drivecode__image:
__w64lt_image_il_drivecode = __w64lt_image_il_drivecode__image - web64_loader_transport_image + WEB64_LOADER_TRANSPORT_ADDRESS
__w64lt_il_drivecode = __w64lt_image_il_drivecode
asl __w64lt_ild_return1
lda $fea0
ldx #3
__w64lt_image_ild_floop__image:
__w64lt_image_ild_floop = __w64lt_image_ild_floop__image - web64_loader_transport_image + WEB64_LOADER_TRANSPORT_ADDRESS
__w64lt_ild_floop = __w64lt_image_ild_floop - __w64lt_image_il_drivecode + __w64lt_drvstart
cmp __w64lt_ild_family-1,x
beq __w64lt_image_ild_ffound__image
dex
bne __w64lt_image_ild_floop__image
beq __w64lt_image_ild_1541__image
__w64lt_image_ild_ffound__image:
__w64lt_image_ild_ffound = __w64lt_image_ild_ffound__image - web64_loader_transport_image + WEB64_LOADER_TRANSPORT_ADDRESS
__w64lt_ild_ffound = __w64lt_image_ild_ffound - __w64lt_image_il_drivecode + __w64lt_drvstart
lda __w64lt_ild_idloclo-1,x
sta __w64lt_ild_idlda+1
lda __w64lt_ild_idlochi-1,x
sta __w64lt_ild_idlda+2
__w64lt_image_ild_idlda__image:
__w64lt_image_ild_idlda = __w64lt_image_ild_idlda__image - web64_loader_transport_image + WEB64_LOADER_TRANSPORT_ADDRESS
__w64lt_ild_idlda = __w64lt_image_ild_idlda - __w64lt_image_il_drivecode + __w64lt_drvstart
lda $fea4
ldx #3
__w64lt_image_ild_idloop__image:
__w64lt_image_ild_idloop = __w64lt_image_ild_idloop__image - web64_loader_transport_image + WEB64_LOADER_TRANSPORT_ADDRESS
__w64lt_ild_idloop = __w64lt_image_ild_idloop - __w64lt_image_il_drivecode + __w64lt_drvstart
cmp __w64lt_ild_id-1,x
beq __w64lt_image_ild_idfound__image
dex
bne __w64lt_image_ild_idloop__image
__w64lt_image_ild_1541__image:
__w64lt_image_ild_1541 = __w64lt_image_ild_1541__image - web64_loader_transport_image + WEB64_LOADER_TRANSPORT_ADDRESS
__w64lt_ild_1541 = __w64lt_image_ild_1541 - __w64lt_image_il_drivecode + __w64lt_drvstart
__w64lt_image_ild_idfound__image:
__w64lt_image_ild_idfound = __w64lt_image_ild_idfound__image - web64_loader_transport_image + WEB64_LOADER_TRANSPORT_ADDRESS
__w64lt_ild_idfound = __w64lt_image_ild_idfound - __w64lt_image_il_drivecode + __w64lt_drvstart
stx __w64lt_ild_return2
rts
__w64lt_image_ild_family__image:
__w64lt_image_ild_family = __w64lt_image_ild_family__image - web64_loader_transport_image + WEB64_LOADER_TRANSPORT_ADDRESS
__w64lt_ild_family = __w64lt_image_ild_family - __w64lt_image_il_drivecode + __w64lt_drvstart
.byte $43,$0d,$ff
__w64lt_image_ild_idloclo__image:
__w64lt_image_ild_idloclo = __w64lt_image_ild_idloclo__image - web64_loader_transport_image + WEB64_LOADER_TRANSPORT_ADDRESS
__w64lt_ild_idloclo = __w64lt_image_ild_idloclo - __w64lt_image_il_drivecode + __w64lt_drvstart
.byte $a4,$c6,$e9
__w64lt_image_ild_idlochi__image:
__w64lt_image_ild_idlochi = __w64lt_image_ild_idlochi__image - web64_loader_transport_image + WEB64_LOADER_TRANSPORT_ADDRESS
__w64lt_ild_idlochi = __w64lt_image_ild_idlochi - __w64lt_image_il_drivecode + __w64lt_drvstart
.byte $fe,$e5,$a6
__w64lt_image_ild_id__image:
__w64lt_image_ild_id = __w64lt_image_ild_id__image - web64_loader_transport_image + WEB64_LOADER_TRANSPORT_ADDRESS
__w64lt_ild_id = __w64lt_image_ild_id - __w64lt_image_il_drivecode + __w64lt_drvstart
.byte 56,70,72
__w64lt_image_ild_return1__image:
__w64lt_image_ild_return1 = __w64lt_image_ild_return1__image - web64_loader_transport_image + WEB64_LOADER_TRANSPORT_ADDRESS
__w64lt_ild_return1 = __w64lt_image_ild_return1 - __w64lt_image_il_drivecode + __w64lt_drvstart
.byte $55
__w64lt_image_ild_return2__image:
__w64lt_image_ild_return2 = __w64lt_image_ild_return2__image - web64_loader_transport_image + WEB64_LOADER_TRANSPORT_ADDRESS
__w64lt_ild_return2 = __w64lt_image_ild_return2 - __w64lt_image_il_drivecode + __w64lt_drvstart
.byte 0
__w64lt_image_il_driveend__image:
__w64lt_image_il_driveend = __w64lt_image_il_driveend__image - web64_loader_transport_image + WEB64_LOADER_TRANSPORT_ADDRESS
__w64lt_il_driveend = __w64lt_image_il_driveend
__w64lt_image_il_mrstring__image:
__w64lt_image_il_mrstring = __w64lt_image_il_mrstring__image - web64_loader_transport_image + WEB64_LOADER_TRANSPORT_ADDRESS
__w64lt_il_mrstring = __w64lt_image_il_mrstring
.byte 2,>__w64lt_ild_return1,<__w64lt_ild_return1,82,45,77
__w64lt_image_il_dirtrklo__image:
__w64lt_image_il_dirtrklo = __w64lt_image_il_dirtrklo__image - web64_loader_transport_image + WEB64_LOADER_TRANSPORT_ADDRESS
__w64lt_il_dirtrklo = __w64lt_image_il_dirtrklo
.byte <__w64lt_drv_1541dirtrk,<$022b,<$54,<$2ba7
__w64lt_image_il_dirtrkhi__image:
__w64lt_image_il_dirtrkhi = __w64lt_image_il_dirtrkhi__image - web64_loader_transport_image + WEB64_LOADER_TRANSPORT_ADDRESS
__w64lt_il_dirtrkhi = __w64lt_image_il_dirtrkhi
.byte >__w64lt_drv_1541dirtrk,>$022b,>$54,>$2ba7
__w64lt_image_il_dirsctlo__image:
__w64lt_image_il_dirsctlo = __w64lt_image_il_dirsctlo__image - web64_loader_transport_image + WEB64_LOADER_TRANSPORT_ADDRESS
__w64lt_il_dirsctlo = __w64lt_image_il_dirsctlo
.byte <__w64lt_drv_1541dirsct,<__w64lt_drv_1581dirsct,<$56,<$2ba9
__w64lt_image_il_dirscthi__image:
__w64lt_image_il_dirscthi = __w64lt_image_il_dirscthi__image - web64_loader_transport_image + WEB64_LOADER_TRANSPORT_ADDRESS
__w64lt_il_dirscthi = __w64lt_image_il_dirscthi
.byte >__w64lt_drv_1541dirsct,>__w64lt_drv_1581dirsct,>$56,>$2ba9
__w64lt_image_il_execlo__image:
__w64lt_image_il_execlo = __w64lt_image_il_execlo__image - web64_loader_transport_image + WEB64_LOADER_TRANSPORT_ADDRESS
__w64lt_il_execlo = __w64lt_image_il_execlo
.byte <__w64lt_drv_1541exec,<$ff54,<__w64lt_drv_fdexec,<$ff4e
__w64lt_image_il_exechi__image:
__w64lt_image_il_exechi = __w64lt_image_il_exechi__image - web64_loader_transport_image + WEB64_LOADER_TRANSPORT_ADDRESS
__w64lt_il_exechi = __w64lt_image_il_exechi
.byte >__w64lt_drv_1541exec,>$ff54,>__w64lt_drv_fdexec,>$ff4e
__w64lt_image_il_jobtrklo__image:
__w64lt_image_il_jobtrklo = __w64lt_image_il_jobtrklo__image - web64_loader_transport_image + WEB64_LOADER_TRANSPORT_ADDRESS
__w64lt_il_jobtrklo = __w64lt_image_il_jobtrklo
.byte <$0008,<$000d,<$000d,<$2802
__w64lt_image_il_jobtrkhi__image:
__w64lt_image_il_jobtrkhi = __w64lt_image_il_jobtrkhi__image - web64_loader_transport_image + WEB64_LOADER_TRANSPORT_ADDRESS
__w64lt_il_jobtrkhi = __w64lt_image_il_jobtrkhi
.byte >$0008,>$000d,>$000d,>$2802
__w64lt_image_il_zp__image:
__w64lt_image_il_zp = __w64lt_image_il_zp__image - web64_loader_transport_image + WEB64_LOADER_TRANSPORT_ADDRESS
__w64lt_il_zp = __w64lt_image_il_zp
.byte $06,$0b,$0b,$06
__w64lt_image_il_ledenabled__image:
__w64lt_image_il_ledenabled = __w64lt_image_il_ledenabled__image - web64_loader_transport_image + WEB64_LOADER_TRANSPORT_ADDRESS
__w64lt_il_ledenabled = __w64lt_image_il_ledenabled
.byte $a9,$a9,$a9,$60
__w64lt_image_il_ledbit__image:
__w64lt_image_il_ledbit = __w64lt_image_il_ledbit__image - web64_loader_transport_image + WEB64_LOADER_TRANSPORT_ADDRESS
__w64lt_il_ledbit = __w64lt_image_il_ledbit
.byte $08,$40,$40,$00
__w64lt_image_il_ledadrhi__image:
__w64lt_image_il_ledadrhi = __w64lt_image_il_ledadrhi__image - web64_loader_transport_image + WEB64_LOADER_TRANSPORT_ADDRESS
__w64lt_il_ledadrhi = __w64lt_image_il_ledadrhi
.byte $1c,$40,$40,$40
__w64lt_init_image_end__image:
__w64lt_init_image_end = __w64lt_init_image_end__image - web64_loader_transport_image + WEB64_LOADER_TRANSPORT_ADDRESS
__w64loader_transport_end__image:
__w64loader_transport_end = __w64loader_transport_end__image - web64_loader_transport_image + WEB64_LOADER_TRANSPORT_ADDRESS
web64_loader_transport_image_end:
web64_loader_transport_image_size = web64_loader_transport_image_end - web64_loader_transport_image
web64/loader.h
Synchronous hardware loading and transactional W64X installation with caller-owned RAM, IRQ and lifecycle.
Included headers: <stdint.h>.
Functions:
| Name | Prototype | Description | Typical use |
|---|---|---|---|
web64_loader_load_raw | _web64_rt uint8_t web64_loader_load_raw(const web64_loader_request *request) | Web64 SDK runtime helper. | web64_loader_load_raw(...) |
web64_loader_load_packed | _web64_rt uint8_t web64_loader_load_packed(const web64_loader_request *request) | Web64 SDK runtime helper. | web64_loader_load_packed(...) |
web64_loader_unpack | _web64_rt uint8_t web64_loader_unpack(const web64_loader_packed_request *request) | Web64 SDK runtime helper. | web64_loader_unpack(...) |
web64_loader_init | _web64_rt uint8_t web64_loader_init(uint8_t device, uint8_t *sector, volatile uint16_t *ticks) | Web64 SDK runtime helper. | web64_loader_init(...) |
web64_loader_read | _web64_rt uint8_t web64_loader_read(const char *name, uint8_t length, uint8_t *stage, uint16_t capacity) | Web64 SDK runtime helper. | web64_loader_read(...) |
web64_loader_status | uint8_t web64_loader_status(void) | Web64 SDK runtime helper. | web64_loader_status(...) |
web64_loader_abort | void web64_loader_abort(void) | Web64 SDK runtime helper. | web64_loader_abort(...) |
web64_loader_shutdown | uint8_t web64_loader_shutdown(void) | Web64 SDK runtime helper. | web64_loader_shutdown(...) |
web64_loader_reinitialize_after_save | uint8_t web64_loader_reinitialize_after_save(void) | Web64 SDK runtime helper. | web64_loader_reinitialize_after_save(...) |
web64_loader_last_size | uint16_t web64_loader_last_size(void) | Web64 SDK runtime helper. | web64_loader_last_size(...) |
web64_loader_last_origin | uint16_t web64_loader_last_origin(void) | Web64 SDK runtime helper. | web64_loader_last_origin(...) |
Structs:
| Name | Description | Field summary |
|---|---|---|
web64_loader_packed_request | Public struct declared by <web64/loader.h>. | 17 fields: const uint8_t *stage, uint16_t length, uint8_t *destination, uint16_t capacity, ... |
Macros:
| Name | Value | Description |
|---|---|---|
WEB64_LOADER_OK | 0 | Macro constant exported by the header. |
WEB64_LOADER_NOT_FOUND | 1 | Macro constant exported by the header. |
WEB64_LOADER_TRANSPORT | 2 | Macro constant exported by the header. |
WEB64_LOADER_UNAVAILABLE | 3 | Macro constant exported by the header. |
WEB64_LOADER_HEADER | 4 | Macro constant exported by the header. |
WEB64_LOADER_INTEGRITY | 5 | Macro constant exported by the header. |
WEB64_LOADER_PACKED_SIZE | 6 | Macro constant exported by the header. |
WEB64_LOADER_UNPACKED_SIZE | 7 | Macro constant exported by the header. |
WEB64_LOADER_RANGE | 8 | Macro constant exported by the header. |
WEB64_LOADER_WORKSPACE | 9 | Macro constant exported by the header. |
WEB64_LOADER_DECOMPRESSION | 10 | Macro constant exported by the header. |
WEB64_LOADER_ABORTED | 11 | Macro constant exported by the header. |
WEB64_LOADER_NOT_INITIALIZED | 12 | Macro constant exported by the header. |
WEB64_LOADER_INVALID_ARGUMENT | 13 | Macro constant exported by the header. |
WEB64_LOADER_UNSUPPORTED_DRIVE | 14 | Macro constant exported by the header. |
WEB64_LOADER_BUSY | 15 | Macro constant exported by the header. |
WEB64_LOADER_ALL_BLOCKS | 255 | Macro constant exported by the header. |
Header listing:
#ifndef WEB64_LOADER_H
#define WEB64_LOADER_H
#include <stdint.h>
#define WEB64_LOADER_OK 0
#define WEB64_LOADER_NOT_FOUND 1
#define WEB64_LOADER_TRANSPORT 2
#define WEB64_LOADER_UNAVAILABLE 3
#define WEB64_LOADER_HEADER 4
#define WEB64_LOADER_INTEGRITY 5
#define WEB64_LOADER_PACKED_SIZE 6
#define WEB64_LOADER_UNPACKED_SIZE 7
#define WEB64_LOADER_RANGE 8
#define WEB64_LOADER_WORKSPACE 9
#define WEB64_LOADER_DECOMPRESSION 10
#define WEB64_LOADER_ABORTED 11
#define WEB64_LOADER_NOT_INITIALIZED 12
#define WEB64_LOADER_INVALID_ARGUMENT 13
#define WEB64_LOADER_UNSUPPORTED_DRIVE 14
#define WEB64_LOADER_BUSY 15
#define WEB64_LOADER_ALL_BLOCKS 255
typedef struct { const uint8_t *stage; uint16_t length; uint8_t *destination; uint16_t capacity; uint8_t *workspace; uint16_t workspace_capacity; uint8_t block; } web64_loader_packed_request;
typedef struct { const char *name; uint8_t name_length; uint8_t *stage; uint16_t stage_capacity; uint8_t *destination; uint16_t capacity; uint8_t *workspace; uint16_t workspace_capacity; uint8_t block; } web64_loader_request;
_web64_rt uint8_t web64_loader_load_raw(const web64_loader_request *request);
_web64_rt uint8_t web64_loader_load_packed(const web64_loader_request *request);
_web64_rt uint8_t web64_loader_unpack(const web64_loader_packed_request *request);
_web64_rt uint8_t web64_loader_init(uint8_t device, uint8_t *sector, volatile uint16_t *ticks);
_web64_rt uint8_t web64_loader_read(const char *name, uint8_t length, uint8_t *stage, uint16_t capacity);
uint8_t web64_loader_status(void);
void web64_loader_abort(void);
uint8_t web64_loader_shutdown(void);
uint8_t web64_loader_reinitialize_after_save(void);
uint16_t web64_loader_last_size(void);
uint16_t web64_loader_last_origin(void);
#endif
web64/loader.inc
Exact-width native ASM loader argument windows, request offsets and convenience macros.
Header listing:
WEB64_LOADER_OK = 0
WEB64_LOADER_NOT_FOUND = 1
WEB64_LOADER_TRANSPORT = 2
WEB64_LOADER_UNAVAILABLE = 3
WEB64_LOADER_HEADER = 4
WEB64_LOADER_INTEGRITY = 5
WEB64_LOADER_PACKED_SIZE = 6
WEB64_LOADER_UNPACKED_SIZE = 7
WEB64_LOADER_RANGE = 8
WEB64_LOADER_WORKSPACE = 9
WEB64_LOADER_DECOMPRESSION = 10
WEB64_LOADER_ABORTED = 11
WEB64_LOADER_NOT_INITIALIZED = 12
WEB64_LOADER_INVALID_ARGUMENT = 13
WEB64_LOADER_UNSUPPORTED_DRIVE = 14
WEB64_LOADER_BUSY = 15
WEB64_LOADER_ALL_BLOCKS = 255
WEB64_LOADER_PACKED_REQUEST_STAGE = 0
WEB64_LOADER_PACKED_REQUEST_LENGTH = 2
WEB64_LOADER_PACKED_REQUEST_DESTINATION = 4
WEB64_LOADER_PACKED_REQUEST_CAPACITY = 6
WEB64_LOADER_PACKED_REQUEST_WORKSPACE = 8
WEB64_LOADER_PACKED_REQUEST_WORKSPACE_CAPACITY = 10
WEB64_LOADER_PACKED_REQUEST_BLOCK = 12
WEB64_LOADER_PACKED_REQUEST_SIZE = 13
WEB64_LOADER_PACKED_REQUEST_ALL = 255
WEB64_LOADER_REQUEST_NAME = 0
WEB64_LOADER_REQUEST_NAME_LENGTH = 2
WEB64_LOADER_REQUEST_STAGE = 3
WEB64_LOADER_REQUEST_STAGE_CAPACITY = 5
WEB64_LOADER_REQUEST_DESTINATION = 7
WEB64_LOADER_REQUEST_CAPACITY = 9
WEB64_LOADER_REQUEST_WORKSPACE = 11
WEB64_LOADER_REQUEST_WORKSPACE_CAPACITY = 13
WEB64_LOADER_REQUEST_BLOCK = 15
WEB64_LOADER_REQUEST_SIZE = 16
; Web64 _web64_rt C/assembly call helpers for <web64/loader.h>
; Generated from native runtime registry v8; do not hand-edit.
; Arguments are immediate assembly expressions. Pass C globals with their emitted labels.
; Prepare helpers write the complete exact-width window and clobber A only.
; Call helpers prepare the window, JSR the public entry, and inherit its clobber/return contract.
; Helpers allocate no storage. Including this file, or leaving a helper unused, links zero runtime bytes.
WEB64_RT_LOADER_CALL_COUNT = 11
WEB64_RT_LOADER_WINDOW_CALL_COUNT = 5
; web64_loader_abort: parameterless entry _web64_loader_abort
.macro web64_rt_call_loader_abort
jsr _web64_loader_abort
.endmacro
; web64_loader_init: 5-byte window; entry _web64_loader_init
.macro web64_rt_prepare_loader_init device, sector, ticks
lda #device
sta _web64_loader_init__arg_device
lda #<sector
sta _web64_loader_init__arg_sector
lda #>sector
sta _web64_loader_init__arg_sector+1
lda #<ticks
sta _web64_loader_init__arg_ticks
lda #>ticks
sta _web64_loader_init__arg_ticks+1
.endmacro
.macro web64_rt_call_loader_init device, sector, ticks
web64_rt_prepare_loader_init device, sector, ticks
jsr _web64_loader_init
.endmacro
; web64_loader_last_origin: parameterless entry _web64_loader_last_origin
.macro web64_rt_call_loader_last_origin
jsr _web64_loader_last_origin
.endmacro
; web64_loader_last_size: parameterless entry _web64_loader_last_size
.macro web64_rt_call_loader_last_size
jsr _web64_loader_last_size
.endmacro
; web64_loader_load_packed: 2-byte window; entry _web64_loader_load_packed
.macro web64_rt_prepare_loader_load_packed request
lda #<request
sta _web64_loader_load_packed__arg_request
lda #>request
sta _web64_loader_load_packed__arg_request+1
.endmacro
.macro web64_rt_call_loader_load_packed request
web64_rt_prepare_loader_load_packed request
jsr _web64_loader_load_packed
.endmacro
; web64_loader_load_raw: 2-byte window; entry _web64_loader_load_raw
.macro web64_rt_prepare_loader_load_raw request
lda #<request
sta _web64_loader_load_raw__arg_request
lda #>request
sta _web64_loader_load_raw__arg_request+1
.endmacro
.macro web64_rt_call_loader_load_raw request
web64_rt_prepare_loader_load_raw request
jsr _web64_loader_load_raw
.endmacro
; web64_loader_read: 7-byte window; entry _web64_loader_read
.macro web64_rt_prepare_loader_read name, length, stage, capacity
lda #<name
sta _web64_loader_read__arg_name
lda #>name
sta _web64_loader_read__arg_name+1
lda #length
sta _web64_loader_read__arg_length
lda #<stage
sta _web64_loader_read__arg_stage
lda #>stage
sta _web64_loader_read__arg_stage+1
lda #<capacity
sta _web64_loader_read__arg_capacity
lda #>capacity
sta _web64_loader_read__arg_capacity+1
.endmacro
.macro web64_rt_call_loader_read name, length, stage, capacity
web64_rt_prepare_loader_read name, length, stage, capacity
jsr _web64_loader_read
.endmacro
; web64_loader_reinitialize_after_save: parameterless entry _web64_loader_reinitialize_after_save
.macro web64_rt_call_loader_reinitialize_after_save
jsr _web64_loader_reinitialize_after_save
.endmacro
; web64_loader_shutdown: parameterless entry _web64_loader_shutdown
.macro web64_rt_call_loader_shutdown
jsr _web64_loader_shutdown
.endmacro
; web64_loader_status: parameterless entry _web64_loader_status
.macro web64_rt_call_loader_status
jsr _web64_loader_status
.endmacro
; web64_loader_unpack: 2-byte window; entry _web64_loader_unpack
.macro web64_rt_prepare_loader_unpack request
lda #<request
sta _web64_loader_unpack__arg_request
lda #>request
sta _web64_loader_unpack__arg_request+1
.endmacro
.macro web64_rt_call_loader_unpack request
web64_rt_prepare_loader_unpack request
jsr _web64_loader_unpack
.endmacro
web64/motion.h
Independent subpixel motion primitives for acceleration, braking, clamping, wrapping, gravity, and integration.
Included headers: <web64/game.h>.
Functions:
| Name | Prototype | Description | Typical use |
|---|---|---|---|
web64_motion_axis | _web64_rt int16_t web64_motion_axis(int16_t velocity, int8_t intent, uint16_t acceleration, uint16_t braking, uint16_t maximum) | Applies one-axis acceleration, braking, direction intent, and speed clamping. | vx = web64_motion_axis(vx, intent, accel, brake, max_speed); |
web64_motion_steer_s16 | _web64_rt int16_t web64_motion_steer_s16(int16_t velocity, int8_t intent, uint8_t acceleration, uint8_t braking, uint8_t reversal, uint8_t maximum) | Applies signed 16-bit steering with explicit acceleration, braking, reversal, and maximum speed. | vx = web64_motion_steer_s16(vx, intent, accel, brake, reverse, max_speed); |
web64_motion_integrate | _web64_rt void web64_motion_integrate(uint16_t *position, int16_t velocity) | Adds signed velocity to an unsigned 16-bit position. | web64_motion_integrate(&x, vx); |
web64_motion_clamp | _web64_rt uint8_t web64_motion_clamp(uint16_t *position, int16_t *velocity, uint16_t minimum, uint16_t maximum) | Clamps an unsigned 16-bit position and zeroes velocity on boundary contact. | contacts = web64_motion_clamp(&x, &vx, min_x, max_x); |
web64_motion_wrap | _web64_rt void web64_motion_wrap(uint16_t *position, uint16_t minimum, uint16_t maximum) | Wraps an unsigned 16-bit position into a half-open range. | web64_motion_wrap(&x, 0, world_width); |
web64_motion_integrate_s16 | _web64_rt void web64_motion_integrate_s16(int16_t *position, int16_t velocity) | Adds signed velocity to a signed 16-bit position. | web64_motion_integrate_s16(&x, vx); |
web64_motion_clamp_s16 | _web64_rt uint8_t web64_motion_clamp_s16(int16_t *position, int16_t *velocity, int16_t minimum, int16_t maximum) | Clamps a signed 16-bit position and zeroes velocity on boundary contact. | contacts = web64_motion_clamp_s16(&y, &vy, min_y, max_y); |
web64_motion_wrap_s16 | _web64_rt void web64_motion_wrap_s16(int16_t *position, int16_t minimum, int16_t maximum) | Wraps a signed 16-bit position into a half-open range. | web64_motion_wrap_s16(&x, 0, world_width); |
Structs:
| Name | Description | Field summary |
|---|---|---|
Web64Body2D | Public struct declared by <web64/motion.h>. | 10 fields: web64_pos_t x, web64_pos_t y, web64_vel_t vx, web64_vel_t vy, ... |
Macros:
| Name | Value | Description |
|---|---|---|
WEB64_MOTION_HIT_MIN_X | 1 | Macro constant exported by the header. |
WEB64_MOTION_HIT_MAX_X | 2 | Macro constant exported by the header. |
WEB64_MOTION_HIT_MIN_Y | 4 | Macro constant exported by the header. |
WEB64_MOTION_HIT_MAX_Y | 8 | Macro constant exported by the header. |
web64_motion_apply_gravity(velocity, gravity, terminal) | web64_motion_axis((velocity), 1, (gravity), 0, (terminal)) | Macro constant exported by the header. |
web64_motion_jump(velocity, impulse) | ((velocity) = (web64_vel_t)(-(int16_t)(impulse))) | Typed pointer or expression macro. |
web64_motion_brake(velocity, braking) | web64_motion_axis((velocity), 0, 0, (braking), 0x7fff) | Macro constant exported by the header. |
web64_motion_platform(body, intent, profile) | ((body)->vx = web64_motion_axis((body)->vx, (intent), (profile)->acceleration, (profile)->braking, (profile)->maximum), (body)->vy = web64_motion_apply_gravity((body)->vy, (profile)->gravity, (profile)->terminal), web64_motion_integrate(&(body)->x, (body)->vx), web64_motion_integrate(&(body)->y, (body)->vy)) | Typed pointer or expression macro. |
Header listing:
#ifndef WEB64_MOTION_H
#define WEB64_MOTION_H
#include <web64/game.h>
#define WEB64_MOTION_HIT_MIN_X 1
#define WEB64_MOTION_HIT_MAX_X 2
#define WEB64_MOTION_HIT_MIN_Y 4
#define WEB64_MOTION_HIT_MAX_Y 8
typedef struct { web64_pos_t x; web64_pos_t y; web64_vel_t vx; web64_vel_t vy; } Web64Body2D;
typedef struct { uint16_t acceleration; uint16_t braking; uint16_t maximum; uint16_t gravity; uint16_t terminal; } Web64MotionProfile;
_web64_rt int16_t web64_motion_axis(int16_t velocity, int8_t intent, uint16_t acceleration, uint16_t braking, uint16_t maximum);
_web64_rt int16_t web64_motion_steer_s16(int16_t velocity, int8_t intent, uint8_t acceleration, uint8_t braking, uint8_t reversal, uint8_t maximum);
_web64_rt void web64_motion_integrate(uint16_t *position, int16_t velocity);
_web64_rt uint8_t web64_motion_clamp(uint16_t *position, int16_t *velocity, uint16_t minimum, uint16_t maximum);
_web64_rt void web64_motion_wrap(uint16_t *position, uint16_t minimum, uint16_t maximum);
_web64_rt void web64_motion_integrate_s16(int16_t *position, int16_t velocity);
_web64_rt uint8_t web64_motion_clamp_s16(int16_t *position, int16_t *velocity, int16_t minimum, int16_t maximum);
_web64_rt void web64_motion_wrap_s16(int16_t *position, int16_t minimum, int16_t maximum);
#define web64_motion_apply_gravity(velocity, gravity, terminal) web64_motion_axis((velocity), 1, (gravity), 0, (terminal))
#define web64_motion_jump(velocity, impulse) ((velocity) = (web64_vel_t)(-(int16_t)(impulse)))
#define web64_motion_brake(velocity, braking) web64_motion_axis((velocity), 0, 0, (braking), 0x7fff)
#define web64_motion_platform(body, intent, profile) ((body)->vx = web64_motion_axis((body)->vx, (intent), (profile)->acceleration, (profile)->braking, (profile)->maximum), (body)->vy = web64_motion_apply_gravity((body)->vy, (profile)->gravity, (profile)->terminal), web64_motion_integrate(&(body)->x, (body)->vx), web64_motion_integrate(&(body)->y, (body)->vy))
#endif
web64/motion.inc
Registry-generated Motion runtime prepare/call macros for native assembly.
Header listing:
; Web64 _web64_rt C/assembly call helpers for <web64/motion.h>
; Generated from native runtime registry v8; do not hand-edit.
; Arguments are immediate assembly expressions. Pass C globals with their emitted labels.
; Prepare helpers write the complete exact-width window and clobber A only.
; Call helpers prepare the window, JSR the public entry, and inherit its clobber/return contract.
; Helpers allocate no storage. Including this file, or leaving a helper unused, links zero runtime bytes.
WEB64_RT_MOTION_CALL_COUNT = 8
WEB64_RT_MOTION_WINDOW_CALL_COUNT = 8
; web64_motion_axis: 9-byte window; entry _web64_motion_axis
.macro web64_rt_prepare_motion_axis velocity, intent, acceleration, braking, maximum
lda #<velocity
sta _web64_motion_axis__arg_velocity
lda #>velocity
sta _web64_motion_axis__arg_velocity+1
lda #intent
sta _web64_motion_axis__arg_intent
lda #<acceleration
sta _web64_motion_axis__arg_acceleration
lda #>acceleration
sta _web64_motion_axis__arg_acceleration+1
lda #<braking
sta _web64_motion_axis__arg_braking
lda #>braking
sta _web64_motion_axis__arg_braking+1
lda #<maximum
sta _web64_motion_axis__arg_maximum
lda #>maximum
sta _web64_motion_axis__arg_maximum+1
.endmacro
.macro web64_rt_call_motion_axis velocity, intent, acceleration, braking, maximum
web64_rt_prepare_motion_axis velocity, intent, acceleration, braking, maximum
jsr _web64_motion_axis
.endmacro
; web64_motion_clamp: 8-byte window; entry _web64_motion_clamp
.macro web64_rt_prepare_motion_clamp position, velocity, minimum, maximum
lda #<position
sta _web64_motion_clamp__arg_position
lda #>position
sta _web64_motion_clamp__arg_position+1
lda #<velocity
sta _web64_motion_clamp__arg_velocity
lda #>velocity
sta _web64_motion_clamp__arg_velocity+1
lda #<minimum
sta _web64_motion_clamp__arg_minimum
lda #>minimum
sta _web64_motion_clamp__arg_minimum+1
lda #<maximum
sta _web64_motion_clamp__arg_maximum
lda #>maximum
sta _web64_motion_clamp__arg_maximum+1
.endmacro
.macro web64_rt_call_motion_clamp position, velocity, minimum, maximum
web64_rt_prepare_motion_clamp position, velocity, minimum, maximum
jsr _web64_motion_clamp
.endmacro
; web64_motion_clamp_s16: 8-byte window; entry _web64_motion_clamp_s16
.macro web64_rt_prepare_motion_clamp_s16 position, velocity, minimum, maximum
lda #<position
sta _web64_motion_clamp_s16__arg_position
lda #>position
sta _web64_motion_clamp_s16__arg_position+1
lda #<velocity
sta _web64_motion_clamp_s16__arg_velocity
lda #>velocity
sta _web64_motion_clamp_s16__arg_velocity+1
lda #<minimum
sta _web64_motion_clamp_s16__arg_minimum
lda #>minimum
sta _web64_motion_clamp_s16__arg_minimum+1
lda #<maximum
sta _web64_motion_clamp_s16__arg_maximum
lda #>maximum
sta _web64_motion_clamp_s16__arg_maximum+1
.endmacro
.macro web64_rt_call_motion_clamp_s16 position, velocity, minimum, maximum
web64_rt_prepare_motion_clamp_s16 position, velocity, minimum, maximum
jsr _web64_motion_clamp_s16
.endmacro
; web64_motion_integrate: 4-byte window; entry _web64_motion_integrate
.macro web64_rt_prepare_motion_integrate position, velocity
lda #<position
sta _web64_motion_integrate__arg_position
lda #>position
sta _web64_motion_integrate__arg_position+1
lda #<velocity
sta _web64_motion_integrate__arg_velocity
lda #>velocity
sta _web64_motion_integrate__arg_velocity+1
.endmacro
.macro web64_rt_call_motion_integrate position, velocity
web64_rt_prepare_motion_integrate position, velocity
jsr _web64_motion_integrate
.endmacro
; web64_motion_integrate_s16: 4-byte window; entry _web64_motion_integrate_s16
.macro web64_rt_prepare_motion_integrate_s16 position, velocity
lda #<position
sta _web64_motion_integrate_s16__arg_position
lda #>position
sta _web64_motion_integrate_s16__arg_position+1
lda #<velocity
sta _web64_motion_integrate_s16__arg_velocity
lda #>velocity
sta _web64_motion_integrate_s16__arg_velocity+1
.endmacro
.macro web64_rt_call_motion_integrate_s16 position, velocity
web64_rt_prepare_motion_integrate_s16 position, velocity
jsr _web64_motion_integrate_s16
.endmacro
; web64_motion_steer_s16: 7-byte window; entry _web64_motion_steer_s16
.macro web64_rt_prepare_motion_steer_s16 velocity, intent, acceleration, braking, reversal, maximum
lda #<velocity
sta _web64_motion_steer_s16__arg_velocity
lda #>velocity
sta _web64_motion_steer_s16__arg_velocity+1
lda #intent
sta _web64_motion_steer_s16__arg_intent
lda #acceleration
sta _web64_motion_steer_s16__arg_acceleration
lda #braking
sta _web64_motion_steer_s16__arg_braking
lda #reversal
sta _web64_motion_steer_s16__arg_reversal
lda #maximum
sta _web64_motion_steer_s16__arg_maximum
.endmacro
.macro web64_rt_call_motion_steer_s16 velocity, intent, acceleration, braking, reversal, maximum
web64_rt_prepare_motion_steer_s16 velocity, intent, acceleration, braking, reversal, maximum
jsr _web64_motion_steer_s16
.endmacro
; web64_motion_wrap: 6-byte window; entry _web64_motion_wrap
.macro web64_rt_prepare_motion_wrap position, minimum, maximum
lda #<position
sta _web64_motion_wrap__arg_position
lda #>position
sta _web64_motion_wrap__arg_position+1
lda #<minimum
sta _web64_motion_wrap__arg_minimum
lda #>minimum
sta _web64_motion_wrap__arg_minimum+1
lda #<maximum
sta _web64_motion_wrap__arg_maximum
lda #>maximum
sta _web64_motion_wrap__arg_maximum+1
.endmacro
.macro web64_rt_call_motion_wrap position, minimum, maximum
web64_rt_prepare_motion_wrap position, minimum, maximum
jsr _web64_motion_wrap
.endmacro
; web64_motion_wrap_s16: 6-byte window; entry _web64_motion_wrap_s16
.macro web64_rt_prepare_motion_wrap_s16 position, minimum, maximum
lda #<position
sta _web64_motion_wrap_s16__arg_position
lda #>position
sta _web64_motion_wrap_s16__arg_position+1
lda #<minimum
sta _web64_motion_wrap_s16__arg_minimum
lda #>minimum
sta _web64_motion_wrap_s16__arg_minimum+1
lda #<maximum
sta _web64_motion_wrap_s16__arg_maximum
lda #>maximum
sta _web64_motion_wrap_s16__arg_maximum+1
.endmacro
.macro web64_rt_call_motion_wrap_s16 position, minimum, maximum
web64_rt_prepare_motion_wrap_s16 position, minimum, maximum
jsr _web64_motion_wrap_s16
.endmacro
web64/reu.h
Web64 SDK header <web64/reu.h>.
Included headers: <stdint.h>.
Functions:
| Name | Prototype | Description | Typical use |
|---|---|---|---|
web64_reu_init | _web64_rt uint8_t web64_reu_init(void) | Web64 SDK runtime helper. | web64_reu_init(...) |
web64_reu_store | _web64_rt uint8_t web64_reu_store(const web64_reu_request *request, web64_reu_result *result) | Web64 SDK runtime helper. | web64_reu_store(...) |
web64_reu_fetch | _web64_rt uint8_t web64_reu_fetch(const web64_reu_request *request, web64_reu_result *result) | Web64 SDK runtime helper. | web64_reu_fetch(...) |
Structs:
| Name | Description | Field summary |
|---|---|---|
web64_reu_request | Public struct declared by <web64/reu.h>. | 5 fields: uint8_t *buffer, uint32_t reuOffset, uint16_t length, } web64_reu_request, ... |
Macros:
| Name | Value | Description |
|---|---|---|
WEB64_REU_REG_STATUS | 0xDF00U | Macro constant exported by the header. |
WEB64_REU_REG_COMMAND | 0xDF01U | Macro constant exported by the header. |
WEB64_REU_REG_C64_ADDRESS_LO | 0xDF02U | Macro constant exported by the header. |
WEB64_REU_REG_C64_ADDRESS_HI | 0xDF03U | Macro constant exported by the header. |
WEB64_REU_REG_REU_ADDRESS_LO | 0xDF04U | Macro constant exported by the header. |
WEB64_REU_REG_REU_ADDRESS_MID | 0xDF05U | Macro constant exported by the header. |
WEB64_REU_REG_REU_ADDRESS_HI | 0xDF06U | Macro constant exported by the header. |
WEB64_REU_REG_LENGTH_LO | 0xDF07U | Macro constant exported by the header. |
WEB64_REU_REG_LENGTH_HI | 0xDF08U | Macro constant exported by the header. |
WEB64_REU_REG_IRQ_MASK | 0xDF09U | Macro constant exported by the header. |
WEB64_REU_REG_ADDRESS_CONTROL | 0xDF0AU | Macro constant exported by the header. |
WEB64_REU_OK | 0 | Macro constant exported by the header. |
WEB64_REU_NOT_INITIALIZED | 1 | Macro constant exported by the header. |
WEB64_REU_UNAVAILABLE | 2 | Macro constant exported by the header. |
WEB64_REU_RANGE | 3 | Macro constant exported by the header. |
WEB64_REU_BUFFER | 4 | Macro constant exported by the header. |
WEB64_REU_BUSY | 5 | Macro constant exported by the header. |
WEB64_REU_TRANSFER | 6 | Macro constant exported by the header. |
WEB64_REU_MAX_BURST | 256 | Macro constant exported by the header. |
Header listing:
#ifndef WEB64_REU_H
#define WEB64_REU_H
#include <stdint.h>
#define WEB64_REU_REG_STATUS 0xDF00U
#define WEB64_REU_REG_COMMAND 0xDF01U
#define WEB64_REU_REG_C64_ADDRESS_LO 0xDF02U
#define WEB64_REU_REG_C64_ADDRESS_HI 0xDF03U
#define WEB64_REU_REG_REU_ADDRESS_LO 0xDF04U
#define WEB64_REU_REG_REU_ADDRESS_MID 0xDF05U
#define WEB64_REU_REG_REU_ADDRESS_HI 0xDF06U
#define WEB64_REU_REG_LENGTH_LO 0xDF07U
#define WEB64_REU_REG_LENGTH_HI 0xDF08U
#define WEB64_REU_REG_IRQ_MASK 0xDF09U
#define WEB64_REU_REG_ADDRESS_CONTROL 0xDF0AU
#define WEB64_REU_OK 0
#define WEB64_REU_NOT_INITIALIZED 1
#define WEB64_REU_UNAVAILABLE 2
#define WEB64_REU_RANGE 3
#define WEB64_REU_BUFFER 4
#define WEB64_REU_BUSY 5
#define WEB64_REU_TRANSFER 6
#define WEB64_REU_MAX_BURST 256
typedef struct { uint8_t *buffer; uint32_t reuOffset; uint16_t length; } web64_reu_request;
typedef struct { uint16_t completed; } web64_reu_result;
_web64_rt uint8_t web64_reu_init(void);
_web64_rt uint8_t web64_reu_store(const web64_reu_request *request, web64_reu_result *result);
_web64_rt uint8_t web64_reu_fetch(const web64_reu_request *request, web64_reu_result *result);
#endif
web64/reu.inc
Web64 SDK header <web64/reu.inc>.
Header listing:
WEB64_REU_REG_STATUS = $DF00
WEB64_REU_REG_COMMAND = $DF01
WEB64_REU_REG_C64_ADDRESS_LO = $DF02
WEB64_REU_REG_C64_ADDRESS_HI = $DF03
WEB64_REU_REG_REU_ADDRESS_LO = $DF04
WEB64_REU_REG_REU_ADDRESS_MID = $DF05
WEB64_REU_REG_REU_ADDRESS_HI = $DF06
WEB64_REU_REG_LENGTH_LO = $DF07
WEB64_REU_REG_LENGTH_HI = $DF08
WEB64_REU_REG_IRQ_MASK = $DF09
WEB64_REU_REG_ADDRESS_CONTROL = $DF0A
WEB64_REU_OK = 0
WEB64_REU_NOT_INITIALIZED = 1
WEB64_REU_UNAVAILABLE = 2
WEB64_REU_RANGE = 3
WEB64_REU_BUFFER = 4
WEB64_REU_BUSY = 5
WEB64_REU_TRANSFER = 6
WEB64_REU_REQUEST_BUFFER = 0
WEB64_REU_REQUEST_REU_OFFSET = 2
WEB64_REU_REQUEST_LENGTH = 6
WEB64_REU_REQUEST_SIZE = 8
WEB64_REU_RESULT_COMPLETED = 0
WEB64_REU_RESULT_SIZE = 2
WEB64_REU_MAX_BURST = 256
; Web64 _web64_rt C/assembly call helpers for <web64/reu.h>
; Generated from native runtime registry v8; do not hand-edit.
; Arguments are immediate assembly expressions. Pass C globals with their emitted labels.
; Prepare helpers write the complete exact-width window and clobber A only.
; Call helpers prepare the window, JSR the public entry, and inherit its clobber/return contract.
; Helpers allocate no storage. Including this file, or leaving a helper unused, links zero runtime bytes.
WEB64_RT_REU_CALL_COUNT = 3
WEB64_RT_REU_WINDOW_CALL_COUNT = 3
; web64_reu_fetch: 4-byte window; entry _web64_reu_fetch
.macro web64_rt_prepare_reu_fetch request, result
lda #<request
sta _web64_reu_fetch__arg_request
lda #>request
sta _web64_reu_fetch__arg_request+1
lda #<result
sta _web64_reu_fetch__arg_result
lda #>result
sta _web64_reu_fetch__arg_result+1
.endmacro
.macro web64_rt_call_reu_fetch request, result
web64_rt_prepare_reu_fetch request, result
jsr _web64_reu_fetch
.endmacro
; web64_reu_init: 0-byte window; entry _web64_reu_init
.macro web64_rt_prepare_reu_init
.endmacro
.macro web64_rt_call_reu_init
web64_rt_prepare_reu_init
jsr _web64_reu_init
.endmacro
; web64_reu_store: 4-byte window; entry _web64_reu_store
.macro web64_rt_prepare_reu_store request, result
lda #<request
sta _web64_reu_store__arg_request
lda #>request
sta _web64_reu_store__arg_request+1
lda #<result
sta _web64_reu_store__arg_result
lda #>result
sta _web64_reu_store__arg_result+1
.endmacro
.macro web64_rt_call_reu_store request, result
web64_rt_prepare_reu_store request, result
jsr _web64_reu_store
.endmacro
web64/runtime.inc
Registry-generated _web64_rt entry and exact-width named argument-window reference for native and Kick-compatible assembly callers.
Header listing:
; Web64 runtime _web64_rt ABI registry v8
; Including this file links no runtime code.
; Referencing an entry label from assembly exact-links that entry and its window.
; Each linked entry defines the named and positional symbols listed below.
; Populate the complete window before JSR; windows are mainline-only and non-reentrant.
WEB64_RT_REGISTRY_VERSION = 8
WEB64_RT_ABI_EXACT_WIDTH_NAMED_WINDOW_V1 = 1
WEB64_RT_ARGUMENT_WINDOW_COUNT = 166
; _web64_actor_activate: _web64_actor_activate__arg_window, 8 byte(s)
; +0 active[2] -> _web64_actor_activate__arg_active / _web64_actor_activate__arg0 (0)
; +2 active_ids[2] -> _web64_actor_activate__arg_active_ids / _web64_actor_activate__arg1 (1)
; +4 active_count[2] -> _web64_actor_activate__arg_active_count / _web64_actor_activate__arg2 (2)
; +6 capacity[1] -> _web64_actor_activate__arg_capacity / _web64_actor_activate__arg3 (3)
; +7 actor[1] -> _web64_actor_activate__arg_actor / _web64_actor_activate__arg4 (4)
; _web64_actor_batch_animation_tick: _web64_actor_batch_animation_tick__arg_window, 6 byte(s)
; +0 view[2] -> _web64_actor_batch_animation_tick__arg_view / _web64_actor_batch_animation_tick__arg0 (0)
; +2 animation[2] -> _web64_actor_batch_animation_tick__arg_animation / _web64_actor_batch_animation_tick__arg1 (1)
; +4 status[2] -> _web64_actor_batch_animation_tick__arg_status / _web64_actor_batch_animation_tick__arg2 (2)
; _web64_actor_batch_animation_tick_fast: _web64_actor_batch_animation_tick_fast__arg_window, 6 byte(s)
; +0 view[2] -> _web64_actor_batch_animation_tick_fast__arg_view / _web64_actor_batch_animation_tick_fast__arg0 (0)
; +2 animation[2] -> _web64_actor_batch_animation_tick_fast__arg_animation / _web64_actor_batch_animation_tick_fast__arg1 (1)
; +4 status[2] -> _web64_actor_batch_animation_tick_fast__arg_status / _web64_actor_batch_animation_tick_fast__arg2 (2)
; _web64_actor_batch_build_commands: _web64_actor_batch_build_commands__arg_window, 10 byte(s)
; +0 view[2] -> _web64_actor_batch_build_commands__arg_view / _web64_actor_batch_build_commands__arg0 (0)
; +2 visible[2] -> _web64_actor_batch_build_commands__arg_visible / _web64_actor_batch_build_commands__arg1 (1)
; +4 sprites[2] -> _web64_actor_batch_build_commands__arg_sprites / _web64_actor_batch_build_commands__arg2 (2)
; +6 commands[2] -> _web64_actor_batch_build_commands__arg_commands / _web64_actor_batch_build_commands__arg3 (3)
; +8 status[2] -> _web64_actor_batch_build_commands__arg_status / _web64_actor_batch_build_commands__arg4 (4)
; _web64_actor_batch_build_commands_fast: _web64_actor_batch_build_commands_fast__arg_window, 10 byte(s)
; +0 view[2] -> _web64_actor_batch_build_commands_fast__arg_view / _web64_actor_batch_build_commands_fast__arg0 (0)
; +2 visible[2] -> _web64_actor_batch_build_commands_fast__arg_visible / _web64_actor_batch_build_commands_fast__arg1 (1)
; +4 sprites[2] -> _web64_actor_batch_build_commands_fast__arg_sprites / _web64_actor_batch_build_commands_fast__arg2 (2)
; +6 commands[2] -> _web64_actor_batch_build_commands_fast__arg_commands / _web64_actor_batch_build_commands_fast__arg3 (3)
; +8 status[2] -> _web64_actor_batch_build_commands_fast__arg_status / _web64_actor_batch_build_commands_fast__arg4 (4)
; _web64_actor_batch_cull: _web64_actor_batch_cull__arg_window, 8 byte(s)
; +0 view[2] -> _web64_actor_batch_cull__arg_view / _web64_actor_batch_cull__arg0 (0)
; +2 viewport[2] -> _web64_actor_batch_cull__arg_viewport / _web64_actor_batch_cull__arg1 (1)
; +4 visible[2] -> _web64_actor_batch_cull__arg_visible / _web64_actor_batch_cull__arg2 (2)
; +6 status[2] -> _web64_actor_batch_cull__arg_status / _web64_actor_batch_cull__arg3 (3)
; _web64_actor_batch_cull_fast: _web64_actor_batch_cull_fast__arg_window, 8 byte(s)
; +0 view[2] -> _web64_actor_batch_cull_fast__arg_view / _web64_actor_batch_cull_fast__arg0 (0)
; +2 viewport[2] -> _web64_actor_batch_cull_fast__arg_viewport / _web64_actor_batch_cull_fast__arg1 (1)
; +4 visible[2] -> _web64_actor_batch_cull_fast__arg_visible / _web64_actor_batch_cull_fast__arg2 (2)
; +6 status[2] -> _web64_actor_batch_cull_fast__arg_status / _web64_actor_batch_cull_fast__arg3 (3)
; _web64_actor_batch_integrate_x: _web64_actor_batch_integrate_x__arg_window, 4 byte(s)
; +0 view[2] -> _web64_actor_batch_integrate_x__arg_view / _web64_actor_batch_integrate_x__arg0 (0)
; +2 status[2] -> _web64_actor_batch_integrate_x__arg_status / _web64_actor_batch_integrate_x__arg1 (1)
; _web64_actor_batch_integrate_x_fast: _web64_actor_batch_integrate_x_fast__arg_window, 4 byte(s)
; +0 view[2] -> _web64_actor_batch_integrate_x_fast__arg_view / _web64_actor_batch_integrate_x_fast__arg0 (0)
; +2 status[2] -> _web64_actor_batch_integrate_x_fast__arg_status / _web64_actor_batch_integrate_x_fast__arg1 (1)
; _web64_actor_batch_integrate_xy: _web64_actor_batch_integrate_xy__arg_window, 4 byte(s)
; +0 view[2] -> _web64_actor_batch_integrate_xy__arg_view / _web64_actor_batch_integrate_xy__arg0 (0)
; +2 status[2] -> _web64_actor_batch_integrate_xy__arg_status / _web64_actor_batch_integrate_xy__arg1 (1)
; _web64_actor_batch_integrate_xy_fast: _web64_actor_batch_integrate_xy_fast__arg_window, 4 byte(s)
; +0 view[2] -> _web64_actor_batch_integrate_xy_fast__arg_view / _web64_actor_batch_integrate_xy_fast__arg0 (0)
; +2 status[2] -> _web64_actor_batch_integrate_xy_fast__arg_status / _web64_actor_batch_integrate_xy_fast__arg1 (1)
; _web64_actor_batch_integrate_y: _web64_actor_batch_integrate_y__arg_window, 4 byte(s)
; +0 view[2] -> _web64_actor_batch_integrate_y__arg_view / _web64_actor_batch_integrate_y__arg0 (0)
; +2 status[2] -> _web64_actor_batch_integrate_y__arg_status / _web64_actor_batch_integrate_y__arg1 (1)
; _web64_actor_batch_integrate_y_fast: _web64_actor_batch_integrate_y_fast__arg_window, 4 byte(s)
; +0 view[2] -> _web64_actor_batch_integrate_y_fast__arg_view / _web64_actor_batch_integrate_y_fast__arg0 (0)
; +2 status[2] -> _web64_actor_batch_integrate_y_fast__arg_status / _web64_actor_batch_integrate_y_fast__arg1 (1)
; _web64_actor_batch_pairs_x: _web64_actor_batch_pairs_x__arg_window, 8 byte(s)
; +0 view[2] -> _web64_actor_batch_pairs_x__arg_view / _web64_actor_batch_pairs_x__arg0 (0)
; +2 workspace[2] -> _web64_actor_batch_pairs_x__arg_workspace / _web64_actor_batch_pairs_x__arg1 (1)
; +4 pairs[2] -> _web64_actor_batch_pairs_x__arg_pairs / _web64_actor_batch_pairs_x__arg2 (2)
; +6 status[2] -> _web64_actor_batch_pairs_x__arg_status / _web64_actor_batch_pairs_x__arg3 (3)
; _web64_actor_batch_pairs_x_fast: _web64_actor_batch_pairs_x_fast__arg_window, 8 byte(s)
; +0 view[2] -> _web64_actor_batch_pairs_x_fast__arg_view / _web64_actor_batch_pairs_x_fast__arg0 (0)
; +2 workspace[2] -> _web64_actor_batch_pairs_x_fast__arg_workspace / _web64_actor_batch_pairs_x_fast__arg1 (1)
; +4 pairs[2] -> _web64_actor_batch_pairs_x_fast__arg_pairs / _web64_actor_batch_pairs_x_fast__arg2 (2)
; +6 status[2] -> _web64_actor_batch_pairs_x_fast__arg_status / _web64_actor_batch_pairs_x_fast__arg3 (3)
; _web64_actor_batch_run_mux: _web64_actor_batch_run_mux__arg_window, 2 byte(s)
; +0 pipeline[2] -> _web64_actor_batch_run_mux__arg_pipeline / _web64_actor_batch_run_mux__arg0 (0)
; _web64_actor_batch_run_mux_fast: _web64_actor_batch_run_mux_fast__arg_window, 2 byte(s)
; +0 pipeline[2] -> _web64_actor_batch_run_mux_fast__arg_pipeline / _web64_actor_batch_run_mux_fast__arg0 (0)
; _web64_actor_commands_render_direct: _web64_actor_commands_render_direct__arg_window, 7 byte(s)
; +0 renderer[2] -> _web64_actor_commands_render_direct__arg_renderer / _web64_actor_commands_render_direct__arg0 (0)
; +2 commands[2] -> _web64_actor_commands_render_direct__arg_commands / _web64_actor_commands_render_direct__arg1 (1)
; +4 owned_slots[1] -> _web64_actor_commands_render_direct__arg_owned_slots / _web64_actor_commands_render_direct__arg2 (2)
; +5 status[2] -> _web64_actor_commands_render_direct__arg_status / _web64_actor_commands_render_direct__arg3 (3)
; _web64_actor_commands_render_direct_fast: _web64_actor_commands_render_direct_fast__arg_window, 7 byte(s)
; +0 renderer[2] -> _web64_actor_commands_render_direct_fast__arg_renderer / _web64_actor_commands_render_direct_fast__arg0 (0)
; +2 commands[2] -> _web64_actor_commands_render_direct_fast__arg_commands / _web64_actor_commands_render_direct_fast__arg1 (1)
; +4 owned_slots[1] -> _web64_actor_commands_render_direct_fast__arg_owned_slots / _web64_actor_commands_render_direct_fast__arg2 (2)
; +5 status[2] -> _web64_actor_commands_render_direct_fast__arg_status / _web64_actor_commands_render_direct_fast__arg3 (3)
; _web64_actor_commands_submit_mux: _web64_actor_commands_submit_mux__arg_window, 6 byte(s)
; +0 mux[2] -> _web64_actor_commands_submit_mux__arg_mux / _web64_actor_commands_submit_mux__arg0 (0)
; +2 commands[2] -> _web64_actor_commands_submit_mux__arg_commands / _web64_actor_commands_submit_mux__arg1 (1)
; +4 status[2] -> _web64_actor_commands_submit_mux__arg_status / _web64_actor_commands_submit_mux__arg2 (2)
; _web64_actor_commands_submit_mux_fast: _web64_actor_commands_submit_mux_fast__arg_window, 6 byte(s)
; +0 mux[2] -> _web64_actor_commands_submit_mux_fast__arg_mux / _web64_actor_commands_submit_mux_fast__arg0 (0)
; +2 commands[2] -> _web64_actor_commands_submit_mux_fast__arg_commands / _web64_actor_commands_submit_mux_fast__arg1 (1)
; +4 status[2] -> _web64_actor_commands_submit_mux_fast__arg_status / _web64_actor_commands_submit_mux_fast__arg2 (2)
; _web64_actor_deactivate: _web64_actor_deactivate__arg_window, 7 byte(s)
; +0 active[2] -> _web64_actor_deactivate__arg_active / _web64_actor_deactivate__arg0 (0)
; +2 active_ids[2] -> _web64_actor_deactivate__arg_active_ids / _web64_actor_deactivate__arg1 (1)
; +4 active_count[2] -> _web64_actor_deactivate__arg_active_count / _web64_actor_deactivate__arg2 (2)
; +6 actor[1] -> _web64_actor_deactivate__arg_actor / _web64_actor_deactivate__arg3 (3)
; _web64_actor_sprite_bind_asset: _web64_actor_sprite_bind_asset__arg_window, 8 byte(s)
; +0 sprites[2] -> _web64_actor_sprite_bind_asset__arg_sprites / _web64_actor_sprite_bind_asset__arg0 (0)
; +2 actor[1] -> _web64_actor_sprite_bind_asset__arg_actor / _web64_actor_sprite_bind_asset__arg1 (1)
; +3 asset[2] -> _web64_actor_sprite_bind_asset__arg_asset / _web64_actor_sprite_bind_asset__arg2 (2)
; +5 pointer_base[1] -> _web64_actor_sprite_bind_asset__arg_pointer_base / _web64_actor_sprite_bind_asset__arg3 (3)
; +6 flags[1] -> _web64_actor_sprite_bind_asset__arg_flags / _web64_actor_sprite_bind_asset__arg4 (4)
; +7 priority[1] -> _web64_actor_sprite_bind_asset__arg_priority / _web64_actor_sprite_bind_asset__arg5 (5)
; _web64_actor_sprite_bind_asset_pair: _web64_actor_sprite_bind_asset_pair__arg_window, 7 byte(s)
; +0 sprites[2] -> _web64_actor_sprite_bind_asset_pair__arg_sprites / _web64_actor_sprite_bind_asset_pair__arg0 (0)
; +2 actor[1] -> _web64_actor_sprite_bind_asset_pair__arg_actor / _web64_actor_sprite_bind_asset_pair__arg1 (1)
; +3 binding[2] -> _web64_actor_sprite_bind_asset_pair__arg_binding / _web64_actor_sprite_bind_asset_pair__arg2 (2)
; +5 flags[1] -> _web64_actor_sprite_bind_asset_pair__arg_flags / _web64_actor_sprite_bind_asset_pair__arg3 (3)
; +6 priority[1] -> _web64_actor_sprite_bind_asset_pair__arg_priority / _web64_actor_sprite_bind_asset_pair__arg4 (4)
; _web64_actor_sprite_bind_raw: _web64_actor_sprite_bind_raw__arg_window, 9 byte(s)
; +0 sprites[2] -> _web64_actor_sprite_bind_raw__arg_sprites / _web64_actor_sprite_bind_raw__arg0 (0)
; +2 actor[1] -> _web64_actor_sprite_bind_raw__arg_actor / _web64_actor_sprite_bind_raw__arg1 (1)
; +3 pointer_base[1] -> _web64_actor_sprite_bind_raw__arg_pointer_base / _web64_actor_sprite_bind_raw__arg2 (2)
; +4 frame_count[2] -> _web64_actor_sprite_bind_raw__arg_frame_count / _web64_actor_sprite_bind_raw__arg3 (3)
; +6 color[1] -> _web64_actor_sprite_bind_raw__arg_color / _web64_actor_sprite_bind_raw__arg4 (4)
; +7 flags[1] -> _web64_actor_sprite_bind_raw__arg_flags / _web64_actor_sprite_bind_raw__arg5 (5)
; +8 priority[1] -> _web64_actor_sprite_bind_raw__arg_priority / _web64_actor_sprite_bind_raw__arg6 (6)
; _web64_actor_sprite_unbind: _web64_actor_sprite_unbind__arg_window, 3 byte(s)
; +0 sprites[2] -> _web64_actor_sprite_unbind__arg_sprites / _web64_actor_sprite_unbind__arg0 (0)
; +2 actor[1] -> _web64_actor_sprite_unbind__arg_actor / _web64_actor_sprite_unbind__arg1 (1)
; _web64_animation_init: _web64_animation_init__arg_window, 4 byte(s)
; +0 player[2] -> _web64_animation_init__arg_player / _web64_animation_init__arg0 (0)
; +2 bank[2] -> _web64_animation_init__arg_bank / _web64_animation_init__arg1 (1)
; _web64_animation_play: _web64_animation_play__arg_window, 4 byte(s)
; +0 player[2] -> _web64_animation_play__arg_player / _web64_animation_play__arg0 (0)
; +2 sequence[1] -> _web64_animation_play__arg_sequence / _web64_animation_play__arg1 (1)
; +3 policy[1] -> _web64_animation_play__arg_policy / _web64_animation_play__arg2 (2)
; _web64_animation_queue: _web64_animation_queue__arg_window, 3 byte(s)
; +0 player[2] -> _web64_animation_queue__arg_player / _web64_animation_queue__arg0 (0)
; +2 sequence[1] -> _web64_animation_queue__arg_sequence / _web64_animation_queue__arg1 (1)
; _web64_animation_take_events: _web64_animation_take_events__arg_window, 2 byte(s)
; +0 player[2] -> _web64_animation_take_events__arg_player / _web64_animation_take_events__arg0 (0)
; _web64_animation_tick: _web64_animation_tick__arg_window, 2 byte(s)
; +0 player[2] -> _web64_animation_tick__arg_player / _web64_animation_tick__arg0 (0)
; _web64_asset_copy: _web64_asset_copy__arg_window, 6 byte(s)
; +0 destination[2] -> _web64_asset_copy__arg_destination / _web64_asset_copy__arg0 (0)
; +2 source[2] -> _web64_asset_copy__arg_source / _web64_asset_copy__arg1 (1)
; +4 length[2] -> _web64_asset_copy__arg_length / _web64_asset_copy__arg2 (2)
; _web64_asset_copy_block: _web64_asset_copy_block__arg_window, 4 byte(s)
; +0 destination[2] -> _web64_asset_copy_block__arg_destination / _web64_asset_copy_block__arg0 (0)
; +2 asset[2] -> _web64_asset_copy_block__arg_asset / _web64_asset_copy_block__arg1 (1)
; _web64_asset_copy_blockset: _web64_asset_copy_blockset__arg_window, 4 byte(s)
; +0 destination[2] -> _web64_asset_copy_blockset__arg_destination / _web64_asset_copy_blockset__arg0 (0)
; +2 asset[2] -> _web64_asset_copy_blockset__arg_asset / _web64_asset_copy_blockset__arg1 (1)
; _web64_asset_copy_char: _web64_asset_copy_char__arg_window, 4 byte(s)
; +0 destination[2] -> _web64_asset_copy_char__arg_destination / _web64_asset_copy_char__arg0 (0)
; +2 asset[2] -> _web64_asset_copy_char__arg_asset / _web64_asset_copy_char__arg1 (1)
; _web64_asset_copy_charset: _web64_asset_copy_charset__arg_window, 4 byte(s)
; +0 destination[2] -> _web64_asset_copy_charset__arg_destination / _web64_asset_copy_charset__arg0 (0)
; +2 asset[2] -> _web64_asset_copy_charset__arg_asset / _web64_asset_copy_charset__arg1 (1)
; _web64_asset_copy_map_plane: _web64_asset_copy_map_plane__arg_window, 5 byte(s)
; +0 destination[2] -> _web64_asset_copy_map_plane__arg_destination / _web64_asset_copy_map_plane__arg0 (0)
; +2 asset[2] -> _web64_asset_copy_map_plane__arg_asset / _web64_asset_copy_map_plane__arg1 (1)
; +4 plane[1] -> _web64_asset_copy_map_plane__arg_plane / _web64_asset_copy_map_plane__arg2 (2)
; _web64_asset_copy_sid_payload: _web64_asset_copy_sid_payload__arg_window, 4 byte(s)
; +0 destination[2] -> _web64_asset_copy_sid_payload__arg_destination / _web64_asset_copy_sid_payload__arg0 (0)
; +2 asset[2] -> _web64_asset_copy_sid_payload__arg_asset / _web64_asset_copy_sid_payload__arg1 (1)
; _web64_asset_copy_sprite: _web64_asset_copy_sprite__arg_window, 4 byte(s)
; +0 destination[2] -> _web64_asset_copy_sprite__arg_destination / _web64_asset_copy_sprite__arg0 (0)
; +2 asset[2] -> _web64_asset_copy_sprite__arg_asset / _web64_asset_copy_sprite__arg1 (1)
; _web64_asset_copy_sprite_pair: _web64_asset_copy_sprite_pair__arg_window, 6 byte(s)
; +0 base_destination[2] -> _web64_asset_copy_sprite_pair__arg_base_destination / _web64_asset_copy_sprite_pair__arg0 (0)
; +2 overlay_destination[2] -> _web64_asset_copy_sprite_pair__arg_overlay_destination / _web64_asset_copy_sprite_pair__arg1 (1)
; +4 asset[2] -> _web64_asset_copy_sprite_pair__arg_asset / _web64_asset_copy_sprite_pair__arg2 (2)
; _web64_bitmap_activate: _web64_bitmap_activate__arg_window, 2 byte(s)
; +0 bitmap[2] -> _web64_bitmap_activate__arg_bitmap / _web64_bitmap_activate__arg0 (0)
; _web64_bitmap_clear: _web64_bitmap_clear__arg_window, 3 byte(s)
; +0 bitmap[2] -> _web64_bitmap_clear__arg_bitmap / _web64_bitmap_clear__arg0 (0)
; +2 pixel[1] -> _web64_bitmap_clear__arg_pixel / _web64_bitmap_clear__arg1 (1)
; _web64_bitmap_configure: _web64_bitmap_configure__arg_window, 7 byte(s)
; +0 bitmap[2] -> _web64_bitmap_configure__arg_bitmap / _web64_bitmap_configure__arg0 (0)
; +2 pixels[2] -> _web64_bitmap_configure__arg_pixels / _web64_bitmap_configure__arg1 (1)
; +4 screen[2] -> _web64_bitmap_configure__arg_screen / _web64_bitmap_configure__arg2 (2)
; +6 mode[1] -> _web64_bitmap_configure__arg_mode / _web64_bitmap_configure__arg3 (3)
; _web64_bitmap_ellipse: _web64_bitmap_ellipse__arg_window, 12 byte(s)
; +0 bitmap[2] -> _web64_bitmap_ellipse__arg_bitmap / _web64_bitmap_ellipse__arg0 (0)
; +2 center_x[2] -> _web64_bitmap_ellipse__arg_center_x / _web64_bitmap_ellipse__arg1 (1)
; +4 center_y[2] -> _web64_bitmap_ellipse__arg_center_y / _web64_bitmap_ellipse__arg2 (2)
; +6 radius_x[2] -> _web64_bitmap_ellipse__arg_radius_x / _web64_bitmap_ellipse__arg3 (3)
; +8 radius_y[2] -> _web64_bitmap_ellipse__arg_radius_y / _web64_bitmap_ellipse__arg4 (4)
; +10 pixel[1] -> _web64_bitmap_ellipse__arg_pixel / _web64_bitmap_ellipse__arg5 (5)
; +11 operation[1] -> _web64_bitmap_ellipse__arg_operation / _web64_bitmap_ellipse__arg6 (6)
; _web64_bitmap_ellipse_fast: _web64_bitmap_ellipse_fast__arg_window, 10 byte(s)
; +0 bitmap[2] -> _web64_bitmap_ellipse_fast__arg_bitmap / _web64_bitmap_ellipse_fast__arg0 (0)
; +2 center_x[2] -> _web64_bitmap_ellipse_fast__arg_center_x / _web64_bitmap_ellipse_fast__arg1 (1)
; +4 center_y[1] -> _web64_bitmap_ellipse_fast__arg_center_y / _web64_bitmap_ellipse_fast__arg2 (2)
; +5 radius_x[2] -> _web64_bitmap_ellipse_fast__arg_radius_x / _web64_bitmap_ellipse_fast__arg3 (3)
; +7 radius_y[1] -> _web64_bitmap_ellipse_fast__arg_radius_y / _web64_bitmap_ellipse_fast__arg4 (4)
; +8 pixel[1] -> _web64_bitmap_ellipse_fast__arg_pixel / _web64_bitmap_ellipse_fast__arg5 (5)
; +9 operation[1] -> _web64_bitmap_ellipse_fast__arg_operation / _web64_bitmap_ellipse_fast__arg6 (6)
; _web64_bitmap_fill_rect: _web64_bitmap_fill_rect__arg_window, 12 byte(s)
; +0 bitmap[2] -> _web64_bitmap_fill_rect__arg_bitmap / _web64_bitmap_fill_rect__arg0 (0)
; +2 x[2] -> _web64_bitmap_fill_rect__arg_x / _web64_bitmap_fill_rect__arg1 (1)
; +4 y[2] -> _web64_bitmap_fill_rect__arg_y / _web64_bitmap_fill_rect__arg2 (2)
; +6 width[2] -> _web64_bitmap_fill_rect__arg_width / _web64_bitmap_fill_rect__arg3 (3)
; +8 height[2] -> _web64_bitmap_fill_rect__arg_height / _web64_bitmap_fill_rect__arg4 (4)
; +10 pixel[1] -> _web64_bitmap_fill_rect__arg_pixel / _web64_bitmap_fill_rect__arg5 (5)
; +11 operation[1] -> _web64_bitmap_fill_rect__arg_operation / _web64_bitmap_fill_rect__arg6 (6)
; _web64_bitmap_fill_rect_fast: _web64_bitmap_fill_rect_fast__arg_window, 10 byte(s)
; +0 bitmap[2] -> _web64_bitmap_fill_rect_fast__arg_bitmap / _web64_bitmap_fill_rect_fast__arg0 (0)
; +2 x[2] -> _web64_bitmap_fill_rect_fast__arg_x / _web64_bitmap_fill_rect_fast__arg1 (1)
; +4 y[1] -> _web64_bitmap_fill_rect_fast__arg_y / _web64_bitmap_fill_rect_fast__arg2 (2)
; +5 width[2] -> _web64_bitmap_fill_rect_fast__arg_width / _web64_bitmap_fill_rect_fast__arg3 (3)
; +7 height[1] -> _web64_bitmap_fill_rect_fast__arg_height / _web64_bitmap_fill_rect_fast__arg4 (4)
; +8 pixel[1] -> _web64_bitmap_fill_rect_fast__arg_pixel / _web64_bitmap_fill_rect_fast__arg5 (5)
; +9 operation[1] -> _web64_bitmap_fill_rect_fast__arg_operation / _web64_bitmap_fill_rect_fast__arg6 (6)
; _web64_bitmap_flood_fill: _web64_bitmap_flood_fill__arg_window, 9 byte(s)
; +0 bitmap[2] -> _web64_bitmap_flood_fill__arg_bitmap / _web64_bitmap_flood_fill__arg0 (0)
; +2 seed_x[2] -> _web64_bitmap_flood_fill__arg_seed_x / _web64_bitmap_flood_fill__arg1 (1)
; +4 seed_y[2] -> _web64_bitmap_flood_fill__arg_seed_y / _web64_bitmap_flood_fill__arg2 (2)
; +6 replacement[1] -> _web64_bitmap_flood_fill__arg_replacement / _web64_bitmap_flood_fill__arg3 (3)
; +7 workspace[2] -> _web64_bitmap_flood_fill__arg_workspace / _web64_bitmap_flood_fill__arg4 (4)
; _web64_bitmap_flood_fill_fast: _web64_bitmap_flood_fill_fast__arg_window, 8 byte(s)
; +0 bitmap[2] -> _web64_bitmap_flood_fill_fast__arg_bitmap / _web64_bitmap_flood_fill_fast__arg0 (0)
; +2 seed_x[2] -> _web64_bitmap_flood_fill_fast__arg_seed_x / _web64_bitmap_flood_fill_fast__arg1 (1)
; +4 seed_y[1] -> _web64_bitmap_flood_fill_fast__arg_seed_y / _web64_bitmap_flood_fill_fast__arg2 (2)
; +5 replacement[1] -> _web64_bitmap_flood_fill_fast__arg_replacement / _web64_bitmap_flood_fill_fast__arg3 (3)
; +6 workspace[2] -> _web64_bitmap_flood_fill_fast__arg_workspace / _web64_bitmap_flood_fill_fast__arg4 (4)
; _web64_bitmap_get: _web64_bitmap_get__arg_window, 6 byte(s)
; +0 bitmap[2] -> _web64_bitmap_get__arg_bitmap / _web64_bitmap_get__arg0 (0)
; +2 x[2] -> _web64_bitmap_get__arg_x / _web64_bitmap_get__arg1 (1)
; +4 y[2] -> _web64_bitmap_get__arg_y / _web64_bitmap_get__arg2 (2)
; _web64_bitmap_get_fast: _web64_bitmap_get_fast__arg_window, 5 byte(s)
; +0 bitmap[2] -> _web64_bitmap_get_fast__arg_bitmap / _web64_bitmap_get_fast__arg0 (0)
; +2 x[2] -> _web64_bitmap_get_fast__arg_x / _web64_bitmap_get_fast__arg1 (1)
; +4 y[1] -> _web64_bitmap_get_fast__arg_y / _web64_bitmap_get_fast__arg2 (2)
; _web64_bitmap_hline: _web64_bitmap_hline__arg_window, 10 byte(s)
; +0 bitmap[2] -> _web64_bitmap_hline__arg_bitmap / _web64_bitmap_hline__arg0 (0)
; +2 x[2] -> _web64_bitmap_hline__arg_x / _web64_bitmap_hline__arg1 (1)
; +4 y[2] -> _web64_bitmap_hline__arg_y / _web64_bitmap_hline__arg2 (2)
; +6 width[2] -> _web64_bitmap_hline__arg_width / _web64_bitmap_hline__arg3 (3)
; +8 pixel[1] -> _web64_bitmap_hline__arg_pixel / _web64_bitmap_hline__arg4 (4)
; +9 operation[1] -> _web64_bitmap_hline__arg_operation / _web64_bitmap_hline__arg5 (5)
; _web64_bitmap_hline_fast: _web64_bitmap_hline_fast__arg_window, 9 byte(s)
; +0 bitmap[2] -> _web64_bitmap_hline_fast__arg_bitmap / _web64_bitmap_hline_fast__arg0 (0)
; +2 x[2] -> _web64_bitmap_hline_fast__arg_x / _web64_bitmap_hline_fast__arg1 (1)
; +4 y[1] -> _web64_bitmap_hline_fast__arg_y / _web64_bitmap_hline_fast__arg2 (2)
; +5 width[2] -> _web64_bitmap_hline_fast__arg_width / _web64_bitmap_hline_fast__arg3 (3)
; +7 pixel[1] -> _web64_bitmap_hline_fast__arg_pixel / _web64_bitmap_hline_fast__arg4 (4)
; +8 operation[1] -> _web64_bitmap_hline_fast__arg_operation / _web64_bitmap_hline_fast__arg5 (5)
; _web64_bitmap_init: _web64_bitmap_init__arg_window, 9 byte(s)
; +0 bitmap[2] -> _web64_bitmap_init__arg_bitmap / _web64_bitmap_init__arg0 (0)
; +2 pixels[2] -> _web64_bitmap_init__arg_pixels / _web64_bitmap_init__arg1 (1)
; +4 screen[2] -> _web64_bitmap_init__arg_screen / _web64_bitmap_init__arg2 (2)
; +6 mode[1] -> _web64_bitmap_init__arg_mode / _web64_bitmap_init__arg3 (3)
; +7 palette[2] -> _web64_bitmap_init__arg_palette / _web64_bitmap_init__arg4 (4)
; _web64_bitmap_line: _web64_bitmap_line__arg_window, 12 byte(s)
; +0 bitmap[2] -> _web64_bitmap_line__arg_bitmap / _web64_bitmap_line__arg0 (0)
; +2 x0[2] -> _web64_bitmap_line__arg_x0 / _web64_bitmap_line__arg1 (1)
; +4 y0[2] -> _web64_bitmap_line__arg_y0 / _web64_bitmap_line__arg2 (2)
; +6 x1[2] -> _web64_bitmap_line__arg_x1 / _web64_bitmap_line__arg3 (3)
; +8 y1[2] -> _web64_bitmap_line__arg_y1 / _web64_bitmap_line__arg4 (4)
; +10 pixel[1] -> _web64_bitmap_line__arg_pixel / _web64_bitmap_line__arg5 (5)
; +11 operation[1] -> _web64_bitmap_line__arg_operation / _web64_bitmap_line__arg6 (6)
; _web64_bitmap_line_fast: _web64_bitmap_line_fast__arg_window, 10 byte(s)
; +0 bitmap[2] -> _web64_bitmap_line_fast__arg_bitmap / _web64_bitmap_line_fast__arg0 (0)
; +2 x0[2] -> _web64_bitmap_line_fast__arg_x0 / _web64_bitmap_line_fast__arg1 (1)
; +4 y0[1] -> _web64_bitmap_line_fast__arg_y0 / _web64_bitmap_line_fast__arg2 (2)
; +5 x1[2] -> _web64_bitmap_line_fast__arg_x1 / _web64_bitmap_line_fast__arg3 (3)
; +7 y1[1] -> _web64_bitmap_line_fast__arg_y1 / _web64_bitmap_line_fast__arg4 (4)
; +8 pixel[1] -> _web64_bitmap_line_fast__arg_pixel / _web64_bitmap_line_fast__arg5 (5)
; +9 operation[1] -> _web64_bitmap_line_fast__arg_operation / _web64_bitmap_line_fast__arg6 (6)
; _web64_bitmap_load_map: _web64_bitmap_load_map__arg_window, 6 byte(s)
; +0 bitmap[2] -> _web64_bitmap_load_map__arg_bitmap / _web64_bitmap_load_map__arg0 (0)
; +2 map[2] -> _web64_bitmap_load_map__arg_map / _web64_bitmap_load_map__arg1 (1)
; +4 charset[2] -> _web64_bitmap_load_map__arg_charset / _web64_bitmap_load_map__arg2 (2)
; _web64_bitmap_palette_cell: _web64_bitmap_palette_cell__arg_window, 6 byte(s)
; +0 bitmap[2] -> _web64_bitmap_palette_cell__arg_bitmap / _web64_bitmap_palette_cell__arg0 (0)
; +2 column[1] -> _web64_bitmap_palette_cell__arg_column / _web64_bitmap_palette_cell__arg1 (1)
; +3 row[1] -> _web64_bitmap_palette_cell__arg_row / _web64_bitmap_palette_cell__arg2 (2)
; +4 palette[2] -> _web64_bitmap_palette_cell__arg_palette / _web64_bitmap_palette_cell__arg3 (3)
; _web64_bitmap_palette_uniform: _web64_bitmap_palette_uniform__arg_window, 4 byte(s)
; +0 bitmap[2] -> _web64_bitmap_palette_uniform__arg_bitmap / _web64_bitmap_palette_uniform__arg0 (0)
; +2 palette[2] -> _web64_bitmap_palette_uniform__arg_palette / _web64_bitmap_palette_uniform__arg1 (1)
; _web64_bitmap_plot: _web64_bitmap_plot__arg_window, 8 byte(s)
; +0 bitmap[2] -> _web64_bitmap_plot__arg_bitmap / _web64_bitmap_plot__arg0 (0)
; +2 x[2] -> _web64_bitmap_plot__arg_x / _web64_bitmap_plot__arg1 (1)
; +4 y[2] -> _web64_bitmap_plot__arg_y / _web64_bitmap_plot__arg2 (2)
; +6 pixel[1] -> _web64_bitmap_plot__arg_pixel / _web64_bitmap_plot__arg3 (3)
; +7 operation[1] -> _web64_bitmap_plot__arg_operation / _web64_bitmap_plot__arg4 (4)
; _web64_bitmap_plot_fast: _web64_bitmap_plot_fast__arg_window, 7 byte(s)
; +0 bitmap[2] -> _web64_bitmap_plot_fast__arg_bitmap / _web64_bitmap_plot_fast__arg0 (0)
; +2 x[2] -> _web64_bitmap_plot_fast__arg_x / _web64_bitmap_plot_fast__arg1 (1)
; +4 y[1] -> _web64_bitmap_plot_fast__arg_y / _web64_bitmap_plot_fast__arg2 (2)
; +5 pixel[1] -> _web64_bitmap_plot_fast__arg_pixel / _web64_bitmap_plot_fast__arg3 (3)
; +6 operation[1] -> _web64_bitmap_plot_fast__arg_operation / _web64_bitmap_plot_fast__arg4 (4)
; _web64_bitmap_rect: _web64_bitmap_rect__arg_window, 12 byte(s)
; +0 bitmap[2] -> _web64_bitmap_rect__arg_bitmap / _web64_bitmap_rect__arg0 (0)
; +2 x[2] -> _web64_bitmap_rect__arg_x / _web64_bitmap_rect__arg1 (1)
; +4 y[2] -> _web64_bitmap_rect__arg_y / _web64_bitmap_rect__arg2 (2)
; +6 width[2] -> _web64_bitmap_rect__arg_width / _web64_bitmap_rect__arg3 (3)
; +8 height[2] -> _web64_bitmap_rect__arg_height / _web64_bitmap_rect__arg4 (4)
; +10 pixel[1] -> _web64_bitmap_rect__arg_pixel / _web64_bitmap_rect__arg5 (5)
; +11 operation[1] -> _web64_bitmap_rect__arg_operation / _web64_bitmap_rect__arg6 (6)
; _web64_bitmap_rect_fast: _web64_bitmap_rect_fast__arg_window, 10 byte(s)
; +0 bitmap[2] -> _web64_bitmap_rect_fast__arg_bitmap / _web64_bitmap_rect_fast__arg0 (0)
; +2 x[2] -> _web64_bitmap_rect_fast__arg_x / _web64_bitmap_rect_fast__arg1 (1)
; +4 y[1] -> _web64_bitmap_rect_fast__arg_y / _web64_bitmap_rect_fast__arg2 (2)
; +5 width[2] -> _web64_bitmap_rect_fast__arg_width / _web64_bitmap_rect_fast__arg3 (3)
; +7 height[1] -> _web64_bitmap_rect_fast__arg_height / _web64_bitmap_rect_fast__arg4 (4)
; +8 pixel[1] -> _web64_bitmap_rect_fast__arg_pixel / _web64_bitmap_rect_fast__arg5 (5)
; +9 operation[1] -> _web64_bitmap_rect_fast__arg_operation / _web64_bitmap_rect_fast__arg6 (6)
; _web64_bitmap_vline: _web64_bitmap_vline__arg_window, 10 byte(s)
; +0 bitmap[2] -> _web64_bitmap_vline__arg_bitmap / _web64_bitmap_vline__arg0 (0)
; +2 x[2] -> _web64_bitmap_vline__arg_x / _web64_bitmap_vline__arg1 (1)
; +4 y[2] -> _web64_bitmap_vline__arg_y / _web64_bitmap_vline__arg2 (2)
; +6 height[2] -> _web64_bitmap_vline__arg_height / _web64_bitmap_vline__arg3 (3)
; +8 pixel[1] -> _web64_bitmap_vline__arg_pixel / _web64_bitmap_vline__arg4 (4)
; +9 operation[1] -> _web64_bitmap_vline__arg_operation / _web64_bitmap_vline__arg5 (5)
; _web64_bitmap_vline_fast: _web64_bitmap_vline_fast__arg_window, 9 byte(s)
; +0 bitmap[2] -> _web64_bitmap_vline_fast__arg_bitmap / _web64_bitmap_vline_fast__arg0 (0)
; +2 x[2] -> _web64_bitmap_vline_fast__arg_x / _web64_bitmap_vline_fast__arg1 (1)
; +4 y[1] -> _web64_bitmap_vline_fast__arg_y / _web64_bitmap_vline_fast__arg2 (2)
; +5 height[2] -> _web64_bitmap_vline_fast__arg_height / _web64_bitmap_vline_fast__arg3 (3)
; +7 pixel[1] -> _web64_bitmap_vline_fast__arg_pixel / _web64_bitmap_vline_fast__arg4 (4)
; +8 operation[1] -> _web64_bitmap_vline_fast__arg_operation / _web64_bitmap_vline_fast__arg5 (5)
; _web64_cart_copy: _web64_cart_copy__arg_window, 2 byte(s)
; +0 request[2] -> _web64_cart_copy__arg_request / _web64_cart_copy__arg0 (0)
; _web64_cart_read: _web64_cart_read__arg_window, 2 byte(s)
; +0 request[2] -> _web64_cart_read__arg_request / _web64_cart_read__arg0 (0)
; _web64_cart_resource_copy: _web64_cart_resource_copy__arg_window, 4 byte(s)
; +0 request[2] -> _web64_cart_resource_copy__arg_request / _web64_cart_resource_copy__arg0 (0)
; +2 result[2] -> _web64_cart_resource_copy__arg_result / _web64_cart_resource_copy__arg1 (1)
; _web64_cart_resource_read: _web64_cart_resource_read__arg_window, 4 byte(s)
; +0 request[2] -> _web64_cart_resource_read__arg_request / _web64_cart_resource_read__arg0 (0)
; +2 result[2] -> _web64_cart_resource_read__arg_result / _web64_cart_resource_read__arg1 (1)
; _web64_cart_resources_init: _web64_cart_resources_init__arg_window, 0 byte(s)
; _web64_cart_select_bank: _web64_cart_select_bank__arg_window, 2 byte(s)
; +0 profile[1] -> _web64_cart_select_bank__arg_profile / _web64_cart_select_bank__arg0 (0)
; +1 bank[1] -> _web64_cart_select_bank__arg_bank / _web64_cart_select_bank__arg1 (1)
; _web64_cart_set_mode: _web64_cart_set_mode__arg_window, 2 byte(s)
; +0 profile[1] -> _web64_cart_set_mode__arg_profile / _web64_cart_set_mode__arg0 (0)
; +1 mode[1] -> _web64_cart_set_mode__arg_mode / _web64_cart_set_mode__arg1 (1)
; _web64_collision_aabb: _web64_collision_aabb__arg_window, 4 byte(s)
; +0 a[2] -> _web64_collision_aabb__arg_a / _web64_collision_aabb__arg0 (0)
; +2 b[2] -> _web64_collision_aabb__arg_b / _web64_collision_aabb__arg1 (1)
; _web64_collision_event_push: _web64_collision_event_push__arg_window, 4 byte(s)
; +0 queue[2] -> _web64_collision_event_push__arg_queue / _web64_collision_event_push__arg0 (0)
; +2 event[2] -> _web64_collision_event_push__arg_event / _web64_collision_event_push__arg1 (1)
; _web64_collision_find_material_rect: _web64_collision_find_material_rect__arg_window, 8 byte(s)
; +0 materials[2] -> _web64_collision_find_material_rect__arg_materials / _web64_collision_find_material_rect__arg0 (0)
; +2 row_stride[1] -> _web64_collision_find_material_rect__arg_row_stride / _web64_collision_find_material_rect__arg1 (1)
; +3 first_column[1] -> _web64_collision_find_material_rect__arg_first_column / _web64_collision_find_material_rect__arg2 (2)
; +4 last_column[1] -> _web64_collision_find_material_rect__arg_last_column / _web64_collision_find_material_rect__arg3 (3)
; +5 first_row[1] -> _web64_collision_find_material_rect__arg_first_row / _web64_collision_find_material_rect__arg4 (4)
; +6 last_row[1] -> _web64_collision_find_material_rect__arg_last_row / _web64_collision_find_material_rect__arg5 (5)
; +7 material[1] -> _web64_collision_find_material_rect__arg_material / _web64_collision_find_material_rect__arg6 (6)
; _web64_collision_map_write: _web64_collision_map_write__arg_window, 7 byte(s)
; +0 plane[2] -> _web64_collision_map_write__arg_plane / _web64_collision_map_write__arg0 (0)
; +2 row_stride[2] -> _web64_collision_map_write__arg_row_stride / _web64_collision_map_write__arg1 (1)
; +4 column[1] -> _web64_collision_map_write__arg_column / _web64_collision_map_write__arg2 (2)
; +5 row[1] -> _web64_collision_map_write__arg_row / _web64_collision_map_write__arg3 (3)
; +6 value[1] -> _web64_collision_map_write__arg_value / _web64_collision_map_write__arg4 (4)
; _web64_collision_material_at: _web64_collision_material_at__arg_window, 6 byte(s)
; +0 map[2] -> _web64_collision_material_at__arg_map / _web64_collision_material_at__arg0 (0)
; +2 pixel_x[2] -> _web64_collision_material_at__arg_pixel_x / _web64_collision_material_at__arg1 (1)
; +4 pixel_y[2] -> _web64_collision_material_at__arg_pixel_y / _web64_collision_material_at__arg2 (2)
; _web64_collision_material_flags: _web64_collision_material_flags__arg_window, 3 byte(s)
; +0 map[2] -> _web64_collision_material_flags__arg_map / _web64_collision_material_flags__arg0 (0)
; +2 material[1] -> _web64_collision_material_flags__arg_material / _web64_collision_material_flags__arg1 (1)
; _web64_collision_probe_edge: _web64_collision_probe_edge__arg_window, 9 byte(s)
; +0 map[2] -> _web64_collision_probe_edge__arg_map / _web64_collision_probe_edge__arg0 (0)
; +2 pixel_x[2] -> _web64_collision_probe_edge__arg_pixel_x / _web64_collision_probe_edge__arg1 (1)
; +4 pixel_y0[2] -> _web64_collision_probe_edge__arg_pixel_y0 / _web64_collision_probe_edge__arg2 (2)
; +6 pixel_y1[2] -> _web64_collision_probe_edge__arg_pixel_y1 / _web64_collision_probe_edge__arg3 (3)
; +8 material_mask[1] -> _web64_collision_probe_edge__arg_material_mask / _web64_collision_probe_edge__arg4 (4)
; _web64_collision_probe_point: _web64_collision_probe_point__arg_window, 7 byte(s)
; +0 map[2] -> _web64_collision_probe_point__arg_map / _web64_collision_probe_point__arg0 (0)
; +2 pixel_x[2] -> _web64_collision_probe_point__arg_pixel_x / _web64_collision_probe_point__arg1 (1)
; +4 pixel_y[2] -> _web64_collision_probe_point__arg_pixel_y / _web64_collision_probe_point__arg2 (2)
; +6 material_mask[1] -> _web64_collision_probe_point__arg_material_mask / _web64_collision_probe_point__arg3 (3)
; _web64_collision_probe_span: _web64_collision_probe_span__arg_window, 9 byte(s)
; +0 map[2] -> _web64_collision_probe_span__arg_map / _web64_collision_probe_span__arg0 (0)
; +2 pixel_x0[2] -> _web64_collision_probe_span__arg_pixel_x0 / _web64_collision_probe_span__arg1 (1)
; +4 pixel_x1[2] -> _web64_collision_probe_span__arg_pixel_x1 / _web64_collision_probe_span__arg2 (2)
; +6 pixel_y[2] -> _web64_collision_probe_span__arg_pixel_y / _web64_collision_probe_span__arg3 (3)
; +8 material_mask[1] -> _web64_collision_probe_span__arg_material_mask / _web64_collision_probe_span__arg4 (4)
; _web64_collision_sweep_x: _web64_collision_sweep_x__arg_window, 6 byte(s)
; +0 map[2] -> _web64_collision_sweep_x__arg_map / _web64_collision_sweep_x__arg0 (0)
; +2 box[2] -> _web64_collision_sweep_x__arg_box / _web64_collision_sweep_x__arg1 (1)
; +4 sweep[2] -> _web64_collision_sweep_x__arg_sweep / _web64_collision_sweep_x__arg2 (2)
; _web64_collision_sweep_y: _web64_collision_sweep_y__arg_window, 6 byte(s)
; +0 map[2] -> _web64_collision_sweep_y__arg_map / _web64_collision_sweep_y__arg0 (0)
; +2 box[2] -> _web64_collision_sweep_y__arg_box / _web64_collision_sweep_y__arg1 (1)
; +4 sweep[2] -> _web64_collision_sweep_y__arg_sweep / _web64_collision_sweep_y__arg2 (2)
; _web64_cos8: _web64_cos8__arg_window, 1 byte(s)
; +0 angle[1] -> _web64_cos8__arg_angle / _web64_cos8__arg0 (0)
; _web64_disk_load: _web64_disk_load__arg_window, 6 byte(s)
; +0 name[2] -> _web64_disk_load__arg_name / _web64_disk_load__arg0 (0)
; +2 length[1] -> _web64_disk_load__arg_length / _web64_disk_load__arg1 (1)
; +3 device[1] -> _web64_disk_load__arg_device / _web64_disk_load__arg2 (2)
; +4 address[2] -> _web64_disk_load__arg_address / _web64_disk_load__arg3 (3)
; _web64_disk_request: _web64_disk_request__arg_window, 1 byte(s)
; +0 disk_index[1] -> _web64_disk_request__arg_disk_index / _web64_disk_request__arg0 (0)
; _web64_disk_require: _web64_disk_require__arg_window, 4 byte(s)
; +0 marker_name[2] -> _web64_disk_require__arg_marker_name / _web64_disk_require__arg0 (0)
; +2 marker_length[1] -> _web64_disk_require__arg_marker_length / _web64_disk_require__arg1 (1)
; +3 device[1] -> _web64_disk_require__arg_device / _web64_disk_require__arg2 (2)
; _web64_disk_save: _web64_disk_save__arg_window, 8 byte(s)
; +0 name[2] -> _web64_disk_save__arg_name / _web64_disk_save__arg0 (0)
; +2 length[1] -> _web64_disk_save__arg_length / _web64_disk_save__arg1 (1)
; +3 device[1] -> _web64_disk_save__arg_device / _web64_disk_save__arg2 (2)
; +4 start_address[2] -> _web64_disk_save__arg_start_address / _web64_disk_save__arg3 (3)
; +6 end_address[2] -> _web64_disk_save__arg_end_address / _web64_disk_save__arg4 (4)
; _web64_file_close: _web64_file_close__arg_window, 1 byte(s)
; +0 logical_file[1] -> _web64_file_close__arg_logical_file / _web64_file_close__arg0 (0)
; _web64_file_open: _web64_file_open__arg_window, 6 byte(s)
; +0 name[2] -> _web64_file_open__arg_name / _web64_file_open__arg0 (0)
; +2 length[1] -> _web64_file_open__arg_length / _web64_file_open__arg1 (1)
; +3 logical_file[1] -> _web64_file_open__arg_logical_file / _web64_file_open__arg2 (2)
; +4 device[1] -> _web64_file_open__arg_device / _web64_file_open__arg3 (3)
; +5 secondary[1] -> _web64_file_open__arg_secondary / _web64_file_open__arg4 (4)
; _web64_file_read: _web64_file_read__arg_window, 3 byte(s)
; +0 logical_file[1] -> _web64_file_read__arg_logical_file / _web64_file_read__arg0 (0)
; +1 destination[2] -> _web64_file_read__arg_destination / _web64_file_read__arg1 (1)
; _web64_file_write: _web64_file_write__arg_window, 2 byte(s)
; +0 logical_file[1] -> _web64_file_write__arg_logical_file / _web64_file_write__arg0 (0)
; +1 value[1] -> _web64_file_write__arg_value / _web64_file_write__arg1 (1)
; _web64_fix8_abs: _web64_fix8_abs__arg_window, 2 byte(s)
; +0 value[2] -> _web64_fix8_abs__arg_value / _web64_fix8_abs__arg0 (0)
; _web64_fix8_add_sat: _web64_fix8_add_sat__arg_window, 4 byte(s)
; +0 a[2] -> _web64_fix8_add_sat__arg_a / _web64_fix8_add_sat__arg0 (0)
; +2 b[2] -> _web64_fix8_add_sat__arg_b / _web64_fix8_add_sat__arg1 (1)
; _web64_fix8_clamp: _web64_fix8_clamp__arg_window, 6 byte(s)
; +0 value[2] -> _web64_fix8_clamp__arg_value / _web64_fix8_clamp__arg0 (0)
; +2 min_value[2] -> _web64_fix8_clamp__arg_min_value / _web64_fix8_clamp__arg1 (1)
; +4 max_value[2] -> _web64_fix8_clamp__arg_max_value / _web64_fix8_clamp__arg2 (2)
; _web64_fix8_div: _web64_fix8_div__arg_window, 4 byte(s)
; +0 a[2] -> _web64_fix8_div__arg_a / _web64_fix8_div__arg0 (0)
; +2 b[2] -> _web64_fix8_div__arg_b / _web64_fix8_div__arg1 (1)
; _web64_fix8_lerp: _web64_fix8_lerp__arg_window, 5 byte(s)
; +0 a[2] -> _web64_fix8_lerp__arg_a / _web64_fix8_lerp__arg0 (0)
; +2 b[2] -> _web64_fix8_lerp__arg_b / _web64_fix8_lerp__arg1 (1)
; +4 amount[1] -> _web64_fix8_lerp__arg_amount / _web64_fix8_lerp__arg2 (2)
; _web64_fix8_max: _web64_fix8_max__arg_window, 4 byte(s)
; +0 a[2] -> _web64_fix8_max__arg_a / _web64_fix8_max__arg0 (0)
; +2 b[2] -> _web64_fix8_max__arg_b / _web64_fix8_max__arg1 (1)
; _web64_fix8_min: _web64_fix8_min__arg_window, 4 byte(s)
; +0 a[2] -> _web64_fix8_min__arg_a / _web64_fix8_min__arg0 (0)
; +2 b[2] -> _web64_fix8_min__arg_b / _web64_fix8_min__arg1 (1)
; _web64_fix8_mul: _web64_fix8_mul__arg_window, 4 byte(s)
; +0 a[2] -> _web64_fix8_mul__arg_a / _web64_fix8_mul__arg0 (0)
; +2 b[2] -> _web64_fix8_mul__arg_b / _web64_fix8_mul__arg1 (1)
; _web64_fix8_mul_round: _web64_fix8_mul_round__arg_window, 4 byte(s)
; +0 a[2] -> _web64_fix8_mul_round__arg_a / _web64_fix8_mul_round__arg0 (0)
; +2 b[2] -> _web64_fix8_mul_round__arg_b / _web64_fix8_mul_round__arg1 (1)
; _web64_fix8_sub_sat: _web64_fix8_sub_sat__arg_window, 4 byte(s)
; +0 a[2] -> _web64_fix8_sub_sat__arg_a / _web64_fix8_sub_sat__arg0 (0)
; +2 b[2] -> _web64_fix8_sub_sat__arg_b / _web64_fix8_sub_sat__arg1 (1)
; _web64_fixvec2_add: _web64_fixvec2_add__arg_window, 6 byte(s)
; +0 out[2] -> _web64_fixvec2_add__arg_out / _web64_fixvec2_add__arg0 (0)
; +2 a[2] -> _web64_fixvec2_add__arg_a / _web64_fixvec2_add__arg1 (1)
; +4 b[2] -> _web64_fixvec2_add__arg_b / _web64_fixvec2_add__arg2 (2)
; _web64_fixvec2_scale: _web64_fixvec2_scale__arg_window, 6 byte(s)
; +0 out[2] -> _web64_fixvec2_scale__arg_out / _web64_fixvec2_scale__arg0 (0)
; +2 value[2] -> _web64_fixvec2_scale__arg_value / _web64_fixvec2_scale__arg1 (1)
; +4 scale[2] -> _web64_fixvec2_scale__arg_scale / _web64_fixvec2_scale__arg2 (2)
; _web64_fixvec2_sub: _web64_fixvec2_sub__arg_window, 6 byte(s)
; +0 out[2] -> _web64_fixvec2_sub__arg_out / _web64_fixvec2_sub__arg0 (0)
; +2 a[2] -> _web64_fixvec2_sub__arg_a / _web64_fixvec2_sub__arg1 (1)
; +4 b[2] -> _web64_fixvec2_sub__arg_b / _web64_fixvec2_sub__arg2 (2)
; _web64_loader_init: _web64_loader_init__arg_window, 5 byte(s)
; +0 device[1] -> _web64_loader_init__arg_device / _web64_loader_init__arg0 (0)
; +1 sector[2] -> _web64_loader_init__arg_sector / _web64_loader_init__arg1 (1)
; +3 ticks[2] -> _web64_loader_init__arg_ticks / _web64_loader_init__arg2 (2)
; _web64_loader_load_packed: _web64_loader_load_packed__arg_window, 2 byte(s)
; +0 request[2] -> _web64_loader_load_packed__arg_request / _web64_loader_load_packed__arg0 (0)
; _web64_loader_load_raw: _web64_loader_load_raw__arg_window, 2 byte(s)
; +0 request[2] -> _web64_loader_load_raw__arg_request / _web64_loader_load_raw__arg0 (0)
; _web64_loader_read: _web64_loader_read__arg_window, 7 byte(s)
; +0 name[2] -> _web64_loader_read__arg_name / _web64_loader_read__arg0 (0)
; +2 length[1] -> _web64_loader_read__arg_length / _web64_loader_read__arg1 (1)
; +3 stage[2] -> _web64_loader_read__arg_stage / _web64_loader_read__arg2 (2)
; +5 capacity[2] -> _web64_loader_read__arg_capacity / _web64_loader_read__arg3 (3)
; _web64_loader_unpack: _web64_loader_unpack__arg_window, 2 byte(s)
; +0 request[2] -> _web64_loader_unpack__arg_request / _web64_loader_unpack__arg0 (0)
; _web64_motion_axis: _web64_motion_axis__arg_window, 9 byte(s)
; +0 velocity[2] -> _web64_motion_axis__arg_velocity / _web64_motion_axis__arg0 (0)
; +2 intent[1] -> _web64_motion_axis__arg_intent / _web64_motion_axis__arg1 (1)
; +3 acceleration[2] -> _web64_motion_axis__arg_acceleration / _web64_motion_axis__arg2 (2)
; +5 braking[2] -> _web64_motion_axis__arg_braking / _web64_motion_axis__arg3 (3)
; +7 maximum[2] -> _web64_motion_axis__arg_maximum / _web64_motion_axis__arg4 (4)
; _web64_motion_clamp: _web64_motion_clamp__arg_window, 8 byte(s)
; +0 position[2] -> _web64_motion_clamp__arg_position / _web64_motion_clamp__arg0 (0)
; +2 velocity[2] -> _web64_motion_clamp__arg_velocity / _web64_motion_clamp__arg1 (1)
; +4 minimum[2] -> _web64_motion_clamp__arg_minimum / _web64_motion_clamp__arg2 (2)
; +6 maximum[2] -> _web64_motion_clamp__arg_maximum / _web64_motion_clamp__arg3 (3)
; _web64_motion_clamp_s16: _web64_motion_clamp_s16__arg_window, 8 byte(s)
; +0 position[2] -> _web64_motion_clamp_s16__arg_position / _web64_motion_clamp_s16__arg0 (0)
; +2 velocity[2] -> _web64_motion_clamp_s16__arg_velocity / _web64_motion_clamp_s16__arg1 (1)
; +4 minimum[2] -> _web64_motion_clamp_s16__arg_minimum / _web64_motion_clamp_s16__arg2 (2)
; +6 maximum[2] -> _web64_motion_clamp_s16__arg_maximum / _web64_motion_clamp_s16__arg3 (3)
; _web64_motion_integrate: _web64_motion_integrate__arg_window, 4 byte(s)
; +0 position[2] -> _web64_motion_integrate__arg_position / _web64_motion_integrate__arg0 (0)
; +2 velocity[2] -> _web64_motion_integrate__arg_velocity / _web64_motion_integrate__arg1 (1)
; _web64_motion_integrate_s16: _web64_motion_integrate_s16__arg_window, 4 byte(s)
; +0 position[2] -> _web64_motion_integrate_s16__arg_position / _web64_motion_integrate_s16__arg0 (0)
; +2 velocity[2] -> _web64_motion_integrate_s16__arg_velocity / _web64_motion_integrate_s16__arg1 (1)
; _web64_motion_steer_s16: _web64_motion_steer_s16__arg_window, 7 byte(s)
; +0 velocity[2] -> _web64_motion_steer_s16__arg_velocity / _web64_motion_steer_s16__arg0 (0)
; +2 intent[1] -> _web64_motion_steer_s16__arg_intent / _web64_motion_steer_s16__arg1 (1)
; +3 acceleration[1] -> _web64_motion_steer_s16__arg_acceleration / _web64_motion_steer_s16__arg2 (2)
; +4 braking[1] -> _web64_motion_steer_s16__arg_braking / _web64_motion_steer_s16__arg3 (3)
; +5 reversal[1] -> _web64_motion_steer_s16__arg_reversal / _web64_motion_steer_s16__arg4 (4)
; +6 maximum[1] -> _web64_motion_steer_s16__arg_maximum / _web64_motion_steer_s16__arg5 (5)
; _web64_motion_wrap: _web64_motion_wrap__arg_window, 6 byte(s)
; +0 position[2] -> _web64_motion_wrap__arg_position / _web64_motion_wrap__arg0 (0)
; +2 minimum[2] -> _web64_motion_wrap__arg_minimum / _web64_motion_wrap__arg1 (1)
; +4 maximum[2] -> _web64_motion_wrap__arg_maximum / _web64_motion_wrap__arg2 (2)
; _web64_motion_wrap_s16: _web64_motion_wrap_s16__arg_window, 6 byte(s)
; +0 position[2] -> _web64_motion_wrap_s16__arg_position / _web64_motion_wrap_s16__arg0 (0)
; +2 minimum[2] -> _web64_motion_wrap_s16__arg_minimum / _web64_motion_wrap_s16__arg1 (1)
; +4 maximum[2] -> _web64_motion_wrap_s16__arg_maximum / _web64_motion_wrap_s16__arg2 (2)
; _web64_motion2d_integrate: _web64_motion2d_integrate__arg_window, 2 byte(s)
; +0 motion[2] -> _web64_motion2d_integrate__arg_motion / _web64_motion2d_integrate__arg0 (0)
; _web64_reu_fetch: _web64_reu_fetch__arg_window, 4 byte(s)
; +0 request[2] -> _web64_reu_fetch__arg_request / _web64_reu_fetch__arg0 (0)
; +2 result[2] -> _web64_reu_fetch__arg_result / _web64_reu_fetch__arg1 (1)
; _web64_reu_init: _web64_reu_init__arg_window, 0 byte(s)
; _web64_reu_store: _web64_reu_store__arg_window, 4 byte(s)
; +0 request[2] -> _web64_reu_store__arg_request / _web64_reu_store__arg0 (0)
; +2 result[2] -> _web64_reu_store__arg_result / _web64_reu_store__arg1 (1)
; _web64_sin8: _web64_sin8__arg_window, 1 byte(s)
; +0 angle[1] -> _web64_sin8__arg_angle / _web64_sin8__arg0 (0)
; _web64_sprite_apply_overlay_palette: _web64_sprite_apply_overlay_palette__arg_window, 2 byte(s)
; +0 asset[2] -> _web64_sprite_apply_overlay_palette__arg_asset / _web64_sprite_apply_overlay_palette__arg0 (0)
; _web64_sprite_mux_activate: _web64_sprite_mux_activate__arg_window, 2 byte(s)
; +0 mux[2] -> _web64_sprite_mux_activate__arg_mux / _web64_sprite_mux_activate__arg0 (0)
; _web64_sprite_mux_begin_frame: _web64_sprite_mux_begin_frame__arg_window, 2 byte(s)
; +0 mux[2] -> _web64_sprite_mux_begin_frame__arg_mux / _web64_sprite_mux_begin_frame__arg0 (0)
; _web64_sprite_mux_commit: _web64_sprite_mux_commit__arg_window, 2 byte(s)
; +0 mux[2] -> _web64_sprite_mux_commit__arg_mux / _web64_sprite_mux_commit__arg0 (0)
; _web64_sprite_mux_deactivate: _web64_sprite_mux_deactivate__arg_window, 2 byte(s)
; +0 mux[2] -> _web64_sprite_mux_deactivate__arg_mux / _web64_sprite_mux_deactivate__arg0 (0)
; _web64_sprite_mux_init: _web64_sprite_mux_init__arg_window, 13 byte(s)
; +0 mux[2] -> _web64_sprite_mux_init__arg_mux / _web64_sprite_mux_init__arg0 (0)
; +2 buffer_a[2] -> _web64_sprite_mux_init__arg_buffer_a / _web64_sprite_mux_init__arg1 (1)
; +4 buffer_b[2] -> _web64_sprite_mux_init__arg_buffer_b / _web64_sprite_mux_init__arg2 (2)
; +6 capacity[1] -> _web64_sprite_mux_init__arg_capacity / _web64_sprite_mux_init__arg3 (3)
; +7 pointer_table[2] -> _web64_sprite_mux_init__arg_pointer_table / _web64_sprite_mux_init__arg4 (4)
; +9 owned_slots[1] -> _web64_sprite_mux_init__arg_owned_slots / _web64_sprite_mux_init__arg5 (5)
; +10 multicolor_1[1] -> _web64_sprite_mux_init__arg_multicolor_1 / _web64_sprite_mux_init__arg6 (6)
; +11 multicolor_2[1] -> _web64_sprite_mux_init__arg_multicolor_2 / _web64_sprite_mux_init__arg7 (7)
; +12 video_standard[1] -> _web64_sprite_mux_init__arg_video_standard / _web64_sprite_mux_init__arg8 (8)
; _web64_sprite_mux_submit: _web64_sprite_mux_submit__arg_window, 9 byte(s)
; +0 mux[2] -> _web64_sprite_mux_submit__arg_mux / _web64_sprite_mux_submit__arg0 (0)
; +2 x[2] -> _web64_sprite_mux_submit__arg_x / _web64_sprite_mux_submit__arg1 (1)
; +4 y[1] -> _web64_sprite_mux_submit__arg_y / _web64_sprite_mux_submit__arg2 (2)
; +5 pointer[1] -> _web64_sprite_mux_submit__arg_pointer / _web64_sprite_mux_submit__arg3 (3)
; +6 color[1] -> _web64_sprite_mux_submit__arg_color / _web64_sprite_mux_submit__arg4 (4)
; +7 flags[1] -> _web64_sprite_mux_submit__arg_flags / _web64_sprite_mux_submit__arg5 (5)
; +8 priority[1] -> _web64_sprite_mux_submit__arg_priority / _web64_sprite_mux_submit__arg6 (6)
; _web64_sprite_mux_submit_asset_pair: _web64_sprite_mux_submit_asset_pair__arg_window, 11 byte(s)
; +0 mux[2] -> _web64_sprite_mux_submit_asset_pair__arg_mux / _web64_sprite_mux_submit_asset_pair__arg0 (0)
; +2 binding[2] -> _web64_sprite_mux_submit_asset_pair__arg_binding / _web64_sprite_mux_submit_asset_pair__arg1 (1)
; +4 x[2] -> _web64_sprite_mux_submit_asset_pair__arg_x / _web64_sprite_mux_submit_asset_pair__arg2 (2)
; +6 y[1] -> _web64_sprite_mux_submit_asset_pair__arg_y / _web64_sprite_mux_submit_asset_pair__arg3 (3)
; +7 base_frame[1] -> _web64_sprite_mux_submit_asset_pair__arg_base_frame / _web64_sprite_mux_submit_asset_pair__arg4 (4)
; +8 overlay_frame[1] -> _web64_sprite_mux_submit_asset_pair__arg_overlay_frame / _web64_sprite_mux_submit_asset_pair__arg5 (5)
; +9 flags[1] -> _web64_sprite_mux_submit_asset_pair__arg_flags / _web64_sprite_mux_submit_asset_pair__arg6 (6)
; +10 priority[1] -> _web64_sprite_mux_submit_asset_pair__arg_priority / _web64_sprite_mux_submit_asset_pair__arg7 (7)
; _web64_sprite_mux_submit_pair: _web64_sprite_mux_submit_pair__arg_window, 11 byte(s)
; +0 mux[2] -> _web64_sprite_mux_submit_pair__arg_mux / _web64_sprite_mux_submit_pair__arg0 (0)
; +2 x[2] -> _web64_sprite_mux_submit_pair__arg_x / _web64_sprite_mux_submit_pair__arg1 (1)
; +4 y[1] -> _web64_sprite_mux_submit_pair__arg_y / _web64_sprite_mux_submit_pair__arg2 (2)
; +5 base_pointer[1] -> _web64_sprite_mux_submit_pair__arg_base_pointer / _web64_sprite_mux_submit_pair__arg3 (3)
; +6 overlay_pointer[1] -> _web64_sprite_mux_submit_pair__arg_overlay_pointer / _web64_sprite_mux_submit_pair__arg4 (4)
; +7 base_color[1] -> _web64_sprite_mux_submit_pair__arg_base_color / _web64_sprite_mux_submit_pair__arg5 (5)
; +8 overlay_color[1] -> _web64_sprite_mux_submit_pair__arg_overlay_color / _web64_sprite_mux_submit_pair__arg6 (6)
; +9 flags[1] -> _web64_sprite_mux_submit_pair__arg_flags / _web64_sprite_mux_submit_pair__arg7 (7)
; +10 priority[1] -> _web64_sprite_mux_submit_pair__arg_priority / _web64_sprite_mux_submit_pair__arg8 (8)
; _web64_sprite_render: _web64_sprite_render__arg_window, 9 byte(s)
; +0 renderer[2] -> _web64_sprite_render__arg_renderer / _web64_sprite_render__arg0 (0)
; +2 slot[1] -> _web64_sprite_render__arg_slot / _web64_sprite_render__arg1 (1)
; +3 x[2] -> _web64_sprite_render__arg_x / _web64_sprite_render__arg2 (2)
; +5 y[1] -> _web64_sprite_render__arg_y / _web64_sprite_render__arg3 (3)
; +6 frame[1] -> _web64_sprite_render__arg_frame / _web64_sprite_render__arg4 (4)
; +7 color[1] -> _web64_sprite_render__arg_color / _web64_sprite_render__arg5 (5)
; +8 flags[1] -> _web64_sprite_render__arg_flags / _web64_sprite_render__arg6 (6)
; _web64_sprite_render_asset_pair: _web64_sprite_render_asset_pair__arg_window, 12 byte(s)
; +0 renderer[2] -> _web64_sprite_render_asset_pair__arg_renderer / _web64_sprite_render_asset_pair__arg0 (0)
; +2 binding[2] -> _web64_sprite_render_asset_pair__arg_binding / _web64_sprite_render_asset_pair__arg1 (1)
; +4 base_slot[1] -> _web64_sprite_render_asset_pair__arg_base_slot / _web64_sprite_render_asset_pair__arg2 (2)
; +5 overlay_slot[1] -> _web64_sprite_render_asset_pair__arg_overlay_slot / _web64_sprite_render_asset_pair__arg3 (3)
; +6 x[2] -> _web64_sprite_render_asset_pair__arg_x / _web64_sprite_render_asset_pair__arg4 (4)
; +8 y[1] -> _web64_sprite_render_asset_pair__arg_y / _web64_sprite_render_asset_pair__arg5 (5)
; +9 base_frame[1] -> _web64_sprite_render_asset_pair__arg_base_frame / _web64_sprite_render_asset_pair__arg6 (6)
; +10 overlay_frame[1] -> _web64_sprite_render_asset_pair__arg_overlay_frame / _web64_sprite_render_asset_pair__arg7 (7)
; +11 flags[1] -> _web64_sprite_render_asset_pair__arg_flags / _web64_sprite_render_asset_pair__arg8 (8)
; _web64_sprite_render_attachment: _web64_sprite_render_attachment__arg_window, 18 byte(s)
; +0 renderer[2] -> _web64_sprite_render_attachment__arg_renderer / _web64_sprite_render_attachment__arg0 (0)
; +2 base_slot[1] -> _web64_sprite_render_attachment__arg_base_slot / _web64_sprite_render_attachment__arg1 (1)
; +3 overlay_slot[1] -> _web64_sprite_render_attachment__arg_overlay_slot / _web64_sprite_render_attachment__arg2 (2)
; +4 world_x[2] -> _web64_sprite_render_attachment__arg_world_x / _web64_sprite_render_attachment__arg3 (3)
; +6 world_y[2] -> _web64_sprite_render_attachment__arg_world_y / _web64_sprite_render_attachment__arg4 (4)
; +8 camera[2] -> _web64_sprite_render_attachment__arg_camera / _web64_sprite_render_attachment__arg5 (5)
; +10 offset_x[1] -> _web64_sprite_render_attachment__arg_offset_x / _web64_sprite_render_attachment__arg6 (6)
; +11 offset_y[1] -> _web64_sprite_render_attachment__arg_offset_y / _web64_sprite_render_attachment__arg7 (7)
; +12 base_frame[1] -> _web64_sprite_render_attachment__arg_base_frame / _web64_sprite_render_attachment__arg8 (8)
; +13 overlay_frame[1] -> _web64_sprite_render_attachment__arg_overlay_frame / _web64_sprite_render_attachment__arg9 (9)
; +14 base_color[1] -> _web64_sprite_render_attachment__arg_base_color / _web64_sprite_render_attachment__arg10 (10)
; +15 overlay_color[1] -> _web64_sprite_render_attachment__arg_overlay_color / _web64_sprite_render_attachment__arg11 (11)
; +16 base_flags[1] -> _web64_sprite_render_attachment__arg_base_flags / _web64_sprite_render_attachment__arg12 (12)
; +17 overlay_flags[1] -> _web64_sprite_render_attachment__arg_overlay_flags / _web64_sprite_render_attachment__arg13 (13)
; _web64_sprite_render_camera: _web64_sprite_render_camera__arg_window, 12 byte(s)
; +0 renderer[2] -> _web64_sprite_render_camera__arg_renderer / _web64_sprite_render_camera__arg0 (0)
; +2 slot[1] -> _web64_sprite_render_camera__arg_slot / _web64_sprite_render_camera__arg1 (1)
; +3 world_x[2] -> _web64_sprite_render_camera__arg_world_x / _web64_sprite_render_camera__arg2 (2)
; +5 world_y[2] -> _web64_sprite_render_camera__arg_world_y / _web64_sprite_render_camera__arg3 (3)
; +7 camera[2] -> _web64_sprite_render_camera__arg_camera / _web64_sprite_render_camera__arg4 (4)
; +9 frame[1] -> _web64_sprite_render_camera__arg_frame / _web64_sprite_render_camera__arg5 (5)
; +10 color[1] -> _web64_sprite_render_camera__arg_color / _web64_sprite_render_camera__arg6 (6)
; +11 flags[1] -> _web64_sprite_render_camera__arg_flags / _web64_sprite_render_camera__arg7 (7)
; _web64_sprite_render_overlay: _web64_sprite_render_overlay__arg_window, 12 byte(s)
; +0 renderer[2] -> _web64_sprite_render_overlay__arg_renderer / _web64_sprite_render_overlay__arg0 (0)
; +2 base_slot[1] -> _web64_sprite_render_overlay__arg_base_slot / _web64_sprite_render_overlay__arg1 (1)
; +3 overlay_slot[1] -> _web64_sprite_render_overlay__arg_overlay_slot / _web64_sprite_render_overlay__arg2 (2)
; +4 x[2] -> _web64_sprite_render_overlay__arg_x / _web64_sprite_render_overlay__arg3 (3)
; +6 y[1] -> _web64_sprite_render_overlay__arg_y / _web64_sprite_render_overlay__arg4 (4)
; +7 base_frame[1] -> _web64_sprite_render_overlay__arg_base_frame / _web64_sprite_render_overlay__arg5 (5)
; +8 overlay_frame[1] -> _web64_sprite_render_overlay__arg_overlay_frame / _web64_sprite_render_overlay__arg6 (6)
; +9 base_color[1] -> _web64_sprite_render_overlay__arg_base_color / _web64_sprite_render_overlay__arg7 (7)
; +10 overlay_color[1] -> _web64_sprite_render_overlay__arg_overlay_color / _web64_sprite_render_overlay__arg8 (8)
; +11 flags[1] -> _web64_sprite_render_overlay__arg_flags / _web64_sprite_render_overlay__arg9 (9)
; _web64_sprite_renderer_init: _web64_sprite_renderer_init__arg_window, 4 byte(s)
; +0 renderer[2] -> _web64_sprite_renderer_init__arg_renderer / _web64_sprite_renderer_init__arg0 (0)
; +2 pointer_base[2] -> _web64_sprite_renderer_init__arg_pointer_base / _web64_sprite_renderer_init__arg1 (1)
; _web64_trajectory_init: _web64_trajectory_init__arg_window, 10 byte(s)
; +0 state[2] -> _web64_trajectory_init__arg_state / _web64_trajectory_init__arg0 (0)
; +2 pattern[2] -> _web64_trajectory_init__arg_pattern / _web64_trajectory_init__arg1 (1)
; +4 x[2] -> _web64_trajectory_init__arg_x / _web64_trajectory_init__arg2 (2)
; +6 y[2] -> _web64_trajectory_init__arg_y / _web64_trajectory_init__arg3 (3)
; +8 options[2] -> _web64_trajectory_init__arg_options / _web64_trajectory_init__arg4 (4)
; _web64_trajectory_init_fast: _web64_trajectory_init_fast__arg_window, 10 byte(s)
; +0 state[2] -> _web64_trajectory_init_fast__arg_state / _web64_trajectory_init_fast__arg0 (0)
; +2 pattern[2] -> _web64_trajectory_init_fast__arg_pattern / _web64_trajectory_init_fast__arg1 (1)
; +4 x[2] -> _web64_trajectory_init_fast__arg_x / _web64_trajectory_init_fast__arg2 (2)
; +6 y[2] -> _web64_trajectory_init_fast__arg_y / _web64_trajectory_init_fast__arg3 (3)
; +8 options[2] -> _web64_trajectory_init_fast__arg_options / _web64_trajectory_init_fast__arg4 (4)
; _web64_trajectory_step: _web64_trajectory_step__arg_window, 2 byte(s)
; +0 state[2] -> _web64_trajectory_step__arg_state / _web64_trajectory_step__arg0 (0)
; _web64_trajectory_step_batch: _web64_trajectory_step_batch__arg_window, 5 byte(s)
; +0 states[2] -> _web64_trajectory_step_batch__arg_states / _web64_trajectory_step_batch__arg0 (0)
; +2 count[1] -> _web64_trajectory_step_batch__arg_count / _web64_trajectory_step_batch__arg1 (1)
; +3 events[2] -> _web64_trajectory_step_batch__arg_events / _web64_trajectory_step_batch__arg2 (2)
; _web64_trajectory_step_batch_fast: _web64_trajectory_step_batch_fast__arg_window, 5 byte(s)
; +0 states[2] -> _web64_trajectory_step_batch_fast__arg_states / _web64_trajectory_step_batch_fast__arg0 (0)
; +2 count[1] -> _web64_trajectory_step_batch_fast__arg_count / _web64_trajectory_step_batch_fast__arg1 (1)
; +3 events[2] -> _web64_trajectory_step_batch_fast__arg_events / _web64_trajectory_step_batch_fast__arg2 (2)
; _web64_trajectory_step_fast: _web64_trajectory_step_fast__arg_window, 2 byte(s)
; +0 state[2] -> _web64_trajectory_step_fast__arg_state / _web64_trajectory_step_fast__arg0 (0)
; _web64_trajectory_validate: _web64_trajectory_validate__arg_window, 2 byte(s)
; +0 pattern[2] -> _web64_trajectory_validate__arg_pattern / _web64_trajectory_validate__arg0 (0)
; _web64_ufix8_div: _web64_ufix8_div__arg_window, 4 byte(s)
; +0 a[2] -> _web64_ufix8_div__arg_a / _web64_ufix8_div__arg0 (0)
; +2 b[2] -> _web64_ufix8_div__arg_b / _web64_ufix8_div__arg1 (1)
; _web64_ufix8_mul: _web64_ufix8_mul__arg_window, 4 byte(s)
; +0 a[2] -> _web64_ufix8_mul__arg_a / _web64_ufix8_mul__arg0 (0)
; +2 b[2] -> _web64_ufix8_mul__arg_b / _web64_ufix8_mul__arg1 (1)
; _web64_world_apply_video_mode: _web64_world_apply_video_mode__arg_window, 2 byte(s)
; +0 flags[1] -> _web64_world_apply_video_mode__arg_flags / _web64_world_apply_video_mode__arg0 (0)
; +1 memory_setup[1] -> _web64_world_apply_video_mode__arg_memory_setup / _web64_world_apply_video_mode__arg1 (1)
; _web64_world_camera_sync_x: _web64_world_camera_sync_x__arg_window, 4 byte(s)
; +0 camera[2] -> _web64_world_camera_sync_x__arg_camera / _web64_world_camera_sync_x__arg0 (0)
; +2 subpixel_position[2] -> _web64_world_camera_sync_x__arg_subpixel_position / _web64_world_camera_sync_x__arg1 (1)
; _web64_world_camera_sync_y: _web64_world_camera_sync_y__arg_window, 4 byte(s)
; +0 camera[2] -> _web64_world_camera_sync_y__arg_camera / _web64_world_camera_sync_y__arg0 (0)
; +2 subpixel_position[2] -> _web64_world_camera_sync_y__arg_subpixel_position / _web64_world_camera_sync_y__arg1 (1)
; _web64_world_copy_asset: _web64_world_copy_asset__arg_window, 6 byte(s)
; +0 destination[2] -> _web64_world_copy_asset__arg_destination / _web64_world_copy_asset__arg0 (0)
; +2 source[2] -> _web64_world_copy_asset__arg_source / _web64_world_copy_asset__arg1 (1)
; +4 length[2] -> _web64_world_copy_asset__arg_length / _web64_world_copy_asset__arg2 (2)
; _web64_world_draw_block2_view: _web64_world_draw_block2_view__arg_window, 15 byte(s)
; +0 map[2] -> _web64_world_draw_block2_view__arg_map / _web64_world_draw_block2_view__arg0 (0)
; +2 blocks[2] -> _web64_world_draw_block2_view__arg_blocks / _web64_world_draw_block2_view__arg1 (1)
; +4 block_colors[2] -> _web64_world_draw_block2_view__arg_block_colors / _web64_world_draw_block2_view__arg2 (2)
; +6 screen[2] -> _web64_world_draw_block2_view__arg_screen / _web64_world_draw_block2_view__arg3 (3)
; +8 color_ram[2] -> _web64_world_draw_block2_view__arg_color_ram / _web64_world_draw_block2_view__arg4 (4)
; +10 width[1] -> _web64_world_draw_block2_view__arg_width / _web64_world_draw_block2_view__arg5 (5)
; +11 height[1] -> _web64_world_draw_block2_view__arg_height / _web64_world_draw_block2_view__arg6 (6)
; +12 row_stride[1] -> _web64_world_draw_block2_view__arg_row_stride / _web64_world_draw_block2_view__arg7 (7)
; +13 color_mode[1] -> _web64_world_draw_block2_view__arg_color_mode / _web64_world_draw_block2_view__arg8 (8)
; +14 region_color[1] -> _web64_world_draw_block2_view__arg_region_color / _web64_world_draw_block2_view__arg9 (9)
; _web64_world_draw_block2_view_screen: _web64_world_draw_block2_view_screen__arg_window, 9 byte(s)
; +0 map[2] -> _web64_world_draw_block2_view_screen__arg_map / _web64_world_draw_block2_view_screen__arg0 (0)
; +2 blocks[2] -> _web64_world_draw_block2_view_screen__arg_blocks / _web64_world_draw_block2_view_screen__arg1 (1)
; +4 screen[2] -> _web64_world_draw_block2_view_screen__arg_screen / _web64_world_draw_block2_view_screen__arg2 (2)
; +6 width[1] -> _web64_world_draw_block2_view_screen__arg_width / _web64_world_draw_block2_view_screen__arg3 (3)
; +7 height[1] -> _web64_world_draw_block2_view_screen__arg_height / _web64_world_draw_block2_view_screen__arg4 (4)
; +8 row_stride[1] -> _web64_world_draw_block2_view_screen__arg_row_stride / _web64_world_draw_block2_view_screen__arg5 (5)
; _web64_world_draw_char_view: _web64_world_draw_char_view__arg_window, 13 byte(s)
; +0 cells[2] -> _web64_world_draw_char_view__arg_cells / _web64_world_draw_char_view__arg0 (0)
; +2 colors[2] -> _web64_world_draw_char_view__arg_colors / _web64_world_draw_char_view__arg1 (1)
; +4 screen[2] -> _web64_world_draw_char_view__arg_screen / _web64_world_draw_char_view__arg2 (2)
; +6 color_ram[2] -> _web64_world_draw_char_view__arg_color_ram / _web64_world_draw_char_view__arg3 (3)
; +8 width[1] -> _web64_world_draw_char_view__arg_width / _web64_world_draw_char_view__arg4 (4)
; +9 height[1] -> _web64_world_draw_char_view__arg_height / _web64_world_draw_char_view__arg5 (5)
; +10 row_stride[1] -> _web64_world_draw_char_view__arg_row_stride / _web64_world_draw_char_view__arg6 (6)
; +11 color_mode[1] -> _web64_world_draw_char_view__arg_color_mode / _web64_world_draw_char_view__arg7 (7)
; +12 region_color[1] -> _web64_world_draw_char_view__arg_region_color / _web64_world_draw_char_view__arg8 (8)
; _web64_world_draw_char_view_screen: _web64_world_draw_char_view_screen__arg_window, 7 byte(s)
; +0 cells[2] -> _web64_world_draw_char_view_screen__arg_cells / _web64_world_draw_char_view_screen__arg0 (0)
; +2 screen[2] -> _web64_world_draw_char_view_screen__arg_screen / _web64_world_draw_char_view_screen__arg1 (1)
; +4 width[1] -> _web64_world_draw_char_view_screen__arg_width / _web64_world_draw_char_view_screen__arg2 (2)
; +5 height[1] -> _web64_world_draw_char_view_screen__arg_height / _web64_world_draw_char_view_screen__arg3 (3)
; +6 row_stride[1] -> _web64_world_draw_char_view_screen__arg_row_stride / _web64_world_draw_char_view_screen__arg4 (4)
; _web64_world_mutate_cell: _web64_world_mutate_cell__arg_window, 20 byte(s)
; +0 cells[2] -> _web64_world_mutate_cell__arg_cells / _web64_world_mutate_cell__arg0 (0)
; +2 colors[2] -> _web64_world_mutate_cell__arg_colors / _web64_world_mutate_cell__arg1 (1)
; +4 materials[2] -> _web64_world_mutate_cell__arg_materials / _web64_world_mutate_cell__arg2 (2)
; +6 screen[2] -> _web64_world_mutate_cell__arg_screen / _web64_world_mutate_cell__arg3 (3)
; +8 color_ram[2] -> _web64_world_mutate_cell__arg_color_ram / _web64_world_mutate_cell__arg4 (4)
; +10 camera[2] -> _web64_world_mutate_cell__arg_camera / _web64_world_mutate_cell__arg5 (5)
; +12 column[1] -> _web64_world_mutate_cell__arg_column / _web64_world_mutate_cell__arg6 (6)
; +13 row[1] -> _web64_world_mutate_cell__arg_row / _web64_world_mutate_cell__arg7 (7)
; +14 value[1] -> _web64_world_mutate_cell__arg_value / _web64_world_mutate_cell__arg8 (8)
; +15 color[1] -> _web64_world_mutate_cell__arg_color / _web64_world_mutate_cell__arg9 (9)
; +16 material[1] -> _web64_world_mutate_cell__arg_material / _web64_world_mutate_cell__arg10 (10)
; +17 row_stride[1] -> _web64_world_mutate_cell__arg_row_stride / _web64_world_mutate_cell__arg11 (11)
; +18 screen_stride[1] -> _web64_world_mutate_cell__arg_screen_stride / _web64_world_mutate_cell__arg12 (12)
; +19 color_mode[1] -> _web64_world_mutate_cell__arg_color_mode / _web64_world_mutate_cell__arg13 (13)
; _web64_world_scroll_x: _web64_world_scroll_x__arg_window, 6 byte(s)
; +0 camera[2] -> _web64_world_scroll_x__arg_camera / _web64_world_scroll_x__arg0 (0)
; +2 delta_pixels[1] -> _web64_world_scroll_x__arg_delta_pixels / _web64_world_scroll_x__arg1 (1)
; +3 max_cell_x[2] -> _web64_world_scroll_x__arg_max_cell_x / _web64_world_scroll_x__arg2 (2)
; +5 flags[1] -> _web64_world_scroll_x__arg_flags / _web64_world_scroll_x__arg3 (3)
; _web64_world_scroll_y: _web64_world_scroll_y__arg_window, 6 byte(s)
; +0 camera[2] -> _web64_world_scroll_y__arg_camera / _web64_world_scroll_y__arg0 (0)
; +2 delta_pixels[1] -> _web64_world_scroll_y__arg_delta_pixels / _web64_world_scroll_y__arg1 (1)
; +3 max_cell_y[2] -> _web64_world_scroll_y__arg_max_cell_y / _web64_world_scroll_y__arg2 (2)
; +5 flags[1] -> _web64_world_scroll_y__arg_flags / _web64_world_scroll_y__arg3 (3)
; _web64_world_shift_down: _web64_world_shift_down__arg_window, 6 byte(s)
; +0 screen[2] -> _web64_world_shift_down__arg_screen / _web64_world_shift_down__arg0 (0)
; +2 color_ram[2] -> _web64_world_shift_down__arg_color_ram / _web64_world_shift_down__arg1 (1)
; +4 height[1] -> _web64_world_shift_down__arg_height / _web64_world_shift_down__arg2 (2)
; +5 color_mode[1] -> _web64_world_shift_down__arg_color_mode / _web64_world_shift_down__arg3 (3)
; _web64_world_shift_left: _web64_world_shift_left__arg_window, 6 byte(s)
; +0 screen[2] -> _web64_world_shift_left__arg_screen / _web64_world_shift_left__arg0 (0)
; +2 color_ram[2] -> _web64_world_shift_left__arg_color_ram / _web64_world_shift_left__arg1 (1)
; +4 height[1] -> _web64_world_shift_left__arg_height / _web64_world_shift_left__arg2 (2)
; +5 color_mode[1] -> _web64_world_shift_left__arg_color_mode / _web64_world_shift_left__arg3 (3)
; _web64_world_shift_right: _web64_world_shift_right__arg_window, 6 byte(s)
; +0 screen[2] -> _web64_world_shift_right__arg_screen / _web64_world_shift_right__arg0 (0)
; +2 color_ram[2] -> _web64_world_shift_right__arg_color_ram / _web64_world_shift_right__arg1 (1)
; +4 height[1] -> _web64_world_shift_right__arg_height / _web64_world_shift_right__arg2 (2)
; +5 color_mode[1] -> _web64_world_shift_right__arg_color_mode / _web64_world_shift_right__arg3 (3)
; _web64_world_shift_up: _web64_world_shift_up__arg_window, 6 byte(s)
; +0 screen[2] -> _web64_world_shift_up__arg_screen / _web64_world_shift_up__arg0 (0)
; +2 color_ram[2] -> _web64_world_shift_up__arg_color_ram / _web64_world_shift_up__arg1 (1)
; +4 height[1] -> _web64_world_shift_up__arg_height / _web64_world_shift_up__arg2 (2)
; +5 color_mode[1] -> _web64_world_shift_up__arg_color_mode / _web64_world_shift_up__arg3 (3)
; _web64_world_stream_column: _web64_world_stream_column__arg_window, 15 byte(s)
; +0 cells[2] -> _web64_world_stream_column__arg_cells / _web64_world_stream_column__arg0 (0)
; +2 colors[2] -> _web64_world_stream_column__arg_colors / _web64_world_stream_column__arg1 (1)
; +4 screen[2] -> _web64_world_stream_column__arg_screen / _web64_world_stream_column__arg2 (2)
; +6 color_ram[2] -> _web64_world_stream_column__arg_color_ram / _web64_world_stream_column__arg3 (3)
; +8 source_column[1] -> _web64_world_stream_column__arg_source_column / _web64_world_stream_column__arg4 (4)
; +9 dest_column[1] -> _web64_world_stream_column__arg_dest_column / _web64_world_stream_column__arg5 (5)
; +10 height[1] -> _web64_world_stream_column__arg_height / _web64_world_stream_column__arg6 (6)
; +11 row_stride[1] -> _web64_world_stream_column__arg_row_stride / _web64_world_stream_column__arg7 (7)
; +12 screen_stride[1] -> _web64_world_stream_column__arg_screen_stride / _web64_world_stream_column__arg8 (8)
; +13 color_mode[1] -> _web64_world_stream_column__arg_color_mode / _web64_world_stream_column__arg9 (9)
; +14 region_color[1] -> _web64_world_stream_column__arg_region_color / _web64_world_stream_column__arg10 (10)
; _web64_world_stream_column_screen: _web64_world_stream_column_screen__arg_window, 9 byte(s)
; +0 cells[2] -> _web64_world_stream_column_screen__arg_cells / _web64_world_stream_column_screen__arg0 (0)
; +2 screen[2] -> _web64_world_stream_column_screen__arg_screen / _web64_world_stream_column_screen__arg1 (1)
; +4 source_column[1] -> _web64_world_stream_column_screen__arg_source_column / _web64_world_stream_column_screen__arg2 (2)
; +5 dest_column[1] -> _web64_world_stream_column_screen__arg_dest_column / _web64_world_stream_column_screen__arg3 (3)
; +6 height[1] -> _web64_world_stream_column_screen__arg_height / _web64_world_stream_column_screen__arg4 (4)
; +7 row_stride[1] -> _web64_world_stream_column_screen__arg_row_stride / _web64_world_stream_column_screen__arg5 (5)
; +8 screen_stride[1] -> _web64_world_stream_column_screen__arg_screen_stride / _web64_world_stream_column_screen__arg6 (6)
; _web64_world_stream_row: _web64_world_stream_row__arg_window, 15 byte(s)
; +0 cells[2] -> _web64_world_stream_row__arg_cells / _web64_world_stream_row__arg0 (0)
; +2 colors[2] -> _web64_world_stream_row__arg_colors / _web64_world_stream_row__arg1 (1)
; +4 screen[2] -> _web64_world_stream_row__arg_screen / _web64_world_stream_row__arg2 (2)
; +6 color_ram[2] -> _web64_world_stream_row__arg_color_ram / _web64_world_stream_row__arg3 (3)
; +8 source_row[1] -> _web64_world_stream_row__arg_source_row / _web64_world_stream_row__arg4 (4)
; +9 dest_row[1] -> _web64_world_stream_row__arg_dest_row / _web64_world_stream_row__arg5 (5)
; +10 width[1] -> _web64_world_stream_row__arg_width / _web64_world_stream_row__arg6 (6)
; +11 row_stride[1] -> _web64_world_stream_row__arg_row_stride / _web64_world_stream_row__arg7 (7)
; +12 screen_stride[1] -> _web64_world_stream_row__arg_screen_stride / _web64_world_stream_row__arg8 (8)
; +13 color_mode[1] -> _web64_world_stream_row__arg_color_mode / _web64_world_stream_row__arg9 (9)
; +14 region_color[1] -> _web64_world_stream_row__arg_region_color / _web64_world_stream_row__arg10 (10)
; _web64_world_stream_row_screen: _web64_world_stream_row_screen__arg_window, 9 byte(s)
; +0 cells[2] -> _web64_world_stream_row_screen__arg_cells / _web64_world_stream_row_screen__arg0 (0)
; +2 screen[2] -> _web64_world_stream_row_screen__arg_screen / _web64_world_stream_row_screen__arg1 (1)
; +4 source_row[1] -> _web64_world_stream_row_screen__arg_source_row / _web64_world_stream_row_screen__arg2 (2)
; +5 dest_row[1] -> _web64_world_stream_row_screen__arg_dest_row / _web64_world_stream_row_screen__arg3 (3)
; +6 width[1] -> _web64_world_stream_row_screen__arg_width / _web64_world_stream_row_screen__arg4 (4)
; +7 row_stride[1] -> _web64_world_stream_row_screen__arg_row_stride / _web64_world_stream_row_screen__arg5 (5)
; +8 screen_stride[1] -> _web64_world_stream_row_screen__arg_screen_stride / _web64_world_stream_row_screen__arg6 (6)
web64/sprite-mux.h
Caller-owned PAL schedule storage, deterministic atomic submissions, double-buffer publication, explicit status, and application-chained IRQ service.
Included headers: <web64/sprite-runtime.h>.
Structs:
| Name | Description | Field summary |
|---|---|---|
Web64SpriteMuxStatus | Runtime-facing Web64 helper struct. | 30 fields: uint8_t accepted_entries, uint8_t dropped_entries, uint8_t accepted_layers, uint8_t dropped_layers, ... |
Web64SpriteMultiplexer | Runtime-facing Web64 helper struct. | 27 fields: Web64SpriteMuxEntry *buffer_a, Web64SpriteMuxEntry *buffer_b, Web64SpriteMuxEntry *build_buffer, Web64SpriteMuxEntry *active_buffer, ... |
Macros:
| Name | Value | Description |
|---|---|---|
WEB64_SPRITE_MUX_VIDEO_PAL | 1 | Macro constant exported by the header. |
WEB64_SPRITE_MUX_VIDEO_NTSC | 2 | Macro constant exported by the header. |
WEB64_SPRITE_MUX_OK | 0 | Macro constant exported by the header. |
WEB64_SPRITE_MUX_BUSY | 1 | Macro constant exported by the header. |
WEB64_SPRITE_MUX_CAPACITY | 2 | Macro constant exported by the header. |
WEB64_SPRITE_MUX_INVALID_FRAME | 4 | Macro constant exported by the header. |
WEB64_SPRITE_MUX_PALETTE_MISMATCH | 8 | Macro constant exported by the header. |
WEB64_SPRITE_MUX_UNSCHEDULABLE | 16 | Macro constant exported by the header. |
WEB64_SPRITE_MUX_UNSUPPORTED_STANDARD | 32 | Macro constant exported by the header. |
WEB64_SPRITE_MUX_ACTIVE | 64 | Macro constant exported by the header. |
WEB64_SPRITE_MUX_INVALID_ARGUMENT | 128 | Macro constant exported by the header. |
WEB64_SPRITE_MUX_ENTRY_PAIR | 1 | Macro constant exported by the header. |
WEB64_SPRITE_MUX_PAL_LINE_CYCLES | 63 | Macro constant exported by the header. |
WEB64_SPRITE_MUX_IRQ_FIXED_CYCLES | 300 | Macro constant exported by the header. |
WEB64_SPRITE_MUX_IRQ_LAYER_CYCLES | 48 | Macro constant exported by the header. |
WEB64_SPRITE_MUX_SAFETY_CYCLES | 63 | Macro constant exported by the header. |
WEB64_SPRITE_MUX_SINGLE_SERVICE_LINES | 7 | Macro constant exported by the header. |
WEB64_SPRITE_MUX_PAIR_SERVICE_LINES | 8 | Macro constant exported by the header. |
Header listing:
#ifndef WEB64_SPRITE_MUX_H
#define WEB64_SPRITE_MUX_H
#include <web64/sprite-runtime.h>
#define WEB64_SPRITE_MUX_VIDEO_PAL 1
#define WEB64_SPRITE_MUX_VIDEO_NTSC 2
#define WEB64_SPRITE_MUX_OK 0
#define WEB64_SPRITE_MUX_BUSY 1
#define WEB64_SPRITE_MUX_CAPACITY 2
#define WEB64_SPRITE_MUX_INVALID_FRAME 4
#define WEB64_SPRITE_MUX_PALETTE_MISMATCH 8
#define WEB64_SPRITE_MUX_UNSCHEDULABLE 16
#define WEB64_SPRITE_MUX_UNSUPPORTED_STANDARD 32
#define WEB64_SPRITE_MUX_ACTIVE 64
#define WEB64_SPRITE_MUX_INVALID_ARGUMENT 128
#define WEB64_SPRITE_MUX_ENTRY_PAIR 1
#define WEB64_SPRITE_MUX_PAL_LINE_CYCLES 63
#define WEB64_SPRITE_MUX_IRQ_FIXED_CYCLES 300
#define WEB64_SPRITE_MUX_IRQ_LAYER_CYCLES 48
#define WEB64_SPRITE_MUX_SAFETY_CYCLES 63
#define WEB64_SPRITE_MUX_SINGLE_SERVICE_LINES 7
#define WEB64_SPRITE_MUX_PAIR_SERVICE_LINES 8
typedef struct { uint8_t accepted_entries; uint8_t dropped_entries; uint8_t accepted_layers; uint8_t dropped_layers; uint8_t reasons; uint8_t capacity; uint8_t submitted_entries; uint8_t pending; } Web64SpriteMuxStatus;
typedef struct { uint16_t x; uint8_t y; uint8_t base_pointer; uint8_t overlay_pointer; uint8_t base_color; uint8_t overlay_color; uint8_t flags; uint8_t priority; uint8_t submission_order; uint8_t layers; uint8_t base_slot; uint8_t overlay_slot; uint16_t event_line; uint16_t end_line; uint8_t accepted; uint8_t vic_x_high; uint8_t vic_expand_x; uint8_t vic_expand_y; uint8_t vic_priority; uint8_t vic_multicolor; uint8_t vic_visible; } Web64SpriteMuxEntry;
typedef struct { Web64SpriteMuxEntry *buffer_a; Web64SpriteMuxEntry *buffer_b; Web64SpriteMuxEntry *build_buffer; Web64SpriteMuxEntry *active_buffer; Web64SpriteMuxEntry *pending_buffer; uint16_t pointer_table; uint8_t capacity; uint8_t owned_slots; uint8_t multicolor_1; uint8_t multicolor_2; uint8_t video_standard; uint8_t build_count; uint8_t build_layers; uint8_t pending_count; uint8_t active_count; uint8_t pending; uint8_t activated; uint8_t active_index; uint8_t layout_count; Web64SpriteMuxStatus status; uint16_t slot_end[8]; uint8_t slot_used; uint8_t layout_generation; uint8_t buffer_a_generation; uint8_t buffer_b_generation; uint8_t layout_layers; uint8_t stable_identity_x_low; } Web64SpriteMultiplexer;
#define WEB64_SPRITE_MUX_STORAGE(name, capacity) Web64SpriteMultiplexer name; Web64SpriteMuxEntry name##_buffer_a[capacity]; Web64SpriteMuxEntry name##_buffer_b[capacity]
_web64_rt uint8_t web64_sprite_mux_init(Web64SpriteMultiplexer *mux, Web64SpriteMuxEntry *buffer_a, Web64SpriteMuxEntry *buffer_b, uint8_t capacity, uint16_t pointer_table, uint8_t owned_slots, uint8_t multicolor_1, uint8_t multicolor_2, uint8_t video_standard);
_web64_rt uint8_t web64_sprite_mux_activate(Web64SpriteMultiplexer *mux);
_web64_rt void web64_sprite_mux_deactivate(Web64SpriteMultiplexer *mux);
_web64_rt uint8_t web64_sprite_mux_begin_frame(Web64SpriteMultiplexer *mux);
_web64_rt uint8_t web64_sprite_mux_submit(Web64SpriteMultiplexer *mux, uint16_t x, uint8_t y, uint8_t pointer, uint8_t color, uint8_t flags, uint8_t priority);
_web64_rt uint8_t web64_sprite_mux_submit_pair(Web64SpriteMultiplexer *mux, uint16_t x, uint8_t y, uint8_t base_pointer, uint8_t overlay_pointer, uint8_t base_color, uint8_t overlay_color, uint8_t flags, uint8_t priority);
_web64_rt uint8_t web64_sprite_mux_submit_asset_pair(Web64SpriteMultiplexer *mux, const Web64SpriteOverlayBinding *binding, uint16_t x, uint8_t y, uint8_t base_frame, uint8_t overlay_frame, uint8_t flags, uint8_t priority);
_web64_rt uint8_t web64_sprite_mux_commit(Web64SpriteMultiplexer *mux);
void web64_sprite_mux_irq_service(void);
void web64_sprite_mux_irq_service_fast(void);
#endif
web64/sprite-mux.inc
Registry-generated sprite-multiplexer prepare/call macros, including parameterless IRQ-service calls, for native assembly.
Header listing:
; Web64 _web64_rt C/assembly call helpers for <web64/sprite-mux.h>
; Generated from native runtime registry v8; do not hand-edit.
; Arguments are immediate assembly expressions. Pass C globals with their emitted labels.
; Prepare helpers write the complete exact-width window and clobber A only.
; Call helpers prepare the window, JSR the public entry, and inherit its clobber/return contract.
; Helpers allocate no storage. Including this file, or leaving a helper unused, links zero runtime bytes.
WEB64_RT_SPRITE_MUX_CALL_COUNT = 10
WEB64_RT_SPRITE_MUX_WINDOW_CALL_COUNT = 8
; web64_sprite_mux_activate: 2-byte window; entry _web64_sprite_mux_activate
.macro web64_rt_prepare_sprite_mux_activate mux
lda #<mux
sta _web64_sprite_mux_activate__arg_mux
lda #>mux
sta _web64_sprite_mux_activate__arg_mux+1
.endmacro
.macro web64_rt_call_sprite_mux_activate mux
web64_rt_prepare_sprite_mux_activate mux
jsr _web64_sprite_mux_activate
.endmacro
; web64_sprite_mux_begin_frame: 2-byte window; entry _web64_sprite_mux_begin_frame
.macro web64_rt_prepare_sprite_mux_begin_frame mux
lda #<mux
sta _web64_sprite_mux_begin_frame__arg_mux
lda #>mux
sta _web64_sprite_mux_begin_frame__arg_mux+1
.endmacro
.macro web64_rt_call_sprite_mux_begin_frame mux
web64_rt_prepare_sprite_mux_begin_frame mux
jsr _web64_sprite_mux_begin_frame
.endmacro
; web64_sprite_mux_commit: 2-byte window; entry _web64_sprite_mux_commit
.macro web64_rt_prepare_sprite_mux_commit mux
lda #<mux
sta _web64_sprite_mux_commit__arg_mux
lda #>mux
sta _web64_sprite_mux_commit__arg_mux+1
.endmacro
.macro web64_rt_call_sprite_mux_commit mux
web64_rt_prepare_sprite_mux_commit mux
jsr _web64_sprite_mux_commit
.endmacro
; web64_sprite_mux_deactivate: 2-byte window; entry _web64_sprite_mux_deactivate
.macro web64_rt_prepare_sprite_mux_deactivate mux
lda #<mux
sta _web64_sprite_mux_deactivate__arg_mux
lda #>mux
sta _web64_sprite_mux_deactivate__arg_mux+1
.endmacro
.macro web64_rt_call_sprite_mux_deactivate mux
web64_rt_prepare_sprite_mux_deactivate mux
jsr _web64_sprite_mux_deactivate
.endmacro
; web64_sprite_mux_init: 13-byte window; entry _web64_sprite_mux_init
.macro web64_rt_prepare_sprite_mux_init mux, buffer_a, buffer_b, capacity, pointer_table, owned_slots, multicolor_1, multicolor_2, video_standard
lda #<mux
sta _web64_sprite_mux_init__arg_mux
lda #>mux
sta _web64_sprite_mux_init__arg_mux+1
lda #<buffer_a
sta _web64_sprite_mux_init__arg_buffer_a
lda #>buffer_a
sta _web64_sprite_mux_init__arg_buffer_a+1
lda #<buffer_b
sta _web64_sprite_mux_init__arg_buffer_b
lda #>buffer_b
sta _web64_sprite_mux_init__arg_buffer_b+1
lda #capacity
sta _web64_sprite_mux_init__arg_capacity
lda #<pointer_table
sta _web64_sprite_mux_init__arg_pointer_table
lda #>pointer_table
sta _web64_sprite_mux_init__arg_pointer_table+1
lda #owned_slots
sta _web64_sprite_mux_init__arg_owned_slots
lda #multicolor_1
sta _web64_sprite_mux_init__arg_multicolor_1
lda #multicolor_2
sta _web64_sprite_mux_init__arg_multicolor_2
lda #video_standard
sta _web64_sprite_mux_init__arg_video_standard
.endmacro
.macro web64_rt_call_sprite_mux_init mux, buffer_a, buffer_b, capacity, pointer_table, owned_slots, multicolor_1, multicolor_2, video_standard
web64_rt_prepare_sprite_mux_init mux, buffer_a, buffer_b, capacity, pointer_table, owned_slots, multicolor_1, multicolor_2, video_standard
jsr _web64_sprite_mux_init
.endmacro
; web64_sprite_mux_irq_service: parameterless entry _web64_sprite_mux_irq_service
.macro web64_rt_call_sprite_mux_irq_service
jsr _web64_sprite_mux_irq_service
.endmacro
; web64_sprite_mux_irq_service_fast: parameterless entry _web64_sprite_mux_irq_service_fast
.macro web64_rt_call_sprite_mux_irq_service_fast
jsr _web64_sprite_mux_irq_service_fast
.endmacro
; web64_sprite_mux_submit: 9-byte window; entry _web64_sprite_mux_submit
.macro web64_rt_prepare_sprite_mux_submit mux, x, y, pointer, color, flags, priority
lda #<mux
sta _web64_sprite_mux_submit__arg_mux
lda #>mux
sta _web64_sprite_mux_submit__arg_mux+1
lda #<x
sta _web64_sprite_mux_submit__arg_x
lda #>x
sta _web64_sprite_mux_submit__arg_x+1
lda #y
sta _web64_sprite_mux_submit__arg_y
lda #pointer
sta _web64_sprite_mux_submit__arg_pointer
lda #color
sta _web64_sprite_mux_submit__arg_color
lda #flags
sta _web64_sprite_mux_submit__arg_flags
lda #priority
sta _web64_sprite_mux_submit__arg_priority
.endmacro
.macro web64_rt_call_sprite_mux_submit mux, x, y, pointer, color, flags, priority
web64_rt_prepare_sprite_mux_submit mux, x, y, pointer, color, flags, priority
jsr _web64_sprite_mux_submit
.endmacro
; web64_sprite_mux_submit_asset_pair: 11-byte window; entry _web64_sprite_mux_submit_asset_pair
.macro web64_rt_prepare_sprite_mux_submit_asset_pair mux, binding, x, y, base_frame, overlay_frame, flags, priority
lda #<mux
sta _web64_sprite_mux_submit_asset_pair__arg_mux
lda #>mux
sta _web64_sprite_mux_submit_asset_pair__arg_mux+1
lda #<binding
sta _web64_sprite_mux_submit_asset_pair__arg_binding
lda #>binding
sta _web64_sprite_mux_submit_asset_pair__arg_binding+1
lda #<x
sta _web64_sprite_mux_submit_asset_pair__arg_x
lda #>x
sta _web64_sprite_mux_submit_asset_pair__arg_x+1
lda #y
sta _web64_sprite_mux_submit_asset_pair__arg_y
lda #base_frame
sta _web64_sprite_mux_submit_asset_pair__arg_base_frame
lda #overlay_frame
sta _web64_sprite_mux_submit_asset_pair__arg_overlay_frame
lda #flags
sta _web64_sprite_mux_submit_asset_pair__arg_flags
lda #priority
sta _web64_sprite_mux_submit_asset_pair__arg_priority
.endmacro
.macro web64_rt_call_sprite_mux_submit_asset_pair mux, binding, x, y, base_frame, overlay_frame, flags, priority
web64_rt_prepare_sprite_mux_submit_asset_pair mux, binding, x, y, base_frame, overlay_frame, flags, priority
jsr _web64_sprite_mux_submit_asset_pair
.endmacro
; web64_sprite_mux_submit_pair: 11-byte window; entry _web64_sprite_mux_submit_pair
.macro web64_rt_prepare_sprite_mux_submit_pair mux, x, y, base_pointer, overlay_pointer, base_color, overlay_color, flags, priority
lda #<mux
sta _web64_sprite_mux_submit_pair__arg_mux
lda #>mux
sta _web64_sprite_mux_submit_pair__arg_mux+1
lda #<x
sta _web64_sprite_mux_submit_pair__arg_x
lda #>x
sta _web64_sprite_mux_submit_pair__arg_x+1
lda #y
sta _web64_sprite_mux_submit_pair__arg_y
lda #base_pointer
sta _web64_sprite_mux_submit_pair__arg_base_pointer
lda #overlay_pointer
sta _web64_sprite_mux_submit_pair__arg_overlay_pointer
lda #base_color
sta _web64_sprite_mux_submit_pair__arg_base_color
lda #overlay_color
sta _web64_sprite_mux_submit_pair__arg_overlay_color
lda #flags
sta _web64_sprite_mux_submit_pair__arg_flags
lda #priority
sta _web64_sprite_mux_submit_pair__arg_priority
.endmacro
.macro web64_rt_call_sprite_mux_submit_pair mux, x, y, base_pointer, overlay_pointer, base_color, overlay_color, flags, priority
web64_rt_prepare_sprite_mux_submit_pair mux, x, y, base_pointer, overlay_pointer, base_color, overlay_color, flags, priority
jsr _web64_sprite_mux_submit_pair
.endmacro
web64/sprite-runtime.h
Independent direct eight-sprite renderer with 9-bit X, dirty writes, camera projection, native overlay-asset pairs, and raw attachment helpers.
Included headers: <web64/game.h>.
Functions:
| Name | Prototype | Description | Typical use |
|---|---|---|---|
web64_sprite_renderer_init | _web64_rt void web64_sprite_renderer_init(Web64SpriteRenderer *renderer, uint16_t pointer_base) | Initializes direct eight-sprite renderer dirty caches and sprite-pointer base address. | web64_sprite_renderer_init(&renderer, 0x07f8); |
web64_sprite_render | _web64_rt uint8_t web64_sprite_render(Web64SpriteRenderer *renderer, uint8_t slot, uint16_t x, uint8_t y, uint8_t frame, uint8_t color, uint8_t flags) | Writes one logical sprite state to a stable VIC-II hardware slot while suppressing unchanged register writes. | web64_sprite_render(&renderer, 0, x, y, frame, color, WEB64_SPRITE_VISIBLE); |
web64_sprite_render_camera | _web64_rt uint8_t web64_sprite_render_camera(Web64SpriteRenderer *renderer, uint8_t slot, uint16_t world_x, uint16_t world_y, Web64Camera *camera, uint8_t frame, uint8_t color, uint8_t flags) | Projects a world-space sprite through a camera and clips offscreen output. | web64_sprite_render_camera(&renderer, 0, world_x, world_y, &camera, frame, color, flags); |
web64_sprite_render_overlay | _web64_rt uint8_t web64_sprite_render_overlay(Web64SpriteRenderer *renderer, uint8_t base_slot, uint8_t overlay_slot, uint16_t x, uint8_t y, uint8_t base_frame, uint8_t overlay_frame, uint8_t base_color, uint8_t overlay_color, uint8_t flags) | Renders adjacent base and overlay hardware slots with synchronized position updates. | web64_sprite_render_overlay(&renderer, 0, 1, x, y, base_frame, overlay_frame, base_color, overlay_color, flags); |
web64_sprite_apply_overlay_palette | _web64_rt uint8_t web64_sprite_apply_overlay_palette(const Web64SpriteOverlayAsset *asset) | Web64 SDK runtime helper. | web64_sprite_apply_overlay_palette(...) |
web64_sprite_render_asset_pair | _web64_rt uint8_t web64_sprite_render_asset_pair(Web64SpriteRenderer *renderer, const Web64SpriteOverlayBinding *binding, uint8_t base_slot, uint8_t overlay_slot, uint16_t x, uint8_t y, uint8_t base_frame, uint8_t overlay_frame, uint8_t flags) | Web64 SDK runtime helper. | web64_sprite_render_asset_pair(...) |
web64_sprite_render_attachment | _web64_rt uint8_t web64_sprite_render_attachment(Web64SpriteRenderer *renderer, uint8_t base_slot, uint8_t overlay_slot, uint16_t world_x, uint16_t world_y, Web64Camera *camera, int8_t offset_x, int8_t offset_y, uint8_t base_frame, uint8_t overlay_frame, uint8_t base_color, uint8_t overlay_color, uint8_t base_flags, uint8_t overlay_flags) | Atomically renders a base sprite plus signed-offset overlay using camera projection and independent dirty state. | web64_sprite_render_attachment(&renderer, 0, 1, x, y, &camera, ox, oy, base, overlay, c0, c1, flags0, flags1); |
Structs:
| Name | Description | Field summary |
|---|---|---|
Web64SpriteState | Runtime-facing Web64 helper struct. | 10 fields: uint16_t x, uint8_t y, uint8_t frame, uint8_t color, ... |
Web64Camera | Public struct declared by <web64/sprite-runtime.h>. | 6 fields: int16_t x, int16_t y, } Web64Camera, typedef struct { Web64AssetRef asset, ... |
Macros:
| Name | Value | Description |
|---|---|---|
WEB64_SPRITE_VISIBLE | 1 | Macro constant exported by the header. |
WEB64_SPRITE_MULTICOLOR | 2 | Macro constant exported by the header. |
WEB64_SPRITE_EXPAND_X | 4 | Macro constant exported by the header. |
WEB64_SPRITE_EXPAND_Y | 8 | Macro constant exported by the header. |
WEB64_SPRITE_BEHIND | 16 | Macro constant exported by the header. |
Header listing:
#ifndef WEB64_SPRITE_RUNTIME_H
#define WEB64_SPRITE_RUNTIME_H
#include <web64/game.h>
#define WEB64_SPRITE_VISIBLE 1
#define WEB64_SPRITE_MULTICOLOR 2
#define WEB64_SPRITE_EXPAND_X 4
#define WEB64_SPRITE_EXPAND_Y 8
#define WEB64_SPRITE_BEHIND 16
typedef struct { uint16_t x; uint8_t y; uint8_t frame; uint8_t color; uint8_t flags; } Web64SpriteState;
typedef struct { Web64SpriteState slots[8]; uint8_t valid_mask; uint8_t pointer_base_lo; uint8_t pointer_base_hi; } Web64SpriteRenderer;
typedef struct { int16_t x; int16_t y; } Web64Camera;
typedef struct { Web64AssetRef asset; uint8_t base_pointer; uint8_t overlay_pointer; } Web64SpriteOverlayBinding;
_web64_rt void web64_sprite_renderer_init(Web64SpriteRenderer *renderer, uint16_t pointer_base);
_web64_rt uint8_t web64_sprite_render(Web64SpriteRenderer *renderer, uint8_t slot, uint16_t x, uint8_t y, uint8_t frame, uint8_t color, uint8_t flags);
_web64_rt uint8_t web64_sprite_render_camera(Web64SpriteRenderer *renderer, uint8_t slot, uint16_t world_x, uint16_t world_y, Web64Camera *camera, uint8_t frame, uint8_t color, uint8_t flags);
_web64_rt uint8_t web64_sprite_render_overlay(Web64SpriteRenderer *renderer, uint8_t base_slot, uint8_t overlay_slot, uint16_t x, uint8_t y, uint8_t base_frame, uint8_t overlay_frame, uint8_t base_color, uint8_t overlay_color, uint8_t flags);
_web64_rt uint8_t web64_sprite_apply_overlay_palette(const Web64SpriteOverlayAsset *asset);
_web64_rt uint8_t web64_sprite_render_asset_pair(Web64SpriteRenderer *renderer, const Web64SpriteOverlayBinding *binding, uint8_t base_slot, uint8_t overlay_slot, uint16_t x, uint8_t y, uint8_t base_frame, uint8_t overlay_frame, uint8_t flags);
_web64_rt uint8_t web64_sprite_render_attachment(Web64SpriteRenderer *renderer, uint8_t base_slot, uint8_t overlay_slot, uint16_t world_x, uint16_t world_y, Web64Camera *camera, int8_t offset_x, int8_t offset_y, uint8_t base_frame, uint8_t overlay_frame, uint8_t base_color, uint8_t overlay_color, uint8_t base_flags, uint8_t overlay_flags);
#endif
web64/sprite-runtime.inc
Registry-generated direct-sprite runtime prepare/call macros for native assembly.
Header listing:
; Web64 _web64_rt C/assembly call helpers for <web64/sprite-runtime.h>
; Generated from native runtime registry v8; do not hand-edit.
; Arguments are immediate assembly expressions. Pass C globals with their emitted labels.
; Prepare helpers write the complete exact-width window and clobber A only.
; Call helpers prepare the window, JSR the public entry, and inherit its clobber/return contract.
; Helpers allocate no storage. Including this file, or leaving a helper unused, links zero runtime bytes.
WEB64_RT_SPRITE_RUNTIME_CALL_COUNT = 7
WEB64_RT_SPRITE_RUNTIME_WINDOW_CALL_COUNT = 7
; web64_sprite_apply_overlay_palette: 2-byte window; entry _web64_sprite_apply_overlay_palette
.macro web64_rt_prepare_sprite_apply_overlay_palette asset
lda #<asset
sta _web64_sprite_apply_overlay_palette__arg_asset
lda #>asset
sta _web64_sprite_apply_overlay_palette__arg_asset+1
.endmacro
.macro web64_rt_call_sprite_apply_overlay_palette asset
web64_rt_prepare_sprite_apply_overlay_palette asset
jsr _web64_sprite_apply_overlay_palette
.endmacro
; web64_sprite_render: 9-byte window; entry _web64_sprite_render
.macro web64_rt_prepare_sprite_render renderer, slot, x, y, frame, color, flags
lda #<renderer
sta _web64_sprite_render__arg_renderer
lda #>renderer
sta _web64_sprite_render__arg_renderer+1
lda #slot
sta _web64_sprite_render__arg_slot
lda #<x
sta _web64_sprite_render__arg_x
lda #>x
sta _web64_sprite_render__arg_x+1
lda #y
sta _web64_sprite_render__arg_y
lda #frame
sta _web64_sprite_render__arg_frame
lda #color
sta _web64_sprite_render__arg_color
lda #flags
sta _web64_sprite_render__arg_flags
.endmacro
.macro web64_rt_call_sprite_render renderer, slot, x, y, frame, color, flags
web64_rt_prepare_sprite_render renderer, slot, x, y, frame, color, flags
jsr _web64_sprite_render
.endmacro
; web64_sprite_render_asset_pair: 12-byte window; entry _web64_sprite_render_asset_pair
.macro web64_rt_prepare_sprite_render_asset_pair renderer, binding, base_slot, overlay_slot, x, y, base_frame, overlay_frame, flags
lda #<renderer
sta _web64_sprite_render_asset_pair__arg_renderer
lda #>renderer
sta _web64_sprite_render_asset_pair__arg_renderer+1
lda #<binding
sta _web64_sprite_render_asset_pair__arg_binding
lda #>binding
sta _web64_sprite_render_asset_pair__arg_binding+1
lda #base_slot
sta _web64_sprite_render_asset_pair__arg_base_slot
lda #overlay_slot
sta _web64_sprite_render_asset_pair__arg_overlay_slot
lda #<x
sta _web64_sprite_render_asset_pair__arg_x
lda #>x
sta _web64_sprite_render_asset_pair__arg_x+1
lda #y
sta _web64_sprite_render_asset_pair__arg_y
lda #base_frame
sta _web64_sprite_render_asset_pair__arg_base_frame
lda #overlay_frame
sta _web64_sprite_render_asset_pair__arg_overlay_frame
lda #flags
sta _web64_sprite_render_asset_pair__arg_flags
.endmacro
.macro web64_rt_call_sprite_render_asset_pair renderer, binding, base_slot, overlay_slot, x, y, base_frame, overlay_frame, flags
web64_rt_prepare_sprite_render_asset_pair renderer, binding, base_slot, overlay_slot, x, y, base_frame, overlay_frame, flags
jsr _web64_sprite_render_asset_pair
.endmacro
; web64_sprite_render_attachment: 18-byte window; entry _web64_sprite_render_attachment
.macro web64_rt_prepare_sprite_render_attachment renderer, base_slot, overlay_slot, world_x, world_y, camera, offset_x, offset_y, base_frame, overlay_frame, base_color, overlay_color, base_flags, overlay_flags
lda #<renderer
sta _web64_sprite_render_attachment__arg_renderer
lda #>renderer
sta _web64_sprite_render_attachment__arg_renderer+1
lda #base_slot
sta _web64_sprite_render_attachment__arg_base_slot
lda #overlay_slot
sta _web64_sprite_render_attachment__arg_overlay_slot
lda #<world_x
sta _web64_sprite_render_attachment__arg_world_x
lda #>world_x
sta _web64_sprite_render_attachment__arg_world_x+1
lda #<world_y
sta _web64_sprite_render_attachment__arg_world_y
lda #>world_y
sta _web64_sprite_render_attachment__arg_world_y+1
lda #<camera
sta _web64_sprite_render_attachment__arg_camera
lda #>camera
sta _web64_sprite_render_attachment__arg_camera+1
lda #offset_x
sta _web64_sprite_render_attachment__arg_offset_x
lda #offset_y
sta _web64_sprite_render_attachment__arg_offset_y
lda #base_frame
sta _web64_sprite_render_attachment__arg_base_frame
lda #overlay_frame
sta _web64_sprite_render_attachment__arg_overlay_frame
lda #base_color
sta _web64_sprite_render_attachment__arg_base_color
lda #overlay_color
sta _web64_sprite_render_attachment__arg_overlay_color
lda #base_flags
sta _web64_sprite_render_attachment__arg_base_flags
lda #overlay_flags
sta _web64_sprite_render_attachment__arg_overlay_flags
.endmacro
.macro web64_rt_call_sprite_render_attachment renderer, base_slot, overlay_slot, world_x, world_y, camera, offset_x, offset_y, base_frame, overlay_frame, base_color, overlay_color, base_flags, overlay_flags
web64_rt_prepare_sprite_render_attachment renderer, base_slot, overlay_slot, world_x, world_y, camera, offset_x, offset_y, base_frame, overlay_frame, base_color, overlay_color, base_flags, overlay_flags
jsr _web64_sprite_render_attachment
.endmacro
; web64_sprite_render_camera: 12-byte window; entry _web64_sprite_render_camera
.macro web64_rt_prepare_sprite_render_camera renderer, slot, world_x, world_y, camera, frame, color, flags
lda #<renderer
sta _web64_sprite_render_camera__arg_renderer
lda #>renderer
sta _web64_sprite_render_camera__arg_renderer+1
lda #slot
sta _web64_sprite_render_camera__arg_slot
lda #<world_x
sta _web64_sprite_render_camera__arg_world_x
lda #>world_x
sta _web64_sprite_render_camera__arg_world_x+1
lda #<world_y
sta _web64_sprite_render_camera__arg_world_y
lda #>world_y
sta _web64_sprite_render_camera__arg_world_y+1
lda #<camera
sta _web64_sprite_render_camera__arg_camera
lda #>camera
sta _web64_sprite_render_camera__arg_camera+1
lda #frame
sta _web64_sprite_render_camera__arg_frame
lda #color
sta _web64_sprite_render_camera__arg_color
lda #flags
sta _web64_sprite_render_camera__arg_flags
.endmacro
.macro web64_rt_call_sprite_render_camera renderer, slot, world_x, world_y, camera, frame, color, flags
web64_rt_prepare_sprite_render_camera renderer, slot, world_x, world_y, camera, frame, color, flags
jsr _web64_sprite_render_camera
.endmacro
; web64_sprite_render_overlay: 12-byte window; entry _web64_sprite_render_overlay
.macro web64_rt_prepare_sprite_render_overlay renderer, base_slot, overlay_slot, x, y, base_frame, overlay_frame, base_color, overlay_color, flags
lda #<renderer
sta _web64_sprite_render_overlay__arg_renderer
lda #>renderer
sta _web64_sprite_render_overlay__arg_renderer+1
lda #base_slot
sta _web64_sprite_render_overlay__arg_base_slot
lda #overlay_slot
sta _web64_sprite_render_overlay__arg_overlay_slot
lda #<x
sta _web64_sprite_render_overlay__arg_x
lda #>x
sta _web64_sprite_render_overlay__arg_x+1
lda #y
sta _web64_sprite_render_overlay__arg_y
lda #base_frame
sta _web64_sprite_render_overlay__arg_base_frame
lda #overlay_frame
sta _web64_sprite_render_overlay__arg_overlay_frame
lda #base_color
sta _web64_sprite_render_overlay__arg_base_color
lda #overlay_color
sta _web64_sprite_render_overlay__arg_overlay_color
lda #flags
sta _web64_sprite_render_overlay__arg_flags
.endmacro
.macro web64_rt_call_sprite_render_overlay renderer, base_slot, overlay_slot, x, y, base_frame, overlay_frame, base_color, overlay_color, flags
web64_rt_prepare_sprite_render_overlay renderer, base_slot, overlay_slot, x, y, base_frame, overlay_frame, base_color, overlay_color, flags
jsr _web64_sprite_render_overlay
.endmacro
; web64_sprite_renderer_init: 4-byte window; entry _web64_sprite_renderer_init
.macro web64_rt_prepare_sprite_renderer_init renderer, pointer_base
lda #<renderer
sta _web64_sprite_renderer_init__arg_renderer
lda #>renderer
sta _web64_sprite_renderer_init__arg_renderer+1
lda #<pointer_base
sta _web64_sprite_renderer_init__arg_pointer_base
lda #>pointer_base
sta _web64_sprite_renderer_init__arg_pointer_base+1
.endmacro
.macro web64_rt_call_sprite_renderer_init renderer, pointer_base
web64_rt_prepare_sprite_renderer_init renderer, pointer_base
jsr _web64_sprite_renderer_init
.endmacro
web64/trajectory.h
Compact deterministic waypoint patterns, caller-owned Q12.4 execution state, exact scalar and synchronized-batch stepping, and transparent Motion/Actor projection.
Included headers: <stdint.h>, <web64/game.h>.
Structs:
| Name | Description | Field summary |
|---|---|---|
Web64TrajectorySegment | Public struct declared by <web64/trajectory.h>. | 6 fields: char delta_x, char delta_y, uint8_t duration, } Web64TrajectorySegment, ... |
Web64TrajectoryState | Public struct declared by <web64/trajectory.h>. | 13 fields: Web64TrajectoryPattern *pattern, web64_pos_t x, web64_pos_t y, int16_t step_x, ... |
Macros:
| Name | Value | Description |
|---|---|---|
WEB64_TRAJECTORY_ABI_VERSION | 1 | Macro constant exported by the header. |
WEB64_TRAJECTORY_MAX_SEGMENTS | 1024 | Macro constant exported by the header. |
WEB64_TRAJECTORY_BATCH_MAX_STATES | 255 | Macro constant exported by the header. |
WEB64_TRAJECTORY_CONTROL_INDEX_MASK | 1023 | Macro constant exported by the header. |
WEB64_TRAJECTORY_NEGATE_X | 1024 | Macro constant exported by the header. |
WEB64_TRAJECTORY_NEGATE_Y | 2048 | Macro constant exported by the header. |
WEB64_TRAJECTORY_LOOP | 4096 | Macro constant exported by the header. |
WEB64_TRAJECTORY_PING_PONG | 8192 | Macro constant exported by the header. |
WEB64_TRAJECTORY_REVERSE | 16384 | Macro constant exported by the header. |
WEB64_TRAJECTORY_COMPLETE | 32768 | Macro constant exported by the header. |
WEB64_TRAJECTORY_OPTIONS_MASK | 31744 | Macro constant exported by the header. |
WEB64_TRAJECTORY_CORRECTION_X_NEGATIVE | 1 | Macro constant exported by the header. |
WEB64_TRAJECTORY_CORRECTION_Y_NEGATIVE | 2 | Macro constant exported by the header. |
WEB64_TRAJECTORY_OK | 0 | Macro constant exported by the header. |
WEB64_TRAJECTORY_EVENT_SEGMENT | 1 | Macro constant exported by the header. |
WEB64_TRAJECTORY_EVENT_LOOP | 2 | Macro constant exported by the header. |
WEB64_TRAJECTORY_EVENT_DIRECTION | 4 | Macro constant exported by the header. |
WEB64_TRAJECTORY_EVENT_COMPLETE | 8 | Macro constant exported by the header. |
WEB64_TRAJECTORY_INVALID_ARGUMENT | 16 | Macro constant exported by the header. |
WEB64_TRAJECTORY_INVALID_PATTERN | 32 | Macro constant exported by the header. |
WEB64_TRAJECTORY_INVALID_DURATION | 64 | Macro constant exported by the header. |
WEB64_TRAJECTORY_INVALID_STATE | 128 | Macro constant exported by the header. |
WEB64_TRAJECTORY_SEGMENT_DELTA_X | 0 | Macro constant exported by the header. |
WEB64_TRAJECTORY_SEGMENT_DELTA_Y | 1 | Macro constant exported by the header. |
WEB64_TRAJECTORY_SEGMENT_DURATION | 2 | Macro constant exported by the header. |
WEB64_TRAJECTORY_SEGMENT_SIZE | 3 | Macro constant exported by the header. |
WEB64_TRAJECTORY_PATTERN_SEGMENTS | 0 | Macro constant exported by the header. |
WEB64_TRAJECTORY_PATTERN_COUNT | 2 | Macro constant exported by the header. |
WEB64_TRAJECTORY_PATTERN_SIZE | 4 | Macro constant exported by the header. |
WEB64_TRAJECTORY_STATE_PATTERN | 0 | Macro constant exported by the header. |
WEB64_TRAJECTORY_STATE_X | 2 | Macro constant exported by the header. |
WEB64_TRAJECTORY_STATE_Y | 4 | Macro constant exported by the header. |
WEB64_TRAJECTORY_STATE_STEP_X | 6 | Macro constant exported by the header. |
WEB64_TRAJECTORY_STATE_STEP_Y | 8 | Macro constant exported by the header. |
WEB64_TRAJECTORY_STATE_CONTROL | 10 | Macro constant exported by the header. |
WEB64_TRAJECTORY_STATE_DURATION | 12 | Macro constant exported by the header. |
WEB64_TRAJECTORY_STATE_FRAMES_REMAINING | 13 | Macro constant exported by the header. |
WEB64_TRAJECTORY_STATE_REMAINDER_X | 14 | Macro constant exported by the header. |
WEB64_TRAJECTORY_STATE_REMAINDER_Y | 15 | Macro constant exported by the header. |
WEB64_TRAJECTORY_STATE_ERROR_X | 16 | Macro constant exported by the header. |
WEB64_TRAJECTORY_STATE_ERROR_Y | 17 | Macro constant exported by the header. |
WEB64_TRAJECTORY_STATE_CORRECTION | 18 | Macro constant exported by the header. |
WEB64_TRAJECTORY_STATE_SIZE | 19 | Macro constant exported by the header. |
Header listing:
#ifndef WEB64_TRAJECTORY_H
#define WEB64_TRAJECTORY_H
#include <stdint.h>
#include <web64/game.h>
#define WEB64_TRAJECTORY_ABI_VERSION 1
#define WEB64_TRAJECTORY_MAX_SEGMENTS 1024
#define WEB64_TRAJECTORY_BATCH_MAX_STATES 255
#define WEB64_TRAJECTORY_CONTROL_INDEX_MASK 1023
#define WEB64_TRAJECTORY_NEGATE_X 1024
#define WEB64_TRAJECTORY_NEGATE_Y 2048
#define WEB64_TRAJECTORY_LOOP 4096
#define WEB64_TRAJECTORY_PING_PONG 8192
#define WEB64_TRAJECTORY_REVERSE 16384
#define WEB64_TRAJECTORY_COMPLETE 32768
#define WEB64_TRAJECTORY_OPTIONS_MASK 31744
#define WEB64_TRAJECTORY_CORRECTION_X_NEGATIVE 1
#define WEB64_TRAJECTORY_CORRECTION_Y_NEGATIVE 2
#define WEB64_TRAJECTORY_OK 0
#define WEB64_TRAJECTORY_EVENT_SEGMENT 1
#define WEB64_TRAJECTORY_EVENT_LOOP 2
#define WEB64_TRAJECTORY_EVENT_DIRECTION 4
#define WEB64_TRAJECTORY_EVENT_COMPLETE 8
#define WEB64_TRAJECTORY_INVALID_ARGUMENT 16
#define WEB64_TRAJECTORY_INVALID_PATTERN 32
#define WEB64_TRAJECTORY_INVALID_DURATION 64
#define WEB64_TRAJECTORY_INVALID_STATE 128
#define WEB64_TRAJECTORY_SEGMENT_DELTA_X 0
#define WEB64_TRAJECTORY_SEGMENT_DELTA_Y 1
#define WEB64_TRAJECTORY_SEGMENT_DURATION 2
#define WEB64_TRAJECTORY_SEGMENT_SIZE 3
#define WEB64_TRAJECTORY_PATTERN_SEGMENTS 0
#define WEB64_TRAJECTORY_PATTERN_COUNT 2
#define WEB64_TRAJECTORY_PATTERN_SIZE 4
#define WEB64_TRAJECTORY_STATE_PATTERN 0
#define WEB64_TRAJECTORY_STATE_X 2
#define WEB64_TRAJECTORY_STATE_Y 4
#define WEB64_TRAJECTORY_STATE_STEP_X 6
#define WEB64_TRAJECTORY_STATE_STEP_Y 8
#define WEB64_TRAJECTORY_STATE_CONTROL 10
#define WEB64_TRAJECTORY_STATE_DURATION 12
#define WEB64_TRAJECTORY_STATE_FRAMES_REMAINING 13
#define WEB64_TRAJECTORY_STATE_REMAINDER_X 14
#define WEB64_TRAJECTORY_STATE_REMAINDER_Y 15
#define WEB64_TRAJECTORY_STATE_ERROR_X 16
#define WEB64_TRAJECTORY_STATE_ERROR_Y 17
#define WEB64_TRAJECTORY_STATE_CORRECTION 18
#define WEB64_TRAJECTORY_STATE_SIZE 19
typedef struct { char delta_x; char delta_y; uint8_t duration; } Web64TrajectorySegment;
typedef struct { Web64TrajectorySegment *segments; uint16_t count; } Web64TrajectoryPattern;
typedef struct { Web64TrajectoryPattern *pattern; web64_pos_t x; web64_pos_t y; int16_t step_x; int16_t step_y; uint16_t control; uint8_t duration; uint8_t frames_remaining; uint8_t remainder_x; uint8_t remainder_y; uint8_t error_x; uint8_t error_y; uint8_t correction; } Web64TrajectoryState;
/* Patterns and state are caller-owned and remain directly readable/writable from C or assembly. */
/* These transparent adapters copy only the public Q12.4 result; they link no runtime and trigger no downstream phase. */
#define WEB64_TRAJECTORY_APPLY_BODY(state, body) (body).x = (state).x; (body).y = (state).y
#define WEB64_TRAJECTORY_APPLY_POSITION(state, x_positions, y_positions, index) (x_positions)[(index)] = (state).x; (y_positions)[(index)] = (state).y
/* Checked calls validate before mutation. Fast calls require a previously validated immutable pattern and valid state. */
_web64_rt uint8_t web64_trajectory_validate(const Web64TrajectoryPattern *pattern);
_web64_rt uint8_t web64_trajectory_init(Web64TrajectoryState *state, const Web64TrajectoryPattern *pattern, uint16_t x, uint16_t y, uint16_t options);
_web64_rt uint8_t web64_trajectory_init_fast(Web64TrajectoryState *state, const Web64TrajectoryPattern *pattern, uint16_t x, uint16_t y, uint16_t options);
_web64_rt uint8_t web64_trajectory_step(Web64TrajectoryState *state);
_web64_rt uint8_t web64_trajectory_step_fast(Web64TrajectoryState *state);
/* Batch calls preserve input order and write one event byte per state. Checked batch preflights non-null, non-wrapping, non-overlapping state/event spans before mutation. The fast entry requires those valid spans plus contiguous lockstep states sharing one pattern/index/phase and traversal mode; X/Y negation may differ. */
_web64_rt uint8_t web64_trajectory_step_batch(Web64TrajectoryState *states, uint8_t count, uint8_t *events);
_web64_rt uint8_t web64_trajectory_step_batch_fast(Web64TrajectoryState *states, uint8_t count, uint8_t *events);
#endif
web64/trajectory.inc
Assembly ABI constants, exact packed offsets, standard runtime prepare/call macros, compatible trajectory aliases, descriptor/storage emitters, and position-copy helpers.
Header listing:
; Web64 trajectory public ABI v1
; Caller-owned data; Q12.4 positions; signed pixel deltas; duration is frames.
; Mainline-only, non-reentrant runtime. A/X/Y/flags and $fb-$fe are caller-save.
; Linked _web64_rt entries publish exact-width named argument windows beside their entries.
; This family include is self-contained; runtime.inc remains an optional whole-registry catalog.
; The macros below expand to ordinary instructions/data and add no hidden runtime or storage.
WEB64_TRAJECTORY_ABI_VERSION = 1
WEB64_TRAJECTORY_MAX_SEGMENTS = 1024
WEB64_TRAJECTORY_BATCH_MAX_STATES = 255
WEB64_TRAJECTORY_CONTROL_INDEX_MASK = 1023
WEB64_TRAJECTORY_NEGATE_X = 1024
WEB64_TRAJECTORY_NEGATE_Y = 2048
WEB64_TRAJECTORY_LOOP = 4096
WEB64_TRAJECTORY_PING_PONG = 8192
WEB64_TRAJECTORY_REVERSE = 16384
WEB64_TRAJECTORY_COMPLETE = 32768
WEB64_TRAJECTORY_OPTIONS_MASK = 31744
WEB64_TRAJECTORY_CORRECTION_X_NEGATIVE = 1
WEB64_TRAJECTORY_CORRECTION_Y_NEGATIVE = 2
WEB64_TRAJECTORY_OK = 0
WEB64_TRAJECTORY_EVENT_SEGMENT = 1
WEB64_TRAJECTORY_EVENT_LOOP = 2
WEB64_TRAJECTORY_EVENT_DIRECTION = 4
WEB64_TRAJECTORY_EVENT_COMPLETE = 8
WEB64_TRAJECTORY_INVALID_ARGUMENT = 16
WEB64_TRAJECTORY_INVALID_PATTERN = 32
WEB64_TRAJECTORY_INVALID_DURATION = 64
WEB64_TRAJECTORY_INVALID_STATE = 128
WEB64_TRAJECTORY_SEGMENT_DELTA_X = 0
WEB64_TRAJECTORY_SEGMENT_DELTA_Y = 1
WEB64_TRAJECTORY_SEGMENT_DURATION = 2
WEB64_TRAJECTORY_SEGMENT_SIZE = 3
WEB64_TRAJECTORY_PATTERN_SEGMENTS = 0
WEB64_TRAJECTORY_PATTERN_COUNT = 2
WEB64_TRAJECTORY_PATTERN_SIZE = 4
WEB64_TRAJECTORY_STATE_PATTERN = 0
WEB64_TRAJECTORY_STATE_X = 2
WEB64_TRAJECTORY_STATE_Y = 4
WEB64_TRAJECTORY_STATE_STEP_X = 6
WEB64_TRAJECTORY_STATE_STEP_Y = 8
WEB64_TRAJECTORY_STATE_CONTROL = 10
WEB64_TRAJECTORY_STATE_DURATION = 12
WEB64_TRAJECTORY_STATE_FRAMES_REMAINING = 13
WEB64_TRAJECTORY_STATE_REMAINDER_X = 14
WEB64_TRAJECTORY_STATE_REMAINDER_Y = 15
WEB64_TRAJECTORY_STATE_ERROR_X = 16
WEB64_TRAJECTORY_STATE_ERROR_Y = 17
WEB64_TRAJECTORY_STATE_CORRECTION = 18
WEB64_TRAJECTORY_STATE_SIZE = 19
; Immediate argument helpers. No second include is required for the prepare/call macros.
; These setup helpers clobber A only. Runtime call macros retain the entry clobber contract above.
.macro web64_trajectory_arg_u8 destination, value
lda #value
sta destination
.endmacro
.macro web64_trajectory_arg_u16 destination, value
lda #<value
sta destination
lda #>value
sta destination+1
.endmacro
; Setup-only forms are intended for hot loops that reuse a prepared argument window.
.macro web64_trajectory_prepare_validate pattern
web64_trajectory_arg_u16 _web64_trajectory_validate__arg_pattern, pattern
.endmacro
.macro web64_trajectory_prepare_init state, pattern, x, y, options
web64_trajectory_arg_u16 _web64_trajectory_init__arg_state, state
web64_trajectory_arg_u16 _web64_trajectory_init__arg_pattern, pattern
web64_trajectory_arg_u16 _web64_trajectory_init__arg_x, x
web64_trajectory_arg_u16 _web64_trajectory_init__arg_y, y
web64_trajectory_arg_u16 _web64_trajectory_init__arg_options, options
.endmacro
.macro web64_trajectory_prepare_init_fast state, pattern, x, y, options
web64_trajectory_arg_u16 _web64_trajectory_init_fast__arg_state, state
web64_trajectory_arg_u16 _web64_trajectory_init_fast__arg_pattern, pattern
web64_trajectory_arg_u16 _web64_trajectory_init_fast__arg_x, x
web64_trajectory_arg_u16 _web64_trajectory_init_fast__arg_y, y
web64_trajectory_arg_u16 _web64_trajectory_init_fast__arg_options, options
.endmacro
.macro web64_trajectory_prepare_step state
web64_trajectory_arg_u16 _web64_trajectory_step__arg_state, state
.endmacro
.macro web64_trajectory_prepare_step_fast state
web64_trajectory_arg_u16 _web64_trajectory_step_fast__arg_state, state
.endmacro
.macro web64_trajectory_prepare_step_batch states, count, events
web64_trajectory_arg_u16 _web64_trajectory_step_batch__arg_states, states
web64_trajectory_arg_u8 _web64_trajectory_step_batch__arg_count, count
web64_trajectory_arg_u16 _web64_trajectory_step_batch__arg_events, events
.endmacro
.macro web64_trajectory_prepare_step_batch_fast states, count, events
web64_trajectory_arg_u16 _web64_trajectory_step_batch_fast__arg_states, states
web64_trajectory_arg_u8 _web64_trajectory_step_batch_fast__arg_count, count
web64_trajectory_arg_u16 _web64_trajectory_step_batch_fast__arg_events, events
.endmacro
; Complete convenience calls set every argument and then invoke the public entry.
.macro web64_trajectory_call_validate pattern
web64_trajectory_prepare_validate pattern
jsr _web64_trajectory_validate
.endmacro
.macro web64_trajectory_call_init state, pattern, x, y, options
web64_trajectory_prepare_init state, pattern, x, y, options
jsr _web64_trajectory_init
.endmacro
.macro web64_trajectory_call_init_fast state, pattern, x, y, options
web64_trajectory_prepare_init_fast state, pattern, x, y, options
jsr _web64_trajectory_init_fast
.endmacro
.macro web64_trajectory_call_step state
web64_trajectory_prepare_step state
jsr _web64_trajectory_step
.endmacro
.macro web64_trajectory_call_step_fast state
web64_trajectory_prepare_step_fast state
jsr _web64_trajectory_step_fast
.endmacro
.macro web64_trajectory_call_step_batch states, count, events
web64_trajectory_prepare_step_batch states, count, events
jsr _web64_trajectory_step_batch
.endmacro
.macro web64_trajectory_call_step_batch_fast states, count, events
web64_trajectory_prepare_step_batch_fast states, count, events
jsr _web64_trajectory_step_batch_fast
.endmacro
; Public descriptor/storage helpers. They emit exactly the packed ABI bytes shown above.
.macro web64_trajectory_emit_segment delta_x, delta_y, duration
.byte delta_x, delta_y, duration
.endmacro
.macro web64_trajectory_emit_pattern segments, count
.word segments
.word count
.endmacro
.macro web64_trajectory_reserve_states count
.fill count * WEB64_TRAJECTORY_STATE_SIZE, 0
.endmacro
.macro web64_trajectory_reserve_events count
.fill count, 0
.endmacro
; Copy one public Q12.4 state position into two caller-owned 16-bit destinations.
.macro web64_trajectory_copy_position state, x_destination, y_destination
lda state+WEB64_TRAJECTORY_STATE_X
sta x_destination
lda state+WEB64_TRAJECTORY_STATE_X+1
sta x_destination+1
lda state+WEB64_TRAJECTORY_STATE_Y
sta y_destination
lda state+WEB64_TRAJECTORY_STATE_Y+1
sta y_destination+1
.endmacro
; Web64 _web64_rt C/assembly call helpers for <web64/trajectory.h>
; Generated from native runtime registry v8; do not hand-edit.
; Arguments are immediate assembly expressions. Pass C globals with their emitted labels.
; Prepare helpers write the complete exact-width window and clobber A only.
; Call helpers prepare the window, JSR the public entry, and inherit its clobber/return contract.
; Helpers allocate no storage. Including this file, or leaving a helper unused, links zero runtime bytes.
WEB64_RT_TRAJECTORY_CALL_COUNT = 7
WEB64_RT_TRAJECTORY_WINDOW_CALL_COUNT = 7
; web64_trajectory_init: 10-byte window; entry _web64_trajectory_init
.macro web64_rt_prepare_trajectory_init state, pattern, x, y, options
lda #<state
sta _web64_trajectory_init__arg_state
lda #>state
sta _web64_trajectory_init__arg_state+1
lda #<pattern
sta _web64_trajectory_init__arg_pattern
lda #>pattern
sta _web64_trajectory_init__arg_pattern+1
lda #<x
sta _web64_trajectory_init__arg_x
lda #>x
sta _web64_trajectory_init__arg_x+1
lda #<y
sta _web64_trajectory_init__arg_y
lda #>y
sta _web64_trajectory_init__arg_y+1
lda #<options
sta _web64_trajectory_init__arg_options
lda #>options
sta _web64_trajectory_init__arg_options+1
.endmacro
.macro web64_rt_call_trajectory_init state, pattern, x, y, options
web64_rt_prepare_trajectory_init state, pattern, x, y, options
jsr _web64_trajectory_init
.endmacro
; web64_trajectory_init_fast: 10-byte window; entry _web64_trajectory_init_fast
.macro web64_rt_prepare_trajectory_init_fast state, pattern, x, y, options
lda #<state
sta _web64_trajectory_init_fast__arg_state
lda #>state
sta _web64_trajectory_init_fast__arg_state+1
lda #<pattern
sta _web64_trajectory_init_fast__arg_pattern
lda #>pattern
sta _web64_trajectory_init_fast__arg_pattern+1
lda #<x
sta _web64_trajectory_init_fast__arg_x
lda #>x
sta _web64_trajectory_init_fast__arg_x+1
lda #<y
sta _web64_trajectory_init_fast__arg_y
lda #>y
sta _web64_trajectory_init_fast__arg_y+1
lda #<options
sta _web64_trajectory_init_fast__arg_options
lda #>options
sta _web64_trajectory_init_fast__arg_options+1
.endmacro
.macro web64_rt_call_trajectory_init_fast state, pattern, x, y, options
web64_rt_prepare_trajectory_init_fast state, pattern, x, y, options
jsr _web64_trajectory_init_fast
.endmacro
; web64_trajectory_step: 2-byte window; entry _web64_trajectory_step
.macro web64_rt_prepare_trajectory_step state
lda #<state
sta _web64_trajectory_step__arg_state
lda #>state
sta _web64_trajectory_step__arg_state+1
.endmacro
.macro web64_rt_call_trajectory_step state
web64_rt_prepare_trajectory_step state
jsr _web64_trajectory_step
.endmacro
; web64_trajectory_step_batch: 5-byte window; entry _web64_trajectory_step_batch
.macro web64_rt_prepare_trajectory_step_batch states, count, events
lda #<states
sta _web64_trajectory_step_batch__arg_states
lda #>states
sta _web64_trajectory_step_batch__arg_states+1
lda #count
sta _web64_trajectory_step_batch__arg_count
lda #<events
sta _web64_trajectory_step_batch__arg_events
lda #>events
sta _web64_trajectory_step_batch__arg_events+1
.endmacro
.macro web64_rt_call_trajectory_step_batch states, count, events
web64_rt_prepare_trajectory_step_batch states, count, events
jsr _web64_trajectory_step_batch
.endmacro
; web64_trajectory_step_batch_fast: 5-byte window; entry _web64_trajectory_step_batch_fast
.macro web64_rt_prepare_trajectory_step_batch_fast states, count, events
lda #<states
sta _web64_trajectory_step_batch_fast__arg_states
lda #>states
sta _web64_trajectory_step_batch_fast__arg_states+1
lda #count
sta _web64_trajectory_step_batch_fast__arg_count
lda #<events
sta _web64_trajectory_step_batch_fast__arg_events
lda #>events
sta _web64_trajectory_step_batch_fast__arg_events+1
.endmacro
.macro web64_rt_call_trajectory_step_batch_fast states, count, events
web64_rt_prepare_trajectory_step_batch_fast states, count, events
jsr _web64_trajectory_step_batch_fast
.endmacro
; web64_trajectory_step_fast: 2-byte window; entry _web64_trajectory_step_fast
.macro web64_rt_prepare_trajectory_step_fast state
lda #<state
sta _web64_trajectory_step_fast__arg_state
lda #>state
sta _web64_trajectory_step_fast__arg_state+1
.endmacro
.macro web64_rt_call_trajectory_step_fast state
web64_rt_prepare_trajectory_step_fast state
jsr _web64_trajectory_step_fast
.endmacro
; web64_trajectory_validate: 2-byte window; entry _web64_trajectory_validate
.macro web64_rt_prepare_trajectory_validate pattern
lda #<pattern
sta _web64_trajectory_validate__arg_pattern
lda #>pattern
sta _web64_trajectory_validate__arg_pattern+1
.endmacro
.macro web64_rt_call_trajectory_validate pattern
web64_rt_prepare_trajectory_validate pattern
jsr _web64_trajectory_validate
.endmacro
web64/world.h
Independent Game Runtime World-module camera, viewport, native asset streaming, static rendering, fine-scroll, and visible mutation declarations.
Included headers: <stdint.h>, <web64/game.h>.
Structs:
| Name | Description | Field summary |
|---|---|---|
Web64WorldCamera | Public struct declared by <web64/world.h>. | 20 fields: uint16_t x, uint16_t y, uint8_t fine_x, uint8_t fine_y, ... |
Web64WorldRect | Public struct declared by <web64/world.h>. | uint8_t column, uint8_t row, uint8_t width, uint8_t height |
Macros:
| Name | Value | Description |
|---|---|---|
WEB64_WORLD_MODE_MULTICOLOR | 1 | Macro constant exported by the header. |
WEB64_WORLD_CAMERA_WRAP | 1 | Macro constant exported by the header. |
WEB64_WORLD_CAMERA_CLAMP | 2 | Macro constant exported by the header. |
WEB64_WORLD_COLOR_REGION | 0 | Macro constant exported by the header. |
WEB64_WORLD_COLOR_PER_CELL | 1 | Macro constant exported by the header. |
WEB64_WORLD_COLOR_NONE | 2 | Macro constant exported by the header. |
WEB64_WORLD_BOUNDARY_LEFT | 1 | Macro constant exported by the header. |
WEB64_WORLD_BOUNDARY_RIGHT | 2 | Macro constant exported by the header. |
WEB64_WORLD_BOUNDARY_UP | 4 | Macro constant exported by the header. |
WEB64_WORLD_BOUNDARY_DOWN | 8 | Macro constant exported by the header. |
WEB64_WORLD_SCREEN_COLUMNS | 40 | Macro constant exported by the header. |
WEB64_WORLD_SCREEN_ROWS | 25 | Macro constant exported by the header. |
Header listing:
#ifndef WEB64_WORLD_H
#define WEB64_WORLD_H
#include <stdint.h>
#include <web64/game.h>
#define WEB64_WORLD_MODE_MULTICOLOR 1
#define WEB64_WORLD_CAMERA_WRAP 1
#define WEB64_WORLD_CAMERA_CLAMP 2
#define WEB64_WORLD_COLOR_REGION 0
#define WEB64_WORLD_COLOR_PER_CELL 1
#define WEB64_WORLD_COLOR_NONE 2
#define WEB64_WORLD_BOUNDARY_LEFT 1
#define WEB64_WORLD_BOUNDARY_RIGHT 2
#define WEB64_WORLD_BOUNDARY_UP 4
#define WEB64_WORLD_BOUNDARY_DOWN 8
#define WEB64_WORLD_SCREEN_COLUMNS 40
#define WEB64_WORLD_SCREEN_ROWS 25
typedef struct { uint16_t x; uint16_t y; uint8_t fine_x; uint8_t fine_y; uint8_t flags; } Web64WorldCamera;
typedef struct { uint16_t cells; uint16_t colors; uint16_t materials; uint16_t blocks; uint16_t screen; uint16_t color_ram; uint16_t row_stride; uint8_t width; uint8_t height; uint8_t cell_width; uint8_t cell_height; uint8_t color_mode; uint8_t region_color; uint8_t flags; } Web64WorldView;
typedef struct { uint8_t column; uint8_t row; uint8_t width; uint8_t height; } Web64WorldRect;
_web64_rt void web64_world_apply_video_mode(uint8_t flags, uint8_t memory_setup);
/* Compatibility wrapper retained from Web64 1.7; prefer web64_asset_copy(). */
_web64_rt void web64_world_copy_asset(uint8_t *destination, const uint8_t *source, uint16_t length);
_web64_rt uint8_t web64_world_draw_char_view(uint8_t *cells, uint8_t *colors, uint8_t *screen, uint8_t *color_ram, uint8_t width, uint8_t height, uint8_t row_stride, uint8_t color_mode, uint8_t region_color);
_web64_rt uint8_t web64_world_draw_block2_view(uint8_t *map, uint8_t *blocks, uint8_t *block_colors, uint8_t *screen, uint8_t *color_ram, uint8_t width, uint8_t height, uint8_t row_stride, uint8_t color_mode, uint8_t region_color);
_web64_rt uint8_t web64_world_draw_char_view_screen(uint8_t *cells, uint8_t *screen, uint8_t width, uint8_t height, uint8_t row_stride);
_web64_rt uint8_t web64_world_draw_block2_view_screen(uint8_t *map, uint8_t *blocks, uint8_t *screen, uint8_t width, uint8_t height, uint8_t row_stride);
_web64_rt uint8_t web64_world_stream_column(uint8_t *cells, uint8_t *colors, uint8_t *screen, uint8_t *color_ram, uint8_t source_column, uint8_t dest_column, uint8_t height, uint8_t row_stride, uint8_t screen_stride, uint8_t color_mode, uint8_t region_color);
_web64_rt uint8_t web64_world_stream_row(uint8_t *cells, uint8_t *colors, uint8_t *screen, uint8_t *color_ram, uint8_t source_row, uint8_t dest_row, uint8_t width, uint8_t row_stride, uint8_t screen_stride, uint8_t color_mode, uint8_t region_color);
_web64_rt uint8_t web64_world_stream_column_screen(uint8_t *cells, uint8_t *screen, uint8_t source_column, uint8_t dest_column, uint8_t height, uint8_t row_stride, uint8_t screen_stride);
_web64_rt uint8_t web64_world_stream_row_screen(uint8_t *cells, uint8_t *screen, uint8_t source_row, uint8_t dest_row, uint8_t width, uint8_t row_stride, uint8_t screen_stride);
/* Camera math only: the application owns rendering and frame synchronization. */
/* Boundary bits report direction, not a crossing count; split render steps so each call crosses at most one cell. */
_web64_rt uint8_t web64_world_scroll_x(Web64WorldCamera *camera, int8_t delta_pixels, uint16_t max_cell_x, uint8_t flags);
_web64_rt uint8_t web64_world_scroll_y(Web64WorldCamera *camera, int8_t delta_pixels, uint16_t max_cell_y, uint8_t flags);
/* Synchronize directly from Motion Q12.4 position; clamp or wrap the Motion position before calling. */
_web64_rt uint8_t web64_world_camera_sync_x(Web64WorldCamera *camera, uint16_t subpixel_position);
_web64_rt uint8_t web64_world_camera_sync_y(Web64WorldCamera *camera, uint16_t subpixel_position);
/* Offscreen-page primitives only. Never pass the screen currently selected by VIC-II. */
_web64_rt void web64_world_shift_left(uint8_t *screen, uint8_t *color_ram, uint8_t height, uint8_t color_mode);
_web64_rt void web64_world_shift_right(uint8_t *screen, uint8_t *color_ram, uint8_t height, uint8_t color_mode);
_web64_rt void web64_world_shift_up(uint8_t *screen, uint8_t *color_ram, uint8_t height, uint8_t color_mode);
_web64_rt void web64_world_shift_down(uint8_t *screen, uint8_t *color_ram, uint8_t height, uint8_t color_mode);
_web64_rt uint8_t web64_world_mutate_cell(uint8_t *cells, uint8_t *colors, uint8_t *materials, uint8_t *screen, uint8_t *color_ram, Web64WorldCamera *camera, uint8_t column, uint8_t row, uint8_t value, uint8_t color, uint8_t material, uint8_t row_stride, uint8_t screen_stride, uint8_t color_mode);
#define web64_world_shift_left_screen(screen, height) web64_world_shift_left((screen), 0, (height), WEB64_WORLD_COLOR_NONE)
#define web64_world_shift_right_screen(screen, height) web64_world_shift_right((screen), 0, (height), WEB64_WORLD_COLOR_NONE)
#define web64_world_shift_up_screen(screen, height) web64_world_shift_up((screen), 0, (height), WEB64_WORLD_COLOR_NONE)
#define web64_world_shift_down_screen(screen, height) web64_world_shift_down((screen), 0, (height), WEB64_WORLD_COLOR_NONE)
#define web64_world_mutate_cell_screen(cells, screen, camera, column, row, value, row_stride, screen_stride) web64_world_mutate_cell((cells), 0, 0, (screen), 0, (camera), (column), (row), (value), 0, 0, (row_stride), (screen_stride), WEB64_WORLD_COLOR_NONE)
#define WEB64_WORLD_PIXEL_TO_CELL(pixel) ((uint16_t)(pixel) >> 3)
#define WEB64_WORLD_PIXEL_FINE(pixel) ((uint8_t)(pixel) & 7)
#define WEB64_WORLD_SUBPIXEL_TO_PIXEL(position) ((uint16_t)(position) >> WEB64_SUBPIXEL_BITS)
#define WEB64_WORLD_SUBPIXEL_TO_CELL(position) (WEB64_WORLD_SUBPIXEL_TO_PIXEL(position) >> 3)
#define WEB64_WORLD_SUBPIXEL_FINE(position) (WEB64_WORLD_SUBPIXEL_TO_PIXEL(position) & 7)
#define web64_world_camera_vic_fine_x(camera) (7 - ((camera)->fine_x & 7))
#define web64_world_camera_vic_fine_y(camera) (7 - ((camera)->fine_y & 7))
#define web64_world_camera_pixel_x(camera) (((camera)->x << 3) + (camera)->fine_x)
#define web64_world_camera_pixel_y(camera) (((camera)->y << 3) + (camera)->fine_y)
#endif
web64/world.inc
Registry-generated World runtime prepare/call macros for native assembly.
Header listing:
; Web64 _web64_rt C/assembly call helpers for <web64/world.h>
; Generated from native runtime registry v8; do not hand-edit.
; Arguments are immediate assembly expressions. Pass C globals with their emitted labels.
; Prepare helpers write the complete exact-width window and clobber A only.
; Call helpers prepare the window, JSR the public entry, and inherit its clobber/return contract.
; Helpers allocate no storage. Including this file, or leaving a helper unused, links zero runtime bytes.
WEB64_RT_WORLD_CALL_COUNT = 19
WEB64_RT_WORLD_WINDOW_CALL_COUNT = 19
; web64_world_apply_video_mode: 2-byte window; entry _web64_world_apply_video_mode
.macro web64_rt_prepare_world_apply_video_mode flags, memory_setup
lda #flags
sta _web64_world_apply_video_mode__arg_flags
lda #memory_setup
sta _web64_world_apply_video_mode__arg_memory_setup
.endmacro
.macro web64_rt_call_world_apply_video_mode flags, memory_setup
web64_rt_prepare_world_apply_video_mode flags, memory_setup
jsr _web64_world_apply_video_mode
.endmacro
; web64_world_camera_sync_x: 4-byte window; entry _web64_world_camera_sync_x
.macro web64_rt_prepare_world_camera_sync_x camera, subpixel_position
lda #<camera
sta _web64_world_camera_sync_x__arg_camera
lda #>camera
sta _web64_world_camera_sync_x__arg_camera+1
lda #<subpixel_position
sta _web64_world_camera_sync_x__arg_subpixel_position
lda #>subpixel_position
sta _web64_world_camera_sync_x__arg_subpixel_position+1
.endmacro
.macro web64_rt_call_world_camera_sync_x camera, subpixel_position
web64_rt_prepare_world_camera_sync_x camera, subpixel_position
jsr _web64_world_camera_sync_x
.endmacro
; web64_world_camera_sync_y: 4-byte window; entry _web64_world_camera_sync_y
.macro web64_rt_prepare_world_camera_sync_y camera, subpixel_position
lda #<camera
sta _web64_world_camera_sync_y__arg_camera
lda #>camera
sta _web64_world_camera_sync_y__arg_camera+1
lda #<subpixel_position
sta _web64_world_camera_sync_y__arg_subpixel_position
lda #>subpixel_position
sta _web64_world_camera_sync_y__arg_subpixel_position+1
.endmacro
.macro web64_rt_call_world_camera_sync_y camera, subpixel_position
web64_rt_prepare_world_camera_sync_y camera, subpixel_position
jsr _web64_world_camera_sync_y
.endmacro
; web64_world_copy_asset: 6-byte window; entry _web64_world_copy_asset
.macro web64_rt_prepare_world_copy_asset destination, source, length
lda #<destination
sta _web64_world_copy_asset__arg_destination
lda #>destination
sta _web64_world_copy_asset__arg_destination+1
lda #<source
sta _web64_world_copy_asset__arg_source
lda #>source
sta _web64_world_copy_asset__arg_source+1
lda #<length
sta _web64_world_copy_asset__arg_length
lda #>length
sta _web64_world_copy_asset__arg_length+1
.endmacro
.macro web64_rt_call_world_copy_asset destination, source, length
web64_rt_prepare_world_copy_asset destination, source, length
jsr _web64_world_copy_asset
.endmacro
; web64_world_draw_block2_view: 15-byte window; entry _web64_world_draw_block2_view
.macro web64_rt_prepare_world_draw_block2_view map, blocks, block_colors, screen, color_ram, width, height, row_stride, color_mode, region_color
lda #<map
sta _web64_world_draw_block2_view__arg_map
lda #>map
sta _web64_world_draw_block2_view__arg_map+1
lda #<blocks
sta _web64_world_draw_block2_view__arg_blocks
lda #>blocks
sta _web64_world_draw_block2_view__arg_blocks+1
lda #<block_colors
sta _web64_world_draw_block2_view__arg_block_colors
lda #>block_colors
sta _web64_world_draw_block2_view__arg_block_colors+1
lda #<screen
sta _web64_world_draw_block2_view__arg_screen
lda #>screen
sta _web64_world_draw_block2_view__arg_screen+1
lda #<color_ram
sta _web64_world_draw_block2_view__arg_color_ram
lda #>color_ram
sta _web64_world_draw_block2_view__arg_color_ram+1
lda #width
sta _web64_world_draw_block2_view__arg_width
lda #height
sta _web64_world_draw_block2_view__arg_height
lda #row_stride
sta _web64_world_draw_block2_view__arg_row_stride
lda #color_mode
sta _web64_world_draw_block2_view__arg_color_mode
lda #region_color
sta _web64_world_draw_block2_view__arg_region_color
.endmacro
.macro web64_rt_call_world_draw_block2_view map, blocks, block_colors, screen, color_ram, width, height, row_stride, color_mode, region_color
web64_rt_prepare_world_draw_block2_view map, blocks, block_colors, screen, color_ram, width, height, row_stride, color_mode, region_color
jsr _web64_world_draw_block2_view
.endmacro
; web64_world_draw_block2_view_screen: 9-byte window; entry _web64_world_draw_block2_view_screen
.macro web64_rt_prepare_world_draw_block2_view_screen map, blocks, screen, width, height, row_stride
lda #<map
sta _web64_world_draw_block2_view_screen__arg_map
lda #>map
sta _web64_world_draw_block2_view_screen__arg_map+1
lda #<blocks
sta _web64_world_draw_block2_view_screen__arg_blocks
lda #>blocks
sta _web64_world_draw_block2_view_screen__arg_blocks+1
lda #<screen
sta _web64_world_draw_block2_view_screen__arg_screen
lda #>screen
sta _web64_world_draw_block2_view_screen__arg_screen+1
lda #width
sta _web64_world_draw_block2_view_screen__arg_width
lda #height
sta _web64_world_draw_block2_view_screen__arg_height
lda #row_stride
sta _web64_world_draw_block2_view_screen__arg_row_stride
.endmacro
.macro web64_rt_call_world_draw_block2_view_screen map, blocks, screen, width, height, row_stride
web64_rt_prepare_world_draw_block2_view_screen map, blocks, screen, width, height, row_stride
jsr _web64_world_draw_block2_view_screen
.endmacro
; web64_world_draw_char_view: 13-byte window; entry _web64_world_draw_char_view
.macro web64_rt_prepare_world_draw_char_view cells, colors, screen, color_ram, width, height, row_stride, color_mode, region_color
lda #<cells
sta _web64_world_draw_char_view__arg_cells
lda #>cells
sta _web64_world_draw_char_view__arg_cells+1
lda #<colors
sta _web64_world_draw_char_view__arg_colors
lda #>colors
sta _web64_world_draw_char_view__arg_colors+1
lda #<screen
sta _web64_world_draw_char_view__arg_screen
lda #>screen
sta _web64_world_draw_char_view__arg_screen+1
lda #<color_ram
sta _web64_world_draw_char_view__arg_color_ram
lda #>color_ram
sta _web64_world_draw_char_view__arg_color_ram+1
lda #width
sta _web64_world_draw_char_view__arg_width
lda #height
sta _web64_world_draw_char_view__arg_height
lda #row_stride
sta _web64_world_draw_char_view__arg_row_stride
lda #color_mode
sta _web64_world_draw_char_view__arg_color_mode
lda #region_color
sta _web64_world_draw_char_view__arg_region_color
.endmacro
.macro web64_rt_call_world_draw_char_view cells, colors, screen, color_ram, width, height, row_stride, color_mode, region_color
web64_rt_prepare_world_draw_char_view cells, colors, screen, color_ram, width, height, row_stride, color_mode, region_color
jsr _web64_world_draw_char_view
.endmacro
; web64_world_draw_char_view_screen: 7-byte window; entry _web64_world_draw_char_view_screen
.macro web64_rt_prepare_world_draw_char_view_screen cells, screen, width, height, row_stride
lda #<cells
sta _web64_world_draw_char_view_screen__arg_cells
lda #>cells
sta _web64_world_draw_char_view_screen__arg_cells+1
lda #<screen
sta _web64_world_draw_char_view_screen__arg_screen
lda #>screen
sta _web64_world_draw_char_view_screen__arg_screen+1
lda #width
sta _web64_world_draw_char_view_screen__arg_width
lda #height
sta _web64_world_draw_char_view_screen__arg_height
lda #row_stride
sta _web64_world_draw_char_view_screen__arg_row_stride
.endmacro
.macro web64_rt_call_world_draw_char_view_screen cells, screen, width, height, row_stride
web64_rt_prepare_world_draw_char_view_screen cells, screen, width, height, row_stride
jsr _web64_world_draw_char_view_screen
.endmacro
; web64_world_mutate_cell: 20-byte window; entry _web64_world_mutate_cell
.macro web64_rt_prepare_world_mutate_cell cells, colors, materials, screen, color_ram, camera, column, row, value, color, material, row_stride, screen_stride, color_mode
lda #<cells
sta _web64_world_mutate_cell__arg_cells
lda #>cells
sta _web64_world_mutate_cell__arg_cells+1
lda #<colors
sta _web64_world_mutate_cell__arg_colors
lda #>colors
sta _web64_world_mutate_cell__arg_colors+1
lda #<materials
sta _web64_world_mutate_cell__arg_materials
lda #>materials
sta _web64_world_mutate_cell__arg_materials+1
lda #<screen
sta _web64_world_mutate_cell__arg_screen
lda #>screen
sta _web64_world_mutate_cell__arg_screen+1
lda #<color_ram
sta _web64_world_mutate_cell__arg_color_ram
lda #>color_ram
sta _web64_world_mutate_cell__arg_color_ram+1
lda #<camera
sta _web64_world_mutate_cell__arg_camera
lda #>camera
sta _web64_world_mutate_cell__arg_camera+1
lda #column
sta _web64_world_mutate_cell__arg_column
lda #row
sta _web64_world_mutate_cell__arg_row
lda #value
sta _web64_world_mutate_cell__arg_value
lda #color
sta _web64_world_mutate_cell__arg_color
lda #material
sta _web64_world_mutate_cell__arg_material
lda #row_stride
sta _web64_world_mutate_cell__arg_row_stride
lda #screen_stride
sta _web64_world_mutate_cell__arg_screen_stride
lda #color_mode
sta _web64_world_mutate_cell__arg_color_mode
.endmacro
.macro web64_rt_call_world_mutate_cell cells, colors, materials, screen, color_ram, camera, column, row, value, color, material, row_stride, screen_stride, color_mode
web64_rt_prepare_world_mutate_cell cells, colors, materials, screen, color_ram, camera, column, row, value, color, material, row_stride, screen_stride, color_mode
jsr _web64_world_mutate_cell
.endmacro
; web64_world_scroll_x: 6-byte window; entry _web64_world_scroll_x
.macro web64_rt_prepare_world_scroll_x camera, delta_pixels, max_cell_x, flags
lda #<camera
sta _web64_world_scroll_x__arg_camera
lda #>camera
sta _web64_world_scroll_x__arg_camera+1
lda #delta_pixels
sta _web64_world_scroll_x__arg_delta_pixels
lda #<max_cell_x
sta _web64_world_scroll_x__arg_max_cell_x
lda #>max_cell_x
sta _web64_world_scroll_x__arg_max_cell_x+1
lda #flags
sta _web64_world_scroll_x__arg_flags
.endmacro
.macro web64_rt_call_world_scroll_x camera, delta_pixels, max_cell_x, flags
web64_rt_prepare_world_scroll_x camera, delta_pixels, max_cell_x, flags
jsr _web64_world_scroll_x
.endmacro
; web64_world_scroll_y: 6-byte window; entry _web64_world_scroll_y
.macro web64_rt_prepare_world_scroll_y camera, delta_pixels, max_cell_y, flags
lda #<camera
sta _web64_world_scroll_y__arg_camera
lda #>camera
sta _web64_world_scroll_y__arg_camera+1
lda #delta_pixels
sta _web64_world_scroll_y__arg_delta_pixels
lda #<max_cell_y
sta _web64_world_scroll_y__arg_max_cell_y
lda #>max_cell_y
sta _web64_world_scroll_y__arg_max_cell_y+1
lda #flags
sta _web64_world_scroll_y__arg_flags
.endmacro
.macro web64_rt_call_world_scroll_y camera, delta_pixels, max_cell_y, flags
web64_rt_prepare_world_scroll_y camera, delta_pixels, max_cell_y, flags
jsr _web64_world_scroll_y
.endmacro
; web64_world_shift_down: 6-byte window; entry _web64_world_shift_down
.macro web64_rt_prepare_world_shift_down screen, color_ram, height, color_mode
lda #<screen
sta _web64_world_shift_down__arg_screen
lda #>screen
sta _web64_world_shift_down__arg_screen+1
lda #<color_ram
sta _web64_world_shift_down__arg_color_ram
lda #>color_ram
sta _web64_world_shift_down__arg_color_ram+1
lda #height
sta _web64_world_shift_down__arg_height
lda #color_mode
sta _web64_world_shift_down__arg_color_mode
.endmacro
.macro web64_rt_call_world_shift_down screen, color_ram, height, color_mode
web64_rt_prepare_world_shift_down screen, color_ram, height, color_mode
jsr _web64_world_shift_down
.endmacro
; web64_world_shift_left: 6-byte window; entry _web64_world_shift_left
.macro web64_rt_prepare_world_shift_left screen, color_ram, height, color_mode
lda #<screen
sta _web64_world_shift_left__arg_screen
lda #>screen
sta _web64_world_shift_left__arg_screen+1
lda #<color_ram
sta _web64_world_shift_left__arg_color_ram
lda #>color_ram
sta _web64_world_shift_left__arg_color_ram+1
lda #height
sta _web64_world_shift_left__arg_height
lda #color_mode
sta _web64_world_shift_left__arg_color_mode
.endmacro
.macro web64_rt_call_world_shift_left screen, color_ram, height, color_mode
web64_rt_prepare_world_shift_left screen, color_ram, height, color_mode
jsr _web64_world_shift_left
.endmacro
; web64_world_shift_right: 6-byte window; entry _web64_world_shift_right
.macro web64_rt_prepare_world_shift_right screen, color_ram, height, color_mode
lda #<screen
sta _web64_world_shift_right__arg_screen
lda #>screen
sta _web64_world_shift_right__arg_screen+1
lda #<color_ram
sta _web64_world_shift_right__arg_color_ram
lda #>color_ram
sta _web64_world_shift_right__arg_color_ram+1
lda #height
sta _web64_world_shift_right__arg_height
lda #color_mode
sta _web64_world_shift_right__arg_color_mode
.endmacro
.macro web64_rt_call_world_shift_right screen, color_ram, height, color_mode
web64_rt_prepare_world_shift_right screen, color_ram, height, color_mode
jsr _web64_world_shift_right
.endmacro
; web64_world_shift_up: 6-byte window; entry _web64_world_shift_up
.macro web64_rt_prepare_world_shift_up screen, color_ram, height, color_mode
lda #<screen
sta _web64_world_shift_up__arg_screen
lda #>screen
sta _web64_world_shift_up__arg_screen+1
lda #<color_ram
sta _web64_world_shift_up__arg_color_ram
lda #>color_ram
sta _web64_world_shift_up__arg_color_ram+1
lda #height
sta _web64_world_shift_up__arg_height
lda #color_mode
sta _web64_world_shift_up__arg_color_mode
.endmacro
.macro web64_rt_call_world_shift_up screen, color_ram, height, color_mode
web64_rt_prepare_world_shift_up screen, color_ram, height, color_mode
jsr _web64_world_shift_up
.endmacro
; web64_world_stream_column: 15-byte window; entry _web64_world_stream_column
.macro web64_rt_prepare_world_stream_column cells, colors, screen, color_ram, source_column, dest_column, height, row_stride, screen_stride, color_mode, region_color
lda #<cells
sta _web64_world_stream_column__arg_cells
lda #>cells
sta _web64_world_stream_column__arg_cells+1
lda #<colors
sta _web64_world_stream_column__arg_colors
lda #>colors
sta _web64_world_stream_column__arg_colors+1
lda #<screen
sta _web64_world_stream_column__arg_screen
lda #>screen
sta _web64_world_stream_column__arg_screen+1
lda #<color_ram
sta _web64_world_stream_column__arg_color_ram
lda #>color_ram
sta _web64_world_stream_column__arg_color_ram+1
lda #source_column
sta _web64_world_stream_column__arg_source_column
lda #dest_column
sta _web64_world_stream_column__arg_dest_column
lda #height
sta _web64_world_stream_column__arg_height
lda #row_stride
sta _web64_world_stream_column__arg_row_stride
lda #screen_stride
sta _web64_world_stream_column__arg_screen_stride
lda #color_mode
sta _web64_world_stream_column__arg_color_mode
lda #region_color
sta _web64_world_stream_column__arg_region_color
.endmacro
.macro web64_rt_call_world_stream_column cells, colors, screen, color_ram, source_column, dest_column, height, row_stride, screen_stride, color_mode, region_color
web64_rt_prepare_world_stream_column cells, colors, screen, color_ram, source_column, dest_column, height, row_stride, screen_stride, color_mode, region_color
jsr _web64_world_stream_column
.endmacro
; web64_world_stream_column_screen: 9-byte window; entry _web64_world_stream_column_screen
.macro web64_rt_prepare_world_stream_column_screen cells, screen, source_column, dest_column, height, row_stride, screen_stride
lda #<cells
sta _web64_world_stream_column_screen__arg_cells
lda #>cells
sta _web64_world_stream_column_screen__arg_cells+1
lda #<screen
sta _web64_world_stream_column_screen__arg_screen
lda #>screen
sta _web64_world_stream_column_screen__arg_screen+1
lda #source_column
sta _web64_world_stream_column_screen__arg_source_column
lda #dest_column
sta _web64_world_stream_column_screen__arg_dest_column
lda #height
sta _web64_world_stream_column_screen__arg_height
lda #row_stride
sta _web64_world_stream_column_screen__arg_row_stride
lda #screen_stride
sta _web64_world_stream_column_screen__arg_screen_stride
.endmacro
.macro web64_rt_call_world_stream_column_screen cells, screen, source_column, dest_column, height, row_stride, screen_stride
web64_rt_prepare_world_stream_column_screen cells, screen, source_column, dest_column, height, row_stride, screen_stride
jsr _web64_world_stream_column_screen
.endmacro
; web64_world_stream_row: 15-byte window; entry _web64_world_stream_row
.macro web64_rt_prepare_world_stream_row cells, colors, screen, color_ram, source_row, dest_row, width, row_stride, screen_stride, color_mode, region_color
lda #<cells
sta _web64_world_stream_row__arg_cells
lda #>cells
sta _web64_world_stream_row__arg_cells+1
lda #<colors
sta _web64_world_stream_row__arg_colors
lda #>colors
sta _web64_world_stream_row__arg_colors+1
lda #<screen
sta _web64_world_stream_row__arg_screen
lda #>screen
sta _web64_world_stream_row__arg_screen+1
lda #<color_ram
sta _web64_world_stream_row__arg_color_ram
lda #>color_ram
sta _web64_world_stream_row__arg_color_ram+1
lda #source_row
sta _web64_world_stream_row__arg_source_row
lda #dest_row
sta _web64_world_stream_row__arg_dest_row
lda #width
sta _web64_world_stream_row__arg_width
lda #row_stride
sta _web64_world_stream_row__arg_row_stride
lda #screen_stride
sta _web64_world_stream_row__arg_screen_stride
lda #color_mode
sta _web64_world_stream_row__arg_color_mode
lda #region_color
sta _web64_world_stream_row__arg_region_color
.endmacro
.macro web64_rt_call_world_stream_row cells, colors, screen, color_ram, source_row, dest_row, width, row_stride, screen_stride, color_mode, region_color
web64_rt_prepare_world_stream_row cells, colors, screen, color_ram, source_row, dest_row, width, row_stride, screen_stride, color_mode, region_color
jsr _web64_world_stream_row
.endmacro
; web64_world_stream_row_screen: 9-byte window; entry _web64_world_stream_row_screen
.macro web64_rt_prepare_world_stream_row_screen cells, screen, source_row, dest_row, width, row_stride, screen_stride
lda #<cells
sta _web64_world_stream_row_screen__arg_cells
lda #>cells
sta _web64_world_stream_row_screen__arg_cells+1
lda #<screen
sta _web64_world_stream_row_screen__arg_screen
lda #>screen
sta _web64_world_stream_row_screen__arg_screen+1
lda #source_row
sta _web64_world_stream_row_screen__arg_source_row
lda #dest_row
sta _web64_world_stream_row_screen__arg_dest_row
lda #width
sta _web64_world_stream_row_screen__arg_width
lda #row_stride
sta _web64_world_stream_row_screen__arg_row_stride
lda #screen_stride
sta _web64_world_stream_row_screen__arg_screen_stride
.endmacro
.macro web64_rt_call_world_stream_row_screen cells, screen, source_row, dest_row, width, row_stride, screen_stride
web64_rt_prepare_world_stream_row_screen cells, screen, source_row, dest_row, width, row_stride, screen_stride
jsr _web64_world_stream_row_screen
.endmacro