m6805 - standardize cpu functions
This commit is contained in:
parent
4afbdcc37c
commit
2ade39e0b8
|
@ -597,7 +597,7 @@ static INT32 DrvFrame()
|
|||
}
|
||||
}
|
||||
|
||||
if (K052109_irq_enabled) konamiSetIrqLine(KONAMI_IRQ_LINE, KONAMI_HOLD_LINE);
|
||||
if (K052109_irq_enabled) konamiSetIrqLine(KONAMI_IRQ_LINE, KONAMI_IRQSTATUS_AUTO);
|
||||
|
||||
if (pBurnSoundOut) {
|
||||
INT32 nSegmentLength = nBurnSoundLen - nSoundBufferPos;
|
||||
|
@ -635,7 +635,7 @@ static INT32 DrvScan(INT32 nAction,INT32 *pnMin)
|
|||
ba.szName = "All Ram";
|
||||
BurnAcb(&ba);
|
||||
|
||||
konamiCpuScan(nAction, pnMin);
|
||||
konamiCpuScan(nAction);
|
||||
ZetScan(nAction);
|
||||
|
||||
BurnYM2151Scan(nAction);
|
||||
|
|
|
@ -2588,7 +2588,7 @@ static INT32 DrvScan(INT32 nAction, INT32 *pnMin)
|
|||
if (DrvSubCPUType == DD_CPU_TYPE_M6803) M6803Scan(nAction);
|
||||
if (DrvSubCPUType == DD_CPU_TYPE_Z80 || DrvSoundCPUType == DD_CPU_TYPE_Z80) ZetScan(nAction);
|
||||
if (DrvSoundCPUType == DD_CPU_TYPE_M6809) M6809Scan(nAction);
|
||||
if (DrvGameType == DD_GAME_DARKTOWR) m68705Scan(nAction, pnMin);
|
||||
if (DrvGameType == DD_GAME_DARKTOWR) m6805Scan(nAction); // m68705
|
||||
|
||||
BurnYM2151Scan(nAction);
|
||||
if (DrvSoundCPUType == DD_CPU_TYPE_Z80) MSM6295Scan(0, nAction);
|
||||
|
|
|
@ -1006,7 +1006,7 @@ static INT32 DrvScan(INT32 nAction,INT32 *pnMin)
|
|||
BurnAcb(&ba);
|
||||
|
||||
M6809Scan(nAction);
|
||||
m6805Scan(nAction, 0);
|
||||
m6805Scan(nAction);
|
||||
|
||||
BurnYM2203Scan(nAction, pnMin);
|
||||
|
||||
|
|
|
@ -796,7 +796,7 @@ static INT32 DrvScan(INT32 nAction, INT32 *pnMin)
|
|||
if (nAction & ACB_DRIVER_DATA) {
|
||||
SekScan(nAction);
|
||||
ZetScan(nAction);
|
||||
m6805Scan(nAction, 0);
|
||||
m6805Scan(nAction);
|
||||
|
||||
BurnYM2203Scan(nAction, pnMin);
|
||||
|
||||
|
|
|
@ -155,7 +155,7 @@ void m67805_taito_exit()
|
|||
INT32 m68705_taito_scan(INT32 nAction)
|
||||
{
|
||||
if (nAction & ACB_VOLATILE) {
|
||||
m6805Scan(nAction, 0);
|
||||
m6805Scan(nAction);
|
||||
|
||||
SCAN_VAR(portA_in);
|
||||
SCAN_VAR(portB_in);
|
||||
|
|
|
@ -32,6 +32,7 @@
|
|||
|
||||
#include "burnint.h"
|
||||
#include "driver.h"
|
||||
#include "m6805.h"
|
||||
#include "m6805_intf.h"
|
||||
|
||||
#define change_pc(x) PC = x
|
||||
|
@ -809,7 +810,7 @@ int m6805TotalCycles()
|
|||
return m6805.nTotalCycles;
|
||||
}
|
||||
|
||||
int m6805Scan(int nAction, int *)
|
||||
int m6805Scan(int nAction)
|
||||
{
|
||||
#if defined FBA_DEBUG
|
||||
if (!DebugCPU_M6805Initted) bprintf(PRINT_ERROR, _T("m6805Scan called without init\n"));
|
||||
|
|
|
@ -47,23 +47,23 @@ enum { M6805_PC=1, M6805_S, M6805_CC, M6805_A, M6805_X, M6805_IRQ_STATE };
|
|||
/****************************************************************************/
|
||||
/* Read a byte from given memory location */
|
||||
/****************************************************************************/
|
||||
#define M6805_RDMEM(Addr) (m6805_read(Addr))
|
||||
#define M6805_RDMEM(Addr) (m6805Read(Addr))
|
||||
|
||||
/****************************************************************************/
|
||||
/* Write a byte to given memory location */
|
||||
/****************************************************************************/
|
||||
#define M6805_WRMEM(Addr,Value) (m6805_write(Addr,Value))
|
||||
#define M6805_WRMEM(Addr,Value) (m6805Write(Addr,Value))
|
||||
|
||||
/****************************************************************************/
|
||||
/* M6805_RDOP() is identical to M6805_RDMEM() except it is used for reading */
|
||||
/* opcodes. In case of system with memory mapped I/O, this function can be */
|
||||
/* used to greatly speed up emulation */
|
||||
/****************************************************************************/
|
||||
#define M6805_RDOP(Addr) (m6805_fetch(Addr))
|
||||
#define M6805_RDOP(Addr) (m6805Fetch(Addr))
|
||||
|
||||
/****************************************************************************/
|
||||
/* M6805_RDOP_ARG() is identical to M6805_RDOP() but it's used for reading */
|
||||
/* opcode arguments. This difference can be used to support systems that */
|
||||
/* use different encoding mechanisms for opcodes and opcode arguments */
|
||||
/****************************************************************************/
|
||||
#define M6805_RDOP_ARG(Addr) (m6805_read(Addr))
|
||||
#define M6805_RDOP_ARG(Addr) (m6805Read(Addr))
|
||||
|
|
|
@ -11,8 +11,8 @@ static INT32 PAGE_SHIFT;
|
|||
#define WRITE 1
|
||||
#define FETCH 2
|
||||
|
||||
static UINT8 (*m6805Read)(UINT16 address);
|
||||
static void (*m6805Write)(UINT16 address, UINT8 data);
|
||||
static UINT8 (*m6805ReadFunction)(UINT16 address);
|
||||
static void (*m6805WriteFunction)(UINT16 address, UINT8 data);
|
||||
|
||||
static UINT8 *mem[3][0x100];
|
||||
|
||||
|
@ -36,7 +36,7 @@ void m6805SetWriteHandler(void (*write)(UINT16, UINT8))
|
|||
if (!DebugCPU_M6805Initted) bprintf(PRINT_ERROR, _T("m6805SetWriteHandler called without init\n"));
|
||||
#endif
|
||||
|
||||
m6805Write = write;
|
||||
m6805WriteFunction = write;
|
||||
}
|
||||
|
||||
void m6805SetReadHandler(UINT8 (*read)(UINT16))
|
||||
|
@ -45,10 +45,10 @@ void m6805SetReadHandler(UINT8 (*read)(UINT16))
|
|||
if (!DebugCPU_M6805Initted) bprintf(PRINT_ERROR, _T("m6805SetReadHandler called without init\n"));
|
||||
#endif
|
||||
|
||||
m6805Read = read;
|
||||
m6805ReadFunction = read;
|
||||
}
|
||||
|
||||
void m6805_write(UINT16 address, UINT8 data)
|
||||
void m6805Write(UINT16 address, UINT8 data)
|
||||
{
|
||||
address &= ADDRESS_MASK;
|
||||
|
||||
|
@ -57,15 +57,15 @@ void m6805_write(UINT16 address, UINT8 data)
|
|||
return;
|
||||
}
|
||||
|
||||
if (m6805Write != NULL) {
|
||||
m6805Write(address, data);
|
||||
if (m6805WriteFunction != NULL) {
|
||||
m6805WriteFunction(address, data);
|
||||
return;
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
UINT8 m6805_read(UINT16 address)
|
||||
UINT8 m6805Read(UINT16 address)
|
||||
{
|
||||
address &= ADDRESS_MASK;
|
||||
|
||||
|
@ -73,14 +73,14 @@ UINT8 m6805_read(UINT16 address)
|
|||
return mem[READ][address >> PAGE_SHIFT][address & PAGE_MASK];
|
||||
}
|
||||
|
||||
if (m6805Read != NULL) {
|
||||
return m6805Read(address);
|
||||
if (m6805ReadFunction != NULL) {
|
||||
return m6805ReadFunction(address);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
UINT8 m6805_fetch(UINT16 address)
|
||||
UINT8 m6805Fetch(UINT16 address)
|
||||
{
|
||||
address &= ADDRESS_MASK;
|
||||
|
||||
|
@ -88,10 +88,10 @@ UINT8 m6805_fetch(UINT16 address)
|
|||
return mem[FETCH][address >> PAGE_SHIFT][address & PAGE_MASK];
|
||||
}
|
||||
|
||||
return m6805_read(address);
|
||||
return m6805Read(address);
|
||||
}
|
||||
|
||||
void m6805_write_rom(UINT32 address, UINT8 data)
|
||||
static void m6805_write_rom(UINT32 address, UINT8 data)
|
||||
{
|
||||
#if defined FBA_DEBUG
|
||||
if (!DebugCPU_M6805Initted) bprintf(PRINT_ERROR, _T("m6805_write_rom called without init\n"));
|
||||
|
@ -111,8 +111,8 @@ void m6805_write_rom(UINT32 address, UINT8 data)
|
|||
mem[FETCH][address >> PAGE_SHIFT][address & PAGE_MASK] = data;
|
||||
}
|
||||
|
||||
if (m6805Write != NULL) {
|
||||
m6805Write(address, data);
|
||||
if (m6805WriteFunction != NULL) {
|
||||
m6805WriteFunction(address, data);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -126,7 +126,7 @@ INT32 m6805GetActive()
|
|||
|
||||
static UINT8 m6805CheatRead(UINT32 a)
|
||||
{
|
||||
return m6805_read(a);
|
||||
return m6805Read(a);
|
||||
}
|
||||
|
||||
static cpu_core_config M6805CheatCpuConfig =
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
#include "m6805/m6805.h"
|
||||
void m6805Write(UINT16 address, UINT8 data);
|
||||
UINT8 m6805Read(UINT16 address);
|
||||
UINT8 m6805Fetch(UINT16 address);
|
||||
|
||||
#define M6805_READ 1
|
||||
#define M6805_WRITE 2
|
||||
|
@ -12,18 +14,12 @@ void m6805MapMemory(UINT8 *ptr, INT32 nStart, INT32 nEnd, INT32 nType);
|
|||
void m6805SetWriteHandler(void (*write)(UINT16, UINT8));
|
||||
void m6805SetReadHandler(UINT8 (*read)(UINT16));
|
||||
|
||||
void m6805_write(UINT16 address, UINT8 data);
|
||||
UINT8 m6805_read(UINT16 address);
|
||||
UINT8 m6805_fetch(UINT16 address);
|
||||
void m6805_write_rom(UINT32 address, UINT8 data);
|
||||
|
||||
void m6805Init(INT32 num, INT32 address_range);
|
||||
void m6805Exit();
|
||||
void m6805Open(INT32 );
|
||||
void m6805Close();
|
||||
|
||||
INT32 m6805Scan(INT32 nAction, INT32 *);
|
||||
#define m68705Scan(x, y) m6805Scan(x, y)
|
||||
INT32 m6805Scan(INT32 nAction);
|
||||
|
||||
void m6805Reset();
|
||||
void m6805SetIrqLine(INT32 , INT32 state);
|
||||
|
@ -34,9 +30,8 @@ void m6805RunEnd();
|
|||
void m68705Reset();
|
||||
void m68705SetIrqLine(INT32 irqline, INT32 state);
|
||||
|
||||
void hd63705Reset(void);
|
||||
void hd63705Reset();
|
||||
void hd63705SetIrqLine(INT32 irqline, INT32 state);
|
||||
|
||||
void m6805NewFrame();
|
||||
INT32 m6805TotalCycles();
|
||||
|
||||
|
|
Loading…
Reference in New Issue