Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
alexbevi
GitHub Repository: alexbevi/BizHawk
Path: blob/master/wonderswan/interrupt.h
2 views
1
#ifndef __WSWAN_INTERRUPT_H
2
#define __WSWAN_INTERRUPT_H
3
4
#include "system.h"
5
6
namespace MDFN_IEN_WSWAN
7
{
8
enum
9
{
10
WSINT_SERIAL_SEND = 0,
11
WSINT_KEY_PRESS,
12
WSINT_RTC_ALARM,
13
WSINT_SERIAL_RECV,
14
WSINT_LINE_HIT,
15
WSINT_VBLANK_TIMER,
16
WSINT_VBLANK,
17
WSINT_HBLANK_TIMER
18
};
19
20
class Interrupt
21
{
22
public:
23
void DoInterrupt(unsigned);
24
void AssertInterrupt(unsigned which, bool asserted);
25
void Write(uint32 A, uint8 V);
26
uint8 Read(uint32 A);
27
void Check();
28
void Reset();
29
30
private:
31
uint8 IAsserted;
32
uint8 IStatus;
33
uint8 IEnable;
34
uint8 IVectorBase;
35
36
bool IOn_Cache;
37
uint32 IOn_Which;
38
uint32 IVector_Cache;
39
40
static const uint8 LevelTriggeredMask = (1U << WSINT_SERIAL_RECV);
41
42
private:
43
void Recalc();
44
public:
45
System *sys;
46
template<bool isReader>void SyncState(NewState *ns);
47
};
48
49
}
50
51
#endif
52
53