1
/***************************************************************************
6
Preliminary driver by R. Belmont
9
0000-7fff: 32k window on 128k of sample RAM
11
c000-dfff: optional expansion RAM
12
e100-e101: 6850 UART (for MIDI)
14
e408-e40f: filter cut-off frequency
15
e410-e417: filter resonance
16
e418-e41f: multiplexer address pre-set
18
ec00-ecef: ES5503 "DOC" sound chip
36
***************************************************************************/
38
#define ADDRESS_MAP_MODERN
41
#include "cpu/m6809/m6809.h"
42
#include "machine/6850acia.h"
43
#include "machine/6522via.h"
44
#include "machine/wd17xx.h"
45
#include "imagedev/flopdrv.h"
46
#include "formats/basicdsk.h"
47
#include "sound/es5503.h"
49
class mirage_state : public driver_device
52
mirage_state(const machine_config &mconfig, device_type type, const char *tag)
53
: driver_device(mconfig, type, tag) { }
55
virtual void machine_reset();
61
static void mirage_doc_irq(device_t *device, int state)
65
static READ8_DEVICE_HANDLER( mirage_adc_read )
70
static const es5503_interface mirage_es5503_interface =
77
static VIDEO_START( mirage )
81
static SCREEN_UPDATE( mirage )
86
void mirage_state::machine_reset()
88
es5503_set_base(machine().device("es5503"), machine().region("ensoniq")->base());
91
memory_set_bankptr(machine(), "sndbank", machine().region("ensoniq")->base() );
94
static ADDRESS_MAP_START( mirage_map, AS_PROGRAM, 8, mirage_state )
95
AM_RANGE(0x0000, 0x7fff) AM_ROMBANK("sndbank") // 32k window on 128k of wave RAM
96
AM_RANGE(0x8000, 0xbfff) AM_RAM // main RAM
97
AM_RANGE(0xe100, 0xe100) AM_DEVREADWRITE("acia6850", acia6850_device, status_read, control_write)
98
AM_RANGE(0xe101, 0xe101) AM_DEVREADWRITE("acia6850", acia6850_device, data_read, data_write)
99
AM_RANGE(0xe200, 0xe2ff) AM_DEVREADWRITE("via6522", via6522_device, read, write)
100
AM_RANGE(0xe800, 0xe800) AM_DEVREADWRITE_LEGACY("wd177x", wd17xx_status_r,wd17xx_command_w)
101
AM_RANGE(0xe801, 0xe801) AM_DEVREADWRITE_LEGACY("wd177x", wd17xx_track_r,wd17xx_track_w)
102
AM_RANGE(0xe802, 0xe802) AM_DEVREADWRITE_LEGACY("wd177x", wd17xx_sector_r,wd17xx_sector_w)
103
AM_RANGE(0xe803, 0xe803) AM_DEVREADWRITE_LEGACY("wd177x", wd17xx_data_r,wd17xx_data_w)
104
// AM_RANGE(0xec00, 0xecef) AM_DEVREADWRITE_LEGACY("es5503", es5503_r, es5503_w)
105
AM_RANGE(0xf000, 0xffff) AM_ROM AM_REGION("osrom", 0)
108
// port A: front panel
109
static WRITE8_DEVICE_HANDLER( mirage_via_write_porta )
111
// printf("PORT A: %02x\n", data);
115
// bit 7: OUT UART clock
116
// bit 4: OUT disk enable (motor on?)
117
// bit 3: OUT sample/play
118
// bit 2: OUT mic line/in
119
// bit 1: OUT upper/lower bank (64k halves)
120
// bit 0: OUT bank 0/bank 1 (32k halves)
122
static WRITE8_DEVICE_HANDLER( mirage_via_write_portb )
125
mirage_state *mirage = device->machine().driver_data<mirage_state>();
127
// handle sound RAM bank switching
128
bank = (data & 2) ? (64*1024) : 0;
129
bank += (data & 1) ? (32*1024) : 0;
130
if (bank != mirage->last_sndram_bank)
132
mirage->last_sndram_bank = bank;
133
memory_set_bankptr(device->machine(), "sndbank", device->machine().region("ensoniq")->base() + bank);
137
// port A: front panel
138
static READ8_DEVICE_HANDLER( mirage_via_read_porta )
144
// bit 6: IN FDC disk loaded
145
// bit 5: IN 5503 sync (?)
146
static READ8_DEVICE_HANDLER( mirage_via_read_portb )
151
// external sync pulse
152
static READ8_DEVICE_HANDLER( mirage_via_read_ca1 )
158
static READ8_DEVICE_HANDLER( mirage_via_read_cb1 )
164
static READ8_DEVICE_HANDLER( mirage_via_read_ca2 )
171
static READ8_DEVICE_HANDLER( mirage_via_read_cb2 )
176
const via6522_interface mirage_via =
178
DEVCB_HANDLER(mirage_via_read_porta),
179
DEVCB_HANDLER(mirage_via_read_portb),
180
DEVCB_HANDLER(mirage_via_read_ca1),
181
DEVCB_HANDLER(mirage_via_read_cb1),
182
DEVCB_HANDLER(mirage_via_read_ca2),
183
DEVCB_HANDLER(mirage_via_read_cb2),
184
DEVCB_HANDLER(mirage_via_write_porta),
185
DEVCB_HANDLER(mirage_via_write_portb),
190
DEVCB_CPU_INPUT_LINE("maincpu", M6809_IRQ_LINE)
193
static ACIA6850_INTERFACE( mirage_acia6850_interface )
198
DEVCB_NULL, // rx out
199
DEVCB_NULL, // cts in
200
DEVCB_NULL, // rts out
201
DEVCB_NULL, // dcd in
202
DEVCB_CPU_INPUT_LINE("maincpu", M6809_FIRQ_LINE)
205
static FLOPPY_OPTIONS_START(mirage)
206
FLOPPY_OPTION(mirage, "img", "Mirage disk image", basicdsk_identify_default, basicdsk_construct_default, NULL,
211
FIRST_SECTOR_ID([0]))
214
static const floppy_interface mirage_floppy_interface =
221
FLOPPY_STANDARD_3_5_DSDD,
222
FLOPPY_OPTIONS_NAME(mirage),
227
const wd17xx_interface mirage_wd17xx_interface =
230
DEVCB_CPU_INPUT_LINE("maincpu", INPUT_LINE_NMI), // intrq
232
{FLOPPY_0, NULL, NULL, NULL}
235
static MACHINE_CONFIG_START( mirage, mirage_state )
236
MCFG_CPU_ADD("maincpu", M6809E, 4000000)
237
MCFG_CPU_PROGRAM_MAP(mirage_map)
239
MCFG_SCREEN_ADD("screen", RASTER)
240
MCFG_SCREEN_REFRESH_RATE(60)
241
MCFG_VIDEO_START(mirage)
242
MCFG_SCREEN_UPDATE(mirage)
243
MCFG_SCREEN_FORMAT(BITMAP_FORMAT_RGB32)
244
MCFG_SCREEN_SIZE(320, 240)
245
MCFG_SCREEN_VISIBLE_AREA(0, 319, 1, 239)
247
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
248
MCFG_SOUND_ADD("es5503", ES5503, 7000000)
249
MCFG_SOUND_CONFIG(mirage_es5503_interface)
250
MCFG_SOUND_ROUTE(0, "lspeaker", 1.0)
251
MCFG_SOUND_ROUTE(1, "rspeaker", 1.0)
253
MCFG_VIA6522_ADD("via6522", 1000000, mirage_via)
255
MCFG_ACIA6850_ADD("acia6850", mirage_acia6850_interface)
257
MCFG_WD1770_ADD("wd177x", mirage_wd17xx_interface )
258
MCFG_FLOPPY_2_DRIVES_ADD(mirage_floppy_interface)
261
static INPUT_PORTS_START( mirage )
265
ROM_REGION(0x1000, "osrom", 0)
266
ROM_LOAD( "mirage.bin", 0x0000, 0x1000, CRC(9fc7553c) SHA1(ec6ea5613eeafd21d8f3a7431a35a6ff16eed56d) )
268
ROM_REGION(0x20000, "ensoniq", ROMREGION_ERASE)
271
CONS( 1984, mirage, 0, 0, mirage, mirage, 0, "Ensoniq", "Mirage", GAME_NOT_WORKING )