structure, lower-casing functions and re-inclusion updates of the src\emu\cpu headers J - M.

This commit is contained in:
Derrick Renaud 2008-08-12 03:40:09 +00:00
parent 7e7e4ef30f
commit d5d5d9449b
59 changed files with 297 additions and 138 deletions

View File

@ -432,7 +432,7 @@ static void jaguar_state_register(int index, const char *type)
static void jaguargpu_init(int index, int clock, const void *_config, int (*irqcallback)(int)) static void jaguargpu_init(int index, int clock, const void *_config, int (*irqcallback)(int))
{ {
const struct jaguar_config *config = _config; const jaguar_cpu_core *config = _config;
memset(&jaguar, 0, sizeof(jaguar)); memset(&jaguar, 0, sizeof(jaguar));
@ -445,7 +445,7 @@ static void jaguargpu_init(int index, int clock, const void *_config, int (*irqc
static void jaguardsp_init(int index, int clock, const void *_config, int (*irqcallback)(int)) static void jaguardsp_init(int index, int clock, const void *_config, int (*irqcallback)(int))
{ {
const struct jaguar_config *config = _config; const jaguar_cpu_core *config = _config;
memset(&jaguar, 0, sizeof(jaguar)); memset(&jaguar, 0, sizeof(jaguar));

View File

@ -6,8 +6,10 @@
***************************************************************************/ ***************************************************************************/
#ifndef _JAGUAR_H #pragma once
#define _JAGUAR_H
#ifndef __JAGUAR_H__
#define __JAGUAR_H__
#include "cpuintrf.h" #include "cpuintrf.h"
@ -73,7 +75,8 @@ enum
CONFIGURATION STRUCTURE CONFIGURATION STRUCTURE
***************************************************************************/ ***************************************************************************/
struct jaguar_config typedef struct _jaguar_cpu_core jaguar_cpu_core;
struct _jaguar_cpu_core
{ {
void (*cpu_int_callback)(void); void (*cpu_int_callback)(void);
}; };
@ -104,4 +107,4 @@ extern void jaguardsp_ctrl_w(int cpunum, offs_t offset, UINT32 data, UINT32 mem_
extern UINT32 jaguardsp_ctrl_r(int cpunum, offs_t offset); extern UINT32 jaguardsp_ctrl_r(int cpunum, offs_t offset);
#endif /* _JAGUAR_H */ #endif /* __JAGUAR_H__ */

View File

@ -1,7 +1,9 @@
/*** konami: Portable Konami cpu emulator ******************************************/ /*** konami: Portable Konami cpu emulator ******************************************/
#ifndef _KONAMI_H #pragma once
#define _KONAMI_H
#ifndef __KONAMI_H__
#define __KONAMI_H__
#include "cpuintrf.h" #include "cpuintrf.h"
@ -53,4 +55,4 @@ void konami_get_info(UINT32 state, cpuinfo *info);
offs_t konami_dasm(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram); offs_t konami_dasm(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram);
#endif /* _KONAMI_H */ #endif /* __KONAMI_H__ */

View File

@ -45,7 +45,7 @@ enum {
typedef struct typedef struct
{ {
const LH5801_CONFIG *config; const lh5801_cpu_core *config;
PAIR s, p, u, x, y; PAIR s, p, u, x, y;
int tm; //9 bit int tm; //9 bit
@ -91,7 +91,7 @@ static LH5801_Regs lh5801= { 0 };
static void lh5801_init(int cpu, int clock, const void *config, int (*irqcallback)(int)) static void lh5801_init(int cpu, int clock, const void *config, int (*irqcallback)(int))
{ {
memset(&lh5801, 0, sizeof(lh5801)); memset(&lh5801, 0, sizeof(lh5801));
lh5801.config = (const LH5801_CONFIG *) config; lh5801.config = (const lh5801_cpu_core *) config;
} }
static void lh5801_reset(void) static void lh5801_reset(void)

View File

@ -18,8 +18,10 @@
* - This entire notice must remain in the source code. * - This entire notice must remain in the source code.
* *
*****************************************************************************/ *****************************************************************************/
#ifndef _LH5801_H #pragma once
#define _LH5801_H
#ifndef __LH5801_H__
#define __LH5801_H__
/* /*
lh5801 lh5801
@ -64,9 +66,11 @@ pc 8bit
#include "cpuintrf.h" #include "cpuintrf.h"
typedef struct { typedef struct _lh5801_cpu_core lh5801_cpu_core;
struct _lh5801_cpu_core
{
UINT8 (*in)(void); UINT8 (*in)(void);
} LH5801_CONFIG; };
#define LH5801_INT_NONE 0 #define LH5801_INT_NONE 0
#define LH5801_IRQ 1 #define LH5801_IRQ 1
@ -74,4 +78,4 @@ typedef struct {
void lh5801_get_info(UINT32 state, cpuinfo *info); void lh5801_get_info(UINT32 state, cpuinfo *info);
extern offs_t lh5801_dasm(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram); extern offs_t lh5801_dasm(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram);
#endif #endif /* __LH5801_H__ */

View File

@ -75,7 +75,7 @@ typedef struct {
int doHALTbug; int doHALTbug;
int haltIFstatus; int haltIFstatus;
UINT8 features; UINT8 features;
const LR35902_CONFIG *config; const lr35902_cpu_core *config;
} lr35902_16BitRegs; } lr35902_16BitRegs;
#ifdef LSB_FIRST #ifdef LSB_FIRST
@ -179,7 +179,7 @@ static const int CyclesCB[256] =
static void lr35902_init(int index, int clock, const void *config, int (*irqcallback)(int)) static void lr35902_init(int index, int clock, const void *config, int (*irqcallback)(int))
{ {
Regs.w.config = (const LR35902_CONFIG *) config; Regs.w.config = (const lr35902_cpu_core *) config;
Regs.w.irq_callback = irqcallback; Regs.w.irq_callback = irqcallback;
} }

View File

@ -1,13 +1,17 @@
#ifndef lr35902_H #pragma once
#define lr35902_H
#ifndef __LR35902_H__
#define __LR35902_H__
#include "cpuintrf.h" #include "cpuintrf.h"
typedef struct { typedef struct _lr35902_cpu_core lr35902_cpu_core;
struct _lr35902_cpu_core
{
const UINT16 *regs; const UINT16 *regs;
UINT8 features; UINT8 features;
void (*timer_fired_func)(int cycles); void (*timer_fired_func)(int cycles);
} LR35902_CONFIG; };
enum { enum {
LR35902_PC=1, LR35902_SP, LR35902_AF, LR35902_BC, LR35902_DE, LR35902_HL, LR35902_PC=1, LR35902_SP, LR35902_AF, LR35902_BC, LR35902_DE, LR35902_HL,
@ -27,4 +31,4 @@ extern void lr35902_get_info(UINT32 state, cpuinfo *info);
extern unsigned lr35902_dasm( char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram ); extern unsigned lr35902_dasm( char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram );
#endif #endif /* __LR35902_H__ */

View File

@ -1,5 +1,7 @@
#ifndef HEADER__M37710 #pragma once
#define HEADER__M37710
#ifndef __M37710_H__
#define __M37710_H__
/* ======================================================================== */ /* ======================================================================== */
/* =============================== COPYRIGHT ============================== */ /* =============================== COPYRIGHT ============================== */
@ -120,4 +122,4 @@ void m37710_get_info(UINT32 state, cpuinfo *info);
/* ============================== END OF FILE ============================= */ /* ============================== END OF FILE ============================= */
/* ======================================================================== */ /* ======================================================================== */
#endif /* HEADER__M37710 */ #endif /* __M37710_H__ */

View File

@ -1,5 +1,7 @@
#ifndef HEADER__M37710CM #pragma once
#define HEADER__M37710CM
#ifndef __M37710CM_H__
#define __M37710CM_H__
#define m37710i_branching(A) #define m37710i_branching(A)
#define m37710i_jumping(A) #define m37710i_jumping(A)
@ -61,7 +63,8 @@ INLINE int MAKE_INT_8(int A) {return (A & 0x80) ? A | ~0xff : A & 0xff;}
/* ======================================================================== */ /* ======================================================================== */
/* CPU Structure */ /* CPU Structure */
typedef struct typedef struct _m37710i_cpu_struct m37710i_cpu_struct;
struct _m37710i_cpu_struct
{ {
uint a; /* Accumulator */ uint a; /* Accumulator */
uint b; /* holds high byte of accumulator */ uint b; /* holds high byte of accumulator */
@ -107,7 +110,8 @@ typedef struct
UINT8 m37710_regs[128]; UINT8 m37710_regs[128];
attotime reload[8]; attotime reload[8];
emu_timer *timers[8]; emu_timer *timers[8];
} m37710i_cpu_struct; };
extern m37710i_cpu_struct m37710i_cpu; extern m37710i_cpu_struct m37710i_cpu;
extern int m37710_ICount; extern int m37710_ICount;
@ -315,4 +319,4 @@ void m37710i_update_irqs(void);
/* ======================================================================== */ /* ======================================================================== */
/* ================================== CPU ================================= */ /* ================================== CPU ================================= */
/* ======================================================================== */ /* ======================================================================== */
#endif /* HEADER__M37710CM */ #endif /* __M37710CM_H__ */

View File

@ -2,6 +2,12 @@
/* ============================= CONFIGURATION ============================ */ /* ============================= CONFIGURATION ============================ */
/* ======================================================================== */ /* ======================================================================== */
#pragma once
#ifndef __M37710OP_H__
#define __M37710OP_H__
#undef FLAG_SET_M #undef FLAG_SET_M
#undef FLAG_SET_X #undef FLAG_SET_X
@ -2957,3 +2963,5 @@ TABLE_FUNCTION(int, execute, (int clocks))
/* ======================================================================== */ /* ======================================================================== */
/* ================================== EOF ================================= */ /* ================================== EOF ================================= */
/* ======================================================================== */ /* ======================================================================== */
#endif /* __M37710OP_H__ */

View File

@ -1,5 +1,7 @@
#ifndef HEADER__M7700DS #pragma once
#define HEADER__M7700DS
#ifndef __M7700DS_H__
#define __M7700DS_H__
/* /*
@ -16,4 +18,4 @@ All rights reserved.
int m7700_disassemble(char* buff, unsigned int pc, unsigned int pb, const UINT8 *oprom, int m_flag, int x_flag); int m7700_disassemble(char* buff, unsigned int pc, unsigned int pb, const UINT8 *oprom, int m_flag, int x_flag);
#endif /* HEADER__7700DS */ #endif /* __M7700DS_H__ */

View File

@ -1,3 +1,8 @@
#pragma once
#ifndef __ILL02_H__
#define __ILL02_H__
/***************************************************************************** /*****************************************************************************
* *
* ill02.h * ill02.h
@ -274,5 +279,4 @@
P|=F_V; \ P|=F_V; \
} }
#endif /* __ILL02_H__ */

View File

@ -19,8 +19,10 @@
* *
*****************************************************************************/ *****************************************************************************/
#ifndef _M4510_H #pragma once
#define _M4510_H
#ifndef __M4510_H__
#define __M4510_H__
#include "m6502.h" #include "m6502.h"
@ -41,6 +43,4 @@ void m4510_get_info(UINT32 state, cpuinfo *info);
extern unsigned m4510_dasm(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram); extern unsigned m4510_dasm(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram);
#endif #endif /* __M4510_H__ */

View File

@ -22,8 +22,10 @@
*****************************************************************************/ *****************************************************************************/
/* 2.February 2000 PeT added 65sc02 subtype */ /* 2.February 2000 PeT added 65sc02 subtype */
#ifndef _M6502_H #pragma once
#define _M6502_H
#ifndef __M6502_H__
#define __M6502_H__
#include "cpuintrf.h" #include "cpuintrf.h"
@ -245,5 +247,4 @@ extern void deco16_get_info(UINT32 state, cpuinfo *info);
extern unsigned deco16_dasm(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram); extern unsigned deco16_dasm(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram);
#endif /* _M6502_H */ #endif /* __M6502_H__ */

View File

@ -19,7 +19,9 @@
* *
*****************************************************************************/ *****************************************************************************/
#ifndef _M6509_H #pragma once
#ifndef __M6509_H__
#define _M6509_H #define _M6509_H
#include "m6502.h" #include "m6502.h"
@ -38,6 +40,4 @@ enum {
void m6509_get_info(UINT32 state, cpuinfo *info); void m6509_get_info(UINT32 state, cpuinfo *info);
#endif /* _M6509_H */ #endif /* __M6509_H__ */

View File

@ -19,8 +19,10 @@
* *
*****************************************************************************/ *****************************************************************************/
#ifndef _M65CE02_H #pragma once
#define _M65CE02_H
#ifndef __M65CE02_H__
#define __M65CE02_H__
#include "m6502.h" #include "m6502.h"
@ -36,6 +38,4 @@ void m65ce02_get_info(UINT32 state, cpuinfo *info);
extern unsigned m65ce02_dasm(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram); extern unsigned m65ce02_dasm(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram);
#endif /* _M65CE02_H */ #endif /* __M65CE02_H__ */

View File

@ -5,6 +5,12 @@
* *
*****************************************************************************/ *****************************************************************************/
#pragma once
#ifndef __MINC4510_H__
#define __MINC4510_H__
/* 4510 flags */ /* 4510 flags */
#define F_C 0x01 #define F_C 0x01
#define F_Z 0x02 #define F_Z 0x02
@ -70,3 +76,4 @@
#undef RDOPARG #undef RDOPARG
#define RDOPARG() m4510_cpu_readop_arg(); m4510_ICount -= 1 #define RDOPARG() m4510_cpu_readop_arg(); m4510_ICount -= 1
#endif /* __MINC4510_H__ */

View File

@ -5,6 +5,12 @@
* *
*****************************************************************************/ *****************************************************************************/
#pragma once
#ifndef __MINCCE02_H__
#define __MINCCE02_H__
/* 65ce02 flags */ /* 65ce02 flags */
#define F_C 0x01 #define F_C 0x01
#define F_Z 0x02 #define F_Z 0x02
@ -69,3 +75,4 @@
#define RDMEM(addr) program_read_byte_8le(addr); m65ce02_ICount -= 1 #define RDMEM(addr) program_read_byte_8le(addr); m65ce02_ICount -= 1
#define WRMEM(addr,data) program_write_byte_8le(addr,data); m65ce02_ICount -= 1 #define WRMEM(addr,data) program_write_byte_8le(addr,data); m65ce02_ICount -= 1
#endif /* __MINCCE02_H__ */

View File

@ -20,6 +20,12 @@
* *
*****************************************************************************/ *****************************************************************************/
#pragma once
#ifndef __OPS02_H__
#define __OPS02_H__
/* 6502 flags */ /* 6502 flags */
#define F_C 0x01 #define F_C 0x01
#define F_Z 0x02 #define F_Z 0x02
@ -806,3 +812,4 @@
A = Y; \ A = Y; \
SET_NZ(A) SET_NZ(A)
#endif /* __OPS02_H__ */

View File

@ -20,6 +20,12 @@
* *
*****************************************************************************/ *****************************************************************************/
#pragma once
#ifndef __OPS09_H__
#define __OPS09_H__
#define m6502 m6509 #define m6502 m6509
#define m6502_ICount m6509_ICount #define m6502_ICount m6509_ICount
@ -213,5 +219,4 @@
PCW--; \ PCW--; \
logerror("M6509 KILL opcode %05x: %02x\n", PCD, cpu_readop(PCD)) logerror("M6509 KILL opcode %05x: %02x\n", PCD, cpu_readop(PCD))
#endif /* __OPS09_H__ */

View File

@ -22,6 +22,12 @@
* *
*****************************************************************************/ *****************************************************************************/
#pragma once
#ifndef __OPS4510_H__
#define __OPS4510_H__
/* 65ce02 ******************************************************** /* 65ce02 ********************************************************
* TXS Transfer index X to stack LSB * TXS Transfer index X to stack LSB
* no flags changed (sic!) * no flags changed (sic!)
@ -75,3 +81,4 @@
(*m4510.insn[op])(); \ (*m4510.insn[op])(); \
} \ } \
#endif /* __OPS4510_H__ */

View File

@ -20,6 +20,12 @@
* *
*****************************************************************************/ *****************************************************************************/
#pragma once
#ifndef __OPSC02_H__
#define __OPSC02_H__
/*************************************************************** /***************************************************************
*************************************************************** ***************************************************************
* Macros to emulate the 65C02 opcodes * Macros to emulate the 65C02 opcodes
@ -350,4 +356,4 @@
PCD = EAD; \ PCD = EAD; \
CHANGE_PC CHANGE_PC
#endif /* __OPSC02_H__ */

View File

@ -22,6 +22,12 @@
* *
*****************************************************************************/ *****************************************************************************/
#pragma once
#ifndef __OPSCE02_H__
#define __OPSCE02_H__
#define SET_NZ(n) if ((n) == 0) P = (P & ~F_N) | F_Z; else P = (P & ~(F_N | F_Z)) | ((n) & F_N) #define SET_NZ(n) if ((n) == 0) P = (P & ~F_N) | F_Z; else P = (P & ~(F_N | F_Z)) | ((n) & F_N)
#define SET_Z(n) if ((n) == 0) P |= F_Z; else P &= ~F_Z #define SET_Z(n) if ((n) == 0) P |= F_Z; else P &= ~F_Z
@ -989,3 +995,4 @@
A = Z; \ A = Z; \
SET_NZ(A) SET_NZ(A)
#endif /* __OPSCE02_H__ */

View File

@ -4,6 +4,11 @@
*************************************************************** ***************************************************************
***************************************************************/ ***************************************************************/
#pragma once
#ifndef __OPSN2A03_H__
#define __OPSN2A03_H__
/* N2A03 ******************************************************* /* N2A03 *******************************************************
* ADC Add with carry - no decimal mode * ADC Add with carry - no decimal mode
@ -37,4 +42,4 @@
} \ } \
SET_NZ(A) SET_NZ(A)
#endif /* __OPSN2A03_H__ */

View File

@ -1,7 +1,9 @@
/*** m6800: Portable 6800 class emulator *************************************/ /*** m6800: Portable 6800 class emulator *************************************/
#ifndef _M6800_H #pragma once
#define _M6800_H
#ifndef __M6800_H__
#define __M6800_H__
#include "cpuintrf.h" #include "cpuintrf.h"
@ -218,4 +220,4 @@ offs_t m6808_dasm(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opra
offs_t hd63701_dasm(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram); offs_t hd63701_dasm(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram);
offs_t nsc8105_dasm(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram); offs_t nsc8105_dasm(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram);
#endif /* _M6800_H */ #endif /* __M6800_H__ */

View File

@ -1,5 +1,7 @@
#ifndef M68000__HEADER #pragma once
#define M68000__HEADER
#ifndef __M68000_H__
#define __M68000_H__
#include "cpuintrf.h" #include "cpuintrf.h"
@ -24,7 +26,8 @@ extern int m68k_ICount;
/* Redirect memory calls */ /* Redirect memory calls */
struct m68k_memory_interface typedef struct _m68k_memory_interface m68k_memory_interface;
struct _m68k_memory_interface
{ {
offs_t opcode_xor; // Address Calculation offs_t opcode_xor; // Address Calculation
UINT16 (*readimm16)(offs_t); // Immediate read 16 bit UINT16 (*readimm16)(offs_t); // Immediate read 16 bit
@ -46,7 +49,9 @@ struct m68k_memory_interface
UINT32 (*read32d)(offs_t); // Direct read 32 bit UINT32 (*read32d)(offs_t); // Direct read 32 bit
}; };
struct m68k_encryption_interface
typedef struct _m68k_encryption_interface m68k_encryption_interface;
struct _m68k_encryption_interface
{ {
UINT8 (*read8pc)(offs_t); // PC Relative read 8 bit UINT8 (*read8pc)(offs_t); // PC Relative read 8 bit
UINT16 (*read16pc)(offs_t); // PC Relative read 16 bit UINT16 (*read16pc)(offs_t); // PC Relative read 16 bit
@ -160,4 +165,4 @@ void m68040_get_info(UINT32 state, cpuinfo *info);
// C Core header // C Core header
#include "m68kmame.h" #include "m68kmame.h"
#endif /* M68000__HEADER */ #endif /* __M68000_H__ */

View File

@ -1,5 +1,7 @@
#ifndef M68K__HEADER #pragma once
#define M68K__HEADER
#ifndef __M68K_H__
#define __M68K_H__
/* ======================================================================== */ /* ======================================================================== */
/* ========================= LICENSING & COPYRIGHT ======================== */ /* ========================= LICENSING & COPYRIGHT ======================== */
@ -80,7 +82,7 @@ enum
}; };
/* Registers used by m68k_get_reg() and m68k_set_reg() */ /* Registers used by m68k_get_reg() and m68k_set_reg() */
typedef enum enum _m68k_register_t
{ {
/* Real registers */ /* Real registers */
M68K_REG_D0, /* Data registers */ M68K_REG_D0, /* Data registers */
@ -122,7 +124,10 @@ typedef enum
M68K_REG_PPC, /* Previous value in the program counter */ M68K_REG_PPC, /* Previous value in the program counter */
M68K_REG_IR, /* Instruction register */ M68K_REG_IR, /* Instruction register */
M68K_REG_CPU_TYPE /* Type of CPU being run */ M68K_REG_CPU_TYPE /* Type of CPU being run */
} m68k_register_t; };
typedef enum _m68k_register_t m68k_register_t;
/* ======================================================================== */ /* ======================================================================== */
/* ====================== FUNCTIONS CALLED BY THE CPU ===================== */ /* ====================== FUNCTIONS CALLED BY THE CPU ===================== */
@ -376,4 +381,4 @@ unsigned int m68k_disassemble_raw(char* str_buff, unsigned int pc, const unsigne
/* ============================== END OF FILE ============================= */ /* ============================== END OF FILE ============================= */
/* ======================================================================== */ /* ======================================================================== */
#endif /* M68K__HEADER */ #endif /* __M68K_H__ */

View File

@ -20,9 +20,10 @@
*/ */
#pragma once
#ifndef M68KCONF__HEADER #ifndef __M68KCONF_H__
#define M68KCONF__HEADER #define __M68KCONF_H__
/* Configuration switches. /* Configuration switches.
@ -198,4 +199,4 @@
/* ============================== END OF FILE ============================= */ /* ============================== END OF FILE ============================= */
/* ======================================================================== */ /* ======================================================================== */
#endif /* M68KCONF__HEADER */ #endif /* __M68KCONF_H__ */

View File

@ -21,10 +21,10 @@
*/ */
#pragma once
#ifndef __M68KCPU_H__
#ifndef M68KCPU__HEADER #define __M68KCPU_H__
#define M68KCPU__HEADER
#include "m68k.h" #include "m68k.h"
#include <limits.h> #include <limits.h>
@ -840,13 +840,16 @@
/* =============================== PROTOTYPES ============================= */ /* =============================== PROTOTYPES ============================= */
/* ======================================================================== */ /* ======================================================================== */
typedef union typedef union _fp_reg fp_reg;
union _fp_reg
{ {
UINT64 i; UINT64 i;
double f; double f;
} fp_reg; };
typedef struct
typedef struct _m68ki_cpu_core m68ki_cpu_core;
struct _m68ki_cpu_core
{ {
uint cpu_type; /* CPU Type: 68000, 68008, 68010, 68EC020, or 68020 */ uint cpu_type; /* CPU Type: 68000, 68008, 68010, 68EC020, or 68020 */
uint dar[16]; /* Data and Address Registers */ uint dar[16]; /* Data and Address Registers */
@ -907,7 +910,7 @@ typedef struct
void (*set_fc_callback)(unsigned int new_fc); /* Called when the CPU function code changes */ void (*set_fc_callback)(unsigned int new_fc); /* Called when the CPU function code changes */
void (*instr_hook_callback)(unsigned int pc); /* Called every instruction cycle prior to execution */ void (*instr_hook_callback)(unsigned int pc); /* Called every instruction cycle prior to execution */
} m68ki_cpu_core; };
extern m68ki_cpu_core m68ki_cpu; extern m68ki_cpu_core m68ki_cpu;
@ -2041,4 +2044,4 @@ INLINE void m68ki_check_interrupts(void)
/* ============================== END OF FILE ============================= */ /* ============================== END OF FILE ============================= */
/* ======================================================================== */ /* ======================================================================== */
#endif /* M68KCPU__HEADER */ #endif /* __M68KCPU_H__ */

View File

@ -5,7 +5,7 @@
/* global access */ /* global access */
struct m68k_memory_interface m68k_memory_intf; m68k_memory_interface m68k_memory_intf;
offs_t m68k_encrypted_opcode_start[MAX_CPU]; offs_t m68k_encrypted_opcode_start[MAX_CPU];
offs_t m68k_encrypted_opcode_end[MAX_CPU]; offs_t m68k_encrypted_opcode_end[MAX_CPU];
@ -27,7 +27,7 @@ static UINT16 m68008_read_immediate_16(offs_t address)
} }
/* interface for 20/22-bit address bus, 8-bit data bus (68008) */ /* interface for 20/22-bit address bus, 8-bit data bus (68008) */
static const struct m68k_memory_interface interface_d8 = static const m68k_memory_interface interface_d8 =
{ {
0, 0,
m68008_read_immediate_16, m68008_read_immediate_16,
@ -49,7 +49,7 @@ static UINT16 read_immediate_16(offs_t address)
} }
/* interface for 24-bit address bus, 16-bit data bus (68000, 68010) */ /* interface for 24-bit address bus, 16-bit data bus (68000, 68010) */
static const struct m68k_memory_interface interface_d16 = static const m68k_memory_interface interface_d16 =
{ {
0, 0,
read_immediate_16, read_immediate_16,
@ -125,7 +125,7 @@ static void writelong_d32(offs_t address, UINT32 data)
} }
/* interface for 32-bit data bus (68EC020, 68020) */ /* interface for 32-bit data bus (68EC020, 68020) */
static const struct m68k_memory_interface interface_d32 = static const m68k_memory_interface interface_d32 =
{ {
WORD_XOR_BE(0), WORD_XOR_BE(0),
read_immediate_16, read_immediate_16,

View File

@ -1,5 +1,7 @@
#ifndef M68KMAME__HEADER #pragma once
#define M68KMAME__HEADER
#ifndef __M68KMAME_H__
#define __M68KMAME_H__
/* ======================================================================== */ /* ======================================================================== */
/* ============================== MAME STUFF ============================== */ /* ============================== MAME STUFF ============================== */
@ -56,7 +58,7 @@
#define m68ki_remaining_cycles m68k_ICount #define m68ki_remaining_cycles m68k_ICount
extern struct m68k_memory_interface m68k_memory_intf; extern m68k_memory_interface m68k_memory_intf;
extern offs_t m68k_encrypted_opcode_start[MAX_CPU]; extern offs_t m68k_encrypted_opcode_start[MAX_CPU];
extern offs_t m68k_encrypted_opcode_end[MAX_CPU]; extern offs_t m68k_encrypted_opcode_end[MAX_CPU];
@ -172,4 +174,4 @@ void m68k_set_encrypted_opcode_range(int cpunum, offs_t start, offs_t end);
/* ============================== END OF FILE ============================= */ /* ============================== END OF FILE ============================= */
/* ======================================================================== */ /* ======================================================================== */
#endif /* M68KMAME__HEADER */ #endif /* __M68KMAME_H__ */

View File

@ -1,7 +1,9 @@
/*** m6805: Portable 6805 emulator ******************************************/ /*** m6805: Portable 6805 emulator ******************************************/
#ifndef _M6805_H #pragma once
#define _M6805_H
#ifndef __M6805_H__
#define __M6805_H__
#include "cpuintrf.h" #include "cpuintrf.h"
@ -84,4 +86,4 @@ extern void hd63705_get_info(UINT32 state, cpuinfo *info);
offs_t m6805_dasm(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram); offs_t m6805_dasm(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram);
#endif /* _M6805_H */ #endif /* __M6805_H__ */

View File

@ -1,7 +1,9 @@
/*** m6809: Portable 6809 emulator ******************************************/ /*** m6809: Portable 6809 emulator ******************************************/
#ifndef _M6809_H #pragma once
#define _M6809_H
#ifndef __M6809_H__
#define __M6809_H__
#include "cpuintrf.h" #include "cpuintrf.h"
@ -47,4 +49,4 @@ void m6809e_get_info(UINT32 state, cpuinfo *info);
# define TRUE (!FALSE) # define TRUE (!FALSE)
#endif #endif
#endif /* _M6809_H */ #endif /* __M6809_H__ */

View File

@ -116,7 +116,7 @@ static void mb86233_set_context(void *src)
static void mb86233_init(int index, int clock, const void *config, int (*irqcallback)(int)) static void mb86233_init(int index, int clock, const void *config, int (*irqcallback)(int))
{ {
struct mb86233_config * _config = (struct mb86233_config *)config; mb86233_cpu_core * _config = (mb86233_cpu_core *)config;
(void)index; (void)index;
(void)clock; (void)clock;
(void)irqcallback; (void)irqcallback;

View File

@ -1,5 +1,7 @@
#ifndef _MB86233_H #pragma once
#define _MB86233_H
#ifndef __MB86233_H__
#define __MB86233_H__
#include "cpuintrf.h" #include "cpuintrf.h"
@ -41,7 +43,8 @@ enum
STRUCTURES STRUCTURES
***************************************************************************/ ***************************************************************************/
struct mb86233_config typedef struct _mb86233_cpu_core mb86233_cpu_core;
struct _mb86233_cpu_core
{ {
int (*fifo_read_cb)( UINT32* data ); int (*fifo_read_cb)( UINT32* data );
void (*fifo_write_cb)( UINT32 data ); void (*fifo_write_cb)( UINT32 data );
@ -50,4 +53,4 @@ struct mb86233_config
extern void mb86233_get_info(UINT32 state, cpuinfo *info); extern void mb86233_get_info(UINT32 state, cpuinfo *info);
#endif /* _MB86233_H */ #endif /* __MB86233_H__ */

View File

@ -121,7 +121,7 @@ static void mb88_init(int index, int clock, const void *config, int (*irqcallbac
{ {
if ( config ) if ( config )
{ {
const struct MB88Config *_config = (const struct MB88Config*)config; const mb88_cpu_core *_config = (const mb88_cpu_core*)config;
mb88.PLA = _config->PLA_config; mb88.PLA = _config->PLA_config;
} }

View File

@ -7,8 +7,10 @@
***************************************************************************/ ***************************************************************************/
#ifndef _MB88xx_H_ #pragma once
#define _MB88xx_H_
#ifndef __MB88XX_H__
#define __MB88XX_H__
#ifndef INLINE #ifndef INLINE
#define INLINE static inline #define INLINE static inline
@ -56,7 +58,8 @@ enum
CONFIG STRUCTURE CONFIG STRUCTURE
***************************************************************************/ ***************************************************************************/
struct MB88Config typedef struct _mb88_cpu_core mb88_cpu_core;
struct _mb88_cpu_core
{ {
UINT8 *PLA_config; /* PLA configuration (32 byte values), if NULL assume direct output */ UINT8 *PLA_config; /* PLA configuration (32 byte values), if NULL assume direct output */
}; };
@ -73,4 +76,4 @@ void mb8844_get_info(UINT32 state, cpuinfo *info);
offs_t mb88_dasm(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram); offs_t mb88_dasm(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram);
#endif #endif /* __MB88XX_H__ */

View File

@ -1,10 +1,17 @@
typedef struct { #pragma once
#ifndef __HC11OPS_H__
#define __HC11OPS_H__
typedef struct _hc11_opcode_list_struct hc11_opcode_list_struct;
struct _hc11_opcode_list_struct
{
int page; int page;
int opcode; int opcode;
void (*handler)(void); void (*handler)(void);
} HC11_OPCODE_LIST; };
static const HC11_OPCODE_LIST hc11_opcode_list[] = static const hc11_opcode_list_struct hc11_opcode_list[] =
{ {
/* page opcode handler */ /* page opcode handler */
{ 0, 0x1b, HC11OP(aba) }, { 0, 0x1b, HC11OP(aba) },
@ -187,3 +194,5 @@ static const HC11_OPCODE_LIST hc11_opcode_list[] =
{ 0, 0x1a, HC11OP(page3) }, { 0, 0x1a, HC11OP(page3) },
{ 0, 0xcd, HC11OP(page4) }, { 0, 0xcd, HC11OP(page4) },
}; };
#endif /* __HC11OPS_H__ */

View File

@ -323,7 +323,7 @@ static void hc11_init(int index, int clock, const void *config, int (*irqcallbac
hc11_optable_page4[i] = HC11OP(invalid); hc11_optable_page4[i] = HC11OP(invalid);
} }
/* fill the opcode tables */ /* fill the opcode tables */
for(i=0; i < sizeof(hc11_opcode_list)/sizeof(HC11_OPCODE_LIST); i++) for(i=0; i < sizeof(hc11_opcode_list)/sizeof(hc11_opcode_list_struct); i++)
{ {
switch(hc11_opcode_list[i].page) switch(hc11_opcode_list[i].page)
{ {

View File

@ -1,5 +1,7 @@
#ifndef _MC68HC11_H #pragma once
#define _MC68HC11_H
#ifndef __MC68HC11_H__
#define __MC68HC11_H__
#include "cpuintrf.h" #include "cpuintrf.h"
@ -27,4 +29,4 @@ void mc68hc11_get_info(UINT32 state, cpuinfo *info);
#define MC68HC11_IO_AD6 0x16 #define MC68HC11_IO_AD6 0x16
#define MC68HC11_IO_AD7 0x17 #define MC68HC11_IO_AD7 0x17
#endif #endif /* __MC68HC11_H__ */

View File

@ -1,5 +1,9 @@
#ifndef minx_H #pragma once
#define minx_H
#ifndef __MINX_H__
#define __MINX_H__
#include "cpuintrf.h" #include "cpuintrf.h"
#include "osd_cpu.h" #include "osd_cpu.h"
#include "driver.h" #include "driver.h"
@ -12,5 +16,4 @@ enum {
extern unsigned minx_dasm( char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram ); extern unsigned minx_dasm( char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram );
#endif #endif /* __MINX_H__ */

View File

@ -1,3 +1,8 @@
#pragma once
#ifndef __MINXFUNC_H__
#define __MINXFUNC_H__
INLINE UINT8 ADD8( UINT8 arg1, UINT8 arg2 ) INLINE UINT8 ADD8( UINT8 arg1, UINT8 arg2 )
{ {
@ -363,3 +368,4 @@ INLINE void CALL( UINT16 arg )
#define AD2_XL UINT32 addr2 = ( regs.XI << 16 ) | ( regs.X + ( regs.HL & 0x00FF ) ) #define AD2_XL UINT32 addr2 = ( regs.XI << 16 ) | ( regs.X + ( regs.HL & 0x00FF ) )
#define AD2_YL UINT32 addr2 = ( regs.YI << 16 ) | ( regs.Y + ( regs.HL & 0x00FF ) ) #define AD2_YL UINT32 addr2 = ( regs.YI << 16 ) | ( regs.Y + ( regs.HL & 0x00FF ) )
#endif /* __MINXFUNC_H__ */

View File

@ -1,3 +1,8 @@
#pragma once
#ifndef __MINXOPCE_H__
#define __MINXOPCE_H__
#undef OP #undef OP
#define OP(nn) INLINE void minx_CE_##nn(void) #define OP(nn) INLINE void minx_CE_##nn(void)
@ -331,4 +336,4 @@ static const int insnminx_cycles_CE[256] = {
12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12
}; };
#endif /* __MINXOPCE_H__ */

View File

@ -1,3 +1,8 @@
#pragma once
#ifndef __MINXOPCF_H__
#define __MINXOPCF_H__
#undef OP #undef OP
#define OP(nn) INLINE void minx_CF_##nn(void) #define OP(nn) INLINE void minx_CF_##nn(void)
@ -331,3 +336,4 @@ static const int insnminx_cycles_CF[256] = {
8, 8, 8, 8, 8, 8, 1, 1, 8, 8, 8, 1, 1, 1, 8, 1 8, 8, 8, 8, 8, 8, 1, 1, 8, 8, 8, 1, 1, 1, 8, 1
}; };
#endif /* __MINXOPCF_H__ */

View File

@ -1,3 +1,8 @@
#pragma once
#ifndef __MINXOPS_H__
#define __MINXOPS_H__
#undef OP #undef OP
#define OP(nn) INLINE void minx_##nn(void) #define OP(nn) INLINE void minx_##nn(void)
@ -331,3 +336,4 @@ static const int insnminx_cycles[256] = {
20, 8, 24, 12, 8, 1, 8, 12, 8, 8, 8, 20, 20, 1, 1, 8 20, 8, 24, 12, 8, 1, 8, 12, 8, 8, 8, 20, 20, 1, 1, 8
}; };
#endif /* __MINXOPS_H__ */

View File

@ -11,6 +11,8 @@
***************************************************************************/ ***************************************************************************/
#pragma once
#ifndef __MIPS3_H__ #ifndef __MIPS3_H__
#define __MIPS3_H__ #define __MIPS3_H__

View File

@ -6,6 +6,8 @@
***************************************************************************/ ***************************************************************************/
#pragma once
#ifndef __MIPS3COM_H__ #ifndef __MIPS3COM_H__
#define __MIPS3COM_H__ #define __MIPS3COM_H__
@ -258,4 +260,4 @@ INLINE void mips3com_set_irq_line(mips3_state *mips, int irqline, int state)
mips->cpr[0][COP0_Cause] &= ~(0x400 << irqline); mips->cpr[0][COP0_Cause] &= ~(0x400 << irqline);
} }
#endif #endif /* __MIPS3COM_H__ */

View File

@ -10,6 +10,8 @@
***************************************************************************/ ***************************************************************************/
#pragma once
#ifndef __MIPS3FE_H__ #ifndef __MIPS3FE_H__
#define __MIPS3FE_H__ #define __MIPS3FE_H__
@ -39,4 +41,4 @@
int mips3fe_describe(void *param, opcode_desc *desc, const opcode_desc *prev); int mips3fe_describe(void *param, opcode_desc *desc, const opcode_desc *prev);
#endif #endif /* __MIPS3FE_H__ */

View File

@ -1,5 +1,7 @@
#ifndef _MIPS_H #pragma once
#define _MIPS_H
#ifndef __PSX_H__
#define __PSX_H__
#include "cpuintrf.h" #include "cpuintrf.h"
@ -209,4 +211,4 @@ extern unsigned DasmMIPS( char *buffer, UINT32 pc, const UINT8 *opram );
extern void psxcpu_get_info(UINT32 state, cpuinfo *info); extern void psxcpu_get_info(UINT32 state, cpuinfo *info);
#endif #endif
#endif #endif /* __PSX_H__ */

View File

@ -346,7 +346,7 @@ static void r3000_set_context(void *src)
static void r3000_init(int index, int clock, const void *_config, int (*irqcallback)(int)) static void r3000_init(int index, int clock, const void *_config, int (*irqcallback)(int))
{ {
const struct r3000_config *config = _config; const r3000_cpu_core *config = _config;
/* allocate memory */ /* allocate memory */
r3000.icache = auto_malloc(config->icache); r3000.icache = auto_malloc(config->icache);

View File

@ -6,8 +6,8 @@
***************************************************************************/ ***************************************************************************/
#ifndef _R3000_H #ifndef __R3000_H__
#define _R3000_H #define __R3000_H__
#include "cpuintrf.h" #include "cpuintrf.h"
@ -47,7 +47,8 @@ enum
STRUCTURES STRUCTURES
***************************************************************************/ ***************************************************************************/
struct r3000_config typedef struct _r3000_cpu_core r3000_cpu_core;
struct _r3000_cpu_core
{ {
UINT8 hasfpu; /* 1 if we have an FPU, 0 otherwise */ UINT8 hasfpu; /* 1 if we have an FPU, 0 otherwise */
size_t icache; /* code cache size */ size_t icache; /* code cache size */
@ -65,4 +66,4 @@ extern void r3000le_get_info(UINT32 state, cpuinfo *info);
extern void r3041be_get_info(UINT32 state, cpuinfo *info); extern void r3041be_get_info(UINT32 state, cpuinfo *info);
extern void r3041le_get_info(UINT32 state, cpuinfo *info); extern void r3041le_get_info(UINT32 state, cpuinfo *info);
#endif /* _JAGUAR_H */ #endif /* __R3000_H__ */

View File

@ -1078,7 +1078,7 @@ INPUT_PORTS_END
* *
*************************************/ *************************************/
static const struct r3000_config config = static const r3000_cpu_core config =
{ {
0, /* 1 if we have an FPU, 0 otherwise */ 0, /* 1 if we have an FPU, 0 otherwise */
4096, /* code cache size */ 4096, /* code cache size */
@ -1086,13 +1086,13 @@ static const struct r3000_config config =
}; };
static const struct jaguar_config gpu_config = static const jaguar_cpu_core gpu_config =
{ {
jaguar_gpu_cpu_int jaguar_gpu_cpu_int
}; };
static const struct jaguar_config dsp_config = static const jaguar_cpu_core dsp_config =
{ {
jaguar_dsp_cpu_int jaguar_dsp_cpu_int
}; };

View File

@ -1215,7 +1215,7 @@ GFXDECODE_END
* *
*************************************/ *************************************/
static const struct m68k_encryption_interface cps2_encryption = static const m68k_encryption_interface cps2_encryption =
{ {
cps2_read8, cps2_read16, cps2_read32, cps2_read8, cps2_read16, cps2_read32,
cps2_read16, cps2_read32 cps2_read16, cps2_read32

View File

@ -1806,7 +1806,7 @@ ADDRESS_MAP_END
/*****************************************************************************/ /*****************************************************************************/
static const struct mb86233_config tgp_config = static const mb86233_cpu_core tgp_config =
{ {
copro_fifoin_pop, copro_fifoin_pop,
copro_fifoout_push, copro_fifoout_push,

View File

@ -452,7 +452,7 @@ INPUT_PORTS_END
* *
*************************************/ *************************************/
static const struct r3000_config config = static const r3000_cpu_core config =
{ {
0, /* 1 if we have an FPU, 0 otherwise */ 0, /* 1 if we have an FPU, 0 otherwise */
4096, /* code cache size */ 4096, /* code cache size */

View File

@ -308,7 +308,7 @@ static const st0016_interface st0016_config =
cpunum_set_input_line(machine, 1, R3000_IRQ4, ASSERT_LINE); cpunum_set_input_line(machine, 1, R3000_IRQ4, ASSERT_LINE);
} }
static const struct r3000_config config = static const r3000_cpu_core config =
{ {
0, 0,
4096, /* code cache size */ 4096, /* code cache size */

View File

@ -621,7 +621,7 @@ static const st0016_interface st0016_config =
cpunum_set_input_line(machine, 1, R3000_IRQ4, ASSERT_LINE); cpunum_set_input_line(machine, 1, R3000_IRQ4, ASSERT_LINE);
} }
static const struct r3000_config config = static const r3000_cpu_core config =
{ {
1, /* 1 if we have an FPU, 0 otherwise */ 1, /* 1 if we have an FPU, 0 otherwise */
4096, /* code cache size */ 4096, /* code cache size */

View File

@ -1,6 +1,6 @@
/*----------- defined in machine/model1.c -----------*/ /*----------- defined in machine/model1.c -----------*/
extern const struct mb86233_config model1_vr_tgp_config; extern const mb86233_cpu_core model1_vr_tgp_config;
extern int model1_dump; extern int model1_dump;
READ16_HANDLER( model1_tgp_copro_r ); READ16_HANDLER( model1_tgp_copro_r );

View File

@ -2154,7 +2154,7 @@ WRITE16_HANDLER( model1_vr_tgp_w )
} }
/* TGP config */ /* TGP config */
const struct mb86233_config model1_vr_tgp_config = const mb86233_cpu_core model1_vr_tgp_config =
{ {
copro_fifoin_pop, copro_fifoin_pop,
copro_fifoout_push, copro_fifoout_push,