Convert v30mz.cpp to C

This commit is contained in:
twinaphex 2020-10-04 14:47:02 +02:00
parent 734c3e5943
commit d18b0d906b
3 changed files with 14 additions and 14 deletions

View File

@ -21,13 +21,13 @@ ifneq ($(HAVE_GRIFFIN),1)
SOURCES_CXX += \ SOURCES_CXX += \
$(CORE_EMU_DIR)/gfx.cpp \ $(CORE_EMU_DIR)/gfx.cpp \
$(CORE_EMU_DIR)/wswan-memory.cpp \ $(CORE_EMU_DIR)/wswan-memory.cpp \
$(CORE_EMU_DIR)/v30mz.cpp \
$(CORE_EMU_DIR)/sound.cpp $(CORE_EMU_DIR)/sound.cpp
SOURCES_C += \ SOURCES_C += \
$(CORE_EMU_DIR)/interrupt.c \ $(CORE_EMU_DIR)/interrupt.c \
$(CORE_EMU_DIR)/rtc.c \ $(CORE_EMU_DIR)/rtc.c \
$(CORE_EMU_DIR)/tcache.c \ $(CORE_EMU_DIR)/tcache.c \
$(CORE_EMU_DIR)/v30mz.c \
$(CORE_EMU_DIR)/eeprom.c $(CORE_EMU_DIR)/eeprom.c
endif endif

View File

@ -136,7 +136,7 @@ static INLINE void i_real_popf(void)
/***************************************************************************/ /***************************************************************************/
extern "C" void v30mz_init(uint8 (*readmem20)(uint32), void (*writemem20)(uint32,uint8), uint8 (*readport)(uint32), void (*writeport)(uint32, uint8)) void v30mz_init(uint8 (*readmem20)(uint32), void (*writemem20)(uint32,uint8), uint8 (*readport)(uint32), void (*writeport)(uint32, uint8))
{ {
cpu_readmem20 = readmem20; cpu_readmem20 = readmem20;
cpu_writemem20 = writemem20; cpu_writemem20 = writemem20;
@ -145,7 +145,7 @@ extern "C" void v30mz_init(uint8 (*readmem20)(uint32), void (*writemem20)(uint32
cpu_writeport = writeport; cpu_writeport = writeport;
} }
extern "C" void v30mz_reset(void) void v30mz_reset(void)
{ {
unsigned i; unsigned i;
const BREGS reg_name[8] = { AL, CL, DL, BL, AH, CH, DH, BH }; const BREGS reg_name[8] = { AL, CL, DL, BL, AH, CH, DH, BH };
@ -187,7 +187,7 @@ extern "C" void v30mz_reset(void)
InHLT = 0; InHLT = 0;
} }
extern "C" void v30mz_int(uint32 vector, bool IgnoreIF) void v30mz_int(uint32 vector, bool IgnoreIF)
{ {
InHLT = false; // This is correct! Standby mode is always exited when there is an INT signal, regardless of whether interrupt are disabled. InHLT = false; // This is correct! Standby mode is always exited when there is an INT signal, regardless of whether interrupt are disabled.
if(I.IF || IgnoreIF) if(I.IF || IgnoreIF)
@ -1013,7 +1013,7 @@ unsigned v30mz_get_reg(int regnum)
void nec_set_irq_line(int irqline, int state); void nec_set_irq_line(int irqline, int state);
extern "C" void v30mz_set_reg(int regnum, unsigned val) void v30mz_set_reg(int regnum, unsigned val)
{ {
switch( regnum ) switch( regnum )
{ {
@ -1144,7 +1144,7 @@ void v30mz_execute(int cycles)
} }
extern "C" int v30mz_StateAction(StateMem *sm, int load, int data_only) int v30mz_StateAction(StateMem *sm, int load, int data_only)
{ {
uint16 PSW; uint16 PSW;

View File

@ -21,6 +21,10 @@ enum
NEC_DS0 NEC_DS0
}; };
#ifdef __cplusplus
extern "C" {
#endif
/* Public variables */ /* Public variables */
extern int32 v30mz_ICount; extern int32 v30mz_ICount;
@ -29,9 +33,6 @@ void v30mz_execute(int cycles);
unsigned v30mz_get_reg(int regnum); unsigned v30mz_get_reg(int regnum);
#ifdef __cplusplus
extern "C" {
#endif
extern uint32 v30mz_timestamp; extern uint32 v30mz_timestamp;
void v30mz_init(uint8 (*readmem20)(uint32), void (*writemem20)(uint32,uint8), uint8 (*readport)(uint32), void (*writeport)(uint32, uint8)); void v30mz_init(uint8 (*readmem20)(uint32), void (*writemem20)(uint32,uint8), uint8 (*readport)(uint32), void (*writeport)(uint32, uint8));
@ -39,15 +40,14 @@ void v30mz_set_reg(int, unsigned);
void v30mz_reset(void); void v30mz_reset(void);
void v30mz_int(uint32 vector, bool IgnoreIF); void v30mz_int(uint32 vector, bool IgnoreIF);
int v30mz_StateAction(StateMem *sm, int load, int data_only); int v30mz_StateAction(StateMem *sm, int load, int data_only);
#ifdef __cplusplus
}
#endif
#ifdef WANT_DEBUGGER #ifdef WANT_DEBUGGER
void v30mz_debug(void (*CPUHook)(uint32), uint8 (*ReadHook)(uint32), void (*WriteHook)(uint32, uint8), uint8 (*PortReadHook)(uint32), void (*PortWriteHook)(uint32, uint8), void v30mz_debug(void (*CPUHook)(uint32), uint8 (*ReadHook)(uint32), void (*WriteHook)(uint32, uint8), uint8 (*PortReadHook)(uint32), void (*PortWriteHook)(uint32, uint8),
void (*BranchTraceHook)(uint16 from_CS, uint16 from_IP, uint16 to_CS, uint16 to_IP, bool interrupt) ); void (*BranchTraceHook)(uint16 from_CS, uint16 from_IP, uint16 to_CS, uint16 to_IP, bool interrupt) );
#endif #endif
#ifdef __cplusplus
}
#endif
#endif #endif