From 092b273bf60dbd383a97a5ea2449270204550bcf Mon Sep 17 00:00:00 2001 From: Ariane Fugmann Date: Sat, 21 Nov 2015 21:13:10 +0100 Subject: [PATCH 1/6] Model1 - output lamps and drive board commands --- src/mame/drivers/model1.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/mame/drivers/model1.cpp b/src/mame/drivers/model1.cpp index 69f3882fe96..79efbc2c9b0 100644 --- a/src/mame/drivers/model1.cpp +++ b/src/mame/drivers/model1.cpp @@ -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 set_led_status(machine(), 0, data & 0x4); // START (1) set_led_status(machine(), 1, data & 0x8); // VIEW1 (START2 - VF) set_led_status(machine(), 2, data & 0x10); // VIEW2 (VIEW - SWA) @@ -670,6 +672,11 @@ WRITE16_MEMBER(model1_state::io_w) set_led_status(machine(), 4, data & 0x40); // VIEW4 set_led_status(machine(), 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); From 2936148bb6f80182774825786a1b4bf2641e6b3e Mon Sep 17 00:00:00 2001 From: Ariane Fugmann Date: Tue, 19 Jan 2016 00:02:23 +0100 Subject: [PATCH 2/6] Model1: fix TGP parser crashing MAME --- src/mame/video/model1.cpp | 32 +++++++++++++++++++------------- 1 file changed, 19 insertions(+), 13 deletions(-) diff --git a/src/mame/video/model1.cpp b/src/mame/video/model1.cpp index 65d0b2846cc..dff675674bf 100644 --- a/src/mame/video/model1.cpp +++ b/src/mame/video/model1.cpp @@ -1198,11 +1198,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) { - case 0: + switch(type) { + case 0x0: + LOG_TGP(("VIDEO: unknown type %x\n", type)); list += 2; break; - case 1: + case 0x1: + case 0x41: // 1 = plane 1 // 2 = ?? draw object (413d3, 17c4c, e) // 3 = plane 2 @@ -1214,10 +1216,10 @@ void model1_state::tgp_render(bitmap_rgb32 &bitmap, const rectangle &cliprect) push_object(readi(list+2), readi(list+4), readi(list+6)); list += 8; break; - case 2: + case 0x2: list = draw_direct(bitmap, cliprect, list+2); break; - case 3: + case 0x3: LOG_TGP(("VIDEO: viewport (%d, %d, %d, %d, %d, %d, %d)\n", readi(list+2), readi16(list+4), readi16(list+6), readi16(list+8), @@ -1236,7 +1238,7 @@ void model1_state::tgp_render(bitmap_rgb32 &bitmap, const rectangle &cliprect) list += 16; break; - case 4: { + case 0x4: { int adr = readi(list+2); int len = readi(list+4)+1; int i; @@ -1246,11 +1248,12 @@ void model1_state::tgp_render(bitmap_rgb32 &bitmap, const rectangle &cliprect) list += 6+len*2; break; } - case 5: + case 0x5: { int adr = readi(list+2); int len = readi(list+4); int i; + LOG_TGP(("VIDEO: write poly ram, adr=%x, len=%x\n", adr, len)); for(i=0;izoomx = readf(list+2)*4; view->zoomy = readf(list+4)*4; @@ -1322,10 +1325,12 @@ void model1_state::tgp_render(bitmap_rgb32 &bitmap, const rectangle &cliprect) list += 6; break; case 0xf: + // end of list + LOG_TGP(("VIDEO: end of list\n")); //case -1: goto end; default: - LOG_TGP(("VIDEO: unknown type %d\n", type)); + LOG_TGP(("VIDEO: unknown type %x\n", type)); goto end; } } @@ -1361,6 +1366,7 @@ void model1_state::tgp_scan() list += 2; break; case 1: + case 41: list += 8; break; case 2: @@ -1430,7 +1436,7 @@ void model1_state::tgp_scan() case -1: goto end; default: - LOG_TGP(("VIDEO: unknown type %d\n", type)); + LOG_TGP(("VIDEO: unknown type %x\n", type)); goto end; } } From 50f27e3ed3794160c93ca27d488bf1f9236c027f Mon Sep 17 00:00:00 2001 From: Ariane Fugmann Date: Sat, 4 Jun 2016 09:42:14 +0200 Subject: [PATCH 3/6] Revert "Model1: fix TGP parser crashing MAME" This reverts commit 2936148bb6f80182774825786a1b4bf2641e6b3e. --- src/mame/video/model1.cpp | 32 +++++++++++++------------------- 1 file changed, 13 insertions(+), 19 deletions(-) diff --git a/src/mame/video/model1.cpp b/src/mame/video/model1.cpp index 6625affdd16..f8f7244cf30 100644 --- a/src/mame/video/model1.cpp +++ b/src/mame/video/model1.cpp @@ -1198,13 +1198,11 @@ void model1_state::tgp_render(bitmap_rgb32 &bitmap, const rectangle &cliprect) for(;;) { int type = (list[1]<<16)|list[0]; m_glist=list; - switch(type) { - case 0x0: - LOG_TGP(("VIDEO: unknown type %x\n", type)); + switch(type & 15) { + case 0: list += 2; break; - case 0x1: - case 0x41: + case 1: // 1 = plane 1 // 2 = ?? draw object (413d3, 17c4c, e) // 3 = plane 2 @@ -1216,10 +1214,10 @@ void model1_state::tgp_render(bitmap_rgb32 &bitmap, const rectangle &cliprect) push_object(readi(list+2), readi(list+4), readi(list+6)); list += 8; break; - case 0x2: + case 2: list = draw_direct(bitmap, cliprect, list+2); break; - case 0x3: + case 3: LOG_TGP(("VIDEO: viewport (%d, %d, %d, %d, %d, %d, %d)\n", readi(list+2), readi16(list+4), readi16(list+6), readi16(list+8), @@ -1238,7 +1236,7 @@ void model1_state::tgp_render(bitmap_rgb32 &bitmap, const rectangle &cliprect) list += 16; break; - case 0x4: { + case 4: { int adr = readi(list+2); int len = readi(list+4)+1; int i; @@ -1248,12 +1246,11 @@ void model1_state::tgp_render(bitmap_rgb32 &bitmap, const rectangle &cliprect) list += 6+len*2; break; } - case 0x5: + case 5: { int adr = readi(list+2); int len = readi(list+4); int i; - LOG_TGP(("VIDEO: write poly ram, adr=%x, len=%x\n", adr, len)); for(i=0;izoomx = readf(list+2)*4; view->zoomy = readf(list+4)*4; @@ -1325,12 +1322,10 @@ void model1_state::tgp_render(bitmap_rgb32 &bitmap, const rectangle &cliprect) list += 6; break; case 0xf: - // end of list - LOG_TGP(("VIDEO: end of list\n")); //case -1: goto end; default: - LOG_TGP(("VIDEO: unknown type %x\n", type)); + LOG_TGP(("VIDEO: unknown type %d\n", type)); goto end; } } @@ -1366,7 +1361,6 @@ void model1_state::tgp_scan() list += 2; break; case 1: - case 41: list += 8; break; case 2: @@ -1436,7 +1430,7 @@ void model1_state::tgp_scan() case -1: goto end; default: - LOG_TGP(("VIDEO: unknown type %x\n", type)); + LOG_TGP(("VIDEO: unknown type %d\n", type)); goto end; } } From 128a6a28806e8f93b5438683d2babb150f41ce7b Mon Sep 17 00:00:00 2001 From: Ariane Fugmann Date: Sat, 4 Jun 2016 10:30:35 +0200 Subject: [PATCH 4/6] Model1: Fix TGP parser crashing --- src/mame/video/model1.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/mame/video/model1.cpp b/src/mame/video/model1.cpp index 2c90eaceb25..51ff89e945b 100644 --- a/src/mame/video/model1.cpp +++ b/src/mame/video/model1.cpp @@ -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: From 7e99816b6354818dad762bfaabfbc159ec4b512e Mon Sep 17 00:00:00 2001 From: Ariane Fugmann Date: Sat, 4 Jun 2016 10:33:02 +0200 Subject: [PATCH 5/6] Revert "Model1: Fix TGP parser crashing" This reverts commit 128a6a28806e8f93b5438683d2babb150f41ce7b. --- src/mame/video/model1.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/mame/video/model1.cpp b/src/mame/video/model1.cpp index 51ff89e945b..2c90eaceb25 100644 --- a/src/mame/video/model1.cpp +++ b/src/mame/video/model1.cpp @@ -1303,13 +1303,12 @@ void model1_state::tgp_render(bitmap_rgb32 &bitmap, const rectangle &cliprect) for (;;) { int type = (list[1] << 16) | list[0]; m_glist = list; - switch (type) + switch (type & 15) { case 0: list += 2; break; case 1: - case 0x41: // 1 = plane 1 // 2 = ?? draw object (413d3, 17c4c, e) // 3 = plane 2 @@ -1464,7 +1463,6 @@ void model1_state::tgp_scan() list += 2; break; case 1: - case 0x41: list += 8; break; case 2: From de476b8ad8b0e713e6e539582e1f92a7f5195a25 Mon Sep 17 00:00:00 2001 From: Ariane Fugmann Date: Sat, 4 Jun 2016 10:41:11 +0200 Subject: [PATCH 6/6] Model1: fix TGP parser crashing fix the model 1 TGP crashing the emulation ( mame testers 6123 ) --- src/mame/video/model1.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/mame/video/model1.cpp b/src/mame/video/model1.cpp index 2a4a192d039..b22d6f67410 100644 --- a/src/mame/video/model1.cpp +++ b/src/mame/video/model1.cpp @@ -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: