forked from CeRiAl/Xhomer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpro_mem.c
100 lines (72 loc) · 1.72 KB
/
pro_mem.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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
/* pro_mem.c: memory expansion board
Copyright (c) 1997-2003, Tarik Isani (xhomer@isani.org)
This file is part of Xhomer.
Xhomer is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License version 2
as published by the Free Software Foundation.
Xhomer is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Xhomer; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* XXX TBD:
-This peripheral is not emulated yet, due to
lack of documentation
*/
#ifdef PRO
#include "pdp11_defs.h"
unsigned short MEMROM[1024];
LOCAL int pro_mem_ptr;
LOCAL int pro_mem_cmd;
/* Memory board registers */
/* Addresses 17775000-17775002 */
int pro_mem_rd (int pa)
{
int data;
switch (pa & 017777776)
{
case 017775000:
data = MEMROM[pro_mem_ptr++];
pro_mem_ptr &= 01777;
break;
case 017775004:
data = 020;
break;
case 017775006:
data = pro_mem_cmd;
break;
default:
data = 0;
break;
}
return data;
}
void pro_mem_wr (int data, int pa, int access)
{
switch (pa & 017777776)
{
case 017775002:
/* Reset memory pointer */
pro_mem_ptr = 0;
break;
case 017775004:
break;
case 017775006:
WRITE_WB(pro_mem_cmd, PRO_MEM_CMD_W, access);
break;
default:
break;
}
}
void pro_mem_reset ()
{
pro_mem_ptr = 0;
pro_mem_cmd = 040;
}
void pro_mem_exit ()
{
}
#endif