Increased maximum number of timers to 64;
Redid some things in serial_old.c; Made win_serial.c only compile and link if make is started with WALTJE=y; The NVR path text box in the Settings dialog now has ES_AUTOHSCROLL set.
This commit is contained in:
@@ -133,6 +133,7 @@ endif
|
|||||||
|
|
||||||
ifeq ($(WALTJE), y)
|
ifeq ($(WALTJE), y)
|
||||||
SERIAL = serial.o
|
SERIAL = serial.o
|
||||||
|
WSERIAL = win_serial.o
|
||||||
WFLAGS = -DWALTJE
|
WFLAGS = -DWALTJE
|
||||||
else
|
else
|
||||||
SERIAL = serial_old.o
|
SERIAL = serial_old.o
|
||||||
@@ -241,7 +242,7 @@ WINOBJ = win.o \
|
|||||||
win_ddraw.o win_ddraw_fs.o win_ddraw_screenshot.o \
|
win_ddraw.o win_ddraw_fs.o win_ddraw_screenshot.o \
|
||||||
win_d3d.o win_d3d_fs.o \
|
win_d3d.o win_d3d_fs.o \
|
||||||
win_language.o win_status.o win_opendir.o win_dynld.o \
|
win_language.o win_status.o win_opendir.o win_dynld.o \
|
||||||
win_video.o win_serial.o win_keyboard.o win_mouse.o \
|
win_video.o $(WSERIAL) win_keyboard.o win_mouse.o \
|
||||||
win_iodev.o win_joystick.o win_midi.o \
|
win_iodev.o win_joystick.o win_midi.o \
|
||||||
win_settings.o win_deviceconfig.o win_joystickconfig.o \
|
win_settings.o win_deviceconfig.o win_joystickconfig.o \
|
||||||
86Box.res
|
86Box.res
|
||||||
|
|||||||
@@ -255,7 +255,7 @@ BEGIN
|
|||||||
12,12
|
12,12
|
||||||
LTEXT "MB",IDT_1705,123,64,10,10
|
LTEXT "MB",IDT_1705,123,64,10,10
|
||||||
LTEXT "Memory:",IDT_1706,7,64,30,10
|
LTEXT "Memory:",IDT_1706,7,64,30,10
|
||||||
LTEXT "NVR Path:",IDT_1700,7,83,60,10
|
LTEXT "NVR Path:",IDT_1700,7,83,60,10,ES_AUTOHSCROLL
|
||||||
EDITTEXT IDC_EDIT_NVR_PATH,71,82,138,12
|
EDITTEXT IDC_EDIT_NVR_PATH,71,82,138,12
|
||||||
PUSHBUTTON "&Specify...",IDC_BUTTON_NVR_PATH,214,82,46,12
|
PUSHBUTTON "&Specify...",IDC_BUTTON_NVR_PATH,214,82,46,12
|
||||||
CONTROL "Dynamic Recompiler",IDC_CHECK_DYNAREC,"Button",
|
CONTROL "Dynamic Recompiler",IDC_CHECK_DYNAREC,"Button",
|
||||||
|
|||||||
@@ -204,7 +204,7 @@ void gameport_update_joystick_type()
|
|||||||
|
|
||||||
void *gameport_init()
|
void *gameport_init()
|
||||||
{
|
{
|
||||||
gameport_t *gameport;
|
gameport_t *gameport = NULL;
|
||||||
|
|
||||||
if (joystick_type == 7)
|
if (joystick_type == 7)
|
||||||
{
|
{
|
||||||
|
|||||||
2
src/pc.c
2
src/pc.c
@@ -366,7 +366,9 @@ void initmodules(void)
|
|||||||
/* Initialize modules. */
|
/* Initialize modules. */
|
||||||
network_init();
|
network_init();
|
||||||
mouse_init();
|
mouse_init();
|
||||||
|
#ifdef WALTJE
|
||||||
serial_init();
|
serial_init();
|
||||||
|
#endif
|
||||||
disc_random_init();
|
disc_random_init();
|
||||||
|
|
||||||
joystick_init();
|
joystick_init();
|
||||||
|
|||||||
@@ -244,7 +244,7 @@ void serial_recieve_callback(void *p)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
uint16_t base_address[2] = { 0x3f8, 0x2f8 };
|
uint16_t base_address[2] = { 0x0000, 0x0000 };
|
||||||
|
|
||||||
void serial_remove(int port)
|
void serial_remove(int port)
|
||||||
{
|
{
|
||||||
@@ -259,68 +259,82 @@ void serial_remove(int port)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!base_address[port - 1])
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
pclog("Removing serial port %i at %04X...\n", port, base_address[port - 1]);
|
pclog("Removing serial port %i at %04X...\n", port, base_address[port - 1]);
|
||||||
|
|
||||||
io_removehandler(base_address[port - 1], 0x0008, serial_read, NULL, NULL, serial_write, NULL, NULL, (port == 1) ? &serial1 : &serial2);
|
switch(port)
|
||||||
base_address[port - 1] = 0x0000;
|
{
|
||||||
|
case 1:
|
||||||
|
io_removehandler(base_address[0], 0x0008, serial_read, NULL, NULL, serial_write, NULL, NULL, &serial1);
|
||||||
|
base_address[0] = 0x0000;
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
io_removehandler(base_address[1], 0x0008, serial_read, NULL, NULL, serial_write, NULL, NULL, &serial2);
|
||||||
|
base_address[1] = 0x0000;
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void serial_setup(int port, uint16_t addr, int irq)
|
void serial_setup(int port, uint16_t addr, int irq)
|
||||||
{
|
{
|
||||||
SERIAL *p;
|
|
||||||
|
|
||||||
if ((port < 1) || (port > 2))
|
|
||||||
{
|
|
||||||
fatal("serial_setup(): Invalid serial port: %i\n", port);
|
|
||||||
exit(-1);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!serial_enabled[port - 1])
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (base_address[port - 1] != 0x0000)
|
|
||||||
{
|
|
||||||
serial_remove(port);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (addr == 0x0000)
|
|
||||||
{
|
|
||||||
pclog("Serial port %i at %04X, ignoring...\n", port, base_address[port - 1]);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (port == 1)
|
|
||||||
{
|
|
||||||
p = &serial1;
|
|
||||||
}
|
|
||||||
else if (port == 2)
|
|
||||||
{
|
|
||||||
p = &serial2;
|
|
||||||
}
|
|
||||||
|
|
||||||
pclog("Adding serial port %i at %04X...\n", port, addr);
|
pclog("Adding serial port %i at %04X...\n", port, addr);
|
||||||
|
|
||||||
base_address[port - 1] = addr;
|
switch(port)
|
||||||
io_sethandler(base_address[port - 1], 0x0008, serial_read, NULL, NULL, serial_write, NULL, NULL, p);
|
{
|
||||||
|
case 1:
|
||||||
p->irq = irq;
|
if (base_address[0] != 0x0000)
|
||||||
|
{
|
||||||
|
serial_remove(port);
|
||||||
|
}
|
||||||
|
if (addr != 0x0000)
|
||||||
|
{
|
||||||
|
base_address[0] = addr;
|
||||||
|
io_sethandler(addr, 0x0008, serial_read, NULL, NULL, serial_write, NULL, NULL, &serial1);
|
||||||
|
}
|
||||||
|
serial1.irq = irq;
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
if (base_address[1] != 0x0000)
|
||||||
|
{
|
||||||
|
serial_remove(port);
|
||||||
|
}
|
||||||
|
if (addr != 0x0000)
|
||||||
|
{
|
||||||
|
base_address[1] = addr;
|
||||||
|
io_sethandler(addr, 0x0008, serial_read, NULL, NULL, serial_write, NULL, NULL, &serial2);
|
||||||
|
}
|
||||||
|
serial2.irq = irq;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
fatal("serial_setup(): Invalid serial port: %i\n", port);
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void serial_init(void)
|
void serial_init(void)
|
||||||
{
|
{
|
||||||
|
base_address[0] = 0x03f8;
|
||||||
|
base_address[1] = 0x02f8;
|
||||||
|
|
||||||
if (serial_enabled[0])
|
if (serial_enabled[0])
|
||||||
{
|
{
|
||||||
pclog("Adding serial port 1...\n");
|
pclog("Adding serial port 1...\n");
|
||||||
serial_setup(1, 0x3f8, 4);
|
memset(&serial1, 0, sizeof(serial1));
|
||||||
|
io_sethandler(0x3f8, 0x0008, serial_read, NULL, NULL, serial_write, NULL, NULL, &serial1);
|
||||||
|
serial1.irq = 4;
|
||||||
serial1.rcr_callback = NULL;
|
serial1.rcr_callback = NULL;
|
||||||
timer_add(serial_recieve_callback, &serial1.recieve_delay, &serial1.recieve_delay, &serial1);
|
timer_add(serial_recieve_callback, &serial1.recieve_delay, &serial1.recieve_delay, &serial1);
|
||||||
}
|
}
|
||||||
if (serial_enabled[1])
|
if (serial_enabled[1])
|
||||||
{
|
{
|
||||||
pclog("Adding serial port 2...\n");
|
pclog("Adding serial port 2...\n");
|
||||||
serial_setup(2, 0x2f8, 3);
|
memset(&serial2, 0, sizeof(serial2));
|
||||||
|
io_sethandler(0x2f8, 0x0008, serial_read, NULL, NULL, serial_write, NULL, NULL, &serial2);
|
||||||
|
serial2.irq = 3;
|
||||||
serial2.rcr_callback = NULL;
|
serial2.rcr_callback = NULL;
|
||||||
timer_add(serial_recieve_callback, &serial2.recieve_delay, &serial2.recieve_delay, &serial2);
|
timer_add(serial_recieve_callback, &serial2.recieve_delay, &serial2.recieve_delay, &serial2);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
#include "sound_wss.h"*/
|
#include "sound_wss.h"*/
|
||||||
#include "timer.h"
|
#include "timer.h"
|
||||||
|
|
||||||
#define TIMERS_MAX 32
|
#define TIMERS_MAX 64
|
||||||
|
|
||||||
int TIMER_USEC;
|
int TIMER_USEC;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user