mirror of
https://github.com/joncampbell123/dosbox-x.git
synced 2025-10-13 17:48:10 +08:00
fix for COM port
This commit is contained in:
@@ -427,7 +427,6 @@ private:
|
||||
|
||||
extern CSerial* serialports[];
|
||||
const uint8_t serial_defaultirq[] = { 4, 3, 4, 3, 0, 0, 0, 0, 0 };
|
||||
const uint16_t serial_baseaddr[] = {0x3f8,0x2f8,0x3e8,0x2e8,0,0,0,0,0};
|
||||
const char* const serial_comname[]={"COM1","COM2","COM3","COM4","COM5","COM6","COM7","COM8","COM9"};
|
||||
|
||||
// the COM devices
|
||||
|
@@ -98,10 +98,9 @@ device_COM::~device_COM() {
|
||||
sclass->mydosdevice = NULL;
|
||||
}
|
||||
|
||||
|
||||
|
||||
// COM1 - COM4 objects
|
||||
// COM1 - COM9 objects
|
||||
CSerial* serialports[9] ={0,0,0,0,0,0,0,0,0};
|
||||
uint16_t serial_baseaddr[9] = {0x3f8,0x2f8,0x3e8,0x2e8,0,0,0,0,0};
|
||||
|
||||
static Bitu SERIAL_Read (Bitu port, Bitu iolen) {
|
||||
(void)iolen;//UNUSED
|
||||
@@ -1122,7 +1121,10 @@ CSerial::CSerial(Bitu id, CommandLine* cmd) {
|
||||
|
||||
std::string str;
|
||||
uint16_t base = serial_baseaddr[id];
|
||||
if(cmd->FindStringBegin("base:",str,true)) base = (uint16_t)strtol(str.c_str(), NULL, 16);
|
||||
if(cmd->FindStringBegin("base:",str,true)) {
|
||||
base = (uint16_t)strtol(str.c_str(), NULL, 16);
|
||||
serial_baseaddr[id] = base;
|
||||
}
|
||||
irq = serial_defaultirq[id];
|
||||
getBituSubstring("irq:",&irq, cmd);
|
||||
if (irq < 2 || irq > 15) irq = serial_defaultirq[id];
|
||||
@@ -1175,6 +1177,7 @@ CSerial::CSerial(Bitu id, CommandLine* cmd) {
|
||||
txOverrunErrors=0;
|
||||
overrunIF0=0;
|
||||
breakErrors=0;
|
||||
LOG_MSG("Serial%d: BASE %xh",(int)id+1,(int)base);
|
||||
|
||||
for (Bitu i = 0; i <= 7; i++) {
|
||||
WriteHandler[i].Install (i + base, SERIAL_Write, IO_MB);
|
||||
|
Reference in New Issue
Block a user