mirror of
https://github.com/holub/mame
synced 2025-05-09 15:51:48 +03:00
Modernization of drivers part 23 (no whatsnew)
This commit is contained in:
parent
a1819a469e
commit
c36982dee6
@ -89,39 +89,39 @@ public:
|
||||
virtual void video_start();
|
||||
virtual void palette_init();
|
||||
UINT32 screen_update_cham24(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
|
||||
void cham24_set_mirroring( int mirroring );
|
||||
};
|
||||
|
||||
|
||||
|
||||
static void cham24_set_mirroring( running_machine &machine, int mirroring )
|
||||
void cham24_state::cham24_set_mirroring( int mirroring )
|
||||
{
|
||||
cham24_state *state = machine.driver_data<cham24_state>();
|
||||
switch(mirroring)
|
||||
{
|
||||
case PPU_MIRROR_LOW:
|
||||
state->m_nt_page[0] = state->m_nt_page[1] = state->m_nt_page[2] = state->m_nt_page[3] = state->m_nt_ram;
|
||||
m_nt_page[0] = m_nt_page[1] = m_nt_page[2] = m_nt_page[3] = m_nt_ram;
|
||||
break;
|
||||
case PPU_MIRROR_HIGH:
|
||||
state->m_nt_page[0] = state->m_nt_page[1] = state->m_nt_page[2] = state->m_nt_page[3] = state->m_nt_ram + 0x400;
|
||||
m_nt_page[0] = m_nt_page[1] = m_nt_page[2] = m_nt_page[3] = m_nt_ram + 0x400;
|
||||
break;
|
||||
case PPU_MIRROR_HORZ:
|
||||
state->m_nt_page[0] = state->m_nt_ram;
|
||||
state->m_nt_page[1] = state->m_nt_ram;
|
||||
state->m_nt_page[2] = state->m_nt_ram + 0x400;
|
||||
state->m_nt_page[3] = state->m_nt_ram + 0x400;
|
||||
m_nt_page[0] = m_nt_ram;
|
||||
m_nt_page[1] = m_nt_ram;
|
||||
m_nt_page[2] = m_nt_ram + 0x400;
|
||||
m_nt_page[3] = m_nt_ram + 0x400;
|
||||
break;
|
||||
case PPU_MIRROR_VERT:
|
||||
state->m_nt_page[0] = state->m_nt_ram;
|
||||
state->m_nt_page[1] = state->m_nt_ram + 0x400;
|
||||
state->m_nt_page[2] = state->m_nt_ram;
|
||||
state->m_nt_page[3] = state->m_nt_ram + 0x400;
|
||||
m_nt_page[0] = m_nt_ram;
|
||||
m_nt_page[1] = m_nt_ram + 0x400;
|
||||
m_nt_page[2] = m_nt_ram;
|
||||
m_nt_page[3] = m_nt_ram + 0x400;
|
||||
break;
|
||||
case PPU_MIRROR_NONE:
|
||||
default:
|
||||
state->m_nt_page[0] = state->m_nt_ram;
|
||||
state->m_nt_page[1] = state->m_nt_ram + 0x400;
|
||||
state->m_nt_page[2] = state->m_nt_ram + 0x800;
|
||||
state->m_nt_page[3] = state->m_nt_ram + 0xc00;
|
||||
m_nt_page[0] = m_nt_ram;
|
||||
m_nt_page[1] = m_nt_ram + 0x400;
|
||||
m_nt_page[2] = m_nt_ram + 0x800;
|
||||
m_nt_page[3] = m_nt_ram + 0xc00;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -210,7 +210,7 @@ WRITE8_MEMBER(cham24_state::cham24_mapper_w)
|
||||
membank("bank1")->set_base(machine().root_device().memregion("gfx1")->base() + (0x2000 * gfx_bank));
|
||||
|
||||
// set gfx mirroring
|
||||
cham24_set_mirroring(machine(), gfx_mirroring != 0 ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
|
||||
cham24_set_mirroring(gfx_mirroring != 0 ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
|
||||
|
||||
// switch PRG bank
|
||||
if (prg_bank_page_size == 0)
|
||||
|
@ -42,6 +42,8 @@ public:
|
||||
virtual void machine_reset();
|
||||
UINT32 screen_update_clayshoo(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
|
||||
TIMER_CALLBACK_MEMBER(reset_analog_bit);
|
||||
UINT8 difficulty_input_port_r( int bit );
|
||||
void create_analog_timers( );
|
||||
};
|
||||
|
||||
|
||||
@ -57,12 +59,12 @@ WRITE8_MEMBER(clayshoo_state::input_port_select_w)
|
||||
}
|
||||
|
||||
|
||||
static UINT8 difficulty_input_port_r( running_machine &machine, int bit )
|
||||
UINT8 clayshoo_state::difficulty_input_port_r( int bit )
|
||||
{
|
||||
UINT8 ret = 0;
|
||||
|
||||
/* read fake port and remap the buttons to 2 bits */
|
||||
UINT8 raw = machine.root_device().ioport("FAKE")->read();
|
||||
UINT8 raw = machine().root_device().ioport("FAKE")->read();
|
||||
|
||||
if (raw & (1 << (bit + 1)))
|
||||
ret = 0x03; /* expert */
|
||||
@ -83,8 +85,8 @@ READ8_MEMBER(clayshoo_state::input_port_r)
|
||||
{
|
||||
case 0x01: ret = ioport("IN0")->read(); break;
|
||||
case 0x02: ret = ioport("IN1")->read(); break;
|
||||
case 0x04: ret = (ioport("IN2")->read() & 0xf0) | difficulty_input_port_r(machine(), 0) |
|
||||
(difficulty_input_port_r(machine(), 3) << 2); break;
|
||||
case 0x04: ret = (ioport("IN2")->read() & 0xf0) | difficulty_input_port_r(0) |
|
||||
(difficulty_input_port_r(3) << 2); break;
|
||||
case 0x08: ret = ioport("IN3")->read(); break;
|
||||
case 0x10:
|
||||
case 0x20: break; /* these two are not really used */
|
||||
@ -134,11 +136,10 @@ READ8_MEMBER(clayshoo_state::analog_r)
|
||||
}
|
||||
|
||||
|
||||
static void create_analog_timers( running_machine &machine )
|
||||
void clayshoo_state::create_analog_timers( )
|
||||
{
|
||||
clayshoo_state *state = machine.driver_data<clayshoo_state>();
|
||||
state->m_analog_timer_1 = machine.scheduler().timer_alloc(timer_expired_delegate(FUNC(clayshoo_state::reset_analog_bit),state));
|
||||
state->m_analog_timer_2 = machine.scheduler().timer_alloc(timer_expired_delegate(FUNC(clayshoo_state::reset_analog_bit),state));
|
||||
m_analog_timer_1 = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(clayshoo_state::reset_analog_bit),this));
|
||||
m_analog_timer_2 = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(clayshoo_state::reset_analog_bit),this));
|
||||
}
|
||||
|
||||
|
||||
@ -171,7 +172,7 @@ static I8255A_INTERFACE( ppi8255_1_intf )
|
||||
|
||||
void clayshoo_state::machine_start()
|
||||
{
|
||||
create_analog_timers(machine());
|
||||
create_analog_timers();
|
||||
|
||||
/* register for state saving */
|
||||
save_item(NAME(m_input_port_select));
|
||||
|
@ -91,6 +91,7 @@ public:
|
||||
virtual void palette_init();
|
||||
UINT32 screen_update_dacholer(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
|
||||
INTERRUPT_GEN_MEMBER(sound_irq);
|
||||
void draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect );
|
||||
};
|
||||
|
||||
TILE_GET_INFO_MEMBER(dacholer_state::get_bg_tile_info)
|
||||
@ -121,23 +122,22 @@ WRITE8_MEMBER(dacholer_state::bg_scroll_y_w)
|
||||
m_scroll_y = data;
|
||||
}
|
||||
|
||||
static void draw_sprites( running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect )
|
||||
void dacholer_state::draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect )
|
||||
{
|
||||
dacholer_state *state = machine.driver_data<dacholer_state>();
|
||||
int offs, code, attr, sx, sy, flipx, flipy;
|
||||
|
||||
for (offs = 0; offs < state->m_spriteram.bytes(); offs += 4)
|
||||
for (offs = 0; offs < m_spriteram.bytes(); offs += 4)
|
||||
{
|
||||
code = state->m_spriteram[offs + 1];
|
||||
attr = state->m_spriteram[offs + 2];
|
||||
code = m_spriteram[offs + 1];
|
||||
attr = m_spriteram[offs + 2];
|
||||
|
||||
flipx = attr & 0x10;
|
||||
flipy = attr & 0x20;
|
||||
|
||||
sx = (state->m_spriteram[offs + 3] - 128) + 256 * (attr & 0x01);
|
||||
sy = 255 - state->m_spriteram[offs];
|
||||
sx = (m_spriteram[offs + 3] - 128) + 256 * (attr & 0x01);
|
||||
sy = 255 - m_spriteram[offs];
|
||||
|
||||
if (state->flip_screen())
|
||||
if (flip_screen())
|
||||
{
|
||||
sx = 240 - sx;
|
||||
sy = 240 - sy;
|
||||
@ -145,7 +145,7 @@ static void draw_sprites( running_machine &machine, bitmap_ind16 &bitmap, const
|
||||
flipy = !flipy;
|
||||
}
|
||||
|
||||
drawgfx_transpen(bitmap, cliprect, machine.gfx[2],
|
||||
drawgfx_transpen(bitmap, cliprect, machine().gfx[2],
|
||||
code,
|
||||
0,
|
||||
flipx,flipy,
|
||||
@ -167,7 +167,7 @@ UINT32 dacholer_state::screen_update_dacholer(screen_device &screen, bitmap_ind1
|
||||
}
|
||||
|
||||
m_bg_tilemap->draw(bitmap, cliprect, 0, 0);
|
||||
draw_sprites(machine(), bitmap, cliprect);
|
||||
draw_sprites(bitmap, cliprect);
|
||||
m_fg_tilemap->draw(bitmap, cliprect, 0, 0);
|
||||
return 0;
|
||||
}
|
||||
|
@ -87,6 +87,8 @@ public:
|
||||
virtual void machine_reset();
|
||||
virtual void video_start();
|
||||
UINT32 screen_update_discoboy(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
|
||||
void draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect );
|
||||
void discoboy_setrombank( UINT8 data );
|
||||
};
|
||||
|
||||
|
||||
@ -95,46 +97,45 @@ void discoboy_state::video_start()
|
||||
{
|
||||
}
|
||||
|
||||
static void draw_sprites( running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect )
|
||||
void discoboy_state::draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect )
|
||||
{
|
||||
discoboy_state *state = machine.driver_data<discoboy_state>();
|
||||
int flipscreen = 0;
|
||||
int offs, sx, sy;
|
||||
|
||||
for (offs = 0x1000 - 0x40; offs >= 0; offs -= 0x20)
|
||||
{
|
||||
int code = state->m_ram_4[offs];
|
||||
int attr = state->m_ram_4[offs + 1];
|
||||
int code = m_ram_4[offs];
|
||||
int attr = m_ram_4[offs + 1];
|
||||
int color = attr & 0x0f;
|
||||
sx = state->m_ram_4[offs + 3] + ((attr & 0x10) << 4);
|
||||
sy = ((state->m_ram_4[offs + 2] + 8) & 0xff) - 8;
|
||||
sx = m_ram_4[offs + 3] + ((attr & 0x10) << 4);
|
||||
sy = ((m_ram_4[offs + 2] + 8) & 0xff) - 8;
|
||||
code += (attr & 0xe0) << 3;
|
||||
|
||||
if (code >= 0x400)
|
||||
{
|
||||
if ((state->m_gfxbank & 0x30) == 0x00)
|
||||
if ((m_gfxbank & 0x30) == 0x00)
|
||||
{
|
||||
code = 0x400 + (code & 0x3ff);
|
||||
}
|
||||
else if ((state->m_gfxbank & 0x30) == 0x10)
|
||||
else if ((m_gfxbank & 0x30) == 0x10)
|
||||
{
|
||||
code = 0x400 + (code & 0x3ff) + 0x400;
|
||||
}
|
||||
else if ((state->m_gfxbank & 0x30) == 0x20)
|
||||
else if ((m_gfxbank & 0x30) == 0x20)
|
||||
{
|
||||
code = 0x400 + (code & 0x3ff) + 0x800;
|
||||
}
|
||||
else if ((state->m_gfxbank & 0x30) == 0x30)
|
||||
else if ((m_gfxbank & 0x30) == 0x30)
|
||||
{
|
||||
code = 0x400 + (code & 0x3ff) + 0xc00;
|
||||
}
|
||||
else
|
||||
{
|
||||
code = machine.rand();
|
||||
code = machine().rand();
|
||||
}
|
||||
}
|
||||
|
||||
drawgfx_transpen(bitmap,cliprect,machine.gfx[0],
|
||||
drawgfx_transpen(bitmap,cliprect,machine().gfx[0],
|
||||
code,
|
||||
color,
|
||||
flipscreen,0,
|
||||
@ -196,15 +197,15 @@ UINT32 discoboy_state::screen_update_discoboy(screen_device &screen, bitmap_ind1
|
||||
}
|
||||
}
|
||||
|
||||
draw_sprites(machine(), bitmap, cliprect);
|
||||
draw_sprites(bitmap, cliprect);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
#ifdef UNUSED_FUNCTION
|
||||
void discoboy_setrombank( running_machine &machine, UINT8 data )
|
||||
void discoboy_state::discoboy_setrombank( UINT8 data )
|
||||
{
|
||||
UINT8 *ROM = machine.root_device().memregion("maincpu")->base();
|
||||
UINT8 *ROM = machine().root_device().memregion("maincpu")->base();
|
||||
data &= 0x2f;
|
||||
space.machine().root_device().membank("bank1")->set_base(&ROM[0x6000 + (data * 0x1000)] );
|
||||
}
|
||||
|
@ -86,6 +86,7 @@ public:
|
||||
DECLARE_READ8_MEMBER(dominob_unk_port02_r);
|
||||
virtual void video_start();
|
||||
UINT32 screen_update_dominob(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
|
||||
void draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect );
|
||||
};
|
||||
|
||||
void dominob_state::video_start()
|
||||
@ -93,31 +94,30 @@ void dominob_state::video_start()
|
||||
machine().gfx[0]->set_granularity(8);
|
||||
}
|
||||
|
||||
static void draw_sprites( running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect )
|
||||
void dominob_state::draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect )
|
||||
{
|
||||
dominob_state *state = machine.driver_data<dominob_state>();
|
||||
int offs;
|
||||
|
||||
for (offs = 0; offs < state->m_spriteram.bytes(); offs += 4)
|
||||
for (offs = 0; offs < m_spriteram.bytes(); offs += 4)
|
||||
{
|
||||
int sx, sy, code;
|
||||
|
||||
sx = state->m_spriteram[offs];
|
||||
sy = 248 - state->m_spriteram[offs + 1];
|
||||
if (state->flip_screen_x()) sx = 248 - sx;
|
||||
if (state->flip_screen_y()) sy = 248 - sy;
|
||||
sx = m_spriteram[offs];
|
||||
sy = 248 - m_spriteram[offs + 1];
|
||||
if (flip_screen_x()) sx = 248 - sx;
|
||||
if (flip_screen_y()) sy = 248 - sy;
|
||||
|
||||
code = state->m_spriteram[offs + 3] + ((state->m_spriteram[offs + 2] & 0x03) << 8) ;
|
||||
code = m_spriteram[offs + 3] + ((m_spriteram[offs + 2] & 0x03) << 8) ;
|
||||
|
||||
drawgfx_transpen(bitmap,cliprect,machine.gfx[0],
|
||||
drawgfx_transpen(bitmap,cliprect,machine().gfx[0],
|
||||
2 * code,
|
||||
((state->m_spriteram[offs + 2] & 0xf8) >> 3) ,
|
||||
state->flip_screen_x(),state->flip_screen_y(),
|
||||
sx,sy + (state->flip_screen_y() ? 8 : -8),0);
|
||||
drawgfx_transpen(bitmap,cliprect,machine.gfx[0],
|
||||
((m_spriteram[offs + 2] & 0xf8) >> 3) ,
|
||||
flip_screen_x(),flip_screen_y(),
|
||||
sx,sy + (flip_screen_y() ? 8 : -8),0);
|
||||
drawgfx_transpen(bitmap,cliprect,machine().gfx[0],
|
||||
2 * code + 1,
|
||||
((state->m_spriteram[offs + 2] & 0xf8) >> 3) ,
|
||||
state->flip_screen_x(),state->flip_screen_y(),
|
||||
((m_spriteram[offs + 2] & 0xf8) >> 3) ,
|
||||
flip_screen_x(),flip_screen_y(),
|
||||
sx,sy,0);
|
||||
}
|
||||
}
|
||||
@ -158,7 +158,7 @@ UINT32 dominob_state::screen_update_dominob(screen_device &screen, bitmap_ind16
|
||||
}
|
||||
}
|
||||
|
||||
draw_sprites(machine(), bitmap, cliprect);
|
||||
draw_sprites(bitmap, cliprect);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -165,17 +165,17 @@ public:
|
||||
virtual void video_start();
|
||||
UINT32 screen_update_dreamwld(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
|
||||
void screen_eof_dreamwld(screen_device &screen, bool state);
|
||||
void draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect );
|
||||
};
|
||||
|
||||
|
||||
|
||||
static void draw_sprites( running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect )
|
||||
void dreamwld_state::draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect )
|
||||
{
|
||||
dreamwld_state *state = machine.driver_data<dreamwld_state>();
|
||||
gfx_element *gfx = machine.gfx[0];
|
||||
UINT32 *source = state->m_spritebuf1;
|
||||
UINT32 *finish = state->m_spritebuf1 + 0x1000 / 4;
|
||||
UINT16 *redirect = (UINT16 *)state->memregion("spritelut")->base();
|
||||
gfx_element *gfx = machine().gfx[0];
|
||||
UINT32 *source = m_spritebuf1;
|
||||
UINT32 *finish = m_spritebuf1 + 0x1000 / 4;
|
||||
UINT16 *redirect = (UINT16 *)memregion("spritelut")->base();
|
||||
|
||||
while (source < finish)
|
||||
{
|
||||
@ -394,7 +394,7 @@ UINT32 dreamwld_state::screen_update_dreamwld(screen_device &screen, bitmap_ind1
|
||||
tmptilemap0->draw(bitmap, cliprect, 0, 0);
|
||||
tmptilemap1->draw(bitmap, cliprect, 0, 0);
|
||||
|
||||
draw_sprites(machine(), bitmap, cliprect);
|
||||
draw_sprites(bitmap, cliprect);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -41,6 +41,7 @@ public:
|
||||
virtual void machine_reset();
|
||||
virtual void video_start();
|
||||
UINT32 screen_update_drtomy(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
|
||||
void draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect );
|
||||
};
|
||||
|
||||
|
||||
@ -78,22 +79,21 @@ TILE_GET_INFO_MEMBER(drtomy_state::get_tile_info_bg)
|
||||
3 | xxxxxxxx xxxxxx-- | sprite code
|
||||
*/
|
||||
|
||||
static void draw_sprites( running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect )
|
||||
void drtomy_state::draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect )
|
||||
{
|
||||
drtomy_state *state = machine.driver_data<drtomy_state>();
|
||||
int i, x, y, ex, ey;
|
||||
gfx_element *gfx = machine.gfx[0];
|
||||
gfx_element *gfx = machine().gfx[0];
|
||||
|
||||
static const int x_offset[2] = {0x0, 0x2};
|
||||
static const int y_offset[2] = {0x0, 0x1};
|
||||
|
||||
for (i = 3; i < 0x1000 / 2; i += 4)
|
||||
{
|
||||
int sx = state->m_spriteram[i + 2] & 0x01ff;
|
||||
int sy = (240 - (state->m_spriteram[i] & 0x00ff)) & 0x00ff;
|
||||
int number = state->m_spriteram[i + 3];
|
||||
int color = (state->m_spriteram[i + 2] & 0x1e00) >> 9;
|
||||
int attr = (state->m_spriteram[i] & 0xfe00) >> 9;
|
||||
int sx = m_spriteram[i + 2] & 0x01ff;
|
||||
int sy = (240 - (m_spriteram[i] & 0x00ff)) & 0x00ff;
|
||||
int number = m_spriteram[i + 3];
|
||||
int color = (m_spriteram[i + 2] & 0x1e00) >> 9;
|
||||
int attr = (m_spriteram[i] & 0xfe00) >> 9;
|
||||
|
||||
int xflip = attr & 0x20;
|
||||
int yflip = attr & 0x40;
|
||||
@ -134,7 +134,7 @@ UINT32 drtomy_state::screen_update_drtomy(screen_device &screen, bitmap_ind16 &b
|
||||
{
|
||||
m_tilemap_bg->draw(bitmap, cliprect, 0, 0);
|
||||
m_tilemap_fg->draw(bitmap, cliprect, 0, 0);
|
||||
draw_sprites(machine(), bitmap, cliprect);
|
||||
draw_sprites(bitmap, cliprect);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -62,6 +62,7 @@ public:
|
||||
virtual void palette_init();
|
||||
UINT32 screen_update_ettrivia(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
|
||||
INTERRUPT_GEN_MEMBER(ettrivia_interrupt);
|
||||
inline void get_tile_info(tile_data &tileinfo, int tile_index, UINT8 *vidram, int gfx_code);
|
||||
};
|
||||
|
||||
|
||||
@ -196,25 +197,24 @@ static GFXDECODE_START( ettrivia )
|
||||
GFXDECODE_ENTRY( "gfx2", 0, charlayout, 32*4, 32 )
|
||||
GFXDECODE_END
|
||||
|
||||
INLINE void get_tile_info(running_machine &machine, tile_data &tileinfo, int tile_index, UINT8 *vidram, int gfx_code)
|
||||
void ettrivia_state::get_tile_info(tile_data &tileinfo, int tile_index, UINT8 *vidram, int gfx_code)
|
||||
{
|
||||
ettrivia_state *state = machine.driver_data<ettrivia_state>();
|
||||
int code = vidram[tile_index];
|
||||
int color = (code >> 5) + 8 * state->m_palreg;
|
||||
int color = (code >> 5) + 8 * m_palreg;
|
||||
|
||||
code += state->m_gfx_bank * 0x100;
|
||||
code += m_gfx_bank * 0x100;
|
||||
|
||||
SET_TILE_INFO(gfx_code,code,color,0);
|
||||
SET_TILE_INFO_MEMBER(gfx_code,code,color,0);
|
||||
}
|
||||
|
||||
TILE_GET_INFO_MEMBER(ettrivia_state::get_tile_info_bg)
|
||||
{
|
||||
get_tile_info(machine(), tileinfo, tile_index, m_bg_videoram, 0);
|
||||
get_tile_info(tileinfo, tile_index, m_bg_videoram, 0);
|
||||
}
|
||||
|
||||
TILE_GET_INFO_MEMBER(ettrivia_state::get_tile_info_fg)
|
||||
{
|
||||
get_tile_info(machine(), tileinfo, tile_index, m_fg_videoram, 1);
|
||||
get_tile_info(tileinfo, tile_index, m_fg_videoram, 1);
|
||||
}
|
||||
|
||||
void ettrivia_state::palette_init()
|
||||
|
@ -112,6 +112,9 @@ public:
|
||||
UINT32 screen_update_famibox(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
|
||||
TIMER_CALLBACK_MEMBER(famicombox_attract_timer_callback);
|
||||
TIMER_CALLBACK_MEMBER(famicombox_gameplay_timer_callback);
|
||||
void set_mirroring(famibox_state *state, int mirroring);
|
||||
void famicombox_bankswitch(UINT8 bank);
|
||||
void famicombox_reset();
|
||||
};
|
||||
|
||||
/******************************************************
|
||||
@ -121,34 +124,34 @@ public:
|
||||
*******************************************************/
|
||||
|
||||
#if 0
|
||||
static void set_mirroring(famibox_state *state, int mirroring)
|
||||
void famibox_state::set_mirroring(famibox_state *state, int mirroring)
|
||||
{
|
||||
switch(mirroring)
|
||||
{
|
||||
case PPU_MIRROR_LOW:
|
||||
state->m_nt_page[0] = state->m_nt_page[1] = state->m_nt_page[2] = state->m_nt_page[3] = state->m_nt_ram;
|
||||
m_nt_page[0] = m_nt_page[1] = m_nt_page[2] = m_nt_page[3] = m_nt_ram;
|
||||
break;
|
||||
case PPU_MIRROR_HIGH:
|
||||
state->m_nt_page[0] = state->m_nt_page[1] = state->m_nt_page[2] = state->m_nt_page[3] = state->m_nt_ram + 0x400;
|
||||
m_nt_page[0] = m_nt_page[1] = m_nt_page[2] = m_nt_page[3] = m_nt_ram + 0x400;
|
||||
break;
|
||||
case PPU_MIRROR_HORZ:
|
||||
state->m_nt_page[0] = state->m_nt_ram;
|
||||
state->m_nt_page[1] = state->m_nt_ram;
|
||||
state->m_nt_page[2] = state->m_nt_ram + 0x400;
|
||||
state->m_nt_page[3] = state->m_nt_ram + 0x400;
|
||||
m_nt_page[0] = m_nt_ram;
|
||||
m_nt_page[1] = m_nt_ram;
|
||||
m_nt_page[2] = m_nt_ram + 0x400;
|
||||
m_nt_page[3] = m_nt_ram + 0x400;
|
||||
break;
|
||||
case PPU_MIRROR_VERT:
|
||||
state->m_nt_page[0] = state->m_nt_ram;
|
||||
state->m_nt_page[1] = state->m_nt_ram + 0x400;
|
||||
state->m_nt_page[2] = state->m_nt_ram;
|
||||
state->m_nt_page[3] = state->m_nt_ram + 0x400;
|
||||
m_nt_page[0] = m_nt_ram;
|
||||
m_nt_page[1] = m_nt_ram + 0x400;
|
||||
m_nt_page[2] = m_nt_ram;
|
||||
m_nt_page[3] = m_nt_ram + 0x400;
|
||||
break;
|
||||
case PPU_MIRROR_NONE:
|
||||
default:
|
||||
state->m_nt_page[0] = state->m_nt_ram;
|
||||
state->m_nt_page[1] = state->m_nt_ram + 0x400;
|
||||
state->m_nt_page[2] = state->m_nt_ram + 0x800;
|
||||
state->m_nt_page[3] = state->m_nt_ram + 0xc00;
|
||||
m_nt_page[0] = m_nt_ram;
|
||||
m_nt_page[1] = m_nt_ram + 0x400;
|
||||
m_nt_page[2] = m_nt_ram + 0x800;
|
||||
m_nt_page[3] = m_nt_ram + 0xc00;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -234,7 +237,7 @@ READ8_MEMBER(famibox_state::famibox_IN1_r)
|
||||
System
|
||||
|
||||
*******************************************************/
|
||||
static void famicombox_bankswitch(running_machine &machine, UINT8 bank)
|
||||
void famibox_state::famicombox_bankswitch(UINT8 bank)
|
||||
{
|
||||
struct
|
||||
{
|
||||
@ -263,25 +266,24 @@ static void famicombox_bankswitch(running_machine &machine, UINT8 bank)
|
||||
{ 0x00, "menu", 0, 0x4000, 0x8000 },
|
||||
};
|
||||
|
||||
// famibox_state *state = machine.driver_data<famibox_state>();
|
||||
|
||||
for (int i = 0; i < sizeof(famicombox_banks)/sizeof(famicombox_banks[0]); i++ )
|
||||
{
|
||||
if ( bank == famicombox_banks[i].bank ||
|
||||
famicombox_banks[i].bank == 0 )
|
||||
{
|
||||
machine.root_device().membank("cpubank1")->set_base(machine.root_device().memregion(famicombox_banks[i].memory_region)->base() + famicombox_banks[i].bank1_offset);
|
||||
machine.root_device().membank("cpubank2")->set_base(machine.root_device().memregion(famicombox_banks[i].memory_region)->base() + famicombox_banks[i].bank2_offset);
|
||||
machine.root_device().membank("ppubank1")->set_base(machine.root_device().memregion(famicombox_banks[i].memory_region)->base() + famicombox_banks[i].ppubank_offset);
|
||||
machine().root_device().membank("cpubank1")->set_base(machine().root_device().memregion(famicombox_banks[i].memory_region)->base() + famicombox_banks[i].bank1_offset);
|
||||
machine().root_device().membank("cpubank2")->set_base(machine().root_device().memregion(famicombox_banks[i].memory_region)->base() + famicombox_banks[i].bank2_offset);
|
||||
machine().root_device().membank("ppubank1")->set_base(machine().root_device().memregion(famicombox_banks[i].memory_region)->base() + famicombox_banks[i].ppubank_offset);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void famicombox_reset(running_machine &machine)
|
||||
void famibox_state::famicombox_reset()
|
||||
{
|
||||
famicombox_bankswitch(machine, 0);
|
||||
machine.device("maincpu")->reset();
|
||||
famicombox_bankswitch(0);
|
||||
machine().device("maincpu")->reset();
|
||||
}
|
||||
|
||||
TIMER_CALLBACK_MEMBER(famibox_state::famicombox_attract_timer_callback)
|
||||
@ -290,7 +292,7 @@ TIMER_CALLBACK_MEMBER(famibox_state::famicombox_attract_timer_callback)
|
||||
if ( BIT(m_exception_mask,1) )
|
||||
{
|
||||
m_exception_cause &= ~0x02;
|
||||
famicombox_reset(machine());
|
||||
famicombox_reset();
|
||||
}
|
||||
}
|
||||
|
||||
@ -305,7 +307,7 @@ TIMER_CALLBACK_MEMBER(famibox_state::famicombox_gameplay_timer_callback)
|
||||
if ( BIT(m_exception_mask,4) )
|
||||
{
|
||||
m_exception_cause &= ~0x10;
|
||||
famicombox_reset(machine());
|
||||
famicombox_reset();
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -371,7 +373,7 @@ WRITE8_MEMBER(famibox_state::famibox_system_w)
|
||||
break;
|
||||
case 4:
|
||||
logerror("%s: bankswitch %x\n", machine().describe_context(), data );
|
||||
famicombox_bankswitch(machine(), data & 0x3f);
|
||||
famicombox_bankswitch(data & 0x3f);
|
||||
break;
|
||||
default:
|
||||
logerror("%s: Unhandled famibox_system_w(%x,%02x)\n", machine().describe_context(), offset, data );
|
||||
@ -410,7 +412,7 @@ INPUT_CHANGED_MEMBER(famibox_state::famibox_keyswitch_changed)
|
||||
if ( BIT(m_exception_mask, 3) )
|
||||
{
|
||||
m_exception_cause &= ~0x08;
|
||||
famicombox_reset(machine());
|
||||
famicombox_reset();
|
||||
}
|
||||
}
|
||||
|
||||
@ -427,7 +429,7 @@ INPUT_CHANGED_MEMBER(famibox_state::coin_inserted)
|
||||
if ( BIT(m_exception_mask,4) && (m_coins == 1) )
|
||||
{
|
||||
m_exception_cause &= ~0x10;
|
||||
famicombox_reset(machine());
|
||||
famicombox_reset();
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -549,7 +551,7 @@ GFXDECODE_END
|
||||
|
||||
void famibox_state::machine_reset()
|
||||
{
|
||||
famicombox_bankswitch(machine(), 0);
|
||||
famicombox_bankswitch(0);
|
||||
}
|
||||
|
||||
void famibox_state::machine_start()
|
||||
@ -563,7 +565,7 @@ void famibox_state::machine_start()
|
||||
machine().device("ppu")->memory().space(AS_PROGRAM).install_readwrite_handler(0x2000, 0x3eff, read8_delegate(FUNC(famibox_state::famibox_nt_r), this), write8_delegate(FUNC(famibox_state::famibox_nt_w), this));
|
||||
machine().device("ppu")->memory().space(AS_PROGRAM).install_read_bank(0x0000, 0x1fff, "ppubank1");
|
||||
|
||||
famicombox_bankswitch(machine(), 0);
|
||||
famicombox_bankswitch(0);
|
||||
|
||||
|
||||
m_attract_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(famibox_state::famicombox_attract_timer_callback),this));
|
||||
|
@ -95,6 +95,7 @@ public:
|
||||
virtual void machine_reset();
|
||||
virtual void video_start();
|
||||
UINT32 screen_update_galaxi(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
|
||||
void show_out( );
|
||||
};
|
||||
|
||||
|
||||
@ -213,22 +214,21 @@ UINT32 galaxi_state::screen_update_galaxi(screen_device &screen, bitmap_ind16 &b
|
||||
Memory Maps
|
||||
***************************************************************************/
|
||||
|
||||
static void show_out( running_machine &machine )
|
||||
void galaxi_state::show_out( )
|
||||
{
|
||||
// galaxi_state *state = machine.driver_data<galaxi_state>();
|
||||
// popmessage("%04x %04x %04x", state->m_out[0], state->m_out[1], state->m_out[2]);
|
||||
// popmessage("%04x %04x %04x", m_out[0], m_out[1], m_out[2]);
|
||||
}
|
||||
|
||||
WRITE16_MEMBER(galaxi_state::galaxi_500000_w)
|
||||
{
|
||||
COMBINE_DATA(&m_out[0]);
|
||||
show_out(machine());
|
||||
show_out();
|
||||
}
|
||||
|
||||
WRITE16_MEMBER(galaxi_state::galaxi_500002_w)
|
||||
{
|
||||
COMBINE_DATA(&m_out[1]);
|
||||
show_out(machine());
|
||||
show_out();
|
||||
}
|
||||
|
||||
WRITE16_MEMBER(galaxi_state::galaxi_500004_w)
|
||||
@ -263,7 +263,7 @@ WRITE16_MEMBER(galaxi_state::galaxi_500004_w)
|
||||
}
|
||||
|
||||
COMBINE_DATA(&m_out[2]);
|
||||
show_out(machine());
|
||||
show_out();
|
||||
}
|
||||
|
||||
CUSTOM_INPUT_MEMBER(galaxi_state::ticket_r)
|
||||
|
@ -121,6 +121,8 @@ public:
|
||||
virtual void video_start();
|
||||
UINT32 screen_update_gamecstl(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
|
||||
IRQ_CALLBACK_MEMBER(irq_callback);
|
||||
void draw_char(bitmap_ind16 &bitmap, const rectangle &cliprect, gfx_element *gfx, int ch, int att, int x, int y);
|
||||
void intel82439tx_init();
|
||||
};
|
||||
|
||||
|
||||
@ -139,7 +141,7 @@ void gamecstl_state::video_start()
|
||||
palette_set_color(machine(), i, cga_palette[i]);
|
||||
}
|
||||
|
||||
static void draw_char(bitmap_ind16 &bitmap, const rectangle &cliprect, gfx_element *gfx, int ch, int att, int x, int y)
|
||||
void gamecstl_state::draw_char(bitmap_ind16 &bitmap, const rectangle &cliprect, gfx_element *gfx, int ch, int att, int x, int y)
|
||||
{
|
||||
int i,j;
|
||||
const UINT8 *dp;
|
||||
@ -232,15 +234,14 @@ static void mxtc_config_w(device_t *busdevice, device_t *device, int function, i
|
||||
state->m_mxtc_config_reg[reg] = data;
|
||||
}
|
||||
|
||||
static void intel82439tx_init(running_machine &machine)
|
||||
void gamecstl_state::intel82439tx_init()
|
||||
{
|
||||
gamecstl_state *state = machine.driver_data<gamecstl_state>();
|
||||
state->m_mxtc_config_reg[0x60] = 0x02;
|
||||
state->m_mxtc_config_reg[0x61] = 0x02;
|
||||
state->m_mxtc_config_reg[0x62] = 0x02;
|
||||
state->m_mxtc_config_reg[0x63] = 0x02;
|
||||
state->m_mxtc_config_reg[0x64] = 0x02;
|
||||
state->m_mxtc_config_reg[0x65] = 0x02;
|
||||
m_mxtc_config_reg[0x60] = 0x02;
|
||||
m_mxtc_config_reg[0x61] = 0x02;
|
||||
m_mxtc_config_reg[0x62] = 0x02;
|
||||
m_mxtc_config_reg[0x63] = 0x02;
|
||||
m_mxtc_config_reg[0x64] = 0x02;
|
||||
m_mxtc_config_reg[0x65] = 0x02;
|
||||
}
|
||||
|
||||
static UINT32 intel82439tx_pci_r(device_t *busdevice, device_t *device, int function, int reg, UINT32 mem_mask)
|
||||
@ -759,7 +760,7 @@ DRIVER_INIT_MEMBER(gamecstl_state,gamecstl)
|
||||
|
||||
init_pc_common(machine(), PCCOMMON_KEYBOARD_AT, gamecstl_set_keyb_int);
|
||||
|
||||
intel82439tx_init(machine());
|
||||
intel82439tx_init();
|
||||
|
||||
kbdc8042_init(machine(), &at8042);
|
||||
}
|
||||
|
@ -74,6 +74,9 @@ public:
|
||||
UINT32 screen_update_gpworld(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
|
||||
INTERRUPT_GEN_MEMBER(vblank_callback_gpworld);
|
||||
TIMER_CALLBACK_MEMBER(irq_stop);
|
||||
void gpworld_draw_tiles(bitmap_rgb32 &bitmap,const rectangle &cliprect);
|
||||
inline void draw_pixel(bitmap_rgb32 &bitmap,const rectangle &cliprect,int x,int y,int color,int flip);
|
||||
void gpworld_draw_sprites(bitmap_rgb32 &bitmap, const rectangle &cliprect);
|
||||
};
|
||||
|
||||
|
||||
@ -85,9 +88,8 @@ public:
|
||||
|
||||
|
||||
/* VIDEO GOODS */
|
||||
static void gpworld_draw_tiles(running_machine &machine, bitmap_rgb32 &bitmap,const rectangle &cliprect)
|
||||
void gpworld_state::gpworld_draw_tiles(bitmap_rgb32 &bitmap,const rectangle &cliprect)
|
||||
{
|
||||
gpworld_state *state = machine.driver_data<gpworld_state>();
|
||||
UINT8 characterX, characterY;
|
||||
|
||||
/* Temporarily set to 64 wide to accommodate two screens */
|
||||
@ -97,13 +99,13 @@ static void gpworld_draw_tiles(running_machine &machine, bitmap_rgb32 &bitmap,co
|
||||
{
|
||||
int current_screen_character = (characterY*64) + characterX;
|
||||
|
||||
drawgfx_transpen(bitmap, cliprect, machine.gfx[0], state->m_tile_ram[current_screen_character],
|
||||
drawgfx_transpen(bitmap, cliprect, machine().gfx[0], m_tile_ram[current_screen_character],
|
||||
characterY, 0, 0, characterX*8, characterY*8, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
INLINE void draw_pixel(running_machine &machine, bitmap_rgb32 &bitmap,const rectangle &cliprect,int x,int y,int color,int flip)
|
||||
void gpworld_state::draw_pixel(bitmap_rgb32 &bitmap,const rectangle &cliprect,int x,int y,int color,int flip)
|
||||
{
|
||||
if (flip)
|
||||
{
|
||||
@ -112,12 +114,11 @@ INLINE void draw_pixel(running_machine &machine, bitmap_rgb32 &bitmap,const rect
|
||||
}
|
||||
|
||||
if (cliprect.contains(x, y))
|
||||
bitmap.pix32(y, x) = machine.pens[color];
|
||||
bitmap.pix32(y, x) = machine().pens[color];
|
||||
}
|
||||
|
||||
static void gpworld_draw_sprites(running_machine &machine, bitmap_rgb32 &bitmap, const rectangle &cliprect)
|
||||
void gpworld_state::gpworld_draw_sprites(bitmap_rgb32 &bitmap, const rectangle &cliprect)
|
||||
{
|
||||
gpworld_state *state = machine.driver_data<gpworld_state>();
|
||||
const int SPR_Y_TOP = 0;
|
||||
const int SPR_Y_BOTTOM = 1;
|
||||
const int SPR_X_LO = 2;
|
||||
@ -126,16 +127,16 @@ static void gpworld_draw_sprites(running_machine &machine, bitmap_rgb32 &bitmap,
|
||||
const int SPR_SKIP_HI = 5;
|
||||
const int SPR_GFXOFS_LO = 6;
|
||||
const int SPR_GFXOFS_HI = 7;
|
||||
int flip = state->flip_screen();
|
||||
int flip = flip_screen();
|
||||
|
||||
int i;
|
||||
|
||||
UINT8 *GFX = state->memregion("gfx2")->base();
|
||||
UINT8 *GFX = memregion("gfx2")->base();
|
||||
|
||||
/* Heisted from Daphne which heisted it from MAME */
|
||||
for (i = 0; i < 0x800; i += 8)
|
||||
{
|
||||
UINT8 *spr_reg = state->m_sprite_ram + i;
|
||||
UINT8 *spr_reg = m_sprite_ram + i;
|
||||
|
||||
if (spr_reg[SPR_Y_BOTTOM] && spr_reg[SPR_X_LO] != 0xff)
|
||||
{
|
||||
@ -203,10 +204,10 @@ static void gpworld_draw_sprites(running_machine &machine, bitmap_rgb32 &bitmap,
|
||||
}
|
||||
|
||||
/* Daphne says "don't draw the pixel if it's black". */
|
||||
draw_pixel(machine, bitmap,cliprect,x+0,y,palette_get_color(machine, pixel1 + (sprite_color*0x10 + 0x200)),flip);
|
||||
draw_pixel(machine, bitmap,cliprect,x+1,y,palette_get_color(machine, pixel2 + (sprite_color*0x10 + 0x200)),flip);
|
||||
draw_pixel(machine, bitmap,cliprect,x+2,y,palette_get_color(machine, pixel3 + (sprite_color*0x10 + 0x200)),flip);
|
||||
draw_pixel(machine, bitmap,cliprect,x+3,y,palette_get_color(machine, pixel4 + (sprite_color*0x10 + 0x200)),flip);
|
||||
draw_pixel(bitmap,cliprect,x+0,y,palette_get_color(machine(), pixel1 + (sprite_color*0x10 + 0x200)),flip);
|
||||
draw_pixel(bitmap,cliprect,x+1,y,palette_get_color(machine(), pixel2 + (sprite_color*0x10 + 0x200)),flip);
|
||||
draw_pixel(bitmap,cliprect,x+2,y,palette_get_color(machine(), pixel3 + (sprite_color*0x10 + 0x200)),flip);
|
||||
draw_pixel(bitmap,cliprect,x+3,y,palette_get_color(machine(), pixel4 + (sprite_color*0x10 + 0x200)),flip);
|
||||
|
||||
x += 4;
|
||||
|
||||
@ -230,8 +231,8 @@ UINT32 gpworld_state::screen_update_gpworld(screen_device &screen, bitmap_rgb32
|
||||
{
|
||||
bitmap.fill(0, cliprect);
|
||||
|
||||
gpworld_draw_tiles(machine(), bitmap, cliprect);
|
||||
gpworld_draw_sprites(machine(), bitmap, cliprect);
|
||||
gpworld_draw_tiles(bitmap, cliprect);
|
||||
gpworld_draw_sprites(bitmap, cliprect);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -142,6 +142,7 @@ public:
|
||||
UINT32 screen_update_jollyjgr(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
|
||||
UINT32 screen_update_fspider(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
|
||||
INTERRUPT_GEN_MEMBER(jollyjgr_interrupt);
|
||||
void draw_bitmap( bitmap_ind16 &bitmap );
|
||||
};
|
||||
|
||||
|
||||
@ -456,9 +457,8 @@ void jollyjgr_state::video_start()
|
||||
m_bg_tilemap->set_scroll_cols(32);
|
||||
}
|
||||
|
||||
static void draw_bitmap( running_machine &machine, bitmap_ind16 &bitmap )
|
||||
void jollyjgr_state::draw_bitmap( bitmap_ind16 &bitmap )
|
||||
{
|
||||
jollyjgr_state *state = machine.driver_data<jollyjgr_state>();
|
||||
int x, y, count;
|
||||
int i, bit0, bit1, bit2;
|
||||
int color;
|
||||
@ -470,18 +470,18 @@ static void draw_bitmap( running_machine &machine, bitmap_ind16 &bitmap )
|
||||
{
|
||||
for(i = 0; i < 8; i++)
|
||||
{
|
||||
bit0 = (state->m_bitmap[count] >> i) & 1;
|
||||
bit1 = (state->m_bitmap[count + 0x2000] >> i) & 1;
|
||||
bit2 = (state->m_bitmap[count + 0x4000] >> i) & 1;
|
||||
bit0 = (m_bitmap[count] >> i) & 1;
|
||||
bit1 = (m_bitmap[count + 0x2000] >> i) & 1;
|
||||
bit2 = (m_bitmap[count + 0x4000] >> i) & 1;
|
||||
color = bit0 | (bit1 << 1) | (bit2 << 2);
|
||||
|
||||
if(color)
|
||||
{
|
||||
if(state->m_flip_x && state->m_flip_y)
|
||||
if(m_flip_x && m_flip_y)
|
||||
bitmap.pix16(y, x * 8 + i) = color + 32;
|
||||
else if(state->m_flip_x && !state->m_flip_y)
|
||||
else if(m_flip_x && !m_flip_y)
|
||||
bitmap.pix16(255 - y, x * 8 + i) = color + 32;
|
||||
else if(!state->m_flip_x && state->m_flip_y)
|
||||
else if(!m_flip_x && m_flip_y)
|
||||
bitmap.pix16(y, 255 - x * 8 - i) = color + 32;
|
||||
else
|
||||
bitmap.pix16(255 - y, 255 - x * 8 - i) = color + 32;
|
||||
@ -503,7 +503,7 @@ UINT32 jollyjgr_state::screen_update_jollyjgr(screen_device &screen, bitmap_ind1
|
||||
if(m_pri) //used in Frog & Spiders level 3
|
||||
{
|
||||
if(!(m_bitmap_disable))
|
||||
draw_bitmap(machine(), bitmap);
|
||||
draw_bitmap(bitmap);
|
||||
|
||||
m_bg_tilemap->draw(bitmap, cliprect, 0, 0);
|
||||
}
|
||||
@ -512,7 +512,7 @@ UINT32 jollyjgr_state::screen_update_jollyjgr(screen_device &screen, bitmap_ind1
|
||||
m_bg_tilemap->draw(bitmap, cliprect, 0, 0);
|
||||
|
||||
if(!(m_bitmap_disable))
|
||||
draw_bitmap(machine(), bitmap);
|
||||
draw_bitmap(bitmap);
|
||||
}
|
||||
|
||||
/* Sprites are the same as in Galaxian */
|
||||
|
@ -85,8 +85,6 @@ Dip sw.2
|
||||
#include "video/ramdac.h"
|
||||
#include "sound/dac.h"
|
||||
|
||||
static void littlerb_draw_sprites(running_machine &machine);
|
||||
|
||||
class littlerb_state : public driver_device
|
||||
{
|
||||
public:
|
||||
@ -173,7 +171,7 @@ public:
|
||||
|
||||
}
|
||||
|
||||
littlerb_draw_sprites(space.machine());
|
||||
littlerb_draw_sprites();
|
||||
|
||||
|
||||
m_listoffset = 0;
|
||||
@ -203,6 +201,13 @@ public:
|
||||
virtual void video_start();
|
||||
UINT32 screen_update_littlerb(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
|
||||
TIMER_DEVICE_CALLBACK_MEMBER(littlerb_scanline);
|
||||
void littlerb_recalc_regs();
|
||||
UINT16 littlerb_data_read(UINT16 mem_mask);
|
||||
void littlerb_data_write(UINT16 data, UINT16 mem_mask);
|
||||
void littlerb_recalc_address();
|
||||
UINT8 sound_data_shift();
|
||||
void draw_sprite(bitmap_ind16 &bitmap, const rectangle &cliprect, int xsize,int ysize, UINT32 fulloffs, int xpos, int ypos );
|
||||
void littlerb_draw_sprites();
|
||||
};
|
||||
|
||||
|
||||
@ -291,32 +296,29 @@ littlerb_vdp_device::littlerb_vdp_device(const machine_config &mconfig, const ch
|
||||
/* end VDP device to give us our own memory map */
|
||||
|
||||
|
||||
static void littlerb_recalc_regs(running_machine &machine)
|
||||
void littlerb_state::littlerb_recalc_regs()
|
||||
{
|
||||
littlerb_state *state = machine.driver_data<littlerb_state>();
|
||||
state->m_vdp_address_low = state->m_write_address&0xffff;
|
||||
state->m_vdp_address_high = (state->m_write_address>>16)&0xffff;
|
||||
m_vdp_address_low = m_write_address&0xffff;
|
||||
m_vdp_address_high = (m_write_address>>16)&0xffff;
|
||||
}
|
||||
|
||||
|
||||
static UINT16 littlerb_data_read(running_machine &machine, UINT16 mem_mask)
|
||||
UINT16 littlerb_state::littlerb_data_read(UINT16 mem_mask)
|
||||
{
|
||||
littlerb_state *state = machine.driver_data<littlerb_state>();
|
||||
UINT32 addr = state->m_write_address >> 3; // almost surely raw addresses are actually shifted by 3
|
||||
address_space &vdp_space = machine.device<littlerb_vdp_device>("littlerbvdp")->space();
|
||||
UINT32 addr = m_write_address >> 3; // almost surely raw addresses are actually shifted by 3
|
||||
address_space &vdp_space = machine().device<littlerb_vdp_device>("littlerbvdp")->space();
|
||||
|
||||
return vdp_space.read_word(addr, mem_mask);
|
||||
}
|
||||
|
||||
static void littlerb_data_write(running_machine &machine, UINT16 data, UINT16 mem_mask)
|
||||
void littlerb_state::littlerb_data_write(UINT16 data, UINT16 mem_mask)
|
||||
{
|
||||
littlerb_state *state = machine.driver_data<littlerb_state>();
|
||||
UINT32 addr = state->m_write_address >> 3; // almost surely raw addresses are actually shifted by 3
|
||||
address_space &vdp_space = machine.device<littlerb_vdp_device>("littlerbvdp")->space();
|
||||
int mode = state->m_vdp_writemode;
|
||||
UINT32 addr = m_write_address >> 3; // almost surely raw addresses are actually shifted by 3
|
||||
address_space &vdp_space = machine().device<littlerb_vdp_device>("littlerbvdp")->space();
|
||||
int mode = m_vdp_writemode;
|
||||
|
||||
|
||||
logerror("mode %04x, data %04x, mem_mask %04x (address %08x)\n", mode, data, mem_mask, state->m_write_address >> 3);
|
||||
logerror("mode %04x, data %04x, mem_mask %04x (address %08x)\n", mode, data, mem_mask, m_write_address >> 3);
|
||||
|
||||
if ((mode!=0x3800) && (mode !=0x2000) && (mode != 0xe000) && (mode != 0xf800))
|
||||
{
|
||||
@ -327,8 +329,8 @@ static void littlerb_data_write(running_machine &machine, UINT16 data, UINT16 me
|
||||
|
||||
// 2000 is used for palette writes which appears to be a RAMDAC, no auto-inc.
|
||||
// 1ff80806 is our 'spritelist'
|
||||
if (mode!=0x2000 && mode != 0xe000 && addr != 0x1ff80806) state->m_write_address+=0x10;
|
||||
littlerb_recalc_regs(machine);
|
||||
if (mode!=0x2000 && mode != 0xe000 && addr != 0x1ff80806) m_write_address+=0x10;
|
||||
littlerb_recalc_regs();
|
||||
}
|
||||
|
||||
|
||||
@ -339,10 +341,9 @@ static void littlerb_data_write(running_machine &machine, UINT16 data, UINT16 me
|
||||
|
||||
|
||||
|
||||
static void littlerb_recalc_address(running_machine &machine)
|
||||
void littlerb_state::littlerb_recalc_address()
|
||||
{
|
||||
littlerb_state *state = machine.driver_data<littlerb_state>();
|
||||
state->m_write_address = state->m_vdp_address_low | state->m_vdp_address_high<<16;
|
||||
m_write_address = m_vdp_address_low | m_vdp_address_high<<16;
|
||||
}
|
||||
|
||||
READ16_MEMBER(littlerb_state::littlerb_vdp_r)
|
||||
@ -354,7 +355,7 @@ READ16_MEMBER(littlerb_state::littlerb_vdp_r)
|
||||
{
|
||||
case 0: res = m_vdp_address_low; break;
|
||||
case 1: res = m_vdp_address_high; break;
|
||||
case 2: res = littlerb_data_read(machine(), mem_mask); break;
|
||||
case 2: res = littlerb_data_read(mem_mask); break;
|
||||
case 3: res = m_vdp_writemode; break;
|
||||
}
|
||||
|
||||
@ -405,17 +406,17 @@ WRITE16_MEMBER(littlerb_state::littlerb_vdp_w)
|
||||
{
|
||||
case 0:
|
||||
COMBINE_DATA(&m_vdp_address_low);
|
||||
littlerb_recalc_address(machine());
|
||||
littlerb_recalc_address();
|
||||
break;
|
||||
|
||||
case 1:
|
||||
COMBINE_DATA(&m_vdp_address_high);
|
||||
littlerb_recalc_address(machine());
|
||||
littlerb_recalc_address();
|
||||
break;
|
||||
|
||||
|
||||
case 2:
|
||||
littlerb_data_write(machine(), data, mem_mask);
|
||||
littlerb_data_write(data, mem_mask);
|
||||
break;
|
||||
|
||||
case 3:
|
||||
@ -429,22 +430,22 @@ WRITE16_MEMBER(littlerb_state::littlerb_vdp_w)
|
||||
}
|
||||
|
||||
/* could be slightly different (timing wise, directly related to the irqs), but certainly they smoked some bad pot for this messy way ... */
|
||||
static UINT8 sound_data_shift(running_machine &machine)
|
||||
UINT8 littlerb_state::sound_data_shift()
|
||||
{
|
||||
return ((machine.primary_screen->frame_number() % 16) == 0) ? 8 : 0;
|
||||
return ((machine().primary_screen->frame_number() % 16) == 0) ? 8 : 0;
|
||||
}
|
||||
|
||||
/* l is SFX, r is BGM (they doesn't seem to share the same data ROM) */
|
||||
WRITE16_MEMBER(littlerb_state::littlerb_l_sound_w)
|
||||
{
|
||||
m_sound_index_l = (data >> sound_data_shift(machine())) & 0xff;
|
||||
m_sound_index_l = (data >> sound_data_shift()) & 0xff;
|
||||
m_sound_pointer_l = 0;
|
||||
//popmessage("%04x %04x",m_sound_index_l,m_sound_index_r);
|
||||
}
|
||||
|
||||
WRITE16_MEMBER(littlerb_state::littlerb_r_sound_w)
|
||||
{
|
||||
m_sound_index_r = (data >> sound_data_shift(machine())) & 0xff;
|
||||
m_sound_index_r = (data >> sound_data_shift()) & 0xff;
|
||||
m_sound_pointer_r = 0;
|
||||
//popmessage("%04x %04x",m_sound_index_l,m_sound_index_r);
|
||||
}
|
||||
@ -606,11 +607,11 @@ void littlerb_state::video_start()
|
||||
|
||||
|
||||
|
||||
static void draw_sprite(running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect, int xsize,int ysize, UINT32 fulloffs, int xpos, int ypos )
|
||||
void littlerb_state::draw_sprite(bitmap_ind16 &bitmap, const rectangle &cliprect, int xsize,int ysize, UINT32 fulloffs, int xpos, int ypos )
|
||||
{
|
||||
int x,y;
|
||||
fulloffs >>= 3;
|
||||
address_space &vdp_space = machine.device<littlerb_vdp_device>("littlerbvdp")->space();
|
||||
address_space &vdp_space = machine().device<littlerb_vdp_device>("littlerbvdp")->space();
|
||||
|
||||
for (y=0;y<ysize;y++)
|
||||
{
|
||||
@ -643,18 +644,17 @@ static void draw_sprite(running_machine &machine, bitmap_ind16 &bitmap, const re
|
||||
}
|
||||
}
|
||||
|
||||
static void littlerb_draw_sprites(running_machine &machine)
|
||||
void littlerb_state::littlerb_draw_sprites()
|
||||
{
|
||||
littlerb_state *state = machine.driver_data<littlerb_state>();
|
||||
int x,y,offs;
|
||||
int xsize,ysize;
|
||||
UINT16* spriteregion = state->m_spritelist;
|
||||
UINT16* spriteregion = m_spritelist;
|
||||
//littlerb_printf("frame\n");
|
||||
|
||||
int layer = 0;
|
||||
int yoffset = 0;
|
||||
|
||||
littlerb_printf("m_listoffset %04x\n", state->m_listoffset );
|
||||
littlerb_printf("m_listoffset %04x\n", m_listoffset );
|
||||
|
||||
littlerb_printf("%04x %04x %04x %04x\n", spriteregion[0], spriteregion[1], spriteregion[2], spriteregion[3]);
|
||||
|
||||
@ -663,7 +663,7 @@ static void littlerb_draw_sprites(running_machine &machine)
|
||||
int minx = 0 , maxx = 0x14f;
|
||||
int miny = 0 , maxy = 0x11f;
|
||||
|
||||
for (offs=0;offs<(state->m_listoffset);)
|
||||
for (offs=0;offs<(m_listoffset);)
|
||||
{
|
||||
UINT32 read_dword = ((spriteregion[offs+1])<<16)+ (spriteregion[offs+0]);
|
||||
|
||||
@ -694,11 +694,11 @@ static void littlerb_draw_sprites(running_machine &machine)
|
||||
if (spriteregion[offs+4]==0x6000)
|
||||
{
|
||||
if (spriteregion[offs+3] & 0x1000)
|
||||
state->m_temp_bitmap_sprites_back->fill(0, state->m_temp_bitmap_sprites_back->cliprect());
|
||||
m_temp_bitmap_sprites_back->fill(0, m_temp_bitmap_sprites_back->cliprect());
|
||||
}
|
||||
else
|
||||
{
|
||||
if (spriteregion[offs+1] != 0xffd6) state->m_temp_bitmap_sprites->fill(0, state->m_temp_bitmap_sprites->cliprect());
|
||||
if (spriteregion[offs+1] != 0xffd6) m_temp_bitmap_sprites->fill(0, m_temp_bitmap_sprites->cliprect());
|
||||
}
|
||||
|
||||
|
||||
@ -781,36 +781,36 @@ static void littlerb_draw_sprites(running_machine &machine)
|
||||
// used between levels, and on boss death to clip sprite at the ground for sinking effect
|
||||
|
||||
|
||||
if (clip.min_x > state->m_temp_bitmap_sprites->cliprect().max_x)
|
||||
clip.min_x = state->m_temp_bitmap_sprites->cliprect().max_x;
|
||||
if (clip.min_x > m_temp_bitmap_sprites->cliprect().max_x)
|
||||
clip.min_x = m_temp_bitmap_sprites->cliprect().max_x;
|
||||
|
||||
if (clip.min_x < state->m_temp_bitmap_sprites->cliprect().min_x)
|
||||
clip.min_x = state->m_temp_bitmap_sprites->cliprect().min_x;
|
||||
if (clip.min_x < m_temp_bitmap_sprites->cliprect().min_x)
|
||||
clip.min_x = m_temp_bitmap_sprites->cliprect().min_x;
|
||||
|
||||
if (clip.max_x > state->m_temp_bitmap_sprites->cliprect().max_x)
|
||||
clip.max_x = state->m_temp_bitmap_sprites->cliprect().max_x;
|
||||
if (clip.max_x > m_temp_bitmap_sprites->cliprect().max_x)
|
||||
clip.max_x = m_temp_bitmap_sprites->cliprect().max_x;
|
||||
|
||||
if (clip.max_x < state->m_temp_bitmap_sprites->cliprect().min_x)
|
||||
clip.max_x = state->m_temp_bitmap_sprites->cliprect().min_x;
|
||||
if (clip.max_x < m_temp_bitmap_sprites->cliprect().min_x)
|
||||
clip.max_x = m_temp_bitmap_sprites->cliprect().min_x;
|
||||
|
||||
|
||||
if (clip.min_y > state->m_temp_bitmap_sprites->cliprect().max_y)
|
||||
clip.min_y = state->m_temp_bitmap_sprites->cliprect().max_y;
|
||||
if (clip.min_y > m_temp_bitmap_sprites->cliprect().max_y)
|
||||
clip.min_y = m_temp_bitmap_sprites->cliprect().max_y;
|
||||
|
||||
if (clip.min_y < state->m_temp_bitmap_sprites->cliprect().min_y)
|
||||
clip.min_y = state->m_temp_bitmap_sprites->cliprect().min_y;
|
||||
if (clip.min_y < m_temp_bitmap_sprites->cliprect().min_y)
|
||||
clip.min_y = m_temp_bitmap_sprites->cliprect().min_y;
|
||||
|
||||
if (clip.max_y > state->m_temp_bitmap_sprites->cliprect().max_y)
|
||||
clip.max_y = state->m_temp_bitmap_sprites->cliprect().max_y;
|
||||
if (clip.max_y > m_temp_bitmap_sprites->cliprect().max_y)
|
||||
clip.max_y = m_temp_bitmap_sprites->cliprect().max_y;
|
||||
|
||||
if (clip.max_y < state->m_temp_bitmap_sprites->cliprect().min_y)
|
||||
clip.max_y = state->m_temp_bitmap_sprites->cliprect().min_y;
|
||||
if (clip.max_y < m_temp_bitmap_sprites->cliprect().min_y)
|
||||
clip.max_y = m_temp_bitmap_sprites->cliprect().min_y;
|
||||
|
||||
|
||||
littlerb_alt_printf("%04x %04x %04x %04x %04x %04x\n", spriteregion[offs+0], spriteregion[offs+1], spriteregion[offs+2], spriteregion[offs+3], spriteregion[offs+4], spriteregion[offs+5]);
|
||||
|
||||
if (layer==0) draw_sprite(machine, *state->m_temp_bitmap_sprites, clip,xsize,ysize,fullcode,x,y);
|
||||
else draw_sprite(machine, *state->m_temp_bitmap_sprites_back, clip,xsize,ysize,fullcode,x,y);
|
||||
if (layer==0) draw_sprite(*m_temp_bitmap_sprites, clip,xsize,ysize,fullcode,x,y);
|
||||
else draw_sprite(*m_temp_bitmap_sprites_back, clip,xsize,ysize,fullcode,x,y);
|
||||
|
||||
|
||||
offs += 6;
|
||||
|
@ -99,6 +99,7 @@ public:
|
||||
virtual void machine_start();
|
||||
virtual void machine_reset();
|
||||
IRQ_CALLBACK_MEMBER(irq_callback);
|
||||
void intel82439tx_init();
|
||||
};
|
||||
|
||||
|
||||
@ -197,15 +198,14 @@ static void mxtc_config_w(device_t *busdevice, device_t *device, int function, i
|
||||
state->m_mxtc_config_reg[reg] = data;
|
||||
}
|
||||
|
||||
static void intel82439tx_init(running_machine &machine)
|
||||
void midqslvr_state::intel82439tx_init()
|
||||
{
|
||||
midqslvr_state *state = machine.driver_data<midqslvr_state>();
|
||||
state->m_mxtc_config_reg[0x60] = 0x02;
|
||||
state->m_mxtc_config_reg[0x61] = 0x02;
|
||||
state->m_mxtc_config_reg[0x62] = 0x02;
|
||||
state->m_mxtc_config_reg[0x63] = 0x02;
|
||||
state->m_mxtc_config_reg[0x64] = 0x02;
|
||||
state->m_mxtc_config_reg[0x65] = 0x02;
|
||||
m_mxtc_config_reg[0x60] = 0x02;
|
||||
m_mxtc_config_reg[0x61] = 0x02;
|
||||
m_mxtc_config_reg[0x62] = 0x02;
|
||||
m_mxtc_config_reg[0x63] = 0x02;
|
||||
m_mxtc_config_reg[0x64] = 0x02;
|
||||
m_mxtc_config_reg[0x65] = 0x02;
|
||||
}
|
||||
|
||||
static UINT32 intel82439tx_pci_r(device_t *busdevice, device_t *device, int function, int reg, UINT32 mem_mask)
|
||||
@ -662,7 +662,7 @@ void midqslvr_state::machine_start()
|
||||
init_pc_common(machine(), PCCOMMON_KEYBOARD_AT, midqslvr_set_keyb_int);
|
||||
|
||||
m_maincpu->set_irq_acknowledge_callback(device_irq_acknowledge_delegate(FUNC(midqslvr_state::irq_callback),this));
|
||||
intel82439tx_init(machine());
|
||||
intel82439tx_init();
|
||||
|
||||
kbdc8042_init(machine(), &at8042);
|
||||
}
|
||||
|
@ -131,6 +131,8 @@ public:
|
||||
virtual void palette_init();
|
||||
UINT32 screen_update_mirax(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
|
||||
INTERRUPT_GEN_MEMBER(mirax_vblank_irq);
|
||||
void draw_tilemap(bitmap_ind16 &bitmap, const rectangle &cliprect, UINT8 draw_flag);
|
||||
void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect);
|
||||
};
|
||||
|
||||
|
||||
@ -163,10 +165,9 @@ void mirax_state::palette_init()
|
||||
}
|
||||
|
||||
|
||||
static void draw_tilemap(running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect, UINT8 draw_flag)
|
||||
void mirax_state::draw_tilemap(bitmap_ind16 &bitmap, const rectangle &cliprect, UINT8 draw_flag)
|
||||
{
|
||||
mirax_state *state = machine.driver_data<mirax_state>();
|
||||
gfx_element *gfx = machine.gfx[0];
|
||||
gfx_element *gfx = machine().gfx[0];
|
||||
int y,x;
|
||||
int res_x,res_y,wrapy;
|
||||
|
||||
@ -174,29 +175,28 @@ static void draw_tilemap(running_machine &machine, bitmap_ind16 &bitmap, const r
|
||||
{
|
||||
for (x=0;x<32;x++)
|
||||
{
|
||||
int tile = state->m_videoram[32*y+x];
|
||||
int color = (state->m_colorram[x*2]<<8) | (state->m_colorram[(x*2)+1]);
|
||||
int tile = m_videoram[32*y+x];
|
||||
int color = (m_colorram[x*2]<<8) | (m_colorram[(x*2)+1]);
|
||||
int x_scroll = (color & 0xff00)>>8;
|
||||
tile |= ((color & 0xe0)<<3);
|
||||
|
||||
res_x = (state->m_flipscreen_x) ? 248-x*8 : x*8;
|
||||
res_y = (state->m_flipscreen_y) ? 248-y*8+x_scroll : y*8-x_scroll;
|
||||
wrapy = (state->m_flipscreen_y) ? -256 : 256;
|
||||
res_x = (m_flipscreen_x) ? 248-x*8 : x*8;
|
||||
res_y = (m_flipscreen_y) ? 248-y*8+x_scroll : y*8-x_scroll;
|
||||
wrapy = (m_flipscreen_y) ? -256 : 256;
|
||||
|
||||
if((x <= 1 || x >= 30) ^ draw_flag)
|
||||
{
|
||||
drawgfx_opaque(bitmap,cliprect,gfx,tile,color & 7,(state->m_flipscreen_x),(state->m_flipscreen_y),res_x,res_y);
|
||||
drawgfx_opaque(bitmap,cliprect,gfx,tile,color & 7,(m_flipscreen_x),(m_flipscreen_y),res_x,res_y);
|
||||
/* wrap-around */
|
||||
drawgfx_opaque(bitmap,cliprect,gfx,tile,color & 7,(state->m_flipscreen_x),(state->m_flipscreen_y),res_x,res_y+wrapy);
|
||||
drawgfx_opaque(bitmap,cliprect,gfx,tile,color & 7,(m_flipscreen_x),(m_flipscreen_y),res_x,res_y+wrapy);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void draw_sprites(running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect)
|
||||
void mirax_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect)
|
||||
{
|
||||
mirax_state *state = machine.driver_data<mirax_state>();
|
||||
UINT8 *spriteram = state->m_spriteram;
|
||||
UINT8 *spriteram = m_spriteram;
|
||||
int count;
|
||||
|
||||
for(count=0;count<0x200;count+=4)
|
||||
@ -208,24 +208,24 @@ static void draw_sprites(running_machine &machine, bitmap_ind16 &bitmap, const r
|
||||
|
||||
spr_offs = (spriteram[count+1] & 0x3f);
|
||||
color = spriteram[count+2] & 0x7;
|
||||
fx = (state->m_flipscreen_x) ^ ((spriteram[count+1] & 0x40) >> 6); //<- guess
|
||||
fy = (state->m_flipscreen_y) ^ ((spriteram[count+1] & 0x80) >> 7);
|
||||
fx = (m_flipscreen_x) ^ ((spriteram[count+1] & 0x40) >> 6); //<- guess
|
||||
fy = (m_flipscreen_y) ^ ((spriteram[count+1] & 0x80) >> 7);
|
||||
|
||||
spr_offs += (spriteram[count+2] & 0xe0)<<1;
|
||||
spr_offs += (spriteram[count+2] & 0x10)<<5;
|
||||
|
||||
y = (state->m_flipscreen_y) ? spriteram[count] : 0x100 - spriteram[count] - 16;
|
||||
x = (state->m_flipscreen_x) ? 240 - spriteram[count+3] : spriteram[count+3];
|
||||
y = (m_flipscreen_y) ? spriteram[count] : 0x100 - spriteram[count] - 16;
|
||||
x = (m_flipscreen_x) ? 240 - spriteram[count+3] : spriteram[count+3];
|
||||
|
||||
drawgfx_transpen(bitmap,cliprect,machine.gfx[1],spr_offs,color,fx,fy,x,y,0);
|
||||
drawgfx_transpen(bitmap,cliprect,machine().gfx[1],spr_offs,color,fx,fy,x,y,0);
|
||||
}
|
||||
}
|
||||
|
||||
UINT32 mirax_state::screen_update_mirax(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
|
||||
{
|
||||
draw_tilemap(machine(),bitmap,cliprect,1);
|
||||
draw_sprites(machine(),bitmap,cliprect);
|
||||
draw_tilemap(machine(),bitmap,cliprect,0);
|
||||
draw_tilemap(bitmap,cliprect,1);
|
||||
draw_sprites(bitmap,cliprect);
|
||||
draw_tilemap(bitmap,cliprect,0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -63,6 +63,8 @@ public:
|
||||
UINT32 screen_update_mjsister(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
|
||||
TIMER_CALLBACK_MEMBER(dac_callback);
|
||||
void mjsister_redraw();
|
||||
void mjsister_plot0( int offset, UINT8 data );
|
||||
void mjsister_plot1( int offset, UINT8 data );
|
||||
};
|
||||
|
||||
|
||||
@ -81,24 +83,22 @@ void mjsister_state::video_start()
|
||||
save_item(NAME(m_videoram1));
|
||||
}
|
||||
|
||||
static void mjsister_plot0( running_machine &machine, int offset, UINT8 data )
|
||||
void mjsister_state::mjsister_plot0( int offset, UINT8 data )
|
||||
{
|
||||
mjsister_state *state = machine.driver_data<mjsister_state>();
|
||||
int x, y, c1, c2;
|
||||
|
||||
x = offset & 0x7f;
|
||||
y = offset / 0x80;
|
||||
|
||||
c1 = (data & 0x0f) + state->m_colorbank * 0x20;
|
||||
c2 = ((data & 0xf0) >> 4) + state->m_colorbank * 0x20;
|
||||
c1 = (data & 0x0f) + m_colorbank * 0x20;
|
||||
c2 = ((data & 0xf0) >> 4) + m_colorbank * 0x20;
|
||||
|
||||
state->m_tmpbitmap0->pix16(y, x * 2 + 0) = c1;
|
||||
state->m_tmpbitmap0->pix16(y, x * 2 + 1) = c2;
|
||||
m_tmpbitmap0->pix16(y, x * 2 + 0) = c1;
|
||||
m_tmpbitmap0->pix16(y, x * 2 + 1) = c2;
|
||||
}
|
||||
|
||||
static void mjsister_plot1( running_machine &machine, int offset, UINT8 data )
|
||||
void mjsister_state::mjsister_plot1( int offset, UINT8 data )
|
||||
{
|
||||
mjsister_state *state = machine.driver_data<mjsister_state>();
|
||||
int x, y, c1, c2;
|
||||
|
||||
x = offset & 0x7f;
|
||||
@ -108,12 +108,12 @@ static void mjsister_plot1( running_machine &machine, int offset, UINT8 data )
|
||||
c2 = (data & 0xf0) >> 4;
|
||||
|
||||
if (c1)
|
||||
c1 += state->m_colorbank * 0x20 + 0x10;
|
||||
c1 += m_colorbank * 0x20 + 0x10;
|
||||
if (c2)
|
||||
c2 += state->m_colorbank * 0x20 + 0x10;
|
||||
c2 += m_colorbank * 0x20 + 0x10;
|
||||
|
||||
state->m_tmpbitmap1->pix16(y, x * 2 + 0) = c1;
|
||||
state->m_tmpbitmap1->pix16(y, x * 2 + 1) = c2;
|
||||
m_tmpbitmap1->pix16(y, x * 2 + 0) = c1;
|
||||
m_tmpbitmap1->pix16(y, x * 2 + 1) = c2;
|
||||
}
|
||||
|
||||
WRITE8_MEMBER(mjsister_state::mjsister_videoram_w)
|
||||
@ -121,12 +121,12 @@ WRITE8_MEMBER(mjsister_state::mjsister_videoram_w)
|
||||
if (m_vrambank)
|
||||
{
|
||||
m_videoram1[offset] = data;
|
||||
mjsister_plot1(machine(), offset, data);
|
||||
mjsister_plot1(offset, data);
|
||||
}
|
||||
else
|
||||
{
|
||||
m_videoram0[offset] = data;
|
||||
mjsister_plot0(machine(), offset, data);
|
||||
mjsister_plot0(offset, data);
|
||||
}
|
||||
}
|
||||
|
||||
@ -141,8 +141,8 @@ UINT32 mjsister_state::screen_update_mjsister(screen_device &screen, bitmap_ind1
|
||||
|
||||
for (offs = 0; offs < 0x8000; offs++)
|
||||
{
|
||||
mjsister_plot0(machine(), offs, m_videoram0[offs]);
|
||||
mjsister_plot1(machine(), offs, m_videoram1[offs]);
|
||||
mjsister_plot0(offs, m_videoram0[offs]);
|
||||
mjsister_plot1(offs, m_videoram1[offs]);
|
||||
}
|
||||
m_screen_redraw = 0;
|
||||
}
|
||||
|
@ -79,6 +79,7 @@ public:
|
||||
virtual void video_start();
|
||||
UINT32 screen_update_mlanding(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
|
||||
TIMER_CALLBACK_MEMBER(dma_complete);
|
||||
int start_dma();
|
||||
};
|
||||
|
||||
|
||||
@ -113,9 +114,8 @@ UINT32 mlanding_state::screen_update_mlanding(screen_device &screen, bitmap_ind1
|
||||
}
|
||||
|
||||
/* Return the number of pixels processed for timing purposes? */
|
||||
static int start_dma(running_machine &machine)
|
||||
int mlanding_state::start_dma()
|
||||
{
|
||||
mlanding_state *state = machine.driver_data<mlanding_state>();
|
||||
/* Traverse the DMA RAM list */
|
||||
int offs;
|
||||
|
||||
@ -130,14 +130,14 @@ static int start_dma(running_machine &machine)
|
||||
|
||||
int j, k;
|
||||
|
||||
UINT16 attr = state->m_dma_ram[offs];
|
||||
UINT16 attr = m_dma_ram[offs];
|
||||
|
||||
if (attr == 0)
|
||||
continue;
|
||||
|
||||
x = state->m_dma_ram[offs + 1];
|
||||
y = state->m_dma_ram[offs + 2];
|
||||
colour = state->m_dma_ram[offs + 3];
|
||||
x = m_dma_ram[offs + 1];
|
||||
y = m_dma_ram[offs + 2];
|
||||
colour = m_dma_ram[offs + 3];
|
||||
|
||||
dx = x >> 11;
|
||||
dy = y >> 11;
|
||||
@ -172,8 +172,8 @@ static int start_dma(running_machine &machine)
|
||||
// Draw the 8x8 chunk
|
||||
for (y1 = 0; y1 < 8; ++y1)
|
||||
{
|
||||
UINT16 *src = &state->m_ml_tileram[(code * 2 * 8) + y1*2];
|
||||
UINT16 *dst = &state->m_g_ram[(y + k*8+y1)*512/2 + (j*8+x)/2];
|
||||
UINT16 *src = &m_ml_tileram[(code * 2 * 8) + y1*2];
|
||||
UINT16 *dst = &m_g_ram[(y + k*8+y1)*512/2 + (j*8+x)/2];
|
||||
|
||||
UINT8 p2 = *src & 0xff;
|
||||
UINT8 p1 = *src++ >> 8;
|
||||
@ -220,7 +220,7 @@ static int start_dma(running_machine &machine)
|
||||
for(y1 = 0; y1 < dy*8; y1++)
|
||||
{
|
||||
int x1;
|
||||
UINT16 *dst = &state->m_g_ram[((y + y1) * 512/2) + x/2];
|
||||
UINT16 *dst = &m_g_ram[((y + y1) * 512/2) + x/2];
|
||||
|
||||
for(x1 = 0; x1 < dx*8; x1+=2)
|
||||
{
|
||||
@ -324,7 +324,7 @@ WRITE16_MEMBER(mlanding_state::ml_sub_reset_w)
|
||||
int pixels;
|
||||
|
||||
// Return the number of pixels drawn?
|
||||
pixels = start_dma(machine());
|
||||
pixels = start_dma();
|
||||
|
||||
if (pixels)
|
||||
{
|
||||
|
@ -57,6 +57,8 @@ public:
|
||||
DECLARE_MACHINE_RESET(nprsp);
|
||||
UINT32 screen_update_neoprint(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
|
||||
UINT32 screen_update_nprsp(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
|
||||
void draw_layer(bitmap_ind16 &bitmap,const rectangle &cliprect,int layer,int data_shift);
|
||||
void audio_cpu_assert_nmi();
|
||||
};
|
||||
|
||||
|
||||
@ -73,16 +75,15 @@ xxxx xxxx xxxx xxxx [2] scroll Y, signed
|
||||
---- ---- --?? ??xx [6] map register
|
||||
*/
|
||||
|
||||
static void draw_layer(running_machine &machine, bitmap_ind16 &bitmap,const rectangle &cliprect,int layer,int data_shift)
|
||||
void neoprint_state::draw_layer(bitmap_ind16 &bitmap,const rectangle &cliprect,int layer,int data_shift)
|
||||
{
|
||||
neoprint_state *state = machine.driver_data<neoprint_state>();
|
||||
int i, y, x;
|
||||
gfx_element *gfx = machine.gfx[0];
|
||||
gfx_element *gfx = machine().gfx[0];
|
||||
INT16 scrollx, scrolly;
|
||||
|
||||
i = (state->m_npvidregs[((layer*8)+0x06)/2] & 7) * 0x1000/4;
|
||||
scrollx = ((state->m_npvidregs[((layer*8)+0x00)/2] - (0xd8 + layer*4)) & 0x03ff);
|
||||
scrolly = ((state->m_npvidregs[((layer*8)+0x02)/2] - 0xffeb) & 0x03ff);
|
||||
i = (m_npvidregs[((layer*8)+0x06)/2] & 7) * 0x1000/4;
|
||||
scrollx = ((m_npvidregs[((layer*8)+0x00)/2] - (0xd8 + layer*4)) & 0x03ff);
|
||||
scrolly = ((m_npvidregs[((layer*8)+0x02)/2] - 0xffeb) & 0x03ff);
|
||||
|
||||
scrollx/=2;
|
||||
scrolly/=2;
|
||||
@ -91,14 +92,14 @@ static void draw_layer(running_machine &machine, bitmap_ind16 &bitmap,const rect
|
||||
{
|
||||
for (x=0;x<32;x++)
|
||||
{
|
||||
UINT16 dat = state->m_npvidram[i*2] >> data_shift; // a video register?
|
||||
UINT16 dat = m_npvidram[i*2] >> data_shift; // a video register?
|
||||
UINT16 color;
|
||||
if(state->m_npvidram[i*2+1] & 0x0020) // TODO: 8bpp switch?
|
||||
color = ((state->m_npvidram[i*2+1] & 0x8000) << 1) | 0x200 | ((state->m_npvidram[i*2+1] & 0xff00) >> 7);
|
||||
if(m_npvidram[i*2+1] & 0x0020) // TODO: 8bpp switch?
|
||||
color = ((m_npvidram[i*2+1] & 0x8000) << 1) | 0x200 | ((m_npvidram[i*2+1] & 0xff00) >> 7);
|
||||
else
|
||||
color = ((state->m_npvidram[i*2+1] & 0xff00) >> 8) | ((state->m_npvidram[i*2+1] & 0x0010) << 4);
|
||||
UINT8 fx = (state->m_npvidram[i*2+1] & 0x0040);
|
||||
UINT8 fy = (state->m_npvidram[i*2+1] & 0x0080);
|
||||
color = ((m_npvidram[i*2+1] & 0xff00) >> 8) | ((m_npvidram[i*2+1] & 0x0010) << 4);
|
||||
UINT8 fx = (m_npvidram[i*2+1] & 0x0040);
|
||||
UINT8 fy = (m_npvidram[i*2+1] & 0x0080);
|
||||
|
||||
drawgfx_transpen(bitmap,cliprect,gfx,dat,color,fx,fy,x*16+scrollx,y*16-scrolly,0);
|
||||
drawgfx_transpen(bitmap,cliprect,gfx,dat,color,fx,fy,x*16+scrollx-512,y*16-scrolly,0);
|
||||
@ -115,8 +116,8 @@ UINT32 neoprint_state::screen_update_neoprint(screen_device &screen, bitmap_ind1
|
||||
{
|
||||
bitmap.fill(0, cliprect);
|
||||
|
||||
draw_layer(machine(),bitmap,cliprect,1,2);
|
||||
draw_layer(machine(),bitmap,cliprect,0,2);
|
||||
draw_layer(bitmap,cliprect,1,2);
|
||||
draw_layer(bitmap,cliprect,0,2);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@ -125,9 +126,9 @@ UINT32 neoprint_state::screen_update_nprsp(screen_device &screen, bitmap_ind16 &
|
||||
{
|
||||
bitmap.fill(0, cliprect);
|
||||
|
||||
draw_layer(machine(),bitmap,cliprect,1,0);
|
||||
draw_layer(machine(),bitmap,cliprect,2,0);
|
||||
draw_layer(machine(),bitmap,cliprect,0,0);
|
||||
draw_layer(bitmap,cliprect,1,0);
|
||||
draw_layer(bitmap,cliprect,2,0);
|
||||
draw_layer(bitmap,cliprect,0,0);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@ -165,9 +166,9 @@ READ16_MEMBER(neoprint_state::neoprint_audio_result_r)
|
||||
return (m_audio_result << 8) | 0x00;
|
||||
}
|
||||
|
||||
static void audio_cpu_assert_nmi(running_machine &machine)
|
||||
void neoprint_state::audio_cpu_assert_nmi()
|
||||
{
|
||||
machine.device("audiocpu")->execute().set_input_line(INPUT_LINE_NMI, ASSERT_LINE);
|
||||
machine().device("audiocpu")->execute().set_input_line(INPUT_LINE_NMI, ASSERT_LINE);
|
||||
}
|
||||
|
||||
|
||||
@ -183,7 +184,7 @@ WRITE16_MEMBER(neoprint_state::audio_command_w)
|
||||
{
|
||||
soundlatch_byte_w(space, 0, data >> 8);
|
||||
|
||||
audio_cpu_assert_nmi(machine());
|
||||
audio_cpu_assert_nmi();
|
||||
|
||||
/* boost the interleave to let the audio CPU read the command */
|
||||
machine().scheduler().boost_interleave(attotime::zero, attotime::from_usec(50));
|
||||
|
@ -51,6 +51,7 @@ public:
|
||||
virtual void machine_reset();
|
||||
virtual void video_start();
|
||||
UINT32 screen_update_nexus3d(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
|
||||
void nexus3d_flash_reset();
|
||||
};
|
||||
|
||||
|
||||
@ -61,14 +62,13 @@ public:
|
||||
// Flash handling is very similar (but not 100% identical) to the stuff used in cavesh3 (command structure seems very slightly different, probably due to larger size)
|
||||
// this is just a skeleton implementation
|
||||
|
||||
void nexus3d_flash_reset(running_machine& machine)
|
||||
void nexus3d_state::nexus3d_flash_reset()
|
||||
{
|
||||
nexus3d_state *state = machine.driver_data<nexus3d_state>();
|
||||
state->m_last_flash_cmd = 0x00;
|
||||
state->m_flash_addr_seq = 0;
|
||||
state->m_flash_addr = 0;
|
||||
m_last_flash_cmd = 0x00;
|
||||
m_flash_addr_seq = 0;
|
||||
m_flash_addr = 0;
|
||||
|
||||
state->m_flash_page_addr = 0;
|
||||
m_flash_page_addr = 0;
|
||||
}
|
||||
|
||||
READ8_MEMBER(nexus3d_state::n3d_flash_r)
|
||||
@ -189,7 +189,7 @@ UINT32 nexus3d_state::screen_update_nexus3d(screen_device &screen, bitmap_rgb32
|
||||
|
||||
void nexus3d_state::machine_reset()
|
||||
{
|
||||
nexus3d_flash_reset(machine());
|
||||
nexus3d_flash_reset();
|
||||
}
|
||||
|
||||
static MACHINE_CONFIG_START( nexus3d, nexus3d_state )
|
||||
|
@ -131,6 +131,7 @@ public:
|
||||
virtual void machine_reset();
|
||||
INTERRUPT_GEN_MEMBER(update_pia_1);
|
||||
DECLARE_WRITE8_MEMBER(ic48_1_74123_output_changed);
|
||||
inline void shift_star_generator( );
|
||||
};
|
||||
|
||||
|
||||
@ -371,10 +372,9 @@ static MC6845_UPDATE_ROW( update_row )
|
||||
}
|
||||
|
||||
|
||||
INLINE void shift_star_generator( running_machine &machine )
|
||||
void nyny_state::shift_star_generator( )
|
||||
{
|
||||
nyny_state *state = machine.driver_data<nyny_state>();
|
||||
state->m_star_shift_reg = (state->m_star_shift_reg << 1) | (((~state->m_star_shift_reg >> 15) & 0x01) ^ ((state->m_star_shift_reg >> 2) & 0x01));
|
||||
m_star_shift_reg = (m_star_shift_reg << 1) | (((~m_star_shift_reg >> 15) & 0x01) ^ ((m_star_shift_reg >> 2) & 0x01));
|
||||
}
|
||||
|
||||
|
||||
@ -408,7 +408,7 @@ static MC6845_END_UPDATE( end_update )
|
||||
}
|
||||
|
||||
if (delay_counter == 0)
|
||||
shift_star_generator(device->machine());
|
||||
state->shift_star_generator();
|
||||
else
|
||||
delay_counter = delay_counter - 1;
|
||||
}
|
||||
|
@ -76,6 +76,7 @@ public:
|
||||
virtual void machine_start();
|
||||
virtual void video_start();
|
||||
UINT32 screen_update_onetwo(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
|
||||
void set_color(int offset);
|
||||
};
|
||||
|
||||
|
||||
@ -137,27 +138,26 @@ WRITE8_MEMBER(onetwo_state::onetwo_soundlatch_w)
|
||||
m_audiocpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE);
|
||||
}
|
||||
|
||||
static void set_color(running_machine &machine, int offset)
|
||||
void onetwo_state::set_color(int offset)
|
||||
{
|
||||
onetwo_state *state = machine.driver_data<onetwo_state>();
|
||||
int r, g, b;
|
||||
|
||||
r = state->m_paletteram[offset] & 0x1f;
|
||||
g = state->m_paletteram2[offset] & 0x1f;
|
||||
b = ((state->m_paletteram[offset] & 0x60) >> 2) | ((state->m_paletteram2[offset] & 0xe0) >> 5);
|
||||
palette_set_color_rgb(machine, offset, pal5bit(r), pal5bit(g), pal5bit(b));
|
||||
r = m_paletteram[offset] & 0x1f;
|
||||
g = m_paletteram2[offset] & 0x1f;
|
||||
b = ((m_paletteram[offset] & 0x60) >> 2) | ((m_paletteram2[offset] & 0xe0) >> 5);
|
||||
palette_set_color_rgb(machine(), offset, pal5bit(r), pal5bit(g), pal5bit(b));
|
||||
}
|
||||
|
||||
WRITE8_MEMBER(onetwo_state::palette1_w)
|
||||
{
|
||||
m_paletteram[offset] = data;
|
||||
set_color(machine(), offset);
|
||||
set_color(offset);
|
||||
}
|
||||
|
||||
WRITE8_MEMBER(onetwo_state::palette2_w)
|
||||
{
|
||||
m_paletteram2[offset] = data;
|
||||
set_color(machine(), offset);
|
||||
set_color(offset);
|
||||
}
|
||||
|
||||
/*************************************
|
||||
|
@ -100,6 +100,7 @@ public:
|
||||
virtual void palette_init();
|
||||
UINT32 screen_update_panicr(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
|
||||
TIMER_DEVICE_CALLBACK_MEMBER(panicr_scanline);
|
||||
void draw_sprites(bitmap_ind16 &bitmap,const rectangle &cliprect );
|
||||
};
|
||||
|
||||
|
||||
@ -224,10 +225,9 @@ void panicr_state::video_start()
|
||||
colortable_configure_tilemap_groups(machine().colortable, m_txttilemap, machine().gfx[0], 0);
|
||||
}
|
||||
|
||||
static void draw_sprites(running_machine &machine, bitmap_ind16 &bitmap,const rectangle &cliprect )
|
||||
void panicr_state::draw_sprites(bitmap_ind16 &bitmap,const rectangle &cliprect )
|
||||
{
|
||||
panicr_state *state = machine.driver_data<panicr_state>();
|
||||
UINT8 *spriteram = state->m_spriteram;
|
||||
UINT8 *spriteram = m_spriteram;
|
||||
int offs,flipx,flipy,x,y,color,sprite;
|
||||
|
||||
for (offs = 0; offs<0x1000; offs+=16)
|
||||
@ -239,12 +239,12 @@ static void draw_sprites(running_machine &machine, bitmap_ind16 &bitmap,const re
|
||||
if (spriteram[offs+1] & 0x40) x -= 0x100;
|
||||
|
||||
color = spriteram[offs+1] & 0x0f;
|
||||
sprite = spriteram[offs+0] | (*state->m_spritebank << 8);
|
||||
sprite = spriteram[offs+0] | (*m_spritebank << 8);
|
||||
|
||||
drawgfx_transmask(bitmap,cliprect,machine.gfx[3],
|
||||
drawgfx_transmask(bitmap,cliprect,machine().gfx[3],
|
||||
sprite,
|
||||
color,flipx,flipy,x,y,
|
||||
colortable_get_transpen_mask(machine.colortable, machine.gfx[3], color, 0));
|
||||
colortable_get_transpen_mask(machine().colortable, machine().gfx[3], color, 0));
|
||||
}
|
||||
}
|
||||
|
||||
@ -254,7 +254,7 @@ UINT32 panicr_state::screen_update_panicr(screen_device &screen, bitmap_ind16 &b
|
||||
m_txttilemap->mark_all_dirty();
|
||||
m_bgtilemap->set_scrollx(0, m_scrollx);
|
||||
m_bgtilemap->draw(bitmap, cliprect, 0,0);
|
||||
draw_sprites(machine(),bitmap,cliprect);
|
||||
draw_sprites(bitmap,cliprect);
|
||||
m_txttilemap->draw(bitmap, cliprect, 0,0);
|
||||
|
||||
return 0;
|
||||
|
@ -103,6 +103,7 @@ public:
|
||||
virtual void machine_start();
|
||||
virtual void machine_reset();
|
||||
IRQ_CALLBACK_MEMBER(irq_callback);
|
||||
void intel82439tx_init();
|
||||
};
|
||||
|
||||
// Intel 82439TX System Controller (MXTC)
|
||||
@ -185,15 +186,14 @@ static void mxtc_config_w(device_t *busdevice, device_t *device, int function, i
|
||||
state->m_mxtc_config_reg[reg] = data;
|
||||
}
|
||||
|
||||
static void intel82439tx_init(running_machine &machine)
|
||||
void savquest_state::intel82439tx_init()
|
||||
{
|
||||
savquest_state *state = machine.driver_data<savquest_state>();
|
||||
state->m_mxtc_config_reg[0x60] = 0x02;
|
||||
state->m_mxtc_config_reg[0x61] = 0x02;
|
||||
state->m_mxtc_config_reg[0x62] = 0x02;
|
||||
state->m_mxtc_config_reg[0x63] = 0x02;
|
||||
state->m_mxtc_config_reg[0x64] = 0x02;
|
||||
state->m_mxtc_config_reg[0x65] = 0x02;
|
||||
m_mxtc_config_reg[0x60] = 0x02;
|
||||
m_mxtc_config_reg[0x61] = 0x02;
|
||||
m_mxtc_config_reg[0x62] = 0x02;
|
||||
m_mxtc_config_reg[0x63] = 0x02;
|
||||
m_mxtc_config_reg[0x64] = 0x02;
|
||||
m_mxtc_config_reg[0x65] = 0x02;
|
||||
}
|
||||
|
||||
static UINT32 intel82439tx_pci_r(device_t *busdevice, device_t *device, int function, int reg, UINT32 mem_mask)
|
||||
@ -623,7 +623,7 @@ void savquest_state::machine_start()
|
||||
init_pc_common(machine(), PCCOMMON_KEYBOARD_AT, savquest_set_keyb_int);
|
||||
|
||||
m_maincpu->set_irq_acknowledge_callback(device_irq_acknowledge_delegate(FUNC(savquest_state::irq_callback),this));
|
||||
intel82439tx_init(machine());
|
||||
intel82439tx_init();
|
||||
|
||||
kbdc8042_init(machine(), &at8042);
|
||||
}
|
||||
|
@ -59,12 +59,13 @@ public:
|
||||
DECLARE_DRIVER_INIT(astron);
|
||||
virtual void machine_start();
|
||||
UINT32 screen_update_astron(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
|
||||
void astron_draw_characters(bitmap_rgb32 &bitmap,const rectangle &cliprect);
|
||||
void astron_draw_sprites(bitmap_rgb32 &bitmap, const rectangle &cliprect);
|
||||
};
|
||||
|
||||
/* VIDEO GOODS */
|
||||
static void astron_draw_characters(running_machine &machine, bitmap_rgb32 &bitmap,const rectangle &cliprect)
|
||||
void segald_state::astron_draw_characters(bitmap_rgb32 &bitmap,const rectangle &cliprect)
|
||||
{
|
||||
segald_state *state = machine.driver_data<segald_state>();
|
||||
UINT8 characterX, characterY;
|
||||
|
||||
for (characterX = 0; characterX < 32; characterX++)
|
||||
@ -72,13 +73,13 @@ static void astron_draw_characters(running_machine &machine, bitmap_rgb32 &bitma
|
||||
for (characterY = 0; characterY < 32; characterY++)
|
||||
{
|
||||
int current_screen_character = (characterY*32) + characterX;
|
||||
drawgfx_transpen(bitmap, cliprect, machine.gfx[0], state->m_fix_ram[current_screen_character],
|
||||
drawgfx_transpen(bitmap, cliprect, machine().gfx[0], m_fix_ram[current_screen_character],
|
||||
1, 0, 0, characterX*8, characterY*8, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void astron_draw_sprites(running_machine &machine, bitmap_rgb32 &bitmap, const rectangle &cliprect)
|
||||
void segald_state::astron_draw_sprites(bitmap_rgb32 &bitmap, const rectangle &cliprect)
|
||||
{
|
||||
/* Heisted from Daphne */
|
||||
const UINT8 SPR_Y_TOP = 0;
|
||||
@ -90,7 +91,6 @@ static void astron_draw_sprites(running_machine &machine, bitmap_rgb32 &bitmap,
|
||||
/* const UINT8 SPR_GFXOFS_LO = 6;*/
|
||||
/* const UINT8 SPR_GFXOFS_HI = 7;*/
|
||||
|
||||
segald_state *state = machine.driver_data<segald_state>();
|
||||
int sx,sy;
|
||||
int spr_number;
|
||||
int spr_base;
|
||||
@ -98,8 +98,8 @@ static void astron_draw_sprites(running_machine &machine, bitmap_rgb32 &bitmap,
|
||||
for (spr_number = 0; spr_number < 32; spr_number++)
|
||||
{
|
||||
spr_base = 0x10 * spr_number;
|
||||
sy = state->m_obj_ram[spr_base + SPR_Y_TOP];
|
||||
sx = state->m_obj_ram[spr_base + SPR_X_LO];
|
||||
sy = m_obj_ram[spr_base + SPR_Y_TOP];
|
||||
sx = m_obj_ram[spr_base + SPR_X_LO];
|
||||
|
||||
if (sx != 0 || sy != 0)
|
||||
logerror("Hey! A sprite's not at 0,0 : %d %d", sx, sy);
|
||||
@ -111,8 +111,8 @@ UINT32 segald_state::screen_update_astron(screen_device &screen, bitmap_rgb32 &b
|
||||
{
|
||||
bitmap.fill(0, cliprect);
|
||||
|
||||
astron_draw_characters(machine(), bitmap, cliprect);
|
||||
astron_draw_sprites(machine(), bitmap, cliprect);
|
||||
astron_draw_characters(bitmap, cliprect);
|
||||
astron_draw_sprites(bitmap, cliprect);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -114,31 +114,34 @@ public:
|
||||
DECLARE_WRITE8_MEMBER(oki_setbank);
|
||||
virtual void video_start();
|
||||
UINT32 screen_update_sliver(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
|
||||
void plot_pixel_rgb(int x, int y, UINT32 r, UINT32 g, UINT32 b);
|
||||
void plot_pixel_pal(int x, int y, int addr);
|
||||
void blit_gfx();
|
||||
void render_jpeg();
|
||||
};
|
||||
|
||||
static void plot_pixel_rgb(sliver_state *state, int x, int y, UINT32 r, UINT32 g, UINT32 b)
|
||||
void sliver_state::plot_pixel_rgb(int x, int y, UINT32 r, UINT32 g, UINT32 b)
|
||||
{
|
||||
// printf("plot %d %d %d\n", r,g,b);
|
||||
|
||||
if (y < 0 || x < 0 || x > 383 || y > 255)
|
||||
return;
|
||||
|
||||
state->m_bitmap_bg.pix32(y, x) = r | (g<<8) | (b<<16);
|
||||
m_bitmap_bg.pix32(y, x) = r | (g<<8) | (b<<16);
|
||||
}
|
||||
|
||||
static void plot_pixel_pal(running_machine &machine, int x, int y, int addr)
|
||||
void sliver_state::plot_pixel_pal(int x, int y, int addr)
|
||||
{
|
||||
sliver_state *state = machine.driver_data<sliver_state>();
|
||||
UINT32 r,g,b;
|
||||
|
||||
if (y < 0 || x < 0 || x > 383 || y > 255)
|
||||
return;
|
||||
|
||||
b=(state->m_colorram[addr] << 2) | (state->m_colorram[addr] & 0x3);
|
||||
g=(state->m_colorram[addr+0x100] << 2) | (state->m_colorram[addr+0x100] & 3);
|
||||
r=(state->m_colorram[addr+0x200] << 2) | (state->m_colorram[addr+0x200] & 3);
|
||||
b=(m_colorram[addr] << 2) | (m_colorram[addr] & 0x3);
|
||||
g=(m_colorram[addr+0x100] << 2) | (m_colorram[addr+0x100] & 3);
|
||||
r=(m_colorram[addr+0x200] << 2) | (m_colorram[addr+0x200] & 3);
|
||||
|
||||
state->m_bitmap_fg.pix32(y, x) = r | (g<<8) | (b<<16);
|
||||
m_bitmap_fg.pix32(y, x) = r | (g<<8) | (b<<16);
|
||||
}
|
||||
|
||||
WRITE16_MEMBER(sliver_state::fifo_data_w)
|
||||
@ -162,22 +165,21 @@ WRITE16_MEMBER(sliver_state::fifo_data_w)
|
||||
}
|
||||
}
|
||||
|
||||
static void blit_gfx(running_machine &machine)
|
||||
void sliver_state::blit_gfx()
|
||||
{
|
||||
sliver_state *state = machine.driver_data<sliver_state>();
|
||||
int tmpptr=0;
|
||||
const UINT8 *rom = state->memregion("user1")->base();
|
||||
const UINT8 *rom = memregion("user1")->base();
|
||||
|
||||
while (tmpptr < state->m_fptr)
|
||||
while (tmpptr < m_fptr)
|
||||
{
|
||||
int x,y,romdata;
|
||||
int w,h;
|
||||
int romoffs=state->m_fifo[tmpptr+0]+(state->m_fifo[tmpptr+1] << 8)+(state->m_fifo[tmpptr+2] << 16);
|
||||
int romoffs=m_fifo[tmpptr+0]+(m_fifo[tmpptr+1] << 8)+(m_fifo[tmpptr+2] << 16);
|
||||
|
||||
w=state->m_fifo[tmpptr+3]+1;
|
||||
h=state->m_fifo[tmpptr+4]+1;
|
||||
w=m_fifo[tmpptr+3]+1;
|
||||
h=m_fifo[tmpptr+4]+1;
|
||||
|
||||
if (state->m_fifo[tmpptr+7] == 0)
|
||||
if (m_fifo[tmpptr+7] == 0)
|
||||
{
|
||||
for (y=0; y < h; y++)
|
||||
{
|
||||
@ -186,7 +188,7 @@ static void blit_gfx(running_machine &machine)
|
||||
romdata = rom[romoffs&0x1fffff];
|
||||
if (romdata)
|
||||
{
|
||||
plot_pixel_pal(machine, state->m_fifo[tmpptr+5]+state->m_fifo[tmpptr+3]-x, state->m_fifo[tmpptr+6]+state->m_fifo[tmpptr+4]-y, romdata);
|
||||
plot_pixel_pal(m_fifo[tmpptr+5]+m_fifo[tmpptr+3]-x, m_fifo[tmpptr+6]+m_fifo[tmpptr+4]-y, romdata);
|
||||
}
|
||||
romoffs++;
|
||||
}
|
||||
@ -205,7 +207,7 @@ WRITE16_MEMBER(sliver_state::fifo_clear_w)
|
||||
|
||||
WRITE16_MEMBER(sliver_state::fifo_flush_w)
|
||||
{
|
||||
blit_gfx(machine());
|
||||
blit_gfx();
|
||||
}
|
||||
|
||||
|
||||
@ -214,13 +216,12 @@ WRITE16_MEMBER(sliver_state::jpeg1_w)
|
||||
COMBINE_DATA(&m_jpeg1);
|
||||
}
|
||||
|
||||
static void render_jpeg(running_machine &machine)
|
||||
void sliver_state::render_jpeg()
|
||||
{
|
||||
sliver_state *state = machine.driver_data<sliver_state>();
|
||||
int x;
|
||||
int addr = (int)state->m_jpeg2 + (((int)state->m_jpeg1) << 16);
|
||||
int addr = (int)m_jpeg2 + (((int)m_jpeg1) << 16);
|
||||
|
||||
state->m_bitmap_bg.fill(0);
|
||||
m_bitmap_bg.fill(0);
|
||||
if (addr < 0)
|
||||
{
|
||||
return;
|
||||
@ -237,7 +238,7 @@ static void render_jpeg(running_machine &machine)
|
||||
cinfo.err = jpeg_std_error(&jerr);
|
||||
jpeg_create_decompress(&cinfo);
|
||||
|
||||
jpeg_mem_src(&cinfo, machine.root_device().memregion("user2")->base()+addr, machine.root_device().memregion("user2")->bytes()-addr);
|
||||
jpeg_mem_src(&cinfo, machine().root_device().memregion("user2")->base()+addr, machine().root_device().memregion("user2")->bytes()-addr);
|
||||
|
||||
jpeg_read_header(&cinfo, TRUE);
|
||||
jpeg_start_decompress(&cinfo);
|
||||
@ -256,7 +257,7 @@ static void render_jpeg(running_machine &machine)
|
||||
UINT8 b = buffer[0][(x*3)];
|
||||
UINT8 g = buffer[0][(x*3)+1];
|
||||
UINT8 r = buffer[0][(x*3)+2];
|
||||
plot_pixel_rgb(state, x - x_offset + state->m_jpeg_x, y - y_offset - state->m_jpeg_y, r, g, b);
|
||||
plot_pixel_rgb(x - x_offset + m_jpeg_x, y - y_offset - m_jpeg_y, r, g, b);
|
||||
|
||||
}
|
||||
|
||||
@ -274,7 +275,7 @@ WRITE16_MEMBER(sliver_state::jpeg2_w)
|
||||
{
|
||||
COMBINE_DATA(&m_jpeg2);
|
||||
|
||||
render_jpeg(machine());
|
||||
render_jpeg();
|
||||
|
||||
}
|
||||
|
||||
@ -297,7 +298,7 @@ WRITE16_MEMBER(sliver_state::io_data_w)
|
||||
{
|
||||
m_jpeg_x = tmpx;
|
||||
m_jpeg_y = tmpy;
|
||||
render_jpeg(machine());
|
||||
render_jpeg();
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -106,6 +106,8 @@ public:
|
||||
DECLARE_DRIVER_INIT(INIT);
|
||||
virtual void video_start();
|
||||
UINT32 screen_update_srmp6(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
|
||||
void update_palette();
|
||||
UINT32 process(UINT8 b,UINT32 dst_offset);
|
||||
};
|
||||
|
||||
#define VERBOSE 0
|
||||
@ -122,18 +124,17 @@ static const gfx_layout tiles8x8_layout =
|
||||
8*64
|
||||
};
|
||||
|
||||
static void update_palette(running_machine &machine)
|
||||
void srmp6_state::update_palette()
|
||||
{
|
||||
srmp6_state *state = machine.driver_data<srmp6_state>();
|
||||
INT8 r, g ,b;
|
||||
int brg = state->m_brightness - 0x60;
|
||||
int brg = m_brightness - 0x60;
|
||||
int i;
|
||||
|
||||
for(i = 0; i < 0x800; i++)
|
||||
{
|
||||
r = state->m_generic_paletteram_16[i] >> 0 & 0x1F;
|
||||
g = state->m_generic_paletteram_16[i] >> 5 & 0x1F;
|
||||
b = state->m_generic_paletteram_16[i] >> 10 & 0x1F;
|
||||
r = m_generic_paletteram_16[i] >> 0 & 0x1F;
|
||||
g = m_generic_paletteram_16[i] >> 5 & 0x1F;
|
||||
b = m_generic_paletteram_16[i] >> 10 & 0x1F;
|
||||
|
||||
if(brg < 0) {
|
||||
r += (r * brg) >> 5;
|
||||
@ -151,7 +152,7 @@ static void update_palette(running_machine &machine)
|
||||
b += ((0x1F - b) * brg) >> 5;
|
||||
if(b > 0x1F) b = 0x1F;
|
||||
}
|
||||
palette_set_color(machine, i, MAKE_RGB(r << 3, g << 3, b << 3));
|
||||
palette_set_color(machine(), i, MAKE_RGB(r << 3, g << 3, b << 3));
|
||||
}
|
||||
}
|
||||
|
||||
@ -339,7 +340,7 @@ WRITE16_MEMBER(srmp6_state::video_regs_w)
|
||||
data = (!data)?0x60:(data == 0x5e)?0x60:data;
|
||||
if (m_brightness != data) {
|
||||
m_brightness = data;
|
||||
update_palette(machine());
|
||||
update_palette();
|
||||
}
|
||||
break;
|
||||
|
||||
@ -368,36 +369,35 @@ READ16_MEMBER(srmp6_state::video_regs_r)
|
||||
|
||||
|
||||
/* DMA RLE stuff - the same as CPS3 */
|
||||
static UINT32 process(running_machine &machine,UINT8 b,UINT32 dst_offset)
|
||||
UINT32 srmp6_state::process(UINT8 b,UINT32 dst_offset)
|
||||
{
|
||||
srmp6_state *state = machine.driver_data<srmp6_state>();
|
||||
int l=0;
|
||||
|
||||
UINT8 *tram=(UINT8*)state->m_tileram;
|
||||
UINT8 *tram=(UINT8*)m_tileram;
|
||||
|
||||
if (state->m_lastb == state->m_lastb2) //rle
|
||||
if (m_lastb == m_lastb2) //rle
|
||||
{
|
||||
int i;
|
||||
int rle=(b+1)&0xff;
|
||||
|
||||
for(i=0;i<rle;++i)
|
||||
{
|
||||
tram[dst_offset + state->m_destl] = state->m_lastb;
|
||||
machine.gfx[0]->mark_dirty((dst_offset + state->m_destl)/0x40);
|
||||
tram[dst_offset + m_destl] = m_lastb;
|
||||
machine().gfx[0]->mark_dirty((dst_offset + m_destl)/0x40);
|
||||
|
||||
dst_offset++;
|
||||
++l;
|
||||
}
|
||||
state->m_lastb2 = 0xffff;
|
||||
m_lastb2 = 0xffff;
|
||||
|
||||
return l;
|
||||
}
|
||||
else
|
||||
{
|
||||
state->m_lastb2 = state->m_lastb;
|
||||
state->m_lastb = b;
|
||||
tram[dst_offset + state->m_destl] = b;
|
||||
machine.gfx[0]->mark_dirty((dst_offset + state->m_destl)/0x40);
|
||||
m_lastb2 = m_lastb;
|
||||
m_lastb = b;
|
||||
tram[dst_offset + m_destl] = b;
|
||||
machine().gfx[0]->mark_dirty((dst_offset + m_destl)/0x40);
|
||||
|
||||
return 1;
|
||||
}
|
||||
@ -453,13 +453,13 @@ WRITE16_MEMBER(srmp6_state::srmp6_dma_w)
|
||||
{
|
||||
UINT8 real_byte;
|
||||
real_byte = rom[srctab+p*2];
|
||||
tempidx+=process(machine(),real_byte,tempidx);
|
||||
tempidx+=process(real_byte,tempidx);
|
||||
real_byte = rom[srctab+p*2+1];//px[DMA_XOR((current_table_address+p*2+1))];
|
||||
tempidx+=process(machine(),real_byte,tempidx);
|
||||
tempidx+=process(real_byte,tempidx);
|
||||
}
|
||||
else
|
||||
{
|
||||
tempidx+=process(machine(),p,tempidx);
|
||||
tempidx+=process(p,tempidx);
|
||||
}
|
||||
|
||||
ctrl<<=1;
|
||||
|
@ -258,13 +258,18 @@ public:
|
||||
required_device<cpu_device> m_maincpu;
|
||||
required_memory_region m_region_user2;
|
||||
required_ioport m_io_ps7500;
|
||||
|
||||
typedef void (ssfindo_state::*ssfindo_speedup_func)(address_space &space);
|
||||
ssfindo_speedup_func ssfindo_speedup;
|
||||
|
||||
void PS7500_startTimer0();
|
||||
void PS7500_startTimer1();
|
||||
void PS7500_reset();
|
||||
void ssfindo_speedups(address_space& space);
|
||||
void ppcar_speedups(address_space& space);
|
||||
};
|
||||
|
||||
|
||||
static void PS7500_startTimer0(running_machine &machine);
|
||||
static void PS7500_startTimer1(running_machine &machine);
|
||||
|
||||
|
||||
UINT32 ssfindo_state::screen_update_ssfindo(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
|
||||
{
|
||||
int s,x,y;
|
||||
@ -309,15 +314,14 @@ TIMER_CALLBACK_MEMBER(ssfindo_state::PS7500_Timer0_callback)
|
||||
}
|
||||
}
|
||||
|
||||
static void PS7500_startTimer0(running_machine &machine)
|
||||
void ssfindo_state::PS7500_startTimer0()
|
||||
{
|
||||
ssfindo_state *state = machine.driver_data<ssfindo_state>();
|
||||
int val=((state->m_PS7500_IO[T0low]&0xff)|((state->m_PS7500_IO[T0high]&0xff)<<8))>>1;
|
||||
int val=((m_PS7500_IO[T0low]&0xff)|((m_PS7500_IO[T0high]&0xff)<<8))>>1;
|
||||
|
||||
if(val==0)
|
||||
state->m_PS7500timer0->adjust(attotime::never);
|
||||
m_PS7500timer0->adjust(attotime::never);
|
||||
else
|
||||
state->m_PS7500timer0->adjust(attotime::from_usec(val ), 0, attotime::from_usec(val ));
|
||||
m_PS7500timer0->adjust(attotime::from_usec(val ), 0, attotime::from_usec(val ));
|
||||
}
|
||||
|
||||
TIMER_CALLBACK_MEMBER(ssfindo_state::PS7500_Timer1_callback)
|
||||
@ -329,14 +333,13 @@ TIMER_CALLBACK_MEMBER(ssfindo_state::PS7500_Timer1_callback)
|
||||
}
|
||||
}
|
||||
|
||||
static void PS7500_startTimer1(running_machine &machine)
|
||||
void ssfindo_state::PS7500_startTimer1()
|
||||
{
|
||||
ssfindo_state *state = machine.driver_data<ssfindo_state>();
|
||||
int val=((state->m_PS7500_IO[T1low]&0xff)|((state->m_PS7500_IO[T1high]&0xff)<<8))>>1;
|
||||
int val=((m_PS7500_IO[T1low]&0xff)|((m_PS7500_IO[T1high]&0xff)<<8))>>1;
|
||||
if(val==0)
|
||||
state->m_PS7500timer1->adjust(attotime::never);
|
||||
m_PS7500timer1->adjust(attotime::never);
|
||||
else
|
||||
state->m_PS7500timer1->adjust(attotime::from_usec(val ), 0, attotime::from_usec(val ));
|
||||
m_PS7500timer1->adjust(attotime::from_usec(val ), 0, attotime::from_usec(val ));
|
||||
}
|
||||
|
||||
INTERRUPT_GEN_MEMBER(ssfindo_state::ssfindo_interrupt)
|
||||
@ -348,20 +351,17 @@ INTERRUPT_GEN_MEMBER(ssfindo_state::ssfindo_interrupt)
|
||||
}
|
||||
}
|
||||
|
||||
static void PS7500_reset(running_machine &machine)
|
||||
void ssfindo_state::PS7500_reset()
|
||||
{
|
||||
ssfindo_state *state = machine.driver_data<ssfindo_state>();
|
||||
state->m_PS7500_IO[IOCR] = 0x3f;
|
||||
state->m_PS7500_IO[VIDCR] = 0;
|
||||
m_PS7500_IO[IOCR] = 0x3f;
|
||||
m_PS7500_IO[VIDCR] = 0;
|
||||
|
||||
state->m_PS7500timer0->adjust( attotime::never);
|
||||
state->m_PS7500timer1->adjust( attotime::never);
|
||||
m_PS7500timer0->adjust( attotime::never);
|
||||
m_PS7500timer1->adjust( attotime::never);
|
||||
}
|
||||
|
||||
typedef void (*ssfindo_speedup_func)(address_space &space);
|
||||
ssfindo_speedup_func ssfindo_speedup;
|
||||
|
||||
static void ssfindo_speedups(address_space& space)
|
||||
void ssfindo_state::ssfindo_speedups(address_space& space)
|
||||
{
|
||||
if (space.device().safe_pc()==0x2d6c8) // ssfindo
|
||||
space.device().execute().spin_until_time(attotime::from_usec(20));
|
||||
@ -369,7 +369,7 @@ static void ssfindo_speedups(address_space& space)
|
||||
space.device().execute().spin_until_time(attotime::from_usec(20));
|
||||
}
|
||||
|
||||
static void ppcar_speedups(address_space& space)
|
||||
void ssfindo_state::ppcar_speedups(address_space& space)
|
||||
{
|
||||
if (space.device().safe_pc()==0x000bc8) // ppcar
|
||||
space.device().execute().spin_until_time(attotime::from_usec(20));
|
||||
@ -402,7 +402,7 @@ READ32_MEMBER(ssfindo_state::PS7500_IO_r)
|
||||
return (m_PS7500_IO[IRQSTA] & m_PS7500_IO[IRQMSKA]) | 0x80;
|
||||
|
||||
case IOCR: //TODO: nINT1, OD[n] p.81
|
||||
if (ssfindo_speedup) ssfindo_speedup(space);
|
||||
if (ssfindo_speedup) (this->*ssfindo_speedup)(space);
|
||||
|
||||
if( m_iocr_hack)
|
||||
{
|
||||
@ -462,11 +462,11 @@ WRITE32_MEMBER(ssfindo_state::PS7500_IO_w)
|
||||
break;
|
||||
|
||||
case T1GO:
|
||||
PS7500_startTimer1(machine());
|
||||
PS7500_startTimer1();
|
||||
break;
|
||||
|
||||
case T0GO:
|
||||
PS7500_startTimer0(machine());
|
||||
PS7500_startTimer0();
|
||||
break;
|
||||
|
||||
case VIDEND:
|
||||
@ -621,7 +621,7 @@ ADDRESS_MAP_END
|
||||
|
||||
void ssfindo_state::machine_reset()
|
||||
{
|
||||
PS7500_reset(machine());
|
||||
PS7500_reset();
|
||||
}
|
||||
|
||||
static INPUT_PORTS_START( ssfindo )
|
||||
@ -874,7 +874,7 @@ DRIVER_INIT_MEMBER(ssfindo_state,ssfindo)
|
||||
{
|
||||
DRIVER_INIT_CALL(common);
|
||||
m_flashType=0;
|
||||
ssfindo_speedup = ssfindo_speedups;
|
||||
ssfindo_speedup = &ssfindo_state::ssfindo_speedups;
|
||||
m_iocr_hack=0;
|
||||
}
|
||||
|
||||
@ -882,7 +882,7 @@ DRIVER_INIT_MEMBER(ssfindo_state,ppcar)
|
||||
{
|
||||
DRIVER_INIT_CALL(common);
|
||||
m_flashType=1;
|
||||
ssfindo_speedup = ppcar_speedups;
|
||||
ssfindo_speedup = &ssfindo_state::ppcar_speedups;
|
||||
m_iocr_hack=0;
|
||||
}
|
||||
|
||||
|
@ -98,6 +98,7 @@ public:
|
||||
virtual void palette_init();
|
||||
UINT32 screen_update_taitowlf(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
|
||||
IRQ_CALLBACK_MEMBER(irq_callback);
|
||||
void intel82439tx_init();
|
||||
};
|
||||
|
||||
#if !ENABLE_VGA
|
||||
@ -174,15 +175,14 @@ static void mxtc_config_w(device_t *busdevice, device_t *device, int function, i
|
||||
state->m_mxtc_config_reg[reg] = data;
|
||||
}
|
||||
|
||||
static void intel82439tx_init(running_machine &machine)
|
||||
void taitowlf_state::intel82439tx_init()
|
||||
{
|
||||
taitowlf_state *state = machine.driver_data<taitowlf_state>();
|
||||
state->m_mxtc_config_reg[0x60] = 0x02;
|
||||
state->m_mxtc_config_reg[0x61] = 0x02;
|
||||
state->m_mxtc_config_reg[0x62] = 0x02;
|
||||
state->m_mxtc_config_reg[0x63] = 0x02;
|
||||
state->m_mxtc_config_reg[0x64] = 0x02;
|
||||
state->m_mxtc_config_reg[0x65] = 0x02;
|
||||
m_mxtc_config_reg[0x60] = 0x02;
|
||||
m_mxtc_config_reg[0x61] = 0x02;
|
||||
m_mxtc_config_reg[0x62] = 0x02;
|
||||
m_mxtc_config_reg[0x63] = 0x02;
|
||||
m_mxtc_config_reg[0x64] = 0x02;
|
||||
m_mxtc_config_reg[0x65] = 0x02;
|
||||
}
|
||||
|
||||
static UINT32 intel82439tx_pci_r(device_t *busdevice, device_t *device, int function, int reg, UINT32 mem_mask)
|
||||
@ -703,7 +703,7 @@ DRIVER_INIT_MEMBER(taitowlf_state,taitowlf)
|
||||
|
||||
init_pc_common(machine(), PCCOMMON_KEYBOARD_AT, taitowlf_set_keyb_int);
|
||||
|
||||
intel82439tx_init(machine());
|
||||
intel82439tx_init();
|
||||
|
||||
kbdc8042_init(machine(), &at8042);
|
||||
}
|
||||
|
@ -84,6 +84,7 @@ public:
|
||||
virtual void machine_reset();
|
||||
TIMER_CALLBACK_MEMBER(intrq_tick);
|
||||
TIMER_CALLBACK_MEMBER(ssi263_phoneme_tick);
|
||||
void check_interrupt();
|
||||
};
|
||||
|
||||
|
||||
@ -95,16 +96,15 @@ static const UINT8 led_map[16] = { 0x3f, 0x06, 0x5b, 0x4f, 0x66, 0x6d, 0x7c, 0x0
|
||||
|
||||
/* Interrupts */
|
||||
|
||||
static void check_interrupt(running_machine &machine)
|
||||
void thayers_state::check_interrupt()
|
||||
{
|
||||
thayers_state *state = machine.driver_data<thayers_state>();
|
||||
if (!state->m_timer_int || !state->m_data_rdy_int || !state->m_ssi_data_request)
|
||||
if (!m_timer_int || !m_data_rdy_int || !m_ssi_data_request)
|
||||
{
|
||||
machine.device("maincpu")->execute().set_input_line(INPUT_LINE_IRQ0, HOLD_LINE);
|
||||
machine().device("maincpu")->execute().set_input_line(INPUT_LINE_IRQ0, HOLD_LINE);
|
||||
}
|
||||
else
|
||||
{
|
||||
machine.device("maincpu")->execute().set_input_line(INPUT_LINE_IRQ0, CLEAR_LINE);
|
||||
machine().device("maincpu")->execute().set_input_line(INPUT_LINE_IRQ0, CLEAR_LINE);
|
||||
}
|
||||
}
|
||||
|
||||
@ -146,14 +146,14 @@ WRITE8_MEMBER(thayers_state::timer_int_ack_w)
|
||||
{
|
||||
m_timer_int = 1;
|
||||
|
||||
check_interrupt(machine());
|
||||
check_interrupt();
|
||||
}
|
||||
|
||||
WRITE8_MEMBER(thayers_state::data_rdy_int_ack_w)
|
||||
{
|
||||
m_data_rdy_int = 1;
|
||||
|
||||
check_interrupt(machine());
|
||||
check_interrupt();
|
||||
}
|
||||
|
||||
WRITE8_MEMBER(thayers_state::cop_d_w)
|
||||
@ -179,7 +179,7 @@ WRITE8_MEMBER(thayers_state::cop_d_w)
|
||||
m_data_rdy_int = 0;
|
||||
}
|
||||
|
||||
check_interrupt(machine());
|
||||
check_interrupt();
|
||||
}
|
||||
|
||||
/* COP Communication */
|
||||
@ -475,7 +475,7 @@ static const char SSI263_PHONEMES[0x40][5] =
|
||||
TIMER_CALLBACK_MEMBER(thayers_state::ssi263_phoneme_tick)
|
||||
{
|
||||
m_ssi_data_request = 0;
|
||||
check_interrupt(machine());
|
||||
check_interrupt();
|
||||
}
|
||||
|
||||
WRITE8_MEMBER(thayers_state::ssi263_register_w)
|
||||
@ -493,7 +493,7 @@ WRITE8_MEMBER(thayers_state::ssi263_register_w)
|
||||
ssi263.p = data & 0x3f;
|
||||
|
||||
m_ssi_data_request = 1;
|
||||
check_interrupt(machine());
|
||||
check_interrupt();
|
||||
|
||||
switch (ssi263.mode)
|
||||
{
|
||||
|
@ -70,6 +70,7 @@ public:
|
||||
virtual void machine_start();
|
||||
virtual void machine_reset();
|
||||
IRQ_CALLBACK_MEMBER(irq_callback);
|
||||
void intel82439tx_init();
|
||||
};
|
||||
|
||||
|
||||
@ -263,15 +264,14 @@ static void mxtc_config_w(device_t *busdevice, device_t *device, int function, i
|
||||
state->m_mxtc_config_reg[reg] = data;
|
||||
}
|
||||
|
||||
static void intel82439tx_init(running_machine &machine)
|
||||
void voyager_state::intel82439tx_init()
|
||||
{
|
||||
voyager_state *state = machine.driver_data<voyager_state>();
|
||||
state->m_mxtc_config_reg[0x60] = 0x02;
|
||||
state->m_mxtc_config_reg[0x61] = 0x02;
|
||||
state->m_mxtc_config_reg[0x62] = 0x02;
|
||||
state->m_mxtc_config_reg[0x63] = 0x02;
|
||||
state->m_mxtc_config_reg[0x64] = 0x02;
|
||||
state->m_mxtc_config_reg[0x65] = 0x02;
|
||||
m_mxtc_config_reg[0x60] = 0x02;
|
||||
m_mxtc_config_reg[0x61] = 0x02;
|
||||
m_mxtc_config_reg[0x62] = 0x02;
|
||||
m_mxtc_config_reg[0x63] = 0x02;
|
||||
m_mxtc_config_reg[0x64] = 0x02;
|
||||
m_mxtc_config_reg[0x65] = 0x02;
|
||||
}
|
||||
|
||||
static UINT32 intel82439tx_pci_r(device_t *busdevice, device_t *device, int function, int reg, UINT32 mem_mask)
|
||||
@ -788,7 +788,7 @@ DRIVER_INIT_MEMBER(voyager_state,voyager)
|
||||
|
||||
init_pc_common(machine(), PCCOMMON_KEYBOARD_AT, voyager_set_keyb_int);
|
||||
|
||||
intel82439tx_init(machine());
|
||||
intel82439tx_init();
|
||||
|
||||
kbdc8042_init(machine(), &at8042);
|
||||
}
|
||||
|
@ -116,6 +116,7 @@ public:
|
||||
virtual void machine_start();
|
||||
virtual void machine_reset();
|
||||
IRQ_CALLBACK_MEMBER(irq_callback);
|
||||
void intel82439tx_init();
|
||||
};
|
||||
|
||||
// Intel 82439TX System Controller (MXTC)
|
||||
@ -210,15 +211,14 @@ static void mxtc_config_w(device_t *busdevice, device_t *device, int function, i
|
||||
state->m_mxtc_config_reg[reg] = data;
|
||||
}
|
||||
|
||||
static void intel82439tx_init(running_machine &machine)
|
||||
void xtom3d_state::intel82439tx_init()
|
||||
{
|
||||
xtom3d_state *state = machine.driver_data<xtom3d_state>();
|
||||
state->m_mxtc_config_reg[0x60] = 0x02;
|
||||
state->m_mxtc_config_reg[0x61] = 0x02;
|
||||
state->m_mxtc_config_reg[0x62] = 0x02;
|
||||
state->m_mxtc_config_reg[0x63] = 0x02;
|
||||
state->m_mxtc_config_reg[0x64] = 0x02;
|
||||
state->m_mxtc_config_reg[0x65] = 0x02;
|
||||
m_mxtc_config_reg[0x60] = 0x02;
|
||||
m_mxtc_config_reg[0x61] = 0x02;
|
||||
m_mxtc_config_reg[0x62] = 0x02;
|
||||
m_mxtc_config_reg[0x63] = 0x02;
|
||||
m_mxtc_config_reg[0x64] = 0x02;
|
||||
m_mxtc_config_reg[0x65] = 0x02;
|
||||
}
|
||||
|
||||
static UINT32 intel82439tx_pci_r(device_t *busdevice, device_t *device, int function, int reg, UINT32 mem_mask)
|
||||
@ -654,7 +654,7 @@ void xtom3d_state::machine_start()
|
||||
init_pc_common(machine(), PCCOMMON_KEYBOARD_AT, xtom3d_set_keyb_int);
|
||||
|
||||
m_maincpu->set_irq_acknowledge_callback(device_irq_acknowledge_delegate(FUNC(xtom3d_state::irq_callback),this));
|
||||
intel82439tx_init(machine());
|
||||
intel82439tx_init();
|
||||
|
||||
kbdc8042_init(machine(), &at8042);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user