~ubuntu-branches/ubuntu/precise/mame/precise-proposed

« back to all changes in this revision

Viewing changes to src/mame/drivers/mquake.c

  • Committer: Package Import Robot
  • Author(s): Cesare Falco
  • Date: 2011-11-30 18:50:10 UTC
  • mfrom: (1.1.4)
  • Revision ID: package-import@ubuntu.com-20111130185010-02hcxybht1mn082w
Tags: 0.144-0ubuntu1
* New upstream release (LP: #913550)
* mame.install:
  - Added artwork/ images to be used with -effect switch
  - Be more selective with hash/ contents
* contrib/mame.ini: added /usr/share/games/mame/artwork/ to artpath

Show diffs side-by-side

added added

removed removed

Lines of Context:
13
13
#include "sound/es5503.h"
14
14
#include "machine/6526cia.h"
15
15
#include "machine/nvram.h"
 
16
#include "machine/amigafdc.h"
16
17
 
17
18
 
18
19
 
84
85
 *
85
86
 *************************************/
86
87
 
87
 
static WRITE8_DEVICE_HANDLER( mquake_es5503_w )
 
88
static READ8_HANDLER( es5503_sample_r )
88
89
{
89
 
        // 5503 ROM is banked by the output channel (it's a handy 4-bit output from the 5503)
90
 
        if (offset < 0xe0)
91
 
        {
92
 
                // if it's an oscillator control register
93
 
                if ((offset & 0xe0) == 0xa0)
94
 
                {
95
 
                        // if not writing a "halt", set the bank
96
 
                        if (!(data & 1))
97
 
                        {
98
 
                                es5503_set_base(device, device->machine().region("ensoniq")->base() + ((data>>4)*0x10000));
99
 
                        }
100
 
                }
101
 
        }
 
90
        UINT8 *rom = space->machine().region("es5503")->base();
 
91
        es5503_device *es5503 = space->machine().device<es5503_device>("es5503");
102
92
 
103
 
        es5503_w(device, offset, data);
 
93
        return rom[offset + (es5503->get_channel_strobe() * 0x10000)];
104
94
}
105
95
 
 
96
static ADDRESS_MAP_START( mquake_es5503_map, AS_0, 8 )
 
97
        AM_RANGE(0x000000, 0x1ffff) AM_READ(es5503_sample_r)
 
98
ADDRESS_MAP_END
106
99
 
107
100
static WRITE16_HANDLER( output_w )
108
101
{
147
140
        AM_RANGE(0xfc0000, 0xffffff) AM_ROM AM_REGION("user1", 0)                       /* System ROM */
148
141
 
149
142
        AM_RANGE(0x200000, 0x203fff) AM_RAM AM_SHARE("nvram")
150
 
        AM_RANGE(0x204000, 0x2041ff) AM_DEVREADWRITE8("ensoniq", es5503_r, mquake_es5503_w, 0x00ff)
 
143
        AM_RANGE(0x204000, 0x2041ff) AM_DEVREADWRITE8_MODERN("es5503", es5503_device, read, write, 0x00ff)
151
144
        AM_RANGE(0x282000, 0x282001) AM_READ_PORT("SW.LO")
152
145
        AM_RANGE(0x282002, 0x282003) AM_READ_PORT("SW.HI")
153
146
        AM_RANGE(0x284000, 0x28400f) AM_WRITE(output_w)
309
302
 *
310
303
 *************************************/
311
304
 
312
 
static const es5503_interface es5503_intf =
313
 
{
314
 
        NULL,
315
 
        NULL,
316
 
        NULL
317
 
};
318
 
 
319
 
 
320
305
static MACHINE_RESET(mquake)
321
306
{
322
 
        /* set ES5503 wave memory (this is banked in 64k increments) */
323
 
        es5503_set_base(machine.device("ensoniq"), machine.region("ensoniq")->base());
324
 
 
325
307
        MACHINE_RESET_CALL(amiga);
326
308
}
327
309
 
391
373
        MCFG_SOUND_ROUTE(2, "rspeaker", 0.50)
392
374
        MCFG_SOUND_ROUTE(3, "lspeaker", 0.50)
393
375
 
394
 
        MCFG_SOUND_ADD("ensoniq", ES5503, 7159090)              /* ES5503 is likely mono due to channel strobe used as bank select */
395
 
        MCFG_SOUND_CONFIG(es5503_intf)
 
376
        MCFG_ES5503_ADD("es5503", 7159090, NULL, NULL)          /* ES5503 is likely mono due to channel strobe used as bank select */
 
377
        MCFG_DEVICE_ADDRESS_MAP(AS_0, mquake_es5503_map)
396
378
        MCFG_SOUND_ROUTE(0, "lspeaker", 0.50)
397
379
        MCFG_SOUND_ROUTE(0, "rspeaker", 0.50)
398
380
        MCFG_SOUND_ROUTE(1, "lspeaker", 0.50)
401
383
        /* cia */
402
384
        MCFG_MOS8520_ADD("cia_0", AMIGA_68000_NTSC_CLOCK / 10, cia_0_intf)
403
385
        MCFG_MOS8520_ADD("cia_1", AMIGA_68000_NTSC_CLOCK / 10, cia_1_intf)
 
386
 
 
387
        /* fdc */
 
388
        MCFG_AMIGA_FDC_ADD("fdc", AMIGA_68000_NTSC_CLOCK)
404
389
MACHINE_CONFIG_END
405
390
 
406
391
 
430
415
        ROM_LOAD16_BYTE( "rom5l.bin",    0xa0000, 0x10000, CRC(7b6ec532) SHA1(e19005269673134431eb55053d650f747f614b89) )
431
416
        ROM_LOAD16_BYTE( "rom5h.bin",    0xa0001, 0x10000, CRC(ed8ec9b7) SHA1(510416bc88382e7a548635dcba53a2b615272e0f) )
432
417
 
433
 
        ROM_REGION(0x040000, "ensoniq", 0)
 
418
        ROM_REGION(0x040000, "es5503", 0)
434
419
        ROM_LOAD( "qrom0.bin",    0x000000, 0x010000, CRC(753e29b4) SHA1(4c7ccff02d310c7c669aa170e8efb6f2cb996432) )
435
420
        ROM_LOAD( "qrom1.bin",    0x010000, 0x010000, CRC(e9e15629) SHA1(a0aa60357a13703f69a2a13e83f2187c9a1f63c1) )
436
421
        ROM_LOAD( "qrom2.bin",    0x020000, 0x010000, CRC(837294f7) SHA1(99e383998105a63896096629a51b3a0e9eb16b17) )
452
437
        {
453
438
                ANGUS_CHIP_RAM_MASK,
454
439
                NULL, NULL, NULL,
455
 
                NULL, NULL, NULL,
 
440
                NULL,
456
441
                NULL, NULL,
457
442
                NULL,
458
443
                0