mirror of
https://github.com/sarah-walker-pcem/pcem.git
synced 2025-07-23 11:43:03 +02:00
Fixes for clang + related bugfixes (#263)
This commit is contained in:
committed by
GitHub
parent
e1fba7a7b4
commit
2e87d35d00
@@ -262,7 +262,7 @@ enum { ABRT_NONE = 0, ABRT_GEN, ABRT_TS = 0xA, ABRT_NP = 0xB, ABRT_SS = 0xC, ABR
|
|||||||
This distinction is used by the dynarec; a block that hits an 'expected' exception
|
This distinction is used by the dynarec; a block that hits an 'expected' exception
|
||||||
would be compiled, a block that hits an 'unexpected' exception would be rejected so
|
would be compiled, a block that hits an 'unexpected' exception would be rejected so
|
||||||
that we don't end up with an unnecessarily short block*/
|
that we don't end up with an unnecessarily short block*/
|
||||||
#define ABRT_EXPECTED 0x80
|
#define ABRT_EXPECTED ((int8_t)0x80)
|
||||||
extern uint32_t abrt_error;
|
extern uint32_t abrt_error;
|
||||||
|
|
||||||
void x86_doabrt(int x86_abrt);
|
void x86_doabrt(int x86_abrt);
|
||||||
|
@@ -3,7 +3,7 @@
|
|||||||
extern uint64_t PITCONST;
|
extern uint64_t PITCONST;
|
||||||
void pit_init();
|
void pit_init();
|
||||||
void pit_ps2_init();
|
void pit_ps2_init();
|
||||||
void pit_reset();
|
void pit_reset(PIT *pit);
|
||||||
void pit_set_gate(PIT *pit, int channel, int gate);
|
void pit_set_gate(PIT *pit, int channel, int gate);
|
||||||
void pit_set_using_timer(PIT *pit, int t, int using_timer);
|
void pit_set_using_timer(PIT *pit, int t, int using_timer);
|
||||||
void pit_set_out_func(PIT *pit, int t, void (*func)(int new_out, int old_out));
|
void pit_set_out_func(PIT *pit, int t, void (*func)(int new_out, int old_out));
|
||||||
|
@@ -53,7 +53,7 @@ static const p6_instruction_t alu6_op = {.nr_uops = 6,
|
|||||||
.uop[5] = {.type = UOP_ALU01, .throughput = 1, .latency = 1}};
|
.uop[5] = {.type = UOP_ALU01, .throughput = 1, .latency = 1}};
|
||||||
static const p6_instruction_t aluc_op = {.nr_uops = 2,
|
static const p6_instruction_t aluc_op = {.nr_uops = 2,
|
||||||
.uop[0] = {.type = UOP_ALU01, .throughput = 1, .latency = 1},
|
.uop[0] = {.type = UOP_ALU01, .throughput = 1, .latency = 1},
|
||||||
.uop[0] = {.type = UOP_ALU01, .throughput = 1, .latency = 1}};
|
.uop[1] = {.type = UOP_ALU01, .throughput = 1, .latency = 1}};
|
||||||
static const p6_instruction_t load_alu_op = {.nr_uops = 2,
|
static const p6_instruction_t load_alu_op = {.nr_uops = 2,
|
||||||
.uop[0] = {.type = UOP_LOAD, .throughput = 1, .latency = 2},
|
.uop[0] = {.type = UOP_LOAD, .throughput = 1, .latency = 2},
|
||||||
.uop[1] = {.type = UOP_ALU01, .throughput = 1, .latency = 1}};
|
.uop[1] = {.type = UOP_ALU01, .throughput = 1, .latency = 1}};
|
||||||
@@ -89,7 +89,7 @@ static const p6_instruction_t store_op = {.nr_uops = 2,
|
|||||||
|
|
||||||
static const p6_instruction_t bswap_op = {.nr_uops = 2,
|
static const p6_instruction_t bswap_op = {.nr_uops = 2,
|
||||||
.uop[0] = {.type = UOP_ALU0, .throughput = 1, .latency = 1},
|
.uop[0] = {.type = UOP_ALU0, .throughput = 1, .latency = 1},
|
||||||
.uop[0] = {.type = UOP_ALU01, .throughput = 1, .latency = 1}};
|
.uop[1] = {.type = UOP_ALU01, .throughput = 1, .latency = 1}};
|
||||||
static const p6_instruction_t leave_op = {.nr_uops = 3,
|
static const p6_instruction_t leave_op = {.nr_uops = 3,
|
||||||
.uop[0] = {.type = UOP_LOAD, .throughput = 1, .latency = 2},
|
.uop[0] = {.type = UOP_LOAD, .throughput = 1, .latency = 2},
|
||||||
.uop[1] = {.type = UOP_ALU01, .throughput = 1, .latency = 1},
|
.uop[1] = {.type = UOP_ALU01, .throughput = 1, .latency = 1},
|
||||||
@@ -349,18 +349,18 @@ static const p6_instruction_t div16_op = {.nr_uops = 3,
|
|||||||
.uop[2] = {.type = UOP_ALU01, .throughput = 1, .latency = 1}};
|
.uop[2] = {.type = UOP_ALU01, .throughput = 1, .latency = 1}};
|
||||||
static const p6_instruction_t div16_mem_op = {.nr_uops = 4,
|
static const p6_instruction_t div16_mem_op = {.nr_uops = 4,
|
||||||
.uop[0] = {.type = UOP_LOAD, .throughput = 1, .latency = 2},
|
.uop[0] = {.type = UOP_LOAD, .throughput = 1, .latency = 2},
|
||||||
.uop[0] = {.type = UOP_ALU0, .throughput = 21, .latency = 21},
|
.uop[1] = {.type = UOP_ALU0, .throughput = 21, .latency = 21},
|
||||||
.uop[1] = {.type = UOP_ALU0, .throughput = 1, .latency = 1},
|
.uop[2] = {.type = UOP_ALU0, .throughput = 1, .latency = 1},
|
||||||
.uop[2] = {.type = UOP_ALU01, .throughput = 1, .latency = 1}};
|
.uop[3] = {.type = UOP_ALU01, .throughput = 1, .latency = 1}};
|
||||||
static const p6_instruction_t div32_op = {.nr_uops = 3,
|
static const p6_instruction_t div32_op = {.nr_uops = 3,
|
||||||
.uop[0] = {.type = UOP_ALU0, .throughput = 35, .latency = 35},
|
.uop[0] = {.type = UOP_ALU0, .throughput = 35, .latency = 35},
|
||||||
.uop[1] = {.type = UOP_ALU0, .throughput = 1, .latency = 1},
|
.uop[1] = {.type = UOP_ALU0, .throughput = 1, .latency = 1},
|
||||||
.uop[2] = {.type = UOP_ALU01, .throughput = 1, .latency = 1}};
|
.uop[2] = {.type = UOP_ALU01, .throughput = 1, .latency = 1}};
|
||||||
static const p6_instruction_t div32_mem_op = {.nr_uops = 4,
|
static const p6_instruction_t div32_mem_op = {.nr_uops = 4,
|
||||||
.uop[0] = {.type = UOP_LOAD, .throughput = 1, .latency = 2},
|
.uop[0] = {.type = UOP_LOAD, .throughput = 1, .latency = 2},
|
||||||
.uop[0] = {.type = UOP_ALU0, .throughput = 35, .latency = 35},
|
.uop[1] = {.type = UOP_ALU0, .throughput = 35, .latency = 35},
|
||||||
.uop[1] = {.type = UOP_ALU0, .throughput = 1, .latency = 1},
|
.uop[2] = {.type = UOP_ALU0, .throughput = 1, .latency = 1},
|
||||||
.uop[2] = {.type = UOP_ALU01, .throughput = 1, .latency = 1}};
|
.uop[3] = {.type = UOP_ALU01, .throughput = 1, .latency = 1}};
|
||||||
static const p6_instruction_t emms_op = {.nr_uops = 11,
|
static const p6_instruction_t emms_op = {.nr_uops = 11,
|
||||||
.uop[0] = {.type = UOP_ALU0, .throughput = 1, .latency = 1},
|
.uop[0] = {.type = UOP_ALU0, .throughput = 1, .latency = 1},
|
||||||
.uop[1] = {.type = UOP_ALU0, .throughput = 1, .latency = 1},
|
.uop[1] = {.type = UOP_ALU0, .throughput = 1, .latency = 1},
|
||||||
@@ -393,7 +393,7 @@ static const p6_instruction_t ins_op = {.nr_uops = 4,
|
|||||||
.uop[0] = {.type = UOP_ALU0, .throughput = 18, .latency = 18},
|
.uop[0] = {.type = UOP_ALU0, .throughput = 18, .latency = 18},
|
||||||
.uop[1] = {.type = UOP_STOREADDR, .throughput = 1, .latency = 1},
|
.uop[1] = {.type = UOP_STOREADDR, .throughput = 1, .latency = 1},
|
||||||
.uop[2] = {.type = UOP_STOREDATA, .throughput = 1, .latency = 1},
|
.uop[2] = {.type = UOP_STOREDATA, .throughput = 1, .latency = 1},
|
||||||
.uop[2] = {.type = UOP_ALU01, .throughput = 1, .latency = 1}};
|
.uop[3] = {.type = UOP_ALU01, .throughput = 1, .latency = 1}};
|
||||||
static const p6_instruction_t int_op = {
|
static const p6_instruction_t int_op = {
|
||||||
.nr_uops = 7,
|
.nr_uops = 7,
|
||||||
.uop[0] = {.type = UOP_ALU0, .throughput = 20, .latency = 20},
|
.uop[0] = {.type = UOP_ALU0, .throughput = 20, .latency = 20},
|
||||||
|
@@ -251,7 +251,7 @@ void disc_stop(int drive) {
|
|||||||
drive ^= fdd_swap;
|
drive ^= fdd_swap;
|
||||||
|
|
||||||
if (drive < 2 && drives[drive].stop)
|
if (drive < 2 && drives[drive].stop)
|
||||||
drives[drive].stop(drive);
|
drives[drive].stop();
|
||||||
}
|
}
|
||||||
|
|
||||||
void disc_set_drivesel(int drive) {
|
void disc_set_drivesel(int drive) {
|
||||||
|
4
src/pc.c
4
src/pc.c
@@ -60,10 +60,10 @@
|
|||||||
#include "hdd.h"
|
#include "hdd.h"
|
||||||
#include "x86.h"
|
#include "x86.h"
|
||||||
#include "paths.h"
|
#include "paths.h"
|
||||||
|
#include "plugin.h"
|
||||||
|
|
||||||
#ifdef USE_NETWORKING
|
#ifdef USE_NETWORKING
|
||||||
#include "nethandler.h"
|
#include "nethandler.h"
|
||||||
#include "plugin.h"
|
|
||||||
#include "wx-utils.h"
|
#include "wx-utils.h"
|
||||||
#define NE2000 1
|
#define NE2000 1
|
||||||
uint8_t ethif;
|
uint8_t ethif;
|
||||||
@@ -369,7 +369,7 @@ void resetpchard() {
|
|||||||
network_card_init(network_card_current);
|
network_card_init(network_card_current);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
sound_card_init(sound_card_current);
|
sound_card_init();
|
||||||
if (GUS)
|
if (GUS)
|
||||||
device_add(&gus_device);
|
device_add(&gus_device);
|
||||||
if (GAMEBLASTER)
|
if (GAMEBLASTER)
|
||||||
|
@@ -149,8 +149,10 @@ static void tc8521_set_nvrram(uint8_t *nvrram, struct tm *cur_time_tm) {
|
|||||||
nvrram[TC8521_HOUR1] = cur_time_tm->tm_hour % 10;
|
nvrram[TC8521_HOUR1] = cur_time_tm->tm_hour % 10;
|
||||||
nvrram[TC8521_HOUR10] = cur_time_tm->tm_hour / 10;
|
nvrram[TC8521_HOUR10] = cur_time_tm->tm_hour / 10;
|
||||||
} else {
|
} else {
|
||||||
nvrram[TC8521_HOUR1] = (cur_time_tm->tm_hour % 12) % 10;
|
int hour12 = (cur_time_tm->tm_hour % 12);
|
||||||
nvrram[TC8521_HOUR10] = ((cur_time_tm->tm_hour % 12) / 10) | (cur_time_tm->tm_hour >= 12) ? 2 : 0;
|
if (hour12 == 0) hour12 = 12;
|
||||||
|
nvrram[TC8521_HOUR1] = hour12 % 10;
|
||||||
|
nvrram[TC8521_HOUR10] = hour12 / 10;
|
||||||
}
|
}
|
||||||
nvrram[TC8521_WEEKDAY] = cur_time_tm->tm_wday;
|
nvrram[TC8521_WEEKDAY] = cur_time_tm->tm_wday;
|
||||||
nvrram[TC8521_DAY1] = cur_time_tm->tm_mday % 10;
|
nvrram[TC8521_DAY1] = cur_time_tm->tm_mday % 10;
|
||||||
|
@@ -81,6 +81,7 @@ int sound_card_has_config(int card) {
|
|||||||
char *sound_card_get_internal_name(int card) {
|
char *sound_card_get_internal_name(int card) {
|
||||||
if (sound_cards[card] != NULL)
|
if (sound_cards[card] != NULL)
|
||||||
return sound_cards[card]->internal_name;
|
return sound_cards[card]->internal_name;
|
||||||
|
return "error-no-name";
|
||||||
}
|
}
|
||||||
|
|
||||||
int sound_card_get_from_internal_name(char *s) {
|
int sound_card_get_from_internal_name(char *s) {
|
||||||
|
@@ -106,7 +106,6 @@ static int treble_cut[6] = {
|
|||||||
(int)(0.354 * 16384) /*-3 dB - filter output is at +6 dB*/
|
(int)(0.354 * 16384) /*-3 dB - filter output is at +6 dB*/
|
||||||
};
|
};
|
||||||
|
|
||||||
void adgold_timer_poll();
|
|
||||||
void adgold_update(adgold_t *adgold);
|
void adgold_update(adgold_t *adgold);
|
||||||
|
|
||||||
void adgold_update_irq_status(adgold_t *adgold) {
|
void adgold_update_irq_status(adgold_t *adgold) {
|
||||||
|
@@ -140,7 +140,7 @@ typedef struct s3_t {
|
|||||||
#define INT_FIFO_EMP (1 << 3)
|
#define INT_FIFO_EMP (1 << 3)
|
||||||
#define INT_MASK 0xf
|
#define INT_MASK 0xf
|
||||||
|
|
||||||
void s3_updatemapping();
|
void s3_updatemapping(s3_t *s3);
|
||||||
|
|
||||||
void s3_accel_write(uint32_t addr, uint8_t val, void *p);
|
void s3_accel_write(uint32_t addr, uint8_t val, void *p);
|
||||||
void s3_accel_write_w(uint32_t addr, uint16_t val, void *p);
|
void s3_accel_write_w(uint32_t addr, uint16_t val, void *p);
|
||||||
|
@@ -16,6 +16,9 @@
|
|||||||
/*Very rough estimate*/
|
/*Very rough estimate*/
|
||||||
#define VID_CLOCK (double)(651 * 216 * 60)
|
#define VID_CLOCK (double)(651 * 216 * 60)
|
||||||
|
|
||||||
|
#define T1000_OUTPUT_DISPLAY_INTERNAL 1u
|
||||||
|
#define T1000_OUTPUT_DISPLAY_EXTERNAL 0u
|
||||||
|
#define T1000_OUTPUT_DISPLAY_UNSET 255u
|
||||||
/* Mapping of attributes to colours */
|
/* Mapping of attributes to colours */
|
||||||
static uint32_t blue, grey;
|
static uint32_t blue, grey;
|
||||||
static uint8_t boldcols[256]; /* Which attributes use the bold font */
|
static uint8_t boldcols[256]; /* Which attributes use the bold font */
|
||||||
@@ -31,7 +34,7 @@ static uint8_t language;
|
|||||||
*/
|
*/
|
||||||
static uint8_t st_video_options;
|
static uint8_t st_video_options;
|
||||||
static uint8_t st_enabled = 1;
|
static uint8_t st_enabled = 1;
|
||||||
static uint8_t st_display_internal = -1;
|
static uint8_t st_display_internal = T1000_OUTPUT_DISPLAY_UNSET;
|
||||||
|
|
||||||
void t1000_video_options_set(uint8_t options) {
|
void t1000_video_options_set(uint8_t options) {
|
||||||
st_video_options = options & 1;
|
st_video_options = options & 1;
|
||||||
@@ -385,7 +388,7 @@ static void t1000_poll(void *p) {
|
|||||||
mem_mapping_disable(&t1000->mapping);
|
mem_mapping_disable(&t1000->mapping);
|
||||||
}
|
}
|
||||||
/* Switch between internal plasma and external CRT display. */
|
/* Switch between internal plasma and external CRT display. */
|
||||||
if (st_display_internal != -1 && st_display_internal != t1000->internal) {
|
if (st_display_internal != T1000_OUTPUT_DISPLAY_UNSET && st_display_internal != t1000->internal) {
|
||||||
t1000->internal = st_display_internal;
|
t1000->internal = st_display_internal;
|
||||||
t1000_recalctimings(t1000);
|
t1000_recalctimings(t1000);
|
||||||
}
|
}
|
||||||
|
@@ -13,6 +13,10 @@
|
|||||||
#define T3100E_XSIZE 640
|
#define T3100E_XSIZE 640
|
||||||
#define T3100E_YSIZE 400
|
#define T3100E_YSIZE 400
|
||||||
|
|
||||||
|
#define T3100E_OUTPUT_DISPLAY_INTERNAL 1u
|
||||||
|
#define T3100E_OUTPUT_DISPLAY_EXTERNAL 0u
|
||||||
|
#define T3100E_OUTPUT_DISPLAY_UNSET 255u
|
||||||
|
|
||||||
/*Very rough estimate*/
|
/*Very rough estimate*/
|
||||||
#define VID_CLOCK (double)(651 * 416 * 60)
|
#define VID_CLOCK (double)(651 * 416 * 60)
|
||||||
|
|
||||||
@@ -45,7 +49,7 @@ static uint32_t normcols[256][2];
|
|||||||
* Bits 0,1: Font set (not currently implemented)
|
* Bits 0,1: Font set (not currently implemented)
|
||||||
*/
|
*/
|
||||||
static uint8_t st_video_options;
|
static uint8_t st_video_options;
|
||||||
static uint8_t st_display_internal = -1;
|
static uint8_t st_display_internal = T3100E_OUTPUT_DISPLAY_UNSET;
|
||||||
|
|
||||||
void t3100e_video_options_set(uint8_t options) { st_video_options = options; }
|
void t3100e_video_options_set(uint8_t options) { st_video_options = options; }
|
||||||
|
|
||||||
@@ -402,7 +406,7 @@ void t3100e_poll(void *p) {
|
|||||||
t3100e->cga.fontbase = (512 * (t3100e->video_options & 3)) + ((t3100e->video_options & 4) ? 256 : 0);
|
t3100e->cga.fontbase = (512 * (t3100e->video_options & 3)) + ((t3100e->video_options & 4) ? 256 : 0);
|
||||||
}
|
}
|
||||||
/* Switch between internal plasma and external CRT display. */
|
/* Switch between internal plasma and external CRT display. */
|
||||||
if (st_display_internal != -1 && st_display_internal != t3100e->internal) {
|
if (st_display_internal != T3100E_OUTPUT_DISPLAY_UNSET && st_display_internal != t3100e->internal) {
|
||||||
t3100e->internal = st_display_internal;
|
t3100e->internal = st_display_internal;
|
||||||
t3100e_recalctimings(t3100e);
|
t3100e_recalctimings(t3100e);
|
||||||
}
|
}
|
||||||
|
@@ -555,7 +555,7 @@ int window_create() {
|
|||||||
info.cch = 256;
|
info.cch = 256;
|
||||||
info.dwTypeData = label;
|
info.dwTypeData = label;
|
||||||
if (GetMenuItemInfo(native_menu, i, 1, &info))
|
if (GetMenuItemInfo(native_menu, i, 1, &info))
|
||||||
AppendMenu(menu, MF_STRING | MF_POPUP, (UINT)GetSubMenu(native_menu, i), info.dwTypeData);
|
AppendMenu(menu, MF_STRING | MF_POPUP, (UINT_PTR)GetSubMenu(native_menu, i), info.dwTypeData);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* The class is registered, let's create the program*/
|
/* The class is registered, let's create the program*/
|
||||||
|
@@ -138,18 +138,20 @@ void StatusPane::Render(wxDC &dc) {
|
|||||||
if (emulation_state != EMULATION_STOPPED) {
|
if (emulation_state != EMULATION_STOPPED) {
|
||||||
// draw status text
|
// draw status text
|
||||||
if (show_status) {
|
if (show_status) {
|
||||||
|
char charMac = statusMachineText[0];
|
||||||
|
char charDev = statusDeviceText[0];
|
||||||
if (updatestatus) {
|
if (updatestatus) {
|
||||||
updatestatus = 0;
|
updatestatus = 0;
|
||||||
get_status(statusMachineText, statusDeviceText);
|
get_status(statusMachineText, statusDeviceText);
|
||||||
}
|
}
|
||||||
if (statusMachineText) {
|
if (charMac != 0 || statusMachineText[0] != charMac) {
|
||||||
int statusX = 5;
|
int statusX = 5;
|
||||||
int statusY = height + 5;
|
int statusY = height + 5;
|
||||||
wxSize size = dc.GetMultiLineTextExtent(statusMachineText);
|
wxSize size = dc.GetMultiLineTextExtent(statusMachineText);
|
||||||
dc.DrawText(statusMachineText, statusX, statusY);
|
dc.DrawText(statusMachineText, statusX, statusY);
|
||||||
width = MAX(width, statusX + size.GetWidth());
|
width = MAX(width, statusX + size.GetWidth());
|
||||||
height = MAX(height, statusY + size.GetHeight());
|
height = MAX(height, statusY + size.GetHeight());
|
||||||
if (statusDeviceText) {
|
if (charDev != 0 || statusDeviceText[0] != charDev) {
|
||||||
wxSize dSize = dc.GetMultiLineTextExtent(statusDeviceText);
|
wxSize dSize = dc.GetMultiLineTextExtent(statusDeviceText);
|
||||||
dc.DrawText(statusDeviceText, statusX + ceil((size.GetWidth() + 50) / 100.0) * 100,
|
dc.DrawText(statusDeviceText, statusX + ceil((size.GetWidth() + 50) / 100.0) * 100,
|
||||||
statusY);
|
statusY);
|
||||||
|
Reference in New Issue
Block a user