Previous 15994 Revisions Next

r5153 Sunday 5th July, 2009 at 12:33:10 UTC by Curt Coder
[VCS80] System is now fully working.
[docs]messnew.txt
[src/mess/drivers]vcs80.c
[src/mess/includes]vcs80.h
[src/mess/layout]vcs80.lay

src/mess/includes/vcs80.h
r5152r5153
1010{
1111   /* keyboard state */
1212   int keylatch;
13   int keyclk;
1314
1415   /* devices */
1516   const device_config *z80pio;
src/mess/layout/vcs80.lay
r5152r5153
22<mamelayout version="2">
33   <element name="digit" defstate="0">
44      <led7seg>
5         <color red="0" green="0.75" blue="0.0" />
5         <color red="0.75" green="0" blue="0.0" />
66      </led7seg>
77   </element>
88 
src/mess/drivers/vcs80.c
r5152r5153
7777   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_F) PORT_CHAR('F')
7878
7979   PORT_START("ROW2")
80   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("A+") PORT_CODE(KEYCODE_F1)
81   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("A-") PORT_CODE(KEYCODE_F2)
82   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("MA") PORT_CODE(KEYCODE_F3)
83   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("RE") PORT_CODE(KEYCODE_F4)
84   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("GO") PORT_CODE(KEYCODE_F5)
85   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("TR") PORT_CODE(KEYCODE_F6)
86   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("ST") PORT_CODE(KEYCODE_F7)
87   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("PE") PORT_CODE(KEYCODE_F8)
80   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("A+") PORT_CODE(KEYCODE_UP)
81   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("A-") PORT_CODE(KEYCODE_DOWN)
82   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("MA") PORT_CODE(KEYCODE_M)
83   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("RE") PORT_CODE(KEYCODE_R)
84   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("GO") PORT_CODE(KEYCODE_G)
85   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("TR") PORT_CODE(KEYCODE_T)
86   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("ST") PORT_CODE(KEYCODE_S)
87   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("PE") PORT_CODE(KEYCODE_P)
8888INPUT_PORTS_END
8989
90/* Keyboard HACK */
90/* Z80-PIO Interface */
9191
9292static TIMER_DEVICE_CALLBACK( vcs80_keyboard_tick )
9393{
94   vcs80_state *state = timer->machine->driver_data;
95
96   UINT8 data = 0xf7;
97
98   if (!BIT(input_port_read(timer->machine, "ROW0"), state->keylatch)) data &= ~0x10;
99   if (!BIT(input_port_read(timer->machine, "ROW1"), state->keylatch)) data &= ~0x20;
100   if (!BIT(input_port_read(timer->machine, "ROW2"), state->keylatch)) data &= ~0x40;
101
102   z80pio_p_w(state->z80pio, 0, data);
103
104   z80pio_p_w(state->z80pio, 1, 0x80);
105   z80pio_p_w(state->z80pio, 1, 0x00);
106}
107
108/* Z80-PIO Interface */
109
110static READ8_DEVICE_HANDLER( pio_port_a_r )
111{
11294   /*
11395     
11496      bit      description
11597
116      0      keyboard and led latch bit 0
117      1      keyboard and led latch bit 1
118      2      keyboard and led latch bit 2
119      3      GND
120      4      keyboard row input 0
121      5      keyboard row input 1
122      6      keyboard row input 2
123      7      demultiplexer clock output
98      PA0      keyboard and led latch bit 0
99      PA1      keyboard and led latch bit 1
100      PA2      keyboard and led latch bit 2
101      PA3      GND
102      PA4      keyboard row input 0
103      PA5      keyboard row input 1
104      PA6      keyboard row input 2
105      PA7      demultiplexer clock input
124106
125107   */
126108
127   vcs80_state *state = device->machine->driver_data;
109   vcs80_state *state = timer->machine->driver_data;
128110
129   UINT8 data = 0xf7;
111   UINT8 data = 0;
130112
131   if (!BIT(input_port_read(device->machine, "ROW0"), state->keylatch)) data &= ~0x10;
132   if (!BIT(input_port_read(device->machine, "ROW1"), state->keylatch)) data &= ~0x20;
133   if (!BIT(input_port_read(device->machine, "ROW2"), state->keylatch)) data &= ~0x40;
113   if (state->keyclk)
114   {
115      state->keylatch++;
116      state->keylatch &= 0x07;
117   }
134118
135   return data;
136}
119   data = (state->keyclk << 7) | 0x70 | state->keylatch;
137120
138static WRITE8_DEVICE_HANDLER( pio_port_a_w )
139{
140   /*
141     
142      bit      description
121   if (!BIT(input_port_read(timer->machine, "ROW0"), state->keylatch)) data &= ~0x10;
122   if (!BIT(input_port_read(timer->machine, "ROW1"), state->keylatch)) data &= ~0x20;
123   if (!BIT(input_port_read(timer->machine, "ROW2"), state->keylatch)) data &= ~0x40;
143124
144      0      keyboard and led latch bit 0
145      1      keyboard and led latch bit 1
146      2      keyboard and led latch bit 2
147      3      GND
148      4      keyboard row input 0
149      5      keyboard row input 1
150      6      keyboard row input 2
151      7      demultiplexer clock output
125   z80pio_p_w(state->z80pio, 0, data);
152126
153   */
154
155   vcs80_state *state = device->machine->driver_data;
156
157   state->keylatch = data & 0x07;
127   state->keyclk = !state->keyclk;
158128}
159129
160130static WRITE8_DEVICE_HANDLER( pio_port_b_w )
r5152r5153
163133     
164134      bit      description
165135
166      0      VQD30 segment A
167      1      VQD30 segment B
168      2      VQD30 segment C
169      3      VQD30 segment D
170      4      VQD30 segment E
171      5      VQD30 segment F
172      6      VQD30 segment G
173      7      PIO B/_A
136      PB0      VQD30 segment A
137      PB1      VQD30 segment B
138      PB2      VQD30 segment C
139      PB3      VQD30 segment D
140      PB4      VQD30 segment E
141      PB5      VQD30 segment G
142      PB6      VQD30 segment F
143      PB7      _A0
174144
175145   */
176146
177147   vcs80_state *state = device->machine->driver_data;
178148
149   UINT8 led_data = BITSWAP8(data & 0x7f, 7, 5, 6, 4, 3, 2, 1, 0);
179150   int digit = state->keylatch;
180151
181152   /* skip middle digit */
182153   if (digit > 3) digit++;
183154
184   output_set_digit_value(digit, data & 0x7f);
155   output_set_digit_value(8 - digit, led_data);
185156}
186157
187158static const z80pio_interface pio_intf =
188159{
189160   DEVCB_CPU_INPUT_LINE(Z80_TAG, INPUT_LINE_IRQ0),   /* callback when change interrupt status */
190   DEVCB_HANDLER(pio_port_a_r),   /* port A read callback */
161   DEVCB_NULL,                  /* port A read callback */
191162   DEVCB_NULL,                  /* port B read callback */
192   DEVCB_HANDLER(pio_port_a_w),   /* port A write callback */
163   DEVCB_NULL,                  /* port A write callback */
193164   DEVCB_HANDLER(pio_port_b_w),   /* port B write callback */
194165   DEVCB_NULL,                  /* portA ready active callback */
195166   DEVCB_NULL                  /* portB ready active callback */
r5152r5153
214185
215186   /* register for state saving */
216187   state_save_register_global(machine, state->keylatch);
188   state_save_register_global(machine, state->keyclk);
217189}
218190
219191/* Machine Driver */
r5152r5153
229201
230202    MDRV_MACHINE_START(vcs80)
231203
232   /* keyboard HACK */
204   /* keyboard timer */
233205   MDRV_TIMER_ADD_PERIODIC("keyboard", vcs80_keyboard_tick, HZ(1000))
234206
235207    /* video hardware */
r5152r5153
248220
249221/* System Configuration */
250222
251static SYSTEM_CONFIG_START(vcs80)
223static SYSTEM_CONFIG_START( vcs80 )
252224   CONFIG_RAM_DEFAULT( 1 * 1024 )
253225SYSTEM_CONFIG_END
254226
227/* Driver Initialization */
228
229static DIRECT_UPDATE_HANDLER( vcs80_direct_update_handler )
230{
231   vcs80_state *state = space->machine->driver_data;
232
233   /* _A0 is connected to PIO PB7 */
234   z80pio_p_w(state->z80pio, 1, (!BIT(address, 0)) << 7);
235
236   return address;
237}
238
239static DRIVER_INIT( vcs80 )
240{
241   memory_set_direct_update_handler(cputag_get_address_space(machine, Z80_TAG, ADDRESS_SPACE_PROGRAM), vcs80_direct_update_handler);
242   memory_set_direct_update_handler(cputag_get_address_space(machine, Z80_TAG, ADDRESS_SPACE_IO), vcs80_direct_update_handler);
243}
244
255245/* System Drivers */
256246
257247/*    YEAR   NAME   PARENT   COMPAT   MACHINE   INPUT   INIT   CONFIG   COMPANY            FULLNAME   FLAGS */
258COMP( 1983, vcs80,  0,      0,      vcs80,   vcs80,   0,      vcs80,   "Eckhard Schiller",   "VCS-80",   GAME_NOT_WORKING)
248COMP( 1983, vcs80,  0,      0,      vcs80,   vcs80,   vcs80,   vcs80,   "Eckhard Schiller",   "VCS-80",   GAME_SUPPORTS_SAVE )
docs/messnew.txt
r5152r5153
4747 
4848- [TIKI100] System is now working, except for double sided disks. [Curt Coder]
4949
50- [VCS80] System is now fully working. [Curt Coder]
5051
5152
53
5254User Interface Changes:
5355-----------------------
5456(none)

Previous 15994 Revisions Next


© 1998-2018 The MESS Team