~ubuntu-branches/debian/wheezy/mame/wheezy

« back to all changes in this revision

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

  • Committer: Bazaar Package Importer
  • Author(s): Jordi Mallach, Emmanuel Kasper, Félix Arreola Rodríguez, Jordi Mallach
  • Date: 2011-05-11 21:06:50 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20110511210650-jizvh8a6x117y9hr
Tags: 0.142-1
[ Emmanuel Kasper ]
* New upstream release
* Set NOWERROR=1 to allow compiling with gcc-4.6
* Remove fix_powerpc_build.patch, as upstream has taken it in this release
* Add gnome-video-arcade front end as a suggested package

[ Félix Arreola Rodríguez ]
* Add kfreebsd-build.patch to quilt series, to fix build on kfreebsd

[ Jordi Mallach ]
* Remove unneeded and bogus addition of --with-quilt to the dh invocation.
* Add Cesare Falco (long time Ubuntu maintainer) to Uploaders, and wrap
  them into multiple lines.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/***************************************************************************
2
2
 
3
 
Multipede (c) 1980-2 Infogrames / 199x CosmoDog
 
3
Centipede, Millipede, Missile Command, Let's Go Bowling "Multipede"
 
4
(c) 1980-2 / 2002 - Infogrames / CosmoDog
4
5
 
5
6
preliminary driver by Angelo Salese
6
7
 
 
8
Earlier revisions of this cabinet did not include the bowling game.
 
9
 
7
10
TODO:
8
11
- program banking;
9
12
- finish video emulation;
10
13
- inputs;
11
14
- sound;
 
15
- change the CPU when a G658C02 core will be available;
 
16
- driver probably needs rewriting, at least the i/o part;
 
17
 
 
18
Probably on the CPLD (CY39100V208B) - Quoted from Cosmodog's website:
 
19
 "Instead, we used a programmable chip that we could reconfigure very
 
20
 quickly while the game is running. So, during that 1/8th of a second
 
21
 or so when the screen goes black while it switches games, it's actually
 
22
 reloading the hardware with a whole new design to run the next game."
12
23
 
13
24
============================================================================
14
25
 
28
39
***************************************************************************/
29
40
 
30
41
#include "emu.h"
31
 
#include "cpu/m6502/m6502.h"
 
42
#include "cpu/g65816/g65816.h"
32
43
 
33
44
 
34
45
class cmmb_state : public driver_device
37
48
        cmmb_state(running_machine &machine, const driver_device_config_base &config)
38
49
                : driver_device(machine, config) { }
39
50
 
40
 
        UINT8 *videoram;
 
51
        UINT8 *m_videoram;
 
52
        UINT8 m_irq_mask;
41
53
};
42
54
 
43
55
 
46
58
 
47
59
}
48
60
 
49
 
static VIDEO_UPDATE( cmmb )
 
61
static SCREEN_UPDATE( cmmb )
50
62
{
51
 
        cmmb_state *state = screen->machine->driver_data<cmmb_state>();
52
 
        UINT8 *videoram = state->videoram;
53
 
        const gfx_element *gfx = screen->machine->gfx[0];
 
63
        cmmb_state *state = screen->machine().driver_data<cmmb_state>();
 
64
        UINT8 *videoram = state->m_videoram;
 
65
        const gfx_element *gfx = screen->machine().gfx[0];
54
66
        int count = 0x00000;
55
67
 
56
68
        int y,x;
73
85
 
74
86
static READ8_HANDLER( cmmb_charram_r )
75
87
{
76
 
        UINT8 *GFX = space->machine->region("gfx")->base();
 
88
        UINT8 *GFX = space->machine().region("gfx")->base();
77
89
 
78
90
        return GFX[offset];
79
91
}
80
92
 
81
93
static WRITE8_HANDLER( cmmb_charram_w )
82
94
{
83
 
        UINT8 *GFX = space->machine->region("gfx")->base();
 
95
        UINT8 *GFX = space->machine().region("gfx")->base();
84
96
 
85
97
        GFX[offset] = data;
86
98
 
87
99
        offset&=0xfff;
88
100
 
89
101
        /* dirty char */
90
 
        gfx_element_mark_dirty(space->machine->gfx[0], offset >> 4);
91
 
    gfx_element_mark_dirty(space->machine->gfx[1], offset >> 5);
 
102
        gfx_element_mark_dirty(space->machine().gfx[0], offset >> 4);
 
103
    gfx_element_mark_dirty(space->machine().gfx[1], offset >> 5);
92
104
}
93
105
 
94
106
 
103
115
        //printf("%02x R\n",offset);
104
116
        switch(offset)
105
117
        {
106
 
                case 0x00: return input_port_read(space->machine, "IN2");
 
118
                case 0x00: return input_port_read(space->machine(), "IN2");
107
119
                case 0x03: return 4; //eeprom?
108
 
                case 0x0e: return input_port_read(space->machine, "IN0");
109
 
                case 0x0f: return input_port_read(space->machine, "IN1");
 
120
                case 0x0e: return input_port_read(space->machine(), "IN0");
 
121
                case 0x0f: return input_port_read(space->machine(), "IN1");
110
122
        }
111
123
 
112
124
        return 0xff;
113
125
}
114
126
 
115
 
static UINT8 irq_mask;
116
127
 
117
128
/*
118
129
    {
119
 
        UINT8 *ROM = space->machine->region("maincpu")->base();
 
130
        UINT8 *ROM = space->machine().region("maincpu")->base();
120
131
        UINT32 bankaddress;
121
132
 
122
133
        bankaddress = 0x10000 + (0x10000 * (data & 0x03));
123
 
        memory_set_bankptr(space->machine, "bank1", &ROM[bankaddress]);
 
134
        memory_set_bankptr(space->machine(), "bank1", &ROM[bankaddress]);
124
135
    }
125
136
*/
126
137
 
127
138
static WRITE8_HANDLER( cmmb_output_w )
128
139
{
 
140
        cmmb_state *state = space->machine().driver_data<cmmb_state>();
129
141
        //printf("%02x -> [%02x] W\n",data,offset);
130
142
        switch(offset)
131
143
        {
132
144
                case 0x01:
133
145
                        {
134
 
                                UINT8 *ROM = space->machine->region("maincpu")->base();
 
146
                                UINT8 *ROM = space->machine().region("maincpu")->base();
135
147
                                UINT32 bankaddress;
136
148
 
137
149
                                bankaddress = 0x1c000 + (0x10000 * (data & 0x03));
138
 
                                memory_set_bankptr(space->machine, "bank1", &ROM[bankaddress]);
 
150
                                memory_set_bankptr(space->machine(), "bank1", &ROM[bankaddress]);
139
151
                        }
140
152
                        break;
141
153
                case 0x03:
142
 
                        irq_mask = data & 0x80;
 
154
                        state->m_irq_mask = data & 0x80;
143
155
                        break;
144
156
                case 0x07:
145
157
                        break;
148
160
 
149
161
static READ8_HANDLER( kludge_r )
150
162
{
151
 
        return space->machine->rand();
 
163
        return space->machine().rand();
152
164
}
153
165
 
154
166
/* overlap empty addresses */
155
 
static ADDRESS_MAP_START( cmmb_map, ADDRESS_SPACE_PROGRAM, 8 )
 
167
static ADDRESS_MAP_START( cmmb_map, AS_PROGRAM, 8 )
 
168
        ADDRESS_MAP_GLOBAL_MASK(0xffff)
156
169
        AM_RANGE(0x0000, 0x01ff) AM_RAM /* zero page address */
157
170
//  AM_RANGE(0x13c0, 0x13ff) AM_RAM //spriteram
158
 
        AM_RANGE(0x1000, 0x13ff) AM_RAM AM_BASE_MEMBER(cmmb_state, videoram)
 
171
        AM_RANGE(0x1000, 0x13ff) AM_RAM AM_BASE_MEMBER(cmmb_state, m_videoram)
159
172
        AM_RANGE(0x2480, 0x249f) AM_RAM_WRITE(cmmb_paletteram_w) AM_BASE_GENERIC(paletteram)
160
173
        AM_RANGE(0x4000, 0x400f) AM_READWRITE(cmmb_input_r,cmmb_output_w) //i/o
161
174
        AM_RANGE(0x4900, 0x4900) AM_READ(kludge_r)
275
288
 
276
289
static INTERRUPT_GEN( cmmb_irq )
277
290
{
278
 
        //if(input_code_pressed_once(device->machine, KEYCODE_Z))
279
 
        //  cpu_set_input_line(device, 0, HOLD_LINE);
 
291
        //if(input_code_pressed_once(device->machine(), KEYCODE_Z))
 
292
        //  device_set_input_line(device, 0, HOLD_LINE);
280
293
}
281
294
 
282
295
static MACHINE_RESET( cmmb )
286
299
static MACHINE_CONFIG_START( cmmb, cmmb_state )
287
300
 
288
301
        /* basic machine hardware */
289
 
        MCFG_CPU_ADD("maincpu",M65C02,8000000/2) // unknown clock
 
302
        MCFG_CPU_ADD("maincpu",G65816,8000000/2) // G658C02 (a G65816 with 64k of address line space), unknown clock
290
303
        MCFG_CPU_PROGRAM_MAP(cmmb_map)
291
304
        MCFG_CPU_VBLANK_INT("screen",cmmb_irq)
292
305
 
297
310
        MCFG_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
298
311
        MCFG_SCREEN_SIZE(32*8, 32*8)
299
312
        MCFG_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 0*8, 32*8-1)
 
313
        MCFG_SCREEN_UPDATE(cmmb)
 
314
 
300
315
        MCFG_GFXDECODE(cmmb)
301
316
        MCFG_PALETTE_LENGTH(512)
302
317
 
303
318
        MCFG_VIDEO_START(cmmb)
304
 
        MCFG_VIDEO_UPDATE(cmmb)
305
319
 
306
320
        MCFG_MACHINE_RESET(cmmb)
307
321
 
325
339
        ROM_REGION( 0x1000, "gfx", ROMREGION_ERASE00 )
326
340
ROM_END
327
341
 
328
 
GAME( 199?, cmmb162,  0,       cmmb,  cmmb,  0, ROT270, "Infogrames / Cosmodog", "Multipede (V1.00)", GAME_NO_SOUND|GAME_NOT_WORKING )
 
342
GAME( 2002, cmmb162,  0,       cmmb,  cmmb,  0, ROT270, "Infogrames / Cosmodog", "Multipede (rev 1.62)", GAME_NO_SOUND|GAME_NOT_WORKING )