80
80
***************************************************************************/
82
WRITE16_HANDLER( othldrby_videoram_addr_w )
82
WRITE16_MEMBER(othldrby_state::othldrby_videoram_addr_w)
84
othldrby_state *state = space->machine().driver_data<othldrby_state>();
85
state->m_vram_addr = data;
88
READ16_HANDLER( othldrby_videoram_r )
87
READ16_MEMBER(othldrby_state::othldrby_videoram_r)
90
othldrby_state *state = space->machine().driver_data<othldrby_state>();
92
if (state->m_vram_addr < VIDEORAM_SIZE)
93
return state->m_vram[state->m_vram_addr++];
90
if (m_vram_addr < VIDEORAM_SIZE)
91
return m_vram[m_vram_addr++];
96
popmessage("GFXRAM OUT OF BOUNDS %04x", state->m_vram_addr);
94
popmessage("GFXRAM OUT OF BOUNDS %04x", m_vram_addr);
101
WRITE16_HANDLER( othldrby_videoram_w )
99
WRITE16_MEMBER(othldrby_state::othldrby_videoram_w)
103
othldrby_state *state = space->machine().driver_data<othldrby_state>();
105
if (state->m_vram_addr < VIDEORAM_SIZE)
102
if (m_vram_addr < VIDEORAM_SIZE)
107
if (state->m_vram_addr < SPRITERAM_START)
108
state->m_bg_tilemap[state->m_vram_addr / 0x800]->mark_tile_dirty((state->m_vram_addr & 0x7ff) / 2);
109
state->m_vram[state->m_vram_addr++] = data;
104
if (m_vram_addr < SPRITERAM_START)
105
m_bg_tilemap[m_vram_addr / 0x800]->mark_tile_dirty((m_vram_addr & 0x7ff) / 2);
106
m_vram[m_vram_addr++] = data;
112
popmessage("GFXRAM OUT OF BOUNDS %04x", state->m_vram_addr);
115
WRITE16_HANDLER( othldrby_vreg_addr_w )
117
othldrby_state *state = space->machine().driver_data<othldrby_state>();
118
state->m_vreg_addr = data & 0x7f; /* bit 7 is set when screen is flipped */
121
WRITE16_HANDLER( othldrby_vreg_w )
123
othldrby_state *state = space->machine().driver_data<othldrby_state>();
125
if (state->m_vreg_addr < OTHLDRBY_VREG_SIZE)
126
state->m_vreg[state->m_vreg_addr++] = data;
109
popmessage("GFXRAM OUT OF BOUNDS %04x", m_vram_addr);
112
WRITE16_MEMBER(othldrby_state::othldrby_vreg_addr_w)
114
m_vreg_addr = data & 0x7f; /* bit 7 is set when screen is flipped */
117
WRITE16_MEMBER(othldrby_state::othldrby_vreg_w)
120
if (m_vreg_addr < OTHLDRBY_VREG_SIZE)
121
m_vreg[m_vreg_addr++] = data;
128
popmessage("%06x: VREG OUT OF BOUNDS %04x", cpu_get_pc(&space->device()), state->m_vreg_addr);
123
popmessage("%06x: VREG OUT OF BOUNDS %04x", cpu_get_pc(&space.device()), m_vreg_addr);
185
180
othldrby_state *state = screen.machine().driver_data<othldrby_state>();
188
flip_screen_set(screen.machine(), state->m_vreg[0x0f] & 0x80);
183
state->flip_screen_set(state->m_vreg[0x0f] & 0x80);
190
185
for (layer = 0; layer < 3; layer++)
192
if (flip_screen_get(screen.machine()))
187
if (state->flip_screen())
194
189
state->m_bg_tilemap[layer]->set_scrollx(0, state->m_vreg[2 * layer] + 59);
195
190
state->m_bg_tilemap[layer]->set_scrolly(0, state->m_vreg[2 * layer + 1] + 248);