uxn

Varvara Ordinator, written in ANSI C(SDL2)
git clone https://git.eamoncaddigan.net/uxn.git
Log | Files | Refs | README | LICENSE

uxn.h (961B)


      1 /*
      2 Copyright (c) 2021 Devine Lu Linvega
      3 
      4 Permission to use, copy, modify, and distribute this software for any
      5 purpose with or without fee is hereby granted, provided that the above
      6 copyright notice and this permission notice appear in all copies.
      7 
      8 THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
      9 WITH REGARD TO THIS SOFTWARE.
     10 */
     11 
     12 /* clang-format off */
     13 
     14 #define PEEK2(d) (*(d) << 8 | (d)[1])
     15 #define POKE2(d, v) { *(d) = (v) >> 8; (d)[1] = (v); }
     16 
     17 /* clang-format on */
     18 
     19 #define PAGE_PROGRAM 0x0100
     20 
     21 typedef unsigned char Uint8;
     22 typedef signed char Sint8;
     23 typedef unsigned short Uint16;
     24 typedef signed short Sint16;
     25 typedef unsigned int Uint32;
     26 
     27 typedef struct {
     28 	Uint8 dat[0x100], ptr;
     29 } Stack;
     30 
     31 typedef struct Uxn {
     32 	Uint8 *ram, *dev;
     33 	Stack wst, rst;
     34 } Uxn;
     35 
     36 /* required functions */
     37 
     38 extern Uint8 emu_dei(Uxn *u, Uint8 addr);
     39 extern void emu_deo(Uxn *u, Uint8 addr, Uint8 value);
     40 
     41 /* built-ins */
     42 
     43 int uxn_eval(Uxn *u, Uint16 pc);