Skip to content

Commit

Permalink
Port relevant bits from
Browse files Browse the repository at this point in the history
- 46b2a88fdadd618e48eb7e0dc52abc1abf37ef51
- 73b8ffa32629eca039fc13f0e3cb42b1c3a38d9f

- 8c1e0cae82f42189d45eca39730d672885bb1816
  • Loading branch information
RaymiiOrg authored May 4, 2024
1 parent 7a3e8c5 commit 09b9e88
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 17 deletions.
16 changes: 13 additions & 3 deletions src/S3Trio64.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,7 @@ void CS3Trio64::init() {
state.sequencer.sr9 = 0; // Extended Sequencer Register 9 (SR9)
state.sequencer.srA = 0; // External Bus Request Control (SRA)
state.sequencer.srB = 0; // Miscellaneous Extended Sequencer Register (SRB)
state.sequencer.srD = 0; // Extended Sequencer Register (EX_SR_D) (SRD) 00H poweron
state.sequencer.sr10 = 0; // CLK Value Low Register (UNLK_EXSR) (SR10)
state.sequencer.sr11 = 0; // MCLK Value High Register (SR11)
state.sequencer.sr12 = 0; // DCLK Value Low Register (SR12)
Expand Down Expand Up @@ -2774,6 +2775,12 @@ u8 CS3Trio64::read_b_3c5() {
case 0xA: // External Bus Request Control Register (SRA)
return state.sequencer.srA;

case 0x0b:
return state.sequencer.srB;

case 0x0D:
return state.sequencer.srD;

case 0x10: /* sequencer: SR10 */
return state.sequencer.sr10;

Expand All @@ -2783,6 +2790,9 @@ u8 CS3Trio64::read_b_3c5() {
case 0x15:
return state.sequencer.sr15;

case 0x18:
return state.sequencer.sr18;

default:
printf("FAIL VGA: 3c5 READ INDEX=0x%02x %d\n", state.sequencer.index, state.sequencer.index);
FAILURE_1(NotImplemented, "io read 0x3c5: index %u unhandled",
Expand Down Expand Up @@ -2931,9 +2941,9 @@ u8 CS3Trio64::read_b_3d4() { return state.CRTC.address; }
* For a description of CRTC Registers, see CCirrus::write_b_3d4.
**/
u8 CS3Trio64::read_b_3d5() {
if((state.CRTC.address > 0x18) && (state.CRTC.address != 0x2e) && (state.CRTC.address != 0x2f) && (state.CRTC.address != 0x36) && \
(state.CRTC.address != 0x40) && (state.CRTC.address != 0x42) && (state.CRTC.address != 0x30) && (state.CRTC.address != 0x6b) && \
(state.CRTC.address != 0x6c) && (state.CRTC.address != 0x67))
if((state.CRTC.address > 0x70) && (state.CRTC.address != 0x2e) && (state.CRTC.address != 0x2f) && (state.CRTC.address != 0x36) &&
(state.CRTC.address != 0x40) && (state.CRTC.address != 0x42) && (state.CRTC.address != 0x30) && (state.CRTC.address != 0x31) &&
(state.CRTC.address != 0x32) && (state.CRTC.address != 0x6b) && (state.CRTC.address != 0x6c) && (state.CRTC.address != 0x67))
{
FAILURE_1(NotImplemented, "io read: invalid CRTC register 0x%02x \n",
(unsigned)state.CRTC.address);
Expand Down
1 change: 1 addition & 0 deletions src/S3Trio64.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,7 @@ class CS3Trio64 : public CVGA {
u8 sr8; // unlock extended sequencer (SR8)
u8 srA; // External Bus Request Control (SRA)
u8 srB; // Miscellaneous Extended Sequencer Register (SRB)
u8 srD; // Extended Sequencer Register (EX_SR_D) (SRD)
u8 sr10; // CLK Value Low Register (UNLK_EXSR) (SR10)
u8 sr11; // MCLK Value High Register (SR11)
u8 sr12; // DCLK Value Low Register (SR12)
Expand Down
31 changes: 17 additions & 14 deletions src/Serial.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -639,23 +639,26 @@ void CSerial::WaitForConnection() {

state.serial_cycles = 0;

// Send some control characters to the telnet client to handle
// character-at-a-time mode.
sprintf(buffer, telnet_options, IAC, DO, TELOPT_ECHO);
this->write(buffer);
if (state.iNumber != 1) // don't send if serial #1, kgdb support
{
// Send some control characters to the telnet client to handle
// character-at-a-time mode.
sprintf(buffer, telnet_options, IAC, DO, TELOPT_ECHO);
this->write(buffer);

sprintf(buffer, telnet_options, IAC, DO, TELOPT_NAWS);
write(buffer);
sprintf(buffer, telnet_options, IAC, DO, TELOPT_NAWS);
write(buffer);

sprintf(buffer, telnet_options, IAC, DO, TELOPT_LFLOW);
this->write(buffer);
sprintf(buffer, telnet_options, IAC, DO, TELOPT_LFLOW);
this->write(buffer);

sprintf(buffer, telnet_options, IAC, WILL, TELOPT_ECHO);
this->write(buffer);
sprintf(buffer, telnet_options, IAC, WILL, TELOPT_ECHO);
this->write(buffer);

sprintf(buffer, telnet_options, IAC, WILL, TELOPT_SGA);
this->write(buffer);
sprintf(buffer, telnet_options, IAC, WILL, TELOPT_SGA);
this->write(buffer);

sprintf(s, "This is serial port #%d on ES40 Emulator\r\n", state.iNumber);
this->write(s);
sprintf(s, "This is serial port #%d on the AXPBox Emulator\r\n", state.iNumber);
this->write(s);
}
}

0 comments on commit 09b9e88

Please sign in to comment.