Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Libretro
RACE
Commits
b9a379c6
Commit
b9a379c6
authored
Oct 04, 2020
by
Libretro-Admin
Browse files
Convert cz80.cpp and cz80_support.cpp to C
parent
51417ce9
Changes
6
Hide whitespace changes
Inline
Side-by-side
Makefile.common
View file @
b9a379c6
...
...
@@ -55,8 +55,8 @@ ifeq ($(DRZ80),1)
SOURCES_ASM
:=
$(CORE_DIR)
/DrZ80.s
else
FLAGS
+=
-DCZ80
SOURCES_C
XX
+=
$(CORE_DIR)
/cz80.c
pp
\
$(CORE_DIR)
/cz80_support.c
pp
SOURCES_C
+=
$(CORE_DIR)
/cz80.c
\
$(CORE_DIR)
/cz80_support.c
endif
...
...
cz80.c
pp
→
cz80.c
View file @
b9a379c6
File moved
cz80.h
View file @
b9a379c6
...
...
@@ -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_
...
...
cz80_support.c
pp
→
cz80_support.c
View file @
b9a379c6
...
...
@@ -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
);
...
...
cz80_support.h
View file @
b9a379c6
...
...
@@ -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 */
...
...
cz80exec.inc
View file @
b9a379c6
...
...
@@ -118,7 +118,9 @@ Cz80_Exec:
{
Opcode
=
REAL_FETCH_BYTE
;
Cz80_Exec_direct
:
{
union16
*
data
=
pzHL
;
#include "cz80_op.inc"
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment