-
Notifications
You must be signed in to change notification settings - Fork 6
/
int-r8810.c
56 lines (36 loc) · 1.2 KB
/
int-r8810.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
//------------------------------------------------------------------------------
// EMU86 - R8810 interrupt controller
//------------------------------------------------------------------------------
#include "emu-int.h"
#include "int-r8810.h"
#define INT_REG_VECT 0
#define INT_REG_EOI 1
int _int_line_max = INT_LINE_MAX;
int _int_prio_max = INT_PRIO_MAX;
// Timers are edge triggered
int _int_mode [INT_LINE_MAX] =
{ 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0};
int _int_prio [INT_LINE_MAX] =
{ 0, 7, 1, 2, 3, 4, 5, 6, 7, 7, 0, 0, 7};
int _int_vect [INT_LINE_MAX] =
{ 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x10, 0x11, 0x12, 0x13, 0x14 };
int _int_mask [INT_LINE_MAX] =
{ 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0}; // FIXME: unmask timer & serial by program
int _int_req [INT_LINE_MAX] =
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
int _int_serv [INT_LINE_MAX] =
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
// PIC I/O write
int int_io_write (word_t p, word_t w)
{
int r = p >> 1;
if (r == INT_REG_EOI) {
if ((w & 0x001F) == 0x0008) int_end_line (INT_LINE_TIMER0);
if ((w & 0x001F) == 0x0014) int_end_line (INT_LINE_SERIAL);
}
return 0;
}
// PIC initialization
void int_init (void)
{
}