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

« back to all changes in this revision

Viewing changes to src/mame/drivers/lgp.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:
68
68
#include "render.h"
69
69
#include "machine/laserdsc.h"
70
70
 
 
71
 
 
72
class lgp_state : public driver_device
 
73
{
 
74
public:
 
75
        lgp_state(running_machine &machine, const driver_device_config_base &config)
 
76
                : driver_device(machine, config) { }
 
77
 
 
78
        device_t *m_laserdisc;
 
79
        UINT8 *m_tile_ram;
 
80
        UINT8 *m_tile_control_ram;
 
81
        emu_timer *m_irq_timer;
 
82
};
 
83
 
 
84
 
71
85
/* From italiandoh's notes */
72
86
#define CPU_PCB_CLOCK (8000000)
73
87
#define SOUND_PCB_CLOCK (6000000)
74
88
 
75
 
/* Misc variables */
76
 
static device_t *laserdisc;
77
 
 
78
 
static UINT8 *tile_ram;
79
 
static UINT8 *tile_control_ram;
80
 
 
81
 
static emu_timer *irq_timer;
82
 
 
83
89
 
84
90
/* VIDEO GOODS */
85
 
static VIDEO_UPDATE( lgp )
 
91
static SCREEN_UPDATE( lgp )
86
92
{
 
93
        lgp_state *state = screen->machine().driver_data<lgp_state>();
87
94
        int charx, chary;
88
95
 
89
96
        /* make color 0 transparent */
90
 
        palette_set_color(screen->machine, 0, MAKE_ARGB(0,0,0,0));
 
97
        palette_set_color(screen->machine(), 0, MAKE_ARGB(0,0,0,0));
91
98
 
92
99
        /* clear */
93
100
        bitmap_fill(bitmap, cliprect, 0);
101
108
 
102
109
                        /* Somewhere there's a flag that offsets the tilemap by 0x100*x */
103
110
                        /* Palette is likely set somewhere as well (tile_control_ram?) */
104
 
                        drawgfx_transpen(bitmap, cliprect, screen->machine->gfx[0],
105
 
                                        tile_ram[current_screen_character],
 
111
                        drawgfx_transpen(bitmap, cliprect, screen->machine().gfx[0],
 
112
                                        state->m_tile_ram[current_screen_character],
106
113
                                        0,
107
114
                                        0, 0, charx*8, chary*8, 0);
108
115
                }
116
123
/* Main Z80 R/W */
117
124
static READ8_HANDLER(ldp_read)
118
125
{
119
 
        return laserdisc_data_r(laserdisc);
 
126
        lgp_state *state = space->machine().driver_data<lgp_state>();
 
127
        return laserdisc_data_r(state->m_laserdisc);
120
128
}
121
129
 
122
130
static WRITE8_HANDLER(ldp_write)
123
131
{
124
 
        laserdisc_data_w(laserdisc,data);
 
132
        lgp_state *state = space->machine().driver_data<lgp_state>();
 
133
        laserdisc_data_w(state->m_laserdisc,data);
125
134
}
126
135
 
127
136
 
129
138
 
130
139
 
131
140
/* PROGRAM MAPS */
132
 
static ADDRESS_MAP_START( main_program_map, ADDRESS_SPACE_PROGRAM, 8 )
 
141
static ADDRESS_MAP_START( main_program_map, AS_PROGRAM, 8 )
133
142
        AM_RANGE(0x0000,0x7fff) AM_ROM
134
 
        AM_RANGE(0xe000,0xe3ff) AM_RAM AM_BASE(&tile_ram)
135
 
        AM_RANGE(0xe400,0xe7ff) AM_RAM AM_BASE(&tile_control_ram)
 
143
        AM_RANGE(0xe000,0xe3ff) AM_RAM AM_BASE_MEMBER(lgp_state, m_tile_ram)
 
144
        AM_RANGE(0xe400,0xe7ff) AM_RAM AM_BASE_MEMBER(lgp_state, m_tile_control_ram)
136
145
 
137
146
//  AM_RANGE(0xef00,0xef00) AM_READ_PORT("IN_TEST")
138
147
        AM_RANGE(0xef80,0xef80) AM_READWRITE(ldp_read,ldp_write)
145
154
        AM_RANGE(0xf000,0xffff) AM_RAM
146
155
ADDRESS_MAP_END
147
156
 
148
 
static ADDRESS_MAP_START( sound_program_map, ADDRESS_SPACE_PROGRAM, 8 )
 
157
static ADDRESS_MAP_START( sound_program_map, AS_PROGRAM, 8 )
149
158
        AM_RANGE(0x0000,0x3fff) AM_ROM
150
159
        AM_RANGE(0x8000,0x83ff) AM_RAM
151
160
        AM_RANGE(0x8400,0x8407) AM_RAM          /* Needs handler!  Communications? */
154
163
 
155
164
 
156
165
/* IO MAPS */
157
 
static ADDRESS_MAP_START( main_io_map, ADDRESS_SPACE_IO, 8 )
 
166
static ADDRESS_MAP_START( main_io_map, AS_IO, 8 )
158
167
        ADDRESS_MAP_GLOBAL_MASK(0xff)
159
168
//  AM_RANGE(0xfd,0xfd) AM_READ_PORT("IN_TEST")
160
169
//  AM_RANGE(0xfe,0xfe) AM_READ_PORT("IN_TEST")
161
170
ADDRESS_MAP_END
162
171
 
163
 
static ADDRESS_MAP_START( sound_io_map, ADDRESS_SPACE_IO, 8 )
 
172
static ADDRESS_MAP_START( sound_io_map, AS_IO, 8 )
164
173
        ADDRESS_MAP_GLOBAL_MASK(0xff)
165
174
ADDRESS_MAP_END
166
175
 
324
333
 
325
334
static INTERRUPT_GEN( vblank_callback_lgp )
326
335
{
 
336
        lgp_state *state = device->machine().driver_data<lgp_state>();
327
337
        // NMI
328
 
        //cpu_set_input_line(device, INPUT_LINE_NMI, PULSE_LINE);
 
338
        //device_set_input_line(device, INPUT_LINE_NMI, PULSE_LINE);
329
339
 
330
340
        // IRQ
331
 
        cpu_set_input_line(device, 0, ASSERT_LINE);
332
 
        timer_adjust_oneshot(irq_timer, ATTOTIME_IN_USEC(50), 0);
 
341
        device_set_input_line(device, 0, ASSERT_LINE);
 
342
        state->m_irq_timer->adjust(attotime::from_usec(50));
333
343
}
334
344
 
335
345
 
336
346
static MACHINE_START( lgp )
337
347
{
338
 
        laserdisc = machine->device("laserdisc");
339
 
    irq_timer = timer_alloc(machine, irq_stop, 0);
 
348
        lgp_state *state = machine.driver_data<lgp_state>();
 
349
        state->m_laserdisc = machine.device("laserdisc");
 
350
        state->m_irq_timer = machine.scheduler().timer_alloc(FUNC(irq_stop));
340
351
}
341
352
 
342
353
 
343
354
/* DRIVER */
344
 
static MACHINE_CONFIG_START( lgp, driver_device )
 
355
static MACHINE_CONFIG_START( lgp, lgp_state )
345
356
        /* main cpu */
346
357
        MCFG_CPU_ADD("maincpu", Z80, CPU_PCB_CLOCK)
347
358
        MCFG_CPU_PROGRAM_MAP(main_program_map)