Skip to content

Commit c9a8a36

Browse files
committed
zeta 1.2.0
1 parent 2a400ca commit c9a8a36

6 files changed

Lines changed: 25 additions & 14 deletions

File tree

src/frontend_posix.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ static int posix_vfs_exists(const char *filename) {
4747
}
4848

4949
static void posix_zzt_help(int argc, char **argv) {
50-
char *owner = (argv > 0 && argv[0] != NULL && strlen(argv[0]) > 0) ? argv[0] : "zeta";
50+
char *owner = (argc > 0 && argv[0] != NULL && strlen(argv[0]) > 0) ? argv[0] : "zeta";
5151

5252
fprintf(stderr, "Usage: %s [arguments] [world file]\n", owner);
5353
fprintf(stderr, "\n");
@@ -219,7 +219,7 @@ static int posix_zzt_init(int argc, char **argv) {
219219
break;
220220
#endif
221221
case '?':
222-
fprintf(stderr, "Could not parse options! Try %s -h for help.\n", argv > 0 ? argv[0] : "running with");
222+
fprintf(stderr, "Could not parse options! Try %s -h for help.\n", argc > 0 ? argv[0] : "running with");
223223
exit(0);
224224
return INIT_ERR_GENERIC;
225225
}

src/zzt.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -854,12 +854,14 @@ static void cpu_func_intr_0x10(cpu_state* cpu) {
854854
} return;
855855
case 0x01:
856856
case 0x11: {
857-
zzt_load_charset(8, 14, res_8x14_bin, true);
857+
if (zzt_get_style() == ZZT_STYLE_DEFAULT)
858+
zzt_load_charset(8, 14, res_8x14_bin, true);
858859
zzt.requested_char_height = 14;
859860
} return;
860861
case 0x02:
861862
case 0x12: {
862-
zzt_load_charset(8, 8, res_8x8_bin, true);
863+
if (zzt_get_style() == ZZT_STYLE_DEFAULT)
864+
zzt_load_charset(8, 8, res_8x8_bin, true);
863865
zzt.requested_char_height = 8;
864866
} return;
865867
case 0x30: {

src/zzt_ems.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ static ems_status ems_resize_handles(ems_state *ems, u16 new_size) {
5151
old_handles = ems->handles;
5252
ems->handles = realloc(old_handles, sizeof(ems_handle) * new_size);
5353
if (ems->handles == NULL) {
54-
ems->handles = old_handles;
5554
return EMS_STATUS_OUT_OF_HANDLES;
5655
}
5756
}
@@ -134,7 +133,6 @@ static ems_status ems_map_page(cpu_state *cpu, ems_state *ems, u8 physical_page,
134133
phys_data = ems->handles[handle].data;
135134
ems->handles[handle].data = realloc(phys_data, sizeof(u8) * (logical_page + 1) * EMS_PAGE_SIZE);
136135
if (ems->handles[handle].data == NULL) {
137-
ems->handles[handle].data = phys_data;
138136
return EMS_STATUS_INTERNAL_ERROR;
139137
}
140138
}

web/package.json

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,22 @@
66
"scripts": {
77
"build": "node_modules/.bin/rollup -c --bundleConfigAsCjs"
88
},
9-
"browserslist": ["defaults"],
9+
"browserslist": [
10+
"defaults"
11+
],
1012
"author": "asie",
1113
"license": "MIT",
1214
"devDependencies": {
13-
"@babel/core": "^7.26.10",
14-
"@babel/preset-env": "^7.26.9",
15-
"@rollup/plugin-babel": "^6.0.4",
16-
"@rollup/plugin-node-resolve": "^16.0.1",
17-
"@rollup/plugin-terser": "^0.4.4",
18-
"rollup": "^4.46.2",
15+
"@babel/core": "^7.29.0",
16+
"@babel/preset-env": "^7.29.0",
17+
"@rollup/plugin-babel": "^7.0.0",
18+
"@rollup/plugin-node-resolve": "^16.0.3",
19+
"@rollup/plugin-terser": "^1.0.0",
20+
"rollup": "^4.59.0",
1921
"rollup-plugin-banner2": "^1.3.1"
2022
},
2123
"dependencies": {
22-
"core-js": "^3.44.0"
24+
"core-js": "^3.48.0",
25+
"npm-check-updates": "^19.6.3"
2326
}
2427
}

web/res/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ The entrypoint is "ZetaLoad(options, callback);". The callback is optional, and
5858
* Set to 0 to disable blinking - force low colors (can be changed back in the F11 menu).
5959
* Set to -1 to disable blinking - enable high colors (can be changed back by the running engine).
6060
* charset_override: the location of a PNG image file (16x16 chars) overriding the engine's character set, if present.
61+
* style: the built-in rendering style to use: "1991", "1994", "1999", "2002"
6162
* audio:
6263
* bufferSize (buffer): the audio buffer size, in samples.
6364
* sampleRate (buffer): the audio sampling rate, in Hz.

web/src/emulator.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -469,6 +469,13 @@ export function createEmulator(render, audio, vfs, options) {
469469
}
470470
}
471471

472+
if (options && options.render && options.render.style) {
473+
if (options.render.style == "1991") emu._zzt_set_style(1);
474+
if (options.render.style == "1994") emu._zzt_set_style(2);
475+
if (options.render.style == "1999") emu._zzt_set_style(3);
476+
if (options.render.style == "2002") emu._zzt_set_style(4);
477+
}
478+
472479
if (options && options.commands) {
473480
const lastCommand = options.commands.length - 1;
474481
for (var i = 0; i <= lastCommand; i++) {

0 commit comments

Comments
 (0)