More bits of missed formatting

This commit is contained in:
Jasmine Iwanek
2022-12-20 19:25:51 -05:00
parent df553aa200
commit 537fbad564
14 changed files with 213 additions and 196 deletions

View File

@@ -17,8 +17,8 @@
* Copyright 2008-2020 Sarah Walker. * Copyright 2008-2020 Sarah Walker.
* Copyright 2016-2020 Miran Grca. * Copyright 2016-2020 Miran Grca.
* Copyright 2017-2020 Fred N. van Kempen. * Copyright 2017-2020 Fred N. van Kempen.
* Copyright 2021 Laci bá' * Copyright 2021 Laci bá'
* Copyright 2021 dob205 * Copyright 2021 dob205
*/ */
#include <inttypes.h> #include <inttypes.h>
#include <stdarg.h> #include <stdarg.h>

View File

@@ -667,14 +667,16 @@ ropFCHS(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, codeb
return op_pc; \ return op_pc; \
} }
// clang-format off
opFLDimm(1, 1.0) opFLDimm(1, 1.0)
opFLDimm(L2T, 3.3219280948873623) opFLDimm(L2T, 3.3219280948873623)
opFLDimm(L2E, 1.4426950408889634); opFLDimm(L2E, 1.4426950408889634);
opFLDimm(PI, 3.141592653589793); opFLDimm(PI, 3.141592653589793);
opFLDimm(EG2, 0.3010299956639812); opFLDimm(EG2, 0.3010299956639812);
opFLDimm(Z, 0.0) opFLDimm(Z, 0.0)
// clang-format on
static uint32_t ropFLDLN2(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, codeblock_t *block) static uint32_t ropFLDLN2(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, codeblock_t *block)
{ {
FP_ENTER(); FP_ENTER();
FP_LOAD_IMM_Q(0x3fe62e42fefa39f0ull); FP_LOAD_IMM_Q(0x3fe62e42fefa39f0ull);

View File

@@ -485,48 +485,51 @@ codegen_flush(void)
return; return;
} }
// clang-format off
static int opcode_modrm[256] = { static int opcode_modrm[256] = {
1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, /*00*/ 1, 1, 1, 1, 0, 0, 0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 0, 0, /*c0*/
0, 1, 1, 1, 0, 1, 0, 0, 1, 1, 0, 1, 1, 1, 0, 1, /*d0*/ 0, 1, 1, 1, 0, 1, 0, 0, 1, 1, 0, 1, 1, 1, 0, 1, /*d0*/
0, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1, 1, 1, 0, 1, /*e0*/ 0, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1, 1, 1, 0, 1, /*e0*/
0, 1, 1, 1, 0, 1, 0, 0, 1, 1, 1, 0, 1, 1, 1, 0 /*f0*/ 0, 1, 1, 1, 0, 1, 0, 0, 1, 1, 1, 0, 1, 1, 1, 0 /*f0*/
}; };
// clang-format off
void void
codegen_debug(void) codegen_debug(void)

View File

@@ -1627,48 +1627,51 @@ codegen_flush(void)
return; return;
} }
// clang-format off
static int opcode_modrm[256] = { static int opcode_modrm[256] = {
1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, /*00*/ 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, /*00*/
1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, /*10*/ 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, /*10*/
1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, /*20*/ 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, /*20*/
1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, /*30*/ 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, /*30*/
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /*40*/ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /*40*/
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /*80*/ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /*80*/
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /*90*/ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /*90*/
0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, /*a0*/ 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, /*a0*/
1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, /*b0*/ 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, /*b0*/
1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, /*c0*/ 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, /*c0*/
0, 1, 1, 1, 0, 1, 0, 0, 1, 1, 0, 1, 1, 1, 0, 1, /*d0*/ 0, 1, 1, 1, 0, 1, 0, 0, 1, 1, 0, 1, 1, 1, 0, 1, /*d0*/
0, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1, 1, 1, 0, 1, /*e0*/ 0, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1, 1, 1, 0, 1, /*e0*/
0, 1, 1, 1, 0, 1, 0, 0, 1, 1, 1, 0, 1, 1, 1, 0 /*f0*/ 0, 1, 1, 1, 0, 1, 0, 0, 1, 1, 1, 0, 1, 1, 1, 0 /*f0*/
}; };
// clang-format on
void void
codegen_debug(void) codegen_debug(void)

View File

@@ -322,48 +322,51 @@ codegen_generate_ea(ir_data_t *ir, x86seg *op_ea_seg, uint32_t fetchdat, int op_
return codegen_generate_ea_16_long(ir, op_ea_seg, fetchdat, op_ssegs, op_pc); return codegen_generate_ea_16_long(ir, op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b0*/ 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, /*b0*/
1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, /*c0*/ 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, /*c0*/
0, 1, 1, 1, 0, 1, 0, 0, 1, 1, 0, 1, 1, 1, 0, 1, /*d0*/ 0, 1, 1, 1, 0, 1, 0, 0, 1, 1, 0, 1, 1, 1, 0, 1, /*d0*/
0, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1, 1, 1, 0, 1, /*e0*/ 0, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1, 1, 1, 0, 1, /*e0*/
0, 1, 1, 1, 0, 1, 0, 0, 1, 1, 1, 0, 1, 1, 1, 0 /*f0*/ 0, 1, 1, 1, 0, 1, 0, 0, 1, 1, 1, 0, 1, 1, 1, 0 /*f0*/
}; };
// clang-format on
void void
codegen_generate_call(uint8_t opcode, OpFn op, uint32_t fetchdat, uint32_t new_pc, uint32_t old_pc) codegen_generate_call(uint8_t opcode, OpFn op, uint32_t fetchdat, uint32_t new_pc, uint32_t old_pc)

View File

@@ -37,16 +37,18 @@
return op_pc + 2; \ return op_pc + 2; \
} }
// clang-format off
ropParith(PFADD) ropParith(PFADD)
ropParith(PFCMPEQ) ropParith(PFCMPEQ)
ropParith(PFCMPGE) ropParith(PFCMPGE)
ropParith(PFCMPGT) ropParith(PFCMPGT)
ropParith(PFMAX) ropParith(PFMAX)
ropParith(PFMIN) ropParith(PFMIN)
ropParith(PFMUL) ropParith(PFMUL)
ropParith(PFSUB) ropParith(PFSUB)
// clang-format on
uint32_t ropPF2ID(codeblock_t *block, ir_data_t *ir, uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc) uint32_t ropPF2ID(codeblock_t *block, ir_data_t *ir, uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc)
{ {
int dest_reg = (fetchdat >> 3) & 7; int dest_reg = (fetchdat >> 3) & 7;

View File

@@ -423,8 +423,10 @@ ropFUCOMPP(codeblock_t *block, ir_data_t *ir, uint8_t opcode, uint32_t fetchdat,
return op_pc + 1; \ return op_pc + 1; \
} }
// clang-format off
ropF_arith_mem(s, uop_MEM_LOAD_SINGLE) ropF_arith_mem(s, uop_MEM_LOAD_SINGLE)
ropF_arith_mem(d, uop_MEM_LOAD_DOUBLE) ropF_arith_mem(d, uop_MEM_LOAD_DOUBLE)
// clang-format on
#define ropFI_arith_mem(name, temp_reg) \ #define ropFI_arith_mem(name, temp_reg) \
uint32_t ropFIADD##name(codeblock_t *block, ir_data_t *ir, uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc) \ uint32_t ropFIADD##name(codeblock_t *block, ir_data_t *ir, uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc) \

View File

@@ -1170,7 +1170,7 @@ cpu_set(void)
#endif #endif
if ((cpu_s->cpu_type == CPU_K6_2P) || (cpu_s->cpu_type == CPU_K6_3P)) { if ((cpu_s->cpu_type == CPU_K6_2P) || (cpu_s->cpu_type == CPU_K6_3P)) {
x86_opcodes_3DNOW = ops_3DNOWE; x86_opcodes_3DNOW = ops_3DNOWE;
#ifdef USE_DYNAREC #ifdef USE_DYNAREC
x86_dynarec_opcodes_3DNOW = dynarec_ops_3DNOWE; x86_dynarec_opcodes_3DNOW = dynarec_ops_3DNOWE;
#endif #endif

View File

@@ -125,25 +125,27 @@
return 0; \ return 0; \
} }
// clang-format off
opFPU(s, x87_ts, 16, t.i, geteal, t.s, _32) opFPU(s, x87_ts, 16, t.i, geteal, t.s, _32)
#ifndef FPU_8087 #ifndef FPU_8087
opFPU(s, x87_ts, 32, t.i, geteal, t.s, _32) opFPU(s, x87_ts, 32, t.i, geteal, t.s, _32)
#endif #endif
opFPU(d, x87_td, 16, t.i, geteaq, t.d, _64) opFPU(d, x87_td, 16, t.i, geteaq, t.d, _64)
#ifndef FPU_8087 #ifndef FPU_8087
opFPU(d, x87_td, 32, t.i, geteaq, t.d, _64) opFPU(d, x87_td, 32, t.i, geteaq, t.d, _64)
#endif #endif
opFPU(iw, uint16_t, 16, t, geteaw, (double) (int16_t) t, _i16) opFPU(iw, uint16_t, 16, t, geteaw, (double) (int16_t) t, _i16)
#ifndef FPU_8087 #ifndef FPU_8087
opFPU(iw, uint16_t, 32, t, geteaw, (double) (int16_t) t, _i16) opFPU(iw, uint16_t, 32, t, geteaw, (double) (int16_t) t, _i16)
#endif #endif
opFPU(il, uint32_t, 16, t, geteal, (double) (int32_t) t, _i32) opFPU(il, uint32_t, 16, t, geteal, (double) (int32_t) t, _i32)
#ifndef FPU_8087 #ifndef FPU_8087
opFPU(il, uint32_t, 32, t, geteal, (double) (int32_t) t, _i32) opFPU(il, uint32_t, 32, t, geteal, (double) (int32_t) t, _i32)
#endif #endif
// clang-format on
static int opFADD(uint32_t fetchdat) static int opFADD(uint32_t fetchdat)
{ {
FP_ENTER(); FP_ENTER();
cpu_state.pc++; cpu_state.pc++;

View File

@@ -28,109 +28,109 @@ extern "C" {
#if 0 #if 0
typedef struct { typedef struct {
uint8_t id, uint8_t id,
uint8_t bus_type, /* Bus type: IDE, SCSI, etc. */ uint8_t bus_type, /* Bus type: IDE, SCSI, etc. */
bus, :4, /* ID of the bus (for example, for IDE, bus, : 4, /* ID of the bus (for example, for IDE,
0 = primary, 1 = secondary, etc. */ 0 = primary, 1 = secondary, etc. */
bus_id, :4, /* ID of the device on the bus */ bus_id, : 4, /* ID of the device on the bus */
uint8_t type, /* Type flags, interpretation depends uint8_t type, /* Type flags, interpretation depends
on the device */ on the device */
uint8_t is_image; /* This is only used for CD-ROM: uint8_t is_image; /* This is only used for CD-ROM:
0 = Image; 0 = Image;
1 = Host drive */ 1 = Host drive */
wchar_t path[1024]; /* Name of current image file or wchar_t path[1024]; /* Name of current image file or
host drive */ host drive */
uint32_t spt, /* Physical geometry parameters */ uint32_t spt, /* Physical geometry parameters */
hpc, hpc,
tracks; tracks;
} storage_cfg_t; } storage_cfg_t;
typedef struct { typedef struct {
/* General configuration */ /* General configuration */
int vid_resize, /* Window is resizable or not */ int vid_resize, /* Window is resizable or not */
vid_renderer, /* Renderer */ vid_renderer, /* Renderer */
vid_fullscreen_scale, /* Full screen scale type */ vid_fullscreen_scale, /* Full screen scale type */
vid_fullscreen_start, /* Start emulator in full screen */ vid_fullscreen_start, /* Start emulator in full screen */
vid_force_43, /* Force 4:3 display ratio in windowed mode */ vid_force_43, /* Force 4:3 display ratio in windowed mode */
vid_scale, /* Windowed mode scale */ vid_scale, /* Windowed mode scale */
vid_overscan, /* EGA/(S)VGA overscan enabled */ vid_overscan, /* EGA/(S)VGA overscan enabled */
vid_cga_contrast, /* CGA alternate contrast enabled */ vid_cga_contrast, /* CGA alternate contrast enabled */
vid_grayscale, /* Video is grayscale */ vid_grayscale, /* Video is grayscale */
vid_grayscale_type, /* Video grayscale type */ vid_grayscale_type, /* Video grayscale type */
vid_invert_display, /* Invert display */ vid_invert_display, /* Invert display */
rctrl_is_lalt, /* Right CTRL is left ALT */ rctrl_is_lalt, /* Right CTRL is left ALT */
update_icons, /* Update status bar icons */ update_icons, /* Update status bar icons */
window_remember, /* Remember window position and size */ window_remember, /* Remember window position and size */
window_w, /* Window coordinates */ window_w, /* Window coordinates */
window_h, window_h,
window_x, window_x,
window_y, window_y,
sound_gain; /* Sound gain */ sound_gain; /* Sound gain */
# ifdef USE_LANGUAGE # ifdef USE_LANGUAGE
uint16_t language_id; /* Language ID (0x0409 = English (US)) */ uint16_t language_id; /* Language ID (0x0409 = English (US)) */
# endif # endif
/* Machine cateogory */ /* Machine cateogory */
int machine, /* Machine */ int machine, /* Machine */
cpu, /* CPU */ cpu, /* CPU */
# ifdef USE_DYNAREC # ifdef USE_DYNAREC
cpu_use_dynarec, /* CPU recompiler enabled */ cpu_use_dynarec, /* CPU recompiler enabled */
# endif # endif
wait_states, /* CPU wait states */ wait_states, /* CPU wait states */
enable_external_fpu, /* FPU enabled */ enable_external_fpu, /* FPU enabled */
time_sync; /* Time sync enabled */ time_sync; /* Time sync enabled */
uint32_t mem_size; /* Memory size */ uint32_t mem_size; /* Memory size */
/* Video category */ /* Video category */
int video_card, /* Video card */ int video_card, /* Video card */
voodoo_enabled; /* Voodoo enabled */ voodoo_enabled; /* Voodoo enabled */
/* Input devices category */ /* Input devices category */
int mouse_type, /* Mouse type */ int mouse_type, /* Mouse type */
joystick_type; /* Joystick type */ joystick_type; /* Joystick type */
/* Sound category */ /* Sound category */
int sound_card, /* Sound card */ int sound_card, /* Sound card */
midi_device, /* Midi device */ midi_device, /* Midi device */
mpu_401, /* Standalone MPU-401 enabled */ mpu_401, /* Standalone MPU-401 enabled */
ssi_2001_enabled, /* SSI-2001 enabled */ ssi_2001_enabled, /* SSI-2001 enabled */
game_blaster_enabled, /* Game blaster enabled */ game_blaster_enabled, /* Game blaster enabled */
gus_enabled, /* Gravis Ultrasound enabled */ gus_enabled, /* Gravis Ultrasound enabled */
opl_type, /* OPL emulation type */ opl_type, /* OPL emulation type */
sound_is_float; /* Sound is 32-bit float or 16-bit integer */ sound_is_float; /* Sound is 32-bit float or 16-bit integer */
/* Network category */ /* Network category */
int network_type, /* Network type (SLiRP or PCap) */ int network_type, /* Network type (SLiRP or PCap) */
network_card; /* Network card */ network_card; /* Network card */
char network_host[520]; /* PCap device */ char network_host[520]; /* PCap device */
/* Ports category */ /* Ports category */
char parallel_devices[PARALLEL_MAX][32]; /* LPT device names */ char parallel_devices[PARALLEL_MAX][32]; /* LPT device names */
# ifdef USE_SERIAL_DEVICES # ifdef USE_SERIAL_DEVICES
char serial_devices[SERIAL_MAX][32]; /* Serial device names */ char serial_devices[SERIAL_MAX][32]; /* Serial device names */
# endif # endif
/* Other peripherals category */ /* Other peripherals category */
int fdc_type, /* Floppy disk controller type */ int fdc_type, /* Floppy disk controller type */
hdc, /* Hard disk controller */ hdc, /* Hard disk controller */
scsi_card, /* SCSI controller */ scsi_card, /* SCSI controller */
ide_ter_enabled, /* Tertiary IDE controller enabled */ ide_ter_enabled, /* Tertiary IDE controller enabled */
ide_qua_enabled, /* Quaternary IDE controller enabled */ ide_qua_enabled, /* Quaternary IDE controller enabled */
bugger_enabled, /* ISA bugger device enabled */ bugger_enabled, /* ISA bugger device enabled */
isa_rtc_type, /* ISA RTC card */ isa_rtc_type, /* ISA RTC card */
isa_mem_type[ISAMEM_MAX]; /* ISA memory boards */ isa_mem_type[ISAMEM_MAX]; /* ISA memory boards */
/* Hard disks category */ /* Hard disks category */
storage_cfg_t hdd[HDD_NUM]; /* Hard disk drives */ storage_cfg_t hdd[HDD_NUM]; /* Hard disk drives */
/* Floppy drives category */ /* Floppy drives category */
storage_cfg_t fdd[FDD_NUM]; /* Floppy drives */ storage_cfg_t fdd[FDD_NUM]; /* Floppy drives */
/* Other removable devices category */ /* Other removable devices category */
storage_cfg_t cdrom[CDROM_NUM], /* CD-ROM drives */ storage_cfg_t cdrom[CDROM_NUM], /* CD-ROM drives */
storage_cfg_t rdisk[ZIP_NUM]; /* Removable disk drives */ storage_cfg_t rdisk[ZIP_NUM]; /* Removable disk drives */
} config_t; } config_t;
#endif #endif

View File

@@ -548,7 +548,7 @@ NewFloppyDialog::createZipSectorImage(const QString &filename, const disk_size_t
empty[0x5003] = empty[0x1D003] = 0xFF; empty[0x5003] = empty[0x1D003] = 0xFF;
/* Root directory = 0x35000 /* Root directory = 0x35000
Data = 0x39000 */ Data = 0x39000 */
} else { } else {
/* ZIP 250 */ /* ZIP 250 */
/* MBR */ /* MBR */
@@ -570,7 +570,7 @@ NewFloppyDialog::createZipSectorImage(const QString &filename, const disk_size_t
memset(&(empty[0x0200]), 0x48, 0x3E00); memset(&(empty[0x0200]), 0x48, 0x3E00);
/* The second sector begins with some strange data /* The second sector begins with some strange data
in my reference image. */ in my reference image. */
*(uint64_t *) &(empty[0x0200]) = 0x3831393230334409LL; *(uint64_t *) &(empty[0x0200]) = 0x3831393230334409LL;
*(uint64_t *) &(empty[0x0208]) = 0x6A57766964483130LL; *(uint64_t *) &(empty[0x0208]) = 0x6A57766964483130LL;
*(uint64_t *) &(empty[0x0210]) = 0x3C3A34676063653FLL; *(uint64_t *) &(empty[0x0210]) = 0x3C3A34676063653FLL;
@@ -619,7 +619,7 @@ NewFloppyDialog::createZipSectorImage(const QString &filename, const disk_size_t
empty[0x4203] = empty[0x22003] = 0xFF; empty[0x4203] = empty[0x22003] = 0xFF;
/* Root directory = 0x3FE00 /* Root directory = 0x3FE00
Data = 0x38200 */ Data = 0x38200 */
} }
pbar.setMaximum(pbar_max); pbar.setMaximum(pbar_max);

View File

@@ -11,8 +11,8 @@
# Authors: Cacodemon345 # Authors: Cacodemon345
# David Hrdlička, <hrdlickadavid@outlook.com> # David Hrdlička, <hrdlickadavid@outlook.com>
# #
# Copyright 2021 Cacodemon345. # Copyright 2021 Cacodemon345.
# Copyright 2021 David Hrdlička. # Copyright 2021 David Hrdlička.
# #
add_library(plat OBJECT unix.c) add_library(plat OBJECT unix.c)

View File

@@ -10,7 +10,7 @@
# #
# Authors: David Hrdlička, <hrdlickadavid@outlook.com> # Authors: David Hrdlička, <hrdlickadavid@outlook.com>
# #
# Copyright 2020,2021 David Hrdlička. # Copyright 2020-2021 David Hrdlička.
# #
enable_language(RC) enable_language(RC)