1
0
mirror of https://github.com/pkimpel/retro-b5500.git synced 2026-02-11 10:55:09 +00:00

Implement BIC/BCLANSI translation in B5500ColdLoader and do disk writes in alpha mode; fix typos in DCMCP transcription.

This commit is contained in:
paul
2013-02-25 12:48:07 +00:00
parent 4858c324a1
commit e769899afe
3 changed files with 55 additions and 17 deletions

View File

@@ -19828,7 +19828,7 @@ SVSEARCH: IF (LOC:=LINK.[CF])=0 THEN GO TO ROCKABYE; 24033200
FORGETSPACE(Y+2);% 24035900
END;% 24036000
END ELSE 24036100
OF SAVEF}63 OR TOGLE.MEMNO=0 THEN 24036125
IF SAVEF}63 OR TOGLE.MEMNO=0 THEN 24036125
BEGIN% ALLOCATE ON "SPACE AVAILABLE" BASIS 24036150
START:% 24036200
IF (LINK ~ POLISH(M[AVAIL], 0, SIZE, CFX, LLL,% 24036300
@@ -20608,7 +20608,7 @@ PROCEDURE LIBRARYTRANSFER; 28200000
% 28200108
% TOGS.[21:1] (BHS) INDICATES BAD HEADER 28200110
% [23:1] (FORKED) NOT ORIGINATING LIBMAIN/DISK 28200112
% [26:1] (OF) CURRENT <MFID>/<FID> HAS BEEN 28200114
% [26:1] (OE) CURRENT <MFID>/<FID> HAS BEEN 28200114
% OPENED EXCLUSIVE 28200116
% 28200118
% [28:1] (SOMECOPIED) AT LEAST ONE FILE HAS BEEN 28200120
@@ -20664,7 +20664,7 @@ BEGIN 28200200
BHS = TOGS.[21:1]#, 28208400
FORKED = TOGS.[23:1]#, 28208600
B6500 = TOGS.[24:1]#, 28208800
OF = TOGS.[26:1]#, 28209000
OE = TOGS.[26:1]#, 28209000
SOMECOPIED = TOGS.[28:1]#, 28209100
REELSW = TOGS.[33:1]#, 28209200
SKIPDIR = TOGS.[35:1]#, 28209400
@@ -20789,7 +20789,7 @@ PRE: SPOUT(T); T:=1; 28219200
IF IOD[W].[24:1] 28234800
THEN TMP:=TMP+B6500 28235000
ELSE BEGIN SIZE:=SIZE+B6500; WRDSZ[W]:=SIZE; END; 28235200
IOREQUEST(-(IOD[W]:=9AROW[W] INX TMP)& 28235400
IOREQUEST(-(IOD[W]:=(AROW[W] INX TMP)& 28235400
SIZE[8:38:10]& 28235600
TINU[U][3:3:5]& 28235800
(NOT IOD[W])[24:24:1]) OR @2017700000, 28236000

View File

@@ -652,7 +652,7 @@ B5500IOUnit.prototype.initiateDiskIO = function(u) {
/**************************************/
B5500IOUnit.prototype.forkIO = function forkIO() {
/* Asychrounously nitiates an I/O operation on this I/O Unit for a peripheral device */
/* Asynchronously initiates an I/O operation on this I/O Unit for a peripheral device */
var addr; // memory address
var chars; // I/O memory transfer length
var index; // unit index

View File

@@ -79,7 +79,7 @@ window.onload = function() {
blockCount: 0,
blockLength: 0};
var BICtoANSI = [ // Index by 6-bit BIC to get ANSI character
var BICtoANSIChar = [ // Index by 6-bit BIC to get ANSI character
"0", "1", "2", "3", "4", "5", "6", "7",
"8", "9", "#", "@", "?", ":", ">", "}",
"+", "A", "B", "C", "D", "E", "F", "G",
@@ -89,7 +89,7 @@ window.onload = function() {
" ", "/", "S", "T", "U", "V", "W", "X",
"Y", "Z", ",", "%", "!", "=", "]", "\""];
var BICtoANSICode = [ // Index by 6-bit BIC to get 8-bit ANSI code
var BICtoANSI = [ // Index by 6-bit BIC to get 8-bit ANSI code
0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37, // 00-07, @00-07
0x38,0x39,0x23,0x40,0x3F,0x3A,0x3E,0x7D, // 08-1F, @10-17
0x2B,0x41,0x42,0x43,0x44,0x45,0x46,0x47, // 10-17, @20-27
@@ -99,6 +99,16 @@ window.onload = function() {
0x20,0x2F,0x53,0x54,0x55,0x56,0x57,0x58, // 30-37, @60-67
0x59,0x5A,0x2C,0x25,0x21,0x3D,0x5D,0x23]; // 38-3F, @70-77
var BICtoBCLANSI = [ // Index by 6-bit BIC to get 8-bit BCL-as-ANSI code
0x23,0x31,0x32,0x33,0x34,0x35,0x36,0x37, // 00-07, @00-07
0x38,0x39,0x40,0x3F,0x30,0x3A,0x3E,0x7D, // 08-1F, @10-17
0x2C,0x2F,0x53,0x54,0x55,0x56,0x57,0x58, // 10-17, @20-27
0x59,0x5A,0x25,0x21,0x20,0x3D,0x5D,0x22, // 18-1F, @30-37
0x24,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F,0x50, // 20-27, @40-47
0x51,0x52,0x2A,0x2D,0x7C,0x29,0x3B,0x7B, // 28-2F, @50-57
0x2B,0x41,0x42,0x43,0x44,0x45,0x46,0x47, // 30-37, @60-67
0x48,0x49,0x5B,0x26,0x2E,0x28,0x3C,0x7E]; // 38-3F, @70-77
var ANSItoBIC = [ // Index by 8-bit ANSI to get 6-bit BIC (upcased, invalid=>"?")
0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C, // 00-0F
0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C, // 10-1F
@@ -117,6 +127,24 @@ window.onload = function() {
0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C, // E0-EF
0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C]; // F0-FF
var BCLANSItoBIC = [ // Index by 8-bit BCL-as-ANSI to get 6-bit BIC (upcased, invalid=>"?")
0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C, // 00-0F
0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C, // 10-1F
0x1C,0x1B,0x1F,0x00,0x20,0x1A,0x3B,0x0C,0x3D,0x2D,0x2A,0x30,0x10,0x2B,0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x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C]; // F0-FF
var pow2 = [ // powers of 2 from 0 to 52
0x1, 0x2, 0x4, 0x8,
0x10, 0x20, 0x40, 0x80,
@@ -232,22 +260,27 @@ window.onload = function() {
/* Translates an array of B5500 words to ANSI byte-array format.
"words" = the array of words
"wx" = the starting index in "words"
"wLength" = the number of words to translate
"wLength" = the number of words to translate: if this is negative, then binary
translation is done; otherwise B5500 BCLANSI translation is done
"bytes" = a Uint8Array array
"bx" = the starting index in "bytes" to store the translated data */
var c;
var table = (wLength < 0 ? BICtoANSI : BICtoBCLANSI);
var w;
var x;
var y;
var z;
bx = bx || 0;
if (wLength < 0) {
wLength = -wLength;
}
for (x=0; x<wLength; x++) {
w = words[wx+x] || 0;
for (y=0; y<8; y++) {
z = w % 0x40000000000;
c = (w-z)/0x40000000000;
bytes[bx++] = BICtoANSICode[c];
bytes[bx++] = table[c];
w = z*64;
}
}
@@ -258,20 +291,25 @@ window.onload = function() {
/* Translates a portion of an ANSI byte array to a sequence of B5500 words.
"bytes" = the Uint8Array byte array
"bx" = 0-relative offset into "bytes"
"bLength" = number of bytes to translate
"bLength" = number of bytes to translate: if this is negative, then binary
translation is done; otherwise B5500 BCLANSI translation is done
"words" = the word array
"wx" = 0-relative offset into "words" to store the translated data */
var cx = 0;
var w = 0;
var table = (bLength < 0 ? ANSItoBIC : BCLANSItoBIC);
var x;
wx = wx || 0;
if (bLength < 0) {
bLength = -bLength;
}
for (x=0; x<bLength; x++) {
if (cx >= 8) {
words[wx++] = w;
w = cx = 0;
}
w = w*64 + ANSItoBIC[bytes[bx+x]];
w = w*64 + table[bytes[bx+x]];
cx++;
}
while (cx++ < 8) {
@@ -449,7 +487,7 @@ window.onload = function() {
ctl.blockLength = 0;
} else {
do {
text += BICtoANSI[c & 0x3F];
text += BICtoANSIChar[c & 0x3F];
if (++x < limit) {
c = data.getUint8(x);
} else {
@@ -1013,7 +1051,7 @@ window.onload = function() {
fid = "0" + padToLength(nameParts[1] || " ", 7);
stringToANSI(mfid, buf, 0);
stringToANSI(fid, buf, 8);
ANSItoWords(buf, 0, 16, names, 0);
ANSItoWords(buf, 0, -16, names, 0);
mfid = names[0];
fid = names[1];
loadAsMCP = $$("AsMCP_" + fileNr).checked;
@@ -1412,10 +1450,10 @@ window.onload = function() {
w[23] = parseInt("0000000000000000", 8);
w[24] = parseInt("0000000000000000", 8);
w[25] = parseInt("0000000000000000", 8);
w[26] = parseInt("0000000000000000", 8);
w[27] = parseInt("7660000000000022", 8);
w[28] = parseInt("7560000000000371", 8);
w[29] = parseInt("7560000000000400", 8);
w[26] = parseInt("7560020000000367", 8);
w[27] = parseInt("7660220000000022", 8);
w[28] = parseInt("7560070000000371", 8);
w[29] = parseInt("7560140000000400", 8);
wordsToANSI(w, 0, 30, buffer, 0);
eu.put(buffer, addr++);