1 /* pro_mem.c: memory expansion board
2 
3    Copyright (c) 1997-2003, Tarik Isani (xhomer@isani.org)
4 
5    This file is part of Xhomer.
6 
7    Xhomer is free software; you can redistribute it and/or modify
8    it under the terms of the GNU General Public License version 2
9    as published by the Free Software Foundation.
10 
11    Xhomer is distributed in the hope that it will be useful,
12    but WITHOUT ANY WARRANTY; without even the implied warranty of
13    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14    GNU General Public License for more details.
15 
16    You should have received a copy of the GNU General Public License
17    along with Xhomer; if not, write to the Free Software
18    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
19 */
20 
21 
22 /* XXX TBD:
23 		-This peripheral is not emulated yet, due to
24 		 lack of documentation
25 */
26 
27 #ifdef PRO
28 #include "pdp11_defs.h"
29 
30 
31 	unsigned short MEMROM[1024];
32 
33 LOCAL	int	pro_mem_ptr;
34 LOCAL	int	pro_mem_cmd;
35 
36 
37 /* Memory board registers */
38 /* Addresses 17775000-17775002 */
39 
pro_mem_rd(int pa)40 int pro_mem_rd (int pa)
41 {
42 int data;
43 
44 	switch (pa & 017777776)
45 	{
46 	  case 017775000:
47 	    data = MEMROM[pro_mem_ptr++];
48 	    pro_mem_ptr &= 01777;
49 	    break;
50 
51 	  case 017775004:
52 	    data = 020;
53 	    break;
54 
55 	  case 017775006:
56 	    data = pro_mem_cmd;
57 	    break;
58 
59 	  default:
60 	    data = 0;
61 	    break;
62 	}
63 
64 	return data;
65 }
66 
pro_mem_wr(int data,int pa,int access)67 void pro_mem_wr (int data, int pa, int access)
68 {
69 	switch (pa & 017777776)
70 	{
71 	  case 017775002:
72 	    /* Reset memory pointer */
73 
74 	    pro_mem_ptr = 0;
75 	    break;
76 
77 	  case 017775004:
78 	    break;
79 
80 	  case 017775006:
81 	    WRITE_WB(pro_mem_cmd, PRO_MEM_CMD_W, access);
82 	    break;
83 
84 	  default:
85 	    break;
86 	}
87 }
88 
89 
pro_mem_reset()90 void pro_mem_reset ()
91 {
92 	pro_mem_ptr = 0;
93 	pro_mem_cmd = 040;
94 }
95 
96 
pro_mem_exit()97 void pro_mem_exit ()
98 {
99 }
100 #endif
101