Major changes to NVR, system initialization (pc.c), and what goes on in the Windows startup (win.c.) Not fully done yet, but good enough for a first commit.

This commit is contained in:
waltje
2017-10-07 00:46:54 -04:00
parent 95fe21b651
commit 2b37b7fbfb
108 changed files with 5628 additions and 5912 deletions

View File

@@ -8,7 +8,7 @@
#
# Modified Makefile for Win32 (MinGW32) environment.
#
# Version: @(#)Makefile.mingw 1.0.52 2017/10/02
# Version: @(#)Makefile.mingw 1.0.52 2017/10/05
#
# Authors: Miran Grca, <mgrca8@gmail.com>
# Fred N. van Kempen, <decwiz@yahoo.com>
@@ -351,7 +351,7 @@ WINOBJ := win.o \
win_d3d.o win_d3d_fs.o \
win_language.o win_status.o $(OPENDIR) win_dynld.o \
win_video.o $(WSERIAL) win_keyboard.o win_mouse.o \
win_iodev.o win_joystick.o win_midi.o \
win_joystick.o win_midi.o win_thread.o \
win_settings.o win_deviceconfig.o win_joystickconfig.o
OBJ := $(MAINOBJ) $(CPUOBJ) $(MCHOBJ) $(DEVOBJ) \

View File

@@ -44,7 +44,7 @@
* configuration register (CTRL_SPCFG bit set) but have to
* remember that stuff first...
*
* Version: @(#)bugger.c 1.0.5 2017/09/24
* Version: @(#)bugger.c 1.0.6 2017/10/05
*
* Author: Fred N. van Kempen, <decwiz@yahoo.com>
* Copyright 1989-2017 Fred N. van Kempen.
@@ -55,6 +55,7 @@
#include <wchar.h>
#include "ibm.h"
#include "io.h"
#include "win/win.h"
#include "bugger.h"
@@ -103,7 +104,7 @@ bug_setui(void)
(bug_ledr&0x02)?'R':'r', (bug_ledr&0x01)?'R':'r');
/* Send formatted string to the UI. */
status_settext(bug_str);
StatusBarSetText(bug_str);
}

View File

@@ -9,7 +9,7 @@
* Implementation of the CD-ROM drive with SCSI(-like)
* commands, for both ATAPI and SCSI usage.
*
* Version: @(#)cdrom.c 1.0.9 2017/10/02
* Version: @(#)cdrom.c 1.0.9 2017/10/05
*
* Author: Miran Grca, <mgrca8@gmail.com>
* Copyright 2016,2017 Miran Grca.
@@ -29,6 +29,7 @@
#include "../nvr.h"
#include "../disk/hdc.h"
#include "../disk/hdc_ide.h"
#include "../win/win.h"
#include "../win/plat_iodev.h"
#include "cdrom.h"
@@ -2565,11 +2566,11 @@ cdrom_readtoc_fallback:
cdrom[id].all_blocks_total = cdrom[id].block_total;
if (cdrom[id].packet_status != CDROM_PHASE_COMPLETE)
{
update_status_bar_icon(SB_CDROM | id, 1);
StatusBarUpdateIcon(SB_CDROM | id, 1);
}
else
{
update_status_bar_icon(SB_CDROM | id, 0);
StatusBarUpdateIcon(SB_CDROM | id, 0);
}
return;
@@ -3675,7 +3676,7 @@ void cdrom_phase_callback(uint8_t id)
cdrom[id].status = READY_STAT;
cdrom[id].phase = 3;
cdrom[id].packet_status = 0xFF;
update_status_bar_icon(SB_CDROM | id, 0);
StatusBarUpdateIcon(SB_CDROM | id, 0);
cdrom_irq_raise(id);
return;
case CDROM_PHASE_DATA_OUT:
@@ -3690,7 +3691,7 @@ void cdrom_phase_callback(uint8_t id)
cdrom[id].packet_status = CDROM_PHASE_COMPLETE;
cdrom[id].status = READY_STAT;
cdrom[id].phase = 3;
update_status_bar_icon(SB_CDROM | id, 0);
StatusBarUpdateIcon(SB_CDROM | id, 0);
cdrom_irq_raise(id);
return;
case CDROM_PHASE_DATA_IN:
@@ -3705,7 +3706,7 @@ void cdrom_phase_callback(uint8_t id)
cdrom[id].packet_status = CDROM_PHASE_COMPLETE;
cdrom[id].status = READY_STAT;
cdrom[id].phase = 3;
update_status_bar_icon(SB_CDROM | id, 0);
StatusBarUpdateIcon(SB_CDROM | id, 0);
cdrom_irq_raise(id);
return;
case CDROM_PHASE_ERROR:

View File

@@ -9,7 +9,7 @@
* Implementation of the CD-ROM host drive IOCTL interface for
* Windows using SCSI Passthrough Direct.
*
* Version: @(#)cdrom_ioctl.c 1.0.4 2017/09/24
* Version: @(#)cdrom_ioctl.c 1.0.5 2017/10/04
*
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
* Miran Grca, <mgrca8@gmail.com>
@@ -26,6 +26,7 @@
#include <string.h>
#include <wchar.h>
#include "../ibm.h"
#include "../device.h"
#include "../scsi/scsi.h"
#include "cdrom.h"
#include "cdrom_ioctl.h"

File diff suppressed because it is too large Load Diff

View File

@@ -18,7 +18,7 @@
* 2 clocks - fetch opcode 1 2 clocks - execute
* 2 clocks - fetch opcode 2 etc
*
* Version: @(#)808x.c 1.0.2 2017/09/24
* Version: @(#)808x.c 1.0.3 2017/10/04
*
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
* Miran Grca, <mgrca8@gmail.com>
@@ -28,18 +28,18 @@
#include <stdio.h>
#include <stdint.h>
#include <string.h>
//#include <unistd.h>
#include <wchar.h>
#include "../ibm.h"
#include "cpu.h"
#include "x86.h"
#include "../keyboard.h"
#include "../keyboard.h" /* its WRONG to have this in here!! --FvK */
#include "../mem.h"
#include "../rom.h"
#include "../nmi.h"
#include "../pic.h"
#include "../timer.h"
#include "../scsi/scsi.h"
#include "../device.h" /* for scsi.h */
#include "../scsi/scsi.h" /* its WRONG to have this in here!! --FvK */
int xt_cpu_multi;
int nmi = 0;

View File

@@ -4,6 +4,10 @@
#ifndef _X86_OPS_H
#define _X86_OPS_H
#define UNUSED(x) (void)(x)
typedef int (*OpFn)(uint32_t fetchdat);
void x86_setopcodes(OpFn *opcodes, OpFn *opcodes_0f, OpFn *dynarec_opcodes, OpFn *dynarec_opcodes_0f);

View File

@@ -9,7 +9,7 @@
* Implementation of the generic device interface to handle
* all devices attached to the emulator.
*
* Version: @(#)device.c 1.0.4 2017/10/01
* Version: @(#)device.c 1.0.4 2017/10/04
*
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
* Miran Grca, <mgrca8@gmail.com>
@@ -31,335 +31,339 @@
#define DEVICE_MAX 256 /* max # of devices */
static void *device_priv[DEVICE_MAX];
static device_t *devices[DEVICE_MAX];
static device_t *current_device;
static device_t *devices[DEVICE_MAX];
static void *device_priv[DEVICE_MAX];
static device_t *device_current;
void device_init(void)
void
device_init(void)
{
memset(devices, 0x00, sizeof(devices));
memset(devices, 0x00, sizeof(devices));
}
void device_add(device_t *d)
void
device_add(device_t *d)
{
int c = 0;
void *priv = NULL;
while (devices[c] != NULL && c < 256)
void *priv = NULL;
int c = 0;
while (devices[c] != NULL && c < 256)
c++;
if (c >= DEVICE_MAX)
fatal("device_add : too many devices\n");
if (c >= DEVICE_MAX)
fatal("device_add: too many devices\n");
current_device = d;
if (d->init != NULL)
{
priv = d->init();
if (priv == NULL)
fatal("device_add : device init failed\n");
}
devices[c] = d;
device_priv[c] = priv;
device_current = d;
if (d->init != NULL) {
priv = d->init(d);
if (priv == NULL)
fatal("device_add: device init failed\n");
}
devices[c] = d;
device_priv[c] = priv;
}
void device_close_all(void)
void
device_close_all(void)
{
int c;
int c;
for (c=0; c<DEVICE_MAX; c++)
{
if (devices[c] != NULL)
{
if (devices[c]->close != NULL)
devices[c]->close(device_priv[c]);
devices[c] = device_priv[c] = NULL;
}
}
for (c=0; c<DEVICE_MAX; c++) {
if (devices[c] != NULL) {
if (devices[c]->close != NULL)
devices[c]->close(device_priv[c]);
devices[c] = device_priv[c] = NULL;
}
}
}
void *device_get_priv(device_t *d)
void
device_reset_all(void)
{
int c;
int c;
for (c=0; c<DEVICE_MAX; c++)
{
if (devices[c] != NULL)
{
if (devices[c] == d)
return device_priv[c];
}
}
return NULL;
for (c=0; c<DEVICE_MAX; c++) {
if (devices[c] != NULL) {
if (devices[c]->reset != NULL)
devices[c]->reset(device_priv[c]);
}
}
}
int device_available(device_t *d)
void *
device_get_priv(device_t *d)
{
int c;
for (c=0; c<DEVICE_MAX; c++) {
if (devices[c] != NULL) {
if (devices[c] == d)
return(device_priv[c]);
}
}
return(NULL);
}
int
device_available(device_t *d)
{
#ifdef RELEASE_BUILD
if (d->flags & DEVICE_NOT_WORKING)
return 0;
if (d->flags & DEVICE_NOT_WORKING) return(0);
#endif
if (d->available)
return d->available();
return 1;
if (d->available != NULL)
return(d->available());
return(1);
}
void device_speed_changed(void)
void
device_speed_changed(void)
{
int c;
for (c=0; c<DEVICE_MAX; c++)
{
if (devices[c] != NULL)
{
if (devices[c]->speed_changed != NULL)
{
devices[c]->speed_changed(device_priv[c]);
}
}
}
sound_speed_changed();
int c;
for (c=0; c<DEVICE_MAX; c++) {
if (devices[c] != NULL) {
if (devices[c]->speed_changed != NULL)
devices[c]->speed_changed(device_priv[c]);
}
}
sound_speed_changed();
}
void device_force_redraw(void)
void
device_force_redraw(void)
{
int c;
for (c=0; c<DEVICE_MAX; c++)
{
if (devices[c] != NULL)
{
if (devices[c]->force_redraw != NULL)
{
int c;
for (c=0; c<DEVICE_MAX; c++) {
if (devices[c] != NULL) {
if (devices[c]->force_redraw != NULL)
devices[c]->force_redraw(device_priv[c]);
}
}
}
}
}
}
char *device_add_status_info(char *s, int max_len)
void
device_add_status_info(char *s, int max_len)
{
int c;
for (c=0; c<DEVICE_MAX; c++)
{
if (devices[c] != NULL)
{
if (devices[c]->add_status_info != NULL)
devices[c]->add_status_info(s, max_len, device_priv[c]);
}
}
int c;
return NULL;
for (c=0; c<DEVICE_MAX; c++) {
if (devices[c] != NULL) {
if (devices[c]->add_status_info != NULL)
devices[c]->add_status_info(s, max_len, device_priv[c]);
}
}
}
int device_get_config_int(char *s)
char *
device_get_config_string(char *s)
{
device_config_t *config = current_device->config;
while (config && config->type != -1)
{
if (!strcmp(s, config->name))
return config_get_int(current_device->name, s, config->default_int);
device_config_t *c = device_current->config;
config++;
}
return 0;
while (c && c->type != -1) {
if (! strcmp(s, c->name))
return(config_get_string(device_current->name, s, c->default_string));
c++;
}
return(NULL);
}
int device_get_config_int_ex(char *s, int default_int)
int
device_get_config_int(char *s)
{
device_config_t *config = current_device->config;
while (config && config->type != -1)
{
if (!strcmp(s, config->name))
return config_get_int(current_device->name, s, default_int);
device_config_t *c = device_current->config;
config++;
}
return default_int;
while (c && c->type != -1) {
if (! strcmp(s, c->name))
return(config_get_int(device_current->name, s, c->default_int));
c++;
}
return(0);
}
int device_get_config_hex16(char *s)
int
device_get_config_int_ex(char *s, int default_int)
{
device_config_t *config = current_device->config;
device_config_t *c = device_current->config;
while (config && config->type != -1)
{
if (!strcmp(s, config->name))
return config_get_hex16(current_device->name, s, config->default_int);
while (c && c->type != -1) {
if (! strcmp(s, c->name))
return(config_get_int(device_current->name, s, default_int));
config++;
}
return 0;
c++;
}
return(default_int);
}
int device_get_config_hex20(char *s)
int
device_get_config_hex16(char *s)
{
device_config_t *config = current_device->config;
while (config && config->type != -1)
{
if (!strcmp(s, config->name))
return config_get_hex20(current_device->name, s, config->default_int);
device_config_t *c = device_current->config;
config++;
}
return 0;
while (c && c->type != -1) {
if (! strcmp(s, c->name))
return(config_get_hex16(device_current->name, s, c->default_int));
c++;
}
return(0);
}
int device_get_config_mac(char *s, int default_int)
int
device_get_config_hex20(char *s)
{
device_config_t *config = current_device->config;
while (config && config->type != -1)
{
if (!strcmp(s, config->name))
return config_get_mac(current_device->name, s, default_int);
device_config_t *c = device_current->config;
config++;
}
return default_int;
while (c && c->type != -1) {
if (! strcmp(s, c->name))
return(config_get_hex20(device_current->name, s, c->default_int));
c++;
}
return(0);
}
void device_set_config_int(char *s, int val)
int
device_get_config_mac(char *s, int default_int)
{
device_config_t *config = current_device->config;
while (config && config->type != -1)
{
if (!strcmp(s, config->name))
{
config_set_int(current_device->name, s, val);
return;
}
device_config_t *c = device_current->config;
config++;
}
while (c && c->type != -1) {
if (! strcmp(s, c->name))
return(config_get_mac(device_current->name, s, default_int));
c++;
}
return(default_int);
}
void device_set_config_hex16(char *s, int val)
void
device_set_config_int(char *s, int val)
{
device_config_t *config = current_device->config;
while (config && config->type != -1)
{
if (!strcmp(s, config->name))
{
config_set_hex16(current_device->name, s, val);
return;
}
device_config_t *c = device_current->config;
config++;
}
while (c && c->type != -1) {
if (! strcmp(s, c->name)) {
config_set_int(device_current->name, s, val);
break;
}
c++;
}
}
void device_set_config_hex20(char *s, int val)
void
device_set_config_hex16(char *s, int val)
{
device_config_t *config = current_device->config;
while (config && config->type != -1)
{
if (!strcmp(s, config->name))
{
config_set_hex20(current_device->name, s, val);
return;
}
device_config_t *c = device_current->config;
config++;
}
while (c && c->type != -1) {
if (! strcmp(s, c->name)) {
config_set_hex16(device_current->name, s, val);
break;
}
c++;
}
}
void device_set_config_mac(char *s, int val)
void
device_set_config_hex20(char *s, int val)
{
device_config_t *config = current_device->config;
while (config && config->type != -1)
{
if (!strcmp(s, config->name))
{
config_set_mac(current_device->name, s, val);
return;
}
device_config_t *c = device_current->config;
config++;
}
while (c && c->type != -1) {
if (! strcmp(s, c->name)) {
config_set_hex20(device_current->name, s, val);
break;
}
c++;
}
}
char *device_get_config_string(char *s)
void
device_set_config_mac(char *s, int val)
{
device_config_t *config = current_device->config;
while (config && config->type != -1)
{
if (!strcmp(s, config->name))
return config_get_string(current_device->name, s, config->default_string);
device_config_t *c = device_current->config;
config++;
}
return NULL;
while (c && c->type != -1) {
if (! strcmp(s, c->name)) {
config_set_mac(device_current->name, s, val);
break;
}
c++;
}
}
int machine_get_config_int(char *s)
int
machine_get_config_int(char *s)
{
device_t *device = machine_getdevice(machine);
device_config_t *config;
device_t *d = machine_getdevice(machine);
device_config_t *c;
if (!device)
return 0;
if (d == NULL) return(0);
config = device->config;
while (config && config->type != -1)
{
if (!strcmp(s, config->name))
return config_get_int(device->name, s, config->default_int);
c = d->config;
while (c && c->type != -1) {
if (! strcmp(s, c->name))
return(config_get_int(d->name, s, c->default_int));
config++;
}
return 0;
c++;
}
return(0);
}
char *machine_get_config_string(char *s)
char *
machine_get_config_string(char *s)
{
device_t *device = machine_getdevice(machine);
device_config_t *config;
if (!device)
return 0;
device_t *d = machine_getdevice(machine);
device_config_t *c;
config = device->config;
while (config && config->type != -1)
{
if (!strcmp(s, config->name))
return config_get_string(device->name, s, config->default_string);
if (d == NULL) return(0);
config++;
}
return NULL;
c = d->config;
while (c && c->type != -1) {
if (! strcmp(s, c->name))
return(config_get_string(d->name, s, c->default_string));
c++;
}
return(NULL);
}

View File

@@ -9,12 +9,14 @@
* Implementation of the generic device interface to handle
* all devices attached to the emulator.
*
* Version: @(#)device.h 1.0.2 2017/08/23
* Version: @(#)device.h 1.0.3 2017/10/04
*
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
* Miran Grca, <mgrca8@gmail.com>
* Fred N. van Kempen, <decwiz@yahoo.com>
* Copyright 2008-2016 Sarah Walker.
* Copyright 2016,2017 Miran Grca.
* Copyright 2017 Fred N. van Kempen.
*/
#ifndef EMU_DEVICE_H
# define EMU_DEVICE_H
@@ -32,69 +34,68 @@
#define CONFIG_MAC 9
enum
{
DEVICE_NOT_WORKING = 1, /*Device does not currently work correctly and will be disabled in a release build*/
DEVICE_AT = 2, /*Device requires an AT-compatible system*/
DEVICE_PS2 = 4, /*Device requires a PS/1 or PS/2 system*/
DEVICE_MCA = 0x20, /*Device requires the MCA bus*/
DEVICE_PCI = 0x40 /*Device requires the PCI bus*/
enum {
DEVICE_NOT_WORKING = 1, /* does not currently work correctly and will be disabled in a release build*/
DEVICE_AT = 2, /* requires an AT-compatible system */
DEVICE_PS2 = 4, /* requires a PS/1 or PS/2 system */
DEVICE_MCA = 0x20, /* requires the MCA bus */
DEVICE_PCI = 0x40 /* requires the PCI bus */
};
typedef struct device_config_selection_t
{
char description[256];
int value;
typedef struct {
char description[256];
int value;
} device_config_selection_t;
typedef struct device_config_file_filter_t
{
char description[256];
char extensions[25][25];
typedef struct {
char description[256];
char extensions[25][25];
} device_config_file_filter_t;
typedef struct device_config_spinner_t
{
int min;
int max;
int step;
typedef struct {
int min;
int max;
int step;
} device_config_spinner_t;
typedef struct device_config_t
{
char name[256];
char description[256];
int type;
char default_string[256];
int default_int;
device_config_selection_t selection[16];
device_config_file_filter_t file_filter[16];
device_config_spinner_t spinner;
typedef struct {
char name[256];
char description[256];
int type;
char default_string[256];
int default_int;
device_config_selection_t selection[16];
device_config_file_filter_t file_filter[16];
device_config_spinner_t spinner;
} device_config_t;
typedef struct device_t
{
char name[50];
uint32_t flags;
void *(*init)();
void (*close)(void *p);
int (*available)();
void (*speed_changed)(void *p);
void (*force_redraw)(void *p);
void (*add_status_info)(char *s, int max_len, void *p);
device_config_t *config;
typedef struct _device_ {
char name[50];
uint32_t flags; /* system flags */
uint32_t local; /* flags local to device */
void *(*init)(struct _device_ *);
void (*close)(void *p);
void (*reset)(void *p);
int (*available)(void);
void (*speed_changed)(void *p);
void (*force_redraw)(void *p);
void (*add_status_info)(char *s, int max_len, void *p);
device_config_t *config;
} device_t;
extern void device_init(void);
extern void device_add(device_t *d);
extern void device_close_all(void);
extern void device_reset_all(void);
extern void *device_get_priv(device_t *d);
extern int device_available(device_t *d);
extern void device_speed_changed(void);
extern void device_force_redraw(void);
extern char *device_add_status_info(char *s, int max_len);
extern void device_add_status_info(char *s, int max_len);
extern int device_get_config_int(char *name);
extern int device_get_config_int_ex(char *s, int default_int);

View File

@@ -8,7 +8,7 @@
*
* Common code to handle all sorts of disk controllers.
*
* Version: @(#)hdc.c 1.0.2 2017/10/01
* Version: @(#)hdc.c 1.0.3 2017/10/04
*
* Authors: Miran Grca, <mgrca8@gmail.com>
* Fred N. van Kempen, <decwiz@yahoo.com>
@@ -31,7 +31,7 @@ int hdc_current;
static void *
null_init(void)
null_init(device_t *info)
{
return(NULL);
}
@@ -44,14 +44,14 @@ null_close(void *priv)
static device_t null_device = {
"Null HDC", 0,
null_init, null_close,
"Null HDC", 0, 0,
null_init, null_close, NULL,
NULL, NULL, NULL, NULL, NULL
};
static void *
inthdc_init(void)
inthdc_init(device_t *info)
{
return(NULL);
}
@@ -64,8 +64,8 @@ inthdc_close(void *priv)
static device_t inthdc_device = {
"Internal Controller", 0,
inthdc_init, inthdc_close,
"Internal Controller", 0, 0,
inthdc_init, inthdc_close, NULL,
NULL, NULL, NULL, NULL, NULL
};

View File

@@ -8,7 +8,7 @@
*
* Driver for the ESDI controller (WD1007-vse1) for PC/AT.
*
* Version: @(#)hdc_esdi_at.c 1.0.2 2017/10/01
* Version: @(#)hdc_esdi_at.c 1.0.3 2017/10/05
*
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
* Miran Grca, <mgrca8@gmail.com>
@@ -32,6 +32,7 @@
#include "../pic.h"
#include "../rom.h"
#include "../timer.h"
#include "../win/win.h"
#include "hdc.h"
#include "hdd.h"
@@ -513,7 +514,7 @@ esdi_callback(void *priv)
esdi->pos = 0;
esdi->status = STAT_DRQ | STAT_READY | STAT_DSC;
irq_raise(esdi);
update_status_bar_icon(SB_HDD | HDD_BUS_ESDI, 1);
StatusBarUpdateIcon(SB_HDD | HDD_BUS_ESDI, 1);
break;
case CMD_WRITE:
@@ -548,7 +549,7 @@ esdi_callback(void *priv)
} else {
esdi->status = STAT_READY | STAT_DSC;
}
update_status_bar_icon(SB_HDD | HDD_BUS_ESDI, 1);
StatusBarUpdateIcon(SB_HDD | HDD_BUS_ESDI, 1);
break;
case CMD_VERIFY:
@@ -574,7 +575,7 @@ esdi_callback(void *priv)
break;
}
update_status_bar_icon(SB_HDD | HDD_BUS_ESDI, 1);
StatusBarUpdateIcon(SB_HDD | HDD_BUS_ESDI, 1);
next_sector(esdi);
esdi->secount = (esdi->secount - 1) & 0xff;
if (esdi->secount)
@@ -608,7 +609,7 @@ esdi_callback(void *priv)
}
esdi->status = STAT_READY | STAT_DSC;
irq_raise(esdi);
update_status_bar_icon(SB_HDD | HDD_BUS_ESDI, 1);
StatusBarUpdateIcon(SB_HDD | HDD_BUS_ESDI, 1);
break;
case CMD_DIAGNOSE:
@@ -736,7 +737,7 @@ esdi_callback(void *priv)
break;
}
update_status_bar_icon(SB_HDD | HDD_BUS_ESDI, 0);
StatusBarUpdateIcon(SB_HDD | HDD_BUS_ESDI, 0);
}
@@ -770,7 +771,7 @@ loadhd(esdi_t *esdi, int hdd_num, int d, const wchar_t *fn)
static void *
wd1007vse1_init(void)
wd1007vse1_init(device_t *info)
{
int i, c = 0;
@@ -842,8 +843,10 @@ wd1007vse1_available(void)
device_t esdi_at_wd1007vse1_device = {
"Western Digital WD1007V-SE1 (ESDI)",
DEVICE_AT,
0,
wd1007vse1_init,
wd1007vse1_close,
NULL,
wd1007vse1_available,
NULL, NULL, NULL, NULL
};

View File

@@ -52,7 +52,7 @@
* however, are auto-configured by the system software as
* shown above.
*
* Version: @(#)hdc_esdi_mca.c 1.0.4 2017/09/29
* Version: @(#)hdc_esdi_mca.c 1.0.5 2017/10/05
*
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
* Fred N. van Kempen, <decwiz@yahoo.com>
@@ -73,6 +73,7 @@
#include "../pic.h"
#include "../rom.h"
#include "../timer.h"
#include "../win/win.h"
#include "hdc.h"
#include "hdd.h"
@@ -325,7 +326,7 @@ esdi_callback(void *priv)
if (dev->rba >= drive->sectors)
fatal("Read past end of drive\n");
hdd_image_read(drive->hdd_num, dev->rba, 1, (uint8_t *)dev->data);
update_status_bar_icon(SB_HDD | HDD_BUS_ESDI, 1);
StatusBarUpdateIcon(SB_HDD | HDD_BUS_ESDI, 1);
}
while (dev->data_pos < 256) {
@@ -406,11 +407,11 @@ esdi_callback(void *priv)
hdd_image_write(drive->hdd_num, dev->rba, 1, (uint8_t *)dev->data);
dev->rba++;
dev->sector_pos++;
update_status_bar_icon(SB_HDD | HDD_BUS_ESDI, 1);
StatusBarUpdateIcon(SB_HDD | HDD_BUS_ESDI, 1);
dev->data_pos = 0;
}
update_status_bar_icon(SB_HDD | HDD_BUS_ESDI, 0);
StatusBarUpdateIcon(SB_HDD | HDD_BUS_ESDI, 0);
dev->status = STATUS_CMD_IN_PROGRESS;
dev->cmd_state = 2;
@@ -970,7 +971,7 @@ esdi_mca_write(int port, uint8_t val, void *priv)
static void *
esdi_init(void)
esdi_init(device_t *info)
{
drive_t *drive;
esdi_t *dev;
@@ -1066,7 +1067,7 @@ esdi_available(void)
device_t esdi_ps2_device = {
"IBM ESDI Fixed Disk Adapter (MCA)",
DEVICE_MCA,
esdi_init, esdi_close, esdi_available,
NULL, NULL, NULL, NULL
DEVICE_MCA, 0,
esdi_init, esdi_close, NULL,
esdi_available, NULL, NULL, NULL, NULL
};

View File

@@ -9,7 +9,7 @@
* Implementation of the IDE emulation for hard disks and ATAPI
* CD-ROM devices.
*
* Version: @(#)hdc_ide.c 1.0.9 2017/09/30
* Version: @(#)hdc_ide.c 1.0.10 2017/10/05
*
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
* Miran Grca, <mgrca8@gmail.com>
@@ -30,6 +30,7 @@
#include "../device.h"
#include "../cdrom/cdrom.h"
#include "../scsi/scsi.h"
#include "../win/win.h"
#include "hdc.h"
#include "hdc_ide.h"
#include "hdd.h"
@@ -1296,7 +1297,7 @@ uint32_t ide_read_data(int ide_board, int length)
}
else
{
update_status_bar_icon(SB_HDD | hdd[ide->hdd_num].bus, 0);
StatusBarUpdateIcon(SB_HDD | hdd[ide->hdd_num].bus, 0);
}
}
}
@@ -1644,7 +1645,7 @@ void callbackide(int ide_board)
ide_irq_raise(ide);
update_status_bar_icon(SB_HDD | hdd[ide->hdd_num].bus, 1);
StatusBarUpdateIcon(SB_HDD | hdd[ide->hdd_num].bus, 1);
return;
case WIN_READ_DMA:
@@ -1691,12 +1692,12 @@ void callbackide(int ide_board)
ide_next_sector(ide);
ide->atastat = BUSY_STAT;
idecallback[ide_board]=6*IDE_TIME;
update_status_bar_icon(SB_HDD | hdd[ide->hdd_num].bus, 1);
StatusBarUpdateIcon(SB_HDD | hdd[ide->hdd_num].bus, 1);
}
else
{
ide_irq_raise(ide);
update_status_bar_icon(SB_HDD | hdd[ide->hdd_num].bus, 0);
StatusBarUpdateIcon(SB_HDD | hdd[ide->hdd_num].bus, 0);
}
}
}
@@ -1749,7 +1750,7 @@ void callbackide(int ide_board)
ide->blockcount = 0;
}
update_status_bar_icon(SB_HDD | hdd[ide->hdd_num].bus, 1);
StatusBarUpdateIcon(SB_HDD | hdd[ide->hdd_num].bus, 1);
return;
case WIN_WRITE:
@@ -1770,12 +1771,12 @@ void callbackide(int ide_board)
ide->atastat = DRQ_STAT | READY_STAT | DSC_STAT;
ide->pos=0;
ide_next_sector(ide);
update_status_bar_icon(SB_HDD | hdd[ide->hdd_num].bus, 1);
StatusBarUpdateIcon(SB_HDD | hdd[ide->hdd_num].bus, 1);
}
else
{
ide->atastat = READY_STAT | DSC_STAT;
update_status_bar_icon(SB_HDD | hdd[ide->hdd_num].bus, 0);
StatusBarUpdateIcon(SB_HDD | hdd[ide->hdd_num].bus, 0);
}
return;
@@ -1809,12 +1810,12 @@ void callbackide(int ide_board)
ide_next_sector(ide);
ide->atastat = BUSY_STAT;
idecallback[ide_board]=6*IDE_TIME;
update_status_bar_icon(SB_HDD | hdd[ide->hdd_num].bus, 1);
StatusBarUpdateIcon(SB_HDD | hdd[ide->hdd_num].bus, 1);
}
else
{
ide_irq_raise(ide);
update_status_bar_icon(SB_HDD | hdd[ide->hdd_num].bus, 0);
StatusBarUpdateIcon(SB_HDD | hdd[ide->hdd_num].bus, 0);
}
}
}
@@ -1843,12 +1844,12 @@ void callbackide(int ide_board)
ide->atastat = DRQ_STAT | READY_STAT | DSC_STAT;
ide->pos=0;
ide_next_sector(ide);
update_status_bar_icon(SB_HDD | hdd[ide->hdd_num].bus, 1);
StatusBarUpdateIcon(SB_HDD | hdd[ide->hdd_num].bus, 1);
}
else
{
ide->atastat = READY_STAT | DSC_STAT;
update_status_bar_icon(SB_HDD | hdd[ide->hdd_num].bus, 0);
StatusBarUpdateIcon(SB_HDD | hdd[ide->hdd_num].bus, 0);
}
return;
@@ -1865,7 +1866,7 @@ void callbackide(int ide_board)
ide->pos=0;
ide->atastat = READY_STAT | DSC_STAT;
ide_irq_raise(ide);
update_status_bar_icon(SB_HDD | hdd[ide->hdd_num].bus, 1);
StatusBarUpdateIcon(SB_HDD | hdd[ide->hdd_num].bus, 1);
return;
case WIN_FORMAT:
@@ -1882,7 +1883,7 @@ void callbackide(int ide_board)
ide->atastat = READY_STAT | DSC_STAT;
ide_irq_raise(ide);
/* update_status_bar_icon(SB_HDD | hdd[ide->hdd_num].bus, 1); */
/* StatusBarUpdateIcon(SB_HDD | hdd[ide->hdd_num].bus, 1); */
return;
case WIN_DRIVE_DIAGNOSTICS:

View File

@@ -12,7 +12,7 @@
* based design. Most cards were WD1003-WA2 or -WAH, where the
* -WA2 cards had a floppy controller as well (to save space.)
*
* Version: @(#)hdd_mfm_at.c 1.0.4 2017/09/29
* Version: @(#)hdd_mfm_at.c 1.0.5 2017/10/05
*
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
* Fred N. van Kempen, <decwiz@yahoo.com>
@@ -29,6 +29,7 @@
#include "../io.h"
#include "../pic.h"
#include "../timer.h"
#include "../win/win.h"
#include "hdc.h"
#include "hdd.h"
@@ -461,7 +462,7 @@ mfm_readw(uint16_t port, void *priv)
mfm->callback = 6*MFM_TIME;
timer_update_outstanding();
} else {
update_status_bar_icon(SB_HDD|HDD_BUS_MFM, 0);
StatusBarUpdateIcon(SB_HDD|HDD_BUS_MFM, 0);
}
}
}
@@ -561,7 +562,7 @@ do_callback(void *priv)
mfm->reset = 0;
update_status_bar_icon(SB_HDD|HDD_BUS_MFM, 0);
StatusBarUpdateIcon(SB_HDD|HDD_BUS_MFM, 0);
return;
}
@@ -595,7 +596,7 @@ do_callback(void *priv)
mfm->pos = 0;
mfm->status = STAT_DRQ|STAT_READY|STAT_DSC;
irq_raise(mfm);
update_status_bar_icon(SB_HDD|HDD_BUS_MFM, 1);
StatusBarUpdateIcon(SB_HDD|HDD_BUS_MFM, 1);
break;
case CMD_WRITE:
@@ -620,9 +621,9 @@ do_callback(void *priv)
mfm->status |= STAT_DRQ;
mfm->pos = 0;
next_sector(mfm);
update_status_bar_icon(SB_HDD|HDD_BUS_MFM, 1);
StatusBarUpdateIcon(SB_HDD|HDD_BUS_MFM, 1);
} else {
update_status_bar_icon(SB_HDD|HDD_BUS_MFM, 0);
StatusBarUpdateIcon(SB_HDD|HDD_BUS_MFM, 0);
}
irq_raise(mfm);
break;
@@ -636,7 +637,7 @@ do_callback(void *priv)
mfm->pos = 0;
mfm->status = STAT_READY|STAT_DSC;
irq_raise(mfm);
update_status_bar_icon(SB_HDD|HDD_BUS_MFM, 1);
StatusBarUpdateIcon(SB_HDD|HDD_BUS_MFM, 1);
break;
case CMD_FORMAT:
@@ -656,7 +657,7 @@ do_callback(void *priv)
mfm->status = STAT_READY|STAT_DSC;
irq_raise(mfm);
update_status_bar_icon(SB_HDD|HDD_BUS_MFM, 1);
StatusBarUpdateIcon(SB_HDD|HDD_BUS_MFM, 1);
break;
case CMD_DIAGNOSE:
@@ -700,7 +701,7 @@ loadhd(mfm_t *mfm, int c, int d, const wchar_t *fn)
static void *
mfm_init(void)
mfm_init(device_t *info)
{
mfm_t *mfm;
int c, d;
@@ -733,7 +734,7 @@ mfm_init(void)
timer_add(do_callback, &mfm->callback, &mfm->callback, mfm);
update_status_bar_icon(SB_HDD|HDD_BUS_MFM, 0);
StatusBarUpdateIcon(SB_HDD|HDD_BUS_MFM, 0);
return(mfm);
}
@@ -753,13 +754,13 @@ mfm_close(void *priv)
free(mfm);
update_status_bar_icon(SB_HDD|HDD_BUS_MFM, 0);
StatusBarUpdateIcon(SB_HDD|HDD_BUS_MFM, 0);
}
device_t mfm_at_wd1003_device = {
"WD1003 AT MFM/RLL Controller",
DEVICE_AT,
DEVICE_AT, 0,
mfm_init, mfm_close, NULL,
NULL, NULL, NULL, NULL
NULL, NULL, NULL, NULL, NULL
};

View File

@@ -41,7 +41,7 @@
* Since all controllers (including the ones made by DTC) use
* (mostly) the same API, we keep them all in this module.
*
* Version: @(#)hdd_mfm_xt.c 1.0.6 2017/09/30
* Version: @(#)hdd_mfm_xt.c 1.0.7 2017/10/05
*
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
* Fred N. van Kempen, <decwiz@yahoo.com>
@@ -61,6 +61,7 @@
#include "../pic.h"
#include "../rom.h"
#include "../timer.h"
#include "../win/win.h"
#include "hdc.h"
#include "hdd.h"
@@ -402,7 +403,7 @@ mfm_callback(void *priv)
mfm_complete(mfm);
update_status_bar_icon(SB_HDD | HDD_BUS_MFM, 1);
StatusBarUpdateIcon(SB_HDD | HDD_BUS_MFM, 1);
break;
default:
@@ -447,7 +448,7 @@ mfm_callback(void *priv)
hdd_image_read(drive->hdd_num, addr, 1,
(uint8_t *) mfm->sector_buf);
update_status_bar_icon(SB_HDD|HDD_BUS_MFM, 1);
StatusBarUpdateIcon(SB_HDD|HDD_BUS_MFM, 1);
if (mfm->irq_dma_mask & DMA_ENA)
mfm->callback = MFM_TIME;
@@ -492,7 +493,7 @@ mfm_callback(void *priv)
hdd_image_read(drive->hdd_num, addr, 1,
(uint8_t *) mfm->sector_buf);
update_status_bar_icon(SB_HDD|HDD_BUS_MFM, 1);
StatusBarUpdateIcon(SB_HDD|HDD_BUS_MFM, 1);
mfm->state = STATE_SEND_DATA;
@@ -504,7 +505,7 @@ mfm_callback(void *priv)
}
} else {
mfm_complete(mfm);
update_status_bar_icon(SB_HDD | HDD_BUS_MFM, 0);
StatusBarUpdateIcon(SB_HDD | HDD_BUS_MFM, 0);
}
break;
@@ -565,7 +566,7 @@ mfm_callback(void *priv)
hdd_image_write(drive->hdd_num, addr, 1,
(uint8_t *) mfm->sector_buf);
update_status_bar_icon(SB_HDD|HDD_BUS_MFM, 1);
StatusBarUpdateIcon(SB_HDD|HDD_BUS_MFM, 1);
next_sector(mfm);
mfm->data_pos = 0;
@@ -802,7 +803,7 @@ mfm_set_switches(mfm_t *mfm)
static void *
xebec_init(void)
xebec_init(device_t *info)
{
int i, c = 0;
@@ -856,14 +857,15 @@ xebec_available(void)
device_t mfm_xt_xebec_device = {
"IBM PC Fixed Disk Adapter",
0,
xebec_init, mfm_close, xebec_available,
NULL, NULL, NULL, NULL
0, 0,
xebec_init, mfm_close, NULL,
xebec_available, NULL, NULL, NULL,
NULL
};
static void *
dtc5150x_init(void)
dtc5150x_init(device_t *info)
{
int i, c = 0;
@@ -906,7 +908,8 @@ dtc5150x_available(void)
device_t mfm_xt_dtc5150x_device = {
"DTC 5150X",
0,
dtc5150x_init, mfm_close, dtc5150x_available,
NULL, NULL, NULL, NULL
0, 0,
dtc5150x_init, mfm_close, NULL,
dtc5150x_available, NULL, NULL, NULL,
NULL
};

View File

@@ -21,7 +21,7 @@
* already on their way out, the newer IDE standard based on the
* PC/AT controller and 16b design became the IDE we now know.
*
* Version: @(#)xtide.c 1.0.6 2017/10/10
* Version: @(#)hdc_xtide.c 1.0.7 2017/10/04
*
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
* Miran Grca, <mgrca8@gmail.com>
@@ -126,7 +126,7 @@ xtide_read(uint16_t port, void *priv)
static void *
xtide_init(void)
xtide_init(device_t *info)
{
xtide_t *xtide = malloc(sizeof(xtide_t));
@@ -153,7 +153,7 @@ xtide_available(void)
static void *
xtide_at_init(void)
xtide_at_init(device_t *info)
{
xtide_t *xtide = malloc(sizeof(xtide_t));
@@ -176,7 +176,7 @@ xtide_at_available(void)
static void *
xtide_ps2_init(void)
xtide_ps2_init(device_t *info)
{
xtide_t *xtide = malloc(sizeof(xtide_t));
@@ -203,7 +203,7 @@ xtide_ps2_available(void)
static void *
xtide_at_ps2_init(void)
xtide_at_ps2_init(device_t *info)
{
xtide_t *xtide = malloc(sizeof(xtide_t));
@@ -237,27 +237,35 @@ xtide_close(void *priv)
device_t xtide_device = {
"XTIDE",
0,
xtide_init, xtide_close, xtide_available,
NULL, NULL, NULL, NULL
0,
xtide_init, xtide_close, NULL,
xtide_available, NULL, NULL, NULL,
NULL
};
device_t xtide_at_device = {
"XTIDE (AT)",
DEVICE_AT,
xtide_at_init, xtide_close, xtide_at_available,
NULL, NULL, NULL, NULL
0,
xtide_at_init, xtide_close, NULL,
xtide_at_available, NULL, NULL, NULL,
NULL
};
device_t xtide_ps2_device = {
"XTIDE (Acculogic)",
0,
xtide_ps2_init, xtide_close, xtide_ps2_available,
NULL, NULL, NULL, NULL
0,
xtide_ps2_init, xtide_close, NULL,
xtide_ps2_available, NULL, NULL, NULL,
NULL
};
device_t xtide_at_ps2_device = {
"XTIDE (AT) (1.1.5)",
DEVICE_PS2,
xtide_at_ps2_init, xtide_close, xtide_at_ps2_available,
NULL, NULL, NULL, NULL
0,
xtide_at_ps2_init, xtide_close, NULL,
xtide_at_ps2_available, NULL, NULL, NULL,
NULL
};

View File

@@ -8,7 +8,7 @@
*
* Common code to handle all sorts of hard disk images.
*
* Version: @(#)hdd.c 1.0.2 2017/09/30
* Version: @(#)hdd.c 1.0.3 2017/10/05
*
* Authors: Miran Grca, <mgrca8@gmail.com>
* Fred N. van Kempen, <decwiz@yahoo.com>
@@ -23,6 +23,8 @@
#include "../cpu/cpu.h"
#include "../device.h"
#include "../machine/machine.h"
#include "../win/win.h"
#include "../win/win_language.h"
#include "hdd.h"
@@ -37,3 +39,138 @@ hdd_init(void)
return(0);
}
int
hdd_string_to_bus(char *str, int cdrom)
{
if (! strcmp(str, "none"))
return(HDD_BUS_DISABLED);
if (! strcmp(str, "mfm")) {
if (cdrom) {
no_cdrom:
msgbox_error(hwndMain, IDS_4114);
return(0);
}
return(HDD_BUS_MFM);
}
/* FIXME: delete 'rll' in a year or so.. --FvK */
if (!strcmp(str, "esdi") || !strcmp(str, "rll")) {
if (cdrom) goto no_cdrom;
return(HDD_BUS_ESDI);
}
if (! strcmp(str, "ide_pio_only"))
return(HDD_BUS_IDE_PIO_ONLY);
if (! strcmp(str, "ide"))
return(HDD_BUS_IDE_PIO_ONLY);
if (! strcmp(str, "atapi_pio_only"))
return(HDD_BUS_IDE_PIO_ONLY);
if (! strcmp(str, "atapi"))
return(HDD_BUS_IDE_PIO_ONLY);
if (! strcmp(str, "eide"))
return(HDD_BUS_IDE_PIO_ONLY);
if (! strcmp(str, "xtide"))
return(HDD_BUS_XTIDE);
if (! strcmp(str, "atide"))
return(HDD_BUS_IDE_PIO_ONLY);
if (! strcmp(str, "ide_pio_and_dma"))
return(HDD_BUS_IDE_PIO_AND_DMA);
if (! strcmp(str, "atapi_pio_and_dma"))
return(HDD_BUS_IDE_PIO_AND_DMA);
if (! strcmp(str, "scsi"))
return(HDD_BUS_SCSI);
if (! strcmp(str, "removable")) {
if (cdrom) goto no_cdrom;
return(HDD_BUS_SCSI_REMOVABLE);
}
if (! strcmp(str, "scsi_removable")) {
if (cdrom) goto no_cdrom;
return(HDD_BUS_SCSI_REMOVABLE);
}
if (! strcmp(str, "removable_scsi")) {
if (cdrom) goto no_cdrom;
return(HDD_BUS_SCSI_REMOVABLE);
}
if (! strcmp(str, "usb"))
msgbox_error(hwndMain, IDS_4110);
return(0);
}
char *
hdd_bus_to_string(int bus, int cdrom)
{
char *s = "none";
switch (bus) {
case HDD_BUS_DISABLED:
default:
break;
case HDD_BUS_MFM:
s = "mfm";
break;
case HDD_BUS_XTIDE:
s = "xtide";
break;
case HDD_BUS_ESDI:
s = "esdi";
break;
case HDD_BUS_IDE_PIO_ONLY:
s = cdrom ? "atapi_pio_only" : "ide_pio_only";
break;
case HDD_BUS_IDE_PIO_AND_DMA:
s = cdrom ? "atapi_pio_and_dma" : "ide_pio_and_dma";
break;
case HDD_BUS_SCSI:
s = "scsi";
break;
case HDD_BUS_SCSI_REMOVABLE:
s = "scsi_removable";
break;
}
return(s);
}
int
hdd_is_valid(int c)
{
if (hdd[c].bus == HDD_BUS_DISABLED) return(0);
if ((wcslen(hdd[c].fn) == 0) &&
(hdd[c].bus != HDD_BUS_SCSI_REMOVABLE)) return(0);
if ((hdd[c].tracks==0) || (hdd[c].hpc==0) || (hdd[c].spt==0)) return(0);
return(1);
}

View File

@@ -8,7 +8,7 @@
*
* Definitions for the hard disk image handler.
*
* Version: @(#)hdd.h 1.0.2 2017/09/30
* Version: @(#)hdd.h 1.0.3 2017/10/05
*
* Authors: Miran Grca, <mgrca8@gmail.com>
* Fred N. van Kempen, <decwiz@yahoo.com>
@@ -71,6 +71,9 @@ extern uint64_t hdd_table[128][3];
extern int hdd_init(void);
extern int hdd_string_to_bus(char *str, int cdrom);
extern char *hdd_bus_to_string(int bus, int cdrom);
extern int hdd_is_valid(int c);
extern int hdd_image_load(int id);
extern void hdd_image_seek(uint8_t id, uint32_t sector);

View File

@@ -9,7 +9,7 @@
* Implementation of the NEC uPD-765 and compatible floppy disk
* controller.
*
* Version: @(#)fdc.c 1.0.3 2017/09/24
* Version: @(#)fdc.c 1.0.4 2017/10/05
*
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
* Miran Grca, <mgrca8@gmail.com>
@@ -28,6 +28,7 @@
#include "../dma.h"
#include "../pic.h"
#include "../timer.h"
#include "../win/win.h"
#include "floppy.h"
#include "fdc.h"
#include "fdd.h"
@@ -677,7 +678,7 @@ void fdc_write(uint16_t addr, uint8_t val, void *priv)
floppytime = 128 * (1 << TIMER_SHIFT);
timer_update_outstanding();
floppyint=-1;
update_status_bar_icon(SB_FLOPPY | 0, 0);
StatusBarUpdateIcon(SB_FLOPPY | 0, 0);
fdc_reset();
}
if (!fdd_get_flags(0))
@@ -714,7 +715,7 @@ void fdc_write(uint16_t addr, uint8_t val, void *priv)
for (i = 0; i < FDD_NUM; i++)
{
update_status_bar_icon(SB_FLOPPY | i, 0);
StatusBarUpdateIcon(SB_FLOPPY | i, 0);
}
fdc_reset();
@@ -987,7 +988,7 @@ bad_command:
fdc.stat = 0x50;
}
floppytime = 0;
update_status_bar_icon(SB_FLOPPY | fdc.drive, 1);
StatusBarUpdateIcon(SB_FLOPPY | fdc.drive, 1);
fdc.inread = 1;
break;
@@ -1032,7 +1033,7 @@ bad_command:
floppy_writesector(fdc.drive, fdc.sector, fdc.params[1], fdc.head, fdc.rate, fdc.params[4]);
floppytime = 0;
fdc.written = 0;
update_status_bar_icon(SB_FLOPPY | fdc.drive, 1);
StatusBarUpdateIcon(SB_FLOPPY | fdc.drive, 1);
fdc.pos = 0;
if (fdc.pcjr)
fdc.stat = 0xb0;
@@ -1065,7 +1066,7 @@ bad_command:
floppy_comparesector(fdc.drive, fdc.sector, fdc.params[1], fdc.head, fdc.rate, fdc.params[4]);
floppytime = 0;
fdc.written = 0;
update_status_bar_icon(SB_FLOPPY | fdc.drive, 1);
StatusBarUpdateIcon(SB_FLOPPY | fdc.drive, 1);
fdc.pos = 0;
if (fdc.pcjr || !fdc.dma)
{
@@ -1109,7 +1110,7 @@ bad_command:
fdc.stat = 0x50;
}
floppytime = 0;
update_status_bar_icon(SB_FLOPPY | fdc.drive, 1);
StatusBarUpdateIcon(SB_FLOPPY | fdc.drive, 1);
fdc.inread = 1;
break;
@@ -1466,7 +1467,7 @@ void fdc_poll_common_finish(int compare, int st5)
fdc.res[9]=fdc.sector;
fdc.res[10]=fdc.params[4];
fdc_log("Read/write finish (%02X %02X %02X %02X %02X %02X %02X)\n" , fdc.res[4], fdc.res[5], fdc.res[6], fdc.res[7], fdc.res[8], fdc.res[9], fdc.res[10]);
update_status_bar_icon(SB_FLOPPY | fdc.drive, 0);
StatusBarUpdateIcon(SB_FLOPPY | fdc.drive, 0);
paramstogo=7;
}
@@ -1512,7 +1513,7 @@ void fdc_callback(void *priv)
return;
case 2: /*Read track*/
update_status_bar_icon(SB_FLOPPY | fdc.drive, 1);
StatusBarUpdateIcon(SB_FLOPPY | fdc.drive, 1);
fdc.eot[fdc.drive]--;
fdc.read_track_sector.id.r++;
if (!fdc.eot[fdc.drive] || fdc.tc)
@@ -1672,7 +1673,7 @@ void fdc_callback(void *priv)
{
fdc.sector++;
}
update_status_bar_icon(SB_FLOPPY | fdc.drive, 1);
StatusBarUpdateIcon(SB_FLOPPY | fdc.drive, 1);
switch (floppyint)
{
case 5:
@@ -1911,7 +1912,7 @@ void fdc_error(int st5, int st6)
fdc.res[10]=0;
break;
}
update_status_bar_icon(SB_FLOPPY | fdc.drive, 0);
StatusBarUpdateIcon(SB_FLOPPY | fdc.drive, 0);
paramstogo=7;
}
@@ -2142,7 +2143,7 @@ void fdc_sectorid(uint8_t track, uint8_t side, uint8_t sector, uint8_t size, uin
fdc.res[8]=side;
fdc.res[9]=sector;
fdc.res[10]=size;
update_status_bar_icon(SB_FLOPPY | fdc.drive, 0);
StatusBarUpdateIcon(SB_FLOPPY | fdc.drive, 0);
paramstogo=7;
}
@@ -2198,7 +2199,7 @@ void fdc_hard_reset()
for (i = 0; i < FDD_NUM; i++)
{
update_status_bar_icon(SB_FLOPPY | i, 0);
StatusBarUpdateIcon(SB_FLOPPY | i, 0);
}
}

View File

@@ -9,7 +9,7 @@
* Generic floppy disk interface that communicates with the
* other handlers.
*
* Version: @(#)floppy.c 1.0.5 2017/10/02
* Version: @(#)floppy.c 1.0.5 2017/10/05
*
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
* Miran Grca, <mgrca8@gmail.com>
@@ -25,6 +25,7 @@
#include "../rom.h"
#include "../config.h"
#include "../timer.h"
#include "../win/win.h"
#include "floppy.h"
#include "floppy_86f.h"
#include "floppy_fdi.h"
@@ -157,7 +158,7 @@ void floppy_load(int drive, wchar_t *fn)
drive_empty[drive] = 1;
fdd_set_head(real_drive(drive), 0);
memset(floppyfns[drive], 0, sizeof(floppyfns[drive]));
update_status_bar_icon_state(drive, 1);
StatusBarUpdateIconState(drive, 1);
}
void floppy_close(int drive)
@@ -176,7 +177,7 @@ void floppy_close(int drive)
drives[drive].format = NULL;
drives[drive].byteperiod = NULL;
drives[drive].stop = NULL;
update_status_bar_icon_state(drive, 1);
StatusBarUpdateIconState(drive, 1);
}
int floppy_notfound=0;

View File

@@ -10,7 +10,7 @@
* data in the form of FM/MFM-encoded transitions) which also
* forms the core of the emulator's floppy disk emulation.
*
* Version: @(#)floppy_86f.c 1.0.5 2017/10/02
* Version: @(#)floppy_86f.c 1.0.5 2017/10/05
*
* Author: Miran Grca, <mgrca8@gmail.com>
* Copyright 2016,2017 Miran Grca.
@@ -28,6 +28,7 @@
#include "../dma.h"
#include "../nvr.h"
#include "../random.h"
#include "../win/win.h"
#include "floppy.h"
#include "fdc.h"
#include "fdd.h"
@@ -3424,7 +3425,7 @@ void d86f_load(int drive, wchar_t *fn)
}
fclose(d86f[drive].f);
d86f[drive].f = NULL;
update_status_bar_icon_state(drive, 1);
StatusBarUpdateIconState(drive, 1);
return;
}
else

View File

@@ -164,7 +164,7 @@ void gameport_timer_over(void *p)
gameport->joystick->a0_over(gameport->joystick_dat);
}
void *gameport_init_common()
void *gameport_init_common(void)
{
gameport_t *gameport = malloc(sizeof(gameport_t));
@@ -193,7 +193,7 @@ void *gameport_init_common()
return gameport;
}
void gameport_update_joystick_type()
void gameport_update_joystick_type(void)
{
gameport_t *gameport = gameport_global;
@@ -205,7 +205,7 @@ void gameport_update_joystick_type()
}
}
void *gameport_init()
void *gameport_init(device_t *info)
{
gameport_t *gameport = NULL;
@@ -222,7 +222,7 @@ void *gameport_init()
return gameport;
}
void *gameport_201_init()
void *gameport_201_init(device_t *info)
{
gameport_t *gameport;
@@ -258,23 +258,19 @@ void gameport_close(void *p)
device_t gameport_device =
{
"Game port",
0,
0, 0,
gameport_init,
gameport_close,
NULL,
NULL,
NULL,
NULL, NULL, NULL, NULL,
NULL
};
device_t gameport_201_device =
{
"Game port (port 201h only)",
0,
0, 0,
gameport_201_init,
gameport_close,
NULL,
NULL,
NULL,
NULL, NULL, NULL, NULL,
NULL
};

View File

@@ -10,7 +10,7 @@
*
* !!!NOTE!!! The goal is to GET RID of this file. Do NOT add stuff !!
*
* Version: @(#)ibm.h 1.0.7 2017/10/02
* Version: @(#)ibm.h 1.0.8 2017/10/04
*
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
* Miran Grca, <mgrca8@gmail.com>
@@ -587,11 +587,11 @@ extern int scale;
extern void pclog(const char *format, ...);
extern void fatal(const char *format, ...);
extern wchar_t *pc_concat(wchar_t *str);
extern void pc_init_modules(void);
extern void pc_init(int argc, wchar_t *argv[]);
extern int pc_init_modules(void);
extern int pc_init(int argc, wchar_t *argv[]);
extern void pc_close(void);
extern void resetpchard_close(void);
extern void resetpchard_init(void);
extern void pc_reset_hard_close(void);
extern void pc_reset_hard_init(void);
extern void pc_reset_hard(void);
extern void pc_full_speed(void);
extern void pc_speed_changed(void);
@@ -635,20 +635,6 @@ extern void x86ts(char *s, uint16_t error);
extern void x87_dumpregs(void);
extern void x87_reset(void);
/* Platform functions. */
extern void update_status_bar_icon(int tag, int active);
extern void update_status_bar_icon_state(int tag, int state);
extern void status_settextw(wchar_t *wstr);
extern void status_settext(char *str);
#define SB_FLOPPY 0x00
#define SB_CDROM 0x10
#define SB_RDISK 0x20
#define SB_HDD 0x40
#define SB_NETWORK 0x50
#define SB_TEXT 0x60
#define UNUSED(x) (void)x
/* Configuration values. */
#define SERIAL_MAX 2

View File

@@ -8,7 +8,7 @@
*
* Implementation of the Intel 2 Mbit 8-bit flash devices.
*
* Version: @(#)intel_flash.c 1.0.4 2017/10/02
* Version: @(#)intel_flash.c 1.0.5 2017/10/04
*
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
* Miran Grca, <mgrca8@gmail.com>
@@ -307,54 +307,43 @@ void intel_flash_close(void *p)
free(flash);
}
device_t intel_flash_bxt_ami_device =
{
"Intel 28F001BXT Flash BIOS",
0,
0, 0,
intel_flash_bxt_ami_init,
intel_flash_close,
NULL,
NULL,
NULL,
NULL,
NULL
NULL,
NULL, NULL, NULL, NULL, NULL
};
device_t intel_flash_bxb_ami_device =
{
"Intel 28F001BXB Flash BIOS",
0,
0, 0,
intel_flash_bxb_ami_init,
intel_flash_close,
NULL,
NULL,
NULL,
NULL,
NULL
NULL,
NULL, NULL, NULL, NULL, NULL
};
device_t intel_flash_bxt_device =
{
"Intel 28F001BXT Flash BIOS",
0,
0, 0,
intel_flash_bxt_init,
intel_flash_close,
NULL,
NULL,
NULL,
NULL,
NULL
NULL,
NULL, NULL, NULL, NULL, NULL
};
device_t intel_flash_bxb_device =
{
"Intel 28F001BXB Flash BIOS",
0,
0, 0,
intel_flash_bxb_init,
intel_flash_close,
NULL,
NULL,
NULL,
NULL,
NULL
NULL,
NULL, NULL, NULL, NULL, NULL
};

View File

@@ -8,7 +8,7 @@
*
* Handling of the emulated machines.
*
* Version: @(#)machine.c 1.0.16 2017/09/30
* Version: @(#)machine.c 1.0.17 2017/10/04
*
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
* Miran Grca, <mgrca8@gmail.com>
@@ -172,14 +172,14 @@ machine_init(void)
AMSTRAD = AT = PCI = TANDY = 0;
io_init();
fdc_update_is_nsc(0);
machines[machine].init();
/* Load the machine's ROM BIOS. */
rom_load_bios(romset);
mem_add_bios();
if (machines[machine].get_device)
device_add(machines[machine].get_device());
machines[machine].init();
}

View File

@@ -24,16 +24,20 @@ void machine_at_init(void)
AT = 1;
machine_common_init();
pit_set_out_func(&pit, 1, pit_refresh_timer_at);
pic2_init();
dma16_init();
if (lpt_enabled)
lpt2_remove();
mem_add_bios();
pit_set_out_func(&pit, 1, pit_refresh_timer_at);
dma16_init();
keyboard_at_init();
nvr_at_init(8);
pic2_init();
keyboard_at_init();
if (joystick_type != 7)
device_add(&gameport_device);
if (bugger_enabled)
bugger_init();
}
@@ -41,17 +45,20 @@ void machine_at_init(void)
void machine_at_ide_init(void)
{
machine_at_init();
ide_init();
}
void machine_at_top_remap_init(void)
{
machine_at_init();
mem_remap_top_384k();
}
void machine_at_ide_top_remap_init(void)
{
machine_at_ide_init();
mem_remap_top_384k();
}

View File

@@ -21,8 +21,6 @@ void machine_common_init(void)
pic_init();
pit_init();
fdc_add();
if (lpt_enabled)
{
lpt_init();
@@ -37,4 +35,6 @@ void machine_common_init(void)
{
serial_setup(2, SERIAL2_ADDR, SERIAL2_IRQ);
}
fdc_add();
}

View File

@@ -10,7 +10,7 @@
*
* NOTE: The file will also implement an NE1000 for 8-bit ISA systems.
*
* Version: @(#)net_ne2000.c 1.0.15 2017/09/24
* Version: @(#)net_ne2000.c 1.0.16 2017/10/05
*
* Authors: Fred N. van Kempen, <decwiz@yahoo.com>
* Peter Grehan, grehan@iprg.nokia.com>
@@ -35,6 +35,7 @@
#include "../pic.h"
#include "../random.h"
#include "../device.h"
#include "../win/win.h"
#include "network.h"
#include "net_ne2000.h"
#include "bswap.h"
@@ -497,6 +498,7 @@ asic_write(nic_t *dev, uint32_t off, uint32_t val, unsigned len)
{
nelog(3, "%s: ASIC write addr=0x%02x, value=0x%04x\n",
dev->name, (unsigned)off, (unsigned) val);
switch(off) {
case 0x00: /* Data register - see asic_read for a description */
if ((len > 1) && (dev->DCR.wdsize == 0)) {
@@ -504,30 +506,25 @@ asic_write(nic_t *dev, uint32_t off, uint32_t val, unsigned len)
dev->name, len);
break;
}
if (dev->remote_bytes == 0) {
if (dev->remote_bytes == 0)
nelog(3, "%s: DMA write, byte count 0\n", dev->name);
}
chipmem_write(dev, dev->remote_dma, val, len);
if (len == 4) {
if (len == 4)
dev->remote_dma += len;
} else {
else
dev->remote_dma += (dev->DCR.wdsize + 1);
}
if (dev->remote_dma == dev->page_stop << 8) {
if (dev->remote_dma == dev->page_stop << 8)
dev->remote_dma = dev->page_start << 8;
}
if (len == 4) {
if (len == 4)
dev->remote_bytes -= len;
} else {
else
dev->remote_bytes -= (dev->DCR.wdsize + 1);
}
if (dev->remote_bytes > NE2K_MEMSIZ) {
if (dev->remote_bytes > NE2K_MEMSIZ)
dev->remote_bytes = 0;
}
/* If all bytes have been written, signal remote-DMA complete */
if (dev->remote_bytes == 0) {
@@ -1423,13 +1420,10 @@ nic_update_bios(nic_t *dev)
reg_bios_enable = 1;
if (!dev->has_bios) {
return;
}
if (! dev->has_bios) return;
if (PCI && dev->is_pci) {
if (PCI && dev->is_pci)
reg_bios_enable = dev->pci_bar[1].addr_regs[0] & 0x01;
}
/* PCI BIOS stuff, just enable_disable. */
if (reg_bios_enable) {
@@ -1654,26 +1648,22 @@ static int
mcast_index(const void *dst)
{
#define POLYNOMIAL 0x04c11db6
unsigned long crc = 0xffffffffL;
int carry, i, j;
unsigned char b;
unsigned char *ep = (unsigned char *) dst;
uint32_t crc = 0xffffffffL;
int carry, i, j;
uint8_t b;
uint8_t *ep = (uint8_t *)dst;
for (i = 6; --i >= 0;)
{
b = *ep++;
for (j = 8; --j >= 0;)
{
carry = ((crc & 0x80000000L) ? 1 : 0) ^ (b & 0x01);
crc <<= 1;
b >>= 1;
if (carry)
{
crc = ((crc ^ POLYNOMIAL) | carry);
}
}
for (i=6; --i>=0;) {
b = *ep++;
for (j = 8; --j >= 0;) {
carry = ((crc & 0x80000000L) ? 1 : 0) ^ (b & 0x01);
crc <<= 1;
b >>= 1;
if (carry)
crc = ((crc ^ POLYNOMIAL) | carry);
}
return (crc >> 26);
}
return(crc >> 26);
#undef POLYNOMIAL
}
@@ -1681,7 +1671,7 @@ mcast_index(const void *dst)
static void
nic_tx(nic_t *dev, uint32_t val)
{
update_status_bar_icon(SB_NETWORK, 1);
StatusBarUpdateIcon(SB_NETWORK, 1);
dev->CR.tx_packet = 0;
dev->TSR.tx_ok = 1;
@@ -1692,7 +1682,7 @@ nic_tx(nic_t *dev, uint32_t val)
nic_interrupt(dev, 1);
dev->tx_timer_active = 0;
update_status_bar_icon(SB_NETWORK, 0);
StatusBarUpdateIcon(SB_NETWORK, 0);
}
@@ -1713,7 +1703,7 @@ nic_rx(void *priv, uint8_t *buf, int io_len)
int idx, nextpage;
int endbytes;
update_status_bar_icon(SB_NETWORK, 1);
StatusBarUpdateIcon(SB_NETWORK, 1);
if (io_len != 60)
nelog(2, "%s: rx_frame with length %d\n", dev->name, io_len);
@@ -1744,14 +1734,14 @@ nic_rx(void *priv, uint8_t *buf, int io_len)
) {
nelog(1, "%s: no space\n", dev->name);
update_status_bar_icon(SB_NETWORK, 0);
StatusBarUpdateIcon(SB_NETWORK, 0);
return;
}
if ((io_len < 40/*60*/) && !dev->RCR.runts_ok) {
nelog(1, "%s: rejected small packet, length %d\n", dev->name, io_len);
update_status_bar_icon(SB_NETWORK, 0);
StatusBarUpdateIcon(SB_NETWORK, 0);
return;
}
@@ -1773,7 +1763,7 @@ nic_rx(void *priv, uint8_t *buf, int io_len)
if (! dev->RCR.broadcast) {
nelog(2, "%s: RX BC disabled\n", dev->name);
update_status_bar_icon(SB_NETWORK, 0);
StatusBarUpdateIcon(SB_NETWORK, 0);
return;
}
}
@@ -1786,7 +1776,7 @@ nic_rx(void *priv, uint8_t *buf, int io_len)
nelog(2, "%s: RX MC disabled\n", dev->name);
#endif
update_status_bar_icon(SB_NETWORK, 0);
StatusBarUpdateIcon(SB_NETWORK, 0);
return;
}
@@ -1795,7 +1785,7 @@ nic_rx(void *priv, uint8_t *buf, int io_len)
if (! (dev->mchash[idx>>3] & (1<<(idx&0x7)))) {
nelog(2, "%s: RX MC not listed\n", dev->name);
update_status_bar_icon(SB_NETWORK, 0);
StatusBarUpdateIcon(SB_NETWORK, 0);
return;
}
}
@@ -1841,7 +1831,7 @@ nic_rx(void *priv, uint8_t *buf, int io_len)
if (dev->IMR.rx_inte)
nic_interrupt(dev, 1);
update_status_bar_icon(SB_NETWORK, 0);
StatusBarUpdateIcon(SB_NETWORK, 0);
}
@@ -1851,35 +1841,32 @@ nic_rom_init(nic_t *dev, wchar_t *s)
uint32_t temp;
FILE *f;
if (s == NULL)
{
if (s == NULL) return;
if (dev->bios_addr == 0) return;
if ((f = rom_fopen(s, L"rb")) != NULL) {
fseek(f, 0L, SEEK_END);
temp = ftell(f);
fclose(f);
dev->bios_size = 0x10000;
if (temp <= 0x8000)
dev->bios_size = 0x8000;
if (temp <= 0x4000)
dev->bios_size = 0x4000;
if (temp <= 0x2000)
dev->bios_size = 0x2000;
dev->bios_mask = (dev->bios_size >> 8) & 0xff;
dev->bios_mask = (0x100 - dev->bios_mask) & 0xff;
} else {
dev->bios_addr = 0x00000;
dev->bios_size = 0;
return;
}
if (dev->bios_addr > 0) {
if ((f = rom_fopen(s, L"rb")) != NULL) {
fseek(f, 0L, SEEK_END);
temp = ftell(f);
fclose(f);
dev->bios_size = 0x10000;
if (temp <= 0x8000)
dev->bios_size = 0x8000;
if (temp <= 0x4000)
dev->bios_size = 0x4000;
if (temp <= 0x2000)
dev->bios_size = 0x2000;
dev->bios_mask = (dev->bios_size >> 8) & 0xff;
dev->bios_mask = (0x100 - dev->bios_mask) & 0xff;
} else {
dev->bios_addr = 0x00000;
dev->bios_size = 0;
return;
}
/* Create a memory mapping for the space. */
rom_init(&dev->bios_rom, s, dev->bios_addr,
dev->bios_size, dev->bios_size-1, 0, MEM_MAPPING_EXTERNAL);
}
/* Create a memory mapping for the space. */
rom_init(&dev->bios_rom, s, dev->bios_addr,
dev->bios_size, dev->bios_size-1, 0, MEM_MAPPING_EXTERNAL);
nelog(1, "%s: BIOS configured at %06lX (size %ld)\n",
dev->name, dev->bios_addr, dev->bios_size);
@@ -1939,13 +1926,9 @@ nic_init(int board)
dev->bios_addr = device_get_config_hex20("bios_addr");
if (dev->bios_addr)
{
dev->has_bios = 1;
}
else
{
else
dev->has_bios = 0;
}
/* See if we have a local MAC address configured. */
mac = device_get_config_mac("mac", -1);
@@ -2083,21 +2066,21 @@ nic_close(void *priv)
static void *
ne1000_init(void)
ne1000_init(device_t *info)
{
return(nic_init(NE2K_NE1000));
}
static void *
ne2000_init(void)
ne2000_init(device_t *info)
{
return(nic_init(NE2K_NE2000));
}
static void *
rtl8029as_init(void)
rtl8029as_init(device_t *info)
{
return(nic_init(NE2K_RTL8029AS));
}
@@ -2296,35 +2279,26 @@ static device_config_t rtl8029as_config[] =
device_t ne1000_device = {
"Novell NE1000",
0,
ne1000_init,
nic_close,
NULL,
NULL,
NULL,
NULL,
NE2K_NE1000,
ne1000_init, nic_close, NULL,
NULL, NULL, NULL, NULL,
ne1000_config
};
device_t ne2000_device = {
"Novell NE2000",
0,
ne2000_init,
nic_close,
NULL,
NULL,
NULL,
NULL,
DEVICE_AT,
NE2K_NE2000,
ne2000_init, nic_close, NULL,
NULL, NULL, NULL, NULL,
ne2000_config
};
device_t rtl8029as_device = {
"Realtek RTL8029AS",
0,
rtl8029as_init,
nic_close,
NULL,
NULL,
NULL,
NULL,
NE2K_RTL8029AS,
rtl8029as_init, nic_close, NULL,
NULL, NULL, NULL, NULL,
rtl8029as_config
};

View File

@@ -12,7 +12,7 @@
* it should be malloc'ed and then linked to the NETCARD def.
* Will be done later.
*
* Version: @(#)network.c 1.0.11 2017/09/24
* Version: @(#)network.c 1.0.12 2017/10/04
*
* Author: Fred N. van Kempen, <decwiz@yahoo.com>
*/
@@ -43,12 +43,12 @@ static netcard_t net_cards[] = {
/* Global variables. */
int network_card;
int network_type;
int network_ndev;
int nic_do_log;
int network_card;
netdev_t network_devs[32];
char network_pcap[512];
int nic_do_log;
/*
@@ -69,10 +69,9 @@ network_init(void)
nic_do_log = 0;
#endif
#if 0
/* Initialize to a known state. */
network_type = NET_TYPE_NONE;
network_card = 0;
#endif
/* Create a first device entry that's always there, as needed by UI. */
strcpy(network_devs[0].device, "none");

130
src/nvr.c
View File

@@ -397,6 +397,9 @@ onesec_timer(void *priv)
/* Update the system RTC. */
rtc_tick();
if (nvr->hook != NULL)
(*nvr->hook)(nvr);
/* Re-calculate the timer. */
nvr_recalc();
@@ -455,7 +458,8 @@ update_timer(void *priv)
nvr->regs[RTC_REGC] |= REGC_IRQF;
/* Generate an interrupt. */
picint(1<<nvr->irq);
if (nvr->irq != -1)
picint(1<<nvr->irq);
}
}
@@ -468,7 +472,8 @@ update_timer(void *priv)
nvr->regs[RTC_REGC] |= REGC_IRQF;
/* Generate an interrupt. */
picint(1<<nvr->irq);
if (nvr->irq != -1)
picint(1<<nvr->irq);
}
}
@@ -496,7 +501,8 @@ ticker_timer(void *priv)
nvr->regs[RTC_REGC] |= REGC_IRQF;
/* Generate an interrupt. */
picint(1<<nvr->irq);
if (nvr->irq != -1)
picint(1<<nvr->irq);
}
}
@@ -642,107 +648,101 @@ nvr_recalc(void)
}
/* Load an NVR from file. */
void
/*
* Load an NVR from file.
*
* This function does two things, really. It clear and initializes
* the RTC and NVRAM areas, sets up defaults for the RTC part, and
* then attempts to load data from a saved file.
*
* Either way, after that loading, it will continue to configure
* the local RTC to operate, so it can update either the local RTC,
* and/or the supplied by a client.
*/
int
nvr_load(void)
{
FILE *f;
int c;
/* Make sure we have been initialized. */
if (saved_nvr == NULL) return;
if (saved_nvr == NULL) return(0);
/* Clear out any old data. */
memset(saved_nvr->regs, 0xff, sizeof(saved_nvr->regs));
/* Set the defaults. */
memset(saved_nvr->regs, 0x00, RTC_REGS);
saved_nvr->regs[RTC_DOM] = 1;
saved_nvr->regs[RTC_MONTH] = 1;
saved_nvr->regs[RTC_YEAR] = RTC_BCD(80);
saved_nvr->regs[RTC_CENTURY] = RTC_BCD(19);
#if 0
europc_load_nvr();
if (saved_nvr->load)
(*saved_nvr->load();
return;
}
#endif
f = NULL;
if (saved_nvr->mask != 0) {
pclog("Opening NVR file: %ws...\n", saved_nvr->fname);
f = _wfopen(nvr_path(saved_nvr->fname), L"rb");
}
if (f==NULL || saved_nvr->mask==0) {
if (f != NULL)
fclose(f);
/* No file loaded, or no file available. */
if (! enable_sync) {
/* No time-sync enabled, so just set the defaults. */
saved_nvr->regs[RTC_SECONDS] = 0;
saved_nvr->regs[RTC_MINUTES] = 0;
saved_nvr->regs[RTC_HOURS] = 0;
saved_nvr->regs[RTC_DOM] = 1;
saved_nvr->regs[RTC_MONTH] = 1;
saved_nvr->regs[RTC_YEAR] = RTC_BCD(80);
saved_nvr->regs[RTC_REGB] = REGB_2412;
saved_nvr->regs[RTC_CENTURY] = RTC_BCD(19);
if (saved_nvr->load == NULL) {
/* We are responsible for loading. */
f = NULL;
if (saved_nvr->mask != 0) {
pclog("Opening NVR file: %ws...\n", saved_nvr->fname);
f = _wfopen(nvr_path(saved_nvr->fname), L"rb");
}
return;
if (f != NULL) {
/* Read NVR contents from file. */
fread(saved_nvr->regs, sizeof(saved_nvr->regs), 1, f);
(void)fclose(f);
}
} else {
/* OK, use alternate function. */
(*saved_nvr->load)(saved_nvr->fname);
}
/* Read NVR contents from file. */
fread(saved_nvr->regs, sizeof(saved_nvr->regs), 1, f);
(void)fclose(f);
/* Update the internal clock state based on the NVR registers. */
if (enable_sync)
rtc_sync(saved_nvr->regs);
else
rtc_setnvr(saved_nvr->regs);
saved_nvr->regs[RTC_REGA] = 0x06;
/* Get the local RTC running! */
saved_nvr->regs[RTC_REGA] = (REGA_RS2|REGA_RS1);
saved_nvr->regs[RTC_REGB] = REGB_2412;
c = 1 << ((saved_nvr->regs[RTC_REGA] & REGA_RS) - 1);
saved_nvr->rtctime += (int)(RTCCONST * c * (1<<TIMER_SHIFT));
return(1);
}
/* Save the current NVR to a file. */
void
int
nvr_save(void)
{
FILE *f;
/* Make sure we have been initialized. */
if (saved_nvr == NULL) return;
if (saved_nvr == NULL) return(0);
#if 0
europc_save_nvr();
if (saved_nvr->save == NULL) {
/* We are responsible for saving. */
f = NULL;
if (saved_nvr->mask != 0) {
pclog("Saving NVR file: %ws...\n", saved_nvr->fname);
f = _wfopen(nvr_path(saved_nvr->fname), L"wb");
}
if (saved_nvr->save)
(*saved_nvr->save)();
return;
if (f != NULL) {
/* Save NVR contents to file. */
(void)fwrite(saved_nvr->regs, sizeof(saved_nvr->regs), 1, f);
(void)fclose(f);
}
} else {
/* OK, use alternate function. */
(*saved_nvr->save)(saved_nvr->fname);
}
#endif
f = NULL;
if (saved_nvr->mask != 0) {
pclog("Saving NVR file: %ws...\n", saved_nvr->fname);
f = _wfopen(nvr_path(saved_nvr->fname), L"wb");
}
if (f==NULL || saved_nvr->mask==0) {
if (f != NULL)
fclose(f);
return;
}
(void)fwrite(saved_nvr->regs, sizeof(saved_nvr->regs), 1, f);
(void)fclose(f);
/* Device is clean again. */
nvr_dosave = 0;
return(1);
}

View File

@@ -76,6 +76,12 @@
typedef struct _nvr_ {
uint8_t regs[RTC_REGS+114]; /* these are the registers */
int mask,
irq,
addr;
wchar_t *fname;
int upd_stat,
upd_ecount,
onesec_time,
@@ -83,14 +89,16 @@ typedef struct _nvr_ {
rtctime,
oldmachine;
int mask,
irq,
addr;
/* Hooks to internal RTC I/O functions. */
void (*set)(struct _nvr_ *, uint16_t, uint8_t);
uint8_t (*get)(struct _nvr_ *, uint16_t);
wchar_t *fname;
/* Hooks to alternative load/save functions. */
int8_t (*load)(wchar_t *fname);
int8_t (*save)(wchar_t *fname);
/* Hook to RTC ticker handler. */
void (*hook)(struct _nvr_ *);
} nvr_t;
@@ -99,8 +107,8 @@ extern int nvr_dosave;
extern void nvr_init(nvr_t *);
extern void nvr_load(void);
extern void nvr_save(void);
extern int nvr_load(void);
extern int nvr_save(void);
extern void nvr_recalc(void);
extern wchar_t *nvr_path(wchar_t *str);

View File

@@ -14,7 +14,7 @@
* of those batteries would create corrosion issues later on
* in mainboard life...
*
* Version: @(#)nvr_at.c 1.0.5 2017/10/02
* Version: @(#)nvr_at.c 1.0.6 2017/10/04
*
* Authors: Miran Grca, <mgrca8@gmail.com>
* Fred N. van Kempen, <decwiz@yahoo.com>
@@ -105,4 +105,7 @@ nvr_at_init(int irq)
/* Set up the PC/AT handler for this device. */
io_sethandler(0x0070, 2,
nvr_read, NULL, NULL, nvr_write, NULL, NULL, nvr);
/* Load the NVR into memory! */
(void)nvr_load();
}

View File

@@ -54,7 +54,7 @@ static void ps2_nvr_write(uint16_t port, uint8_t val, void *p)
}
}
static void *ps2_nvr_init()
static void *ps2_nvr_init(device_t *info)
{
ps2_nvr_t *nvr = (ps2_nvr_t *)malloc(sizeof(ps2_nvr_t));
FILE *f = NULL;
@@ -100,10 +100,9 @@ device_t ps2_nvr_device =
{
"PS/2 NVRRAM",
0,
0,
ps2_nvr_init,
ps2_nvr_close,
NULL,
NULL,
NULL,
NULL
NULL,
NULL, NULL, NULL, NULL
};

268
src/pc.c
View File

@@ -8,7 +8,7 @@
*
* Emulation core dispatcher.
*
* Version: @(#)pc.c 1.0.16 2017/10/01
* Version: @(#)pc.c 1.0.17 2017/10/04
*
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
* Miran Grca, <mgrca8@gmail.com>
@@ -26,6 +26,7 @@
#include "86box.h"
#include "config.h"
#include "ibm.h"
#include "io.h"
#include "mem.h"
#include "rom.h"
#include "cpu/codegen.h"
@@ -71,6 +72,7 @@
#include "win/plat_mouse.h"
#include "win/plat_ui.h"
#include "win/win.h"
#include "win/win_language.h"
#include "scsi/scsi.h"
#include "serial.h"
#include "sound/sound.h"
@@ -189,20 +191,6 @@ pc_concat(wchar_t *str)
}
static void
usage(void)
{
printf("Command line options:\n\n");
printf("--config file.cfg - use given file as initial configuration\n");
printf("--dump - always dump memory on exit\n");
printf("--fullscreen - start in fullscreen mode\n");
printf("--vmpath pathname - set 'path' to be root for vm\n");
exit(-1);
/*NOTREACHED*/
}
/*
* Perform initial startup of the PC.
*
@@ -210,7 +198,7 @@ usage(void)
* where we check commandline arguments and loading a
* configuration file.
*/
void
int
pc_init(int argc, wchar_t *argv[])
{
wchar_t *cfg = NULL;
@@ -225,7 +213,6 @@ pc_init(int argc, wchar_t *argv[])
get_executable_name(exe_path, sizeof(exe_path)-1);
p = get_filename_w(exe_path);
*p = L'\0';
pclog("exe_path=%ws\n", exe_path);
/*
* Get the current working directory.
@@ -239,8 +226,12 @@ pc_init(int argc, wchar_t *argv[])
for (c=1; c<argc; c++) {
if (! _wcsicmp(argv[c], L"--help")) {
usage:
usage();
/*NOTRECHED*/
printf("\nCommand line options:\n\n");
printf("--config file.cfg - use given file as configuration\n");
printf("--dump - always dump memory on exit\n");
printf("--fullscreen - start in fullscreen mode\n");
printf("--vmpath pathname - set 'path' to be root for vm\n");
return(0);
} else if (!_wcsicmp(argv[c], L"--config") ||
!_wcsicmp(argv[c], L"-C")) {
if ((c+1) == argc) break;
@@ -270,8 +261,7 @@ usage:
#endif
/* .. and then exit. */
exit(0);
/*NOTREACHED*/
return(0);
} else if (!_wcsicmp(argv[c], L"--vmpath") ||
!_wcsicmp(argv[c], L"-P")) {
if ((c+1) == argc) break;
@@ -283,7 +273,14 @@ usage:
else goto usage;
}
/*
* This is where we start outputting to the log file,
* if there is one. Maybe we should log a header with
* application build info and such? --FvK
*/
/* Make sure cfg_path has a trailing backslash. */
pclog("exe_path=%ws\n", exe_path);
if ((cfg_path[wcslen(cfg_path)-1] != L'\\') &&
(cfg_path[wcslen(cfg_path)-1] != L'/')) {
wcscat(cfg_path, L"\\");
@@ -318,8 +315,13 @@ usage:
* modules before we load the config..
*/
hdd_init();
network_init();
/* Load the configuration file. */
config_load(cfg);
/* All good! */
return(1);
}
@@ -354,52 +356,114 @@ pc_speed_changed(void)
/* Initialize modules, ran once, after pc_init. */
void
int
pc_init_modules(void)
{
int i;
int c, i;
pclog("Scanning for ROM images:\n");
c = 0;
for (i=0; i<ROM_MAX; i++) {
romspresent[i] = rom_load_bios(i);
c += romspresent[i];
}
if (c == 0) {
/* No usable ROMs found, aborting. */
return(0);
}
pclog("A total of %d ROM sets have been loaded.\n", c);
/*
* Load the ROMs for the selected machine.
*
* FIXME:
* We should not do that here. If something turns out
* to be wrong with the configuration (such as missing
* ROM images, we should just display a fatal message
* in the render window's center, let them click OK,
* and then exit so they can remedy the situation.
*/
again:
if (! rom_load_bios(romset)) {
/* Whoops, ROMs not found. */
if (romset != -1)
msgbox_info(hwndMain, IDS_2063);
/* Select another machine to use. */
for (c=0; c<ROM_MAX; c++) {
if (romspresent[c]) {
romset = c;
machine = machine_getmachine(romset);
config_save();
/* This can loop if all ROMs are now bad.. */
goto again;
}
}
}
/* Make sure we have a usable video card. */
for (c=0; c<GFX_MAX; c++)
gfx_present[c] = video_card_available(video_old_to_new(c));
again2:
if (! video_card_available(video_old_to_new(gfxcard))) {
if (romset != -1) {
msgbox_info(hwndMain, IDS_2064);
}
for (c=GFX_MAX-1; c>=0; c--) {
if (gfx_present[c]) {
gfxcard = c;
config_save();
/* This can loop if all cards now bad.. */
goto again2;
}
}
}
cpuspeed2 = (AT) ? 2 : 1;
atfullspeed = 0;
random_init();
mem_init();
codegen_init();
rom_load_bios(romset);
mem_add_bios();
mouse_init();
#ifdef WALTJE
serial_init();
#endif
joystick_init();
video_init();
ide_init_first();
#if 1
/* should be in cdrom.c */
cdrom_init_host_drives();
for (c=0; c<CDROM_NUM; c++) {
if (cdrom_drives[c].bus_type) {
SCSIReset(cdrom_drives[c].scsi_device_id, cdrom_drives[c].scsi_device_lun);
}
if (cdrom_drives[c].host_drive == 200) {
image_open(c, cdrom_image[c].image_path);
} else
if ((cdrom_drives[c].host_drive>='A') && (cdrom_drives[c].host_drive <= 'Z'))
{
ioctl_open(c, cdrom_drives[c].host_drive);
} else {
cdrom_null_open(c, cdrom_drives[c].host_drive);
}
}
#endif
device_init();
timer_reset();
for (i=0; i<CDROM_NUM; i++) {
if (cdrom_drives[i].bus_type) {
SCSIReset(cdrom_drives[i].scsi_device_id, cdrom_drives[i].scsi_device_lun);
}
if (cdrom_drives[i].host_drive == 200) {
image_open(i, cdrom_image[i].image_path);
} else
if ((cdrom_drives[i].host_drive>='A') && (cdrom_drives[i].host_drive <= 'Z'))
{
ioctl_open(i, cdrom_drives[i].host_drive);
} else {
cdrom_null_open(i, cdrom_drives[i].host_drive);
}
}
sound_reset();
#if 1
@@ -418,8 +482,6 @@ pc_init_modules(void)
floppy_load(2, floppyfns[2]);
floppy_load(3, floppyfns[3]);
#endif
nvr_load();
sound_init();
@@ -427,10 +489,6 @@ pc_init_modules(void)
ide_reset();
scsi_card_init();
pc_full_speed();
for (i=0; i<CDROM_NUM; i++) {
if (cdrom_drives[i].host_drive == 200) {
image_reset(i);
@@ -440,30 +498,17 @@ pc_init_modules(void)
}
}
scsi_card_init();
pc_full_speed();
shadowbios = 0;
return(1);
}
void
pc_reset(void)
{
cpu_set();
resetx86();
dma_reset();
fdc_reset();
pic_reset();
serial_reset();
if (AT)
setpitclock(machines[machine].cpu[cpu_manufacturer].cpus[cpu].rspeed);
else
setpitclock(14318184.0);
shadowbios = 0;
}
void
/* Insert keystrokes into the machine's keyboard buffer. */
static void
pc_keyboard_send(uint8_t val)
{
if (AT)
@@ -473,6 +518,7 @@ pc_keyboard_send(uint8_t val)
}
/* Send the machine a Control-Alt-DEL sequence. */
void
pc_send_cad(void)
{
@@ -485,6 +531,7 @@ pc_send_cad(void)
}
/* Send the machine a Control-Alt-ESC sequence. */
void
pc_send_cae(void)
{
@@ -498,7 +545,7 @@ pc_send_cae(void)
void
resetpchard_close(void)
pc_reset_hard_close(void)
{
suppress_overscan = 0;
@@ -510,35 +557,70 @@ resetpchard_close(void)
}
/*
* This is basically the spot where we start up the actual machine,
* by issuing a 'hard reset' to the entire configuration. Order is
* somewhat important here. Functions here should be named _reset
* really, as that is what they do.
*/
void
resetpchard_init(void)
pc_reset_hard_init(void)
{
int i;
/* First, we reset the modules that are not part of the
* actual machine, but which support some of the modules
* that are.
*/
sound_realloc_buffers();
sound_cd_thread_reset();
initalmain(0, NULL);
initalmain(0,NULL);
/* Reset the general machine support modules. */
mem_resize();
io_init();
device_init();
timer_reset();
midi_device_init();
inital();
timer_reset();
sound_reset();
mem_resize();
fdc_init();
fdc_update_is_nsc(0);
floppy_reset();
#ifndef WALTJE
serial_init();
#endif
/* Initialize the actual machine and its basic modules. */
machine_init();
video_reset();
/*
* Once the machine has been initialized, all that remains
* should be resetting all devices set up for it, to their
* current configurations !
*
* For, we will call their reset functions here, but that
* will be a call to device_reset_all() later !
*/
/* Reset some basic devices. */
speaker_init();
serial_reset();
lpt1_device_init();
/* Reset keyboard and/or mouse. */
keyboard_at_reset();
mouse_emu_init();
/* Reset the video card. */
video_reset();
/* Reset the Floppy Disk controller. */
fdc_reset();
/* Reset the Hard Disk Controller module. */
hdc_reset();
/* Reconfire and reset the IDE layer. */
ide_ter_disable();
ide_qua_disable();
if (ide_enable[2])
@@ -547,9 +629,13 @@ resetpchard_init(void)
ide_qua_init();
ide_reset();
/* Reset and reconfigure the SCSI layer. */
scsi_card_init();
/* Reset and reconfigure the Network Card layer. */
network_reset();
/* Reset and reconfigure the Sound Card layer. */
sound_card_init();
if (mpu401_standalone_enable)
mpu401_device_add();
@@ -562,16 +648,18 @@ resetpchard_init(void)
if (voodoo_enabled)
device_add(&voodoo_device);
pc_reset();
/* Reset the CPU module. */
cpu_set();
resetx86();
dma_reset();
pic_reset();
mouse_emu_init();
nvr_load();
if (AT)
setpitclock(machines[machine].cpu[cpu_manufacturer].cpus[cpu].rspeed);
else
setpitclock(14318184.0);
shadowbios = 0;
keyboard_at_reset();
cpu_cache_int_enabled = cpu_cache_ext_enabled = 0;
for (i=0; i<CDROM_NUM; i++) {
@@ -583,17 +671,15 @@ resetpchard_init(void)
ioctl_reset(i);
}
}
sound_cd_thread_reset();
}
void
pc_reset_hard(void)
{
resetpchard_close();
pc_reset_hard_close();
resetpchard_init();
pc_reset_hard_init();
}

View File

@@ -8,7 +8,7 @@
*
* Handling of the SCSI controllers.
*
* Version: @(#)scsi.c 1.0.6 2017/10/01
* Version: @(#)scsi.c 1.0.7 2017/10/03
*
* Authors: TheCollector1995, <mariogplayer@gmail.com>
* Miran Grca, <mgrca8@gmail.com>
@@ -54,6 +54,7 @@ typedef struct {
static SCSI_CARD scsi_cards[] = {
{ "None", "none", NULL, NULL },
{ "Adaptec AHA-1540B", "aha1540b", &aha1540b_device, aha_device_reset },
{ "Adaptec AHA-1542C", "aha1542c", &aha1542c_device, aha_device_reset },
{ "Adaptec AHA-1542CF", "aha1542cf", &aha1542cf_device, aha_device_reset },
{ "Adaptec AHA-1640", "aha1640", &aha1640_device, aha_device_reset },
{ "BusLogic BT-545C", "bt545c", &buslogic_device, BuslogicDeviceReset },

View File

@@ -8,7 +8,7 @@
*
* SCSI controller handler header.
*
* Version: @(#)scsi_h 1.0.5 2017/08/27
* Version: @(#)scsi_h 1.0.6 2017/10/04
*
* Authors: TheCollector1995, <mariogplayer@gmail.com>
* Miran Grca, <mgrca8@gmail.com>
@@ -281,7 +281,7 @@ extern int scsi_card_current;
extern int scsi_card_available(int card);
extern char *scsi_card_getname(int card);
extern struct device_t *scsi_card_getdevice(int card);
extern device_t *scsi_card_getdevice(int card);
extern int scsi_card_has_config(int card);
extern char *scsi_card_get_internal_name(int card);
extern int scsi_card_get_from_internal_name(char *s);

View File

@@ -12,7 +12,7 @@
*
* NOTE: THIS IS CURRENTLY A MESS, but will be cleaned up as I go.
*
* Version: @(#)scsi_aha154x.c 1.0.19 2017/10/02
* Version: @(#)scsi_aha154x.c 1.0.20 2017/10/04
*
* Authors: Fred N. van Kempen, <decwiz@yahoo.com>
* Original Buslogic version by SA1988 and Miran Grca.
@@ -369,7 +369,6 @@ typedef struct {
} Req_t;
#pragma pack(pop)
#pragma pack(push,1)
typedef struct {
int8_t type; /* type of device */
char name[16]; /* name of device */
@@ -425,7 +424,6 @@ typedef struct {
int Lock;
event_t *evt;
} aha_t;
#pragma pack(pop)
static uint16_t aha_ports[] = {
@@ -2043,7 +2041,7 @@ aha_init(int type)
case AHA_154xC:
strcpy(dev->name, "AHA-154xC");
dev->bios_path = L"roms/scsi/adaptec/aha1542c101.bin";
dev->bios_path = L"roms/scsi/adaptec/aha1542c102.bin";
dev->bid = 'D';
dev->rom_shram = 0x3F80; /* shadow RAM address base */
dev->rom_shramsz = 128; /* size of shadow RAM */
@@ -2114,21 +2112,28 @@ aha_init(int type)
static void *
aha_154xB_init(void)
aha_154xB_init(device_t *info)
{
return(aha_init(AHA_154xB));
}
static void *
aha_154xCF_init(void)
aha_154xC_init(device_t *info)
{
return(aha_init(AHA_154xC));
}
static void *
aha_154xCF_init(device_t *info)
{
return(aha_init(AHA_154xCF));
}
static void *
aha_1640_init(void)
aha_1640_init(device_t *info)
{
return(aha_init(AHA_1640));
}
@@ -2272,34 +2277,54 @@ static device_config_t aha_154x_config[] = {
device_t aha1540b_device = {
"Adaptec AHA-1540B",
0,
0,
aha_154xB_init,
aha_close,
NULL,
NULL,
NULL,
NULL,
NULL,
aha_154x_config
};
device_t aha1542c_device = {
"Adaptec AHA-1542C",
0,
0,
aha_154xC_init,
aha_close,
NULL,
NULL,
NULL,
NULL,
NULL,
aha_154x_config
};
device_t aha1542cf_device = {
"Adaptec AHA-1542CF",
0,
0,
aha_154xCF_init,
aha_close,
NULL,
NULL,
NULL,
NULL,
NULL,
aha_154x_config
};
device_t aha1640_device = {
"Adaptec AHA-1640",
DEVICE_MCA,
0,
aha_1640_init,
aha_close,
NULL,
NULL,
NULL,
NULL,
NULL
};

View File

@@ -3,6 +3,7 @@
extern device_t aha1540b_device;
extern device_t aha1542c_device;
extern device_t aha1542cf_device;
extern device_t aha1640_device;

View File

@@ -8,7 +8,7 @@
*
* The shared AHA and Buslogic SCSI BIOS command handler.
*
* Version: @(#)scsi_bios_command.c 1.0.2 2017/09/24
* Version: @(#)scsi_bios_command.c 1.0.3 2017/10/04
*
* Authors: TheCollector1995, <mariogplayer@gmail.com>
* Miran Grca, <mgrca8@gmail.com>
@@ -24,6 +24,7 @@
#include <wchar.h>
#include "../ibm.h"
#include "../dma.h"
#include "../device.h"
#include "scsi.h"
#include "scsi_bios_command.h"
#include "scsi_device.h"

View File

@@ -10,7 +10,7 @@
* 0 - BT-545C ISA;
* 1 - BT-958D PCI (but BT-545C ISA on non-PCI machines)
*
* Version: @(#)scsi_buslogic.c 1.0.15 2017/10/02
* Version: @(#)scsi_buslogic.c 1.0.16 2017/10/04
*
* Authors: TheCollector1995, <mariogplayer@gmail.com>
* Miran Grca, <mgrca8@gmail.com>
@@ -3019,14 +3019,14 @@ BuslogicInit(int chip)
static void *
Buslogic_545C_Init(void)
Buslogic_545C_Init(device_t *info)
{
return BuslogicInit(CHIP_BUSLOGIC_ISA);
}
static void *
Buslogic_958D_Init(void)
Buslogic_958D_Init(device_t *info)
{
return BuslogicInit(CHIP_BUSLOGIC_PCI);
}
@@ -3143,23 +3143,27 @@ static device_config_t BuslogicConfig[] = {
device_t buslogic_device = {
"Buslogic BT-545C ISA",
0,
0,
Buslogic_545C_Init,
BuslogicClose,
NULL,
NULL,
NULL,
NULL,
NULL,
BuslogicConfig
};
device_t buslogic_pci_device = {
"Buslogic BT-958D PCI",
0,
0,
Buslogic_958D_Init,
BuslogicClose,
NULL,
NULL,
NULL,
NULL,
NULL,
BuslogicConfig
};

View File

@@ -8,7 +8,7 @@
*
* The generic SCSI device command handler.
*
* Version: @(#)scsi_device.c 1.0.4 2017/10/01
* Version: @(#)scsi_device.c 1.0.5 2017/10/04
*
* Authors: Miran Grca, <mgrca8@gmail.com>
* Fred N. van Kempen, <decwiz@yahoo.com>
@@ -20,6 +20,7 @@
#include <string.h>
#include <wchar.h>
#include "../ibm.h"
#include "../device.h"
#include "../cdrom/cdrom.h"
#include "../disk/hdd.h"
#include "scsi.h"

View File

@@ -6,7 +6,7 @@
*
* Emulation of SCSI fixed and removable disks.
*
* Version: @(#)scsi_disk.c 1.0.9 2017/10/01
* Version: @(#)scsi_disk.c 1.0.9 2017/10/05
*
* Author: Miran Grca, <mgrca8@gmail.com>
* Copyright 2017 Miran Grca.
@@ -26,6 +26,7 @@
#include "../disk/hdd.h"
#include "../disk/hdc.h"
#include "../disk/hdc_ide.h"
#include "../win/win.h"
#include "../win/plat_iodev.h"
#include "scsi.h"
#include "scsi_disk.h"
@@ -889,11 +890,11 @@ void scsi_hd_command(uint8_t id, uint8_t *cdb)
shdc[id].all_blocks_total = shdc[id].block_total;
if (shdc[id].packet_status != CDROM_PHASE_COMPLETE)
{
update_status_bar_icon((hdd[id].bus == HDD_BUS_SCSI_REMOVABLE) ? (SB_RDISK | id) : (SB_HDD | HDD_BUS_SCSI), 1);
StatusBarUpdateIcon((hdd[id].bus == HDD_BUS_SCSI_REMOVABLE) ? (SB_RDISK | id) : (SB_HDD | HDD_BUS_SCSI), 1);
}
else
{
update_status_bar_icon((hdd[id].bus == HDD_BUS_SCSI_REMOVABLE) ? (SB_RDISK | id) : (SB_HDD | HDD_BUS_SCSI), 0);
StatusBarUpdateIcon((hdd[id].bus == HDD_BUS_SCSI_REMOVABLE) ? (SB_RDISK | id) : (SB_HDD | HDD_BUS_SCSI), 0);
}
return;
@@ -965,11 +966,11 @@ void scsi_hd_command(uint8_t id, uint8_t *cdb)
shdc[id].all_blocks_total = shdc[id].block_total;
if (shdc[id].packet_status != CDROM_PHASE_COMPLETE)
{
update_status_bar_icon((hdd[id].bus == HDD_BUS_SCSI_REMOVABLE) ? (SB_RDISK | id) : (SB_HDD | HDD_BUS_SCSI), 1);
StatusBarUpdateIcon((hdd[id].bus == HDD_BUS_SCSI_REMOVABLE) ? (SB_RDISK | id) : (SB_HDD | HDD_BUS_SCSI), 1);
}
else
{
update_status_bar_icon((hdd[id].bus == HDD_BUS_SCSI_REMOVABLE) ? (SB_RDISK | id) : (SB_HDD | HDD_BUS_SCSI), 0);
StatusBarUpdateIcon((hdd[id].bus == HDD_BUS_SCSI_REMOVABLE) ? (SB_RDISK | id) : (SB_HDD | HDD_BUS_SCSI), 0);
}
return;
@@ -1163,7 +1164,7 @@ void scsi_hd_callback(uint8_t id)
shdc[id].status = READY_STAT;
shdc[id].phase = 3;
shdc[id].packet_status = 0xFF;
update_status_bar_icon((hdd[id].bus == HDD_BUS_SCSI_REMOVABLE) ? (SB_RDISK | id) : (SB_HDD | HDD_BUS_SCSI), 0);
StatusBarUpdateIcon((hdd[id].bus == HDD_BUS_SCSI_REMOVABLE) ? (SB_RDISK | id) : (SB_HDD | HDD_BUS_SCSI), 0);
return;
case CDROM_PHASE_DATA_OUT:
scsi_hd_log("SCSI HD %i: PHASE_DATA_OUT\n", id);
@@ -1175,7 +1176,7 @@ void scsi_hd_callback(uint8_t id)
shdc[id].packet_status = CDROM_PHASE_COMPLETE;
shdc[id].status = READY_STAT;
shdc[id].phase = 3;
update_status_bar_icon((hdd[id].bus == HDD_BUS_SCSI_REMOVABLE) ? (SB_RDISK | id) : (SB_HDD | HDD_BUS_SCSI), 0);
StatusBarUpdateIcon((hdd[id].bus == HDD_BUS_SCSI_REMOVABLE) ? (SB_RDISK | id) : (SB_HDD | HDD_BUS_SCSI), 0);
return;
case CDROM_PHASE_DATA_IN:
scsi_hd_log("SCSI HD %i: PHASE_DATA_IN\n", id);
@@ -1187,7 +1188,7 @@ void scsi_hd_callback(uint8_t id)
shdc[id].packet_status = CDROM_PHASE_COMPLETE;
shdc[id].status = READY_STAT;
shdc[id].phase = 3;
update_status_bar_icon((hdd[id].bus == HDD_BUS_SCSI_REMOVABLE) ? (SB_RDISK | id) : (SB_HDD | HDD_BUS_SCSI), 0);
StatusBarUpdateIcon((hdd[id].bus == HDD_BUS_SCSI_REMOVABLE) ? (SB_RDISK | id) : (SB_HDD | HDD_BUS_SCSI), 0);
return;
case CDROM_PHASE_ERROR:
scsi_hd_log("SCSI HD %i: PHASE_ERROR\n", id);

View File

@@ -1,8 +1,15 @@
#ifndef EMU_SOUND_MIDI_H
# define EMU_SOUND_MIDI_H
extern int midi_device_current;
int midi_device_available(int card);
char *midi_device_getname(int card);
struct device_t *midi_device_getdevice(int card);
#ifdef EMU_DEVICE_H
device_t *midi_device_getdevice(int card);
#endif
int midi_device_has_config(int card);
char *midi_device_get_internal_name(int card);
int midi_device_get_from_internal_name(char *s);
@@ -32,4 +39,7 @@ void midi_poll();
#else
#define SYSTEM_MIDI_NAME "System MIDI"
#define SYSTEM_MIDI_INTERNAL_NAME "system_midi"
#endif
#endif
#endif /*EMU_SOUND_MIDI_H*/

View File

@@ -222,12 +222,12 @@ void* mt32emu_init(wchar_t *control_rom, wchar_t *pcm_rom)
return dev;
}
void *mt32_init()
void *mt32_init(device_t *info)
{
return mt32emu_init(L"roms/sound/mt32/mt32_control.rom", L"roms/sound/mt32/mt32_pcm.rom");
}
void *cm32l_init()
void *cm32l_init(device_t *info)
{
return mt32emu_init(L"roms/sound/cm32l/cm32l_control.rom", L"roms/sound/cm32l/cm32l_pcm.rom");
}
@@ -316,8 +316,10 @@ device_t mt32_device =
{
"Roland MT-32 Emulation",
0,
0,
mt32_init,
mt32_close,
NULL,
mt32_available,
NULL,
NULL,
@@ -329,8 +331,10 @@ device_t cm32l_device =
{
"Roland CM-32L Emulation",
0,
0,
cm32l_init,
mt32_close,
NULL,
cm32l_available,
NULL,
NULL,

View File

@@ -9,7 +9,7 @@
#include "midi_system.h"
void* system_midi_init()
void* system_midi_init(device_t *info)
{
midi_device_t* dev = malloc(sizeof(midi_device_t));
memset(dev, 0, sizeof(midi_device_t));
@@ -32,7 +32,7 @@ void system_midi_close(void* p)
midi_close();
}
int system_midi_available()
int system_midi_available(void)
{
return plat_midi_get_num_devs();
}
@@ -53,9 +53,10 @@ static device_config_t system_midi_config[] =
device_t system_midi_device =
{
SYSTEM_MIDI_NAME,
0,
0, 0,
system_midi_init,
system_midi_close,
NULL,
system_midi_available,
NULL,
NULL,

View File

@@ -63,7 +63,7 @@ void adlib_mca_write(int port, uint8_t val, void *p)
adlib->pos_regs[port & 7] = val;
}
void *adlib_init()
void *adlib_init(device_t *info)
{
adlib_t *adlib = malloc(sizeof(adlib_t));
memset(adlib, 0, sizeof(adlib_t));
@@ -75,9 +75,9 @@ void *adlib_init()
return adlib;
}
void *adlib_mca_init()
void *adlib_mca_init(device_t *info)
{
adlib_t *adlib = adlib_init();
adlib_t *adlib = adlib_init(info);
io_removehandler(0x0388, 0x0002, opl2_read, NULL, NULL, opl2_write, NULL, NULL, &adlib->opl);
mca_add(adlib_mca_read, adlib_mca_write, adlib);
@@ -98,11 +98,9 @@ device_t adlib_device =
{
"AdLib",
0,
adlib_init,
adlib_close,
NULL,
NULL,
NULL,
0,
adlib_init, adlib_close, NULL,
NULL, NULL, NULL, NULL,
NULL
};
@@ -110,10 +108,8 @@ device_t adlib_mca_device =
{
"AdLib (MCA)",
DEVICE_MCA,
adlib_init,
adlib_close,
NULL,
NULL,
NULL,
0,
adlib_init, adlib_close, NULL,
NULL, NULL, NULL, NULL,
NULL
};

View File

@@ -754,7 +754,7 @@ static void adgold_get_buffer(int32_t *buffer, int len, void *p)
}
void *adgold_init()
void *adgold_init(device_t *info)
{
FILE *f;
int c;
@@ -840,9 +840,10 @@ static device_config_t adgold_config[] =
device_t adgold_device =
{
"AdLib Gold",
0,
0, 0,
adgold_init,
adgold_close,
NULL,
NULL,
NULL,
NULL,

View File

@@ -158,7 +158,7 @@ uint8_t cms_read(uint16_t addr, void *p)
return cms->regs[chip][cms->addrs[chip] & 31];
}
void *cms_init()
void *cms_init(device_t *info)
{
cms_t *cms = malloc(sizeof(cms_t));
memset(cms, 0, sizeof(cms_t));
@@ -179,11 +179,8 @@ void cms_close(void *p)
device_t cms_device =
{
"Creative Music System / Game Blaster",
0,
cms_init,
cms_close,
NULL,
NULL,
NULL,
0, 0,
cms_init, cms_close, NULL,
NULL, NULL, NULL, NULL,
NULL
};

View File

@@ -995,7 +995,7 @@ static void gus_get_buffer(int32_t *buffer, int len, void *p)
}
void *gus_init()
void *gus_init(device_t *info)
{
int c;
double out = 1.0;
@@ -1060,11 +1060,8 @@ void gus_speed_changed(void *p)
device_t gus_device =
{
"Gravis UltraSound",
0,
gus_init,
gus_close,
NULL,
gus_speed_changed,
NULL,
0, 0,
gus_init, gus_close, NULL, NULL,
gus_speed_changed, NULL, NULL,
NULL
};

View File

@@ -8,7 +8,7 @@
*
* Roland MPU-401 emulation.
*
* Version: @(#)snd_mpu401.c 1.0.2 2017/09/24
* Version: @(#)snd_mpu401.c 1.0.3 2017/10/04
*
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
* DOSBox Team,
@@ -788,7 +788,7 @@ void mpu401_device_add(void)
device_add(&mpu401_device);
}
void *mpu401_standalone_init()
void *mpu401_standalone_init(device_t *info)
{
mpu_t *mpu;
@@ -872,11 +872,10 @@ static device_config_t mpu401_standalone_config[] =
device_t mpu401_device =
{
"MPU-401 (Standalone)",
0,
0, 0,
mpu401_standalone_init,
mpu401_standalone_close,
NULL,
NULL,
NULL, NULL, NULL,
NULL,
NULL,
mpu401_standalone_config

View File

@@ -718,7 +718,8 @@ void pas16_get_buffer(int32_t *buffer, int len, void *p)
pas16->dsp.pos = 0;
}
void *pas16_init()
static void *pas16_init(device_t *info)
{
pas16_t *pas16 = malloc(sizeof(pas16_t));
memset(pas16, 0, sizeof(pas16_t));
@@ -735,7 +736,7 @@ void *pas16_init()
return pas16;
}
void pas16_close(void *p)
static void pas16_close(void *p)
{
pas16_t *pas16 = (pas16_t *)p;
@@ -746,10 +747,8 @@ device_t pas16_device =
{
"Pro Audio Spectrum 16",
DEVICE_NOT_WORKING,
pas16_init,
pas16_close,
NULL,
NULL,
NULL,
NULL
0,
pas16_init, pas16_close, NULL,
NULL, NULL, NULL, NULL,
NULL
};

View File

@@ -138,7 +138,7 @@ static void ps1_audio_get_buffer(int32_t *buffer, int len, void *p)
ps1->pos = 0;
}
static void *ps1_audio_init()
static void *ps1_audio_init(device_t *info)
{
ps1_audio_t *ps1 = malloc(sizeof(ps1_audio_t));
memset(ps1, 0, sizeof(ps1_audio_t));
@@ -163,9 +163,10 @@ static void ps1_audio_close(void *p)
device_t ps1_audio_device =
{
"PS/1 Audio Card",
0,
0, 0,
ps1_audio_init,
ps1_audio_close,
NULL,
NULL,
NULL,
NULL,

View File

@@ -184,7 +184,7 @@ static void pssj_get_buffer(int32_t *buffer, int len, void *p)
pssj->pos = 0;
}
void *pssj_init()
void *pssj_init(device_t *info)
{
pssj_t *pssj = malloc(sizeof(pssj_t));
memset(pssj, 0, sizeof(pssj_t));
@@ -208,9 +208,10 @@ void pssj_close(void *p)
device_t pssj_device =
{
"Tandy PSSJ",
0,
0, 0,
pssj_init,
pssj_close,
NULL,
NULL,
NULL,
NULL,

View File

@@ -8,7 +8,7 @@
*
* Sound Blaster emulation.
*
* Version: @(#)sound_sb.c 1.0.1 2017/09/24
* Version: @(#)sound_sb.c 1.0.2 2017/10/04
*
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
* Miran Grca, <mgrca8@gmail.com>
@@ -502,7 +502,7 @@ void sb_pro_mcv_write(int port, uint8_t val, void *p)
sb_dsp_setdma8(&sb->dsp, sb->pos_regs[4] & 3);
}
void *sb_1_init()
void *sb_1_init(device_t *info)
{
sb_t *sb = malloc(sizeof(sb_t));
uint16_t addr = device_get_config_hex16("base");
@@ -519,7 +519,7 @@ void *sb_1_init()
sound_add_handler(sb_get_buffer_opl2, sb);
return sb;
}
void *sb_15_init()
void *sb_15_init(device_t *info)
{
sb_t *sb = malloc(sizeof(sb_t));
uint16_t addr = device_get_config_hex16("base");
@@ -537,7 +537,7 @@ void *sb_15_init()
return sb;
}
void *sb_mcv_init()
void *sb_mcv_init(device_t *info)
{
sb_t *sb = malloc(sizeof(sb_t));
memset(sb, 0, sizeof(sb_t));
@@ -554,7 +554,7 @@ void *sb_mcv_init()
sb->pos_regs[1] = 0x50;
return sb;
}
void *sb_2_init()
void *sb_2_init(device_t *info)
{
sb_t *sb = malloc(sizeof(sb_t));
uint16_t addr = device_get_config_hex16("base");
@@ -572,7 +572,7 @@ void *sb_2_init()
return sb;
}
void *sb_pro_v1_init()
void *sb_pro_v1_init(device_t *info)
{
sb_t *sb = malloc(sizeof(sb_t));
uint16_t addr = device_get_config_hex16("base");
@@ -600,7 +600,7 @@ void *sb_pro_v1_init()
return sb;
}
void *sb_pro_v2_init()
void *sb_pro_v2_init(device_t *info)
{
sb_t *sb = malloc(sizeof(sb_t));
uint16_t addr = device_get_config_hex16("base");
@@ -627,7 +627,7 @@ void *sb_pro_v2_init()
return sb;
}
void *sb_pro_mcv_init()
void *sb_pro_mcv_init(device_t *info)
{
sb_t *sb = malloc(sizeof(sb_t));
memset(sb, 0, sizeof(sb_t));
@@ -650,7 +650,7 @@ void *sb_pro_mcv_init()
return sb;
}
void *sb_16_init()
void *sb_16_init(device_t *info)
{
sb_t *sb = malloc(sizeof(sb_t));
uint16_t addr = device_get_config_hex16("base");
@@ -690,12 +690,12 @@ void *sb_16_init()
return sb;
}
int sb_awe32_available()
int sb_awe32_available(void)
{
return rom_present(L"roms/sound/awe32.raw");
}
void *sb_awe32_init()
void *sb_awe32_init(device_t *info)
{
sb_t *sb = malloc(sizeof(sb_t));
uint16_t addr = device_get_config_hex16("base");
@@ -1212,9 +1212,8 @@ device_t sb_1_device =
{
"Sound Blaster v1.0",
0,
sb_1_init,
sb_close,
NULL,
0,
sb_1_init, sb_close, NULL, NULL,
sb_speed_changed,
NULL,
sb_add_status_info,
@@ -1224,9 +1223,8 @@ device_t sb_15_device =
{
"Sound Blaster v1.5",
0,
sb_15_init,
sb_close,
NULL,
0,
sb_15_init, sb_close, NULL, NULL,
sb_speed_changed,
NULL,
sb_add_status_info,
@@ -1236,9 +1234,8 @@ device_t sb_mcv_device =
{
"Sound Blaster MCV",
DEVICE_MCA,
sb_mcv_init,
sb_close,
NULL,
0,
sb_mcv_init, sb_close, NULL, NULL,
sb_speed_changed,
NULL,
sb_add_status_info,
@@ -1248,9 +1245,8 @@ device_t sb_2_device =
{
"Sound Blaster v2.0",
0,
sb_2_init,
sb_close,
NULL,
0,
sb_2_init, sb_close, NULL, NULL,
sb_speed_changed,
NULL,
sb_add_status_info,
@@ -1260,9 +1256,8 @@ device_t sb_pro_v1_device =
{
"Sound Blaster Pro v1",
0,
sb_pro_v1_init,
sb_close,
NULL,
0,
sb_pro_v1_init, sb_close, NULL, NULL,
sb_speed_changed,
NULL,
sb_add_status_info,
@@ -1272,9 +1267,8 @@ device_t sb_pro_v2_device =
{
"Sound Blaster Pro v2",
0,
sb_pro_v2_init,
sb_close,
NULL,
0,
sb_pro_v2_init, sb_close, NULL, NULL,
sb_speed_changed,
NULL,
sb_add_status_info,
@@ -1284,9 +1278,8 @@ device_t sb_pro_mcv_device =
{
"Sound Blaster Pro MCV",
DEVICE_MCA,
sb_pro_mcv_init,
sb_close,
NULL,
0,
sb_pro_mcv_init, sb_close, NULL, NULL,
sb_speed_changed,
NULL,
sb_add_status_info,
@@ -1296,9 +1289,8 @@ device_t sb_16_device =
{
"Sound Blaster 16",
0,
sb_16_init,
sb_close,
NULL,
0,
sb_16_init, sb_close, NULL, NULL,
sb_speed_changed,
NULL,
sb_add_status_info,
@@ -1308,8 +1300,8 @@ device_t sb_awe32_device =
{
"Sound Blaster AWE32",
0,
sb_awe32_init,
sb_close,
0,
sb_awe32_init, sb_close, NULL,
sb_awe32_available,
sb_speed_changed,
NULL,

View File

@@ -205,7 +205,7 @@ void sn76489_init(sn76489_t *sn76489, uint16_t base, uint16_t size, int type, in
io_sethandler(base, size, NULL, NULL, NULL, sn76489_write, NULL, NULL, sn76489);
}
void *sn76489_device_init()
void *sn76489_device_init(device_t *info)
{
sn76489_t *sn76489 = malloc(sizeof(sn76489_t));
memset(sn76489, 0, sizeof(sn76489_t));
@@ -214,7 +214,7 @@ void *sn76489_device_init()
return sn76489;
}
void *ncr8496_device_init()
void *ncr8496_device_init(device_t *info)
{
sn76489_t *sn76489 = malloc(sizeof(sn76489_t));
memset(sn76489, 0, sizeof(sn76489_t));
@@ -235,21 +235,19 @@ device_t sn76489_device =
{
"TI SN74689 PSG",
0,
0,
sn76489_device_init,
sn76489_device_close,
NULL,
NULL,
NULL,
NULL, NULL, NULL, NULL,
NULL
};
device_t ncr8496_device =
{
"NCR8496 PSG",
0,
0,
ncr8496_device_init,
sn76489_device_close,
NULL,
NULL,
NULL,
NULL, NULL, NULL, NULL,
NULL
};

View File

@@ -57,7 +57,7 @@ static void ssi2001_write(uint16_t addr, uint8_t val, void *p)
sid_write(addr, val, p);
}
void *ssi2001_init()
void *ssi2001_init(device_t *info)
{
ssi2001_t *ssi2001 = malloc(sizeof(ssi2001_t));
memset(ssi2001, 0, sizeof(ssi2001_t));
@@ -82,11 +82,8 @@ void ssi2001_close(void *p)
device_t ssi2001_device =
{
"Innovation SSI-2001",
0,
ssi2001_init,
ssi2001_close,
NULL,
NULL,
NULL,
0, 0,
ssi2001_init, ssi2001_close, NULL,
NULL, NULL, NULL, NULL,
NULL
};

View File

@@ -77,7 +77,7 @@ static void wss_get_buffer(int32_t *buffer, int len, void *p)
wss->ad1848.pos = 0;
}
void *wss_init()
void *wss_init(device_t *info)
{
wss_t *wss = malloc(sizeof(wss_t));
@@ -115,11 +115,10 @@ void wss_speed_changed(void *p)
device_t wss_device =
{
"Windows Sound System",
0,
wss_init,
wss_close,
0, 0,
wss_init, wss_close, NULL,
NULL,
wss_speed_changed,
NULL,
NULL, NULL,
NULL
};

View File

@@ -8,13 +8,16 @@
*
* Sound emulation core.
*
* Version: @(#)sound.h 1.0.1 2017/06/14
* Version: @(#)sound.h 1.0.2 2017/10/04
*
* Author: Sarah Walker, <http://pcem-emulator.co.uk/>
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
* Miran Grca, <mgrca8@gmail.com>
* Copyright 2008-2017 Sarah Walker.
* Copyright 2016-2017 Miran Grca.
* Copyright 2016,2017 Miran Grca.
*/
#ifndef EMU_SOUND_H
# define EMU_SOUND_H
void sound_add_handler(void (*get_buffer)(int32_t *buffer, int len, void *p), void *p);
@@ -22,7 +25,9 @@ extern int sound_card_current;
int sound_card_available(int card);
char *sound_card_getname(int card);
struct device_t *sound_card_getdevice(int card);
#ifdef EMU_DEVICE_H
device_t *sound_card_getdevice(int card);
#endif
int sound_card_has_config(int card);
char *sound_card_get_internal_name(int card);
int sound_card_get_from_internal_name(char *s);
@@ -48,3 +53,6 @@ void initalmain(int argc, char *argv[]);
void inital();
void givealbuffer(void *buf);
void givealbuffer_cd(void *buf);
#endif /*EMU_SOUND_H*/

View File

@@ -125,7 +125,7 @@ int tandy_eeprom_read(void)
}
static void *tandy_eeprom_init(void)
static void *tandy_eeprom_init(device_t *info)
{
tandy_eeprom_t *eeprom = malloc(sizeof(tandy_eeprom_t));
FILE *f = NULL;
@@ -180,12 +180,9 @@ void tandy_eeprom_close(void *p)
device_t tandy_eeprom_device =
{
"Tandy EEPROM",
0,
0, 0,
tandy_eeprom_init,
tandy_eeprom_close,
NULL,
NULL,
NULL,
NULL,
NULL, NULL, NULL, NULL, NULL,
NULL
};

View File

@@ -60,7 +60,7 @@ void tandy_rom_bank_write(uint16_t port, uint8_t val, void *p)
}
void *tandy_rom_init(void)
void *tandy_rom_init(device_t *info)
{
FILE *f, *ff;
int c;
@@ -97,12 +97,8 @@ void tandy_rom_close(void *p)
device_t tandy_rom_device =
{
"Tandy 1000SL/2 ROM",
0,
tandy_rom_init,
tandy_rom_close,
NULL,
NULL,
NULL,
NULL,
0, 0,
tandy_rom_init, tandy_rom_close, NULL,
NULL, NULL, NULL, NULL,
NULL
};

View File

@@ -162,7 +162,7 @@ void ati18800_recalctimings(svga_t *svga)
}
}
void *ati18800_init()
void *ati18800_init(device_t *info)
{
ati18800_t *ati18800 = malloc(sizeof(ati18800_t));
memset(ati18800, 0, sizeof(ati18800_t));
@@ -185,7 +185,7 @@ void *ati18800_init()
return ati18800;
}
static int ati18800_available()
static int ati18800_available(void)
{
return rom_present(L"roms/video/ati18800/vga88.BIN");
}
@@ -223,12 +223,13 @@ void ati18800_add_status_info(char *s, int max_len, void *p)
device_t ati18800_device =
{
"ATI-18800",
0,
0, 0,
ati18800_init,
ati18800_close,
NULL,
ati18800_available,
ati18800_speed_changed,
ati18800_force_redraw,
ati18800_add_status_info
ati18800_add_status_info,
NULL
};

View File

@@ -354,7 +354,7 @@ void ati28800_recalctimings(svga_t *svga)
}
}
void *ati28800_init()
void *ati28800_init(device_t *info)
{
uint32_t memory = 512;
ati28800_t *ati28800;
@@ -396,17 +396,17 @@ void *ati28800_init()
return ati28800;
}
static int ati28800_available()
static int ati28800_available(void)
{
return rom_present(L"roms/video/ati28800/bios.bin");
}
static int compaq_ati28800_available()
static int compaq_ati28800_available(void)
{
return (rom_present(L"roms/video/ati28800/XLEVEN.bin") && rom_present(L"roms/video/ati28800/XLODD.bin"));
}
static int ati28800_wonderxl24_available()
static int ati28800_wonderxl24_available(void)
{
return (rom_present(L"roms/video/ati28800/112-14318-102.bin") && rom_present(L"roms/video/ati28800/112-14319-102.bin"));
}
@@ -490,8 +490,10 @@ device_t ati28800_device =
{
"ATI-28800",
0,
0,
ati28800_init,
ati28800_close,
NULL,
ati28800_available,
ati28800_speed_changed,
ati28800_force_redraw,
@@ -503,8 +505,10 @@ device_t compaq_ati28800_device =
{
"Compaq ATI-28800",
0,
0,
ati28800_init,
ati28800_close,
NULL,
compaq_ati28800_available,
ati28800_speed_changed,
ati28800_force_redraw,
@@ -516,8 +520,10 @@ device_t ati28800_wonderxl24_device =
{
"ATI-28800 (VGA Wonder XL24)",
0,
0,
ati28800_init,
ati28800_close,
NULL,
ati28800_wonderxl24_available,
ati28800_speed_changed,
ati28800_force_redraw,

View File

@@ -8,7 +8,7 @@
*
* ATi Mach64 graphics card emulation.
*
* Version: @(#)vid_ati_mach64.c 1.0.2 2017/09/24
* Version: @(#)vid_ati_mach64.c 1.0.3 2017/10/04
*
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
* Miran Grca, <mgrca8@gmail.com>
@@ -3294,7 +3294,7 @@ void mach64_pci_write(int func, int addr, uint8_t val, void *p)
}
}
static void *mach64_common_init()
static void *mach64_common_init(void)
{
mach64_t *mach64 = malloc(sizeof(mach64_t));
memset(mach64, 0, sizeof(mach64_t));
@@ -3337,7 +3337,7 @@ static void *mach64_common_init()
return mach64;
}
static void *mach64gx_init()
static void *mach64gx_init(device_t *info)
{
mach64_t *mach64 = mach64_common_init();
@@ -3357,7 +3357,7 @@ static void *mach64gx_init()
return mach64;
}
static void *mach64vt2_init()
static void *mach64vt2_init(device_t *info)
{
mach64_t *mach64 = mach64_common_init();
svga_t *svga = &mach64->svga;
@@ -3378,11 +3378,11 @@ static void *mach64vt2_init()
return mach64;
}
int mach64gx_available()
int mach64gx_available(void)
{
return rom_present(L"roms/video/mach64/bios.bin");
}
int mach64vt2_available()
int mach64vt2_available(void)
{
return rom_present(L"roms/video/mach64/atimach64vt2pci.bin");
}
@@ -3511,8 +3511,10 @@ device_t mach64gx_device =
{
"ATI Mach64GX",
0,
0,
mach64gx_init,
mach64_close,
NULL,
mach64gx_available,
mach64_speed_changed,
mach64_force_redraw,
@@ -3523,8 +3525,10 @@ device_t mach64vt2_device =
{
"ATI Mach64VT2",
DEVICE_PCI,
0,
mach64vt2_init,
mach64_close,
NULL,
mach64vt2_available,
mach64_speed_changed,
mach64_force_redraw,

View File

@@ -8,7 +8,7 @@
*
* Emulation of the old and new IBM CGA graphics cards.
*
* Version: @(#)vid_cga.c 1.0.2 2017/09/24
* Version: @(#)vid_cga.c 1.0.3 2017/10/04
*
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
* Miran Grca, <mgrca8@gmail.com>
@@ -468,7 +468,7 @@ void cga_init(cga_t *cga)
cga->composite = 0;
}
void *cga_standalone_init()
void *cga_standalone_init(device_t *info)
{
int display_type;
cga_t *cga = malloc(sizeof(cga_t));
@@ -578,9 +578,10 @@ static device_config_t cga_config[] =
device_t cga_device =
{
"CGA",
0,
0, 0,
cga_standalone_init,
cga_close,
NULL,
NULL,
cga_speed_changed,
NULL,

View File

@@ -882,92 +882,93 @@ void *clgd_common_init(wchar_t *romfn, uint8_t id)
return clgd;
}
void *gd6235_init()
void *gd6235_init(device_t *info)
{
return clgd_common_init(L"roms/video/cirruslogic/vga6235.rom", CIRRUS_ID_CLGD6235);
}
void *gd5422_init()
void *gd5422_init(device_t *info)
{
return clgd_common_init(L"roms/video/cirruslogic/CL5422.ROM", CIRRUS_ID_CLGD5422);
}
void *gd5429_init()
void *gd5429_init(device_t *info)
{
return clgd_common_init(L"roms/video/cirruslogic/5429.vbi", CIRRUS_ID_CLGD5429);
}
void *gd5430_init()
void *gd5430_init(device_t *info)
{
return clgd_common_init(L"roms/video/cirruslogic/pci.BIN", CIRRUS_ID_CLGD5430);
}
void *dia5430_init()
void *dia5430_init(device_t *info)
{
return clgd_common_init(L"roms/video/cirruslogic/diamondvlbus.BIN", CIRRUS_ID_CLGD5430);
}
void *gd5434_init()
void *gd5434_init(device_t *info)
{
return clgd_common_init(L"roms/video/cirruslogic/japan.BIN", CIRRUS_ID_CLGD5434);
}
void *gd5436_init()
void *gd5436_init(device_t *info)
{
return clgd_common_init(L"roms/video/cirruslogic/5436.VBI", CIRRUS_ID_CLGD5436);
}
void *gd5440_init()
void *gd5440_init(device_t *info)
{
return clgd_common_init(L"roms/video/cirruslogic/5440BIOS.BIN", CIRRUS_ID_CLGD5440);
}
void *gd5446_init()
void *gd5446_init(device_t *info)
{
return clgd_common_init(L"roms/video/cirruslogic/5446BV.VBI", CIRRUS_ID_CLGD5446);
}
static int gd5422_available()
static int gd5422_available(void)
{
return rom_present(L"roms/video/cirruslogic/CL5422.ROM");
}
static int gd5429_available()
static int gd5429_available(void)
{
return rom_present(L"roms/video/cirruslogic/5429.vbi");
}
static int gd5430_available()
static int gd5430_available(void)
{
return rom_present(L"roms/video/cirruslogic/pci.BIN");
}
static int dia5430_available()
static int dia5430_available(void)
{
return rom_present(L"roms/video/cirruslogic/diamondvlbus.BIN");
}
static int gd5434_available()
static int gd5434_available(void)
{
return rom_present(L"roms/video/cirruslogic/japan.BIN");
}
static int gd5436_available()
static int gd5436_available(void)
{
return rom_present(L"roms/video/cirruslogic/5436.VBI");
}
static int gd5440_available()
static int gd5440_available(void)
{
return rom_present(L"roms/video/cirruslogic/5440BIOS.BIN");
}
static int gd5446_available()
static int gd5446_available(void)
{
return rom_present(L"roms/video/cirruslogic/5446BV.VBI");
}
static int gd6235_available()
static int gd6235_available(void)
{
return rom_present(L"roms/video/cirruslogic/vga6235.rom");
}
@@ -1005,116 +1006,134 @@ void clgd_add_status_info(char *s, int max_len, void *p)
device_t gd5422_device =
{
"Cirrus Logic GD5422",
// DEVICE_NOT_WORKING,
DEVICE_NOT_WORKING,
0,
gd5422_init,
clgd_close,
NULL,
gd5422_available,
clgd_speed_changed,
clgd_force_redraw,
clgd_add_status_info
clgd_add_status_info,
NULL
};
device_t gd5429_device =
{
"Cirrus Logic GD5429",
// DEVICE_NOT_WORKING,
DEVICE_NOT_WORKING,
0,
gd5429_init,
clgd_close,
NULL,
gd5429_available,
clgd_speed_changed,
clgd_force_redraw,
clgd_add_status_info
clgd_add_status_info,
NULL
};
device_t gd5430_device =
{
"Cirrus Logic GD5430",
// DEVICE_NOT_WORKING,
DEVICE_NOT_WORKING,
0,
gd5430_init,
clgd_close,
NULL,
gd5430_available,
clgd_speed_changed,
clgd_force_redraw,
clgd_add_status_info
clgd_add_status_info,
NULL
};
device_t dia5430_device =
{
"Diamond CL-GD5430",
// DEVICE_NOT_WORKING,
DEVICE_NOT_WORKING,
0,
dia5430_init,
clgd_close,
NULL,
dia5430_available,
clgd_speed_changed,
clgd_force_redraw,
clgd_add_status_info
clgd_add_status_info,
NULL
};
device_t gd5434_device =
{
"Cirrus Logic GD5434",
// DEVICE_NOT_WORKING,
DEVICE_NOT_WORKING,
0,
gd5434_init,
clgd_close,
NULL,
gd5434_available,
clgd_speed_changed,
clgd_force_redraw,
clgd_add_status_info
clgd_add_status_info,
NULL
};
device_t gd5436_device =
{
"Cirrus Logic GD5436",
// DEVICE_NOT_WORKING,
DEVICE_NOT_WORKING,
0,
gd5436_init,
clgd_close,
NULL,
gd5436_available,
clgd_speed_changed,
clgd_force_redraw,
clgd_add_status_info
clgd_add_status_info,
NULL
};
device_t gd5440_device =
{
"Cirrus Logic GD5440",
// DEVICE_NOT_WORKING,
DEVICE_NOT_WORKING,
0,
gd5440_init,
clgd_close,
NULL,
gd5440_available,
clgd_speed_changed,
clgd_force_redraw,
clgd_add_status_info
clgd_add_status_info,
NULL
};
device_t gd5446_device =
{
"Cirrus Logic GD5446",
// DEVICE_NOT_WORKING,
DEVICE_NOT_WORKING,
0,
gd5446_init,
clgd_close,
NULL,
gd5446_available,
clgd_speed_changed,
clgd_force_redraw,
clgd_add_status_info
clgd_add_status_info,
NULL
};
device_t gd6235_device =
{
"Cirrus Logic GD6235",
// DEVICE_NOT_WORKING,
DEVICE_NOT_WORKING,
0,
gd6235_init,
clgd_close,
NULL,
gd6235_available,
clgd_speed_changed,
clgd_force_redraw,
clgd_add_status_info
clgd_add_status_info,
NULL
};

View File

@@ -365,7 +365,7 @@ void colorplus_init(colorplus_t *colorplus)
cga_init(&colorplus->cga);
}
void *colorplus_standalone_init()
void *colorplus_standalone_init(device_t *info)
{
int display_type;
@@ -445,10 +445,10 @@ static device_config_t colorplus_config[] =
device_t colorplus_device =
{
"Colorplus",
0,
0, 0,
colorplus_standalone_init,
colorplus_close,
NULL,
NULL, NULL,
colorplus_speed_changed,
NULL,
NULL,

View File

@@ -9,7 +9,7 @@
* Emulation of the EGA, Chips & Technologies SuperEGA, and
* AX JEGA graphics cards.
*
* Version: @(#)vid_ega.c 1.0.4 2017/09/24
* Version: @(#)vid_ega.c 1.0.5 2017/10/04
*
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
* Miran Grca, <mgrca8@gmail.com>
@@ -1121,7 +1121,7 @@ void *cpqega_standalone_init()
return ega;
}
void *sega_standalone_init()
void *sega_standalone_init(device_t *info)
{
ega_t *ega = malloc(sizeof(ega_t));
memset(ega, 0, sizeof(ega_t));
@@ -1255,7 +1255,7 @@ static void LoadFontxFile(wchar_t *fname)
fclose(mfile);
}
void *jega_standalone_init()
void *jega_standalone_init(device_t *info)
{
ega_t *ega = (ega_t *) sega_standalone_init();
@@ -1268,17 +1268,17 @@ void *jega_standalone_init()
}
#endif
static int ega_standalone_available()
static int ega_standalone_available(void)
{
return rom_present(L"roms/video/ega/ibm_6277356_ega_card_u44_27128.bin");
}
static int cpqega_standalone_available()
static int cpqega_standalone_available(void)
{
return rom_present(L"roms/video/ega/108281-001.bin");
}
static int sega_standalone_available()
static int sega_standalone_available(void)
{
return rom_present(L"roms/video/ega/lega.vbi");
}
@@ -1326,8 +1326,10 @@ device_t ega_device =
{
"EGA",
0,
0,
ega_standalone_init,
ega_close,
NULL,
ega_standalone_available,
ega_speed_changed,
NULL,
@@ -1339,8 +1341,10 @@ device_t cpqega_device =
{
"Compaq EGA",
0,
0,
cpqega_standalone_init,
ega_close,
NULL,
cpqega_standalone_available,
ega_speed_changed,
NULL,
@@ -1352,8 +1356,10 @@ device_t sega_device =
{
"SuperEGA",
0,
0,
sega_standalone_init,
ega_close,
NULL,
sega_standalone_available,
ega_speed_changed,
NULL,
@@ -1366,8 +1372,10 @@ device_t jega_device =
{
"AX JEGA",
0,
0,
jega_standalone_init,
ega_close,
NULL,
sega_standalone_available,
ega_speed_changed,
NULL,

View File

@@ -143,7 +143,7 @@ void et4000_recalctimings(svga_t *svga)
}
}
void *et4000_init()
void *et4000_init(device_t *info)
{
et4000_t *et4000 = malloc(sizeof(et4000_t));
memset(et4000, 0, sizeof(et4000_t));
@@ -161,7 +161,7 @@ void *et4000_init()
return et4000;
}
static int et4000_available()
static int et4000_available(void)
{
return rom_present(L"roms/video/et4000/et4000.BIN");
}
@@ -200,8 +200,10 @@ device_t et4000_device =
{
"Tseng Labs ET4000AX",
0,
0,
et4000_init,
et4000_close,
NULL,
et4000_available,
et4000_speed_changed,
et4000_force_redraw,

View File

@@ -1140,7 +1140,7 @@ void et4000w32p_pci_write(int func, int addr, uint8_t val, void *p)
}
}
void *et4000w32p_init()
void *et4000w32p_init(device_t *info)
{
int vram_size;
et4000w32p_t *et4000 = malloc(sizeof(et4000w32p_t));
@@ -1189,7 +1189,7 @@ void *et4000w32p_init()
return et4000;
}
int et4000w32p_available()
int et4000w32p_available(void)
{
return rom_present(L"roms/video/et4000w32/et4000w32.bin");
}
@@ -1262,8 +1262,10 @@ device_t et4000w32p_device =
{
"Tseng Labs ET4000/w32p",
0,
0,
et4000w32p_init,
et4000w32p_close,
NULL,
et4000w32p_available,
et4000w32p_speed_changed,
et4000w32p_force_redraw,

View File

@@ -553,7 +553,7 @@ void genius_poll(void *p)
}
}
void *genius_init()
void *genius_init(device_t *info)
{
int c;
genius_t *genius = malloc(sizeof(genius_t));
@@ -609,7 +609,7 @@ void genius_close(void *p)
free(genius);
}
static int genius_available()
static int genius_available(void)
{
return rom_present(L"roms/video/genius/8x12.bin");
}
@@ -624,11 +624,13 @@ void genius_speed_changed(void *p)
device_t genius_device =
{
"Genius VHR",
0,
0, 0,
genius_init,
genius_close,
NULL,
genius_available,
genius_speed_changed,
NULL,
NULL,
NULL
};

View File

@@ -316,7 +316,8 @@ void hercules_poll(void *p)
}
}
void *hercules_init()
void *hercules_init(device_t *info)
{
int c;
hercules_t *hercules = malloc(sizeof(hercules_t));
@@ -408,16 +409,17 @@ static device_config_t hercules_config[] =
device_t hercules_device =
{
"Hercules",
0,
0, 0,
hercules_init,
hercules_close,
NULL,
NULL,
hercules_speed_changed,
NULL,
NULL,
#ifdef __unix
NULL
#else
NULL,
hercules_config
#endif
};

View File

@@ -662,7 +662,7 @@ void herculesplus_poll(void *p)
}
}
void *herculesplus_init()
void *herculesplus_init(device_t *info)
{
int c;
herculesplus_t *herculesplus = malloc(sizeof(herculesplus_t));
@@ -714,11 +714,13 @@ void herculesplus_speed_changed(void *p)
device_t herculesplus_device =
{
"Hercules Plus",
0,
0, 0,
herculesplus_init,
herculesplus_close,
NULL,
NULL,
herculesplus_speed_changed,
NULL,
NULL,
NULL
};

View File

@@ -1010,7 +1010,7 @@ void incolor_poll(void *p)
}
}
void *incolor_init()
void *incolor_init(device_t *info)
{
int c;
incolor_t *incolor = malloc(sizeof(incolor_t));
@@ -1061,11 +1061,14 @@ void incolor_speed_changed(void *p)
device_t incolor_device =
{
"Hercules InColor",
0,
0, 0,
incolor_init,
incolor_close,
NULL,
NULL,
incolor_speed_changed,
NULL,
NULL,
NULL,
NULL
};

View File

@@ -265,7 +265,8 @@ void mda_poll(void *p)
}
}
void *mda_init()
void *mda_init(device_t *info)
{
int c;
mda_t *mda = malloc(sizeof(mda_t));
@@ -357,16 +358,17 @@ static device_config_t mda_config[] =
device_t mda_device =
{
"MDA",
0,
0, 0,
mda_init,
mda_close,
NULL,
NULL,
mda_speed_changed,
NULL,
NULL,
#ifdef __unix
NULL
#else
NULL,
mda_config
#endif
};

View File

@@ -2828,7 +2828,8 @@ void riva128_ptimer_tick(void *p)
riva128->nvenable = 1;
}
void *riva128_init()
void *riva128_init(device_t *info)
{
riva128_t *riva128 = malloc(sizeof(riva128_t));
memset(riva128, 0, sizeof(riva128_t));
@@ -2911,7 +2912,7 @@ void riva128_ptimer_tick(void *p)
riva128->ptimer.clock_mul = 1;
riva128->ptimer.clock_div = 1;
//Some bullshit default values so that the emulator won't shit itself trying to boot. These'll be overwritten by the video BIOS anyway.
//default values so that the emulator can boot. These'll be overwritten by the video BIOS anyway.
riva128->pramdac.m_m = 0x03;
riva128->pramdac.m_n = 0xc2;
riva128->pramdac.m_p = 0x0d;
@@ -2962,7 +2963,7 @@ void riva128_ptimer_tick(void *p)
return riva128;
}
void riva128_close(void *p)
void riva128_close(void *p)
{
riva128_t *riva128 = (riva128_t *)p;
FILE *f = fopen("vram.dmp", "wb");
@@ -2974,12 +2975,12 @@ void riva128_ptimer_tick(void *p)
free(riva128);
}
int riva128_available()
int riva128_available(void)
{
return rom_present(L"roms/video/nv_riva128/Diamond_V330_rev-e.vbi");
}
void riva128_speed_changed(void *p)
void riva128_speed_changed(void *p)
{
riva128_t *riva128 = (riva128_t *)p;
@@ -3024,7 +3025,8 @@ device_config_t riva128_config[] =
}
};
/* device_config_t riva128zx_config[] =
#if 0
device_config_t riva128zx_config[] =
{
{
.name = "memory",
@@ -3057,14 +3059,17 @@ device_config_t riva128_config[] =
{
.type = -1
}
};*/
};
#endif
device_t riva128_device =
{
"nVidia RIVA 128",
0,
0,
riva128_init,
riva128_close,
NULL,
riva128_available,
riva128_speed_changed,
riva128_force_redraw,
@@ -3072,7 +3077,8 @@ device_t riva128_device =
riva128_config
};
void *rivatnt_init()
void *rivatnt_init(device_t *info)
{
riva128_t *riva128 = malloc(sizeof(riva128_t));
memset(riva128, 0, sizeof(riva128_t));
@@ -3139,7 +3145,7 @@ device_t riva128_device =
riva128->pci_card = pci_add_card(PCI_ADD_VIDEO, riva128_pci_read, rivatnt_pci_write, riva128);
//Some bullshit default values so that the emulator won't shit itself trying to boot. These'll be overwritten by the video BIOS anyway.
//default values so that the emulator can boot. These'll be overwritten by the video BIOS anyway.
riva128->pramdac.m_m = 0x03;
riva128->pramdac.m_n = 0xc2;
riva128->pramdac.m_p = 0x0d;
@@ -3188,7 +3194,7 @@ device_t riva128_device =
return riva128;
}
void rivatnt_close(void *p)
void rivatnt_close(void *p)
{
riva128_t *riva128 = (riva128_t *)p;
FILE *f = fopen("vram.dmp", "wb");
@@ -3200,33 +3206,33 @@ device_t riva128_device =
free(riva128);
}
int rivatnt_available()
int rivatnt_available(void)
{
return rom_present(L"roms/video/nv_riva128/NV4_diamond_revB.rom");
}
void rivatnt_speed_changed(void *p)
void rivatnt_speed_changed(void *p)
{
riva128_t *riva128 = (riva128_t *)p;
svga_recalctimings(&riva128->svga);
}
void rivatnt_force_redraw(void *p)
void rivatnt_force_redraw(void *p)
{
riva128_t *riva128 = (riva128_t *)p;
riva128->svga.fullchange = changeframecount;
}
void rivatnt_add_status_info(char *s, int max_len, void *p)
void rivatnt_add_status_info(char *s, int max_len, void *p)
{
riva128_t *riva128 = (riva128_t *)p;
svga_add_status_info(s, max_len, &riva128->svga);
}
device_config_t rivatnt_config[] =
device_config_t rivatnt_config[] =
{
{
"memory", "Memory size", CONFIG_SELECTION, "", 16,
@@ -3254,8 +3260,10 @@ device_t rivatnt_device =
{
"nVidia RIVA TNT",
0,
0,
rivatnt_init,
rivatnt_close,
NULL,
rivatnt_available,
rivatnt_speed_changed,
rivatnt_force_redraw,
@@ -3263,7 +3271,7 @@ device_t rivatnt_device =
rivatnt_config
};
void *rivatnt2_init()
void *rivatnt2_init(device_t *info)
{
riva128_t *riva128 = malloc(sizeof(riva128_t));
memset(riva128, 0, sizeof(riva128_t));
@@ -3343,7 +3351,7 @@ device_t rivatnt_device =
riva128->pci_card = pci_add_card(PCI_ADD_VIDEO, riva128_pci_read, rivatnt_pci_write, riva128);
//Some bullshit default values so that the emulator won't shit itself trying to boot. These'll be overwritten by the video BIOS anyway.
//default values so that the emulator can boot. These'll be overwritten by the video BIOS anyway.
riva128->pramdac.m_m = 0x03;
riva128->pramdac.m_n = 0xc2;
riva128->pramdac.m_p = 0x0d;
@@ -3392,7 +3400,7 @@ device_t rivatnt_device =
return riva128;
}
void rivatnt2_close(void *p)
void rivatnt2_close(void *p)
{
riva128_t *riva128 = (riva128_t *)p;
FILE *f = fopen("vram.dmp", "wb");
@@ -3404,33 +3412,33 @@ device_t rivatnt_device =
free(riva128);
}
int rivatnt2_available()
int rivatnt2_available(void)
{
return rom_present(L"roms/video/nv_riva128/NV5diamond.bin") || rom_present(L"roms/video/nv_riva128/inno3d64bit.BIN") || rom_present(L"roms/video/nv_riva128/creative.BIN");
}
void rivatnt2_speed_changed(void *p)
void rivatnt2_speed_changed(void *p)
{
riva128_t *riva128 = (riva128_t *)p;
svga_recalctimings(&riva128->svga);
}
void rivatnt2_force_redraw(void *p)
void rivatnt2_force_redraw(void *p)
{
riva128_t *riva128 = (riva128_t *)p;
riva128->svga.fullchange = changeframecount;
}
void rivatnt2_add_status_info(char *s, int max_len, void *p)
void rivatnt2_add_status_info(char *s, int max_len, void *p)
{
riva128_t *riva128 = (riva128_t *)p;
svga_add_status_info(s, max_len, &riva128->svga);
}
device_config_t rivatnt2_config[] =
device_config_t rivatnt2_config[] =
{
{
"model", "Card model", CONFIG_SELECTION, "", 0,
@@ -3475,8 +3483,10 @@ device_t rivatnt2_device =
{
"nVidia RIVA TNT2",
0,
0,
rivatnt2_init,
rivatnt2_close,
NULL,
rivatnt2_available,
rivatnt2_speed_changed,
rivatnt2_force_redraw,

View File

@@ -449,7 +449,9 @@ void m24_poll(void *p)
}
}
void *m24_init()
static void *
m24_init(device_t *info)
{
m24_t *m24 = malloc(sizeof(m24_t));
memset(m24, 0, sizeof(m24_t));
@@ -463,7 +465,9 @@ void *m24_init()
return m24;
}
void m24_close(void *p)
static void
m24_close(void *p)
{
m24_t *m24 = (m24_t *)p;
@@ -471,21 +475,23 @@ void m24_close(void *p)
free(m24);
}
void m24_speed_changed(void *p)
static void
m24_speed_changed(void *p)
{
m24_t *m24 = (m24_t *)p;
m24_recalctimings(m24);
}
device_t m24_device =
{
"Olivetti M24 (video)",
0,
0, 0,
m24_init,
m24_close,
NULL,
m24_speed_changed,
NULL,
NULL, NULL, m24_speed_changed,
NULL, NULL, NULL, NULL,
NULL
};

View File

@@ -187,29 +187,29 @@ void *oti067_common_init(wchar_t *bios_fn, int vram_size, int chip_id)
return oti067;
}
void *oti067_init()
void *oti067_init(device_t *info)
{
int vram_size = device_get_config_int("memory");
return oti067_common_init(L"roms/video/oti/bios.bin", vram_size, 2);
}
void *oti077_init()
void *oti077_init(device_t *info)
{
int vram_size = device_get_config_int("memory");
return oti067_common_init(L"roms/video/oti/oti077.vbi", vram_size, 5);
}
static int oti067_available()
static int oti067_available(void)
{
return rom_present(L"roms/video/oti/bios.bin");
}
static int oti077_available()
static int oti077_available(void)
{
return rom_present(L"roms/video/oti/oti077.vbi");
}
void oti067_close(void *p)
static void oti067_close(void *p)
{
oti067_t *oti067 = (oti067_t *)p;
@@ -218,21 +218,21 @@ void oti067_close(void *p)
free(oti067);
}
void oti067_speed_changed(void *p)
static void oti067_speed_changed(void *p)
{
oti067_t *oti067 = (oti067_t *)p;
svga_recalctimings(&oti067->svga);
}
void oti067_force_redraw(void *p)
static void oti067_force_redraw(void *p)
{
oti067_t *oti067 = (oti067_t *)p;
oti067->svga.fullchange = changeframecount;
}
void oti067_add_status_info(char *s, int max_len, void *p)
static void oti067_add_status_info(char *s, int max_len, void *p)
{
oti067_t *oti067 = (oti067_t *)p;
@@ -288,8 +288,10 @@ device_t oti067_device =
{
"Oak OTI-067",
0,
0,
oti067_init,
oti067_close,
NULL,
oti067_available,
oti067_speed_changed,
oti067_force_redraw,
@@ -300,8 +302,10 @@ device_t oti077_device =
{
"Oak OTI-077",
0,
0,
oti077_init,
oti067_close,
NULL,
oti077_available,
oti067_speed_changed,
oti067_force_redraw,

View File

@@ -254,7 +254,8 @@ uint8_t paradise_read(uint32_t addr, void *p)
return svga_read_linear(addr, &paradise->svga);
}
void *paradise_pvga1a_init()
void *paradise_pvga1a_init(device_t *info)
{
paradise_t *paradise = malloc(sizeof(paradise_t));
svga_t *svga = &paradise->svga;
@@ -287,7 +288,7 @@ void *paradise_pvga1a_init()
return paradise;
}
void *paradise_wd90c11_init()
void *paradise_wd90c11_init(device_t *info)
{
paradise_t *paradise = malloc(sizeof(paradise_t));
svga_t *svga = &paradise->svga;
@@ -322,18 +323,18 @@ void *paradise_wd90c11_init()
return paradise;
}
static void *paradise_pvga1a_pc2086_init()
static void *paradise_pvga1a_pc2086_init(device_t *info)
{
paradise_t *paradise = paradise_pvga1a_init();
paradise_t *paradise = paradise_pvga1a_init(info);
if (paradise)
rom_init(&paradise->bios_rom, L"roms/machines/pc2086/40186.ic171", 0xc0000, 0x8000, 0x7fff, 0, MEM_MAPPING_EXTERNAL);
return paradise;
}
static void *paradise_pvga1a_pc3086_init()
static void *paradise_pvga1a_pc3086_init(device_t *info)
{
paradise_t *paradise = paradise_pvga1a_init();
paradise_t *paradise = paradise_pvga1a_init(info);
if (paradise)
rom_init(&paradise->bios_rom, L"roms/machines/pc3086/c000.bin", 0xc0000, 0x8000, 0x7fff, 0, MEM_MAPPING_EXTERNAL);
@@ -341,9 +342,9 @@ static void *paradise_pvga1a_pc3086_init()
return paradise;
}
static void *paradise_wd90c11_megapc_init()
static void *paradise_wd90c11_megapc_init(device_t *info)
{
paradise_t *paradise = paradise_wd90c11_init();
paradise_t *paradise = paradise_wd90c11_init(info);
if (paradise)
rom_init_interleaved(&paradise->bios_rom,
@@ -354,7 +355,7 @@ static void *paradise_wd90c11_megapc_init()
return paradise;
}
static int paradise_wd90c11_standalone_available()
static int paradise_wd90c11_standalone_available(void)
{
return rom_present(L"roms/machines/megapc/41651-bios lo.u18") && rom_present(L"roms/machines/megapc/211253-bios hi.u19");
}
@@ -389,13 +390,16 @@ void paradise_add_status_info(char *s, int max_len, void *p)
svga_add_status_info(s, max_len, &paradise->svga);
}
device_t paradise_pvga1a_pc2086_device =
{
"Paradise PVGA1A (Amstrad PC2086)",
0,
0,
paradise_pvga1a_pc2086_init,
paradise_close,
NULL,
NULL,
paradise_speed_changed,
paradise_force_redraw,
paradise_add_status_info
@@ -404,8 +408,10 @@ device_t paradise_pvga1a_pc3086_device =
{
"Paradise PVGA1A (Amstrad PC3086)",
0,
0,
paradise_pvga1a_pc3086_init,
paradise_close,
NULL,
NULL,
paradise_speed_changed,
paradise_force_redraw,
@@ -415,8 +421,10 @@ device_t paradise_wd90c11_megapc_device =
{
"Paradise WD90C11 (Amstrad MegaPC)",
0,
0,
paradise_wd90c11_megapc_init,
paradise_close,
NULL,
NULL,
paradise_speed_changed,
paradise_force_redraw,
@@ -426,8 +434,10 @@ device_t paradise_wd90c11_device =
{
"Paradise WD90C11",
0,
0,
paradise_wd90c11_megapc_init,
paradise_close,
NULL,
paradise_wd90c11_standalone_available,
paradise_speed_changed,
paradise_force_redraw,

View File

@@ -448,7 +448,8 @@ static void pc1512_poll(void *p)
}
}
static void *pc1512_init()
static void *pc1512_init(device_t *info)
{
pc1512_t *pc1512 = malloc(sizeof(pc1512_t));
memset(pc1512, 0, sizeof(pc1512_t));
@@ -483,9 +484,10 @@ static void pc1512_speed_changed(void *p)
device_t pc1512_device =
{
"Amstrad PC1512 (video)",
0,
0, 0,
pc1512_init,
pc1512_close,
NULL,
NULL,
pc1512_speed_changed,
NULL,

View File

@@ -123,7 +123,8 @@ void pc1640_poll(void *p)
}
}
void *pc1640_init()
void *pc1640_init(device_t *info)
{
pc1640_t *pc1640 = malloc(sizeof(pc1640_t));
cga_t *cga = &pc1640->cga;
@@ -145,7 +146,7 @@ void *pc1640_init()
return pc1640;
}
void pc1640_close(void *p)
static void pc1640_close(void *p)
{
pc1640_t *pc1640 = (pc1640_t *)p;
@@ -153,7 +154,7 @@ void pc1640_close(void *p)
free(pc1640);
}
void pc1640_speed_changed(void *p)
static void pc1640_speed_changed(void *p)
{
pc1640_t *pc1640 = (pc1640_t *)p;
@@ -163,9 +164,10 @@ void pc1640_speed_changed(void *p)
device_t pc1640_device =
{
"Amstrad PC1640 (video)",
0,
0, 0,
pc1640_init,
pc1640_close,
NULL,
NULL,
pc1640_speed_changed,
NULL,

View File

@@ -110,7 +110,8 @@ uint8_t pc200_in(uint16_t addr, void *p)
return cga_in(addr, cga);
}
void *pc200_init()
static void *pc200_init(device_t *info)
{
pc200_t *pc200 = malloc(sizeof(pc200_t));
cga_t *cga = &pc200->cga;
@@ -126,7 +127,7 @@ void *pc200_init()
return pc200;
}
void pc200_close(void *p)
static void pc200_close(void *p)
{
pc200_t *pc200 = (pc200_t *)p;
@@ -134,7 +135,7 @@ void pc200_close(void *p)
free(pc200);
}
void pc200_speed_changed(void *p)
static void pc200_speed_changed(void *p)
{
pc200_t *pc200 = (pc200_t *)p;
@@ -144,9 +145,10 @@ void pc200_speed_changed(void *p)
device_t pc200_device =
{
"Amstrad PC200 (video)",
0,
0, 0,
pc200_init,
pc200_close,
NULL,
NULL,
pc200_speed_changed,
NULL,

View File

@@ -517,7 +517,8 @@ void pcjr_poll(void *p)
}
}
static void *pcjr_video_init()
static void *pcjr_video_init(device_t *info)
{
int display_type;
pcjr_t *pcjr = malloc(sizeof(pcjr_t));
@@ -551,9 +552,10 @@ static void pcjr_speed_changed(void *p)
device_t pcjr_video_device =
{
"IBM PCjr (video)",
0,
0, 0,
pcjr_video_init,
pcjr_video_close,
NULL,
NULL,
pcjr_speed_changed,
NULL,
@@ -586,9 +588,10 @@ static device_config_t pcjr_config[] =
static device_t pcjr_device =
{
"IBM PCjr",
0,
0, 0,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,

View File

@@ -122,7 +122,8 @@ uint8_t ps1_m2121_svga_in(uint16_t addr, void *p)
return temp;
}
void *ps1_m2121_svga_init()
static void *ps1_m2121_svga_init(device_t *info)
{
ps1_m2121_svga_t *ps1 = malloc(sizeof(ps1_m2121_svga_t));
memset(ps1, 0, sizeof(ps1_m2121_svga_t));
@@ -176,10 +177,11 @@ void ps1_m2121_svga_add_status_info(char *s, int max_len, void *p)
device_t ps1_m2121_svga_device =
{
"PS/1 Model 2121 SVGA",
0,
0, 0,
ps1_m2121_svga_init,
ps1_m2121_svga_close,
NULL,
NULL,
ps1_m2121_svga_speed_changed,
ps1_m2121_svga_force_redraw,
ps1_m2121_svga_add_status_info

View File

@@ -2216,29 +2216,30 @@ void *s3_vision864_init(wchar_t *bios_fn)
return s3;
}
void *s3_bahamas64_init()
static void *s3_bahamas64_init(device_t *info)
{
s3_t *s3 = s3_vision864_init(L"roms/video/s3/bahamas64.BIN");
return s3;
}
void *s3_phoenix_vision864_init()
static void *s3_phoenix_vision864_init(device_t *info)
{
s3_t *s3 = s3_vision864_init(L"roms/video/s3/86c864p.bin");
return s3;
}
int s3_bahamas64_available()
static int s3_bahamas64_available(void)
{
return rom_present(L"roms/video/s3/bahamas64.BIN");
}
int s3_phoenix_vision864_available()
static int s3_phoenix_vision864_available(void)
{
return rom_present(L"roms/video/s3/86c864p.bin");
}
void *s3_phoenix_trio32_init()
static void *s3_phoenix_trio32_init(device_t *info)
{
s3_t *s3 = s3_init(L"roms/video/s3/86C732P.bin", S3_TRIO32);
@@ -2253,12 +2254,12 @@ void *s3_phoenix_trio32_init()
return s3;
}
int s3_phoenix_trio32_available()
static int s3_phoenix_trio32_available(void)
{
return rom_present(L"roms/video/s3/86C732P.bin");
}
void *s3_trio64_init(wchar_t *bios_fn)
static void *s3_trio64_init(wchar_t *bios_fn)
{
s3_t *s3 = s3_init(bios_fn, S3_TRIO64);
@@ -2272,40 +2273,40 @@ void *s3_trio64_init(wchar_t *bios_fn)
return s3;
}
void *s3_9fx_init()
static void *s3_9fx_init(device_t *info)
{
s3_t *s3 = s3_trio64_init(L"roms/video/s3/s3_764.bin");
return s3;
}
void *s3_phoenix_trio64_init()
static void *s3_phoenix_trio64_init(device_t *info)
{
s3_t *s3 = s3_trio64_init(L"roms/video/s3/86C764X1.bin");
return s3;
}
void *s3_diamond_stealth64_init()
static void *s3_diamond_stealth64_init(device_t *info)
{
s3_t *s3 = s3_trio64_init(L"roms/video/s3/STEALT64.BIN");
return s3;
}
int s3_9fx_available()
static int s3_9fx_available(void)
{
return rom_present(L"roms/video/s3/s3_764.bin");
}
int s3_phoenix_trio64_available()
static int s3_phoenix_trio64_available(void)
{
return rom_present(L"roms/video/s3/86c764x1.bin");
}
int s3_diamond_stealth64_available()
static int s3_diamond_stealth64_available(void)
{
return rom_present(L"roms/video/s3/STEALT64.BIN");
}
void s3_close(void *p)
static void s3_close(void *p)
{
s3_t *s3 = (s3_t *)p;
@@ -2318,21 +2319,21 @@ void s3_close(void *p)
free(s3);
}
void s3_speed_changed(void *p)
static void s3_speed_changed(void *p)
{
s3_t *s3 = (s3_t *)p;
svga_recalctimings(&s3->svga);
}
void s3_force_redraw(void *p)
static void s3_force_redraw(void *p)
{
s3_t *s3 = (s3_t *)p;
s3->svga.fullchange = changeframecount;
}
void s3_add_status_info(char *s, int max_len, void *p)
static void s3_add_status_info(char *s, int max_len, void *p)
{
s3_t *s3 = (s3_t *)p;
char temps[256];
@@ -2466,8 +2467,10 @@ device_t s3_bahamas64_device =
{
"Paradise Bahamas 64 (S3 Vision864)",
0,
0,
s3_bahamas64_init,
s3_close,
NULL,
s3_bahamas64_available,
s3_speed_changed,
s3_force_redraw,
@@ -2479,8 +2482,10 @@ device_t s3_9fx_device =
{
"Number 9 9FX (S3 Trio64)",
0,
0,
s3_9fx_init,
s3_close,
NULL,
s3_9fx_available,
s3_speed_changed,
s3_force_redraw,
@@ -2492,8 +2497,10 @@ device_t s3_phoenix_trio32_device =
{
"Phoenix S3 Trio32",
0,
0,
s3_phoenix_trio32_init,
s3_close,
NULL,
s3_phoenix_trio32_available,
s3_speed_changed,
s3_force_redraw,
@@ -2505,8 +2512,10 @@ device_t s3_phoenix_trio64_device =
{
"Phoenix S3 Trio64",
0,
0,
s3_phoenix_trio64_init,
s3_close,
NULL,
s3_phoenix_trio64_available,
s3_speed_changed,
s3_force_redraw,
@@ -2518,8 +2527,10 @@ device_t s3_phoenix_vision864_device =
{
"Phoenix S3 Vision864",
0,
0,
s3_phoenix_vision864_init,
s3_close,
NULL,
s3_phoenix_vision864_available,
s3_speed_changed,
s3_force_redraw,
@@ -2531,8 +2542,10 @@ device_t s3_diamond_stealth64_device =
{
"S3 Trio64 (Diamond Stealth64 DRAM)",
0,
0,
s3_diamond_stealth64_init,
s3_close,
NULL,
s3_diamond_stealth64_available,
s3_speed_changed,
s3_force_redraw,

View File

@@ -3751,7 +3751,7 @@ static void s3_virge_pci_write(int func, int addr, uint8_t val, void *p)
}
}
static void *s3_virge_init()
static void *s3_virge_init(device_t *info)
{
virge_t *virge = malloc(sizeof(virge_t));
memset(virge, 0, sizeof(virge_t));
@@ -3846,7 +3846,7 @@ static void *s3_virge_init()
return virge;
}
static void *s3_virge_988_init()
static void *s3_virge_988_init(device_t *info)
{
virge_t *virge = malloc(sizeof(virge_t));
memset(virge, 0, sizeof(virge_t));
@@ -4035,12 +4035,12 @@ static void *s3_virge_375_init(wchar_t *romfn)
return virge;
}
static void *s3_virge_375_1_init()
static void *s3_virge_375_1_init(device_t *info)
{
return s3_virge_375_init(L"roms/video/s3virge/86c375_1.bin");
}
static void *s3_virge_375_4_init()
static void *s3_virge_375_4_init(device_t *info)
{
return s3_virge_375_init(L"roms/video/s3virge/86c375_4.bin");
}
@@ -4068,22 +4068,22 @@ static void s3_virge_close(void *p)
free(virge);
}
static int s3_virge_available()
static int s3_virge_available(void)
{
return rom_present(L"roms/video/s3virge/s3virge.bin");
}
static int s3_virge_988_available()
static int s3_virge_988_available(void)
{
return rom_present(L"roms/video/s3virge/diamondstealth3000.VBI");
}
static int s3_virge_375_1_available()
static int s3_virge_375_1_available(void)
{
return rom_present(L"roms/video/s3virge/86c375_1.bin");
}
static int s3_virge_375_4_available()
static int s3_virge_375_4_available(void)
{
return rom_present(L"roms/video/s3virge/86c375_4.bin");
}
@@ -4154,8 +4154,10 @@ device_t s3_virge_device =
{
"Diamond Stealth 3D 2000 (S3 ViRGE)",
0,
0,
s3_virge_init,
s3_virge_close,
NULL,
s3_virge_available,
s3_virge_speed_changed,
s3_virge_force_redraw,
@@ -4167,8 +4169,10 @@ device_t s3_virge_988_device =
{
"Diamond Stealth 3D 3000 (S3 ViRGE/VX)",
0,
0,
s3_virge_988_init,
s3_virge_close,
NULL,
s3_virge_988_available,
s3_virge_speed_changed,
s3_virge_force_redraw,
@@ -4180,8 +4184,10 @@ device_t s3_virge_375_device =
{
"S3 ViRGE/DX",
0,
0,
s3_virge_375_1_init,
s3_virge_close,
NULL,
s3_virge_375_1_available,
s3_virge_speed_changed,
s3_virge_force_redraw,
@@ -4193,8 +4199,10 @@ device_t s3_virge_375_4_device =
{
"S3 ViRGE/DX (VBE 2.0)",
0,
0,
s3_virge_375_4_init,
s3_virge_close,
NULL,
s3_virge_375_4_available,
s3_virge_speed_changed,
s3_virge_force_redraw,

View File

@@ -585,7 +585,8 @@ void tandy_poll(void *p)
}
}
void *tandy_init()
static void *tandy_init(device_t *info)
{
int display_type;
tandy_t *tandy = malloc(sizeof(tandy_t));
@@ -610,14 +611,14 @@ void *tandy_init()
return tandy;
}
void tandy_close(void *p)
static void tandy_close(void *p)
{
tandy_t *tandy = (tandy_t *)p;
free(tandy);
}
void tandy_speed_changed(void *p)
static void tandy_speed_changed(void *p)
{
tandy_t *tandy = (tandy_t *)p;
@@ -628,11 +629,14 @@ device_t tandy_device =
{
"Tandy 1000 (video)",
0,
0,
tandy_init,
tandy_close,
NULL,
NULL,
tandy_speed_changed,
NULL,
NULL,
NULL
};
@@ -662,8 +666,9 @@ static device_config_t tandy_config[] =
static device_t tandy1000_device =
{
"Tandy 1000",
0,
0, 0,
NULL,
NULL,
NULL,
NULL,
NULL,
@@ -674,8 +679,9 @@ static device_t tandy1000_device =
static device_t tandy1000hx_device =
{
"Tandy 1000HX",
0,
0, 0,
NULL,
NULL,
NULL,
NULL,
NULL,

View File

@@ -654,7 +654,8 @@ static void tandysl_poll(void *p)
}
}
static void *tandysl_init()
static void *tandysl_init(device_t *info)
{
tandysl_t *tandy = malloc(sizeof(tandysl_t));
memset(tandy, 0, sizeof(tandysl_t));
@@ -694,10 +695,13 @@ device_t tandysl_device =
{
"Tandy 1000SL (video)",
0,
0,
tandysl_init,
tandysl_close,
NULL,
NULL,
tandysl_speed_changed,
NULL,
NULL,
NULL
};

View File

@@ -507,7 +507,7 @@ void tgui_pci_write(int func, int addr, uint8_t val, void *p)
}
}
void *tgui9440_init()
void *tgui9440_init(device_t *info)
{
tgui_t *tgui = malloc(sizeof(tgui_t));
memset(tgui, 0, sizeof(tgui_t));
@@ -539,7 +539,7 @@ void *tgui9440_init()
return tgui;
}
static int tgui9440_available()
static int tgui9440_available(void)
{
return rom_present(L"roms/video/tgui9440/9440.vbi");
}
@@ -1275,8 +1275,10 @@ device_t tgui9440_device =
{
"Trident TGUI 9440",
0,
0,
tgui9440_init,
tgui_close,
NULL,
tgui9440_available,
tgui_speed_changed,
tgui_force_redraw,

View File

@@ -282,7 +282,8 @@ void tvga_recalctimings(svga_t *svga)
}
}
void *tvga8900d_init()
static void *tvga8900d_init(device_t *info)
{
tvga_t *tvga = malloc(sizeof(tvga_t));
memset(tvga, 0, sizeof(tvga_t));
@@ -303,7 +304,7 @@ void *tvga8900d_init()
return tvga;
}
static int tvga8900d_available()
static int tvga8900d_available(void)
{
return rom_present(L"roms/video/tvga/TRIDENT.BIN");
}
@@ -367,8 +368,10 @@ device_t tvga8900d_device =
{
"Trident TVGA 8900D",
0,
0,
tvga8900d_init,
tvga_close,
NULL,
tvga8900d_available,
tvga_speed_changed,
tvga_force_redraw,

View File

@@ -84,7 +84,8 @@ uint8_t vga_in(uint16_t addr, void *p)
return temp;
}
void *vga_init()
static void *vga_init(device_t *info)
{
vga_t *vga = malloc(sizeof(vga_t));
memset(vga, 0, sizeof(vga_t));
@@ -105,8 +106,9 @@ void *vga_init()
return vga;
}
#ifdef DEV_BRANCH
void *trigem_unk_init()
static void *trigem_unk_init(device_t *info)
{
vga_t *vga = malloc(sizeof(vga_t));
memset(vga, 0, sizeof(vga_t));
@@ -133,7 +135,7 @@ void *trigem_unk_init()
#endif
/*PS/1 uses a standard VGA controller, but with no option ROM*/
void *ps1vga_init()
void *ps1vga_init(device_t *info)
{
vga_t *vga = malloc(sizeof(vga_t));
memset(vga, 0, sizeof(vga_t));
@@ -152,7 +154,7 @@ void *ps1vga_init()
return vga;
}
static int vga_available()
static int vga_available(void)
{
return rom_present(L"roms/video/vga/ibm_vga.bin");
}
@@ -191,8 +193,10 @@ device_t vga_device =
{
"VGA",
0,
0,
vga_init,
vga_close,
NULL,
vga_available,
vga_speed_changed,
vga_force_redraw,
@@ -203,8 +207,10 @@ device_t trigem_unk_device =
{
"VGA",
0,
0,
trigem_unk_init,
vga_close,
NULL,
vga_available,
vga_speed_changed,
vga_force_redraw,
@@ -215,8 +221,10 @@ device_t ps1vga_device =
{
"PS/1 VGA",
0,
0,
ps1vga_init,
vga_close,
NULL,
vga_available,
vga_speed_changed,
vga_force_redraw,

View File

@@ -1,7 +1,6 @@
#include <stdio.h>
#include <stdint.h>
#include <string.h>
//#include <stddef.h>
#include <stdlib.h>
#include <wchar.h>
#include <math.h>
@@ -7460,7 +7459,8 @@ static void voodoo_speed_changed(void *p)
// pclog("Voodoo read_time=%i write_time=%i burst_time=%i %08x %08x\n", voodoo->read_time, voodoo->write_time, voodoo->burst_time, voodoo->fbiInit1, voodoo->fbiInit4);
}
void *voodoo_card_init()
void *voodoo_card_init(void)
{
int c;
voodoo_t *voodoo = malloc(sizeof(voodoo_t));
@@ -7597,7 +7597,7 @@ void *voodoo_card_init()
return voodoo;
}
void *voodoo_init()
void *voodoo_init(device_t *info)
{
voodoo_set_t *voodoo_set = malloc(sizeof(voodoo_set_t));
uint32_t tmuConfig = 1;
@@ -7838,8 +7838,10 @@ device_t voodoo_device =
{
"3DFX Voodoo Graphics",
DEVICE_PCI,
0,
voodoo_init,
voodoo_close,
NULL,
NULL,
voodoo_speed_changed,
NULL,

View File

@@ -875,7 +875,8 @@ void wy700_poll(void *p)
}
}
void *wy700_init()
void *wy700_init(device_t *info)
{
int c;
wy700_t *wy700 = malloc(sizeof(wy700_t));
@@ -986,11 +987,13 @@ void wy700_speed_changed(void *p)
device_t wy700_device =
{
"Wyse 700",
0,
0, 0,
wy700_init,
wy700_close,
NULL,
NULL,
wy700_speed_changed,
NULL,
NULL,
NULL
};

View File

@@ -1,6 +1,9 @@
/* Copyright holders: Sarah Walker, Tenshi
see COPYING for more details
*/
#ifndef EMU_VIDEO_H
# define EMU_VIDEO_H
typedef struct
{
@@ -28,7 +31,9 @@ extern BITMAP *buffer, *buffer32;
int video_card_available(int card);
char *video_card_getname(int card);
struct device_t *video_card_getdevice(int card);
#ifdef EMU_DEVICE_H
device_t *video_card_getdevice(int card);
#endif
int video_card_has_config(int card);
int video_card_getid(char *s);
int video_old_to_new(int card);
@@ -122,3 +127,6 @@ void updatewindowsize(int x, int y);
#ifdef ENABLE_VRAM_DUMP
void svga_dump_vram(void);
#endif
#endif /*EMU_VIDEO_H*/

View File

@@ -8,7 +8,7 @@
*
* Windows resource script.
*
* Version: @(#)86Box.rc 1.0.14 2017/10/01
* Version: @(#)86Box.rc 1.0.15 2017/10/05
*
* Authors: Miran Grca, <mgrca8@gmail.com>
* Fred N. van Kempen, <decwiz@yahoo.com>
@@ -40,7 +40,7 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
// Menu
//
MAINMENU MENU DISCARDABLE
MainMenu MENU DISCARDABLE
BEGIN
POPUP "&Action"
BEGIN
@@ -157,13 +157,17 @@ BEGIN
END
END
StatusBarMenu MENU DISCARDABLE
BEGIN
END
/////////////////////////////////////////////////////////////////////////////
//
// Accelerator
//
MAINACCEL ACCELERATORS MOVEABLE PURE
MainAccel ACCELERATORS MOVEABLE PURE
BEGIN
#ifdef ENABLE_VRAM_DUMP
VK_F1, IDM_DUMP_VRAM, CONTROL, VIRTKEY
@@ -686,9 +690,7 @@ BEGIN
IDS_2053 "Invalid number of sectors (valid values are between 1 and 63)"
IDS_2054 "Invalid number of heads (valid values are between 1 and 16)"
IDS_2055 "Invalid number of cylinders (valid values are between 1 and 266305)"
#if NOTUSED
IDS_2056
#endif
IDS_2056 "No usable ROM images found!"
IDS_2057 "(empty)"
IDS_2058 "(host drive %c:)"
IDS_2059 "Turbo"
@@ -735,6 +737,7 @@ BEGIN
IDS_2092 "Bus"
IDS_2093 "DMA"
IDS_2094 "KB"
IDS_2095 "Neither DirectDraw nor Direct3D available !"
END
STRINGTABLE DISCARDABLE
@@ -807,10 +810,8 @@ BEGIN
IDS_2150 "Thrustmaster Flight Control System"
IDS_2151 "Disabled"
IDS_2152 "None"
#if UNUSED
IDS_2153
IDS_2154
#endif
IDS_2153 "Unable to load Keyboard Accelerators!"
IDS_2154 "Unable to register Raw Input!"
IDS_2155 "IRQ %i"
IDS_2156 "%" PRIu64
IDS_2157 "%" PRIu64 " MB (CHS: %" PRIu64 ", %" PRIu64 ", %" PRIu64 ")"

View File

@@ -9,11 +9,8 @@
* Windows resource defines.
*
* NOTE: FIXME: Strings 2176 and 2193 are same.
* NOTE: FIXME: string 2052 not in use.
* NOTE: FIXME: string 2095 not in use.
* NOTE: FIXME: strings 2153-2154 not in use.
*
* Version: @(#)resource.h 1.0.9 2017/10/01
* Version: @(#)resource.h 1.0.10 2017/10/05
*
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
* Miran Grca, <mgrca8@gmail.com>
@@ -211,7 +208,7 @@
#define IDS_2053 2053 // "Invalid number of sectors.."
#define IDS_2054 2054 // "Invalid number of heads.."
#define IDS_2055 2055 // "Invalid number of cylinders.."
#define IDS_2056 2056 // "Please enter a valid file name"
#define IDS_2056 2056 // "No usable ROM images found!"
#define IDS_2057 2057 // "Unable to open the file for write"
#define IDS_2058 2058 // "Attempting to create a HDI.."
#define IDS_2059 2059 // "Remember to partition and.."
@@ -250,7 +247,7 @@
#define IDS_2092 2092 // "Bus"
#define IDS_2093 2093 // "DMA"
#define IDS_2094 2094 // "KB"
#define IDS_2095 2095
#define IDS_2095 2095 // "No renderer available!"
#define IDS_2096 2096 // "Slave"
#define IDS_2097 2097 // "SCSI (ID %s, LUN %s)"
#define IDS_2098 2098 // "Adapter Type"
@@ -308,12 +305,10 @@
#define IDS_2150 2150 // "Thrustmaster Flight Control System"
#define IDS_2151 2151 // "Disabled"
#define IDS_2152 2152 // "None"
#if NOTUSED
#define IDS_2153 2153
#define IDS_2154 2154
#endif
#define IDS_2153 2153 // "Unable to load Accelerators"
#define IDS_2154 2154 // "Unable to register Raw Input"
#define IDS_2155 2155 // "IRQ %i"
#define IDS_2156 2156 // "MFM (%01i:%01i)"
#define IDS_2156 2156 // "MFM/RLL (%91i:%01i)"
#define IDS_2157 2157 // "IDE (PIO+DMA) (%01i:%01i)"
#define IDS_2158 2158 // "SCSI (%02i:%02i)"
#define IDS_2159 2159 // "Invalid number of cylinders.."

File diff suppressed because it is too large Load Diff

View File

@@ -8,22 +8,17 @@
*
* The Emulator's Windows core.
*
* Version: @(#)win.h 1.0.0 2017/05/30
* NOTE This should be named 'plat.h' and then include any
* Windows-specific header files needed, to keep them
* out of the main code.
*
* Author: Sarah Walker, <http://pcem-emulator.co.uk/>
* Version: @(#)win.h 1.0.2 2017/10/05
*
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
* Miran Grca, <mgrca8@gmail.com>
* Copyright 2008-2017 Sarah Walker.
* Copyright 2016-2017 Miran Grca.
*/
/*
* This should be named 'plat.h' and then include any
* Windows-specific header files needed, to keep them
* out of the main code.
*/
/* Copyright holders: Sarah Walker
see COPYING for more details
*/
#ifndef BOX_WIN_H
# define BOX_WIN_H
@@ -31,32 +26,34 @@
# define UNICODE
# endif
# define BITMAP WINDOWS_BITMAP
/* # ifdef _WIN32_WINNT
# undef _WIN32_WINNT
# define _WIN32_WINNT 0x0501
# endif */
# if 0
# ifdef _WIN32_WINNT
# undef _WIN32_WINNT
# define _WIN32_WINNT 0x0501
# endif
# endif
# include <windows.h>
# include "resource.h"
# undef BITMAP
#define szClassName L"86BoxMainWnd"
#define szSubClassName L"86BoxSubWnd"
#define szStatusBarClassName L"86BoxStatusBar"
/* Class names and such. */
#define CLASS_NAME L"86BoxMainWnd"
#define MENU_NAME L"MainMenu"
#define ACCEL_NAME L"MainAccel"
#define SUB_CLASS_NAME L"86BoxSubWnd"
#define SB_CLASS_NAME L"86BoxStatusBar"
#define SB_MENU_NAME L"StatusBarMenu"
#define RENDER_NAME L"RenderWindow"
#define WM_RESETD3D WM_USER
#define WM_LEAVEFULLSCREEN WM_USER + 1
#define WM_SAVESETTINGS 0x8888 /* 86Box-specific message, used to tell the child dialog to save the currently specified settings. */
#define SB_ICON_WIDTH 24
/* Application-specific window messages. */
#define WM_RESETD3D WM_USER
#define WM_LEAVEFULLSCREEN WM_USER+1
#define WM_SAVESETTINGS 0x8888
extern HINSTANCE hinstance;
extern HWND ghwnd;
extern HWND status_hwnd;
extern HWND hwndStatus;
extern HWND hwndMain;
extern int status_is_open;
extern int mousecapture;
@@ -65,9 +62,6 @@ extern WCHAR wopenfilestring[260];
extern int pause;
extern HMENU smenu;
extern HMENU *sb_menu_handles;
#ifdef __cplusplus
extern "C" {
@@ -75,9 +69,9 @@ extern "C" {
extern void leave_fullscreen(void);
extern void status_open(HWND hwnd);
extern void deviceconfig_open(HWND hwnd, struct device_t *device);
#ifdef EMU_DEVICE_H
extern void deviceconfig_open(HWND hwnd, device_t *device);
#endif
extern void joystickconfig_open(HWND hwnd, int joy_nr, int type);
extern int getfile(HWND hwnd, char *f, char *fn);
@@ -92,23 +86,40 @@ extern void endblit(void);
extern void win_settings_open(HWND hwnd);
extern void win_menu_update();
extern void update_status_bar_panes(HWND hwnds);
extern int fdd_type_to_icon(int type);
extern void hard_disk_add_open(HWND hwnd, int is_existing);
extern int hard_disk_was_added(void);
extern void get_registry_key_map(void);
extern void process_raw_input(LPARAM lParam, int infocus);
extern int find_status_bar_part(int tag);
extern void cdrom_init_host_drives(void);
extern void cdrom_close(uint8_t id);
extern void update_tip(int meaning);
extern BOOL DirectoryExists(LPCTSTR szPath);
/* Status Window definitions. */
extern HWND hwndStatus;
extern void StatusWindowCreate(HWND hwnd);
/* Status Bar definitions. */
#define SB_ICON_WIDTH 24
#define SB_FLOPPY 0x00
#define SB_CDROM 0x10
#define SB_RDISK 0x20
#define SB_HDD 0x40
#define SB_NETWORK 0x50
#define SB_TEXT 0x60
extern int fdd_type_to_icon(int type);
extern int StatusBarFindPart(int tag);
extern void StatusBarUpdatePanes(void);
extern void StatusBarUpdateTip(int meaning);
extern void StatusBarUpdateIcon(int tag, int val);
extern void StatusBarUpdateIconState(int tag, int active);
extern void StatusBarSetTextW(wchar_t *wstr);
extern void StatusBarSetText(char *str);
#ifdef __cplusplus
}
#endif

View File

@@ -6,9 +6,9 @@
*
* This file is part of the 86Box distribution.
*
* Direct3D 9 full screen rendererer and screenshots taking.
* Direct3D 9 full-screen rendererer.
*
* Version: @(#)win_d3d_fs.cc 1.0.2 2017/08/23
* Version: @(#)win_d3d_fs.cc 1.0.3 2017/10/05
*
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
* Miran Grca, <mgrca8@gmail.com>
@@ -45,9 +45,9 @@ static D3DPRESENT_PARAMETERS d3dpp;
static HWND d3d_hwnd;
static HWND d3d_device_window;
static int d3d_fs_w, d3d_fs_h;
struct CUSTOMVERTEX
{
FLOAT x, y, z, rhw; // from the D3DFVF_XYZRHW flag
@@ -55,55 +55,72 @@ struct CUSTOMVERTEX
FLOAT tu, tv;
};
PALETTE cgapal =
{
{0,0,0},{0,42,0},{42,0,0},{42,21,0},
{0,0,0},{0,42,42},{42,0,42},{42,42,42},
{0,0,0},{21,63,21},{63,21,21},{63,63,21},
{0,0,0},{21,63,63},{63,21,63},{63,63,63},
{0,0,0},{0,0,42},{0,42,0},{0,42,42},
{42,0,0},{42,0,42},{42,21,00},{42,42,42},
{21,21,21},{21,21,63},{21,63,21},{21,63,63},
{63,21,21},{63,21,63},{63,63,21},{63,63,63},
PALETTE cgapal = {
{0,0,0},{0,42,0},{42,0,0},{42,21,0},
{0,0,0},{0,42,42},{42,0,42},{42,42,42},
{0,0,0},{21,63,21},{63,21,21},{63,63,21},
{0,0,0},{21,63,63},{63,21,63},{63,63,63},
{0,0,0},{0,21,0},{0,0,42},{0,42,42},
{42,0,21},{21,10,21},{42,0,42},{42,0,63},
{21,21,21},{21,63,21},{42,21,42},{21,63,63},
{63,0,0},{42,42,0},{63,21,42},{41,41,41},
{0,0,0},{0,0,42},{0,42,0},{0,42,42},
{42,0,0},{42,0,42},{42,21,00},{42,42,42},
{21,21,21},{21,21,63},{21,63,21},{21,63,63},
{63,21,21},{63,21,63},{63,63,21},{63,63,63},
{0,0,0},{0,21,0},{0,0,42},{0,42,42},
{42,0,21},{21,10,21},{42,0,42},{42,0,63},
{21,21,21},{21,63,21},{42,21,42},{21,63,63},
{63,0,0},{42,42,0},{63,21,42},{41,41,41},
{0,0,0},{0,42,42},{42,0,0},{42,42,42},
{0,0,0},{0,42,42},{42,0,0},{42,42,42},
{0,0,0},{0,63,63},{63,0,0},{63,63,63},
{0,0,0},{0,63,63},{63,0,0},{63,63,63},
{0,0,0},{0,42,42},{42,0,0},{42,42,42},
{0,0,0},{0,42,42},{42,0,0},{42,42,42},
{0,0,0},{0,63,63},{63,0,0},{63,63,63},
{0,0,0},{0,63,63},{63,0,0},{63,63,63},
};
PALETTE cgapal_mono[6] =
{
{ // 0 - green, 4-color-optimized contrast
{0x00,0x00,0x00},{0x00,0x0d,0x03},{0x01,0x17,0x05},{0x01,0x1a,0x06},{0x02,0x28,0x09},{0x02,0x2c,0x0a},{0x03,0x39,0x0d},{0x03,0x3c,0x0e},
{0x00,0x07,0x01},{0x01,0x13,0x04},{0x01,0x1f,0x07},{0x01,0x23,0x08},{0x02,0x31,0x0b},{0x02,0x35,0x0c},{0x05,0x3f,0x11},{0x0d,0x3f,0x17},
},
{ // 1 - green, 16-color-optimized contrast
{0x00,0x00,0x00},{0x00,0x0d,0x03},{0x01,0x15,0x05},{0x01,0x17,0x05},{0x01,0x21,0x08},{0x01,0x24,0x08},{0x02,0x2e,0x0b},{0x02,0x31,0x0b},
{0x01,0x22,0x08},{0x02,0x28,0x09},{0x02,0x30,0x0b},{0x02,0x32,0x0c},{0x03,0x39,0x0d},{0x03,0x3b,0x0e},{0x09,0x3f,0x14},{0x0d,0x3f,0x17},
},
{ // 2 - amber, 4-color-optimized contrast
{0x00,0x00,0x00},{0x15,0x05,0x00},{0x20,0x0b,0x00},{0x24,0x0d,0x00},{0x33,0x18,0x00},{0x37,0x1b,0x00},{0x3f,0x26,0x01},{0x3f,0x2b,0x06},
{0x0b,0x02,0x00},{0x1b,0x08,0x00},{0x29,0x11,0x00},{0x2e,0x14,0x00},{0x3b,0x1e,0x00},{0x3e,0x21,0x00},{0x3f,0x32,0x0a},{0x3f,0x38,0x0d},
},
{ // 3 - amber, 16-color-optimized contrast
{0x00,0x00,0x00},{0x15,0x05,0x00},{0x1e,0x09,0x00},{0x21,0x0b,0x00},{0x2b,0x12,0x00},{0x2f,0x15,0x00},{0x38,0x1c,0x00},{0x3b,0x1e,0x00},
{0x2c,0x13,0x00},{0x32,0x17,0x00},{0x3a,0x1e,0x00},{0x3c,0x1f,0x00},{0x3f,0x27,0x01},{0x3f,0x2a,0x04},{0x3f,0x36,0x0c},{0x3f,0x38,0x0d},
},
{ // 4 - grey, 4-color-optimized contrast
{0x00,0x00,0x00},{0x0e,0x0f,0x10},{0x15,0x17,0x18},{0x18,0x1a,0x1b},{0x24,0x25,0x25},{0x27,0x28,0x28},{0x33,0x34,0x32},{0x37,0x38,0x35},
{0x09,0x0a,0x0b},{0x11,0x12,0x13},{0x1c,0x1e,0x1e},{0x20,0x22,0x22},{0x2c,0x2d,0x2c},{0x2f,0x30,0x2f},{0x3c,0x3c,0x38},{0x3f,0x3f,0x3b},
},
{ // 5 - grey, 16-color-optimized contrast
{0x00,0x00,0x00},{0x0e,0x0f,0x10},{0x13,0x14,0x15},{0x15,0x17,0x18},{0x1e,0x20,0x20},{0x20,0x22,0x22},{0x29,0x2a,0x2a},{0x2c,0x2d,0x2c},
{0x1f,0x21,0x21},{0x23,0x25,0x25},{0x2b,0x2c,0x2b},{0x2d,0x2e,0x2d},{0x34,0x35,0x33},{0x37,0x37,0x34},{0x3e,0x3e,0x3a},{0x3f,0x3f,0x3b},
}
PALETTE cgapal_mono[6] = {
{ /* 0 - green, 4-color-optimized contrast. */
{0x00,0x00,0x00},{0x00,0x0d,0x03},{0x01,0x17,0x05},
{0x01,0x1a,0x06},{0x02,0x28,0x09},{0x02,0x2c,0x0a},
{0x03,0x39,0x0d},{0x03,0x3c,0x0e},{0x00,0x07,0x01},
{0x01,0x13,0x04},{0x01,0x1f,0x07},{0x01,0x23,0x08},
{0x02,0x31,0x0b},{0x02,0x35,0x0c},{0x05,0x3f,0x11},{0x0d,0x3f,0x17},
},
{ /* 1 - green, 16-color-optimized contrast. */
{0x00,0x00,0x00},{0x00,0x0d,0x03},{0x01,0x15,0x05},
{0x01,0x17,0x05},{0x01,0x21,0x08},{0x01,0x24,0x08},
{0x02,0x2e,0x0b},{0x02,0x31,0x0b},{0x01,0x22,0x08},
{0x02,0x28,0x09},{0x02,0x30,0x0b},{0x02,0x32,0x0c},
{0x03,0x39,0x0d},{0x03,0x3b,0x0e},{0x09,0x3f,0x14},{0x0d,0x3f,0x17},
},
{ /* 2 - amber, 4-color-optimized contrast. */
{0x00,0x00,0x00},{0x15,0x05,0x00},{0x20,0x0b,0x00},
{0x24,0x0d,0x00},{0x33,0x18,0x00},{0x37,0x1b,0x00},
{0x3f,0x26,0x01},{0x3f,0x2b,0x06},{0x0b,0x02,0x00},
{0x1b,0x08,0x00},{0x29,0x11,0x00},{0x2e,0x14,0x00},
{0x3b,0x1e,0x00},{0x3e,0x21,0x00},{0x3f,0x32,0x0a},{0x3f,0x38,0x0d},
},
{ /* 3 - amber, 16-color-optimized contrast. */
{0x00,0x00,0x00},{0x15,0x05,0x00},{0x1e,0x09,0x00},
{0x21,0x0b,0x00},{0x2b,0x12,0x00},{0x2f,0x15,0x00},
{0x38,0x1c,0x00},{0x3b,0x1e,0x00},{0x2c,0x13,0x00},
{0x32,0x17,0x00},{0x3a,0x1e,0x00},{0x3c,0x1f,0x00},
{0x3f,0x27,0x01},{0x3f,0x2a,0x04},{0x3f,0x36,0x0c},{0x3f,0x38,0x0d},
},
{ /* 4 - grey, 4-color-optimized contrast. */
{0x00,0x00,0x00},{0x0e,0x0f,0x10},{0x15,0x17,0x18},
{0x18,0x1a,0x1b},{0x24,0x25,0x25},{0x27,0x28,0x28},
{0x33,0x34,0x32},{0x37,0x38,0x35},{0x09,0x0a,0x0b},
{0x11,0x12,0x13},{0x1c,0x1e,0x1e},{0x20,0x22,0x22},
{0x2c,0x2d,0x2c},{0x2f,0x30,0x2f},{0x3c,0x3c,0x38},{0x3f,0x3f,0x3b},
},
{ /* 5 - grey, 16-color-optimized contrast. */
{0x00,0x00,0x00},{0x0e,0x0f,0x10},{0x13,0x14,0x15},
{0x15,0x17,0x18},{0x1e,0x20,0x20},{0x20,0x22,0x22},
{0x29,0x2a,0x2a},{0x2c,0x2d,0x2c},{0x1f,0x21,0x21},
{0x23,0x25,0x25},{0x2b,0x2c,0x2b},{0x2d,0x2e,0x2d},
{0x34,0x35,0x33},{0x37,0x37,0x34},{0x3e,0x3e,0x3a},{0x3f,0x3f,0x3b},
}
};
uint32_t pal_lookup[256];
@@ -182,7 +199,7 @@ int d3d_fs_init(HWND h)
_swprintf(emulator_title, L"%s v%s", EMU_NAME_W, EMU_VERSION_W);
d3d_device_window = CreateWindowEx (
0,
szSubClassName,
SUB_CLASS_NAME,
emulator_title,
WS_POPUP,
CW_USEDEFAULT,
@@ -497,7 +514,7 @@ static void d3d_fs_blit_memtoscreen(int x, int y, int y1, int y2, int w, int h)
hr = d3ddev->Present(NULL, NULL, d3d_device_window, NULL);
if (hr == D3DERR_DEVICELOST || hr == D3DERR_INVALIDCALL)
PostMessage(ghwnd, WM_RESETD3D, 0, 0);
PostMessage(hwndMain, WM_RESETD3D, 0, 0);
}
static void d3d_fs_blit_memtoscreen_8(int x, int y, int w, int h)
@@ -615,7 +632,7 @@ static void d3d_fs_blit_memtoscreen_8(int x, int y, int w, int h)
hr = d3ddev->Present(NULL, NULL, d3d_device_window, NULL);
if (hr == D3DERR_DEVICELOST || hr == D3DERR_INVALIDCALL)
PostMessage(ghwnd, WM_RESETD3D, 0, 0);
PostMessage(hwndMain, WM_RESETD3D, 0, 0);
}

View File

@@ -33,7 +33,9 @@ static HWND ddraw_hwnd;
int ddraw_init(HWND h)
{
#if NO_THIS_CRASHES_NOW
cgapal_rebuild();
#endif
if (FAILED(DirectDrawCreate(NULL, &lpdd, NULL)))
return 0;

View File

@@ -119,7 +119,7 @@ void SaveBitmap(wchar_t *szFilename,HBITMAP hBitmap)
if((fp = _wfopen(szFilename,L"wb"))==NULL)
{
_swprintf(szMessage, win_language_get_string_from_id(IDS_2088), szFilename);
msgbox_error_wstr(ghwnd, szMessage);
msgbox_error_wstr(hwndMain, szMessage);
break;
}

Some files were not shown because too many files have changed in this diff Show More