all repos — xyw @ 8b40e451fc046ce1eb659c98afa6f6b79fc55dba

A minimal virtual machine and assembler for terminals.

Implemented support for 2x zooming.
h3rald h3rald@h3rald.com
Wed, 07 Jan 2026 14:45:20 +0100
commit

8b40e451fc046ce1eb659c98afa6f6b79fc55dba

parent

c35d11b7e11d8c0b6213751f15347ff70b844c17

3 files changed, 9 insertions(+), 3 deletions(-)

jump to
M xyw.cxyw.c

@@ -3,6 +3,7 @@ #include <string.h>

#include "xyw.h" int xyw_debug = 0; +int xyw_zoom = 1; // Instruction mnemonics definition const char xyw_instructions[][4] = {

@@ -36,11 +37,15 @@ if (flag(argv[i], "debug"))

{ xyw_debug = 1; } + if (flag(argv[i], "zoom")) + { + xyw_zoom = 2; + } } for (int i = 1; i < argc; i++) { - if (flag(argv[i], "debug")) + if (flag(argv[i], "debug") || flag(argv[i], "zoom")) { continue; // already handled }
M xyw.hxyw.h

@@ -33,6 +33,7 @@ // clang-format on

extern const char xyw_instructions[][4]; extern int xyw_debug; +extern int xyw_zoom; extern xyw_device xyw_devices[XYW_TOTAL_DEVICES]; int xyw_assemble(const char *input, const char *output);
M xywrun.cxywrun.c

@@ -369,8 +369,8 @@ process_metadata();

// Set direct page to device page by default xyw_memory[SYSTEM_PAGE] = 0xff; // Initialize fenster - uint32_t buf[width * height]; - struct fenster f = {.title = title, .width = width, .height = height, .buf = buf}; + uint32_t buf[width * height * xyw_zoom * xyw_zoom]; + struct fenster f = {.title = title, .width = width * xyw_zoom, .height = height * xyw_zoom, .buf = buf}; fenster_open(&f); xyw_byte paused = 0; while (fenster_loop(&f) == 0 && xyw_memory[SYSTEM_STATE] && *pc < SYSTEM_MEMORY_START)