trunk/src/mame/drivers/vmetal.c
| r20035 | r20036 | |
| 1 | | /* |
| 2 | | |
| 3 | | Varia Metal |
| 4 | | Excellent System Ltd, 1995 |
| 5 | | |
| 6 | | PCB Layout |
| 7 | | ---------- |
| 8 | | This game runs on Metro hardware. |
| 9 | | |
| 10 | | ES-9309B-B |
| 11 | | |--------------------------------------------| |
| 12 | | | TA7222 8.U9 DSW1(8) DSW2(8) | |
| 13 | | |VOL M6295 1.000MHz | |
| 14 | | | |------------| | |
| 15 | | | 7.U12 | 68000 | | |
| 16 | | | uPC3403 |------------| | |
| 17 | | |J 640kHz ES-8712 | |
| 18 | | |A M6585 EPM7032 6B.U18 5B.U19 | |
| 19 | | |M MM1035 | |
| 20 | | |M 26.666MHz 16MHz 62256 62256 | |
| 21 | | |A | |
| 22 | | | |--------| 1.U29 | |
| 23 | | | 62256 |Imagetek| | |
| 24 | | | 62256 |I4220 | 2.U31 | |
| 25 | | | | | | |
| 26 | | | |--------| 3.U28 | |
| 27 | | | | |
| 28 | | | 6264 4.U30 | |
| 29 | | |--------------------------------------------| |
| 30 | | Notes: |
| 31 | | 68000 - clock 16.000MHz |
| 32 | | ES-8712 - ES-8712 Single Channel ADPCM Samples Player. Clock ?? seems to be 16kHz? |
| 33 | | This chip is branded 'EXCELLENT', may be (or not??) manufactured by Ensonic (SDIP48) |
| 34 | | M6295 - clock 1.000MHz. Sample rate = 1000000/132 |
| 35 | | M6585 - Oki M6585 ADPCM Voice Synthesizer IC (DIP18). Clock 640kHz. |
| 36 | | Sample rate = 16kHz (selection - pin 1 LOW, pin 2 HIGH = 16kHz) |
| 37 | | This is a version-up to the previous M5205 with some additional |
| 38 | | capabilies and improvements. |
| 39 | | MM1035 - Mitsumi Monolithic IC MM1035 System Reset and Watchdog Timer (DIP8) |
| 40 | | uPC3403 - NEC uPC3403 High Performance Quad Operational Amplifier (DIP14) |
| 41 | | 62256 - 32k x8 SRAM (DIP28) |
| 42 | | 6264 - 8k x8 SRAM (DIP28) |
| 43 | | TA7222 - Toshiba TA7222 5.8 Watt Audio Power Amplifier (SIP10) |
| 44 | | EPM7032 - Altera EPM7032LC44-15T High Performance EEPROM-based Programmable Logic Device (PLCC44) |
| 45 | | Custom - Imagetek I4220 Graphics Controller (QFP208) |
| 46 | | VSync - 58.2328Hz |
| 47 | | HSync - 15.32kHz |
| 48 | | ROMs - |
| 49 | | 6B & 5B are 27C040 EPROM (DIP32) |
| 50 | | 8 is 4M MaskROM (DIP32) |
| 51 | | All other ROMs are 16M MaskROM (DIP42) |
| 52 | | |
| 53 | | |
| 54 | | |
| 55 | | |
| 56 | | Varia Metal |
| 57 | | |
| 58 | | Notes: |
| 59 | | |
| 60 | | ***** |
| 61 | | i should fully merge video with metro.c, it uses the same imagetek chip (although with 16x16 tiles) |
| 62 | | this should fix most of the remaining gfx glitches - looks very similar to 'taidoa' (stephh) |
| 63 | | ***** |
| 64 | | |
| 65 | | |
| 66 | | It has Sega and Taito logos in the roms ?! |
| 67 | | |
| 68 | | ES8712 sound may not be quite right. Samples are currently looped, but |
| 69 | | whether they should and how, is unknown. |
| 70 | | |
| 71 | | where does the M6585 hook up to? |
| 72 | | |
| 73 | | cleanup |
| 74 | | |
| 75 | | |
| 76 | | */ |
| 77 | | |
| 78 | | #include "emu.h" |
| 79 | | #include "cpu/m68000/m68000.h" |
| 80 | | #include "sound/okim6295.h" |
| 81 | | #include "sound/es8712.h" |
| 82 | | #include "includes/metro.h" |
| 83 | | |
| 84 | | class vmetal_state : public metro_state |
| 85 | | { |
| 86 | | public: |
| 87 | | vmetal_state(const machine_config &mconfig, device_type type, const char *tag) |
| 88 | | : metro_state(mconfig, type, tag), |
| 89 | | m_texttileram(*this, "texttileram"), |
| 90 | | m_mid1tileram(*this, "mid1tileram"), |
| 91 | | m_mid2tileram(*this, "mid2tileram"), |
| 92 | | m_tlookup(*this, "tlookup"), |
| 93 | | m_vmetal_videoregs(*this, "vmetal_regs") |
| 94 | | { } |
| 95 | | |
| 96 | | required_shared_ptr<UINT16> m_texttileram; |
| 97 | | required_shared_ptr<UINT16> m_mid1tileram; |
| 98 | | required_shared_ptr<UINT16> m_mid2tileram; |
| 99 | | required_shared_ptr<UINT16> m_tlookup; |
| 100 | | required_shared_ptr<UINT16> m_vmetal_videoregs; |
| 101 | | |
| 102 | | tilemap_t *m_texttilemap; |
| 103 | | tilemap_t *m_mid1tilemap; |
| 104 | | tilemap_t *m_mid2tilemap; |
| 105 | | DECLARE_READ16_MEMBER(varia_crom_read); |
| 106 | | DECLARE_WRITE16_MEMBER(vmetal_texttileram_w); |
| 107 | | DECLARE_WRITE16_MEMBER(vmetal_mid1tileram_w); |
| 108 | | DECLARE_WRITE16_MEMBER(vmetal_mid2tileram_w); |
| 109 | | DECLARE_READ16_MEMBER(varia_dips_bit8_r); |
| 110 | | DECLARE_READ16_MEMBER(varia_dips_bit7_r); |
| 111 | | DECLARE_READ16_MEMBER(varia_dips_bit6_r); |
| 112 | | DECLARE_READ16_MEMBER(varia_dips_bit5_r); |
| 113 | | DECLARE_READ16_MEMBER(varia_dips_bit4_r); |
| 114 | | DECLARE_READ16_MEMBER(varia_dips_bit3_r); |
| 115 | | DECLARE_READ16_MEMBER(varia_dips_bit2_r); |
| 116 | | DECLARE_READ16_MEMBER(varia_dips_bit1_r); |
| 117 | | DECLARE_WRITE8_MEMBER(vmetal_control_w); |
| 118 | | DECLARE_WRITE8_MEMBER(vmetal_es8712_w); |
| 119 | | TILE_GET_INFO_MEMBER(get_vmetal_texttilemap_tile_info); |
| 120 | | TILE_GET_INFO_MEMBER(get_vmetal_mid1tilemap_tile_info); |
| 121 | | TILE_GET_INFO_MEMBER(get_vmetal_mid2tilemap_tile_info); |
| 122 | | DECLARE_VIDEO_START(varia); |
| 123 | | UINT32 screen_update_varia(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
| 124 | | }; |
| 125 | | |
| 126 | | |
| 127 | | READ16_MEMBER(vmetal_state::varia_crom_read) |
| 128 | | { |
| 129 | | /* game reads the cgrom, result is 7772, verified to be correct on the real board */ |
| 130 | | |
| 131 | | |
| 132 | | UINT8 *cgrom = memregion("gfx1")->base(); |
| 133 | | UINT16 retdat; |
| 134 | | |
| 135 | | offset = offset << 1; |
| 136 | | offset |= (m_vmetal_videoregs[0x0ab / 2] & 0x7f) << 16; |
| 137 | | retdat = ((cgrom[offset] << 8) | (cgrom[offset + 1])); |
| 138 | | // popmessage("varia romread offset %06x data %04x", offset, retdat); |
| 139 | | |
| 140 | | return retdat; |
| 141 | | } |
| 142 | | |
| 143 | | |
| 144 | | static void get_vmetal_tlookup(running_machine &machine, UINT16 data, UINT16 *tileno, UINT16 *color) |
| 145 | | { |
| 146 | | vmetal_state *state = machine.driver_data<vmetal_state>(); |
| 147 | | int idx = ((data & 0x7fff) >> 4) * 2; |
| 148 | | UINT32 lookup = (state->m_tlookup[idx] << 16) | state->m_tlookup[idx + 1]; |
| 149 | | |
| 150 | | *tileno = (data & 0xf) | ((lookup >> 2) & 0xfff0); |
| 151 | | *color = (lookup >> 20) & 0xff; |
| 152 | | } |
| 153 | | |
| 154 | | |
| 155 | | WRITE16_MEMBER(vmetal_state::vmetal_texttileram_w) |
| 156 | | { |
| 157 | | |
| 158 | | COMBINE_DATA(&m_texttileram[offset]); |
| 159 | | m_texttilemap->mark_tile_dirty(offset); |
| 160 | | } |
| 161 | | |
| 162 | | WRITE16_MEMBER(vmetal_state::vmetal_mid1tileram_w) |
| 163 | | { |
| 164 | | |
| 165 | | COMBINE_DATA(&m_mid1tileram[offset]); |
| 166 | | m_mid1tilemap->mark_tile_dirty(offset); |
| 167 | | } |
| 168 | | |
| 169 | | WRITE16_MEMBER(vmetal_state::vmetal_mid2tileram_w) |
| 170 | | { |
| 171 | | |
| 172 | | COMBINE_DATA(&m_mid2tileram[offset]); |
| 173 | | m_mid2tilemap->mark_tile_dirty(offset); |
| 174 | | } |
| 175 | | |
| 176 | | |
| 177 | | READ16_MEMBER(vmetal_state::varia_dips_bit8_r){ return ((ioport("DSW2")->read() & 0x80) << 0) | ((ioport("DSW1")->read() & 0x80) >> 1); } |
| 178 | | READ16_MEMBER(vmetal_state::varia_dips_bit7_r){ return ((ioport("DSW2")->read() & 0x40) << 1) | ((ioport("DSW1")->read() & 0x40) >> 0); } |
| 179 | | READ16_MEMBER(vmetal_state::varia_dips_bit6_r){ return ((ioport("DSW2")->read() & 0x20) << 2) | ((ioport("DSW1")->read() & 0x20) << 1); } |
| 180 | | READ16_MEMBER(vmetal_state::varia_dips_bit5_r){ return ((ioport("DSW2")->read() & 0x10) << 3) | ((ioport("DSW1")->read() & 0x10) << 2); } |
| 181 | | READ16_MEMBER(vmetal_state::varia_dips_bit4_r){ return ((ioport("DSW2")->read() & 0x08) << 4) | ((ioport("DSW1")->read() & 0x08) << 3); } |
| 182 | | READ16_MEMBER(vmetal_state::varia_dips_bit3_r){ return ((ioport("DSW2")->read() & 0x04) << 5) | ((ioport("DSW1")->read() & 0x04) << 4); } |
| 183 | | READ16_MEMBER(vmetal_state::varia_dips_bit2_r){ return ((ioport("DSW2")->read() & 0x02) << 6) | ((ioport("DSW1")->read() & 0x02) << 5); } |
| 184 | | READ16_MEMBER(vmetal_state::varia_dips_bit1_r){ return ((ioport("DSW2")->read() & 0x01) << 7) | ((ioport("DSW1")->read() & 0x01) << 6); } |
| 185 | | |
| 186 | | WRITE8_MEMBER(vmetal_state::vmetal_control_w) |
| 187 | | { |
| 188 | | device_t *device = machine().device("essnd"); |
| 189 | | /* Lower nibble is the coin control bits shown in |
| 190 | | service mode, but in game mode they're different */ |
| 191 | | coin_counter_w(machine(), 0, data & 0x04); |
| 192 | | coin_counter_w(machine(), 1, data & 0x08); /* 2nd coin schute activates coin 0 counter in game mode?? */ |
| 193 | | // coin_lockout_w(machine(), 0, data & 0x01); /* always on in game mode?? */ |
| 194 | | coin_lockout_w(machine(), 1, data & 0x02); /* never activated in game mode?? */ |
| 195 | | |
| 196 | | if ((data & 0x40) == 0) |
| 197 | | device->reset(); |
| 198 | | else |
| 199 | | es8712_play(device); |
| 200 | | |
| 201 | | if (data & 0x10) |
| 202 | | es8712_set_bank_base(device, 0x100000); |
| 203 | | else |
| 204 | | es8712_set_bank_base(device, 0x000000); |
| 205 | | |
| 206 | | if (data & 0xa0) |
| 207 | | logerror("%s:Writing unknown bits %04x to $200000\n",machine().describe_context(),data); |
| 208 | | } |
| 209 | | |
| 210 | | WRITE8_MEMBER(vmetal_state::vmetal_es8712_w) |
| 211 | | { |
| 212 | | device_t *device = machine().device("essnd"); |
| 213 | | /* Many samples in the ADPCM ROM are actually not used. |
| 214 | | |
| 215 | | Snd Offset Writes Sample Range |
| 216 | | 0000 0004 0002 0006 000a 0008 000c |
| 217 | | -- ---------------------------------- ------------- |
| 218 | | 00 006e 0001 00ab 003c 0002 003a 003a 01ab6e-023a3c |
| 219 | | 01 003d 0002 003a 001d 0002 007e 007e 023a3d-027e1d |
| 220 | | 02 00e2 0003 0005 002e 0003 00f3 00f3 0305e2-03f32e |
| 221 | | 03 000a 0005 001e 00f6 0005 00ec 00ec 051e0a-05ecf6 |
| 222 | | 04 00f7 0005 00ec 008d 0006 0060 0060 05ecf7-06608d |
| 223 | | 05 0016 0008 002e 0014 0009 0019 0019 082e16-091914 |
| 224 | | 06 0015 0009 0019 0094 000b 0015 0015 091915-0b1594 |
| 225 | | 07 0010 000d 0012 00bf 000d 0035 0035 0d1210-0d35bf |
| 226 | | 08 00ce 000e 002f 0074 000f 0032 0032 0e2fce-0f3274 |
| 227 | | 09 0000 0000 0000 003a 0000 007d 007d 000000-007d3a |
| 228 | | 0a 0077 0000 00fa 008d 0001 00b6 00b6 00fa77-01b68d |
| 229 | | 0b 008e 0001 00b6 00b3 0002 0021 0021 01b68e-0221b3 |
| 230 | | 0c 0062 0002 00f7 0038 0003 00de 00de 02f762-03de38 |
| 231 | | 0d 00b9 0005 00ab 00ef 0006 0016 0016 05abb9-0616ef |
| 232 | | 0e 00dd 0007 0058 00db 0008 001a 001a 0758dd-081adb |
| 233 | | 0f 00dc 0008 001a 002e 0008 008a 008a 081adc-088a2e |
| 234 | | 10 00db 0009 00d7 00ff 000a 0046 0046 09d7db-0a46ff |
| 235 | | 11 0077 000c 0003 006d 000c 0080 0080 0c0377-0c806d |
| 236 | | 12 006e 000c 0080 006c 000d 0002 0002 0c806e-0d026c |
| 237 | | 13 006d 000d 0002 002b 000d 0041 0041 0d026d-0d412b |
| 238 | | 14 002c 000d 0041 002a 000d 00be 00be 0d412c-0dbe2a |
| 239 | | 15 002b 000d 00be 0029 000e 0083 0083 0dbe2b-0e8329 |
| 240 | | 16 002a 000e 0083 00ee 000f 0069 0069 0e832a-0f69ee |
| 241 | | */ |
| 242 | | |
| 243 | | es8712_w(device, space, offset, data); |
| 244 | | logerror("%s:Writing %04x to ES8712 offset %02x\n", machine().describe_context(), data, offset); |
| 245 | | } |
| 246 | | |
| 247 | | |
| 248 | | static ADDRESS_MAP_START( varia_program_map, AS_PROGRAM, 16, vmetal_state ) |
| 249 | | AM_RANGE(0x000000, 0x0fffff) AM_ROM |
| 250 | | AM_RANGE(0x100000, 0x11ffff) AM_RAM_WRITE(vmetal_texttileram_w) AM_SHARE("texttileram") |
| 251 | | AM_RANGE(0x120000, 0x13ffff) AM_RAM_WRITE(vmetal_mid1tileram_w) AM_SHARE("mid1tileram") |
| 252 | | AM_RANGE(0x140000, 0x15ffff) AM_RAM_WRITE(vmetal_mid2tileram_w) AM_SHARE("mid2tileram") |
| 253 | | |
| 254 | | AM_RANGE(0x160000, 0x16ffff) AM_READ(varia_crom_read) // cgrom read window .. |
| 255 | | |
| 256 | | AM_RANGE(0x170000, 0x173fff) AM_RAM_WRITE(paletteram_GGGGGRRRRRBBBBBx_word_w) AM_SHARE("paletteram") // Palette |
| 257 | | AM_RANGE(0x174000, 0x174fff) AM_RAM AM_SHARE("spriteram") |
| 258 | | AM_RANGE(0x175000, 0x177fff) AM_RAM |
| 259 | | AM_RANGE(0x178000, 0x1787ff) AM_RAM AM_SHARE("tlookup") |
| 260 | | AM_RANGE(0x178800, 0x1796ff) AM_RAM AM_SHARE("vmetal_regs") |
| 261 | | AM_RANGE(0x179700, 0x179713) AM_WRITEONLY AM_SHARE("videoregs") // Metro sprite chip Video Registers |
| 262 | | |
| 263 | | AM_RANGE(0x200000, 0x200001) AM_READ_PORT("P1_P2") AM_WRITE8(vmetal_control_w, 0x00ff) |
| 264 | | AM_RANGE(0x200002, 0x200003) AM_READ_PORT("SYSTEM") |
| 265 | | |
| 266 | | /* same weird way to read Dip Switches as in many games in metro.c driver - use balcube_dsw_r read handler once the driver is merged */ |
| 267 | | AM_RANGE(0x30fffe, 0x30ffff) AM_READNOP // 0x40 = dip1-16 -> 0xff0086 (doesn't exist in this game : address is NEVER read back) |
| 268 | | AM_RANGE(0x317ffe, 0x317fff) AM_READNOP // 0x40 = dip1-15 -> 0xff0086 (doesn't exist in this game : address is NEVER read back) |
| 269 | | AM_RANGE(0x31bffe, 0x31bfff) AM_READNOP // 0x40 = dip1-14 -> 0xff0086 (doesn't exist in this game : address is NEVER read back) |
| 270 | | AM_RANGE(0x31dffe, 0x31dfff) AM_READNOP // 0x40 = dip1-13 -> 0xff0086 (doesn't exist in this game : address is NEVER read back) |
| 271 | | AM_RANGE(0x31effe, 0x31efff) AM_READNOP // 0x40 = dip1-12 -> 0xff0086 (doesn't exist in this game : address is NEVER read back) |
| 272 | | AM_RANGE(0x31f7fe, 0x31f7ff) AM_READNOP // 0x40 = dip1-11 -> 0xff0086 (doesn't exist in this game : address is NEVER read back) |
| 273 | | AM_RANGE(0x31fbfe, 0x31fbff) AM_READNOP // 0x40 = dip1-10 -> 0xff0086 (doesn't exist in this game : address is NEVER read back) |
| 274 | | AM_RANGE(0x31fdfe, 0x31fdff) AM_READNOP // 0x40 = dip1-9 -> 0xff0086 (doesn't exist in this game : address is NEVER read back) |
| 275 | | AM_RANGE(0x31fefe, 0x31feff) AM_READ(varia_dips_bit8_r) // 0x40 = dip1-8 -> 0xff0085 , 0x80 = dip2-8 -> 0xff0084 |
| 276 | | AM_RANGE(0x31ff7e, 0x31ff7f) AM_READ(varia_dips_bit7_r) // 0x40 = dip1-7 -> 0xff0085 , 0x80 = dip2-7 -> 0xff0084 |
| 277 | | AM_RANGE(0x31ffbe, 0x31ffbf) AM_READ(varia_dips_bit6_r) // 0x40 = dip1-6 -> 0xff0085 , 0x80 = dip2-6 -> 0xff0084 |
| 278 | | AM_RANGE(0x31ffde, 0x31ffdf) AM_READ(varia_dips_bit5_r) // 0x40 = dip1-5 -> 0xff0085 , 0x80 = dip2-5 -> 0xff0084 |
| 279 | | AM_RANGE(0x31ffee, 0x31ffef) AM_READ(varia_dips_bit4_r) // 0x40 = dip1-4 -> 0xff0085 , 0x80 = dip2-4 -> 0xff0084 |
| 280 | | AM_RANGE(0x31fff6, 0x31fff7) AM_READ(varia_dips_bit3_r) // 0x40 = dip1-3 -> 0xff0085 , 0x80 = dip2-3 -> 0xff0084 |
| 281 | | AM_RANGE(0x31fffa, 0x31fffb) AM_READ(varia_dips_bit2_r) // 0x40 = dip1-2 -> 0xff0085 , 0x80 = dip2-2 -> 0xff0084 |
| 282 | | AM_RANGE(0x31fffc, 0x31fffd) AM_READ(varia_dips_bit1_r) // 0x40 = dip1-1 -> 0xff0085 , 0x80 = dip2-1 -> 0xff0084 |
| 283 | | |
| 284 | | AM_RANGE(0x400000, 0x400001) AM_DEVREADWRITE8("oki", okim6295_device, read, write, 0x00ff ) |
| 285 | | AM_RANGE(0x400002, 0x400003) AM_DEVWRITE8("oki", okim6295_device, write, 0x00ff) // Volume/channel info |
| 286 | | AM_RANGE(0x500000, 0x50000d) AM_WRITE8(vmetal_es8712_w, 0x00ff) |
| 287 | | |
| 288 | | AM_RANGE(0xff0000, 0xffffff) AM_RAM |
| 289 | | ADDRESS_MAP_END |
| 290 | | |
| 291 | | |
| 292 | | /* verified from M68000 code */ |
| 293 | | static INPUT_PORTS_START( varia ) |
| 294 | | PORT_START("P1_P2") |
| 295 | | PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2) |
| 296 | | PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2) |
| 297 | | PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2) |
| 298 | | PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2) |
| 299 | | PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) |
| 300 | | PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2) |
| 301 | | PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2) |
| 302 | | PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_START2 ) |
| 303 | | PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1) |
| 304 | | PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1) |
| 305 | | PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1) |
| 306 | | PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1) |
| 307 | | PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) |
| 308 | | PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1) |
| 309 | | PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1) |
| 310 | | PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_START1 ) |
| 311 | | |
| 312 | | PORT_START("SYSTEM") |
| 313 | | PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_COIN1 ) |
| 314 | | PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN2 ) |
| 315 | | PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_TILT ) /* 'Tilt' only in "test mode" - no effect ingame */ |
| 316 | | PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_SERVICE1 ) /* same coinage as COIN1 and COIN2 */ |
| 317 | | PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_SERVICE2 ) /* 'Test' only in "test mode" - no effect ingame */ |
| 318 | | PORT_BIT( 0xffe0, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 319 | | |
| 320 | | /* stored to 0xff0085.b (cpl'ed) */ |
| 321 | | PORT_START("DSW1") |
| 322 | | PORT_DIPNAME( 0x0007, 0x0007, DEF_STR( Coinage ) ) |
| 323 | | PORT_DIPSETTING( 0x0005, DEF_STR( 3C_1C ) ) |
| 324 | | PORT_DIPSETTING( 0x0006, DEF_STR( 2C_1C ) ) |
| 325 | | PORT_DIPSETTING( 0x0007, DEF_STR( 1C_1C ) ) |
| 326 | | PORT_DIPSETTING( 0x0004, DEF_STR( 1C_2C ) ) |
| 327 | | PORT_DIPSETTING( 0x0003, DEF_STR( 1C_3C ) ) |
| 328 | | PORT_DIPSETTING( 0x0002, DEF_STR( 1C_4C ) ) |
| 329 | | PORT_DIPSETTING( 0x0001, DEF_STR( 1C_5C ) ) |
| 330 | | PORT_DIPSETTING( 0x0000, DEF_STR( 1C_6C ) ) |
| 331 | | PORT_DIPUNUSED( 0x0008, IP_ACTIVE_LOW ) /* 0x01 (OFF) or 0x02 (ON) written to 0xff0112.b but NEVER read back - old credits for 2 players game ? */ |
| 332 | | PORT_DIPNAME( 0x0010, 0x0010, DEF_STR( Flip_Screen ) ) /* 0x07c1 written to 0x1788ac.w (screen control ?) at first (code at 0x0001b8) */ |
| 333 | | PORT_DIPSETTING( 0x0010, DEF_STR( Off ) ) /* 0x07c1 written to 0xff0114.w (then 0x1788ac.w) during initialisation (code at 0x000436) */ |
| 334 | | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) /* 0x07c0 written to 0xff0114.w (then 0x1788ac.w) during initialisation (code at 0x000436) */ |
| 335 | | PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Demo_Sounds ) ) |
| 336 | | PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) |
| 337 | | PORT_DIPSETTING( 0x0020, DEF_STR( On ) ) |
| 338 | | PORT_DIPUNUSED( 0x0040, IP_ACTIVE_LOW ) |
| 339 | | PORT_DIPUNUSED( 0x0080, IP_ACTIVE_LOW ) |
| 340 | | |
| 341 | | /* stored to 0xff0084.b (cpl'ed) */ |
| 342 | | PORT_START("DSW2") |
| 343 | | PORT_DIPNAME( 0x0003, 0x0003, DEF_STR( Difficulty ) ) |
| 344 | | PORT_DIPSETTING( 0x0002, DEF_STR( Easy ) ) |
| 345 | | PORT_DIPSETTING( 0x0003, DEF_STR( Normal ) ) |
| 346 | | PORT_DIPSETTING( 0x0001, DEF_STR( Hard ) ) |
| 347 | | PORT_DIPSETTING( 0x0000, DEF_STR( Hardest ) ) |
| 348 | | PORT_DIPNAME( 0x000c, 0x000c, DEF_STR( Lives ) ) |
| 349 | | PORT_DIPSETTING( 0x0008, "1" ) |
| 350 | | PORT_DIPSETTING( 0x0004, "2" ) |
| 351 | | PORT_DIPSETTING( 0x000c, "3" ) |
| 352 | | PORT_DIPSETTING( 0x0000, "4" ) |
| 353 | | PORT_DIPNAME( 0x0010, 0x0010, DEF_STR( Bonus_Life ) ) /* code at 0x0004a4 */ |
| 354 | | PORT_DIPSETTING( 0x0010, "Every 30000" ) |
| 355 | | PORT_DIPSETTING( 0x0000, "Every 60000" ) |
| 356 | | PORT_DIPUNUSED( 0x0020, IP_ACTIVE_LOW ) |
| 357 | | PORT_DIPUNUSED( 0x0040, IP_ACTIVE_LOW ) |
| 358 | | PORT_SERVICE( 0x0080, IP_ACTIVE_LOW ) |
| 359 | | INPUT_PORTS_END |
| 360 | | |
| 361 | | |
| 362 | | |
| 363 | | static const gfx_layout char16x16layout = |
| 364 | | { |
| 365 | | 16,16, |
| 366 | | RGN_FRAC(1,1), |
| 367 | | 4, |
| 368 | | { 0,1,2,3 }, |
| 369 | | { 4, 0, 12, 8, 20, 16, 28, 24, 36, 32, 44, 40, 52, 48, 60, 56 }, |
| 370 | | { 0*64, 1*64, 2*64, 3*64, 4*64, 5*64, 6*64, 7*64, 8*64, 9*64, 10*64, 11*64, 12*64, 13*64, 14*64, 15*64 }, |
| 371 | | 16*64 |
| 372 | | }; |
| 373 | | |
| 374 | | static const gfx_layout char8x8layout = |
| 375 | | { |
| 376 | | 8,8, |
| 377 | | RGN_FRAC(1,1), |
| 378 | | 4, |
| 379 | | { 0,1,2,3 }, |
| 380 | | { 4, 0, 12, 8, 20, 16, 28, 24 }, |
| 381 | | { 0*32,1*32,2*32,3*32,4*32,5*32,6*32,7*32 }, |
| 382 | | 8*32 |
| 383 | | }; |
| 384 | | |
| 385 | | static GFXDECODE_START( vmetal ) |
| 386 | | GFXDECODE_ENTRY( "gfx1", 0, char16x16layout, 0x1000, 512 ) /* bg tiles */ |
| 387 | | GFXDECODE_ENTRY( "gfx1", 0, char8x8layout, 0x1000, 512 ) /* bg tiles */ |
| 388 | | GFXDECODE_END |
| 389 | | |
| 390 | | |
| 391 | | TILE_GET_INFO_MEMBER(vmetal_state::get_vmetal_texttilemap_tile_info) |
| 392 | | { |
| 393 | | UINT32 tile; |
| 394 | | UINT16 color, data = m_texttileram[tile_index]; |
| 395 | | int idx = ((data & 0x7fff) >> 4) * 2; |
| 396 | | UINT32 lookup = (m_tlookup[idx] << 16) | m_tlookup[idx + 1]; |
| 397 | | |
| 398 | | tile = (data & 0xf) | (lookup & 0x7fff0); |
| 399 | | color = ((lookup >> 20) & 0x1f) + 0xe0; |
| 400 | | |
| 401 | | if (data & 0x8000) |
| 402 | | tile = 0; |
| 403 | | |
| 404 | | SET_TILE_INFO_MEMBER(1, tile, color, TILE_FLIPYX(0x0)); |
| 405 | | } |
| 406 | | |
| 407 | | |
| 408 | | TILE_GET_INFO_MEMBER(vmetal_state::get_vmetal_mid1tilemap_tile_info) |
| 409 | | { |
| 410 | | UINT16 tile, color, data = m_mid1tileram[tile_index]; |
| 411 | | |
| 412 | | get_vmetal_tlookup(machine(), data, &tile, &color); |
| 413 | | |
| 414 | | if (data & 0x8000) |
| 415 | | tile = 0; |
| 416 | | |
| 417 | | SET_TILE_INFO_MEMBER(0, tile, color, TILE_FLIPYX(0x0)); |
| 418 | | } |
| 419 | | |
| 420 | | TILE_GET_INFO_MEMBER(vmetal_state::get_vmetal_mid2tilemap_tile_info) |
| 421 | | { |
| 422 | | UINT16 tile, color, data = m_mid2tileram[tile_index]; |
| 423 | | |
| 424 | | get_vmetal_tlookup(machine(), data, &tile, &color); |
| 425 | | |
| 426 | | if (data & 0x8000) |
| 427 | | tile = 0; |
| 428 | | |
| 429 | | SET_TILE_INFO_MEMBER(0, tile, color, TILE_FLIPYX(0x0)); |
| 430 | | } |
| 431 | | |
| 432 | | static void expand_gfx1(running_machine &machine) |
| 433 | | { |
| 434 | | metro_state *state = machine.driver_data<metro_state>(); |
| 435 | | UINT8 *base_gfx = state->memregion("gfx1")->base(); |
| 436 | | UINT32 length = 2 * state->memregion("gfx1")->bytes(); |
| 437 | | state->m_expanded_gfx1 = auto_alloc_array(machine, UINT8, length); |
| 438 | | for (int i = 0; i < length; i += 2) |
| 439 | | { |
| 440 | | UINT8 src = base_gfx[i / 2]; |
| 441 | | state->m_expanded_gfx1[i+0] = src & 15; |
| 442 | | state->m_expanded_gfx1[i+1] = src >> 4; |
| 443 | | } |
| 444 | | } |
| 445 | | |
| 446 | | VIDEO_START_MEMBER(vmetal_state,varia) |
| 447 | | { |
| 448 | | |
| 449 | | m_texttilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(vmetal_state::get_vmetal_texttilemap_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 256, 256); |
| 450 | | m_mid1tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(vmetal_state::get_vmetal_mid1tilemap_tile_info),this), TILEMAP_SCAN_ROWS, 16, 16, 256, 256); |
| 451 | | m_mid2tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(vmetal_state::get_vmetal_mid2tilemap_tile_info),this), TILEMAP_SCAN_ROWS, 16, 16, 256, 256); |
| 452 | | |
| 453 | | m_texttilemap->set_transparent_pen(15); |
| 454 | | m_mid1tilemap->set_transparent_pen(15); |
| 455 | | m_mid2tilemap->set_transparent_pen(15); |
| 456 | | |
| 457 | | expand_gfx1(machine()); |
| 458 | | } |
| 459 | | |
| 460 | | UINT32 vmetal_state::screen_update_varia(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) |
| 461 | | { |
| 462 | | |
| 463 | | bitmap.fill(get_black_pen(machine()), cliprect); |
| 464 | | machine().priority_bitmap.fill(0, cliprect); |
| 465 | | |
| 466 | | m_mid2tilemap->set_scrollx(0, m_vmetal_videoregs[0x06a/2]-64 /*+ m_vmetal_videoregs[0x066/2]*/); |
| 467 | | m_mid1tilemap->set_scrollx(0, m_vmetal_videoregs[0x07a/2]-64 /*+ m_vmetal_videoregs[0x076/2]*/); |
| 468 | | m_texttilemap->set_scrollx(0, -64 /*+ m_vmetal_videoregs[0x076/2]*/); |
| 469 | | |
| 470 | | m_mid2tilemap->set_scrolly(0, -64); |
| 471 | | m_mid1tilemap->set_scrolly(0, -64); |
| 472 | | m_texttilemap->set_scrolly(0, -64); |
| 473 | | |
| 474 | | m_mid1tilemap->draw(bitmap, cliprect, 0, 0); |
| 475 | | m_mid2tilemap->draw(bitmap, cliprect, 0, 0); |
| 476 | | metro_draw_sprites(machine(), bitmap, cliprect); |
| 477 | | m_texttilemap->draw(bitmap, cliprect, 0, 0); |
| 478 | | return 0; |
| 479 | | } |
| 480 | | |
| 481 | | |
| 482 | | static MACHINE_CONFIG_START( varia, vmetal_state ) |
| 483 | | |
| 484 | | /* basic machine hardware */ |
| 485 | | MCFG_CPU_ADD("maincpu", M68000, 16000000) |
| 486 | | MCFG_CPU_PROGRAM_MAP(varia_program_map) |
| 487 | | MCFG_CPU_VBLANK_INT_DRIVER("screen", vmetal_state, irq1_line_hold) // also level 3 |
| 488 | | |
| 489 | | /* video hardware */ |
| 490 | | MCFG_SCREEN_ADD("screen", RASTER) |
| 491 | | MCFG_SCREEN_REFRESH_RATE(60) |
| 492 | | MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) |
| 493 | | MCFG_SCREEN_SIZE(2048, 2048) |
| 494 | | MCFG_SCREEN_VISIBLE_AREA(0+64, 319+64, 0+64, 223+64) |
| 495 | | MCFG_SCREEN_UPDATE_DRIVER(vmetal_state, screen_update_varia) |
| 496 | | |
| 497 | | MCFG_GFXDECODE(vmetal) |
| 498 | | MCFG_PALETTE_LENGTH(0x4000) |
| 499 | | |
| 500 | | MCFG_VIDEO_START_OVERRIDE(vmetal_state,varia) |
| 501 | | |
| 502 | | /* sound hardware */ |
| 503 | | MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker") |
| 504 | | |
| 505 | | MCFG_OKIM6295_ADD("oki", 1320000, OKIM6295_PIN7_HIGH) // clock frequency & pin 7 not verified |
| 506 | | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.75) |
| 507 | | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.75) |
| 508 | | |
| 509 | | MCFG_SOUND_ADD("essnd", ES8712, 12000) |
| 510 | | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.50) |
| 511 | | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.50) |
| 512 | | MACHINE_CONFIG_END |
| 513 | | |
| 514 | | |
| 515 | | ROM_START( vmetal ) |
| 516 | | ROM_REGION( 0x100000, "maincpu", 0 ) /* 68000 Code */ |
| 517 | | ROM_LOAD16_BYTE( "5b.u19", 0x00001, 0x80000, CRC(4933ac6c) SHA1(1a3303e32fcb08854d4d6e13f36ca99d92aed4cc) ) |
| 518 | | ROM_LOAD16_BYTE( "6b.u18", 0x00000, 0x80000, CRC(4eb939d5) SHA1(741ab05043fc3bd886162d878630e45da9359718) ) |
| 519 | | |
| 520 | | ROM_REGION( 0x800000, "gfx1", 0 ) |
| 521 | | ROMX_LOAD( "1.u29", 0x000004, 0x200000, CRC(b470c168) SHA1(c30462dc134da1e71a94b36ef96ecd65c325b07e) , ROM_GROUPWORD | ROM_SKIP(6)) |
| 522 | | ROMX_LOAD( "2.u31", 0x000000, 0x200000, CRC(b36f8d60) SHA1(1676859d0fee4eb9897ce1601a2c9fd9a6dc4a43) , ROM_GROUPWORD | ROM_SKIP(6)) |
| 523 | | ROMX_LOAD( "3.u28", 0x000006, 0x200000, CRC(00fca765) SHA1(ca9010bd7f59367e483868018db9a9abf871386e) , ROM_GROUPWORD | ROM_SKIP(6)) |
| 524 | | ROMX_LOAD( "4.u30", 0x000002, 0x200000, CRC(5a25a49c) SHA1(c30781202ec882e1ec6adfb560b0a1075b3cce55) , ROM_GROUPWORD | ROM_SKIP(6)) |
| 525 | | |
| 526 | | ROM_REGION( 0x080000, "oki", 0 ) /* OKI6295 Samples */ |
| 527 | | /* Second half is junk */ |
| 528 | | ROM_LOAD( "8.u9", 0x00000, 0x80000, CRC(c14c001c) SHA1(bad96b5cd40d1c34ef8b702262168ecab8192fb6) ) |
| 529 | | |
| 530 | | ROM_REGION( 0x200000, "essnd", 0 ) /* Samples */ |
| 531 | | ROM_LOAD( "7.u12", 0x00000, 0x200000, CRC(a88c52f1) SHA1(d74a5a11f84ba6b1042b33a2c156a1071b6fbfe1) ) |
| 532 | | ROM_END |
| 533 | | |
| 534 | | ROM_START( vmetaln ) |
| 535 | | ROM_REGION( 0x100000, "maincpu", 0 ) /* 68000 Code */ |
| 536 | | ROM_LOAD16_BYTE( "vm5.bin", 0x00001, 0x80000, CRC(43ef844e) SHA1(c673f34fcc9e406282c9008795b52d01a240099a) ) |
| 537 | | ROM_LOAD16_BYTE( "vm6.bin", 0x00000, 0x80000, CRC(cb292ab1) SHA1(41fdfe67e6cb848542fd5aa0dfde3b1936bb3a28) ) |
| 538 | | |
| 539 | | ROM_REGION( 0x800000, "gfx1", 0 ) |
| 540 | | ROMX_LOAD( "1.u29", 0x000004, 0x200000, CRC(b470c168) SHA1(c30462dc134da1e71a94b36ef96ecd65c325b07e) , ROM_GROUPWORD | ROM_SKIP(6)) |
| 541 | | ROMX_LOAD( "2.u31", 0x000000, 0x200000, CRC(b36f8d60) SHA1(1676859d0fee4eb9897ce1601a2c9fd9a6dc4a43) , ROM_GROUPWORD | ROM_SKIP(6)) |
| 542 | | ROMX_LOAD( "3.u28", 0x000006, 0x200000, CRC(00fca765) SHA1(ca9010bd7f59367e483868018db9a9abf871386e) , ROM_GROUPWORD | ROM_SKIP(6)) |
| 543 | | ROMX_LOAD( "4.u30", 0x000002, 0x200000, CRC(5a25a49c) SHA1(c30781202ec882e1ec6adfb560b0a1075b3cce55) , ROM_GROUPWORD | ROM_SKIP(6)) |
| 544 | | |
| 545 | | ROM_REGION( 0x080000, "oki", 0 ) /* OKI6295 Samples */ |
| 546 | | /* Second half is junk */ |
| 547 | | ROM_LOAD( "8.u9", 0x00000, 0x80000, CRC(c14c001c) SHA1(bad96b5cd40d1c34ef8b702262168ecab8192fb6) ) |
| 548 | | |
| 549 | | ROM_REGION( 0x200000, "essnd", 0 ) /* Samples */ |
| 550 | | ROM_LOAD( "7.u12", 0x00000, 0x200000, CRC(a88c52f1) SHA1(d74a5a11f84ba6b1042b33a2c156a1071b6fbfe1) ) |
| 551 | | ROM_END |
| 552 | | |
| 553 | | |
| 554 | | GAME( 1995, vmetal, 0, varia, varia, driver_device, 0, ROT270, "Excellent System", "Varia Metal", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS | GAME_NO_COCKTAIL | GAME_SUPPORTS_SAVE ) |
| 555 | | GAME( 1995, vmetaln, vmetal, varia, varia, driver_device, 0, ROT270, "Excellent System (New Ways Trading Co. license)", "Varia Metal (New Ways Trading Co.)", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS | GAME_NO_COCKTAIL | GAME_SUPPORTS_SAVE ) |
trunk/src/mame/drivers/metro.c
| r20035 | r20036 | |
| 18 | 18 | |
| 19 | 19 | Other : Memory Blitter |
| 20 | 20 | |
| 21 | | ----------------------------------------------------------------------------- |
| 22 | | Year + Game PCB Video Chip Issues / Notes |
| 23 | | ----------------------------------------------------------------------------- |
| 21 | ------------------------------------------------------------------------------------------------ |
| 22 | Year + Game PCB Video Issues / Notes |
| 23 | ------------------------------------------------------------------------------------------------ |
| 24 | 24 | 92 Last Fortress - Toride VG420 I4100 |
| 25 | 25 | 92 Last Fortress - Toride (Ger)VG460-(A) I4100 |
| 26 | 26 | 92 Pang Pom's VG420 I4100 |
| r20035 | r20036 | |
| 39 | 39 | 95 Mouse Shooter GoGo - I4220 No sound CPU |
| 40 | 40 | 95 Pururun MTR5260-A I4220 |
| 41 | 41 | 95 Puzzli MTR5260-A I4220 |
| 42 | 95 Varia Metal ES-9309B-B I4220 No sound CPU but ES-8712 + M6295 + M6585 |
| 42 | 43 | 96 Bal Cube - I4220 No sound CPU |
| 43 | 44 | 96 Bang Bang Ball - I4220 No sound CPU |
| 44 | 45 | 96 Daitoride (YMF278B) - I4220 No sound CPU |
| r20035 | r20036 | |
| 52 | 53 | 97 Mahjong Gakuensai VG340-A I4300 No sound CPU |
| 53 | 54 | 98 Mahjong Gakuensai 2 VG340-A I4300 No sound CPU |
| 54 | 55 | 00 Puzzlet VG2200-(B) I4300 Z86E02 Zilog Z8 8-bit MCU |
| 55 | | ----------------------------------------------------------------------------- |
| 56 | ------------------------------------------------------------------------------------------------ |
| 56 | 57 | |
| 57 | 58 | Mouse Shooter GoGo, Bal Cube, Bang Bang Ball & Daitoride (YMF278B) PCBs have |
| 58 | 59 | no PCB number but all look identical to each other. |
| 59 | 60 | |
| 60 | 61 | To Do: |
| 61 | 62 | |
| 63 | - Tilemaps/sprites offsets may be emulated understanding what appear to be CRT registers |
| 64 | at c78880 (sequence of 4 values), c78890 (sequence of 5 values) and c788a0 (start sequence). |
| 62 | 65 | - Wrong color bars in service mode (e.g. balcube, toride2g). |
| 63 | 66 | They use solid color tiles (80xx), but the right palette is not at 00-ff. |
| 64 | 67 | Related to the unknown table in the RAM mapped just before the palette? |
| r20035 | r20036 | |
| 67 | 70 | - Coin lockout |
| 68 | 71 | - Some gfx problems in ladykill, 3kokushi, puzzli, gakusai, |
| 69 | 72 | seem related to how we handle windows and wrapping |
| 70 | | - Are the 16x16 tiles used by Mouja a Imagetek I4300-only feature? |
| 71 | 73 | - Interrupt timing needs figuring out properly, having it incorrect |
| 72 | 74 | causes scrolling glitches in some games. Test cases Mouse Go Go |
| 73 | 75 | title screen, GunMaster title screen. Changing it can cause |
| r20035 | r20036 | |
| 75 | 77 | - Bang Bang Ball / Bubble Buster slow to a crawl when you press a |
| 76 | 78 | button between levels, on a real PCB it speeds up instead (related |
| 77 | 79 | to above?) |
| 80 | - vmetal: ES8712 sound may not be quite right. Samples are currently looped, but |
| 81 | whether they should and how, is unknown. Where does the M6585 hook up to? |
| 78 | 82 | |
| 79 | 83 | Notes: |
| 80 | 84 | |
| r20035 | r20036 | |
| 82 | 86 | keeping start 2 pressed. |
| 83 | 87 | - Sprite zoom in Mouja at the end of a match looks wrong, but it's been verified |
| 84 | 88 | to be the same on the original board |
| 89 | - vmetal: has Sega and Taito logos in the roms ?! |
| 85 | 90 | |
| 91 | |
| 86 | 92 | driver modified by Eisuke Watanabe |
| 87 | 93 | ***************************************************************************/ |
| 88 | 94 | |
| r20035 | r20036 | |
| 93 | 99 | #include "cpu/upd7810/upd7810.h" |
| 94 | 100 | #include "includes/metro.h" |
| 95 | 101 | #include "machine/eeprom.h" |
| 96 | | #include "sound/2610intf.h" |
| 97 | 102 | #include "sound/2151intf.h" |
| 98 | 103 | #include "sound/2413intf.h" |
| 104 | #include "sound/2610intf.h" |
| 105 | #include "sound/es8712.h" |
| 99 | 106 | #include "sound/okim6295.h" |
| 100 | 107 | #include "sound/ymf278b.h" |
| 101 | 108 | #include "video/konicdev.h" |
| r20035 | r20036 | |
| 785 | 792 | AM_RANGE(0x678840, 0x67884d) AM_WRITE(metro_blitter_w) AM_SHARE("blitter_regs") // Tiles Blitter |
| 786 | 793 | AM_RANGE(0x678860, 0x67886b) AM_WRITE(metro_window_w) AM_SHARE("window") // Tilemap Window |
| 787 | 794 | AM_RANGE(0x678870, 0x67887b) AM_WRITEONLY AM_SHARE("scroll") // Scroll |
| 788 | | AM_RANGE(0x678880, 0x678881) AM_WRITENOP // ? increasing |
| 789 | | AM_RANGE(0x678890, 0x678891) AM_WRITENOP // ? increasing |
| 795 | AM_RANGE(0x678880, 0x678881) AM_WRITENOP // ? CRT |
| 796 | AM_RANGE(0x678890, 0x678891) AM_WRITENOP // ? CRT |
| 790 | 797 | AM_RANGE(0x6788a2, 0x6788a3) AM_READWRITE(metro_irq_cause_r, metro_irq_cause_w) // IRQ Cause / IRQ Acknowledge |
| 791 | 798 | AM_RANGE(0x6788a4, 0x6788a5) AM_WRITEONLY AM_SHARE("irq_enable") // IRQ Enable |
| 792 | 799 | AM_RANGE(0x6788aa, 0x6788ab) AM_WRITEONLY AM_SHARE("rombank") // Rom Bank |
| r20035 | r20036 | |
| 814 | 821 | AM_RANGE(0x178840, 0x17884d) AM_WRITE(metro_blitter_w) AM_SHARE("blitter_regs") // Tiles Blitter |
| 815 | 822 | AM_RANGE(0x178860, 0x17886b) AM_WRITE(metro_window_w) AM_SHARE("window") // Tilemap Window |
| 816 | 823 | AM_RANGE(0x178870, 0x17887b) AM_WRITEONLY AM_SHARE("scroll") // Scroll |
| 817 | | AM_RANGE(0x178880, 0x178881) AM_WRITENOP // ? increasing |
| 818 | | AM_RANGE(0x178890, 0x178891) AM_WRITENOP // ? increasing |
| 824 | AM_RANGE(0x178880, 0x178881) AM_WRITENOP // ? CRT |
| 825 | AM_RANGE(0x178890, 0x178891) AM_WRITENOP // ? CRT |
| 819 | 826 | AM_RANGE(0x1788a2, 0x1788a3) AM_READWRITE(metro_irq_cause_r, metro_irq_cause_w) // IRQ Cause / IRQ Acknowledge |
| 820 | 827 | AM_RANGE(0x1788a4, 0x1788a5) AM_WRITEONLY AM_SHARE("irq_enable") // IRQ Enable |
| 821 | 828 | AM_RANGE(0x1788aa, 0x1788ab) AM_WRITEONLY AM_SHARE("rombank") // Rom Bank |
| r20035 | r20036 | |
| 856 | 863 | AM_RANGE(0xe78840, 0xe7884d) AM_WRITE(metro_blitter_w) AM_SHARE("blitter_regs") // Tiles Blitter |
| 857 | 864 | AM_RANGE(0xe78860, 0xe7886b) AM_WRITE(metro_window_w) AM_SHARE("window") // Tilemap Window |
| 858 | 865 | AM_RANGE(0xe78870, 0xe7887b) AM_WRITEONLY AM_SHARE("scroll") // Scroll |
| 859 | | AM_RANGE(0xe78880, 0xe78881) AM_WRITENOP // ? increasing |
| 860 | | AM_RANGE(0xe78890, 0xe78891) AM_WRITENOP // ? increasing |
| 866 | AM_RANGE(0xe78880, 0xe78881) AM_WRITENOP // ? CRT |
| 867 | AM_RANGE(0xe78890, 0xe78891) AM_WRITENOP // ? CRT |
| 861 | 868 | AM_RANGE(0xe788a2, 0xe788a3) AM_READWRITE(metro_irq_cause_r, metro_irq_cause_w) // IRQ Cause / IRQ Acknowledge |
| 862 | 869 | AM_RANGE(0xe788a4, 0xe788a5) AM_WRITEONLY AM_SHARE("irq_enable") // IRQ Enable |
| 863 | 870 | AM_RANGE(0xe788aa, 0xe788ab) AM_WRITEONLY AM_SHARE("rombank") // Rom Bank |
| r20035 | r20036 | |
| 884 | 891 | AM_RANGE(0x178840, 0x17884d) AM_WRITE(metro_blitter_w) AM_SHARE("blitter_regs") // Tiles Blitter |
| 885 | 892 | AM_RANGE(0x178860, 0x17886b) AM_WRITE(metro_window_w) AM_SHARE("window") // Tilemap Window |
| 886 | 893 | AM_RANGE(0x178870, 0x17887b) AM_WRITEONLY AM_SHARE("scroll") // Scroll |
| 887 | | AM_RANGE(0x178880, 0x178881) AM_WRITENOP // ? increasing |
| 888 | | AM_RANGE(0x178890, 0x178891) AM_WRITENOP // ? increasing |
| 894 | AM_RANGE(0x178880, 0x178881) AM_WRITENOP // ? CRT |
| 895 | AM_RANGE(0x178890, 0x178891) AM_WRITENOP // ? CRT |
| 889 | 896 | AM_RANGE(0x1788a2, 0x1788a3) AM_READWRITE(metro_irq_cause_r,metro_irq_cause_w) // IRQ Cause / IRQ Acknowledge |
| 890 | 897 | AM_RANGE(0x1788a4, 0x1788a5) AM_WRITEONLY AM_SHARE("irq_enable") // IRQ Enable |
| 891 | 898 | AM_RANGE(0x1788aa, 0x1788ab) AM_WRITEONLY AM_SHARE("rombank") // Rom Bank |
| r20035 | r20036 | |
| 920 | 927 | AM_RANGE(0x178840, 0x17884d) AM_WRITE(metro_blitter_w) AM_SHARE("blitter_regs") // Tiles Blitter |
| 921 | 928 | AM_RANGE(0x178860, 0x17886b) AM_WRITE(metro_window_w) AM_SHARE("window") // Tilemap Window |
| 922 | 929 | AM_RANGE(0x178870, 0x17887b) AM_WRITEONLY AM_SHARE("scroll") // Scroll |
| 923 | | AM_RANGE(0x178880, 0x178881) AM_WRITENOP // ? increasing |
| 924 | | AM_RANGE(0x178890, 0x178891) AM_WRITENOP // ? increasing |
| 930 | AM_RANGE(0x178880, 0x178881) AM_WRITENOP // ? CRT |
| 931 | AM_RANGE(0x178890, 0x178891) AM_WRITENOP // ? CRT |
| 925 | 932 | AM_RANGE(0x1788a2, 0x1788a3) AM_READWRITE(metro_irq_cause_r, metro_irq_cause_w) // IRQ Cause / IRQ Acknowledge |
| 926 | 933 | AM_RANGE(0x1788a4, 0x1788a5) AM_WRITEONLY AM_SHARE("irq_enable") // IRQ Enable |
| 927 | 934 | AM_RANGE(0x1788aa, 0x1788ab) AM_WRITEONLY AM_SHARE("rombank") // Rom Bank |
| r20035 | r20036 | |
| 954 | 961 | AM_RANGE(0x478840, 0x47884d) AM_WRITE(metro_blitter_w) AM_SHARE("blitter_regs") // Tiles Blitter |
| 955 | 962 | AM_RANGE(0x478860, 0x47886b) AM_WRITE(metro_window_w) AM_SHARE("window") // Tilemap Window |
| 956 | 963 | AM_RANGE(0x478870, 0x47887b) AM_WRITEONLY AM_SHARE("scroll") // Scroll |
| 957 | | AM_RANGE(0x478880, 0x478881) AM_WRITENOP // ? increasing |
| 958 | | AM_RANGE(0x478890, 0x478891) AM_WRITENOP // ? increasing |
| 964 | AM_RANGE(0x478880, 0x478881) AM_WRITENOP // ? CRT |
| 965 | AM_RANGE(0x478890, 0x478891) AM_WRITENOP // ? CRT |
| 959 | 966 | AM_RANGE(0x4788a2, 0x4788a3) AM_READWRITE(metro_irq_cause_r, metro_irq_cause_w) // IRQ Cause / IRQ Acknowledge |
| 960 | 967 | AM_RANGE(0x4788a4, 0x4788a5) AM_WRITEONLY AM_SHARE("irq_enable") // IRQ Enable |
| 961 | 968 | AM_RANGE(0x4788a8, 0x4788a9) AM_WRITE(metro_soundlatch_w) // To Sound CPU |
| r20035 | r20036 | |
| 989 | 996 | AM_RANGE(0x878840, 0x87884d) AM_WRITE(metro_blitter_w) AM_SHARE("blitter_regs") // Tiles Blitter |
| 990 | 997 | AM_RANGE(0x878860, 0x87886b) AM_WRITE(metro_window_w) AM_SHARE("window") // Tilemap Window |
| 991 | 998 | AM_RANGE(0x878870, 0x87887b) AM_WRITEONLY AM_SHARE("scroll") // Scroll Regs |
| 992 | | AM_RANGE(0x878880, 0x878881) AM_WRITENOP // ? increasing |
| 993 | | AM_RANGE(0x878890, 0x878891) AM_WRITENOP // ? increasing |
| 999 | AM_RANGE(0x878880, 0x878881) AM_WRITENOP // ? CRT |
| 1000 | AM_RANGE(0x878890, 0x878891) AM_WRITENOP // ? CRT |
| 994 | 1001 | AM_RANGE(0x8788a4, 0x8788a5) AM_WRITEONLY AM_SHARE("irq_enable") // IRQ Enable |
| 995 | 1002 | AM_RANGE(0x8788a8, 0x8788a9) AM_WRITE(metro_soundlatch_w) // To Sound CPU |
| 996 | 1003 | AM_RANGE(0x8788aa, 0x8788ab) AM_WRITEONLY AM_SHARE("rombank") // Rom Bank |
| r20035 | r20036 | |
| 1044 | 1051 | AM_RANGE(0x878840, 0x87884d) AM_WRITE(metro_blitter_w) AM_SHARE("blitter_regs") // Tiles Blitter |
| 1045 | 1052 | AM_RANGE(0x878860, 0x87886b) AM_WRITE(metro_window_w) AM_SHARE("window") // Tilemap Window |
| 1046 | 1053 | AM_RANGE(0x878870, 0x87887b) AM_WRITEONLY AM_SHARE("scroll") // Scroll |
| 1047 | | AM_RANGE(0x878880, 0x878881) AM_WRITENOP // ? increasing |
| 1048 | | AM_RANGE(0x878890, 0x878891) AM_WRITENOP // ? increasing |
| 1054 | AM_RANGE(0x878880, 0x878881) AM_WRITENOP // ? CRT |
| 1055 | AM_RANGE(0x878890, 0x878891) AM_WRITENOP // ? CRT |
| 1049 | 1056 | AM_RANGE(0x8788a2, 0x8788a3) AM_READWRITE(metro_irq_cause_r, metro_irq_cause_w) // IRQ Cause / IRQ Acknowledge |
| 1050 | 1057 | AM_RANGE(0x8788a4, 0x8788a5) AM_WRITEONLY AM_SHARE("irq_enable") // IRQ Enable |
| 1051 | 1058 | AM_RANGE(0x8788a8, 0x8788a9) AM_WRITE(metro_soundlatch_w) // To Sound CPU |
| r20035 | r20036 | |
| 1075 | 1082 | AM_RANGE(0x878840, 0x87884d) AM_WRITE(metro_blitter_w) AM_SHARE("blitter_regs") // Tiles Blitter |
| 1076 | 1083 | AM_RANGE(0x878860, 0x87886b) AM_WRITE(metro_window_w) AM_SHARE("window") // Tilemap Window |
| 1077 | 1084 | AM_RANGE(0x878870, 0x87887b) AM_WRITEONLY AM_SHARE("scroll") // Scroll Regs - WRONG |
| 1078 | | // AM_RANGE(0x878880, 0x878881) AM_WRITENOP // ? increasing |
| 1079 | | AM_RANGE(0x878890, 0x878891) AM_WRITENOP // ? increasing |
| 1085 | // AM_RANGE(0x878880, 0x878881) AM_WRITENOP // ? CRT |
| 1086 | AM_RANGE(0x878890, 0x878891) AM_WRITENOP // ? CRT |
| 1080 | 1087 | AM_RANGE(0x8788a2, 0x8788a3) AM_READWRITE(metro_irq_cause_r, metro_irq_cause_w) // IRQ Cause / IRQ Acknowledge |
| 1081 | 1088 | AM_RANGE(0x8788a4, 0x8788a5) AM_WRITEONLY AM_SHARE("irq_enable") // IRQ Enable |
| 1082 | 1089 | AM_RANGE(0x8788a8, 0x8788a9) AM_WRITE(metro_soundlatch_w) // To Sound CPU |
| r20035 | r20036 | |
| 1109 | 1116 | AM_RANGE(0x878840, 0x87884d) AM_WRITE(metro_blitter_w) AM_SHARE("blitter_regs") // Tiles Blitter |
| 1110 | 1117 | AM_RANGE(0x878860, 0x87886b) AM_WRITE(metro_window_w) AM_SHARE("window") // Tilemap Window |
| 1111 | 1118 | AM_RANGE(0x878870, 0x87887b) AM_WRITEONLY AM_SHARE("scroll") // Scroll |
| 1112 | | AM_RANGE(0x878880, 0x878881) AM_WRITENOP // ? increasing |
| 1113 | | AM_RANGE(0x878890, 0x878891) AM_WRITENOP // ? increasing |
| 1119 | AM_RANGE(0x878880, 0x878881) AM_WRITENOP // ? CRT |
| 1120 | AM_RANGE(0x878890, 0x878891) AM_WRITENOP // ? CRT |
| 1114 | 1121 | AM_RANGE(0x8788a2, 0x8788a3) AM_READWRITE(metro_irq_cause_r, metro_irq_cause_w) // IRQ Cause / IRQ Acknowledge |
| 1115 | 1122 | AM_RANGE(0x8788a4, 0x8788a5) AM_WRITEONLY AM_SHARE("irq_enable") // IRQ Enable |
| 1116 | 1123 | AM_RANGE(0x8788a8, 0x8788a9) AM_WRITE(metro_soundlatch_w) // To Sound CPU |
| r20035 | r20036 | |
| 1150 | 1157 | AM_RANGE(0x8f8840, 0x8f884d) AM_WRITE(metro_blitter_w) AM_SHARE("blitter_regs") // Tiles Blitter |
| 1151 | 1158 | AM_RANGE(0x8f8860, 0x8f886b) AM_WRITE(metro_window_w) AM_SHARE("window") // Tilemap Window |
| 1152 | 1159 | AM_RANGE(0x8f8870, 0x8f887b) AM_WRITEONLY AM_SHARE("scroll") // Scroll |
| 1153 | | AM_RANGE(0x8f8880, 0x8f8881) AM_WRITENOP // ? increasing |
| 1154 | | AM_RANGE(0x8f8890, 0x8f8891) AM_WRITENOP // ? increasing |
| 1160 | AM_RANGE(0x8f8880, 0x8f8881) AM_WRITENOP // ? CRT |
| 1161 | AM_RANGE(0x8f8890, 0x8f8891) AM_WRITENOP // ? CRT |
| 1155 | 1162 | AM_RANGE(0x8f88a2, 0x8f88a3) AM_READWRITE(metro_irq_cause_r, metro_irq_cause_w) // IRQ Cause / IRQ Acknowledge |
| 1156 | 1163 | AM_RANGE(0x8f88a4, 0x8f88a5) AM_WRITEONLY AM_SHARE("irq_enable") // IRQ Enable |
| 1157 | 1164 | AM_RANGE(0x8f88a8, 0x8f88a9) AM_WRITE(metro_soundlatch_w) // To Sound CPU |
| r20035 | r20036 | |
| 1439 | 1446 | AM_RANGE(0x478840, 0x47884d) AM_WRITE(metro_blitter_w) AM_SHARE("blitter_regs") // Tiles Blitter |
| 1440 | 1447 | AM_RANGE(0x478860, 0x47886b) AM_WRITE(metro_window_w) AM_SHARE("window") // Tilemap Window |
| 1441 | 1448 | AM_RANGE(0x478870, 0x47887b) AM_WRITEONLY AM_SHARE("scroll") // Scroll Regs |
| 1442 | | AM_RANGE(0x478880, 0x478881) AM_WRITENOP // ? increasing |
| 1443 | | AM_RANGE(0x478890, 0x478891) AM_WRITENOP // ? increasing |
| 1449 | AM_RANGE(0x478880, 0x478881) AM_WRITENOP // ? CRT |
| 1450 | AM_RANGE(0x478890, 0x478891) AM_WRITENOP // ? CRT |
| 1444 | 1451 | AM_RANGE(0x4788a2, 0x4788a3) AM_READWRITE(metro_irq_cause_r,metro_irq_cause_w) // IRQ Cause / IRQ Acknowledge |
| 1445 | 1452 | AM_RANGE(0x4788a4, 0x4788a5) AM_WRITEONLY AM_SHARE("irq_enable") // IRQ Enable |
| 1446 | 1453 | AM_RANGE(0x4788a8, 0x4788a9) AM_WRITE(metro_soundlatch_w) // To Sound CPU |
| r20035 | r20036 | |
| 1482 | 1489 | AM_RANGE(0xc78840, 0xc7884d) AM_WRITE(metro_blitter_w) AM_SHARE("blitter_regs") // Tiles Blitter |
| 1483 | 1490 | AM_RANGE(0xc78860, 0xc7886b) AM_WRITE(metro_window_w) AM_SHARE("window") // Tilemap Window |
| 1484 | 1491 | AM_RANGE(0xc78870, 0xc7887b) AM_WRITEONLY AM_SHARE("scroll") // Scroll Regs |
| 1485 | | AM_RANGE(0xc78880, 0xc78881) AM_WRITENOP // ? increasing |
| 1486 | | AM_RANGE(0xc78890, 0xc78891) AM_WRITENOP // ? increasing |
| 1492 | AM_RANGE(0xc78880, 0xc78881) AM_WRITENOP // ? CRT |
| 1493 | AM_RANGE(0xc78890, 0xc78891) AM_WRITENOP // ? CRT |
| 1487 | 1494 | AM_RANGE(0xc788a2, 0xc788a3) AM_READWRITE(metro_irq_cause_r,metro_irq_cause_w) // IRQ Cause / IRQ Acknowledge |
| 1488 | 1495 | AM_RANGE(0xc788a4, 0xc788a5) AM_WRITEONLY AM_SHARE("irq_enable") // IRQ Enable |
| 1489 | 1496 | AM_RANGE(0xc788a8, 0xc788a9) AM_WRITE(metro_soundlatch_w) // To Sound CPU |
| r20035 | r20036 | |
| 1518 | 1525 | AM_RANGE(0x878840, 0x87884d) AM_WRITE(metro_blitter_w) AM_SHARE("blitter_regs") // Tiles Blitter |
| 1519 | 1526 | AM_RANGE(0x878860, 0x87886b) AM_WRITE(metro_window_w) AM_SHARE("window") // Tilemap Window |
| 1520 | 1527 | AM_RANGE(0x878870, 0x87887b) AM_WRITEONLY AM_SHARE("scroll") // Scroll |
| 1521 | | AM_RANGE(0x878880, 0x878881) AM_WRITENOP // ? increasing |
| 1522 | | AM_RANGE(0x878890, 0x878891) AM_WRITENOP // ? increasing |
| 1528 | AM_RANGE(0x878880, 0x878881) AM_WRITENOP // ? CRT |
| 1529 | AM_RANGE(0x878890, 0x878891) AM_WRITENOP // ? CRT |
| 1523 | 1530 | AM_RANGE(0x8788a2, 0x8788a3) AM_READWRITE(metro_irq_cause_r,metro_irq_cause_w) // IRQ Cause / IRQ Acknowledge |
| 1524 | 1531 | AM_RANGE(0x8788a4, 0x8788a5) AM_WRITEONLY AM_SHARE("irq_enable") // IRQ Enable |
| 1525 | 1532 | AM_RANGE(0x8788a8, 0x8788a9) AM_WRITE(metro_soundlatch_w) // To Sound CPU |
| r20035 | r20036 | |
| 1552 | 1559 | AM_RANGE(0xc78840, 0xc7884d) AM_WRITE(metro_blitter_w) AM_SHARE("blitter_regs") // Tiles Blitter |
| 1553 | 1560 | AM_RANGE(0xc78860, 0xc7886b) AM_WRITE(metro_window_w) AM_SHARE("window") // Tilemap Window |
| 1554 | 1561 | AM_RANGE(0xc78870, 0xc7887b) AM_WRITEONLY AM_SHARE("scroll") // Scroll Regs |
| 1555 | | AM_RANGE(0xc78880, 0xc78881) AM_WRITENOP // ? increasing |
| 1556 | | AM_RANGE(0xc78890, 0xc78891) AM_WRITENOP // ? increasing |
| 1562 | AM_RANGE(0xc78880, 0xc78881) AM_WRITENOP // ? CRT |
| 1563 | AM_RANGE(0xc78890, 0xc78891) AM_WRITENOP // ? CRT |
| 1557 | 1564 | AM_RANGE(0xc788a2, 0xc788a3) AM_READWRITE(metro_irq_cause_r,metro_irq_cause_w) // IRQ Cause / IRQ Acknowledge |
| 1558 | 1565 | AM_RANGE(0xc788a4, 0xc788a5) AM_WRITEONLY AM_SHARE("irq_enable") // IRQ Enable |
| 1559 | 1566 | AM_RANGE(0xc788a8, 0xc788a9) AM_WRITE(metro_soundlatch_w) // To Sound CPU |
| r20035 | r20036 | |
| 1586 | 1593 | AM_RANGE(0xc78840, 0xc7884d) AM_WRITE(metro_blitter_w) AM_SHARE("blitter_regs") // Tiles Blitter |
| 1587 | 1594 | AM_RANGE(0xc78860, 0xc7886b) AM_WRITE(metro_window_w) AM_SHARE("window") // Tilemap Window |
| 1588 | 1595 | AM_RANGE(0xc78870, 0xc7887b) AM_WRITEONLY AM_SHARE("scroll") // Scroll Regs |
| 1589 | | AM_RANGE(0xc78880, 0xc78881) AM_WRITENOP // ? increasing |
| 1590 | | AM_RANGE(0xc78890, 0xc78891) AM_WRITENOP // ? increasing |
| 1596 | AM_RANGE(0xc78880, 0xc78881) AM_WRITENOP // ? CRT |
| 1597 | AM_RANGE(0xc78890, 0xc78891) AM_WRITENOP // ? CRT |
| 1591 | 1598 | AM_RANGE(0xc788a2, 0xc788a3) AM_READWRITE(metro_irq_cause_r, metro_irq_cause_w) // IRQ Cause / IRQ Acknowledge |
| 1592 | 1599 | AM_RANGE(0xc788a4, 0xc788a5) AM_WRITEONLY AM_SHARE("irq_enable") // IRQ Enable |
| 1593 | 1600 | AM_RANGE(0xc788a8, 0xc788a9) AM_WRITE(metro_soundlatch_w) // To Sound CPU |
| r20035 | r20036 | |
| 1653 | 1660 | AM_RANGE(0x278000, 0x2787ff) AM_RAM AM_SHARE("tiletable") // Tiles Set |
| 1654 | 1661 | AM_RANGE(0x278860, 0x27886b) AM_WRITE(metro_window_w) AM_SHARE("window") // Tilemap Window |
| 1655 | 1662 | AM_RANGE(0x278870, 0x27887b) AM_WRITEONLY AM_SHARE("scroll") // Scroll |
| 1656 | | AM_RANGE(0x278890, 0x278891) AM_WRITENOP // ? increasing |
| 1663 | AM_RANGE(0x278890, 0x278891) AM_WRITENOP // ? CRT |
| 1657 | 1664 | AM_RANGE(0x2788a2, 0x2788a3) AM_READWRITE(metro_irq_cause_r,metro_irq_cause_w) // IRQ Cause / IRQ Acknowledge |
| 1658 | 1665 | AM_RANGE(0x2788a4, 0x2788a5) AM_WRITEONLY AM_SHARE("irq_enable") // IRQ Enable |
| 1659 | 1666 | AM_RANGE(0x2788aa, 0x2788ab) AM_WRITEONLY AM_SHARE("rombank") // Rom Bank |
| r20035 | r20036 | |
| 1789 | 1796 | AM_RANGE(0x778840, 0x77884f) AM_WRITE(metro_blitter_w) AM_SHARE("blitter_regs") // Tiles Blitter |
| 1790 | 1797 | AM_RANGE(0x778860, 0x77886b) AM_WRITE(metro_window_w) AM_SHARE("window") // Tilemap Window |
| 1791 | 1798 | AM_RANGE(0x778870, 0x77887b) AM_WRITEONLY AM_SHARE("scroll") // Scroll |
| 1792 | | AM_RANGE(0x778890, 0x778891) AM_WRITENOP // ? increasing |
| 1799 | AM_RANGE(0x778890, 0x778891) AM_WRITENOP // ? CRT |
| 1793 | 1800 | AM_RANGE(0x7788a2, 0x7788a3) AM_WRITE(metro_irq_cause_w) // IRQ Cause |
| 1794 | 1801 | AM_RANGE(0x7788a4, 0x7788a5) AM_WRITE(puzzlet_irq_enable_w) AM_SHARE("irq_enable") // IRQ Enable |
| 1795 | 1802 | |
| r20035 | r20036 | |
| 1819 | 1826 | |
| 1820 | 1827 | |
| 1821 | 1828 | /*************************************************************************** |
| 1829 | Varia Metal |
| 1830 | ***************************************************************************/ |
| 1822 | 1831 | |
| 1832 | WRITE8_MEMBER(metro_state::vmetal_control_w) |
| 1833 | { |
| 1834 | device_t *device = machine().device("essnd"); |
| 1835 | /* Lower nibble is the coin control bits shown in |
| 1836 | service mode, but in game mode they're different */ |
| 1837 | coin_counter_w(machine(), 0, data & 0x04); |
| 1838 | coin_counter_w(machine(), 1, data & 0x08); /* 2nd coin schute activates coin 0 counter in game mode?? */ |
| 1839 | // coin_lockout_w(machine(), 0, data & 0x01); /* always on in game mode?? */ |
| 1840 | coin_lockout_w(machine(), 1, data & 0x02); /* never activated in game mode?? */ |
| 1823 | 1841 | |
| 1842 | if ((data & 0x40) == 0) |
| 1843 | device->reset(); |
| 1844 | else |
| 1845 | es8712_play(device); |
| 1846 | |
| 1847 | if (data & 0x10) |
| 1848 | es8712_set_bank_base(device, 0x100000); |
| 1849 | else |
| 1850 | es8712_set_bank_base(device, 0x000000); |
| 1851 | |
| 1852 | if (data & 0xa0) |
| 1853 | logerror("%s: Writing unknown bits %04x to $200000\n",machine().describe_context(),data); |
| 1854 | } |
| 1855 | |
| 1856 | WRITE8_MEMBER(metro_state::vmetal_es8712_w) |
| 1857 | { |
| 1858 | /* Many samples in the ADPCM ROM are actually not used. |
| 1859 | |
| 1860 | Snd Offset Writes Sample Range |
| 1861 | 0000 0004 0002 0006 000a 0008 000c |
| 1862 | -- ---------------------------------- ------------- |
| 1863 | 00 006e 0001 00ab 003c 0002 003a 003a 01ab6e-023a3c |
| 1864 | 01 003d 0002 003a 001d 0002 007e 007e 023a3d-027e1d |
| 1865 | 02 00e2 0003 0005 002e 0003 00f3 00f3 0305e2-03f32e |
| 1866 | 03 000a 0005 001e 00f6 0005 00ec 00ec 051e0a-05ecf6 |
| 1867 | 04 00f7 0005 00ec 008d 0006 0060 0060 05ecf7-06608d |
| 1868 | 05 0016 0008 002e 0014 0009 0019 0019 082e16-091914 |
| 1869 | 06 0015 0009 0019 0094 000b 0015 0015 091915-0b1594 |
| 1870 | 07 0010 000d 0012 00bf 000d 0035 0035 0d1210-0d35bf |
| 1871 | 08 00ce 000e 002f 0074 000f 0032 0032 0e2fce-0f3274 |
| 1872 | 09 0000 0000 0000 003a 0000 007d 007d 000000-007d3a |
| 1873 | 0a 0077 0000 00fa 008d 0001 00b6 00b6 00fa77-01b68d |
| 1874 | 0b 008e 0001 00b6 00b3 0002 0021 0021 01b68e-0221b3 |
| 1875 | 0c 0062 0002 00f7 0038 0003 00de 00de 02f762-03de38 |
| 1876 | 0d 00b9 0005 00ab 00ef 0006 0016 0016 05abb9-0616ef |
| 1877 | 0e 00dd 0007 0058 00db 0008 001a 001a 0758dd-081adb |
| 1878 | 0f 00dc 0008 001a 002e 0008 008a 008a 081adc-088a2e |
| 1879 | 10 00db 0009 00d7 00ff 000a 0046 0046 09d7db-0a46ff |
| 1880 | 11 0077 000c 0003 006d 000c 0080 0080 0c0377-0c806d |
| 1881 | 12 006e 000c 0080 006c 000d 0002 0002 0c806e-0d026c |
| 1882 | 13 006d 000d 0002 002b 000d 0041 0041 0d026d-0d412b |
| 1883 | 14 002c 000d 0041 002a 000d 00be 00be 0d412c-0dbe2a |
| 1884 | 15 002b 000d 00be 0029 000e 0083 0083 0dbe2b-0e8329 |
| 1885 | 16 002a 000e 0083 00ee 000f 0069 0069 0e832a-0f69ee |
| 1886 | */ |
| 1887 | |
| 1888 | device_t *device = machine().device("essnd"); |
| 1889 | es8712_w(device, space, offset, data); |
| 1890 | logerror("%s: Writing %04x to ES8712 offset %02x\n", machine().describe_context(), data, offset); |
| 1891 | } |
| 1892 | |
| 1893 | static ADDRESS_MAP_START( vmetal_map, AS_PROGRAM, 16, metro_state ) |
| 1894 | AM_RANGE(0x000000, 0x0fffff) AM_ROM // ROM |
| 1895 | AM_RANGE(0x100000, 0x11ffff) AM_RAM_WRITE(metro_vram_0_w) AM_SHARE("vram_0") // Layer 0 |
| 1896 | AM_RANGE(0x120000, 0x13ffff) AM_RAM_WRITE(metro_vram_1_w) AM_SHARE("vram_1") // Layer 1 |
| 1897 | AM_RANGE(0x140000, 0x15ffff) AM_RAM_WRITE(metro_vram_2_w) AM_SHARE("vram_2") // Layer 2 |
| 1898 | AM_RANGE(0x160000, 0x16ffff) AM_READ(metro_bankedrom_r) // Banked ROM |
| 1899 | AM_RANGE(0x170000, 0x171fff) AM_RAM // ??? |
| 1900 | AM_RANGE(0x172000, 0x173fff) AM_RAM_WRITE(paletteram_GGGGGRRRRRBBBBBx_word_w) AM_SHARE("paletteram") // Palette |
| 1901 | AM_RANGE(0x174000, 0x174fff) AM_RAM AM_SHARE("spriteram") // Sprites |
| 1902 | AM_RANGE(0x178000, 0x1787ff) AM_RAM AM_SHARE("tiletable") // Tiles Set |
| 1903 | AM_RANGE(0x178840, 0x17884d) AM_WRITE(metro_blitter_w) AM_SHARE("blitter_regs") // Tiles Blitter |
| 1904 | AM_RANGE(0x178860, 0x17886b) AM_WRITE(metro_window_w) AM_SHARE("window") // Tilemap Window |
| 1905 | AM_RANGE(0x178870, 0x17887b) AM_WRITEONLY AM_SHARE("scroll") // Scroll |
| 1906 | AM_RANGE(0x178880, 0x178881) AM_WRITENOP // ? CRT |
| 1907 | AM_RANGE(0x178890, 0x178891) AM_WRITENOP // ? CRT |
| 1908 | AM_RANGE(0x1788a2, 0x1788a3) AM_READWRITE(metro_irq_cause_r, metro_irq_cause_w) // IRQ Cause / IRQ Acknowledge |
| 1909 | AM_RANGE(0x1788a4, 0x1788a5) AM_WRITEONLY AM_SHARE("irq_enable") // IRQ Enable |
| 1910 | AM_RANGE(0x1788aa, 0x1788ab) AM_WRITEONLY AM_SHARE("rombank") // Rom Bank |
| 1911 | AM_RANGE(0x1788ac, 0x1788ad) AM_WRITEONLY AM_SHARE("screenctrl") // Screen Control |
| 1912 | AM_RANGE(0x179700, 0x179713) AM_WRITEONLY AM_SHARE("videoregs") // Video Registers |
| 1913 | AM_RANGE(0x200000, 0x200001) AM_READ_PORT("P1_P2") AM_WRITE8(vmetal_control_w, 0x00ff) |
| 1914 | AM_RANGE(0x200002, 0x200003) AM_READ_PORT("SYSTEM") |
| 1915 | AM_RANGE(0x300000, 0x31ffff) AM_READ(balcube_dsw_r) // DSW x 3 |
| 1916 | AM_RANGE(0x400000, 0x400001) AM_DEVREADWRITE8("oki", okim6295_device, read, write, 0x00ff ) |
| 1917 | AM_RANGE(0x400002, 0x400003) AM_DEVWRITE8("oki", okim6295_device, write, 0x00ff) |
| 1918 | AM_RANGE(0x500000, 0x50000d) AM_WRITE8(vmetal_es8712_w, 0x00ff) |
| 1919 | AM_RANGE(0xf00000, 0xf0ffff) AM_RAM AM_MIRROR(0x0f0000) // RAM (mirrored) |
| 1920 | ADDRESS_MAP_END |
| 1921 | |
| 1922 | |
| 1923 | /*************************************************************************** |
| 1924 | |
| 1925 | |
| 1824 | 1926 | Input Ports |
| 1825 | 1927 | |
| 1826 | 1928 | |
| r20035 | r20036 | |
| 3278 | 3380 | PORT_BIT( 0xffff, IP_ACTIVE_LOW, IPT_UNKNOWN ) // BIT 6 !? |
| 3279 | 3381 | INPUT_PORTS_END |
| 3280 | 3382 | |
| 3383 | /*************************************************************************** |
| 3384 | Varia Metal |
| 3385 | ***************************************************************************/ |
| 3281 | 3386 | |
| 3387 | /* verified from M68000 code */ |
| 3388 | static INPUT_PORTS_START( vmetal ) |
| 3389 | PORT_START("P1_P2") |
| 3390 | PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2) |
| 3391 | PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2) |
| 3392 | PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2) |
| 3393 | PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2) |
| 3394 | PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) |
| 3395 | PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2) |
| 3396 | PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2) |
| 3397 | PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_START2 ) |
| 3398 | PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1) |
| 3399 | PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1) |
| 3400 | PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1) |
| 3401 | PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1) |
| 3402 | PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) |
| 3403 | PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1) |
| 3404 | PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1) |
| 3405 | PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_START1 ) |
| 3282 | 3406 | |
| 3407 | PORT_START("SYSTEM") |
| 3408 | PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_COIN1 ) |
| 3409 | PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN2 ) |
| 3410 | PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_TILT ) /* 'Tilt' only in "test mode" - no effect ingame */ |
| 3411 | PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_SERVICE1 ) /* same coinage as COIN1 and COIN2 */ |
| 3412 | PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_SERVICE2 ) /* 'Test' only in "test mode" - no effect ingame */ |
| 3413 | PORT_BIT( 0xffe0, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 3414 | |
| 3415 | PORT_START("DSW0") |
| 3416 | // DSW1, stored at 0xff0085.b (cpl'ed) |
| 3417 | PORT_DIPNAME( 0x0007, 0x0007, DEF_STR( Coinage ) ) |
| 3418 | PORT_DIPSETTING( 0x0005, DEF_STR( 3C_1C ) ) |
| 3419 | PORT_DIPSETTING( 0x0006, DEF_STR( 2C_1C ) ) |
| 3420 | PORT_DIPSETTING( 0x0007, DEF_STR( 1C_1C ) ) |
| 3421 | PORT_DIPSETTING( 0x0004, DEF_STR( 1C_2C ) ) |
| 3422 | PORT_DIPSETTING( 0x0003, DEF_STR( 1C_3C ) ) |
| 3423 | PORT_DIPSETTING( 0x0002, DEF_STR( 1C_4C ) ) |
| 3424 | PORT_DIPSETTING( 0x0001, DEF_STR( 1C_5C ) ) |
| 3425 | PORT_DIPSETTING( 0x0000, DEF_STR( 1C_6C ) ) |
| 3426 | PORT_DIPUNUSED( 0x0008, IP_ACTIVE_LOW ) /* 0x01 (OFF) or 0x02 (ON) written to 0xff0112.b but NEVER read back - old credits for 2 players game ? */ |
| 3427 | PORT_DIPNAME( 0x0010, 0x0010, DEF_STR( Flip_Screen ) ) /* 0x07c1 written to 0x1788ac.w (screen control ?) at first (code at 0x0001b8) */ |
| 3428 | PORT_DIPSETTING( 0x0010, DEF_STR( Off ) ) /* 0x07c1 written to 0xff0114.w (then 0x1788ac.w) during initialisation (code at 0x000436) */ |
| 3429 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) /* 0x07c0 written to 0xff0114.w (then 0x1788ac.w) during initialisation (code at 0x000436) */ |
| 3430 | PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Demo_Sounds ) ) |
| 3431 | PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) |
| 3432 | PORT_DIPSETTING( 0x0020, DEF_STR( On ) ) |
| 3433 | PORT_DIPUNUSED( 0x0040, IP_ACTIVE_LOW ) |
| 3434 | PORT_DIPUNUSED( 0x0080, IP_ACTIVE_LOW ) |
| 3435 | |
| 3436 | PORT_START("IN2") |
| 3437 | // DSW2, stored at 0xff0084.b (cpl'ed) |
| 3438 | PORT_DIPNAME( 0x0003, 0x0003, DEF_STR( Difficulty ) ) |
| 3439 | PORT_DIPSETTING( 0x0002, DEF_STR( Easy ) ) |
| 3440 | PORT_DIPSETTING( 0x0003, DEF_STR( Normal ) ) |
| 3441 | PORT_DIPSETTING( 0x0001, DEF_STR( Hard ) ) |
| 3442 | PORT_DIPSETTING( 0x0000, DEF_STR( Hardest ) ) |
| 3443 | PORT_DIPNAME( 0x000c, 0x000c, DEF_STR( Lives ) ) |
| 3444 | PORT_DIPSETTING( 0x0008, "1" ) |
| 3445 | PORT_DIPSETTING( 0x0004, "2" ) |
| 3446 | PORT_DIPSETTING( 0x000c, "3" ) |
| 3447 | PORT_DIPSETTING( 0x0000, "4" ) |
| 3448 | PORT_DIPNAME( 0x0010, 0x0010, DEF_STR( Bonus_Life ) ) /* code at 0x0004a4 */ |
| 3449 | PORT_DIPSETTING( 0x0010, "Every 30000" ) |
| 3450 | PORT_DIPSETTING( 0x0000, "Every 60000" ) |
| 3451 | PORT_DIPUNUSED( 0x0020, IP_ACTIVE_LOW ) |
| 3452 | PORT_DIPUNUSED( 0x0040, IP_ACTIVE_LOW ) |
| 3453 | PORT_SERVICE( 0x0080, IP_ACTIVE_LOW ) |
| 3454 | INPUT_PORTS_END |
| 3455 | |
| 3456 | |
| 3457 | |
| 3283 | 3458 | /*************************************************************************** |
| 3284 | 3459 | |
| 3285 | 3460 | |
| r20035 | r20036 | |
| 3302 | 3477 | }; |
| 3303 | 3478 | |
| 3304 | 3479 | /* 8x8x8 tiles for later games */ |
| 3305 | | static GFXLAYOUT_RAW( layout_8x8x8h, 8, 8, 8*8, 32*8 ) |
| 3480 | static GFXLAYOUT_RAW( layout_8x8x8, 8, 8, 8*8, 32*8 ) |
| 3306 | 3481 | |
| 3307 | 3482 | /* 16x16x4 tiles for later games */ |
| 3308 | | static const gfx_layout layout_16x16x4q = |
| 3483 | static const gfx_layout layout_16x16x4 = |
| 3309 | 3484 | { |
| 3310 | 3485 | 16,16, |
| 3311 | 3486 | RGN_FRAC(1,1), |
| r20035 | r20036 | |
| 3317 | 3492 | }; |
| 3318 | 3493 | |
| 3319 | 3494 | /* 16x16x8 tiles for later games */ |
| 3320 | | static GFXLAYOUT_RAW( layout_16x16x8o, 16, 16, 16*8, 32*8 ) |
| 3495 | static GFXLAYOUT_RAW( layout_16x16x8, 16, 16, 16*8, 32*8 ) |
| 3321 | 3496 | |
| 3322 | 3497 | static const gfx_layout layout_053936 = |
| 3323 | 3498 | { |
| r20035 | r20036 | |
| 3352 | 3527 | |
| 3353 | 3528 | static GFXDECODE_START( i4220 ) |
| 3354 | 3529 | GFXDECODE_ENTRY( "gfx1", 0, layout_8x8x4, 0x0, 0x100 ) // [0] 4 Bit Tiles |
| 3355 | | GFXDECODE_ENTRY( "gfx1", 0, layout_8x8x8h, 0x0, 0x10 ) // [1] 8 Bit Tiles |
| 3530 | GFXDECODE_ENTRY( "gfx1", 0, layout_8x8x8, 0x0, 0x10 ) // [1] 8 Bit Tiles |
| 3531 | GFXDECODE_ENTRY( "gfx1", 0, layout_16x16x4, 0x0, 0x100 ) // [2] 4 Bit Tiles 16x16 |
| 3532 | GFXDECODE_ENTRY( "gfx1", 0, layout_16x16x8, 0x0, 0x100 ) // [3] 8 Bit Tiles 16x16 |
| 3356 | 3533 | GFXDECODE_END |
| 3357 | 3534 | |
| 3358 | 3535 | static GFXDECODE_START( blzntrnd ) |
| 3359 | 3536 | GFXDECODE_ENTRY( "gfx1", 0, layout_8x8x4, 0x0, 0x100 ) // [0] 4 Bit Tiles |
| 3360 | | GFXDECODE_ENTRY( "gfx1", 0, layout_8x8x8h, 0x0, 0x10 ) // [1] 8 Bit Tiles |
| 3361 | | GFXDECODE_ENTRY( "gfx3", 0, layout_053936, 0x0, 0x10 ) // [2] 053936 Tiles |
| 3537 | GFXDECODE_ENTRY( "gfx1", 0, layout_8x8x8, 0x0, 0x10 ) // [1] 8 Bit Tiles |
| 3538 | GFXDECODE_ENTRY( "gfx1", 0, layout_16x16x4, 0x0, 0x100 ) // [2] 4 Bit Tiles 16x16 |
| 3539 | GFXDECODE_ENTRY( "gfx1", 0, layout_16x16x8, 0x0, 0x100 ) // [3] 8 Bit Tiles 16x16 |
| 3540 | GFXDECODE_ENTRY( "gfx2", 0, layout_053936, 0x0, 0x10 ) // [4] 053936 Tiles |
| 3362 | 3541 | GFXDECODE_END |
| 3363 | 3542 | |
| 3364 | 3543 | static GFXDECODE_START( gstrik2 ) |
| 3365 | 3544 | GFXDECODE_ENTRY( "gfx1", 0, layout_8x8x4, 0x0, 0x100 ) // [0] 4 Bit Tiles |
| 3366 | | GFXDECODE_ENTRY( "gfx1", 0, layout_8x8x8h, 0x0, 0x10 ) // [1] 8 Bit Tiles |
| 3367 | | GFXDECODE_ENTRY( "gfx3", 0, layout_053936_16,0x0, 0x10 ) // [2] 053936 Tiles |
| 3545 | GFXDECODE_ENTRY( "gfx1", 0, layout_8x8x8, 0x0, 0x10 ) // [1] 8 Bit Tiles |
| 3546 | GFXDECODE_ENTRY( "gfx1", 0, layout_16x16x4, 0x0, 0x100 ) // [2] 4 Bit Tiles 16x16 |
| 3547 | GFXDECODE_ENTRY( "gfx1", 0, layout_16x16x8, 0x0, 0x100 ) // [3] 8 Bit Tiles 16x16 |
| 3548 | GFXDECODE_ENTRY( "gfx2", 0, layout_053936_16,0x0, 0x10 ) // [4] 053936 Tiles |
| 3368 | 3549 | GFXDECODE_END |
| 3369 | 3550 | |
| 3551 | // same as 14220: |
| 3370 | 3552 | static GFXDECODE_START( i4300 ) |
| 3371 | 3553 | GFXDECODE_ENTRY( "gfx1", 0, layout_8x8x4, 0x0, 0x100 ) // [0] 4 Bit Tiles |
| 3372 | | GFXDECODE_ENTRY( "gfx1", 0, layout_8x8x8h, 0x0, 0x10 ) // [1] 8 Bit Tiles |
| 3373 | | GFXDECODE_ENTRY( "gfx1", 0, layout_16x16x4q, 0x0, 0x100 ) // [2] 4 Bit Tiles 16x16 |
| 3374 | | GFXDECODE_ENTRY( "gfx1", 0, layout_16x16x8o, 0x0, 0x100 ) // [2] 8 Bit Tiles 16x16 |
| 3554 | GFXDECODE_ENTRY( "gfx1", 0, layout_8x8x8, 0x0, 0x10 ) // [1] 8 Bit Tiles |
| 3555 | GFXDECODE_ENTRY( "gfx1", 0, layout_16x16x4, 0x0, 0x100 ) // [2] 4 Bit Tiles 16x16 |
| 3556 | GFXDECODE_ENTRY( "gfx1", 0, layout_16x16x8, 0x0, 0x100 ) // [3] 8 Bit Tiles 16x16 |
| 3375 | 3557 | GFXDECODE_END |
| 3376 | 3558 | |
| 3377 | 3559 | |
| r20035 | r20036 | |
| 3396 | 3578 | save_item(NAME(m_gakusai_oki_bank_hi)); |
| 3397 | 3579 | save_item(NAME(m_sprite_xoffs)); |
| 3398 | 3580 | save_item(NAME(m_sprite_yoffs)); |
| 3399 | | save_item(NAME(m_bg_tilemap_enable)); |
| 3400 | | save_item(NAME(m_bg_tilemap_enable16)); |
| 3401 | 3581 | } |
| 3402 | 3582 | |
| 3403 | 3583 | MACHINE_RESET_MEMBER(metro_state,metro) |
| r20035 | r20036 | |
| 3433 | 3613 | MCFG_SCREEN_UPDATE_DRIVER(metro_state, screen_update_metro) |
| 3434 | 3614 | |
| 3435 | 3615 | MCFG_GFXDECODE(i4220) |
| 3436 | | MCFG_VIDEO_START_OVERRIDE(metro_state,metro_i4220_offset) |
| 3616 | MCFG_VIDEO_START_OVERRIDE(metro_state,metro_i4220_dx_tmap) |
| 3437 | 3617 | MCFG_PALETTE_LENGTH(0x1000) |
| 3438 | 3618 | |
| 3439 | 3619 | /* sound hardware */ |
| r20035 | r20036 | |
| 3466 | 3646 | MCFG_SCREEN_UPDATE_DRIVER(metro_state, screen_update_metro) |
| 3467 | 3647 | |
| 3468 | 3648 | MCFG_GFXDECODE(i4220) |
| 3469 | | MCFG_VIDEO_START_OVERRIDE(metro_state,metro_i4220_offset) |
| 3649 | MCFG_VIDEO_START_OVERRIDE(metro_state,metro_i4220_dx_tmap) |
| 3470 | 3650 | MCFG_PALETTE_LENGTH(0x1000) |
| 3471 | 3651 | |
| 3472 | 3652 | /* sound hardware */ |
| r20035 | r20036 | |
| 3499 | 3679 | MCFG_SCREEN_UPDATE_DRIVER(metro_state, screen_update_metro) |
| 3500 | 3680 | |
| 3501 | 3681 | MCFG_GFXDECODE(i4220) |
| 3502 | | MCFG_VIDEO_START_OVERRIDE(metro_state,metro_i4220_offset) |
| 3682 | MCFG_VIDEO_START_OVERRIDE(metro_state,metro_i4220_dx_tmap) |
| 3503 | 3683 | MCFG_PALETTE_LENGTH(0x1000) |
| 3504 | 3684 | |
| 3505 | 3685 | /* sound hardware */ |
| r20035 | r20036 | |
| 3532 | 3712 | MCFG_SCREEN_UPDATE_DRIVER(metro_state, screen_update_metro) |
| 3533 | 3713 | |
| 3534 | 3714 | MCFG_GFXDECODE(i4220) |
| 3535 | | MCFG_VIDEO_START_OVERRIDE(metro_state,metro_i4220_offset) |
| 3715 | MCFG_VIDEO_START_OVERRIDE(metro_state,metro_i4220_dx_tmap) |
| 3536 | 3716 | MCFG_PALETTE_LENGTH(0x1000) |
| 3537 | 3717 | |
| 3538 | 3718 | /* sound hardware */ |
| r20035 | r20036 | |
| 3565 | 3745 | MCFG_SCREEN_UPDATE_DRIVER(metro_state, screen_update_metro) |
| 3566 | 3746 | |
| 3567 | 3747 | MCFG_GFXDECODE(i4220) |
| 3568 | | MCFG_VIDEO_START_OVERRIDE(metro_state,metro_i4220_offset) |
| 3748 | MCFG_VIDEO_START_OVERRIDE(metro_state,metro_i4220_dx_tmap) |
| 3569 | 3749 | MCFG_PALETTE_LENGTH(0x1000) |
| 3570 | 3750 | |
| 3571 | 3751 | /* sound hardware */ |
| r20035 | r20036 | |
| 3602 | 3782 | MCFG_SCREEN_UPDATE_DRIVER(metro_state, screen_update_metro) |
| 3603 | 3783 | |
| 3604 | 3784 | MCFG_GFXDECODE(i4220) |
| 3605 | | MCFG_VIDEO_START_OVERRIDE(metro_state,metro_i4220_offset) |
| 3785 | MCFG_VIDEO_START_OVERRIDE(metro_state,metro_i4220_dx_tmap) |
| 3606 | 3786 | MCFG_PALETTE_LENGTH(0x1000) |
| 3607 | 3787 | |
| 3608 | 3788 | /* sound hardware */ |
| r20035 | r20036 | |
| 4204 | 4384 | MACHINE_CONFIG_END |
| 4205 | 4385 | |
| 4206 | 4386 | |
| 4387 | static MACHINE_CONFIG_START( vmetal, metro_state ) |
| 4388 | |
| 4389 | /* basic machine hardware */ |
| 4390 | MCFG_CPU_ADD("maincpu", M68000, XTAL_16MHz) |
| 4391 | MCFG_CPU_PROGRAM_MAP(vmetal_map) |
| 4392 | MCFG_CPU_VBLANK_INT_DRIVER("screen", metro_state, metro_vblank_interrupt) |
| 4393 | MCFG_CPU_PERIODIC_INT_DRIVER(metro_state, metro_periodic_interrupt, 8*60) // ? |
| 4394 | |
| 4395 | MCFG_MACHINE_START_OVERRIDE(metro_state,metro) |
| 4396 | MCFG_MACHINE_RESET_OVERRIDE(metro_state,metro) |
| 4397 | |
| 4398 | /* video hardware */ |
| 4399 | MCFG_SCREEN_ADD("screen", RASTER) |
| 4400 | MCFG_SCREEN_REFRESH_RATE(58.2328) // VSync 58.2328Hz, HSync 15.32kHz |
| 4401 | MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) |
| 4402 | MCFG_SCREEN_SIZE(320, 224) |
| 4403 | MCFG_SCREEN_VISIBLE_AREA(0, 320-1, 0, 224-1) |
| 4404 | MCFG_SCREEN_UPDATE_DRIVER(metro_state, screen_update_metro) |
| 4405 | |
| 4406 | MCFG_GFXDECODE(i4220) |
| 4407 | MCFG_VIDEO_START_OVERRIDE(metro_state,metro_i4220_dx_sprite) |
| 4408 | MCFG_PALETTE_LENGTH(0x1000) |
| 4409 | |
| 4410 | /* sound hardware */ |
| 4411 | MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker") |
| 4412 | |
| 4413 | MCFG_OKIM6295_ADD("oki", XTAL_1MHz, OKIM6295_PIN7_HIGH) |
| 4414 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.75) |
| 4415 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.75) |
| 4416 | |
| 4417 | MCFG_SOUND_ADD("essnd", ES8712, 12000) |
| 4418 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.50) |
| 4419 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.50) |
| 4420 | |
| 4421 | // OKI M6585 not hooked up... |
| 4422 | MACHINE_CONFIG_END |
| 4423 | |
| 4424 | |
| 4207 | 4425 | static const k053936_interface blzntrnd_k053936_intf = |
| 4208 | 4426 | { |
| 4209 | 4427 | 0, -69, -21 |
| r20035 | r20036 | |
| 4522 | 4740 | ROMX_LOAD( "rom331.bin", 0x1000004, 0x200000, CRC(4d909c28) SHA1(fb9bb824e518f67713799ed2c0159a7bd70f35c4) , ROM_GROUPWORD | ROM_SKIP(6)) |
| 4523 | 4741 | ROMX_LOAD( "rom375.bin", 0x1000006, 0x200000, CRC(6eb4f97c) SHA1(c7f006230cbf10e706b0362eeed34655a3aef1a5) , ROM_GROUPWORD | ROM_SKIP(6)) |
| 4524 | 4742 | |
| 4525 | | ROM_REGION( 0x200000, "gfx3", 0 ) /* 053936 gfx data */ |
| 4743 | ROM_REGION( 0x200000, "gfx2", 0 ) /* 053936 gfx data */ |
| 4526 | 4744 | ROM_LOAD( "rom9.bin", 0x000000, 0x200000, CRC(37ca3570) SHA1(3374c586bf84583fa33f2793c4e8f2f61a0cab1c) ) |
| 4527 | 4745 | |
| 4528 | 4746 | ROM_REGION( 0x080000, "ymsnd.deltat", 0 ) /* Samples */ |
| r20035 | r20036 | |
| 4608 | 4826 | // ROMX_LOAD( "chr14.90", 0x1800004, 0x200000, CRC() SHA1() , ROM_GROUPWORD | ROM_SKIP(6)) |
| 4609 | 4827 | // ROMX_LOAD( "chr15.89", 0x1800006, 0x200000, CRC() SHA1() , ROM_GROUPWORD | ROM_SKIP(6)) |
| 4610 | 4828 | |
| 4611 | | ROM_REGION( 0x200000, "gfx3", 0 ) /* 053936 gfx data */ |
| 4829 | ROM_REGION( 0x200000, "gfx2", 0 ) /* 053936 gfx data */ |
| 4612 | 4830 | ROM_LOAD( "psacrom.60", 0x000000, 0x200000, CRC(73f1f279) SHA1(1135b2b1eb4c52249bc12ee178340bbb202a94c8) ) |
| 4613 | 4831 | |
| 4614 | 4832 | ROM_REGION( 0x200000, "ymsnd.deltat", 0 ) /* Samples */ |
| r20035 | r20036 | |
| 4648 | 4866 | // ROMX_LOAD( "chr14.90", 0x1800004, 0x200000, CRC() SHA1() , ROM_GROUPWORD | ROM_SKIP(6)) |
| 4649 | 4867 | // ROMX_LOAD( "chr15.89", 0x1800006, 0x200000, CRC() SHA1() , ROM_GROUPWORD | ROM_SKIP(6)) |
| 4650 | 4868 | |
| 4651 | | ROM_REGION( 0x200000, "gfx3", 0 ) /* 053936 gfx data */ |
| 4869 | ROM_REGION( 0x200000, "gfx2", 0 ) /* 053936 gfx data */ |
| 4652 | 4870 | ROM_LOAD( "psacrom.60", 0x000000, 0x200000, CRC(73f1f279) SHA1(1135b2b1eb4c52249bc12ee178340bbb202a94c8) ) |
| 4653 | 4871 | |
| 4654 | 4872 | ROM_REGION( 0x200000, "ymsnd.deltat", 0 ) /* Samples */ |
| r20035 | r20036 | |
| 5949 | 6167 | ROM_LOAD( "tr2_ja_7.3g", 0x000000, 0x020000, CRC(6ee32315) SHA1(ef4d59576929deab0aa459a67be21d97c2803dea) ) |
| 5950 | 6168 | ROM_END |
| 5951 | 6169 | |
| 6170 | /*************************************************************************** |
| 5952 | 6171 | |
| 6172 | Varia Metal |
| 6173 | Excellent System Ltd, 1995 |
| 6174 | |
| 6175 | PCB Layout |
| 6176 | ---------- |
| 6177 | This game runs on Metro hardware. |
| 6178 | |
| 6179 | ES-9309B-B |
| 6180 | |--------------------------------------------| |
| 6181 | | TA7222 8.U9 DSW1(8) DSW2(8) | |
| 6182 | |VOL M6295 1.000MHz | |
| 6183 | | |------------| | |
| 6184 | | 7.U12 | 68000 | | |
| 6185 | | uPC3403 |------------| | |
| 6186 | |J 640kHz ES-8712 | |
| 6187 | |A M6585 EPM7032 6B.U18 5B.U19 | |
| 6188 | |M MM1035 | |
| 6189 | |M 26.666MHz 16MHz 62256 62256 | |
| 6190 | |A | |
| 6191 | | |--------| 1.U29 | |
| 6192 | | 62256 |Imagetek| | |
| 6193 | | 62256 |I4220 | 2.U31 | |
| 6194 | | | | | |
| 6195 | | |--------| 3.U28 | |
| 6196 | | | |
| 6197 | | 6264 4.U30 | |
| 6198 | |--------------------------------------------| |
| 6199 | Notes: |
| 6200 | 68000 - clock 16.000MHz |
| 6201 | ES-8712 - ES-8712 Single Channel ADPCM Samples Player. Clock ?? seems to be 16kHz? |
| 6202 | This chip is branded 'EXCELLENT', may be (or not??) manufactured by Ensonic (SDIP48) |
| 6203 | M6295 - clock 1.000MHz. Sample rate = 1000000/132 |
| 6204 | M6585 - Oki M6585 ADPCM Voice Synthesizer IC (DIP18). Clock 640kHz. |
| 6205 | Sample rate = 16kHz (selection - pin 1 LOW, pin 2 HIGH = 16kHz) |
| 6206 | This is a version-up to the previous M5205 with some additional |
| 6207 | capabilies and improvements. |
| 6208 | MM1035 - Mitsumi Monolithic IC MM1035 System Reset and Watchdog Timer (DIP8) |
| 6209 | uPC3403 - NEC uPC3403 High Performance Quad Operational Amplifier (DIP14) |
| 6210 | 62256 - 32k x8 SRAM (DIP28) |
| 6211 | 6264 - 8k x8 SRAM (DIP28) |
| 6212 | TA7222 - Toshiba TA7222 5.8 Watt Audio Power Amplifier (SIP10) |
| 6213 | EPM7032 - Altera EPM7032LC44-15T High Performance EEPROM-based Programmable Logic Device (PLCC44) |
| 6214 | Custom - Imagetek I4220 Graphics Controller (QFP208) |
| 6215 | VSync - 58.2328Hz |
| 6216 | HSync - 15.32kHz |
| 6217 | ROMs - |
| 6218 | 6B & 5B are 27C040 EPROM (DIP32) |
| 6219 | 8 is 4M MaskROM (DIP32) |
| 6220 | All other ROMs are 16M MaskROM (DIP42) |
| 6221 | |
| 6222 | ***************************************************************************/ |
| 6223 | |
| 6224 | ROM_START( vmetal ) |
| 6225 | ROM_REGION( 0x100000, "maincpu", 0 ) /* 68000 Code */ |
| 6226 | ROM_LOAD16_BYTE( "6b.u18", 0x00000, 0x80000, CRC(4eb939d5) SHA1(741ab05043fc3bd886162d878630e45da9359718) ) |
| 6227 | ROM_LOAD16_BYTE( "5b.u19", 0x00001, 0x80000, CRC(4933ac6c) SHA1(1a3303e32fcb08854d4d6e13f36ca99d92aed4cc) ) |
| 6228 | |
| 6229 | ROM_REGION( 0x800000, "gfx1", 0 ) |
| 6230 | ROMX_LOAD( "2.u31", 0x000000, 0x200000, CRC(b36f8d60) SHA1(1676859d0fee4eb9897ce1601a2c9fd9a6dc4a43), ROM_GROUPWORD | ROM_SKIP(6)) |
| 6231 | ROMX_LOAD( "4.u30", 0x000002, 0x200000, CRC(5a25a49c) SHA1(c30781202ec882e1ec6adfb560b0a1075b3cce55), ROM_GROUPWORD | ROM_SKIP(6)) |
| 6232 | ROMX_LOAD( "1.u29", 0x000004, 0x200000, CRC(b470c168) SHA1(c30462dc134da1e71a94b36ef96ecd65c325b07e), ROM_GROUPWORD | ROM_SKIP(6)) |
| 6233 | ROMX_LOAD( "3.u28", 0x000006, 0x200000, CRC(00fca765) SHA1(ca9010bd7f59367e483868018db9a9abf871386e), ROM_GROUPWORD | ROM_SKIP(6)) |
| 6234 | |
| 6235 | ROM_REGION( 0x080000, "oki", 0 ) /* OKI6295 Samples */ |
| 6236 | /* Second half is junk */ |
| 6237 | ROM_LOAD( "8.u9", 0x00000, 0x80000, CRC(c14c001c) SHA1(bad96b5cd40d1c34ef8b702262168ecab8192fb6) ) |
| 6238 | |
| 6239 | ROM_REGION( 0x200000, "essnd", 0 ) /* Samples */ |
| 6240 | ROM_LOAD( "7.u12", 0x00000, 0x200000, CRC(a88c52f1) SHA1(d74a5a11f84ba6b1042b33a2c156a1071b6fbfe1) ) |
| 6241 | ROM_END |
| 6242 | |
| 6243 | ROM_START( vmetaln ) |
| 6244 | ROM_REGION( 0x100000, "maincpu", 0 ) /* 68000 Code */ |
| 6245 | ROM_LOAD16_BYTE( "vm6.bin", 0x00000, 0x80000, CRC(cb292ab1) SHA1(41fdfe67e6cb848542fd5aa0dfde3b1936bb3a28) ) |
| 6246 | ROM_LOAD16_BYTE( "vm5.bin", 0x00001, 0x80000, CRC(43ef844e) SHA1(c673f34fcc9e406282c9008795b52d01a240099a) ) |
| 6247 | |
| 6248 | ROM_REGION( 0x800000, "gfx1", 0 ) |
| 6249 | ROMX_LOAD( "2.u31", 0x000000, 0x200000, CRC(b36f8d60) SHA1(1676859d0fee4eb9897ce1601a2c9fd9a6dc4a43), ROM_GROUPWORD | ROM_SKIP(6)) |
| 6250 | ROMX_LOAD( "4.u30", 0x000002, 0x200000, CRC(5a25a49c) SHA1(c30781202ec882e1ec6adfb560b0a1075b3cce55), ROM_GROUPWORD | ROM_SKIP(6)) |
| 6251 | ROMX_LOAD( "1.u29", 0x000004, 0x200000, CRC(b470c168) SHA1(c30462dc134da1e71a94b36ef96ecd65c325b07e), ROM_GROUPWORD | ROM_SKIP(6)) |
| 6252 | ROMX_LOAD( "3.u28", 0x000006, 0x200000, CRC(00fca765) SHA1(ca9010bd7f59367e483868018db9a9abf871386e), ROM_GROUPWORD | ROM_SKIP(6)) |
| 6253 | |
| 6254 | ROM_REGION( 0x080000, "oki", 0 ) /* OKI6295 Samples */ |
| 6255 | /* Second half is junk */ |
| 6256 | ROM_LOAD( "8.u9", 0x00000, 0x80000, CRC(c14c001c) SHA1(bad96b5cd40d1c34ef8b702262168ecab8192fb6) ) |
| 6257 | |
| 6258 | ROM_REGION( 0x200000, "essnd", 0 ) /* Samples */ |
| 6259 | ROM_LOAD( "7.u12", 0x00000, 0x200000, CRC(a88c52f1) SHA1(d74a5a11f84ba6b1042b33a2c156a1071b6fbfe1) ) |
| 6260 | ROM_END |
| 6261 | |
| 6262 | |
| 5953 | 6263 | /*************************************************************************** |
| 5954 | 6264 | |
| 5955 | 6265 | |
| r20035 | r20036 | |
| 6091 | 6401 | |
| 6092 | 6402 | ***************************************************************************/ |
| 6093 | 6403 | |
| 6094 | | GAME( 1992, karatour, 0, karatour, karatour, metro_state, karatour, ROT0, "Mitchell", "The Karate Tournament", GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE ) |
| 6095 | | GAME( 1992, pangpoms, 0, pangpoms, pangpoms, metro_state, metro, ROT0, "Metro", "Pang Pom's", GAME_SUPPORTS_SAVE ) |
| 6096 | | GAME( 1992, pangpomsm, pangpoms, pangpoms, pangpoms, metro_state, metro, ROT0, "Metro (Mitchell license)", "Pang Pom's (Mitchell)", GAME_SUPPORTS_SAVE ) |
| 6097 | | GAME( 1992, skyalert, 0, skyalert, skyalert, metro_state, metro, ROT270, "Metro", "Sky Alert", GAME_SUPPORTS_SAVE ) |
| 6098 | | GAME( 1993, ladykill, 0, karatour, ladykill, metro_state, karatour, ROT90, "Yanyaka (Mitchell license)", "Lady Killer", GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE ) |
| 6099 | | GAME( 1993, moegonta, ladykill, karatour, moegonta, metro_state, karatour, ROT90, "Yanyaka", "Moeyo Gonta!! (Japan)", GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE ) |
| 6100 | | GAME( 1993, poitto, 0, poitto, poitto, metro_state, metro, ROT0, "Metro / Able Corp.", "Poitto!", GAME_SUPPORTS_SAVE ) |
| 6101 | | GAME( 1994, blzntrnd, 0, blzntrnd, blzntrnd, metro_state, blzntrnd, ROT0, "Human Amusement", "Blazing Tornado", GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE ) |
| 6102 | | GAME( 1994, dharma, 0, dharma, dharma, metro_state, metro, ROT0, "Metro", "Dharma Doujou", GAME_SUPPORTS_SAVE ) |
| 6103 | | GAME( 1994, dharmak, dharma, dharma, dharma, metro_state, dharmak, ROT0, "Metro", "Dharma Doujou (Korea)", GAME_SUPPORTS_SAVE ) |
| 6104 | | GAME( 1994, lastfort, 0, lastfort, lastfort, metro_state, metro, ROT0, "Metro", "Last Fortress - Toride", GAME_SUPPORTS_SAVE ) |
| 6105 | | GAME( 1994, lastforte, lastfort, lastfort, lastfero, metro_state, metro, ROT0, "Metro", "Last Fortress - Toride (Erotic, Rev C)", GAME_SUPPORTS_SAVE ) |
| 6106 | | GAME( 1994, lastfortea,lastfort, lastfort, lastfero, metro_state, metro, ROT0, "Metro", "Last Fortress - Toride (Erotic, Rev A)", GAME_SUPPORTS_SAVE ) |
| 6107 | | GAME( 1994, lastfortk, lastfort, lastfort, lastfero, metro_state, metro, ROT0, "Metro", "Last Fortress - Toride (Korea)", GAME_SUPPORTS_SAVE ) |
| 6108 | | GAME( 1994, lastfortg, lastfort, lastforg, ladykill, metro_state, metro, ROT0, "Metro", "Last Fortress - Toride (German)", GAME_SUPPORTS_SAVE ) |
| 6109 | | GAME( 1994, toride2g, 0, toride2g, toride2g, metro_state, metro, ROT0, "Metro", "Toride II Adauchi Gaiden", GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE ) |
| 6110 | | GAME( 1994, toride2gg, toride2g, toride2g, toride2g, metro_state, metro, ROT0, "Metro", "Toride II Adauchi Gaiden (German)", GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE ) |
| 6111 | | GAME( 1994, toride2gk, toride2g, toride2g, toride2g, metro_state, metro, ROT0, "Metro", "Toride II Bok Su Oi Jeon Adauchi Gaiden (Korea)", GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE ) |
| 6112 | | GAME( 1994, toride2j, toride2g, toride2g, toride2g, metro_state, metro, ROT0, "Metro", "Toride II (Japan)", GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE ) |
| 6113 | | GAME( 1994, gunmast, 0, pururun, gunmast, metro_state, daitorid, ROT0, "Metro", "Gun Master", GAME_SUPPORTS_SAVE ) |
| 6114 | | GAME( 1995, daitorid, 0, daitorid, daitorid, metro_state, daitorid, ROT0, "Metro", "Daitoride", GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE ) |
| 6115 | | GAME( 1996, daitorida, daitorid, daitoa, daitorid, metro_state, balcube, ROT0, "Metro", "Daitoride (YMF278B version)", GAME_SUPPORTS_SAVE ) |
| 6116 | | GAME( 1995, dokyusei, 0, dokyusei, dokyusei, metro_state, gakusai, ROT0, "Make Software / Elf / Media Trading", "Mahjong Doukyuusei", GAME_SUPPORTS_SAVE ) |
| 6117 | | GAME( 1995, dokyusp, 0, dokyusp, gakusai, metro_state, gakusai, ROT0, "Make Software / Elf / Media Trading", "Mahjong Doukyuusei Special", GAME_SUPPORTS_SAVE ) |
| 6118 | | GAME( 1995, msgogo, 0, msgogo, msgogo, metro_state, balcube, ROT0, "Metro", "Mouse Shooter GoGo", GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE ) |
| 6119 | | GAME( 1995, pururun, 0, pururun, pururun, metro_state, daitorid, ROT0, "Metro / Banpresto", "Pururun", GAME_SUPPORTS_SAVE ) |
| 6120 | | GAME( 1995, puzzli, 0, daitorid, puzzli, metro_state, daitorid, ROT0, "Metro / Banpresto", "Puzzli", GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE ) |
| 6121 | | GAME( 1996, 3kokushi, 0, 3kokushi, 3kokushi, metro_state, karatour, ROT0, "Mitchell", "Sankokushi (Japan)", GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE ) |
| 6122 | | GAME( 1996, balcube, 0, balcube, balcube, metro_state, balcube, ROT0, "Metro", "Bal Cube", GAME_SUPPORTS_SAVE ) |
| 6123 | | GAME( 1996, bangball, 0, bangball, bangball, metro_state, balcube, ROT0, "Banpresto / Kunihiko Tashiro+Goodhouse", "Bang Bang Ball (v1.05)", GAME_SUPPORTS_SAVE ) |
| 6124 | | GAME( 1996, gstrik2, 0, gstrik2, gstrik2, metro_state, blzntrnd, ROT0, "Human Amusement", "Grand Striker 2 (Europe and Oceania)", GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE ) |
| 6125 | | GAME( 1996, gstrik2j, gstrik2, gstrik2, gstrik2, metro_state, blzntrnd, ROT0, "Human Amusement", "Grand Striker 2 (Japan)", GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE ) // priority between rounds |
| 6126 | | GAME( 1999, batlbubl, bangball, batlbubl, batlbubl, metro_state, balcube, ROT0, "Banpresto (Limenko license?)", "Battle Bubble (v2.00)", GAME_SUPPORTS_SAVE ) // or bootleg? |
| 6127 | | GAME( 1996, mouja, 0, mouja, mouja, metro_state, mouja, ROT0, "Etona", "Mouja (Japan)", GAME_NO_COCKTAIL | GAME_SUPPORTS_SAVE ) |
| 6128 | | GAME( 1997, gakusai, 0, gakusai, gakusai, metro_state, gakusai, ROT0, "MakeSoft", "Mahjong Gakuensai (Japan)", GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE ) |
| 6129 | | GAME( 1998, gakusai2, 0, gakusai2, gakusai, metro_state, gakusai, ROT0, "MakeSoft", "Mahjong Gakuensai 2 (Japan)", GAME_SUPPORTS_SAVE ) |
| 6130 | | GAME( 2000, puzzlet, 0, puzzlet, puzzlet, metro_state, puzzlet, ROT0, "Unies Corporation", "Puzzlet (Japan)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_SUPPORTS_SAVE ) |
| 6404 | GAME( 1992, karatour, 0, karatour, karatour, metro_state, karatour, ROT0, "Mitchell", "The Karate Tournament", GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE ) |
| 6405 | GAME( 1992, pangpoms, 0, pangpoms, pangpoms, metro_state, metro, ROT0, "Metro", "Pang Pom's", GAME_SUPPORTS_SAVE ) |
| 6406 | GAME( 1992, pangpomsm, pangpoms, pangpoms, pangpoms, metro_state, metro, ROT0, "Metro (Mitchell license)", "Pang Pom's (Mitchell)", GAME_SUPPORTS_SAVE ) |
| 6407 | GAME( 1992, skyalert, 0, skyalert, skyalert, metro_state, metro, ROT270, "Metro", "Sky Alert", GAME_SUPPORTS_SAVE ) |
| 6408 | GAME( 1993, ladykill, 0, karatour, ladykill, metro_state, karatour, ROT90, "Yanyaka (Mitchell license)", "Lady Killer", GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE ) |
| 6409 | GAME( 1993, moegonta, ladykill, karatour, moegonta, metro_state, karatour, ROT90, "Yanyaka", "Moeyo Gonta!! (Japan)", GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE ) |
| 6410 | GAME( 1993, poitto, 0, poitto, poitto, metro_state, metro, ROT0, "Metro / Able Corp.", "Poitto!", GAME_SUPPORTS_SAVE ) |
| 6411 | GAME( 1994, blzntrnd, 0, blzntrnd, blzntrnd, metro_state, blzntrnd, ROT0, "Human Amusement", "Blazing Tornado", GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE ) |
| 6412 | GAME( 1994, dharma, 0, dharma, dharma, metro_state, metro, ROT0, "Metro", "Dharma Doujou", GAME_SUPPORTS_SAVE ) |
| 6413 | GAME( 1994, dharmak, dharma, dharma, dharma, metro_state, dharmak, ROT0, "Metro", "Dharma Doujou (Korea)", GAME_SUPPORTS_SAVE ) |
| 6414 | GAME( 1994, lastfort, 0, lastfort, lastfort, metro_state, metro, ROT0, "Metro", "Last Fortress - Toride", GAME_SUPPORTS_SAVE ) |
| 6415 | GAME( 1994, lastforte, lastfort, lastfort, lastfero, metro_state, metro, ROT0, "Metro", "Last Fortress - Toride (Erotic, Rev C)", GAME_SUPPORTS_SAVE ) |
| 6416 | GAME( 1994, lastfortea,lastfort, lastfort, lastfero, metro_state, metro, ROT0, "Metro", "Last Fortress - Toride (Erotic, Rev A)", GAME_SUPPORTS_SAVE ) |
| 6417 | GAME( 1994, lastfortk, lastfort, lastfort, lastfero, metro_state, metro, ROT0, "Metro", "Last Fortress - Toride (Korea)", GAME_SUPPORTS_SAVE ) |
| 6418 | GAME( 1994, lastfortg, lastfort, lastforg, ladykill, metro_state, metro, ROT0, "Metro", "Last Fortress - Toride (German)", GAME_SUPPORTS_SAVE ) |
| 6419 | GAME( 1994, toride2g, 0, toride2g, toride2g, metro_state, metro, ROT0, "Metro", "Toride II Adauchi Gaiden", GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE ) |
| 6420 | GAME( 1994, toride2gg, toride2g, toride2g, toride2g, metro_state, metro, ROT0, "Metro", "Toride II Adauchi Gaiden (German)", GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE ) |
| 6421 | GAME( 1994, toride2gk, toride2g, toride2g, toride2g, metro_state, metro, ROT0, "Metro", "Toride II Bok Su Oi Jeon Adauchi Gaiden (Korea)", GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE ) |
| 6422 | GAME( 1994, toride2j, toride2g, toride2g, toride2g, metro_state, metro, ROT0, "Metro", "Toride II (Japan)", GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE ) |
| 6423 | GAME( 1994, gunmast, 0, pururun, gunmast, metro_state, daitorid, ROT0, "Metro", "Gun Master", GAME_SUPPORTS_SAVE ) |
| 6424 | GAME( 1995, daitorid, 0, daitorid, daitorid, metro_state, daitorid, ROT0, "Metro", "Daitoride", GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE ) |
| 6425 | GAME( 1996, daitorida, daitorid, daitoa, daitorid, metro_state, balcube, ROT0, "Metro", "Daitoride (YMF278B version)", GAME_SUPPORTS_SAVE ) |
| 6426 | GAME( 1995, dokyusei, 0, dokyusei, dokyusei, metro_state, gakusai, ROT0, "Make Software / Elf / Media Trading", "Mahjong Doukyuusei", GAME_SUPPORTS_SAVE ) |
| 6427 | GAME( 1995, dokyusp, 0, dokyusp, gakusai, metro_state, gakusai, ROT0, "Make Software / Elf / Media Trading", "Mahjong Doukyuusei Special", GAME_SUPPORTS_SAVE ) |
| 6428 | GAME( 1995, msgogo, 0, msgogo, msgogo, metro_state, balcube, ROT0, "Metro", "Mouse Shooter GoGo", GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE ) |
| 6429 | GAME( 1995, pururun, 0, pururun, pururun, metro_state, daitorid, ROT0, "Metro / Banpresto", "Pururun", GAME_SUPPORTS_SAVE ) |
| 6430 | GAME( 1995, puzzli, 0, daitorid, puzzli, metro_state, daitorid, ROT0, "Metro / Banpresto", "Puzzli", GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE ) |
| 6431 | GAME( 1996, 3kokushi, 0, 3kokushi, 3kokushi, metro_state, karatour, ROT0, "Mitchell", "Sankokushi (Japan)", GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE ) |
| 6432 | GAME( 1996, balcube, 0, balcube, balcube, metro_state, balcube, ROT0, "Metro", "Bal Cube", GAME_SUPPORTS_SAVE ) |
| 6433 | GAME( 1996, bangball, 0, bangball, bangball, metro_state, balcube, ROT0, "Banpresto / Kunihiko Tashiro+Goodhouse", "Bang Bang Ball (v1.05)", GAME_SUPPORTS_SAVE ) |
| 6434 | GAME( 1996, gstrik2, 0, gstrik2, gstrik2, metro_state, blzntrnd, ROT0, "Human Amusement", "Grand Striker 2 (Europe and Oceania)", GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE ) |
| 6435 | GAME( 1996, gstrik2j, gstrik2, gstrik2, gstrik2, metro_state, blzntrnd, ROT0, "Human Amusement", "Grand Striker 2 (Japan)", GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE ) // priority between rounds |
| 6436 | GAME( 1999, batlbubl, bangball, batlbubl, batlbubl, metro_state, balcube, ROT0, "Banpresto (Limenko license?)", "Battle Bubble (v2.00)", GAME_SUPPORTS_SAVE ) // or bootleg? |
| 6437 | GAME( 1996, mouja, 0, mouja, mouja, metro_state, mouja, ROT0, "Etona", "Mouja (Japan)", GAME_NO_COCKTAIL | GAME_SUPPORTS_SAVE ) |
| 6438 | GAME( 1997, gakusai, 0, gakusai, gakusai, metro_state, gakusai, ROT0, "MakeSoft", "Mahjong Gakuensai (Japan)", GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE ) |
| 6439 | GAME( 1998, gakusai2, 0, gakusai2, gakusai, metro_state, gakusai, ROT0, "MakeSoft", "Mahjong Gakuensai 2 (Japan)", GAME_SUPPORTS_SAVE ) |
| 6440 | GAME( 2000, puzzlet, 0, puzzlet, puzzlet, metro_state, puzzlet, ROT0, "Unies Corporation", "Puzzlet (Japan)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_SUPPORTS_SAVE ) |
| 6441 | GAME( 1995, vmetal, 0, vmetal, vmetal, metro_state, blzntrnd, ROT90, "Excellent System", "Varia Metal", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE ) |
| 6442 | GAME( 1995, vmetaln, vmetal, vmetal, vmetal, metro_state, blzntrnd, ROT90, "Excellent System (New Ways Trading Co. license)", "Varia Metal (New Ways Trading Co.)", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE ) |
trunk/src/mame/video/metro.c
| r20035 | r20036 | |
| 60 | 60 | int code = m_k053936_ram[tile_index]; |
| 61 | 61 | |
| 62 | 62 | SET_TILE_INFO_MEMBER( |
| 63 | | 2, |
| 63 | 4, |
| 64 | 64 | code & 0x7fff, |
| 65 | 65 | 0xe, |
| 66 | 66 | 0); |
| r20035 | r20036 | |
| 71 | 71 | int code = m_k053936_ram[tile_index]; |
| 72 | 72 | |
| 73 | 73 | SET_TILE_INFO_MEMBER( |
| 74 | | 2, |
| 74 | 4, |
| 75 | 75 | (code & 0x7fff)>>2, |
| 76 | 76 | 0xe, |
| 77 | 77 | 0); |
| r20035 | r20036 | |
| 100 | 100 | |
| 101 | 101 | /*************************************************************************** |
| 102 | 102 | |
| 103 | | |
| 104 | 103 | Tilemaps: Tiles Set & Window |
| 105 | 104 | |
| 106 | 105 | Each entry in the Tiles Set RAM uses 2 words to specify a starting |
| r20035 | r20036 | |
| 116 | 115 | 2.w Code Low Bits |
| 117 | 116 | |
| 118 | 117 | * 00-ff, but on later chips supporting it, xf means 256 color tile and palette x |
| 118 | |
| 119 | 119 | ***************************************************************************/ |
| 120 | 120 | |
| 121 | 121 | |
| r20035 | r20036 | |
| 127 | 127 | |
| 128 | 128 | ***************************************************************************/ |
| 129 | 129 | |
| 130 | | /* A 2048 x 2048 virtual tilemap */ |
| 130 | // A 2048 x 2048 virtual tilemap |
| 131 | 131 | #define BIG_NX (0x100) |
| 132 | 132 | #define BIG_NY (0x100) |
| 133 | 133 | |
| 134 | | /* A smaller 512 x 256 window defines the actual tilemap */ |
| 134 | // A smaller 512 x 256 window defines the actual tilemap |
| 135 | 135 | |
| 136 | 136 | #define WIN_NX (0x40) |
| 137 | 137 | #define WIN_NY (0x20) |
| 138 | 138 | |
| 139 | | // this looks up a single pixel in a tile, given the code |
| 140 | | // the metro hardware has an indirection table, which is used here |
| 141 | | // returns if to draw the pixel or not, pixel colour is placed in pix |
| 142 | | INLINE UINT8 get_tile_pix( running_machine &machine, UINT16 code, UINT8 x, UINT8 y, int big, UINT16* pix ) |
| 139 | /* This looks up a single pixel in a tile, given the tile code. |
| 140 | The Metro hardware has an indirection table, which is used here. |
| 141 | Returns if to draw the pixel or not, pixel colour is placed in pix */ |
| 142 | INLINE UINT8 get_tile_pix( running_machine &machine, UINT16 code, UINT8 x, UINT8 y, int big, UINT16 *pix ) |
| 143 | 143 | { |
| 144 | 144 | metro_state *state = machine.driver_data<metro_state>(); |
| 145 | 145 | int table_index; |
| 146 | 146 | UINT32 tile; |
| 147 | 147 | |
| 148 | | /* Use code as an index into the tiles set table */ |
| 148 | // Use code as an index into the tiles set table |
| 149 | 149 | table_index = ((code & 0x1ff0) >> 4) * 2; |
| 150 | 150 | tile = (state->m_tiletable[table_index + 0] << 16) + state->m_tiletable[table_index + 1]; |
| 151 | 151 | |
| 152 | | if (code & 0x8000) /* Special: draw a tile of a single color (i.e. not from the gfx ROMs) */ |
| 152 | if (code & 0x8000) // Special: draw a tile of a single color (i.e. not from the gfx ROMs) |
| 153 | 153 | { |
| 154 | 154 | *pix = code & 0x0fff; |
| 155 | 155 | |
| r20035 | r20036 | |
| 157 | 157 | return 1; |
| 158 | 158 | else |
| 159 | 159 | return 0; |
| 160 | | |
| 161 | 160 | } |
| 162 | 161 | else if (((tile & 0x00f00000) == 0x00f00000) && (state->m_support_8bpp)) /* draw tile as 8bpp (e.g. balcube bg) */ |
| 163 | 162 | { |
| r20035 | r20036 | |
| 171 | 170 | data = gfx1->get_data(tile2); |
| 172 | 171 | else |
| 173 | 172 | { |
| 174 | | *pix |= 0; |
| 173 | *pix = 0; |
| 175 | 174 | return 0; |
| 176 | 175 | } |
| 177 | 176 | |
| r20035 | r20036 | |
| 190 | 189 | return 1; |
| 191 | 190 | else |
| 192 | 191 | return 0; |
| 193 | | |
| 194 | 192 | } |
| 195 | 193 | else |
| 196 | 194 | { |
| r20035 | r20036 | |
| 204 | 202 | data = gfx1->get_data(tile2); |
| 205 | 203 | else |
| 206 | 204 | { |
| 207 | | *pix |= 0; |
| 205 | *pix = 0; |
| 208 | 206 | return 0; |
| 209 | 207 | } |
| 210 | 208 | |
| r20035 | r20036 | |
| 241 | 239 | |
| 242 | 240 | |
| 243 | 241 | |
| 244 | | /* Dirty the relevant tilemap when its window changes */ |
| 245 | 242 | WRITE16_MEMBER(metro_state::metro_window_w) |
| 246 | 243 | { |
| 247 | 244 | COMBINE_DATA(&m_window[offset]); |
| r20035 | r20036 | |
| 265 | 262 | the tile's sizes to be known at startup - which we don't! |
| 266 | 263 | */ |
| 267 | 264 | |
| 268 | | /* Dirty tilemaps when the tiles set changes */ |
| 269 | | |
| 270 | | static void expand_gfx1(metro_state &state) |
| 265 | void metro_state::expand_gfx1() |
| 271 | 266 | { |
| 272 | | UINT8 *base_gfx = state.machine().root_device().memregion("gfx1")->base(); |
| 273 | | UINT32 length = 2 * state.machine().root_device().memregion("gfx1")->bytes(); |
| 274 | | state.m_expanded_gfx1 = auto_alloc_array(state.machine(), UINT8, length); |
| 267 | UINT8 *base_gfx = machine().root_device().memregion("gfx1")->base(); |
| 268 | UINT32 length = machine().root_device().memregion("gfx1")->bytes() * 2; |
| 269 | |
| 270 | m_expanded_gfx1 = auto_alloc_array(machine(), UINT8, length); |
| 271 | |
| 275 | 272 | for (int i = 0; i < length; i += 2) |
| 276 | 273 | { |
| 277 | 274 | UINT8 src = base_gfx[i / 2]; |
| 278 | | state.m_expanded_gfx1[i+0] = src & 15; |
| 279 | | state.m_expanded_gfx1[i+1] = src >> 4; |
| 275 | |
| 276 | m_expanded_gfx1[i + 0] = src & 0xf; |
| 277 | m_expanded_gfx1[i + 1] = src >> 4; |
| 280 | 278 | } |
| 281 | 279 | } |
| 282 | 280 | |
| 283 | 281 | VIDEO_START_MEMBER(metro_state,metro_i4100) |
| 284 | 282 | { |
| 285 | | expand_gfx1(*this); |
| 283 | expand_gfx1(); |
| 286 | 284 | |
| 287 | 285 | m_support_8bpp = 0; |
| 288 | 286 | m_support_16x16 = 0; |
| 289 | 287 | m_has_zoom = 0; |
| 290 | 288 | |
| 291 | | m_bg_tilemap_enable[0] = 1; |
| 292 | | m_bg_tilemap_enable[1] = 1; |
| 293 | | m_bg_tilemap_enable[2] = 1; |
| 289 | m_tilemap_scrolldx[0] = 0; |
| 290 | m_tilemap_scrolldx[1] = 0; |
| 291 | m_tilemap_scrolldx[2] = 0; |
| 294 | 292 | |
| 295 | | m_bg_tilemap_enable16[0] = 0; |
| 296 | | m_bg_tilemap_enable16[1] = 0; |
| 297 | | m_bg_tilemap_enable16[2] = 0; |
| 298 | | |
| 299 | | m_bg_tilemap_scrolldx[0] = 0; |
| 300 | | m_bg_tilemap_scrolldx[1] = 0; |
| 301 | | m_bg_tilemap_scrolldx[2] = 0; |
| 293 | m_sprite_xoffs_dx = 0; |
| 302 | 294 | } |
| 303 | 295 | |
| 304 | 296 | VIDEO_START_MEMBER(metro_state,metro_i4220) |
| 305 | 297 | { |
| 306 | 298 | VIDEO_START_CALL_MEMBER(metro_i4100); |
| 307 | 299 | |
| 308 | | m_support_8bpp = 1; |
| 300 | m_support_8bpp = 1; // balcube |
| 301 | m_support_16x16 = 1; // vmetal |
| 309 | 302 | } |
| 310 | | VIDEO_START_MEMBER(metro_state,metro_i4220_offset) |
| 303 | VIDEO_START_MEMBER(metro_state,metro_i4220_dx_tmap) |
| 311 | 304 | { |
| 312 | 305 | VIDEO_START_CALL_MEMBER(metro_i4220); |
| 313 | 306 | |
| 314 | | m_bg_tilemap_scrolldx[0] = -2; |
| 315 | | m_bg_tilemap_scrolldx[1] = -2; |
| 316 | | m_bg_tilemap_scrolldx[2] = -2; |
| 307 | m_tilemap_scrolldx[0] = -2; |
| 308 | m_tilemap_scrolldx[1] = -2; |
| 309 | m_tilemap_scrolldx[2] = -2; |
| 317 | 310 | } |
| 311 | VIDEO_START_MEMBER(metro_state,metro_i4220_dx_sprite) |
| 312 | { |
| 313 | VIDEO_START_CALL_MEMBER(metro_i4220); |
| 318 | 314 | |
| 315 | m_sprite_xoffs_dx = 8; |
| 316 | } |
| 317 | |
| 319 | 318 | VIDEO_START_MEMBER(metro_state,metro_i4300) |
| 320 | 319 | { |
| 321 | 320 | VIDEO_START_CALL_MEMBER(metro_i4220); |
| 322 | 321 | |
| 323 | | m_support_16x16 = 1; |
| 322 | // any additional feature? |
| 324 | 323 | } |
| 325 | 324 | |
| 326 | 325 | VIDEO_START_MEMBER(metro_state,blzntrnd) |
| r20035 | r20036 | |
| 331 | 330 | |
| 332 | 331 | m_k053936_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(metro_state::metro_k053936_get_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 256, 512); |
| 333 | 332 | |
| 334 | | m_bg_tilemap_scrolldx[0] = 8; |
| 335 | | m_bg_tilemap_scrolldx[1] = 8; |
| 336 | | m_bg_tilemap_scrolldx[2] = 8; |
| 333 | m_tilemap_scrolldx[0] = 8; |
| 334 | m_tilemap_scrolldx[1] = 8; |
| 335 | m_tilemap_scrolldx[2] = 8; |
| 337 | 336 | } |
| 338 | 337 | |
| 339 | 338 | VIDEO_START_MEMBER(metro_state,gstrik2) |
| r20035 | r20036 | |
| 344 | 343 | |
| 345 | 344 | m_k053936_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(metro_state::metro_k053936_gstrik2_get_tile_info),this), tilemap_mapper_delegate(FUNC(metro_state::tilemap_scan_gstrik2),this), 16, 16, 128, 256); |
| 346 | 345 | |
| 347 | | m_bg_tilemap_scrolldx[0] = 8; |
| 348 | | m_bg_tilemap_scrolldx[1] = 0; |
| 349 | | m_bg_tilemap_scrolldx[2] = 8; |
| 346 | m_tilemap_scrolldx[0] = 8; |
| 347 | m_tilemap_scrolldx[1] = 0; |
| 348 | m_tilemap_scrolldx[2] = 8; |
| 350 | 349 | } |
| 351 | 350 | |
| 352 | 351 | /*************************************************************************** |
| r20035 | r20036 | |
| 409 | 408 | |
| 410 | 409 | ***************************************************************************/ |
| 411 | 410 | |
| 412 | | /* Draw sprites */ |
| 413 | | |
| 414 | 411 | void metro_draw_sprites( running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect ) |
| 415 | 412 | { |
| 416 | 413 | metro_state *state = machine.driver_data<metro_state>(); |
| r20035 | r20036 | |
| 450 | 447 | { |
| 451 | 448 | int x, y, attr, code, color, flipx, flipy, zoom, curr_pri, width, height; |
| 452 | 449 | |
| 453 | | /* Exponential zoom table extracted from daitoride */ |
| 450 | // Exponential zoom table extracted from daitoride |
| 454 | 451 | static const int zoomtable[0x40] = |
| 455 | 452 | { 0xAAC,0x800,0x668,0x554,0x494,0x400,0x390,0x334, |
| 456 | 453 | 0x2E8,0x2AC,0x278,0x248,0x224,0x200,0x1E0,0x1C8, |
| r20035 | r20036 | |
| 556 | 553 | |
| 557 | 554 | ***************************************************************************/ |
| 558 | 555 | |
| 559 | | /* copy a 'window' from the large 2048x2048 (or 4096x4096 for 16x16 tiles) tilemap */ |
| 556 | // Copy a 'window' from the large 2048x2048 (or 4096x4096 for 16x16 tiles) tilemap |
| 560 | 557 | |
| 561 | | |
| 562 | 558 | static void draw_tilemap( running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect, UINT32 flags, UINT32 pcode, |
| 563 | | int sx, int sy, int wx, int wy, int big, UINT16* tilemapram, int layer ) |
| 559 | int sx, int sy, int wx, int wy, int big, UINT16 *tilemapram, int layer ) |
| 564 | 560 | { |
| 565 | 561 | metro_state *state = machine.driver_data<metro_state>(); |
| 566 | 562 | int y; |
| 567 | 563 | |
| 568 | 564 | bitmap_ind8 &priority_bitmap = machine.priority_bitmap; |
| 569 | 565 | |
| 570 | | int width = big ? 4096 : 2048;//pixdata->width; |
| 571 | | int height = big ? 4096 : 2048;//pixdata->height; |
| 566 | int width = big ? 4096 : 2048; |
| 567 | int height = big ? 4096 : 2048; |
| 572 | 568 | |
| 573 | | int scrwidth = bitmap.width(); |
| 569 | int scrwidth = bitmap.width(); |
| 574 | 570 | int scrheight = bitmap.height(); |
| 575 | 571 | |
| 576 | | int windowwidth = width >> 2; |
| 572 | int windowwidth = width >> 2; |
| 577 | 573 | int windowheight = height >> 3; |
| 578 | 574 | |
| 579 | | if (!big) |
| 580 | | { |
| 581 | | if (!state->m_bg_tilemap_enable[layer]) return; |
| 582 | | } |
| 583 | | else |
| 584 | | { |
| 585 | | if (!state->m_bg_tilemap_enable16[layer]) return; |
| 586 | | } |
| 575 | sx += state->m_tilemap_scrolldx[layer] * (state->m_flip_screen ? 1 : -1); |
| 587 | 576 | |
| 588 | | |
| 589 | | if (!state->m_flip_screen) |
| 577 | for (y = 0; y < scrheight; y++) |
| 590 | 578 | { |
| 591 | | sx -= state->m_bg_tilemap_scrolldx[layer]; |
| 592 | | } |
| 593 | | else |
| 594 | | { |
| 595 | | sx += state->m_bg_tilemap_scrolldx[layer]; |
| 596 | | } |
| 597 | | |
| 598 | | for (y=0;y<scrheight;y++) |
| 599 | | { |
| 600 | 579 | int scrolly = (sy+y-wy)&(windowheight-1); |
| 601 | 580 | int x; |
| 602 | | UINT16* dst; |
| 581 | UINT16 *dst; |
| 603 | 582 | UINT8 *priority_baseaddr; |
| 604 | 583 | int srcline = (wy+scrolly)&(height-1); |
| 605 | 584 | int srctilerow = srcline >> (big ? 4 : 3); |
| r20035 | r20036 | |
| 609 | 588 | dst = &bitmap.pix16(y); |
| 610 | 589 | priority_baseaddr = &priority_bitmap.pix8(y); |
| 611 | 590 | |
| 612 | | for (x=0;x<scrwidth;x++) |
| 591 | for (x = 0; x < scrwidth; x++) |
| 613 | 592 | { |
| 614 | 593 | int scrollx = (sx+x-wx)&(windowwidth-1); |
| 615 | 594 | int srccol = (wx+scrollx)&(width-1); |
| r20035 | r20036 | |
| 633 | 612 | dst = &bitmap.pix16(scrheight-y-1); |
| 634 | 613 | priority_baseaddr = &priority_bitmap.pix8(scrheight-y-1); |
| 635 | 614 | |
| 636 | | for (x=0;x<scrwidth;x++) |
| 615 | for (x = 0; x < scrwidth; x++) |
| 637 | 616 | { |
| 638 | 617 | int scrollx = (sx+x-wx)&(windowwidth-1); |
| 639 | 618 | int srccol = (wx+scrollx)&(width-1); |
| r20035 | r20036 | |
| 655 | 634 | } |
| 656 | 635 | } |
| 657 | 636 | |
| 658 | | /* Draw all the layers that match the given priority */ |
| 637 | // Draw all the layers that match the given priority |
| 638 | |
| 659 | 639 | static void draw_layers( running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect, int pri, int layers_ctrl ) |
| 660 | 640 | { |
| 661 | 641 | metro_state *state = machine.driver_data<metro_state>(); |
| 662 | 642 | UINT16 layers_pri = state->m_videoregs[0x10 / 2]; |
| 663 | 643 | int layer; |
| 664 | 644 | |
| 665 | | /* Draw all the layers with priority == pri */ |
| 666 | | for (layer = 2; layer >= 0; layer--) // tilemap[2] below? |
| 645 | // Draw all the layers with priority == pri |
| 646 | for (layer = 2; layer >= 0; layer--) |
| 667 | 647 | { |
| 668 | 648 | if (pri == ((layers_pri >> (layer * 2)) & 3)) |
| 669 | 649 | { |
| 670 | | /* Scroll and Window values */ |
| 650 | // Scroll and Window values |
| 671 | 651 | UINT16 sy = state->m_scroll[layer * 2 + 0]; UINT16 sx = state->m_scroll[layer * 2 + 1]; |
| 672 | 652 | UINT16 wy = state->m_window[layer * 2 + 0]; UINT16 wx = state->m_window[layer * 2 + 1]; |
| 673 | 653 | |
| 674 | 654 | if (BIT(layers_ctrl, layer)) // for debug |
| 675 | 655 | { |
| 676 | | UINT16* tilemapram = 0; |
| 656 | UINT16 *tilemapram = 0; |
| 677 | 657 | |
| 678 | | if (layer==0) tilemapram = state->m_vram_0; |
| 679 | | else if (layer==1) tilemapram = state->m_vram_1; |
| 680 | | else if (layer==2) tilemapram = state->m_vram_2; |
| 658 | switch (layer) |
| 659 | { |
| 660 | case 0: tilemapram = state->m_vram_0; break; |
| 661 | case 1: tilemapram = state->m_vram_1; break; |
| 662 | case 2: tilemapram = state->m_vram_2; break; |
| 663 | } |
| 681 | 664 | |
| 682 | | draw_tilemap(machine, bitmap, cliprect, 0, 1 << (3 - pri), sx, sy, wx, wy, 0, tilemapram, layer); |
| 665 | int big = state->m_support_16x16 && (*state->m_screenctrl & (0x0020 << layer)); |
| 683 | 666 | |
| 684 | | if (state->m_support_16x16) |
| 685 | | draw_tilemap(machine, bitmap, cliprect, 0, 1 << (3 - pri), sx, sy, wx, wy, 1, tilemapram, layer); |
| 667 | draw_tilemap(machine, bitmap, cliprect, 0, 1 << (3 - pri), sx, sy, wx, wy, big, tilemapram, layer); |
| 686 | 668 | } |
| 687 | 669 | } |
| 688 | 670 | } |
| 689 | 671 | } |
| 690 | 672 | |
| 691 | 673 | |
| 692 | | |
| 693 | 674 | UINT32 metro_state::screen_update_metro(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) |
| 694 | 675 | { |
| 695 | 676 | int pri, layers_ctrl = -1; |
| 696 | 677 | UINT16 screenctrl = *m_screenctrl; |
| 697 | 678 | |
| 698 | | m_sprite_xoffs = m_videoregs[0x06 / 2] - screen.width() / 2; |
| 679 | m_sprite_xoffs = m_videoregs[0x06 / 2] - screen.width() / 2 + m_sprite_xoffs_dx; |
| 699 | 680 | m_sprite_yoffs = m_videoregs[0x04 / 2] - screen.height() / 2; |
| 700 | 681 | |
| 701 | | /* The background color is selected by a register */ |
| 702 | 682 | machine().priority_bitmap.fill(0, cliprect); |
| 683 | |
| 684 | // The background color is selected by a register |
| 703 | 685 | bitmap.fill(m_videoregs[0x12/2] & 0x0fff, cliprect); |
| 704 | 686 | |
| 705 | 687 | /* Screen Control Register: |
| 706 | 688 | |
| 707 | 689 | f--- ---- ---- ---- ? |
| 708 | 690 | -edc b--- ---- ---- |
| 709 | | ---- -a98 ---- ---- ? Leds |
| 710 | | ---- ---- 7--- ---- 16x16 Tiles (Layer 2) |
| 711 | | ---- ---- -6-- ---- 16x16 Tiles (Layer 1) |
| 712 | | ---- ---- --5- ---- 16x16 Tiles (Layer 0) |
| 691 | ---- -a98 ---- ---- ? Leds (see gakusai attract) |
| 692 | ---- ---- 765- ---- 16x16 Tiles (Layer 2-1-0) |
| 713 | 693 | ---- ---- ---4 32-- |
| 714 | | ---- ---- ---- --1- ? Blank Screen |
| 694 | ---- ---- ---- --1- Blank Screen |
| 715 | 695 | ---- ---- ---- ---0 Flip Screen */ |
| 716 | 696 | if (screenctrl & 2) |
| 717 | 697 | return 0; |
| 718 | 698 | |
| 719 | | //flip_screen_set(screenctrl & 1); |
| 720 | 699 | m_flip_screen = screenctrl & 1; |
| 721 | 700 | |
| 722 | | /* If the game supports 16x16 tiles, make sure that the |
| 723 | | 16x16 and 8x8 tilemaps of a given layer are not simultaneously |
| 724 | | enabled! */ |
| 725 | | if (m_support_16x16) |
| 726 | | { |
| 727 | | int layer; |
| 728 | | |
| 729 | | for (layer = 0; layer < 3; layer++) |
| 730 | | { |
| 731 | | int big = screenctrl & (0x0020 << layer); |
| 732 | | |
| 733 | | m_bg_tilemap_enable[layer] = !big; |
| 734 | | m_bg_tilemap_enable16[layer] = big; |
| 735 | | } |
| 736 | | } |
| 737 | | |
| 738 | | |
| 739 | 701 | #ifdef MAME_DEBUG |
| 740 | 702 | if (machine().input().code_pressed(KEYCODE_Z)) |
| 741 | 703 | { |
| r20035 | r20036 | |
| 746 | 708 | if (machine().input().code_pressed(KEYCODE_A)) msk |= 8; |
| 747 | 709 | if (msk != 0) |
| 748 | 710 | { |
| 749 | | bitmap.fill(0, cliprect); |
| 711 | bitmap.fill(get_black_pen(machine()), cliprect); |
| 750 | 712 | layers_ctrl &= msk; |
| 751 | 713 | } |
| 752 | 714 | |
| 753 | | popmessage("l %x-%x-%x r %04x %04x %04x", |
| 715 | popmessage( "lyr: %x-%x-%x spr: %04x clr: %04x scr: %04x", |
| 754 | 716 | (m_videoregs[0x10/2] & 0x30) >> 4, (m_videoregs[0x10/2] & 0xc) >> 2, m_videoregs[0x10/2] & 3, |
| 755 | 717 | m_videoregs[0x02/2], m_videoregs[0x12/2], |
| 756 | 718 | *m_screenctrl); |
| r20035 | r20036 | |
| 765 | 727 | |
| 766 | 728 | if (layers_ctrl & 0x08) |
| 767 | 729 | metro_draw_sprites(machine(), bitmap, cliprect); |
| 730 | |
| 768 | 731 | return 0; |
| 769 | 732 | } |