Previous 15994 Revisions Next

r4170 Tuesday 20th January, 2009 at 13:45:47 UTC by Robbbert
[ZX] Commit WIP (1) Added sound to pc8300/pow3000/lambda (2) Fixed TV diode for pow3000/lambda (3) Removed TV diode for pc8300 (4) Added /corrected many keyboard labels (5) Marked pow3000/lambda as working (6) Fixed access violation when loading .O file for ZX80 (7) Added notes (8) Can load .O and .P files (9) Some games are playable now.
[src/mess/drivers]zx.c
[src/mess/formats]zx81_p.c
[src/mess/includes]zx.h
[src/mess/machine]zx.c
[src/mess/video]zx.c

src/mess/video/zx.c
r4169r4170
8383      old_x = (new_x + 1) % width;
8484      old_y = new_y;
8585      old_c = color;
86      dac_data_w(0, color ? 255 : 0);
86//      dac_data_w(0, color ? 255 : 0);
8787   }
8888}
8989
src/mess/includes/zx.h
r4169r4170
1212
1313DRIVER_INIT( zx );
1414MACHINE_RESET( zx80 );
15MACHINE_RESET( lambda );
15MACHINE_RESET( pow3000 );
1616MACHINE_RESET( pc8300 );
1717
1818READ8_HANDLER( zx_ram_r );
19READ8_HANDLER ( zx_io_r );
20WRITE8_HANDLER ( zx_io_w );
21
19READ8_HANDLER ( pc8300_io_r );
2220READ8_HANDLER ( pow3000_io_r );
23
2421READ8_HANDLER ( zx80_io_r );
2522WRITE8_HANDLER ( zx80_io_w );
2623READ8_HANDLER ( zx81_io_r );
r4169r4170
3330
3431void zx_ula_bkgnd(running_machine *machine, int color);
3532void zx_ula_r(running_machine *machine, int offs, const char *region, const UINT8 param);
36//void zx_ula_r(running_machine *machine, int offs, const char *region);
37//int zx_ula_r(running_machine *machine, int offs, const char *region);
3833
3934extern emu_timer *ula_nmi;
4035extern int ula_irq_active;
src/mess/machine/zx.c
r4169r4170
1010#include "cpu/z80/z80.h"
1111#include "includes/zx.h"
1212#include "devices/cassette.h"
13#include "sound/speaker.h"
1314
1415#define video_screen_get_refresh(screen)   (((screen_config *)(screen)->inline_config)->refresh)
1516
r4169r4170
2728   UINT8 *RAM = memory_region(space->machine, "main");   
2829   RAM[offset + 0x4000] = data;
2930
30   if ((offset > 0x29) && (offset < 0x400))
31   if (data & 0x40)
3132   {
32      if (data & 0x40)
33      {
34         memory_write_byte (space, offset | 0xc000, data);
35         RAM[offset | 0xc000] = data;
36      }
37      else
38      {
39         memory_write_byte (space, offset | 0xc000, 0);
40         RAM[offset | 0xc000] = 0;
41      }
33      memory_write_byte (space, offset | 0xc000, data);
34      RAM[offset | 0xc000] = data;
4235   }
36   else
37   {
38      memory_write_byte (space, offset | 0xc000, 0);
39      RAM[offset | 0xc000] = 0;
40   }
4341}
4442
4543/* I know this looks really pointless... but it has to be here */
r4169r4170
7270   return address;
7371}
7472
75static DIRECT_UPDATE_HANDLER ( lambda_setdirect )
73static DIRECT_UPDATE_HANDLER ( pow3000_setdirect )
7674{
7775   if (address & 0xc000)
7876      zx_ula_r(space->machine, address, "gfx1", 1);
r4169r4170
8583   zx_tape_bit = 0x80;
8684}
8785
88MACHINE_RESET ( lambda )
86MACHINE_RESET ( pow3000 )
8987{
90   memory_set_direct_update_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), lambda_setdirect);
88   memory_set_direct_update_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), pow3000_setdirect);
9189   zx_tape_bit = 0x80;
9290}
9391
r4169r4170
104102
105103READ8_HANDLER ( zx80_io_r )
106104{
107/* port FE = read keyboard, cass bit and NTSC/PAL diode
108   The upper 8 bits are used to select a keyboard scan line */
105/* port FE = read keyboard, NTSC/PAL diode, and cass bit; turn off HSYNC-generator/cass-out
106   The upper 8 bits are used to select a keyboard scan line
109107
108   The diode doesn't make any visual difference, but it's in the schematic, and used by the code. */
109
110110   UINT8 data = 0xff;
111111   UINT8 offs = offset & 0xff;
112112
r4169r4170
176176READ8_HANDLER ( zx81_io_r )
177177{
178178/* port FB = read printer status, not emulated
179   FE = read keyboard, cass bit and NTSC/PAL diode; turn off HSYNC generator if NMI is off
179   FE = read keyboard, NTSC/PAL diode, and cass bit; turn off HSYNC-generator/cass-out
180180   The upper 8 bits are used to select a keyboard scan line */
181181
182182   UINT8 data = 0xff;
r4169r4170
245245   return data;
246246}
247247
248READ8_HANDLER ( pow3000_io_r )
248READ8_HANDLER ( pc8300_io_r )
249249{
250/* port F5 = sound
251   F6 = unknown
252   FB = read printer status, not emulated
253   FE = read keyboard and cass bit; turn off HSYNC-generator/cass-out
254   The upper 8 bits are used to select a keyboard scan line.
255   No TV diode */
256
250257   UINT8 data = 0xff;
251258   UINT8 offs = offset & 0xff;
259   static UINT8 speaker_state = 0;
252260
261   if (offs == 0xf5)
262   {
263      speaker_state ^= 1;
264      speaker_level_w(0, speaker_state);
265   }
266   else
253267   if (offs == 0xfe)
254268   {
255      UINT8 extra0 = input_port_read(space->machine, "SPC0");
256269      UINT8 extra1 = input_port_read(space->machine, "SPC1");
257270      UINT8 extra2 = input_port_read(space->machine, "SPC2");
258271
259272      if ((offset & 0x0100) == 0)
260273      {
261         data &= input_port_read(space->machine, "ROW0") & extra0;
274         data &= input_port_read(space->machine, "ROW0");
262275         /* SHIFT for extra keys */
263         if (extra0 != 0xff || extra1 != 0xff || extra2 != 0xff)
276         if (extra1 != 0xff || extra2 != 0xff)
264277            data &= ~0x01;
265278      }
266279      if ((offset & 0x0200) == 0)
r4169r4170
268281      if ((offset & 0x0400) == 0)
269282         data &= input_port_read(space->machine, "ROW2");
270283      if ((offset & 0x0800) == 0)
271         data &= input_port_read(space->machine, "ROW3");
284         data &= input_port_read(space->machine, "ROW3") & extra1;
272285      if ((offset & 0x1000) == 0)
273         data &= input_port_read(space->machine, "ROW4");
286         data &= input_port_read(space->machine, "ROW4") & extra2;
274287      if ((offset & 0x2000) == 0)
275288         data &= input_port_read(space->machine, "ROW5");
276289      if ((offset & 0x4000) == 0)
277         data &= input_port_read(space->machine, "ROW6") & extra1;
290         data &= input_port_read(space->machine, "ROW6");
278291      if ((offset & 0x8000) == 0)
279         data &= input_port_read(space->machine, "ROW7") & extra2;
292         data &= input_port_read(space->machine, "ROW7");
280293
281      if (!input_port_read(space->machine, "CONFIG"))
282         data &= ~0x40;
283
284294      cassette_output(devtag_get_device(space->machine, CASSETTE, "cassette"), +0.75);
285295
286296      if (ula_irq_active)
287297      {
288298         zx_ula_bkgnd(space->machine, 0);
289299         ula_irq_active = 0;
290         LOG_ZX81_IOR("ULA IRQs off");
300
301//         LOG_ZX81_IOR("ULA IRQs off");
291302      }
292303      else
293304      {
r4169r4170
299310
300311         data &= ~zx_tape_bit;
301312
302         LOG_ZX81_IOR("Tape");
313//         LOG_ZX81_IOR("Tape");
303314      }
304315      if (ula_frame_vsync == 3)
305316      {
r4169r4170
308319      }
309320   }
310321   else
311      LOG_ZX81_IOR("Unknown port");
322      LOG_ZX81_IOR("Unmapped port");
312323
313324   return data;
314325}
315326
316WRITE8_HANDLER( zx80_io_w )
327READ8_HANDLER ( pow3000_io_r )
317328{
318/* port FF = write HSYNC and cass data */
319   
320   UINT8 offs = offset & 0xff;
329/* port 7E = read NTSC/PAL diode
330   F5 = sound
331   F6 = unknown
332   FB = read printer status, not emulated
333   FE = read keyboard and cass bit; turn off HSYNC-generator/cass-out
334   The upper 8 bits are used to select a keyboard scan line */
321335
322   if (offs == 0xff)
323      cassette_output(devtag_get_device(space->machine, CASSETTE, "cassette"), -0.75);
324   else
325      LOG_ZX81_IOR("Unmapped port");
326}
327
328WRITE8_HANDLER ( zx81_io_w )
329{
330/* port FB = write data to printer
331   FD = turn off NMI generator
332   FE = turn on NMI generator
333   FF = write HSYNC and cass data */
334
335   const device_config *screen = video_screen_first(space->machine->config);
336   int height = video_screen_get_height(screen);
336   UINT8 data = 0xff;
337337   UINT8 offs = offset & 0xff;
338   static UINT8 speaker_state = 0;
338339
339   if (offs == 0xfd)
340   if (offs == 0x7e)
340341   {
341      timer_reset(ula_nmi, attotime_never);
342
343      LOG_ZX81_IOW("ULA NMIs off");
342      data = (input_port_read(space->machine, "CONFIG"));
344343   }
345344   else
346   if (offs == 0xfe)
345   if (offs == 0xf5)
347346   {
348      timer_adjust_periodic(ula_nmi, attotime_zero, 0, cpu_clocks_to_attotime(space->machine->cpu[0], 207));
349
350      LOG_ZX81_IOW("ULA NMIs on");
351
352      /* remove the IRQ */
353      ula_irq_active = 0;
347      speaker_state ^= 1;
348      speaker_level_w(0, speaker_state);
354349   }
355350   else
356   if (offs == 0xff)
351   if (offs == 0xfe)
357352   {
358      cassette_output(devtag_get_device(space->machine, CASSETTE, "cassette"), -0.75);
359      zx_ula_bkgnd(space->machine, 1);
360      if (ula_frame_vsync == 2)
361      {
362         cpu_spinuntil_time(space->cpu,video_screen_get_time_until_pos(space->machine->primary_screen, height - 1, 0));
363         ula_scanline_count = height - 1;
364         logerror ("S: %d B: %d\n", video_screen_get_vpos(space->machine->primary_screen), video_screen_get_hpos(space->machine->primary_screen));
365      }
353      UINT8 extra0 = input_port_read(space->machine, "SPC0");
354      UINT8 extra1 = input_port_read(space->machine, "SPC1");
355      UINT8 extra2 = input_port_read(space->machine, "SPC2");
366356
367      LOG_ZX81_IOW("ULA IRQs on");
368   }
369   else
370      LOG_ZX81_IOR("Unmapped port");
371}
372
373READ8_HANDLER ( zx_io_r )
374{
375   const device_config *screen = video_screen_first(space->machine->config);
376   int data = 0xff;
377
378   if ((offset & 1) == 0)
379   {
380      int extra1 = input_port_read(space->machine, "SPC0");
381      int extra2 = input_port_read(space->machine, "SPC1");
382
383//      ula_scancode_count = 0;
384357      if ((offset & 0x0100) == 0)
385358      {
386         data &= input_port_read(space->machine, "ROW0");
359         data &= input_port_read(space->machine, "ROW0") & extra0;
387360         /* SHIFT for extra keys */
388         if (extra1 != 0xff || extra2 != 0xff)
361         if (extra0 != 0xff || extra1 != 0xff || extra2 != 0xff)
389362            data &= ~0x01;
390363      }
391364      if ((offset & 0x0200) == 0)
r4169r4170
393366      if ((offset & 0x0400) == 0)
394367         data &= input_port_read(space->machine, "ROW2");
395368      if ((offset & 0x0800) == 0)
396         data &= input_port_read(space->machine, "ROW3") & extra1;
369         data &= input_port_read(space->machine, "ROW3");
397370      if ((offset & 0x1000) == 0)
398         data &= input_port_read(space->machine, "ROW4") & extra2;
371         data &= input_port_read(space->machine, "ROW4");
399372      if ((offset & 0x2000) == 0)
400373         data &= input_port_read(space->machine, "ROW5");
401374      if ((offset & 0x4000) == 0)
402         data &= input_port_read(space->machine, "ROW6");
375         data &= input_port_read(space->machine, "ROW6") & extra1;
403376      if ((offset & 0x8000) == 0)
404         data &= input_port_read(space->machine, "ROW7");
405      if (video_screen_get_refresh(screen) > 55)
406         data &= ~0x40;
377         data &= input_port_read(space->machine, "ROW7") & extra2;
407378
379      cassette_output(devtag_get_device(space->machine, CASSETTE, "cassette"), +0.75);
380
408381      if (ula_irq_active)
409382      {
410383         zx_ula_bkgnd(space->machine, 0);
411384         ula_irq_active = 0;
412
413385         LOG_ZX81_IOR("ULA IRQs off");
414386      }
415387      else
r4169r4170
422394
423395         data &= ~zx_tape_bit;
424396
425         LOG_ZX81_IOR("Tape");
397//         LOG_ZX81_IOR("Tape");
426398      }
427399      if (ula_frame_vsync == 3)
428400      {
r4169r4170
431403      }
432404   }
433405   else
434      LOG_ZX81_IOR("Unmapped port");
406      LOG_ZX81_IOR("Unknown port");
435407
436408   return data;
437409}
438410
439WRITE8_HANDLER ( zx_io_w )
411WRITE8_HANDLER( zx80_io_w )
440412{
441/* port FB = write data to printer
413/* port FF = write HSYNC and cass data */
414   
415   UINT8 offs = offset & 0xff;
416
417   if (offs == 0xff)
418      cassette_output(devtag_get_device(space->machine, CASSETTE, "cassette"), -0.75);
419   else
420      LOG_ZX81_IOR("Unmapped port");
421}
422
423WRITE8_HANDLER ( zx81_io_w )
424{
425/* port F5 = unknown, pc8300/pow3000/lambda only
426   F6 = unknown, pc8300/pow3000/lambda only
427   FB = write data to printer, not emulated
442428   FD = turn off NMI generator
443429   FE = turn on NMI generator
444430   FF = write HSYNC and cass data */
r4169r4170
447433   int height = video_screen_get_height(screen);
448434   UINT8 offs = offset & 0xff;
449435
450   if (!(offs & 2))
436   if (offs == 0xfd)
451437   {
452438      timer_reset(ula_nmi, attotime_never);
453439
454440      LOG_ZX81_IOW("ULA NMIs off");
455441   }
456442   else
457   if (!(offs & 1))
443   if (offs == 0xfe)
458444   {
459445      timer_adjust_periodic(ula_nmi, attotime_zero, 0, cpu_clocks_to_attotime(space->machine->cpu[0], 207));
460446
r4169r4170
464450      ula_irq_active = 0;
465451   }
466452   else
467//   if (offs == 0xff)
453   if (offs == 0xff)
468454   {
455      cassette_output(devtag_get_device(space->machine, CASSETTE, "cassette"), -0.75);
469456      zx_ula_bkgnd(space->machine, 1);
470457      if (ula_frame_vsync == 2)
471458      {
r4169r4170
476463
477464      LOG_ZX81_IOW("ULA IRQs on");
478465   }
479//   else
480//      LOG_ZX81_IOR("Unmapped port");
466   else
467      LOG_ZX81_IOR("Unmapped port");
481468}
469
src/mess/formats/zx81_p.c
r4169r4170
5151#define ZX81_START_LOAD_ADDRESS   0x4009
5252#define ZX80_START_LOAD_ADDRESS   0x4000
5353#define ZX81_DATA_LENGTH_OFFSET   0x0b
54#define ZX80_DATA_LENGTH_OFFSET   0x04
5455
5556static UINT8 zx_file_name[128];
5657static UINT16 real_data_length = 0;
r4169r4170
236237   unsigned int number_of_0_data = 0;
237238   unsigned int number_of_1_data = 0;
238239
239   real_data_length = bytes[ZX81_DATA_LENGTH_OFFSET] + bytes[ZX81_DATA_LENGTH_OFFSET+1]*256 - ZX81_START_LOAD_ADDRESS;
240   real_data_length = bytes[ZX80_DATA_LENGTH_OFFSET] + bytes[ZX80_DATA_LENGTH_OFFSET+1]*256 - ZX80_START_LOAD_ADDRESS - 1;
240241
241242   number_of_1_data = zx81_cassette_calculate_number_of_1(bytes, real_data_length);
242243   number_of_0_data = length*8-number_of_1_data;
src/mess/drivers/zx.c
r4169r4170
1212           Some cleanups. Two non-working TESTDRIVERS added.
1313        14.05.2004 Finally fixed and readded.
1414
15    Changes done by Robbbert in Jan 2009:
16   - Added the NTSC/PAL diode to all systems except pc8300 which doesn't support it.
17   - Applied NTSC timings to pc8300 only, all others depend on the diode.
18   - Many keyboard fixes, and descriptions added to keys.
19   - All ram packs up to 32k are supported.
20   - Fixed .O files from causing an access violation.
21   - Enabled cassette saving.
22   - Many general fixes to pow3000/lambda.
23   - Added sound to pc8300/pow3000/lambda.
24
1525    To do:
16    Tape saving (needs changes in video hardware emulation).
1726    Some memory areas are not mirrored as they should.
18    Video hardware is not fully emulated, so it does not support pseudo
19    hi-res and hi-res modes.
27    Video hardware is not fully emulated, so it does not support pseudo hi-res and hi-res modes.
2028    Some memory packs are unemulated.
29    h4th and tree4th need their address maps worked out (eg, the stack is set to FB80)
30    Most games don't work
2131
22Current issues: 4th and tree4th need their address maps worked out (eg, the stack is set to FB80)
23      All drivers: Screen issues, and run extremely slowly
2432
25
2633****************************************************************************/
2734
2835#include "driver.h"
2936#include "cpu/z80/z80.h"
30#include "sound/dac.h"
37//#include "sound/dac.h"
38#include "sound/speaker.h"
3139#include "sound/wave.h"
3240#include "includes/zx.h"
3341#include "devices/cassette.h"
r4169r4170
3644/* Memory Maps */
3745
3846static ADDRESS_MAP_START( zx80_map, ADDRESS_SPACE_PROGRAM, 8 )
39   AM_RANGE(0x0000, 0x3fff) AM_ROM
40   AM_RANGE(0xc000, 0xcfff) AM_RAM AM_READWRITE(zx_ram_r,SMH_NOP)
47   AM_RANGE(0x0000, 0x1fff) AM_ROM
48   AM_RANGE(0x2000, 0x3fff) AM_READNOP AM_WRITENOP
49   AM_RANGE(0xc000, 0xffff) AM_RAM AM_READWRITE(zx_ram_r,SMH_NOP)
4150ADDRESS_MAP_END
4251
4352static ADDRESS_MAP_START( zx80_io_map, ADDRESS_SPACE_IO, 8 )
r4169r4170
4857   AM_RANGE(0x0000, 0xffff) AM_READWRITE(zx81_io_r, zx81_io_w)
4958ADDRESS_MAP_END
5059
60static ADDRESS_MAP_START( pc8300_io_map, ADDRESS_SPACE_IO, 8 )
61   AM_RANGE(0x0000, 0xffff) AM_READWRITE(pc8300_io_r, zx81_io_w)
62ADDRESS_MAP_END
63
5164static ADDRESS_MAP_START( pow3000_io_map, ADDRESS_SPACE_IO, 8 )
5265   AM_RANGE(0x0000, 0xffff) AM_READWRITE(pow3000_io_r, zx81_io_w)
5366ADDRESS_MAP_END
r4169r4170
5568/* Input Ports */
5669
5770static INPUT_PORTS_START( zx80 )
58   PORT_START("RAM")
59
6071   PORT_START("ROW0")
6172   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("SHIFT") PORT_CODE(KEYCODE_LSHIFT) PORT_CHAR(UCHAR_SHIFT_1)
62   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Z") PORT_CODE(KEYCODE_Z) PORT_CHAR('Z')
63   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("X") PORT_CODE(KEYCODE_X) PORT_CHAR('X')
64   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("C") PORT_CODE(KEYCODE_C) PORT_CHAR('C')
65   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("V") PORT_CODE(KEYCODE_V) PORT_CHAR('V')
73   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Z :") PORT_CODE(KEYCODE_Z) PORT_CHAR('Z')
74   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("X ; CLEAR") PORT_CODE(KEYCODE_X) PORT_CHAR('X')
75   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("C ? CLS") PORT_CODE(KEYCODE_C) PORT_CHAR('C')
76   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("V / GOSUB") PORT_CODE(KEYCODE_V) PORT_CHAR('V')
6677   PORT_BIT( 0xe0, IP_ACTIVE_LOW, IPT_UNUSED )
6778
6879   PORT_START("ROW1")
69   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("A") PORT_CODE(KEYCODE_A) PORT_CHAR('A')
70   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("S") PORT_CODE(KEYCODE_S) PORT_CHAR('S')
71   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("D") PORT_CODE(KEYCODE_D) PORT_CHAR('D')
72   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("F") PORT_CODE(KEYCODE_F) PORT_CHAR('F')
73   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("G") PORT_CODE(KEYCODE_G) PORT_CHAR('G')
80   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("A LIST") PORT_CODE(KEYCODE_A) PORT_CHAR('A')
81   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("S STOP") PORT_CODE(KEYCODE_S) PORT_CHAR('S')
82   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("D DIM") PORT_CODE(KEYCODE_D) PORT_CHAR('D')
83   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("F FOR") PORT_CODE(KEYCODE_F) PORT_CHAR('F')
84   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("G GOTO") PORT_CODE(KEYCODE_G) PORT_CHAR('G')
7485   PORT_BIT( 0xe0, IP_ACTIVE_LOW, IPT_UNUSED )
7586
7687   PORT_START("ROW2")
77   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Q") PORT_CODE(KEYCODE_Q) PORT_CHAR('Q')
78   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("W") PORT_CODE(KEYCODE_W) PORT_CHAR('W')
79   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("E") PORT_CODE(KEYCODE_E) PORT_CHAR('E')
80   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("R") PORT_CODE(KEYCODE_R) PORT_CHAR('R')
81   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("T") PORT_CODE(KEYCODE_T) PORT_CHAR('T')
88   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Q NEW") PORT_CODE(KEYCODE_Q) PORT_CHAR('Q')
89   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("W LOAD") PORT_CODE(KEYCODE_W) PORT_CHAR('W')
90   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("E SAVE") PORT_CODE(KEYCODE_E) PORT_CHAR('E')
91   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("R RUN") PORT_CODE(KEYCODE_R) PORT_CHAR('R')
92   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("T CONT") PORT_CODE(KEYCODE_T) PORT_CHAR('T')
8293   PORT_BIT( 0xe0, IP_ACTIVE_LOW, IPT_UNUSED )
8394
8495   PORT_START("ROW3")
85   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("1 EDIT") PORT_CODE(KEYCODE_1) PORT_CHAR('1')
96   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("1 NOT") PORT_CODE(KEYCODE_1) PORT_CHAR('1')
8697   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("2 AND") PORT_CODE(KEYCODE_2) PORT_CHAR('2')
8798   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("3 THEN") PORT_CODE(KEYCODE_3) PORT_CHAR('3')
8899   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("4 TO") PORT_CODE(KEYCODE_4) PORT_CHAR('4')
r4169r4170
91102
92103   PORT_START("ROW4")
93104   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("0 RUBOUT") PORT_CODE(KEYCODE_0) PORT_CHAR('0')
94   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("9 GRAPHICS") PORT_CODE(KEYCODE_9) PORT_CHAR('9')
105   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("9 HOME") PORT_CODE(KEYCODE_9) PORT_CHAR('9')
95106   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("8 RIGHT") PORT_CODE(KEYCODE_8) PORT_CHAR('8')
96107   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("7 UP") PORT_CODE(KEYCODE_7) PORT_CHAR('7')
97108   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("6 DOWN") PORT_CODE(KEYCODE_6) PORT_CHAR('6')
98109   PORT_BIT( 0xe0, IP_ACTIVE_LOW, IPT_UNUSED )
99110
100111   PORT_START("ROW5")
101   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("P PRINT") PORT_CODE(KEYCODE_P) PORT_CHAR('P')
102   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("O POKE") PORT_CODE(KEYCODE_O) PORT_CHAR('O')
103   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("I INPUT") PORT_CODE(KEYCODE_I) PORT_CHAR('I')
104   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("U IF") PORT_CODE(KEYCODE_U) PORT_CHAR('U')
105   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Y RETURN") PORT_CODE(KEYCODE_Y) PORT_CHAR('Y')
112   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("P *") PORT_CODE(KEYCODE_P) PORT_CHAR('P')
113   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("O ) PRINT") PORT_CODE(KEYCODE_O) PORT_CHAR('O')
114   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("I ( INPUT") PORT_CODE(KEYCODE_I) PORT_CHAR('I')
115   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("U $ IF") PORT_CODE(KEYCODE_U) PORT_CHAR('U')
116   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Y \" REM") PORT_CODE(KEYCODE_Y) PORT_CHAR('Y')
106117   PORT_BIT( 0xe0, IP_ACTIVE_LOW, IPT_UNUSED )
107118
108119   PORT_START("ROW6")
109   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("ENTER") PORT_CODE(KEYCODE_ENTER) PORT_CHAR(13)
110   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("L") PORT_CODE(KEYCODE_L) PORT_CHAR('L')
111   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("K") PORT_CODE(KEYCODE_K) PORT_CHAR('K')
112   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("J") PORT_CODE(KEYCODE_J) PORT_CHAR('J')
113   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("H") PORT_CODE(KEYCODE_H) PORT_CHAR('H')
120   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("NEWLINE EDIT") PORT_CODE(KEYCODE_ENTER) PORT_CHAR(13)
121   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("L =") PORT_CODE(KEYCODE_L) PORT_CHAR('L')
122   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("K + LET") PORT_CODE(KEYCODE_K) PORT_CHAR('K')
123   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("J - RAND") PORT_CODE(KEYCODE_J) PORT_CHAR('J')
124   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("H ** POKE") PORT_CODE(KEYCODE_H) PORT_CHAR('H')
114125   PORT_BIT( 0xe0, IP_ACTIVE_LOW, IPT_UNUSED )
115126
116127   PORT_START("ROW7")
117   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("SPACE \xC2\xA3") PORT_CODE(KEYCODE_SPACE) PORT_CHAR(' ') PORT_CHAR('\xA3')
128   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("SPACE \xC2\xA3 BREAK") PORT_CODE(KEYCODE_SPACE) PORT_CHAR(' ') PORT_CHAR('\xA3')
118129   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME(". ,") PORT_CODE(KEYCODE_STOP) PORT_CHAR('.') PORT_CHAR(',')
119130   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("M >") PORT_CODE(KEYCODE_M) PORT_CHAR('M') PORT_CHAR('>')
120   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("N >") PORT_CODE(KEYCODE_N) PORT_CHAR('N') PORT_CHAR('<')
121   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("B") PORT_CODE(KEYCODE_B) PORT_CHAR('B')
131   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("N < NEXT") PORT_CODE(KEYCODE_N) PORT_CHAR('N') PORT_CHAR('<')
132   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("B OR RET") PORT_CODE(KEYCODE_B) PORT_CHAR('B')
122133   PORT_BIT( 0xe0, IP_ACTIVE_LOW, IPT_UNUSED )
123134
124135   PORT_START("SPC1")   /* special keys 1 */
r4169r4170
127138
128139   PORT_START("SPC2")   /* special keys 2 */
129140   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("BACKSPACE") PORT_CODE(KEYCODE_BACKSPACE) PORT_CHAR(8)
130   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("GRAPHICS") PORT_CODE(KEYCODE_LALT) PORT_CHAR(UCHAR_SHIFT_2)
131141   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("\xE2\x86\x92") PORT_CODE(KEYCODE_RIGHT) PORT_CHAR(UCHAR_MAMEKEY(RIGHT))
132142   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("\xE2\x86\x91") PORT_CODE(KEYCODE_UP) PORT_CHAR(UCHAR_MAMEKEY(UP))
133143   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("\xE2\x86\x93") PORT_CODE(KEYCODE_DOWN) PORT_CHAR(UCHAR_MAMEKEY(DOWN))
134   PORT_BIT( 0xe0, IP_ACTIVE_LOW, IPT_UNUSED )
144   PORT_BIT( 0xe2, IP_ACTIVE_LOW, IPT_UNUSED )
135145
136146   PORT_START("CONFIG")   /* config diode on main board */
137147   PORT_CONFNAME( 0x40, 0x40, "TV system")
r4169r4170
139149   PORT_CONFSETTING(    0x40, "PAL")
140150INPUT_PORTS_END
141151
142static INPUT_PORTS_START( zx81 )
152static INPUT_PORTS_START( pc8300 )
143153   PORT_START("ROW0")
144154   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("SHIFT") PORT_CODE(KEYCODE_LSHIFT) PORT_CHAR(UCHAR_SHIFT_1)
145155   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Z :") PORT_CODE(KEYCODE_Z) PORT_CHAR('Z') PORT_CHAR(':')
r4169r4170
215225   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("\xE2\x86\x91") PORT_CODE(KEYCODE_UP) PORT_CHAR(UCHAR_MAMEKEY(UP))
216226   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("\xE2\x86\x93") PORT_CODE(KEYCODE_DOWN) PORT_CHAR(UCHAR_MAMEKEY(DOWN))
217227   PORT_BIT( 0xe0, IP_ACTIVE_LOW, IPT_UNUSED )
228INPUT_PORTS_END
218229
230static INPUT_PORTS_START( zx81 )
231   PORT_INCLUDE(pc8300)
232
219233   PORT_START("CONFIG")   /* config diode on main board */
220234   PORT_CONFNAME( 0x40, 0x40, "TV system")
221235   PORT_CONFSETTING(    0x00, "NTSC")
r4169r4170
303317   PORT_BIT( 0xe5, IP_ACTIVE_LOW, IPT_UNUSED)
304318
305319   PORT_START("CONFIG")   /* config diode on main board */
306   PORT_CONFNAME( 0x40, 0x00, "TV system")
320   PORT_CONFNAME( 0x01, 0x00, "TV system")
307321   PORT_CONFSETTING(    0x00, "NTSC")
308   PORT_CONFSETTING(    0x40, "PAL")
322   PORT_CONFSETTING(    0x01, "PAL")
309323INPUT_PORTS_END
310324
311325/* Graphics Layouts */
r4169r4170
337351   GFXDECODE_ENTRY( "gfx1", 0x0000, zx_char_layout, 0, 2 )
338352GFXDECODE_END
339353
340static GFXDECODE_START( pow3000 )
341   GFXDECODE_ENTRY( "gfx1", 0x0000, zx_char_layout, 0, 2 )
342GFXDECODE_END
343354
344355/* Palette Initialization */
345356
r4169r4170
419430   MDRV_VIDEO_EOF(zx)
420431   MDRV_VIDEO_UPDATE(generic_bitmapped)
421432
422   // sound hardware
433
434   /* sound hardware */
423435   MDRV_SPEAKER_STANDARD_MONO("mono")
424   MDRV_SOUND_ADD("dac", DAC, 0)
425   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
436//   MDRV_SOUND_ADD("dac", DAC, 0)
437   MDRV_SOUND_ADD("speaker", SPEAKER, 0)
438   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.75)
426439   MDRV_SOUND_ADD("cassette", WAVE, 0)
427   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
440   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.30)
428441
429442   MDRV_CASSETTE_ADD( "cassette", zx80_cassette_config )
430443MACHINE_DRIVER_END
r4169r4170
443456static MACHINE_DRIVER_START( ts1000 )
444457   MDRV_IMPORT_FROM(zx81)
445458
446   MDRV_SCREEN_MODIFY("main")
447   MDRV_SCREEN_REFRESH_RATE(ZX81_NTSC_FRAMES_PER_SECOND)
448   MDRV_SCREEN_SIZE(ZX81_PIXELS_PER_SCANLINE, ZX81_NTSC_SCANLINES)
449   MDRV_SCREEN_VISIBLE_AREA(0, ZX81_PIXELS_PER_SCANLINE-1, 0, ZX81_NTSC_SCANLINES-1)
450
451459   MDRV_PALETTE_INIT(ts1000)
452460MACHINE_DRIVER_END
453461
454462static MACHINE_DRIVER_START( pc8300 )
455   MDRV_IMPORT_FROM(ts1000)
463   MDRV_IMPORT_FROM(zx81)
456464
457465   MDRV_CPU_MODIFY("main")
466   MDRV_CPU_IO_MAP(pc8300_io_map, 0)
458467
459468   MDRV_MACHINE_RESET(pc8300)
469
470   MDRV_SCREEN_MODIFY("main")
471   MDRV_SCREEN_REFRESH_RATE(ZX81_NTSC_FRAMES_PER_SECOND)
472   MDRV_SCREEN_SIZE(ZX81_PIXELS_PER_SCANLINE, ZX81_NTSC_SCANLINES)
473   MDRV_SCREEN_VISIBLE_AREA(0, ZX81_PIXELS_PER_SCANLINE-1, 0, ZX81_NTSC_SCANLINES-1)
474
460475   MDRV_GFXDECODE(pc8300)
461476   MDRV_PALETTE_INIT(zx80)
462477MACHINE_DRIVER_END
463478
464479static MACHINE_DRIVER_START( pow3000 )
465   MDRV_IMPORT_FROM(ts1000)
480   MDRV_IMPORT_FROM(zx81)
466481
467482   MDRV_CPU_MODIFY("main")
468483   MDRV_CPU_IO_MAP(pow3000_io_map, 0)
469484
470   MDRV_MACHINE_RESET(lambda)
471   MDRV_GFXDECODE(pow3000)
485   MDRV_MACHINE_RESET(pow3000)
486   MDRV_GFXDECODE(pc8300)
472487   MDRV_PALETTE_INIT(zx80)
473488MACHINE_DRIVER_END
474489
475static MACHINE_DRIVER_START( lambda )
476   MDRV_IMPORT_FROM(ts1000)
477490
478   MDRV_CPU_MODIFY("main")
479   MDRV_CPU_IO_MAP(pow3000_io_map, 0)
480
481   MDRV_MACHINE_RESET(lambda)
482   MDRV_GFXDECODE(pc8300)
483   MDRV_PALETTE_INIT(zx80)
484MACHINE_DRIVER_END
485
486491/* ROMs */
487492
488493ROM_START(zx80)
r4169r4170
560565COMP( 1980, zx80,       0,      0,      zx80,       zx80,       zx,     zx80,   "Sinclair Research",        "ZX-80",                                        0 )
561566COMP( 1981, zx81,       0,      0,      zx81,       zx81,       zx,     zx81,   "Sinclair Research",        "ZX-81",                                        0 )
562567COMP( 1982, ts1000,     zx81,   0,      ts1000,     zx81,       zx,     zx81,   "Timex Sinclair",           "Timex Sinclair 1000",                          0 )
563COMP( 1984, pc8300,     zx81,   0,      pc8300,     zx81,       zx,     pc8300, "Your Computer",            "PC8300",                                       0 )
564COMP( 1983, pow3000,    zx81,   0,      pow3000,    pow3000,    zx,     pc8300, "Creon Enterprises",        "Power 3000",                                   GAME_NOT_WORKING )
565COMP( 1982, lambda,     zx81,   0,      lambda,     pow3000,    zx,     pc8300, "Lambda Electronics Ltd",   "Lambda 8300",                                  GAME_NOT_WORKING )
568COMP( 1984, pc8300,     zx81,   0,      pc8300,     pc8300,     zx,     pc8300, "Your Computer",            "PC8300",                                       0 )
569COMP( 1983, pow3000,    zx81,   0,      pow3000,    pow3000,    zx,     pc8300, "Creon Enterprises",        "Power 3000",                                   0 )
570COMP( 1982, lambda,     zx81,   0,      pow3000,    pow3000,    zx,     pc8300, "Lambda Electronics Ltd",   "Lambda 8300",                                  0 )

Previous 15994 Revisions Next


© 1998-2018 The MESS Team