mirror of
https://github.com/holub/mame
synced 2025-10-05 08:41:31 +03:00
seta2.cpp: checkpoint (#4384)
* seta2.cpp: remove some patches that don't appear to be needed now, also alter coin timing for funcube because existing value falls outside of what funcube2 expects * seta2 continued use of actual registers (nw) * continued use of actual registers (nw) * (nw)
This commit is contained in:
parent
62af3e0b1c
commit
278fa09713
@ -194,7 +194,7 @@ void seta2_state::grdians_map(address_map &map)
|
||||
map(0xc00000, 0xc3ffff).ram().w(FUNC(seta2_state::spriteram_w)).share("spriteram"); // Sprites
|
||||
map(0xc40000, 0xc4ffff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette"); // Palette
|
||||
map(0xc50000, 0xc5ffff).ram(); // cleared
|
||||
map(0xc60000, 0xc6003f).w(FUNC(seta2_state::vregs_w)).share("vregs"); // Video Registers
|
||||
map(0xc60000, 0xc6003f).ram().w(FUNC(seta2_state::vregs_w)).share("vregs"); // Video Registers
|
||||
map(0xe00010, 0xe0001f).w(FUNC(seta2_state::sound_bank_w)).umask16(0x00ff); // Samples Banks
|
||||
map(0xfffc00, 0xffffff).rw(m_tmp68301, FUNC(tmp68301_device::regs_r), FUNC(tmp68301_device::regs_w)); // TMP68301 Registers
|
||||
}
|
||||
@ -233,7 +233,7 @@ void seta2_state::gundamex_map(address_map &map)
|
||||
map(0xc00000, 0xc3ffff).ram().share("spriteram"); // Sprites
|
||||
map(0xc40000, 0xc4ffff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette"); // Palette
|
||||
map(0xc50000, 0xc5ffff).ram(); // cleared
|
||||
map(0xc60000, 0xc6003f).w(FUNC(seta2_state::vregs_w)).share("vregs"); // Video Registers
|
||||
map(0xc60000, 0xc6003f).ram().w(FUNC(seta2_state::vregs_w)).share("vregs"); // Video Registers
|
||||
map(0xe00010, 0xe0001f).w(FUNC(seta2_state::sound_bank_w)).umask16(0x00ff); // Samples Banks
|
||||
map(0xfffc00, 0xffffff).rw(m_tmp68301, FUNC(tmp68301_device::regs_r), FUNC(tmp68301_device::regs_w)); // TMP68301 Registers
|
||||
}
|
||||
@ -291,7 +291,7 @@ void seta2_state::mj4simai_map(address_map &map)
|
||||
map(0xb00000, 0xb03fff).rw("x1snd", FUNC(x1_010_device::word_r), FUNC(x1_010_device::word_w)); // Sound
|
||||
map(0xc00000, 0xc3ffff).ram().share("spriteram"); // Sprites
|
||||
map(0xc40000, 0xc4ffff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette"); // Palette
|
||||
map(0xc60000, 0xc6003f).w(FUNC(seta2_state::vregs_w)).share("vregs"); // Video Registers
|
||||
map(0xc60000, 0xc6003f).ram().w(FUNC(seta2_state::vregs_w)).share("vregs"); // Video Registers
|
||||
map(0xfffc00, 0xffffff).rw(m_tmp68301, FUNC(tmp68301_device::regs_r), FUNC(tmp68301_device::regs_w)); // TMP68301 Registers
|
||||
}
|
||||
|
||||
@ -315,7 +315,7 @@ void seta2_state::myangel_map(address_map &map)
|
||||
map(0xb00000, 0xb03fff).rw("x1snd", FUNC(x1_010_device::word_r), FUNC(x1_010_device::word_w)); // Sound
|
||||
map(0xc00000, 0xc3ffff).ram().share("spriteram"); // Sprites
|
||||
map(0xc40000, 0xc4ffff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette"); // Palette
|
||||
map(0xc60000, 0xc6003f).w(FUNC(seta2_state::vregs_w)).share("vregs"); // Video Registers
|
||||
map(0xc60000, 0xc6003f).ram().w(FUNC(seta2_state::vregs_w)).share("vregs"); // Video Registers
|
||||
map(0xfffc00, 0xffffff).rw(m_tmp68301, FUNC(tmp68301_device::regs_r), FUNC(tmp68301_device::regs_w)); // TMP68301 Registers
|
||||
}
|
||||
|
||||
@ -339,7 +339,7 @@ void seta2_state::myangel2_map(address_map &map)
|
||||
map(0xb00000, 0xb03fff).rw("x1snd", FUNC(x1_010_device::word_r), FUNC(x1_010_device::word_w)); // Sound
|
||||
map(0xd00000, 0xd3ffff).ram().share("spriteram"); // Sprites
|
||||
map(0xd40000, 0xd4ffff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette"); // Palette
|
||||
map(0xd60000, 0xd6003f).w(FUNC(seta2_state::vregs_w)).share("vregs"); // Video Registers
|
||||
map(0xd60000, 0xd6003f).ram().w(FUNC(seta2_state::vregs_w)).share("vregs"); // Video Registers
|
||||
map(0xfffc00, 0xffffff).rw(m_tmp68301, FUNC(tmp68301_device::regs_r), FUNC(tmp68301_device::regs_w)); // TMP68301 Registers
|
||||
}
|
||||
|
||||
@ -381,7 +381,7 @@ void seta2_state::pzlbowl_map(address_map &map)
|
||||
map(0x700000, 0x700001).r(FUNC(seta2_state::pzlbowl_protection_r)); // Protection
|
||||
map(0x800000, 0x83ffff).ram().share("spriteram"); // Sprites
|
||||
map(0x840000, 0x84ffff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette"); // Palette
|
||||
map(0x860000, 0x86003f).w(FUNC(seta2_state::vregs_w)).share("vregs"); // Video Registers
|
||||
map(0x860000, 0x86003f).ram().w(FUNC(seta2_state::vregs_w)).share("vregs"); // Video Registers
|
||||
map(0x900000, 0x903fff).rw("x1snd", FUNC(x1_010_device::word_r), FUNC(x1_010_device::word_w)); // Sound
|
||||
map(0xfffc00, 0xffffff).rw(m_tmp68301, FUNC(tmp68301_device::regs_r), FUNC(tmp68301_device::regs_w)); // TMP68301 Registers
|
||||
}
|
||||
@ -415,7 +415,7 @@ void seta2_state::penbros_map(address_map &map)
|
||||
map(0x500300, 0x500301).portr("DSW1");
|
||||
map(0x500302, 0x500303).portr("DSW2");
|
||||
map(0x500300, 0x50030f).w(FUNC(seta2_state::sound_bank_w)).umask16(0x00ff);
|
||||
map(0xb60000, 0xb6003f).w(FUNC(seta2_state::vregs_w)).share("vregs");
|
||||
map(0xb60000, 0xb6003f).ram().w(FUNC(seta2_state::vregs_w)).share("vregs");
|
||||
map(0xfffc00, 0xffffff).rw(m_tmp68301, FUNC(tmp68301_device::regs_r), FUNC(tmp68301_device::regs_w));
|
||||
}
|
||||
|
||||
@ -481,7 +481,7 @@ void seta2_state::reelquak_map(address_map &map)
|
||||
map(0xb00000, 0xb03fff).rw("x1snd", FUNC(x1_010_device::word_r), FUNC(x1_010_device::word_w)); // Sound
|
||||
map(0xc00000, 0xc3ffff).ram().share("spriteram"); // Sprites
|
||||
map(0xc40000, 0xc4ffff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette"); // Palette
|
||||
map(0xc60000, 0xc6003f).w(FUNC(seta2_state::vregs_w)).share("vregs"); // Video Registers
|
||||
map(0xc60000, 0xc6003f).ram().w(FUNC(seta2_state::vregs_w)).share("vregs"); // Video Registers
|
||||
map(0xfffc00, 0xffffff).rw(m_tmp68301, FUNC(tmp68301_device::regs_r), FUNC(tmp68301_device::regs_w)); // TMP68301 Registers
|
||||
}
|
||||
|
||||
@ -496,7 +496,7 @@ void seta2_state::namcostr_map(address_map &map)
|
||||
map(0x000000, 0x07ffff).rom(); // ROM
|
||||
map(0x200000, 0x20ffff).ram(); // RAM
|
||||
map(0xc00000, 0xc3ffff).ram().share("spriteram"); // Sprites
|
||||
map(0xc60000, 0xc6003f).w(FUNC(seta2_state::vregs_w)).share("vregs"); // Video Registers
|
||||
map(0xc60000, 0xc6003f).ram().w(FUNC(seta2_state::vregs_w)).share("vregs"); // Video Registers
|
||||
map(0xfffc00, 0xffffff).rw(m_tmp68301, FUNC(tmp68301_device::regs_r), FUNC(tmp68301_device::regs_w)); // TMP68301 Registers
|
||||
}
|
||||
|
||||
@ -537,7 +537,7 @@ void seta2_state::samshoot_map(address_map &map)
|
||||
|
||||
map(0x800000, 0x83ffff).ram().share("spriteram"); // Sprites
|
||||
map(0x840000, 0x84ffff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette"); // Palette
|
||||
map(0x860000, 0x86003f).w(FUNC(seta2_state::vregs_w)).share("vregs"); // Video Registers
|
||||
map(0x860000, 0x86003f).ram().w(FUNC(seta2_state::vregs_w)).share("vregs"); // Video Registers
|
||||
|
||||
map(0x900000, 0x903fff).rw("x1snd", FUNC(x1_010_device::word_r), FUNC(x1_010_device::word_w)); // Sound
|
||||
|
||||
@ -634,7 +634,7 @@ void staraudi_state::staraudi_map(address_map &map)
|
||||
map(0xc00000, 0xc3ffff).ram().share("spriteram"); // Sprites
|
||||
map(0xc40000, 0xc4ffff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette"); // Palette
|
||||
map(0xc50000, 0xc5ffff).ram(); // cleared
|
||||
map(0xc60000, 0xc6003f).w(FUNC(staraudi_state::vregs_w)).share("vregs"); // Video Registers
|
||||
map(0xc60000, 0xc6003f).ram().w(FUNC(staraudi_state::vregs_w)).share("vregs"); // Video Registers
|
||||
map(0xfffc00, 0xffffff).rw(m_tmp68301, FUNC(tmp68301_device::regs_r), FUNC(tmp68301_device::regs_w)); // TMP68301 Registers
|
||||
}
|
||||
|
||||
@ -690,7 +690,7 @@ void seta2_state::telpacfl_map(address_map &map)
|
||||
map(0x900000, 0x903fff).rw("x1snd", FUNC(x1_010_device::word_r), FUNC(x1_010_device::word_w)); // Sound
|
||||
map(0xb00000, 0xb3ffff).ram().share("spriteram"); // Sprites
|
||||
map(0xb40000, 0xb4ffff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette"); // Palette
|
||||
map(0xb60000, 0xb6003f).w(FUNC(seta2_state::vregs_w)).share("vregs"); // Video Registers
|
||||
map(0xb60000, 0xb6003f).ram().w(FUNC(seta2_state::vregs_w)).share("vregs"); // Video Registers
|
||||
map(0xd00006, 0xd00007).r("watchdog", FUNC(watchdog_timer_device::reset16_r));
|
||||
// AM_RANGE(0xe00000, 0xe00001) AM_WRITE
|
||||
map(0xe00010, 0xe0001f).w(FUNC(seta2_state::sound_bank_w)).umask16(0x00ff); // Samples Banks
|
||||
@ -857,7 +857,7 @@ void funcube_state::funcube_map(address_map &map)
|
||||
|
||||
map(0x00800000, 0x0083ffff).rw(FUNC(funcube_state::spriteram_r), FUNC(funcube_state::spriteram_w)).share("spriteram");
|
||||
map(0x00840000, 0x0084ffff).ram().w(m_palette, FUNC(palette_device::write32)).share("palette"); // Palette
|
||||
map(0x00860000, 0x0086003f).w(FUNC(funcube_state::vregs_w)).share("vregs");
|
||||
map(0x00860000, 0x0086003f).ram().w(FUNC(funcube_state::vregs_w)).share("vregs");
|
||||
|
||||
map(0x00c00000, 0x00c002ff).rw(FUNC(funcube_state::nvram_r), FUNC(funcube_state::nvram_w));
|
||||
|
||||
@ -878,7 +878,7 @@ void funcube_state::funcube2_map(address_map &map)
|
||||
|
||||
map(0x00800000, 0x0083ffff).rw(FUNC(funcube_state::spriteram_r), FUNC(funcube_state::spriteram_w)).share("spriteram");
|
||||
map(0x00840000, 0x0084ffff).ram().w(m_palette, FUNC(palette_device::write32)).share("palette");
|
||||
map(0x00860000, 0x0086003f).w(FUNC(funcube_state::vregs_w)).share("vregs");
|
||||
map(0x00860000, 0x0086003f).ram().w(FUNC(funcube_state::vregs_w)).share("vregs");
|
||||
|
||||
map(0x00c00000, 0x00c002ff).rw(FUNC(funcube_state::nvram_r), FUNC(funcube_state::nvram_w));
|
||||
|
||||
@ -909,7 +909,7 @@ READ16_MEMBER(funcube_state::coins_r)
|
||||
|
||||
uint8_t hopper_bit = (m_hopper_motor && !(m_screen->frame_number()%20)) ? 1 : 0;
|
||||
|
||||
const uint64_t coin_total_cycles = FUNCUBE_SUB_CPU_CLOCK.value() / (1000/20);
|
||||
const uint64_t coin_total_cycles = FUNCUBE_SUB_CPU_CLOCK.value() / (1000/10);
|
||||
|
||||
if ( m_coin_start_cycles )
|
||||
{
|
||||
@ -2325,7 +2325,7 @@ MACHINE_CONFIG_START(seta2_state::seta2)
|
||||
MCFG_SCREEN_REFRESH_RATE(60)
|
||||
MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500))
|
||||
MCFG_SCREEN_SIZE(0x200, 0x100)
|
||||
MCFG_SCREEN_VISIBLE_AREA(0x40, 0x1c0-1, 0x00, 0xf0-1)
|
||||
MCFG_SCREEN_VISIBLE_AREA(0x00, 0x180-1, 0x00, 0xf0-1)
|
||||
MCFG_SCREEN_UPDATE_DRIVER(seta2_state, screen_update)
|
||||
MCFG_SCREEN_VBLANK_CALLBACK(WRITELINE(*this, seta2_state, screen_vblank))
|
||||
MCFG_SCREEN_PALETTE("palette")
|
||||
@ -2367,7 +2367,7 @@ MACHINE_CONFIG_START(seta2_state::grdians)
|
||||
|
||||
// video hardware
|
||||
MCFG_SCREEN_MODIFY("screen")
|
||||
MCFG_SCREEN_VISIBLE_AREA(0x80, 0x80 + 0x130 -1, 0x00, 0x00 + 0xe8 -1)
|
||||
MCFG_SCREEN_VISIBLE_AREA(0x00, 0x130-1, 0x00, 0xe8 -1)
|
||||
MACHINE_CONFIG_END
|
||||
|
||||
|
||||
@ -2400,7 +2400,7 @@ MACHINE_CONFIG_START(seta2_state::pzlbowl)
|
||||
|
||||
// video hardware
|
||||
MCFG_SCREEN_MODIFY("screen")
|
||||
MCFG_SCREEN_VISIBLE_AREA(0x10, 0x190-1, 0x00, 0xf0-1)
|
||||
MCFG_SCREEN_VISIBLE_AREA(0x00, 0x180-1, 0x00, 0xf0-1)
|
||||
MACHINE_CONFIG_END
|
||||
|
||||
|
||||
@ -2433,11 +2433,8 @@ MACHINE_CONFIG_START(seta2_state::reelquak)
|
||||
NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0);
|
||||
MCFG_TICKET_DISPENSER_ADD("dispenser", attotime::from_msec(200), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_LOW)
|
||||
|
||||
// video hardware
|
||||
MCFG_SCREEN_MODIFY("screen")
|
||||
MCFG_SCREEN_VISIBLE_AREA(0x40, 0x180-1, 0x00, 0xf0-1)
|
||||
|
||||
MCFG_VIDEO_START_OVERRIDE(seta2_state,xoffset)
|
||||
MCFG_SCREEN_VISIBLE_AREA(0x00, 0x140-1, 0x000, 0x0f0-1)
|
||||
MACHINE_CONFIG_END
|
||||
|
||||
|
||||
@ -2451,9 +2448,8 @@ MACHINE_CONFIG_START(seta2_state::samshoot)
|
||||
|
||||
NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0);
|
||||
|
||||
// video hardware
|
||||
MCFG_SCREEN_MODIFY("screen")
|
||||
MCFG_SCREEN_VISIBLE_AREA(0x40, 0x180-1, 0x00, 0xf0-1)
|
||||
MCFG_SCREEN_VISIBLE_AREA(0x00, 0x140-1, 0x000, 0x0f0-1)
|
||||
MACHINE_CONFIG_END
|
||||
|
||||
|
||||
@ -2468,7 +2464,7 @@ MACHINE_CONFIG_START(staraudi_state::staraudi)
|
||||
// video hardware
|
||||
MCFG_SCREEN_MODIFY("screen")
|
||||
MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)) // not accurate
|
||||
MCFG_SCREEN_VISIBLE_AREA(0x10, 0x150-1, 0x00, 0x0f0-1)
|
||||
MCFG_SCREEN_VISIBLE_AREA(0x00, 0x140-1, 0x000, 0x0f0-1)
|
||||
|
||||
MCFG_GFXDECODE_MODIFY("gfxdecode", gfx_seta2)
|
||||
MACHINE_CONFIG_END
|
||||
@ -2488,8 +2484,7 @@ MACHINE_CONFIG_START(seta2_state::telpacfl)
|
||||
|
||||
// video hardware
|
||||
MCFG_SCREEN_MODIFY("screen")
|
||||
MCFG_SCREEN_VISIBLE_AREA(0x0, 0x180-1, 0x00, 0xf0-1)
|
||||
MCFG_VIDEO_START_OVERRIDE(seta2_state,xoffset1)
|
||||
MCFG_SCREEN_VISIBLE_AREA(0x0, 0x180-1, 0x00, 0xf0-1) // still off by 1 because of different CRTC regs?
|
||||
MACHINE_CONFIG_END
|
||||
|
||||
|
||||
@ -2820,38 +2815,28 @@ ROM_END
|
||||
void funcube_state::init_funcube()
|
||||
{
|
||||
uint32_t *main_cpu = (uint32_t *) memregion("maincpu")->base();
|
||||
uint16_t *sub_cpu = (uint16_t *) memregion("sub")->base();
|
||||
|
||||
main_cpu[0x064/4] = 0x0000042a; // PIC protection?
|
||||
|
||||
// Sub CPU
|
||||
sub_cpu[0x506/2] = 0x5470; // rte -> rts
|
||||
}
|
||||
|
||||
void funcube_state::init_funcube2()
|
||||
{
|
||||
uint32_t *main_cpu = (uint32_t *) memregion("maincpu")->base();
|
||||
uint16_t *sub_cpu = (uint16_t *) memregion("sub")->base();
|
||||
|
||||
main_cpu[0xa5c/4] = 0x4e713e3c; // PIC protection?
|
||||
main_cpu[0xa74/4] = 0x4e713e3c;
|
||||
main_cpu[0xa8c/4] = 0x4e7141f9;
|
||||
|
||||
// Sub CPU
|
||||
sub_cpu[0x4d4/2] = 0x5470; // rte -> rts
|
||||
}
|
||||
|
||||
void funcube_state::init_funcube3()
|
||||
{
|
||||
uint32_t *main_cpu = (uint32_t *) memregion("maincpu")->base();
|
||||
uint16_t *sub_cpu = (uint16_t *) memregion("sub")->base();
|
||||
|
||||
main_cpu[0x008bc/4] = 0x4a804e71;
|
||||
main_cpu[0x19f0c/4] = 0x4e714e71;
|
||||
main_cpu[0x19fb8/4] = 0x4e714e71;
|
||||
|
||||
// Sub CPU
|
||||
sub_cpu[0x4d4/2] = 0x5470; // rte -> rts
|
||||
}
|
||||
|
||||
/***************************************************************************
|
||||
@ -3819,7 +3804,7 @@ ROM_START( staraudi )
|
||||
ROM_LOAD( "lh28f016sat_flash.u08", 0x000000, 0x200000, CRC(002255bd) SHA1(5e94c29e9a785fe49229f57bc94234ac79dd2f3b) )
|
||||
|
||||
ROM_REGION( 0x400000, "x1snd", 0 ) // Samples
|
||||
ROM_LOAD( "su1_snd.u32", 0x000000, 0x400000, CRC(d5376010) SHA1(89fab1fbb45c7cf8acb63c31ecafdeb3482c2fec) ) // BAD, inconsistent reads: FIXED BITS (xxxxxxxx00000000)
|
||||
ROM_LOAD( "su1_snd.u32", 0x000000, 0x400000, BAD_DUMP CRC(d5376010) SHA1(89fab1fbb45c7cf8acb63c31ecafdeb3482c2fec) ) // BAD, inconsistent reads: FIXED BITS (xxxxxxxx00000000)
|
||||
ROM_END
|
||||
|
||||
void staraudi_state::driver_start()
|
||||
|
@ -85,9 +85,6 @@ protected:
|
||||
DECLARE_READ16_MEMBER(spriteram_r);
|
||||
DECLARE_WRITE16_MEMBER(spriteram_w);
|
||||
|
||||
DECLARE_VIDEO_START(xoffset);
|
||||
DECLARE_VIDEO_START(xoffset1);
|
||||
|
||||
void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect);
|
||||
|
||||
uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
|
||||
@ -136,13 +133,9 @@ protected:
|
||||
output_finder<7> m_leds;
|
||||
output_finder<11> m_lamps;
|
||||
|
||||
int m_xoffset;
|
||||
int m_keyboard_row;
|
||||
std::unique_ptr<uint16_t[]> m_buffered_spriteram;
|
||||
|
||||
std::unique_ptr<uint16_t[]> m_private_spriteram;
|
||||
|
||||
|
||||
private:
|
||||
void drawgfx_line(bitmap_ind16 &bitmap, const rectangle &cliprect, int gfx, const uint8_t* const addr, const uint32_t realcolor, int flipx, int flipy, int base_sx, int shadow, int realline, int line, int opaque);
|
||||
inline void get_tile(uint16_t* spriteram, int is_16x16, int x, int y, int page, int& code, int& attr, int& flipx, int& flipy, int& color);
|
||||
|
@ -89,13 +89,13 @@
|
||||
0/2/4/6 Horizontal: Sync, Blank, DSPdot, Cycle (same as ssv.c?)
|
||||
8/a/c/e Vertical : Sync, Blank, DSPdot, Cycle (same as ssv.c?)
|
||||
|
||||
10
|
||||
12 Offset X?
|
||||
10 Offxet X low bits (sub pixels)
|
||||
12 Offset X high bits (pixels)
|
||||
14 Zoom X? low bits
|
||||
16 Zoom X? high bits *
|
||||
|
||||
18
|
||||
1a Offset Y?
|
||||
18 Offset Y low bits (sub pixels)
|
||||
1a Offset Y high bits (pixels)
|
||||
1c Zoom Y? low bits
|
||||
1e Zoom Y? high bits *
|
||||
|
||||
@ -108,8 +108,25 @@
|
||||
|
||||
32..3f ?
|
||||
|
||||
* A value of 0x0100 is means no zoom, a value of 0x0200 will halve the size.
|
||||
A value less than 0x0100 probably means magnification.
|
||||
Global X offset values based on penbros
|
||||
|
||||
0x1c0 - when zoom is smallest
|
||||
counts up to 0x7ff
|
||||
then 0x00 when finished
|
||||
|
||||
counts up to 0x089 when zooming in
|
||||
|
||||
Zoom values (both x and y) based on penbros and others (x flip/unflip logic is reverse of y logic)
|
||||
|
||||
(unflipped gfx)
|
||||
0x7f5 00 = smallest
|
||||
0x7ff 00 = normal
|
||||
0x7ff xx = larger
|
||||
|
||||
(flipped gfx, negative zoom factor!, used instead of flipscreen bits in some cases)
|
||||
0x00b 00 = smallest
|
||||
0x001 00 = normal
|
||||
0x001 xx = larger
|
||||
|
||||
***************************************************************************/
|
||||
|
||||
@ -142,6 +159,9 @@ WRITE16_MEMBER(seta2_state::vregs_w)
|
||||
uint16_t olddata = m_vregs[offset];
|
||||
|
||||
COMBINE_DATA(&m_vregs[offset]);
|
||||
|
||||
// popmessage("%04x %04x", m_vregs[0x1e/2], m_vregs[0x1c/2]);
|
||||
|
||||
if (m_vregs[offset] != olddata)
|
||||
logerror("CPU #0 PC %06X: Video Reg %02X <- %04X\n", m_maincpu->pc(), offset * 2, data);
|
||||
|
||||
@ -172,9 +192,6 @@ WRITE16_MEMBER(seta2_state::vregs_w)
|
||||
case 0x26: // something display list related? buffering control?
|
||||
if (data)
|
||||
{
|
||||
// Buffer sprites by 1 frame
|
||||
//memcpy(m_buffered_spriteram.get(), m_spriteram, m_spriteram.bytes());
|
||||
|
||||
/* copy the base spritelist to a private (non-CPU visible buffer)
|
||||
copy the indexed sprites to 0 in spriteram, adjusting pointers in base sprite list as appropriate
|
||||
this at least gets the sprite data in the right place for the grdians raster effect to write the
|
||||
@ -380,19 +397,36 @@ inline void seta2_state::get_tile(uint16_t* spriteram, int is_16x16, int x, int
|
||||
|
||||
void seta2_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect)
|
||||
{
|
||||
if (!m_vregs.found())
|
||||
return; // ablastb (bootleg) doesn't have obvious video registers, so just abandon, probably needs a different driver
|
||||
|
||||
// Sprites list
|
||||
uint16_t *spriteram = m_spriteram;
|
||||
int global_yoffset = (m_vregs[0x1a/2] & 0x7ff);
|
||||
int global_yoffset = (m_vregs[0x1a/2] & 0x7ff); // and 0x18/2 for low bits
|
||||
if (global_yoffset & 0x400)
|
||||
global_yoffset -= 0x800;
|
||||
|
||||
global_yoffset += 1;
|
||||
global_yoffset += 1; // +2 for myangel / myangel2?
|
||||
|
||||
int global_xoffset = (m_vregs[0x12/2] & 0x7ff); // and 0x10/2 for low bits
|
||||
if (global_xoffset & 0x400)
|
||||
global_xoffset -= 0x800;
|
||||
|
||||
// funcube3 sets a global xoffset of -1 causing a single pixel shift, does something else compensate for it?
|
||||
// note, it also writes a different address for the sprite buffering (related?) but doesn't also have the global zoom set to negative like Star Audition which also writes there.
|
||||
|
||||
int global_xzoom = (m_vregs[0x16/2] & 0x7ff); // and 0x14/2 for low bits
|
||||
|
||||
// HACK: this inverts the zoom on all sprites, thus flipping the screen and altering positions as the origin becomes the right hand side, not left, see star audition (by default) or deer hunting when you turn on horizontal flip
|
||||
// TODO: properly render negative zoom sprites
|
||||
if (global_xzoom & 0x400)
|
||||
{
|
||||
global_xoffset -= 0x14f;
|
||||
}
|
||||
|
||||
uint16_t *s1 = m_private_spriteram.get();
|
||||
|
||||
|
||||
// for ( ; s1 < end; s1+=4 )
|
||||
for (; s1 < &m_private_spriteram[0x1000 / 2]; s1 += 4) // more reasonable (and it cures MAME lockup in e.g. funcube3 boot)
|
||||
for (; s1 < &m_private_spriteram[0x1000 / 2]; s1 += 4)
|
||||
{
|
||||
int num = s1[0];
|
||||
|
||||
@ -422,6 +456,7 @@ void seta2_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect)
|
||||
use_shadow = 0;
|
||||
// which_gfx = 4 << 8;
|
||||
global_yoffset = -0x90;
|
||||
global_xoffset = 0x80;
|
||||
}
|
||||
|
||||
// Number of single-sprites
|
||||
@ -456,6 +491,8 @@ void seta2_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect)
|
||||
if (sy & 0x100)
|
||||
sy -= 0x200;
|
||||
|
||||
sx -= global_xoffset;
|
||||
|
||||
int width = use_global_size ? global_sizex : local_sizex;
|
||||
int height = use_global_size ? global_sizey : local_sizey;
|
||||
|
||||
@ -464,7 +501,6 @@ void seta2_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect)
|
||||
if (!width)
|
||||
continue;
|
||||
|
||||
scrollx += m_xoffset;
|
||||
scrollx &= 0x3ff;
|
||||
scrolly &= 0x1ff;
|
||||
|
||||
@ -472,7 +508,7 @@ void seta2_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect)
|
||||
|
||||
rectangle clip;
|
||||
// sprite clipping region (x)
|
||||
clip.min_x = (sx + xoffs) & 0x3ff;
|
||||
clip.min_x = (sx + xoffs);
|
||||
clip.min_x = (clip.min_x & 0x1ff) - (clip.min_x & 0x200);
|
||||
clip.max_x = clip.min_x + width * 0x10 - 1;
|
||||
|
||||
@ -535,10 +571,10 @@ void seta2_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect)
|
||||
sizey = (1 << ((sizey & 0x0c00) >> 10)) - 1;
|
||||
|
||||
sx += xoffs;
|
||||
sy += yoffs;
|
||||
|
||||
sx = (sx & 0x1ff) - (sx & 0x200);
|
||||
sx -= global_xoffset;
|
||||
|
||||
sy += yoffs;
|
||||
sy += global_yoffset;
|
||||
|
||||
sy &= 0x1ff;
|
||||
@ -611,11 +647,8 @@ void seta2_state::video_start()
|
||||
for (int i = 0; m_gfxdecode->gfx(i); ++i)
|
||||
m_gfxdecode->gfx(i)->set_granularity(16);
|
||||
|
||||
m_buffered_spriteram = std::make_unique<uint16_t[]>(m_spriteram.bytes()/2);
|
||||
m_private_spriteram = make_unique_clear<uint16_t[]>(0x1000 / 2);
|
||||
|
||||
m_xoffset = 0;
|
||||
|
||||
m_realtilenumber = std::make_unique<uint32_t[]>(0x80000);
|
||||
|
||||
m_spritegfx = m_gfxdecode->gfx(0);
|
||||
@ -629,20 +662,6 @@ void seta2_state::video_start()
|
||||
save_pointer(NAME(m_private_spriteram), 0x1000 / 2);
|
||||
}
|
||||
|
||||
VIDEO_START_MEMBER(seta2_state,xoffset)
|
||||
{
|
||||
video_start();
|
||||
|
||||
m_xoffset = 0x200;
|
||||
}
|
||||
|
||||
VIDEO_START_MEMBER(seta2_state,xoffset1)
|
||||
{
|
||||
video_start();
|
||||
|
||||
m_xoffset = 0x1;
|
||||
}
|
||||
|
||||
uint32_t seta2_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
|
||||
{
|
||||
// Black or pen 0?
|
||||
@ -663,12 +682,6 @@ uint32_t seta2_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap,
|
||||
|
||||
WRITE_LINE_MEMBER(seta2_state::screen_vblank)
|
||||
{
|
||||
// rising edge
|
||||
if (state)
|
||||
{
|
||||
// Buffer sprites by 1 frame, moved to video register 0x26, improves grdians intro there
|
||||
//memcpy(m_buffered_spriteram.get(), m_spriteram, m_spriteram.bytes());
|
||||
}
|
||||
}
|
||||
|
||||
// staraudi
|
||||
|
Loading…
Reference in New Issue
Block a user