~ubuntu-branches/ubuntu/raring/mame/raring-proposed

« back to all changes in this revision

Viewing changes to mess/src/mess/drivers/mirage.c

  • Committer: Package Import Robot
  • Author(s): Jordi Mallach, Jordi Mallach, Emmanuel Kasper
  • Date: 2011-12-19 22:56:27 UTC
  • mfrom: (0.1.2)
  • Revision ID: package-import@ubuntu.com-20111219225627-ub5oga1oys4ogqzm
Tags: 0.144-1
[ Jordi Mallach ]
* Fix syntax errors in DEP5 copyright file (lintian).
* Use a versioned copyright Format specification field.
* Update Vcs-* URLs.
* Move transitional packages to the new metapackages section, and make
  them priority extra.
* Remove references to GNU/Linux and MESS sources from copyright.
* Add build variables for s390x.
* Use .xz tarballs as it cuts 4MB for the upstream sources.
* Add nplayers.ini as a patch. Update copyright file to add CC-BY-SA-3.0.

[ Emmanuel Kasper ]
* New upstream release. Closes: #651538.
* Add Free Desktop compliant png icons of various sizes taken from
  the hydroxygen iconset
* Mess is now built from a new source package, to avoid possible source
  incompatibilities between mame and the mess overlay.
* Mame-tools are not built from the mame source package anymore, but
  from the mess source package

Show diffs side-by-side

added added

removed removed

Lines of Context:
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(const machine_config &mconfig, device_type type, const char *tag)
53
 
    : driver_device(mconfig, type, tag) { }
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(machine().device("es5503"), machine().region("ensoniq")->base());
89
 
 
90
 
        last_sndram_bank = 0;
91
 
        memory_set_bankptr(machine(), "sndbank", 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("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)
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, NULL,
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_interface mirage_floppy_interface =
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
 
        NULL
225
 
};
226
 
 
227
 
const wd17xx_interface mirage_wd17xx_interface =
228
 
{
229
 
        DEVCB_NULL,                     // dden
230
 
        DEVCB_CPU_INPUT_LINE("maincpu", INPUT_LINE_NMI),        // intrq
231
 
        DEVCB_NULL,                     // drq
232
 
        {FLOPPY_0, NULL, NULL, NULL}
233
 
};
234
 
 
235
 
static MACHINE_CONFIG_START( mirage, mirage_state )
236
 
        MCFG_CPU_ADD("maincpu", M6809E, 4000000)
237
 
        MCFG_CPU_PROGRAM_MAP(mirage_map)
238
 
 
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)
246
 
 
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)
252
 
 
253
 
        MCFG_VIA6522_ADD("via6522", 1000000, mirage_via)
254
 
 
255
 
        MCFG_ACIA6850_ADD("acia6850", mirage_acia6850_interface)
256
 
 
257
 
        MCFG_WD1770_ADD("wd177x", mirage_wd17xx_interface )
258
 
        MCFG_FLOPPY_2_DRIVES_ADD(mirage_floppy_interface)
259
 
MACHINE_CONFIG_END
260
 
 
261
 
static INPUT_PORTS_START( mirage )
262
 
INPUT_PORTS_END
263
 
 
264
 
ROM_START( mirage )
265
 
        ROM_REGION(0x1000, "osrom", 0)
266
 
        ROM_LOAD( "mirage.bin",   0x0000, 0x1000, CRC(9fc7553c) SHA1(ec6ea5613eeafd21d8f3a7431a35a6ff16eed56d) )
267
 
 
268
 
        ROM_REGION(0x20000, "ensoniq", ROMREGION_ERASE)
269
 
ROM_END
270
 
 
271
 
CONS( 1984, mirage, 0, 0, mirage, mirage, 0, "Ensoniq", "Mirage", GAME_NOT_WORKING )
272