all repos — xyw @ 85f7ba0ea6622afd4c390df0efcca6368072d84f

A minimal virtual machine and assembler for terminals.

Integrating fenster.
h3rald h3rald@h3rald.com
Wed, 17 Dec 2025 11:18:11 +0100
commit

85f7ba0ea6622afd4c390df0efcca6368072d84f

parent

5455787cc2c749e4372e695aa2db153035289c64

2 files changed, 10 insertions(+), 1 deletions(-)

jump to
A examples/window.xyw

@@ -0,0 +1,1 @@

+.include "devices.xyw"
M xywrun.cxywrun.c

@@ -15,6 +15,9 @@ #define USER_STACK_START 0xfd00

#define SYSTEM_STACK_START 0xfe00 #define DEVICE_AREA_START 0xff00 +#define MAX_WIDTH 256 +#define MAX_HEIGHT 256 + /* system device */ #define SYSTEM_STATE 0xff00 #define SYSTEM_ERROR 0xff01

@@ -292,7 +295,11 @@ }

} // Set direct page to device page by default xyw_memory[SYSTEM_PAGE] = 0xff; - while (xyw_memory[SYSTEM_STATE] && *pc < SYSTEM_MEMORY_START) + // Initialize fenster + uint32_t buf[MAX_WIDTH * MAX_HEIGHT] = {0}; + struct fenster f = {.title = "xyw", .width = MAX_WIDTH, .height = MAX_HEIGHT, .buf = buf}; + fenster_open(&f); + while (fenster_loop(&f) == 0 && xyw_memory[SYSTEM_STATE] && *pc < SYSTEM_MEMORY_START) { xyw_dbg("PC: %04X -> %02X (%s) [U:%02X|S:%02X|X:%02X|Y:%02X|XW:%04X|YW:%04X]\n", *pc, xyw_memory[*pc], xyw_instructions[xyw_memory[*pc] & 0x1F], *u, *s, *x, *y, *xw, *yw); switch (xyw_memory[*pc])

@@ -337,5 +344,6 @@ // At present, JCN, JMP, JSR and RTS set the pc to 1 value less than the actual address

// because we are relying on the fact that pc will be incremented at the end of the loop (*pc)++; } + fenster_close(&f); return 0; }