bowltry.cpp: extensive QA notes, make it to populate display list for the science (#8270)

This commit is contained in:
Angelo Salese 2021-07-08 11:43:02 +02:00 committed by GitHub
parent becc35ab59
commit 40c6a80f6e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,5 +1,5 @@
// license:BSD-3-Clause // license:BSD-3-Clause
// copyright-holders:David Haywood // copyright-holders:David Haywood, Angelo Salese
/************************************************************************************************************ /************************************************************************************************************
Bowling Try! Bowling Try!
@ -7,8 +7,21 @@
(c)200? Atlus (c)200? Atlus
TODO: TODO:
- Tight loops at 0x60e090-0x60e093, control status from video chip? - Decompress YGV631 GFXs (RGB555/RGB565 format?)
- YGV631-B ... what's that? - Add base YGV631 display parsing;
- TT5665 sound interface doesn't quite work, also definitely missing bankswitching behaviour.
Notice that TT5665 works in 0x100000 data ROM banks, but only the first part seems to
have a valid table header?
- serial comms, very verbose;
- I/O, we currently add aggressive hookups for debugging reasons;
- Understand how exactly the mechanical part comes into play.
The only thing available from the net is a cabinet picture, depicting a long bowling lane.
There's no video of this in action, the speculation is that there's a physical ball and pins
that are drawn OSD, and touchscreen sensors that determines hitting point.
- Are we missing an irq event here?
Whatever is happening with rand hookups it doesn't seem to have much impact on the game logic
(i.e. serial always sends a P1 0000, never a P2 or an actual positive score), or even acknowledge the
likely coin insertions, definitely needs some video display to verify.
ATLUS PCB BT-208001 ATLUS PCB BT-208001
------------------------ ------------------------
@ -34,80 +47,121 @@
#include "screen.h" #include "screen.h"
#include "speaker.h" #include "speaker.h"
#define HACK_ENABLED 0
class bowltry_state : public driver_device class bowltry_state : public driver_device
{ {
public: public:
bowltry_state(const machine_config &mconfig, device_type type, const char *tag) bowltry_state(const machine_config &mconfig, device_type type, const char *tag)
: driver_device(mconfig, type, tag) : driver_device(mconfig, type, tag)
, m_maincpu(*this, "maincpu") , m_maincpu(*this, "maincpu")
, m_adpcm(*this, "tt5665")
, m_vregs(*this, "vregs")
{ } { }
void bowltry(machine_config &config); void bowltry(machine_config &config);
protected: protected:
void bowltry_map(address_map &map); void bowltry_map(address_map &map);
void bowltry_io(address_map &map);
uint32_t screen_update_bowltry(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); uint32_t screen_update_bowltry(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
int m_test_x; u16 fake_io_r(offs_t offset);
int m_test_y; u16 vregs_r(offs_t offset, u16 mem_mask = ~0);
int m_start_offs; void vregs_w(offs_t offset, u16 data, u16 mem_mask = ~0);
#if HACK_ENABLED
uint16_t hack_r(offs_t offset);
void hack_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0);
uint16_t m_hack[2];
#endif
required_device<cpu_device> m_maincpu; required_device<h83008_device> m_maincpu;
required_device<tt5665_device> m_adpcm;
required_shared_ptr<u16> m_vregs;
}; };
#if HACK_ENABLED uint32_t bowltry_state::screen_update_bowltry(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
uint16_t bowltry_state::hack_r(offs_t offset)
{ {
if(offset) // YGV display list starts off at top of the VRAM stack,
return m_hack[1] & ~0x20; // and executes in 0x14 byte chunks
// [0x0/2] control word
// 0x8001 always on first entry, jump link (to next entry anyway)?
// 0x0000 on first list POST, used in tandem with entry [2] bit 15 high may be ignore or fill
// 0x4000 on first list POST, same as above plus end of list marker
// 0x2000 on normal execution, draw this object
// 0x6000 on normal execution, draw plus end of list marker (which is either tail or a cut short of a few objects earlier)
// [0xa/2] object number?
// [0xc/2] Y coordinate?
// [0xe/2] X coordinate?
// everything else is always filled with the same data,
// best guess is that SW fills to whatever necessary to "draw a normal sprite with no zoom/transparency etc. etc."
m_hack[0]^=1; return 0;
return m_hack[0];
} }
void bowltry_state::hack_w(offs_t offset, uint16_t data, uint16_t mem_mask) u16 bowltry_state::vregs_r(offs_t offset, u16 mem_mask)
{ {
COMBINE_DATA(&m_hack[offset]); // ---- ---x: vblank
if (offset == 0x090/2)
return (m_vregs[offset] & ~1) | (machine().rand() & 1);
// --x- ---- ---- ----: DMA enable?
// ---- ---- --x- ----: display list trigger, writes 1 then tight loops expecting to clear
// ---- ---- ---- x---: unknown, may be DMA mode
if (offset == 0x092/2)
return (m_vregs[offset] & ~0x20) | (machine().rand() & 0x20);
// other registers sets up stuff like cliprect coords (no CRTC?)
// hard to say without decoded GFXs.
return m_vregs[offset];
}
void bowltry_state::vregs_w(offs_t offset, u16 data, u16 mem_mask)
{
COMBINE_DATA(&m_vregs[offset]);
}
u16 bowltry_state::fake_io_r(offs_t offset)
{
return machine().rand();
} }
#endif
void bowltry_state::bowltry_map(address_map &map) void bowltry_state::bowltry_map(address_map &map)
{ {
map.unmap_value_high(); // map.unmap_value_high();
map(0x000000, 0x07ffff).rom().region("maincpu", 0); map(0x000000, 0x07ffff).rom().region("maincpu", 0);
map(0x080000, 0x083fff).ram(); map(0x080000, 0x083fff).ram();
//map(0x200000, 0x200003).noprw(); // These two are clearly 8-bit inputs
//map(0x240000, 0x240001).noprw(); map(0x200000, 0x200001).r(FUNC(bowltry_state::fake_io_r));
//map(0x400000, 0x400005).noprw(); map(0x200002, 0x200003).r(FUNC(bowltry_state::fake_io_r));
map(0x600000, 0x60ffff).ram(); map(0x200004, 0x200005).nopw();
#if HACK_ENABLED map(0x240000, 0x240001).nopw();
map(0x60e090, 0x60e093).rw(FUNC(bowltry_state::hack_r), FUNC(bowltry_state::hack_w)); // routine at PC=0x8db8 does some intricate checks with the status and work RAM buffers
#endif // if successful it eventually writing at PC=8e28 and onward, including OKI style writings for the other chip as well
// current hookup never gives a valid write except for a 0x78 at POST on both channels ...
// TODO: we also currently hook this up as mirror but the specs definitely mentions having separate L & R channel routings unlike 6295
map(0x400003, 0x400003).rw(m_adpcm, FUNC(tt5665_device::read), FUNC(tt5665_device::write));
map(0x400005, 0x400005).rw(m_adpcm, FUNC(tt5665_device::read), FUNC(tt5665_device::write));
// ygv VRAM, TBD boundaries, may not be all of it?
// SW just aimlessly clears everything in the range at PC=5f28
map(0x600000, 0x60dfff).ram();
map(0x60e000, 0x60ffff).rw(FUNC(bowltry_state::vregs_r), FUNC(bowltry_state::vregs_w)).share("vregs");
}
void bowltry_state::bowltry_io(address_map &map)
{
// these looks either EEPROM or touchscreen style writes, with chip select etc.
// map(0x09, 0x09).r(FUNC(bowltry_state::fake_io_r));
// map(0x0a, 0x0a).r(FUNC(bowltry_state::fake_io_r));
} }
static INPUT_PORTS_START( bowltry ) static INPUT_PORTS_START( bowltry )
INPUT_PORTS_END INPUT_PORTS_END
uint32_t bowltry_state::screen_update_bowltry(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
{
return 0;
}
void bowltry_state::bowltry(machine_config &config) void bowltry_state::bowltry(machine_config &config)
{ {
H83008(config, m_maincpu, 16000000); H83008(config, m_maincpu, 16000000);
m_maincpu->set_addrmap(AS_PROGRAM, &bowltry_state::bowltry_map); m_maincpu->set_addrmap(AS_PROGRAM, &bowltry_state::bowltry_map);
// m_maincpu->set_vblank_int("screen", FUNC(bowltry_state::irq0_line_hold)); // uses vector $64, IMIAB according to the manual (timer/compare B, internal to the CPU) m_maincpu->set_addrmap(AS_IO, &bowltry_state::bowltry_io);
// uses vector $64, IMIAB according to the manual (timer/compare B, internal to the CPU)
// no vblank, most likely handled by YGV video register bit at 0x090/2
// TODO: serial hookup, comms with a LED type ring display?
// it sometimes feeds with "P1" and four zeroes
screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER));
screen.set_refresh_hz(60); screen.set_refresh_hz(60);
@ -122,14 +176,15 @@ void bowltry_state::bowltry(machine_config &config)
/* tt5665 sound */ /* tt5665 sound */
SPEAKER(config, "speaker").front_center(); SPEAKER(config, "speaker").front_center();
TT5665(config, "tt5665", 16000000/4, tt5665_device::ss_state::SS_HIGH, 0).add_route(1, "speaker", 1.0); // guessed, needs to verification TT5665(config, "tt5665", 16000000/4, tt5665_device::ss_state::SS_HIGH, 0).add_route(1, "speaker", 1.0); // clock and SS pin unverified
} }
ROM_START( bowltry ) ROM_START( bowltry )
ROM_REGION( 0x080000, "maincpu", 0 ) ROM_REGION( 0x080000, "maincpu", 0 )
ROM_LOAD16_WORD_SWAP( "u30_v1.00.u30", 0x000000, 0x080000, CRC(2bd47419) SHA1(8fc975340e47ddeedf96e454a6c5372328f28b72) ) ROM_LOAD16_WORD_SWAP( "u30_v1.00.u30", 0x000000, 0x080000, CRC(2bd47419) SHA1(8fc975340e47ddeedf96e454a6c5372328f28b72) )
ROM_REGION( 0x800000, "gfx", 0 ) // ??? ROM_REGION( 0x800000, "gfx", 0 )
// TODO: confirm arrangement
ROM_LOAD16_BYTE( "u27_v1.00.u27", 0x000000, 0x400000, CRC(80f51c25) SHA1(53c21325e7796197c26ca0cf4f8e51bf1e0bdcd3) ) ROM_LOAD16_BYTE( "u27_v1.00.u27", 0x000000, 0x400000, CRC(80f51c25) SHA1(53c21325e7796197c26ca0cf4f8e51bf1e0bdcd3) )
ROM_LOAD16_BYTE( "u28_v1.00.u28", 0x000001, 0x400000, CRC(9cc8b577) SHA1(6ef5cbb83860f88c9c83d4410034c5b528b2138b) ) ROM_LOAD16_BYTE( "u28_v1.00.u28", 0x000001, 0x400000, CRC(9cc8b577) SHA1(6ef5cbb83860f88c9c83d4410034c5b528b2138b) )
@ -138,4 +193,4 @@ ROM_START( bowltry )
ROM_END ROM_END
GAME( 200?, bowltry, 0, bowltry, bowltry, bowltry_state, empty_init, ROT0, "Atlus", "Bowling Try!", MACHINE_IS_SKELETON ) GAME( 200?, bowltry, 0, bowltry, bowltry, bowltry_state, empty_init, ROT0, "Atlus", "Bowling Try!", MACHINE_IS_SKELETON_MECHANICAL )