Merge pull request #4984 from cam900/taitoair_args

taitoair.cpp : Updates
This commit is contained in:
R. Belmont 2019-05-08 09:53:04 -04:00 committed by GitHub
commit 3625c9ca0a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 221 additions and 241 deletions

View File

@ -209,7 +209,7 @@ perhaps? The two writes seem to take only two values.
MEMORY handlers MEMORY handlers
***********************************************************/ ***********************************************************/
WRITE16_MEMBER(taitoair_state::system_control_w) void taitoair_state::system_control_w(offs_t offset, u16 data, u16 mem_mask)
{ {
if ((ACCESSING_BITS_0_7 == 0) && ACCESSING_BITS_8_15) if ((ACCESSING_BITS_0_7 == 0) && ACCESSING_BITS_8_15)
data >>= 8; data >>= 8;
@ -222,32 +222,32 @@ WRITE16_MEMBER(taitoair_state::system_control_w)
logerror("68K:%06x writing %04x to TMS32025. %s HOLD , %s RESET\n", m_maincpu->pcbase(), data, ((data & 4) ? "Clear" : "Assert"), ((data & 1) ? "Clear" : "Assert")); logerror("68K:%06x writing %04x to TMS32025. %s HOLD , %s RESET\n", m_maincpu->pcbase(), data, ((data & 4) ? "Clear" : "Assert"), ((data & 1) ? "Clear" : "Assert"));
} }
READ16_MEMBER(taitoair_state::lineram_r) u16 taitoair_state::lineram_r(offs_t offset)
{ {
return m_line_ram[offset]; return m_line_ram[offset];
} }
WRITE16_MEMBER(taitoair_state::lineram_w) void taitoair_state::lineram_w(offs_t offset, u16 data, u16 mem_mask)
{ {
if (ACCESSING_BITS_8_15 && ACCESSING_BITS_0_7) if (ACCESSING_BITS_8_15 && ACCESSING_BITS_0_7)
m_line_ram[offset] = data; m_line_ram[offset] = data;
//if(offset == 0x3fff) //if (offset == 0x3fff)
// printf("LineRAM go %d\n",(int)m_screen->frame_number()); // printf("LineRAM go %d\n",(int)m_screen->frame_number());
} }
READ16_MEMBER(taitoair_state::dspram_r) u16 taitoair_state::dspram_r(offs_t offset)
{ {
return m_dsp_ram[offset]; return m_dsp_ram[offset];
} }
WRITE16_MEMBER(taitoair_state::dspram_w) void taitoair_state::dspram_w(offs_t offset, u16 data, u16 mem_mask)
{ {
if (ACCESSING_BITS_8_15 && ACCESSING_BITS_0_7) if (ACCESSING_BITS_8_15 && ACCESSING_BITS_0_7)
m_dsp_ram[offset] = data; m_dsp_ram[offset] = data;
} }
READ16_MEMBER(taitoair_state::dsp_HOLD_signal_r) u16 taitoair_state::dsp_HOLD_signal_r()
{ {
/* HOLD signal is active low */ /* HOLD signal is active low */
// logerror("TMS32025:%04x Reading %01x level from HOLD signal\n", m_dsp->pcbase(), m_dsp_hold_signal); // logerror("TMS32025:%04x Reading %01x level from HOLD signal\n", m_dsp->pcbase(), m_dsp_hold_signal);
@ -255,43 +255,39 @@ READ16_MEMBER(taitoair_state::dsp_HOLD_signal_r)
return m_dsp_hold_signal; return m_dsp_hold_signal;
} }
WRITE16_MEMBER(taitoair_state::dsp_HOLDA_signal_w) void taitoair_state::dsp_HOLDA_signal_w(offs_t offset, u16 data)
{ {
if (offset) if (offset)
logerror("TMS32025:%04x Writing %01x level to HOLD-Acknowledge signal\n", m_dsp->pcbase(), data); logerror("TMS32025:%04x Writing %01x level to HOLD-Acknowledge signal\n", m_dsp->pcbase(), data);
} }
WRITE16_MEMBER(taitoair_state::airsys_paletteram16_w)/* xxBBBBxRRRRxGGGG */ void taitoair_state::paletteram_w(offs_t offset, u16 data, u16 mem_mask)/* xxBBBBxRRRRxGGGG */
{ {
int a;
COMBINE_DATA(&m_paletteram[offset]); COMBINE_DATA(&m_paletteram[offset]);
a = m_paletteram[offset]; const u16 a = m_paletteram[offset];
m_palette->set_pen_color(offset, pal4bit(a >> 0), pal4bit(a >> 5), pal4bit(a >> 10)); m_palette->set_pen_color(offset, pal4bit(a >> 0), pal4bit(a >> 5), pal4bit(a >> 10));
} }
WRITE16_MEMBER(taitoair_state::airsys_gradram_w) void taitoair_state::gradram_w(offs_t offset, u16 data, u16 mem_mask)
{ {
uint32_t pen;
int r,g,b;
//int pal_r,pal_g,pal_b; //int pal_r,pal_g,pal_b;
COMBINE_DATA(&m_gradram[offset]); COMBINE_DATA(&m_gradram[offset]);
offset &= 0x1fff; offset &= 0x1fff;
pen = (m_gradram[offset])|(m_gradram[(offset+0x2000)]<<16); const u32 pen = (m_gradram[offset]) | (m_gradram[(offset + 0x2000)] << 16);
/* TODO: correct? */ /* TODO: correct? */
r = (pen & 0x00007f) >> 0; u8 r = (pen & 0x00007f) >> 0;
g = (pen & 0x007f00) >> (8); u8 g = (pen & 0x007f00) >> (8);
b = (pen & 0x7f0000) >> (16); u8 b = (pen & 0x7f0000) >> (16);
r = (r << 1) | (r & 1); r = (r << 1) | (r & 1);
g = (g << 1) | (g & 1); g = (g << 1) | (g & 1);
b = (b << 1) | (b & 1); b = (b << 1) | (b & 1);
m_palette->set_pen_color(offset+0x2000, r, g, b); m_palette->set_pen_color(offset + 0x2000, r, g, b);
} }
@ -301,7 +297,7 @@ WRITE16_MEMBER(taitoair_state::airsys_gradram_w)
READ16_MEMBER(taitoair_state::stick_input_r) READ16_MEMBER(taitoair_state::stick_input_r)
{ {
switch( offset ) switch (offset)
{ {
case 0x00: /* "counter 1" lo */ case 0x00: /* "counter 1" lo */
return m_yoke->throttle_r(space,0) & 0xff; return m_yoke->throttle_r(space,0) & 0xff;
@ -321,7 +317,7 @@ READ16_MEMBER(taitoair_state::stick_input_r)
READ16_MEMBER(taitoair_state::stick2_input_r) READ16_MEMBER(taitoair_state::stick2_input_r)
{ {
switch( offset ) switch (offset)
{ {
case 0x00: /* "counter 3" lo */ case 0x00: /* "counter 3" lo */
return m_yoke->sticky_r(space,0); return m_yoke->sticky_r(space,0);
@ -333,9 +329,9 @@ READ16_MEMBER(taitoair_state::stick2_input_r)
return 0; return 0;
} }
WRITE8_MEMBER(taitoair_state::sound_bankswitch_w) void taitoair_state::sound_bankswitch_w(u8 data)
{ {
membank("z80bank")->set_entry(data & 3); m_z80bank->set_entry(data & 3);
} }
/*! /*!
@ -348,17 +344,17 @@ WRITE8_MEMBER(taitoair_state::sound_bankswitch_w)
[2] (unused) [2] (unused)
[3] both games uses 0xb7, most likely a register setting. [3] both games uses 0xb7, most likely a register setting.
*/ */
WRITE16_MEMBER(taitoair_state::dma_regs_w) void taitoair_state::dma_regs_w(offs_t offset, u16 data, u16 mem_mask)
{ {
printf("%08x %04x\n",offset,data); printf("%08x %04x\n",offset,data);
if(offset == 0 && ACCESSING_BITS_8_15) if (offset == 0 && ACCESSING_BITS_8_15)
{ {
if(data == 0x1fff) if (data == 0x1fff)
{ {
fb_erase_op(); fb_erase_op();
} }
else if(data & 0x8000) else if (data & 0x8000)
{ {
/*! @todo it also flushes current palette. */ /*! @todo it also flushes current palette. */
fb_copy_op(); fb_copy_op();
@ -366,7 +362,7 @@ WRITE16_MEMBER(taitoair_state::dma_regs_w)
} }
} }
WRITE8_MEMBER(taitoair_state::coin_control_w) void taitoair_state::coin_control_w(u8 data)
{ {
machine().bookkeeping().coin_lockout_w(0, ~data & 0x01); machine().bookkeeping().coin_lockout_w(0, ~data & 0x01);
machine().bookkeeping().coin_lockout_w(1, ~data & 0x02); machine().bookkeeping().coin_lockout_w(1, ~data & 0x02);
@ -383,8 +379,8 @@ void taitoair_state::airsys_map(address_map &map)
map(0x000000, 0x0bffff).rom(); map(0x000000, 0x0bffff).rom();
map(0x0c0000, 0x0cffff).ram().share("m68000_mainram"); map(0x0c0000, 0x0cffff).ram().share("m68000_mainram");
map(0x140000, 0x140001).w(FUNC(taitoair_state::system_control_w)); /* Pause the TMS32025 */ map(0x140000, 0x140001).w(FUNC(taitoair_state::system_control_w)); /* Pause the TMS32025 */
map(0x180000, 0x187fff).ram().w(FUNC(taitoair_state::airsys_gradram_w)).share("gradram"); /* "gradiation ram (0/1)" */ map(0x180000, 0x187fff).ram().w(FUNC(taitoair_state::gradram_w)).share("gradram"); /* "gradiation ram (0/1)" */
map(0x188000, 0x189fff).mirror(0x2000).ram().w(FUNC(taitoair_state::airsys_paletteram16_w)).share("paletteram"); map(0x188000, 0x189fff).mirror(0x2000).ram().w(FUNC(taitoair_state::paletteram_w)).share("paletteram");
map(0x800000, 0x820fff).rw(m_tc0080vco, FUNC(tc0080vco_device::word_r), FUNC(tc0080vco_device::word_w)); /* tilemaps, sprites */ map(0x800000, 0x820fff).rw(m_tc0080vco, FUNC(tc0080vco_device::word_r), FUNC(tc0080vco_device::word_w)); /* tilemaps, sprites */
map(0x906000, 0x906007).w(FUNC(taitoair_state::dma_regs_w)); // DMA? map(0x906000, 0x906007).w(FUNC(taitoair_state::dma_regs_w)); // DMA?
map(0x908000, 0x90ffff).ram().share("line_ram"); /* "line ram" */ map(0x908000, 0x90ffff).ram().share("line_ram"); /* "line ram" */
@ -418,38 +414,38 @@ void taitoair_state::sound_map(address_map &map)
/********************************** TMS32025 ********************************/ /********************************** TMS32025 ********************************/
WRITE16_MEMBER(taitoair_state::dsp_test_start_w) void taitoair_state::dsp_test_start_w(u16 data)
{ {
m_dsp_test_object_type = data; m_dsp_test_object_type = data;
m_dsp_test_or_clip = 0; m_dsp_test_or_clip = 0;
m_dsp_test_and_clip = 0xf; m_dsp_test_and_clip = 0xf;
} }
WRITE16_MEMBER(taitoair_state::dsp_test_x_w) void taitoair_state::dsp_test_x_w(u16 data)
{ {
m_dsp_test_x = data; m_dsp_test_x = data;
} }
WRITE16_MEMBER(taitoair_state::dsp_test_y_w) void taitoair_state::dsp_test_y_w(u16 data)
{ {
m_dsp_test_y = data; m_dsp_test_y = data;
} }
WRITE16_MEMBER(taitoair_state::dsp_test_z_w) void taitoair_state::dsp_test_z_w(u16 data)
{ {
m_dsp_test_z = data; m_dsp_test_z = data;
} }
READ16_MEMBER(taitoair_state::dsp_test_point_r) u16 taitoair_state::dsp_test_point_r()
{ {
uint16_t r = 0; u16 r = 0;
if(m_dsp_test_x < -m_dsp_test_z) if (m_dsp_test_x < -m_dsp_test_z)
r |= 1; r |= 1;
if(m_dsp_test_x > m_dsp_test_z) if (m_dsp_test_x > m_dsp_test_z)
r |= 2; r |= 2;
if(m_dsp_test_y < -m_dsp_test_z) if (m_dsp_test_y < -m_dsp_test_z)
r |= 4; r |= 4;
if(m_dsp_test_y > m_dsp_test_z) if (m_dsp_test_y > m_dsp_test_z)
r |= 8; r |= 8;
m_dsp_test_or_clip |= r; m_dsp_test_or_clip |= r;
@ -457,60 +453,60 @@ READ16_MEMBER(taitoair_state::dsp_test_point_r)
return r; return r;
} }
READ16_MEMBER(taitoair_state::dsp_test_or_clip_r) u16 taitoair_state::dsp_test_or_clip_r()
{ {
return m_dsp_test_or_clip; return m_dsp_test_or_clip;
} }
READ16_MEMBER(taitoair_state::dsp_test_and_clip_r) u16 taitoair_state::dsp_test_and_clip_r()
{ {
return m_dsp_test_and_clip; return m_dsp_test_and_clip;
} }
WRITE16_MEMBER(taitoair_state::dsp_muldiv_a_1_w) void taitoair_state::dsp_muldiv_a_1_w(u16 data)
{ {
m_dsp_muldiv_a_1 = data; m_dsp_muldiv_a_1 = data;
} }
WRITE16_MEMBER(taitoair_state::dsp_muldiv_b_1_w) void taitoair_state::dsp_muldiv_b_1_w(u16 data)
{ {
m_dsp_muldiv_b_1 = data; m_dsp_muldiv_b_1 = data;
} }
WRITE16_MEMBER(taitoair_state::dsp_muldiv_c_1_w) void taitoair_state::dsp_muldiv_c_1_w(u16 data)
{ {
m_dsp_muldiv_c_1 = data; m_dsp_muldiv_c_1 = data;
} }
READ16_MEMBER(taitoair_state::dsp_muldiv_1_r) u16 taitoair_state::dsp_muldiv_1_r()
{ {
if(m_dsp_muldiv_c_1 == 0) if (m_dsp_muldiv_c_1 == 0)
return 0xffff; /**< @todo true value? */ return 0xffff; /**< @todo true value? */
return m_dsp_muldiv_a_1*m_dsp_muldiv_b_1/m_dsp_muldiv_c_1; return m_dsp_muldiv_a_1 * m_dsp_muldiv_b_1 / m_dsp_muldiv_c_1;
} }
WRITE16_MEMBER(taitoair_state::dsp_muldiv_a_2_w) void taitoair_state::dsp_muldiv_a_2_w(u16 data)
{ {
m_dsp_muldiv_a_2 = data; m_dsp_muldiv_a_2 = data;
} }
WRITE16_MEMBER(taitoair_state::dsp_muldiv_b_2_w) void taitoair_state::dsp_muldiv_b_2_w(u16 data)
{ {
m_dsp_muldiv_b_2 = data; m_dsp_muldiv_b_2 = data;
} }
WRITE16_MEMBER(taitoair_state::dsp_muldiv_c_2_w) void taitoair_state::dsp_muldiv_c_2_w(u16 data)
{ {
m_dsp_muldiv_c_2 = data; m_dsp_muldiv_c_2 = data;
} }
READ16_MEMBER(taitoair_state::dsp_muldiv_2_r) u16 taitoair_state::dsp_muldiv_2_r()
{ {
if(m_dsp_muldiv_c_2 == 0) if (m_dsp_muldiv_c_2 == 0)
return 0xffff; /**< @todo true value? */ return 0xffff; /**< @todo true value? */
return m_dsp_muldiv_a_2*m_dsp_muldiv_b_2/m_dsp_muldiv_c_2; return m_dsp_muldiv_a_2 * m_dsp_muldiv_b_2 / m_dsp_muldiv_c_2;
} }
@ -653,16 +649,12 @@ INPUT_PORTS_END
static const gfx_layout tilelayout = static const gfx_layout tilelayout =
{ {
16,16, /* 16x16 pixels */ 16,16, /* 16x16 pixels */
RGN_FRAC(1,4), RGN_FRAC(1,1),
4, 4,
{ 0, 1, 2, 3 }, { STEP4(0, 1) },
{ 4, 0, 12, 8, { STEP16(15*4, -4) },
RGN_FRAC(1,4)+4, RGN_FRAC(1,4), RGN_FRAC(1,4)+12, RGN_FRAC(1,4)+8, { STEP16(0, 16*4) },
RGN_FRAC(2,4)+4, RGN_FRAC(2,4), RGN_FRAC(2,4)+12, RGN_FRAC(2,4)+8, 16*16*4
RGN_FRAC(3,4)+4, RGN_FRAC(3,4), RGN_FRAC(3,4)+12, RGN_FRAC(3,4)+8 },
{ 0*16, 1*16, 2*16, 3*16, 4*16, 5*16, 6*16, 7*16,
8*16, 9*16, 10*16, 11*16, 12*16, 13*16, 14*16, 15*16 },
16*16
}; };
static GFXDECODE_START( gfx_airsys ) static GFXDECODE_START( gfx_airsys )
@ -676,7 +668,7 @@ GFXDECODE_END
void taitoair_state::machine_start() void taitoair_state::machine_start()
{ {
membank("z80bank")->configure_entries(0, 4, memregion("audiocpu")->base(), 0x4000); m_z80bank->configure_entries(0, 4, memregion("audiocpu")->base(), 0x4000);
save_item(NAME(m_q.header)); save_item(NAME(m_q.header));
save_item(NAME(m_q.pcount)); save_item(NAME(m_q.pcount));
@ -690,11 +682,9 @@ void taitoair_state::machine_start()
void taitoair_state::machine_reset() void taitoair_state::machine_reset()
{ {
int i;
m_dsp_hold_signal = ASSERT_LINE; m_dsp_hold_signal = ASSERT_LINE;
for (i = 0; i < TAITOAIR_POLY_MAX_PT; i++) for (int i = 0; i < TAITOAIR_POLY_MAX_PT; i++)
{ {
m_q.p[i].x = 0; m_q.p[i].x = 0;
m_q.p[i].y = 0; m_q.p[i].y = 0;
@ -737,7 +727,7 @@ void taitoair_state::airsys(machine_config &config)
// m_screen->set_visarea(0*16, 32*16-1, 3*16, 28*16-1); // m_screen->set_visarea(0*16, 32*16-1, 3*16, 28*16-1);
// Estimated, assume same as mlanding.cpp // Estimated, assume same as mlanding.cpp
m_screen->set_raw(16000000, 640, 0, 512, 462, 3*16, 28*16); m_screen->set_raw(16000000, 640, 0, 512, 462, 3*16, 28*16);
m_screen->set_screen_update(FUNC(taitoair_state::screen_update_taitoair)); m_screen->set_screen_update(FUNC(taitoair_state::screen_update));
m_screen->set_palette(m_palette); m_screen->set_palette(m_palette);
GFXDECODE(config, m_gfxdecode, m_palette, gfx_airsys); GFXDECODE(config, m_gfxdecode, m_palette, gfx_airsys);
@ -809,14 +799,14 @@ ROM_START( topland )
ROM_LOAD( "b62_mecha.rom", 0x00000, 0x08000, NO_DUMP ) ROM_LOAD( "b62_mecha.rom", 0x00000, 0x08000, NO_DUMP )
ROM_REGION( 0x100000, "gfx1", 0 ) /* 16x16 tiles */ ROM_REGION( 0x100000, "gfx1", 0 ) /* 16x16 tiles */
ROM_LOAD16_BYTE( "b62-33.39", 0x000000, 0x20000, CRC(38786867) SHA1(7292e3fa69cad6494f2e8e7efa9c3f989bdf958d) ) ROM_LOAD64_BYTE( "b62-33.39", 0x000007, 0x20000, CRC(38786867) SHA1(7292e3fa69cad6494f2e8e7efa9c3f989bdf958d) )
ROM_LOAD16_BYTE( "b62-36.48", 0x000001, 0x20000, CRC(4259e76a) SHA1(eb0dc5d0a6f875e3b8335fb30d4c2ad3880c31b9) ) ROM_LOAD64_BYTE( "b62-36.48", 0x000006, 0x20000, CRC(4259e76a) SHA1(eb0dc5d0a6f875e3b8335fb30d4c2ad3880c31b9) )
ROM_LOAD16_BYTE( "b62-29.27", 0x040000, 0x20000, CRC(efdd5c51) SHA1(6df3e9782946cf6f4a21ee3d335548c53cd21e3a) ) ROM_LOAD64_BYTE( "b62-29.27", 0x000005, 0x20000, CRC(efdd5c51) SHA1(6df3e9782946cf6f4a21ee3d335548c53cd21e3a) )
ROM_LOAD16_BYTE( "b62-34.40", 0x040001, 0x20000, CRC(a7e10ca4) SHA1(862c23c095f96f9e0cae00d70947782d5f4e45e6) ) ROM_LOAD64_BYTE( "b62-34.40", 0x000004, 0x20000, CRC(a7e10ca4) SHA1(862c23c095f96f9e0cae00d70947782d5f4e45e6) )
ROM_LOAD16_BYTE( "b62-35.47", 0x080000, 0x20000, CRC(cba7bac5) SHA1(5305c84abcbcc23281744454803b849853b26632) ) ROM_LOAD64_BYTE( "b62-35.47", 0x000003, 0x20000, CRC(cba7bac5) SHA1(5305c84abcbcc23281744454803b849853b26632) )
ROM_LOAD16_BYTE( "b62-30.28", 0x080001, 0x20000, CRC(30e37cb8) SHA1(6bc777bdf1a56952dbfbe2f595279a43e2fa98fd) ) ROM_LOAD64_BYTE( "b62-30.28", 0x000002, 0x20000, CRC(30e37cb8) SHA1(6bc777bdf1a56952dbfbe2f595279a43e2fa98fd) )
ROM_LOAD16_BYTE( "b62-31.29", 0x0c0000, 0x20000, CRC(3feebfe3) SHA1(5b014d7d6fa1daf400ac1a437f551281debfdba6) ) ROM_LOAD64_BYTE( "b62-31.29", 0x000001, 0x20000, CRC(3feebfe3) SHA1(5b014d7d6fa1daf400ac1a437f551281debfdba6) )
ROM_LOAD16_BYTE( "b62-32.30", 0x0c0001, 0x20000, CRC(66806646) SHA1(d8e0c37b5227d8583d523164ffc6828b4508d5a3) ) ROM_LOAD64_BYTE( "b62-32.30", 0x000000, 0x20000, CRC(66806646) SHA1(d8e0c37b5227d8583d523164ffc6828b4508d5a3) )
ROM_REGION( 0xa0000, "ymsnd", 0 ) /* ADPCM samples */ ROM_REGION( 0xa0000, "ymsnd", 0 ) /* ADPCM samples */
ROM_LOAD( "b62-17.5", 0x00000, 0x20000, CRC(36447066) SHA1(91c8cc4e99534b2d533895a342abb22766a20090) ) ROM_LOAD( "b62-17.5", 0x00000, 0x20000, CRC(36447066) SHA1(91c8cc4e99534b2d533895a342abb22766a20090) )
@ -858,14 +848,14 @@ ROM_START( toplandj )
ROM_LOAD( "b62_mecha.rom", 0x00000, 0x08000, NO_DUMP ) ROM_LOAD( "b62_mecha.rom", 0x00000, 0x08000, NO_DUMP )
ROM_REGION( 0x100000, "gfx1", 0 ) /* 16x16 tiles */ ROM_REGION( 0x100000, "gfx1", 0 ) /* 16x16 tiles */
ROM_LOAD16_BYTE( "b62-33.39", 0x000000, 0x20000, CRC(38786867) SHA1(7292e3fa69cad6494f2e8e7efa9c3f989bdf958d) ) ROM_LOAD64_BYTE( "b62-33.39", 0x000007, 0x20000, CRC(38786867) SHA1(7292e3fa69cad6494f2e8e7efa9c3f989bdf958d) )
ROM_LOAD16_BYTE( "b62-36.48", 0x000001, 0x20000, CRC(4259e76a) SHA1(eb0dc5d0a6f875e3b8335fb30d4c2ad3880c31b9) ) ROM_LOAD64_BYTE( "b62-36.48", 0x000006, 0x20000, CRC(4259e76a) SHA1(eb0dc5d0a6f875e3b8335fb30d4c2ad3880c31b9) )
ROM_LOAD16_BYTE( "b62-29.27", 0x040000, 0x20000, CRC(efdd5c51) SHA1(6df3e9782946cf6f4a21ee3d335548c53cd21e3a) ) ROM_LOAD64_BYTE( "b62-29.27", 0x000005, 0x20000, CRC(efdd5c51) SHA1(6df3e9782946cf6f4a21ee3d335548c53cd21e3a) )
ROM_LOAD16_BYTE( "b62-34.40", 0x040001, 0x20000, CRC(a7e10ca4) SHA1(862c23c095f96f9e0cae00d70947782d5f4e45e6) ) ROM_LOAD64_BYTE( "b62-34.40", 0x000004, 0x20000, CRC(a7e10ca4) SHA1(862c23c095f96f9e0cae00d70947782d5f4e45e6) )
ROM_LOAD16_BYTE( "b62-35.47", 0x080000, 0x20000, CRC(cba7bac5) SHA1(5305c84abcbcc23281744454803b849853b26632) ) ROM_LOAD64_BYTE( "b62-35.47", 0x000003, 0x20000, CRC(cba7bac5) SHA1(5305c84abcbcc23281744454803b849853b26632) )
ROM_LOAD16_BYTE( "b62-30.28", 0x080001, 0x20000, CRC(30e37cb8) SHA1(6bc777bdf1a56952dbfbe2f595279a43e2fa98fd) ) ROM_LOAD64_BYTE( "b62-30.28", 0x000002, 0x20000, CRC(30e37cb8) SHA1(6bc777bdf1a56952dbfbe2f595279a43e2fa98fd) )
ROM_LOAD16_BYTE( "b62-31.29", 0x0c0000, 0x20000, CRC(3feebfe3) SHA1(5b014d7d6fa1daf400ac1a437f551281debfdba6) ) ROM_LOAD64_BYTE( "b62-31.29", 0x000001, 0x20000, CRC(3feebfe3) SHA1(5b014d7d6fa1daf400ac1a437f551281debfdba6) )
ROM_LOAD16_BYTE( "b62-32.30", 0x0c0001, 0x20000, CRC(66806646) SHA1(d8e0c37b5227d8583d523164ffc6828b4508d5a3) ) ROM_LOAD64_BYTE( "b62-32.30", 0x000000, 0x20000, CRC(66806646) SHA1(d8e0c37b5227d8583d523164ffc6828b4508d5a3) )
ROM_REGION( 0xa0000, "ymsnd", 0 ) /* ADPCM samples */ ROM_REGION( 0xa0000, "ymsnd", 0 ) /* ADPCM samples */
ROM_LOAD( "b62-17.5", 0x00000, 0x20000, CRC(36447066) SHA1(91c8cc4e99534b2d533895a342abb22766a20090) ) ROM_LOAD( "b62-17.5", 0x00000, 0x20000, CRC(36447066) SHA1(91c8cc4e99534b2d533895a342abb22766a20090) )
@ -908,14 +898,14 @@ ROM_START( ainferno )
ROM_LOAD( "c45-30.9", 0x00000, 0x10000, CRC(fa2db40f) SHA1(91c34a53d2fec619f2536ca79fdc6a17fb0d21e4) ) // 27c512, 1111xxxxxxxxxxxx = 0xFF ROM_LOAD( "c45-30.9", 0x00000, 0x10000, CRC(fa2db40f) SHA1(91c34a53d2fec619f2536ca79fdc6a17fb0d21e4) ) // 27c512, 1111xxxxxxxxxxxx = 0xFF
ROM_REGION( 0x100000, "gfx1", 0 ) /* 16x16 tiles */ ROM_REGION( 0x100000, "gfx1", 0 ) /* 16x16 tiles */
ROM_LOAD16_BYTE( "c45-11.28", 0x000000, 0x20000, CRC(d9b4b77c) SHA1(69d570efa8146fb0a712ff45e77bda6fd85769f8) ) ROM_LOAD64_BYTE( "c45-11.28", 0x000007, 0x20000, CRC(d9b4b77c) SHA1(69d570efa8146fb0a712ff45e77bda6fd85769f8) )
ROM_LOAD16_BYTE( "c45-15.40", 0x000001, 0x20000, CRC(d4610698) SHA1(5de519a23300d5b3b09ce7cf8c02a1a6b2fb985c) ) ROM_LOAD64_BYTE( "c45-15.40", 0x000006, 0x20000, CRC(d4610698) SHA1(5de519a23300d5b3b09ce7cf8c02a1a6b2fb985c) )
ROM_LOAD16_BYTE( "c45-12.29", 0x040000, 0x20000, CRC(4ae305b8) SHA1(2bbb981853a7abbba90afb8eb58f6869357551d3) ) ROM_LOAD64_BYTE( "c45-12.29", 0x000005, 0x20000, CRC(4ae305b8) SHA1(2bbb981853a7abbba90afb8eb58f6869357551d3) )
ROM_LOAD16_BYTE( "c45-16.41", 0x040001, 0x20000, CRC(c6eb93b0) SHA1(d0b1adfce5c1f4e21c5d84527d22ace14578f2d7) ) ROM_LOAD64_BYTE( "c45-16.41", 0x000004, 0x20000, CRC(c6eb93b0) SHA1(d0b1adfce5c1f4e21c5d84527d22ace14578f2d7) )
ROM_LOAD16_BYTE( "c45-13.30", 0x080000, 0x20000, CRC(69b82af6) SHA1(13c035e84affa59734c6dd1b07963c08654b5f5a) ) ROM_LOAD64_BYTE( "c45-13.30", 0x000003, 0x20000, CRC(69b82af6) SHA1(13c035e84affa59734c6dd1b07963c08654b5f5a) )
ROM_LOAD16_BYTE( "c45-17.42", 0x080001, 0x20000, CRC(0dbee000) SHA1(41073d5cf20df12d5ba1c424c9d9f0b2d9836d5d) ) ROM_LOAD64_BYTE( "c45-17.42", 0x000002, 0x20000, CRC(0dbee000) SHA1(41073d5cf20df12d5ba1c424c9d9f0b2d9836d5d) )
ROM_LOAD16_BYTE( "c45-14.31", 0x0c0000, 0x20000, CRC(481b6f29) SHA1(0b047e805663b144dc2388c86438950fcdc29658) ) ROM_LOAD64_BYTE( "c45-14.31", 0x000001, 0x20000, CRC(481b6f29) SHA1(0b047e805663b144dc2388c86438950fcdc29658) )
ROM_LOAD16_BYTE( "c45-18.43", 0x0c0001, 0x20000, CRC(ba7ecf3b) SHA1(dd073b7bfbf2f88432337027ae9fb6c4f02a538f) ) ROM_LOAD64_BYTE( "c45-18.43", 0x000000, 0x20000, CRC(ba7ecf3b) SHA1(dd073b7bfbf2f88432337027ae9fb6c4f02a538f) )
ROM_REGION( 0xa0000, "ymsnd", 0 ) /* ADPCM samples */ ROM_REGION( 0xa0000, "ymsnd", 0 ) /* ADPCM samples */
ROM_LOAD( "c45-01.5", 0x00000, 0x20000, CRC(052997b2) SHA1(3aa8b4f759a1c196de39754a9ccdf4fabdbab388) ) ROM_LOAD( "c45-01.5", 0x00000, 0x20000, CRC(052997b2) SHA1(3aa8b4f759a1c196de39754a9ccdf4fabdbab388) )
@ -963,14 +953,14 @@ ROM_START( ainfernoj )
ROM_LOAD( "c45-30.9", 0x00000, 0x10000, CRC(fa2db40f) SHA1(91c34a53d2fec619f2536ca79fdc6a17fb0d21e4) ) // 27c512, 1111xxxxxxxxxxxx = 0xFF ROM_LOAD( "c45-30.9", 0x00000, 0x10000, CRC(fa2db40f) SHA1(91c34a53d2fec619f2536ca79fdc6a17fb0d21e4) ) // 27c512, 1111xxxxxxxxxxxx = 0xFF
ROM_REGION( 0x100000, "gfx1", 0 ) /* 16x16 tiles */ ROM_REGION( 0x100000, "gfx1", 0 ) /* 16x16 tiles */
ROM_LOAD16_BYTE( "c45-11.28", 0x000000, 0x20000, CRC(d9b4b77c) SHA1(69d570efa8146fb0a712ff45e77bda6fd85769f8) ) ROM_LOAD64_BYTE( "c45-11.28", 0x000007, 0x20000, CRC(d9b4b77c) SHA1(69d570efa8146fb0a712ff45e77bda6fd85769f8) )
ROM_LOAD16_BYTE( "c45-15.40", 0x000001, 0x20000, CRC(d4610698) SHA1(5de519a23300d5b3b09ce7cf8c02a1a6b2fb985c) ) ROM_LOAD64_BYTE( "c45-15.40", 0x000006, 0x20000, CRC(d4610698) SHA1(5de519a23300d5b3b09ce7cf8c02a1a6b2fb985c) )
ROM_LOAD16_BYTE( "c45-12.29", 0x040000, 0x20000, CRC(4ae305b8) SHA1(2bbb981853a7abbba90afb8eb58f6869357551d3) ) ROM_LOAD64_BYTE( "c45-12.29", 0x000005, 0x20000, CRC(4ae305b8) SHA1(2bbb981853a7abbba90afb8eb58f6869357551d3) )
ROM_LOAD16_BYTE( "c45-16.41", 0x040001, 0x20000, CRC(c6eb93b0) SHA1(d0b1adfce5c1f4e21c5d84527d22ace14578f2d7) ) ROM_LOAD64_BYTE( "c45-16.41", 0x000004, 0x20000, CRC(c6eb93b0) SHA1(d0b1adfce5c1f4e21c5d84527d22ace14578f2d7) )
ROM_LOAD16_BYTE( "c45-13.30", 0x080000, 0x20000, CRC(69b82af6) SHA1(13c035e84affa59734c6dd1b07963c08654b5f5a) ) ROM_LOAD64_BYTE( "c45-13.30", 0x000003, 0x20000, CRC(69b82af6) SHA1(13c035e84affa59734c6dd1b07963c08654b5f5a) )
ROM_LOAD16_BYTE( "c45-17.42", 0x080001, 0x20000, CRC(0dbee000) SHA1(41073d5cf20df12d5ba1c424c9d9f0b2d9836d5d) ) ROM_LOAD64_BYTE( "c45-17.42", 0x000002, 0x20000, CRC(0dbee000) SHA1(41073d5cf20df12d5ba1c424c9d9f0b2d9836d5d) )
ROM_LOAD16_BYTE( "c45-14.31", 0x0c0000, 0x20000, CRC(481b6f29) SHA1(0b047e805663b144dc2388c86438950fcdc29658) ) ROM_LOAD64_BYTE( "c45-14.31", 0x000001, 0x20000, CRC(481b6f29) SHA1(0b047e805663b144dc2388c86438950fcdc29658) )
ROM_LOAD16_BYTE( "c45-18.43", 0x0c0001, 0x20000, CRC(ba7ecf3b) SHA1(dd073b7bfbf2f88432337027ae9fb6c4f02a538f) ) ROM_LOAD64_BYTE( "c45-18.43", 0x000000, 0x20000, CRC(ba7ecf3b) SHA1(dd073b7bfbf2f88432337027ae9fb6c4f02a538f) )
ROM_REGION( 0xa0000, "ymsnd", 0 ) /* ADPCM samples */ ROM_REGION( 0xa0000, "ymsnd", 0 ) /* ADPCM samples */
ROM_LOAD( "c45-01.5", 0x00000, 0x20000, CRC(052997b2) SHA1(3aa8b4f759a1c196de39754a9ccdf4fabdbab388) ) ROM_LOAD( "c45-01.5", 0x00000, 0x20000, CRC(052997b2) SHA1(3aa8b4f759a1c196de39754a9ccdf4fabdbab388) )

View File

@ -20,13 +20,13 @@
enum { TAITOAIR_FRAC_SHIFT = 16, TAITOAIR_POLY_MAX_PT = 16 }; enum { TAITOAIR_FRAC_SHIFT = 16, TAITOAIR_POLY_MAX_PT = 16 };
struct taitoair_spoint { struct taitoair_spoint {
int32_t x, y; s32 x, y;
}; };
struct taitoair_poly { struct taitoair_poly {
struct taitoair_spoint p[TAITOAIR_POLY_MAX_PT]; struct taitoair_spoint p[TAITOAIR_POLY_MAX_PT];
int pcount; int pcount;
uint16_t header; u16 header;
}; };
@ -50,18 +50,19 @@ public:
, m_gfxdecode(*this, "gfxdecode") , m_gfxdecode(*this, "gfxdecode")
, m_screen(*this, "screen") , m_screen(*this, "screen")
, m_palette(*this, "palette") , m_palette(*this, "palette")
, m_z80bank(*this, "z80bank")
{ } { }
void airsys(machine_config &config); void airsys(machine_config &config);
private: private:
/* memory pointers */ /* memory pointers */
required_shared_ptr<uint16_t> m_m68000_mainram; required_shared_ptr<u16> m_m68000_mainram;
required_shared_ptr<uint16_t> m_line_ram; required_shared_ptr<u16> m_line_ram;
required_shared_ptr<uint16_t> m_dsp_ram; // Shared 68000/TMS32025 RAM required_shared_ptr<u16> m_dsp_ram; // Shared 68000/TMS32025 RAM
required_shared_ptr<uint16_t> m_paletteram; required_shared_ptr<u16> m_paletteram;
required_shared_ptr<uint16_t> m_gradram; required_shared_ptr<u16> m_gradram;
required_shared_ptr<uint16_t> m_tc0430grw; required_shared_ptr<u16> m_tc0430grw;
/* video-related */ /* video-related */
taitoair_poly m_q; taitoair_poly m_q;
@ -80,70 +81,72 @@ private:
required_device<screen_device> m_screen; required_device<screen_device> m_screen;
required_device<palette_device> m_palette; required_device<palette_device> m_palette;
required_memory_bank m_z80bank;
std::unique_ptr<bitmap_ind16> m_framebuffer[2]; std::unique_ptr<bitmap_ind16> m_framebuffer[2];
/* 3d info */ /* 3d info */
int16_t m_frustumLeft; s16 m_frustumLeft;
int16_t m_frustumBottom; s16 m_frustumBottom;
int16_t m_eyecoordBuffer[4]; /* homogeneous */ s16 m_eyecoordBuffer[4]; /* homogeneous */
bool m_gradbank; bool m_gradbank;
uint16_t m_dsp_test_object_type; u16 m_dsp_test_object_type;
int16_t m_dsp_test_or_clip, m_dsp_test_and_clip; s16 m_dsp_test_or_clip, m_dsp_test_and_clip;
int16_t m_dsp_test_x, m_dsp_test_y, m_dsp_test_z; s16 m_dsp_test_x, m_dsp_test_y, m_dsp_test_z;
DECLARE_WRITE16_MEMBER(dsp_test_start_w); void dsp_test_start_w(u16 data);
DECLARE_WRITE16_MEMBER(dsp_test_x_w); void dsp_test_x_w(u16 data);
DECLARE_WRITE16_MEMBER(dsp_test_y_w); void dsp_test_y_w(u16 data);
DECLARE_WRITE16_MEMBER(dsp_test_z_w); void dsp_test_z_w(u16 data);
DECLARE_READ16_MEMBER(dsp_test_point_r); u16 dsp_test_point_r();
DECLARE_READ16_MEMBER(dsp_test_or_clip_r); u16 dsp_test_or_clip_r();
DECLARE_READ16_MEMBER(dsp_test_and_clip_r); u16 dsp_test_and_clip_r();
int16_t m_dsp_muldiv_a_1, m_dsp_muldiv_b_1, m_dsp_muldiv_c_1; s16 m_dsp_muldiv_a_1, m_dsp_muldiv_b_1, m_dsp_muldiv_c_1;
DECLARE_WRITE16_MEMBER(dsp_muldiv_a_1_w); void dsp_muldiv_a_1_w(u16 data);
DECLARE_WRITE16_MEMBER(dsp_muldiv_b_1_w); void dsp_muldiv_b_1_w(u16 data);
DECLARE_WRITE16_MEMBER(dsp_muldiv_c_1_w); void dsp_muldiv_c_1_w(u16 data);
DECLARE_READ16_MEMBER(dsp_muldiv_1_r); u16 dsp_muldiv_1_r();
int16_t m_dsp_muldiv_a_2, m_dsp_muldiv_b_2, m_dsp_muldiv_c_2; s16 m_dsp_muldiv_a_2, m_dsp_muldiv_b_2, m_dsp_muldiv_c_2;
DECLARE_WRITE16_MEMBER(dsp_muldiv_a_2_w); void dsp_muldiv_a_2_w(u16 data);
DECLARE_WRITE16_MEMBER(dsp_muldiv_b_2_w); void dsp_muldiv_b_2_w(u16 data);
DECLARE_WRITE16_MEMBER(dsp_muldiv_c_2_w); void dsp_muldiv_c_2_w(u16 data);
DECLARE_READ16_MEMBER(dsp_muldiv_2_r); u16 dsp_muldiv_2_r();
//bitmap_ind16 *m_buffer3d; //bitmap_ind16 *m_buffer3d;
DECLARE_WRITE16_MEMBER(system_control_w); void system_control_w(offs_t offset, u16 data, u16 mem_mask = ~0);
DECLARE_READ16_MEMBER(lineram_r); u16 lineram_r(offs_t offset);
DECLARE_WRITE16_MEMBER(lineram_w); void lineram_w(offs_t offset, u16 data, u16 mem_mask = ~0);
DECLARE_READ16_MEMBER(dspram_r); u16 dspram_r(offs_t offset);
DECLARE_WRITE16_MEMBER(dspram_w); void dspram_w(offs_t offset, u16 data, u16 mem_mask = ~0);
DECLARE_READ16_MEMBER(dsp_HOLD_signal_r); u16 dsp_HOLD_signal_r();
DECLARE_WRITE16_MEMBER(dsp_HOLDA_signal_w); void dsp_HOLDA_signal_w(offs_t offset, u16 data);
DECLARE_WRITE16_MEMBER(airsys_paletteram16_w); void paletteram_w(offs_t offset, u16 data, u16 mem_mask = ~0);
DECLARE_WRITE16_MEMBER(airsys_gradram_w); void gradram_w(offs_t offset, u16 data, u16 mem_mask = ~0);
DECLARE_READ16_MEMBER(stick_input_r); DECLARE_READ16_MEMBER(stick_input_r);
DECLARE_READ16_MEMBER(stick2_input_r); DECLARE_READ16_MEMBER(stick2_input_r);
DECLARE_WRITE8_MEMBER(coin_control_w); void coin_control_w(u8 data);
DECLARE_WRITE8_MEMBER(sound_bankswitch_w); void sound_bankswitch_w(u8 data);
DECLARE_WRITE16_MEMBER(dsp_flags_w); void dsp_flags_w(offs_t offset, u16 data);
DECLARE_WRITE16_MEMBER(dma_regs_w); void dma_regs_w(offs_t offset, u16 data, u16 mem_mask = ~0);
virtual void machine_start() override; virtual void machine_start() override;
virtual void machine_reset() override; virtual void machine_reset() override;
virtual void video_start() override; virtual void video_start() override;
uint32_t screen_update_taitoair(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); u32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
int draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect ); int draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect);
int draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect, int start_offset ); int draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, int start_offset);
void fb_copy_op(void); void fb_copy_op(void);
void fb_fill_op(void); void fb_fill_op(void);
void fb_erase_op(void); void fb_erase_op(void);
void fill_slope( bitmap_ind16 &bitmap, const rectangle &cliprect, uint16_t header, int32_t x1, int32_t x2, int32_t sl1, int32_t sl2, int32_t y1, int32_t y2, int32_t *nx1, int32_t *nx2 ); void fill_slope(bitmap_ind16 &bitmap, const rectangle &cliprect, u16 header, s32 x1, s32 x2, s32 sl1, s32 sl2, s32 y1, s32 y2, s32 *nx1, s32 *nx2);
void fill_poly( bitmap_ind16 &bitmap, const rectangle &cliprect, const struct taitoair_poly *q ); void fill_poly(bitmap_ind16 &bitmap, const rectangle &cliprect, const struct taitoair_poly *q);
void DSP_map_data(address_map &map); void DSP_map_data(address_map &map);
void DSP_map_program(address_map &map); void DSP_map_program(address_map &map);

View File

@ -70,7 +70,7 @@ static const int zoomy_conv_table[] =
Screen refresh Screen refresh
***************************************************************************/ ***************************************************************************/
int taitoair_state::draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect ) int taitoair_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect)
{ {
return draw_sprites(bitmap,cliprect, 0x3f8 / 2); return draw_sprites(bitmap,cliprect, 0x3f8 / 2);
} }
@ -79,20 +79,14 @@ int taitoair_state::draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprec
@param start_offset DMA sprite offset source @param start_offset DMA sprite offset source
@return value acquired by a pause flag acquisition. @return value acquired by a pause flag acquisition.
*/ */
int taitoair_state::draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect, int start_offset ) int taitoair_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, int start_offset)
{ {
/* Y chain size is 16/32?/64/64? pixels. X chain size /* Y chain size is 16/32?/64/64? pixels. X chain size
is always 64 pixels. */ is always 64 pixels. */
//const uint16_t stop_values[4] = { 0xc00, 0, 0, 0 }; //const u16 stop_values[4] = { 0xc00, 0, 0, 0 };
static const int size[] = { 1, 2, 4, 4 }; static const u8 size[] = { 1, 2, 4, 4 };
int x0, y0, x, y, dx, dy, ex, ey, zx, zy;
int ysize;
int j, k;
int offs; /* sprite RAM offset */
int tile_offs; /* sprite chain offset */
int zoomx, zoomy; /* zoom value */
for (offs = start_offset; offs >= 0; offs -= 0x008 / 2) for (int offs = start_offset; offs >= 0; offs -= 0x008 / 2)
{ {
/*! /*!
Starting at a particular sequence, sprite DMA seems to stop there and resume via "something", Starting at a particular sequence, sprite DMA seems to stop there and resume via "something",
@ -101,23 +95,23 @@ int taitoair_state::draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprec
@todo reported sequence for DMA pause flag is 0x0c** 0x0000 0x0000 0x0000. @todo reported sequence for DMA pause flag is 0x0c** 0x0000 0x0000 0x0000.
Verify how exactly via HW test. Continuing may be determined by a DMA bit write. Verify how exactly via HW test. Continuing may be determined by a DMA bit write.
*/ */
if(m_tc0080vco->sprram_r(offs + 0) == 0xc00 || if (m_tc0080vco->sprram_r(offs + 0) == 0xc00 ||
m_tc0080vco->sprram_r(offs + 0) == 0xcff) // Air Inferno m_tc0080vco->sprram_r(offs + 0) == 0xcff) // Air Inferno
return offs - 8/2; return offs - 8/2;
x0 = m_tc0080vco->sprram_r(offs + 1) & 0x3ff; int x0 = m_tc0080vco->sprram_r(offs + 1) & 0x3ff;
y0 = m_tc0080vco->sprram_r(offs + 0) & 0x3ff; int y0 = m_tc0080vco->sprram_r(offs + 0) & 0x3ff;
zoomx = (m_tc0080vco->sprram_r(offs + 2) & 0x7f00) >> 8; int zoomx = (m_tc0080vco->sprram_r(offs + 2) & 0x7f00) >> 8;
zoomy = (m_tc0080vco->sprram_r(offs + 2) & 0x007f); int zoomy = (m_tc0080vco->sprram_r(offs + 2) & 0x007f);
tile_offs = (m_tc0080vco->sprram_r(offs + 3) & 0x1fff) << 2; u32 tile_offs = (m_tc0080vco->sprram_r(offs + 3) & 0x1fff) << 2;
ysize = size[(m_tc0080vco->sprram_r(offs) & 0x0c00) >> 10]; const u8 ysize = size[(m_tc0080vco->sprram_r(offs) & 0x0c00) >> 10];
if (tile_offs) if (tile_offs)
{ {
/* Convert zoomy value to real value as zoomx */ /* Convert zoomy value to real value as zoomx */
zoomy = zoomy_conv_table[zoomy]; zoomy = zoomy_conv_table[zoomy];
int dx, dy, ex, ey, zx, zy;
if (zoomx < 63) if (zoomx < 63)
{ {
dx = 8 + (zoomx + 2) / 8; dx = 8 + (zoomx + 2) / 8;
@ -160,37 +154,33 @@ int taitoair_state::draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprec
y0 += 2; y0 += 2;
} }
y = y0; int y = y0;
for (j = 0; j < ysize; j ++) for (int j = 0; j < ysize; j++)
{ {
x = x0; int x = x0;
for (k = 0; k < 4; k ++) for (int k = 0; k < 4; k++)
{ {
if (tile_offs >= 0x1000) if (tile_offs >= 0x1000)
{ {
int tile, color, flipx, flipy; const u32 tile = m_tc0080vco->cram_0_r(tile_offs) & 0x7fff;
const u32 color = m_tc0080vco->cram_1_r(tile_offs) & 0x001f;
tile = m_tc0080vco->cram_0_r(tile_offs) & 0x7fff; int flipx = m_tc0080vco->cram_1_r(tile_offs) & 0x0040;
color = m_tc0080vco->cram_1_r(tile_offs) & 0x001f; int flipy = m_tc0080vco->cram_1_r(tile_offs) & 0x0080;
flipx = m_tc0080vco->cram_1_r(tile_offs) & 0x0040;
flipy = m_tc0080vco->cram_1_r(tile_offs) & 0x0080;
if (m_tc0080vco->flipscreen_r()) if (m_tc0080vco->flipscreen_r())
{ {
flipx ^= 0x0040; flipx = !flipx;
flipy ^= 0x0080; flipy = !flipy;
} }
m_gfxdecode->gfx(0)->zoom_transpen(bitmap,cliprect,
m_gfxdecode->gfx(0)->zoom_transpen(bitmap,cliprect,
tile, tile,
color, color,
flipx, flipy, flipx, flipy,
x, y, x, y,
zx, zy, 0 zx, zy, 0);
);
} }
tile_offs ++; tile_offs++;
x += dx; x += dx;
} }
y += dy; y += dy;
@ -201,7 +191,7 @@ int taitoair_state::draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprec
return 0; return 0;
} }
void taitoair_state::fill_slope( bitmap_ind16 &bitmap, const rectangle &cliprect, uint16_t header, int32_t x1, int32_t x2, int32_t sl1, int32_t sl2, int32_t y1, int32_t y2, int32_t *nx1, int32_t *nx2 ) void taitoair_state::fill_slope(bitmap_ind16 &bitmap, const rectangle &cliprect, u16 header, s32 x1, s32 x2, s32 sl1, s32 sl2, s32 y1, s32 y2, s32 *nx1, s32 *nx2)
{ {
if (y1 > cliprect.max_y) if (y1 > cliprect.max_y)
return; return;
@ -230,7 +220,7 @@ void taitoair_state::fill_slope( bitmap_ind16 &bitmap, const rectangle &cliprect
if (x1 > x2 || (x1==x2 && sl1 > sl2)) if (x1 > x2 || (x1==x2 && sl1 > sl2))
{ {
int32_t t, *tp; s32 t, *tp;
t = x1; t = x1;
x1 = x2; x1 = x2;
x2 = t; x2 = t;
@ -258,17 +248,17 @@ void taitoair_state::fill_slope( bitmap_ind16 &bitmap, const rectangle &cliprect
if (xx2 > cliprect.max_x) if (xx2 > cliprect.max_x)
xx2 = cliprect.max_x; xx2 = cliprect.max_x;
if(header & 0x4000 && machine().input().code_pressed(KEYCODE_Q)) if (header & 0x4000 && machine().input().code_pressed(KEYCODE_Q))
{ {
base_color = machine().rand() & 0x3fff; base_color = machine().rand() & 0x3fff;
grad_col = 0; grad_col = 0;
} }
else if(m_paletteram[(header & 0xff)+0x300] & 0x8000) else if (m_paletteram[(header & 0xff)+0x300] & 0x8000)
{ {
/* Terrain elements, with a gradient applied. */ /* Terrain elements, with a gradient applied. */
/*! @todo it's unknown if gradient color applies by global screen Y coordinate or there's a calculation to somewhere ... */ /*! @todo it's unknown if gradient color applies by global screen Y coordinate or there's a calculation to somewhere ... */
base_color = ((header & 0x3f) * 0x80) + 0x2040; base_color = ((header & 0x3f) * 0x80) + 0x2040;
if(header & 0x3fe0) if (header & 0x3fe0)
base_color = machine().rand() & 0x3fff; base_color = machine().rand() & 0x3fff;
grad_col = (y1 >> 3) & 0x3f; grad_col = (y1 >> 3) & 0x3f;
} }
@ -295,22 +285,21 @@ void taitoair_state::fill_slope( bitmap_ind16 &bitmap, const rectangle &cliprect
*nx2 = x2; *nx2 = x2;
} }
void taitoair_state::fill_poly( bitmap_ind16 &bitmap, const rectangle &cliprect, const struct taitoair_poly *q ) void taitoair_state::fill_poly(bitmap_ind16 &bitmap, const rectangle &cliprect, const struct taitoair_poly *q)
{ {
int32_t sl1, sl2, cury, limy, x1, x2; s32 sl1, sl2, x1, x2;
int pmin, pmax, i, ps1, ps2;
struct taitoair_spoint p[TAITOAIR_POLY_MAX_PT * 2]; struct taitoair_spoint p[TAITOAIR_POLY_MAX_PT * 2];
uint16_t header = q->header; u16 header = q->header;
int pcount = q->pcount; int pcount = q->pcount;
for (i = 0; i < pcount; i++) for (int i = 0; i < pcount; i++)
{ {
p[i].x = p[i + pcount].x = q->p[i].x << TAITOAIR_FRAC_SHIFT; p[i].x = p[i + pcount].x = q->p[i].x << TAITOAIR_FRAC_SHIFT;
p[i].y = p[i + pcount].y = q->p[i].y; p[i].y = p[i + pcount].y = q->p[i].y;
} }
pmin = pmax = 0; int pmin = 0, pmax = 0;
for (i = 1; i < pcount; i++) for (int i = 1; i < pcount; i++)
{ {
if (p[i].y < p[pmin].y) if (p[i].y < p[pmin].y)
pmin = i; pmin = i;
@ -318,8 +307,8 @@ void taitoair_state::fill_poly( bitmap_ind16 &bitmap, const rectangle &cliprect,
pmax = i; pmax = i;
} }
cury = p[pmin].y; s32 cury = p[pmin].y;
limy = p[pmax].y; s32 limy = p[pmax].y;
if (cury == limy) if (cury == limy)
return; return;
@ -332,8 +321,8 @@ void taitoair_state::fill_poly( bitmap_ind16 &bitmap, const rectangle &cliprect,
if (limy > cliprect.max_y) if (limy > cliprect.max_y)
limy = cliprect.max_y; limy = cliprect.max_y;
ps1 = pmin + pcount; int ps1 = pmin + pcount;
ps2 = pmin; int ps2 = pmin;
goto startup; goto startup;
@ -469,7 +458,7 @@ void taitoair_state::fb_fill_op()
@todo still don't know how this works. It calls three values (0x1fff-0x5fff-0xdfff), for two or three offsets. @todo still don't know how this works. It calls three values (0x1fff-0x5fff-0xdfff), for two or three offsets.
In theory this should fit into framebuffer draw, display, clear and swap in some way. In theory this should fit into framebuffer draw, display, clear and swap in some way.
*/ */
WRITE16_MEMBER(taitoair_state::dsp_flags_w) void taitoair_state::dsp_flags_w(offs_t offset, u16 data)
{ {
rectangle cliprect; rectangle cliprect;
@ -480,67 +469,67 @@ WRITE16_MEMBER(taitoair_state::dsp_flags_w)
cliprect.max_x = m_screen->width() - 1; cliprect.max_x = m_screen->width() - 1;
cliprect.max_y = m_screen->height() - 1; cliprect.max_y = m_screen->height() - 1;
/* clear and copy operation if offset is 0x3001 */
if (offset == 1)
{ {
/* clear and copy operation if offset is 0x3001 */ fb_copy_op();
if(offset == 1) }
{
fb_copy_op();
}
/* if offset 0x3001 OR 0x3002 we put data in the buffer fb */ /* if offset 0x3001 OR 0x3002 we put data in the buffer fb */
if(offset) if (offset)
{ {
fb_fill_op(); fb_fill_op();
}
} }
} }
void taitoair_state::video_start() void taitoair_state::video_start()
{ {
int width, height; int width = m_screen->width();
int height = m_screen->height();
width = m_screen->width();
height = m_screen->height();
m_framebuffer[0] = std::make_unique<bitmap_ind16>(width, height); m_framebuffer[0] = std::make_unique<bitmap_ind16>(width, height);
m_framebuffer[1] = std::make_unique<bitmap_ind16>(width, height); m_framebuffer[1] = std::make_unique<bitmap_ind16>(width, height);
//m_buffer3d = std::make_unique<bitmap_ind16>(width, height); //m_buffer3d = std::make_unique<bitmap_ind16>(width, height);
} }
uint32_t taitoair_state::screen_update_taitoair(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) u32 taitoair_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{ {
int sprite_ptr;
m_tc0080vco->tilemap_update(); m_tc0080vco->tilemap_update();
uint32_t counter1 = (m_tc0430grw[0] << 16) | m_tc0430grw[1]; u32 counter1 = (m_tc0430grw[0] << 16) | m_tc0430grw[1];
uint32_t inc1x = int16_t(m_tc0430grw[2]); u32 inc1x = s16(m_tc0430grw[2]);
uint32_t inc1y = int16_t(m_tc0430grw[3]); u32 inc1y = s16(m_tc0430grw[3]);
uint32_t counter2 = (m_tc0430grw[4] << 16) | m_tc0430grw[5]; u32 counter2 = (m_tc0430grw[4] << 16) | m_tc0430grw[5];
uint32_t inc2x = int16_t(m_tc0430grw[6]); u32 inc2x = s16(m_tc0430grw[6]);
uint32_t inc2y = int16_t(m_tc0430grw[7]); u32 inc2y = s16(m_tc0430grw[7]);
// Deltas are 118/31 // Deltas are 118/31
int dx = cliprect.min_x + 118; int dx = cliprect.min_x + 118;
int dy = cliprect.min_y - 48 + 31; int dy = cliprect.min_y - 48 + 31;
counter1 += dx*inc1x + dy*inc1y; counter1 += dx * inc1x + dy * inc1y;
counter2 += dx*inc2x + dy*inc2y; counter2 += dx * inc2x + dy * inc2y;
for(int y = cliprect.min_y; y <= cliprect.max_y; y++) { for (int y = cliprect.min_y; y <= cliprect.max_y; y++)
uint32_t c1b = counter1; {
uint32_t c2b = counter2; u32 c1b = counter1;
uint16_t *dest = &bitmap.pix(y, cliprect.min_x); u32 c2b = counter2;
for(int x = cliprect.min_x; x <= cliprect.max_x; x++) { u16 *dest = &bitmap.pix(y, cliprect.min_x);
uint16_t base = 0; for (int x = cliprect.min_x; x <= cliprect.max_x; x++)
uint32_t cntr = 0; {
if(c2b & 0x800000) { u16 base = 0;
u32 cntr = 0;
if (c2b & 0x800000)
{
base = 0x2040; base = 0x2040;
cntr = c2b; cntr = c2b;
} else if(c1b & 0x800000) { }
else if (c1b & 0x800000)
{
base = 0x2000; base = 0x2000;
cntr = c1b; cntr = c1b;
} }
if(m_gradbank == true) if (m_gradbank == true)
base|= 0x1000; base |= 0x1000;
*dest++ = base | (cntr >= 0x83f000 ? 0x3f : (cntr >> 12) & 0x3f); *dest++ = base | (cntr >= 0x83f000 ? 0x3f : (cntr >> 12) & 0x3f);
@ -551,13 +540,11 @@ uint32_t taitoair_state::screen_update_taitoair(screen_device &screen, bitmap_in
counter2 += inc2y; counter2 += inc2y;
} }
copybitmap_trans(bitmap, *m_framebuffer[1], 0, 0, 0, 0, cliprect, 0); copybitmap_trans(bitmap, *m_framebuffer[1], 0, 0, 0, 0, cliprect, 0);
m_tc0080vco->tilemap_draw(screen, bitmap, cliprect, 0, 0, 0); m_tc0080vco->tilemap_draw(screen, bitmap, cliprect, 0, 0, 0);
sprite_ptr = draw_sprites(bitmap, cliprect); int sprite_ptr = draw_sprites(bitmap, cliprect);
m_tc0080vco->tilemap_draw(screen, bitmap, cliprect, 1, 0, 0); m_tc0080vco->tilemap_draw(screen, bitmap, cliprect, 1, 0, 0);