trckydoc: add sprite y flip, crzrally: copy over sprite x clipping from sauro driver

This commit is contained in:
hap 2024-12-06 20:41:43 +01:00
parent b41267dbc6
commit 1bdb8c5b8e
5 changed files with 56 additions and 50 deletions

View File

@ -25,11 +25,13 @@ Bank of 8 switches
The riser board has a pair of HM4334 1K*4 static RAMs and a quad 2-input NAND gate.
TODO:
- dump/add Omori's version, it's assumed it will have a title screen, as seen
inside the gfx roms (OEC logo is still in there too)
- find out win rate dipswitch values, or is it max payout rate?
- doesn't it have a hopper?
- doesn't it have a hopper? or maybe the bootleg version removed that?
- game sometimes leaves gaps when the lady is undressing
- colors aren't 100% correct (see i.e. the stripes in the curtains)
reference video: https://www.youtube.com/watch?v=zTOFIhuwR2w
- colors aren't 100% correct (see i.e. the stripes in the curtains), reference video:
https://www.youtube.com/watch?v=zTOFIhuwR2w
- verify sound pitch (unfortunately, no pcb sound in above video)
- verify irq frequency, though it looks similar to the pcb video

View File

@ -973,6 +973,7 @@ GAME( 1983, ambush, 0, ambush, ambusht, ambush_state, empty_init,
GAME( 1983, ambushh, ambush, ambush, ambusht, ambush_state, empty_init, ROT0, "Tecfri", "Ambush (hack?)", MACHINE_SUPPORTS_SAVE )
GAME( 1983, ambushj, ambush, ambush, ambush, ambush_state, empty_init, ROT0, "Tecfri (Nippon Amuse license)", "Ambush (Japan)", MACHINE_SUPPORTS_SAVE )
GAME( 1983, ambushv, ambush, ambush, ambush, ambush_state, empty_init, ROT0, "Tecfri (Volt Electronics license)", "Ambush (Volt Electronics)", MACHINE_SUPPORTS_SAVE )
GAME( 1983, mariobl, mario, mariobl, mariobl, ambush_state, empty_init, ROT180, "bootleg", "Mario Bros. (bootleg on Ambush Hardware, set 1)", MACHINE_SUPPORTS_SAVE )
GAME( 1983, mariobla, mario, mariobla, mariobl, ambush_state, empty_init, ROT180, "bootleg", "Mario Bros. (bootleg on Ambush Hardware, set 2)", MACHINE_SUPPORTS_SAVE )
GAME( 1983, dkong3abl, dkong3, dkong3abl, dkong3abl, ambush_state, empty_init, ROT90, "bootleg", "Donkey Kong 3 (bootleg on Ambush hardware)", MACHINE_SUPPORTS_SAVE )

View File

@ -11,9 +11,7 @@
- In stop mode press p1 start to freeze the screen, p2 start to resume
TODO:
- missing high bit of sprite X coordinate? (see round 2 and 3 of attract
mode in crzrally)
- crzrally: emulate steering wheel;
- crzrally: emulate steering wheel
***************************************************************************/
@ -246,7 +244,21 @@ void crzrally_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprec
int const code = m_spriteram[offs + 1] + ((m_spriteram[offs + 3] & 0x01) << 8);
int const color = (m_spriteram[offs + 3] >> 4) + ((m_spriteram[offs + 3] & 0x01) << 4);
// Bit 1 unknown but somehow related to X offset (clipping range?)
// Bit 1 somehow related to X offset (clipping range?)
if (m_spriteram[offs + 3] & 0x02)
{
if (sx > 0xc0)
{
// Sign extend
sx = int8_t(sx);
}
}
else
{
if (sx < 0x40)
continue;
}
int flipx = m_spriteram[offs + 3] & 0x04;
int flipy = m_spriteram[offs + 3] & 0x08;
@ -317,7 +329,7 @@ void crzrally_state::prg_map(address_map &map)
void base_state::io_map(address_map &map)
{
map.global_mask(0xff);
map(0x01, 0x01).r("watchdog", FUNC(watchdog_timer_device::reset_r)); // ?
map(0x01, 0x01).r("watchdog", FUNC(watchdog_timer_device::reset_r)); // ?
map(0x04, 0x04).r("ay1", FUNC(ay8910_device::data_r));
map(0x04, 0x05).w("ay1", FUNC(ay8910_device::address_data_w));
map(0x06, 0x06).r("ay2", FUNC(ay8910_device::data_r));
@ -584,7 +596,7 @@ void holeland_state::holeland(machine_config &config)
void crzrally_state::crzrally(machine_config &config)
{
// basic machine hardware
Z80(config, m_maincpu, 20_MHz_XTAL / 4); // 5 MHz
Z80(config, m_maincpu, 20_MHz_XTAL / 4); // 5 MHz
m_maincpu->set_addrmap(AS_PROGRAM, &crzrally_state::prg_map);
m_maincpu->set_addrmap(AS_IO, &crzrally_state::io_map);
m_maincpu->set_vblank_int("screen", FUNC(crzrally_state::irq0_line_hold));
@ -850,6 +862,7 @@ ROM_END
GAME( 1984, holeland, 0, holeland, holeland, holeland_state, empty_init, ROT0, "Tecfri", "Hole Land (Japan)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_SUPPORTS_SAVE )
GAME( 1984, holeland2, holeland, holeland, holeland2, holeland_state, empty_init, ROT0, "Tecfri", "Hole Land (Spain)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_SUPPORTS_SAVE ) //attract is different
GAME( 1985, crzrally, 0, crzrally, crzrally, crzrally_state, empty_init, ROT270, "Tecfri", "Crazy Rally (set 1)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_SUPPORTS_SAVE )
GAME( 1985, crzrallya, crzrally, crzrally, crzrally, crzrally_state, empty_init, ROT270, "Tecfri", "Crazy Rally (set 2)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_SUPPORTS_SAVE )
GAME( 1985, crzrallyg, crzrally, crzrally, crzrally, crzrally_state, empty_init, ROT270, "Tecfri (Gecas license)", "Crazy Rally (Gecas license)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_SUPPORTS_SAVE )

View File

@ -63,10 +63,12 @@ TODO
- What do the rest of the ports in the range c0-ce do?
Tricky Doc
----------
Addition by Reip
Applause by hap
Stephh's notes (based on the games Z80 code and some tests) :
@ -167,8 +169,7 @@ protected:
required_shared_ptr<uint8_t> m_bg_colorram;
tilemap_t *m_bg_tilemap = nullptr;
uint8_t m_palette_bank = 0U;
uint8_t m_palette_bank = 0;
bool m_irq_enable = 0;
// common
@ -327,14 +328,10 @@ void sauro_state::scroll_fg_w(uint8_t data)
void sauro_state::video_start()
{
m_bg_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(sauro_state::get_tile_info_bg)), TILEMAP_SCAN_COLS,
8, 8, 32, 32);
m_fg_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(sauro_state::get_tile_info_fg)), TILEMAP_SCAN_COLS,
8, 8, 32, 32);
m_bg_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(sauro_state::get_tile_info_bg)), TILEMAP_SCAN_COLS, 8, 8, 32, 32);
m_fg_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(sauro_state::get_tile_info_fg)), TILEMAP_SCAN_COLS, 8, 8, 32, 32);
m_fg_tilemap->set_transparent_pen(0);
m_palette_bank = 0;
save_item(NAME(m_palette_bank));
}
@ -343,10 +340,12 @@ void sauro_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect)
{
int const flipy = flip_screen();
// Weird, sprites entries don't start on DWORD boundary
for (int offs = 3; offs < m_spriteram.bytes() - 1; offs += 4)
{
int sy = m_spriteram[offs];
if (sy == 0xf8) continue;
if (sy == 0xf8)
continue;
int const code = m_spriteram[offs + 1] + ((m_spriteram[offs + 3] & 0x03) << 8);
int sx = m_spriteram[offs + 2];
@ -359,12 +358,13 @@ void sauro_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect)
if (sx > 0xc0)
{
// Sign extend
sx = (signed int)(signed char)sx;
sx = int8_t(sx);
}
}
else
{
if (sx < 0x40) continue;
if (sx < 0x40)
continue;
}
int flipx = m_spriteram[offs + 3] & 0x04;
@ -372,7 +372,7 @@ void sauro_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect)
if (flipy)
{
flipx = !flipx;
sx = (235 - sx) & 0xff; // The &0xff is not 100% percent correct
sx = (235 - sx) & 0xff; // The & 0xff is not 100% percent correct
sy = 240 - sy;
}
@ -396,29 +396,16 @@ uint32_t sauro_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap,
void trckydoc_state::video_start()
{
m_bg_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(trckydoc_state::get_tile_info_bg)), TILEMAP_SCAN_COLS,
8, 8, 32, 32);
m_palette_bank = 0;
m_bg_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(trckydoc_state::get_tile_info_bg)), TILEMAP_SCAN_COLS, 8, 8, 32, 32);
}
void trckydoc_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect)
{
int const flipy = flip_screen();
// Weird, sprites entries don't start on DWORD boundary
for (int offs = 3; offs < m_spriteram.bytes() - 1; offs += 4)
{
int sy = m_spriteram[offs];
if (m_spriteram[offs + 3] & 0x08)
{
// needed by the elevator cable (2nd stage), balls bouncing (3rd stage) and maybe other things
sy += 6;
}
int const code = m_spriteram[offs + 1] + ((m_spriteram[offs + 3] & 0x01) << 8);
int sx = m_spriteram[offs + 2] - 2;
int const color = (m_spriteram[offs + 3] >> 4) & 0x0f;
@ -430,20 +417,23 @@ void trckydoc_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprec
if (sx > 0xc0)
{
// Sign extend
sx = (signed int)(signed char)sx;
sx = int8_t(sx);
}
}
else
{
if (sx < 0x40) continue;
if (sx < 0x40)
continue;
}
int flipx = m_spriteram[offs + 3] & 0x04;
int flipy = m_spriteram[offs + 3] & 0x08;
if (flipy)
if (flip_screen())
{
flipx = !flipx;
sx = (235 - sx) & 0xff; // The &0xff is not 100% percent correct
flipy = !flipy;
sx = (235 - sx) & 0xff; // The & 0xff is not 100% percent correct
sy = 240 - sy;
}
@ -532,7 +522,7 @@ void sauro_state::sauro_sound_map(address_map &map)
map(0xc000, 0xc001).w("ymsnd", FUNC(ym3812_device::write));
map(0xa000, 0xa000).w("speech", FUNC(sp0256_device::ald_w));
map(0xe000, 0xe000).r(FUNC(sauro_state::sound_command_r));
map(0xe000, 0xe006).nopw(); // echo from write to e0000
map(0xe000, 0xe006).nopw(); // echo from write to e0000
map(0xe00e, 0xe00f).nopw();
}
@ -544,7 +534,7 @@ void sauro_state::saurobl_sound_map(address_map &map)
map(0xc000, 0xc001).w("ymsnd", FUNC(ym3812_device::write));
map(0xa000, 0xa000).nopw();
map(0xe000, 0xe000).r(FUNC(sauro_state::sound_command_r));
map(0xe000, 0xe006).nopw(); // echo from write to e0000
map(0xe000, 0xe006).nopw(); // echo from write to e0000
map(0xe00e, 0xe00f).nopw();
}
@ -579,7 +569,7 @@ static INPUT_PORTS_START( tecfri )
PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_8WAY
PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_8WAY
PORT_START("P2") // See notes
PORT_START("P2") // See notes
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_COCKTAIL
PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_COCKTAIL
PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_START1 )
@ -657,7 +647,7 @@ static INPUT_PORTS_START( saurobl )
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY
PORT_START("P2") // See notes
PORT_START("P2") // See notes
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_COCKTAIL
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_START1 )
@ -765,7 +755,7 @@ GFXDECODE_END
void base_state::tecfri(machine_config &config)
{
// Basic machine hardware
Z80(config, m_maincpu, XTAL(20'000'000) / 4); // Verified on PCB
Z80(config, m_maincpu, XTAL(20'000'000) / 4); // Verified on PCB
LS259(config, m_mainlatch);
m_mainlatch->q_out_cb<4>().set(FUNC(base_state::irq_reset_w));
@ -788,7 +778,7 @@ void base_state::tecfri(machine_config &config)
// Sound hardware
SPEAKER(config, "mono").front_center();
YM3812(config, "ymsnd", XTAL(20'000'000) / 8).add_route(ALL_OUTPUTS, "mono", 1.0); // Verified on PCB
YM3812(config, "ymsnd", XTAL(20'000'000) / 8).add_route(ALL_OUTPUTS, "mono", 1.0); // Verified on PCB
}
void trckydoc_state::trckydoc(machine_config &config)
@ -821,7 +811,7 @@ void sauro_state::saurobl(machine_config &config)
m_mainlatch->q_out_cb<5>().set(FUNC(sauro_state::palette_bank0_w));
m_mainlatch->q_out_cb<6>().set(FUNC(sauro_state::palette_bank1_w));
z80_device &audiocpu(Z80(config, "audiocpu", XTAL(20'000'000) / 5)); // Verified on PCB
z80_device &audiocpu(Z80(config, "audiocpu", XTAL(20'000'000) / 5)); // Verified on PCB
audiocpu.set_addrmap(AS_PROGRAM, &sauro_state::saurobl_sound_map);
audiocpu.set_periodic_int(FUNC(sauro_state::irq0_line_hold), attotime::from_hz(8 * 60)); // ?
@ -831,7 +821,7 @@ void sauro_state::saurobl(machine_config &config)
GENERIC_LATCH_8(config, m_soundlatch);
subdevice<ym3812_device>("ymsnd")->set_clock(XTAL(20'000'000) / 5); // Verified on PCB
subdevice<ym3812_device>("ymsnd")->set_clock(XTAL(20'000'000) / 5); // Verified on PCB
}
void sauro_state::sauro(machine_config &config)
@ -841,7 +831,7 @@ void sauro_state::sauro(machine_config &config)
subdevice<z80_device>("audiocpu")->set_addrmap(AS_PROGRAM, &sauro_state::sauro_sound_map);
// Sound hardware
sp0256_device &sp0256(SP0256(config, "speech", XTAL(20'000'000) / 5)); // Verified on PCB
sp0256_device &sp0256(SP0256(config, "speech", XTAL(20'000'000) / 5)); // Verified on PCB
sp0256.data_request_callback().set_inputline("audiocpu", INPUT_LINE_NMI);
sp0256.add_route(ALL_OUTPUTS, "mono", 1.0);
}

View File

@ -606,6 +606,6 @@ void speedbal_state::init_musicbal()
} // anonymous namespace
GAMEL( 1987, speedbal, 0, speedbal, speedbal, speedbal_state, init_speedbal, ROT270, "Tecfri / Desystem S.A.", "Speed Ball (set 1)", MACHINE_SUPPORTS_SAVE, layout_speedbal )
GAMEL( 1987, speedbal, 0, speedbal, speedbal, speedbal_state, init_speedbal, ROT270, "Tecfri / Desystem S.A.", "Speed Ball (set 1)", MACHINE_SUPPORTS_SAVE, layout_speedbal )
GAMEL( 1987, speedbala, speedbal, speedbal, speedbal, speedbal_state, init_speedbal, ROT270, "Tecfri / Desystem S.A.", "Speed Ball (set 2)", MACHINE_SUPPORTS_SAVE, layout_speedbal )
GAMEL( 1988, musicbal, 0, speedbal, musicbal, speedbal_state, init_musicbal, ROT270, "Tecfri / Desystem S.A.", "Music Ball", MACHINE_SUPPORTS_SAVE, layout_speedbal )
GAMEL( 1988, musicbal, 0, speedbal, musicbal, speedbal_state, init_musicbal, ROT270, "Tecfri / Desystem S.A.", "Music Ball", MACHINE_SUPPORTS_SAVE, layout_speedbal )