rk86 2.0.23 → 2.0.25
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/rk86.js +54 -33
package/package.json
CHANGED
package/rk86.js
CHANGED
|
@@ -4083,7 +4083,7 @@ import { basename } from "path";
|
|
|
4083
4083
|
// packages/rk86/package.json
|
|
4084
4084
|
var package_default = {
|
|
4085
4085
|
name: "rk86",
|
|
4086
|
-
version: "2.0.
|
|
4086
|
+
version: "2.0.24",
|
|
4087
4087
|
description: "\u042D\u043C\u0443\u043B\u044F\u0442\u043E\u0440 \u0420\u0430\u0434\u0438\u043E-86\u0420\u041A (Intel 8080) \u0434\u043B\u044F \u0442\u0435\u0440\u043C\u0438\u043D\u0430\u043B\u0430",
|
|
4088
4088
|
bin: {
|
|
4089
4089
|
rk86: "rk86.js"
|
|
@@ -5319,9 +5319,11 @@ class Memory {
|
|
|
5319
5319
|
const addr = address & 65535;
|
|
5320
5320
|
this.last_access_address = addr;
|
|
5321
5321
|
this.last_access_operation = "read";
|
|
5322
|
-
|
|
5322
|
+
const ppi_reg = addr & 57347;
|
|
5323
|
+
const vg75_reg = addr & 57345;
|
|
5324
|
+
if (ppi_reg === 32770)
|
|
5323
5325
|
return this.machine.keyboard.modifiers;
|
|
5324
|
-
if (
|
|
5326
|
+
if (ppi_reg === 32769) {
|
|
5325
5327
|
const keyboard_state = this.machine.keyboard.state;
|
|
5326
5328
|
let ch = 255;
|
|
5327
5329
|
const kbd_scanline = ~this.buf[32768];
|
|
@@ -5330,14 +5332,14 @@ class Memory {
|
|
|
5330
5332
|
ch &= keyboard_state[i];
|
|
5331
5333
|
return ch;
|
|
5332
5334
|
}
|
|
5333
|
-
if (
|
|
5335
|
+
if (vg75_reg === 49153) {
|
|
5334
5336
|
const ticks = this.machine.runner.total_ticks;
|
|
5335
5337
|
const FRAME = 35600;
|
|
5336
5338
|
const VRTC_ON = 3560;
|
|
5337
5339
|
const vrtc = ticks % FRAME >= FRAME - VRTC_ON ? 32 : 0;
|
|
5338
5340
|
return vrtc | (this.machine.screen.light_pen_active ? 16 : 0);
|
|
5339
5341
|
}
|
|
5340
|
-
if (
|
|
5342
|
+
if (vg75_reg === 49152) {
|
|
5341
5343
|
if (this.vg75_c001_60_cmd === 1) {
|
|
5342
5344
|
this.vg75_c001_60_cmd = 2;
|
|
5343
5345
|
return this.machine.screen.light_pen_x;
|
|
@@ -5360,11 +5362,12 @@ class Memory {
|
|
|
5360
5362
|
const byte = value8 & 255;
|
|
5361
5363
|
this.last_access_address = addr;
|
|
5362
5364
|
this.last_access_operation = "write";
|
|
5363
|
-
if (addr
|
|
5364
|
-
|
|
5365
|
-
|
|
5366
|
-
const
|
|
5367
|
-
|
|
5365
|
+
if (addr < 63488)
|
|
5366
|
+
this.buf[addr] = byte;
|
|
5367
|
+
const ppi_reg = addr & 57347;
|
|
5368
|
+
const vg75_reg = addr & 57345;
|
|
5369
|
+
const vt57_reg = addr & 57359;
|
|
5370
|
+
if (ppi_reg === 32771) {
|
|
5368
5371
|
if (byte & 128) {} else {
|
|
5369
5372
|
const bit = byte >> 1 & 3;
|
|
5370
5373
|
const value = byte & 1;
|
|
@@ -5373,20 +5376,20 @@ class Memory {
|
|
|
5373
5376
|
}
|
|
5374
5377
|
return;
|
|
5375
5378
|
}
|
|
5376
|
-
if (
|
|
5379
|
+
if (vg75_reg === 49153 && byte === 39)
|
|
5377
5380
|
return;
|
|
5378
|
-
if (
|
|
5381
|
+
if (vg75_reg === 49153 && byte === 224)
|
|
5379
5382
|
return;
|
|
5380
|
-
if (
|
|
5383
|
+
if (vg75_reg === 49153 && byte === 128) {
|
|
5381
5384
|
this.vg75_c001_80_cmd = 1;
|
|
5382
5385
|
return;
|
|
5383
5386
|
}
|
|
5384
|
-
if (
|
|
5387
|
+
if (vg75_reg === 49152 && this.vg75_c001_80_cmd === 1) {
|
|
5385
5388
|
this.vg75_c001_80_cmd += 1;
|
|
5386
5389
|
this.cursor_x_buf = byte + 1;
|
|
5387
5390
|
return;
|
|
5388
5391
|
}
|
|
5389
|
-
if (
|
|
5392
|
+
if (vg75_reg === 49152 && this.vg75_c001_80_cmd === 2) {
|
|
5390
5393
|
this.cursor_y_buf = byte + 1;
|
|
5391
5394
|
this.machine.screen.set_cursor(this.cursor_x_buf - 1, this.cursor_y_buf - 1);
|
|
5392
5395
|
this.video_screen_cursor_x = this.cursor_x_buf;
|
|
@@ -5394,30 +5397,30 @@ class Memory {
|
|
|
5394
5397
|
this.vg75_c001_80_cmd = 0;
|
|
5395
5398
|
return;
|
|
5396
5399
|
}
|
|
5397
|
-
if (
|
|
5400
|
+
if (vg75_reg === 49153 && byte === 96) {
|
|
5398
5401
|
if (this.machine.screen.light_pen_active)
|
|
5399
5402
|
this.vg75_c001_60_cmd = 1;
|
|
5400
5403
|
return;
|
|
5401
5404
|
}
|
|
5402
|
-
if (
|
|
5405
|
+
if (vg75_reg === 49153 && byte === 0) {
|
|
5403
5406
|
this.vg75_c001_00_cmd = 1;
|
|
5404
5407
|
return;
|
|
5405
5408
|
}
|
|
5406
|
-
if (
|
|
5409
|
+
if (vg75_reg === 49152 && this.vg75_c001_00_cmd === 1) {
|
|
5407
5410
|
this.video_screen_size_x_buf = (byte & 127) + 1;
|
|
5408
5411
|
this.vg75_c001_00_cmd += 1;
|
|
5409
5412
|
return;
|
|
5410
5413
|
}
|
|
5411
|
-
if (
|
|
5414
|
+
if (vg75_reg === 49152 && this.vg75_c001_00_cmd === 2) {
|
|
5412
5415
|
this.video_screen_size_y_buf = (byte & 63) + 1;
|
|
5413
5416
|
this.vg75_c001_00_cmd += 1;
|
|
5414
5417
|
return;
|
|
5415
5418
|
}
|
|
5416
|
-
if (
|
|
5419
|
+
if (vg75_reg === 49152 && this.vg75_c001_00_cmd === 3) {
|
|
5417
5420
|
this.vg75_c001_00_cmd += 1;
|
|
5418
5421
|
return;
|
|
5419
5422
|
}
|
|
5420
|
-
if (
|
|
5423
|
+
if (vg75_reg === 49152 && this.vg75_c001_00_cmd === 4) {
|
|
5421
5424
|
this.vg75_c001_00_cmd = 0;
|
|
5422
5425
|
if (this.video_screen_size_x_buf && this.video_screen_size_y_buf) {
|
|
5423
5426
|
this.video_screen_size_x = this.video_screen_size_x_buf;
|
|
@@ -5426,28 +5429,28 @@ class Memory {
|
|
|
5426
5429
|
}
|
|
5427
5430
|
return;
|
|
5428
5431
|
}
|
|
5429
|
-
if (
|
|
5432
|
+
if (vt57_reg === 57352 && byte === 128) {
|
|
5430
5433
|
this.ik57_e008_80_cmd = 1;
|
|
5431
5434
|
this.ik57_ff = 0;
|
|
5432
5435
|
this.tape_8002_as_output = 1;
|
|
5433
5436
|
return;
|
|
5434
5437
|
}
|
|
5435
|
-
if (
|
|
5438
|
+
if (vt57_reg === 57348 && this.ik57_e008_80_cmd === 1) {
|
|
5436
5439
|
this.video_memory_base_buf = byte;
|
|
5437
5440
|
this.ik57_e008_80_cmd += 1;
|
|
5438
5441
|
return;
|
|
5439
5442
|
}
|
|
5440
|
-
if (
|
|
5443
|
+
if (vt57_reg === 57348 && this.ik57_e008_80_cmd === 2) {
|
|
5441
5444
|
this.video_memory_base_buf |= byte << 8;
|
|
5442
5445
|
this.ik57_e008_80_cmd += 1;
|
|
5443
5446
|
return;
|
|
5444
5447
|
}
|
|
5445
|
-
if (
|
|
5448
|
+
if (vt57_reg === 57349 && this.ik57_e008_80_cmd === 3) {
|
|
5446
5449
|
this.video_memory_size_buf = byte;
|
|
5447
5450
|
this.ik57_e008_80_cmd += 1;
|
|
5448
5451
|
return;
|
|
5449
5452
|
}
|
|
5450
|
-
if (
|
|
5453
|
+
if (vt57_reg === 57349 && this.ik57_e008_80_cmd === 4) {
|
|
5451
5454
|
this.video_memory_size_buf = ((this.video_memory_size_buf | byte << 8) & 16383) + 1;
|
|
5452
5455
|
this.ik57_e008_80_cmd = 0;
|
|
5453
5456
|
this.video_memory_base = this.video_memory_base_buf;
|
|
@@ -5455,11 +5458,11 @@ class Memory {
|
|
|
5455
5458
|
this.machine.screen.set_video_memory(this.video_memory_base);
|
|
5456
5459
|
return;
|
|
5457
5460
|
}
|
|
5458
|
-
if (
|
|
5461
|
+
if (vt57_reg === 57352 && byte === 164) {
|
|
5459
5462
|
this.tape_8002_as_output = 0;
|
|
5460
5463
|
return;
|
|
5461
5464
|
}
|
|
5462
|
-
if (
|
|
5465
|
+
if (vt57_reg === 57348 && this.ik57_e008_80_cmd === 0) {
|
|
5463
5466
|
if (this.ik57_ff === 0) {
|
|
5464
5467
|
this.video_memory_base_buf = this.video_memory_base & 65280 | byte;
|
|
5465
5468
|
this.ik57_ff = 1;
|
|
@@ -5471,7 +5474,7 @@ class Memory {
|
|
|
5471
5474
|
}
|
|
5472
5475
|
return;
|
|
5473
5476
|
}
|
|
5474
|
-
if (
|
|
5477
|
+
if (vt57_reg === 57349 && this.ik57_e008_80_cmd === 0) {
|
|
5475
5478
|
if (this.ik57_ff === 0) {
|
|
5476
5479
|
this.video_memory_size_buf = byte;
|
|
5477
5480
|
this.ik57_ff = 1;
|
|
@@ -5482,7 +5485,7 @@ class Memory {
|
|
|
5482
5485
|
}
|
|
5483
5486
|
return;
|
|
5484
5487
|
}
|
|
5485
|
-
if (
|
|
5488
|
+
if (ppi_reg === 32770) {
|
|
5486
5489
|
if (this.tape_8002_as_output) {
|
|
5487
5490
|
this.tape_write_bit(byte & 1);
|
|
5488
5491
|
}
|
|
@@ -6057,16 +6060,30 @@ class TerminalRenderer {
|
|
|
6057
6060
|
output += `${dim}\u250C${"\u2500".repeat(w)}\u2510${reset}
|
|
6058
6061
|
`;
|
|
6059
6062
|
let addr = screen.video_memory_base;
|
|
6063
|
+
let frameStopped = false;
|
|
6060
6064
|
for (let y = 0;y < screen.height; y++) {
|
|
6061
6065
|
let line = `${dim}\u2502${reset}`;
|
|
6066
|
+
let rowStopped = frameStopped;
|
|
6062
6067
|
for (let x = 0;x < w; x++) {
|
|
6063
|
-
const
|
|
6068
|
+
const raw = memory.read(addr++);
|
|
6069
|
+
let ch;
|
|
6070
|
+
if (rowStopped) {
|
|
6071
|
+
ch = " ";
|
|
6072
|
+
} else if (raw >= 240) {
|
|
6073
|
+
ch = " ";
|
|
6074
|
+
rowStopped = true;
|
|
6075
|
+
if (raw >= 248)
|
|
6076
|
+
frameStopped = true;
|
|
6077
|
+
} else if (raw >= 128) {
|
|
6078
|
+
ch = " ";
|
|
6079
|
+
} else {
|
|
6080
|
+
ch = rk86char(raw);
|
|
6081
|
+
}
|
|
6064
6082
|
if (x === screen.cursor_x && y === screen.cursor_y) {
|
|
6065
6083
|
line += `\x1B[4m${ch}${reset}`;
|
|
6066
6084
|
} else {
|
|
6067
6085
|
line += ch;
|
|
6068
6086
|
}
|
|
6069
|
-
addr++;
|
|
6070
6087
|
}
|
|
6071
6088
|
line += `${dim}\u2502${reset}`;
|
|
6072
6089
|
output += line + `
|
|
@@ -6509,7 +6526,7 @@ function dumpScreen(machine) {
|
|
|
6509
6526
|
let rowStopped = frameStopped;
|
|
6510
6527
|
for (let x = 0;x < screen.width; x++) {
|
|
6511
6528
|
const raw = memory.read_raw(addr++);
|
|
6512
|
-
if (rowStopped || raw >=
|
|
6529
|
+
if (rowStopped || raw >= 192) {
|
|
6513
6530
|
line += ".";
|
|
6514
6531
|
if (raw >= 240)
|
|
6515
6532
|
rowStopped = true;
|
|
@@ -6517,6 +6534,10 @@ function dumpScreen(machine) {
|
|
|
6517
6534
|
frameStopped = true;
|
|
6518
6535
|
continue;
|
|
6519
6536
|
}
|
|
6537
|
+
if (raw >= 128) {
|
|
6538
|
+
line += ".";
|
|
6539
|
+
continue;
|
|
6540
|
+
}
|
|
6520
6541
|
const byte = raw & 127;
|
|
6521
6542
|
if (byte === 0 || byte === 9 || byte === 10 || byte === 13) {
|
|
6522
6543
|
line += ".";
|