Files
akbasic/tests/docs_preludes/galagacalls.pre

54 lines
1.4 KiB
Plaintext
Raw Normal View History

/*
* Prelude for the interpreter-facing fragments in docs/20: the boot sequence,
* the ADDEM proof and the rebind-call-reset protocol, shown as runs of CATCH
* calls. The statics are the ones examples/galaga/script.c keeps; the locals
* are the superset every fragment draws from, void-cast in the postlude so an
* unused one is not a warning.
*/
#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
#include <stdio.h>
#include <string.h>
#include <SDL3/SDL.h>
#include <akerror.h>
#include <akstdlib.h>
#include <akgl/actor.h>
#include <akbasic/environment.h>
#include <akbasic/error.h>
#include <akbasic/host.h>
#include <akbasic/runtime.h>
#include <akbasic/sink.h>
typedef struct galaga_docs_Enemy
{
int32_t kind;
int32_t state;
float homex;
float homey;
float t;
int32_t hp;
int32_t fire;
float rnd;
} galaga_docs_Enemy;
static akbasic_Runtime SCRIPT;
static akbasic_TextSink SINK;
static akbasic_StdioSink SINKSTATE;
static char SOURCE[16384];
akerr_ErrorContext AKERR_NOIGNORE *galaga_docs_fragment(galaga_docs_Enemy *enemy, akgl_Actor *actor, float dt);
akerr_ErrorContext AKERR_NOIGNORE *galaga_docs_fragment(galaga_docs_Enemy *enemy, akgl_Actor *actor, float dt)
{
PREPARE_ERROR(errctx);
akbasic_Value args[2];
akbasic_Value *argp[2];
akbasic_Value dtval;
akbasic_Value *result = NULL;
ATTEMPT {