diff --git a/blog/2015/06/01/README.md b/blog/2015/06/01/README.md index ef3966f04..695f921fb 100644 --- a/blog/2015/06/01/README.md +++ b/blog/2015/06/01/README.md @@ -61,5 +61,87 @@ material is extremely vague: I've hard-coded a solution that assumes a color monitor. Support for using a monochrome monitor with an EGA was never completed, and this is another related issue that will have to be resolved for the VGA as well. +--- + +Another problem: during IBM VGA ROM initialization, a "missing readByte handler" warning occurs. + + Card.setMemoryAccess(0x1510): missing readByte handler + stopped (2351185 ops, 7740201 cycles, 1617 ms, 4786766 hz) + EAX=00000204 EBX=0000194A ECX=00000001 EDX=000003C4 + ESP=000000C4 EBP=FFFF0000 ESI=00000000 EDI=000003D4 + SS=0030 DS=0000 ES=C000 FS=0000 GS=0304 PS=00000002 V0 D0 I0 T0 S0 Z0 A0 P0 C0 + C000:1205 FEC0 INC AL + +Before debugging this though, I decided to first make a table of all the register values for most of the modes that +the IBM VGA supports: + + INT 0x10 Mode Requested: 0x00 0x01 0x02 0x03 0x04 0x05 0x06 0x0D 0x0E 0x10 0x12 + + BIOSMODE: 0x01 0x01 0x03 0x03 0x04 0x04 0x06 0x12 0x12 0x12 0x12 + CRTC[0x00]: HORZ_TOTAL 0x2D 0x2D 0x5F 0x5F 0x2D 0x2D 0x5F 0x2D 0x5F 0x5F 0x5F + CRTC[0x01]: HORZ_DISP_END 0x27 0x27 0x4F 0x4F 0x27 0x27 0x4F 0x27 0x4F 0x4F 0x4F + CRTC[0x02]: HORZ_BLANK_START 0x28 0x28 0x50 0x50 0x28 0x28 0x50 0x28 0x50 0x50 0x50 + CRTC[0x03]: HORZ_BLANK_END 0x90 0x90 0x82 0x82 0x90 0x90 0x82 0x90 0x82 0x82 0x82 + CRTC[0x04]: HORZ_RETRACE_START 0x2B 0x2B 0x55 0x55 0x2B 0x2B 0x54 0x2B 0x54 0x54 0x54 + CRTC[0x05]: HORZ_RETRACE_END 0xA0 0xA0 0x81 0x81 0x80 0x80 0x80 0x80 0x80 0x80 0x80 + CRTC[0x06]: VERT_TOTAL 0xBF 0xBF 0xBF 0xBF 0xBF 0xBF 0xBF 0xBF 0xBF 0xBF 0x0B + CRTC[0x07]: OVERFLOW 0x1F 0x1F 0x1F 0x1F 0x1F 0x1F 0x1F 0x1F 0x1F 0x1F 0x3E + CRTC[0x08]: PRESET_ROW_SCAN 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 + CRTC[0x09]: MAX_SCAN_LINE 0x4F 0x4F 0x4F 0x4F 0xC1 0xC1 0xC1 0xC0 0xC0 0x40 0x40 + CRTC[0x0A]: CURSOR_START 0x0D 0x0D 0x0D 0x0D 0x00 0x00 0x00 0x00 0x00 0x00 0x00 + CRTC[0x0B]: CURSOR_END 0x0E 0x0E 0x0E 0x0E 0x00 0x00 0x00 0x00 0x00 0x00 0x00 + CRTC[0x0C]: START_ADDR_HI 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 + CRTC[0x0D]: START_ADDR_LO 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 + CRTC[0x0E]: CURSOR_ADDR_HI 0x01 0x01 0x01 0x01 0x01 0x01 0x01 0x01 0x01 0x01 0x01 + CRTC[0x0F]: CURSOR_ADDR_LO 0x19 0x19 0x41 0x41 0x19 0x19 0x41 0x19 0x41 0x41 0xE1 + CRTC[0x10]: VERT_RETRACE_START 0x9C 0x9C 0x9C 0x9C 0x9C 0x9C 0x9C 0x9C 0x9C 0x83 0xEA + CRTC[0x11]: VERT_RETRACE_END 0x8E 0x8E 0x8E 0x8E 0x8E 0x8E 0x8E 0x8E 0x8E 0x85 0x8C + CRTC[0x12]: VERT_DISP_END 0x8F 0x8F 0x8F 0x8F 0x8F 0x8F 0x8F 0x8F 0x8F 0x5D 0xDF + CRTC[0x13]: OFFSET 0x14 0x14 0x28 0x28 0x14 0x14 0x28 0x14 0x28 0x28 0x28 + CRTC[0x14]: UNDERLINE 0x1F 0x1F 0x1F 0x1F 0x00 0x00 0x00 0x00 0x00 0x0F 0x00 + CRTC[0x15]: VERT_BLANK_START 0x96 0x96 0x96 0x96 0x96 0x96 0x96 0x96 0x96 0x63 0xE7 + CRTC[0x16]: VERT_BLANK_END 0xB9 0xB9 0xB9 0xB9 0xB9 0xB9 0xB9 0xB9 0xB9 0xBA 0x04 + CRTC[0x17]: MODE_CTRL 0xA3 0xA3 0xA3 0xA3 0xA2 0xA2 0xC2 0xE3 0xE3 0xE3 0xE3 + CRTC[0x18]: LINE_COMPARE 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF + GRC[0x00]: SRESET 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 + GRC[0x01]: ESRESET 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 + GRC[0x02]: COLORCMP 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 + GRC[0x03]: DATAROT 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 + GRC[0x04]: READMAP 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 + GRC[0x05]: MODE 0x10 0x10 0x10 0x10 0x30 0x30 0x00 0x00 0x00 0x00 0x00 + GRC[0x06]: MISC 0x0E 0x0E 0x0E 0x0E 0x0F 0x0F 0x0D 0x05 0x05 0x05 0x05 + GRC[0x07]: COLORDC 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x0F 0x0F 0x0F 0x0F + GRC[0x08]: BITMASK 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF + SEQ[0x00]: RESET 0x03 0x03 0x03 0x03 0x03 0x03 0x03 0x03 0x03 0x03 0x03 + SEQ[0x01]: CLOCKING 0x08 0x08 0x00 0x00 0x09 0x09 0x01 0x09 0x01 0x01 0x01 + SEQ[0x02]: MAPMASK 0x03 0x03 0x03 0x03 0x03 0x03 0x01 0x0F 0x0F 0x0F 0x0F + SEQ[0x03]: CHARMAP 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 + SEQ[0x04]: MEMMODE 0x03 0x03 0x03 0x03 0x02 0x02 0x06 0x06 0x06 0x06 0x06 + ATC[0x00]: PAL00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 + ATC[0x01]: PAL01 0x01 0x01 0x01 0x01 0x13 0x13 0x17 0x01 0x01 0x01 0x01 + ATC[0x02]: PAL02 0x02 0x02 0x02 0x02 0x15 0x15 0x17 0x02 0x02 0x02 0x02 + ATC[0x03]: PAL03 0x03 0x03 0x03 0x03 0x17 0x17 0x17 0x03 0x03 0x03 0x03 + ATC[0x04]: PAL04 0x04 0x04 0x04 0x04 0x02 0x02 0x17 0x04 0x04 0x04 0x04 + ATC[0x05]: PAL05 0x05 0x05 0x05 0x05 0x04 0x04 0x17 0x05 0x05 0x05 0x05 + ATC[0x06]: PAL06 0x14 0x14 0x14 0x14 0x06 0x06 0x17 0x06 0x06 0x14 0x14 + ATC[0x07]: PAL07 0x07 0x07 0x07 0x07 0x07 0x07 0x17 0x07 0x07 0x07 0x07 + ATC[0x08]: PAL08 0x38 0x38 0x38 0x38 0x10 0x10 0x17 0x10 0x10 0x38 0x38 + ATC[0x09]: PAL09 0x39 0x39 0x39 0x39 0x11 0x11 0x17 0x11 0x11 0x39 0x39 + ATC[0x0A]: PAL0A 0x3A 0x3A 0x3A 0x3A 0x12 0x12 0x17 0x12 0x12 0x3A 0x3A + ATC[0x0B]: PAL0B 0x3B 0x3B 0x3B 0x3B 0x13 0x13 0x17 0x13 0x13 0x3B 0x3B + ATC[0x0C]: PAL0C 0x3C 0x3C 0x3C 0x3C 0x14 0x14 0x17 0x14 0x14 0x3C 0x3C + ATC[0x0D]: PAL0D 0x3D 0x3D 0x3D 0x3D 0x15 0x15 0x17 0x15 0x15 0x3D 0x3D + ATC[0x0E]: PAL0E 0x3E 0x3E 0x3E 0x3E 0x16 0x16 0x17 0x16 0x16 0x3E 0x3E + ATC[0x0F]: PAL0F 0x3F 0x3F 0x3F 0x3F 0x17 0x17 0x17 0x17 0x17 0x3F 0x3F + ATC[0x10]: MODE 0x0C 0x0C 0x0C 0x0C 0x01 0x01 0x01 0x01 0x01 0x01 0x01 + ATC[0x11]: OVERSCAN 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 + ATC[0x12]: PLANES 0x0F 0x0F 0x0F 0x0F 0x03 0x03 0x01 0x0F 0x0F 0x0F 0x0F + ATC[0x13]: HORZPAN 0x08 0x08 0x08 0x08 0x00 0x00 0x00 0x00 0x00 0x00 0x00 + +In the process of building this table, I also discovered that INT 0x10 mode 0x0D display is garbled, and that all +graphics modes >= 0x0D are misdetected as BIOSMODE 0x12. + +All these issues are under investigation. + *[@jeffpar](http://twitter.com/jeffpar)* *June 1, 2015* diff --git a/modules/pcjs/lib/debugger.js b/modules/pcjs/lib/debugger.js index ae6fca070..2d2f3d2b0 100644 --- a/modules/pcjs/lib/debugger.js +++ b/modules/pcjs/lib/debugger.js @@ -5069,7 +5069,7 @@ if (DEBUGGER) { this.setTempBreakpoint(dbgAddr); } if (!this.runCPU(true)) { - this.println('cpu not available, "g" command ignored'); + this.println('cpu busy, "g" command ignored'); } }; diff --git a/modules/pcjs/lib/video.js b/modules/pcjs/lib/video.js index 6e3c4c768..c171cff0b 100644 --- a/modules/pcjs/lib/video.js +++ b/modules/pcjs/lib/video.js @@ -2190,11 +2190,14 @@ Card.prototype.dumpRegs = function(sName, iReg, aRegs, asRegs) this.dbg.println(sName + ": " + str.toHexByte(iReg)); return; } + var i, cchMax = 19, s = ""; + /* var s = "", i, cchMax = 0; for (i = 0; i < asRegs.length; i++) { if (cchMax < asRegs[i].length) cchMax = asRegs[i].length; } cchMax++; + */ for (i = 0; i < asRegs.length; i++) { if (s) s += '\n'; s += sName + "[" + str.toHexByte(i) + "]: " + str.pad(asRegs[i], cchMax) + str.toHexByte(aRegs[i]) + (i === iReg? "*" : ""); @@ -2216,24 +2219,30 @@ Card.prototype.dumpCard = function() */ this.dumpRegs("CRTC", this.regCRTIndx, this.regCRTData, this.asCRTCRegs); - if (this.nCard == Video.CARD.MDA || this.nCard == Video.CARD.CGA) { - this.dumpRegs(" MODEREG", this.regMode); + if (this.nCard >= Video.CARD.EGA) { + this.dumpRegs(" GRC", this.regGRCIndx, this.regGRCData, this.asGRCRegs); + this.dumpRegs(" SEQ", this.regSEQIndx, this.regSEQData, this.asSEQRegs); + this.dumpRegs(" ATC", this.regATCIndx, this.regATCData, this.asATCRegs); + this.dbg.println(" ATCDATA: " + this.fATCData); + this.dumpRegs(" FEAT", this.regFeat); + this.dumpRegs(" MISC", this.regMisc); + this.dumpRegs(" STATUS0", this.regStatus0); + /* + * There are few more EGA regs we could dump, like GRCPos1, GRCPos2, but does anyone care? + */ } this.dumpRegs(" STATUS1", this.regStatus); + if (this.nCard == Video.CARD.MDA || this.nCard == Video.CARD.CGA) { + this.dumpRegs(" MODEREG", this.regMode); + } + if (this.nCard == Video.CARD.CGA) { this.dumpRegs(" COLOR", this.regColor); } if (this.nCard >= Video.CARD.EGA) { - this.dbg.println(" ATCDATA: " + this.fATCData); - this.dumpRegs(" ATC", this.regATCIndx, this.regATCData, this.asATCRegs); - this.dumpRegs(" GRC", this.regGRCIndx, this.regGRCData, this.asGRCRegs); - this.dumpRegs(" SEQ", this.regSEQIndx, this.regSEQData, this.asSEQRegs); - this.dumpRegs(" FEAT", this.regFeat); - this.dumpRegs(" MISC", this.regMisc); - this.dumpRegs(" STATUS0", this.regStatus0); this.dbg.println(" LATCHES: 0x" + str.toHex(this.latches)); this.dbg.println(" ACCESS: " + str.toHexWord(this.nAccess)); this.dbg.println("Use 'dump video [addr]' to dump video memory");