Previous 15994 Revisions Next

r4303 Thursday 19th February, 2009 at 14:14:30 UTC by Dirk Best
[ATOM] Cleanups
[src/mess/drivers]atom.c
[src/mess/includes]atom.h
[src/mess/machine]atom.c

src/mess/includes/atom.h
r4302r4303
3030WRITE8_DEVICE_HANDLER (atom_8255_portb_w );
3131WRITE8_DEVICE_HANDLER (atom_8255_portc_w );
3232
33/* for floppy disc interface */
34READ8_HANDLER (atom_8271_r);
35WRITE8_HANDLER (atom_8271_w);
36
3733DEVICE_IMAGE_LOAD( atom_floppy );
3834
3935READ8_HANDLER(atom_eprom_box_r);
src/mess/machine/atom.c
r4302r4303
7272   DEVCB_NULL,
7373   DEVCB_NULL,
7474   DEVCB_NULL,
75   DEVCB_DEVICE_LINE(CENTRONICS, "centronics", centronics_strobe_w), /* the CA2 output is connected to the STROBE signal on the centronics */
75   /* the CA2 output is connected to the STROBE signal on the centronics */
76   DEVCB_DEVICE_LINE(CENTRONICS, "centronics", centronics_strobe_w),
7677   DEVCB_NULL,
7778   DEVCB_CPU_INPUT_LINE("main", 0)
7879};
r4302r4303
8687   DEVCB_HANDLER(atom_8255_portc_r),
8788   DEVCB_HANDLER(atom_8255_porta_w),
8889   DEVCB_HANDLER(atom_8255_portb_w),
89   DEVCB_HANDLER(atom_8255_portc_w),
90   DEVCB_DEVICE_HANDLER(SOUND, "speaker", atom_8255_portc_w),
9091};
9192
9293static int previous_i8271_int_state = 0;
r4302r4303
359360   atom_8255_portb = data;
360361}
361362
362WRITE8_DEVICE_HANDLER (atom_8255_portc_w)
363WRITE8_DEVICE_HANDLER(atom_8255_portc_w)
363364{
364   const device_config *speaker = devtag_get_device(device->machine, SOUND, "speaker");
365365   atom_8255_portc = data;
366   speaker_level_w(speaker, (data & 0x04) >> 2);
366   speaker_level_w(device, BIT(data, 2));
367367}
368368
369369
370/* KT- I've assumed that the atom 8271 is linked in exactly the same way as on the bbc */
371READ8_HANDLER(atom_8271_r)
372{
373   device_config *i8271 = (device_config*)devtag_get_device(space->machine, I8271, "i8271");
374
375   switch (offset)
376   {
377      case 0:
378      case 1:
379      case 2:
380      case 3:
381         /* 8271 registers */
382         return i8271_r(i8271, offset);
383      case 4:
384         return i8271_data_r(i8271, offset);
385      default:
386         break;
387   }
388
389   return 0x0ff;
390}
391
392WRITE8_HANDLER(atom_8271_w)
393{
394   device_config *i8271 = (device_config*)devtag_get_device(space->machine, I8271, "i8271");
395
396   switch (offset)
397   {
398      case 0:
399      case 1:
400      case 2:
401      case 3:
402         /* 8271 registers */
403         i8271_w(i8271, offset, data);
404         return;
405      case 4:
406         i8271_data_w(i8271, offset, data);
407         return;
408      default:
409         break;
410   }
411}
412
413
414370/*********************************************/
415371/* emulates a 16-slot eprom box for the Atom */
416372static unsigned char selected_eprom = 0;
src/mess/drivers/atom.c
r4302r4303
8484
8585/* memory w/r functions */
8686
87static ADDRESS_MAP_START( atom_mem, ADDRESS_SPACE_PROGRAM, 8)
87static ADDRESS_MAP_START( atom_mem, ADDRESS_SPACE_PROGRAM, 8 )
8888   AM_RANGE(0x0000, 0x09ff) AM_RAM
89   AM_RANGE(0x0a00, 0x0a04) AM_READWRITE(atom_8271_r, atom_8271_w)
89   AM_RANGE(0x0a00, 0x0a03) AM_DEVREADWRITE(I8271, "i8271", i8271_r, i8271_w)
90   AM_RANGE(0x0a04, 0x0a04) AM_DEVREADWRITE(I8271, "i8271", i8271_data_r, i8271_data_w)
9091   AM_RANGE(0x0a05, 0x7fff) AM_RAM
9192   AM_RANGE(0x8000, 0x97ff) AM_RAM AM_BASE(&videoram) /* VDG 6847 */
9293   AM_RANGE(0x9800, 0x9fff) AM_RAM
93   AM_RANGE(0xb000, 0xb003) AM_DEVREADWRITE( PPI8255, "ppi8255", ppi8255_r, ppi8255_w) /* PPIA 8255 */
94   AM_RANGE(0xb800, 0xbbff) AM_DEVREADWRITE(VIA6522, "via6522_0", via_r, via_w)         /* VIA 6522 */
94   AM_RANGE(0xb000, 0xb003) AM_DEVREADWRITE(PPI8255, "ppi8255", ppi8255_r, ppi8255_w)
95   AM_RANGE(0xb800, 0xbbff) AM_DEVREADWRITE(VIA6522, "via6522_0", via_r, via_w)
9596   AM_RANGE(0xc000, 0xcfff) AM_ROM
9697   AM_RANGE(0xd000, 0xdfff) AM_ROM
9798   AM_RANGE(0xe000, 0xefff) AM_ROM
r4302r4303
99100ADDRESS_MAP_END
100101
101102
102static ADDRESS_MAP_START( atomeb_mem, ADDRESS_SPACE_PROGRAM, 8)
103static ADDRESS_MAP_START( atomeb_mem, ADDRESS_SPACE_PROGRAM, 8 )
103104   AM_RANGE(0x0000, 0x09ff) AM_RAM
104   AM_RANGE(0x0a00, 0x0a04) AM_READWRITE(atom_8271_r, atom_8271_w)
105   AM_RANGE(0x0a00, 0x0a03) AM_DEVREADWRITE(I8271, "i8271", i8271_r, i8271_w)
106   AM_RANGE(0x0a04, 0x0a04) AM_DEVREADWRITE(I8271, "i8271", i8271_data_r, i8271_data_w)
105107   AM_RANGE(0x0a05, 0x7fff) AM_RAM
106108   AM_RANGE(0x8000, 0x97ff) AM_RAM AM_BASE(&videoram) AM_SIZE(&videoram_size) /* VDG 6847 */
107109   AM_RANGE(0x9800, 0x9fff) AM_RAM
108110   AM_RANGE(0xa000, 0xafff) AM_READ(SMH_BANK1)   /* eprom data from eprom box */
109   AM_RANGE(0xb000, 0xb003) AM_DEVREADWRITE( PPI8255, "ppi8255", ppi8255_r, ppi8255_w) /* PPIA 8255 */
110   AM_RANGE(0xb800, 0xbbff) AM_DEVREADWRITE(VIA6522, "via6522_0", via_r, via_w)         /* VIA 6522 */
111   AM_RANGE(0xb000, 0xb003) AM_DEVREADWRITE(PPI8255, "ppi8255", ppi8255_r, ppi8255_w)
112   AM_RANGE(0xb800, 0xbbff) AM_DEVREADWRITE(VIA6522, "via6522_0", via_r, via_w)
111113   AM_RANGE(0xbfff, 0xbfff) AM_READWRITE(atom_eprom_box_r, atom_eprom_box_w)
112114   AM_RANGE(0xc000, 0xcfff) AM_ROM
113115   AM_RANGE(0xd000, 0xdfff) AM_ROM
r4302r4303
122124
123125/* Not implemented: BREAK */
124126
125static INPUT_PORTS_START (atom)
126   PORT_START("vblank") /* VBLANK */
127   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_VBLANK )
128
127static INPUT_PORTS_START( atom )
129128   PORT_START("KEY0")
130129   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED)
131130   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD)                           PORT_CODE(KEYCODE_3)          PORT_CHAR('3') PORT_CHAR('#')

Previous 15994 Revisions Next


© 1998-2018 The MESS Team