From 8f5e93ed6fc54b8e17eda7f40f8fb027979117e9 Mon Sep 17 00:00:00 2001 From: David Haywood Date: Fri, 2 Aug 2013 19:09:10 +0000 Subject: [PATCH] more corrections (nw) --- src/mame/machine/pgmprot_igs027a_type1.c | 126 ++++++++++++++++++----- 1 file changed, 103 insertions(+), 23 deletions(-) diff --git a/src/mame/machine/pgmprot_igs027a_type1.c b/src/mame/machine/pgmprot_igs027a_type1.c index 6202a7efb79..683c0897376 100644 --- a/src/mame/machine/pgmprot_igs027a_type1.c +++ b/src/mame/machine/pgmprot_igs027a_type1.c @@ -564,27 +564,93 @@ void pgm_arm_type1_state::command_handler_ddp3(int pc) /* preliminary */ -// not accurate, low bits (0x03 mask) are certainly wrong, possibly others +// not accurate, low bits (0x03 mask) are certainly wrong, possibly others, 0/1 below each shows if i've attempted to automatically verify the value UINT8 puzzli2_level_decode[256] = { -0x32, 0x3e, 0xb2, 0x37, 0x31, 0x22, 0xd6, 0x0d, 0x35, 0x5c, 0x8d, 0x3c, 0x7a, 0x5f, 0xd4, 0xad, -0x53, 0xff, 0xe9, 0x45, 0xed, 0x11, 0x68, 0x77, 0xd8, 0x34, 0x36, 0x45, 0xa6, 0xeb, 0x1c, 0xc7, -0x3b, 0xbd, 0xad, 0x2f, 0x18, 0xde, 0xa1, 0xaa, 0xdd, 0x52, 0x57, 0xc2, 0xe5, 0x0a, 0x01, 0x6d, -0x67, 0x65, 0x14, 0x70, 0xb7, 0x39, 0x27, 0x78, 0x83, 0xd2, 0x71, 0xb9, 0x10, 0xf5, 0x92, 0x93, -0xfa, 0xe4, 0x5e, 0xb0, 0xf6, 0xaf, 0x95, 0x8a, 0x7c, 0x73, 0xf9, 0x63, 0x86, 0xcb, 0x1a, 0x56, -0xf1, 0x3a, 0xae, 0x63, 0x01, 0x29, 0x96, 0x22, 0x8f, 0x5d, 0x9a, 0x65, 0x74, 0x21, 0x20, 0x40, -0xd3, 0x05, 0xa2, 0xe3, 0xbc, 0x9e, 0x1e, 0x10, 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0 , 0 , 0 , +// 1 , 1 , 0 , 1 , 1 , 1 , 1 , 0 , 0 , 1 , 1 , 1 , 1 , 0 , 0 , 0 , + 0xfa, 0x88, 0x06, 0xcf, 0xfe, 0x33, 0xd5, 0x28, 0x1d, 0x19, 0x4a, 0xb1, 0x83, 0xf2, 0x72, 0x26, +// 0 , 0 , 1 , 1 , 1 , 1 , 1 , 1 , 0 , 0 , 1 , 1 , 1 , 1 , 1 , 1 , +// 0 , 0 , 1 , 1 , 1 , 1 , 1 , 1 , 0 , 0 , 0 , 0 , 1 , 1 , 0 , 0 , }; + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + static int hackcount = 0; static int hackcount2 = 0; static int hack_47_value = 0; @@ -1832,7 +1898,7 @@ DRIVER_INIT_MEMBER(pgm_arm_type1_state,puzzli2) int offset; int limit; - UINT8 coverage[256]; + UINT8 coverage[256]; // coverage is how much of the table we've managed to verify using known facts about the table structure for (int i=0;i<256;i++) coverage[i] = 0; @@ -1863,7 +1929,8 @@ DRIVER_INIT_MEMBER(pgm_arm_type1_state,puzzli2) int entries_left = 0; int currentcolumn = 0; int num_entries = 0; - + int full_entry = 0; + int prev_tablloc = 0; int x = 0; for (x=val1; x> 4); + full_entry = rawvalue; + prev_tablloc = tableloc; num_entries = entries_left; @@ -1925,6 +1994,11 @@ DRIVER_INIT_MEMBER(pgm_arm_type1_state,puzzli2) new_puzzli2_level_decode[tableloc] ^= rawvalue; } + coverage[prev_tablloc] = 1; + if (full_entry!=0) + { + printf(" previous value wasn't 0x00"); + } } @@ -1960,15 +2034,21 @@ DRIVER_INIT_MEMBER(pgm_arm_type1_state,puzzli2) printf("\n"); } - + int c=0; for (int i=0;i<256;i++) { - printf("%d ",coverage[i]); - + printf(" %d , ",coverage[i]); + c++; + if (c==16) + { + printf("\n"); + c = 0; + } } printf("\n"); - int c=0; + c=0; + for (int i=0;i<256;i++) { printf("0x%02x, ", new_puzzli2_level_decode[i]);