rk86 2.0.22 → 2.0.24

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/rk86.js +177 -30
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rk86",
3
- "version": "2.0.22",
3
+ "version": "2.0.24",
4
4
  "description": "Эмулятор Радио-86РК (Intel 8080) для терминала",
5
5
  "bin": {
6
6
  "rk86": "rk86.js"
package/rk86.js CHANGED
@@ -2884,6 +2884,20 @@ var init_catalog_data = __esm(() => {
2884
2884
  checkSum: 44381,
2885
2885
  leadingE6: false
2886
2886
  },
2887
+ {
2888
+ name: "cpudetect.rk",
2889
+ title: "\u041E\u043F\u0440\u0435\u0434\u0435\u043B\u0435\u043D\u0438\u0435 \u0442\u0438\u043F\u0430 \u043F\u0440\u043E\u0446\u0435\u0441\u0441\u043E\u0440\u0430 (8080/Z80)",
2890
+ description: "",
2891
+ screenshots: [
2892
+ "cpudetect.rk-1.png"
2893
+ ],
2894
+ start: 0,
2895
+ end: 75,
2896
+ size: 76,
2897
+ entry: 0,
2898
+ checkSum: 41813,
2899
+ leadingE6: false
2900
+ },
2887
2901
  {
2888
2902
  name: "cputest.bin",
2889
2903
  title: "\u0422\u0435\u0441\u0442 CPU TEST DIAGNOSTICS II V1.2",
@@ -2896,6 +2910,20 @@ var init_catalog_data = __esm(() => {
2896
2910
  checkSum: 65444,
2897
2911
  leadingE6: false
2898
2912
  },
2913
+ {
2914
+ name: "dizzy75.rkr",
2915
+ title: "\u0418\u0433\u0440\u0430 Dizzy",
2916
+ description: "",
2917
+ screenshots: [
2918
+ "dizzy75.rkr-1.png"
2919
+ ],
2920
+ start: 0,
2921
+ end: 30207,
2922
+ size: 30208,
2923
+ entry: 0,
2924
+ checkSum: 21118,
2925
+ leadingE6: false
2926
+ },
2899
2927
  {
2900
2928
  name: "mars3-lpe.rkr",
2901
2929
  title: "\u0418\u0433\u0440\u0430 \u041C\u0430\u0440\u0441",
@@ -2965,6 +2993,20 @@ var init_catalog_data = __esm(() => {
2965
2993
  checkSum: 48506,
2966
2994
  leadingE6: false
2967
2995
  },
2996
+ {
2997
+ name: "monkey.rk",
2998
+ title: "\u041A\u0430\u0440\u0442\u0438\u043D\u043A\u0430 \xAB\u041E\u0431\u0435\u0437\u044C\u044F\u043D\u043A\u0430\xBB",
2999
+ description: "",
3000
+ screenshots: [
3001
+ "monkey.rk-1.png"
3002
+ ],
3003
+ start: 0,
3004
+ end: 1334,
3005
+ size: 1335,
3006
+ entry: 0,
3007
+ checkSum: 55511,
3008
+ leadingE6: false
3009
+ },
2968
3010
  {
2969
3011
  name: "okoshki-demo.rkr",
2970
3012
  title: "\u0414\u0435\u043C\u043E\u043D\u0441\u0442\u0440\u0430\u0446\u0438\u044F \u0434\u043B\u044F \u041C\u043E\u043D\u0438\u0442\u043E\u0440\u0430 \xABmon_okoshki.bin\xBB",
@@ -2995,6 +3037,20 @@ var init_catalog_data = __esm(() => {
2995
3037
  checkSum: 6845,
2996
3038
  leadingE6: false
2997
3039
  },
3040
+ {
3041
+ name: "radio-86.rk",
3042
+ title: "\u0417\u0430\u0441\u0442\u0430\u0432\u043A\u0430 \xAB\u0420\u0430\u0434\u0438\u043E-86\u0420\u041A\xBB",
3043
+ description: "",
3044
+ screenshots: [
3045
+ "radio-86.rk-1.png"
3046
+ ],
3047
+ start: 0,
3048
+ end: 547,
3049
+ size: 548,
3050
+ entry: 0,
3051
+ checkSum: 16294,
3052
+ leadingE6: false
3053
+ },
2998
3054
  {
2999
3055
  name: "rk8080pre.bin",
3000
3056
  title: '\u0422\u0435\u0441\u0442 "8080 Preliminary tests" \u043E\u0442 Ian Bartholomew',
@@ -3086,6 +3142,37 @@ var init_catalog_data = __esm(() => {
3086
3142
  checkSum: 26258,
3087
3143
  leadingE6: false
3088
3144
  },
3145
+ {
3146
+ name: "squash.rkr",
3147
+ title: "\u0418\u0433\u0440\u0430 Squash (\u0441\u043A\u0432\u043E\u0448)",
3148
+ description: "\u0410\u0432\u0442\u043E\u0440: \u0414\u043C\u0438\u0442\u0440\u0438\u0439 \u0418\u0432\u0430\u043D\u043E\u0432, 2024.",
3149
+ screenshots: [
3150
+ "squash.rkr-1.png",
3151
+ "squash.rkr-2.png"
3152
+ ],
3153
+ start: 0,
3154
+ end: 7906,
3155
+ size: 7907,
3156
+ entry: 0,
3157
+ checkSum: 12710,
3158
+ leadingE6: false
3159
+ },
3160
+ {
3161
+ name: "trex.rk",
3162
+ title: "\u0418\u0433\u0440\u0430 T-Rex (\u0422\u0438\u0440\u0430\u043D\u043D\u043E\u0437\u0430\u0432\u0440)",
3163
+ description: "",
3164
+ screenshots: [
3165
+ "trex.rk-1.png",
3166
+ "trex.rk-2.png",
3167
+ "trex.rk-3.png"
3168
+ ],
3169
+ start: 0,
3170
+ end: 13511,
3171
+ size: 13512,
3172
+ entry: 0,
3173
+ checkSum: 58261,
3174
+ leadingE6: false
3175
+ },
3089
3176
  {
3090
3177
  name: "viewport.rkr",
3091
3178
  title: "\u0414\u0435\u043C\u043E\u043D\u0441\u0442\u0440\u0430\u0446\u0438\u044F \u0434\u043B\u044F \u041C\u043E\u043D\u0438\u0442\u043E\u0440\u0430 \xABmon_okoshki.bin\xBB",
@@ -3107,6 +3194,20 @@ var init_catalog_data = __esm(() => {
3107
3194
  entry: 0,
3108
3195
  checkSum: 56892,
3109
3196
  leadingE6: false
3197
+ },
3198
+ {
3199
+ name: "weird.rkr",
3200
+ title: "\u041F\u0440\u0435\u0434\u0441\u043A\u0430\u0437\u0430\u0442\u0435\u043B\u044C\u043D\u0438\u0446\u0430 \u2014 \u0433\u0430\u0434\u0430\u043B\u043A\u0430 \u0441 \u043F\u0440\u0435\u0434\u0441\u043A\u0430\u0437\u0430\u043D\u0438\u044F\u043C\u0438.",
3201
+ description: "",
3202
+ screenshots: [
3203
+ "weird.rkr-1.png"
3204
+ ],
3205
+ start: 0,
3206
+ end: 10677,
3207
+ size: 10678,
3208
+ entry: 0,
3209
+ checkSum: 16541,
3210
+ leadingE6: false
3110
3211
  }
3111
3212
  ];
3112
3213
  });
@@ -3982,7 +4083,7 @@ import { basename } from "path";
3982
4083
  // packages/rk86/package.json
3983
4084
  var package_default = {
3984
4085
  name: "rk86",
3985
- version: "2.0.21",
4086
+ version: "2.0.23",
3986
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",
3987
4088
  bin: {
3988
4089
  rk86: "rk86.js"
@@ -5104,6 +5205,7 @@ class Memory {
5104
5205
  video_screen_size_x_buf = 0;
5105
5206
  video_screen_size_y_buf = 0;
5106
5207
  ik57_e008_80_cmd = 0;
5208
+ ik57_ff = 0;
5107
5209
  vg75_c001_80_cmd = 0;
5108
5210
  cursor_x_buf = 0;
5109
5211
  cursor_y_buf = 0;
@@ -5130,6 +5232,7 @@ class Memory {
5130
5232
  this.video_screen_size_x_buf = 0;
5131
5233
  this.video_screen_size_y_buf = 0;
5132
5234
  this.ik57_e008_80_cmd = 0;
5235
+ this.ik57_ff = 0;
5133
5236
  this.vg75_c001_80_cmd = 0;
5134
5237
  this.cursor_x_buf = 0;
5135
5238
  this.cursor_y_buf = 0;
@@ -5162,6 +5265,7 @@ class Memory {
5162
5265
  cursor_y_buf: this.cursor_y_buf,
5163
5266
  vg75_c001_60_cmd: this.vg75_c001_60_cmd,
5164
5267
  ik57_e008_80_cmd: this.ik57_e008_80_cmd,
5268
+ ik57_ff: this.ik57_ff,
5165
5269
  tape_8002_as_output: this.tape_8002_as_output,
5166
5270
  video_memory_base_buf: h16(this.video_memory_base_buf),
5167
5271
  video_memory_size_buf: h16(this.video_memory_size_buf),
@@ -5186,6 +5290,7 @@ class Memory {
5186
5290
  this.cursor_y_buf = snapshot.cursor_y_buf;
5187
5291
  this.vg75_c001_60_cmd = snapshot.vg75_c001_60_cmd;
5188
5292
  this.ik57_e008_80_cmd = snapshot.ik57_e008_80_cmd;
5293
+ this.ik57_ff = snapshot.ik57_ff ?? 0;
5189
5294
  this.tape_8002_as_output = snapshot.tape_8002_as_output;
5190
5295
  this.video_memory_base_buf = h(snapshot.video_memory_base_buf);
5191
5296
  this.video_memory_size_buf = h(snapshot.video_memory_size_buf);
@@ -5214,9 +5319,11 @@ class Memory {
5214
5319
  const addr = address & 65535;
5215
5320
  this.last_access_address = addr;
5216
5321
  this.last_access_operation = "read";
5217
- if (addr === 32770)
5322
+ const ppi_reg = addr & 57347;
5323
+ const vg75_reg = addr & 57345;
5324
+ if (ppi_reg === 32770)
5218
5325
  return this.machine.keyboard.modifiers;
5219
- if (addr === 32769) {
5326
+ if (ppi_reg === 32769) {
5220
5327
  const keyboard_state = this.machine.keyboard.state;
5221
5328
  let ch = 255;
5222
5329
  const kbd_scanline = ~this.buf[32768];
@@ -5225,10 +5332,14 @@ class Memory {
5225
5332
  ch &= keyboard_state[i];
5226
5333
  return ch;
5227
5334
  }
5228
- if (addr === 49153) {
5229
- return 32 | (this.machine.screen.light_pen_active ? 16 : 0);
5335
+ if (vg75_reg === 49153) {
5336
+ const ticks = this.machine.runner.total_ticks;
5337
+ const FRAME = 35600;
5338
+ const VRTC_ON = 3560;
5339
+ const vrtc = ticks % FRAME >= FRAME - VRTC_ON ? 32 : 0;
5340
+ return vrtc | (this.machine.screen.light_pen_active ? 16 : 0);
5230
5341
  }
5231
- if (addr === 49152) {
5342
+ if (vg75_reg === 49152) {
5232
5343
  if (this.vg75_c001_60_cmd === 1) {
5233
5344
  this.vg75_c001_60_cmd = 2;
5234
5345
  return this.machine.screen.light_pen_x;
@@ -5251,11 +5362,12 @@ class Memory {
5251
5362
  const byte = value8 & 255;
5252
5363
  this.last_access_address = addr;
5253
5364
  this.last_access_operation = "write";
5254
- if (addr >= 63488)
5255
- return;
5256
- this.buf[addr] = byte;
5257
- const peripheral_reg = addr & 61439;
5258
- if (peripheral_reg === 32771) {
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) {
5259
5371
  if (byte & 128) {} else {
5260
5372
  const bit = byte >> 1 & 3;
5261
5373
  const value = byte & 1;
@@ -5264,20 +5376,20 @@ class Memory {
5264
5376
  }
5265
5377
  return;
5266
5378
  }
5267
- if (peripheral_reg === 49153 && byte === 39)
5379
+ if (vg75_reg === 49153 && byte === 39)
5268
5380
  return;
5269
- if (peripheral_reg === 49153 && byte === 224)
5381
+ if (vg75_reg === 49153 && byte === 224)
5270
5382
  return;
5271
- if (peripheral_reg === 49153 && byte === 128) {
5383
+ if (vg75_reg === 49153 && byte === 128) {
5272
5384
  this.vg75_c001_80_cmd = 1;
5273
5385
  return;
5274
5386
  }
5275
- if (peripheral_reg === 49152 && this.vg75_c001_80_cmd === 1) {
5387
+ if (vg75_reg === 49152 && this.vg75_c001_80_cmd === 1) {
5276
5388
  this.vg75_c001_80_cmd += 1;
5277
5389
  this.cursor_x_buf = byte + 1;
5278
5390
  return;
5279
5391
  }
5280
- if (peripheral_reg === 49152 && this.vg75_c001_80_cmd === 2) {
5392
+ if (vg75_reg === 49152 && this.vg75_c001_80_cmd === 2) {
5281
5393
  this.cursor_y_buf = byte + 1;
5282
5394
  this.machine.screen.set_cursor(this.cursor_x_buf - 1, this.cursor_y_buf - 1);
5283
5395
  this.video_screen_cursor_x = this.cursor_x_buf;
@@ -5285,30 +5397,30 @@ class Memory {
5285
5397
  this.vg75_c001_80_cmd = 0;
5286
5398
  return;
5287
5399
  }
5288
- if (peripheral_reg === 49153 && byte === 96) {
5400
+ if (vg75_reg === 49153 && byte === 96) {
5289
5401
  if (this.machine.screen.light_pen_active)
5290
5402
  this.vg75_c001_60_cmd = 1;
5291
5403
  return;
5292
5404
  }
5293
- if (peripheral_reg === 49153 && byte === 0) {
5405
+ if (vg75_reg === 49153 && byte === 0) {
5294
5406
  this.vg75_c001_00_cmd = 1;
5295
5407
  return;
5296
5408
  }
5297
- if (peripheral_reg === 49152 && this.vg75_c001_00_cmd === 1) {
5409
+ if (vg75_reg === 49152 && this.vg75_c001_00_cmd === 1) {
5298
5410
  this.video_screen_size_x_buf = (byte & 127) + 1;
5299
5411
  this.vg75_c001_00_cmd += 1;
5300
5412
  return;
5301
5413
  }
5302
- if (peripheral_reg === 49152 && this.vg75_c001_00_cmd === 2) {
5414
+ if (vg75_reg === 49152 && this.vg75_c001_00_cmd === 2) {
5303
5415
  this.video_screen_size_y_buf = (byte & 63) + 1;
5304
5416
  this.vg75_c001_00_cmd += 1;
5305
5417
  return;
5306
5418
  }
5307
- if (peripheral_reg === 49152 && this.vg75_c001_00_cmd === 3) {
5419
+ if (vg75_reg === 49152 && this.vg75_c001_00_cmd === 3) {
5308
5420
  this.vg75_c001_00_cmd += 1;
5309
5421
  return;
5310
5422
  }
5311
- if (peripheral_reg === 49152 && this.vg75_c001_00_cmd === 4) {
5423
+ if (vg75_reg === 49152 && this.vg75_c001_00_cmd === 4) {
5312
5424
  this.vg75_c001_00_cmd = 0;
5313
5425
  if (this.video_screen_size_x_buf && this.video_screen_size_y_buf) {
5314
5426
  this.video_screen_size_x = this.video_screen_size_x_buf;
@@ -5317,27 +5429,28 @@ class Memory {
5317
5429
  }
5318
5430
  return;
5319
5431
  }
5320
- if (peripheral_reg === 57352 && byte === 128) {
5432
+ if (vt57_reg === 57352 && byte === 128) {
5321
5433
  this.ik57_e008_80_cmd = 1;
5434
+ this.ik57_ff = 0;
5322
5435
  this.tape_8002_as_output = 1;
5323
5436
  return;
5324
5437
  }
5325
- if (peripheral_reg === 57348 && this.ik57_e008_80_cmd === 1) {
5438
+ if (vt57_reg === 57348 && this.ik57_e008_80_cmd === 1) {
5326
5439
  this.video_memory_base_buf = byte;
5327
5440
  this.ik57_e008_80_cmd += 1;
5328
5441
  return;
5329
5442
  }
5330
- if (peripheral_reg === 57348 && this.ik57_e008_80_cmd === 2) {
5443
+ if (vt57_reg === 57348 && this.ik57_e008_80_cmd === 2) {
5331
5444
  this.video_memory_base_buf |= byte << 8;
5332
5445
  this.ik57_e008_80_cmd += 1;
5333
5446
  return;
5334
5447
  }
5335
- if (peripheral_reg === 57349 && this.ik57_e008_80_cmd === 3) {
5448
+ if (vt57_reg === 57349 && this.ik57_e008_80_cmd === 3) {
5336
5449
  this.video_memory_size_buf = byte;
5337
5450
  this.ik57_e008_80_cmd += 1;
5338
5451
  return;
5339
5452
  }
5340
- if (peripheral_reg === 57349 && this.ik57_e008_80_cmd === 4) {
5453
+ if (vt57_reg === 57349 && this.ik57_e008_80_cmd === 4) {
5341
5454
  this.video_memory_size_buf = ((this.video_memory_size_buf | byte << 8) & 16383) + 1;
5342
5455
  this.ik57_e008_80_cmd = 0;
5343
5456
  this.video_memory_base = this.video_memory_base_buf;
@@ -5345,11 +5458,34 @@ class Memory {
5345
5458
  this.machine.screen.set_video_memory(this.video_memory_base);
5346
5459
  return;
5347
5460
  }
5348
- if (peripheral_reg === 57352 && byte === 164) {
5461
+ if (vt57_reg === 57352 && byte === 164) {
5349
5462
  this.tape_8002_as_output = 0;
5350
5463
  return;
5351
5464
  }
5352
- if (addr === 32770) {
5465
+ if (vt57_reg === 57348 && this.ik57_e008_80_cmd === 0) {
5466
+ if (this.ik57_ff === 0) {
5467
+ this.video_memory_base_buf = this.video_memory_base & 65280 | byte;
5468
+ this.ik57_ff = 1;
5469
+ } else {
5470
+ this.video_memory_base = this.video_memory_base_buf & 255 | byte << 8;
5471
+ this.video_memory_base_buf = this.video_memory_base;
5472
+ this.machine.screen.set_video_memory(this.video_memory_base);
5473
+ this.ik57_ff = 0;
5474
+ }
5475
+ return;
5476
+ }
5477
+ if (vt57_reg === 57349 && this.ik57_e008_80_cmd === 0) {
5478
+ if (this.ik57_ff === 0) {
5479
+ this.video_memory_size_buf = byte;
5480
+ this.ik57_ff = 1;
5481
+ } else {
5482
+ this.video_memory_size = ((this.video_memory_size_buf | byte << 8) & 16383) + 1;
5483
+ this.video_memory_size_buf = this.video_memory_size;
5484
+ this.ik57_ff = 0;
5485
+ }
5486
+ return;
5487
+ }
5488
+ if (ppi_reg === 32770) {
5353
5489
  if (this.tape_8002_as_output) {
5354
5490
  this.tape_write_bit(byte & 1);
5355
5491
  }
@@ -6370,10 +6506,21 @@ function dumpScreen(machine) {
6370
6506
  const { memory, screen } = machine;
6371
6507
  const lines = [];
6372
6508
  let addr = screen.video_memory_base;
6509
+ let frameStopped = false;
6373
6510
  for (let y = 0;y < screen.height; y++) {
6374
6511
  let line = "";
6512
+ let rowStopped = frameStopped;
6375
6513
  for (let x = 0;x < screen.width; x++) {
6376
- const byte = memory.read_raw(addr++) & 127;
6514
+ const raw = memory.read_raw(addr++);
6515
+ if (rowStopped || raw >= 240) {
6516
+ line += ".";
6517
+ if (raw >= 240)
6518
+ rowStopped = true;
6519
+ if (raw >= 248)
6520
+ frameStopped = true;
6521
+ continue;
6522
+ }
6523
+ const byte = raw & 127;
6377
6524
  if (byte === 0 || byte === 9 || byte === 10 || byte === 13) {
6378
6525
  line += ".";
6379
6526
  } else {