1 #ifndef __PCFX_PCFX_H
2 #define __PCFX_PCFX_H
3
4 #include "../mednafen.h"
5 #include "../state.h"
6 #include "../general.h"
7 #include "v810/v810_cpu.h"
8 #include "../hw_video/huc6270/vdc.h"
9
10 #define PCFX_MASTER_CLOCK 21477272.72
11
12 #if 0
13 #define FXDBG(format, ...) MDFN_DebugPrint(format, ## __VA_ARGS__)
14 #elif defined(_WIN32)
FXDBG(const char * format,...)15 static inline void FXDBG(const char *format, ...) { (void)0; }
16 #else
17 #define FXDBG(format, ...) ((void)0)
18 #endif
19
MDFN_FastU32MemsetM8(uint32_t * array,uint32_t value_32,unsigned int u32len)20 static INLINE void MDFN_FastU32MemsetM8(uint32_t *array, uint32_t value_32, unsigned int u32len)
21 {
22 uint32_t *ai;
23
24 for(ai = array; ai < array + u32len; ai += 2)
25 {
26 ai[0] = value_32;
27 ai[1] = value_32;
28 }
29 }
30
31 extern V810 PCFX_V810;
32
33 uint8 MDFN_FASTCALL mem_peekbyte(const v810_timestamp_t timestamp, const uint32 A);
34 uint16 MDFN_FASTCALL mem_peekhword(const v810_timestamp_t timestamp, const uint32 A);
35
36 int32 MDFN_FASTCALL pcfx_event_handler(const v810_timestamp_t timestamp);
37
38 void ForceEventUpdates(const uint32 timestamp);
39
40 extern VDC *fx_vdc_chips[2];
41
42 #define REGSETHW(_reg, _data, _msh) { _reg &= 0xFFFF << (_msh ? 0 : 16); _reg |= _data << (_msh ? 16 : 0); }
43 #define REGGETHW(_reg, _msh) ((_reg >> (_msh ? 16 : 0)) & 0xFFFF)
44
45 enum
46 {
47 PCFX_EVENT_PAD = 0,
48 PCFX_EVENT_TIMER,
49 PCFX_EVENT_KING,
50 PCFX_EVENT_ADPCM
51 };
52
53 #define PCFX_EVENT_NONONO 0x7fffffff
54
55 void PCFX_SetEvent(const int type, const v810_timestamp_t next_timestamp);
56
57
58 #endif
59