Merge pull request #921 from SailorSat/master

Fix TGP parser crashing in Model 1 [SailorSat]
This commit is contained in:
R. Belmont 2016-06-05 13:54:50 -04:00
commit 972212518e
2 changed files with 11 additions and 2 deletions

View File

@ -662,7 +662,9 @@ READ16_MEMBER(model1_state::io_r)
WRITE16_MEMBER(model1_state::io_w)
{
if(offset == 0x0f){
// tested in vr, vf, swa, wingwar
// lamp and coinmeters
// 0x01 = COIN METER 1
// 0x02 = COIN METER 2
output().set_led_value(0, data & 0x4); // START (1)
output().set_led_value(1, data & 0x8); // VIEW1 (START2 - VF)
output().set_led_value(2, data & 0x10); // VIEW2 (VIEW - SWA)
@ -670,6 +672,11 @@ WRITE16_MEMBER(model1_state::io_w)
output().set_led_value(4, data & 0x40); // VIEW4
output().set_led_value(5, data & 0x80); // RACE LEADER
m_lamp_state = data;
output().set_digit_value(1, data);
return;
} else if (offset == 0x11) {
// drive board commands
output().set_digit_value(0, data);
return;
}
logerror("IOW: %02x %02x\n", offset, data);

View File

@ -1303,12 +1303,13 @@ void model1_state::tgp_render(bitmap_rgb32 &bitmap, const rectangle &cliprect)
for (;;) {
int type = (list[1] << 16) | list[0];
m_glist = list;
switch (type & 15)
switch (type)
{
case 0:
list += 2;
break;
case 1:
case 0x41:
// 1 = plane 1
// 2 = ?? draw object (413d3, 17c4c, e)
// 3 = plane 2
@ -1463,6 +1464,7 @@ void model1_state::tgp_scan()
list += 2;
break;
case 1:
case 0x41:
list += 8;
break;
case 2: