trunk/src/mame/drivers/equites.c
| r250137 | r250138 | |
| 663 | 663 | ADDRESS_MAP_UNMAP_HIGH |
| 664 | 664 | AM_RANGE(0x000000, 0x00ffff) AM_ROM // ROM area is written several times (dev system?) |
| 665 | 665 | AM_RANGE(0x040000, 0x040fff) AM_RAM AM_SHARE("nvram") // nvram is for gekisou only |
| 666 | | AM_RANGE(0x080000, 0x080fff) AM_READWRITE(equites_fg_videoram_r, equites_fg_videoram_w) // 8-bit |
| 666 | AM_RANGE(0x080000, 0x080fff) AM_READWRITE8(equites_fg_videoram_r, equites_fg_videoram_w, 0x00ff) |
| 667 | 667 | AM_RANGE(0x0c0000, 0x0c01ff) AM_RAM_WRITE(equites_bg_videoram_w) AM_SHARE("bg_videoram") |
| 668 | 668 | AM_RANGE(0x0c0200, 0x0c0fff) AM_RAM |
| 669 | 669 | AM_RANGE(0x100000, 0x100001) AM_READ(equites_spriteram_kludge_r) |
| 670 | 670 | AM_RANGE(0x100000, 0x1001ff) AM_RAM AM_SHARE("spriteram") |
| 671 | 671 | AM_RANGE(0x140000, 0x1407ff) AM_READWRITE8(mcu_ram_r, mcu_ram_w, 0x00ff) |
| 672 | | AM_RANGE(0x180000, 0x180001) AM_READ_PORT("IN1") AM_WRITE(soundlatch_word_w) // LSB: sound latch |
| 673 | | AM_RANGE(0x184000, 0x184001) AM_WRITE(equites_flip0_w) |
| 672 | AM_RANGE(0x180000, 0x180001) AM_READ_PORT("IN1") AM_WRITE8(soundlatch_byte_w, 0x00ff) |
| 673 | AM_RANGE(0x184000, 0x184001) AM_MIRROR(0x020000) AM_MASK(0x020000) AM_WRITE(equites_flipw_w) |
| 674 | 674 | AM_RANGE(0x188000, 0x188001) AM_MIRROR(0x020000) AM_MASK(0x020000) AM_WRITE(mcu_start_w) |
| 675 | 675 | AM_RANGE(0x18c000, 0x18c001) AM_MIRROR(0x020000) AM_MASK(0x020000) AM_WRITE(mcu_switch_w) |
| 676 | | AM_RANGE(0x1a4000, 0x1a4001) AM_WRITE(equites_flip1_w) |
| 677 | | AM_RANGE(0x1c0000, 0x1c0001) AM_READ_PORT("IN0") AM_WRITE(equites_scrollreg_w) // scroll register[XXYY] |
| 678 | | AM_RANGE(0x380000, 0x380001) AM_WRITE(equites_bgcolor_w) // bg color register[CC--] |
| 676 | AM_RANGE(0x1c0000, 0x1c0001) AM_READ_PORT("IN0") AM_WRITE(equites_scrollreg_w) |
| 677 | AM_RANGE(0x380000, 0x380001) AM_WRITE8(equites_bgcolor_w, 0xff00) |
| 679 | 678 | // 580000 unknown (protection?) (gekisou only, installed by DRIVER_INIT) |
| 680 | 679 | // 5a0000 unknown (protection?) (gekisou only, installed by DRIVER_INIT) |
| 681 | 680 | AM_RANGE(0x780000, 0x780001) AM_WRITE(watchdog_reset16_w) |
| r250137 | r250138 | |
| 684 | 683 | static ADDRESS_MAP_START( splndrbt_map, AS_PROGRAM, 16, equites_state ) |
| 685 | 684 | ADDRESS_MAP_UNMAP_HIGH |
| 686 | 685 | AM_RANGE(0x000000, 0x00ffff) AM_ROM |
| 687 | | AM_RANGE(0x040000, 0x040fff) AM_RAM AM_SHARE("workram") // work RAM |
| 688 | | AM_RANGE(0x080000, 0x080001) AM_READ_PORT("IN0") // joyport [2211] |
| 689 | | AM_RANGE(0x0c0000, 0x0c0001) AM_READ_PORT("IN1") AM_WRITE(splndrbt_flip0_w) // [MMLL] MM: bg color register, LL: normal screen |
| 686 | AM_RANGE(0x040000, 0x040fff) AM_RAM AM_SHARE("workram") |
| 687 | AM_RANGE(0x080000, 0x080001) AM_READ_PORT("IN0") |
| 688 | AM_RANGE(0x0c0000, 0x0c0001) AM_READ_PORT("IN1") |
| 689 | AM_RANGE(0x0c0000, 0x0c0001) AM_MIRROR(0x020000) AM_MASK(0x020000) AM_WRITE8(equites_bgcolor_w, 0xff00) // note: addressmask does not apply here |
| 690 | AM_RANGE(0x0c0000, 0x0c0001) AM_MIRROR(0x020000) AM_MASK(0x020000) AM_WRITE8(equites_flipb_w, 0x00ff) |
| 690 | 691 | AM_RANGE(0x0c4000, 0x0c4001) AM_MIRROR(0x020000) AM_MASK(0x020000) AM_WRITE(mcu_start_w) |
| 691 | 692 | AM_RANGE(0x0c8000, 0x0c8001) AM_MIRROR(0x020000) AM_MASK(0x020000) AM_WRITE(mcu_switch_w) |
| 692 | | AM_RANGE(0x0cc000, 0x0cc001) AM_WRITE(splndrbt_selchar0_w) // select active char map |
| 693 | | AM_RANGE(0x0e0000, 0x0e0001) AM_WRITE(splndrbt_flip1_w) // [MMLL] MM: not used, LL: flip screen |
| 694 | | AM_RANGE(0x0ec000, 0x0ec001) AM_WRITE(splndrbt_selchar1_w) // select active char map |
| 693 | AM_RANGE(0x0cc000, 0x0cc001) AM_MIRROR(0x020000) AM_MASK(0x020000) AM_WRITE(splndrbt_selchar_w) |
| 695 | 694 | AM_RANGE(0x100000, 0x100001) AM_WRITE(splndrbt_bg_scrollx_w) |
| 696 | | AM_RANGE(0x140000, 0x140001) AM_WRITE(soundlatch_word_w) // LSB: sound command |
| 695 | AM_RANGE(0x140000, 0x140001) AM_WRITE8(soundlatch_byte_w, 0x00ff) |
| 697 | 696 | AM_RANGE(0x1c0000, 0x1c0001) AM_WRITE(splndrbt_bg_scrolly_w) |
| 698 | 697 | AM_RANGE(0x180000, 0x1807ff) AM_READWRITE8(mcu_ram_r, mcu_ram_w, 0x00ff) |
| 699 | | AM_RANGE(0x200000, 0x200fff) AM_MIRROR(0x1000) AM_READWRITE(equites_fg_videoram_r, equites_fg_videoram_w) // 8-bit |
| 698 | AM_RANGE(0x200000, 0x200fff) AM_MIRROR(0x001000) AM_READWRITE8(equites_fg_videoram_r, equites_fg_videoram_w, 0x00ff) |
| 700 | 699 | AM_RANGE(0x400000, 0x4007ff) AM_RAM_WRITE(equites_bg_videoram_w) AM_SHARE("bg_videoram") |
| 701 | 700 | AM_RANGE(0x400800, 0x400fff) AM_RAM |
| 702 | 701 | AM_RANGE(0x600000, 0x6000ff) AM_RAM AM_SHARE("spriteram") // sprite RAM 0,1 |
trunk/src/mame/includes/equites.h
| r250137 | r250138 | |
| 92 | 92 | DECLARE_WRITE8_MEMBER(mcu_ram_w); |
| 93 | 93 | DECLARE_WRITE16_MEMBER(mcu_start_w); |
| 94 | 94 | DECLARE_WRITE16_MEMBER(mcu_switch_w); |
| 95 | | DECLARE_READ16_MEMBER(equites_fg_videoram_r); |
| 96 | | DECLARE_WRITE16_MEMBER(equites_fg_videoram_w); |
| 95 | DECLARE_READ8_MEMBER(equites_fg_videoram_r); |
| 96 | DECLARE_WRITE8_MEMBER(equites_fg_videoram_w); |
| 97 | 97 | DECLARE_WRITE16_MEMBER(equites_bg_videoram_w); |
| 98 | | DECLARE_WRITE16_MEMBER(equites_bgcolor_w); |
| 98 | DECLARE_WRITE8_MEMBER(equites_bgcolor_w); |
| 99 | 99 | DECLARE_WRITE16_MEMBER(equites_scrollreg_w); |
| 100 | | DECLARE_WRITE16_MEMBER(splndrbt_selchar0_w); |
| 101 | | DECLARE_WRITE16_MEMBER(splndrbt_selchar1_w); |
| 102 | | DECLARE_WRITE16_MEMBER(equites_flip0_w); |
| 103 | | DECLARE_WRITE16_MEMBER(equites_flip1_w); |
| 104 | | DECLARE_WRITE16_MEMBER(splndrbt_flip0_w); |
| 105 | | DECLARE_WRITE16_MEMBER(splndrbt_flip1_w); |
| 100 | DECLARE_WRITE16_MEMBER(splndrbt_selchar_w); |
| 101 | DECLARE_WRITE16_MEMBER(equites_flipw_w); |
| 102 | DECLARE_WRITE8_MEMBER(equites_flipb_w); |
| 106 | 103 | DECLARE_WRITE16_MEMBER(splndrbt_bg_scrollx_w); |
| 107 | 104 | DECLARE_WRITE16_MEMBER(splndrbt_bg_scrolly_w); |
| 108 | 105 | DECLARE_CUSTOM_INPUT_MEMBER(gekisou_unknown_status); |
trunk/src/mame/video/equites.c
| r250137 | r250138 | |
| 153 | 153 | * |
| 154 | 154 | *************************************/ |
| 155 | 155 | |
| 156 | | READ16_MEMBER(equites_state::equites_fg_videoram_r) |
| 156 | READ8_MEMBER(equites_state::equites_fg_videoram_r) |
| 157 | 157 | { |
| 158 | | return 0xff00 | m_fg_videoram[offset]; |
| 158 | // 8-bit |
| 159 | return m_fg_videoram[offset]; |
| 159 | 160 | } |
| 160 | 161 | |
| 161 | | WRITE16_MEMBER(equites_state::equites_fg_videoram_w) |
| 162 | WRITE8_MEMBER(equites_state::equites_fg_videoram_w) |
| 162 | 163 | { |
| 163 | | if (ACCESSING_BITS_0_7) |
| 164 | | { |
| 165 | | m_fg_videoram[offset] = data & 0xff; |
| 166 | | |
| 167 | | m_fg_tilemap->mark_tile_dirty(offset >> 1); |
| 168 | | } |
| 164 | m_fg_videoram[offset] = data; |
| 165 | m_fg_tilemap->mark_tile_dirty(offset >> 1); |
| 169 | 166 | } |
| 170 | 167 | |
| 171 | 168 | WRITE16_MEMBER(equites_state::equites_bg_videoram_w) |
| 172 | 169 | { |
| 173 | 170 | COMBINE_DATA(m_bg_videoram + offset); |
| 174 | | |
| 175 | 171 | m_bg_tilemap->mark_tile_dirty(offset); |
| 176 | 172 | } |
| 177 | 173 | |
| 178 | | WRITE16_MEMBER(equites_state::equites_bgcolor_w) |
| 174 | WRITE8_MEMBER(equites_state::equites_bgcolor_w) |
| 179 | 175 | { |
| 180 | | if (ACCESSING_BITS_8_15) |
| 181 | | m_bgcolor = data >> 8; |
| 176 | // bg color register |
| 177 | if (offset == 0) |
| 178 | m_bgcolor = data; |
| 182 | 179 | } |
| 183 | 180 | |
| 184 | 181 | WRITE16_MEMBER(equites_state::equites_scrollreg_w) |
| r250137 | r250138 | |
| 190 | 187 | m_bg_tilemap->set_scrollx(0, data >> 8); |
| 191 | 188 | } |
| 192 | 189 | |
| 193 | | WRITE16_MEMBER(equites_state::splndrbt_selchar0_w) |
| 190 | WRITE16_MEMBER(equites_state::splndrbt_selchar_w) |
| 194 | 191 | { |
| 195 | | if (m_fg_char_bank != 0) |
| 192 | // data bit is A16 (offset) |
| 193 | data = (offset == 0) ? 0 : 1; |
| 194 | |
| 195 | // select active char map |
| 196 | if (m_fg_char_bank != data) |
| 196 | 197 | { |
| 197 | | m_fg_char_bank = 0; |
| 198 | m_fg_char_bank = data; |
| 198 | 199 | m_fg_tilemap->mark_all_dirty(); |
| 199 | 200 | } |
| 200 | 201 | } |
| 201 | 202 | |
| 202 | | WRITE16_MEMBER(equites_state::splndrbt_selchar1_w) |
| 203 | WRITE16_MEMBER(equites_state::equites_flipw_w) |
| 203 | 204 | { |
| 204 | | if (m_fg_char_bank != 1) |
| 205 | | { |
| 206 | | m_fg_char_bank = 1; |
| 207 | | m_fg_tilemap->mark_all_dirty(); |
| 208 | | } |
| 205 | // data bit is A16 (offset) |
| 206 | flip_screen_set(offset != 0); |
| 209 | 207 | } |
| 210 | 208 | |
| 211 | | WRITE16_MEMBER(equites_state::equites_flip0_w) |
| 209 | WRITE8_MEMBER(equites_state::equites_flipb_w) |
| 212 | 210 | { |
| 213 | | flip_screen_set(0); |
| 211 | // data bit is A16 (offset) |
| 212 | flip_screen_set(offset != 0); |
| 214 | 213 | } |
| 215 | 214 | |
| 216 | | WRITE16_MEMBER(equites_state::equites_flip1_w) |
| 217 | | { |
| 218 | | flip_screen_set(1); |
| 219 | | } |
| 220 | | |
| 221 | | WRITE16_MEMBER(equites_state::splndrbt_flip0_w) |
| 222 | | { |
| 223 | | if (ACCESSING_BITS_0_7) |
| 224 | | flip_screen_set(0); |
| 225 | | |
| 226 | | if (ACCESSING_BITS_8_15) |
| 227 | | m_bgcolor = data >> 8; |
| 228 | | } |
| 229 | | |
| 230 | | WRITE16_MEMBER(equites_state::splndrbt_flip1_w) |
| 231 | | { |
| 232 | | if (ACCESSING_BITS_0_7) |
| 233 | | flip_screen_set(1); |
| 234 | | } |
| 235 | | |
| 236 | 215 | WRITE16_MEMBER(equites_state::splndrbt_bg_scrollx_w) |
| 237 | 216 | { |
| 238 | 217 | COMBINE_DATA(&m_splndrbt_bg_scrollx); |
| r250137 | r250138 | |
| 253 | 232 | |
| 254 | 233 | void equites_state::equites_draw_sprites_block( bitmap_ind16 &bitmap, const rectangle &cliprect, int start, int end ) |
| 255 | 234 | { |
| 256 | | int offs; |
| 257 | | |
| 258 | | for (offs = end - 2; offs >= start; offs -= 2) |
| 235 | for (int offs = end - 2; offs >= start; offs -= 2) |
| 259 | 236 | { |
| 260 | 237 | int attr = m_spriteram[offs + 1]; |
| 261 | 238 | if (!(attr & 0x800)) // disable or x MSB? |
| r250137 | r250138 | |
| 329 | 306 | const UINT8 * const xrom = memregion("user2")->base(); |
| 330 | 307 | const UINT8 * const yrom = xrom + 0x100; |
| 331 | 308 | gfx_element* gfx = m_gfxdecode->gfx(2); |
| 332 | | int offs; |
| 333 | 309 | |
| 334 | 310 | // note that sprites are actually 30x30, contained in 32x32 squares. The outer edge is not used. |
| 335 | 311 | |
| 336 | | for (offs = 0x3f; offs < 0x6f; offs += 2) // 24 sprites |
| 312 | for (int offs = 0x3f; offs < 0x6f; offs += 2) // 24 sprites |
| 337 | 313 | { |
| 338 | 314 | int data = m_spriteram[offs]; |
| 339 | 315 | int fx = (data & 0x2000) >> 13; |