Commit b9a379c6 authored by Libretro-Admin's avatar Libretro-Admin
Browse files

Convert cz80.cpp and cz80_support.cpp to C

parent 51417ce9
......@@ -55,8 +55,8 @@ ifeq ($(DRZ80),1)
SOURCES_ASM := $(CORE_DIR)/DrZ80.s
else
FLAGS += -DCZ80
SOURCES_CXX += $(CORE_DIR)/cz80.cpp \
$(CORE_DIR)/cz80_support.cpp
SOURCES_C += $(CORE_DIR)/cz80.c \
$(CORE_DIR)/cz80_support.c
endif
......
......@@ -9,11 +9,10 @@
#ifndef _CZ80_H_
#define _CZ80_H_
#if defined(__cplusplus) && !defined(USE_CPLUS)
#if defined(__cplusplus)
extern "C" {
#endif
/******************************/
/* Compiler dependant defines */
/******************************/
......@@ -254,8 +253,8 @@ void CZ80_FASTCALL Cz80_Set_IFF(cz80_struc *cpu, u32 value);
void CZ80_FASTCALL Cz80_Set_IM(cz80_struc *cpu, u32 value);
void CZ80_FASTCALL Cz80_Set_I(cz80_struc *cpu, u32 value);
#if defined(__cplusplus) && !defined(USE_CPLUS)
};
#if defined(__cplusplus)
}
#endif
#endif // _CZ80_H_
......
......@@ -2,50 +2,25 @@
#include<stdlib.h>
#include<string.h>
//#include "driver.h"
//#include "cpuintrf.h"
#include "race-memory.h"
//#include "z80/z80.h"
#include "cz80.h"
// #include "hack.h"
unsigned char *mame4all_cz80_rom = &mainram[0x3000];
unsigned char *mame4all_cz80_ram = &mainram[0x3000];
cz80_struc RACE_cz80_struc_alloc;
cz80_struc *RACE_cz80_struc=&RACE_cz80_struc_alloc;
void Z80_Init()
void Z80_Init(void)
{
Cz80_Init(RACE_cz80_struc);
}
void Z80_Reset()
void Z80_Reset(void)
{
//unsigned *ctx=(unsigned *)(((unsigned)cpu_getcontext(cpu_getactivecpu())));
//RACE_cz80_struc=(cz80_struc *)&ctx[4];
//Cz80_Init(RACE_cz80_struc);
Cz80_Reset(RACE_cz80_struc);
//ctx[0]=(unsigned)Cz80_Get_PC(RACE_cz80_struc);
}
/*void Z80_GetRegs(Z80_Regs *Regs)
{
unsigned *ctx=(unsigned *)Regs;
ctx[0] = (unsigned)Cz80_Get_PC(RACE_cz80_struc);
}*/
/*void Z80_SetRegs (Z80_Regs *Regs)
{
unsigned *ctx=(unsigned *)Regs;
RACE_cz80_struc=(cz80_struc *)&ctx[4];
Cz80_Set_PC(RACE_cz80_struc,ctx[0]);
}*/
unsigned Z80_GetPC (void)
{
return Cz80_Get_PC(RACE_cz80_struc);
......
......@@ -5,17 +5,13 @@
extern "C" {
#endif
//#include "osd_cpu.h"
//#include "cpuintrf.h"
//#include "DrZ80.h"
/* daisy-chain link */
typedef struct {
void (*reset)(int); /* reset callback */
int (*interrupt_entry)(int); /* entry callback */
void (*interrupt_reti)(int); /* reti callback */
int irq_param; /* callback paramater */
typedef struct
{
void (*reset)(int); /* reset callback */
int (*interrupt_entry)(int); /* entry callback */
void (*interrupt_reti)(int); /* reti callback */
int irq_param; /* callback paramater */
} Z80_DaisyChain;
#define Z80_MAXDAISY 4 /* maximum of daisy chan device */
......
......@@ -118,7 +118,9 @@ Cz80_Exec:
{
Opcode = REAL_FETCH_BYTE;
Cz80_Exec_direct:
{
union16 *data = pzHL;
#include "cz80_op.inc"
}
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment