Previous 15994 Revisions Next

r5034 Tuesday 16th June, 2009 at 18:11:42 UTC by Wilbert Pol
Added support for Nuova Elettronica Z80NE + LX.388 + LX.390 [Roberto Lavarone]

Changes to the wd17xx implementation:
- Added support for head loaded feedback from floppy drive.
- Busy flag was cleared too early.
- Added support for the WD1771. [Roberto Lavarone]

Added natural keyboard support to KR2376. [Roberto Lavarone]
[docs]messnew.txt
[src/mess]mess.mak messdriv.c
[src/mess/drivers]z80ne.c
[src/mess/formats]z80ne_dsk.c* z80ne_dsk.h*
[src/mess/includes]z80ne.h
[src/mess/layout]z80ne.lay z80net.lay z80netb.lay z80netf.lay*
[src/mess/machine]kr2376.c kr2376.h wd17xx.c wd17xx.h z80ne.c
[src/mess/video]z80ne.c

src/mess/video/z80ne.c
r5033r5034
88
99***************************************************************************/
1010
11#include "driver.h"
12#include "video/m6847.h"
13#include "includes/z80ne.h"
14
15
16/*
11/* MC6847 pin connections:
1712 * GM0 to GND
1813 * GM1 to GND
1914 * GM2 to GND
r5033r5034
2924 * 1  0    0     1     1   Semigraphic 6
3025 * 1  1    1     0     0   Inverted Alphanumeric
3126 */
27
28
29#include "driver.h"
30#include "video/m6847.h"
31#include "includes/z80ne.h"
32
33#define M6847_RGB(r,g,b)   ((r << 16) | (g << 8) | (b << 0))
34
35static const UINT32 lx388palette[] =
36{
37   M6847_RGB(0x00, 0xff, 0x00),   /* GREEN */
38   M6847_RGB(0x00, 0xff, 0x00),   /* YELLOW in original, here GREEN */
39   M6847_RGB(0x00, 0x00, 0xff),   /* BLUE */
40   M6847_RGB(0xff, 0x00, 0x00),   /* RED */
41   M6847_RGB(0xff, 0xff, 0xff),   /* BUFF */
42   M6847_RGB(0x00, 0xff, 0xff),   /* CYAN */
43   M6847_RGB(0xff, 0x00, 0xff),   /* MAGENTA */
44   M6847_RGB(0xff, 0x80, 0x00),   /* ORANGE */
45
46   M6847_RGB(0x00, 0x20, 0x00),   /* BLACK in original, here DARK green */
47   M6847_RGB(0x00, 0xff, 0x00),   /* GREEN */
48   M6847_RGB(0x00, 0x00, 0x00),   /* BLACK */
49   M6847_RGB(0xff, 0xff, 0xff),   /* BUFF */
50
51   M6847_RGB(0x00, 0x20, 0x00),   /* ALPHANUMERIC DARK GREEN */
52   M6847_RGB(0x00, 0xff, 0x00),   /* ALPHANUMERIC BRIGHT GREEN */
53   M6847_RGB(0x40, 0x10, 0x00),   /* ALPHANUMERIC DARK ORANGE */
54   M6847_RGB(0xff, 0xc4, 0x18)      /* ALPHANUMERIC BRIGHT ORANGE */
55};
56
3257static ATTR_CONST UINT8 lx388_get_attributes(running_machine *machine, UINT8 c, int scanline, int pos)
3358{
3459   UINT8 result = 0x00;
r5033r5034
5580   cfg.type = M6847_VERSION_ORIGINAL_PAL;
5681   cfg.get_attributes = lx388_get_attributes;
5782   cfg.get_video_ram = lx388_get_video_ram;
83   cfg.custom_palette = lx388palette;
5884   m6847_init(machine, &cfg);
5985}
src/mess/includes/z80ne.h
r5033r5034
1111#ifndef Z80NE_H_
1212#define Z80NE_H_
1313
14#include "machine/wd17xx.h"
15
1416/***************************************************************************
1517    CONSTANTS
1618***************************************************************************/
r5033r5034
3537WRITE8_HANDLER(lx385_ctrl_w);
3638READ8_HANDLER(lx388_data_r);
3739READ8_HANDLER(lx388_read_field_sync);
40READ8_DEVICE_HANDLER(lx390_fdc_r);
41WRITE8_DEVICE_HANDLER(lx390_fdc_w);
42READ8_DEVICE_HANDLER(lx390_reset_bank);
43WRITE8_DEVICE_HANDLER(lx390_motor_w);
3844
45
3946DRIVER_INIT(z80ne);
4047DRIVER_INIT(z80net);
4148DRIVER_INIT(z80netb);
49DRIVER_INIT(z80netf);
4250MACHINE_RESET(z80ne);
4351MACHINE_RESET(z80net);
4452MACHINE_RESET(z80netb);
53MACHINE_RESET(z80netf);
4554MACHINE_START(z80ne);
4655MACHINE_START(z80net);
4756MACHINE_START(z80netb);
57MACHINE_START(z80netf);
4858
59extern const wd17xx_interface z80ne_wd17xx_interface;
60DEVICE_IMAGE_LOAD( z80ne_floppy );
61
4962INPUT_CHANGED(z80ne_reset);
5063INPUT_CHANGED(z80ne_nmi);
5164
src/mess/messdriv.c
r5033r5034
12651265    DRIVER( z80ne )         /* 1980 - Z80NE */
12661266    DRIVER( z80net )        /* 1980 - Z80NE + LX388 Video Interface */
12671267    DRIVER( z80netb )       /* 1980 - Z80NE + LX388 Video Interface + 16Kb BASIC */
1268    DRIVER( z80netf )      /* 1980 - Z80NE + LX.388 Video Interface + LX.390 FD Controller */
12681269
12691270    /* Talking Electronics Magazine */
12701271    DRIVER( tec1 )          /* Talking Electronics Computer */
src/mess/machine/kr2376.c
r5033r5034
1515   // normal
1616   {
1717      //  Y0    Y1    Y2    Y3    Y4    Y5    Y6    Y7    Y8    Y9   Y10
18      // NUL   SOH   STX   ETX   EOT   ENQ   ACK   BEL   DC1    P     O        X0
1819      { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x11, 0x50, 0x30 }, // X0
20      // DLE   K     L     N     M     NAK   SYN   ETB   CAN   EM    SUB       X1
1921      { 0x10, 0x4b, 0x4c, 0x4e, 0x4d, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1a }, // X1
22      // -     FS    GS    RS    US    <     >     ,     SP    .     _         X2
2023      { 0x2d, 0x1c, 0x1d, 0x1e, 0x1f, 0x3c, 0x3e, 0x2c, 0x20, 0x2e, 0x5f }, // X2
24      // 0     :     p     _     @     BS    [     ]     CR    LF    DEL       X3
2125      { 0x30, 0x3a, 0x70, 0x5f, 0x40, 0x08, 0x5B, 0x5d, 0x0d, 0x0a, 0x7f }, // X3
2226      { 0x3b, 0x2f, 0x2e, 0x2c, 0x6d, 0x6e, 0x62, 0x76, 0x63, 0x78, 0x7a }, // X4
2327      { 0x6c, 0x6b, 0x6a, 0x68, 0x67, 0x66, 0x64, 0x73, 0x61, 0x0c, 0x1b }, // X5
r5033r5034
2832   // shift
2933   {
3034      //  Y0    Y1    Y2    Y3    Y4    Y5    Y6    Y7    Y8    Y9   Y10
35      // NUL   SOH   STX   ETX   EOT   ENQ   ACK   BEL   DC1    @     _        X0
3136      { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x11, 0x40, 0x5f }, // X0
32      { 0x10, 0x5b, 0x60, 0x5e, 0x5d, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1a }, // X1
37      // DLE   [     \     ^     ]     NAK   SYN   ETB   CAN   EM    SUB       X1
38      { 0x10, 0x5b, 0x5c, 0x5e, 0x5d, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1a }, // X1
39      // =     FS    GS    RS    US    <     >     ,     SP    .     _         X2
3340      { 0x3d, 0x1c, 0x1d, 0x1e, 0x1f, 0x3c, 0x3e, 0x2c, 0x20, 0x2e, 0x5f }, // X2
34      { 0x00, 0x2a, 0x50, 0x7f, 0x60, 0x08, 0x7B, 0x7d, 0x0d, 0x0a, 0x7f }, // X3
41      // NUL   *     P     DEL   `     BS    {     }     CR    LF    DEL       X3
42      { 0x00, 0x2a, 0x50, 0x7f, 0x60, 0x08, 0x7b, 0x7d, 0x0d, 0x0a, 0x7f }, // X3
3543      { 0x2b, 0x3f, 0x3e, 0x3c, 0x4d, 0x4e, 0x42, 0x56, 0x43, 0x58, 0x5a }, // X4
3644      { 0x4c, 0x4b, 0x4a, 0x48, 0x47, 0x46, 0x44, 0x53, 0x41, 0x0c, 0x1b }, // X5
3745      { 0x4f, 0x49, 0x55, 0x59, 0x54, 0x52, 0x45, 0x57, 0x51, 0x09, 0x0b }, // X6
r5033r5034
4149   // control
4250   {
4351      //  Y0    Y1    Y2    Y3    Y4    Y5    Y6    Y7    Y8    Y9   Y10
52      // NUL   SOH   STX   ETX   EOT   ENQ   ACK   BEL   DC1   DLE   SI        X0
4453      { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x11, 0x10, 0x0f }, // X0
54      // DLE   VT    FF    SO    CR    NAK   SYN   ETB   CAN   EM    SUB       X1
4555      { 0x10, 0x0b, 0x0c, 0x0e, 0x0d, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1a }, // X1
56      // NUL   FS    GS    RS    US    NUL   NUL   NUL   SP    NUL   US        X2
4657      { 0x00, 0x1c, 0x1d, 0x1e, 0x1f, 0x00, 0x00, 0x00, 0x20, 0x00, 0x1f }, // X2
58      // NUL   NUL   DLE   US    NUL   BS    ESC   GS    CR    LF    DEL       X3
4759      { 0x00, 0x00, 0x10, 0x1f, 0x00, 0x08, 0x1B, 0x1d, 0x0d, 0x0a, 0x7f }, // X3
4860      { 0x00, 0x00, 0x00, 0x00, 0x1d, 0x0e, 0x02, 0x16, 0x03, 0x18, 0x1a }, // X4
4961      { 0x0c, 0x0b, 0x0a, 0x08, 0x07, 0x06, 0x04, 0x13, 0x01, 0x0c, 0x1b }, // X5
r5033r5034
212224
213225INPUT_PORTS_START( kr2376 )
214226   PORT_START("X0")
215   PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_KEYBOARD )
216   PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_KEYBOARD )
217   PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_KEYBOARD )
218   PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_KEYBOARD )
219   PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_KEYBOARD )
220   PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_KEYBOARD )
221   PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_KEYBOARD )
222   PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_KEYBOARD )
223   PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_KEYBOARD )
224   PORT_BIT( 0x0200, IP_ACTIVE_HIGH, IPT_KEYBOARD )
225   PORT_BIT( 0x0400, IP_ACTIVE_HIGH, IPT_KEYBOARD )
227   PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_UNUSED )
228   PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_UNUSED )
229   PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_UNUSED )
230   PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_UNUSED )
231   PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_UNUSED )
232   PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_UNUSED )
233   PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_UNUSED )
234   PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_UNUSED )
235   PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_UNUSED )
236   PORT_BIT( 0x0200, IP_ACTIVE_HIGH, IPT_UNUSED )
237   PORT_BIT( 0x0400, IP_ACTIVE_HIGH, IPT_UNUSED )
226238
227239   PORT_START("X1")
228   PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_KEYBOARD )
229   PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_KEYBOARD )
230   PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_KEYBOARD )
231   PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_KEYBOARD )
232   PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_KEYBOARD )
233   PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_KEYBOARD )
234   PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_KEYBOARD )
235   PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_KEYBOARD )
236   PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_KEYBOARD )
237   PORT_BIT( 0x0200, IP_ACTIVE_HIGH, IPT_KEYBOARD )
238   PORT_BIT( 0x0400, IP_ACTIVE_HIGH, IPT_KEYBOARD )
240   PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_UNUSED )
241   PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_UNUSED )
242   PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_UNUSED )
243   PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_UNUSED )
244   PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_UNUSED )
245   PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_UNUSED )
246   PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_UNUSED )
247   PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_UNUSED )
248   PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_UNUSED )
249   PORT_BIT( 0x0200, IP_ACTIVE_HIGH, IPT_UNUSED )
250   PORT_BIT( 0x0400, IP_ACTIVE_HIGH, IPT_UNUSED )
239251
240252
241253   PORT_START("X2")
242   PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_MINUS) PORT_CHAR('-') PORT_CHAR('=')
243   PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_KEYBOARD )
244   PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_KEYBOARD )
245   PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_KEYBOARD )
246   PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_KEYBOARD )
247   PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_KEYBOARD )
248   PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_KEYBOARD )
249   PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_KEYBOARD )
250   PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("Space") PORT_CODE(KEYCODE_SPACE) PORT_CHAR(' ')
251   PORT_BIT( 0x0200, IP_ACTIVE_HIGH, IPT_KEYBOARD )
252   PORT_BIT( 0x0400, IP_ACTIVE_HIGH, IPT_KEYBOARD )
254   PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_MINUS)      PORT_CHAR('-') PORT_CHAR('=')
255   PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_UNUSED )
256   PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_UNUSED )
257   PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_UNUSED )
258   PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_UNUSED )
259   PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_UNUSED )
260   PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_UNUSED )
261   PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_UNUSED )
262   PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_SPACE)      PORT_CHAR(' ')
263   PORT_BIT( 0x0200, IP_ACTIVE_HIGH, IPT_UNUSED )
264   PORT_BIT( 0x0400, IP_ACTIVE_HIGH, IPT_KEYBOARD )                               PORT_CHAR('_')
253265
254266   PORT_START("X3")
255   PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_0) PORT_CHAR('0')
256   PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_COLON) PORT_CHAR(':') PORT_CHAR('*')
257   PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_P) PORT_CHAR('P')
258   PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("- Delete") PORT_CODE(KEYCODE_EQUALS) PORT_CHAR('_')
259   PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_QUOTE) PORT_CHAR('@') PORT_CHAR('`')
260   PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("Delete") PORT_CODE(KEYCODE_BACKSPACE) PORT_CHAR(8)
261   PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_OPENBRACE) PORT_CHAR('[') PORT_CHAR('{')
267   PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_0)          PORT_CHAR('0')
268   PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_COLON)      PORT_CHAR(':') PORT_CHAR('*')
269   PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_P)          PORT_CHAR('p') PORT_CHAR('P')
270   PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_UNUSED )
271   PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_QUOTE)      PORT_CHAR('`') PORT_CHAR('@')
272   PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_BACKSPACE)  PORT_CHAR(8)                   PORT_NAME("Del")
273   PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_OPENBRACE)  PORT_CHAR('[') PORT_CHAR('{')
262274   PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_CLOSEBRACE) PORT_CHAR(']') PORT_CHAR('}')
263   PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("Carriage Return") PORT_CODE(KEYCODE_ENTER) PORT_CHAR(13)
264   PORT_BIT( 0x0200, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("Line Feed") PORT_CODE(KEYCODE_HOME) PORT_CHAR(UCHAR_MAMEKEY(HOME)) PORT_CHAR(10)
265   PORT_BIT( 0x0400, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_DEL)
275   PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_ENTER)      PORT_CHAR(13)                  PORT_NAME("CR")
276   PORT_BIT( 0x0200, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_HOME)       PORT_CHAR(UCHAR_MAMEKEY(HOME)) PORT_CHAR(10) PORT_NAME("LF")
277   PORT_BIT( 0x0400, IP_ACTIVE_HIGH, IPT_UNUSED )
266278
267279   PORT_START("X4")
268   PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_BACKSLASH2) PORT_CHAR(';') PORT_CHAR('+')
269   PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_SLASH) PORT_CHAR('/') PORT_CHAR('?')
270   PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_STOP) PORT_CHAR('.') PORT_CHAR('>')
271   PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_COMMA) PORT_CHAR(',') PORT_CHAR('<')
272   PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_M) PORT_CHAR('M')
273   PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_N) PORT_CHAR('N')
274   PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_B) PORT_CHAR('B')
275   PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_V) PORT_CHAR('V')
276   PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_C) PORT_CHAR('C')
277   PORT_BIT( 0x0200, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_X) PORT_CHAR('X')
278   PORT_BIT( 0x0400, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_Z) PORT_CHAR('Z')
280   PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_COLON)      PORT_CHAR(';') PORT_CHAR('+')
281   PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_SLASH)      PORT_CHAR('/') PORT_CHAR('?')
282   PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_STOP)       PORT_CHAR('.') PORT_CHAR('>')
283   PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_COMMA)      PORT_CHAR(',') PORT_CHAR('<')
284   PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_M)          PORT_CHAR('m') PORT_CHAR('M')
285   PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_N)          PORT_CHAR('n') PORT_CHAR('N')
286   PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_B)          PORT_CHAR('b') PORT_CHAR('B')
287   PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_V)          PORT_CHAR('v') PORT_CHAR('V')
288   PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_C)          PORT_CHAR('c') PORT_CHAR('C')
289   PORT_BIT( 0x0200, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_X)          PORT_CHAR('x') PORT_CHAR('X')
290   PORT_BIT( 0x0400, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_Z)          PORT_CHAR('z') PORT_CHAR('Z')
279291
280292
281293   PORT_START("X5")
282   PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_L) PORT_CHAR('L')
283   PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_K) PORT_CHAR('K')
284   PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_J) PORT_CHAR('J')
285   PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_H) PORT_CHAR('H')
286   PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_G) PORT_CHAR('G')
287   PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_F) PORT_CHAR('F')
288   PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_D) PORT_CHAR('D')
289   PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_S) PORT_CHAR('S')
290   PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_A) PORT_CHAR('A')
291   PORT_BIT( 0x0200, IP_ACTIVE_HIGH, IPT_KEYBOARD )
292   PORT_BIT( 0x0400, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("Escape") PORT_CODE(KEYCODE_ESC) PORT_CHAR(UCHAR_MAMEKEY(ESC))
294   PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_L)          PORT_CHAR('l') PORT_CHAR('L')
295   PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_K)          PORT_CHAR('k') PORT_CHAR('K')
296   PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_J)          PORT_CHAR('j') PORT_CHAR('J')
297   PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_H)          PORT_CHAR('h') PORT_CHAR('H')
298   PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_G)          PORT_CHAR('c') PORT_CHAR('G')
299   PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_F)          PORT_CHAR('f') PORT_CHAR('F')
300   PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_D)          PORT_CHAR('d') PORT_CHAR('D')
301   PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_S)          PORT_CHAR('s') PORT_CHAR('S')
302   PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_A)          PORT_CHAR('a') PORT_CHAR('A')
303   PORT_BIT( 0x0200, IP_ACTIVE_HIGH, IPT_UNUSED )
304   PORT_BIT( 0x0400, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_ESC)        PORT_CHAR(UCHAR_MAMEKEY(ESC))
293305
294306
295307   PORT_START("X6")
296   PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_O) PORT_CHAR('O')
297   PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_I) PORT_CHAR('I')
298   PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_U) PORT_CHAR('U')
299   PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_Y) PORT_CHAR('Y')
300   PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_T) PORT_CHAR('T')
301   PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_R) PORT_CHAR('R')
302   PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_E) PORT_CHAR('E')
303   PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_W) PORT_CHAR('W')
304   PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_Q) PORT_CHAR('Q')
308   PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_O)          PORT_CHAR('o') PORT_CHAR('O')
309   PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_I)          PORT_CHAR('i') PORT_CHAR('I')
310   PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_U)          PORT_CHAR('u') PORT_CHAR('U')
311   PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_Y)          PORT_CHAR('y') PORT_CHAR('Y')
312   PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_T)          PORT_CHAR('t') PORT_CHAR('T')
313   PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_R)          PORT_CHAR('r') PORT_CHAR('R')
314   PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_E)          PORT_CHAR('e') PORT_CHAR('E')
315   PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_W)          PORT_CHAR('w') PORT_CHAR('W')
316   PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_Q)          PORT_CHAR('q') PORT_CHAR('Q')
305317
306318   PORT_START("X7")
307   PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_9) PORT_CHAR('9') PORT_CHAR(')')
308   PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_8) PORT_CHAR('8') PORT_CHAR('(')
309   PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_7) PORT_CHAR('7') PORT_CHAR(0xFFFD)
310   PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_6) PORT_CHAR('6') PORT_CHAR('&')
311   PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_5) PORT_CHAR('5') PORT_CHAR('%')
312   PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_4) PORT_CHAR('4') PORT_CHAR('$')
313   PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_3) PORT_CHAR('3') PORT_CHAR('#')
314   PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_2) PORT_CHAR('2') PORT_CHAR('"')
315   PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_1) PORT_CHAR('1') PORT_CHAR('!')
316   PORT_BIT( 0x0200, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_TILDE) PORT_CHAR('^') PORT_CHAR('~')
317   PORT_BIT( 0x0400, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_BACKSLASH) PORT_CHAR('\\') PORT_CHAR('|')
319   PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_9)          PORT_CHAR('9') PORT_CHAR(')')
320   PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_8)          PORT_CHAR('8') PORT_CHAR('(')
321   PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_7)          PORT_CHAR('7') PORT_CHAR('\'')
322   PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_6)          PORT_CHAR('6') PORT_CHAR('&')
323   PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_5)          PORT_CHAR('5') PORT_CHAR('%')
324   PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_4)          PORT_CHAR('4') PORT_CHAR('$')
325   PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_3)          PORT_CHAR('3') PORT_CHAR('#')
326   PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_2)          PORT_CHAR('2') PORT_CHAR('"')
327   PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_1)          PORT_CHAR('1') PORT_CHAR('!')
328   PORT_BIT( 0x0200, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_TILDE)      PORT_CHAR('^') PORT_CHAR('~')
329   PORT_BIT( 0x0400, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_BACKSLASH)  PORT_CHAR('\\') PORT_CHAR('|')
318330
319331   PORT_START("MODIFIERS")
320   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("Shift") PORT_CODE(KEYCODE_LSHIFT) PORT_CODE(KEYCODE_RSHIFT) PORT_CHAR(UCHAR_SHIFT_1)
321   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("Ctrl") PORT_CODE(KEYCODE_LCONTROL) PORT_CODE(KEYCODE_RCONTROL) PORT_CHAR(UCHAR_MAMEKEY(LCONTROL)) PORT_CHAR(UCHAR_MAMEKEY(RCONTROL))
322   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("Alpha Lock") PORT_CODE(KEYCODE_CAPSLOCK) PORT_CHAR(UCHAR_MAMEKEY(CAPSLOCK))
332   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_LSHIFT)   PORT_CODE(KEYCODE_RSHIFT)   PORT_CHAR(UCHAR_SHIFT_1)
333   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_LCONTROL) PORT_CODE(KEYCODE_RCONTROL) PORT_CHAR(UCHAR_MAMEKEY(LCONTROL)) PORT_CHAR(UCHAR_MAMEKEY(RCONTROL))
334   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_CAPSLOCK) PORT_CHAR(UCHAR_MAMEKEY(CAPSLOCK))
323335INPUT_PORTS_END
324336
325337
src/mess/machine/kr2376.h
r5033r5034
11/**********************************************************************
22
3    SMC XR2376 Keyboard Encoder emulation
3    SMC KR2376 Keyboard Encoder emulation
44
55    Copyright MESS Team.
66    Visit http://mamedev.org for licensing and usage restrictions.
77
88**********************************************************************
9                     _____   _____
10               Vcc    1 |*    \_/     | 40  Frequency Control A
11   Frequency Control B     2 |          | 39  X0
12   Frequency Control C    3 |          | 38  X1
13         Shift Input    4 |          | 37  X2
14       Control Input    5 |          | 36  X3
15   Parity Invert Input    6 |          | 35  X4
16       Parity Output    7 |          | 34  X5
17      Data Output B8    8 |          | 33  X6
18      Data Output B7    9 |          | 32  X7
19      Data Output B6   10 |   CDP1871    | 31  Y0
20      Data Output B5   11 |          | 30  Y1
21      Data Output B4   12 |          | 29  Y2
22      Data Output B3   13 |          | 28  Y3
23      Data Output B2   14 |          | 27  Y4
24      Data Output B1   15 |          | 26  Y5
25       Strobe Output   16 |          | 25  Y6
26            Ground   17 |          | 24  Y7
27               Vgg   18 |          | 23  Y8
28  Strobe Control Input   19 |          | 22  Y9
29        Invert Input  20 |_____________| 21  Y10
9                            _____   _____
10                   Vcc   1 |*    \_/     | 40  Frequency Control A
11   Frequency Control B   2 |             | 39  X0
12   Frequency Control C   3 |             | 38  X1
13           Shift Input   4 |             | 37  X2
14         Control Input   5 |             | 36  X3
15   Parity Invert Input   6 |             | 35  X4
16         Parity Output   7 |             | 34  X5
17        Data Output B8   8 |             | 33  X6
18        Data Output B7   9 |             | 32  X7
19        Data Output B6  10 |   KR2376    | 31  Y0
20        Data Output B5  11 |             | 30  Y1
21        Data Output B4  12 |             | 29  Y2
22        Data Output B3  13 |             | 28  Y3
23        Data Output B2  14 |             | 27  Y4
24        Data Output B1  15 |             | 26  Y5
25         Strobe Output  16 |             | 25  Y6
26                Ground  17 |             | 24  Y7
27                   Vgg  18 |             | 23  Y8
28  Strobe Control Input  19 |             | 22  Y9
29          Invert Input  20 |_____________| 21  Y10
3030
3131**********************************************************************/
3232
r5033r5034
6868   int clock;
6969
7070   /* This will be called for every change of the strobe pin (pin 16). Optional */
71//   kr2376_on_strobe_changed_func      on_strobe_changed;
71//  kr2376_on_strobe_changed_func       on_strobe_changed;
7272   write8_device_func   on_strobe_changed;
7373};
7474#define KR2376_INTERFACE(name) const kr2376_interface (name)=
src/mess/machine/wd17xx.c
r5033r5034
11/***************************************************************************
22
3   wd17xx.c
3    wd17xx.c
44
5   Implementations of the Western Digitial 17xx and 19xx families of
6   floppy disk controllers
5    Implementations of the Western Digitial 17xx and 19xx families of
6    floppy disk controllers
77
88
9   Kevin Thacker
10      - Removed disk image code and replaced it with floppy drive functions.
11        Any disc image is now useable with this code.
12      - Fixed write protect
9    Kevin Thacker
10        - Removed disk image code and replaced it with floppy drive functions.
11          Any disc image is now useable with this code.
12        - Fixed write protect
1313
14   2005-Apr-16 P.Harvey-Smith:
15      - Increased the delay in wd17xx_timed_read_sector_request and
16        wd17xx_timed_write_sector_request, to 40us to more closely match
17        what happens on the real hardware, this has fixed the NitrOS9 boot
18        problems.
14    2005-Apr-16 P.Harvey-Smith:
15        - Increased the delay in wd17xx_timed_read_sector_request and
16          wd17xx_timed_write_sector_request, to 40us to more closely match
17          what happens on the real hardware, this has fixed the NitrOS9 boot
18          problems.
1919
20   2007-Nov-01 Wilbert Pol:
21      Needed these changes to get the MB8877 for Osborne-1 to work:
22      - Added support for multiple record read
23      - Changed the wd17xx_read_id to not return after DATADONEDELAY, but
24        the host should read the id data through the data register. This
25        was accomplished by making this change in the wd17xx_read_id
26        function:
27         -               wd17xx_complete_command(device, DELAY_DATADONE);
28         +               wd17xx_set_data_request();
20    2007-Nov-01 Wilbert Pol:
21        Needed these changes to get the MB8877 for Osborne-1 to work:
22        - Added support for multiple record read
23        - Changed the wd17xx_read_id to not return after DATADONEDELAY, but
24          the host should read the id data through the data register. This
25          was accomplished by making this change in the wd17xx_read_id
26          function:
27            -               wd17xx_complete_command(device, DELAY_DATADONE);
28            +               wd17xx_set_data_request();
2929
30   2009-May-10 Robbbert:
31      Further change to get the Kaypro II to work
32      - When wd17xx_read_id has generated the 6 data bytes, it should make
33        an IRQ and turn off the busy status. The timing for Osborne is
34        critical, it must be between 300 and 700 usec, I've settled on 400.
35        The Kaypro doesn't care timewise, but the busy flag must turn off
36        sometime or it hangs.
37         -      w->status |= STA_2_BUSY;
38         +      wd17xx_set_busy(device, ATTOTIME_IN_USEC(400));
30    2009-May-10 Robbbert:
31        Further change to get the Kaypro II to work
32        - When wd17xx_read_id has generated the 6 data bytes, it should make
33          an IRQ and turn off the busy status. The timing for Osborne is
34          critical, it must be between 300 and 700 usec, I've settled on 400.
35          The Kaypro doesn't care timewise, but the busy flag must turn off
36          sometime or it hangs.
37            -       w->status |= STA_2_BUSY;
38            +       wd17xx_set_busy(device, ATTOTIME_IN_USEC(400));
3939
40   TODO:
41      - Multiple record write
42      - What happens if a track is read that doesn't have any id's on it?
43        (e.g. unformatted disc)
40    2009-June-4 Roberto Lavarone:
41        - Initial support for wd1771
42        - Added simulation of head loaded feedback from drive
43        - Bugfix: busy flag was cleared too early
4444
45    TODO:
46        - Multiple record write
47        - What happens if a track is read that doesn't have any id's on it?
48         (e.g. unformatted disc)
49
4550***************************************************************************/
4651
4752
r5033r5034
5257
5358/***************************************************************************
5459
55   Parameters
60    Parameters
5661
5762***************************************************************************/
5863
r5033r5034
6873typedef enum
6974{
7075   WD_TYPE_1770,
76   WD_TYPE_1771,
7177   WD_TYPE_1772,
7278   WD_TYPE_1773,
7379   WD_TYPE_179X,
r5033r5034
8288
8389/***************************************************************************
8490
85   Constants
91    Constants
8692
8793***************************************************************************/
8894
r5033r5034
159165
160166/***************************************************************************
161167
162   Structures
168    Structures
163169
164170***************************************************************************/
165171
r5033r5034
200206   emu_timer   *timer, *timer_rs, *timer_ws, *timer_rid;
201207   int      data_direction;
202208
203   UINT8   ipl;               /* index pulse */   
204   
209   UINT8   ipl;               /* index pulse */
210   int     hld_count;            /* head loaded counter */
211
205212   emu_timer *busy_timer;
206213
207214   /* this is the drive currently selected */
r5033r5034
212219
213220   /* pause time when writing/reading sector */
214221   int pause_time;
215   
222
216223   /* Pointer to interface */
217224   const wd17xx_interface *intf;
218225};
r5033r5034
228235
229236/***************************************************************************
230237
231   Read track stuff
238    Read track stuff
232239
233240***************************************************************************/
234241
r5033r5034
236243#define TRKSIZE_DD      6144
237244#if 0
238245static const UINT8 track_DD[][2] = {
239   {16, 0x4e},    /* 16 * 4E (track lead in)             */
240   { 8, 0x00},    /*   8 * 00 (pre DAM)                */
241   { 3, 0xf5},    /*   3 * F5 (clear CRC)                */
246   {16, 0x4e},    /* 16 * 4E (track lead in)               */
247   { 8, 0x00},    /*  8 * 00 (pre DAM)                     */
248   { 3, 0xf5},    /*  3 * F5 (clear CRC)                   */
242249
243   { 1, 0xfe},    /* *** sector *** FE (DAM)             */
244   { 1, 0x80},    /*   4 bytes track,head,sector,seclen    */
245   { 1, 0xf7},    /*   1 * F7 (CRC)                   */
246   {22, 0x4e},    /* 22 * 4E (sector lead in)           */
247   {12, 0x00},    /* 12 * 00 (pre AM)                 */
248   { 3, 0xf5},    /*   3 * F5 (clear CRC)                */
249   { 1, 0xfb},    /*   1 * FB (AM)                    */
250   { 1, 0x81},    /*   x bytes sector data              */
251   { 1, 0xf7},    /*   1 * F7 (CRC)                   */
252   {16, 0x4e},    /* 16 * 4E (sector lead out)          */
253   { 8, 0x00},    /*   8 * 00 (post sector)             */
254   { 0, 0x00},    /* end of data                      */
250   { 1, 0xfe},    /* *** sector *** FE (DAM)               */
251   { 1, 0x80},    /*  4 bytes track,head,sector,seclen     */
252   { 1, 0xf7},    /*  1 * F7 (CRC)                         */
253   {22, 0x4e},    /* 22 * 4E (sector lead in)              */
254   {12, 0x00},    /* 12 * 00 (pre AM)                      */
255   { 3, 0xf5},    /*  3 * F5 (clear CRC)                   */
256   { 1, 0xfb},    /*  1 * FB (AM)                          */
257   { 1, 0x81},    /*  x bytes sector data                  */
258   { 1, 0xf7},    /*  1 * F7 (CRC)                         */
259   {16, 0x4e},    /* 16 * 4E (sector lead out)             */
260   { 8, 0x00},    /*  8 * 00 (post sector)                 */
261   { 0, 0x00},    /* end of data                           */
255262};
256263#endif
257264/* structure describing a single density track */
258265#define TRKSIZE_SD      3172
259266#if 0
260267static const UINT8 track_SD[][2] = {
261   {16, 0xff},    /* 16 * FF (track lead in)             */
262   { 8, 0x00},    /*   8 * 00 (pre DAM)                */
263   { 1, 0xfc},    /*   1 * FC (clear CRC)                */
268   {16, 0xff},    /* 16 * FF (track lead in)               */
269   { 8, 0x00},    /*  8 * 00 (pre DAM)                     */
270   { 1, 0xfc},    /*  1 * FC (clear CRC)                   */
264271
265   {11, 0xff},    /* *** sector *** 11 * FF             */
266   { 6, 0x00},    /*   6 * 00 (pre DAM)                */
267   { 1, 0xfe},    /*   1 * FE (DAM)                   */
268   { 1, 0x80},    /*   4 bytes track,head,sector,seclen    */
269   { 1, 0xf7},    /*   1 * F7 (CRC)                   */
270   {10, 0xff},    /* 10 * FF (sector lead in)           */
271   { 4, 0x00},    /*   4 * 00 (pre AM)                 */
272   { 1, 0xfb},    /*   1 * FB (AM)                    */
273   { 1, 0x81},    /*   x bytes sector data              */
274   { 1, 0xf7},    /*   1 * F7 (CRC)                   */
275   { 0, 0x00},    /* end of data                      */
272   {11, 0xff},    /* *** sector *** 11 * FF                */
273   { 6, 0x00},    /*  6 * 00 (pre DAM)                     */
274   { 1, 0xfe},    /*  1 * FE (DAM)                         */
275   { 1, 0x80},    /*  4 bytes track,head,sector,seclen     */
276   { 1, 0xf7},    /*  1 * F7 (CRC)                         */
277   {10, 0xff},    /* 10 * FF (sector lead in)              */
278   { 4, 0x00},    /*  4 * 00 (pre AM)                      */
279   { 1, 0xfb},    /*  1 * FB (AM)                          */
280   { 1, 0x81},    /*  x bytes sector data                  */
281   { 1, 0xf7},    /*  1 * F7 (CRC)                         */
282   { 0, 0x00},    /* end of data                           */
276283};
277284#endif
278285
r5033r5034
280287
281288/***************************************************************************
282289
283   Prototypes
290    Prototypes
284291
285292***************************************************************************/
286293
r5033r5034
303310void wd17xx_set_drive(const device_config *device,UINT8 drive)
304311{
305312   wd17xx_t *w = get_safe_token(device);
313   if (VERBOSE)
314   {
315      if (drive != w->current_drive)
316         logerror("wd17xx_set_drive: $%02x\n", drive);
317   }
306318   w->current_drive = drive;
307319}
308320
r5033r5034
359371{
360372   UINT8 step_counter;
361373   wd17xx_t *w = get_safe_token(device);
362   
374
363375   if (w->current_drive >= device_count(device->machine, IO_FLOPPY))
364376      return;
365377
r5033r5034
559571   }
560572#endif
561573
562   w->data_count = (w->density) ? TRKSIZE_DD : TRKSIZE_SD;
574   if (w->type == WD_TYPE_1771)
575      w->data_count = TRKSIZE_SD;
576   else
577      w->data_count = (w->density) ? TRKSIZE_DD : TRKSIZE_SD;
563578
564579   floppy_drive_read_track_data_info_buffer( wd17xx_current_image(device), w->hd, (char *)w->buffer, &(w->data_count) );
565580
r5033r5034
638653
639654      wd17xx_set_data_request(device);
640655
641      logerror("read id succeeded.\n");
656      if (VERBOSE)
657         logerror("read id succeeded.\n");
642658   }
643659   else
644660   {
645661      /* record not found */
646662      w->status |= STA_2_REC_N_FND;
647663      //w->sector = w->track_reg;
648      logerror("read id failed\n");
664      if (VERBOSE)
665         logerror("read id failed\n");
649666
650667      wd17xx_complete_command(device, DELAY_ERROR);
651668   }
r5033r5034
659676   if ( img != wd17xx_current_image(controller) )
660677      return;
661678   w->ipl = state;
679
680   if (w->hld_count)
681      w->hld_count--;
662682}
663683
664684
r5033r5034
676696   UINT8 revolution_count;
677697   chrn_id id;
678698   wd17xx_t *w = get_safe_token(device);
679   
699
680700   revolution_count = 0;
681701
682702   w->status &= ~STA_2_REC_N_FND;
r5033r5034
771791{
772792   wd17xx_t *w = get_safe_token(device);
773793   void *param = NULL;
774   if (w->intf->callback_param)
794   if (w->intf->callback_param)
775795      param = (*w->intf->callback_param)(device);
776796   if (w->intf->callback)
777797      (*w->intf->callback)(device, state, param);
r5033r5034
837857
838858   w->data_count = 0;
839859
860   w->hld_count = 2;
861
840862   /* clear busy bit */
841   w->status &= ~STA_2_BUSY;
863   /* RL - removed, busy bit must be on until wd17xx_misc_timer_callback() is fired */
864   /* w->status &= ~STA_2_BUSY; */
842865
843866   usecs = floppy_drive_get_datarate_in_us(w->density);
844867   usecs *= delay;
r5033r5034
853876{
854877   wd17xx_t *w = get_safe_token(device);
855878   /* at this point, the disc is write enabled, and data
856    * has been transfered into our buffer - now write it to
857    * the disc image or to the real disc
858    */
879     * has been transfered into our buffer - now write it to
880     * the disc image or to the real disc
881     */
859882
860883   /* side compare? */
861884   if (w->write_cmd & 0x02)
r5033r5034
869892      w->data_count = w->sector_length;
870893
871894      /* write data */
872      floppy_drive_write_sector_data(wd17xx_current_image(device), w->hd, w->sector_data_id, (char *)w->buffer, w->sector_length,w->write_cmd & 0x01);
895      floppy_drive_write_sector_data(wd17xx_current_image(device), w->hd, w->sector_data_id, (char *)w->buffer, w->sector_length, w->write_cmd & 0x01);
873896   }
874897}
875898
r5033r5034
884907
885908   revolution_count = 0;
886909
887   logerror("doing seek verify\n");
910   if (VERBOSE)
911      logerror("doing seek verify\n");
888912
889913   w->status &= ~STA_1_SEEK_ERR;
890914
r5033r5034
896920         /* compare track */
897921         if (id.C == w->track_reg)
898922         {
899            logerror("seek verify succeeded!\n");
923            if (VERBOSE)
924               logerror("seek verify succeeded!\n");
900925            return;
901926         }
902927      }
r5033r5034
911936
912937   w->status |= STA_1_SEEK_ERR;
913938
914   logerror("failed seek verify!\n");
939   if (VERBOSE)
940      logerror("failed seek verify!\n");
915941}
916942
917943
r5033r5034
921947{
922948   wd17xx_t *w = get_safe_token(device);
923949
924//   w->status_drq = 0;
950//  w->status_drq = 0;
925951   wd17xx_callback(device, WD17XX_DRQ_CLR);
926952   w->status &= ~STA_2_DRQ;
927953}
r5033r5034
936962   if (w->status & STA_2_DRQ)
937963   {
938964      w->status |= STA_2_LOST_DAT;
939//      return;
965//      return;
940966   }
941967
942968   /* set drq */
943//   w->status_drq = STA_2_DRQ;
969//  w->status_drq = STA_2_DRQ;
944970   wd17xx_callback(device, WD17XX_DRQ_SET);
945971   w->status |= STA_2_DRQ;
946972}
r5033r5034
10741100   int result = w->status;
10751101
10761102   wd17xx_callback(device, WD17XX_IRQ_CLR);
1077//   if (w->busy_count)
1078//   {
1079//      if (!--w->busy_count)
1080//         w->status &= ~STA_1_BUSY;
1081//   }
10821103
10831104   /* type 1 command or force int command? */
10841105   if ((w->command_type==TYPE_I) || (w->command_type==TYPE_IV))
r5033r5034
10921113      if (floppy_drive_get_flag_state(wd17xx_current_image(device), FLOPPY_DRIVE_HEAD_AT_TRACK_0))
10931114         result |= STA_1_TRACK0;
10941115
1095   //   floppy_drive_set_ready_state(wd17xx_current_image(device), 1,1);
1116   //  floppy_drive_set_ready_state(wd17xx_current_image(device), 1,1);
10961117      w->status &= ~STA_1_NOT_READY;
10971118
10981119      /* TODO: What is this?  We need some more info on this */
1099      if ((w->type == WD_TYPE_179X) || (w->type == WD_TYPE_1793) || (w->type == WD_TYPE_1773))
1120      if ((w->type == WD_TYPE_179X) || (w->type == WD_TYPE_1793) || (w->type == WD_TYPE_1773) || (w->type == WD_TYPE_1771))
11001121      {
11011122         if (!floppy_drive_get_flag_state(wd17xx_current_image(device), FLOPPY_DRIVE_READY))
11021123            w->status |= STA_1_NOT_READY;
r5033r5034
11061127         if (floppy_drive_get_flag_state(wd17xx_current_image(device), FLOPPY_DRIVE_READY))
11071128            w->status |= STA_1_NOT_READY;
11081129      }
1130
1131      if (w->command_type==TYPE_I)
1132      {
1133         if (w->hld_count)
1134            w->status |= STA_1_HD_LOADED;
1135         else
1136            w->status &= ~ STA_1_HD_LOADED;
1137      }
11091138   }
11101139
11111140   /* eventually set data request bit */
1112//   w->status |= w->status_drq;
1141//  w->status |= w->status_drq;
11131142
11141143   if (VERBOSE)
11151144   {
r5033r5034
12051234         else
12061235         {
12071236            /* Delay the INTRQ 3 byte times because we need to read two CRC bytes and
1208               compare them with a calculated CRC */
1237                   compare them with a calculated CRC */
12091238            wd17xx_complete_command(device, DELAY_DATADONE);
12101239
12111240            if (VERBOSE)
r5033r5034
12591288      }
12601289
12611290
1262//      w->status_ipl = STA_1_IPL;
1263/*      w->status_ipl = 0; */
1291//      w->status_ipl = STA_1_IPL;
1292/*      w->status_ipl = 0; */
12641293
12651294      w->busy_count = 0;
12661295      w->command_type = TYPE_IV;
r5033r5034
13151344         w->status &= ~STA_2_LOST_DAT;
13161345         wd17xx_clear_data_request(device);
13171346#if 1
1318//         w->status = seek(w, w->track, w->head, w->sector);
1347//          w->status = seek(w, w->track, w->head, w->sector);
13191348         if (w->status == 0)
13201349            read_track(device);
13211350#endif
r5033r5034
13501379            {
13511380            w->command = data & ~FDC_MASK_TYPE_III;
13521381            w->data_offset = 0;
1353            w->data_count = (w->density) ? TRKSIZE_DD : TRKSIZE_SD;
1382            if (w->type == WD_TYPE_1771)
1383               w->data_count = TRKSIZE_SD;
1384            else
1385               w->data_count = (w->density) ? TRKSIZE_DD : TRKSIZE_SD;
13541386            wd17xx_set_data_request(device);
13551387            w->status |= STA_2_BUSY;
13561388            w->busy_count = 0;
r5033r5034
15131545      wd17xx_set_busy(device, ATTOTIME_IN_USEC(100));
15141546   }
15151547
1516//   if (w->busy_count==0)
1517//      w->status &= ~STA_1_BUSY;
1548   if (w->command_type == TYPE_I)
1549   {
1550      /* 0 is enable spin up sequence, 1 is disable spin up sequence */
1551      if (data & FDC_STEP_HDLOAD)
1552      {
1553         w->status |= STA_1_HD_LOADED;
1554         w->hld_count = 2;
1555      }
1556      else
1557         w->status &= ~STA_1_HD_LOADED;
15181558
1519//   /* toggle index pulse at read */
1520//   w->status_ipl = STA_1_IPL;
1521
1522   /* 0 is enable spin up sequence, 1 is disable spin up sequence */
1523   if ((data & FDC_STEP_HDLOAD)==0)
1524      w->status |= STA_1_HD_LOADED;
1525
1526   if (data & FDC_STEP_VERIFY)
1527   {
1528      /* verify seek */
1529      wd17xx_verify_seek(device);
1559      if (data & FDC_STEP_VERIFY)
1560      {
1561         /* verify seek */
1562         wd17xx_verify_seek(device);
1563      }
15301564   }
15311565}
15321566
r5033r5034
16521686   assert(device->static_config != NULL);
16531687
16541688   w->intf = device->static_config;
1655   
1689
16561690   w->status = STA_1_TRACK0;
16571691   w->type = device_type;
16581692   w->density = DEN_MFM_LO;
r5033r5034
16671701{
16681702   wd17xx_t *w = get_safe_token(device);
16691703   int i;
1670   
1704
16711705   for (i = 0; i < device_count(device->machine, IO_FLOPPY); i++)
16721706   {
16731707      const device_config *img = image_from_devtype_and_index(device->machine, IO_FLOPPY, i);
r5033r5034
16781712
16791713   w->current_drive = 0;
16801714   w->hd = 0;
1715   w->hld_count = 0;
16811716
16821717   wd17xx_restore(device);
16831718}
16841719
1685void wd17xx_reset(const device_config *device)
1720void wd17xx_reset(const device_config *device)
16861721{
16871722   device_reset_wd17xx(device);
16881723}
r5033r5034
16911726{
16921727   common_start(device, WD_TYPE_1770);
16931728}
1729static DEVICE_START( wd1771 )
1730{
1731   common_start(device, WD_TYPE_1771);
1732}
16941733static DEVICE_START( wd1772 )
16951734{
16961735   common_start(device, WD_TYPE_1772);
r5033r5034
17441783}
17451784
17461785
1786DEVICE_GET_INFO( wd1771 )
1787{
1788   switch (state)
1789   {
1790      /* --- the following bits of info are returned as NULL-terminated strings --- */
1791      case DEVINFO_STR_NAME:                     strcpy(info->s, "WD1771");            break;
1792
1793      /* --- the following bits of info are returned as pointers to data or functions --- */
1794      case DEVINFO_FCT_START:                     info->start = DEVICE_START_NAME(wd1771);   break;
1795
1796      default:                               DEVICE_GET_INFO_CALL(wd1770);            break;
1797   }
1798}
17471799DEVICE_GET_INFO( wd1772 )
17481800{
17491801   switch (state)
src/mess/machine/wd17xx.h
r5033r5034
11/*********************************************************************
22
3   wd17xx.h
3    wd17xx.h
44
5   Implementations of the Western Digital 17xx and 19xx families of
6   floppy disk controllers
5    Implementations of the Western Digital 17xx and 19xx families of
6    floppy disk controllers
77
88*********************************************************************/
99
r5033r5034
1717***************************************************************************/
1818
1919#define WD1770      DEVICE_GET_INFO_NAME(wd1770)
20#define WD1771      DEVICE_GET_INFO_NAME(wd1771)
2021#define WD1772      DEVICE_GET_INFO_NAME(wd1772)
2122#define WD1773      DEVICE_GET_INFO_NAME(wd1773)
2223#define WD179X      DEVICE_GET_INFO_NAME(wd179x)
r5033r5034
5960
6061/* device interface */
6162extern DEVICE_GET_INFO(wd1770);
63extern DEVICE_GET_INFO(wd1771);
6264extern DEVICE_GET_INFO(wd1772);
6365extern DEVICE_GET_INFO(wd1773);
6466extern DEVICE_GET_INFO(wd179x);
r5033r5034
99101   MDRV_DEVICE_ADD(_tag, WD1770, 0) \
100102   MDRV_DEVICE_CONFIG(_intrf)
101103
104#define MDRV_WD1771_ADD(_tag, _intrf) \
105   MDRV_DEVICE_ADD(_tag, WD1771, 0) \
106   MDRV_DEVICE_CONFIG(_intrf)
107
102108#define MDRV_WD1772_ADD(_tag, _intrf) \
103109   MDRV_DEVICE_ADD(_tag, WD1772, 0) \
104110   MDRV_DEVICE_CONFIG(_intrf)
r5033r5034
127133   MDRV_DEVICE_ADD(_tag, MB8877, 0) \
128134   MDRV_DEVICE_CONFIG(_intrf)
129135
130   
136
131137#endif /* WD179X_H */
132138
133139
src/mess/machine/z80ne.c
r5033r5034
11/***********************************************************************
22
3   machine/z80ne.c
3    machine/z80ne.c
44
5   Functions to emulate general aspects of the machine (RAM, ROM,
6   interrupts, I/O ports)
5    Functions to emulate general aspects of the machine (RAM, ROM,
6    interrupts, I/O ports)
77
88***********************************************************************/
99
r5033r5034
1515/* Components */
1616#include "machine/ay31015.h"
1717#include "machine/kr2376.h"
18#include "machine/wd17xx.h"
1918#include "video/m6847.h"
2019
2120/* Devices */
2221#include "devices/basicdsk.h"
2322#include "devices/cassette.h"
23#include "devices/flopdrv.h"
2424
25#define VERBOSE 0
26#define LOG(x) do { if (VERBOSE) logerror x; } while (0)
27
2528static UINT8 lx383_scan_counter;
2629static UINT8 lx383_key[LX383_KEYS];
2730static int   lx383_downsampler;
2831static int   nmi_delay_counter;
32static int   reset_delay_counter;
2933static const device_config *z80ne_ay31015;
3034static UINT8 lx385_ctrl = 0x1f;
3135static const device_config *lx388_kr2376;
3236
3337
3438
39
3540/* timer to read cassette waveforms */
3641static emu_timer *cassette_timer;
3742
r5033r5034
6166   int wave_long;
6267} cass_data;
6368
69static struct _wd17xx_state {
70   int drq;
71   int intrq;
72   UINT8 drive; /* current drive */
73   UINT8 head;  /* current head */
74} wd17xx_state;
75
76
77DEVICE_IMAGE_LOAD( z80ne_floppy )
78{
79   static UINT8 pdrive[4*16];
80   int i;
81   int tracks;    /* total tracks count per drive */
82   int heads;      /* total heads count per drive */
83   int spt;      /* sector per track count per drive */
84   int dir_sector; /* first directory sector (aka DDSL) */
85   int dir_length; /* length of directory in sectors (aka DDGA) */
86   int id = image_index_in_device(image);
87
88   if (device_load_basicdsk_floppy(image) != INIT_PASS)
89      return INIT_FAIL;
90
91   if (image_index_in_device(image) == 0)        /* first floppy? */
92   {
93      image_fseek(image, 0, SEEK_SET);
94      image_fread(image, pdrive, 2);
95#if 0
96      if (pdrive[0] != 0x00 || pdrive[1] != 0xfe)
97      {
98         basicdsk_read_sectormap(image, &tracks[id], &heads[id], &spt[id]);
99      }
100      else
101#endif
102
103      image_fseek(image, 2 * 256, SEEK_SET);
104      image_fread(image, pdrive, 4*16);
105   }
106
107   tracks = pdrive[id*16+3] + 1;
108   heads = (pdrive[id*16+7] & 0x40) ? 2 : 1;
109   spt = pdrive[id*16+4] / heads;
110   dir_sector = 5 * pdrive[id*16+0] * pdrive[id*16+5];
111   dir_length = 5 * pdrive[id*16+9];
112
113    /* set geometry so disk image can be read */
114   basicdsk_set_geometry(image, tracks, heads, spt, 256, 0, 0, FALSE);
115
116   /* mark directory sectors with deleted data address mark */
117   /* assumption dir_sector is a sector offset */
118   for (i = 0; i < dir_length; i++)
119   {
120      int track, side, sector_id;
121      int track_offset, sector_offset;
122
123      /* calc sector offset */
124      sector_offset = dir_sector + i;
125
126      /* get track offset */
127      track_offset = sector_offset / spt;
128
129      /* calc track */
130      track = track_offset / heads;
131
132      /* calc side */
133      side = track_offset % heads;
134
135      /* calc sector id - first sector id is 0! */
136      sector_id = sector_offset % spt;
137
138      /* set deleted data address mark for sector specified */
139      basicdsk_set_ddam(image, track, side, sector_id, 1);
140   }
141   return INIT_PASS;
142}
143
144
64145static const device_config *cassette_device_image(running_machine *machine)
65146{
66147   if (lx385_ctrl & 0x08)
r5033r5034
109190{
110191   /* first two entries point to rom on reset */
111192   UINT8 *RAM = memory_region(machine, "z80ne");
112   memory_configure_bank(machine, 1, 0, 2, &RAM[0x0000], 0x8000);
193   memory_configure_bank(machine, 1, 0, 1, &RAM[0x00000], 0x0400); /* RAM   at 0x0000 */
194   memory_configure_bank(machine, 1, 1, 1, &RAM[0x14000], 0x0400); /* ep382 at 0x0000 */
195   memory_configure_bank(machine, 2, 0, 1, &RAM[0x14000], 0x0400); /* ep382 at 0x8000 */
113196}
114197
115198DRIVER_INIT( z80net )
r5033r5034
121204{
122205}
123206
124/* after the first 3 bytes have been read from ROM, switch the ram back in */
125static TIMER_CALLBACK(z80ne_reset_address_decoder)
207DRIVER_INIT( z80netf )
126208{
127   memory_set_bank(machine, 1, 0);
209   /* first two entries point to rom on reset */
210   UINT8 *RAM = memory_region(machine, "z80ne");
211   memory_configure_bank(machine, 1, 0, 1, &RAM[0x00000], 0x0400); /* RAM   at 0x0000-0x03FF */
212   memory_configure_bank(machine, 1, 1, 3, &RAM[0x14400], 0x0400); /* ep390, ep1390, ep2390 at 0x0000-0x03FF */
213   memory_configure_bank(machine, 1, 4, 1, &RAM[0x14000], 0x0400); /* ep382 at 0x0000-0x03FF */
214   memory_configure_bank(machine, 1, 5, 1, &RAM[0x10000], 0x0400); /* ep548 at 0x0000-0x03FF */
215
216   memory_configure_bank(machine, 2, 0, 1, &RAM[0x00400], 0x3C00); /* RAM   at 0x0400 */
217   memory_configure_bank(machine, 2, 1, 1, &RAM[0x10400], 0x3C00); /* ep548 at 0x0400-0x3FFF */
218
219   memory_configure_bank(machine, 3, 0, 1, &RAM[0x08000], 0x0400); /* RAM   at 0x8000 */
220   memory_configure_bank(machine, 3, 1, 1, &RAM[0x14000], 0x0400); /* ep382 at 0x8000 */
221
222   memory_configure_bank(machine, 4, 0, 1, &RAM[0x0F000], 0x0400); /* RAM   at 0xF000 */
223   memory_configure_bank(machine, 4, 1, 3, &RAM[0x14400], 0x0400); /* ep390, ep1390, ep2390 at 0xF000 */
224
128225}
129226
130227static TIMER_CALLBACK( z80ne_kbd_scan )
131228{
132229   /*
133    * NE555 is connected to a 74LS93 binary counter
134    * 74LS93 output:
135    *   QA-QC: column index for LEDs and keyboard
136    *   QD:    keyboard row select
137    *
138    * Port F0 input bit assignment:
139    *   0   QA   bits 0..3 of row counter
140    *   1   QB
141    *   2   QC
142    *   3   QD
143    *   4   Control button pressed, active high
144    *   5  Always low
145    *   6  Always low
146    *   7  Selected button pressed, active low
147    *
148    *
149    */
230     * NE555 is connected to a 74LS93 binary counter
231     * 74LS93 output:
232     *   QA-QC: column index for LEDs and keyboard
233     *   QD:    keyboard row select
234     *
235     * Port F0 input bit assignment:
236     *   0  QA  bits 0..3 of row counter
237     *   1  QB
238     *   2  QC
239     *   3  QD
240     *   4  Control button pressed, active high
241     *   5  Always low
242     *   6  Always low
243     *   7  Selected button pressed, active low
244     *
245     *
246     */
150247
151248   static UINT16 key_bits;
152249   static UINT8 ctrl, rst;
153250   static UINT8 i;
154251
155   // 4-bit counter
252   /* 4-bit counter */
156253   --lx383_scan_counter;
157254   lx383_scan_counter &= 0x0f;
158255
r5033r5034
174271/*
175272 * Handle NMI delay for single step instruction
176273 */
177//static offs_t nmi_delay_count(ATTR_UNUSED const address_space *space, ATTR_UNUSED offs_t address, direct_read_data *direct)
178274static DIRECT_UPDATE_HANDLER( nmi_delay_count )
179275{
180276   nmi_delay_counter--;
r5033r5034
187283   return address;
188284}
189285
286/*
287 * Handle delayed ROM/RAM banking at RESET
288 * after the first reset_delay_counter bytes have been read from ROM, switch the RAM back in
289 */
290static DIRECT_UPDATE_HANDLER( reset_delay_count )
291{
292   /*
293     * TODO: when debugger is active, his memory access causes this callback
294     *
295     */
296   if(!space->debugger_access)
297      reset_delay_counter--;
298
299   if (!reset_delay_counter)
300   {
301      /* remove this callback */
302      memory_set_direct_update_handler( space, NULL );
303      /* and switch to RAM bank at address 0x0000 */
304      memory_set_bank( space->machine, 1, 0 ); /* RAM at 0x0000 (bank 1) */
305   }
306   return address;
307}
308
309void reset_lx388(running_machine *machine)
310{
311   lx388_kr2376 = devtag_get_device(machine, "lx388_kr2376");
312   kr2376_set_input_pin( lx388_kr2376, KR2376_DSII, 0);
313   kr2376_set_input_pin( lx388_kr2376, KR2376_PII, 0);
314}
315
316void reset_lx382_banking(running_machine *machine)
317{
318   const address_space *space = cputag_get_address_space(machine, "z80ne", ADDRESS_SPACE_PROGRAM);
319
320   /* switch to ROM bank at address 0x0000 */
321    memory_set_bank(machine, 1, 1);
322    memory_set_bank(machine, 2, 0);  /* ep382 at 0x8000 */
323
324   /* after the first 3 bytes have been read from ROM, switch the RAM back in */
325   reset_delay_counter = 2;
326   memory_set_direct_update_handler(space, reset_delay_count);
327}
328
329void reset_lx390_banking(running_machine *machine)
330{
331   const address_space *space = cputag_get_address_space(machine, "z80ne", ADDRESS_SPACE_PROGRAM);
332   reset_delay_counter = 0;
333
334   switch (input_port_read(machine, "CONFIG") & 0x07) {
335   case 0x01: /* EP382 Hex Monitor */
336      if (VERBOSE)
337         logerror("reset_lx390_banking: banking ep382\n");
338       memory_set_bank(machine, 1, 4);  /* ep382 at 0x0000 for 3 cycles, then RAM */
339       memory_set_bank(machine, 2, 0);  /* RAM   at 0x0400 */
340       memory_set_bank(machine, 3, 1);  /* ep382 at 0x8000 */
341       memory_set_bank(machine, 4, 0);  /* RAM   at 0xF000 */
342      /* after the first 3 bytes have been read from ROM, switch the RAM back in */
343      reset_delay_counter = 2;
344      memory_set_direct_update_handler(space, reset_delay_count);
345       break;
346   case 0x02: /* EP548  16k BASIC */
347      if (VERBOSE)
348         logerror("reset_lx390_banking: banking ep548\n");
349       memory_set_bank(machine, 1, 5);  /* ep548 at 0x0000-0x03FF */
350       memory_set_bank(machine, 2, 1);  /* ep548 at 0x0400-0x3FFF */
351       memory_set_bank(machine, 3, 0);  /* RAM   at 0x8000 */
352       memory_set_bank(machine, 4, 0);  /* RAM   at 0xF000 */
353      memory_set_direct_update_handler( space, NULL );
354       break;
355   case 0x03: /* EP390  Boot Loader for 5.5k floppy BASIC */
356      if (VERBOSE)
357         logerror("reset_lx390_banking: banking ep390\n");
358       memory_set_bank(machine, 1, 1);  /* ep390 at 0x0000-0 x03FF for 3 cycles, then RAM */
359       memory_set_bank(machine, 2, 0);  /* RAM   at 0x0400-0x3FFF */
360       memory_set_bank(machine, 3, 0);  /* RAM   at 0x8000 */
361       memory_set_bank(machine, 4, 1);  /* ep390 at 0xF000 */
362      memory_set_direct_update_handler( space, NULL );
363       break;
364   case 0x04: /* EP1390 Boot Loader for NE DOS 1.0/1.5 */
365      if (VERBOSE)
366         logerror("reset_lx390_banking: banking ep1390\n");
367       memory_set_bank(machine, 1, 2);  /* ep1390 at 0x0000-0x03FF for 3 cycles, then RAM */
368       memory_set_bank(machine, 2, 0);  /* RAM   at 0x0400-0x3FFF */
369       memory_set_bank(machine, 3, 0);  /* RAM   at 0x8000 */
370       memory_set_bank(machine, 4, 2);  /* ep1390 at 0xF000 */
371      memory_set_direct_update_handler( space, NULL );
372       break;
373   case 0x05: /* EP2390 Boot Loader for NE DOS G.1 */
374      if (VERBOSE)
375         logerror("reset_lx390_banking: banking ep2390\n");
376       memory_set_bank(machine, 1, 3);  /* ep2390 at 0x0000-0x03FF for 3 cycles, then RAM */
377       memory_set_bank(machine, 2, 0);  /* RAM   at 0x0400-0x3FFF */
378       memory_set_bank(machine, 3, 0);  /* RAM   at 0x8000 */
379       memory_set_bank(machine, 4, 3);  /* ep2390 at 0xF000 */
380      memory_set_direct_update_handler( space, NULL );
381       break;
382   }
383
384    /* TODO: in real hardware the ENH bus line is pulled down
385     * until a I/O read is performed on a address with A0 address bit low and A1 or A2 address bit high
386     */
387}
388
190389MACHINE_RESET(z80ne_base)
191390{
192391   int i;
193392   const address_space *space = cputag_get_address_space(machine, "z80ne", ADDRESS_SPACE_PROGRAM);
194393
195   logerror("In MACHINE_RESET z80ne_base\n");
394   LOG(("In MACHINE_RESET z80ne_base\n"));
196395
197396   for ( i=0; i<LX383_KEYS; i++)
198397       lx383_key[i] = 0xf0 | i;
r5033r5034
221420      cass_data.wave_short = LX385_TAPE_SAMPLE_FREQ / (9600 * 2);
222421      cass_data.wave_long = LX385_TAPE_SAMPLE_FREQ / (4800 * 2);
223422   }
224//   cass_data.output.length = 0;
225423   cass_data.wave_length = cass_data.wave_short;
226424   cass_data.output.length = cass_data.wave_length;
227425   cass_data.output.level = 1;
r5033r5034
239437   ay31015_set_receiver_clock( z80ne_ay31015, cass_data.speed * 16.0);
240438   ay31015_set_transmitter_clock( z80ne_ay31015, cass_data.speed * 16.0);
241439
242   memory_set_direct_update_handler( space, NULL );
243440   nmi_delay_counter = 0;
244441   lx385_ctrl_w(space, 0, 0);
245442
r5033r5034
247444
248445MACHINE_RESET(z80ne)
249446{
250//   UINT8 *RAM = memory_region(machine, "z80ne");
251//   memory_configure_bank(machine, 1, 0, 2, &RAM[0x0000], 0x8000);
252
253   /* after the first 3 bytes have been read from ROM, switch the ram back in */
254   timer_set(machine, ATTOTIME_IN_USEC(6), NULL, 0, z80ne_reset_address_decoder);
255    memory_set_bank(machine, 1, 1);
256
257   logerror("In MACHINE_RESET z80ne\n");
447   LOG(("In MACHINE_RESET z80ne\n"));
448   reset_lx382_banking(machine);
258449   MACHINE_RESET_CALL( z80ne_base );
259450}
260451
261452MACHINE_RESET(z80net)
262453{
454   LOG(("In MACHINE_RESET z80net\n"));
263455   MACHINE_RESET_CALL( z80ne );
264   logerror("In MACHINE_RESET z80net\n");
265
266   lx388_kr2376 = devtag_get_device(machine, "lx388_kr2376");
267   kr2376_set_input_pin( lx388_kr2376, KR2376_DSII, 0);
268   kr2376_set_input_pin( lx388_kr2376, KR2376_PII, 0);
456   reset_lx388(machine);
269457}
270458
271459MACHINE_RESET(z80netb)
272460{
461   LOG(("In MACHINE_RESET z80netb\n"));
273462   MACHINE_RESET_CALL( z80ne_base );
274   logerror("In MACHINE_RESET z80netb\n");
463   reset_lx388(machine);
464}
275465
276   lx388_kr2376 = devtag_get_device(machine, "lx388_kr2376");
277   kr2376_set_input_pin( lx388_kr2376, KR2376_DSII, 0);
278   kr2376_set_input_pin( lx388_kr2376, KR2376_PII, 0);
466MACHINE_RESET(z80netf)
467{
468   const device_config *z80ne_fdc;
469
470   LOG(("In MACHINE_RESET z80netf\n"));
471   reset_lx390_banking(machine);
472   MACHINE_RESET_CALL( z80ne_base );
473   reset_lx388(machine);
474   z80ne_fdc = devtag_get_device(machine, "wd1771");
475   wd17xx_set_density (z80ne_fdc, DEN_FM_HI); /* Datarate 64 usec */
279476}
280477
281478INPUT_CHANGED( z80ne_reset )
r5033r5034
286483   if ( ! BIT(rst, 0))
287484   {
288485      running_machine *machine = field->port->machine;
289      //MACHINE_RESET_CALL(z80ne);
290      //device_reset(cputag_get_cpu(machine, "z80ne"));
291486      mame_schedule_soft_reset(machine);
292487   }
293488}
r5033r5034
305500
306501MACHINE_START( z80ne )
307502{
308   logerror("In MACHINE_START z80ne\n");
503   LOG(("In MACHINE_START z80ne\n"));
309504   state_save_register_item( machine, "z80ne", NULL, 0, lx383_scan_counter );
310505   state_save_register_item( machine, "z80ne", NULL, 0, lx383_downsampler );
311506   state_save_register_item_array( machine, "z80ne", NULL, 0, lx383_key );
r5033r5034
316511MACHINE_START( z80net )
317512{
318513   MACHINE_START_CALL( z80ne );
319   logerror("In MACHINE_START z80net\n");
514   LOG(("In MACHINE_START z80net\n"));
320515}
321516
322517MACHINE_START( z80netb )
323518{
324519   MACHINE_START_CALL( z80net );
325   logerror("In MACHINE_START z80netb\n");
520   LOG(("In MACHINE_START z80netb\n"));
326521}
327522
523MACHINE_START( z80netf )
524{
525   MACHINE_START_CALL( z80net );
526   LOG(("In MACHINE_START z80netf\n"));
527}
528
328529/******************************************************************************
329530 Drivers
330531******************************************************************************/
r5033r5034
333534READ8_HANDLER( lx383_r )
334535{
335536   /*
336    * Keyboard scanning
337    *
338    * IC14 NE555 astable oscillator
339    * IC13 74LS93 binary counter
340    * IC5  74LS240 tri-state buffer
341    *
342    * l'oscillatore NE555 alimenta il clock del contatore 74LS93
343    *       D0 - Q(A) --\
344    *       D1 - Q(B)    |-- column
345    *       D2 - Q(C) --/
346    *       D3 - Q(D)        row
347    *      D4 - CTRL
348    *      D5 - 0
349    *      D6 - 0
350    *      D7 - ~KEY Pressed
351    */
537     * Keyboard scanning
538     *
539     * IC14 NE555 astable oscillator
540     * IC13 74LS93 binary counter
541     * IC5  74LS240 tri-state buffer
542     *
543     * l'oscillatore NE555 alimenta il clock del contatore 74LS93
544     *      D0 - Q(A) --\
545     *      D1 - Q(B)    |-- column
546     *      D2 - Q(C) --/
547     *      D3 - Q(D)        row
548     *      D4 - CTRL
549     *      D5 - 0
550     *      D6 - 0
551     *      D7 - ~KEY Pressed
552     */
352553    return lx383_key[lx383_scan_counter];
353554}
354555
355//#define ATTR_UNUSED __attribute__((__unused__))
356556WRITE8_HANDLER( lx383_w )
357557{
358558   /*
359    * First 8 locations (F0-F7) are mapped to a dual-port 8-byte RAM
360    * The 1KHz NE-555 astable oscillator circuit drive
361    * a 4-bit 74LS93 binary counter.
362    * The 3 least sigificant bits of the counter are connected
363    * both to the read addres of the dual-port ram and to
364    * a 74LS156 3 to 8 binary decoder driving the cathode
365    * of 8 7-segments LEDS.
366    * The data output of the dual-port ram drive the anodes
367    * of the LEDS through 74LS07 buffers.
368    * LED segments - dual-port RAM bit:
369    *   A   0x01
370    *   B   0x02
371    *   C   0x04
372    *   D   0x08
373    *   E   0x10
374    *   F   0x20
375    *   G   0x40
376    *   P   0x80 (represented by DP in original schematics)
377    *
378    *   A write in the range F0-FF starts a 74LS90 counter
379    *   that trigger the NMI line of the CPU afther 2 instruction
380    *   fetch cycles for single step execution.
381    */
559     * First 8 locations (F0-F7) are mapped to a dual-port 8-byte RAM
560     * The 1KHz NE-555 astable oscillator circuit drive
561     * a 4-bit 74LS93 binary counter.
562     * The 3 least sigificant bits of the counter are connected
563     * both to the read addres of the dual-port ram and to
564     * a 74LS156 3 to 8 binary decoder driving the cathode
565     * of 8 7-segments LEDS.
566     * The data output of the dual-port ram drive the anodes
567     * of the LEDS through 74LS07 buffers.
568     * LED segments - dual-port RAM bit:
569     *   A   0x01
570     *   B   0x02
571     *   C   0x04
572     *   D   0x08
573     *   E   0x10
574     *   F   0x20
575     *   G   0x40
576     *   P   0x80 (represented by DP in original schematics)
577     *
578     *   A write in the range F0-FF starts a 74LS90 counter
579     *   that trigger the NMI line of the CPU afther 2 instruction
580     *   fetch cycles for single step execution.
581     */
382582
383583   if ( offset < 8 )
384584       output_set_digit_value( offset, data ^ 0xff );
r5033r5034
441641{
442642   /* set unused bits high */
443643   UINT8 data = 0xc0;
444//   UINT8 olddata = 0xc0;
445644
446645   ay31015_set_input_pin( z80ne_ay31015, AY31015_SWE, 0 );
447646   data |= (ay31015_get_output_pin( z80ne_ay31015, AY31015_OR   ) ? 0x01 : 0);
r5033r5034
454653
455654   return data;
456655}
656
457657WRITE8_HANDLER(lx385_data_w)
458658{
459659   ay31015_set_transmit_data( z80ne_ay31015, data );
r5033r5034
464664WRITE8_HANDLER(lx385_ctrl_w)
465665{
466666   /* Translate data to control signals
467    *     0 bit1=0, bit0=0   UART Reset pulse
468    *     1 bit1=0, bit0=1   UART RDAV (Reset Data Available) pulse
469    *     2 UART Tx Clock Enable (active high)
470    *     3 *TAPEA Enable (active low) (at reset: low)
471    *     4 *TAPEB Enable (active low) (at reset: low)
472    */
667     *     0 bit1=0, bit0=0   UART Reset pulse
668     *     1 bit1=0, bit0=1   UART RDAV (Reset Data Available) pulse
669     *     2 UART Tx Clock Enable (active high)
670     *     3 *TAPEA Enable (active low) (at reset: low)
671     *     4 *TAPEB Enable (active low) (at reset: low)
672     */
473673   UINT8 uart_reset, uart_rdav, uart_tx_clock;
474674   UINT8 motor_a, motor_b;
475675   UINT8 changed_bits = (lx385_ctrl ^ data) & 0x1C;
r5033r5034
532732   data = m6847_get_field_sync(space->machine) ? 0x00 : 0x80;
533733   return data;
534734}
735
736/*
737 * DRQ INTRQ IC9B.10 IC8B.*Q
738 *  0    0     1       0
739 *  0    1     0       x
740 *  1    0     0       x
741 *  1    1     0       x
742 *
743 */
744static WD17XX_CALLBACK( z80ne_fdc_callback )
745{
746   switch (state)
747   {
748      case WD17XX_IRQ_CLR:
749         wd17xx_state.intrq = FALSE;
750         break;
751      case WD17XX_IRQ_SET:
752         wd17xx_state.intrq = TRUE;
753         output_set_value("drv0", 0);
754         output_set_value("drv1", 0);
755         break;
756      case WD17XX_DRQ_CLR:
757         wd17xx_state.drq = FALSE;
758         break;
759      case WD17XX_DRQ_SET:
760         wd17xx_state.drq = TRUE;
761         break;
762   }
763}
764
765const wd17xx_interface z80ne_wd17xx_interface = { z80ne_fdc_callback, NULL };
766
767WRITE8_DEVICE_HANDLER(lx390_motor_w)
768{
769   /* Selection of drive and parameters
770     A write also causes the selected drive motor to turn on for about 3 seconds.
771     When the motor turns off, the drive is deselected.
772        d7 Unused             (trs80: 1=MFM, 0=FM)
773        d6 (trs80: 1=Wait)
774        d5 0=Side 0, 1=Side 1 (trs80: 1=Write Precompensation enabled)
775        d4 Unused             (trs80: 0=Side 0, 1=Side 1)
776        d3 1=select drive 3
777        d2 1=select drive 2
778        d1 1=select drive 1
779        d0 1=select drive 0 */
780
781      UINT8 drive = 255;
782
783      if (data & 1)
784         drive = 0;
785      else
786      if (data & 2)
787         drive = 1;
788      else
789      if (data & 4)
790         drive = 2;
791      else
792      if (data & 8)
793         drive = 3;
794
795      wd17xx_state.head = (data & 32) ? 1 : 0;
796      wd17xx_state.drive = data & 0x0F;
797
798      /* no drive selected, turn off all leds */
799      if (!wd17xx_state.drive)
800      {
801         output_set_value("drv0", 0);
802         output_set_value("drv1", 0);
803      }
804
805      if (drive < 4)
806      {
807         LOG(("lx390_motor_w, set drive %1d\n", drive));
808         wd17xx_set_drive(device,drive);
809         LOG(("lx390_motor_w, set side %1d\n", wd17xx_state.head));
810         wd17xx_set_side(device, wd17xx_state.head);
811      }
812}
813
814READ8_DEVICE_HANDLER(lx390_reset_bank)
815{
816   offs_t pc;
817
818   /* if PC is not in range, we are under integrated debugger control, DON'T SWAP */
819   pc = cpu_get_pc(cputag_get_cpu(device->machine, "z80ne"));
820   if((pc >= 0xf000) && (pc <=0xffff))
821   {
822      LOG(("lx390_reset_bank, reset memory bank 1\n"));
823      memory_set_bank(device->machine, 1, 0); /* RAM at 0x0000 (bank 1) */
824   }
825   else
826   {
827      LOG(("lx390_reset_bank, bypass because in debugger\n"));
828   }
829   return 0xff;
830}
831
832READ8_DEVICE_HANDLER(lx390_fdc_r)
833{
834   UINT8 d;
835
836   switch(offset)
837   {
838   case 0:
839      d = wd17xx_status_r(device, 0);
840      LOG(("lx390_fdc_r, WD17xx status: %02x\n", d));
841      break;
842   case 1:
843      d = wd17xx_track_r(device, 0);
844      LOG(("lx390_fdc_r, WD17xx track:  %02x\n", d));
845      break;
846   case 2:
847      d = wd17xx_sector_r(device, 0);
848      LOG(("lx390_fdc_r, WD17xx sector: %02x\n", d));
849      break;
850   case 3:
851      if(!wd17xx_state.drq && !wd17xx_state.intrq)
852      {
853         d = wd17xx_data_r(device, 0);
854         LOG(("lx390_fdc_r, WD17xx data3, ready:  %02x\n", d));
855      }
856      else
857      {
858         d = 0xff;
859         LOG(("lx390_fdc_r, WD17xx data3,  busy: intrq %01x drq %01x \n", wd17xx_state.intrq, wd17xx_state.drq));
860      }
861      break;
862   case 6:
863      d = 0xff;
864      lx390_reset_bank(device, 0);
865      break;
866   case 7:
867      d = wd17xx_data_r(device, 3);
868      LOG(("lx390_fdc_r, WD17xx data7, force:  %02x\n", d));
869      break;
870   default:
871      d = 0x00;
872   }
873   return d;
874}
875
876WRITE8_DEVICE_HANDLER(lx390_fdc_w)
877{
878   UINT8 d;
879
880   d = data;
881   switch(offset)
882   {
883   case 0:
884      LOG(("lx390_fdc_w, WD17xx command: %02x\n", d));
885      wd17xx_command_w(device, offset, d);
886      if (wd17xx_state.drive & 1)
887         output_set_value("drv0", 2);
888      else if (wd17xx_state.drive & 2)
889         output_set_value("drv1", 2);
890      break;
891   case 1:
892      LOG(("lx390_fdc_w, WD17xx track:   %02x\n", d));
893      wd17xx_track_w(device, offset, d);
894      break;
895   case 2:
896      LOG(("lx390_fdc_w, WD17xx sector:  %02x\n", d));
897      wd17xx_sector_w(device, offset, d);
898      break;
899   case 3:
900      if(!wd17xx_state.drq && !wd17xx_state.intrq)
901      {
902         LOG(("lx390_fdc_w, WD17xx data3, ready:   %02x\n", d));
903         wd17xx_data_w(device, 0, d);
904      }
905      else
906      {
907         LOG(("lx390_fdc_w, WD17xx data3,  busy:   %02x\n", d));
908      }
909      break;
910   case 6:
911      LOG(("lx390_fdc_w, motor_w:   %02x\n", d));
912      lx390_motor_w(device, 0, d);
913      break;
914   case 7:
915      LOG(("lx390_fdc_w, WD17xx data7, force:   %02x\n", d));
916      wd17xx_data_w(device, 3, d);
917      break;
918   }
919}
src/mess/mess.mak
r5033r5034
13581358$(MESSOBJ)/z80ne.a:   \
13591359   $(MESS_DRIVERS)/z80ne.o     \
13601360   $(MESS_VIDEO)/z80ne.o       \
1361   $(MESS_FORMATS)/z80ne_dsk.o \
13611362   $(MESS_MACHINE)/z80ne.o     \
13621363   $(MESS_MACHINE)/kr2376.o   \
13631364
r5033r5034
14971498$(MESS_DRIVERS)/x68k.o:      $(MESS_LAYOUT)/x68000.lh
14981499$(MESS_DRIVERS)/z80ne.o:   $(MESS_LAYOUT)/z80ne.lh   \
14991500                     $(MESS_LAYOUT)/z80net.lh  \
1500                     $(MESS_LAYOUT)/z80netb.lh
1501                     $(MESS_LAYOUT)/z80netb.lh \
1502                     $(MESS_LAYOUT)/z80netf.lh
15011503
15021504#-------------------------------------------------
15031505# MESS-specific tools
src/mess/layout/z80ne.lay
r5033r5034
44
55<mamelayout version="2">
66
7    <element name="button" defstate="1" />
8
9    <element name="black">
10        <rect>
11            <bounds left="0" top="0" right="1" bottom="1" />
12            <color red="0.0" green="0.0" blue="0.0" />
13        </rect>
14    </element>
15
167    <element name="gray">
178        <rect>
189            <bounds left="0" top="0" right="1" bottom="1" />
1910            <color red="0.15" green="0.15" blue="0.15" />
20        </rect>
11        </rect>
2112    </element>
2213
2314    <element name="digit_back">
2415        <rect>
2516            <bounds left="0" top="0" right="1" bottom="1" />
2617            <color red="0.584" green="0.631" blue="0.690" />
27        </rect>
18        </rect>
2819    </element>
2920
3021    <element name="digit" defstate="0">
r5033r5034
3728        <rect>
3829            <bounds left="0" top="0" right="1" bottom="1" />
3930            <color red="0.0" green="0.0" blue="0.0" />
40        </rect>
31        </rect>
4132    </element>
4233
4334    <element name="pushbutton" defstate="1">
src/mess/layout/z80net.lay
r5033r5034
88        <rect>
99            <bounds left="0" top="0" right="1" bottom="1" />
1010            <color red="0.15" green="0.15" blue="0.15" />
11        </rect>
11        </rect>
1212    </element>
1313
1414    <element name="digit_back">
1515        <rect>
1616            <bounds left="0" top="0" right="1" bottom="1" />
1717            <color red="0.584" green="0.631" blue="0.690" />
18        </rect>
18        </rect>
1919    </element>
2020
2121    <element name="digit" defstate="0">
r5033r5034
2828        <rect>
2929            <bounds left="0" top="0" right="1" bottom="1" />
3030            <color red="0.0" green="0.0" blue="0.0" />
31        </rect>
31        </rect>
3232    </element>
3333
3434    <element name="pushbutton" defstate="1">
r5033r5034
666666
667667    </view>
668668
669
670669</mamelayout>
src/mess/layout/z80netb.lay
r5033r5034
88        <rect>
99            <bounds left="0" top="0" right="1" bottom="1" />
1010            <color red="0.15" green="0.15" blue="0.15" />
11        </rect>
11        </rect>
1212    </element>
1313
1414    <element name="back">
1515        <rect>
1616            <bounds left="0" top="0" right="1" bottom="1" />
1717            <color red="0.0" green="0.0" blue="0.0" />
18        </rect>
18        </rect>
1919    </element>
2020
2121    <element name="flatbackground">
src/mess/layout/z80netf.lay
r0r5034
1<?xml version="1.0"?>
2<!-- z80ne.lay -->
3<!-- 2009-01-16: Initial version.  [Roberto Lavarone] -->
4
5<mamelayout version="2">
6
7    <element name="gray">
8        <rect>
9            <bounds left="0" top="0" right="1" bottom="1" />
10            <color red="0.15" green="0.15" blue="0.15" />
11        </rect>
12    </element>
13
14    <element name="digit_back">
15        <rect>
16            <bounds left="0" top="0" right="1" bottom="1" />
17            <color red="0.584" green="0.631" blue="0.690" />
18        </rect>
19    </element>
20
21    <element name="digit" defstate="0">
22        <led7seg>
23            <color red="0.75" green="0.0" blue="0.0"/>
24        </led7seg>
25    </element>
26
27    <element name="back">
28        <rect>
29            <bounds left="0" top="0" right="1" bottom="1" />
30            <color red="0.0" green="0.0" blue="0.0" />
31        </rect>
32    </element>
33
34    <element name="pushbutton" defstate="1">
35        <rect>
36            <bounds x="2" y="2" width="48" height="48"/>
37            <color red="0.1" green="0.1" blue="0.1" />
38        </rect>
39        <rect state="0">
40            <bounds x="0" y="0" width="48" height="48"/>
41            <color red="0.75" green="0.75" blue="0.0" />
42        </rect>
43        <rect state="1">
44            <bounds x="2" y="2" width="48" height="48"/>
45            <color red="0.75" green="0.75" blue="0.0" />
46        </rect>
47    </element>
48
49    <element name="pushbuttonCTRL" defstate="1">
50        <rect>
51            <bounds x="2" y="2" width="48" height="48"/>
52            <color red="0.1" green="0.1" blue="0.1" />
53        </rect>
54        <rect state="0">
55            <bounds x="0" y="0" width="48" height="48"/>
56            <color red="0.25" green="0.25" blue="0.25" />
57        </rect>
58        <text string="CTRL" state="0">
59            <bounds x="8" y="24" width="40" height="20"/>
60            <color red="1.0" green="1.0" blue="1.0" />
61        </text>
62        <rect state="1">
63            <bounds x="2" y="2" width="48" height="48"/>
64            <color red="0.25" green="0.25" blue="0.25" />
65        </rect>
66        <text string="CTRL" state="1">
67            <bounds x="10" y="26" width="40" height="20"/>
68            <color red="1.0" green="1.0" blue="1.0" />
69        </text>
70    </element>
71
72    <element name="pushbuttonRST" defstate="1">
73        <rect>
74            <bounds x="2" y="2" width="48" height="48"/>
75            <color red="0.1" green="0.1" blue="0.1" />
76        </rect>
77        <rect state="0">
78            <bounds x="0" y="0" width="48" height="48"/>
79            <color red="0.75" green="0" blue="0" />
80        </rect>
81        <text string="RST " state="0">
82            <bounds x="8" y="24" width="40" height="20"/>
83            <color red="1.0" green="1.0" blue="1.0" />
84        </text>
85        <rect state="1">
86            <bounds x="2" y="2" width="48" height="48"/>
87            <color red="0.75" green="0" blue="0" />
88        </rect>
89        <text string="RST " state="1">
90            <bounds x="10" y="26" width="40" height="20"/>
91            <color red="1.0" green="1.0" blue="1.0" />
92        </text>
93    </element>
94
95    <element name="pushbutton0" defstate="1">
96        <rect>
97            <bounds x="2" y="2" width="48" height="48"/>
98            <color red="0.1" green="0.1" blue="0.1" />
99        </rect>
100        <rect state="0">
101            <bounds x="0" y="0" width="48" height="48"/>
102            <color red="0.0" green="0.0" blue="0.75" />
103        </rect>
104        <text string="  0 " state="0">
105            <bounds x="8" y="24" width="40" height="20"/>
106            <color red="1.0" green="1.0" blue="1.0" />
107        </text>
108        <rect state="1">
109            <bounds x="2" y="2" width="48" height="48"/>
110            <color red="0.0" green="0.0" blue="0.75" />
111        </rect>
112        <text string="  0 " state="1">
113            <bounds x="10" y="26" width="40" height="20"/>
114            <color red="1.0" green="1.0" blue="1.0" />
115        </text>
116    </element>
117
118    <element name="pushbutton1" defstate="1">
119        <rect>
120            <bounds x="2" y="2" width="48" height="48"/>
121            <color red="0.1" green="0.1" blue="0.1" />
122        </rect>
123        <rect state="0">
124            <bounds x="0" y="0" width="48" height="48"/>
125            <color red="0.0" green="0.0" blue="0.75" />
126        </rect>
127        <text string="  1 " state="0">
128            <bounds x="8" y="24" width="40" height="20"/>
129            <color red="1.0" green="1.0" blue="1.0" />
130        </text>
131        <rect state="1">
132            <bounds x="2" y="2" width="48" height="48"/>
133            <color red="0.0" green="0.0" blue="0.75" />
134        </rect>
135        <text string="  1 " state="1">
136            <bounds x="10" y="26" width="40" height="20"/>
137            <color red="1.0" green="1.0" blue="1.0" />
138        </text>
139    </element>
140
141    <element name="pushbutton2" defstate="1">
142        <rect>
143            <bounds x="2" y="2" width="48" height="48"/>
144            <color red="0.1" green="0.1" blue="0.1" />
145        </rect>
146        <rect state="0">
147            <bounds x="0" y="0" width="48" height="48"/>
148            <color red="0.0" green="0.0" blue="0.75" />
149        </rect>
150        <text string="  2 " state="0">
151            <bounds x="8" y="24" width="40" height="20"/>
152            <color red="1.0" green="1.0" blue="1.0" />
153        </text>
154        <rect state="1">
155            <bounds x="2" y="2" width="48" height="48"/>
156            <color red="0.0" green="0.0" blue="0.75" />
157        </rect>
158        <text string="  2 " state="1">
159            <bounds x="10" y="26" width="40" height="20"/>
160            <color red="1.0" green="1.0" blue="1.0" />
161        </text>
162    </element>
163
164    <element name="pushbutton3" defstate="1">
165        <rect>
166            <bounds x="2" y="2" width="48" height="48"/>
167            <color red="0.1" green="0.1" blue="0.1" />
168        </rect>
169        <rect state="0">
170            <bounds x="0" y="0" width="48" height="48"/>
171            <color red="0.0" green="0.0" blue="0.75" />
172        </rect>
173        <text string="  3 " state="0">
174            <bounds x="8" y="24" width="40" height="20"/>
175            <color red="1.0" green="1.0" blue="1.0" />
176        </text>
177        <rect state="1">
178            <bounds x="2" y="2" width="48" height="48"/>
179            <color red="0.0" green="0.0" blue="0.75" />
180        </rect>
181        <text string="  3 " state="1">
182            <bounds x="10" y="26" width="40" height="20"/>
183            <color red="1.0" green="1.0" blue="1.0" />
184        </text>
185    </element>
186
187    <element name="pushbutton4" defstate="1">
188        <rect>
189            <bounds x="2" y="2" width="48" height="48"/>
190            <color red="0.1" green="0.1" blue="0.1" />
191        </rect>
192        <rect state="0">
193            <bounds x="0" y="0" width="48" height="48"/>
194            <color red="0.0" green="0.0" blue="0.75" />
195        </rect>
196        <text string="  4 " state="0">
197            <bounds x="8" y="24" width="40" height="20"/>
198            <color red="1.0" green="1.0" blue="1.0" />
199        </text>
200        <rect state="1">
201            <bounds x="2" y="2" width="48" height="48"/>
202            <color red="0.0" green="0.0" blue="0.75" />
203        </rect>
204        <text string="  4 " state="1">
205            <bounds x="10" y="26" width="40" height="20"/>
206            <color red="1.0" green="1.0" blue="1.0" />
207        </text>
208    </element>
209
210    <element name="pushbutton5" defstate="1">
211        <rect>
212            <bounds x="2" y="2" width="48" height="48"/>
213            <color red="0.1" green="0.1" blue="0.1" />
214        </rect>
215        <rect state="0">
216            <bounds x="0" y="0" width="48" height="48"/>
217            <color red="0.0" green="0.0" blue="0.75" />
218        </rect>
219        <text string="  5 " state="0">
220            <bounds x="8" y="24" width="40" height="20"/>
221            <color red="1.0" green="1.0" blue="1.0" />
222        </text>
223        <rect state="1">
224            <bounds x="2" y="2" width="48" height="48"/>
225            <color red="0.0" green="0.0" blue="0.75" />
226        </rect>
227        <text string="  5 " state="1">
228            <bounds x="10" y="26" width="40" height="20"/>
229            <color red="1.0" green="1.0" blue="1.0" />
230        </text>
231    </element>
232
233    <element name="pushbutton6" defstate="1">
234        <rect>
235            <bounds x="2" y="2" width="48" height="48"/>
236            <color red="0.1" green="0.1" blue="0.1" />
237        </rect>
238        <rect state="0">
239            <bounds x="0" y="0" width="48" height="48"/>
240            <color red="0.0" green="0.0" blue="0.75" />
241        </rect>
242        <text string="  6 " state="0">
243            <bounds x="8" y="24" width="40" height="20"/>
244            <color red="1.0" green="1.0" blue="1.0" />
245        </text>
246        <rect state="1">
247            <bounds x="2" y="2" width="48" height="48"/>
248            <color red="0.0" green="0.0" blue="0.75" />
249        </rect>
250        <text string="  6 " state="1">
251            <bounds x="10" y="26" width="40" height="20"/>
252            <color red="1.0" green="1.0" blue="1.0" />
253        </text>
254    </element>
255
256    <element name="pushbutton7" defstate="1">
257        <rect>
258            <bounds x="2" y="2" width="48" height="48"/>
259            <color red="0.1" green="0.1" blue="0.1" />
260        </rect>
261        <rect state="0">
262            <bounds x="0" y="0" width="48" height="48"/>
263            <color red="0.0" green="0.0" blue="0.75" />
264        </rect>
265        <text string="  7 " state="0">
266            <bounds x="8" y="24" width="40" height="20"/>
267            <color red="1.0" green="1.0" blue="1.0" />
268        </text>
269        <rect state="1">
270            <bounds x="2" y="2" width="48" height="48"/>
271            <color red="0.0" green="0.0" blue="0.75" />
272        </rect>
273        <text string="  7 " state="1">
274            <bounds x="10" y="26" width="40" height="20"/>
275            <color red="1.0" green="1.0" blue="1.0" />
276        </text>
277    </element>
278
279    <element name="pushbutton8" defstate="1">
280        <rect>
281            <bounds x="2" y="2" width="48" height="48"/>
282            <color red="0.1" green="0.1" blue="0.1" />
283        </rect>
284        <rect state="0">
285            <bounds x="0" y="0" width="48" height="48"/>
286            <color red="0.0" green="0.0" blue="0.75" />
287        </rect>
288        <text string="  8 " state="0">
289            <bounds x="8" y="24" width="40" height="20"/>
290            <color red="1.0" green="1.0" blue="1.0" />
291        </text>
292        <rect state="1">
293            <bounds x="2" y="2" width="48" height="48"/>
294            <color red="0.0" green="0.0" blue="0.75" />
295        </rect>
296        <text string="  8 " state="1">
297            <bounds x="10" y="26" width="40" height="20"/>
298            <color red="1.0" green="1.0" blue="1.0" />
299        </text>
300    </element>
301
302    <element name="pushbutton9" defstate="1">
303        <rect>
304            <bounds x="2" y="2" width="48" height="48"/>
305            <color red="0.1" green="0.1" blue="0.1" />
306        </rect>
307        <rect state="0">
308            <bounds x="0" y="0" width="48" height="48"/>
309            <color red="0.0" green="0.0" blue="0.75" />
310        </rect>
311        <text string="  9 " state="0">
312            <bounds x="8" y="24" width="40" height="20"/>
313            <color red="1.0" green="1.0" blue="1.0" />
314        </text>
315        <rect state="1">
316            <bounds x="2" y="2" width="48" height="48"/>
317            <color red="0.0" green="0.0" blue="0.75" />
318        </rect>
319        <text string="  9 " state="1">
320            <bounds x="10" y="26" width="40" height="20"/>
321            <color red="1.0" green="1.0" blue="1.0" />
322        </text>
323    </element>
324
325    <element name="pushbuttonA" defstate="1">
326        <rect>
327            <bounds x="2" y="2" width="48" height="48"/>
328            <color red="0.1" green="0.1" blue="0.1" />
329        </rect>
330        <rect state="0">
331            <bounds x="0" y="0" width="48" height="48"/>
332            <color red="0.0" green="0.0" blue="0.75" />
333        </rect>
334        <text string="  A " state="0">
335            <bounds x="8" y="24" width="40" height="20"/>
336            <color red="1.0" green="1.0" blue="1.0" />
337        </text>
338        <rect state="1">
339            <bounds x="2" y="2" width="48" height="48"/>
340            <color red="0.0" green="0.0" blue="0.75" />
341        </rect>
342        <text string="  A " state="1">
343            <bounds x="10" y="26" width="40" height="20"/>
344            <color red="1.0" green="1.0" blue="1.0" />
345        </text>
346    </element>
347
348    <element name="pushbuttonB" defstate="1">
349        <rect>
350            <bounds x="2" y="2" width="48" height="48"/>
351            <color red="0.1" green="0.1" blue="0.1" />
352        </rect>
353        <rect state="0">
354            <bounds x="0" y="0" width="48" height="48"/>
355            <color red="0.0" green="0.0" blue="0.75" />
356        </rect>
357        <text string="  B " state="0">
358            <bounds x="8" y="24" width="40" height="20"/>
359            <color red="1.0" green="1.0" blue="1.0" />
360        </text>
361        <rect state="1">
362            <bounds x="2" y="2" width="48" height="48"/>
363            <color red="0.0" green="0.0" blue="0.75" />
364        </rect>
365        <text string="  B " state="1">
366            <bounds x="10" y="26" width="40" height="20"/>
367            <color red="1.0" green="1.0" blue="1.0" />
368        </text>
369    </element>
370
371    <element name="pushbuttonC" defstate="1">
372        <rect>
373            <bounds x="2" y="2" width="48" height="48"/>
374            <color red="0.1" green="0.1" blue="0.1" />
375        </rect>
376        <rect state="0">
377            <bounds x="0" y="0" width="48" height="48"/>
378            <color red="0.0" green="0.0" blue="0.75" />
379        </rect>
380        <text string="  C " state="0">
381            <bounds x="8" y="24" width="40" height="20"/>
382            <color red="1.0" green="1.0" blue="1.0" />
383        </text>
384        <rect state="1">
385            <bounds x="2" y="2" width="48" height="48"/>
386            <color red="0.0" green="0.0" blue="0.75" />
387        </rect>
388        <text string="  C " state="1">
389            <bounds x="10" y="26" width="40" height="20"/>
390            <color red="1.0" green="1.0" blue="1.0" />
391        </text>
392    </element>
393
394    <element name="pushbuttonD" defstate="1">
395        <rect>
396            <bounds x="2" y="2" width="48" height="48"/>
397            <color red="0.1" green="0.1" blue="0.1" />
398        </rect>
399        <rect state="0">
400            <bounds x="0" y="0" width="48" height="48"/>
401            <color red="0.0" green="0.0" blue="0.75" />
402        </rect>
403        <text string="  D " state="0">
404            <bounds x="8" y="24" width="40" height="20"/>
405            <color red="1.0" green="1.0" blue="1.0" />
406        </text>
407        <rect state="1">
408            <bounds x="2" y="2" width="48" height="48"/>
409            <color red="0.0" green="0.0" blue="0.75" />
410        </rect>
411        <text string="  D " state="1">
412            <bounds x="10" y="26" width="40" height="20"/>
413            <color red="1.0" green="1.0" blue="1.0" />
414        </text>
415    </element>
416
417    <element name="pushbuttonE" defstate="1">
418        <rect>
419            <bounds x="2" y="2" width="48" height="48"/>
420            <color red="0.1" green="0.1" blue="0.1" />
421        </rect>
422        <rect state="0">
423            <bounds x="0" y="0" width="48" height="48"/>
424            <color red="0.0" green="0.0" blue="0.75" />
425        </rect>
426        <text string="  E " state="0">
427            <bounds x="8" y="24" width="40" height="20"/>
428            <color red="1.0" green="1.0" blue="1.0" />
429        </text>
430        <rect state="1">
431            <bounds x="2" y="2" width="48" height="48"/>
432            <color red="0.0" green="0.0" blue="0.75" />
433        </rect>
434        <text string="  E " state="1">
435            <bounds x="10" y="26" width="40" height="20"/>
436            <color red="1.0" green="1.0" blue="1.0" />
437        </text>
438    </element>
439
440    <element name="pushbuttonF" defstate="1">
441        <rect>
442            <bounds x="2" y="2" width="48" height="48"/>
443            <color red="0.1" green="0.1" blue="0.1" />
444        </rect>
445        <rect state="0">
446            <bounds x="0" y="0" width="48" height="48"/>
447            <color red="0.0" green="0.0" blue="0.75" />
448        </rect>
449        <text string="  F " state="0">
450            <bounds x="8" y="24" width="40" height="20"/>
451            <color red="1.0" green="1.0" blue="1.0" />
452        </text>
453        <rect state="1">
454            <bounds x="2" y="2" width="48" height="48"/>
455            <color red="0.0" green="0.0" blue="0.75" />
456        </rect>
457        <text string="  F " state="1">
458            <bounds x="10" y="26" width="40" height="20"/>
459            <color red="1.0" green="1.0" blue="1.0" />
460        </text>
461    </element>
462
463    <element name="flatbackground">
464        <rect>
465            <bounds left="-10" top="-10" right="587" bottom="813" />
466            <color red="0.1" green="0.1" blue="0.1" />
467        </rect>
468        <rect>
469            <bounds left="5" top="5" right="577" bottom="803" />
470            <color red="0.1" green="0.2" blue="0.1" />
471        </rect>
472        <rect>
473            <bounds left="0" top="0" right="572" bottom="798" />
474            <color red="0.1" green="0.3" blue="0.1" />
475        </rect>
476    </element>
477
478    <element name="LX.384">
479        <text string="LX.384">
480            <bounds x="0" y="0" width="120" height="40"/>
481            <color red="1.0" green="1.0" blue="1.0" />
482        </text>
483    </element>
484
485    <element name="floppy_led" defstate="0">
486      <disk state="0">
487         <color red="0.09375" green="0.0" blue="0.0" />
488      </disk>
489      <disk state="1">
490         <color red="0.0" green="0.75" blue="0.0" />
491      </disk>
492      <disk state="2">
493         <color red="0.75" green="0.0" blue="0.0" />
494      </disk>
495   </element>
496
497    <element name="floppy0">
498        <text string="Floppy #0">
499            <bounds x="0" y="0" width="160" height="40"/>
500            <color red="1.0" green="1.0" blue="1.0" />
501        </text>
502    </element>
503
504    <element name="floppy1">
505        <text string="Floppy #1">
506            <bounds x="0" y="0" width="160" height="40"/>
507            <color red="1.0" green="1.0" blue="1.0" />
508        </text>
509    </element>
510
511    <element name="LX.388">
512        <text string="LX.388">
513            <bounds x="0" y="0" width="120" height="40"/>
514            <color red="1.0" green="1.0" blue="1.0" />
515        </text>
516    </element>
517
518    <view name="Standard">
519        <backdrop element="flatbackground">
520            <bounds x="0" y="20" width="1175" height="590" />
521        </backdrop>
522
523        <backdrop element="gray">
524            <bounds x="65" y="74" width="640" height="480" />
525        </backdrop>
526
527        <bezel element="LX.388">
528            <bounds x="67" y="80" width="90" height="30" />
529        </bezel>
530
531        <screen index="0">
532            <bounds x="65" y="74" width="640" height="480" />
533        </screen>
534
535        <backdrop element="gray">
536            <bounds x="724" y="74" width="375" height="330" />
537        </backdrop>
538
539        <bezel element="LX.384">
540            <bounds x="726" y="80" width="90" height="30" />
541        </bezel>
542
543        <!-- LEDs -->
544        <!-- LEDs --> <!-- x step = 40 -->
545        <bezel element="digit_back">
546            <bounds x="740" y="119" width="36" height="52" />
547        </bezel>
548        <bezel element="digit_back">
549            <bounds x="784" y="119" width="36" height="52" />
550        </bezel>
551        <bezel element="digit_back">
552            <bounds x="828" y="119" width="36" height="52" />
553        </bezel>
554        <bezel element="digit_back">
555            <bounds x="872" y="119" width="36" height="52" />
556        </bezel>
557        <bezel element="digit_back">
558            <bounds x="916" y="119" width="36" height="52" />
559        </bezel>
560        <bezel element="digit_back">
561            <bounds x="960" y="119" width="36" height="52" />
562        </bezel>
563        <bezel element="digit_back">
564            <bounds x="1004" y="119" width="36" height="52" />
565        </bezel>
566        <bezel element="digit_back">
567            <bounds x="1048" y="119" width="36" height="52" />
568        </bezel>
569        <bezel name="digit7" element="digit">
570            <bounds x="743" y="126" width="30" height="40" />
571        </bezel>
572        <bezel name="digit6" element="digit">
573            <bounds x="787" y="126" width="30" height="40" />
574        </bezel>
575        <bezel name="digit5" element="digit">
576            <bounds x="831" y="126" width="30" height="40" />
577        </bezel>
578        <bezel name="digit4" element="digit">
579            <bounds x="875" y="126" width="30" height="40" />
580        </bezel>
581        <bezel name="digit3" element="digit">
582            <bounds x="919" y="126" width="30" height="40" />
583        </bezel>
584        <bezel name="digit2" element="digit">
585            <bounds x="963" y="126" width="30" height="40" />
586        </bezel>
587        <bezel name="digit1" element="digit">
588            <bounds x="1007" y="126" width="30" height="40" />
589        </bezel>
590        <bezel name="digit0" element="digit">
591            <bounds x="1051" y="126" width="30" height="40" />
592        </bezel>
593
594        <bezel name="drv0" element="floppy_led">
595         <bounds x="765" y="438" width="22" height="22" />
596      </bezel>
597        <bezel element="floppy0">
598            <bounds x="805" y="430" width="120" height="30" />
599        </bezel>
600
601        <bezel name="drv1" element="floppy_led">
602         <bounds x="765" y="468" width="22" height="22" />
603      </bezel>
604        <bezel element="floppy1">
605            <bounds x="805" y="460" width="120" height="30" />
606        </bezel>
607
608        <!-- Buttons -->
609
610        <!-- "Control" -->
611        <bezel element="pushbuttonCTRL" inputtag="CTRL" inputmask="0x10">
612            <bounds x="765" y="338" width="40" height="40"/>
613        </bezel>
614
615        <!-- "Reset" -->
616        <bezel element="pushbuttonRST" inputtag="RST" inputmask="0x01">
617            <bounds x="765" y="210" width="40" height="40"/>
618        </bezel>
619
620
621        <!-- Row 0 :  0 1 2 3 4 5 6 7 --> <!-- xstep=45, ystep=43 -->
622        <!-- "0" -->
623        <bezel element="pushbutton0" inputtag="ROW0" inputmask="0x01">
624            <bounds x="886" y="339" width="40" height="40"/>
625        </bezel>
626
627        <!-- "1" -->
628        <bezel element="pushbutton1" inputtag="ROW0" inputmask="0x02">
629            <bounds x="886" y="296" width="40" height="40"/>
630        </bezel>
631
632        <!-- "2" -->
633        <bezel element="pushbutton2" inputtag="ROW0" inputmask="0x04">
634            <bounds x="931" y="296" width="40" height="40"/>
635        </bezel>
636
637        <!-- "3" -->
638        <bezel element="pushbutton3" inputtag="ROW0" inputmask="0x08">
639            <bounds x="976" y="296" width="40" height="40"/>
640        </bezel>
641
642        <!-- "4" -->
643        <bezel element="pushbutton4" inputtag="ROW0" inputmask="0x10">
644            <bounds x="886" y="253" width="40" height="40"/>
645        </bezel>
646
647        <!-- "5" -->
648        <bezel element="pushbutton5" inputtag="ROW0" inputmask="0x20">
649            <bounds x="931" y="253" width="40" height="40"/>
650        </bezel>
651
652        <!-- "6" -->
653        <bezel element="pushbutton6" inputtag="ROW0" inputmask="0x40">
654            <bounds x="976" y="253" width="40" height="40"/>
655        </bezel>
656
657        <!-- "7" -->
658        <bezel element="pushbutton7" inputtag="ROW0" inputmask="0x80">
659            <bounds x="886" y="210" width="40" height="40"/>
660        </bezel>
661
662
663
664        <!-- Buttons -->
665        <!-- Row 1 :  8 9 A B C D E F -->
666        <!-- "8" -->
667        <bezel element="pushbutton8" inputtag="ROW1" inputmask="0x01">
668            <bounds x="931" y="210" width="40" height="40"/>
669        </bezel>
670
671        <!-- "9" -->
672        <bezel element="pushbutton9" inputtag="ROW1" inputmask="0x02">
673            <bounds x="976" y="210" width="40" height="40"/>
674        </bezel>
675
676        <!-- "A" -->
677        <bezel element="pushbuttonA" inputtag="ROW1" inputmask="0x04">
678            <bounds x="1021" y="210" width="40" height="40"/>
679        </bezel>
680
681        <!-- "B" -->
682        <bezel element="pushbuttonB" inputtag="ROW1" inputmask="0x08">
683            <bounds x="1021" y="253" width="40" height="40"/>
684        </bezel>
685
686        <!-- "C" -->
687        <bezel element="pushbuttonC" inputtag="ROW1" inputmask="0x10">
688            <bounds x="1021" y="296" width="40" height="40"/>
689        </bezel>
690
691        <!-- "D" -->
692        <bezel element="pushbuttonD" inputtag="ROW1" inputmask="0x20">
693            <bounds x="1021" y="339" width="40" height="40"/>
694        </bezel>
695
696        <!-- "E" -->
697        <bezel element="pushbuttonE" inputtag="ROW1" inputmask="0x40">
698            <bounds x="976" y="339" width="40" height="40"/>
699        </bezel>
700
701        <!-- "F" -->
702        <bezel element="pushbuttonF" inputtag="ROW1" inputmask="0x80">
703            <bounds x="931" y="339" width="40" height="40"/>
704        </bezel>
705
706    </view>
707
708
709</mamelayout>
710<?xml version="1.0"?>
711<!-- z80ne.lay -->
712<!-- 2009-01-16: Initial version.  [Roberto Lavarone] -->
713
714<mamelayout version="2">
715
716    <element name="gray">
717        <rect>
718            <bounds left="0" top="0" right="1" bottom="1" />
719            <color red="0.15" green="0.15" blue="0.15" />
720        </rect>
721    </element>
722
723    <element name="digit_back">
724        <rect>
725            <bounds left="0" top="0" right="1" bottom="1" />
726            <color red="0.584" green="0.631" blue="0.690" />
727        </rect>
728    </element>
729
730    <element name="digit" defstate="0">
731        <led7seg>
732            <color red="0.75" green="0.0" blue="0.0"/>
733        </led7seg>
734    </element>
735
736    <element name="back">
737        <rect>
738            <bounds left="0" top="0" right="1" bottom="1" />
739            <color red="0.0" green="0.0" blue="0.0" />
740        </rect>
741    </element>
742
743    <element name="pushbutton" defstate="1">
744        <rect>
745            <bounds x="2" y="2" width="48" height="48"/>
746            <color red="0.1" green="0.1" blue="0.1" />
747        </rect>
748        <rect state="0">
749            <bounds x="0" y="0" width="48" height="48"/>
750            <color red="0.75" green="0.75" blue="0.0" />
751        </rect>
752        <rect state="1">
753            <bounds x="2" y="2" width="48" height="48"/>
754            <color red="0.75" green="0.75" blue="0.0" />
755        </rect>
756    </element>
757
758    <element name="pushbuttonCTRL" defstate="1">
759        <rect>
760            <bounds x="2" y="2" width="48" height="48"/>
761            <color red="0.1" green="0.1" blue="0.1" />
762        </rect>
763        <rect state="0">
764            <bounds x="0" y="0" width="48" height="48"/>
765            <color red="0.25" green="0.25" blue="0.25" />
766        </rect>
767        <text string="CTRL" state="0">
768            <bounds x="8" y="24" width="40" height="20"/>
769            <color red="1.0" green="1.0" blue="1.0" />
770        </text>
771        <rect state="1">
772            <bounds x="2" y="2" width="48" height="48"/>
773            <color red="0.25" green="0.25" blue="0.25" />
774        </rect>
775        <text string="CTRL" state="1">
776            <bounds x="10" y="26" width="40" height="20"/>
777            <color red="1.0" green="1.0" blue="1.0" />
778        </text>
779    </element>
780
781    <element name="pushbuttonRST" defstate="1">
782        <rect>
783            <bounds x="2" y="2" width="48" height="48"/>
784            <color red="0.1" green="0.1" blue="0.1" />
785        </rect>
786        <rect state="0">
787            <bounds x="0" y="0" width="48" height="48"/>
788            <color red="0.75" green="0" blue="0" />
789        </rect>
790        <text string="RST " state="0">
791            <bounds x="8" y="24" width="40" height="20"/>
792            <color red="1.0" green="1.0" blue="1.0" />
793        </text>
794        <rect state="1">
795            <bounds x="2" y="2" width="48" height="48"/>
796            <color red="0.75" green="0" blue="0" />
797        </rect>
798        <text string="RST " state="1">
799            <bounds x="10" y="26" width="40" height="20"/>
800            <color red="1.0" green="1.0" blue="1.0" />
801        </text>
802    </element>
803
804    <element name="pushbutton0" defstate="1">
805        <rect>
806            <bounds x="2" y="2" width="48" height="48"/>
807            <color red="0.1" green="0.1" blue="0.1" />
808        </rect>
809        <rect state="0">
810            <bounds x="0" y="0" width="48" height="48"/>
811            <color red="0.0" green="0.0" blue="0.75" />
812        </rect>
813        <text string="  0 " state="0">
814            <bounds x="8" y="24" width="40" height="20"/>
815            <color red="1.0" green="1.0" blue="1.0" />
816        </text>
817        <rect state="1">
818            <bounds x="2" y="2" width="48" height="48"/>
819            <color red="0.0" green="0.0" blue="0.75" />
820        </rect>
821        <text string="  0 " state="1">
822            <bounds x="10" y="26" width="40" height="20"/>
823            <color red="1.0" green="1.0" blue="1.0" />
824        </text>
825    </element>
826
827    <element name="pushbutton1" defstate="1">
828        <rect>
829            <bounds x="2" y="2" width="48" height="48"/>
830            <color red="0.1" green="0.1" blue="0.1" />
831        </rect>
832        <rect state="0">
833            <bounds x="0" y="0" width="48" height="48"/>
834            <color red="0.0" green="0.0" blue="0.75" />
835        </rect>
836        <text string="  1 " state="0">
837            <bounds x="8" y="24" width="40" height="20"/>
838            <color red="1.0" green="1.0" blue="1.0" />
839        </text>
840        <rect state="1">
841            <bounds x="2" y="2" width="48" height="48"/>
842            <color red="0.0" green="0.0" blue="0.75" />
843        </rect>
844        <text string="  1 " state="1">
845            <bounds x="10" y="26" width="40" height="20"/>
846            <color red="1.0" green="1.0" blue="1.0" />
847        </text>
848    </element>
849
850    <element name="pushbutton2" defstate="1">
851        <rect>
852            <bounds x="2" y="2" width="48" height="48"/>
853            <color red="0.1" green="0.1" blue="0.1" />
854        </rect>
855        <rect state="0">
856            <bounds x="0" y="0" width="48" height="48"/>
857            <color red="0.0" green="0.0" blue="0.75" />
858        </rect>
859        <text string="  2 " state="0">
860            <bounds x="8" y="24" width="40" height="20"/>
861            <color red="1.0" green="1.0" blue="1.0" />
862        </text>
863        <rect state="1">
864            <bounds x="2" y="2" width="48" height="48"/>
865            <color red="0.0" green="0.0" blue="0.75" />
866        </rect>
867        <text string="  2 " state="1">
868            <bounds x="10" y="26" width="40" height="20"/>
869            <color red="1.0" green="1.0" blue="1.0" />
870        </text>
871    </element>
872
873    <element name="pushbutton3" defstate="1">
874        <rect>
875            <bounds x="2" y="2" width="48" height="48"/>
876            <color red="0.1" green="0.1" blue="0.1" />
877        </rect>
878        <rect state="0">
879            <bounds x="0" y="0" width="48" height="48"/>
880            <color red="0.0" green="0.0" blue="0.75" />
881        </rect>
882        <text string="  3 " state="0">
883            <bounds x="8" y="24" width="40" height="20"/>
884            <color red="1.0" green="1.0" blue="1.0" />
885        </text>
886        <rect state="1">
887            <bounds x="2" y="2" width="48" height="48"/>
888            <color red="0.0" green="0.0" blue="0.75" />
889        </rect>
890        <text string="  3 " state="1">
891            <bounds x="10" y="26" width="40" height="20"/>
892            <color red="1.0" green="1.0" blue="1.0" />
893        </text>
894    </element>
895
896    <element name="pushbutton4" defstate="1">
897        <rect>
898            <bounds x="2" y="2" width="48" height="48"/>
899            <color red="0.1" green="0.1" blue="0.1" />
900        </rect>
901        <rect state="0">
902            <bounds x="0" y="0" width="48" height="48"/>
903            <color red="0.0" green="0.0" blue="0.75" />
904        </rect>
905        <text string="  4 " state="0">
906            <bounds x="8" y="24" width="40" height="20"/>
907            <color red="1.0" green="1.0" blue="1.0" />
908        </text>
909        <rect state="1">
910            <bounds x="2" y="2" width="48" height="48"/>
911            <color red="0.0" green="0.0" blue="0.75" />
912        </rect>
913        <text string="  4 " state="1">
914            <bounds x="10" y="26" width="40" height="20"/>
915            <color red="1.0" green="1.0" blue="1.0" />
916        </text>
917    </element>
918
919    <element name="pushbutton5" defstate="1">
920        <rect>
921            <bounds x="2" y="2" width="48" height="48"/>
922            <color red="0.1" green="0.1" blue="0.1" />
923        </rect>
924        <rect state="0">
925            <bounds x="0" y="0" width="48" height="48"/>
926            <color red="0.0" green="0.0" blue="0.75" />
927        </rect>
928        <text string="  5 " state="0">
929            <bounds x="8" y="24" width="40" height="20"/>
930            <color red="1.0" green="1.0" blue="1.0" />
931        </text>
932        <rect state="1">
933            <bounds x="2" y="2" width="48" height="48"/>
934            <color red="0.0" green="0.0" blue="0.75" />
935        </rect>
936        <text string="  5 " state="1">
937            <bounds x="10" y="26" width="40" height="20"/>
938            <color red="1.0" green="1.0" blue="1.0" />
939        </text>
940    </element>
941
942    <element name="pushbutton6" defstate="1">
943        <rect>
944            <bounds x="2" y="2" width="48" height="48"/>
945            <color red="0.1" green="0.1" blue="0.1" />
946        </rect>
947        <rect state="0">
948            <bounds x="0" y="0" width="48" height="48"/>
949            <color red="0.0" green="0.0" blue="0.75" />
950        </rect>
951        <text string="  6 " state="0">
952            <bounds x="8" y="24" width="40" height="20"/>
953            <color red="1.0" green="1.0" blue="1.0" />
954        </text>
955        <rect state="1">
956            <bounds x="2" y="2" width="48" height="48"/>
957            <color red="0.0" green="0.0" blue="0.75" />
958        </rect>
959        <text string="  6 " state="1">
960            <bounds x="10" y="26" width="40" height="20"/>
961            <color red="1.0" green="1.0" blue="1.0" />
962        </text>
963    </element>
964
965    <element name="pushbutton7" defstate="1">
966        <rect>
967            <bounds x="2" y="2" width="48" height="48"/>
968            <color red="0.1" green="0.1" blue="0.1" />
969        </rect>
970        <rect state="0">
971            <bounds x="0" y="0" width="48" height="48"/>
972            <color red="0.0" green="0.0" blue="0.75" />
973        </rect>
974        <text string="  7 " state="0">
975            <bounds x="8" y="24" width="40" height="20"/>
976            <color red="1.0" green="1.0" blue="1.0" />
977        </text>
978        <rect state="1">
979            <bounds x="2" y="2" width="48" height="48"/>
980            <color red="0.0" green="0.0" blue="0.75" />
981        </rect>
982        <text string="  7 " state="1">
983            <bounds x="10" y="26" width="40" height="20"/>
984            <color red="1.0" green="1.0" blue="1.0" />
985        </text>
986    </element>
987
988    <element name="pushbutton8" defstate="1">
989        <rect>
990            <bounds x="2" y="2" width="48" height="48"/>
991            <color red="0.1" green="0.1" blue="0.1" />
992        </rect>
993        <rect state="0">
994            <bounds x="0" y="0" width="48" height="48"/>
995            <color red="0.0" green="0.0" blue="0.75" />
996        </rect>
997        <text string="  8 " state="0">
998            <bounds x="8" y="24" width="40" height="20"/>
999            <color red="1.0" green="1.0" blue="1.0" />
1000        </text>
1001        <rect state="1">
1002            <bounds x="2" y="2" width="48" height="48"/>
1003            <color red="0.0" green="0.0" blue="0.75" />
1004        </rect>
1005        <text string="  8 " state="1">
1006            <bounds x="10" y="26" width="40" height="20"/>
1007            <color red="1.0" green="1.0" blue="1.0" />
1008        </text>
1009    </element>
1010
1011    <element name="pushbutton9" defstate="1">
1012        <rect>
1013            <bounds x="2" y="2" width="48" height="48"/>
1014            <color red="0.1" green="0.1" blue="0.1" />
1015        </rect>
1016        <rect state="0">
1017            <bounds x="0" y="0" width="48" height="48"/>
1018            <color red="0.0" green="0.0" blue="0.75" />
1019        </rect>
1020        <text string="  9 " state="0">
1021            <bounds x="8" y="24" width="40" height="20"/>
1022            <color red="1.0" green="1.0" blue="1.0" />
1023        </text>
1024        <rect state="1">
1025            <bounds x="2" y="2" width="48" height="48"/>
1026            <color red="0.0" green="0.0" blue="0.75" />
1027        </rect>
1028        <text string="  9 " state="1">
1029            <bounds x="10" y="26" width="40" height="20"/>
1030            <color red="1.0" green="1.0" blue="1.0" />
1031        </text>
1032    </element>
1033
1034    <element name="pushbuttonA" defstate="1">
1035        <rect>
1036            <bounds x="2" y="2" width="48" height="48"/>
1037            <color red="0.1" green="0.1" blue="0.1" />
1038        </rect>
1039        <rect state="0">
1040            <bounds x="0" y="0" width="48" height="48"/>
1041            <color red="0.0" green="0.0" blue="0.75" />
1042        </rect>
1043        <text string="  A " state="0">
1044            <bounds x="8" y="24" width="40" height="20"/>
1045            <color red="1.0" green="1.0" blue="1.0" />
1046        </text>
1047        <rect state="1">
1048            <bounds x="2" y="2" width="48" height="48"/>
1049            <color red="0.0" green="0.0" blue="0.75" />
1050        </rect>
1051        <text string="  A " state="1">
1052            <bounds x="10" y="26" width="40" height="20"/>
1053            <color red="1.0" green="1.0" blue="1.0" />
1054        </text>
1055    </element>
1056
1057    <element name="pushbuttonB" defstate="1">
1058        <rect>
1059            <bounds x="2" y="2" width="48" height="48"/>
1060            <color red="0.1" green="0.1" blue="0.1" />
1061        </rect>
1062        <rect state="0">
1063            <bounds x="0" y="0" width="48" height="48"/>
1064            <color red="0.0" green="0.0" blue="0.75" />
1065        </rect>
1066        <text string="  B " state="0">
1067            <bounds x="8" y="24" width="40" height="20"/>
1068            <color red="1.0" green="1.0" blue="1.0" />
1069        </text>
1070        <rect state="1">
1071            <bounds x="2" y="2" width="48" height="48"/>
1072            <color red="0.0" green="0.0" blue="0.75" />
1073        </rect>
1074        <text string="  B " state="1">
1075            <bounds x="10" y="26" width="40" height="20"/>
1076            <color red="1.0" green="1.0" blue="1.0" />
1077        </text>
1078    </element>
1079
1080    <element name="pushbuttonC" defstate="1">
1081        <rect>
1082            <bounds x="2" y="2" width="48" height="48"/>
1083            <color red="0.1" green="0.1" blue="0.1" />
1084        </rect>
1085        <rect state="0">
1086            <bounds x="0" y="0" width="48" height="48"/>
1087            <color red="0.0" green="0.0" blue="0.75" />
1088        </rect>
1089        <text string="  C " state="0">
1090            <bounds x="8" y="24" width="40" height="20"/>
1091            <color red="1.0" green="1.0" blue="1.0" />
1092        </text>
1093        <rect state="1">
1094            <bounds x="2" y="2" width="48" height="48"/>
1095            <color red="0.0" green="0.0" blue="0.75" />
1096        </rect>
1097        <text string="  C " state="1">
1098            <bounds x="10" y="26" width="40" height="20"/>
1099            <color red="1.0" green="1.0" blue="1.0" />
1100        </text>
1101    </element>
1102
1103    <element name="pushbuttonD" defstate="1">
1104        <rect>
1105            <bounds x="2" y="2" width="48" height="48"/>
1106            <color red="0.1" green="0.1" blue="0.1" />
1107        </rect>
1108        <rect state="0">
1109            <bounds x="0" y="0" width="48" height="48"/>
1110            <color red="0.0" green="0.0" blue="0.75" />
1111        </rect>
1112        <text string="  D " state="0">
1113            <bounds x="8" y="24" width="40" height="20"/>
1114            <color red="1.0" green="1.0" blue="1.0" />
1115        </text>
1116        <rect state="1">
1117            <bounds x="2" y="2" width="48" height="48"/>
1118            <color red="0.0" green="0.0" blue="0.75" />
1119        </rect>
1120        <text string="  D " state="1">
1121            <bounds x="10" y="26" width="40" height="20"/>
1122            <color red="1.0" green="1.0" blue="1.0" />
1123        </text>
1124    </element>
1125
1126    <element name="pushbuttonE" defstate="1">
1127        <rect>
1128            <bounds x="2" y="2" width="48" height="48"/>
1129            <color red="0.1" green="0.1" blue="0.1" />
1130        </rect>
1131        <rect state="0">
1132            <bounds x="0" y="0" width="48" height="48"/>
1133            <color red="0.0" green="0.0" blue="0.75" />
1134        </rect>
1135        <text string="  E " state="0">
1136            <bounds x="8" y="24" width="40" height="20"/>
1137            <color red="1.0" green="1.0" blue="1.0" />
1138        </text>
1139        <rect state="1">
1140            <bounds x="2" y="2" width="48" height="48"/>
1141            <color red="0.0" green="0.0" blue="0.75" />
1142        </rect>
1143        <text string="  E " state="1">
1144            <bounds x="10" y="26" width="40" height="20"/>
1145            <color red="1.0" green="1.0" blue="1.0" />
1146        </text>
1147    </element>
1148
1149    <element name="pushbuttonF" defstate="1">
1150        <rect>
1151            <bounds x="2" y="2" width="48" height="48"/>
1152            <color red="0.1" green="0.1" blue="0.1" />
1153        </rect>
1154        <rect state="0">
1155            <bounds x="0" y="0" width="48" height="48"/>
1156            <color red="0.0" green="0.0" blue="0.75" />
1157        </rect>
1158        <text string="  F " state="0">
1159            <bounds x="8" y="24" width="40" height="20"/>
1160            <color red="1.0" green="1.0" blue="1.0" />
1161        </text>
1162        <rect state="1">
1163            <bounds x="2" y="2" width="48" height="48"/>
1164            <color red="0.0" green="0.0" blue="0.75" />
1165        </rect>
1166        <text string="  F " state="1">
1167            <bounds x="10" y="26" width="40" height="20"/>
1168            <color red="1.0" green="1.0" blue="1.0" />
1169        </text>
1170    </element>
1171
1172    <element name="flatbackground">
1173        <rect>
1174            <bounds left="-10" top="-10" right="587" bottom="813" />
1175            <color red="0.1" green="0.1" blue="0.1" />
1176        </rect>
1177        <rect>
1178            <bounds left="5" top="5" right="577" bottom="803" />
1179            <color red="0.1" green="0.2" blue="0.1" />
1180        </rect>
1181        <rect>
1182            <bounds left="0" top="0" right="572" bottom="798" />
1183            <color red="0.1" green="0.3" blue="0.1" />
1184        </rect>
1185    </element>
1186
1187    <element name="LX.384">
1188        <text string="LX.384">
1189            <bounds x="0" y="0" width="120" height="40"/>
1190            <color red="1.0" green="1.0" blue="1.0" />
1191        </text>
1192    </element>
1193
1194    <element name="floppy_led" defstate="0">
1195      <disk state="0">
1196         <color red="0.09375" green="0.0" blue="0.0" />
1197      </disk>
1198      <disk state="1">
1199         <color red="0.0" green="0.75" blue="0.0" />
1200      </disk>
1201      <disk state="2">
1202         <color red="0.75" green="0.0" blue="0.0" />
1203      </disk>
1204   </element>
1205
1206    <element name="floppy0">
1207        <text string="Floppy #0">
1208            <bounds x="0" y="0" width="160" height="40"/>
1209            <color red="1.0" green="1.0" blue="1.0" />
1210        </text>
1211    </element>
1212
1213    <element name="floppy1">
1214        <text string="Floppy #1">
1215            <bounds x="0" y="0" width="160" height="40"/>
1216            <color red="1.0" green="1.0" blue="1.0" />
1217        </text>
1218    </element>
1219
1220    <element name="LX.388">
1221        <text string="LX.388">
1222            <bounds x="0" y="0" width="120" height="40"/>
1223            <color red="1.0" green="1.0" blue="1.0" />
1224        </text>
1225    </element>
1226
1227    <view name="Standard">
1228        <backdrop element="flatbackground">
1229            <bounds x="0" y="20" width="1175" height="590" />
1230        </backdrop>
1231
1232        <backdrop element="gray">
1233            <bounds x="65" y="74" width="640" height="480" />
1234        </backdrop>
1235
1236        <bezel element="LX.388">
1237            <bounds x="67" y="80" width="90" height="30" />
1238        </bezel>
1239
1240        <screen index="0">
1241            <bounds x="65" y="74" width="640" height="480" />
1242        </screen>
1243
1244        <backdrop element="gray">
1245            <bounds x="724" y="74" width="375" height="330" />
1246        </backdrop>
1247
1248        <bezel element="LX.384">
1249            <bounds x="726" y="80" width="90" height="30" />
1250        </bezel>
1251
1252        <!-- LEDs -->
1253        <!-- LEDs --> <!-- x step = 40 -->
1254        <bezel element="digit_back">
1255            <bounds x="740" y="119" width="36" height="52" />
1256        </bezel>
1257        <bezel element="digit_back">
1258            <bounds x="784" y="119" width="36" height="52" />
1259        </bezel>
1260        <bezel element="digit_back">
1261            <bounds x="828" y="119" width="36" height="52" />
1262        </bezel>
1263        <bezel element="digit_back">
1264            <bounds x="872" y="119" width="36" height="52" />
1265        </bezel>
1266        <bezel element="digit_back">
1267            <bounds x="916" y="119" width="36" height="52" />
1268        </bezel>
1269        <bezel element="digit_back">
1270            <bounds x="960" y="119" width="36" height="52" />
1271        </bezel>
1272        <bezel element="digit_back">
1273            <bounds x="1004" y="119" width="36" height="52" />
1274        </bezel>
1275        <bezel element="digit_back">
1276            <bounds x="1048" y="119" width="36" height="52" />
1277        </bezel>
1278        <bezel name="digit7" element="digit">
1279            <bounds x="743" y="126" width="30" height="40" />
1280        </bezel>
1281        <bezel name="digit6" element="digit">
1282            <bounds x="787" y="126" width="30" height="40" />
1283        </bezel>
1284        <bezel name="digit5" element="digit">
1285            <bounds x="831" y="126" width="30" height="40" />
1286        </bezel>
1287        <bezel name="digit4" element="digit">
1288            <bounds x="875" y="126" width="30" height="40" />
1289        </bezel>
1290        <bezel name="digit3" element="digit">
1291            <bounds x="919" y="126" width="30" height="40" />
1292        </bezel>
1293        <bezel name="digit2" element="digit">
1294            <bounds x="963" y="126" width="30" height="40" />
1295        </bezel>
1296        <bezel name="digit1" element="digit">
1297            <bounds x="1007" y="126" width="30" height="40" />
1298        </bezel>
1299        <bezel name="digit0" element="digit">
1300            <bounds x="1051" y="126" width="30" height="40" />
1301        </bezel>
1302
1303        <bezel name="drv0" element="floppy_led">
1304         <bounds x="765" y="438" width="22" height="22" />
1305      </bezel>
1306        <bezel element="floppy0">
1307            <bounds x="805" y="430" width="120" height="30" />
1308        </bezel>
1309
1310        <bezel name="drv1" element="floppy_led">
1311         <bounds x="765" y="468" width="22" height="22" />
1312      </bezel>
1313        <bezel element="floppy1">
1314            <bounds x="805" y="460" width="120" height="30" />
1315        </bezel>
1316
1317        <!-- Buttons -->
1318
1319        <!-- "Control" -->
1320        <bezel element="pushbuttonCTRL" inputtag="CTRL" inputmask="0x10">
1321            <bounds x="765" y="338" width="40" height="40"/>
1322        </bezel>
1323
1324        <!-- "Reset" -->
1325        <bezel element="pushbuttonRST" inputtag="RST" inputmask="0x01">
1326            <bounds x="765" y="210" width="40" height="40"/>
1327        </bezel>
1328
1329
1330        <!-- Row 0 :  0 1 2 3 4 5 6 7 --> <!-- xstep=45, ystep=43 -->
1331        <!-- "0" -->
1332        <bezel element="pushbutton0" inputtag="ROW0" inputmask="0x01">
1333            <bounds x="886" y="339" width="40" height="40"/>
1334        </bezel>
1335
1336        <!-- "1" -->
1337        <bezel element="pushbutton1" inputtag="ROW0" inputmask="0x02">
1338            <bounds x="886" y="296" width="40" height="40"/>
1339        </bezel>
1340
1341        <!-- "2" -->
1342        <bezel element="pushbutton2" inputtag="ROW0" inputmask="0x04">
1343            <bounds x="931" y="296" width="40" height="40"/>
1344        </bezel>
1345
1346        <!-- "3" -->
1347        <bezel element="pushbutton3" inputtag="ROW0" inputmask="0x08">
1348            <bounds x="976" y="296" width="40" height="40"/>
1349        </bezel>
1350
1351        <!-- "4" -->
1352        <bezel element="pushbutton4" inputtag="ROW0" inputmask="0x10">
1353            <bounds x="886" y="253" width="40" height="40"/>
1354        </bezel>
1355
1356        <!-- "5" -->
1357        <bezel element="pushbutton5" inputtag="ROW0" inputmask="0x20">
1358            <bounds x="931" y="253" width="40" height="40"/>
1359        </bezel>
1360
1361        <!-- "6" -->
1362        <bezel element="pushbutton6" inputtag="ROW0" inputmask="0x40">
1363            <bounds x="976" y="253" width="40" height="40"/>
1364        </bezel>
1365
1366        <!-- "7" -->
1367        <bezel element="pushbutton7" inputtag="ROW0" inputmask="0x80">
1368            <bounds x="886" y="210" width="40" height="40"/>
1369        </bezel>
1370
1371
1372
1373        <!-- Buttons -->
1374        <!-- Row 1 :  8 9 A B C D E F -->
1375        <!-- "8" -->
1376        <bezel element="pushbutton8" inputtag="ROW1" inputmask="0x01">
1377            <bounds x="931" y="210" width="40" height="40"/>
1378        </bezel>
1379
1380        <!-- "9" -->
1381        <bezel element="pushbutton9" inputtag="ROW1" inputmask="0x02">
1382            <bounds x="976" y="210" width="40" height="40"/>
1383        </bezel>
1384
1385        <!-- "A" -->
1386        <bezel element="pushbuttonA" inputtag="ROW1" inputmask="0x04">
1387            <bounds x="1021" y="210" width="40" height="40"/>
1388        </bezel>
1389
1390        <!-- "B" -->
1391        <bezel element="pushbuttonB" inputtag="ROW1" inputmask="0x08">
1392            <bounds x="1021" y="253" width="40" height="40"/>
1393        </bezel>
1394
1395        <!-- "C" -->
1396        <bezel element="pushbuttonC" inputtag="ROW1" inputmask="0x10">
1397            <bounds x="1021" y="296" width="40" height="40"/>
1398        </bezel>
1399
1400        <!-- "D" -->
1401        <bezel element="pushbuttonD" inputtag="ROW1" inputmask="0x20">
1402            <bounds x="1021" y="339" width="40" height="40"/>
1403        </bezel>
1404
1405        <!-- "E" -->
1406        <bezel element="pushbuttonE" inputtag="ROW1" inputmask="0x40">
1407            <bounds x="976" y="339" width="40" height="40"/>
1408        </bezel>
1409
1410        <!-- "F" -->
1411        <bezel element="pushbuttonF" inputtag="ROW1" inputmask="0x80">
1412            <bounds x="931" y="339" width="40" height="40"/>
1413        </bezel>
1414
1415    </view>
1416
1417
1418</mamelayout>
src/mess/formats/z80ne_dsk.c
r0r5034
1/*********************************************************************
2
3    formats/z80ne_dsk.c
4
5    Nuova Elettronica Z80NE disk images
6
7*********************************************************************/
8
9#include "mame.h"
10#include "formats/z80ne_dsk.h"
11#include "formats/basicdsk.h"
12#include "devices/flopdrv.h"
13#include "utils.h"
14
15/* -----------------------------------------------------------------------
16 * DMK file format
17 *
18 * David M. Keil's disk image format is aptly called an 'on disk' image
19 * format. This means that whatever written to the disk is encoded into
20 * the image file. IDAMS, sector headers, trailing CRCs, and intra-sector
21 * spacing.                                                         *
22 *
23 *  HEADER DESCRIPTION:
24 *
25 *  Offset  Bytes   Field           Description
26 *  ------  -----   ------------    -----------
27 *       0      1   write_prot      0xff = Write Protected, 0x00 = R/W
28 *       1      1   tracks          Number of tracks
29 *       2      2   track_length    Bytes per track on DMK file (little endian)
30 *       4      1   disk_options    Miscellaneous flags
31 *                                      bit 0-3:  Unused
32 *                                      bit   4:  Sides on DMK file
33 *                                                1=single, 0=double
34 *                                      bit   5:  Unused
35 *                                      bit   6:  Single Density DMK file
36 *                                                1=single (bytes written once
37 *                                                  on IDAMs)
38 *                                                0=double (bytes written
39 *                                                  two times for SD IDAMs)
40 *       5      7   reserved        Reserved for future use
41 *      12      4   real_disk_code  If this is 0x12345678 (little endian)
42 *                                  then access a real disk drive
43 *                                  (unsupported)
44 *
45 * Each track begins with a track TOC, consisting of 64 little endian 16-bit
46 * integers.  Each integer has the following format:
47 *      bit 0-13:   Offset from beginning of track to 'FE' byte of IDAM
48 *                  Note these are always sorted from first to last. All empty
49 *                  entries are 0x00
50 *      bit 14:     Undefined (reserved)
51 *      bit 15:     Sector double density (0=SD 1=DD)
52 *                  If not set and SD DMK flag is set then bytes are written
53 *                  once.
54 * ----------------------------------------------------------------------- */
55
56struct dmk_tag
57{
58   int heads;
59   int tracks;
60   UINT32 track_size;
61};
62
63#define DMK_TAG "z80nedmk"
64
65/* DMK file structure
66 * See WD1711 documentation
67 */
68/* DMK file header */
69#define DMK_HEADER_LEN         16         /* DMK header */
70   /*  For every track (40) */
71   #define DMK_TOC_LEN            128      /* 64 16-bit relative offsets to IDAMs */
72   #define DMK_GAP1_LEN         32      /* GAP1 (26 bytes 0xFF and 6 bytes 0x00) */
73
74      /* For every sector (10) 301 bytes */
75      #define DMK_IDAM_LEN         7   /* IDAM (0xFE, Track, 0x00, Sector, 0x00, CRChi, CRClo) */
76      #define DMK_ID_GAP_LEN         17   /* GAP2 (11 bytes 0xFF and 6 bytes 0x00) */
77      #define DMK_DAM_LEN           1   /* Data Address Mark (0xFB) */
78      #define DMK_DATA_LEN         256 /* Data */
79      #define DMK_DATA_CRC_LEN      2   /* Data CRC (CRChi, CRClo) */
80      #define DMK_DATA_GAP_LEN      18  /* GAP3 (12 bytes 0xFF and 6 bytes 0x00) (not for last sector) */
81
82   #define DMK_EXTRA_TRACK_LENGTH   (176)   /* GAP4 (192 bytes 0xFF) */
83/* End of DMK file structure */
84
85#define dmk_idam_type(x)         (x)[0]
86#define dmk_idam_track(x)         (x)[1]
87#define dmk_idam_side(x)         (x)[2]
88#define dmk_idam_sector(x)         (x)[3]
89#define dmk_idam_sectorlength(x)   (x)[4]
90#define dmk_idam_crc(x)            (((x)[5] << 8) + (x)[6])
91#define dmk_idam_set_crc(x, crc)   (x)[5] = ((crc) >> 8); (x)[6] = ((crc) >> 0);
92
93const char *needle_data = "\x00\x00\x00\x00\x00\x00\x00\x00\xFB\xFB";
94const char *needle_deleted_data_fa = "\x00\x00\x00\x00\x00\x00\x00\x00\xFA\xFA";
95const char *needle_deleted_data_f8 = "\x00\x00\x00\x00\x00\x00\x00\x00\xF8\xF8";
96
97
98static struct dmk_tag *get_dmk_tag(floppy_image *floppy)
99{
100   return floppy_tag(floppy, DMK_TAG);
101}
102
103
104static floperr_t z80ne_dmk_get_track_offset(floppy_image *floppy, int head, int track, UINT64 *offset)
105{
106   struct dmk_tag *tag = get_dmk_tag(floppy);
107
108   if ((head < 0) || (head >= tag->heads) || (track < 0) || (track >= tag->tracks))
109      return FLOPPY_ERROR_SEEKERROR;
110
111   *offset = track;
112   *offset *= tag->heads;
113   *offset += head;
114   *offset *= tag->track_size;
115   *offset += DMK_HEADER_LEN;
116   return FLOPPY_ERROR_SUCCESS;
117}
118
119
120static UINT32 z80ne_dmk_min_track_size(int sectors, int sector_length)
121{
122   int sector_physical_length;
123   sector_physical_length = (DMK_IDAM_LEN + DMK_ID_GAP_LEN + DMK_DAM_LEN + sector_length + DMK_DATA_CRC_LEN + DMK_DATA_GAP_LEN);
124   return DMK_TOC_LEN + 2 * (DMK_GAP1_LEN + (sectors * sector_physical_length) - DMK_DATA_GAP_LEN + DMK_EXTRA_TRACK_LENGTH);
125}
126
127
128
129static floperr_t z80ne_dmk_read_track(floppy_image *floppy, int head, int track, UINT64 offset, void *buffer, size_t buflen)
130{
131   floperr_t err;
132   UINT64 track_offset;
133
134   err = z80ne_dmk_get_track_offset(floppy, head, track, &track_offset);
135   if (err)
136      return err;
137
138   floppy_image_read(floppy, buffer, offset + track_offset, buflen);
139   return FLOPPY_ERROR_SUCCESS;
140}
141
142
143
144static floperr_t z80ne_dmk_write_track(floppy_image *floppy, int head, int track, UINT64 offset, const void *buffer, size_t buflen)
145{
146   floperr_t err;
147   UINT64 track_offset;
148
149   err = z80ne_dmk_get_track_offset(floppy, head, track, &track_offset);
150   if (err)
151      return err;
152
153   floppy_image_write(floppy, buffer, offset + track_offset, buflen);
154   return FLOPPY_ERROR_SUCCESS;
155}
156
157
158
159static floperr_t z80ne_dmk_get_track_data_offset(floppy_image *floppy, int head, int track, UINT64 *offset)
160{
161   *offset = DMK_TOC_LEN + 1;
162   return FLOPPY_ERROR_SUCCESS;
163}
164
165
166static floperr_t z80ne_dmk_format_track(floppy_image *floppy, int head, int track, option_resolution *params)
167{
168   int sectors;
169   int sector_length;
170   int interleave;
171   int first_sector_id;
172   floperr_t err;
173   int physical_sector;
174   int logical_sector;
175   int track_position;
176   UINT16 idam_offset;
177   UINT16 crc;
178   UINT8 *track_data;
179   void *track_data_v;
180   UINT32 max_track_size;
181   int *sector_map = NULL;
182   UINT8 *local_sector = NULL;
183   int local_sector_size;
184   int sector_position;
185   int i;
186
187   err = FLOPPY_ERROR_SUCCESS;
188
189   sectors         = option_resolution_lookup_int(params, PARAM_SECTORS);
190   sector_length   = option_resolution_lookup_int(params, PARAM_SECTOR_LENGTH);
191   interleave      = option_resolution_lookup_int(params, PARAM_INTERLEAVE);
192   first_sector_id   = option_resolution_lookup_int(params, PARAM_FIRST_SECTOR_ID);
193
194   max_track_size = get_dmk_tag(floppy)->track_size;
195
196   if (sectors > DMK_TOC_LEN/2)
197   {
198        err = FLOPPY_ERROR_INTERNAL;
199      goto done;
200   }
201
202   if (max_track_size < z80ne_dmk_min_track_size(sectors, sector_length))
203   {
204      err = FLOPPY_ERROR_NOSPACE;
205      goto done;
206   }
207
208   err = floppy_load_track(floppy, head, track, TRUE, &track_data_v, NULL);
209   if (err)
210      goto done;
211   track_data = (UINT8 *) track_data_v;
212
213   /* set up sector map */
214   sector_map = malloc(sectors * sizeof(*sector_map));
215   if (!sector_map)
216   {
217      err = FLOPPY_ERROR_OUTOFMEMORY;
218      goto done;
219   }
220   memset(sector_map, 0xFF, sectors * sizeof(*sector_map));
221
222   physical_sector = 0;
223   for (logical_sector = 0; logical_sector < sectors; logical_sector++)
224   {
225      while(sector_map[physical_sector] >= 0)
226      {
227         physical_sector++;
228         physical_sector %= sectors;
229      }
230
231      sector_map[physical_sector] = logical_sector + first_sector_id;
232      physical_sector += interleave + 1;
233      physical_sector %= sectors;
234   }
235
236   /* set up a local physical sector template */
237   local_sector_size = (DMK_IDAM_LEN +
238                      DMK_ID_GAP_LEN +
239                      DMK_DAM_LEN +
240                      sector_length +
241                      DMK_DATA_CRC_LEN +
242                      DMK_DATA_GAP_LEN);
243   local_sector = malloc(local_sector_size);
244   if (!local_sector)
245   {
246      err = FLOPPY_ERROR_OUTOFMEMORY;
247      goto done;
248   }
249   memset(local_sector, 0x00, local_sector_size);
250
251   /* set up track table of contents */
252   physical_sector = 0;
253
254   /* write GAP1 (track lead in) */
255   memset(&track_data[DMK_TOC_LEN],    0xFF, 52);
256   memset(&track_data[DMK_TOC_LEN+52], 0x00, 12);
257   track_position = DMK_TOC_LEN + DMK_GAP1_LEN * 2;
258
259   /*
260     *  prepare template in local sector
261     */
262
263   /* IDAM */
264   sector_position = 0;
265   dmk_idam_type(            &local_sector[sector_position]) = 0xFE;
266   dmk_idam_track(            &local_sector[sector_position]) = track;
267   dmk_idam_side(            &local_sector[sector_position]) = head;
268   dmk_idam_sector(         &local_sector[sector_position]) = 0;      /* replace in sector instances */
269   dmk_idam_sectorlength(      &local_sector[sector_position]) = compute_log2(sector_length / 128);
270   dmk_idam_set_crc(         &local_sector[sector_position], 0);       /* replace in sector instances */
271   sector_position += 7;
272
273   /* GAP2 (ID GAP) */
274   memset(&local_sector[sector_position], 0xFF, 11);
275   sector_position += 11;
276   memset(&local_sector[sector_position], 0x00, 6);
277   sector_position += 6;
278
279   /* sector body */
280   local_sector[sector_position] = 0xFB;
281   memset(&local_sector[sector_position + 1], floppy_get_filler(floppy), sector_length);
282   crc = ccitt_crc16(0xffff, &local_sector[sector_position], sector_length + 1);
283   local_sector[sector_position + sector_length + 1] = (UINT8) (crc >> 8);
284   local_sector[sector_position + sector_length + 2] = (UINT8) (crc >> 0);
285   sector_position += sector_length + 3;
286
287   /* GAP3 (Data GAP) */
288   memset(&local_sector[sector_position], 0xFF, 12);
289   sector_position += 12;
290   memset(&local_sector[sector_position], 0x00, 6);
291   sector_position += 6;
292
293   /*
294     *  start of track data
295     */
296   while(physical_sector < DMK_TOC_LEN/2)
297   {
298      if (physical_sector >= sectors)
299      {
300         /* no more sectors */
301         idam_offset = 0;
302      }
303      else
304      {
305         /* this is a sector */
306         idam_offset = track_position;
307         logical_sector = sector_map[physical_sector];
308
309         /* update IDAM in local sector template */
310         dmk_idam_sector(         &local_sector[0]) = logical_sector;      /* update sector number in sector instance  */
311         crc = ccitt_crc16(0xffff,   &local_sector[0], DMK_IDAM_LEN - 2);   /* and recalculate crc */
312         dmk_idam_set_crc(         &local_sector[0], crc);
313
314         /* write local sector in track doubling every byte (DMK double density mode) */
315         for(i=0; i<local_sector_size; i++)
316            track_data[track_position + i*2] = track_data[track_position + (i*2) + 1] = local_sector[i];
317         track_position += (2 * local_sector_size);
318         if (physical_sector == (sectors-1)) /* on last sector remove GAP3 */
319            track_position -= (2 * DMK_DATA_GAP_LEN);
320      }
321
322      /* write the TOC entry */
323      track_data[physical_sector * 2 + 0] = (UINT8) (idam_offset >> 0);
324      track_data[physical_sector * 2 + 1] = (UINT8) (idam_offset >> 8);
325
326      physical_sector++;
327   }
328
329   /* write track footer GAP4 */
330   assert(max_track_size >= (UINT32)track_position);
331   memset(&track_data[track_position], 0xFF, max_track_size - track_position);
332
333done:
334   if (sector_map)
335      free(sector_map);
336   if (local_sector)
337      free(local_sector);
338
339   return err;
340}
341
342
343
344static int z80ne_dmk_get_heads_per_disk(floppy_image *floppy)
345{
346   return get_dmk_tag(floppy)->heads;
347}
348
349
350
351static int z80ne_dmk_get_tracks_per_disk(floppy_image *floppy)
352{
353   return get_dmk_tag(floppy)->tracks;
354}
355
356
357
358static UINT32 z80ne_dmk_get_track_size(floppy_image *floppy, int head, int track)
359{
360   return get_dmk_tag(floppy)->track_size;
361}
362
363void * my_memmem(UINT8 *haystack, size_t haystacklen,
364      UINT8 *needle, size_t needlelen)
365{
366        register UINT8 *h = haystack;
367        register UINT8 *n = needle;
368        register size_t hl = haystacklen;
369        register size_t nl = needlelen;
370        register size_t i;
371
372        if (nl == 0) return (void *) haystack;    /* The first occurrence of the empty string is deemed to occur at
373                                                     the beginning of the string.  */
374        if (hl < nl)
375           return NULL;
376
377        for( i = 0; (i < hl) && (i + nl <= hl ); i++ )
378                if (h[i] == *n) /* first match */
379                        if ( !memcmp(&h[i]+1, n + 1, nl - 1) )
380                                return (void *)(haystack+i);    /* returns a pointer to the substring */
381
382        return (void *)NULL;    /* not found */
383}
384
385
386
387static floperr_t z80ne_dmk_seek_sector_in_track(floppy_image *floppy, int head, int track, int sector, int sector_is_index, int dirtify, UINT8 **sector_data, UINT32 *sector_length)
388{
389   struct dmk_tag *tag = get_dmk_tag(floppy);
390   floperr_t err;
391   size_t idam_offset = 0;
392   UINT16 calculated_crc;
393   size_t i, j;
394   size_t offs;
395   int state;
396   UINT8 *track_data;
397   void *track_data_v;
398   size_t track_length;
399   size_t sec_len;
400   UINT8 *local_idam = NULL;
401   int local_idam_size;
402   UINT8 *sec_data;
403
404
405   err = FLOPPY_ERROR_SUCCESS;
406
407   err = floppy_load_track(floppy, head, track, dirtify, &track_data_v, &track_length);
408   if (err)
409      goto done;
410   track_data = (UINT8 *) track_data_v;
411
412   /* set up a local IDAM space */
413   local_idam_size = (DMK_IDAM_LEN +
414                      DMK_ID_GAP_LEN +
415                      DMK_DAM_LEN +
416                      DMK_DATA_GAP_LEN);
417   local_idam = malloc(local_idam_size);
418   if (!local_idam)
419   {
420      err = FLOPPY_ERROR_OUTOFMEMORY;
421      goto done;
422   }
423   memset(local_idam, 0x00, local_idam_size);
424
425   /* search for matching IDAM */
426   for (i = 0; i < DMK_TOC_LEN / 2; i++)
427   {
428      idam_offset = track_data[i * 2 + 1];
429      idam_offset <<= 8;
430      idam_offset |= track_data[i * 2 + 0];
431      idam_offset &= 0x3FFF;
432
433      if (idam_offset == 0)
434      {
435         /* we've reached the end of the road */
436         i = DMK_TOC_LEN;
437         break;
438      }
439
440      if ((idam_offset + DMK_IDAM_LEN * 2) >= tag->track_size)
441         continue;
442
443      /* overflowing the track? */
444      if ((idam_offset + local_idam_size * 2) >= tag->track_size)
445      {
446         err = FLOPPY_ERROR_SEEKERROR;
447         goto done;
448      }
449
450      /* create a local copy of sector of IDAM */
451      for(j = 0; j < (DMK_IDAM_LEN + DMK_ID_GAP_LEN + DMK_DAM_LEN); j++)
452         local_idam[j] = track_data[idam_offset + j*2];
453
454      /* from now on all operations are done in local copy of IDAM */
455      calculated_crc = ccitt_crc16(0xffff, &local_idam[0], DMK_IDAM_LEN - 2);
456
457      /* check IDAM integrity and check for matching sector */
458      if (calculated_crc == dmk_idam_crc(&local_idam[0]))
459      {
460         if (sector_is_index)
461         {
462            /* the sector is indexed; decrement the index and go */
463            if (sector-- == 0)
464               break;
465         }
466         else
467         {
468            /* check for matching sector ID */
469            if (sector == dmk_idam_sector(&local_idam[0]))
470               break;
471         }
472      }
473   }
474
475   if (i >= DMK_TOC_LEN / 2)
476   {
477      err = FLOPPY_ERROR_SEEKERROR;
478      goto done;
479   }
480
481   /* we found a matching sector ID */
482   state = 0;
483   offs = idam_offset + 2 * DMK_IDAM_LEN;
484
485   /* find pattern 0x0000FB; this represents the start of a data sector */
486   sec_data = my_memmem(&track_data[offs], 2 * (DMK_ID_GAP_LEN + DMK_DAM_LEN), (UINT8 *)needle_data, 10);
487   if(!sec_data)
488   {
489      /* find pattern 0x0000FA; this represents the start of a deleted data sector (used for system sectors) */
490      sec_data = my_memmem(&track_data[offs], 2 * (DMK_ID_GAP_LEN + DMK_DAM_LEN), (UINT8 *)needle_deleted_data_fa, 10);
491   }
492   if(!sec_data)
493   {
494      /* find pattern 0x0000F8; this represents the start of a deleted data sector (used for system sectors) */
495      sec_data = my_memmem(&track_data[offs], 2 * (DMK_ID_GAP_LEN + DMK_DAM_LEN), (UINT8 *)needle_deleted_data_f8, 10);
496   }
497
498   if(sec_data)
499      sec_data += 10;
500   else
501   {
502      err = FLOPPY_ERROR_SEEKERROR;
503      goto done;
504   }
505   offs = sec_data - &track_data[offs];
506
507   sec_len = 128 << dmk_idam_sectorlength(&local_idam[0]);
508
509   if ((offs + 2 * sec_len) > track_length)
510   {
511      err = FLOPPY_ERROR_INVALIDIMAGE;
512      goto done;
513   }
514
515   if (sector_data)
516      *sector_data = sec_data;
517   if (sector_length)
518      *sector_length = sec_len;
519done:
520   if (local_idam)
521      free(local_idam);
522   return err;
523}
524
525
526
527static floperr_t z80ne_dmk_get_sector_length(floppy_image *floppy, int head, int track, int sector, UINT32 *sector_length)
528{
529   return z80ne_dmk_seek_sector_in_track(floppy, head, track, sector, FALSE, FALSE, NULL, sector_length);
530}
531
532
533
534static floperr_t z80ne_dmk_get_indexed_sector_info(floppy_image *floppy, int head, int track, int sector_index, int *cylinder, int *side, int *sector, UINT32 *sector_length, unsigned long *flags)
535{
536   floperr_t err;
537   size_t idam_offset;
538   UINT8 *track_data;
539   void *track_data_v;
540   unsigned long dam;
541
542   if (sector_index * 2 >= DMK_TOC_LEN)
543      return FLOPPY_ERROR_SEEKERROR;
544
545   err = floppy_load_track(floppy, head, track, FALSE, &track_data_v, NULL);
546   if (err)
547      return err;
548   track_data = (UINT8 *) track_data_v;
549
550   idam_offset = track_data[sector_index * 2 + 1];
551   idam_offset <<= 8;
552   idam_offset |= track_data[sector_index * 2 + 0];
553   idam_offset &= 0x3FFF;
554
555   if (idam_offset == 0)
556      return FLOPPY_ERROR_SEEKERROR;
557
558   /* determine type of data sector */
559   /* find pattern 0x0000FB; this represents the start of a data sector */
560   if ( my_memmem(&track_data[idam_offset+14], 2 * (DMK_ID_GAP_LEN + DMK_DAM_LEN), (UINT8 *)needle_data, 10) )
561      dam = 0;
562   /* find pattern 0x0000FA; this represents the start of a deleted data sector (used for system sectors) */
563   else if ( my_memmem(&track_data[idam_offset+14], 2 * (DMK_ID_GAP_LEN + DMK_DAM_LEN), (UINT8 *)needle_deleted_data_fa, 10) )
564      dam = ID_FLAG_DELETED_DATA;
565   /* find pattern 0x0000F8; this represents the start of a deleted data sector (used for system sectors) */
566   else if ( my_memmem(&track_data[idam_offset+14], 2 * (DMK_ID_GAP_LEN + DMK_DAM_LEN), (UINT8 *)needle_deleted_data_f8, 10) )
567      dam = ID_FLAG_DELETED_DATA;
568   else
569      return FLOPPY_ERROR_SEEKERROR;
570
571   if (cylinder)
572      *cylinder = (&track_data[idam_offset])[2];
573   if (side)
574      *side = (&track_data[idam_offset])[4];
575   if (sector)
576      *sector = (&track_data[idam_offset])[6];
577   if (sector_length)
578      *sector_length = 128 << (&track_data[idam_offset])[8];
579   if (flags)
580      *flags = dam;
581   return FLOPPY_ERROR_SUCCESS;
582}
583
584
585
586static floperr_t internal_z80ne_dmk_read_sector(floppy_image *floppy, int head, int track, int sector, int sector_is_index, void *buffer, size_t buflen)
587{
588   floperr_t err;
589   UINT32 sector_length;
590   UINT16 crc_on_disk;
591   UINT16 calculated_crc;
592   UINT8 *sector_data = NULL;
593   UINT8 *local_sector = NULL;
594   int local_sector_size;
595   int i;
596
597   err = FLOPPY_ERROR_SUCCESS;
598
599   /* get sector length and data pointer */
600   err = z80ne_dmk_seek_sector_in_track(floppy, head, track, sector, sector_is_index, FALSE, &sector_data, &sector_length);
601   if (err)
602      goto done;
603
604   /* set up a local physical sector space (DAM + data + crc + GAP) */
605   local_sector_size = (DMK_DAM_LEN + sector_length + DMK_DATA_CRC_LEN + DMK_DATA_GAP_LEN);
606   local_sector = malloc(local_sector_size);
607   if (!local_sector)
608   {
609      err = FLOPPY_ERROR_OUTOFMEMORY;
610      goto done;
611   }
612   memset(local_sector, 0x00, local_sector_size);
613
614   /* get sector data */
615   /* create a local copy of sector data including DAM (for crc calculation) */
616   for(i = 0; i < (DMK_DAM_LEN + sector_length + DMK_DATA_CRC_LEN); i++)
617      local_sector[i] = (sector_data - 2)[i*2];
618
619   crc_on_disk = local_sector[sector_length + 0 + 1];
620   crc_on_disk <<= 8;
621   crc_on_disk += local_sector[sector_length + 1 + 1];
622
623   /* crc calculated including DAM */
624   calculated_crc = ccitt_crc16(0xffff, local_sector, sector_length+1);
625   if (calculated_crc != crc_on_disk)
626   {
627      err = FLOPPY_ERROR_INVALIDIMAGE;
628      goto done;
629   }
630
631   /* copy local sector data excluding DAM */
632   memcpy(buffer, local_sector+1, MIN(sector_length, buflen));
633
634   done:
635   if (local_sector)
636      free(local_sector);
637   return err;
638}
639
640
641
642static floperr_t internal_z80ne_dmk_write_sector(floppy_image *floppy, int head, int track, int sector, int sector_is_index, const void *buffer, size_t buflen, int ddam)
643{
644   floperr_t err;
645   UINT32 sector_length;
646   UINT8 *sector_data;
647   UINT16 crc;
648   UINT8 *local_sector = NULL;
649   int local_sector_size;
650   int i;
651
652   err = FLOPPY_ERROR_SUCCESS;
653
654   /* get sector length */
655   err = z80ne_dmk_seek_sector_in_track(floppy, head, track, sector, sector_is_index, TRUE, &sector_data, &sector_length);
656   if (err)
657      goto done;
658
659   /* set up a local physical sector space */
660   local_sector_size = (DMK_DAM_LEN + sector_length + DMK_DATA_CRC_LEN + DMK_DATA_GAP_LEN);
661   local_sector = malloc(local_sector_size);
662   if (!local_sector)
663   {
664      err = FLOPPY_ERROR_OUTOFMEMORY;
665      goto done;
666   }
667   memset(local_sector, 0x00, local_sector_size);
668   if(!ddam)
669      local_sector[0] = 0xFB;
670   else
671      local_sector[0] = 0xFA;
672
673   if (buflen > sector_length)
674   {
675      err = FLOPPY_ERROR_INTERNAL;
676      goto done;
677   }
678
679   memcpy(&local_sector[1], buffer, buflen);
680
681   crc = ccitt_crc16(0xffff, local_sector, DMK_DAM_LEN + sector_length);
682   local_sector[DMK_DAM_LEN + sector_length + 0] = crc >> 8;
683   local_sector[DMK_DAM_LEN + sector_length + 1] = crc >> 0;
684
685   /* write local sector in track doubling every byte (DMK double density mode) */
686   /* write DAM or DDAM too */
687   sector_data -= 2;
688   for(i=0; i < (DMK_DAM_LEN + sector_length + DMK_DATA_CRC_LEN); i++)
689      sector_data[i*2] = sector_data[(i*2)+1] = local_sector[i];
690
691   done:
692   if (local_sector)
693      free(local_sector);
694   return err;
695}
696
697
698
699static floperr_t z80ne_dmk_read_sector(floppy_image *floppy, int head, int track, int sector, void *buffer, size_t buflen)
700{
701   return internal_z80ne_dmk_read_sector(floppy, head, track, sector, FALSE, buffer, buflen);
702}
703
704static floperr_t z80ne_dmk_write_sector(floppy_image *floppy, int head, int track, int sector, const void *buffer, size_t buflen, int ddam)
705{
706   return internal_z80ne_dmk_write_sector(floppy, head, track, sector, FALSE, buffer, buflen, ddam);
707}
708
709static floperr_t z80ne_dmk_read_indexed_sector(floppy_image *floppy, int head, int track, int sector, void *buffer, size_t buflen)
710{
711   return internal_z80ne_dmk_read_sector(floppy, head, track, sector, TRUE, buffer, buflen);
712}
713
714static floperr_t z80ne_dmk_write_indexed_sector(floppy_image *floppy, int head, int track, int sector, const void *buffer, size_t buflen, int ddam)
715{
716   return internal_z80ne_dmk_write_sector(floppy, head, track, sector, TRUE, buffer, buflen, ddam);
717}
718
719
720
721static void z80ne_dmk_interpret_header(floppy_image *floppy, int *heads, int *tracks, int * sectors, int *track_size)
722{
723   UINT8 header[DMK_HEADER_LEN + DMK_TOC_LEN];
724   int i;
725   int idam_offset;
726   int sects;
727
728   floppy_image_read(floppy, header, 0, DMK_HEADER_LEN + DMK_TOC_LEN);
729
730   if (tracks)
731      *tracks = header[1];
732   if (heads)
733      *heads = (header[4] & 0x10) ? 1 : 2;
734   if (track_size)
735      *track_size = ((int) header[3]) * 0x100 + header[2];
736   if(sectors)
737   {
738      /* count sectors on first track */
739      sects = 0;
740      for (i = 0; i < DMK_TOC_LEN / 2; i++)
741      {
742         idam_offset = header[DMK_HEADER_LEN + i * 2 + 1];
743         idam_offset <<= 8;
744         idam_offset |= header[DMK_HEADER_LEN + i * 2 + 0];
745         idam_offset &= 0x3FFF;
746
747         if (idam_offset == 0)
748            break;
749         else
750            sects++;
751      }
752      *sectors = sects;
753   }
754
755}
756
757
758
759FLOPPY_CONSTRUCT(z80ne_dmk_construct)
760{
761   struct FloppyCallbacks *callbacks;
762   struct dmk_tag *tag;
763   UINT8 header[DMK_HEADER_LEN];
764   int heads, tracks, track_size, sectors, sector_length;
765
766   if (params)
767   {
768      heads         = option_resolution_lookup_int(params, PARAM_HEADS);
769      tracks         = option_resolution_lookup_int(params, PARAM_TRACKS);
770      sectors         = option_resolution_lookup_int(params, PARAM_SECTORS);
771      sector_length   = option_resolution_lookup_int(params, PARAM_SECTOR_LENGTH);
772
773      track_size = z80ne_dmk_min_track_size(sectors, sector_length);
774
775      memset(header, 0, sizeof(header));
776      header[1] = tracks;
777      header[2] = track_size >> 0;
778      header[3] = track_size >> 8;
779      header[4] = (heads == 2) ? 0x00 : 0x10;
780
781      floppy_image_write(floppy, header, 0, sizeof(header));
782   }
783   else
784   {
785      z80ne_dmk_interpret_header(floppy, &heads, &tracks, &sectors, &track_size);
786   }
787
788   tag = floppy_create_tag(floppy, DMK_TAG, sizeof(struct dmk_tag));
789   if (!tag)
790      return FLOPPY_ERROR_OUTOFMEMORY;
791   tag->heads = heads;
792   tag->track_size = track_size;
793   tag->tracks = tracks;
794
795   callbacks = floppy_callbacks(floppy);
796   callbacks->read_track = z80ne_dmk_read_track;
797   callbacks->write_track = z80ne_dmk_write_track;
798   callbacks->get_track_data_offset = z80ne_dmk_get_track_data_offset;
799   callbacks->format_track = z80ne_dmk_format_track;
800   callbacks->get_heads_per_disk = z80ne_dmk_get_heads_per_disk;
801   callbacks->get_tracks_per_disk = z80ne_dmk_get_tracks_per_disk;
802   callbacks->get_track_size = z80ne_dmk_get_track_size;
803   callbacks->get_sector_length = z80ne_dmk_get_sector_length;
804   callbacks->get_indexed_sector_info = z80ne_dmk_get_indexed_sector_info;
805   callbacks->read_sector = z80ne_dmk_read_sector;
806   callbacks->write_sector = z80ne_dmk_write_sector;
807   callbacks->read_indexed_sector = z80ne_dmk_read_indexed_sector;
808   callbacks->write_indexed_sector = z80ne_dmk_write_indexed_sector;
809
810   return FLOPPY_ERROR_SUCCESS;
811}
812
813
814
815FLOPPY_IDENTIFY(z80ne_dmk_identify)
816{
817   int heads, tracks, sectors, track_size;
818   UINT64 size, expected_size;
819
820   size = floppy_image_size(floppy);
821   z80ne_dmk_interpret_header(floppy, &heads, &tracks, &sectors, &track_size);
822   expected_size = DMK_HEADER_LEN + (heads * tracks * track_size);
823   *vote = (size == expected_size) ? 90 : 0;
824   *vote += (sectors == 10) ? 10 : 0;
825   return FLOPPY_ERROR_SUCCESS;
826}
827
828
829
830/* ----------------------------------------------------------------------- */
831
832FLOPPY_OPTIONS_START( z80ne )
833   /*
834     * Single side
835     * Single density
836     * FM, 125 kbit/s,
837     * 40 tracks, track ID: 0..39
838     * 10 sectors/track, sector ID: 0..9
839     * 256 bytes/sector
840     * Interleave 1 (sector ID sequence on track: 0 5 1 6 2 7 3 8 4 9)
841     * 3125 byte/track unformatted
842     * Rotation speed 300 rpm (5 rps)
843     */
844   FLOPPY_OPTION( z80ne_dmk, "zmk",      "Z80NE DMK disk image",   z80ne_dmk_identify,   z80ne_dmk_construct,
845      HEADS([1])
846      TRACKS([40])
847      SECTORS([10])
848      SECTOR_LENGTH([256])
849      INTERLEAVE([1])
850      FIRST_SECTOR_ID([0]))
851FLOPPY_OPTIONS_END
src/mess/formats/z80ne_dsk.h
r0r5034
1/*********************************************************************
2
3    formats/z80ne_dsk.h
4
5    Nuova Elettronica Z80NE disk images
6
7*********************************************************************/
8
9#ifndef Z80NE_DSK_H
10#define Z80NE_DSK_H
11
12#include "formats/flopimg.h"
13
14
15/**************************************************************************/
16
17FLOPPY_OPTIONS_EXTERN(z80ne);
18
19FLOPPY_IDENTIFY(z80ne_dmk_identify);
20FLOPPY_CONSTRUCT(z80ne_dmk_construct);
21
22#endif /* Z80NE_DSK_H */
23/*********************************************************************
24
25    formats/z80ne_dsk.h
26
27    Nuova Elettronica Z80NE disk images
28
29*********************************************************************/
30
31#ifndef Z80NE_DSK_H
32#define Z80NE_DSK_H
33
34#include "formats/flopimg.h"
35
36
37/**************************************************************************/
38
39FLOPPY_OPTIONS_EXTERN(z80ne);
40
41FLOPPY_IDENTIFY(z80ne_dmk_identify);
42FLOPPY_CONSTRUCT(z80ne_dmk_construct);
43
44#endif /* Z80NE_DSK_H */
src/mess/drivers/z80ne.c
r5033r5034
11/******************************************************************************
2   Nuova Elettronica Z80NE system driver
2    Nuova Elettronica Z80NE system driver
33
4   Preliminary driver
4    Preliminary driver
55
6   Roberto Lavarone, 2009-01-05
6    Roberto Lavarone, 2009-01-05
77
8   Thanks go to:
9      Roberto Bazzano: www.z80ne.com
8    Thanks go to:
9        Roberto Bazzano: www.z80ne.com
1010
11   Z80NE memory map
11    Z80NE memory map
1212
13      LX.382 CPU board
14         range     short     description
15         0000-03FF RAM
16         8000-83FF EPROM     firmware
13        LX.382 CPU board
14            range     short     description
15            0000-03FF RAM
16            8000-83FF EPROM     firmware
1717
18      LX.383 HEX keyboard and display controller for LX.384 hex keyboard and display
19         range     short     description
20         F0-F7     I/O       7-segment LED dual-port RAM write
21         F0        I/O       keyboard read
22         F8        I/O       enable single step for next instruction
18        LX.383 HEX keyboard and display controller for LX.384 hex keyboard and display
19            range     short     description
20            F0-F7     I/O       7-segment LED dual-port RAM write
21            F0        I/O       keyboard read
22            F8        I/O       enable single step for next instruction
2323
24      LX.385 Cassette interface
25         range     short     description
26         EE        I/O       UART Data Read/Write
27         EF        I/O       UART Status/Control - Cassette Tape Control
24        LX.385 Cassette interface
25            range     short     description
26            EE        I/O       UART Data Read/Write
27            EF        I/O       UART Status/Control - Cassette Tape Control
2828
29      LX.392 32K Memory expansion board
30         range     short     description
29        LX.392 32K Memory expansion board
30            range     short     description
3131
3232
33      LX.389 Printer Interface
34         range     short     description
35         02-03
36         06-07
37         0A-0B
38         0E-0F
39         12-13
40         16-17
41         1A-1B
42         1E-1F
33        LX.389 Printer Interface
34            range     short     description
35            02-03
36            06-07
37            0A-0B
38            0E-0F
39            12-13
40            16-17
41            1A-1B
42            1E-1F
4343
44      LX.548 16K Basic eprom
45         range     short     description
46         0000-3FFF EPROM     firmware
44        LX.548 16K Basic eprom
45            range     short     description
46            0000-3FFF EPROM     firmware
4747
48      LX.388 Video Interface
49         range     short     description
50         EC00-EDFF RAM
51         EA        I/O       keyboard
52         EB        I/O       video retrace
48        LX.388 Video Interface
49            range     short     description
50            EC00-EDFF RAM
51            EA        I/O       keyboard
52            EB        I/O       video retrace
5353
54      LX.529 Graphics Video and Printer Interface
55         range     short     description
56         80        I/O       PIO 0 port A data (ram 0)
57         81        I/O       PIO 0 port A control (ram 0)
58         82        I/O       PIO 0 port B data (printer)
59         83        I/O       PIO 0 port B control (printer)
60         84        I/O       PIO 1 port A data (ram 1)
61         85        I/O       PIO 1 port A control (ram 1)
62         86        I/O       PIO 1 port B data (keyboard)
63         87        I/O       PIO 1 port B control (keyboard)
64         88        I/O       PIO 2 port A data (ram 2)
65         89        I/O       PIO 2 port A control (ram 2)
66         8A        I/O       PIO 2 port B data (printer busy + 40/80 video chars)
67         8B        I/O       PIO 2 port B control (printer busy + 40/40 video chars)
68         8C        I/O       SY6845 address and status register
69         8D        I/O       SY6845 data register
70         8E        I/O       RAM 3 character attribute
71         8F        I/O       beeper
54        LX.529 Graphics Video and Printer Interface
55            range     short     description
56            80        I/O       PIO 0 port A data (ram 0)
57            81        I/O       PIO 0 port A control (ram 0)
58            82        I/O       PIO 0 port B data (printer)
59            83        I/O       PIO 0 port B control (printer)
60            84        I/O       PIO 1 port A data (ram 1)
61            85        I/O       PIO 1 port A control (ram 1)
62            86        I/O       PIO 1 port B data (keyboard)
63            87        I/O       PIO 1 port B control (keyboard)
64            88        I/O       PIO 2 port A data (ram 2)
65            89        I/O       PIO 2 port A control (ram 2)
66            8A        I/O       PIO 2 port B data (printer busy + 40/80 video chars)
67            8B        I/O       PIO 2 port B control (printer busy + 40/40 video chars)
68            8C        I/O       SY6845 address and status register
69            8D        I/O       SY6845 data register
70            8E        I/O       RAM 3 character attribute
71            8F        I/O       beeper
7272
73      LX.390 Floppy Interface
74         range     short     description
75         F000-F3FF EPROM     firmware
76         D0        I/O       command/status register
77         D1        I/O       trace register
78         D2        I/O       sector register
79         D3        I/O       data register (write only if controller idle)
80         D6        I/O       drive select / drive side one select
81         D7        I/O       data register (write always)
73        LX.390 Floppy Interface
74            range     short     description
75            F000-F3FF EPROM     firmware
76            D0        I/O       command/status register
77            D1        I/O       trace register
78            D2        I/O       sector register
79            D3        I/O       data register (write only if controller idle)
80            D6        I/O       drive select / drive side one select
81            D7        I/O       data register (write always)
8282
83      LX.394-395 EPROM Programmer
84         range     short     description
85         9000-9FFF EPROM     EPROM to be written
86         8400-8FFF EPROM     firmware
83        LX.394-395 EPROM Programmer
84            range     short     description
85            9000-9FFF EPROM     EPROM to be written
86            8400-8FFF EPROM     firmware
8787
8888
8989******************************************************************************/
r5033r5034
9292#include "driver.h"
9393#include "cpu/z80/z80.h"
9494#include "includes/z80ne.h"
95#include "devices/basicdsk.h"
96#include "devices/mflopimg.h"
9597#include "devices/cassette.h"
98#include "formats/z80ne_dsk.h"
9699
97100/* peripheral chips */
98101#include "machine/ay31015.h"
99102#include "machine/kr2376.h"
100103#include "video/m6847.h"
101#include "machine/wd17xx.h"
102104
103105/* Layout */
104106#include "z80ne.lh"
105107#include "z80net.lh"
106108#include "z80netb.lh"
109#include "z80netf.lh"
107110
108111
109112/******************************************************************************
r5033r5034
113116
114117/* LX.382 CPU Board RAM */
115118/* LX.382 CPU Board EPROM */
116#if 0
117119static ADDRESS_MAP_START( z80ne_mem, ADDRESS_SPACE_PROGRAM, 8 )
118120   AM_RANGE( 0x0000, 0x03ff ) AM_RAMBANK(1)
119   AM_RANGE( 0x0400, 0x7fff ) AM_READWRITE(SMH_NOP, SMH_NOP)
120   AM_RANGE( 0x8000, 0x83ff ) AM_ROM
121   AM_RANGE( 0x8400, 0xebff ) AM_READWRITE(SMH_NOP, SMH_NOP)
122   AM_RANGE( 0xec00, 0xedff ) AM_RAM AM_BASE(&videoram) AM_SIZE(&videoram_size) /* (6847) */
123   AM_RANGE( 0xee00, 0xffff ) AM_READWRITE(SMH_NOP, SMH_NOP)
124
121   AM_RANGE( 0x0400, 0x7fff ) AM_RAM
122   AM_RANGE( 0x8000, 0x83ff ) AM_ROMBANK(2)
123   AM_RANGE( 0x8400, 0xffff ) AM_READWRITE(SMH_NOP, SMH_NOP)
125124ADDRESS_MAP_END
126#endif
127125
128static ADDRESS_MAP_START( z80ne_mem, ADDRESS_SPACE_PROGRAM, 8 )
129   AM_RANGE( 0x0000, 0x7fff ) AM_RAMBANK(1)
130   AM_RANGE( 0x8000, 0x83ff ) AM_ROM
131//   AM_RANGE( 0x8400, 0xebff ) AM_READWRITE(SMH_NOP, SMH_NOP)
126static ADDRESS_MAP_START( z80net_mem, ADDRESS_SPACE_PROGRAM, 8 )
127   AM_RANGE( 0x0000, 0x03ff ) AM_RAMBANK(1)
128   AM_RANGE( 0x0400, 0x7fff ) AM_RAM
129   AM_RANGE( 0x8000, 0x83ff ) AM_ROMBANK(2)
132130   AM_RANGE( 0x8400, 0xebff ) AM_RAM
133131   AM_RANGE( 0xec00, 0xedff ) AM_RAM AM_BASE(&videoram) AM_SIZE(&videoram_size) /* (6847) */
134//   AM_RANGE( 0xee00, 0xffff ) AM_READWRITE(SMH_NOP, SMH_NOP)
135132   AM_RANGE( 0xee00, 0xffff ) AM_RAM
136133ADDRESS_MAP_END
137134
r5033r5034
158155   AM_RANGE(0xf0, 0xff) AM_READWRITE( lx383_r, lx383_w )
159156ADDRESS_MAP_END
160157
158static ADDRESS_MAP_START( z80netf_mem, ADDRESS_SPACE_PROGRAM, 8 )
159   AM_RANGE( 0x0000, 0x03ff ) AM_RAMBANK(1)
160   AM_RANGE( 0x0400, 0x3fff ) AM_RAMBANK(2)
161   AM_RANGE( 0x4000, 0x7fff ) AM_RAM
162   AM_RANGE( 0x8000, 0x83ff ) AM_RAMBANK(3)
163   AM_RANGE( 0x8400, 0xdfff ) AM_RAM
164   AM_RANGE( 0xe000, 0xebff ) AM_READWRITE(SMH_NOP, SMH_NOP)
165   AM_RANGE( 0xec00, 0xedff ) AM_RAM AM_BASE(&videoram) AM_SIZE(&videoram_size) /* (6847) */
166   AM_RANGE( 0xee00, 0xefff ) AM_READWRITE(SMH_NOP, SMH_NOP)
167   AM_RANGE( 0xf000, 0xf3ff ) AM_RAMBANK(4)
168   AM_RANGE( 0xf400, 0xffff ) AM_READWRITE(SMH_NOP, SMH_NOP)
169ADDRESS_MAP_END
161170
171static ADDRESS_MAP_START( z80netf_io, ADDRESS_SPACE_IO, 8 )
172   ADDRESS_MAP_GLOBAL_MASK(0xff)
173   AM_RANGE(0xd0, 0xd7) AM_DEVREADWRITE("wd1771", lx390_fdc_r, lx390_fdc_w)
174   AM_RANGE(0xea, 0xea) AM_READ( lx388_data_r )
175   AM_RANGE(0xeb, 0xeb) AM_READ( lx388_read_field_sync )
176   AM_RANGE(0xee, 0xee) AM_READWRITE( lx385_data_r, lx385_data_w )
177   AM_RANGE(0xef, 0xef) AM_READWRITE( lx385_ctrl_r, lx385_ctrl_w )
178   AM_RANGE(0xf0, 0xff) AM_READWRITE( lx383_r, lx383_w )
179ADDRESS_MAP_END
162180
181
182
163183/******************************************************************************
164184 Input Ports
165185******************************************************************************/
r5033r5034
167187
168188static INPUT_PORTS_START( z80ne )
169189/* LX.384 Hex Keyboard and Display */
190/*
191 * In natural mode the CTRL key is mapped on shift
192 */
170193PORT_START("ROW0")         /* IN0 keys row 0 */
171PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("0") PORT_CODE(KEYCODE_0)
172PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("1") PORT_CODE(KEYCODE_1)
173PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("2") PORT_CODE(KEYCODE_2)
174PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("3") PORT_CODE(KEYCODE_3)
175PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("4") PORT_CODE(KEYCODE_4)
176PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("5") PORT_CODE(KEYCODE_5)
177PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("6") PORT_CODE(KEYCODE_6)
178PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("7") PORT_CODE(KEYCODE_7)
194PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("LX.384 0") PORT_CODE(KEYCODE_0)          //PORT_CHAR('0') PORT_CHAR('=')
195PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("LX.384 1") PORT_CODE(KEYCODE_1)          //PORT_CHAR('1') PORT_CHAR('!')
196PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("LX.384 2") PORT_CODE(KEYCODE_2)          //PORT_CHAR('2') PORT_CHAR('"')
197PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("LX.384 3") PORT_CODE(KEYCODE_3)          //PORT_CHAR('3') PORT_CHAR(0x00a3) // ??
198PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("LX.384 4") PORT_CODE(KEYCODE_4)          //PORT_CHAR('4') PORT_CHAR('$')
199PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("LX.384 5") PORT_CODE(KEYCODE_5)          //PORT_CHAR('5') PORT_CHAR('%')
200PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("LX.384 6") PORT_CODE(KEYCODE_6)          //PORT_CHAR('6') PORT_CHAR('&')
201PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("LX.384 7") PORT_CODE(KEYCODE_7)          //PORT_CHAR('7') PORT_CHAR('/')
179202
180203PORT_START("ROW1")         /* IN1 keys row 1 */
181PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("8") PORT_CODE(KEYCODE_8)
182PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("9") PORT_CODE(KEYCODE_9)
183PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("A") PORT_CODE(KEYCODE_A)
184PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("B") PORT_CODE(KEYCODE_B)
185PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("C") PORT_CODE(KEYCODE_C)
186PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("D") PORT_CODE(KEYCODE_D)
187PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("E") PORT_CODE(KEYCODE_E)
188PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("F") PORT_CODE(KEYCODE_F)
204PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("LX.384 8") PORT_CODE(KEYCODE_8)          //PORT_CHAR('8') PORT_CHAR('(')
205PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("LX.384 9") PORT_CODE(KEYCODE_9)          //PORT_CHAR('9') PORT_CHAR(')')
206PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("LX.384 A") PORT_CODE(KEYCODE_A)          //PORT_CHAR('a') PORT_CHAR('A')
207PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("LX.384 B") PORT_CODE(KEYCODE_B)          //PORT_CHAR('b') PORT_CHAR('B')
208PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("LX.384 C") PORT_CODE(KEYCODE_C)          //PORT_CHAR('c') PORT_CHAR('C')
209PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("LX.384 D") PORT_CODE(KEYCODE_D)          //PORT_CHAR('d') PORT_CHAR('D')
210PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("LX.384 E") PORT_CODE(KEYCODE_E)          //PORT_CHAR('e') PORT_CHAR('E')
211PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("LX.384 F") PORT_CODE(KEYCODE_F)          //PORT_CHAR('f') PORT_CHAR('F')
189212
190213PORT_START("CTRL")         /* CONTROL key */
191PORT_BIT( 0x80, 0x80, IPT_UNUSED )
192PORT_BIT( 0x40, 0x40, IPT_UNUSED )
193PORT_BIT( 0x20, 0x20, IPT_UNUSED )
194PORT_BIT( 0x10, 0x10, IPT_KEYBOARD ) PORT_NAME("CTRL") PORT_CODE(KEYCODE_LCONTROL)
195PORT_BIT( 0x08, 0x08, IPT_UNUSED )
196PORT_BIT( 0x04, 0x04, IPT_UNUSED )
197PORT_BIT( 0x02, 0x02, IPT_UNUSED )
198PORT_BIT( 0x01, 0x01, IPT_UNUSED )
214PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED )
215PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED )
216PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED )
217PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("LX.384 CTRL") PORT_CODE(KEYCODE_LCONTROL) PORT_CODE(KEYCODE_RCONTROL) //PORT_CHAR(UCHAR_SHIFT_1)
218PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED )
219PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED )
220PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED )
221PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED )
199222
200223PORT_START("RST")         /* RESET key */
201PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Reset") PORT_CODE(KEYCODE_F3) PORT_CHAR(UCHAR_MAMEKEY(F10)) PORT_CHANGED(z80ne_reset, NULL)
224PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("LX.384 Reset") PORT_CODE(KEYCODE_F3) PORT_CHANGED(z80ne_reset, NULL)
202225
203226/* Settings */
204227PORT_START("LX.385")
205PORT_DIPNAME(0x07, 0x01   , "LX.385: P1,P3 Data Rate")
206PORT_DIPSETTING( 0x01, "A-B: 300 bps")
207PORT_DIPSETTING( 0x02, "A-C: 600 bps")
208PORT_DIPSETTING( 0x04, "A-D: 1200 bps")
209PORT_DIPNAME( 0x08, 0x00, "LX.385: P4 Parity Check")
210PORT_DIPSETTING( 0x00, "Parity Check Enabled")
211PORT_DIPSETTING( 0x08, "Parity Check Disabled")
228PORT_CONFNAME(0x07, 0x01   , "LX.385 Cassette: P1,P3 Data Rate")
229PORT_CONFSETTING( 0x01, "A-B: 300 bps")
230PORT_CONFSETTING( 0x02, "A-C: 600 bps")
231PORT_CONFSETTING( 0x04, "A-D: 1200 bps")
232PORT_CONFNAME( 0x08, 0x00, "LX.385: P4 Parity Check")
233PORT_CONFSETTING( 0x00, "Parity Check Enabled")
234PORT_CONFSETTING( 0x08, "Parity Check Disabled")
212235
213236INPUT_PORTS_END
214237
r5033r5034
219242
220243/* LX.388 Keyboard BREAK key */
221244PORT_START("LX388_BRK")
222PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Break") PORT_CODE(KEYCODE_STOP) PORT_CHANGED(z80ne_nmi, NULL)
245PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Break") PORT_CODE(KEYCODE_INSERT) PORT_CHAR(UCHAR_MAMEKEY(INSERT)) PORT_CHANGED(z80ne_nmi, NULL)
223246
224247/* LX.388 Keyboard (Encoded by KR2376) */
248
225249PORT_START("X0")
226PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_KEYBOARD )
227PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_KEYBOARD )
228PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_KEYBOARD )
229PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_KEYBOARD )
230PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_KEYBOARD )
231PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_KEYBOARD )
232PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_KEYBOARD )
233PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_KEYBOARD )
234PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_KEYBOARD )
235PORT_BIT( 0x0200, IP_ACTIVE_HIGH, IPT_KEYBOARD )
236PORT_BIT( 0x0400, IP_ACTIVE_HIGH, IPT_KEYBOARD )
250PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_UNUSED )
251PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_UNUSED )
252PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_UNUSED )
253PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_UNUSED )
254PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_UNUSED )
255PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_UNUSED )
256PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_UNUSED )
257PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_UNUSED )
258PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_UNUSED )
259PORT_BIT( 0x0200, IP_ACTIVE_HIGH, IPT_UNUSED )
260PORT_BIT( 0x0400, IP_ACTIVE_HIGH, IPT_UNUSED )
237261
238262PORT_START("X1")
239PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_KEYBOARD )
240PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_KEYBOARD )
241PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_KEYBOARD )
242PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_KEYBOARD )
243PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_KEYBOARD )
244PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_KEYBOARD )
245PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_KEYBOARD )
246PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_KEYBOARD )
247PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_KEYBOARD )
248PORT_BIT( 0x0200, IP_ACTIVE_HIGH, IPT_KEYBOARD )
249PORT_BIT( 0x0400, IP_ACTIVE_HIGH, IPT_KEYBOARD )
263PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_UNUSED )
264PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_UNUSED )
265PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_UNUSED )
266PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_UNUSED )
267PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_UNUSED )
268PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_UNUSED )
269PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_UNUSED )
270PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_UNUSED )
271PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_UNUSED )
272PORT_BIT( 0x0200, IP_ACTIVE_HIGH, IPT_UNUSED )
273PORT_BIT( 0x0400, IP_ACTIVE_HIGH, IPT_UNUSED )
250274
251275
252276PORT_START("X2")
253PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_MINUS) PORT_CHAR('-') PORT_CHAR('=')
254PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_KEYBOARD )
255PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_KEYBOARD )
256PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_KEYBOARD )
257PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_KEYBOARD )
258PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_KEYBOARD )
259PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_KEYBOARD )
260PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_KEYBOARD )
261PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("Space") PORT_CODE(KEYCODE_SPACE) PORT_CHAR(' ')
262PORT_BIT( 0x0200, IP_ACTIVE_HIGH, IPT_KEYBOARD )
263PORT_BIT( 0x0400, IP_ACTIVE_HIGH, IPT_KEYBOARD )
277PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_MINUS)      PORT_CHAR('-') PORT_CHAR('=')
278PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_UNUSED )
279PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_UNUSED )
280PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_UNUSED )
281PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_UNUSED )
282PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_UNUSED )
283PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_UNUSED )
284PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_UNUSED )
285PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_SPACE)      PORT_CHAR(' ')
286PORT_BIT( 0x0200, IP_ACTIVE_HIGH, IPT_UNUSED )
287PORT_BIT( 0x0400, IP_ACTIVE_HIGH, IPT_KEYBOARD )                               PORT_CHAR('_')
264288
265289PORT_START("X3")
266PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_0) PORT_CHAR('0')
267PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_COLON) PORT_CHAR(':') PORT_CHAR('*')
268PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_P) PORT_CHAR('P')
269PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("- Delete") PORT_CODE(KEYCODE_EQUALS) PORT_CHAR('_')
270PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_QUOTE) PORT_CHAR('@') PORT_CHAR('`')
271PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("Delete") PORT_CODE(KEYCODE_BACKSPACE) PORT_CHAR(8)
272PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_OPENBRACE) PORT_CHAR('[') PORT_CHAR('{')
290PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_0)          PORT_CHAR('0')
291PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_COLON)      PORT_CHAR(':') PORT_CHAR('*')
292PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_P)          PORT_CHAR('p') PORT_CHAR('P')
293PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_UNUSED )
294PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_QUOTE)      PORT_CHAR('`') PORT_CHAR('@')
295PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_BACKSPACE)  PORT_CHAR(8)                   PORT_NAME("Del")
296PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_OPENBRACE)  PORT_CHAR('[') PORT_CHAR('{')
273297PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_CLOSEBRACE) PORT_CHAR(']') PORT_CHAR('}')
274PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("Carriage Return") PORT_CODE(KEYCODE_ENTER) PORT_CHAR(13)
275PORT_BIT( 0x0200, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("Line Feed") PORT_CODE(KEYCODE_HOME) PORT_CHAR(UCHAR_MAMEKEY(HOME)) PORT_CHAR(10)
276PORT_BIT( 0x0400, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_DEL)
298PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_ENTER)      PORT_CHAR(13)                  PORT_NAME("CR")
299PORT_BIT( 0x0200, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_HOME)       PORT_CHAR(UCHAR_MAMEKEY(HOME)) PORT_CHAR(10) PORT_NAME("LF")
300PORT_BIT( 0x0400, IP_ACTIVE_HIGH, IPT_UNUSED )
277301
278302PORT_START("X4")
279PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_BACKSLASH2) PORT_CHAR(';') PORT_CHAR('+')
280PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_SLASH) PORT_CHAR('/') PORT_CHAR('?')
281PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_STOP) PORT_CHAR('.') PORT_CHAR('>')
282PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_COMMA) PORT_CHAR(',') PORT_CHAR('<')
283PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_M) PORT_CHAR('M')
284PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_N) PORT_CHAR('N')
285PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_B) PORT_CHAR('B')
286PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_V) PORT_CHAR('V')
287PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_C) PORT_CHAR('C')
288PORT_BIT( 0x0200, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_X) PORT_CHAR('X')
289PORT_BIT( 0x0400, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_Z) PORT_CHAR('Z')
303PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_COLON)      PORT_CHAR(';') PORT_CHAR('+')
304PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_SLASH)      PORT_CHAR('/') PORT_CHAR('?')
305PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_STOP)       PORT_CHAR('.') PORT_CHAR('>')
306PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_COMMA)      PORT_CHAR(',') PORT_CHAR('<')
307PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_M)          PORT_CHAR('m') PORT_CHAR('M')
308PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_N)          PORT_CHAR('n') PORT_CHAR('N')
309PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_B)          PORT_CHAR('b') PORT_CHAR('B')
310PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_V)          PORT_CHAR('v') PORT_CHAR('V')
311PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_C)          PORT_CHAR('c') PORT_CHAR('C')
312PORT_BIT( 0x0200, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_X)          PORT_CHAR('x') PORT_CHAR('X')
313PORT_BIT( 0x0400, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_Z)          PORT_CHAR('z') PORT_CHAR('Z')
290314
291315
292316PORT_START("X5")
293PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_L) PORT_CHAR('L')
294PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_K) PORT_CHAR('K')
295PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_J) PORT_CHAR('J')
296PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_H) PORT_CHAR('H')
297PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_G) PORT_CHAR('G')
298PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_F) PORT_CHAR('F')
299PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_D) PORT_CHAR('D')
300PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_S) PORT_CHAR('S')
301PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_A) PORT_CHAR('A')
302PORT_BIT( 0x0200, IP_ACTIVE_HIGH, IPT_KEYBOARD )
303PORT_BIT( 0x0400, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("Escape") PORT_CODE(KEYCODE_ESC) PORT_CHAR(UCHAR_MAMEKEY(ESC))
317PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_L)          PORT_CHAR('l') PORT_CHAR('L')
318PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_K)          PORT_CHAR('k') PORT_CHAR('K')
319PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_J)          PORT_CHAR('j') PORT_CHAR('J')
320PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_H)          PORT_CHAR('h') PORT_CHAR('H')
321PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_G)          PORT_CHAR('c') PORT_CHAR('G')
322PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_F)          PORT_CHAR('f') PORT_CHAR('F')
323PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_D)          PORT_CHAR('d') PORT_CHAR('D')
324PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_S)          PORT_CHAR('s') PORT_CHAR('S')
325PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_A)          PORT_CHAR('a') PORT_CHAR('A')
326PORT_BIT( 0x0200, IP_ACTIVE_HIGH, IPT_UNUSED )
327PORT_BIT( 0x0400, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_ESC)        PORT_CHAR(UCHAR_MAMEKEY(ESC))
304328
305329
306330PORT_START("X6")
307PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_O) PORT_CHAR('O')
308PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_I) PORT_CHAR('I')
309PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_U) PORT_CHAR('U')
310PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_Y) PORT_CHAR('Y')
311PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_T) PORT_CHAR('T')
312PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_R) PORT_CHAR('R')
313PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_E) PORT_CHAR('E')
314PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_W) PORT_CHAR('W')
315PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_Q) PORT_CHAR('Q')
331PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_O)          PORT_CHAR('o') PORT_CHAR('O')
332PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_I)          PORT_CHAR('i') PORT_CHAR('I')
333PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_U)          PORT_CHAR('u') PORT_CHAR('U')
334PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_Y)          PORT_CHAR('y') PORT_CHAR('Y')
335PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_T)          PORT_CHAR('t') PORT_CHAR('T')
336PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_R)          PORT_CHAR('r') PORT_CHAR('R')
337PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_E)          PORT_CHAR('e') PORT_CHAR('E')
338PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_W)          PORT_CHAR('w') PORT_CHAR('W')
339PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_Q)          PORT_CHAR('q') PORT_CHAR('Q')
316340
317341PORT_START("X7")
318PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_9) PORT_CHAR('9') PORT_CHAR(')')
319PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_8) PORT_CHAR('8') PORT_CHAR('(')
320PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_7) PORT_CHAR('7') PORT_CHAR(0xFFFD)
321PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_6) PORT_CHAR('6') PORT_CHAR('&')
322PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_5) PORT_CHAR('5') PORT_CHAR('%')
323PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_4) PORT_CHAR('4') PORT_CHAR('$')
324PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_3) PORT_CHAR('3') PORT_CHAR('#')
325PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_2) PORT_CHAR('2') PORT_CHAR('"')
326PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_1) PORT_CHAR('1') PORT_CHAR('!')
327PORT_BIT( 0x0200, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_TILDE) PORT_CHAR('^') PORT_CHAR('~')
328PORT_BIT( 0x0400, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_BACKSLASH) PORT_CHAR('\\') PORT_CHAR('|')
342PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_9)          PORT_CHAR('9') PORT_CHAR(')')
343PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_8)          PORT_CHAR('8') PORT_CHAR('(')
344PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_7)          PORT_CHAR('7') PORT_CHAR('\'')
345PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_6)          PORT_CHAR('6') PORT_CHAR('&')
346PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_5)          PORT_CHAR('5') PORT_CHAR('%')
347PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_4)          PORT_CHAR('4') PORT_CHAR('$')
348PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_3)          PORT_CHAR('3') PORT_CHAR('#')
349PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_2)          PORT_CHAR('2') PORT_CHAR('"')
350PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_1)          PORT_CHAR('1') PORT_CHAR('!')
351PORT_BIT( 0x0200, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_TILDE)      PORT_CHAR('^') PORT_CHAR('~')
352PORT_BIT( 0x0400, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_BACKSLASH)  PORT_CHAR('\\') PORT_CHAR('|')
329353
330354PORT_START("MODIFIERS")
331355PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("Shift") PORT_CODE(KEYCODE_LSHIFT) PORT_CODE(KEYCODE_RSHIFT) PORT_CHAR(UCHAR_SHIFT_1)
r5033r5034
334358
335359INPUT_PORTS_END
336360
361
362static INPUT_PORTS_START( z80netf )
363
364PORT_INCLUDE( z80net )
365
366/* Settings */
367PORT_START("CONFIG")
368PORT_CONFNAME(0x07, 0x01, "Boot EPROM")
369PORT_CONFSETTING(   0x01, "EP382  Hex Monitor")
370PORT_CONFSETTING(   0x02, "EP548  16k BASIC")
371PORT_CONFSETTING(   0x03, "EP390  Boot Loader for 5.5k floppy BASIC")
372PORT_CONFSETTING(   0x04, "EP1390 Boot Loader for NE DOS 1.0/1.5")
373PORT_CONFSETTING(   0x05, "EP2390 Boot Loader for NE DOS G.1")
374PORT_BIT(0xf8, 0xf8, IPT_UNUSED)
375
376INPUT_PORTS_END
377
378
379
380
337381/******************************************************************************
338382 Machine Drivers
339383******************************************************************************/
r5033r5034
390434   MDRV_IMPORT_FROM( z80ne )
391435
392436   MDRV_CPU_MODIFY("z80ne")
437   MDRV_CPU_PROGRAM_MAP(z80net_mem)
393438   MDRV_CPU_IO_MAP(z80net_io)
394439
395440   MDRV_MACHINE_START( z80net )
r5033r5034
408453   MDRV_SCREEN_VISIBLE_AREA(0, 319, 1, 239)
409454
410455   MDRV_DEFAULT_LAYOUT(layout_z80net)
411   //MDRV_WD179X_ADD("wd179x", z80ne_wd17xx_interface )
412456
413457MACHINE_DRIVER_END
414458
r5033r5034
440484   MDRV_DEFAULT_LAYOUT(layout_z80netb)
441485MACHINE_DRIVER_END
442486
487static MACHINE_DRIVER_START( z80netf )
488   /* basic machine hardware */
489   MDRV_CPU_ADD("z80ne", Z80, Z80NE_CPU_SPEED_HZ)
490   MDRV_CPU_PROGRAM_MAP(z80netf_mem)
491   MDRV_CPU_IO_MAP(z80netf_io)
492
493   MDRV_MACHINE_START(z80netf)
494   MDRV_MACHINE_RESET(z80netf)
495
496   MDRV_AY31015_ADD( "ay_3_1015", z80ne_ay31015_config )
497
498   MDRV_CASSETTE_ADD( "cassettea", z80ne_cassettea_config )
499   MDRV_CASSETTE_ADD( "cassetteb", z80ne_cassetteb_config )
500
501   MDRV_KR2376_ADD( "lx388_kr2376", lx388_kr2376_interface)
502
503   /* video hardware */
504   MDRV_SCREEN_ADD("lx388", RASTER)
505   MDRV_SCREEN_REFRESH_RATE(M6847_PAL_FRAMES_PER_SECOND)
506
507   MDRV_VIDEO_START(lx388)
508   MDRV_VIDEO_UPDATE(m6847)
509   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_RGB32)
510   MDRV_SCREEN_SIZE(320, 25+192+26)
511   MDRV_SCREEN_VISIBLE_AREA(0, 319, 1, 239)
512
513   MDRV_WD1771_ADD("wd1771", z80ne_wd17xx_interface)
514
515   MDRV_DEFAULT_LAYOUT(layout_z80netf)
516MACHINE_DRIVER_END
517
443518/******************************************************************************
444519 ROM Definitions
445520******************************************************************************/
446521
447522
448523ROM_START( z80ne )
449   ROM_REGION(0x10000, "z80ne", 0)
450   ROM_LOAD( "ep382.ic5", 0x8000, 0x0400, CRC(61bc5f39) SHA1(a93779a598736302a2fdd94be2fb0bbddea7a72c) )
524   ROM_REGION(0x20000, "z80ne", 0)
525   ROM_LOAD( "ep382.ic5", 0x14000, 0x0400, CRC(61bc5f39) SHA1(a93779a598736302a2fdd94be2fb0bbddea7a72c) )
451526ROM_END
452527
453528ROM_START( z80net )
454   ROM_REGION(0x10000, "z80ne", 0)
455   ROM_LOAD( "ep382.ic5", 0x8000, 0x0400, CRC(61bc5f39) SHA1(a93779a598736302a2fdd94be2fb0bbddea7a72c) )
529   ROM_REGION(0x20000, "z80ne", 0)
530   ROM_LOAD( "ep382.ic5", 0x14000, 0x0400, CRC(61bc5f39) SHA1(a93779a598736302a2fdd94be2fb0bbddea7a72c) )
456531ROM_END
457532
458533ROM_START( z80netb )
r5033r5034
470545   ROM_LOAD( "548-8.ic8", 0x3800, 0x0800, CRC(f381b594) SHA1(2de7a8941ba48d463974c73d62e994d3cbe2868d) )
471546ROM_END
472547
548ROM_START( z80netf )
549   ROM_REGION(0x20000, "z80ne", 0) /* 64k for code  64k for banked code */
550   /* ep548 banked at 0x0000 - 0x3FFF */
551   ROM_LOAD(  "548-1.ic1", 0x10000, 0x0800, CRC(868cad39) SHA1(0ea8af010786a080f823a879a4211f5712d260da) )
552   ROM_LOAD(  "548-2.ic2", 0x10800, 0x0800, CRC(ac297d99) SHA1(ccf31d3f9d02c3b68a0ee3be4984424df0e83ab0) )
553   ROM_LOAD(  "548-3.ic3", 0x11000, 0x0800, CRC(9c1fe511) SHA1(ff5b6e49a137c2ff9cb760c39bfd85ce4b52bb7d) )
554   ROM_LOAD(  "548-4.ic4", 0x11800, 0x0800, CRC(cb5e0de3) SHA1(0beaa8927faaf61f6c3fc0ea1d3d5670f901aae3) )
555   ROM_LOAD(  "548-5.ic5", 0x12000, 0x0800, CRC(0bd4559c) SHA1(e736a3124819ffb43e96a8114cd188f18d538053) )
556   ROM_LOAD(  "548-6.ic6", 0x12800, 0x0800, CRC(6d663034) SHA1(57588be4e360658dbb313946d7a608e36c1fdd68) )
557   ROM_LOAD(  "548-7.ic7", 0x13000, 0x0800, CRC(0bab06c0) SHA1(d52f1519c798e91f25648e996b1db174d90ce0f5) )
558   ROM_LOAD(  "548-8.ic8", 0x13800, 0x0800, CRC(f381b594) SHA1(2de7a8941ba48d463974c73d62e994d3cbe2868d) )
473559
560   /* ep382 - banked at 0x0000 - 0x03FF */
561   ROM_LOAD(  "ep382.ic5", 0x14000, 0x0400, CRC(61bc5f39) SHA1(a93779a598736302a2fdd94be2fb0bbddea7a72c) )
562
563   /* ep390 - banked at 0x0000 - 0x03FF */
564   ROM_LOAD(  "ep390.ic6", 0x14400, 0x0400, CRC(e4dd7de9) SHA1(523caa97112a9e67cc078c1a70ceee94ec232093) )
565   /* ep1390 - banked at 0x0000 - 0x03FF */
566   ROM_LOAD( "ep1390.ic6", 0x14800, 0x0400, CRC(dc2cbc1d) SHA1(e23418b8f8261a17892f3a73ec09c72bb02e1d0b) )
567   /* ep2390 - banked at 0x0000 - 0x03FF */
568   ROM_LOAD( "ep2390.ic6", 0x14C00, 0x0400, CRC(28d28eee) SHA1(b80f75c1ac4905ae369ecbc9b9ce120cc85502ed) )
569ROM_END
570
571
474572/******************************************************************************
475573 System Config
476574******************************************************************************/
r5033r5034
478576
479577static SYSTEM_CONFIG_START( z80ne )
480578   CONFIG_RAM_DEFAULT( 32 * 1024 )
481   CONFIG_RAM( 1 * 1024 )
482579SYSTEM_CONFIG_END
483580
484581static SYSTEM_CONFIG_START( z80net )
r5033r5034
492589SYSTEM_CONFIG_END
493590
494591
495/*    YEAR  NAME      PARENT    COMPAT  MACHINE   INPUT     INIT     CONFIG   COMPANY               FULLNAME                      FLAGS */
496COMP( 1980,   z80ne,    0,        0,      z80ne,    z80ne,    z80ne,   z80ne,   "Nuova Elettronica",   "Z80NE",                      GAME_NO_SOUND )
592static void z80netf_floppy_getinfo(const mess_device_class *devclass, UINT32 state, union devinfo *info)
593{
594   /* floppy */
595   switch(state)
596   {
597      /* --- the following bits of info are returned as 64-bit signed integers --- */
598      case MESS_DEVINFO_INT_COUNT:         info->i = 4; break;
599
600      /* --- the following bits of info are returned as pointers to data or functions --- */
601/*      case MESS_DEVINFO_PTR_LOAD:         info->load = DEVICE_IMAGE_LOAD_NAME(z80ne_floppy); break; */
602      /* --- the following bits of info are returned as pointers to data or functions --- */
603
604      case MESS_DEVINFO_PTR_FLOPPY_OPTIONS:   info->p = (void *) floppyoptions_z80ne; break;
605
606      case MESS_DEVINFO_STR_NAME+0:                  strcpy(info->s = device_temp_str(), "floppydisk0"); break;
607      case MESS_DEVINFO_STR_NAME+1:                  strcpy(info->s = device_temp_str(), "floppydisk1"); break;
608      case MESS_DEVINFO_STR_NAME+2:                  strcpy(info->s = device_temp_str(), "floppydisk2"); break;
609      case MESS_DEVINFO_STR_NAME+3:                  strcpy(info->s = device_temp_str(), "floppydisk3"); break;
610      case MESS_DEVINFO_STR_SHORT_NAME+0:               strcpy(info->s = device_temp_str(), "flop0"); break;
611      case MESS_DEVINFO_STR_SHORT_NAME+1:               strcpy(info->s = device_temp_str(), "flop1"); break;
612      case MESS_DEVINFO_STR_SHORT_NAME+2:               strcpy(info->s = device_temp_str(), "flop2"); break;
613      case MESS_DEVINFO_STR_SHORT_NAME+3:               strcpy(info->s = device_temp_str(), "flop3"); break;
614      case MESS_DEVINFO_STR_DESCRIPTION+0:               strcpy(info->s = device_temp_str(), "Floppy #0"); break;
615      case MESS_DEVINFO_STR_DESCRIPTION+1:               strcpy(info->s = device_temp_str(), "Floppy #1"); break;
616      case MESS_DEVINFO_STR_DESCRIPTION+2:               strcpy(info->s = device_temp_str(), "Floppy #2"); break;
617      case MESS_DEVINFO_STR_DESCRIPTION+3:               strcpy(info->s = device_temp_str(), "Floppy #3"); break;
618
619      /* --- the following bits of info are returned as NULL-terminated strings --- */
620      case MESS_DEVINFO_STR_FILE_EXTENSIONS:      strcpy(info->s = device_temp_str(), "zmk"); break;
621
622      default:               floppy_device_getinfo(devclass, state, info); break;
623   }
624}
625
626
627static SYSTEM_CONFIG_START( z80netf )
628   CONFIG_RAM_DEFAULT( 56 * 1024 )
629   CONFIG_DEVICE(z80netf_floppy_getinfo)
630SYSTEM_CONFIG_END
631
632/*    YEAR  NAME      PARENT    COMPAT  MACHINE   INPUT     INIT     CONFIG   COMPANY               FULLNAME                      FLAGS */
633COMP( 1980,   z80ne,    0,        0,      z80ne,    z80ne,    z80ne,   z80ne,   "Nuova Elettronica",   "Z80NE",                      GAME_NO_SOUND | GAME_COMPUTER)
497634COMP( 1980,   z80net,   z80ne,    0,      z80net,   z80net,   z80net,  z80net,  "Nuova Elettronica",   "Z80NE + LX.388",             GAME_NO_SOUND | GAME_COMPUTER)
498635COMP( 1980,   z80netb,  z80ne,    0,      z80netb,  z80net,   z80netb, z80netb, "Nuova Elettronica",   "Z80NE + LX.388 + Basic 16k", GAME_NO_SOUND | GAME_COMPUTER)
636COMP( 1980,   z80netf,  z80ne,    0,      z80netf,  z80netf,  z80netf, z80netf, "Nuova Elettronica",   "Z80NE + LX.388 + LX.390",    GAME_NO_SOUND | GAME_COMPUTER)
docs/messnew.txt
r5033r5034
44------------------------------------------------------
55- Canon Cat [Miodrag Milanovic]
66- MMD-1 [Miodrag Milanovic]
7- Nuova Elettronica Z80NE + LX.388 + LX.390  [Roberto Lavarone]
78
89Skeleton drivers :
910------------------
r5033r5034
4445- Added support for passing around 'deleted address mark' information
4546  to the floppy system. [Roberto Lavarone]
4647
48- Changes to the wd17xx implementation:
49  - Added support for head loaded feedback from floppy drive.
50  - Busy flag was cleared too early.
51  - Added support for the WD1771.  [Roberto Lavarone]
4752
53- Added natural keyboard support to KR2376.  [Roberto Lavarone]
4854
55
56
49570.132
5058
5159New System Drivers Supported (in no particular order):

Previous 15994 Revisions Next


© 1998-2018 The MESS Team