SAD Version 5 (alpha)
-
- Posts: 88
- Joined: 2023 Oct 22, 22:13
- Location: New Zealand
- Vehicle Information: Several Kit cars, Ford (Europe), EEC-IV, TVR Vixen, Tasmin (a.k.a Wedge),
Engine - Cologne 2.8 V6 (Europe) catch code 'AA'.
EEC_Disassembler https://github.com/tvrfan/EEC-IV-disassembler
Re: SAD Version 5 (alpha)
Thanks for KIEE will put that in my test set.
Yes, not fixed 'if (0 > 0) ' etc yet... on my list to do. Also may put back the 'gap scanner' for missing code.
I wanted to get the basic analysis correct as much as possible before putting more guesswork back (which is what it is, kind of).
V4 produced some false matches so I took the scanners out.
Names -
I have changed stuff over time to match the Ford manuals, which did appear publicly after I started SAD.
I don't mind which way round, I chose the Ford version to start with, but whatever everyone prefers... same for Special Func Registers - currently uses the handbook names, but can change to suit. Some 8065 may still be wrong as it can have several different modes for output etc. And I think it's set by hardware, so no (easy) way to tell from the binary.
Note - 5.0.7 does better on missed arguments after a fix, but M0M2 still not right.
Yes, not fixed 'if (0 > 0) ' etc yet... on my list to do. Also may put back the 'gap scanner' for missing code.
I wanted to get the basic analysis correct as much as possible before putting more guesswork back (which is what it is, kind of).
V4 produced some false matches so I took the scanners out.
Names -
I have changed stuff over time to match the Ford manuals, which did appear publicly after I started SAD.
I don't mind which way round, I chose the Ford version to start with, but whatever everyone prefers... same for Special Func Registers - currently uses the handbook names, but can change to suit. Some 8065 may still be wrong as it can have several different modes for output etc. And I think it's set by hardware, so no (easy) way to tell from the binary.
Note - 5.0.7 does better on missed arguments after a fix, but M0M2 still not right.
-
- Posts: 280
- Joined: 2021 Feb 16, 15:46
- Location: Australia
- Vehicle Information: 95 Escort RS Cosworth
2.0 YBP
CARD / QUIK / COSY / ANTI
GHAJ0
SMD-190 / SMD-490 EEC-IV
Binary Editor
ForDiag
Re: SAD Version 5 (alpha)
Thank you for adding KIEE to your test suite.
For code basics I'm seeing lots of code in all banks overlooked in RZASAMY with 5.07.
Code: Select all
# Call from L1B3F7 ?1B358?
# Call from L1B565 ?1B563?
# Call from L1B6D8 ?1B6CE?
# Call from L1B71C ?1B6EF?
# Call from L1B78F ?1B76C?
# Call from L1B8D8 ?1B8CB?
# Call from L1B975 ?1B96A?
# Call from L1BAEC ?1BAC7?
# Call from L1BB16 ?1BAC7?
# Call from L1BB30 ?1BAC7?
# Call from L1C459 ?1C30E?
# Call from L1C69D ?1C635?
021b6: f2,71,df,36,71,bf ???
021bc: 36,a1,66,96,46,b1 ???
021c2: ff,3e,c7,01,04,f4 ???
021c8: 3e,c7,d4,7b,00,c7 ???
021ce: 01,05,f4,00,b1,0a ???
021d4: 44,c4,3e,13,c0,3c ???
# JNE from L021DE ?021B6?
021da: 06,98,3e,13,d7,f5 ???
021e0: 0c,04,3c,67,ce,2e ???
021e6: 3c,c3,d4,76,3c,71 ???
# SJump from L02319 ?021B6?
021ec: fe,36,fa,29,4b,47 ???
021f2: ce,2c,06,32,b2,46 ???
021f8: 28,2a,8a,3f,0a,fd ???
# JB from L021FB HSO_BUFF_FULL = 1 ?021B6?
021fe: 11,1f,a0,32,0e,b1 ???
02204: 2a,0d,07,46,89,69 ???
0220a: 96,46,d3,04,a1,66 ???
02210: 96,46,a0,06,3c,08 ???
# JNC from L0220C ?021B6?
02216: 01,3c,47,ce,08,3c ???
0221c: 24,01,40,11,2c,b1 ???
# SJump from L022DB ?021B6?
02222: 01,28,17,05,a0,06 ???
# JB from L02239 B1_TMP1H = 1 ?021B6?
# SJump from L0225E ?021B6?
02228: 3c,08,01,3c,68,24 ???
0222e: 3c,3f,3d,02,20,b1 ???
# JB from L0222F B7_TMP5H = 1 ?021B6?
02234: b3,2f,8c,00,35,39 ???
0223a: 35,e8,47,ce,04,06 ???
02240: 3c,b3,cf,b6,00,31 ???
02246: b3,cf,b7,00,3e,b0 ???
# JNB from L02258 B1_TMP1H = 0 ?021B6?
0224c: 3e,30,b3,2f,8c,00 ???
# DJNZ from L0225B ?021B6?
02252: 35,e0,31,02,20,08 ???
# DJNZ from L02253 ?021B6?
02258: 31,35,f0,e0,30,f0 ???
0225e: 27,c4,a3,ce,02,30 ???
# SJump from L02256 ?021B6?
# JNC from L022A1 ?021B6?
# JB from L02268 B7_TMP6H = 1 ?021B6?
02264: 48,3c,06,3e,3f,3f ???
0226a: f9,b3,2f,8c,00,35 ???
# DJNZ from L02275 ?021B6?
02270: 31,35,02,17,30,e0 ???
# JNB from L02270 B1_TMP1H = 0 ?021B6?
02276: 31,f3,11,2b,9a,ce ???
0227c: 30,d1,05,90,28,2c ???
02282: 17,2b,99,01,40,d1 ???
# JLEU from L0227D ?021B6?
02288: 11,08,01,3a,d3,05 ???
0228e: 38,2b,09,20,03,30 ???
# JNC from L0228C ?021B6?
02294: 2b,04,85,08,84,3a ???
# SJump from L02291 ?021B6?
# JLEU from L02287 ?021B6?
# JB from L0228E B0_TEMP3H = 1 ?021B6?
# JNB from L02293 B0_TEMP3H = 0 ?021B6?
0229a: 67,ce,06,3c,19,01 ???
022a0: 28,d3,bd,c7,41,04 ???
022a6: f4,2c,99,01,40,d9 ???
022ac: 25,df,1f,34,2d,3b ???
# JE from L022EB ?021B6?
022b2: 47,ce,1e,06,32,28 ???
022b8: 83,28,db,29,ee,a0 ???
022be: 32,3c,08,01,32,47 ???
022c4: ce,0a,32,24,a1,91 ???
022ca: 37,3a,20,04,67,ce ???
# JE from L022AD ?021B6?
022d0: 0c,24,07,40,28,5c ???
# JGTU from L022AB ?021B6?
# SJump from L022CC ?021B6?
022d6: 99,0b,40,df,02,27 ???
022dc: 42,88,00,3a,df,39 ???
# JE from L022D9 ?021B6?
022e2: 91,01,36,34,2d,05 ???
# SJump from L02232 ?021B6?
022e8: 88,00,40,df,c5,3f ???
# JNB from L022AF B4_TEMP4H = 0 ?021B6?
# JNB from L022E5 B4_TEMP4H = 0 ?021B6?
# JB from L022ED HSO_BUFF_FULL = 1 ?021B6?
022ee: 0a,fd,11,1f,45,03 ???
022f4: 00,06,0e,b1,0a,0d ???
022fa: fb,34,2d,2d,28,2d ???
02300: 15,44,df,27,c4,3e ???
# JNE from L0230D ?021B6?
02306: 13,c0,3c,06,98,3e ???
0230c: 13,d7,f5,0c,04,3c ???
02312: 6b,d4,76,3c,37,3d ???
02318: 12,26,d0,28,1f,fb ???
# JE from L022E0 ?021B6?
0231e: 91,40,36,28,0a,3f ???
02324: 45,05,10,01,ef,83 ???
0232a: 98,f3,f0,47,ce,22 ???
# JNB from L022FB B4_TEMP4H = 0 ?021B6?
# JE from L02302 ?021B6?
# JNB from L02316 B7_TMP5H = 0 ?021B6?
# JB from L02323 B7_TMP9H = 1 ?021B6?
# SCall from L022FE ?021B6?
# SCall from L02321 ?021B6?
02330: 06,3c,17,05,48,3c ???
# SCall from L022D4 ?021B6?
# JB from L02338 B7_TMP6H = 1 ?02332?
# SCall from L02479 ?02436?
# SCall from L024A1 ?02485?
02336: 06,3e,3f,3f,f7,f0 ???
# SCall from L021EF ?021B6?
# SCall from L022B7 ?021B6?
# SCall from L0231B ?021B6?
# Call from L1BE8D ?1BE87?
0233c: f2,b3,2f,8a,00,3e ???
02342: 38,3e,1c,c7,2e,3d ???
02348: 00,a1,f2,2b,3e,10 ???
0234e: 01,ef,9c,9b,c3,2e ???
02354: 3c,3e,10,01,ef,93 ???
0235a: 9b,c3,2e,3c,3e,20 ???
02360: 09,91,08,b6,ef,f9 ???
# JB from L02342 B0_TMP6L = 1 ?0233C?
02366: 04,71,f7,b6,a1,40 ???
# SJump from L0235F ?0233C?
0236c: 0f,42,a1,ed,cb,3c ???
02372: c7,42,22,3c,c7,42 ???
02378: 2e,3d,a1,ff,ff,3e ???
0237e: c3,42,21,3e,c7,01 ???
02384: 62,0f,3c,c7,01,6e ???
0238a: 0f,3d,b1,41,42,c3 ???
02390: 01,6a,0f,42,f3,f0 ???
# SCall from L022B9 ?021B6?
02396: a3,da,78,24,a1,15 ???
0239c: 46,28,10,01,ef,a4 ???
023a2: 94,c3,da,78,24,a3 ???
023a8: da,7a,24,a1,2d,57 ???
023ae: 28,10,01,ef,93,94 ???
023b4: c3,da,7a,24,a3,da ???
023ba: 7c,24,a1,dd,be,28 ???
023c0: 10,01,ef,82,94,c3 ???
023c6: da,7c,24,10,01,ef ???
023cc: 2c,a3,b1,03,2c,b3 ???
023d2: 01,02,f4,c4,3e,c4 ???
023d8: 19,3f,45,29,b1,13 ???
023de: 28,c7,da,77,2c,a1 ???
023e4: f7,08,26,b1,07,29 ???
023ea: 28,4a,67,ce,20,32 ???
023f0: 20,36,b1,0f,28,b1 ???
# JB from L023D6 B6_FLAGTEMP_BG = 1 ?02396?
023f6: 03,2c,a1,2c,00,26 ???
023fc: b1,02,29,28,35,28 ???
02402: 26,20,23,b1,11,28 ???
# JB from L023D9 B7_TMP9H = 1 ?02396?
02408: c7,01,2f,f4,2c,a1 ???
0240e: 2f,f4,26,32,2d,09 ???
02414: c7,01,37,f4,2c,a1 ???
0241a: 37,f4,26,b1,07,29 ???
# JNB from L02411 B2_TEMP4H = 0 ?02396?
02420: 28,14,28,05,67,ce ???
02426: 1c,32,f0,b0,3a,28 ???
# SJump from L023F0 ?02396?
# SJump from L02403 ?02396?
# SCall from L02401 ?02396?
# SCall from L02422 ?02396?
0242c: b0,3b,2c,a1,2c,00 ???
02432: 26,b1,02,29,a1,91 ???
# SCall from L023EA ?02396?
# SCall from L023FF ?02396?
# SCall from L02420 ?02396?
02438: 37,3a,b1,08,2a,28 ???
# DJNZ from L02481 ?02436?
# DJNZ from L0247B ?02436?
0243e: 6c,47,ce,28,32,3c ???
02444: a3,ce,2a,3e,11,2b ???
0244a: 18,01,28,d3,0b,47 ???
02450: ce,24,32,3c,a3,ce ???
02456: 26,3e,17,2b,3f,0a ???
# JNC from L0244D ?02436?
# JB from L0245A HSO_BUFF_FULL = 1 ?02436?
0245c: fd,11,1f,a0,3c,0e ???
02462: b1,2a,0d,64,3e,32 ???
02468: 08,01,3a,d3,05,38 ???
0246e: 2b,09,20,03,30,2b ???
# JNC from L0246B ?02436?
02474: 04,85,08,84,3a,2e ???
# SJump from L02470 ?02436?
# JB from L0246D B0_TEMP3H = 1 ?02436?
# JNB from L02472 B0_TEMP3H = 0 ?02436?
0247a: b7,e0,2a,bf,b2,27 ???
02480: 28,e0,29,b6,f0,b1 ???
# SCall from L021F9 ?021B6?
02486: 08,2a,b1,2a,2b,18 ???
# DJNZ from L024A7 ?02485?
0248c: 01,28,d3,03,b1,0a ???
02492: 2b,3f,0a,fd,11,1f ???
# JNC from L0248E ?02485?
# JB from L02493 HSO_BUFF_FULL = 1 ?02485?
02498: a0,32,0e,b0,2b,0d ???
0249e: a0,32,3c,2e,8f,67 ???
024a4: ce,2c,32,e0,2a,de ???
024aa: f0,3f,0a,fd,11,1f ???
# SCall from L022BB ?021B6?
# SCall from L0243D ?02436?
# JB from L024AB HSO_BUFF_FULL = 1 ?024AB?
024b0: a0,32,0e,b1,0a,0d ???
024b6: f0 ???
# JNB from L024C4 DATA = 0 ?024AB?
024b7: 09,0b,00 shlw R0,b ZERO <<= b;
024ba: 09,03,00 shlw R0,3 ZERO <<= 3;
024bd: 3a,0a,07 jb B2,Ra,024c7 if (DATA = 0) {
Also seeing a lot of Bank 3 gremlins.
Code: Select all
# JNE from L02CDB Sub_0297b
02cca: b3,4d,60,99,04 ldb R4,[R4c+9960] AD_Cmd = [FGTMP2L+39960];
# JNB from L02CCF ATOD = 0 B0_Sub_0297b
02ccf: 33,0a,fd jnb B3,Ra,02ccf if (ATOD = 0) goto 02ccf;
02cd2: 51,0f,04,49 an3b R49,R4,f FGTMP0H = ATOD_LOW & f;
02cd6: 9b,4d,60,99,49 cmpb R49,[R4c+9960]
02cdb: d7,ed jne 02cca if (FGTMP0H != [FGTMP2L+39960]) goto 02cca;
02cdd: 51,f0,04,4e an3b R4e,R4,f0 FGTMP3L = ATOD_LOW & f0;
02ce1: b0,05,4f ldb R4f,R5 FGTMP3H = ATOD_HI;
02ce4: c3,4d,20,04,4e stw R4e,[R4c+420] [FGTMP2L+30420] = FGTMP3L;
02ce9: c3,4b,00,04,4e stw R4e,[R4a+400] [FGTMP1L+30400] = FGTMP3L;
02cee: 20,49 sjmp 02d39 goto 02d39; }
# JE from L02CC8 Sub_0297b
02cf0: af,f0,02,52 ldzbw R52,[Rf0+2] FGTMP5L = AICE_?x2;
02cf4: 08,01,52 shrw R52,1 FGTMP5L >>= 1;
# JNE from L02D2D Sub_0297b
02cf7: b3,4d,5c,99,4e ldb R4e,[R4c+995c] FGTMP3L = [FGTMP2L+3995c];
-
- Posts: 240
- Joined: 2023 Sep 06, 13:11
- Location: Charlotte NC , USA
- Vehicle Information: 1999 Ford Ranger with 2000 Explorer v8 swap, FLN0
2003 Ford F150 Harley Davidson, Built 5.4L SOHC with 3.4L Whipple and Built 4R100
Re: SAD Version 5 (alpha)
Ah, ok. So... The PSW_V is replacing the OVF? So the old version of SAD was definitely wrong in the screen shot I posted above? Just trying to understand. Sorry if this is in the wrong post.The choice of V instead OVF, is intended to align SAD with the Manuals and Handbook.
When SAD was first released the manuals and handbook were not publicly available, so OVF was chosen on other criteria.
Now, the user can search the manuals and find PSW and the V flag to understand the meaning.
-
- Posts: 240
- Joined: 2023 Sep 06, 13:11
- Location: Charlotte NC , USA
- Vehicle Information: 1999 Ford Ranger with 2000 Explorer v8 swap, FLN0
2003 Ford F150 Harley Davidson, Built 5.4L SOHC with 3.4L Whipple and Built 4R100
Re: SAD Version 5 (alpha)
As someone who is completely new to all this, I like the names matching the handbook and other posted docs. It makes it easier to search for something if I don't understand it.Names -
I have changed stuff over time to match the Ford manuals, which did appear publicly after I started SAD.
I don't mind which way round, I chose the Ford version to start with, but whatever everyone prefers... same for Special Func Registers - currently uses the handbook names, but can change to suit. Some 8065 may still be wrong as it can have several different modes for output etc. And I think it's set by hardware, so no (easy) way to tell from the binary.
-
- Posts: 88
- Joined: 2023 Oct 22, 22:13
- Location: New Zealand
- Vehicle Information: Several Kit cars, Ford (Europe), EEC-IV, TVR Vixen, Tasmin (a.k.a Wedge),
Engine - Cologne 2.8 V6 (Europe) catch code 'AA'.
EEC_Disassembler https://github.com/tvrfan/EEC-IV-disassembler
Re: SAD Version 5 (alpha)
Yes, that was the plan - use the Ford names to make them match in the manuals.BOOSTEDEVERYTHING wrote: ↑2024 Jan 24, 13:02
As someone who is completely new to all this, I like the names matching the handbook and other posted docs. It makes it easier to search for something if I don't understand it.
Overflow versus operands (PSW_V) - It wasn't always wrong in listings, just enough times to make me ditch it for now. Better than misleading someone.
-
- Posts: 280
- Joined: 2021 Feb 16, 15:46
- Location: Australia
- Vehicle Information: 95 Escort RS Cosworth
2.0 YBP
CARD / QUIK / COSY / ANTI
GHAJ0
SMD-190 / SMD-490 EEC-IV
Binary Editor
ForDiag
Re: SAD Version 5 (alpha)
Yes, PSW_V replaces OVF.BOOSTEDEVERYTHING wrote: ↑2024 Jan 24, 12:59 Ah, ok. So... The PSW_V is replacing the OVF? So the old version of SAD was definitely wrong in the screen shot I posted above? Just trying to understand. Sorry if this is in the wrong post.
Code: Select all
030df: 68,52,48 sb2w R48,R52 FGTMP0L -= FGTMP5L;
030e2: d5,08 jnv 030ec if (FGTMP0L >= 0) {
If FGTMPOL changed from d32768 to d32767, PSW_V would be set, so continue.
In this case it is correct.
If FGTMPOL changed from d32767 to d32766, PSW_V would be clear, so jump.
In this case it is wrong.
-
- Posts: 28
- Joined: 2022 Jul 08, 04:54
- Location: South Australia
- Vehicle Information: 1995 ford falcon ute 5.0 windsor efi
Re: SAD Version 5 (alpha)
Andy i think sad 5.0.7 may be not displaying added Rbase R22 in my 3DBC LST.
(3DBC) the other Rbase are commented out as they are only there for my reference.
5.0.6 dir
5.0.6 lst
sad 5.0.7 dir
i tried using the Rbase over a range like i had previously but all 3 dont appear to be working for me.
tried each individual over address range befor commenting them out and trying Rbase 22 0437.
sad 5.0.7 lst
(3DBC) the other Rbase are commented out as they are only there for my reference.
5.0.6 dir
Code: Select all
### Symbol list ###
#rbase 72 46e
#rbase a2 37c
#rbase bc 180
#rbase be 280
rbase 22 0437 2455 251c
sym 2 "CPU_OK" :B 6 # auto
sym 2 "LSO_Port" # auto
Code: Select all
Sub_2445_kam_qualification_test_logic:
2445: a1,37,04,22 ldw R22,437 R22 = 437_?kam_bit_flags?;
2449: 71,7f,28 an2b R28,7f FlgR28_B7_kamok = 0;
244c: b1,aa,42 ldb R42,aa R42 = aa;
244f: b1,c6,30 ldb R30,c6 Scr30 = c6;
2452: b1,75,32 ldb R32,75 R32 = 75;
2455: 9b,22,b7,42 cmpb R42,[R22+b7]
2459: d7,2f jne 248a if (R42 = 3ee_KAMQA) { # [r22-49] 437-49=3EE ? kamqa? LOWEST ADDRESS OF KAM # KAMQA aa= 10101010 BINARY
245b: 9b,22,27,30 cmpb R30,[R22+27]
245f: d7,29 jne 248a if (Scr30 = 45e_KAMQB) { # [r22+27] 437+27=45E ? kamqb? MIDDLE ADDRESS OF KAM # KAMQB c6= 11000110 BINARY
2461: 9b,22,50,32 cmpb R32,[R22+50]
2465: d7,23 jne 248a if (R32 = 487_KAMQC) {
i tried using the Rbase over a range like i had previously but all 3 dont appear to be working for me.
tried each individual over address range befor commenting them out and trying Rbase 22 0437.
Code: Select all
### Symbol list ###
rbase 22 0437
#rbase 22 0437 2455 251c
#rbase 22 0437 8504 8623
#rbase 72 46e
#rbase a2 37c
#rbase bc 180
#rbase be 280
Code: Select all
Sub_2445_kam_qualification_test_logic:
2445: a1,37,04,22 ldw R22,437 R22 = 437_?kam_bit_flags?;
2449: 71,7f,28 an2b R28,7f FlgR28_B7_kamok = 0;
244c: b1,aa,42 ldb R42,aa R42 = aa;
244f: b1,c6,30 ldb R30,c6 Scr30 = c6;
2452: b1,75,32 ldb R32,75 R32 = 75;
2455: 9b,22,b7,42 cmpb R42,[R22+b7]
2459: d7,2f jne 248a if (R42 = [R22-49]) { # [r22-49] 437-49=3EE ? kamqa? LOWEST ADDRESS OF KAM # KAMQA aa= 10101010 BINARY
245b: 9b,22,27,30 cmpb R30,[R22+27]
245f: d7,29 jne 248a if (Scr30 = [R22+27]) { # [r22+27] 437+27=45E ? kamqb? MIDDLE ADDRESS OF KAM # KAMQB c6= 11000110 BINARY
2461: 9b,22,50,32 cmpb R32,[R22+50]
2465: d7,23 jne 248a if (R32 = [R22+50]) {
-
- Posts: 88
- Joined: 2023 Oct 22, 22:13
- Location: New Zealand
- Vehicle Information: Several Kit cars, Ford (Europe), EEC-IV, TVR Vixen, Tasmin (a.k.a Wedge),
Engine - Cologne 2.8 V6 (Europe) catch code 'AA'.
EEC_Disassembler https://github.com/tvrfan/EEC-IV-disassembler
Re: SAD Version 5 (alpha)
Thanks jamie - I did have a problem with 'phantom' rbases, and then after changing the code, Rbases don't even show up.....from too many to too little....
OK. more work to do.
3DBC OK. will check.
OK. more work to do.
3DBC OK. will check.
-
- Posts: 28
- Joined: 2022 Jul 08, 04:54
- Location: South Australia
- Vehicle Information: 1995 ford falcon ute 5.0 windsor efi
Re: SAD Version 5 (alpha)
[quote=tvrfan post_id=13567
3DBC OK. will check.
[/quote]
If you don't have it I had posted it on eectuning a while back.
3DBC OK. will check.
[/quote]
If you don't have it I had posted it on eectuning a while back.
-
- Posts: 88
- Joined: 2023 Oct 22, 22:13
- Location: New Zealand
- Vehicle Information: Several Kit cars, Ford (Europe), EEC-IV, TVR Vixen, Tasmin (a.k.a Wedge),
Engine - Cologne 2.8 V6 (Europe) catch code 'AA'.
EEC_Disassembler https://github.com/tvrfan/EEC-IV-disassembler
Re: SAD Version 5 (alpha)
Released version 5.0.8 with some more fixes.
PROBLEM -
I have found things which mess up my 'elegant' v5 design, and I think it means some of my v5 rewrite won't ever work right... Damn, Damn, Damn!!! (and 'F' words) It may take a while to fix some of these issues. Very frustrating as I thought I had a neat solution, only to find it don't work for some bins. In the meantime v4 works OK, and you can use its output to feed into v5 to add calcs and new features, modify and/or make your own commands to fix the v5 issues.
So I may be quieter for a while...but I am still working on getting SAD to work as well as I can.
PROBLEM -
I have found things which mess up my 'elegant' v5 design, and I think it means some of my v5 rewrite won't ever work right... Damn, Damn, Damn!!! (and 'F' words) It may take a while to fix some of these issues. Very frustrating as I thought I had a neat solution, only to find it don't work for some bins. In the meantime v4 works OK, and you can use its output to feed into v5 to add calcs and new features, modify and/or make your own commands to fix the v5 issues.
So I may be quieter for a while...but I am still working on getting SAD to work as well as I can.