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

« back to all changes in this revision

Viewing changes to src/mame/drivers/nbmj8900.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:
32
32
#include "includes/nbmj8900.h"
33
33
 
34
34
 
35
 
#define SIGNED_DAC      0               // 0:unsigned DAC, 1:signed DAC
36
 
#if SIGNED_DAC
37
 
#define DAC_WRITE       dac_signed_w
38
 
#else
39
 
#define DAC_WRITE       dac_w
40
 
#endif
41
 
 
42
 
 
43
 
 
44
 
 
45
35
static DRIVER_INIT( ohpaipee )
46
36
{
47
37
#if 0
48
 
        UINT8 *prot = machine.region("protdata")->base();
 
38
        UINT8 *prot = machine.root_device().memregion("protdata")->base();
49
39
        int i;
50
40
 
51
41
        /* this is one possible way to rearrange the protection ROM data to get the
59
49
                prot[i] = BITSWAP8(prot[i],2,7,3,5,0,6,4,1);
60
50
        }
61
51
#else
62
 
        unsigned char *ROM = machine.region("maincpu")->base();
 
52
        unsigned char *ROM = machine.root_device().memregion("maincpu")->base();
63
53
 
64
54
        // Protection ROM check skip
65
55
        ROM[0x00e4] = 0x00;
71
61
#endif
72
62
 
73
63
        nb1413m3_type = NB1413M3_OHPAIPEE;
74
 
 
75
 
//  init_nb1413m3(machine);
76
64
}
77
65
 
78
66
static DRIVER_INIT( togenkyo )
79
67
{
80
68
#if 0
81
 
        UINT8 *prot = machine.region("protdata")->base();
 
69
        UINT8 *prot = machine.root_device().memregion("protdata")->base();
82
70
        int i;
83
71
 
84
72
        /* this is one possible way to rearrange the protection ROM data to get the
91
79
                prot[i] = BITSWAP8(prot[i],2,7,3,5,0,6,4,1);
92
80
        }
93
81
#else
94
 
        unsigned char *ROM = machine.region("maincpu")->base();
 
82
        unsigned char *ROM = machine.root_device().memregion("maincpu")->base();
95
83
 
96
84
        // Protection ROM check skip
97
85
        ROM[0x010b] = 0x00;
103
91
#endif
104
92
 
105
93
        nb1413m3_type = NB1413M3_TOGENKYO;
106
 
 
107
 
//S init_nb1413m3(machine);
108
94
}
109
95
 
110
96
 
111
 
static ADDRESS_MAP_START( ohpaipee_map, AS_PROGRAM, 8 )
112
 
        AM_RANGE(0x0000, 0xefff) AM_ROM
113
 
        AM_RANGE(0xf000, 0xf00f) AM_READWRITE(nbmj8900_clut_r, nbmj8900_clut_w)
114
 
        AM_RANGE(0xf400, 0xf5ff) AM_READWRITE(nbmj8900_palette_type1_r, nbmj8900_palette_type1_w)
115
 
        AM_RANGE(0xf800, 0xffff) AM_RAM
116
 
ADDRESS_MAP_END
117
 
 
118
 
static ADDRESS_MAP_START( togenkyo_map, AS_PROGRAM, 8 )
119
 
        AM_RANGE(0x0000, 0xefff) AM_ROM
120
 
        AM_RANGE(0xf000, 0xf00f) AM_READWRITE(nbmj8900_clut_r, nbmj8900_clut_w)
121
 
        AM_RANGE(0xf400, 0xf5ff) AM_READWRITE(nbmj8900_palette_type1_r, nbmj8900_palette_type1_w)
122
 
        AM_RANGE(0xf800, 0xffff) AM_RAM
123
 
ADDRESS_MAP_END
124
 
 
125
 
static ADDRESS_MAP_START( ohpaipee_io_map, AS_IO, 8 )
 
97
static ADDRESS_MAP_START( ohpaipee_map, AS_PROGRAM, 8, nbmj8900_state )
 
98
        AM_RANGE(0x0000, 0xefff) AM_ROM
 
99
        AM_RANGE(0xf000, 0xf00f) AM_READWRITE(nbmj8900_clut_r, nbmj8900_clut_w)
 
100
        AM_RANGE(0xf400, 0xf5ff) AM_READWRITE(nbmj8900_palette_type1_r, nbmj8900_palette_type1_w)
 
101
        AM_RANGE(0xf800, 0xffff) AM_RAM
 
102
ADDRESS_MAP_END
 
103
 
 
104
static ADDRESS_MAP_START( togenkyo_map, AS_PROGRAM, 8, nbmj8900_state )
 
105
        AM_RANGE(0x0000, 0xefff) AM_ROM
 
106
        AM_RANGE(0xf000, 0xf00f) AM_READWRITE(nbmj8900_clut_r, nbmj8900_clut_w)
 
107
        AM_RANGE(0xf400, 0xf5ff) AM_READWRITE(nbmj8900_palette_type1_r, nbmj8900_palette_type1_w)
 
108
        AM_RANGE(0xf800, 0xffff) AM_RAM
 
109
ADDRESS_MAP_END
 
110
 
 
111
static ADDRESS_MAP_START( ohpaipee_io_map, AS_IO, 8, nbmj8900_state )
126
112
        ADDRESS_MAP_GLOBAL_MASK(0xff)
127
 
        AM_RANGE(0x00, 0x7f) AM_READ(nb1413m3_sndrom_r)
128
 
        AM_RANGE(0x00, 0x00) AM_WRITE(nb1413m3_nmi_clock_w)
 
113
        AM_RANGE(0x00, 0x7f) AM_READ_LEGACY(nb1413m3_sndrom_r)
 
114
        AM_RANGE(0x00, 0x00) AM_WRITE_LEGACY(nb1413m3_nmi_clock_w)
129
115
        AM_RANGE(0x20, 0x27) AM_WRITE(nbmj8900_blitter_w)
130
116
 
131
117
        AM_RANGE(0x40, 0x40) AM_WRITE(nbmj8900_clutsel_w)
132
118
        AM_RANGE(0x60, 0x60) AM_WRITE(nbmj8900_romsel_w)
133
119
        AM_RANGE(0x70, 0x70) AM_WRITE(nbmj8900_scrolly_w)
134
120
 
135
 
        AM_RANGE(0x80, 0x81) AM_DEVREADWRITE("ymsnd", ym3812_r,ym3812_w)
136
 
 
137
 
        AM_RANGE(0x90, 0x90) AM_READ(nb1413m3_inputport0_r)
138
 
 
139
 
        AM_RANGE(0xa0, 0xa0) AM_READWRITE(nb1413m3_inputport1_r,nb1413m3_inputportsel_w)
140
 
        AM_RANGE(0xb0, 0xb0) AM_READWRITE(nb1413m3_inputport2_r,nb1413m3_sndrombank1_w)
141
 
        AM_RANGE(0xc0, 0xc0) AM_READ(nb1413m3_inputport3_r)
142
 
        AM_RANGE(0xd0, 0xd0) AM_DEVWRITE("dac", DAC_WRITE)
 
121
        AM_RANGE(0x80, 0x81) AM_DEVREADWRITE_LEGACY("ymsnd", ym3812_r,ym3812_w)
 
122
 
 
123
        AM_RANGE(0x90, 0x90) AM_READ_LEGACY(nb1413m3_inputport0_r)
 
124
 
 
125
        AM_RANGE(0xa0, 0xa0) AM_READWRITE_LEGACY(nb1413m3_inputport1_r,nb1413m3_inputportsel_w)
 
126
        AM_RANGE(0xb0, 0xb0) AM_READWRITE_LEGACY(nb1413m3_inputport2_r,nb1413m3_sndrombank1_w)
 
127
        AM_RANGE(0xc0, 0xc0) AM_READ_LEGACY(nb1413m3_inputport3_r)
 
128
        AM_RANGE(0xd0, 0xd0) AM_DEVWRITE_LEGACY("dac", dac_w)
143
129
        AM_RANGE(0xe0, 0xe0) AM_WRITE(nbmj8900_vramsel_w)
144
 
        AM_RANGE(0xf0, 0xf0) AM_READ(nb1413m3_dipsw1_r)
145
 
        AM_RANGE(0xf1, 0xf1) AM_READWRITE(nb1413m3_dipsw2_r, nb1413m3_outcoin_w)
 
130
        AM_RANGE(0xf0, 0xf0) AM_READ_LEGACY(nb1413m3_dipsw1_r)
 
131
        AM_RANGE(0xf1, 0xf1) AM_READWRITE_LEGACY(nb1413m3_dipsw2_r, nb1413m3_outcoin_w)
146
132
ADDRESS_MAP_END
147
133
 
148
134
 
341
327
        MCFG_SPEAKER_STANDARD_MONO("mono")
342
328
 
343
329
        MCFG_SOUND_ADD("ymsnd", YM3812, 2500000)
344
 
        MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
 
330
        MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.70)
345
331
 
346
332
        MCFG_SOUND_ADD("dac", DAC, 0)
347
 
        MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
 
333
        MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.85)
348
334
MACHINE_CONFIG_END
349
335
 
350
 
 
351
336
static MACHINE_CONFIG_DERIVED( togenkyo, ohpaipee )
352
337
 
353
338
        /* basic machine hardware */
356
341
MACHINE_CONFIG_END
357
342
 
358
343
 
359
 
 
360
344
ROM_START( ohpaipee )
361
345
        ROM_REGION( 0x10000, "maincpu", 0 ) /* program */
362
346
        ROM_LOAD( "02.3h",  0x00000, 0x10000, CRC(2b6c9afc) SHA1(591a7016ebd99d4a2bfdef5e99da3a1ac9d30d75) )