Previous 15994 Revisions Next

r4990 Thursday 11th June, 2009 at 08:46:27 UTC by Miodrag Milanović
[ZRT80] Driver added, working video, and correct DIP switches
[docs]messnew.txt
[src/mess]mess.mak messdriv.c
[src/mess/drivers]zrt80.c*

src/mess/messdriv.c
r4989r4990
13981398    DRIVER( bw14 )
13991399    DRIVER( sdk86 )
14001400    DRIVER( vboy )
1401    DRIVER( zrt80 )
14011402
14021403#endif /* DRIVER_RECURSIVE */
src/mess/mess.mak
r4989r4990
14431443   $(MESS_DRIVERS)/bondwell.o \
14441444   $(MESS_DRIVERS)/sdk86.o \
14451445   $(MESS_DRIVERS)/vboy.o \
1446   $(MESS_DRIVERS)/zrt80.o \
14461447   
14471448#-------------------------------------------------
14481449# layout dependencies
src/mess/drivers/zrt80.c
r0r4990
1/***************************************************************************
2   
3        DEC ZRT-80
4 
5        12/05/2009 Skeleton driver.
6 
7****************************************************************************/
8 
9#include "driver.h"
10#include "cpu/z80/z80.h"
11#include "video/mc6845.h"
12#include "machine/ins8250.h"
13 
14static UINT8 *video_ram;
15 
16static ADDRESS_MAP_START(zrt80_mem, ADDRESS_SPACE_PROGRAM, 8)
17   ADDRESS_MAP_UNMAP_HIGH
18   AM_RANGE(0x0000, 0x0fff) AM_ROM // Z25 - Main firmware
19   AM_RANGE(0x1000, 0x1fff) AM_ROM // Z24 - Expansion
20   AM_RANGE(0x4000, 0x43ff) AM_RAM   // Board RAM
21   // Normaly video RAM is 0x800 but could be expanded up to 8K
22   AM_RANGE(0xc000, 0xdfff) AM_RAM    AM_BASE(&video_ram) // Video RAM
23   
24ADDRESS_MAP_END
25 
26static ADDRESS_MAP_START( zrt80_io , ADDRESS_SPACE_IO, 8)
27   ADDRESS_MAP_UNMAP_HIGH
28   ADDRESS_MAP_GLOBAL_MASK(0xff)
29   AM_RANGE(0x00, 0x07) AM_DEVREADWRITE("ins8250", ins8250_r, ins8250_w )
30   AM_RANGE(0x08, 0x08) AM_DEVWRITE("crtc", mc6845_address_w)
31   AM_RANGE(0x09, 0x09) AM_DEVREADWRITE("crtc", mc6845_register_r , mc6845_register_w)
32   AM_RANGE(0x18, 0x18) AM_READ_PORT("DIPSW2")
33   AM_RANGE(0x20, 0x20) AM_READ_PORT("DIPSW3")
34ADDRESS_MAP_END
35 
36/* Input ports */
37INPUT_PORTS_START( zrt80 )
38   PORT_START("DIPSW1")
39      PORT_DIPNAME( 0x01, 0x01, "Composite Sync" )
40      PORT_DIPSETTING(    0x01, "Negative" )
41      PORT_DIPSETTING(    0x00, "Positive" )
42      PORT_DIPNAME( 0x02, 0x02, "Vertical Sync" )
43      PORT_DIPSETTING(    0x02, "Negative" )
44      PORT_DIPSETTING(    0x00, "Positive" )
45      PORT_DIPNAME( 0x04, 0x00, "Video" )
46      PORT_DIPSETTING(    0x04, "Negative" )
47      PORT_DIPSETTING(    0x00, "Positive" )
48      PORT_DIPNAME( 0x08, 0x08, "Keypad" )
49      PORT_DIPSETTING(    0x08, "Numeric" )
50      PORT_DIPSETTING(    0x00, "Alternate Keyboard" )
51      PORT_DIPNAME( 0x10, 0x10, "Horizontal Sync" )
52      PORT_DIPSETTING(    0x10, "Negative" )
53      PORT_DIPSETTING(    0x00, "Positive" ) 
54      PORT_DIPNAME( 0x20, 0x20, "CPU" )
55      PORT_DIPSETTING(    0x20, "Operating" )
56      PORT_DIPSETTING(    0x00, "Reset" )
57      PORT_DIPNAME( 0x40, 0x40, "Keyboard strobe" )
58      PORT_DIPSETTING(    0x40, "Negative" )
59      PORT_DIPSETTING(    0x00, "Positive" )
60      PORT_DIPNAME( 0x80, 0x00, "Beeper" )
61      PORT_DIPSETTING(    0x80, "Silent" )
62      PORT_DIPSETTING(    0x00, "Enable" ) 
63   PORT_START("DIPSW2")
64      PORT_DIPNAME( 0x0f, 0x05, "Baud rate" )
65      PORT_DIPSETTING(    0x00, "50" )
66      PORT_DIPSETTING(    0x01, "75" )
67      PORT_DIPSETTING(    0x02, "110" )
68      PORT_DIPSETTING(    0x03, "134.5" )
69      PORT_DIPSETTING(    0x04, "150" )
70      PORT_DIPSETTING(    0x05, "300" )
71      PORT_DIPSETTING(    0x06, "600" )
72      PORT_DIPSETTING(    0x07, "1200" )
73      PORT_DIPSETTING(    0x08, "1800" )
74      PORT_DIPSETTING(    0x09, "2000" )
75      PORT_DIPSETTING(    0x0a, "2400" )
76      PORT_DIPSETTING(    0x0b, "3600" )
77      PORT_DIPSETTING(    0x0c, "4800" )
78      PORT_DIPSETTING(    0x0d, "7200" )
79      PORT_DIPSETTING(    0x0e, "9600" )
80      PORT_DIPSETTING(    0x0f, "19200" )
81      PORT_DIPNAME( 0x30, 0x20, "Parity" )
82      PORT_DIPSETTING(    0x00, "Odd" )
83      PORT_DIPSETTING(    0x10, "Even" )
84      PORT_DIPSETTING(    0x20, "Marking" )
85      PORT_DIPSETTING(    0x30, "Spacing" )
86      PORT_DIPNAME( 0x40, 0x40, "Handshake" )
87      PORT_DIPSETTING(    0x40, "CTS" )
88      PORT_DIPSETTING(    0x00, "XON/XOFF" )
89      PORT_DIPNAME( 0x80, 0x80, "Line Feed" )
90      PORT_DIPSETTING(    0x80, "No LF on CR" )
91      PORT_DIPSETTING(    0x00, "Auto" ) 
92   PORT_START("DIPSW3")
93      PORT_DIPNAME( 0x07, 0x07, "Video" )
94      PORT_DIPSETTING(    0x00, "96 x 24 15750Hz, 50Hz" )
95      PORT_DIPSETTING(    0x01, "80 x 48 15750Hz, 50Hz" )
96      PORT_DIPSETTING(    0x02, "80 x 24 15750Hz, 50Hz" )       
97      PORT_DIPSETTING(    0x03, "96 x 24 15750Hz, 60Hz" )
98      PORT_DIPSETTING(    0x04, "80 x 48 18700Hz, 50Hz" )
99      PORT_DIPSETTING(    0x05, "80 x 24 17540Hz, 60Hz" )
100      PORT_DIPSETTING(    0x06, "80 x 48 15750Hz, 60Hz" )
101      PORT_DIPSETTING(    0x07, "80 x 24 15750Hz, 60Hz" )
102      PORT_DIPNAME( 0x18, 0x18, "Emulation" )
103      PORT_DIPSETTING(    0x00, "Adds" )
104      PORT_DIPSETTING(    0x08, "Beehive" )
105      PORT_DIPSETTING(    0x10, "LSI ADM-3" )
106      PORT_DIPSETTING(    0x18, "Heath H-19" )
107      PORT_DIPNAME( 0x20, 0x20, "Mode" )
108      PORT_DIPSETTING(    0x20, "Line" )
109      PORT_DIPSETTING(    0x00, "Local" )
110      PORT_DIPNAME( 0x40, 0x40, "Duplex" )
111      PORT_DIPSETTING(    0x40, "Full" )
112      PORT_DIPSETTING(    0x00, "Half" )
113      PORT_DIPNAME( 0x80, 0x80, "Wraparound" )
114      PORT_DIPSETTING(    0x80, "Disabled" )
115      PORT_DIPSETTING(    0x00, "Enabled" ) 
116INPUT_PORTS_END
117 
118 
119static MACHINE_RESET(zrt80) 
120{   
121}
122 
123VIDEO_START( zrt80 )
124{
125}
126 
127static VIDEO_UPDATE( zrt80 )
128{
129   const device_config *mc6845 = devtag_get_device(screen->machine, "crtc");
130   mc6845_update(mc6845, bitmap, cliprect);
131   return 0;
132}
133 
134static MC6845_UPDATE_ROW( zrt80_update_row )
135{
136   UINT8 *charrom = memory_region(device->machine, "chargen");
137 
138   int column, bit;
139 
140   for (column = 0; column < x_count; column++)
141   {
142      UINT8 code = video_ram[ma + column] & 0x7f;
143      UINT16 addr = code << 4 | (ra & 0x0f);
144      UINT8 data = charrom[addr & 0x7ff];
145 
146      for (bit = 0; bit < 8; bit++)
147      {
148         int x = (column * 8) + bit;
149         int color = BIT(data, 7) ? 1 : 0;
150         if (input_port_read(device->machine, "DIPSW1") & 0x04) {
151            color = color ? 0 : 1;
152         }
153             
154         *BITMAP_ADDR16(bitmap, y, x) = color;
155 
156         data <<= 1;
157      }
158   }
159}
160 
161static const mc6845_interface zrt80_crtc6845_interface =
162{
163   "screen",
164   8 /*?*/,
165   NULL,
166   zrt80_update_row,
167   NULL,
168   NULL,
169   NULL,
170   NULL
171};
172 
173static INS8250_INTERRUPT( zrt80_com_interrupt )
174{
175   logerror("com int\r\n");
176}
177 
178static const ins8250_interface zrt80_com_interface =
179{
180   2457600,
181   zrt80_com_interrupt,
182   NULL,
183   NULL,
184   NULL
185};
186static MACHINE_DRIVER_START( zrt80 )
187    /* basic machine hardware */
188    MDRV_CPU_ADD("maincpu",Z80, XTAL_2_4576MHz)
189    MDRV_CPU_PROGRAM_MAP(zrt80_mem)
190    MDRV_CPU_IO_MAP(zrt80_io)   
191 
192    MDRV_MACHINE_RESET(zrt80)
193   
194    /* video hardware */
195    /* video hardware */
196   MDRV_SCREEN_ADD("screen", RASTER)
197   MDRV_SCREEN_REFRESH_RATE(60)
198   MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)) /* not accurate */
199   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
200   MDRV_SCREEN_SIZE(640, 200)
201   MDRV_SCREEN_VISIBLE_AREA(0, 640 - 1, 0, 200 - 1)
202   MDRV_PALETTE_LENGTH(2)
203   MDRV_PALETTE_INIT(black_and_white)
204 
205   MDRV_MC6845_ADD("crtc", MC6845, XTAL_20MHz / 8, zrt80_crtc6845_interface) 
206 
207    MDRV_VIDEO_START(zrt80)
208    MDRV_VIDEO_UPDATE(zrt80)
209     
210    MDRV_INS8250_ADD( "ins8250", zrt80_com_interface )
211MACHINE_DRIVER_END
212 
213static SYSTEM_CONFIG_START(zrt80)
214SYSTEM_CONFIG_END
215 
216/* ROM definition */
217ROM_START( zrt80 )
218    ROM_REGION( 0x10000, "maincpu", ROMREGION_ERASEFF )
219   ROM_LOAD( "zrt80mon.z25", 0x0000, 0x1000, CRC(e6ea96dc) SHA1(e3075e30bb2b85f9288d0b8b8cdf1d2b4f7586fd))
220   //z24 is 2nd chip, used as expansion
221   ROM_REGION( 0x0800, "chargen", 0 )
222   ROM_LOAD( "zrt80chr.z30", 0x0000, 0x0800, CRC(4dbdc60f) SHA1(20e393f7207a8440029c8290cdf2f121d317a37e))
223ROM_END
224 
225/* Driver */
226 
227/*    YEAR  NAME    PARENT  COMPAT   MACHINE    INPUT    INIT    CONFIG COMPANY   FULLNAME       FLAGS */
228COMP( 1982, zrt80,  0,       0,    zrt80,    zrt80,     0,       zrt80,      "Digital Research Computers",   "ZRT-80",      GAME_NOT_WORKING)
229 
docs/messnew.txt
r4989r4990
88------------------
99- Intel SDK-86
1010- Nintendo Virtual Boy
11- ZRT-80
1112
1213
1314System Driver Changes:

Previous 15994 Revisions Next


© 1998-2018 The MESS Team