Merge branch '86Box:master' into nec-v20

This commit is contained in:
Jasmine Iwanek
2022-04-17 16:45:04 -04:00
committed by GitHub
71 changed files with 568 additions and 842 deletions

View File

@@ -114,6 +114,7 @@ if(HAIKU)
set(RTMIDI OFF)
endif()
set(CMAKE_C_STANDARD 11)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_FIND_PACKAGE_PREFER_CONFIG ON)
@@ -127,6 +128,7 @@ option(OPENAL "OpenAL"
option(RTMIDI "RtMidi" ON)
option(FLUIDSYNTH "FluidSynth" ON)
option(MUNT "MUNT" ON)
option(VNC "VNC renderer" OFF)
option(DINPUT "DirectInput" OFF)
option(CPPTHREADS "C++11 threads" ON)
option(NEW_DYNAREC "Use the PCem v15 (\"new\") dynamic recompiler" OFF)
@@ -140,21 +142,21 @@ option(QT "Qt GUI"
# Option Description Def. Condition Otherwise
# ------ ----------- ---- --------- ---------
cmake_dependent_option(AMD_K5 "AMD K5" ON "DEV_BRANCH" OFF)
cmake_dependent_option(AN430TX "Intel AN430TX" ON "DEV_BRANCH" OFF)
cmake_dependent_option(CYRIX_6X86 "Cyrix 6x86" ON "DEV_BRANCH" OFF)
cmake_dependent_option(DESKPRO386 "Compaq Deskpro 386" ON "DEV_BRANCH" OFF)
cmake_dependent_option(GUSMAX "Gravis UltraSound MAX" ON "DEV_BRANCH" OFF)
cmake_dependent_option(ISAMEM_RAMPAGE "AST Rampage" ON "DEV_BRANCH" OFF)
cmake_dependent_option(ISAMEM_IAB "Intel Above Board" ON "DEV_BRANCH" OFF)
cmake_dependent_option(ISAMEM_BRAT "BocaRAM/AT" ON "DEV_BRANCH" OFF)
cmake_dependent_option(LASERXT "VTech Laser XT" ON "DEV_BRANCH" OFF)
cmake_dependent_option(MGA "Matrox Mystique graphics adapters" ON "DEV_BRANCH" OFF)
cmake_dependent_option(NO_SIO "Machines without emulated Super I/O chips" ON "DEV_BRANCH" OFF)
cmake_dependent_option(OLIVETTI "Olivetti M290" ON "DEV_BRANCH" OFF)
cmake_dependent_option(OPEN_AT "OpenAT" ON "DEV_BRANCH" OFF)
cmake_dependent_option(PAS16 "Pro Audio Spectrum 16" ON "DEV_BRANCH" OFF)
cmake_dependent_option(SIO_DETECT "Super I/O Detection Helper" ON "DEV_BRANCH" OFF)
cmake_dependent_option(TANDY_ISA "Tandy PSG ISA clone boards" ON "DEV_BRANCH" OFF)
cmake_dependent_option(VGAWONDER "ATI VGA Wonder (ATI-18800)" ON "DEV_BRANCH" OFF)
cmake_dependent_option(VNC "VNC renderer" OFF "DEV_BRANCH" OFF)
cmake_dependent_option(XL24 "ATI VGA Wonder XL24 (ATI-28800-6)" ON "DEV_BRANCH" OFF)
# Ditto but for Qt

View File

@@ -172,7 +172,6 @@ int confirm_reset = 1; /* (C) enable reset confirmation */
int confirm_exit = 1; /* (C) enable exit confirmation */
int confirm_save = 1; /* (C) enable save confirmation */
int enable_discord = 0; /* (C) enable Discord integration */
int enable_crashdump = 0; /* (C) enable crash dump */
/* Statistics. */
extern int mmuflush;
@@ -403,9 +402,11 @@ pc_init(int argc, char *argv[])
char temp[2048];
struct tm *info;
time_t now;
int c, vmrp = 0;
int c;
int ng = 0, lvmp = 0;
#ifdef _WIN32
uint32_t *uid, *shwnd;
#endif
uint32_t lang_init = 0;
/* Grab the executable's full path. */
@@ -440,9 +441,6 @@ usage:
printf("\nUsage: 86box [options] [cfg-file]\n\n");
printf("Valid options are:\n\n");
printf("-? or --help - show this information\n");
#ifdef _WIN32
printf("-A or --crashdump - enables crashdump on exception\n");
#endif
printf("-C or --config path - set 'path' to be config file\n");
#ifdef _WIN32
printf("-D or --debug - force debug output logging\n");
@@ -463,9 +461,6 @@ usage:
printf("-Z or --lastvmpath - the last parameter is VM path rather than config\n");
printf("\nA config file can be specified. If none is, the default file will be used.\n");
return(0);
} else if (!strcasecmp(argv[c], "--vmrompath") ||
!strcasecmp(argv[c], "-M")) {
vmrp = 1;
} else if (!strcasecmp(argv[c], "--lastvmpath") ||
!strcasecmp(argv[c], "-Z")) {
lvmp = 1;
@@ -519,9 +514,6 @@ usage:
!strcasecmp(argv[c], "-N")) {
confirm_exit_cmdl = 0;
#ifdef _WIN32
} else if (!strcasecmp(argv[c], "--crashdump") ||
!strcasecmp(argv[c], "-A")) {
enable_crashdump = 1;
} else if (!strcasecmp(argv[c], "--hwnd") ||
!strcasecmp(argv[c], "-H")) {
@@ -1177,7 +1169,7 @@ pc_close(thread_t *ptr)
#ifdef __APPLE__
static void _ui_window_title(void *s)
{
ui_window_title((const wchar_t *) s);
ui_window_title((wchar_t *) s);
free(s);
}
#endif

View File

@@ -172,7 +172,6 @@ EXTRAS :=
AUTODEP := n
CRASHDUMP := n
DEBUG := n
OPTIM := n
X64 := n

View File

@@ -16,9 +16,6 @@
* Copyright 2015-2019 Miran Grca.
* Copyright 2017-2019 bit.
*/
#define __USE_LARGEFILE64
#define _LARGEFILE_SOURCE
#define _LARGEFILE64_SOURCE
#include <inttypes.h>
#include <stdarg.h>
#include <stdio.h>

View File

@@ -17,8 +17,6 @@
* Copyright 2017-2020 Fred N. van Kempen.
* Copyright 2002-2020 The DOSBox Team.
*/
#define _LARGEFILE_SOURCE
#define _LARGEFILE64_SOURCE
#define __STDC_FORMAT_MACROS
#include <stdarg.h>
#include <inttypes.h>

View File

@@ -23,7 +23,7 @@ if(DYNAREC)
target_sources(dynarec PRIVATE codegen_x86-64.c
codegen_accumulate_x86-64.c)
else()
message(SEND_ERROR
message(SEND_ERROR
"Dynarec is incompatible with target platform ${ARCH}")
endif()

View File

@@ -23,12 +23,12 @@ static inline int find_host_xmm_reg()
}
static inline void call(codeblock_t *block, uintptr_t func)
{
uintptr_t diff = func - (uintptr_t)&block->data[block_pos + 5];
intptr_t diff = (intptr_t)(func - (uintptr_t)&block->data[block_pos + 5]);
codegen_reg_loaded[0] = codegen_reg_loaded[1] = codegen_reg_loaded[2] = codegen_reg_loaded[3] = 0;
codegen_reg_loaded[4] = codegen_reg_loaded[5] = codegen_reg_loaded[6] = codegen_reg_loaded[7] = 0;
if (diff >= -0x80000000ULL && diff < 0x7fffffffULL)
if (diff >= -0x80000000LL && diff < 0x7fffffffLL)
{
addbyte(0xE8); /*CALL*/
addlong((uint32_t)diff);

View File

@@ -43,7 +43,7 @@ if(DYNAREC)
target_sources(dynarec PRIVATE codegen_backend_arm.c
codegen_backend_arm_ops.c codegen_backend_arm_uops.c)
else()
message(SEND_ERROR
message(SEND_ERROR
"Dynarec is incompatible with target platform ${ARCH}")
endif()

View File

@@ -22,6 +22,7 @@
#if defined WIN32 || defined _WIN32 || defined _WIN32
#include <windows.h>
#endif
#include <string.h>
void *codegen_mem_load_byte;
void *codegen_mem_load_word;
@@ -310,7 +311,7 @@ void codegen_backend_init()
block->data = codeblock_allocator_get_ptr(block->head_mem_block);
block_write_data = block->data;
build_loadstore_routines(&codeblock[block_current]);
printf("block_pos=%i\n", block_pos);
//pclog("block_pos=%i\n", block_pos);
codegen_fp_round = &block_write_data[block_pos];
build_fp_round_routine(&codeblock[block_current]);

View File

@@ -74,7 +74,6 @@ static void build_load_routine(codeblock_t *block, int size, int is_float)
{
uint32_t *branch_offset;
uint32_t *misaligned_offset;
int offset;
/*In - W0 = address
Out - W0 = data, W1 = abrt*/
@@ -143,7 +142,6 @@ static void build_store_routine(codeblock_t *block, int size, int is_float)
{
uint32_t *branch_offset;
uint32_t *misaligned_offset;
int offset;
/*In - R0 = address, R1 = data
Out - R1 = abrt*/
@@ -283,12 +281,6 @@ void codegen_backend_init()
{
codeblock_t *block;
int c;
#if defined(__linux__) || defined(__APPLE__)
void *start;
size_t len;
long pagesize = sysconf(_SC_PAGESIZE);
long pagemask = ~(pagesize - 1);
#endif
codeblock = malloc(BLOCK_SIZE * sizeof(codeblock_t));
codeblock_hash = malloc(HASH_SIZE * sizeof(codeblock_t *));

View File

@@ -270,12 +270,6 @@ static inline int imm_is_imm16(uint32_t imm_data)
return 1;
return 0;
}
static inline int imm_is_imm12(uint32_t imm_data)
{
if (!(imm_data & 0xfffff000) || !(imm_data & 0xff000fff))
return 1;
return 0;
}
static void codegen_allocate_new_block(codeblock_t *block);

View File

@@ -294,12 +294,6 @@ void codegen_backend_init()
{
codeblock_t *block;
int c;
#if defined(__linux__) || defined(__APPLE__)
void *start;
size_t len;
long pagesize = sysconf(_SC_PAGESIZE);
long pagemask = ~(pagesize - 1);
#endif
codeblock = malloc(BLOCK_SIZE * sizeof(codeblock_t));
codeblock_hash = malloc(HASH_SIZE * sizeof(codeblock_t *));

View File

@@ -27,12 +27,12 @@
static inline void call(codeblock_t *block, uintptr_t func)
{
uintptr_t diff;
intptr_t diff;
codegen_alloc_bytes(block, 5);
diff = func - (uintptr_t)&block_write_data[block_pos + 5];
diff = (intptr_t)(func - (uintptr_t)&block_write_data[block_pos + 5]);
if (diff >= -0x80000000 && diff < 0x7fffffff)
if (diff >= -0x80000000LL && diff < 0x7fffffffLL)
{
codegen_addbyte(block, 0xE8); /*CALL*/
codegen_addlong(block, (uint32_t)diff);
@@ -48,12 +48,12 @@ static inline void call(codeblock_t *block, uintptr_t func)
static inline void jmp(codeblock_t *block, uintptr_t func)
{
uintptr_t diff;
intptr_t diff;
codegen_alloc_bytes(block, 5);
diff = func - (uintptr_t)&block_write_data[block_pos + 5];
diff = (intptr_t)(func - (uintptr_t)&block_write_data[block_pos + 5]);
if (diff >= -0x80000000 && diff < 0x7fffffff)
if (diff >= -0x80000000LL && diff < 0x7fffffffLL)
{
codegen_addbyte(block, 0xe9); /*JMP*/
codegen_addlong(block, (uint32_t)diff);

View File

@@ -268,12 +268,7 @@ void codegen_backend_init()
{
codeblock_t *block;
int c;
#if defined(__linux__) || defined(__APPLE__)
void *start;
size_t len;
long pagesize = sysconf(_SC_PAGESIZE);
long pagemask = ~(pagesize - 1);
#endif
codeblock = malloc(BLOCK_SIZE * sizeof(codeblock_t));
codeblock_hash = malloc(HASH_SIZE * sizeof(codeblock_t *));

View File

@@ -513,7 +513,7 @@ void codegen_reg_write_imm(codeblock_t *block, ir_reg_t ir_reg, uint32_t imm_dat
case REG_DWORD:
if ((uintptr_t)p < 256)
codegen_direct_write_32_imm_stack(block, (int)p, imm_data);
codegen_direct_write_32_imm_stack(block, (int)((uintptr_t) p), imm_data);
else
codegen_direct_write_32_imm(block, p, imm_data);
break;

View File

@@ -2421,12 +2421,12 @@ save_machine(void)
if (fpu_type == 0)
config_delete_var(cat, "fpu_type");
else
else
config_set_string(cat, "fpu_type", (char *) fpu_get_internal_name(cpu_f, cpu, fpu_type));
//Write the mem_size explicitly to the setttings in order to help managers to display it without having the actual machine table
config_delete_var(cat, "mem_size");
config_set_int(cat, "mem_size", mem_size);
config_delete_var(cat, "mem_size");
config_set_int(cat, "mem_size", mem_size);
config_set_int(cat, "cpu_use_dynarec", cpu_use_dynarec);

View File

@@ -321,7 +321,9 @@ static int opENTER_w(uint32_t fetchdat)
uint16_t offset;
int count;
uint32_t tempEBP, tempESP, frame_ptr;
#ifndef IS_DYNAREC
int reads = 0, writes = 1, instr_cycles = 0;
#endif
uint16_t tempw;
offset = getwordf();
@@ -342,20 +344,26 @@ static int opENTER_w(uint32_t fetchdat)
PUSH_W(tempw);
if (cpu_state.abrt) { ESP = tempESP; EBP = tempEBP; return 1; }
CLOCK_CYCLES((is486) ? 3 : 4);
#ifndef IS_DYNAREC
reads++; writes++; instr_cycles += (is486) ? 3 : 4;
#endif
}
PUSH_W(frame_ptr);
if (cpu_state.abrt) { ESP = tempESP; EBP = tempEBP; return 1; }
CLOCK_CYCLES((is486) ? 3 : 5);
#ifndef IS_DYNAREC
writes++; instr_cycles += (is486) ? 3 : 5;
#endif
}
BP = frame_ptr;
if (stack32) ESP -= offset;
else SP -= offset;
CLOCK_CYCLES((is486) ? 14 : 10);
#ifndef IS_DYNAREC
instr_cycles += (is486) ? 14 : 10;
PREFETCH_RUN(instr_cycles, 3, -1, reads,0,writes,0, 0);
#endif
return 0;
}
static int opENTER_l(uint32_t fetchdat)
@@ -363,7 +371,9 @@ static int opENTER_l(uint32_t fetchdat)
uint16_t offset;
int count;
uint32_t tempEBP, tempESP, frame_ptr;
#ifndef IS_DYNAREC
int reads = 0, writes = 1, instr_cycles = 0;
#endif
uint32_t templ;
offset = getwordf();
@@ -383,20 +393,26 @@ static int opENTER_l(uint32_t fetchdat)
PUSH_L(templ);
if (cpu_state.abrt) { ESP = tempESP; EBP = tempEBP; return 1; }
CLOCK_CYCLES((is486) ? 3 : 4);
#ifndef IS_DYNAREC
reads++; writes++; instr_cycles += (is486) ? 3 : 4;
#endif
}
PUSH_L(frame_ptr);
if (cpu_state.abrt) { ESP = tempESP; EBP = tempEBP; return 1; }
CLOCK_CYCLES((is486) ? 3 : 5);
#ifndef IS_DYNAREC
writes++; instr_cycles += (is486) ? 3 : 5;
#endif
}
EBP = frame_ptr;
if (stack32) ESP -= offset;
else SP -= offset;
CLOCK_CYCLES((is486) ? 14 : 10);
#ifndef IS_DYNAREC
instr_cycles += (is486) ? 14 : 10;
PREFETCH_RUN(instr_cycles, 3, -1, reads,0,writes,0, 0);
#endif
return 0;
}

View File

@@ -31,8 +31,7 @@
#define CLAMP(a, min, max) (((a) < (min)) ? (min) : (((a) > (max)) ? (max) : (a)))
/* Formulas and factors derived from Linux's gl518sm.c driver. */
#define GL518SM_RPMDIV(r, d) (CLAMP((r), 1, 960000) * (d))
#define GL518SM_RPM_TO_REG(r, d) ((r) ? CLAMP((480000 + GL518SM_RPMDIV(r, d) / 2) / GL518SM_RPMDIV(r, d), 1, 255) : 0)
#define GL518SM_RPM_TO_REG(r, d) ((r) ? CLAMP((480000 + (r) * (d) / 2) / (r) * (d), 1, 255) : 0)
#define GL518SM_VOLTAGE_TO_REG(v) ((uint8_t) round((v) / 19.0))
#define GL518SM_VDD_TO_REG(v) ((uint8_t) (((v) * 4) / 95.0))

View File

@@ -88,6 +88,8 @@ discord_update_activity(int paused)
if (paren)
*(paren - 1) = '\0';
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wformat-truncation"
if (strlen(vm_name) < 100)
{
snprintf(activity.details, sizeof(activity.details), "Running \"%s\"", vm_name);
@@ -98,6 +100,7 @@ discord_update_activity(int paused)
strncpy(activity.details, strchr(machine_getname(), ']') + 2, sizeof(activity.details) - 1);
snprintf(activity.state, sizeof(activity.state), "%s/%s", cpufamily, cpu_s->name);
}
#pragma GCC diagnostic pop
activity.timestamps.start = time(NULL);

View File

@@ -18,8 +18,6 @@
* Copyright 2016-2019 Miran Grca.
* Copyright 2017-2019 Fred N. van Kempen.
*/
#define _LARGEFILE_SOURCE
#define _LARGEFILE64_SOURCE
#define _GNU_SOURCE
#include <stdarg.h>
#include <stdint.h>

View File

@@ -17,9 +17,6 @@
* Copyright 2008-2020 Sarah Walker.
* Copyright 2016-2020 Miran Grca.
*/
#define __USE_LARGEFILE64
#define _LARGEFILE_SOURCE
#define _LARGEFILE64_SOURCE
#include <stdarg.h>
#include <stdio.h>
#include <stdint.h>

View File

@@ -20,9 +20,6 @@
* Copyright 2008-2019 Sarah Walker.
* Copyright 2017-2019 Fred N. van Kempen.
*/
#define __USE_LARGEFILE64
#define _LARGEFILE_SOURCE
#define _LARGEFILE64_SOURCE
#include <stdarg.h>
#include <stdint.h>
#include <stdio.h>

View File

@@ -67,9 +67,6 @@
* Boston, MA 02111-1307
* USA.
*/
#define __USE_LARGEFILE64
#define _LARGEFILE_SOURCE
#define _LARGEFILE64_SOURCE
#include <stdarg.h>
#include <stdio.h>
#include <stdint.h>

View File

@@ -84,9 +84,6 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#define __USE_LARGEFILE64
#define _LARGEFILE_SOURCE
#define _LARGEFILE64_SOURCE
#include <stdarg.h>
#include <stdint.h>
#include <stdio.h>

View File

@@ -16,8 +16,6 @@
* Copyright 2016-2018 Miran Grca.
* Copyright 2017,2018 Fred N. van Kempen.
*/
#define _LARGEFILE_SOURCE
#define _LARGEFILE64_SOURCE
#define _GNU_SOURCE
#include <stdarg.h>
#include <stdint.h>

View File

@@ -148,8 +148,6 @@ track_is_xdf(int drive, int side, int track)
int max_high_id, expected_high_count, expected_low_count;
uint8_t *r_map;
uint8_t *n_map;
char *data_base;
char *cur_data;
effective_sectors = xdf_sectors = high_sectors = low_sectors = 0;
@@ -162,7 +160,6 @@ track_is_xdf(int drive, int side, int track)
(dev->tracks[track][side].params[3] != 19)) return(0);
r_map = (uint8_t *)(dev->buffer + dev->tracks[track][side].r_map_offs);
data_base = dev->buffer + dev->tracks[track][side].data_offs;
if (! track) {
if (dev->tracks[track][side].params[4] != 2) return(0);
@@ -197,7 +194,6 @@ track_is_xdf(int drive, int side, int track)
n_map = (uint8_t *) (dev->buffer + dev->tracks[track][side].n_map_offs);
cur_data = data_base;
for (i = 0; i < dev->tracks[track][side].params[3]; i++) {
effective_sectors++;
if (!(r_map[i]) && !(n_map[i]))
@@ -207,7 +203,6 @@ track_is_xdf(int drive, int side, int track)
xdf_sectors++;
dev->xdf_ordered_pos[(int) r_map[i]][side] = i;
}
cur_data += (128 << ((uint32_t) n_map[i]));
}
if ((effective_sectors == 3) && (xdf_sectors == 3)) {

View File

@@ -27,6 +27,7 @@
#else
# include <arpa/inet.h>
# include <sys/socket.h>
# include <errno.h>
#endif
#define HAVE_STDARG_H
#include <86box/86box.h>
@@ -954,7 +955,7 @@ e14:
/* Add our supported features to the end. */
if (client->response_pos < (sizeof(client->response) - 1))
client->response_pos += snprintf(&client->response[client->response_pos], sizeof(client->response) - client->response_pos,
"PacketSize=%X;swbreak+;hwbreak+;qXfer:features:read+", sizeof(client->packet) - 1);
"PacketSize=%lX;swbreak+;hwbreak+;qXfer:features:read+", sizeof(client->packet) - 1);
break;
} else if (!strcmp(client->response, "Xfer")) {
/* Read the transfer object. */
@@ -1101,6 +1102,7 @@ unknown:
case 'z': /* remove break/watchpoint */
case 'Z': /* insert break/watchpoint */
{
gdbstub_breakpoint_t *breakpoint, *prev_breakpoint = NULL, **first_breakpoint;
/* Parse breakpoint type. */
@@ -1222,6 +1224,7 @@ unknown:
/* Respond positively. */
goto ok;
}
}
end:
/* Send response. */
@@ -1655,7 +1658,11 @@ gdbstub_init()
.sin_port = htons(port)
};
if (bind(gdbstub_socket, (struct sockaddr *) &bind_addr, sizeof(bind_addr)) == -1) {
#ifdef _WIN32
pclog("GDB Stub: Failed to bind on port %d (%d)\n", port, WSAGetLastError());
#else
pclog("GDB Stup: Failed to bind on port %d (%d)\n", port, errno);
#endif
gdbstub_socket = -1;
return;
}

View File

@@ -42,6 +42,9 @@
#ifdef MAX
#undef MAX
#endif
#ifdef ABS
#undef ABS
#endif
#define MIN(a, b) ((a) < (b) ? (a) : (b))
#define MAX(a, b) ((a) > (b) ? (a) : (b))
@@ -123,7 +126,6 @@ extern int confirm_reset, /* (C) enable reset confirmation */
confirm_exit, /* (C) enable exit confirmation */
confirm_save; /* (C) enable save confirmation */
extern int enable_discord; /* (C) enable Discord integration */
extern int enable_crashdump; /* (C) enable crash dump */
extern int is_pentium; /* TODO: Move back to cpu/cpu.h when it's figured out,
how to remove that hack from the ET4000/W32p. */

View File

@@ -16,6 +16,7 @@
*/
#ifndef EMU_GDBSTUB_H
#define EMU_GDBSTUB_H
#include <stdint.h>
#include <86box/mem.h>
#define GDBSTUB_MEM_READ 0

View File

@@ -514,7 +514,9 @@ extern int machine_at_cmdpc_init(const machine_t *);
extern int machine_at_portableii_init(const machine_t *);
extern int machine_at_portableiii_init(const machine_t *);
extern int machine_at_portableiii386_init(const machine_t *);
#if defined(DEV_BRANCH) && defined(USE_DESKPRO386)
extern int machine_at_deskpro386_init(const machine_t *);
#endif
#ifdef EMU_DEVICE_H
extern const device_t *at_cpqiii_get_device(void);
#endif
@@ -620,7 +622,7 @@ extern int machine_at_i430vx_init(const machine_t *);
extern int machine_at_nupro592_init(const machine_t *);
extern int machine_at_tx97_init(const machine_t *);
#if defined(DEV_BRANCH) && defined(NO_SIO)
#if defined(DEV_BRANCH) && defined(USE_AN430TX)
extern int machine_at_an430tx_init(const machine_t *);
#endif
extern int machine_at_ym430tx_init(const machine_t *);

View File

@@ -158,7 +158,7 @@ typedef struct svga_t
/*Force CRTC to dword mode, regardless of CR14/CR17. Required for S3 enhanced mode*/
int force_dword_mode;
int force_old_addr;
int remap_required;

View File

@@ -20,6 +20,11 @@
#define LOD_MASK (LOD_TMIRROR_S | LOD_TMIRROR_T)
/* Suppress a false positive warning on gcc that causes excessive build log spam */
#if __GNUC__ >= 10
#pragma GCC diagnostic ignored "-Wstringop-overflow"
#endif
typedef struct voodoo_x86_data_t
{
uint8_t code_block[BLOCK_SIZE];

View File

@@ -20,6 +20,11 @@
#define LOD_MASK (LOD_TMIRROR_S | LOD_TMIRROR_T)
/* Suppress a false positive warning on gcc that causes excessive build log spam */
#if __GNUC__ >= 10
#pragma GCC diagnostic ignored "-Wstringop-overflow"
#endif
typedef struct voodoo_x86_data_t
{
uint8_t code_block[BLOCK_SIZE];

View File

@@ -120,7 +120,6 @@ extern uint8_t filterindex;
extern void ResizeWindowByClientArea(HWND hwnd, int width, int height);
extern void InitCrashDump(void);
/* Emulator start/stop support functions. */
extern void do_start(void);

View File

@@ -24,15 +24,19 @@ add_library(mch OBJECT machine.c machine_table.c m_xt.c m_xt_compaq.c
m_at_sockets7.c m_at_socket8.c m_at_slot1.c m_at_slot2.c m_at_socket370.c
m_at_misc.c)
if(AN430TX)
target_compile_definitions(mch PRIVATE USE_AN430TX)
endif()
if(DESKPRO386)
target_compile_definitions(mch PRIVATE USE_DESKPRO386)
endif()
if(LASERXT)
target_sources(mch PRIVATE m_xt_laserxt.c)
target_compile_definitions(mch PRIVATE USE_LASERXT)
endif()
if(NO_SIO)
target_compile_definitions(mch PRIVATE NO_SIO)
endif()
if(OPEN_AT)
target_compile_definitions(mch PRIVATE USE_OPEN_AT)
endif()

View File

@@ -893,6 +893,7 @@ machine_at_portableiii386_init(const machine_t *model)
return ret;
}
#if defined(DEV_BRANCH) && defined(USE_DESKPRO386)
int
machine_at_deskpro386_init(const machine_t *model)
{
@@ -908,3 +909,4 @@ machine_at_deskpro386_init(const machine_t *model)
return ret;
}
#endif

View File

@@ -689,7 +689,7 @@ machine_at_tx97_init(const machine_t *model)
}
#if defined(DEV_BRANCH) && defined(NO_SIO)
#if defined(DEV_BRANCH) && defined(USE_AN430TX)
int
machine_at_an430tx_init(const machine_t *model)
{

View File

@@ -82,9 +82,6 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#define __USE_LARGEFILE64
#define _LARGEFILE_SOURCE
#define _LARGEFILE64_SOURCE
#include <stdarg.h>
#include <stdint.h>
#include <stdio.h>

View File

@@ -401,7 +401,10 @@ static void model_50_write(uint16_t port, uint8_t val)
static void model_55sx_mem_recalc(void)
{
int i, j, state, enabled_mem = 0;
int i, j, state;
#ifdef ENABLE_PS2_MCA_LOG
int enabled_mem = 0;
#endif
int base = 0, remap_size = (ps2.option[3] & 0x10) ? 384 : 256;
int bit_mask = 0x00, max_rows = 4;
int bank_to_rows[16] = { 4, 2, 1, 0, 0, 2, 1, 0, 0, 0, 0, 0, 0, 2, 1, 0 };
@@ -424,14 +427,18 @@ static void model_55sx_mem_recalc(void)
if (ps2.memory_bank[i] & (1 << j)) {
ps2_mca_log("Set memory at %06X-%06X to internal\n", (base * 1024), (base * 1024) + (((base > 0) ? 1024 : 640) * 1024) - 1);
mem_set_mem_state(base * 1024, ((base > 0) ? 1024 : 640) * 1024, MEM_READ_INTERNAL | MEM_WRITE_INTERNAL);
#ifdef ENABLE_PS2_MCA_LOG
enabled_mem += 1024;
#endif
bit_mask |= (1 << (j + (i << 2)));
}
base += 1024;
}
}
#ifdef ENABLE_PS2_MCA_LOG
ps2_mca_log("Enabled memory: %i kB (%02X)\n", enabled_mem, bit_mask);
#endif
if (ps2.option[3] & 0x10)
{

View File

@@ -144,7 +144,6 @@ const machine_filter_t machine_chipsets[] = {
/* Machines to add before machine freeze:
- PCChips M773 (440BX + SMSC with AMI BIOS);
- Rise R418 (was removed on my end, has to be re-added);
- TMC Mycomp PCI54ST;
- Zeos Quadtel 486.
@@ -177,9 +176,6 @@ const machine_filter_t machine_chipsets[] = {
respectively. Also, AMI KBC command C1, mysteriously missing
from the technical references of AMI MegaKey and earlier, is
Write Input Port, same as on AMIKey-3.
Machines to remove:
- Hedaka HED-919.
*/
@@ -215,28 +211,28 @@ const machine_t machines[] = {
{ "[8088] VTech Laser Turbo XT", "ltxt", MACHINE_TYPE_8088, MACHINE_CHIPSET_DISCRETE, machine_xt_laserxt_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_8088, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_PC, MACHINE_FLAGS_NONE, 256, 640, 256, 0,NULL, NULL },
#endif
/* Has a standard PS/2 KBC (so, use IBM PS/2 Type 1). */
{ "[8088] Xi8088", "xi8088", MACHINE_TYPE_8088, MACHINE_CHIPSET_DISCRETE, machine_xt_xi8088_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_8088, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_PS2, MACHINE_FLAGS_NONE, 64, 1024, 128, 127, xi8088_get_device},
{ "[8088] Xi8088", "xi8088", MACHINE_TYPE_8088, MACHINE_CHIPSET_DISCRETE, machine_xt_xi8088_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_8088, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_PS2, MACHINE_FLAGS_NONE, 64, 1024, 128, 127, xi8088_get_device, NULL },
{ "[8088] Z-NIX PC-1600", "znic", MACHINE_TYPE_8088, MACHINE_CHIPSET_DISCRETE, machine_xt_znic_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_8088, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_PC, MACHINE_FLAGS_NONE, 64, 640, 64, 0, NULL, NULL },
{ "[8088] Zenith Data Systems Z-151/152/161", "zdsz151", MACHINE_TYPE_8088, MACHINE_CHIPSET_DISCRETE, machine_xt_z151_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_8088, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_PC, MACHINE_FLAGS_NONE, 128, 640, 64, 0, NULL, NULL },
{ "[8088] Zenith Data Systems Z-159", "zdsz159", MACHINE_TYPE_8088, MACHINE_CHIPSET_DISCRETE, machine_xt_z159_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_8088, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_PC, MACHINE_FLAGS_NONE, 128, 640, 64, 0, NULL, NULL },
{ "[8088] Zenith Data Systems SupersPort (Z-184)", "zdsupers", MACHINE_TYPE_8088, MACHINE_CHIPSET_DISCRETE, machine_xt_z184_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_8088, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_PC, MACHINE_VIDEO_FIXED, 128, 640, 128, 0, z184_get_device},
{ "[8088] Zenith Data Systems SupersPort (Z-184)", "zdsupers", MACHINE_TYPE_8088, MACHINE_CHIPSET_DISCRETE, machine_xt_z184_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_8088, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_PC, MACHINE_VIDEO_FIXED, 128, 640, 128, 0, z184_get_device, NULL },
{ "[GC100A] Philips P3120", "p3120", MACHINE_TYPE_8088, MACHINE_CHIPSET_GC100A, machine_xt_p3120_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_8088, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_PC, MACHINE_XTA, 256, 768, 256, 0, NULL, NULL },
/* 8086 Machines */
{ "[8086] Amstrad PC1512", "pc1512", MACHINE_TYPE_8086, MACHINE_CHIPSET_PROPRIETARY, machine_pc1512_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_8086, CPU_BLOCK_NONE, 8000000, 8000000, 0, 0, 0, 0, MACHINE_PC, MACHINE_VIDEO_FIXED | MACHINE_MOUSE, 512, 640, 128, 63, pc1512_get_device},
{ "[8086] Amstrad PC1640", "pc1640", MACHINE_TYPE_8086, MACHINE_CHIPSET_PROPRIETARY, machine_pc1640_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_8086, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_PC, MACHINE_VIDEO | MACHINE_MOUSE, 640, 640, 640, 63, pc1640_get_device},
{ "[8086] Amstrad PC2086", "pc2086", MACHINE_TYPE_8086, MACHINE_CHIPSET_PROPRIETARY, machine_pc2086_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_8086, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_PC, MACHINE_VIDEO_FIXED | MACHINE_MOUSE, 640, 640, 640, 63, pc2086_get_device},
{ "[8086] Amstrad PC3086", "pc3086", MACHINE_TYPE_8086, MACHINE_CHIPSET_PROPRIETARY, machine_pc3086_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_8086, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_PC, MACHINE_VIDEO_FIXED | MACHINE_MOUSE, 640, 640, 640, 63, pc3086_get_device},
{ "[8086] Amstrad PC20(0)", "pc200", MACHINE_TYPE_8086, MACHINE_CHIPSET_PROPRIETARY, machine_pc200_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_8086, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_PC, MACHINE_VIDEO | MACHINE_MOUSE, 512, 640, 128, 63, pc200_get_device},
{ "[8086] Amstrad PPC512/640", "ppc512", MACHINE_TYPE_8086, MACHINE_CHIPSET_PROPRIETARY, machine_ppc512_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_8086, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_PC, MACHINE_VIDEO | MACHINE_MOUSE, 512, 640, 128, 63, ppc512_get_device},
{ "[8086] Amstrad PC1512", "pc1512", MACHINE_TYPE_8086, MACHINE_CHIPSET_PROPRIETARY, machine_pc1512_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_8086, CPU_BLOCK_NONE, 8000000, 8000000, 0, 0, 0, 0, MACHINE_PC, MACHINE_VIDEO_FIXED | MACHINE_MOUSE, 512, 640, 128, 63, pc1512_get_device, NULL },
{ "[8086] Amstrad PC1640", "pc1640", MACHINE_TYPE_8086, MACHINE_CHIPSET_PROPRIETARY, machine_pc1640_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_8086, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_PC, MACHINE_VIDEO | MACHINE_MOUSE, 640, 640, 640, 63, pc1640_get_device, NULL },
{ "[8086] Amstrad PC2086", "pc2086", MACHINE_TYPE_8086, MACHINE_CHIPSET_PROPRIETARY, machine_pc2086_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_8086, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_PC, MACHINE_VIDEO_FIXED | MACHINE_MOUSE, 640, 640, 640, 63, pc2086_get_device, NULL },
{ "[8086] Amstrad PC3086", "pc3086", MACHINE_TYPE_8086, MACHINE_CHIPSET_PROPRIETARY, machine_pc3086_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_8086, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_PC, MACHINE_VIDEO_FIXED | MACHINE_MOUSE, 640, 640, 640, 63, pc3086_get_device, NULL },
{ "[8086] Amstrad PC20(0)", "pc200", MACHINE_TYPE_8086, MACHINE_CHIPSET_PROPRIETARY, machine_pc200_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_8086, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_PC, MACHINE_VIDEO | MACHINE_MOUSE, 512, 640, 128, 63, pc200_get_device, NULL },
{ "[8086] Amstrad PPC512/640", "ppc512", MACHINE_TYPE_8086, MACHINE_CHIPSET_PROPRIETARY, machine_ppc512_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_8086, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_PC, MACHINE_VIDEO | MACHINE_MOUSE, 512, 640, 128, 63, ppc512_get_device, NULL },
{ "[8086] Compaq Deskpro", "deskpro", MACHINE_TYPE_8086, MACHINE_CHIPSET_PROPRIETARY, machine_xt_compaq_deskpro_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_8086, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_PC, MACHINE_FLAGS_NONE, 128, 640, 128, 0, NULL, NULL },
{ "[8086] Olivetti M21/24/24SP", "m24", MACHINE_TYPE_8086, MACHINE_CHIPSET_PROPRIETARY, machine_xt_m24_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_8086, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_PC, MACHINE_VIDEO | MACHINE_MOUSE, 128, 640, 128, 0, m24_get_device},
{ "[8086] Olivetti M21/24/24SP", "m24", MACHINE_TYPE_8086, MACHINE_CHIPSET_PROPRIETARY, machine_xt_m24_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_8086, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_PC, MACHINE_VIDEO | MACHINE_MOUSE, 128, 640, 128, 0, m24_get_device, NULL },
/* Has Olivetti KBC firmware. */
{ "[8086] Olivetti M240", "m240", MACHINE_TYPE_8086, MACHINE_CHIPSET_PROPRIETARY, machine_xt_m240_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_8086, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_PC, MACHINE_FLAGS_NONE, 128, 640, 128, 0, NULL, NULL },
{ "[8086] Schetmash Iskra-3104", "iskra3104", MACHINE_TYPE_8086, MACHINE_CHIPSET_DISCRETE, machine_xt_iskra3104_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_8086, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_PC, MACHINE_FLAGS_NONE, 128, 640, 128, 0, NULL, NULL },
{ "[8086] Tandy 1000 SL/2", "tandy1000sl2", MACHINE_TYPE_8086, MACHINE_CHIPSET_PROPRIETARY, machine_tandy1000sl2_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_8086, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_PC, MACHINE_VIDEO_FIXED, 512, 768, 128, 0, tandy1k_sl_get_device},
{ "[8086] Tandy 1000 SL/2", "tandy1000sl2", MACHINE_TYPE_8086, MACHINE_CHIPSET_PROPRIETARY, machine_tandy1000sl2_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_8086, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_PC, MACHINE_VIDEO_FIXED, 512, 768, 128, 0, tandy1k_sl_get_device, NULL },
{ "[8086] Victor V86P", "v86p", MACHINE_TYPE_8086, MACHINE_CHIPSET_PROPRIETARY, machine_v86p_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_8086, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_PC, MACHINE_VIDEO, 512, 1024, 128, 127, NULL, NULL },
{ "[8086] Toshiba T1200", "t1200", MACHINE_TYPE_8086, MACHINE_CHIPSET_PROPRIETARY, machine_xt_t1200_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_8086, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_PC, MACHINE_VIDEO, 1024, 2048,1024, 63, t1200_get_device},
{ "[8086] Toshiba T1200", "t1200", MACHINE_TYPE_8086, MACHINE_CHIPSET_PROPRIETARY, machine_xt_t1200_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_8086, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_PC, MACHINE_VIDEO, 1024, 2048,1024, 63, t1200_get_device, NULL },
#if defined(DEV_BRANCH) && defined(USE_LASERXT)
{ "[8086] VTech Laser XT3", "lxt3", MACHINE_TYPE_8086, MACHINE_CHIPSET_DISCRETE, machine_xt_lxt3_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_8086, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_PC, MACHINE_FLAGS_NONE, 256, 640, 256, 0, NULL, NULL },
@@ -259,7 +255,7 @@ const machine_t machines[] = {
/* Uses Compaq KBC firmware. */
{ "[ISA] Compaq Portable II", "portableii", MACHINE_TYPE_286, MACHINE_CHIPSET_PROPRIETARY, machine_at_portableii_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_286, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_AT, MACHINE_FLAGS_NONE, 640, 16384, 128, 127, NULL, NULL },
/* Uses Compaq KBC firmware. */
{ "[ISA] Compaq Portable III", "portableiii", MACHINE_TYPE_286, MACHINE_CHIPSET_PROPRIETARY, machine_at_portableiii_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_286, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_AT, MACHINE_VIDEO, 640, 16384, 128, 127, at_cpqiii_get_device },
{ "[ISA] Compaq Portable III", "portableiii", MACHINE_TYPE_286, MACHINE_CHIPSET_PROPRIETARY, machine_at_portableiii_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_286, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_AT, MACHINE_VIDEO, 640, 16384, 128, 127, at_cpqiii_get_device, NULL },
/* Has IBM AT KBC firmware. */
{ "[ISA] MR BIOS 286 clone", "mr286", MACHINE_TYPE_286, MACHINE_CHIPSET_DISCRETE, machine_at_mr286_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_286, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_AT, MACHINE_IDE, 512, 16384, 128, 127, NULL, NULL },
/* Has IBM AT KBC firmware. */
@@ -326,7 +322,7 @@ const machine_t machines[] = {
/* Has an AMI KBC firmware, the only photo of this is too low resolution
for me to read what's on the KBC chip, so I'm going to assume AMI 'F'
based on the other known HT18 AMI BIOS strings. */
{ "[ALi M1217] Flytech 386", "flytech386", MACHINE_TYPE_386SX, MACHINE_CHIPSET_ALI_M1217, machine_at_flytech386_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_386SX, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_PS2, MACHINE_IDE | MACHINE_VIDEO, 1024, 16384, 1024, 127, at_flytech386_get_device },
{ "[ALi M1217] Flytech 386", "flytech386", MACHINE_TYPE_386SX, MACHINE_CHIPSET_ALI_M1217, machine_at_flytech386_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_386SX, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_PS2, MACHINE_IDE | MACHINE_VIDEO, 1024, 16384, 1024, 127, at_flytech386_get_device, NULL },
/* I'm going to assume this has a standard/generic IBM-compatible AT KBC
firmware until the board is identified. */
{ "[ALi M1217] MR BIOS 386SX clone", "mr1217", MACHINE_TYPE_386SX, MACHINE_CHIPSET_ALI_M1217, machine_at_mr1217_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_386SX, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_PS2, MACHINE_IDE | MACHINE_VIDEO, 1024, 16384, 1024, 127, NULL, NULL },
@@ -337,7 +333,7 @@ const machine_t machines[] = {
/* Has an AMI KBC firmware, the only photo of this is too low resolution
for me to read what's on the KBC chip, so I'm going to assume AMI 'F'
based on the other known HT18 AMI BIOS strings. */
{ "[HT18] AMA-932J", "ama932j", MACHINE_TYPE_386SX, MACHINE_CHIPSET_HT18, machine_at_ama932j_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_386SX, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_AT, MACHINE_IDE | MACHINE_VIDEO, 512, 8192, 128, 127, at_ama932j_get_device },
{ "[HT18] AMA-932J", "ama932j", MACHINE_TYPE_386SX, MACHINE_CHIPSET_HT18, machine_at_ama932j_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_386SX, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_AT, MACHINE_IDE | MACHINE_VIDEO, 512, 8192, 128, 127, at_ama932j_get_device, NULL },
/* Has an unknown KBC firmware with commands B8 and BB in the style of
Phoenix MultiKey and AMIKey-3(!), but also commands E1 and EA with
unknown functions. */
@@ -355,13 +351,13 @@ const machine_t machines[] = {
/* Uses Commodore (CBM) KBC firmware, to be implemented as identical to
the IBM PS/2 Type 1 KBC firmware unless evidence emerges of any
proprietary commands. */
{ "[SCAMP] Commodore SL386SX-25", "cmdsl386sx25", MACHINE_TYPE_386SX, MACHINE_CHIPSET_VLSI_SCAMP, machine_at_cmdsl386sx25_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_386SX, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_PS2, MACHINE_IDE | MACHINE_VIDEO, 1024, 8192, 512, 127, at_cmdsl386sx25_get_device },
{ "[SCAMP] Commodore SL386SX-25", "cmdsl386sx25", MACHINE_TYPE_386SX, MACHINE_CHIPSET_VLSI_SCAMP, machine_at_cmdsl386sx25_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_386SX, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_PS2, MACHINE_IDE | MACHINE_VIDEO, 1024, 8192, 512, 127, at_cmdsl386sx25_get_device, NULL },
/* The closest BIOS string I find to this one's, differs only in one part,
and ends in -8, so I'm going to assume that this, too, has an AMI '8'
(AMI Keyboard BIOS Plus) KBC firmware. */
{ "[SCAMP] DataExpert 386SX", "dataexpert386sx", MACHINE_TYPE_386SX, MACHINE_CHIPSET_VLSI_SCAMP, machine_at_dataexpert386sx_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_386SX, CPU_BLOCK_NONE, 10000000, 25000000, 0, 0, 0, 0, MACHINE_AT, MACHINE_FLAGS_NONE, 1024, 16384, 1024, 127, NULL, NULL },
/* Has IBM PS/2 Type 1 KBC firmware. */
{ "[SCAMP] Samsung SPC-6033P", "spc6033p", MACHINE_TYPE_386SX, MACHINE_CHIPSET_VLSI_SCAMP, machine_at_spc6033p_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_386SX, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_PS2, MACHINE_IDE | MACHINE_VIDEO, 2048, 12288, 2048, 127, at_spc6033p_get_device },
{ "[SCAMP] Samsung SPC-6033P", "spc6033p", MACHINE_TYPE_386SX, MACHINE_CHIPSET_VLSI_SCAMP, machine_at_spc6033p_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_386SX, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_PS2, MACHINE_IDE | MACHINE_VIDEO, 2048, 12288, 2048, 127, at_spc6033p_get_device, NULL },
/* Has an unknown AMI KBC firmware, I'm going to assume 'F' until a
photo or real hardware BIOS string is found. */
{ "[SCAT] KMX-C-02", "kmxc02", MACHINE_TYPE_386SX, MACHINE_CHIPSET_SCAT, machine_at_kmxc02_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_386SX, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_AT, MACHINE_FLAGS_NONE, 512, 16384, 512, 127, NULL, NULL },
@@ -384,8 +380,10 @@ const machine_t machines[] = {
/* Has IBM AT KBC firmware. */
{ "[C&T 386] Samsung SPC-6000A", "spc6000a", MACHINE_TYPE_386DX, MACHINE_CHIPSET_CT_386, machine_at_spc6000a_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_386DX, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_AT, MACHINE_IDE, 1024, 32768, 1024, 127, NULL, NULL },
/* Uses Compaq KBC firmware. */
#if defined(DEV_BRANCH) && defined(USE_DESKPRO386)
{ "[ISA] Compaq Deskpro 386", "deskpro386", MACHINE_TYPE_386DX, MACHINE_CHIPSET_DISCRETE, machine_at_deskpro386_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_386DX, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_AT, MACHINE_IDE, 1024, 14336, 1024, 127, NULL, NULL },
{ "[ISA] Compaq Portable III (386)", "portableiii386", MACHINE_TYPE_386DX, MACHINE_CHIPSET_DISCRETE, machine_at_portableiii386_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_386DX, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_AT, MACHINE_IDE | MACHINE_VIDEO, 1024, 14336, 1024, 127, at_cpqiii_get_device },
#endif
{ "[ISA] Compaq Portable III (386)", "portableiii386", MACHINE_TYPE_386DX, MACHINE_CHIPSET_DISCRETE, machine_at_portableiii386_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_386DX, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_AT, MACHINE_IDE | MACHINE_VIDEO, 1024, 14336, 1024, 127, at_cpqiii_get_device, NULL },
/* Has IBM AT KBC firmware. */
{ "[ISA] Micronics 09-00021", "micronics386", MACHINE_TYPE_386DX, MACHINE_CHIPSET_DISCRETE, machine_at_micronics386_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_386DX, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_AT, MACHINE_FLAGS_NONE, 512, 8192, 128, 127, NULL, NULL },
/* Has AMIKey F KBC firmware. */
@@ -439,9 +437,9 @@ const machine_t machines[] = {
/* According to Deksor on the Win3x.org forum, the BIOS string ends in a -0,
indicating an unknown KBC firmware. But it does send the AMIKey get version
command, so it must expect an AMIKey. */
{ "[VLSI 82C480] HP Vectra 486VL", "vect486vl", MACHINE_TYPE_486, MACHINE_CHIPSET_VLSI_VL82C480, machine_at_vect486vl_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SOCKET1, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_PS2, MACHINE_IDE | MACHINE_VIDEO, 2048, 32768, 2048, 127, at_vect486vl_get_device },
{ "[VLSI 82C480] HP Vectra 486VL", "vect486vl", MACHINE_TYPE_486, MACHINE_CHIPSET_VLSI_VL82C480, machine_at_vect486vl_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SOCKET1, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_PS2, MACHINE_IDE | MACHINE_VIDEO, 2048, 32768, 2048, 127, at_vect486vl_get_device, NULL },
/* Has a standard IBM PS/2 KBC firmware or a clone thereof. */
{ "[VLSI 82C481] Siemens Nixdorf D824", "d824", MACHINE_TYPE_486, MACHINE_CHIPSET_VLSI_VL82C481, machine_at_d824_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SOCKET1, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_PS2, MACHINE_IDE | MACHINE_VIDEO, 2048, 32768, 2048, 127, at_d824_get_device },
{ "[VLSI 82C481] Siemens Nixdorf D824", "d824", MACHINE_TYPE_486, MACHINE_CHIPSET_VLSI_VL82C481, machine_at_d824_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SOCKET1, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_PS2, MACHINE_IDE | MACHINE_VIDEO, 2048, 32768, 2048, 127, at_d824_get_device, NULL },
/* 486 machines - Socket 2 */
/* 486 machines with just the ISA slot */
@@ -449,7 +447,7 @@ const machine_t machines[] = {
command C7 (OR input byte with received data byte). */
{ "[ACC 2168] Packard Bell PB410A", "pb410a", MACHINE_TYPE_486_S2, MACHINE_CHIPSET_ACC_2168, machine_at_pb410a_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SOCKET3, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_PS2, MACHINE_IDE | MACHINE_VIDEO, 4096, 36864, 1024, 127, NULL, NULL },
/* Uses an ACER/NEC 90M002A (UPD82C42C, 8042 clone) with unknown firmware (V4.01H). */
{ "[ALi M1429G] Acer A1G", "acera1g", MACHINE_TYPE_486_S2, MACHINE_CHIPSET_ALI_M1429G, machine_at_acera1g_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SOCKET3, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_PS2, MACHINE_IDE_DUAL | MACHINE_VIDEO, 4096, 36864, 1024, 127, at_acera1g_get_device },
{ "[ALi M1429G] Acer A1G", "acera1g", MACHINE_TYPE_486_S2, MACHINE_CHIPSET_ALI_M1429G, machine_at_acera1g_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SOCKET3, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_PS2, MACHINE_IDE_DUAL | MACHINE_VIDEO, 4096, 36864, 1024, 127, at_acera1g_get_device, NULL },
/* This has an AMIKey-2, which is an updated version of type 'H'. */
{ "[ALi M1429G] Kaimei SA-486 VL-BUS M.B.", "win486", MACHINE_TYPE_486_S2, MACHINE_CHIPSET_ALI_M1429G, machine_at_winbios1429_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SOCKET3, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_VLB, MACHINE_IDE, 1024, 32768, 1024, 127, NULL, NULL },
/* Uses an Intel KBC with Phoenix MultiKey KBC firmware. */
@@ -485,7 +483,7 @@ const machine_t machines[] = {
/* 486 machines which utilize the PCI bus */
/* This has an AMIKey-2, which is an updated version of type 'H'. */
{ "[ALi M1489] AAEON SBC-490", "sbc490", MACHINE_TYPE_486_S3, MACHINE_CHIPSET_ALI_M1489, machine_at_sbc490_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SOCKET3, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_PS2_PCI, MACHINE_IDE_DUAL | MACHINE_VIDEO, 1024, 65536, 1024, 255, at_sbc490_get_device },
{ "[ALi M1489] AAEON SBC-490", "sbc490", MACHINE_TYPE_486_S3, MACHINE_CHIPSET_ALI_M1489, machine_at_sbc490_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SOCKET3, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_PS2_PCI, MACHINE_IDE_DUAL | MACHINE_VIDEO, 1024, 65536, 1024, 255, at_sbc490_get_device, NULL },
/* Has the ALi M1487/9's on-chip keyboard controller which clones a standard AT
KBC. */
{ "[ALi M1489] ABIT AB-PB4", "abpb4", MACHINE_TYPE_486_S3, MACHINE_CHIPSET_ALI_M1489, machine_at_abpb4_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SOCKET3, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_PCI, MACHINE_IDE_DUAL, 1024, 65536, 1024, 255, NULL, NULL },
@@ -595,7 +593,7 @@ const machine_t machines[] = {
/* Has AMI MegaKey KBC firmware. */
{ "[i430LX] Micro Star 586MC1", "586mc1", MACHINE_TYPE_SOCKET4, MACHINE_CHIPSET_INTEL_430LX, machine_at_586mc1_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SOCKET4, CPU_BLOCK_NONE, 60000000, 66666667, 5000, 5000, MACHINE_MULTIPLIER_FIXED, MACHINE_PS2_PCI, MACHINE_IDE_DUAL, 2048, 131072, 2048, 127, NULL, NULL },
/* This has the Phoenix MultiKey KBC firmware. */
{ "[i430LX] Packard Bell PB520R", "pb520r", MACHINE_TYPE_SOCKET4, MACHINE_CHIPSET_INTEL_430LX, machine_at_pb520r_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SOCKET4, CPU_BLOCK_NONE, 60000000, 66666667, 5000, 5000, MACHINE_MULTIPLIER_FIXED, MACHINE_PS2_PCI, MACHINE_IDE_DUAL | MACHINE_VIDEO, 8192, 139264, 2048, 127, at_pb520r_get_device },
{ "[i430LX] Packard Bell PB520R", "pb520r", MACHINE_TYPE_SOCKET4, MACHINE_CHIPSET_INTEL_430LX, machine_at_pb520r_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SOCKET4, CPU_BLOCK_NONE, 60000000, 66666667, 5000, 5000, MACHINE_MULTIPLIER_FIXED, MACHINE_PS2_PCI, MACHINE_IDE_DUAL | MACHINE_VIDEO, 8192, 139264, 2048, 127, at_pb520r_get_device, NULL },
/* OPTi 596/597 */
/* This uses an AMI KBC firmware in PS/2 mode (it sends command A5 with the
@@ -668,24 +666,24 @@ const machine_t machines[] = {
{ "[i430FX] Gateway 2000 Thor", "gw2katx", MACHINE_TYPE_SOCKET7_3V, MACHINE_CHIPSET_INTEL_430FX, machine_at_gw2katx_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SOCKET5_7, CPU_BLOCK_NONE, 50000000, 66666667, 3380, 3520, 1.5, 3.0, MACHINE_PS2_PCI, MACHINE_IDE_DUAL, 8192, 131072, 8192, 127, NULL, NULL },
/* The BIOS does not send a single non-standard KBC command, but the board has a SMC Super I/O
chip with on-chip KBC and AMI MegaKey KBC firmware. */
{ "[i430FX] HP Vectra VL 5 Series 4", "vectra54", MACHINE_TYPE_SOCKET7_3V, MACHINE_CHIPSET_INTEL_430FX, machine_at_vectra54_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SOCKET5_7, CPU_BLOCK_NONE, 50000000, 66666667, 3380, 3520, 1.5, 2.0, MACHINE_PS2_PCI, MACHINE_IDE_DUAL | MACHINE_VIDEO, 8192, 131072, 8192, 511, at_vectra54_get_device },
{ "[i430FX] HP Vectra VL 5 Series 4", "vectra54", MACHINE_TYPE_SOCKET7_3V, MACHINE_CHIPSET_INTEL_430FX, machine_at_vectra54_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SOCKET5_7, CPU_BLOCK_NONE, 50000000, 66666667, 3380, 3520, 1.5, 2.0, MACHINE_PS2_PCI, MACHINE_IDE_DUAL | MACHINE_VIDEO, 8192, 131072, 8192, 511, at_vectra54_get_device, NULL },
/* According to tests from real hardware: This has AMI MegaKey KBC firmware on the
PC87306 Super I/O chip, command 0xA1 returns '5'.
Command 0xA0 copyright string: (C)1994 AMI . */
{ "[i430FX] Intel Advanced/ATX", "thor", MACHINE_TYPE_SOCKET7_3V, MACHINE_CHIPSET_INTEL_430FX, machine_at_thor_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SOCKET5_7, CPU_BLOCK_NONE, 50000000, 66666667, 3380, 3520, 1.5, 3.0, MACHINE_PS2_PCI, MACHINE_IDE_DUAL | MACHINE_VIDEO, 8192, 131072, 8192, 127, at_thor_get_device },
{ "[i430FX] Intel Advanced/ATX", "thor", MACHINE_TYPE_SOCKET7_3V, MACHINE_CHIPSET_INTEL_430FX, machine_at_thor_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SOCKET5_7, CPU_BLOCK_NONE, 50000000, 66666667, 3380, 3520, 1.5, 3.0, MACHINE_PS2_PCI, MACHINE_IDE_DUAL | MACHINE_VIDEO, 8192, 131072, 8192, 127, at_thor_get_device, NULL },
/* According to tests from real hardware: This has AMI MegaKey KBC firmware on the
PC87306 Super I/O chip, command 0xA1 returns '5'.
Command 0xA0 copyright string: (C)1994 AMI . */
{ "[i430FX] Intel Advanced/ATX (MR BIOS)", "mrthor", MACHINE_TYPE_SOCKET7_3V, MACHINE_CHIPSET_INTEL_430FX, machine_at_mrthor_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SOCKET5_7, CPU_BLOCK_NONE, 50000000, 66666667, 3380, 3520, 1.5, 3.0, MACHINE_PS2_PCI, MACHINE_IDE_DUAL, 8192, 131072, 8192, 127, at_mrthor_get_device },
{ "[i430FX] Intel Advanced/ATX (MR BIOS)", "mrthor", MACHINE_TYPE_SOCKET7_3V, MACHINE_CHIPSET_INTEL_430FX, machine_at_mrthor_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SOCKET5_7, CPU_BLOCK_NONE, 50000000, 66666667, 3380, 3520, 1.5, 3.0, MACHINE_PS2_PCI, MACHINE_IDE_DUAL, 8192, 131072, 8192, 127, at_mrthor_get_device, NULL },
/* According to tests from real hardware: This has AMI MegaKey KBC firmware on the
PC87306 Super I/O chip, command 0xA1 returns '5'.
Command 0xA0 copyright string: (C)1994 AMI . */
{ "[i430FX] Intel Advanced/EV", "endeavor", MACHINE_TYPE_SOCKET7_3V, MACHINE_CHIPSET_INTEL_430FX, machine_at_endeavor_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SOCKET5_7, CPU_BLOCK_NONE, 50000000, 66666667, 3380, 3520, 1.5, 3.0, MACHINE_PS2_PCI, MACHINE_IDE_DUAL | MACHINE_VIDEO, 8192, 131072, 8192, 127, at_endeavor_get_device },
{ "[i430FX] Intel Advanced/EV", "endeavor", MACHINE_TYPE_SOCKET7_3V, MACHINE_CHIPSET_INTEL_430FX, machine_at_endeavor_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SOCKET5_7, CPU_BLOCK_NONE, 50000000, 66666667, 3380, 3520, 1.5, 3.0, MACHINE_PS2_PCI, MACHINE_IDE_DUAL | MACHINE_VIDEO, 8192, 131072, 8192, 127, at_endeavor_get_device, NULL },
/* This has an AMIKey-2, which is an updated version of type 'H'. */
{ "[i430FX] MSI MS-5119", "ms5119", MACHINE_TYPE_SOCKET7_3V, MACHINE_CHIPSET_INTEL_430FX, machine_at_ms5119_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SOCKET5_7, CPU_BLOCK_NONE, 50000000, 66666667, 2500, 3520, 1.5, 3.0, MACHINE_PS2_PCI, MACHINE_IDE_DUAL, 8192, 131072, 8192, 127, NULL, NULL },
/* This most likely uses AMI MegaKey KBC firmware as well due to having the same
Super I/O chip (that has the KBC firmware on it) as eg. the Advanced/EV. */
{ "[i430FX] Packard Bell PB640", "pb640", MACHINE_TYPE_SOCKET7_3V, MACHINE_CHIPSET_INTEL_430FX, machine_at_pb640_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SOCKET5_7, CPU_BLOCK_NONE, 50000000, 66666667, 3380, 3520, 1.5, 3.0, MACHINE_PS2_PCI, MACHINE_IDE_DUAL | MACHINE_VIDEO, 8192, 131072, 8192, 127, at_pb640_get_device },
{ "[i430FX] Packard Bell PB640", "pb640", MACHINE_TYPE_SOCKET7_3V, MACHINE_CHIPSET_INTEL_430FX, machine_at_pb640_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SOCKET5_7, CPU_BLOCK_NONE, 50000000, 66666667, 3380, 3520, 1.5, 3.0, MACHINE_PS2_PCI, MACHINE_IDE_DUAL | MACHINE_VIDEO, 8192, 131072, 8192, 127, at_pb640_get_device, NULL },
/* Has an AMI 'H' KBC firmware (1992). */
{ "[i430FX] QDI FMB", "fmb", MACHINE_TYPE_SOCKET7_3V, MACHINE_CHIPSET_INTEL_430FX, machine_at_fmb_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SOCKET5_7, CPU_BLOCK_QDI_FMB, 50000000, 66666667, 3380, 3520, 1.5, 3.0, MACHINE_PS2_PCI, MACHINE_IDE_DUAL, 8192, 131072, 8192, 127, NULL, NULL },
@@ -750,9 +748,9 @@ const machine_t machines[] = {
{ "[i430VX] Biostar MB-8500TVX-A", "8500tvxa", MACHINE_TYPE_SOCKET7, MACHINE_CHIPSET_INTEL_430VX, machine_at_8500tvxa_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SOCKET5_7, CPU_BLOCK_NONE, 50000000, 66666667, 2600, 3520, 1.5, 3.0, MACHINE_PS2_PCI, MACHINE_IDE_DUAL, 8192, 131072, 8192, 127, NULL, NULL },
/* The BIOS does not send a single non-standard KBC command, but the board has a SMC Super I/O
chip with on-chip KBC and AMI MegaKey KBC firmware. */
{ "[i430VX] Compaq Presario 2240", "presario2240", MACHINE_TYPE_SOCKET7, MACHINE_CHIPSET_INTEL_430VX, machine_at_presario2240_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SOCKET5_7, CPU_BLOCK_NONE, 50000000, 66666667, 2800, 3520, 1.5, 3.0, MACHINE_PS2_PCI, MACHINE_IDE_DUAL | MACHINE_VIDEO, 8192, 131072, 8192, 127, at_presario2240_get_device },
{ "[i430VX] Compaq Presario 2240", "presario2240", MACHINE_TYPE_SOCKET7, MACHINE_CHIPSET_INTEL_430VX, machine_at_presario2240_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SOCKET5_7, CPU_BLOCK_NONE, 50000000, 66666667, 2800, 3520, 1.5, 3.0, MACHINE_PS2_PCI, MACHINE_IDE_DUAL | MACHINE_VIDEO, 8192, 131072, 8192, 127, at_presario2240_get_device, NULL },
/* This most likely has AMI MegaKey as above. */
{ "[i430VX] Compaq Presario 4500", "presario4500", MACHINE_TYPE_SOCKET7, MACHINE_CHIPSET_INTEL_430VX, machine_at_presario4500_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SOCKET5_7, CPU_BLOCK_NONE, 50000000, 66666667, 2800, 3520, 1.5, 3.0, MACHINE_PS2_PCI, MACHINE_IDE_DUAL | MACHINE_VIDEO, 8192, 131072, 8192, 127, at_presario4500_get_device },
{ "[i430VX] Compaq Presario 4500", "presario4500", MACHINE_TYPE_SOCKET7, MACHINE_CHIPSET_INTEL_430VX, machine_at_presario4500_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SOCKET5_7, CPU_BLOCK_NONE, 50000000, 66666667, 2800, 3520, 1.5, 3.0, MACHINE_PS2_PCI, MACHINE_IDE_DUAL | MACHINE_VIDEO, 8192, 131072, 8192, 127, at_presario4500_get_device, NULL },
/* The BIOS sends KBC command CB which is an AMI KBC command, so it has an AMI KBC firmware. */
{ "[i430VX] Epox P55-VA", "p55va", MACHINE_TYPE_SOCKET7, MACHINE_CHIPSET_INTEL_430VX, machine_at_p55va_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SOCKET5_7, CPU_BLOCK_NONE, 50000000, 66666667, 2500, 3520, 1.5, 3.0, MACHINE_PS2_PCI, MACHINE_IDE_DUAL, 8192, 131072, 8192, 127, NULL, NULL },
/* The BIOS does not send a single non-standard KBC command. */
@@ -773,7 +771,7 @@ const machine_t machines[] = {
{ "[i430TX] ADLink NuPRO-592", "nupro592", MACHINE_TYPE_SOCKET7, MACHINE_CHIPSET_INTEL_430TX, machine_at_nupro592_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SOCKET5_7, CPU_BLOCK_NONE, 66666667, 66666667, 1900, 2800, 1.5, 5.5, MACHINE_PS2_PCI, MACHINE_IDE_DUAL, 8192, 262144, 8192, 255, NULL, NULL },
/* This has the AMIKey KBC firmware, which is an updated 'F' type (YM430TX is based on the TX97). */
{ "[i430TX] ASUS TX97", "tx97", MACHINE_TYPE_SOCKET7, MACHINE_CHIPSET_INTEL_430TX, machine_at_tx97_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SOCKET5_7, CPU_BLOCK_NONE, 50000000, 75000000, 2500, 3520, 1.5, 3.0, MACHINE_PS2_PCI, MACHINE_IDE_DUAL, 8192, 262144, 8192, 255, NULL, NULL },
#if defined(DEV_BRANCH) && defined(NO_SIO)
#if defined(DEV_BRANCH) && defined(USE_AN430TX)
/* This has the Phoenix MultiKey KBC firmware. */
{ "[i430TX] Intel AN430TX", "an430tx", MACHINE_TYPE_SOCKET7, MACHINE_CHIPSET_INTEL_430TX, machine_at_an430tx_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SOCKET5_7, CPU_BLOCK_NONE, 60000000, 66666667, 2800, 3520, 1.5, 3.0, MACHINE_PS2_PCI, MACHINE_IDE_DUAL, 8192, 262144, 8192, 255, NULL, NULL },
#endif
@@ -907,7 +905,7 @@ const machine_t machines[] = {
{ "[i440BX] HP Vectra VEi 8", "vei8", MACHINE_TYPE_SLOT1, MACHINE_CHIPSET_INTEL_440BX, machine_at_vei8_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SLOT1, CPU_BLOCK_NONE, 66666667, 100000000, 1800, 3500, 1.5, 8.0, MACHINE_PS2_AGP, MACHINE_IDE_DUAL, 8192,1048576, 8192, 255, NULL, NULL },
/* Has a National Semiconductors PC87309 Super I/O chip with on-chip KBC
with most likely AMIKey-2 KBC firmware. */
{ "[i440BX] Tyan Tsunami ATX", "s1846", MACHINE_TYPE_SLOT1, MACHINE_CHIPSET_INTEL_440BX, machine_at_s1846_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SLOT1, CPU_BLOCK_NONE, 66666667, 112121212, 1800, 3500, 1.5, 8.0, MACHINE_PS2_AGP, MACHINE_IDE_DUAL | MACHINE_SOUND, 8192,1048576, 8192, 255, at_s1846_get_device },
{ "[i440BX] Tyan Tsunami ATX", "s1846", MACHINE_TYPE_SLOT1, MACHINE_CHIPSET_INTEL_440BX, machine_at_s1846_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SLOT1, CPU_BLOCK_NONE, 66666667, 112121212, 1800, 3500, 1.5, 8.0, MACHINE_PS2_AGP, MACHINE_IDE_DUAL | MACHINE_SOUND, 8192,1048576, 8192, 255, at_s1846_get_device, NULL },
/* Has a Winbond W83977TF Super I/O chip with on-chip KBC with AMIKey-2 KBC
firmware. */
{ "[i440BX] Supermicro P6SBA", "p6sba", MACHINE_TYPE_SLOT1, MACHINE_CHIPSET_INTEL_440BX, machine_at_p6sba_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SLOT1, CPU_BLOCK_NONE, 66666667, 100000000, 1800, 3500, 1.5, 8.0, MACHINE_PS2_AGP, MACHINE_IDE_DUAL, 8192, 786432, 8192, 255, NULL, NULL },
@@ -915,10 +913,10 @@ const machine_t machines[] = {
/* 440ZX */
/* Has a Winbond W83977EF Super I/O chip with on-chip KBC with AMIKey-2 KBC
firmware. */
{ "[i440ZX] MSI MS-6168", "ms6168", MACHINE_TYPE_SLOT1, MACHINE_CHIPSET_INTEL_440ZX, machine_at_ms6168_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SLOT1, CPU_BLOCK_NONE, 66666667, 100000000, 1800, 3500, 1.5, 8.0, MACHINE_PS2_AGP, MACHINE_IDE_DUAL | MACHINE_AV, 8192, 524288, 8192, 255, at_ms6168_get_device },
{ "[i440ZX] MSI MS-6168", "ms6168", MACHINE_TYPE_SLOT1, MACHINE_CHIPSET_INTEL_440ZX, machine_at_ms6168_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SLOT1, CPU_BLOCK_NONE, 66666667, 100000000, 1800, 3500, 1.5, 8.0, MACHINE_PS2_AGP, MACHINE_IDE_DUAL | MACHINE_AV, 8192, 524288, 8192, 255, at_ms6168_get_device, NULL },
/* Has a Winbond W83977EF Super I/O chip with on-chip KBC with AMIKey-2 KBC
firmware. */
{ "[i440ZX] Packard Bell Bora Pro", "borapro", MACHINE_TYPE_SLOT1, MACHINE_CHIPSET_INTEL_440ZX, machine_at_borapro_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SLOT1, CPU_BLOCK_NONE, 66666667, 66666667, 1800, 3500, 1.5, 8.0, MACHINE_PS2_AGP, MACHINE_IDE_DUAL | MACHINE_AV, 8192, 524288, 8192, 255, at_borapro_get_device },
{ "[i440ZX] Packard Bell Bora Pro", "borapro", MACHINE_TYPE_SLOT1, MACHINE_CHIPSET_INTEL_440ZX, machine_at_borapro_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SLOT1, CPU_BLOCK_NONE, 66666667, 66666667, 1800, 3500, 1.5, 8.0, MACHINE_PS2_AGP, MACHINE_IDE_DUAL | MACHINE_AV, 8192, 524288, 8192, 255, at_borapro_get_device, NULL },
/* SMSC VictoryBX-66 */
/* Has a Winbond W83977EF Super I/O chip with on-chip KBC with AMIKey-2 KBC
@@ -946,7 +944,7 @@ const machine_t machines[] = {
/* 440BX */
/* Has a Winbond W83977EF Super I/O chip with on-chip KBC with AMIKey-2 KBC
firmware. */
{ "[i440BX] Tyan Trinity 371", "s1857", MACHINE_TYPE_SLOT1_370, MACHINE_CHIPSET_INTEL_440BX, machine_at_s1857_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SLOT1 | CPU_PKG_SOCKET370, CPU_BLOCK_NONE, 66666667, 133333333, 1300, 3500, 1.5, 8.0, MACHINE_PS2_AGP, MACHINE_IDE_DUAL, 8192, 786432, 8192, 255, at_s1857_get_device },
{ "[i440BX] Tyan Trinity 371", "s1857", MACHINE_TYPE_SLOT1_370, MACHINE_CHIPSET_INTEL_440BX, machine_at_s1857_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SLOT1 | CPU_PKG_SOCKET370, CPU_BLOCK_NONE, 66666667, 133333333, 1300, 3500, 1.5, 8.0, MACHINE_PS2_AGP, MACHINE_IDE_DUAL, 8192, 786432, 8192, 255, at_s1857_get_device, NULL },
/* Slot 2 machines */
/* 440GX */
@@ -996,17 +994,17 @@ const machine_t machines[] = {
{ "[VIA Apollo Pro 133A] Acorp 6VIA90AP", "6via90ap", MACHINE_TYPE_SOCKET370, MACHINE_CHIPSET_VIA_APOLLO_PRO_133A, machine_at_6via90ap_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SOCKET370, CPU_BLOCK_NONE, 66666667, 150000000, 1300, 3500, MACHINE_MULTIPLIER_FIXED, MACHINE_PS2_A97, MACHINE_IDE_DUAL | MACHINE_AG, 16384, 3145728, 8192, 255, NULL, NULL },
/* Has the VIA VT82C686B southbridge with on-chip KBC identical to the VIA
VT82C42N. */
{ "[VIA Apollo Pro 133A] ASUS CUV4X-LS", "cuv4xls", MACHINE_TYPE_SOCKET370, MACHINE_CHIPSET_VIA_APOLLO_PRO_133A, machine_at_cuv4xls_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SOCKET370, CPU_BLOCK_NONE, 66666667, 150000000, 1300, 3500, 1.5, 8.0, MACHINE_PS2_NOI97, MACHINE_IDE_DUAL | MACHINE_SOUND, 16384, 4194304, 8192, 255, at_cuv4xls_get_device },
{ "[VIA Apollo Pro 133A] ASUS CUV4X-LS", "cuv4xls", MACHINE_TYPE_SOCKET370, MACHINE_CHIPSET_VIA_APOLLO_PRO_133A, machine_at_cuv4xls_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SOCKET370, CPU_BLOCK_NONE, 66666667, 150000000, 1300, 3500, 1.5, 8.0, MACHINE_PS2_NOI97, MACHINE_IDE_DUAL | MACHINE_SOUND, 16384, 4194304, 8192, 255, at_cuv4xls_get_device, NULL },
/* Has a Winbond W83977EF Super I/O chip with on-chip KBC with AMIKey-2 KBC
firmware. */
{ "[VIA Apollo Pro 133A] BCM GT694VA", "gt694va", MACHINE_TYPE_SOCKET370, MACHINE_CHIPSET_VIA_APOLLO_PRO_133A, machine_at_gt694va_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SOCKET370, CPU_BLOCK_NONE, 66666667, 133333333, 1300, 3500, 1.5, 8.0, MACHINE_PS2_AGP, MACHINE_IDE_DUAL | MACHINE_SOUND, 16384, 3145728, 8192, 255, at_gt694va_get_device },
{ "[VIA Apollo Pro 133A] BCM GT694VA", "gt694va", MACHINE_TYPE_SOCKET370, MACHINE_CHIPSET_VIA_APOLLO_PRO_133A, machine_at_gt694va_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SOCKET370, CPU_BLOCK_NONE, 66666667, 133333333, 1300, 3500, 1.5, 8.0, MACHINE_PS2_AGP, MACHINE_IDE_DUAL | MACHINE_SOUND, 16384, 3145728, 8192, 255, at_gt694va_get_device, NULL },
/* Miscellaneous/Fake/Hypervisor machines */
/* Has a Winbond W83977F Super I/O chip with on-chip KBC with AMIKey-2 KBC
firmware. */
{ "[i440BX] Microsoft Virtual PC 2007", "vpc2007", MACHINE_TYPE_MISC, MACHINE_CHIPSET_INTEL_440BX, machine_at_vpc2007_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SLOT1, CPU_BLOCK(CPU_PENTIUM2, CPU_CYRIX3S), 0, 66666667, 0, 0, 0, 0, MACHINE_PS2_PCI, MACHINE_IDE_DUAL, 8192, 1048576, 8192, 255, NULL, NULL },
{ NULL, NULL, MACHINE_TYPE_NONE, MACHINE_CHIPSET_NONE, NULL, 0, 0, MACHINE_AVAILABLE, 0 , 0, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_BUS_NONE, MACHINE_FLAGS_NONE, 0, 0, 0, 0, NULL }
{ NULL, NULL, MACHINE_TYPE_NONE, MACHINE_CHIPSET_NONE, NULL, 0, 0, MACHINE_AVAILABLE, 0 , 0, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_BUS_NONE, MACHINE_FLAGS_NONE, 0, 0, 0, 0, NULL, NULL }
};
int

View File

@@ -2210,8 +2210,6 @@ void
mem_invalidate_range(uint32_t start_addr, uint32_t end_addr)
{
#ifdef USE_NEW_DYNAREC
int byte_offset;
uint64_t byte_mask;
page_t *p;
start_addr &= ~PAGE_MASK_MASK;

View File

@@ -93,12 +93,12 @@ FILE *
rom_fopen(char *fn, char *mode)
{
char temp[1024];
rom_path_t *rom_path = &rom_paths;
FILE *fp;
rom_path_t *rom_path;
FILE *fp = NULL;
if (strstr(fn, "roms/") == fn) {
/* Relative path */
for(rom_path_t *rom_path = &rom_paths; rom_path != NULL; rom_path = rom_path->next) {
for (rom_path = &rom_paths; rom_path != NULL; rom_path = rom_path->next) {
plat_append_filename(temp, rom_path->path, fn + 5);
if ((fp = plat_fopen(temp, mode)) != NULL) {
@@ -118,11 +118,11 @@ int
rom_getfile(char *fn, char *s, int size)
{
char temp[1024];
rom_path_t *rom_path = &rom_paths;
rom_path_t *rom_path;
if (strstr(fn, "roms/") == fn) {
/* Relative path */
for(rom_path_t *rom_path = &rom_paths; rom_path != NULL; rom_path = rom_path->next) {
for (rom_path = &rom_paths; rom_path != NULL; rom_path = rom_path->next) {
plat_append_filename(temp, rom_path->path, fn + 5);
if (rom_present(temp)) {
@@ -138,7 +138,7 @@ rom_getfile(char *fn, char *s, int size)
strncpy(s, fn, size);
return 1;
}
return 0;
}
}

View File

@@ -405,7 +405,7 @@ void
spd_write_drbs_with_ext(uint8_t *regs, uint8_t reg_min, uint8_t reg_max, uint8_t drb_unit)
{
uint8_t row, dimm, drb;
uint16_t size, row_val, rows[SPD_MAX_SLOTS];
uint16_t size, row_val = 0, rows[SPD_MAX_SLOTS];
int shift;
/* No SPD: split SIMMs into pairs as if they were "DIMM"s. */

View File

@@ -88,6 +88,8 @@
#ifdef _WIN32
# define PATH_FREETYPE_DLL "freetype.dll"
#elif defined __APPLE__
# define PATH_FREETYPE_DLL "libfreetype.dylib"
#else
# define PATH_FREETYPE_DLL "libfreetype.so.6"
#endif

View File

@@ -244,7 +244,7 @@ if (APPLE AND CMAKE_MACOSX_BUNDLE)
install_qt5_plugin("Qt${QT_MAJOR}::QMacStylePlugin" QT_PLUGINS ${prefix})
install_qt5_plugin("Qt${QT_MAJOR}::QICOPlugin" QT_PLUGINS ${prefix})
install_qt5_plugin("Qt${QT_MAJOR}::QICNSPlugin" QT_PLUGINS ${prefix})
file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/qt.conf"
"[Paths]\nPlugins = PlugIns\n")
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/qt.conf"

View File

@@ -1 +0,0 @@
* Joystick support

View File

@@ -56,7 +56,7 @@ void evdev_thread_func()
{
while (!stopped)
{
for (int i = 0; i < evdev_mice.size(); i++)
for (unsigned int i = 0; i < evdev_mice.size(); i++)
{
struct input_event ev;
int rc = libevdev_next_event(evdev_mice[i].second, LIBEVDEV_READ_FLAG_NORMAL, &ev);
@@ -67,7 +67,7 @@ void evdev_thread_func()
}
}
}
for (int i = 0; i < evdev_mice.size(); i++)
for (unsigned int i = 0; i < evdev_mice.size(); i++)
{
libevdev_free(evdev_mice[i].second);
close(evdev_mice[i].first);

View File

@@ -117,7 +117,7 @@ void DeviceConfig::ConfigureDevice(const _device_* device, int instance, Setting
cbox->setObjectName(config->name);
auto* model = cbox->model();
int currentIndex = -1;
int selected;
int selected = 0;
switch (config->type) {
case CONFIG_SELECTION:
selected = config_get_int(device_context.name, const_cast<char*>(config->name), config->default_int);

View File

@@ -564,7 +564,7 @@ void HarddiskDialog::onExistingFileSelected(const QString &fileName) {
else if (((size % 3072) == 0) && (size <= 53477376))
heads = 6;
else {
int i;
uint32_t i;
for (i = 5; i < 16; i++) {
if (((size % (i << 9)) == 0) && (size <= ((i * 17) << 19)))
break;

View File

@@ -625,6 +625,7 @@ void MainWindow::on_actionSettings_triggered() {
plat_pause(currentPause);
}
#if defined(__unix__) && !defined(__HAIKU__)
std::array<uint32_t, 256> x11_to_xt_base
{
0,
@@ -952,7 +953,9 @@ std::array<uint32_t, 256> x11_to_xt_vnc
0x14B,
0x14D,
};
#endif
#ifdef Q_OS_MACOS
std::array<uint32_t, 256> darwin_to_xt
{
0x1E,
@@ -1084,7 +1087,9 @@ std::array<uint32_t, 256> darwin_to_xt
0x148,
0,
};
#endif
#if defined(__unix__) && !defined(__HAIKU__)
static std::unordered_map<uint32_t, uint16_t> evdev_to_xt =
{
{96, 0x11C},
@@ -1104,6 +1109,7 @@ static std::unordered_map<uint32_t, uint16_t> evdev_to_xt =
{110, 0x152},
{111, 0x153}
};
#endif
#ifdef __HAIKU__
static std::unordered_map<uint8_t, uint16_t> be_to_xt =
@@ -1216,7 +1222,9 @@ static std::unordered_map<uint8_t, uint16_t> be_to_xt =
};
#endif
#if defined(__unix__) && !defined(__HAIKU__)
static std::array<uint32_t, 256>& selected_keycode = x11_to_xt_base;
#endif
uint16_t x11_keycode_to_keysym(uint32_t keycode)
{

View File

@@ -188,7 +188,7 @@ void MediaMenu::cassetteMount(const QString& filename, bool wp) {
if (! filename.isEmpty()) {
QByteArray filenameBytes = filename.toUtf8();
strncpy(cassette_fname, filenameBytes.data(), sizeof(cassette_fname));
strncpy(cassette_fname, filenameBytes.data(), sizeof(cassette_fname) - 1);
pc_cas_set_fname(cassette, cassette_fname);
}

View File

@@ -446,11 +446,6 @@ bool NewFloppyDialog::createZipSectorImage(const QString &filename, const disk_s
uint32_t total_size = 0;
uint32_t total_sectors = 0;
uint32_t sector_bytes = 0;
uint32_t root_dir_bytes = 0;
uint32_t fat_size = 0;
uint32_t fat1_offs = 0;
uint32_t fat2_offs = 0;
uint32_t zero_bytes = 0;
uint16_t base = 0x1000;
uint32_t pbar_max = 0;
@@ -466,11 +461,6 @@ bool NewFloppyDialog::createZipSectorImage(const QString &filename, const disk_s
if (total_sectors > ZIP_SECTORS)
total_sectors = ZIP_250_SECTORS;
total_size = total_sectors * sector_bytes;
root_dir_bytes = (disk_size.root_dir_entries << 5);
fat_size = (disk_size.spfat * sector_bytes);
fat1_offs = sector_bytes;
fat2_offs = fat1_offs + fat_size;
zero_bytes = fat2_offs + fat_size + root_dir_bytes;
pbar_max = total_size;
if (type == FileType::Zdi) {

View File

@@ -151,7 +151,7 @@ void SettingsHarddisks::save() {
hdd[i].spt = idx.siblingAtColumn(ColumnSectors).data().toUInt();
QByteArray fileName = idx.siblingAtColumn(ColumnFilename).data(Qt::UserRole).toString().toUtf8();
strncpy(hdd[i].fn, fileName.data(), sizeof(hdd[i].fn));
strncpy(hdd[i].fn, fileName.data(), sizeof(hdd[i].fn) - 1);
hdd[i].priv = nullptr;
}
}
@@ -247,12 +247,14 @@ static void addDriveFromDialog(Ui::SettingsHarddisks* ui, const HarddiskDialog&
QByteArray fn = dlg.fileName().toUtf8();
hard_disk_t hd;
memset(&hd, 0, sizeof(hd));
hd.bus = dlg.bus();
hd.channel = dlg.channel();
hd.tracks = dlg.cylinders();
hd.hpc = dlg.heads();
hd.spt = dlg.sectors();
strncpy(hd.fn, fn.data(), sizeof(hd.fn));
strncpy(hd.fn, fn.data(), sizeof(hd.fn) - 1);
addRow(ui->tableView->model(), &hd);
ui->tableView->resizeColumnsToContents();

View File

@@ -60,7 +60,7 @@ void SoftwareRenderer::onBlit(int buf_idx, int x, int y, int w, int h) {
cur_image = buf_idx;
buf_usage[(buf_idx + 1) % 2].clear();
source.setRect(x, y, w, h);
update();
}

View File

@@ -48,7 +48,6 @@ int xi2flides[2] = { 0, 0 };
static Display* disp = nullptr;
static QThread* procThread = nullptr;
static bool xi2childinit = false;
static XIEventMask ximask;
static std::atomic<bool> exitfromthread = false;
static std::atomic<double> xi2_mouse_x = 0, xi2_mouse_y = 0, xi2_mouse_abs_x = 0, xi2_mouse_abs_y = 0;
@@ -106,7 +105,6 @@ void xinput2_proc()
if (XGetEventData(disp, cookie) && cookie->type == GenericEvent && cookie->extension == xi2opcode) {
switch (cookie->evtype) {
case XI_RawMotion: {
static int ss = 0;
const XIRawEvent *rawev = (const XIRawEvent*)cookie->data;
double relative_coords[2] = { 0., 0. };
parse_valuators(rawev->raw_values,rawev->valuators.mask,

View File

@@ -15,12 +15,12 @@ void getDefaultROMPath(char* Path)
inDomains:NSUserDomainMask];
NSURL* appSupportDir = nil;
NSURL* appDirectory = nil;
if ([possibleURLs count] >= 1) {
// Use the first directory (if multiple are returned)
appSupportDir = [possibleURLs objectAtIndex:0];
}
// If a valid app support directory exists, add the
// app's bundle ID to it to specify the final directory.
if (appSupportDir) {
@@ -29,7 +29,7 @@ void getDefaultROMPath(char* Path)
appDirectory=[appDirectory URLByAppendingPathComponent:@"roms"];
}
// create ~/Library/Application Support/... stuff
NSError* theError = nil;
if (![sharedFM createDirectoryAtURL:appDirectory withIntermediateDirectories:YES
attributes:nil error:&theError])
@@ -37,7 +37,7 @@ void getDefaultROMPath(char* Path)
// Handle the error.
NSLog(@"Error creating user library rom path");
} else NSLog(@"Create user rom path sucessfull");
strcpy(Path,[appDirectory fileSystemRepresentation]);
// return appDirectory;
}

View File

@@ -47,9 +47,3 @@ add_library(voodoo OBJECT vid_voodoo.c vid_voodoo_banshee.c
if(NOT MSVC AND (ARCH STREQUAL "i386" OR ARCH STREQUAL "x86_64"))
target_compile_options(voodoo PRIVATE "-msse2")
endif()
# Suppress GCC false positive warnings in vid_voodoo_codegen_x86[-64].h
# that cause ~3000 lines to be output into the logs each time
if(CMAKE_C_COMPILER_ID STREQUAL "GNU")
target_compile_options(voodoo PRIVATE "-Wstringop-overflow=0")
endif()

View File

@@ -1283,7 +1283,7 @@ void mach64_blit(uint32_t cpu_dat, int count, mach64_t *mach64)
case OP_RECT:
while (count)
{
uint32_t src_dat, dest_dat;
uint32_t src_dat = 0, dest_dat;
uint32_t host_dat = 0;
uint32_t old_dest_dat;
int mix = 0;

View File

@@ -546,14 +546,8 @@ gd54xx_overlay_draw(svga_t *svga, int displine)
int bpp = svga->bpp;
int bytesperpix = (bpp + 7) / 8;
uint8_t *src2 = &svga->vram[(svga->ma - (svga->hdisp * bytesperpix)) & svga->vram_display_mask];
int w = gd54xx->overlay.r2sdz;
int occl, ckval;
if (gd54xx->overlay.mode == 2)
w *= 4;
else
w *= 2;
p = &((uint32_t *)buffer32->line[displine])[gd54xx->overlay.region1size + svga->x_add];
src2 += gd54xx->overlay.region1size * bytesperpix;

View File

@@ -120,7 +120,7 @@ typedef struct et4000w32p_t
uint32_t base[3];
uint8_t ctrl;
} mmu;
volatile int busy;
} et4000w32p_t;
@@ -176,7 +176,7 @@ et4000w32p_out(uint16_t addr, uint8_t val, void *p)
uint8_t old;
uint32_t add2addr = 0;
if (((addr & 0xfff0) == 0x3d0 || (addr & 0xfff0) == 0x3b0) && !(svga->miscout & 1))
if (((addr & 0xfff0) == 0x3d0 || (addr & 0xfff0) == 0x3b0) && !(svga->miscout & 1))
addr ^= 0x60;
switch (addr) {
@@ -318,12 +318,12 @@ et4000w32p_in(uint16_t addr, void *p)
et4000w32p_t *et4000 = (et4000w32p_t *)p;
svga_t *svga = &et4000->svga;
if (((addr & 0xfff0) == 0x3d0 || (addr & 0xfff0) == 0x3b0) && !(svga->miscout & 1))
if (((addr & 0xfff0) == 0x3d0 || (addr & 0xfff0) == 0x3b0) && !(svga->miscout & 1))
addr ^= 0x60;
switch (addr) {
case 0x3c5:
if ((svga->seqaddr & 0xf) == 7)
if ((svga->seqaddr & 0xf) == 7)
return svga->seqregs[svga->seqaddr & 0xf] | 4;
break;
@@ -466,7 +466,7 @@ et4000w32p_recalctimings(svga_t *svga)
}
et4000->adjust_cursor = 0;
switch (svga->bpp) {
case 15: case 16:
svga->hdisp >>= 1;
@@ -501,10 +501,10 @@ et4000w32p_recalctimings(svga_t *svga)
}
switch (svga->gdcreg[5] & 0x60) {
case 0x00:
case 0x00:
if (et4000->rev == 5)
svga->ma_latch++;
if (svga->seqregs[1] & 8) /* Low res (320) */
svga->render = svga_render_4bpp_lowres;
else
@@ -674,7 +674,7 @@ et4000w32p_accel_write_fifo(et4000w32p_t *et4000, uint32_t addr, uint8_t val)
et4000->acl.queued.dest_off = (et4000->acl.queued.dest_off & 0x00ff) | ((val & 0x0f) << 8);
break;
case 0x8e:
if (et4000->type >= ET4000W32P_REVC)
if (et4000->type >= ET4000W32P_REVC)
et4000->acl.queued.pixel_depth = val & 0x30;
else
et4000->acl.queued.vbus = val & 0x03;
@@ -747,7 +747,7 @@ et4000w32p_accel_write_fifo(et4000w32p_t *et4000, uint32_t addr, uint8_t val)
}
}
break;
case 0xa4:
case 0xa4:
et4000->acl.queued.mix_addr = (et4000->acl.queued.mix_addr & 0xFFFFFF00) | val;
break;
case 0xa5:
@@ -829,7 +829,7 @@ et4000w32p_accel_write_mmu(et4000w32p_t *et4000, uint32_t addr, uint8_t val, uin
et4000->acl.cpu_input_num = 0;
}
if ((et4000->acl.internal.ctrl_routing & 7) == 4) /*CPU data is X Count*/
et4000w32_blit(val | (et4000->acl.queued.count_x << 8), 0, 0, 0xffffffff, et4000);
if ((et4000->acl.internal.ctrl_routing & 7) == 5) /*CPU data is Y Count*/
@@ -863,7 +863,7 @@ et4000w32p_mmu_write(uint32_t addr, uint8_t val, void *p)
et4000w32p_accel_write_fifo(et4000, addr & 0x7fff, val);
} else {
switch (addr & 0xff) {
case 0x00:
case 0x00:
et4000->mmu.base[0] = (et4000->mmu.base[0] & 0x3fff00) | val;
break;
case 0x01:
@@ -911,7 +911,7 @@ et4000w32p_mmu_read(uint32_t addr, void *p)
et4000w32p_t *et4000 = (et4000w32p_t *)p;
svga_t *svga = &et4000->svga;
uint8_t temp;
switch (addr & 0x6000) {
case 0x0000: /* MMU 0 */
case 0x2000: /* MMU 1 */
@@ -933,7 +933,7 @@ et4000w32p_mmu_read(uint32_t addr, void *p)
if ((addr & 0x1fff) + et4000->mmu.base[et4000->bank] >= svga->vram_max)
return 0xff;
return svga->vram[(addr & 0x1fff) + et4000->mmu.base[et4000->bank]];
case 0x6000:
@@ -1001,8 +1001,8 @@ et4000w32p_mmu_read(uint32_t addr, void *p)
return et4000->acl.internal.dest_off & 0xff;
case 0x8d:
return et4000->acl.internal.dest_off >> 8;
case 0x8e:
if (et4000->type >= ET4000W32P_REVC)
case 0x8e:
if (et4000->type >= ET4000W32P_REVC)
return et4000->acl.internal.pixel_depth;
else
return et4000->acl.internal.vbus;
@@ -1036,7 +1036,7 @@ et4000w32_blit_start(et4000w32p_t *et4000)
{
et4000->acl.x_count = et4000->acl.internal.count_x;
et4000->acl.y_count = et4000->acl.internal.count_y;
et4000->acl.pattern_addr = et4000->acl.internal.pattern_addr;
et4000->acl.source_addr = et4000->acl.internal.source_addr;
et4000->acl.dest_addr = et4000->acl.internal.dest_addr;
@@ -1098,9 +1098,9 @@ et4000w32p_blit_start(et4000w32p_t *et4000)
et4000->acl.internal.pos_x = et4000->acl.internal.pos_y = 0;
et4000->acl.pattern_x = et4000->acl.source_x = et4000->acl.pattern_y = et4000->acl.source_y = 0;
et4000->acl.status |= ACL_XYST;
et4000w32_log("ACL status XYST set\n");
if ((!(et4000->acl.internal.ctrl_routing & 7) || (et4000->acl.internal.ctrl_routing & 4)) && !(et4000->acl.internal.ctrl_routing & 0x40))
if ((!(et4000->acl.internal.ctrl_routing & 7) || (et4000->acl.internal.ctrl_routing & 4)) && !(et4000->acl.internal.ctrl_routing & 0x40))
et4000->acl.status |= ACL_SSO;
if (et4000w32_wrap_x[et4000->acl.internal.pattern_wrap & 7]) {
@@ -1497,7 +1497,7 @@ et4000w32_blit(int count, int cpu_input, uint32_t src_dat, uint32_t mix_dat, et4
/*Write the data*/
svga->vram[et4000->acl.dest_addr & et4000->vram_mask] = out;
svga->changedvram[(et4000->acl.dest_addr & et4000->vram_mask) >> 12] = changeframecount;
if (et4000->acl.internal.xy_dir & 1) {
et4000->acl.dest_addr--;
et4000->acl.pattern_x--;
@@ -1515,7 +1515,7 @@ et4000w32_blit(int count, int cpu_input, uint32_t src_dat, uint32_t mix_dat, et4
if (et4000->acl.source_x >= (et4000w32_wrap_x[et4000->acl.internal.source_wrap & 7] + 1))
et4000->acl.source_x -= (et4000w32_wrap_x[et4000->acl.internal.source_wrap & 7] + 1);
}
et4000->acl.x_count--;
if (et4000->acl.x_count == 0xffff) {
et4000->acl.x_count = et4000->acl.internal.count_x;
@@ -1604,14 +1604,14 @@ et4000w32p_blit(int count, uint32_t mix, uint32_t sdat, int cpu_input, et4000w32
et4000w32_log("%06X %02X ", et4000->acl.mix_addr, svga->vram[(et4000->acl.mix_addr >> 3) & et4000->vram_mask]);
} else {
mixdat = mix & 1;
mix >>= 1;
mix >>= 1;
mix |= 0x80000000;
}
et4000->acl.mix_addr++;
rop = mixdat ? et4000->acl.internal.rop_fg : et4000->acl.internal.rop_bg;
ROPMIX(rop, dest, pattern, source, out);
et4000w32_log("%06X = %02X\n", et4000->acl.dest_addr & et4000->vram_mask, out);
if (!(et4000->acl.internal.ctrl_routing & 0x40)) {
svga->vram[et4000->acl.dest_addr & et4000->vram_mask] = out;
@@ -1627,9 +1627,9 @@ et4000w32p_blit(int count, uint32_t mix, uint32_t sdat, int cpu_input, et4000w32
if (et4000->acl.internal.xy_dir & 1) et4000w32_decx(1, et4000);
else et4000w32_incx(1, et4000);
} else {
if (et4000->acl.internal.xy_dir & 1)
if (et4000->acl.internal.xy_dir & 1)
et4000w32_incx((et4000->acl.internal.pixel_depth >> 4) & 3, et4000);
else
else
et4000w32_decx((et4000->acl.internal.pixel_depth >> 4) & 3, et4000);
et4000->acl.pix_pos = 0;
@@ -1692,15 +1692,15 @@ et4000w32p_blit(int count, uint32_t mix, uint32_t sdat, int cpu_input, et4000w32
sdat >>= 8;
} else
source = svga->vram[(et4000->acl.source_addr + et4000->acl.source_x) & et4000->vram_mask];
dest = svga->vram[et4000->acl.dest_addr & et4000->vram_mask];
out = 0;
if ((et4000->acl.internal.ctrl_routing & 0xa) == 8) {
mixdat = svga->vram[(et4000->acl.mix_addr >> 3) & et4000->vram_mask] & (1 << (et4000->acl.mix_addr & 7));
} else {
mixdat = mix & 1;
mix >>= 1;
mix >>= 1;
mix |= 0x80000000;
}
@@ -1708,7 +1708,7 @@ et4000w32p_blit(int count, uint32_t mix, uint32_t sdat, int cpu_input, et4000w32
ROPMIX(rop, dest, pattern, source, out);
if (!(et4000->acl.internal.ctrl_routing & 0x40)) {
if (!(et4000->acl.internal.ctrl_routing & 0x40)) {
svga->vram[et4000->acl.dest_addr & et4000->vram_mask] = out;
svga->changedvram[(et4000->acl.dest_addr & et4000->vram_mask) >> 12] = changeframecount;
} else {
@@ -1720,7 +1720,7 @@ et4000w32p_blit(int count, uint32_t mix, uint32_t sdat, int cpu_input, et4000w32
et4000w32_decx(1, et4000);
else
et4000w32_incx(1, et4000);
et4000->acl.x_count--;
if (et4000->acl.x_count == 0xffff) {
if (et4000->acl.internal.xy_dir & 2) {
@@ -1748,7 +1748,7 @@ et4000w32p_blit(int count, uint32_t mix, uint32_t sdat, int cpu_input, et4000w32
return;
if (et4000->acl.internal.ctrl_routing & 0x40) {
if (et4000->acl.cpu_dat_pos & 3)
if (et4000->acl.cpu_dat_pos & 3)
et4000->acl.cpu_dat_pos += 4 - (et4000->acl.cpu_dat_pos & 3);
return;
}
@@ -1770,7 +1770,7 @@ et4000w32p_hwcursor_draw(svga_t *svga, int displine)
int minus_width = 0;
uint8_t dat;
offset = svga->hwcursor_latch.xoff;
if (et4000->type == ET4000W32) {
switch (svga->bpp) {
case 8:
@@ -1916,12 +1916,12 @@ et4000w32p_pci_write(int func, int addr, uint8_t val, void *p)
et4000w32p_recalcmapping(et4000);
break;
case 0x13:
et4000->linearbase &= 0x00c00000;
case 0x13:
et4000->linearbase &= 0x00c00000;
et4000->linearbase |= (et4000->pci_regs[0x13] << 24);
svga->crtc[0x30] &= 3;
svga->crtc[0x30] |= ((et4000->linearbase & 0x3f000000) >> 22);
et4000w32p_recalcmapping(et4000);
et4000w32p_recalcmapping(et4000);
break;
case 0x30: case 0x31: case 0x32: case 0x33:
@@ -1954,7 +1954,7 @@ et4000w32p_init(const device_t *info)
et4000->pci = (info->flags & DEVICE_PCI) ? 0x80 : 0x00;
et4000->vlb = (info->flags & DEVICE_VLB) ? 0x40 : 0x00;
/*The ET4000/W32i ISA BIOS seems to not support 2MB of VRAM*/
if ((info->local == ET4000W32) || ((info->local == ET4000W32I) && !(et4000->vlb)))
vram_size = 1;
@@ -1986,14 +1986,14 @@ et4000w32p_init(const device_t *info)
case ET4000W32:
/* ET4000/W32 */
et4000->rev = 0;
rom_init(&et4000->bios_rom, BIOS_ROM_PATH_W32, 0xc0000, 0x8000, 0x7fff, 0,
MEM_MAPPING_EXTERNAL);
et4000->svga.ramdac = device_add(&tseng_ics5301_ramdac_device);
et4000->svga.clock_gen = et4000->svga.ramdac;
et4000->svga.getclock = sdac_getclock;
break;
break;
case ET4000W32I:
/* ET4000/W32i rev B */
@@ -2001,7 +2001,7 @@ et4000w32p_init(const device_t *info)
if (et4000->vlb) {
rom_init(&et4000->bios_rom, BIOS_ROM_PATH_W32I_VLB, 0xc0000, 0x8000, 0x7fff, 0,
MEM_MAPPING_EXTERNAL);
MEM_MAPPING_EXTERNAL);
} else {
rom_init(&et4000->bios_rom, BIOS_ROM_PATH_W32I_ISA, 0xc0000, 0x8000, 0x7fff, 0,
MEM_MAPPING_EXTERNAL);

View File

@@ -265,7 +265,7 @@ draw_char_rom(herculesplus_t *dev, int x, uint8_t chr, uint8_t attr)
static void
draw_char_ram4(herculesplus_t *dev, int x, uint8_t chr, uint8_t attr)
{
unsigned ull, val, ifg, ibg, cfg;
unsigned ull, val, ibg, cfg;
const uint8_t *fnt;
int i, elg, blk;
int cw = HERCULESPLUS_CW;
@@ -280,17 +280,13 @@ draw_char_ram4(herculesplus_t *dev, int x, uint8_t chr, uint8_t attr)
/* MDA-compatible attributes */
ibg = 0;
ifg = 7;
if ((attr & 0x77) == 0x70) { /* Invert */
ifg = 0;
ibg = 7;
}
if (attr & 8)
ifg |= 8; /* High intensity FG */
if (attr & 0x80)
ibg |= 8; /* High intensity BG */
if ((attr & 0x77) == 0) /* Blank */
ifg = ibg;
ull = ((attr & 0x07) == 1) ? 13 : 0xffff;
if (dev->crtc[HERCULESPLUS_CRTC_XMODE] & HERCULESPLUS_XMODE_90COL)
elg = 0;

View File

@@ -406,7 +406,7 @@ dword_remap(svga_t *svga, uint32_t in_addr)
{
if (svga->packed_chain4 || svga->force_old_addr)
return in_addr;
return ((in_addr << 2) & 0x3fff0) |
((in_addr >> 14) & 0xc) |
(in_addr & ~0x3fffc);
@@ -415,8 +415,8 @@ static __inline uint32_t
dword_remap_w(svga_t *svga, uint32_t in_addr)
{
if (svga->packed_chain4 || svga->force_old_addr)
return in_addr;
return in_addr;
return ((in_addr << 2) & 0x1fff8) |
((in_addr >> 14) & 0x6) |
(in_addr & ~0x1fffe);
@@ -425,8 +425,8 @@ static __inline uint32_t
dword_remap_l(svga_t *svga, uint32_t in_addr)
{
if (svga->packed_chain4 || svga->force_old_addr)
return in_addr;
return in_addr;
return ((in_addr << 2) & 0xfffc) |
((in_addr >> 14) & 0x3) |
(in_addr & ~0xffff);
@@ -3379,7 +3379,7 @@ s3_updatemapping(s3_t *s3)
} else {
if (s3->chip >= S3_TRIO64V)
svga->fb_only = 0;
mem_mapping_disable(&s3->linear_mapping);
}

File diff suppressed because it is too large Load Diff

View File

@@ -42,12 +42,11 @@ void
sc1148x_ramdac_out(uint16_t addr, int rs2, uint8_t val, void *p, svga_t *svga)
{
sc1148x_ramdac_t *ramdac = (sc1148x_ramdac_t *) p;
uint8_t rs = (addr & 0x03);
rs |= ((!!rs2) << 2);
int oldbpp = 0;
uint8_t rs = (addr & 0x03) | ((!!rs2) << 2);
int oldbpp = 0;
switch (addr) {
case 0x3c6:
switch (rs) {
case 2: case 6:
switch (ramdac->state) {
case 4:
ramdac->state = 0;
@@ -84,8 +83,7 @@ sc1148x_ramdac_out(uint16_t addr, int rs2, uint8_t val, void *p, svga_t *svga)
}
break;
case 0x3c7: case 0x3c8:
case 0x3c9:
default:
ramdac->state = 0;
svga_out(addr, val, svga);
break;
@@ -97,12 +95,10 @@ uint8_t
sc1148x_ramdac_in(uint16_t addr, int rs2, void *p, svga_t *svga)
{
sc1148x_ramdac_t *ramdac = (sc1148x_ramdac_t *) p;
uint8_t ret = 0xff;
uint8_t rs = (addr & 0x03);
rs |= ((!!rs2) << 2);
uint8_t ret = 0xff, rs = (addr & 0x03) | ((!!rs2) << 2);
switch (addr) {
case 0x3c6:
switch (rs) {
case 2: case 6:
switch (ramdac->state) {
case 1:
case 2: case 3:
@@ -120,8 +116,7 @@ sc1148x_ramdac_in(uint16_t addr, int rs2, void *p, svga_t *svga)
}
break;
case 0x3c7: case 0x3c8:
case 0x3c9:
default:
ret = svga_in(addr, svga);
ramdac->state = 0;
break;

View File

@@ -396,94 +396,94 @@ svga_render_2bpp_lowres(svga_t *svga)
if ((svga->displine + svga->y_add) < 0)
return;
if (svga->force_old_addr) {
changed_offset = ((svga->ma << 1) + (svga->sc & ~svga->crtc[0x17] & 3) * 0x8000) >> 12;
if (svga->changedvram[changed_offset] || svga->changedvram[changed_offset + 1] || svga->fullchange) {
p = &buffer32->line[svga->displine + svga->y_add][svga->x_add];
if (svga->force_old_addr) {
changed_offset = ((svga->ma << 1) + (svga->sc & ~svga->crtc[0x17] & 3) * 0x8000) >> 12;
if (svga->firstline_draw == 2000)
svga->firstline_draw = svga->displine;
svga->lastline_draw = svga->displine;
if (svga->changedvram[changed_offset] || svga->changedvram[changed_offset + 1] || svga->fullchange) {
p = &buffer32->line[svga->displine + svga->y_add][svga->x_add];
for (x = 0; x <= (svga->hdisp + svga->scrollcache); x += 16) {
addr = svga->ma;
if (svga->firstline_draw == 2000)
svga->firstline_draw = svga->displine;
svga->lastline_draw = svga->displine;
if (!(svga->crtc[0x17] & 0x40)) {
addr = (addr << 1) & svga->vram_mask;
addr &= ~7;
for (x = 0; x <= (svga->hdisp + svga->scrollcache); x += 16) {
addr = svga->ma;
if ((svga->crtc[0x17] & 0x20) && (svga->ma & 0x20000))
addr |= 4;
if (!(svga->crtc[0x17] & 0x40)) {
addr = (addr << 1) & svga->vram_mask;
addr &= ~7;
if (!(svga->crtc[0x17] & 0x20) && (svga->ma & 0x8000))
addr |= 4;
}
if ((svga->crtc[0x17] & 0x20) && (svga->ma & 0x20000))
addr |= 4;
if (!(svga->crtc[0x17] & 0x01))
addr = (addr & ~0x8000) | ((svga->sc & 1) ? 0x8000 : 0);
if (!(svga->crtc[0x17] & 0x02))
addr = (addr & ~0x10000) | ((svga->sc & 2) ? 0x10000 : 0);
dat[0] = svga->vram[addr];
dat[1] = svga->vram[addr | 0x1];
if (svga->seqregs[1] & 4)
svga->ma += 2;
else
svga->ma += 4;
svga->ma &= svga->vram_mask;
if (svga->crtc[0x17] & 0x80) {
p[0] = p[1] = svga->pallook[svga->egapal[(dat[0] >> 6) & 3]];
p[2] = p[3] = svga->pallook[svga->egapal[(dat[0] >> 4) & 3]];
p[4] = p[5] = svga->pallook[svga->egapal[(dat[0] >> 2) & 3]];
p[6] = p[7] = svga->pallook[svga->egapal[dat[0] & 3]];
p[8] = p[9] = svga->pallook[svga->egapal[(dat[1] >> 6) & 3]];
p[10] = p[11] = svga->pallook[svga->egapal[(dat[1] >> 4) & 3]];
p[12] = p[13] = svga->pallook[svga->egapal[(dat[1] >> 2) & 3]];
p[14] = p[15] = svga->pallook[svga->egapal[dat[1] & 3]];
} else
memset(p, 0x00, 16 * sizeof(uint32_t));
p += 16;
if (!(svga->crtc[0x17] & 0x20) && (svga->ma & 0x8000))
addr |= 4;
}
if (!(svga->crtc[0x17] & 0x01))
addr = (addr & ~0x8000) | ((svga->sc & 1) ? 0x8000 : 0);
if (!(svga->crtc[0x17] & 0x02))
addr = (addr & ~0x10000) | ((svga->sc & 2) ? 0x10000 : 0);
dat[0] = svga->vram[addr];
dat[1] = svga->vram[addr | 0x1];
if (svga->seqregs[1] & 4)
svga->ma += 2;
else
svga->ma += 4;
svga->ma &= svga->vram_mask;
if (svga->crtc[0x17] & 0x80) {
p[0] = p[1] = svga->pallook[svga->egapal[(dat[0] >> 6) & 3]];
p[2] = p[3] = svga->pallook[svga->egapal[(dat[0] >> 4) & 3]];
p[4] = p[5] = svga->pallook[svga->egapal[(dat[0] >> 2) & 3]];
p[6] = p[7] = svga->pallook[svga->egapal[dat[0] & 3]];
p[8] = p[9] = svga->pallook[svga->egapal[(dat[1] >> 6) & 3]];
p[10] = p[11] = svga->pallook[svga->egapal[(dat[1] >> 4) & 3]];
p[12] = p[13] = svga->pallook[svga->egapal[(dat[1] >> 2) & 3]];
p[14] = p[15] = svga->pallook[svga->egapal[dat[1] & 3]];
} else
memset(p, 0x00, 16 * sizeof(uint32_t));
p += 16;
}
} else {
changed_addr = svga->remap_func(svga, svga->ma);
}
} else {
changed_addr = svga->remap_func(svga, svga->ma);
if (svga->changedvram[changed_addr >> 12] || svga->changedvram[(changed_addr >> 12) + 1] || svga->fullchange) {
p = &buffer32->line[svga->displine + svga->y_add][svga->x_add];
if (svga->changedvram[changed_addr >> 12] || svga->changedvram[(changed_addr >> 12) + 1] || svga->fullchange) {
p = &buffer32->line[svga->displine + svga->y_add][svga->x_add];
if (svga->firstline_draw == 2000)
svga->firstline_draw = svga->displine;
svga->lastline_draw = svga->displine;
if (svga->firstline_draw == 2000)
svga->firstline_draw = svga->displine;
svga->lastline_draw = svga->displine;
for (x = 0; x <= (svga->hdisp + svga->scrollcache); x += 16) {
addr = svga->remap_func(svga, svga->ma);
for (x = 0; x <= (svga->hdisp + svga->scrollcache); x += 16) {
addr = svga->remap_func(svga, svga->ma);
dat[0] = svga->vram[addr];
dat[1] = svga->vram[addr | 0x1];
if (svga->seqregs[1] & 4)
svga->ma += 2;
else
svga->ma += 4;
dat[0] = svga->vram[addr];
dat[1] = svga->vram[addr | 0x1];
if (svga->seqregs[1] & 4)
svga->ma += 2;
else
svga->ma += 4;
svga->ma &= svga->vram_mask;
svga->ma &= svga->vram_mask;
if (svga->crtc[0x17] & 0x80) {
p[0] = p[1] = svga->pallook[svga->egapal[(dat[0] >> 6) & 3]];
p[2] = p[3] = svga->pallook[svga->egapal[(dat[0] >> 4) & 3]];
p[4] = p[5] = svga->pallook[svga->egapal[(dat[0] >> 2) & 3]];
p[6] = p[7] = svga->pallook[svga->egapal[dat[0] & 3]];
p[8] = p[9] = svga->pallook[svga->egapal[(dat[1] >> 6) & 3]];
p[10] = p[11] = svga->pallook[svga->egapal[(dat[1] >> 4) & 3]];
p[12] = p[13] = svga->pallook[svga->egapal[(dat[1] >> 2) & 3]];
p[14] = p[15] = svga->pallook[svga->egapal[dat[1] & 3]];
} else
memset(p, 0x00, 16 * sizeof(uint32_t));
if (svga->crtc[0x17] & 0x80) {
p[0] = p[1] = svga->pallook[svga->egapal[(dat[0] >> 6) & 3]];
p[2] = p[3] = svga->pallook[svga->egapal[(dat[0] >> 4) & 3]];
p[4] = p[5] = svga->pallook[svga->egapal[(dat[0] >> 2) & 3]];
p[6] = p[7] = svga->pallook[svga->egapal[dat[0] & 3]];
p[8] = p[9] = svga->pallook[svga->egapal[(dat[1] >> 6) & 3]];
p[10] = p[11] = svga->pallook[svga->egapal[(dat[1] >> 4) & 3]];
p[12] = p[13] = svga->pallook[svga->egapal[(dat[1] >> 2) & 3]];
p[14] = p[15] = svga->pallook[svga->egapal[dat[1] & 3]];
} else
memset(p, 0x00, 16 * sizeof(uint32_t));
p += 16;
}
p += 16;
}
}
}
}
@@ -500,7 +500,7 @@ svga_render_2bpp_highres(svga_t *svga)
if ((svga->displine + svga->y_add) < 0)
return;
if (svga->force_old_addr) {
if (svga->force_old_addr) {
changed_offset = ((svga->ma << 1) + (svga->sc & ~svga->crtc[0x17] & 3) * 0x8000) >> 12;
if (svga->changedvram[changed_offset] || svga->changedvram[changed_offset + 1] || svga->fullchange) {
@@ -551,7 +551,7 @@ svga_render_2bpp_highres(svga_t *svga)
p += 8;
}
}
} else {
} else {
changed_addr = svga->remap_func(svga, svga->ma);
if (svga->changedvram[changed_addr >> 12] || svga->changedvram[(changed_addr >> 12) + 1] || svga->fullchange) {
@@ -587,8 +587,8 @@ svga_render_2bpp_highres(svga_t *svga)
p += 8;
}
}
}
}
}
}
@@ -666,7 +666,7 @@ svga_render_4bpp_lowres(svga_t *svga)
if (svga->changedvram[svga->ma >> 12] || svga->changedvram[(svga->ma >> 12) + 1] || svga->fullchange) {
p = &buffer32->line[svga->displine + svga->y_add][svga->x_add];
if (svga->firstline_draw == 2000)
if (svga->firstline_draw == 2000)
svga->firstline_draw = svga->displine;
svga->lastline_draw = svga->displine;
@@ -722,7 +722,7 @@ svga_render_4bpp_lowres(svga_t *svga)
p += 16;
}
}
}
} else {
changed_addr = svga->remap_func(svga, svga->ma);
@@ -767,7 +767,7 @@ svga_render_4bpp_lowres(svga_t *svga)
p += 16;
}
}
}
}
}
@@ -784,14 +784,14 @@ svga_render_4bpp_highres(svga_t *svga)
if ((svga->displine + svga->y_add) < 0)
return;
if (svga->force_old_addr) {
changed_offset = (svga->ma + (svga->sc & ~svga->crtc[0x17] & 3) * 0x8000) >> 12;
if (svga->changedvram[changed_offset] || svga->changedvram[changed_offset + 1] || svga->fullchange) {
p = &buffer32->line[svga->displine + svga->y_add][svga->x_add];
if (svga->firstline_draw == 2000)
if (svga->firstline_draw == 2000)
svga->firstline_draw = svga->displine;
svga->lastline_draw = svga->displine;
@@ -847,7 +847,7 @@ svga_render_4bpp_highres(svga_t *svga)
p += 8;
}
}
}
} else {
changed_addr = svga->remap_func(svga, svga->ma);
@@ -908,12 +908,12 @@ svga_render_8bpp_lowres(svga_t *svga)
if ((svga->displine + svga->y_add) < 0)
return;
if (svga->force_old_addr) {
if (svga->changedvram[svga->ma >> 12] || svga->changedvram[(svga->ma >> 12) + 1] || svga->fullchange) {
p = &buffer32->line[svga->displine + svga->y_add][svga->x_add];
if (svga->firstline_draw == 2000)
if (svga->firstline_draw == 2000)
svga->firstline_draw = svga->displine;
svga->lastline_draw = svga->displine;
@@ -981,12 +981,12 @@ svga_render_8bpp_highres(svga_t *svga)
if ((svga->displine + svga->y_add) < 0)
return;
if (svga->force_old_addr) {
if (svga->changedvram[svga->ma >> 12] || svga->changedvram[(svga->ma >> 12) + 1] || svga->fullchange) {
p = &buffer32->line[svga->displine + svga->y_add][svga->x_add];
if (svga->firstline_draw == 2000)
if (svga->firstline_draw == 2000)
svga->firstline_draw = svga->displine;
svga->lastline_draw = svga->displine;
@@ -1172,12 +1172,12 @@ svga_render_15bpp_lowres(svga_t *svga)
if ((svga->displine + svga->y_add) < 0)
return;
if (svga->force_old_addr) {
if (svga->changedvram[svga->ma >> 12] || svga->changedvram[(svga->ma >> 12) + 1] || svga->fullchange) {
p = &buffer32->line[svga->displine + svga->y_add][svga->x_add];
if (svga->firstline_draw == 2000)
if (svga->firstline_draw == 2000)
svga->firstline_draw = svga->displine;
svga->lastline_draw = svga->displine;
@@ -1253,12 +1253,12 @@ svga_render_15bpp_highres(svga_t *svga)
if ((svga->displine + svga->y_add) < 0)
return;
if (svga->force_old_addr) {
if (svga->changedvram[svga->ma >> 12] || svga->changedvram[(svga->ma >> 12) + 1] || svga->fullchange) {
p = &buffer32->line[svga->displine + svga->y_add][svga->x_add];
if (svga->firstline_draw == 2000)
if (svga->firstline_draw == 2000)
svga->firstline_draw = svga->displine;
svga->lastline_draw = svga->displine;
@@ -1282,7 +1282,7 @@ svga_render_15bpp_highres(svga_t *svga)
} else
memset(&(p[x]), 0x00, 8 * sizeof(uint32_t));
}
svga->ma += x << 1;
svga->ma += x << 1;
svga->ma &= svga->vram_display_mask;
}
} else {
@@ -1453,7 +1453,7 @@ svga_render_16bpp_lowres(svga_t *svga)
} else
memset(&(p[(x << 1)]), 0x00, 8 * sizeof(uint32_t));
}
svga->ma += x << 1;
svga->ma += x << 1;
svga->ma &= svga->vram_display_mask;
}
} else {
@@ -1496,7 +1496,7 @@ svga_render_16bpp_lowres(svga_t *svga)
svga->ma += 4;
}
svga->ma &= svga->vram_display_mask;
}
}
}
}
@@ -1511,12 +1511,12 @@ svga_render_16bpp_highres(svga_t *svga)
if ((svga->displine + svga->y_add) < 0)
return;
if (svga->force_old_addr) {
if (svga->changedvram[svga->ma >> 12] || svga->changedvram[(svga->ma >> 12) + 1] || svga->fullchange) {
p = &buffer32->line[svga->displine + svga->y_add][svga->x_add];
if (svga->firstline_draw == 2000)
if (svga->firstline_draw == 2000)
svga->firstline_draw = svga->displine;
svga->lastline_draw = svga->displine;
@@ -1540,9 +1540,9 @@ svga_render_16bpp_highres(svga_t *svga)
} else
memset(&(p[x]), 0x00, 8 * sizeof(uint32_t));
}
svga->ma += x << 1;
svga->ma += x << 1;
svga->ma &= svga->vram_display_mask;
}
}
} else {
changed_addr = svga->remap_func(svga, svga->ma);
@@ -1590,7 +1590,7 @@ svga_render_16bpp_highres(svga_t *svga)
}
}
svga->ma &= svga->vram_display_mask;
}
}
}
}
@@ -1606,13 +1606,13 @@ svga_render_24bpp_lowres(svga_t *svga)
if ((svga->displine + svga->y_add) < 0)
return;
if (svga->force_old_addr) {
if ((svga->displine + svga->y_add) < 0)
return;
if (svga->changedvram[svga->ma >> 12] || svga->changedvram[(svga->ma >> 12) + 1] || svga->fullchange) {
if (svga->firstline_draw == 2000)
if (svga->firstline_draw == 2000)
svga->firstline_draw = svga->displine;
svga->lastline_draw = svga->displine;
@@ -1621,7 +1621,7 @@ svga_render_24bpp_lowres(svga_t *svga)
fg = svga->vram[svga->ma] | (svga->vram[svga->ma + 1] << 8) | (svga->vram[svga->ma + 2] << 16);
else
fg = 0x00000000;
svga->ma += 3;
svga->ma += 3;
svga->ma &= svga->vram_display_mask;
buffer32->line[svga->displine + svga->y_add][(x << 1) + svga->x_add] =
buffer32->line[svga->displine + svga->y_add][(x << 1) + 1 + svga->x_add] = fg;
@@ -1690,12 +1690,12 @@ svga_render_24bpp_highres(svga_t *svga)
if ((svga->displine + svga->y_add) < 0)
return;
if (svga->force_old_addr) {
if (svga->changedvram[svga->ma >> 12] || svga->changedvram[(svga->ma >> 12) + 1] || svga->fullchange) {
p = &buffer32->line[svga->displine + svga->y_add][svga->x_add];
if (svga->firstline_draw == 2000)
if (svga->firstline_draw == 2000)
svga->firstline_draw = svga->displine;
svga->lastline_draw = svga->displine;
@@ -1718,7 +1718,7 @@ svga_render_24bpp_highres(svga_t *svga)
svga->ma += 12;
}
svga->ma &= svga->vram_display_mask;
}
}
} else {
changed_addr = svga->remap_func(svga, svga->ma);
@@ -1766,7 +1766,7 @@ svga_render_24bpp_highres(svga_t *svga)
}
}
svga->ma &= svga->vram_display_mask;
}
}
}
}
@@ -1781,10 +1781,10 @@ svga_render_32bpp_lowres(svga_t *svga)
if ((svga->displine + svga->y_add) < 0)
return;
if (svga->force_old_addr) {
if (svga->changedvram[svga->ma >> 12] || svga->changedvram[(svga->ma >> 12) + 1] || svga->fullchange) {
if (svga->firstline_draw == 2000)
if (svga->firstline_draw == 2000)
svga->firstline_draw = svga->displine;
svga->lastline_draw = svga->displine;
@@ -1847,12 +1847,12 @@ svga_render_32bpp_highres(svga_t *svga)
if ((svga->displine + svga->y_add) < 0)
return;
if (svga->force_old_addr) {
if (svga->changedvram[svga->ma >> 12] || svga->changedvram[(svga->ma >> 12) + 1] || svga->changedvram[(svga->ma >> 12) + 2] || svga->fullchange) {
p = &buffer32->line[svga->displine + svga->y_add][svga->x_add];
if (svga->firstline_draw == 2000)
if (svga->firstline_draw == 2000)
svga->firstline_draw = svga->displine;
svga->lastline_draw = svga->displine;
@@ -1863,7 +1863,7 @@ svga_render_32bpp_highres(svga_t *svga)
dat = 0x00000000;
p[x] = dat & 0xffffff;
}
svga->ma += 4;
svga->ma += 4;
svga->ma &= svga->vram_display_mask;
}
} else {

View File

@@ -43,7 +43,7 @@
<!-- Windows 7 -->
<supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}"/>
<!-- Windows Vista -->
<supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}"/>
<supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}"/>
</application>
</compatibility>
</assembly>

View File

@@ -16,7 +16,7 @@
enable_language(RC)
add_library(plat OBJECT win.c win_dynld.c win_cdrom.c win_keyboard.c
win_crashdump.c win_mouse.c)
win_mouse.c)
add_library(ui OBJECT win_ui.c win_icon.c win_stbar.c win_sdl.c win_dialog.c win_about.c
win_settings.c win_devconf.c win_snd_gain.c win_specify_dim.c win_new_floppy.c

View File

@@ -37,9 +37,15 @@ ifeq ($(DEV_BUILD), y)
ifndef AMD_K5
AMD_K5 := y
endif
ifndef AN430TX
AN430TX := y
endif
ifndef CYRIX_6X86
CYRIX_6X86 := y
endif
ifndef DESKPRO386
DESKPRO386 := y
endif
ifndef GUSMAX
GUSMAX := y
endif
@@ -58,9 +64,6 @@ ifeq ($(DEV_BUILD), y)
ifndef MGA
MGA := y
endif
ifndef NO_SIO
NO_SIO := y
endif
ifndef OPEN_AT
OPEN_AT := y
endif
@@ -76,9 +79,6 @@ ifeq ($(DEV_BUILD), y)
ifndef TANDY_ISA
TANDY_ISA := y
endif
ifndef VNC
VNC := y
endif
ifndef XL24
XL24 := y
endif
@@ -98,9 +98,15 @@ else
ifndef AMD_K5
AMD_K5 := n
endif
ifndef AN430TX
AN430TX := n
endif
ifndef CYRIX_6X86
CYRIX_6X86 := n
endif
ifndef DESKPRO386
DESKPRO386 := n
endif
ifndef GUSMAX
GUSMAX := n
endif
@@ -119,9 +125,6 @@ else
ifndef MGA
MGA := n
endif
ifndef NO_SIO
NO_SIO := n
endif
ifndef OPEN_AT
OPEN_AT := n
endif
@@ -137,9 +140,6 @@ else
ifndef TANDY_ISA
TANDY_ISA := n
endif
ifndef VNC
VNC := n
endif
ifndef XL24
XL24 := n
endif
@@ -182,6 +182,9 @@ endif
ifndef MUNT
MUNT := y
endif
ifndef VNC
VNC := n
endif
ifndef NEW_DYNAREC
NEW_DYNAREC := n
endif
@@ -427,10 +430,18 @@ ifeq ($(AMD_K5), y)
OPTS += -DUSE_AMD_K5
endif
ifeq ($(AN430TX), y)
OPTS += -DUSE_AN430TX
endif
ifeq ($(CYRIX_6X86), y)
OPTS += -DUSE_CYRIX_6X86
endif
ifeq ($(DESKPRO386), y)
OPTS += -DUSE_DESKPRO386
endif
ifeq ($(GUSMAX), y)
OPTS += -DUSE_GUSMAX
endif
@@ -457,10 +468,6 @@ OPTS += -DUSE_MGA
DEVBROBJ += vid_mga.o
endif
ifeq ($(NO_SIO), y)
OPTS += -DNO_SIO
endif
ifeq ($(OPEN_AT), y)
OPTS += -DUSE_OPEN_AT
endif
@@ -720,7 +727,6 @@ VOODOOOBJ := vid_voodoo.o vid_voodoo_banshee.o \
PLATOBJ := win.o \
win_dynld.o \
win_cdrom.o win_keyboard.o \
win_crashdump.o \
win_mouse.o
UIOBJ := win_ui.o win_icon.o win_stbar.o discord.o \

View File

@@ -493,10 +493,6 @@ WinMain(HINSTANCE hInst, HINSTANCE hPrev, LPSTR lpszArg, int nCmdShow)
return(1);
}
/* Enable crash dump services. */
if (enable_crashdump)
InitCrashDump();
/* Create console window. */
if (force_debug) {
CreateConsole(1);
@@ -917,10 +913,10 @@ plat_init_rom_paths()
{
wchar_t appdata_dir[1024] = { L'\0' };
if (_wgetenv("LOCALAPPDATA") && _wgetenv("LOCALAPPDATA")[0] != L'\0') {
if (_wgetenv(L"LOCALAPPDATA") && _wgetenv(L"LOCALAPPDATA")[0] != L'\0') {
char appdata_dir_a[1024] = { '\0' };
size_t len = 0;
wcsncpy(appdata_dir, _wgetenv("LOCALAPPDATA"), 1024);
wcsncpy(appdata_dir, _wgetenv(L"LOCALAPPDATA"), 1024);
len = wcslen(appdata_dir);
if (appdata_dir[len - 1] != L'\\') {
appdata_dir[len] = L'\\';

View File

@@ -1,245 +0,0 @@
/*
* 86Box A hypervisor and IBM PC system emulator that specializes in
* running old operating systems and software designed for IBM
* PC systems and compatibles from 1981 through fairly recent
* system designs based on the PCI bus.
*
* This file is part of the 86Box distribution.
*
* Handle generation of crash-dump reports.
*
*
*
* Authors: Riley
* Miran Grca, <mgrca8@gmail.com>
* Fred N. van Kempen, <decwiz@yahoo.com>
*
* Copyright 2016,2017 Riley.
* Copyright 2016,2017 Miran Grca.
* Copyright 2017 Fred N. van Kempen.
*/
#define _WIN32_WINNT 0x0501
#include <windows.h>
#include <psapi.h>
#include <stdio.h>
#include <stdint.h>
#include <string.h>
#include <stdlib.h>
#include <86box/86box.h>
#include <86box/plat.h>
#include <86box/win.h>
#define ExceptionHandlerBufferSize (10240)
static PVOID hExceptionHandler;
static char *ExceptionHandlerBuffer,
*CurrentBufferPointer;
LONG CALLBACK MakeCrashDump(PEXCEPTION_POINTERS ExceptionInfo)
{
SYSTEMTIME SystemTime;
HANDLE hDumpFile;
char *BufPtr;
/*
* Win32-specific functions will be used wherever possible,
* just in case the C stdlib-equivalents try to allocate
* memory.
* (The Win32-specific functions are generally just wrappers
* over NT system calls anyway.)
*/
if ((ExceptionInfo->ExceptionRecord->ExceptionCode >> 28) != 0xC) {
/*
* ExceptionCode is not a fatal exception (high 4b of
* ntstatus = 0xC) Not going to crash, let's not make
* a crash dump.
*/
return(EXCEPTION_CONTINUE_SEARCH);
}
/*
* So, the program is about to crash. Oh no what do?
* Let's create a crash dump file as a debugging-aid.
*
* First, get the path to the executable.
*/
GetModuleFileName(NULL,ExceptionHandlerBuffer,ExceptionHandlerBufferSize);
if (GetLastError() != ERROR_SUCCESS) {
/* Could not get full path, create in current directory. */
BufPtr = ExceptionHandlerBuffer;
} else {
/*
* Walk through the string backwards looking for the
* last backslash, so as to remove the "86Box.exe"
* filename from the string.
*/
BufPtr = &ExceptionHandlerBuffer[strlen(ExceptionHandlerBuffer)];
for (; BufPtr > ExceptionHandlerBuffer; BufPtr--) {
if (BufPtr[0] == '\\') {
/* Found backslash, terminate the string after it. */
BufPtr[1] = 0;
break;
}
}
BufPtr = &ExceptionHandlerBuffer[strlen(ExceptionHandlerBuffer)];
}
/*
* What would a good filename be?
*
* It should contain the current date and time so as
* to be (hopefully!) unique.
*/
GetSystemTime(&SystemTime);
sprintf(CurrentBufferPointer,
"86box-%d%02d%02d-%02d-%02d-%02d-%03d.dmp",
SystemTime.wYear,
SystemTime.wMonth,
SystemTime.wDay,
SystemTime.wHour,
SystemTime.wMinute,
SystemTime.wSecond,
SystemTime.wMilliseconds);
/* Now the filename is in the buffer, the file can be created. */
hDumpFile = CreateFile(
ExceptionHandlerBuffer, // The filename of the file to open.
GENERIC_WRITE, // The permissions to request.
0, // Make sure other processes can't
// touch the crash dump at all
// while it's open.
NULL, // Leave the security descriptor
// undefined, it doesn't matter.
OPEN_ALWAYS, // Opens the file if it exists,
// creates a new file if it doesn't.
FILE_ATTRIBUTE_NORMAL, // File attributes / etc don't matter.
NULL); // A template file is not being used.
/* Check to make sure the file was actually created. */
if (hDumpFile == INVALID_HANDLE_VALUE) {
/* CreateFile() failed, so just do nothing more. */
return(EXCEPTION_CONTINUE_SEARCH);
}
/*
* Write the data we were passed out in a human-readable format.
*
* Get the name of the module where the exception occurred.
*/
HMODULE hMods[1024];
MODULEINFO modInfo;
HMODULE ipModule = 0;
DWORD cbNeeded;
/* Try to get a list of all loaded modules. */
if (EnumProcessModules(GetCurrentProcess(),
hMods, sizeof(hMods), &cbNeeded)) {
/* Got it, now walk through all modules.. */
for (DWORD i = 0; i < (cbNeeded / sizeof(HMODULE)); i++) {
/* For each module, get the module information. */
GetModuleInformation(GetCurrentProcess(),
hMods[i], &modInfo, sizeof(MODULEINFO));
/* If the exception address is in the range of this module.. */
if ( (ExceptionInfo->ExceptionRecord->ExceptionAddress >= modInfo.lpBaseOfDll) &&
(ExceptionInfo->ExceptionRecord->ExceptionAddress < (void*)((char*)modInfo.lpBaseOfDll + modInfo.SizeOfImage))) {
/* ...this is the module we're looking for! */
ipModule = hMods[i];
break;
}
}
}
/* Start to put the crash-dump string into the buffer. */
sprintf(ExceptionHandlerBuffer,
"#\r\n# %s\r\n#\r\n"
"# Crash on %d-%02d-%02d at %02d:%02d:%02d.%03d\r\n#\r\n"
"\r\n"
"Exception details:\r\n"
" NTSTATUS code: 0x%08lx\r\n Address: 0x%p",
emu_version,
SystemTime.wYear, SystemTime.wMonth, SystemTime.wDay,
SystemTime.wHour, SystemTime.wMinute, SystemTime.wSecond,
SystemTime.wMilliseconds,
ExceptionInfo->ExceptionRecord->ExceptionCode,
(void *)ExceptionInfo->ExceptionRecord->ExceptionAddress);
/*
* If we found the correct module, get the full path to
* the module the exception occured at and include it.
*/
BufPtr = &ExceptionHandlerBuffer[strlen(ExceptionHandlerBuffer)];
if (ipModule != 0) {
sprintf(BufPtr," [");
GetModuleFileName(ipModule, &BufPtr[2],
ExceptionHandlerBufferSize - strlen(ExceptionHandlerBuffer));
if (GetLastError() == ERROR_SUCCESS) {
BufPtr = &ExceptionHandlerBuffer[strlen(ExceptionHandlerBuffer)];
sprintf(BufPtr,"]");
BufPtr += 1;
}
}
sprintf(BufPtr,
"\r\nNumber of parameters: %lu\r\nException parameters: ",
ExceptionInfo->ExceptionRecord->NumberParameters);
for (int i = 0; i < ExceptionInfo->ExceptionRecord->NumberParameters; i++) {
BufPtr = &ExceptionHandlerBuffer[strlen(ExceptionHandlerBuffer)];
sprintf(BufPtr,"0x%p ",
(void *)ExceptionInfo->ExceptionRecord->ExceptionInformation[i]);
}
BufPtr = &ExceptionHandlerBuffer[strlen(ExceptionHandlerBuffer) - 1];
#if defined(__i386__) && !defined(__x86_64)
PCONTEXT Registers = ExceptionInfo->ContextRecord;
/* This binary is being compiled for x86, include a register dump. */
sprintf(BufPtr,
"\r\n\r\nRegister dump:\r\n\r\n"
"EIP:0x%08lx\r\n"
"EAX:0x%08lx EBX:0x%08lx ECX:0x%08lx EDX:0x%08lx\r\n"
"EBP:0x%08lx ESP:0x%08lx ESI:0x%08lx EDI:0x%08lx\r\n\r\n",
Registers->Eip,
Registers->Eax, Registers->Ebx, Registers->Ecx, Registers->Edx,
Registers->Ebp, Registers->Esp, Registers->Esi, Registers->Edi);
#else
/* Register dump not supported by this architecture. */
/* (MinGW headers seem to lack the x64 CONTEXT structure definition) */
sprintf(BufPtr, "\r\n");
#endif
/* Write the string to disk. */
WriteFile(hDumpFile, ExceptionHandlerBuffer,
strlen(ExceptionHandlerBuffer), NULL, NULL);
/* Close the file. */
CloseHandle(hDumpFile);
/* Return, therefore causing the crash. */
return(EXCEPTION_CONTINUE_SEARCH);
}
void
InitCrashDump(void)
{
/*
* An exception handler should not allocate memory,
* so allocate 10kb for it to use if it gets called,
* an amount which should be more than enough.
*/
ExceptionHandlerBuffer = malloc(ExceptionHandlerBufferSize);
CurrentBufferPointer = ExceptionHandlerBuffer;
/*
* Register the exception handler.
* Zero first argument means this exception handler gets
* called last, therefore, crash dump is only made, when
* a crash is going to happen.
*/
hExceptionHandler = AddVectoredExceptionHandler(0, MakeCrashDump);
}

View File

@@ -45,7 +45,10 @@ deviceconfig_dlgproc(HWND hdlg, UINT message, WPARAM wParam, LPARAM lParam)
{
HWND h;
int val_int, id, c, d, num;
int val_int, id, c, d;
#ifdef USE_RTMIDI
int num;
#endif
int changed, cid;
const device_config_t *config;
const device_config_selection_t *selection;