Previous 15994 Revisions Next

r5900 Sunday 27th September, 2009 at 16:25:33 UTC by Angelo Salese
[PC6001]: refactored some stuff, identified where's the keyboard port
[src/mess/drivers]pc6001.c

src/mess/drivers/pc6001.c
r5899r5900
44        NEC PC-6600 series
55
66        12/05/2009 Skeleton driver.
7     
8      PC-6001 (1981-09):
97
8      PC-6001 (1981-09):
9
1010       * CPU: Z80A @ 4 MHz
1111       * ROM: 16KB + 4KB (chargen) - no kanji
1212       * RAM: 16KB, it can be expanded to 32KB
1313       * Text Mode: 32x16 and 2 colors
1414       * Graphic Modes: 64x48 (9 colors), 128x192 (4 colors), 256x192 (2 colors)
1515       * Sound: BEEP + PSG - Optional Voice Synth Cart
16       * Keyboard: JIS Keyboard with 5 function keys, control key, TAB key,
17            HOME/CLR key, INS key, DEL key, GRAPH key, Japanese syllabary
16       * Keyboard: JIS Keyboard with 5 function keys, control key, TAB key,
17            HOME/CLR key, INS key, DEL key, GRAPH key, Japanese syllabary
1818            key, page key, STOP key, and cursor key (4 directions)
19       * 1 cartslot, optional floppy drive, optional serial 232 port, 2
19       * 1 cartslot, optional floppy drive, optional serial 232 port, 2
2020            joystick ports
21   
2221
23      PC-6001 mkII (1983-07):
2422
23      PC-6001 mkII (1983-07):
24
2525       * CPU: Z80A @ 4 MHz
2626       * ROM: 32KB + 16KB (chargen) + 32KB (kanji) + 16KB (Voice Synth)
2727       * RAM: 64KB
28       * Text Mode: same as PC-6001 with N60-BASIC; 40x20 and 15 colors with
28       * Text Mode: same as PC-6001 with N60-BASIC; 40x20 and 15 colors with
2929            N60M-BASIC
30       * Graphic Modes: same as PC-6001 with N60-BASIC; 80x40 (15 colors),
30       * Graphic Modes: same as PC-6001 with N60-BASIC; 80x40 (15 colors),
3131            160x200 (15 colors), 320x200 (4 colors) with N60M-BASIC
3232       * Sound: BEEP + PSG
33       * Keyboard: JIS Keyboard with 5 function keys, control key, TAB key,
34            HOME/CLR key, INS key, DEL key, CAPS key, GRAPH key, Japanese
35            syllabary key, page key, mode key, STOP key, and cursor key (4
33       * Keyboard: JIS Keyboard with 5 function keys, control key, TAB key,
34            HOME/CLR key, INS key, DEL key, CAPS key, GRAPH key, Japanese
35            syllabary key, page key, mode key, STOP key, and cursor key (4
3636            directions)
3737       * 1 cartslot, floppy drive, optional serial 232 port, 2 joystick ports
38   
3938
40      PC-6001 mkIISR (1984-12):
4139
40      PC-6001 mkIISR (1984-12):
41
4242       * CPU: Z80A @ 3.58 MHz
4343       * ROM: 64KB + 16KB (chargen) + 32KB (kanji) + 32KB (Voice Synth)
4444       * RAM: 64KB
45       * Text Mode: same as PC-6001/PC-6001mkII with N60-BASIC; 40x20, 40x25,
45       * Text Mode: same as PC-6001/PC-6001mkII with N60-BASIC; 40x20, 40x25,
4646            80x20, 80x25 and 15 colors with N66SR-BASIC
47       * Graphic Modes: same as PC-6001/PC-6001mkII with N60-BASIC; 80x40 (15 colors),
47       * Graphic Modes: same as PC-6001/PC-6001mkII with N60-BASIC; 80x40 (15 colors),
4848            320x200 (15 colors), 640x200 (15 colors) with N66SR-BASIC
4949       * Sound: BEEP + PSG + FM
50       * Keyboard: JIS Keyboard with 5 function keys, control key, TAB key,
51            HOME/CLR key, INS key, DEL key, CAPS key, GRAPH key, Japanese
52            syllabary key, page key, mode key, STOP key, and cursor key (4
50       * Keyboard: JIS Keyboard with 5 function keys, control key, TAB key,
51            HOME/CLR key, INS key, DEL key, CAPS key, GRAPH key, Japanese
52            syllabary key, page key, mode key, STOP key, and cursor key (4
5353            directions)
5454       * 1 cartslot, floppy drive, optional serial 232 port, 2 joystick ports
55   
5655
56
5757   info from http://www.geocities.jp/retro_zzz/machines/nec/6001/spc60.html
5858
59===
60
61irq vector 00: writes 0x00 to [$fa19]
62irq vector 02: (A = 0, B = 0) tests ppi port c, does something with ay ports (plus more?)
63irq vector 04: uart irq
64irq vector 06: operates with $fa28, $fa2e, $fd1b
65irq vector 08: tests ppi port c, puts port A to $fa1d,puts 0x02 to [$fa19]
66irq vector 0A: writes 0x00 to [$fa19]
67irq vector 0C: writes 0x00 to [$fa19]
68irq vector 0E: same as 2, (A = 0x03, B = 0x00)
69irq vector 10: same as 2, (A = 0x03, B = 0x00)
70irq vector 12: writes 0x10 to [$fa19]
71irq vector 14: same as 2, (A = 0x00, B = 0x01)
72irq vector 16: tests ppi port c, writes the result to $feca.
73
74
5975****************************************************************************/
6076
6177#include "driver.h"
r5899r5900
7187static WRITE8_HANDLER ( pc6001_system_latch_w )
7288{
7389   UINT16 startaddr[] = {0xC000, 0xE000, 0x8000, 0xA000 };
74   
90
7591   pc6001_video_ram =  pc6001_ram + startaddr[(data >> 1) & 0x03] - 0x8000;
7692}
7793
r5899r5900
103119static READ8_DEVICE_HANDLER(nec_ppi8255_r) {
104120   if (offset==2) {
105121      return port_c_8255;
106   } else {
122   }
123   else if(offset==0)
124   {
125      if(input_code_pressed(device->machine,KEYCODE_Z)) //quick kludge test
126         return 0x30;
107127      return i8255a_r(device,offset);
108128   }
129   else {
130      return i8255a_r(device,offset);
131   }
109132}
110133
111134static WRITE8_DEVICE_HANDLER(nec_ppi8255_w) {
r5899r5900
127150   i8255a_w(device,offset,data);
128151}
129152
130static WRITE8_DEVICE_HANDLER(pc6100_ay8910_address_w) {
131   ay8910_address_w(device,offset,data & 0x0f);
132}
133
134153static ADDRESS_MAP_START(pc6001_mem, ADDRESS_SPACE_PROGRAM, 8)
135154   ADDRESS_MAP_UNMAP_HIGH
136155   AM_RANGE(0x0000, 0x7fff) AM_ROM
r5899r5900
143162   AM_RANGE(0x80, 0x80) AM_DEVREADWRITE("uart", msm8251_data_r,msm8251_data_w)
144163   AM_RANGE(0x81, 0x81) AM_DEVREADWRITE("uart", msm8251_status_r,msm8251_control_w)
145164   AM_RANGE(0x90, 0x93) AM_DEVREADWRITE("ppi8255", nec_ppi8255_r, nec_ppi8255_w)
146   AM_RANGE(0xB0, 0xB0) AM_WRITE(pc6001_system_latch_w)
147   AM_RANGE(0xA0, 0xA0) AM_DEVWRITE("ay8910", pc6100_ay8910_address_w)
148   AM_RANGE(0xA1, 0xA1) AM_DEVWRITE("ay8910", ay8910_data_w)   
165   AM_RANGE(0xa0, 0xa0) AM_DEVWRITE("ay8910", ay8910_address_w)
166   AM_RANGE(0xa1, 0xa1) AM_DEVWRITE("ay8910", ay8910_data_w)
167   AM_RANGE(0xa2, 0xa2) AM_DEVREAD("ay8910", ay8910_r)
168   AM_RANGE(0xb0, 0xb0) AM_WRITE(pc6001_system_latch_w)
149169ADDRESS_MAP_END
150170
151171/* Input ports */
r5899r5900
154174      PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("1") PORT_CODE(KEYCODE_1)
155175      PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("2") PORT_CODE(KEYCODE_2)
156176      PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("3") PORT_CODE(KEYCODE_3)
157      PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("4") PORT_CODE(KEYCODE_4)     
177      PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("4") PORT_CODE(KEYCODE_4)
158178      PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("5") PORT_CODE(KEYCODE_5)
159179      PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("6") PORT_CODE(KEYCODE_6)
160180      PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("7") PORT_CODE(KEYCODE_7)
161      PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("8") PORT_CODE(KEYCODE_8)   
181      PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("8") PORT_CODE(KEYCODE_8)
162182INPUT_PORTS_END
163183
164184static UINT8 irq_vector = 0x00;
r5899r5900
166186static INTERRUPT_GEN( pc6001_interrupt )
167187{
168188   irq_vector = 0x16;
169   cpu_set_input_line(device, 0, HOLD_LINE);
189   cpu_set_input_line(device, 0, ASSERT_LINE);
170190}
171191
192static INTERRUPT_GEN( key_irq )
193{
194   irq_vector = 0x14;
195   cpu_set_input_line(device, 0, ASSERT_LINE);
196}
197
172198static IRQ_CALLBACK ( pc6001_irq_callback )
173199{
200   cpu_set_input_line(device, 0, CLEAR_LINE);
174201   return irq_vector;
175202}
176203
r5899r5900
178205{
179206   port_c_8255=0;
180207   pc6001_video_ram =  pc6001_ram;
181   
208
182209   cpu_set_irq_callback(cputag_get_cpu(machine, "maincpu"),pc6001_irq_callback);
183210}
184211
r5899r5900
200227   return 0;
201228}
202229static WRITE8_DEVICE_HANDLER (pc6001_8255_porta_w )
203{   
204//   logerror("pc6001_8255_porta_w %02x\n",data);   
230{
231//   logerror("pc6001_8255_porta_w %02x\n",data);
205232}
206233
207234static READ8_DEVICE_HANDLER (pc6001_8255_portb_r )
r5899r5900
209236   return 0;
210237}
211238static WRITE8_DEVICE_HANDLER (pc6001_8255_portb_w )
212{   
213   //logerror("pc6001_8255_portb_w %02x\n",data);   
239{
240   //logerror("pc6001_8255_portb_w %02x\n",data);
214241}
215242
216243static WRITE8_DEVICE_HANDLER (pc6001_8255_portc_w )
217{     
218   //logerror("pc6001_8255_portc_w %02x\n",data);   
244{
245   //logerror("pc6001_8255_portc_w %02x\n",data);
219246}
220247
221248static READ8_DEVICE_HANDLER (pc6001_8255_portc_r )
222{   
249{
223250   return 0x88;
224251}
225252
r5899r5900
256283   MDRV_CPU_PROGRAM_MAP(pc6001_mem)
257284   MDRV_CPU_IO_MAP(pc6001_io)
258285   MDRV_CPU_VBLANK_INT("screen", pc6001_interrupt)
286   MDRV_CPU_PERIODIC_INT(key_irq,25)
259287
260288//   MDRV_CPU_ADD("subcpu", I8049, 7987200)
261   
289
262290   MDRV_MACHINE_RESET(pc6001)
263291
264   /* video hardware */   
292   /* video hardware */
265293   MDRV_SCREEN_ADD("screen", RASTER)
266294   MDRV_SCREEN_REFRESH_RATE(M6847_NTSC_FRAMES_PER_SECOND)
267295   MDRV_VIDEO_START(pc6001)
r5899r5900
270298   MDRV_SCREEN_SIZE(320, 25+192+26)
271299   MDRV_SCREEN_VISIBLE_AREA(0, 319, 1, 239)
272300
301   MDRV_I8255A_ADD( "ppi8255", pc6001_ppi8255_interface )
302   /* uart */
303   MDRV_MSM8251_ADD("uart", pc6001_usart_interface)
304
273305   MDRV_SPEAKER_STANDARD_MONO("mono")
274306   MDRV_SOUND_ADD("ay8910", AY8910, XTAL_4MHz/2)
275307   MDRV_SOUND_CONFIG(pc6001_ay_interface)
276308   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00)
277   
278   MDRV_I8255A_ADD( "ppi8255", pc6001_ppi8255_interface )
279   /* uart */
280   MDRV_MSM8251_ADD("uart", pc6001_usart_interface)
281   
282309MACHINE_DRIVER_END
283310
284311static MACHINE_DRIVER_START( pc6001sr )

Previous 15994 Revisions Next


© 1998-2018 The MESS Team