Epok Engine

EPOK RUNTIME

Pocketstation

pocketstation.hpp · the pocketstation module

Declarations are extracted from the pinned headers. Examples and general guidance are generated sketches, not verified complete programs; consult the linked source and guides for the actual contract.

Module

the pocketstation module.

Header
pocketstation.hpp
Include
#include "pocketstation.hpp"
Stability
Epok runtime API

Include this module

C++ include
#include "pocketstation.hpp"

Types

Functions and methods

callCalls link function `function` of the running program.MethodconnectedPerforms `connected` as part of the pocketstation module.MethoddelayPerforms `delay` as part of the pocketstation module.FunctionfindFinds a file by name; `*block` receives its first block.MethodinstallCopies an embedded program to the card (replacing an older copy) and returns its first block.Methodinstall_and_launchInstalls (if needed) and starts an embedded program.MethodlaunchStarts the program whose first block is `block` (0 = start-up screen).Methodmailbox_attachedPerforms `mailbox attached` as part of the pocketstation module.Functionmailbox_exchangeHands frames to the emulator bridge and waits for its answer.Functionpocket_error_messagePerforms `pocket error message` as part of the pocketstation module.FunctionprobeTrue when a PocketStation (not a plain memory card) is in the slot.Methodread_directoryReads the 16 directory frames (block 0) in one batch.Methodread_memoryKernel memory access (RAM, I/O, flash), up to 128 bytes.Methodread_sectorReads sector as part of the pocketstation module.MethodreceivePocket Lua link: the message published with `link.send(n)`; size 0 when none.MethodsendPocket Lua link: a message for `link.received()` / `link.byte(i)`.Methodset_ledThe red LED (through the PocketStation's I/O port).Methodset_timeSets the clock (year 1900-2099).Methodset_valuePocket Lua link: sets value `index` (1-16), read with `link.value(index)`.Methodsio_exchangeSIO0 transaction, polled like PsyQo's blocking memory card path.FunctionstatusPerforms `status` as part of the pocketstation module.MethodtransferRuns memory card transactions on `port` (0 = first slot).MethodvaluesPocket Lua link: the 16 values set with `link.set_value(i, v)`.Methodwrite_memoryWrites memory as part of the pocketstation module.Methodwrite_sectorWrites sector as part of the pocketstation module.Method

Fields, variables and values

answeredExposes `answered` on `epok::PocketMailbox` for the pocketstation module.FieldBadArgumentNamed value `BadArgument` in `epok::PocketError`.Enum valueBadPortNamed value `BadPort` in `epok::PocketError`.Enum valueBadReplyan answer did not follow the protocolEnum valueBusyanother memory card transaction owns SIO0Enum valuecapacityExposes `capacity` on `epok::PocketMailbox` for the pocketstation module.VariableCardFullNamed value `CardFull` in `epok::PocketError`.Enum valuedayExposes `day` on `epok::PocketStatus` for the pocketstation module.Fieldfilenamememory card name, up to 20 characters, 7th character 'P'FieldflagsExposes `flags` on `epok::PocketStatus` for the pocketstation module.FieldframesExposes `frames` on `epok::PocketMailbox` for the pocketstation module.FieldhourExposes `hour` on `epok::PocketStatus` for the pocketstation module.Fieldimagewhole 8 KiB blocks, as built by EpokFieldlengthExposes `length` on `epok::PocketFrame` for the pocketstation module.Fieldlength_atExposes `length_at` on `epok::PocketFrame` for the pocketstation module.FieldlengthsExposes `lengths` on `epok::PocketMailbox` for the pocketstation module.FieldmagicExposes `magic` on `epok::PocketMailbox` for the pocketstation module.Fieldmagic_value"EPKP"Variablemax_framesExposes `max_frames` on `epok::PocketMailbox` for the pocketstation module.Variablemessage_capacityExposes `message_capacity` on `epok::PocketStationService` for the pocketstation module.VariableminuteExposes `minute` on `epok::PocketStatus` for the pocketstation module.FieldmonthExposes `month` on `epok::PocketStatus` for the pocketstation module.FieldNoCardnothing answers in the slotEnum valueNotFormattedNamed value `NotFormatted` in `epok::PocketError`.Enum valueNotInstalledthe program is not on the cardEnum valueNotPocketStationa memory card that is not a PocketStationEnum valueOKNamed value `OK` in `epok::PocketError`.Enum valuepocketstationExposes `pocketstation` on the `epok` namespace for the pocketstation module.VariableportExposes `port` on `epok::PocketMailbox` for the pocketstation module.FieldreceivedExposes `received` on `epok::PocketFrame` for the pocketstation module.FieldreceivedExposes `received` on `epok::PocketMailbox` for the pocketstation module.FieldRefusedthe device rejected the request (e.g.Enum valuereplyExposes `reply` on `epok::PocketFrame` for the pocketstation module.FieldreplyExposes `reply` on `epok::PocketMailbox` for the pocketstation module.FieldrequestExposes `request` on `epok::PocketMailbox` for the pocketstation module.FieldRunningthe program to replace is running on the PocketStationEnum valuerunning_blockfirst block of the running program; 0 = start-up screenFieldsave_offsetByte offset of Pocket Lua's 128-byte persistent save sector, or zero.FieldsecondExposes `second` on `epok::PocketStatus` for the pocketstation module.FieldsendExposes `send` on `epok::PocketFrame` for the pocketstation module.FieldsendExposes `send` on `epok::PocketMailbox` for the pocketstation module.FieldserialExposes `serial` on `epok::PocketStatus` for the pocketstation module.FieldsizeExposes `size` on `epok::PocketApp` for the pocketstation module.FieldTimeoutthe device stopped answering mid-requestEnum valuevalue_countExposes `value_count` on `epok::PocketStationService` for the pocketstation module.Variableweekday1 = SundayFieldyearExposes `year` on `epok::PocketStatus` for the pocketstation module.Field