Previous 15994 Revisions Next

r7881 Wednesday 21st April, 2010 at 12:35:14 UTC by Curt Coder
[ATOM] Cleanup.
[src/mess/drivers]atom.c
[src/mess/formats]atom_tap.c atom_tap.h
[src/mess/includes]atom.h
[src/mess/machine]atom.c

src/mess/includes/atom.h
r7880r7881
1/*****************************************************************************
2 *
3 * includes/atom.h
4 *
5 ****************************************************************************/
1#pragma once
62
7#ifndef ATOM_H_
8#define ATOM_H_
3#ifndef __ATOM__
4#define __ATOM__
95
10#include "devices/snapquik.h"
11#include "machine/6522via.h"
12#include "machine/i8255a.h"
13#include "machine/i8271.h"
6#include "emu.h"
147
15/* Motherboard crystals
8#define SY6502_TAG      "ic22"
9#define INS8255_TAG      "ic25"
10#define MC6847_TAG      "ic31"
11#define R6522_TAG      "ic1"
12#define I8271_TAG      "ic13"
13#define SCREEN_TAG      "screen"
14#define CENTRONICS_TAG   "centronics"
15#define CASSETTE_TAG   "cassette"
16#define SPEAKER_TAG      "speaker"
1617
17Source: http://acorn.chriswhy.co.uk/docs/Acorn/Manuals/Acorn_AtomTechnicalManual.pdf
18
19*/
20
2118#define X1   XTAL_3_579545MHz   // MC6847 Clock
22#define X2   XTAL_4MHz      // CPU Clock - a divider reduces it to 1MHz
19#define X2   XTAL_4MHz         // CPU Clock - a divider reduces it to 1MHz
2320
24/*----------- defined in machine/atom.c -----------*/
21class atom_state
22{
23public:
24   static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, atom_state(machine)); }
2525
26extern UINT8 atom_8255_porta;
27extern UINT8 atom_8255_portc;
26   atom_state(running_machine &machine) { }
2827
29extern const i8255a_interface atom_8255_int;
30extern const via6522_interface atom_6522_interface;
31extern const i8271_interface atom_8271_interface;
28   /* eprom state */
29   int eprom;
3230
33MACHINE_START( atom );
34QUICKLOAD_LOAD( atom );
35READ8_DEVICE_HANDLER (atom_8255_porta_r);
36READ8_DEVICE_HANDLER (atom_8255_portb_r);
37READ8_DEVICE_HANDLER (atom_8255_portc_r);
38WRITE8_DEVICE_HANDLER (atom_8255_porta_w );
39WRITE8_DEVICE_HANDLER (atom_8255_portb_w );
40WRITE8_DEVICE_HANDLER (atom_8255_portc_w );
31   /* video state */
32   UINT8 *video_ram;
4133
42READ8_HANDLER(atom_eprom_box_r);
43WRITE8_HANDLER(atom_eprom_box_w);
44void atom_eprom_box_init(running_machine *machine);
34   /* keyboard state */
35   int keylatch;
4536
46MACHINE_START( atomeb );
37   /* cassette state */
38   int hz2400;
39   int pc0;
40   int pc1;
4741
48READ8_DEVICE_HANDLER( atom_mc6847_videoram_r );
49VIDEO_UPDATE( atom );
42   /* devices */
43   running_device *mc6847;
44   running_device *cassette;
45};
5046
51
52#endif /* ATOM_H_ */
47#endif
src/mess/machine/atom.c
r7880r7881
1/***********************************************************************
2
3    atom.c
4
5    Functions to emulate general aspects of the machine (RAM, ROM,
6    interrupts, I/O ports)
7
8    Many thanks to Kees van Oss for:
9    1.  Tape input/output circuit diagram. It describes in great detail how the 2.4 kHz
10        tone, 2.4 kHz tone enable, tape output and tape input are connected.
11    2.  The DOS rom for the Atom so I could complete the floppy disc emulation.
12    3.  Details of the eprom expansion board for the Atom.
13    4.  His demo programs which I used to test the driver.
14
15***********************************************************************/
16
17
18#include "emu.h"
19#include "machine/i8255a.h"
20#include "video/m6847.h"
21#include "machine/ctronics.h"
22#include "machine/i8271.h"
23#include "machine/6522via.h"
24#include "devices/flopdrv.h"
25#include "devices/cassette.h"
26#include "includes/atom.h"
27#include "sound/speaker.h"
28
29
30UINT8 atom_8255_porta;
31static UINT8 atom_8255_portb;
32UINT8 atom_8255_portc;
33
34
35/* I am not sure if this is correct, the atom appears to have a 2.4 kHz timer used for reading tapes?? */
36static int   timer_state = 0;
37
38static running_device *cassette_device_image(running_machine *machine)
39{
40   return devtag_get_device(machine, "cassette");
41}
42
43
44
45/***************************************************************************
46    PRINTER INTERFACE
47***************************************************************************/
48
49/* BUSY from the centronics interface is connected to PA7 of the via */
50static READ8_DEVICE_HANDLER( atom_printer_busy )
51{
52   return centronics_busy_r(device) << 7;
53}
54
55/* DATA lines 0 to 6 are connected to PA0 to PA6 of the via */
56static WRITE8_DEVICE_HANDLER( atom_printer_data )
57{
58   centronics_data_w(device, 0, data & 0x7f);
59}
60
61const via6522_interface atom_6522_interface =
62{
63   DEVCB_DEVICE_HANDLER("centronics", atom_printer_busy),
64   DEVCB_NULL,
65   DEVCB_NULL,
66   DEVCB_NULL,
67   DEVCB_NULL,
68   DEVCB_NULL,
69   DEVCB_DEVICE_HANDLER("centronics", atom_printer_data),
70   DEVCB_NULL,
71   DEVCB_NULL,
72   DEVCB_NULL,
73   /* the CA2 output is connected to the STROBE signal on the centronics */
74   DEVCB_DEVICE_LINE("centronics", centronics_strobe_w),
75   DEVCB_NULL,
76   DEVCB_CPU_INPUT_LINE("maincpu", 0)
77};
78
79
80
81I8255A_INTERFACE( atom_8255_int )
82{
83   DEVCB_HANDLER(atom_8255_porta_r),
84   DEVCB_HANDLER(atom_8255_portb_r),
85   DEVCB_HANDLER(atom_8255_portc_r),
86   DEVCB_HANDLER(atom_8255_porta_w),
87   DEVCB_HANDLER(atom_8255_portb_w),
88   DEVCB_DEVICE_HANDLER("speaker", atom_8255_portc_w),
89};
90
91static int previous_i8271_int_state = 0;
92
93static void atom_8271_interrupt_callback(running_device *device, int state)
94{
95   /* I'm assuming that the nmi is edge triggered */
96   /* a interrupt from the fdc will cause a change in line state, and
97    the nmi will be triggered, but when the state changes because the int
98    is cleared this will not cause another nmi */
99   /* I'll emulate it like this to be sure */
100
101   if (state!=previous_i8271_int_state)
102   {
103      if (state)
104      {
105         /* I'll pulse it because if I used hold-line I'm not sure
106            it would clear - to be checked */
107         cputag_set_input_line(device->machine, "maincpu", INPUT_LINE_NMI, PULSE_LINE);
108      }
109   }
110
111   previous_i8271_int_state = state;
112}
113
114const i8271_interface atom_8271_interface=
115{
116   atom_8271_interrupt_callback,
117   NULL,
118   {FLOPPY_0, FLOPPY_1}
119};
120
121/*
122                                                                  +--------+
123PC0,  Tape Output ------------------------------------------------|
124                                                                  |
125                                                  +---------|     | NAND   |------CAS OUT
126PC1, Enable 2400 Hz ------------------------------|         |     |        |
127                                  +------+        | NAND    |--B--|        |
128PC4, 2400 Hz ---------------+-----|  INV | ---A---|         |     +--------+
129                            |     +------+        +---------+
130                            |
131                            2400 Hz
132
133
134PC4      PC1 PC0     :   A     B  CAS OUT
135  0      0      0    :    1     1        1
136  0      0      1    :    1     1        0
137  0      1      0    :    1     0        1
138  0      1      1    :    1     0        1
139  1      0      0    :    0     1        1
140  1      0      1    :    0     1        0
141  1      1      0    :    0     1        1
142  1      1      1    :    0     1        0
143
144
145Here is a detail from the Atom circuit diagram about Tape Input:
146
147PC5, Cassette
148Input ----------------------------------------------------------------CAS IN
149*/
150static TIMER_CALLBACK(atom_timer_callback)
151{
152   /* change timer state */
153   timer_state^=1;
154
155   /* the 2.4 kHz signal is notted (A), and nand'ed with the 2.4kz enable, resulting
156    in B. The final cassette output is the result of tape output nand'ed with B */
157
158
159   {
160      unsigned char A;
161      unsigned char B;
162      unsigned char result;
163
164      /* 2.4 kHz signal - notted */
165      A = (~timer_state);
166      /* 2.4 kHz signal notted, and anded with 2.4 kHz enable */
167      B = (~(A & (atom_8255_portc>>1))) & 0x01;
168
169      result = (~(B & atom_8255_portc)) & 0x01;
170
171      /* tape output */
172      cassette_output(cassette_device_image(machine), (result & 0x01) ? -1.0 : +1.0);
173   }
174}
175
176MACHINE_START( atom )
177{
178   atom_8255_porta = 0xff;
179   atom_8255_portb = 0xff;
180   atom_8255_portc = 0xff;
181
182   timer_state = 0;
183   timer_pulse(machine, ATTOTIME_IN_HZ(2400*2), NULL, 0, atom_timer_callback);
184
185   /* this is temporary */
186   /* Kees van Oss mentions that address 8-b are used for the random number
187    generator. I don't know if this is hardware, or random data because the
188    ram chips are not cleared at start-up. So at this time, these numbers
189    are poked into the memory to simulate it. When I have more details I will fix it */
190   memory_region(machine, "maincpu")[0x08] = mame_rand(machine) & 0x0ff;
191   memory_region(machine, "maincpu")[0x09] = mame_rand(machine) & 0x0ff;
192   memory_region(machine, "maincpu")[0x0a] = mame_rand(machine) & 0x0ff;
193   memory_region(machine, "maincpu")[0x0b] = mame_rand(machine) & 0x0ff;
194}
195
196READ8_DEVICE_HANDLER (atom_8255_porta_r )
197{
198   /* logerror("8255: Read port a\n"); */
199   return (atom_8255_porta);
200}
201
202READ8_DEVICE_HANDLER ( atom_8255_portb_r )
203{
204   int row;
205   static const char *const keynames[] = {
206      "KEY0", "KEY1", "KEY2", "KEY3", "KEY4", "KEY5",
207      "KEY6", "KEY7", "KEY8", "KEY9", "KEY10", "KEY11"
208   };
209
210   row = atom_8255_porta & 0x0f;
211   /* logerror("8255: Read port b: %02X %02X\n", input_port_read(machine, port),
212                                    input_port_read(machine, "KEY10") & 0xc0); */
213   return ((input_port_read(device->machine, keynames[row]) & 0x3f) | (input_port_read(device->machine, "KEY10") & 0xc0));
214}
215
216READ8_DEVICE_HANDLER ( atom_8255_portc_r )
217{
218   running_device *mc6847 = devtag_get_device(device->machine, "mc6847");
219
220   atom_8255_portc &= 0x0f;
221
222   /* cassette input */
223   if (cassette_input(cassette_device_image(device->machine)) > 0.0)
224   {
225      atom_8255_portc |= (1<<5);
226   }
227
228   /* 2.4 kHz input */
229   if (timer_state)
230   {
231      atom_8255_portc |= (1<<4);
232   }
233
234   atom_8255_portc |= (input_port_read(device->machine, "KEY11") & 0x40);
235   atom_8255_portc |= mc6847_fs_r(mc6847) << 7;
236   /* logerror("8255: Read port c (%02X)\n",atom_8255.atom_8255_portc); */
237   return (atom_8255_portc);
238}
239
240/* Atom 6847 modes:
241
2420000xxxx    Text
2430001xxxx    64x64   4
2440011xxxx    128x64  2
2450101xxxx    128x64  4
2460111xxxx    128x96  2
2471001xxxx    128x96  4
2481011xxxx    128x192 2
2491101xxxx    128x192 4
2501111xxxx    256x192 2
251
252*/
253
254WRITE8_DEVICE_HANDLER( atom_8255_porta_w )
255{
256   running_device *mc6847 = devtag_get_device(device->machine, "mc6847");
257
258   mc6847_ag_w(mc6847, BIT(data, 4));
259   mc6847_gm0_w(mc6847, BIT(data, 5));
260   mc6847_gm1_w(mc6847, BIT(data, 6));
261   mc6847_gm2_w(mc6847, BIT(data, 7));
262
263   atom_8255_porta = data;
264}
265
266WRITE8_DEVICE_HANDLER ( atom_8255_portb_w )
267{
268   atom_8255_portb = data;
269}
270
271WRITE8_DEVICE_HANDLER(atom_8255_portc_w)
272{
273   running_device *mc6847 = devtag_get_device(device->machine, "mc6847");
274
275   speaker_level_w(device, BIT(data, 2));
276   mc6847_css_w(mc6847, BIT(data, 3));
277
278   atom_8255_portc = data;
279}
280
281
282/*********************************************/
283/* emulates a 16-slot eprom box for the Atom */
284static unsigned char selected_eprom = 0;
285
286static void atom_eprom_box_refresh(running_machine *machine)
287{
288    unsigned char *eprom_data;
289
290   /* get address of eprom data */
291   eprom_data = memory_region(machine, "maincpu") + 0x010000 + (selected_eprom<<12);
292   /* set bank address */
293   memory_set_bankptr(machine, "bank1", eprom_data);
294}
295
296void atom_eprom_box_init(running_machine *machine)
297{
298   /* set initial eprom */
299   selected_eprom = 0;
300   /* set memory handler */
301   /* init */
302   atom_eprom_box_refresh(machine);
303}
304
305/* write to eprom box, changes eprom selected */
306WRITE8_HANDLER(atom_eprom_box_w)
307{
308   selected_eprom = data & 0x0f;
309
310   atom_eprom_box_refresh(space->machine);
311}
312
313/* read from eprom box register, can this be done in the real hardware */
314READ8_HANDLER(atom_eprom_box_r)
315{
316   return selected_eprom;
317}
318
319MACHINE_START( atomeb )
320{
321   MACHINE_START_CALL(atom);
322   atom_eprom_box_init(machine);
323}
324
325
326/***************************************************************************
327    MC6847 VDP
328***************************************************************************/
329
330READ8_DEVICE_HANDLER( atom_mc6847_videoram_r )
331{
332   mc6847_as_w(device, BIT(device->machine->generic.videoram.u8[offset], 6));
333   mc6847_intext_w(device, BIT(device->machine->generic.videoram.u8[offset], 6));
334   mc6847_inv_w(device, BIT(device->machine->generic.videoram.u8[offset], 7));
335
336   return device->machine->generic.videoram.u8[offset];
337}
338
339VIDEO_UPDATE( atom )
340{
341   running_device *mc6847 = devtag_get_device(screen->machine, "mc6847");
342   return mc6847_update(mc6847, bitmap, cliprect);
343}
src/mess/formats/atom_tap.c
r7880r7881
22
33    formats/atom_tap.c
44
5    Cassette code for Acorn Atom tap files
5    Cassette code for Acorn Atom tap files (Kansas City Standard)
66
77*********************************************************************/
88
9/*
10
11   http://beebwiki.jonripley.com/Acorn_cassette_format#Atom
12
13   The Atom supports the System series format (as a 'nameless file') and its own format. The data consists of files separated
14   by carrier breaks and the appropriate leaders and trailers, and further subdivided into blocks separated by inter-block gaps.
15   An Atom block consists of the following sequence of bytes:
16
17      Four synchronisation bytes (&2A).
18      File name (one to thirteen characters).
19      One end of file name marker byte (&0D).
20      Block flag, one byte.
21      Block number, two bytes, high byte first.
22      Data block length ? 1, one byte.
23      Execution address, two bytes, high byte first.
24      Load address, two bytes, high byte first.
25      Data, 0 to 256 bytes.
26      Checksum, one byte.
27
28   The block flag is set as follows:
29
30      Bit 7 is set if this block is not the last block of a file.
31      Bit 6 is set if the block contains data. If clear then the 'data block length' field is invalid.
32      Bit 5 is set if this block is not the first block of a file.
33      Bits 4 to 0 are undefined. Normally their contents are:
34      in the first block, bits 15 to 11 of the end address (=1 + the last address saved in the file);
35      in subsequent blocks, bits 6 to 2 of the previous block flag.
36   
37   The checksum is a simple sum (modulo 256) of all bytes from the start of the filename to the end of the data.
38
39*/
40
941#include "emu.h"
1042#include "formats/atom_tap.h"
1143
r7880r7881
2052***************************************************************************/
2153
2254/*-------------------------------------------------
23    CassetteLegacyWaveFiller atom_legacy_fill_wave
55    CassetteModulation atom_tap_modulation
2456-------------------------------------------------*/
2557
26static const struct CassetteLegacyWaveFiller atom_legacy_fill_wave =
58static const struct CassetteModulation atom_tap_modulation =
2759{
28   NULL,               /* fill_wave */
29   -1,                  /* chunk_size */
30   0,                  /* chunk_samples */
31   NULL,               /* chunk_sample_calc */
32   22050,               /* sample_frequency */
33   0,                  /* header_samples */
34   0                  /* trailer_samples */
60   CASSETTE_MODULATION_SINEWAVE,
61   1200.0 - 300, 1200.0, 1200.0 + 300,
62   2400.0 - 600, 2400.0, 2400.0 + 600
3563};
3664
3765/*-------------------------------------------------
38    atom_cassette_identify - identify cassette
66    cassette_image_read_uint8 - read tape data
3967-------------------------------------------------*/
4068
41static casserr_t atom_cassette_identify( cassette_image *cassette, struct CassetteOptions *opts )
69static UINT8 cassette_image_read_uint8(cassette_image *cassette, UINT64 offset)
4270{
43   return cassette_legacy_identify( cassette, opts, &atom_legacy_fill_wave );
71   UINT8 data;
72   cassette_image_read(cassette, &data, offset, 1);
73   return data;
4474}
4575
4676/*-------------------------------------------------
47    atom_cassette_load - load cassette
77    atom_tap_identify - identify cassette
4878-------------------------------------------------*/
4979
50static casserr_t atom_cassette_load( cassette_image *cassette )
80static casserr_t atom_tap_identify(cassette_image *cassette, struct CassetteOptions *opts)
5181{
52   return cassette_legacy_construct( cassette, &atom_legacy_fill_wave );
82   return cassette_modulation_identify( cassette, &atom_tap_modulation, opts);
5383}
5484
5585/*-------------------------------------------------
86    atom_tap_load - load cassette
87-------------------------------------------------*/
88
89#define MODULATE(_value) \
90   for (int i = 0; i < (_value ? 8 : 4); i++) { \
91      err = cassette_put_modulated_data_bit(cassette, 0, time_index, _value, &atom_tap_modulation, &time_displacement);\
92      if (err) return err;\
93      time_index += time_displacement;\
94   }
95
96static casserr_t atom_tap_load(cassette_image *cassette)
97{
98   casserr_t err;
99   UINT64 image_size = cassette_image_size(cassette);
100   UINT64 image_pos = 0;
101   double time_index = 0.0;
102   double time_displacement;
103
104   while (image_pos < image_size)
105   {
106      UINT8 data = cassette_image_read_uint8(cassette, image_pos);
107
108      /* start bit */
109      MODULATE(0);
110
111      /* data bits */
112      for (int bit = 0; bit < 8; bit++)
113      {
114         MODULATE(BIT(data, bit));
115      }
116
117      /* stop bits */
118      MODULATE(1);
119      MODULATE(1);
120
121      image_pos++;
122   }
123
124   return CASSETTE_ERROR_SUCCESS;
125}
126
127/*-------------------------------------------------
56128    CassetteFormat atom_tap_cassette_format
57129-------------------------------------------------*/
58130
59static const struct CassetteFormat atom_tap_cassette_format =
131const struct CassetteFormat atom_tap_format =
60132{
61133   "tap",
62   atom_cassette_identify,
63   atom_cassette_load,
134   atom_tap_identify,
135   atom_tap_load,
64136   NULL
65137};
66
67/*-------------------------------------------------
68    CASSETTE_FORMATLIST( atom_cassette_formats )
69-------------------------------------------------*/
70
71CASSETTE_FORMATLIST_START( atom_cassette_formats )
72   CASSETTE_FORMAT(atom_tap_cassette_format)
73CASSETTE_FORMATLIST_END
src/mess/formats/atom_tap.h
r7880r7881
1313
1414#include "formats/cassimg.h"
1515
16CASSETTE_FORMATLIST_EXTERN( atom_cassette_formats );
16extern const struct CassetteFormat atom_tap_format;
1717
1818#endif
src/mess/drivers/atom.c
r7880r7881
5454    The atom driver in MESS uses the original memory area.
5555
5656
57   http://www.xs4all.nl/~fjkraan/comp/atom/index.html
5758
5859***************************************************************************/
5960
60/* Core includes */
61/*
62
63   TODO:
64
65   - ERROR repeats ad infinitum
66   - break key
67   - ram expansion
68   - tap files
69   - mouse
70   - move eprom box roms to software list
71   - add 16 cartslots for eprom box
72
73*/
74
6175#include "emu.h"
76#include "includes/atom.h"
6277#include "cpu/m6502/m6502.h"
63
64/* Components */
65#include "machine/ctronics.h"
66#include "machine/i8271.h"
67#include "machine/i8255a.h"
68#include "machine/6522via.h"
69#include "video/m6847.h"
70
71/* Devices */
78#include "devices/cassette.h"
7279#include "devices/flopdrv.h"
80#include "devices/messram.h"
81#include "devices/snapquik.h"
7382#include "formats/atom_atm.h"
7483#include "formats/atom_tap.h"
7584#include "formats/basicdsk.h"
76#include "devices/cassette.h"
77#include "devices/snapquik.h"
85#include "formats/uef_cas.h"
86#include "machine/ctronics.h"
87#include "machine/6522via.h"
88#include "machine/i8255a.h"
89#include "machine/i8271.h"
7890#include "sound/speaker.h"
91#include "video/m6847.h"
7992
80#include "includes/atom.h"
93/***************************************************************************
94    READ/WRITE HANDLERS
95***************************************************************************/
8196
97/*-------------------------------------------------
98    bankswitch - EPROM bankswitch
99-------------------------------------------------*/
82100
83/* functions */
101static void bankswitch(running_machine *machine)
102{
103   atom_state *state = (atom_state *)machine->driver_data;
104   const address_space *program = cputag_get_address_space(machine, SY6502_TAG, ADDRESS_SPACE_PROGRAM);
84105
85/* port i/o functions */
106   UINT8 *eprom = memory_region(machine, "eprom") + (state->eprom << 12);
86107
87/* memory w/r functions */
108   memory_install_rom(program, 0xa000, 0xafff, 0, 0, eprom);
109}
88110
111/*-------------------------------------------------
112     eprom_r - EPROM slot select read
113-------------------------------------------------*/
114
115static READ8_HANDLER( eprom_r )
116{
117   atom_state *state = (atom_state *)space->machine->driver_data;
118
119   return state->eprom;
120}
121
122/*-------------------------------------------------
123     eprom_w - EPROM slot select write
124-------------------------------------------------*/
125
126static WRITE8_HANDLER( eprom_w )
127{
128   atom_state *state = (atom_state *)space->machine->driver_data;
129
130   state->eprom = data & 0x0f;
131
132   bankswitch(space->machine);
133}
134
135/***************************************************************************
136    MEMORY MAPS
137***************************************************************************/
138
139/*-------------------------------------------------
140    ADDRESS_MAP( atom_mem )
141-------------------------------------------------*/
142
89143static ADDRESS_MAP_START( atom_mem, ADDRESS_SPACE_PROGRAM, 8 )
90144   AM_RANGE(0x0000, 0x09ff) AM_RAM
91   AM_RANGE(0x0a00, 0x0a03) AM_DEVREADWRITE("i8271", i8271_r, i8271_w)
92   AM_RANGE(0x0a04, 0x0a04) AM_DEVREADWRITE("i8271", i8271_data_r, i8271_data_w)
145   AM_RANGE(0x0a00, 0x0a03) AM_DEVREADWRITE(I8271_TAG, i8271_r, i8271_w)
146   AM_RANGE(0x0a04, 0x0a04) AM_DEVREADWRITE(I8271_TAG, i8271_data_r, i8271_data_w)
93147   AM_RANGE(0x0a05, 0x7fff) AM_RAM
94   AM_RANGE(0x8000, 0x97ff) AM_RAM AM_BASE_GENERIC(videoram) /* VDG 6847 */
148   AM_RANGE(0x8000, 0x97ff) AM_RAM AM_BASE_MEMBER(atom_state, video_ram)
95149   AM_RANGE(0x9800, 0x9fff) AM_RAM
96   AM_RANGE(0xb000, 0xb003) AM_DEVREADWRITE("ppi8255", i8255a_r, i8255a_w)
97   AM_RANGE(0xb800, 0xbbff) AM_DEVREADWRITE("via6522_0", via_r, via_w)
98   AM_RANGE(0xc000, 0xcfff) AM_ROM
99   AM_RANGE(0xd000, 0xdfff) AM_ROM
100   AM_RANGE(0xe000, 0xefff) AM_ROM
101   AM_RANGE(0xf000, 0xffff) AM_ROM
150   AM_RANGE(0xb000, 0xb003) AM_DEVREADWRITE(INS8255_TAG, i8255a_r, i8255a_w)
151   AM_RANGE(0xb800, 0xbbff) AM_DEVREADWRITE(R6522_TAG, via_r, via_w)
152   AM_RANGE(0xc000, 0xffff) AM_ROM AM_REGION(SY6502_TAG, 0)
102153ADDRESS_MAP_END
103154
155/*-------------------------------------------------
156    ADDRESS_MAP( atomeb_mem )
157-------------------------------------------------*/
104158
105159static ADDRESS_MAP_START( atomeb_mem, ADDRESS_SPACE_PROGRAM, 8 )
106   AM_RANGE(0x0000, 0x09ff) AM_RAM
107   AM_RANGE(0x0a00, 0x0a03) AM_DEVREADWRITE("i8271", i8271_r, i8271_w)
108   AM_RANGE(0x0a04, 0x0a04) AM_DEVREADWRITE("i8271", i8271_data_r, i8271_data_w)
109   AM_RANGE(0x0a05, 0x7fff) AM_RAM
110   AM_RANGE(0x8000, 0x97ff) AM_RAM AM_BASE_SIZE_GENERIC(videoram) /* VDG 6847 */
111   AM_RANGE(0x9800, 0x9fff) AM_RAM
112   AM_RANGE(0xa000, 0xafff) AM_READ_BANK("bank1")   /* eprom data from eprom box */
113   AM_RANGE(0xb000, 0xb003) AM_DEVREADWRITE("ppi8255", i8255a_r, i8255a_w)
114   AM_RANGE(0xb800, 0xbbff) AM_DEVREADWRITE("via6522_0", via_r, via_w)
115   AM_RANGE(0xbfff, 0xbfff) AM_READWRITE(atom_eprom_box_r, atom_eprom_box_w)
116   AM_RANGE(0xc000, 0xcfff) AM_ROM
117   AM_RANGE(0xd000, 0xdfff) AM_ROM
118   AM_RANGE(0xe000, 0xefff) AM_ROM
119   AM_RANGE(0xf000, 0xffff) AM_ROM
160   AM_IMPORT_FROM(atom_mem)
161   AM_RANGE(0xbfff, 0xbfff) AM_READWRITE(eprom_r, eprom_w)
120162ADDRESS_MAP_END
121163
164/***************************************************************************
165    INPUT PORTS
166***************************************************************************/
122167
123/* graphics output */
168/*-------------------------------------------------
169    INPUT_CHANGED( trigger_nmi )
170-------------------------------------------------*/
124171
125/* keyboard input */
172static INPUT_CHANGED( trigger_nmi )
173{
174   cputag_set_input_line(field->port->machine, SY6502_TAG, INPUT_LINE_NMI, newval ? CLEAR_LINE : ASSERT_LINE);
175}
126176
127/* Not implemented: BREAK */
177/*-------------------------------------------------
178    INPUT_PORTS( atom )
179-------------------------------------------------*/
128180
129181static INPUT_PORTS_START( atom )
130182   PORT_START("KEY0")
131   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED)
132   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD)                           PORT_CODE(KEYCODE_3)          PORT_CHAR('3') PORT_CHAR('#')
133   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD)                           PORT_CODE(KEYCODE_MINUS)      PORT_CHAR('-') PORT_CHAR('=')
134   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD)                           PORT_CODE(KEYCODE_G)          PORT_CHAR('g') PORT_CHAR('G')
135   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD)                           PORT_CODE(KEYCODE_Q)          PORT_CHAR('q') PORT_CHAR('Q')
136   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Esc")          PORT_CODE(KEYCODE_TILDE)      PORT_CHAR(27)
137   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED)
138   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED)
183   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED )
184   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD )                           PORT_CODE(KEYCODE_3)          PORT_CHAR('3') PORT_CHAR('#')
185   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD )                           PORT_CODE(KEYCODE_MINUS)      PORT_CHAR('-') PORT_CHAR('=')
186   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD )                           PORT_CODE(KEYCODE_G)          PORT_CHAR('g') PORT_CHAR('G')
187   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD )                           PORT_CODE(KEYCODE_Q)          PORT_CHAR('q') PORT_CHAR('Q')
188   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("ESC")          PORT_CODE(KEYCODE_TILDE)      PORT_CHAR(27)
189   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED )
190   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED )
139191
140192   PORT_START("KEY1")
141   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED)
142   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD)                           PORT_CODE(KEYCODE_2)          PORT_CHAR('2') PORT_CHAR('\"')
143   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD)                           PORT_CODE(KEYCODE_COMMA)      PORT_CHAR(',') PORT_CHAR('<')
144   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD)                           PORT_CODE(KEYCODE_F)          PORT_CHAR('f') PORT_CHAR('F')
145   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD)                           PORT_CODE(KEYCODE_P)          PORT_CHAR('p') PORT_CHAR('P')
146   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD)                           PORT_CODE(KEYCODE_Z)          PORT_CHAR('z') PORT_CHAR('Z')
147   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED)
148   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED)
193   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED )
194   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD )                           PORT_CODE(KEYCODE_2)          PORT_CHAR('2') PORT_CHAR('\"')
195   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD )                           PORT_CODE(KEYCODE_COMMA)      PORT_CHAR(',') PORT_CHAR('<')
196   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD )                           PORT_CODE(KEYCODE_F)          PORT_CHAR('f') PORT_CHAR('F')
197   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD )                           PORT_CODE(KEYCODE_P)          PORT_CHAR('p') PORT_CHAR('P')
198   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD )                           PORT_CODE(KEYCODE_Z)          PORT_CHAR('z') PORT_CHAR('Z')
199   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED )
200   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED )
149201
150202   PORT_START("KEY2")
151   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("\xE2\x87\x95") PORT_CODE(KEYCODE_UP)         PORT_CHAR(UCHAR_MAMEKEY(UP)) PORT_CHAR(UCHAR_MAMEKEY(DOWN))
152   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD)                           PORT_CODE(KEYCODE_1)          PORT_CHAR('1') PORT_CHAR('!')
153   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD)                           PORT_CODE(KEYCODE_COLON)      PORT_CHAR(';') PORT_CHAR('+')
154   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD)                           PORT_CODE(KEYCODE_E)          PORT_CHAR('e') PORT_CHAR('E')
155   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD)                           PORT_CODE(KEYCODE_O)          PORT_CHAR('o') PORT_CHAR('O')
156   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD)                           PORT_CODE(KEYCODE_Y)          PORT_CHAR('y') PORT_CHAR('Y')
157   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED)
158   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED)
203   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("\xE2\x87\x95") PORT_CODE(KEYCODE_UP)         PORT_CHAR(UCHAR_MAMEKEY(UP)) PORT_CHAR(UCHAR_MAMEKEY(DOWN))
204   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD )                           PORT_CODE(KEYCODE_1)          PORT_CHAR('1') PORT_CHAR('!')
205   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD )                           PORT_CODE(KEYCODE_COLON)      PORT_CHAR(';') PORT_CHAR('+')
206   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD )                           PORT_CODE(KEYCODE_E)          PORT_CHAR('e') PORT_CHAR('E')
207   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD )                           PORT_CODE(KEYCODE_O)          PORT_CHAR('o') PORT_CHAR('O')
208   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD )                           PORT_CODE(KEYCODE_Y)          PORT_CHAR('y') PORT_CHAR('Y')
209   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED )
210   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED )
159211
160212   PORT_START("KEY3")
161   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("\xE2\x87\x94") PORT_CODE(KEYCODE_RIGHT)      PORT_CHAR(UCHAR_MAMEKEY(RIGHT)) PORT_CHAR(UCHAR_MAMEKEY(LEFT))
162   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD)                           PORT_CODE(KEYCODE_0)          PORT_CHAR('0')
163   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD)                           PORT_CODE(KEYCODE_EQUALS)     PORT_CHAR(':') PORT_CHAR('*')
164   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD)                           PORT_CODE(KEYCODE_D)          PORT_CHAR('d') PORT_CHAR('D')
165   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD)                           PORT_CODE(KEYCODE_N)          PORT_CHAR('n') PORT_CHAR('N')
166   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD)                           PORT_CODE(KEYCODE_X)          PORT_CHAR('x') PORT_CHAR('X')
167   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED)
168   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED)
213   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("\xE2\x87\x94") PORT_CODE(KEYCODE_RIGHT)      PORT_CHAR(UCHAR_MAMEKEY(RIGHT)) PORT_CHAR(UCHAR_MAMEKEY(LEFT))
214   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD )                           PORT_CODE(KEYCODE_0)          PORT_CHAR('0')
215   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD )                           PORT_CODE(KEYCODE_EQUALS)     PORT_CHAR(':') PORT_CHAR('*')
216   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD )                           PORT_CODE(KEYCODE_D)          PORT_CHAR('d') PORT_CHAR('D')
217   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD )                           PORT_CODE(KEYCODE_N)          PORT_CHAR('n') PORT_CHAR('N')
218   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD )                           PORT_CODE(KEYCODE_X)          PORT_CHAR('x') PORT_CHAR('X')
219   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED )
220   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED )
169221
170222   PORT_START("KEY4")
171   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Lock")         PORT_CODE(KEYCODE_LCONTROL)   PORT_CHAR(UCHAR_MAMEKEY(CAPSLOCK)) PORT_TOGGLE
172   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Delete")       PORT_CODE(KEYCODE_DEL)        PORT_CHAR(8)
173   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD)                           PORT_CODE(KEYCODE_9)          PORT_CHAR('9') PORT_CHAR(')')
174   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD)                           PORT_CODE(KEYCODE_C)          PORT_CHAR('c') PORT_CHAR('C')
175   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD)                           PORT_CODE(KEYCODE_M)          PORT_CHAR('m') PORT_CHAR('M')
176   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD)                           PORT_CODE(KEYCODE_W)          PORT_CHAR('w') PORT_CHAR('W')
177   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED)
178   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED)
223   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("LOCK")         PORT_CODE(KEYCODE_LCONTROL)   PORT_CHAR(UCHAR_MAMEKEY(CAPSLOCK)) PORT_TOGGLE
224   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("DEL")          PORT_CODE(KEYCODE_DEL)        PORT_CHAR(8)
225   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD )                           PORT_CODE(KEYCODE_9)          PORT_CHAR('9') PORT_CHAR(')')
226   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD )                           PORT_CODE(KEYCODE_C)          PORT_CHAR('c') PORT_CHAR('C')
227   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD )                           PORT_CODE(KEYCODE_M)          PORT_CHAR('m') PORT_CHAR('M')
228   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD )                           PORT_CODE(KEYCODE_W)          PORT_CHAR('w') PORT_CHAR('W')
229   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED )
230   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED )
179231
180232   PORT_START("KEY5")
181   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("\xE2\x86\x91") PORT_CODE(KEYCODE_BACKSPACE)  PORT_CHAR('^')
182   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Copy")         PORT_CODE(KEYCODE_TAB)        PORT_CHAR(UCHAR_MAMEKEY(TAB))
183   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD)                           PORT_CODE(KEYCODE_8)          PORT_CHAR('8') PORT_CHAR('(')
184   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD)                           PORT_CODE(KEYCODE_B)          PORT_CHAR('b') PORT_CHAR('B')
185   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD)                           PORT_CODE(KEYCODE_L)          PORT_CHAR('l') PORT_CHAR('L')
186   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD)                           PORT_CODE(KEYCODE_V)          PORT_CHAR('v') PORT_CHAR('V')
187   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED)
188   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED)
233   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("\xE2\x86\x91") PORT_CODE(KEYCODE_BACKSPACE)  PORT_CHAR('^')
234   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("COPY")         PORT_CODE(KEYCODE_TAB)        PORT_CHAR(UCHAR_MAMEKEY(TAB))
235   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD )                           PORT_CODE(KEYCODE_8)          PORT_CHAR('8') PORT_CHAR('(')
236   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD )                           PORT_CODE(KEYCODE_B)          PORT_CHAR('b') PORT_CHAR('B')
237   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD )                           PORT_CODE(KEYCODE_L)          PORT_CHAR('l') PORT_CHAR('L')
238   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD )                           PORT_CODE(KEYCODE_V)          PORT_CHAR('v') PORT_CHAR('V')
239   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED )
240   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED )
189241
190242   PORT_START("KEY6")
191   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD)                           PORT_CODE(KEYCODE_BACKSLASH)  PORT_CHAR(']')
192   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Return")       PORT_CODE(KEYCODE_ENTER)      PORT_CHAR(13)
193   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD)                           PORT_CODE(KEYCODE_7)          PORT_CHAR('7') PORT_CHAR('\'')
194   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD)                           PORT_CODE(KEYCODE_A)          PORT_CHAR('a') PORT_CHAR('A')
195   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD)                           PORT_CODE(KEYCODE_K)          PORT_CHAR('k') PORT_CHAR('K')
196   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD)                           PORT_CODE(KEYCODE_U)          PORT_CHAR('u') PORT_CHAR('U')
197   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED)
198   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED)
243   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD )                           PORT_CODE(KEYCODE_BACKSLASH)  PORT_CHAR(']')
244   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("RTN")          PORT_CODE(KEYCODE_ENTER)      PORT_CHAR(13)
245   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD )                           PORT_CODE(KEYCODE_7)          PORT_CHAR('7') PORT_CHAR('\'')
246   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD )                           PORT_CODE(KEYCODE_A)          PORT_CHAR('a') PORT_CHAR('A')
247   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD )                           PORT_CODE(KEYCODE_K)          PORT_CHAR('k') PORT_CHAR('K')
248   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD )                           PORT_CODE(KEYCODE_U)          PORT_CHAR('u') PORT_CHAR('U')
249   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED )
250   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED )
199251
200252   PORT_START("KEY7")
201   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD)                           PORT_CODE(KEYCODE_CLOSEBRACE) PORT_CHAR('\\')
202   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED)
203   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD)                           PORT_CODE(KEYCODE_6)          PORT_CHAR('6') PORT_CHAR('&')
204   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD)                           PORT_CODE(KEYCODE_OPENBRACE)  PORT_CHAR('@')
205   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD)                           PORT_CODE(KEYCODE_J)          PORT_CHAR('j') PORT_CHAR('J')
206   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD)                           PORT_CODE(KEYCODE_T)          PORT_CHAR('t') PORT_CHAR('T')
207   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED)
208   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED)
253   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD )                           PORT_CODE(KEYCODE_CLOSEBRACE) PORT_CHAR('\\')
254   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED )
255   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD )                           PORT_CODE(KEYCODE_6)          PORT_CHAR('6') PORT_CHAR('&')
256   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD )                           PORT_CODE(KEYCODE_OPENBRACE)  PORT_CHAR('@')
257   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD )                           PORT_CODE(KEYCODE_J)          PORT_CHAR('j') PORT_CHAR('J')
258   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD )                           PORT_CODE(KEYCODE_T)          PORT_CHAR('t') PORT_CHAR('T')
259   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED )
260   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED )
209261
210262   PORT_START("KEY8")
211   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD)                           PORT_CODE(KEYCODE_QUOTE)      PORT_CHAR('[')
212   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED)
213   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD)                           PORT_CODE(KEYCODE_5)          PORT_CHAR('5') PORT_CHAR('%')
214   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD)                           PORT_CODE(KEYCODE_SLASH)      PORT_CHAR('/') PORT_CHAR('?')
215   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD)                           PORT_CODE(KEYCODE_I)          PORT_CHAR('i') PORT_CHAR('I')
216   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD)                           PORT_CODE(KEYCODE_S)          PORT_CHAR('s') PORT_CHAR('S')
217   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED)
218   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED)
263   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD )                           PORT_CODE(KEYCODE_QUOTE)      PORT_CHAR('[')
264   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED )
265   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD )                           PORT_CODE(KEYCODE_5)          PORT_CHAR('5') PORT_CHAR('%')
266   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD )                           PORT_CODE(KEYCODE_SLASH)      PORT_CHAR('/') PORT_CHAR('?')
267   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD )                           PORT_CODE(KEYCODE_I)          PORT_CHAR('i') PORT_CHAR('I')
268   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD )                           PORT_CODE(KEYCODE_S)          PORT_CHAR('s') PORT_CHAR('S')
269   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED )
270   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED )
219271
220272   PORT_START("KEY9")
221   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Space")        PORT_CODE(KEYCODE_SPACE)      PORT_CHAR(32)
222   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED)
223   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD)                           PORT_CODE(KEYCODE_4)          PORT_CHAR('4') PORT_CHAR('$')
224   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD)                           PORT_CODE(KEYCODE_STOP)       PORT_CHAR('.') PORT_CHAR('>')
225   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD)                           PORT_CODE(KEYCODE_H)          PORT_CHAR('h') PORT_CHAR('H')
226   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD)                           PORT_CODE(KEYCODE_R)          PORT_CHAR('r') PORT_CHAR('R')
227   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED)
228   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED)
273   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("SPACE")        PORT_CODE(KEYCODE_SPACE)      PORT_CHAR(32)
274   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED )
275   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD )                           PORT_CODE(KEYCODE_4)          PORT_CHAR('4') PORT_CHAR('$')
276   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD )                           PORT_CODE(KEYCODE_STOP)       PORT_CHAR('.') PORT_CHAR('>')
277   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD )                           PORT_CODE(KEYCODE_H)          PORT_CHAR('h') PORT_CHAR('H')
278   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD )                           PORT_CODE(KEYCODE_R)          PORT_CHAR('r') PORT_CHAR('R')
279   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED )
280   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED )
229281
230   PORT_START("KEY10") /* CTRL & SHIFT */
231   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED)
232   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED)
233   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED)
234   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED)
235   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED)
236   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED)
237   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Ctrl")         PORT_CODE(KEYCODE_CAPSLOCK)   PORT_CHAR(UCHAR_MAMEKEY(LCONTROL))
238   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Shift")        PORT_CODE(KEYCODE_LSHIFT) PORT_CODE(KEYCODE_RSHIFT)     PORT_CHAR(UCHAR_SHIFT_1)
282   PORT_START("KEY10")
283   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED )
284   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED )
285   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED )
286   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED )
287   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED )
288   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED )
289   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("CTRL")         PORT_CODE(KEYCODE_CAPSLOCK)   PORT_CHAR(UCHAR_MAMEKEY(LCONTROL))
290   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("SFT")          PORT_CODE(KEYCODE_LSHIFT) PORT_CODE(KEYCODE_RSHIFT)     PORT_CHAR(UCHAR_SHIFT_1)
239291
240   PORT_START("KEY11") /* REPT key */
241   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED)
242   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED)
243   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED)
244   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED)
245   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED)
246   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED)
247   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Rept")         PORT_CODE(KEYCODE_RCONTROL)   PORT_CHAR(UCHAR_MAMEKEY(RCONTROL))
248   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED)
292   PORT_START("RPT")
293   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("REPT")         PORT_CODE(KEYCODE_RCONTROL)   PORT_CHAR(UCHAR_MAMEKEY(RCONTROL))
294
295   PORT_START("BRK")
296   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("BRK")          PORT_CODE(KEYCODE_ESC)   PORT_CHAR(UCHAR_MAMEKEY(ESC)) PORT_CHANGED(trigger_nmi, 0)
249297INPUT_PORTS_END
250298
299/***************************************************************************
300    VIDEO
301***************************************************************************/
251302
252/* centronics interface */
303/*-------------------------------------------------
304    VIDEO_UPDATE( atom )
305-------------------------------------------------*/
306
307static VIDEO_UPDATE( atom )
308{
309   atom_state *state = (atom_state *)screen->machine->driver_data;
310
311   return mc6847_update(state->mc6847, bitmap, cliprect);
312}
313
314/***************************************************************************
315    DEVICE CONFIGURATION
316***************************************************************************/
317
318/*-------------------------------------------------
319    I8255A_INTERFACE( ppi_intf )
320-------------------------------------------------*/
321
322static WRITE8_DEVICE_HANDLER( ppi_pa_w )
323{
324   /*
325
326      bit      description
327
328      0      keyboard column 0
329      1      keyboard column 1
330      2      keyboard column 2
331      3      keyboard column 3
332      4      MC6847 A/G
333      5      MC6847 GM0
334      6      MC6847 GM1
335      7      MC6847 GM2
336
337   */
338
339   atom_state *state = (atom_state *)device->machine->driver_data;
340
341   /* keyboard column */
342   state->keylatch = data & 0x0f;
343
344   /* MC6847 */
345   mc6847_ag_w(state->mc6847, BIT(data, 4));
346   mc6847_gm0_w(state->mc6847, BIT(data, 5));
347   mc6847_gm1_w(state->mc6847, BIT(data, 6));
348   mc6847_gm2_w(state->mc6847, BIT(data, 7));
349}
350
351static READ8_DEVICE_HANDLER( ppi_pb_r )
352{
353   /*
354
355      bit      description
356
357      0      keyboard row 0
358      1      keyboard row 1
359      2      keyboard row 2
360      3      keyboard row 3
361      4      keyboard row 4
362      5      keyboard row 5
363      6      keyboard CTRL
364      7      keyboard SFT
365
366   */
367
368   atom_state *state = (atom_state *)device->machine->driver_data;
369   UINT8 data = 0xff;
370
371   switch (state->keylatch)
372   {
373   case 0: data &= input_port_read(device->machine, "KEY0"); break;
374   case 1: data &= input_port_read(device->machine, "KEY1"); break;
375   case 2: data &= input_port_read(device->machine, "KEY2"); break;
376   case 3: data &= input_port_read(device->machine, "KEY3"); break;
377   case 4: data &= input_port_read(device->machine, "KEY4"); break;
378   case 5: data &= input_port_read(device->machine, "KEY5"); break;
379   case 6: data &= input_port_read(device->machine, "KEY6"); break;
380   case 7: data &= input_port_read(device->machine, "KEY7"); break;
381   case 8: data &= input_port_read(device->machine, "KEY8"); break;
382   case 9: data &= input_port_read(device->machine, "KEY9"); break;
383   }
384
385   data &= input_port_read(device->machine, "KEY10");
386
387   return data;
388}
389
390static READ8_DEVICE_HANDLER( ppi_pc_r )
391{
392   /*
393
394      bit      description
395
396      0      O/P 1, cassette output 0
397      1      O/P 2, cassette output 1
398      2      O/P 3, speaker output
399      3      O/P 4, MC6847 CSS
400      4      2400 Hz input
401      5      cassette input
402      6      keyboard RPT
403      7      MC6847 FS
404
405   */
406
407   atom_state *state = (atom_state *)device->machine->driver_data;
408
409   UINT8 data = 0;
410
411   /* 2400 Hz input */
412   data |= state->hz2400 << 4;
413
414   /* cassette input */
415logerror("cassin %f\n", cassette_input(state->cassette));
416   data |= (cassette_input(state->cassette) > 0.0) << 5;
417
418   /* keyboard RPT */
419   data |= BIT(input_port_read(device->machine, "RPT"), 0) << 6;
420
421   /* MC6847 FS */
422   data |= mc6847_fs_r(state->mc6847) << 7;
423
424   return data;
425}
426
427static WRITE8_DEVICE_HANDLER( ppi_pc_w )
428{
429   /*
430
431      bit      description
432
433      0      O/P 1, cassette output 0
434      1      O/P 2, cassette output 1
435      2      O/P 3, speaker output
436      3      O/P 4, MC6847 CSS
437      4      2400 Hz input
438      5      cassette input
439      6      keyboard RPT
440      7      MC6847 FS
441
442   */
443
444   atom_state *state = (atom_state *)device->machine->driver_data;
445
446   /* cassette output */
447   state->pc0 = BIT(data, 0);
448   state->pc1 = BIT(data, 1);
449
450   /* speaker output */
451   speaker_level_w(device, BIT(data, 2));
452
453   /* MC6847 CSS */
454   mc6847_css_w(state->mc6847, BIT(data, 3));
455}
456
457static I8255A_INTERFACE( ppi_intf )
458{
459   DEVCB_NULL,
460   DEVCB_HANDLER(ppi_pb_r),
461   DEVCB_HANDLER(ppi_pc_r),
462   DEVCB_HANDLER(ppi_pa_w),
463   DEVCB_NULL,
464   DEVCB_DEVICE_HANDLER(SPEAKER_TAG, ppi_pc_w)
465};
466
467/*-------------------------------------------------
468    via6522_interface via_intf
469-------------------------------------------------*/
470
471static READ8_DEVICE_HANDLER( atom_printer_busy )
472{
473   return centronics_busy_r(device) << 7;
474}
475
476static WRITE8_DEVICE_HANDLER( atom_printer_data )
477{
478   centronics_data_w(device, 0, data & 0x7f);
479}
480
481static const via6522_interface via_intf =
482{
483   DEVCB_DEVICE_HANDLER(CENTRONICS_TAG, atom_printer_busy),
484   DEVCB_NULL,
485   DEVCB_NULL,
486   DEVCB_NULL,
487   DEVCB_NULL,
488   DEVCB_NULL,
489   DEVCB_DEVICE_HANDLER(CENTRONICS_TAG, atom_printer_data),
490   DEVCB_NULL,
491   DEVCB_NULL,
492   DEVCB_NULL,
493   DEVCB_DEVICE_LINE(CENTRONICS_TAG, centronics_strobe_w),
494   DEVCB_NULL,
495   DEVCB_CPU_INPUT_LINE(SY6502_TAG, INPUT_LINE_IRQ0)
496};
497
498/*-------------------------------------------------
499    i8271_interface fdc_intf
500-------------------------------------------------*/
501
502static int previous_i8271_int_state = 0;
503
504static void atom_8271_interrupt_callback(running_device *device, int state)
505{
506   /* I'm assuming that the nmi is edge triggered */
507   /* a interrupt from the fdc will cause a change in line state, and
508    the nmi will be triggered, but when the state changes because the int
509    is cleared this will not cause another nmi */
510   /* I'll emulate it like this to be sure */
511
512   if (state!=previous_i8271_int_state)
513   {
514      if (state)
515      {
516         /* I'll pulse it because if I used hold-line I'm not sure
517            it would clear - to be checked */
518         cputag_set_input_line(device->machine, SY6502_TAG, INPUT_LINE_NMI, PULSE_LINE);
519      }
520   }
521
522   previous_i8271_int_state = state;
523}
524
525static const i8271_interface fdc_intf =
526{
527   atom_8271_interrupt_callback,
528   NULL,
529   {FLOPPY_0, FLOPPY_1}
530};
531
532/*-------------------------------------------------
533    centronics_interface atom_centronics_config
534-------------------------------------------------*/
535
253536static const centronics_interface atom_centronics_config =
254537{
255538   FALSE,
256   DEVCB_DEVICE_LINE("via6522_0", via_ca1_w),
539   DEVCB_DEVICE_LINE(R6522_TAG, via_ca1_w),
257540   DEVCB_NULL,
258541   DEVCB_NULL
259542};
260543
261static FLOPPY_OPTIONS_START(atom)
544/*-------------------------------------------------
545    FLOPPY_OPTIONS( atom )
546-------------------------------------------------*/
547
548static FLOPPY_OPTIONS_START( atom )
262549   FLOPPY_OPTION(atom, "dsk,40t", "Atom disk image", basicdsk_identify_default, basicdsk_construct_default,
263550      HEADS([1])
264551      TRACKS([40])
r7880r7881
267554      FIRST_SECTOR_ID([0]))
268555FLOPPY_OPTIONS_END
269556
557/*-------------------------------------------------
558    floppy_config atom_floppy_config
559-------------------------------------------------*/
560
270561static const floppy_config atom_floppy_config =
271562{
272563   DEVCB_NULL,
r7880r7881
279570   DO_NOT_KEEP_GEOMETRY
280571};
281572
573/*-------------------------------------------------
574    cassette_config atom_cassette_config
575-------------------------------------------------*/
576
577static TIMER_DEVICE_CALLBACK( cassette_output_tick )
578{
579   atom_state *state = (atom_state *)timer->machine->driver_data;
580
581   int level = !(!(!state->hz2400 & state->pc1) & state->pc0);
582
583   cassette_output(state->cassette, level ? -1.0 : +1.0);
584
585   state->hz2400 = !state->hz2400;
586}
587
588static CASSETTE_FORMATLIST_START( atom_cassette_formats )
589   CASSETTE_FORMAT(atom_tap_format)
590   CASSETTE_FORMAT(uef_cassette_format)
591CASSETTE_FORMATLIST_END
592
282593static const cassette_config atom_cassette_config =
283594{
284595   atom_cassette_formats,
285596   NULL,
286   (cassette_state) (CASSETTE_STOPPED | CASSETTE_MOTOR_DISABLED | CASSETTE_SPEAKER_MUTED)
597   (cassette_state) (CASSETTE_STOPPED | CASSETTE_MOTOR_ENABLED | CASSETTE_SPEAKER_MUTED)
287598};
288599
600/*-------------------------------------------------
601    mc6847_interface atom_mc6847_intf
602-------------------------------------------------*/
603
604static READ8_DEVICE_HANDLER( atom_mc6847_videoram_r )
605{
606   atom_state *state = (atom_state *)device->machine->driver_data;
607
608   mc6847_as_w(device, BIT(state->video_ram[offset], 6));
609   mc6847_intext_w(device, BIT(state->video_ram[offset], 6));
610   mc6847_inv_w(device, BIT(state->video_ram[offset], 7));
611
612   return state->video_ram[offset];
613}
614
289615static const mc6847_interface atom_mc6847_intf =
290616{
291617   DEVCB_HANDLER(atom_mc6847_videoram_r),
r7880r7881
302628   DEVCB_NULL
303629};
304630
305/* machine definition */
631/***************************************************************************
632    MACHINE INITIALIZATION
633***************************************************************************/
634
635/*-------------------------------------------------
636    MACHINE_START( atom )
637-------------------------------------------------*/
638
639static MACHINE_START( atom )
640{
641   atom_state *state = (atom_state *)machine->driver_data;
642
643   /* this is temporary */
644   /* Kees van Oss mentions that address 8-b are used for the random number
645    generator. I don't know if this is hardware, or random data because the
646    ram chips are not cleared at start-up. So at this time, these numbers
647    are poked into the memory to simulate it. When I have more details I will fix it */
648   memory_region(machine, SY6502_TAG)[0x08] = mame_rand(machine) & 0x0ff;
649   memory_region(machine, SY6502_TAG)[0x09] = mame_rand(machine) & 0x0ff;
650   memory_region(machine, SY6502_TAG)[0x0a] = mame_rand(machine) & 0x0ff;
651   memory_region(machine, SY6502_TAG)[0x0b] = mame_rand(machine) & 0x0ff;
652
653   /* find devices */
654   state->mc6847 = devtag_get_device(machine, MC6847_TAG);
655   state->cassette = devtag_get_device(machine, CASSETTE_TAG);
656}
657
658/*-------------------------------------------------
659    MACHINE_START( atomeb )
660-------------------------------------------------*/
661
662static MACHINE_START( atomeb )
663{
664   MACHINE_START_CALL(atom);
665
666   bankswitch(machine);
667}
668
669/***************************************************************************
670    MACHINE DRIVERS
671***************************************************************************/
672
673/*-------------------------------------------------
674    MACHINE_DRIVER( atom )
675-------------------------------------------------*/
676
306677static MACHINE_DRIVER_START( atom )
678   MDRV_DRIVER_DATA(atom_state)
679
307680   /* basic machine hardware */
308   MDRV_CPU_ADD("maincpu", M65C02, X2 / 4)
681   MDRV_CPU_ADD(SY6502_TAG, M65C02, X2/4)
309682   MDRV_CPU_PROGRAM_MAP(atom_mem)
310683
311684   MDRV_MACHINE_START( atom )
312685
313   MDRV_I8255A_ADD( "ppi8255", atom_8255_int )
314
315686   /* video hardware */
316   MDRV_SCREEN_ADD("screen", RASTER)
687   MDRV_SCREEN_ADD(SCREEN_TAG, RASTER)
317688   MDRV_SCREEN_REFRESH_RATE(M6847_PAL_FRAMES_PER_SECOND)
318
319   MDRV_VIDEO_UPDATE(atom)
320689   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_RGB32)
321690   MDRV_SCREEN_SIZE(320, 25+192+26)
322691   MDRV_SCREEN_VISIBLE_AREA(0, 319, 1, 239)
323692
324   MDRV_MC6847_ADD("mc6847", atom_mc6847_intf)
693   MDRV_MC6847_ADD(MC6847_TAG, atom_mc6847_intf)
325694   MDRV_MC6847_TYPE(M6847_VERSION_ORIGINAL_PAL)
326695
696   MDRV_VIDEO_UPDATE(atom)
697
327698   /* sound hardware */
328699   MDRV_SPEAKER_STANDARD_MONO("mono")
329   MDRV_SOUND_ADD("speaker", SPEAKER, 0)
700   MDRV_SOUND_ADD(SPEAKER_TAG, SPEAKER, 0)
330701   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00)
331702
332   /* printer */
333   MDRV_CENTRONICS_ADD("centronics", atom_centronics_config)
334
335   /* quickload */
703   /* devices */
704   MDRV_TIMER_ADD_PERIODIC("hz2400", cassette_output_tick, HZ(X2/4/416))
705   MDRV_VIA6522_ADD(R6522_TAG, X2/4, via_intf)
706   MDRV_I8255A_ADD(INS8255_TAG, ppi_intf)
707   MDRV_I8271_ADD(I8271_TAG, fdc_intf)
708   MDRV_FLOPPY_2_DRIVES_ADD(atom_floppy_config)
709   MDRV_CENTRONICS_ADD(CENTRONICS_TAG, atom_centronics_config)
710   MDRV_CASSETTE_ADD(CASSETTE_TAG, atom_cassette_config)
336711   MDRV_QUICKLOAD_ADD("quickload", atom_atm, "atm", 0)
337
338   /* cassette */
339   MDRV_CASSETTE_ADD( "cassette", atom_cassette_config )
340
341   /* via */
342   MDRV_VIA6522_ADD("via6522_0", X2 / 4, atom_6522_interface)
343
344   /* i8271 */
345   MDRV_I8271_ADD("i8271", atom_8271_interface)
346
347   MDRV_FLOPPY_2_DRIVES_ADD(atom_floppy_config)
348712MACHINE_DRIVER_END
349713
714/*-------------------------------------------------
715    MACHINE_DRIVER( atomeb )
716-------------------------------------------------*/
350717
351718static MACHINE_DRIVER_START( atomeb )
352   MDRV_IMPORT_FROM( atom )
353   MDRV_CPU_MODIFY( "maincpu" )
719   MDRV_IMPORT_FROM(atom)
720   MDRV_CPU_MODIFY(SY6502_TAG)
354721   MDRV_CPU_PROGRAM_MAP(atomeb_mem)
355722
356   MDRV_MACHINE_START( atomeb )
723   MDRV_MACHINE_START(atomeb)
357724MACHINE_DRIVER_END
358725
726/***************************************************************************
727    ROMS
728***************************************************************************/
359729
360ROM_START (atom)
361   ROM_REGION (0x10000, "maincpu",0)
362   ROM_LOAD ("akernel.rom", 0xf000, 0x1000, CRC(c604db3d) SHA1(2621f27d652d4673e0a79aa669e729b8c3051ab6))
363   ROM_LOAD ("dosrom.rom", 0xe000, 0x1000, CRC(c431a9b7) SHA1(71ea0a4b8d9c3caf9718fc7cc279f4306a23b39c))
364   ROM_LOAD ("afloat.rom", 0xd000, 0x1000, CRC(81d86af7) SHA1(ebcde5b36cb3a3344567cbba4c7b9fde015f4802))
365   ROM_LOAD ("abasic.rom", 0xc000, 0x1000, CRC(43798b9b) SHA1(a8ea19f10d4c98fbc1b666e5968f06d46af9a84c))
730/*-------------------------------------------------
731    ROM( atom )
732-------------------------------------------------*/
733
734ROM_START( atom )
735   ROM_REGION( 0x4000, SY6502_TAG, 0 )
736   ROM_LOAD( "abasic.ic20", 0x0000, 0x1000, CRC(289b7791) SHA1(0072c83458a9690a3ea1f6094f0f38cf8e96a445) )
737   ROM_CONTINUE(          0x3000, 0x1000 )
738   ROM_LOAD( "afloat.ic21", 0x1000, 0x1000, CRC(81d86af7) SHA1(ebcde5b36cb3a3344567cbba4c7b9fde015f4802) )
739   ROM_LOAD( "dosrom.u15",  0x2000, 0x1000, CRC(c431a9b7) SHA1(71ea0a4b8d9c3caf9718fc7cc279f4306a23b39c) )
366740ROM_END
367741
368ROM_START (atomeb)
369   ROM_REGION (0x10000+0x09000, "maincpu",0)
370   ROM_LOAD ("akernel.rom", 0xf000, 0x1000, CRC(c604db3d) SHA1(2621f27d652d4673e0a79aa669e729b8c3051ab6))
371   ROM_LOAD ("dosrom.rom", 0xe000, 0x1000, CRC(c431a9b7) SHA1(71ea0a4b8d9c3caf9718fc7cc279f4306a23b39c))
372   ROM_LOAD ("afloat.rom", 0xd000, 0x1000, CRC(81d86af7) SHA1(ebcde5b36cb3a3344567cbba4c7b9fde015f4802))
373   ROM_LOAD ("abasic.rom", 0xc000, 0x1000, CRC(43798b9b) SHA1(a8ea19f10d4c98fbc1b666e5968f06d46af9a84c))
374   /* roms from another oric emulator */
375   ROM_LOAD ("axr1.rom",0x010000,0x1000, CRC(868fda8b) SHA1(f8417787c28818a7646b9b59d706ef890255049f))       // Atom Externsion ROM AXR1
376   ROM_LOAD ("pcharme.rom",0x011000,0x1000, CRC(9e8bd79f) SHA1(66c57622448b448aa6080911dccb03456d0e3b81))    // P-Charme
377   ROM_LOAD ("gags.rom",0x012000,0x1000, CRC(35e1d713) SHA1(94cc2887ad9fea1849d1d53c64d0668e77696ef4))       // GAGS
378   ROM_LOAD ("werom.rom",0x013000,0x1000, CRC(dfcb3bf8) SHA1(85a19146844da2d6f03e1cde37ee17429eedeb0d))      // WE-ROM
379   ROM_LOAD ("utilikit.rom",0x014000,0x1000, CRC(013b8f93) SHA1(b4341f116a6d1e0cbcd39d64e0b5d14a90dc0356))   // A&F Utility Kit
380   ROM_LOAD ("combox.rom",0x015000,0x1000, CRC(9c8210ab) SHA1(ea293f49a98721cdbdf985d6f2fe636290ef0e75))     // ComBox
381   ROM_LOAD ("salfaa.rom",0x016000,0x1000, CRC(ef857b25) SHA1(b3812427233060972fa01faf3ce381a21576a5ed))     // SALFAA
382   ROM_LOAD ("mousebox.rom",0x017000,0x01000, CRC(0dff30e4) SHA1(b7c0b9c23fcc5cfdc06cb2d2a9e7c2658e248ef7))  // Mouse-Dos Box
383   ROM_LOAD ("atomicw.rom",0x018000,0x1000, CRC(a3fd737d) SHA1(d418d9322c69c49106ed2c268ad0864c0f2c4c1b))    // Atomic Windows
742/*-------------------------------------------------
743    ROM( atomeb )
744-------------------------------------------------*/
745
746ROM_START( atomeb )
747   ROM_REGION( 0x4000, SY6502_TAG, 0 )
748   ROM_LOAD( "abasic.ic20", 0x0000, 0x1000, CRC(289b7791) SHA1(0072c83458a9690a3ea1f6094f0f38cf8e96a445) )
749   ROM_CONTINUE(          0x3000, 0x1000 )
750   ROM_LOAD( "afloat.ic21", 0x1000, 0x1000, CRC(81d86af7) SHA1(ebcde5b36cb3a3344567cbba4c7b9fde015f4802) )
751   ROM_LOAD( "dosrom.u15",  0x2000, 0x1000, CRC(c431a9b7) SHA1(71ea0a4b8d9c3caf9718fc7cc279f4306a23b39c) )
752   
753   ROM_REGION( 0x10000, "eprom", 0 )
754   ROM_LOAD( "axr1.rom",     0x0000, 0x1000, CRC(868fda8b) SHA1(f8417787c28818a7646b9b59d706ef890255049f) ) // Atom Externsion ROM AXR1
755   ROM_LOAD( "pcharme.rom",  0x1000, 0x1000, CRC(9e8bd79f) SHA1(66c57622448b448aa6080911dccb03456d0e3b81) ) // P-Charme
756   ROM_LOAD( "gags.rom",     0x2000, 0x1000, CRC(35e1d713) SHA1(94cc2887ad9fea1849d1d53c64d0668e77696ef4) ) // GAGS
757   ROM_LOAD( "werom.rom",    0x3000, 0x1000, CRC(dfcb3bf8) SHA1(85a19146844da2d6f03e1cde37ee17429eedeb0d) ) // WE-ROM
758   ROM_LOAD( "utilikit.rom", 0x4000, 0x1000, CRC(013b8f93) SHA1(b4341f116a6d1e0cbcd39d64e0b5d14a90dc0356) ) // A&F Utility Kit
759   ROM_LOAD( "combox.rom",   0x5000, 0x1000, CRC(9c8210ab) SHA1(ea293f49a98721cdbdf985d6f2fe636290ef0e75) ) // ComBox
760   ROM_LOAD( "salfaa.rom",   0x6000, 0x1000, CRC(ef857b25) SHA1(b3812427233060972fa01faf3ce381a21576a5ed) ) // SALFAA
761   ROM_LOAD( "mousebox.rom", 0x7000, 0x1000, CRC(0dff30e4) SHA1(b7c0b9c23fcc5cfdc06cb2d2a9e7c2658e248ef7) ) // Mouse-Dos Box
762   ROM_LOAD( "atomicw.rom",  0x8000, 0x1000, CRC(a3fd737d) SHA1(d418d9322c69c49106ed2c268ad0864c0f2c4c1b) ) // Atomic Windows
384763ROM_END
385764
765/***************************************************************************
766    SYSTEM DRIVERS
767***************************************************************************/
768
386769/*    YEAR  NAME      PARENT    COMPAT  MACHINE   INPUT     INIT      COMPANY   FULLNAME */
387770COMP( 1979, atom,     0,        0,      atom,     atom,     0,        "Acorn",  "Atom" , 0)
388771COMP( 1979, atomeb,   atom,     0,      atomeb,   atom,     0,        "Acorn",  "Atom with Eprom Box" , 0)

Previous 15994 Revisions Next


© 1998-2018 The MESS Team