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

« back to all changes in this revision

Viewing changes to src/mame/drivers/goodejan.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:
56
56
#include "sound/3812intf.h"
57
57
#include "includes/sei_crtc.h"
58
58
 
 
59
 
 
60
class goodejan_state : public driver_device
 
61
{
 
62
public:
 
63
        goodejan_state(running_machine &machine, const driver_device_config_base &config)
 
64
                : driver_device(machine, config) { }
 
65
 
 
66
        UINT16 m_mux_data;
 
67
};
 
68
 
 
69
 
59
70
#define GOODEJAN_MHZ1 7159090
60
71
#define GOODEJAN_MHZ2 16000000
61
72
#define GOODEJAN_MHZ3 12000000
62
73
 
63
 
static UINT16 goodejan_mux_data;
64
74
 
65
75
static WRITE16_HANDLER( goodejan_gfxbank_w )
66
76
{
70
80
/* Multiplexer device for the mahjong panel */
71
81
static READ16_HANDLER( mahjong_panel_r )
72
82
{
 
83
        goodejan_state *state = space->machine().driver_data<goodejan_state>();
73
84
        UINT16 ret;
74
85
        ret = 0xffff;
75
86
 
76
 
        switch(goodejan_mux_data)
 
87
        switch(state->m_mux_data)
77
88
        {
78
 
                case 1:    ret = input_port_read(space->machine, "KEY0"); break;
79
 
                case 2:    ret = input_port_read(space->machine, "KEY1"); break;
80
 
                case 4:    ret = input_port_read(space->machine, "KEY2"); break;
81
 
                case 8:    ret = input_port_read(space->machine, "KEY3"); break;
82
 
                case 0x10: ret = input_port_read(space->machine, "KEY4"); break;
 
89
                case 1:    ret = input_port_read(space->machine(), "KEY0"); break;
 
90
                case 2:    ret = input_port_read(space->machine(), "KEY1"); break;
 
91
                case 4:    ret = input_port_read(space->machine(), "KEY2"); break;
 
92
                case 8:    ret = input_port_read(space->machine(), "KEY3"); break;
 
93
                case 0x10: ret = input_port_read(space->machine(), "KEY4"); break;
83
94
        }
84
95
 
85
96
        return ret;
87
98
 
88
99
static WRITE16_HANDLER( mahjong_panel_w )
89
100
{
90
 
        goodejan_mux_data = data;
 
101
        goodejan_state *state = space->machine().driver_data<goodejan_state>();
 
102
        state->m_mux_data = data;
91
103
}
92
104
 
93
 
static ADDRESS_MAP_START( goodejan_map, ADDRESS_SPACE_PROGRAM, 16 )
 
105
static ADDRESS_MAP_START( goodejan_map, AS_PROGRAM, 16 )
94
106
        AM_RANGE(0x00000, 0x0afff) AM_RAM
95
107
        AM_RANGE(0x0c000, 0x0c7ff) AM_RAM_WRITE(seibucrtc_sc0vram_w) AM_BASE(&seibucrtc_sc0vram)
96
108
        AM_RANGE(0x0c800, 0x0cfff) AM_RAM_WRITE(seibucrtc_sc3vram_w) AM_BASE(&seibucrtc_sc3vram)
98
110
        /*Guess: these two aren't used/initialized at all.*/
99
111
        AM_RANGE(0x0e000, 0x0e7ff) AM_RAM_WRITE(seibucrtc_sc1vram_w) AM_BASE(&seibucrtc_sc1vram)
100
112
        AM_RANGE(0x0e800, 0x0efff) AM_RAM_WRITE(seibucrtc_sc2vram_w) AM_BASE(&seibucrtc_sc2vram)
101
 
        AM_RANGE(0x0f800, 0x0ffff) AM_RAM AM_BASE_GENERIC(spriteram)
 
113
        AM_RANGE(0x0f800, 0x0ffff) AM_RAM AM_SHARE("spriteram")
102
114
        AM_RANGE(0xc0000, 0xfffff) AM_ROM
103
115
ADDRESS_MAP_END
104
116
 
105
117
/*totmejan CRT is at 8000-804f,goodejan is at 8040-807f(808f but not tested)*/
106
 
static ADDRESS_MAP_START( common_io_map, ADDRESS_SPACE_IO, 16 )
 
118
static ADDRESS_MAP_START( common_io_map, AS_IO, 16 )
107
119
        AM_RANGE(0x9000, 0x9001) AM_WRITE(goodejan_gfxbank_w)
108
120
        AM_RANGE(0xb000, 0xb003) AM_WRITENOP
109
121
        AM_RANGE(0xb004, 0xb005) AM_WRITE(mahjong_panel_w)
114
126
        AM_RANGE(0xd000, 0xd00f) AM_READWRITE(seibu_main_word_r, seibu_main_word_w)
115
127
ADDRESS_MAP_END
116
128
 
117
 
static ADDRESS_MAP_START( totmejan_io_map, ADDRESS_SPACE_IO, 16 )
 
129
static ADDRESS_MAP_START( totmejan_io_map, AS_IO, 16 )
118
130
        AM_RANGE(0x8000, 0x804f) AM_RAM_WRITE(seibucrtc_vregs_w) AM_BASE(&seibucrtc_vregs)
119
131
        AM_IMPORT_FROM(common_io_map)
120
132
ADDRESS_MAP_END
121
133
 
122
 
static ADDRESS_MAP_START( goodejan_io_map, ADDRESS_SPACE_IO, 16 )
 
134
static ADDRESS_MAP_START( goodejan_io_map, AS_IO, 16 )
123
135
        AM_RANGE(0x8040, 0x807f) AM_RAM_WRITE(seibucrtc_vregs_w) AM_BASE(&seibucrtc_vregs)
124
136
        AM_IMPORT_FROM(common_io_map)
125
137
ADDRESS_MAP_END
318
330
 
319
331
static INTERRUPT_GEN( goodejan_irq )
320
332
{
321
 
        cpu_set_input_line_and_vector(device,0,HOLD_LINE,0x208/4);
 
333
        device_set_input_line_and_vector(device,0,HOLD_LINE,0x208/4);
322
334
/* vector 0x00c is just a reti */
323
335
}
324
336
 
325
 
static MACHINE_CONFIG_START( goodejan, driver_device )
 
337
static MACHINE_CONFIG_START( goodejan, goodejan_state )
326
338
 
327
339
        /* basic machine hardware */
328
340
        MCFG_CPU_ADD("maincpu", V30, GOODEJAN_MHZ2/2)
341
353
        MCFG_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
342
354
        MCFG_SCREEN_SIZE(32*8, 32*8)
343
355
        MCFG_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1) //TODO: dynamic resolution
 
356
        MCFG_SCREEN_UPDATE(seibu_crtc)
344
357
 
345
358
        MCFG_GFXDECODE(goodejan)
346
359
        MCFG_PALETTE_LENGTH(0x1000)
347
360
 
348
361
        MCFG_VIDEO_START(seibu_crtc)
349
 
        MCFG_VIDEO_UPDATE(seibu_crtc)
350
362
 
351
363
        /* sound hardware */
352
364
        SEIBU_SOUND_SYSTEM_YM3812_INTERFACE(GOODEJAN_MHZ1/2,GOODEJAN_MHZ2/16)