Added experimental NVidia Riva TNT2 emulation (patch from MoochMcGee); ASUS P/I-P54TP4XE, ASUS P/I-P55T2P4, and ASUS P/I-P55TVP4 are back; National Semiconductor PC87306 Super I/O chip now correctly reenables devices after a chip power cycle; Several FDC improvements and the behavior is now a bit closer to real hardware (based on actual tests); Added MR Intel Advanced/ATX with Microid Research BIOS with support for 4 floppy drives and up to 4 IDE controllers; Added floppy drives 3 and 4, bringing the maximum to 4; You can now connect hard disks to the tertiary IDE controller; Correct undocumented behavior of the LEA instruction with register is back on 286 and later CPU's; Pentium-rea models with Intel chipsets now have port 92 (with alternate reset and alternate A20 toggle); Overhauled DMA channel read and write routines and fixed cascading; Improved IMG detection of a bad BPB (or complete lack of a BPB); Added preliminary emulation of PS/2 1.44 MB and PC-98 1.25 MB 3-mode drives (both have an inverted DENSEL pin); Removed the incorrect Amstrad mouse patch from TheCollector1995; Fixed ATAPI CD-ROM disk change detection; Windows IOCTL CD-ROM handler now tries to use direct SCSI passthrough for more things, including obtaining CD-ROM capacity; The Diamond Stealth32 (ET4000/W32p) now also works correctly on the two Award SiS 496/497 boxes; The (S)VGA handler now converts 6-bit RAMDAC RGB channels to standard 8-bit RGB using a lookup table generated at emulator start, calculated using the correct intensity conversion method and treating intensity 64 as equivalent to 63; Moved a few options from the Configuration dialog box to the menu; SIO, PIIX, and PIIX3 now have the reset control register on port CF9 as they should; Several bugfixes.
165 lines
3.6 KiB
C
165 lines
3.6 KiB
C
/* Copyright holders: Sarah Walker, Tenshi, leilei
|
|
see COPYING for more details
|
|
*/
|
|
#ifndef _CPU_H_
|
|
#define _CPU_H_
|
|
|
|
extern int cpu, cpu_manufacturer;
|
|
|
|
/*808x class CPUs*/
|
|
#define CPU_8088 0
|
|
#define CPU_8086 1
|
|
|
|
/*286 class CPUs*/
|
|
#define CPU_286 2
|
|
|
|
/*386 class CPUs*/
|
|
#define CPU_386SX 3
|
|
#define CPU_386DX 4
|
|
#define CPU_RAPIDCAD 5
|
|
#define CPU_486SLC 6
|
|
#define CPU_486DLC 7
|
|
|
|
/*486 class CPUs*/
|
|
#define CPU_i486SX 8
|
|
#define CPU_Am486SX 9
|
|
#define CPU_Cx486S 10
|
|
#define CPU_i486DX 11
|
|
#define CPU_Am486DX 12
|
|
#define CPU_Cx486DX 13
|
|
#define CPU_Cx5x86 14
|
|
|
|
/*586 class CPUs*/
|
|
#define CPU_WINCHIP 15
|
|
#define CPU_PENTIUM 16
|
|
#define CPU_PENTIUMMMX 17
|
|
#define CPU_Cx6x86 18
|
|
#define CPU_Cx6x86MX 19
|
|
#define CPU_Cx6x86L 20
|
|
#define CPU_CxGX1 21
|
|
#define CPU_K5 22
|
|
#define CPU_5K86 23
|
|
#define CPU_K6 24
|
|
|
|
/*686 class CPUs*/
|
|
#define CPU_PENTIUMPRO 25
|
|
/*
|
|
#define CPU_PENTIUM2 26
|
|
#define CPU_PENTIUM2D 27 */
|
|
#define CPU_PENTIUM2D 26
|
|
|
|
#define MANU_INTEL 0
|
|
#define MANU_AMD 1
|
|
#define MANU_CYRIX 2
|
|
#define MANU_IDT 3
|
|
|
|
extern int timing_rr;
|
|
extern int timing_mr, timing_mrl;
|
|
extern int timing_rm, timing_rml;
|
|
extern int timing_mm, timing_mml;
|
|
extern int timing_bt, timing_bnt;
|
|
|
|
extern int timing_int, timing_int_rm, timing_int_v86, timing_int_pm, timing_int_pm_outer;
|
|
extern int timing_iret_rm, timing_iret_v86, timing_iret_pm, timing_iret_pm_outer;
|
|
extern int timing_call_rm, timing_call_pm, timing_call_pm_gate, timing_call_pm_gate_inner;
|
|
extern int timing_retf_rm, timing_retf_pm, timing_retf_pm_outer;
|
|
extern int timing_jmp_rm, timing_jmp_pm, timing_jmp_pm_gate;
|
|
|
|
|
|
typedef struct
|
|
{
|
|
char name[32];
|
|
int cpu_type;
|
|
int speed;
|
|
int rspeed;
|
|
int multi;
|
|
int pci_speed;
|
|
uint32_t edx_reset;
|
|
uint32_t cpuid_model;
|
|
uint16_t cyrix_id;
|
|
int cpu_flags;
|
|
int mem_read_cycles, mem_write_cycles;
|
|
int cache_read_cycles, cache_write_cycles;
|
|
} CPU;
|
|
|
|
extern CPU cpus_8088[];
|
|
extern CPU cpus_8086[];
|
|
extern CPU cpus_286[];
|
|
extern CPU cpus_i386[];
|
|
extern CPU cpus_i386DX[];
|
|
extern CPU cpus_Am386[];
|
|
extern CPU cpus_Am386DX[];
|
|
extern CPU cpus_486SDLC[];
|
|
extern CPU cpus_486DLC[];
|
|
extern CPU cpus_i486[];
|
|
extern CPU cpus_Am486[];
|
|
extern CPU cpus_Cx486[];
|
|
extern CPU cpus_WinChip[];
|
|
extern CPU cpus_Pentium5V[];
|
|
extern CPU cpus_Pentium5V50[];
|
|
extern CPU cpus_PentiumS5[];
|
|
extern CPU cpus_K5[];
|
|
extern CPU cpus_K56[];
|
|
extern CPU cpus_Pentium[];
|
|
extern CPU cpus_6x86[];
|
|
extern CPU cpus_PentiumPro[];
|
|
extern CPU cpus_Pentium2[];
|
|
extern CPU cpus_Pentium2D[];
|
|
|
|
extern CPU cpus_pcjr[];
|
|
extern CPU cpus_pc1512[];
|
|
extern CPU cpus_ibmat[];
|
|
extern CPU cpus_ps1_m2011[];
|
|
extern CPU cpus_acer[];
|
|
|
|
extern int cpu_iscyrix;
|
|
extern int cpu_16bitbus;
|
|
extern int cpu_busspeed;
|
|
extern int cpu_multi;
|
|
|
|
extern int cpu_hasrdtsc;
|
|
extern int cpu_hasMSR;
|
|
extern int cpu_hasMMX;
|
|
extern int cpu_hasCR4;
|
|
|
|
#define CR4_TSD (1 << 2)
|
|
#define CR4_DE (1 << 3)
|
|
#define CR4_MCE (1 << 6)
|
|
#define CR4_PCE (1 << 8)
|
|
#define CR4_OSFXSR (1 << 9)
|
|
|
|
extern uint64_t cpu_CR4_mask;
|
|
|
|
#define CPU_SUPPORTS_DYNAREC 1
|
|
#define CPU_REQUIRES_DYNAREC 2
|
|
// #define CPU_REQUIRES_DYNAREC 0
|
|
|
|
extern int cpu_cycles_read, cpu_cycles_read_l, cpu_cycles_write, cpu_cycles_write_l;
|
|
extern int cpu_prefetch_cycles, cpu_prefetch_width;
|
|
extern int cpu_waitstates;
|
|
extern int cpu_cache_int_enabled, cpu_cache_ext_enabled;
|
|
|
|
extern uint64_t tsc;
|
|
|
|
void cyrix_write(uint16_t addr, uint8_t val, void *priv);
|
|
uint8_t cyrix_read(uint16_t addr, void *priv);
|
|
|
|
extern int is8086;
|
|
|
|
void cpu_CPUID();
|
|
|
|
void cpu_RDMSR();
|
|
void cpu_WRMSR();
|
|
|
|
extern int cpu_use_dynarec;
|
|
|
|
extern int xt_cpu_multi;
|
|
|
|
#define ISA_CYCLES_SHIFT 6
|
|
extern int isa_cycles;
|
|
#define ISA_CYCLES(x) ((x * isa_cycles) >> ISA_CYCLES_SHIFT)
|
|
|
|
void cpu_update_waitstates();
|
|
|
|
#endif
|