| 1 | #ifndef __MDFN_PCE_ARCADE_CARD_H |
| 2 | #define __MDFN_PCE_ARCADE_CARD_H |
| 3 | |
| 4 | typedef struct |
| 5 | { |
| 6 | uint32 base; // 24 bits |
| 7 | uint16 offset; // 16 bits |
| 8 | uint16 increment; // 16 bits |
| 9 | uint8 control; // 7 bits |
| 10 | } ACPort_t; |
| 11 | |
| 12 | typedef struct |
| 13 | { |
| 14 | ACPort_t ports[4]; |
| 15 | uint32 shift_latch; // 32 bits |
| 16 | uint8 shift_bits; // signed 4-bit value |
| 17 | uint8 rotate_bits; // same |
| 18 | } ArcadeCard_t; |
| 19 | |
| 20 | class ArcadeCard |
| 21 | { |
| 22 | public: |
| 23 | |
| 24 | ArcadeCard(void); |
| 25 | ~ArcadeCard(); |
| 26 | |
| 27 | void Power(void); |
| 28 | int StateAction(StateMem *sm, int load, int data_only); |
| 29 | |
| 30 | uint8 Read(uint32 A, bool peek = false); // Pass peek as true if you don't want side-effects from this read(IE in a debugger). |
| 31 | void Write(uint32 A, uint8 V); |
| 32 | |
| 33 | INLINE void PhysWrite(uint32 A, uint8 V) |
| 34 | { |
| 35 | Write(0x1a00 | ((A >> 9) & 0x30), V); |
| 36 | } |
| 37 | |
| 38 | INLINE uint8 PhysRead(uint32 A, bool peek = false) |
| 39 | { |
| 40 | return(Read(0x1a00 | ((A >> 9) & 0x30), peek)); |
| 41 | } |
| 42 | |
| 43 | |
| 44 | void PeekRAM(uint32 Address, uint32 Length, uint8 *Buffer); |
| 45 | void PokeRAM(uint32 Address, uint32 Length, const uint8 *Buffer); |
| 46 | |
| 47 | private: |
| 48 | |
| 49 | ArcadeCard_t AC; |
| 50 | |
| 51 | bool ACRAMUsed; |
| 52 | uint8 ACRAM[0x200000]; |
| 53 | }; |
| 54 | |
| 55 | #endif |