Types
Button = enum P1_Up, P1_Down, P1_Left, P1_Right, P1_A, P1_B, P1_X, P1_Y, P2_Up, P2_Down, P2_Left, P2_Right, P2_A, P2_B, P2_X, P2_Y, P3_Up, P3_Down, P3_Left, P3_Right, P3_A, P3_B, P3_X, P3_Y, P4_Up, P4_Down, P4_Left, P4_Right, P4_A, P4_B, P4_X, P4_Y
- Source Edit
Color = enum Null = -1, Color0, Color1, Color2, Color3, Color4, Color5, Color6, Color7, Color8, Color9, Color10, Color11, Color12, Color13, Color14, Color15
- Source Edit
Key = enum Key_Null, Key_A, Key_B, Key_C, Key_D, Key_E, Key_F, Key_G, Key_H, Key_I, Key_J, Key_K, Key_L, Key_M, Key_N, Key_O, Key_P, Key_Q, Key_R, Key_S, Key_T, Key_U, Key_V, Key_W, Key_X, Key_Y, Key_Z, Key_0, Key_1, Key_2, Key_3, Key_4, Key_5, Key_6, Key_7, Key_8, Key_9, Key_Minus, Key_Equals, Key_Leftbracket, Key_Rightbracket, Key_Backslash, Key_Semicolon, Key_Apostrophe, Key_Grave, Key_Comma, Key_Period, Key_Slash, Key_Space, Key_Tab, Key_Return, Key_Backspace, Key_Delete, Key_Insert, Key_Pageup, Key_Pagedown, Key_Home, Key_End, Key_Up, Key_Down, Key_Left, Key_Right, Key_Capslock, Key_Ctrl, Key_Shift, Key_Alt
- Source Edit
MouseState {.bycopy.} = object x*: int16 y*: int16 scrollx*: int8 scrolly*: int8 left*: bool middle*: bool right*: bool
- Source Edit
VRAM {.bycopy.} = object screen*: array[130560 div 8, uint8] palette*: array[48, uint8] ## 16 colors. palletteMap*: array[8, uint8] ## 16 indices. borderColorAndOvrTransparency*: uint8 ## Bank 0 is border color, bank 1 is OVR transparency. screenOffsetX*: int8 screenOffsetY*: int8 mouseCursor*: int8 blitSegment*: uint8 reserved*: array[3, uint8]
- Source Edit
Vars
Framebuffer = cast[ptr VRAM](0)
- Source Edit
MusicPatterns = cast[ptr array[MusicPatternsSize, uint8]](0x00011164)
- Source Edit
MusicTracks = cast[ptr array[MusicTracksSize, uint8]](0x00013E64)
- Source Edit
PersistentMemory = cast[ptr array[PersistentMemorySize, uint8]](0x00014004)
- Source Edit
SoundRegisters = cast[ptr array[SoundRegistersSize, uint8]](0x0000FF9C)
- Source Edit
SoundState = cast[ptr array[SoundStateSize, uint8]](0x00013FFC)
- Source Edit
SpriteFlags = cast[ptr array[SpriteFlagsSize, uint8]](0x00014404)
- Source Edit
StereoVolume = cast[ptr array[StereoVolumeSize, uint8]](0x00014000)
- Source Edit
SystemFont = cast[ptr array[SystemFontSize, uint8]](0x00014604)
- Source Edit
WasmFreeRam = cast[ptr array[WasmFreeRamSize, uint8]](0x00018000)
- Source Edit
Consts
GamepadsSize: uint32 = 4
- Source Edit
HeightTiles = 17
- Source Edit
KeyboardSize: uint32 = 4
- Source Edit
MusicPatternsSize: uint32 = 11520
- Source Edit
MusicTracksSize: uint32 = 408
- Source Edit
PersistentMemorySize: uint32 = 1024
- Source Edit
SfxStateSize: uint32 = 16
- Source Edit
SoundRegistersSize: uint32 = 72
- Source Edit
SoundStateSize: uint32 = 4
- Source Edit
SpriteFlagsSize: uint32 = 512
- Source Edit
SpritesSize: uint32 = 0x00002000
- Source Edit
StereoVolumeSize: uint32 = 4
- Source Edit
SystemFontSize: uint32 = 2048
- Source Edit
WasmFreeRamSize: uint32 = 163840
- Source Edit
WaveformsSize: uint32 = 256
- Source Edit
WidthTiles = 30
- Source Edit
Procs
proc font(text: cstring; x, y: int32; trans_colors: ptr uint8; trans_count: int8; char_width, char_height: int8; fixed: bool; scale: int8; alt: bool): int8 {.importc, codegenDecl: "__attribute__((import_name(\"$2\"))) $1 $2$3", ...raises: [], tags: [], forbids: [].}
- Print a string using foreground sprite data as the font. Source Edit
proc mouse(mouse_ptr_addy: ptr MouseState) {.importc, codegenDecl: "__attribute__((import_name(\"$2\"))) $1 $2$3", ...raises: [], tags: [], forbids: [].}
- Get XY and press state of mouse/touch. Source Edit
proc ttri(x1, y1, x2, y2, x3, y3, u1, v1, u2, v2, u3, v3: cfloat; texsrc: int32; trans_colors: ptr uint8; color_count: int8; z1, z2, z3: cfloat; depth: bool) {.importc, codegenDecl: "__attribute__((import_name(\"$2\"))) $1 $2$3", ...raises: [], tags: [], forbids: [].}
- Draw a triangle filled with texture. Source Edit