~ubuntu-branches/debian/sid/mame/sid

« back to all changes in this revision

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

  • Committer: Package Import Robot
  • Author(s): Jordi Mallach, Emmanuel Kasper, Jordi Mallach
  • Date: 2012-06-05 20:02:23 UTC
  • mfrom: (0.3.1) (0.1.4)
  • Revision ID: package-import@ubuntu.com-20120605200223-gnlpogjrg6oqe9md
Tags: 0.146-1
[ Emmanuel Kasper ]
* New upstream release
* Drop patch to fix man pages section and patches to link with flac 
  and jpeg system lib: all this has been pushed upstream by Cesare Falco
* Add DM-Upload-Allowed: yes field.

[ Jordi Mallach ]
* Create a "gnu" TARGETOS stanza that defines NO_AFFINITY_NP.
* Stop setting TARGETOS to "unix" in d/rules. It should be autodetected,
  and set to the appropriate value.
* mame_manpage_section.patch: Change mame's manpage section to 6 (games),
  in the TH declaration.

Show diffs side-by-side

added added

removed removed

Lines of Context:
22
22
 
23
23
/***************************************************************************/
24
24
 
25
 
static WRITE8_HANDLER( pcktgal_bank_w )
26
 
{
27
 
        UINT8 *RAM = space->machine().region("maincpu")->base();
28
 
 
29
 
        if (data & 1) { memory_set_bankptr(space->machine(), "bank1", &RAM[0x4000]); }
30
 
        else { memory_set_bankptr(space->machine(), "bank1", &RAM[0x10000]); }
31
 
 
32
 
        if (data & 2) { memory_set_bankptr(space->machine(), "bank2", &RAM[0x6000]); }
33
 
        else { memory_set_bankptr(space->machine(), "bank2", &RAM[0x12000]); }
34
 
}
35
 
 
36
 
static WRITE8_HANDLER( pcktgal_sound_bank_w )
37
 
{
38
 
        memory_set_bank(space->machine(), "bank3", (data >> 2) & 1);
39
 
}
40
 
 
41
 
static WRITE8_HANDLER( pcktgal_sound_w )
42
 
{
43
 
        soundlatch_w(space, 0, data);
44
 
        cputag_set_input_line(space->machine(), "audiocpu", INPUT_LINE_NMI, PULSE_LINE);
 
25
WRITE8_MEMBER(pcktgal_state::pcktgal_bank_w)
 
26
{
 
27
        UINT8 *RAM = memregion("maincpu")->base();
 
28
 
 
29
        if (data & 1) { membank("bank1")->set_base(&RAM[0x4000]); }
 
30
        else { membank("bank1")->set_base(&RAM[0x10000]); }
 
31
 
 
32
        if (data & 2) { membank("bank2")->set_base(&RAM[0x6000]); }
 
33
        else { membank("bank2")->set_base(&RAM[0x12000]); }
 
34
}
 
35
 
 
36
WRITE8_MEMBER(pcktgal_state::pcktgal_sound_bank_w)
 
37
{
 
38
        membank("bank3")->set_entry((data >> 2) & 1);
 
39
}
 
40
 
 
41
WRITE8_MEMBER(pcktgal_state::pcktgal_sound_w)
 
42
{
 
43
        soundlatch_byte_w(space, 0, data);
 
44
        cputag_set_input_line(machine(), "audiocpu", INPUT_LINE_NMI, PULSE_LINE);
45
45
}
46
46
 
47
47
 
57
57
                cputag_set_input_line(device->machine(), "audiocpu", M6502_IRQ_LINE, HOLD_LINE);
58
58
}
59
59
 
60
 
static WRITE8_HANDLER( pcktgal_adpcm_data_w )
 
60
WRITE8_MEMBER(pcktgal_state::pcktgal_adpcm_data_w)
61
61
{
62
 
        pcktgal_state *state = space->machine().driver_data<pcktgal_state>();
63
 
        state->m_msm5205next=data;
 
62
        m_msm5205next=data;
64
63
}
65
64
 
66
65
static READ8_DEVICE_HANDLER( pcktgal_adpcm_reset_r )
71
70
 
72
71
/***************************************************************************/
73
72
 
74
 
static ADDRESS_MAP_START( pcktgal_map, AS_PROGRAM, 8 )
 
73
static ADDRESS_MAP_START( pcktgal_map, AS_PROGRAM, 8, pcktgal_state )
75
74
        AM_RANGE(0x0000, 0x07ff) AM_RAM
76
 
        AM_RANGE(0x0800, 0x0fff) AM_DEVREADWRITE("tilegen1", deco_bac06_pf_data_8bit_r, deco_bac06_pf_data_8bit_w)
77
 
        AM_RANGE(0x1000, 0x11ff) AM_RAM AM_BASE_SIZE_MEMBER(pcktgal_state, m_spriteram, m_spriteram_size)
 
75
        AM_RANGE(0x0800, 0x0fff) AM_DEVREADWRITE_LEGACY("tilegen1", deco_bac06_pf_data_8bit_r, deco_bac06_pf_data_8bit_w)
 
76
        AM_RANGE(0x1000, 0x11ff) AM_RAM AM_SHARE("spriteram")
78
77
        AM_RANGE(0x1800, 0x1800) AM_READ_PORT("P1")
79
 
        AM_RANGE(0x1800, 0x1807) AM_DEVWRITE("tilegen1", deco_bac06_pf_control0_8bit_w)
80
 
        AM_RANGE(0x1810, 0x181f) AM_DEVREADWRITE("tilegen1", deco_bac06_pf_control1_8bit_r, deco_bac06_pf_control1_8bit_w)
 
78
        AM_RANGE(0x1800, 0x1807) AM_DEVWRITE_LEGACY("tilegen1", deco_bac06_pf_control0_8bit_w)
 
79
        AM_RANGE(0x1810, 0x181f) AM_DEVREADWRITE_LEGACY("tilegen1", deco_bac06_pf_control1_8bit_r, deco_bac06_pf_control1_8bit_w)
81
80
 
82
81
        AM_RANGE(0x1a00, 0x1a00) AM_READ_PORT("P2") AM_WRITE(pcktgal_sound_w)
83
82
        AM_RANGE(0x1c00, 0x1c00) AM_READ_PORT("DSW") AM_WRITE(pcktgal_bank_w)
89
88
 
90
89
/***************************************************************************/
91
90
 
92
 
static ADDRESS_MAP_START( pcktgal_sound_map, AS_PROGRAM, 8 )
 
91
static ADDRESS_MAP_START( pcktgal_sound_map, AS_PROGRAM, 8, pcktgal_state )
93
92
        AM_RANGE(0x0000, 0x07ff) AM_RAM
94
 
        AM_RANGE(0x0800, 0x0801) AM_DEVWRITE("ym1", ym2203_w)
95
 
        AM_RANGE(0x1000, 0x1001) AM_DEVWRITE("ym2", ym3812_w)
 
93
        AM_RANGE(0x0800, 0x0801) AM_DEVWRITE_LEGACY("ym1", ym2203_w)
 
94
        AM_RANGE(0x1000, 0x1001) AM_DEVWRITE_LEGACY("ym2", ym3812_w)
96
95
        AM_RANGE(0x1800, 0x1800) AM_WRITE(pcktgal_adpcm_data_w) /* ADPCM data for the MSM5205 chip */
97
96
        AM_RANGE(0x2000, 0x2000) AM_WRITE(pcktgal_sound_bank_w)
98
 
        AM_RANGE(0x3000, 0x3000) AM_READ(soundlatch_r)
99
 
        AM_RANGE(0x3400, 0x3400) AM_DEVREAD("msm", pcktgal_adpcm_reset_r)       /* ? not sure */
 
97
        AM_RANGE(0x3000, 0x3000) AM_READ(soundlatch_byte_r)
 
98
        AM_RANGE(0x3400, 0x3400) AM_DEVREAD_LEGACY("msm", pcktgal_adpcm_reset_r)        /* ? not sure */
100
99
        AM_RANGE(0x4000, 0x7fff) AM_ROMBANK("bank3")
101
100
        AM_RANGE(0x8000, 0xffff) AM_ROM
102
101
ADDRESS_MAP_END
414
413
        int A;
415
414
        address_space *space = machine.device("audiocpu")->memory().space(AS_PROGRAM);
416
415
        UINT8 *decrypted = auto_alloc_array(machine, UINT8, 0x10000);
417
 
        UINT8 *rom = machine.region("audiocpu")->base();
 
416
        UINT8 *rom = machine.root_device().memregion("audiocpu")->base();
418
417
 
419
418
        space->set_decrypted_region(0x8000, 0xffff, decrypted);
420
419
 
422
421
        for (A = 0x8000;A < 0x18000;A++)
423
422
                decrypted[A-0x8000] = (rom[A] & 0x9f) | ((rom[A] & 0x20) << 1) | ((rom[A] & 0x40) >> 1);
424
423
 
425
 
        memory_configure_bank(machine, "bank3", 0, 2, machine.region("audiocpu")->base() + 0x10000, 0x4000);
426
 
        memory_configure_bank_decrypted(machine, "bank3", 0, 2, &decrypted[0x8000], 0x4000);
 
424
        machine.root_device().membank("bank3")->configure_entries(0, 2, machine.root_device().memregion("audiocpu")->base() + 0x10000, 0x4000);
 
425
        machine.root_device().membank("bank3")->configure_decrypted_entries(0, 2, &decrypted[0x8000], 0x4000);
427
426
}
428
427
 
429
428
static DRIVER_INIT( graphics )
430
429
{
431
 
        UINT8 *rom = machine.region("gfx1")->base();
432
 
        int len = machine.region("gfx1")->bytes();
 
430
        UINT8 *rom = machine.root_device().memregion("gfx1")->base();
 
431
        int len = machine.root_device().memregion("gfx1")->bytes();
433
432
        int i,j,temp[16];
434
433
 
435
 
        memory_configure_bank(machine, "bank3", 0, 2, machine.region("audiocpu")->base() + 0x10000, 0x4000);
 
434
        machine.root_device().membank("bank3")->configure_entries(0, 2, machine.root_device().memregion("audiocpu")->base() + 0x10000, 0x4000);
436
435
 
437
436
        /* Tile graphics roms have some swapped lines, original version only */
438
437
        for (i = 0x00000;i < len;i += 32)