src/mess/drivers/mirage.c
| r0 | r11127 | |
| 1 | /*************************************************************************** |
| 2 | |
| 3 | drivers/mirage.c |
| 4 | |
| 5 | Ensoniq Mirage Sampler |
| 6 | Preliminary driver by R. Belmont |
| 7 | |
| 8 | Map for Mirage: |
| 9 | 0000-7fff: 32k window on 128k of sample RAM |
| 10 | 8000-bfff: main RAM |
| 11 | c000-dfff: optional expansion RAM |
| 12 | e100-e101: 6850 UART (for MIDI) |
| 13 | e200-e2ff: 6522 VIA |
| 14 | e408-e40f: filter cut-off frequency |
| 15 | e410-e417: filter resonance |
| 16 | e418-e41f: multiplexer address pre-set |
| 17 | e800-e803: WD1770 FDC |
| 18 | ec00-ecef: ES5503 "DOC" sound chip |
| 19 | f000-ffff: boot ROM |
| 20 | |
| 21 | LED patterns |
| 22 | |
| 23 | 80 |
| 24 | _____ |
| 25 | | | 40 |
| 26 | 04 | 02 | |
| 27 | _____ |
| 28 | | | 20 |
| 29 | 08 | | |
| 30 | _____ |
| 31 | 10 |
| 32 | |
| 33 | PORT A: 111xyzzz |
| 34 | |
| 35 | |
| 36 | ***************************************************************************/ |
| 37 | |
| 38 | #define ADDRESS_MAP_MODERN |
| 39 | |
| 40 | #include "emu.h" |
| 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" |
| 48 | |
| 49 | class mirage_state : public driver_device |
| 50 | { |
| 51 | public: |
| 52 | mirage_state(running_machine &machine, const driver_device_config_base &config) |
| 53 | : driver_device(machine, config) { } |
| 54 | |
| 55 | virtual void machine_reset(); |
| 56 | |
| 57 | int last_sndram_bank; |
| 58 | }; |
| 59 | |
| 60 | |
| 61 | static void mirage_doc_irq(device_t *device, int state) |
| 62 | { |
| 63 | } |
| 64 | |
| 65 | static READ8_DEVICE_HANDLER( mirage_adc_read ) |
| 66 | { |
| 67 | return 0x80; |
| 68 | } |
| 69 | |
| 70 | static const es5503_interface mirage_es5503_interface = |
| 71 | { |
| 72 | mirage_doc_irq, |
| 73 | mirage_adc_read, |
| 74 | NULL |
| 75 | }; |
| 76 | |
| 77 | static VIDEO_START( mirage ) |
| 78 | { |
| 79 | } |
| 80 | |
| 81 | static SCREEN_UPDATE( mirage ) |
| 82 | { |
| 83 | return 0; |
| 84 | } |
| 85 | |
| 86 | void mirage_state::machine_reset() |
| 87 | { |
| 88 | es5503_set_base(m_machine.device("es5503"), m_machine.region("ensoniq")->base()); |
| 89 | |
| 90 | last_sndram_bank = 0; |
| 91 | memory_set_bankptr(m_machine, "sndbank", m_machine.region("ensoniq")->base() ); |
| 92 | } |
| 93 | |
| 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_LEGACY("acia6850", acia6850_stat_r, acia6850_ctrl_w) |
| 98 | AM_RANGE(0xe101, 0xe101) AM_DEVREADWRITE_LEGACY("acia6850", acia6850_data_r, acia6850_data_w) |
| 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) |
| 106 | ADDRESS_MAP_END |
| 107 | |
| 108 | // port A: front panel |
| 109 | static WRITE8_DEVICE_HANDLER( mirage_via_write_porta ) |
| 110 | { |
| 111 | // printf("PORT A: %02x\n", data); |
| 112 | } |
| 113 | |
| 114 | // port B: |
| 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) |
| 121 | |
| 122 | static WRITE8_DEVICE_HANDLER( mirage_via_write_portb ) |
| 123 | { |
| 124 | int bank = 0; |
| 125 | mirage_state *mirage = device->machine().driver_data<mirage_state>(); |
| 126 | |
| 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) |
| 131 | { |
| 132 | mirage->last_sndram_bank = bank; |
| 133 | memory_set_bankptr(device->machine(), "sndbank", device->machine().region("ensoniq")->base() + bank); |
| 134 | } |
| 135 | } |
| 136 | |
| 137 | // port A: front panel |
| 138 | static READ8_DEVICE_HANDLER( mirage_via_read_porta ) |
| 139 | { |
| 140 | return 0; |
| 141 | } |
| 142 | |
| 143 | // port B: |
| 144 | // bit 6: IN FDC disk loaded |
| 145 | // bit 5: IN 5503 sync (?) |
| 146 | static READ8_DEVICE_HANDLER( mirage_via_read_portb ) |
| 147 | { |
| 148 | return 0x60; |
| 149 | } |
| 150 | |
| 151 | // external sync pulse |
| 152 | static READ8_DEVICE_HANDLER( mirage_via_read_ca1 ) |
| 153 | { |
| 154 | return 0; |
| 155 | } |
| 156 | |
| 157 | // keyscan |
| 158 | static READ8_DEVICE_HANDLER( mirage_via_read_cb1 ) |
| 159 | { |
| 160 | return 0; |
| 161 | } |
| 162 | |
| 163 | // keyscan |
| 164 | static READ8_DEVICE_HANDLER( mirage_via_read_ca2 ) |
| 165 | { |
| 166 | return 0; |
| 167 | } |
| 168 | |
| 169 | |
| 170 | // keyscan |
| 171 | static READ8_DEVICE_HANDLER( mirage_via_read_cb2 ) |
| 172 | { |
| 173 | return 0; |
| 174 | } |
| 175 | |
| 176 | const via6522_interface mirage_via = |
| 177 | { |
| 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), |
| 186 | DEVCB_NULL, |
| 187 | DEVCB_NULL, |
| 188 | DEVCB_NULL, |
| 189 | DEVCB_NULL, |
| 190 | DEVCB_CPU_INPUT_LINE("maincpu", M6809_IRQ_LINE) |
| 191 | }; |
| 192 | |
| 193 | static ACIA6850_INTERFACE( mirage_acia6850_interface ) |
| 194 | { |
| 195 | 0, // tx clock |
| 196 | 0, // rx clock |
| 197 | DEVCB_NULL, // rx in |
| 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) |
| 203 | }; |
| 204 | |
| 205 | static FLOPPY_OPTIONS_START(mirage) |
| 206 | FLOPPY_OPTION(mirage, "img", "Mirage disk image", basicdsk_identify_default, basicdsk_construct_default, |
| 207 | HEADS([1]) |
| 208 | TRACKS([80]) |
| 209 | SECTORS([5]) |
| 210 | SECTOR_LENGTH([512]) |
| 211 | FIRST_SECTOR_ID([0])) |
| 212 | FLOPPY_OPTIONS_END |
| 213 | |
| 214 | static const floppy_config mirage_floppy_config = |
| 215 | { |
| 216 | DEVCB_NULL, |
| 217 | DEVCB_NULL, |
| 218 | DEVCB_NULL, |
| 219 | DEVCB_NULL, |
| 220 | DEVCB_NULL, |
| 221 | FLOPPY_STANDARD_3_5_DSDD, |
| 222 | FLOPPY_OPTIONS_NAME(mirage), |
| 223 | NULL |
| 224 | }; |
| 225 | |
| 226 | const wd17xx_interface mirage_wd17xx_interface = |
| 227 | { |
| 228 | DEVCB_NULL, // dden |
| 229 | DEVCB_CPU_INPUT_LINE("maincpu", INPUT_LINE_NMI), // intrq |
| 230 | DEVCB_NULL, // drq |
| 231 | {FLOPPY_0, NULL, NULL, NULL} |
| 232 | }; |
| 233 | |
| 234 | static MACHINE_CONFIG_START( mirage, mirage_state ) |
| 235 | MCFG_CPU_ADD("maincpu", M6809E, 4000000) |
| 236 | MCFG_CPU_PROGRAM_MAP(mirage_map) |
| 237 | |
| 238 | MCFG_SCREEN_ADD("screen", RASTER) |
| 239 | MCFG_SCREEN_REFRESH_RATE(60) |
| 240 | MCFG_VIDEO_START(mirage) |
| 241 | MCFG_SCREEN_UPDATE(mirage) |
| 242 | MCFG_SCREEN_FORMAT(BITMAP_FORMAT_RGB32) |
| 243 | MCFG_SCREEN_SIZE(320, 240) |
| 244 | MCFG_SCREEN_VISIBLE_AREA(0, 319, 1, 239) |
| 245 | |
| 246 | MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker") |
| 247 | MCFG_SOUND_ADD("es5503", ES5503, 7000000) |
| 248 | MCFG_SOUND_CONFIG(mirage_es5503_interface) |
| 249 | MCFG_SOUND_ROUTE(0, "lspeaker", 1.0) |
| 250 | MCFG_SOUND_ROUTE(1, "rspeaker", 1.0) |
| 251 | |
| 252 | MCFG_VIA6522_ADD("via6522", 1000000, mirage_via) |
| 253 | |
| 254 | MCFG_ACIA6850_ADD("acia6850", mirage_acia6850_interface) |
| 255 | |
| 256 | MCFG_WD177X_ADD("wd177x", mirage_wd17xx_interface ) |
| 257 | MCFG_FLOPPY_2_DRIVES_ADD(mirage_floppy_config) |
| 258 | MACHINE_CONFIG_END |
| 259 | |
| 260 | static INPUT_PORTS_START( mirage ) |
| 261 | INPUT_PORTS_END |
| 262 | |
| 263 | ROM_START( mirage ) |
| 264 | ROM_REGION(0x1000, "osrom", 0) |
| 265 | ROM_LOAD( "mirage.bin", 0x0000, 0x1000, CRC(9fc7553c) SHA1(ec6ea5613eeafd21d8f3a7431a35a6ff16eed56d) ) |
| 266 | |
| 267 | ROM_REGION(0x20000, "ensoniq", ROMREGION_ERASE) |
| 268 | ROM_END |
| 269 | |
| 270 | CONS( 1984, mirage, 0, 0, mirage, mirage, 0, "Ensoniq", "Mirage", GAME_NOT_WORKING ) |
| 271 | |
src/mess/drivers/esq1.c
| r11126 | r11127 | |
| 52 | 52 | |
| 53 | 53 | ***************************************************************************/ |
| 54 | 54 | |
| 55 | #define ADDRESS_MAP_MODERN |
| 56 | |
| 55 | 57 | #include "emu.h" |
| 56 | 58 | #include "cpu/m6809/m6809.h" |
| 57 | 59 | #include "sound/es5503.h" |
| r11126 | r11127 | |
| 100 | 102 | memory_set_bankptr(machine, "osbank", machine.region("osrom")->base() ); |
| 101 | 103 | } |
| 102 | 104 | |
| 103 | | static ADDRESS_MAP_START( esq1_map, AS_PROGRAM, 8 ) |
| 105 | static ADDRESS_MAP_START( esq1_map, AS_PROGRAM, 8, esq1_state ) |
| 104 | 106 | AM_RANGE(0x0000, 0x1fff) AM_RAM // OSRAM |
| 105 | 107 | AM_RANGE(0x4000, 0x5fff) AM_RAM // SEQRAM |
| 106 | | AM_RANGE(0x6000, 0x63ff) AM_DEVREADWRITE("es5503", es5503_r, es5503_w) |
| 107 | | AM_RANGE(0x6400, 0x640f) AM_DEVREADWRITE("duart", duart68681_r, duart68681_w) |
| 108 | AM_RANGE(0x6000, 0x63ff) AM_DEVREADWRITE_LEGACY("es5503", es5503_r, es5503_w) |
| 109 | AM_RANGE(0x6400, 0x640f) AM_DEVREADWRITE_LEGACY("duart", duart68681_r, duart68681_w) |
| 108 | 110 | AM_RANGE(0x7000, 0x7fff) AM_ROMBANK("osbank") |
| 109 | 111 | AM_RANGE(0x8000, 0xffff) AM_ROM AM_REGION("osrom", 0x8000) // OS "high" ROM is always mapped here |
| 110 | 112 | ADDRESS_MAP_END |
| r11126 | r11127 | |
| 196 | 198 | ROM_LOAD( "esq1wavhi.bin", 0x8000, 0x8000, CRC(94c554a3) SHA1(ed0318e5253637585559e8cf24c06d6115bd18f6) ) |
| 197 | 199 | ROM_END |
| 198 | 200 | |
| 199 | | CONS( 1987, esq1, 0, 0, esq1, esq1, 0, "Ensoniq", "ESQ-1", GAME_NOT_WORKING ) |
| 201 | CONS( 1986, esq1, 0, 0, esq1, esq1, 0, "Ensoniq", "ESQ-1", GAME_NOT_WORKING ) |