Revision: 3763 Author: lewis Date: 2018-04-15 08:52:04 -0700 (Sun, 15 Apr 2018) Log Message: ----------- Fix ckformat for 64 bit Spur, which saves format number in first 4 bytes of the header, versus 8 bytes for 64 bit V3. Prior version worked by accident for little endian host using strncmp() check, but failed when correct memcmp() was used without limiting check to 4 bytes for spur and 8 for V3. Modified Paths: -------------- trunk/src/ckformat.c Modified: trunk/src/ckformat.c =================================================================== --- trunk/src/ckformat.c 2018-04-14 21:07:56 UTC (rev 3762) +++ trunk/src/ckformat.c 2018-04-15 15:52:04 UTC (rev 3763) @@ -5,7 +5,7 @@ /* Usage: ckformat imageFileName */ /* --- DO NOT EDIT THIS FILE --- */ -/* --- Automatically generated from class ImageFormat 2018-04-14T17:00:30.957+01:00--- */ +/* --- Automatically generated from class ImageFormat 2018-04-15T11:41:31.047+01:00--- */ /* --- Source code is in package ImageFormat in the VMMaker repository --- */ /* --- DO NOT EDIT THIS FILE --- */ @@ -44,120 +44,204 @@ } } { - unsigned char b_6502_2[4]= { 102, 25, 0, 0}; - if (memcmp(buf, b_6502_2, 4) == 0) { + unsigned char b_6502_2[8]= { 0, 0, 0, 0, 0, 0, 25, 102}; + if (memcmp(buf, b_6502_2, 8) == 0) { printf("%d\n", 6502); exit(0); } } { - unsigned char b_6504_3[4]= { 0, 0, 25, 104}; - if (memcmp(buf, b_6504_3, 4) == 0) { + unsigned char b_6502_3[4]= { 102, 25, 0, 0}; + if (memcmp(buf, b_6502_3, 4) == 0) { + printf("%d\n", 6502); + exit(0); + } + } + { + unsigned char b_6502_4[8]= { 102, 25, 0, 0, 0, 0, 0, 0}; + if (memcmp(buf, b_6502_4, 8) == 0) { + printf("%d\n", 6502); + exit(0); + } + } + { + unsigned char b_6504_5[4]= { 0, 0, 25, 104}; + if (memcmp(buf, b_6504_5, 4) == 0) { printf("%d\n", 6504); exit(0); } } { - unsigned char b_6504_4[4]= { 104, 25, 0, 0}; - if (memcmp(buf, b_6504_4, 4) == 0) { + unsigned char b_6504_6[8]= { 0, 0, 0, 0, 0, 0, 25, 104}; + if (memcmp(buf, b_6504_6, 8) == 0) { printf("%d\n", 6504); exit(0); } } { - unsigned char b_6505_5[4]= { 0, 0, 25, 105}; - if (memcmp(buf, b_6505_5, 4) == 0) { + unsigned char b_6504_7[4]= { 104, 25, 0, 0}; + if (memcmp(buf, b_6504_7, 4) == 0) { + printf("%d\n", 6504); + exit(0); + } + } + { + unsigned char b_6504_8[8]= { 104, 25, 0, 0, 0, 0, 0, 0}; + if (memcmp(buf, b_6504_8, 8) == 0) { + printf("%d\n", 6504); + exit(0); + } + } + { + unsigned char b_6505_9[4]= { 0, 0, 25, 105}; + if (memcmp(buf, b_6505_9, 4) == 0) { printf("%d\n", 6505); exit(0); } } { - unsigned char b_6505_6[4]= { 105, 25, 0, 0}; - if (memcmp(buf, b_6505_6, 4) == 0) { + unsigned char b_6505_10[8]= { 0, 0, 0, 0, 0, 0, 25, 105}; + if (memcmp(buf, b_6505_10, 8) == 0) { printf("%d\n", 6505); exit(0); } } { - unsigned char b_6521_7[4]= { 0, 0, 25, 121}; - if (memcmp(buf, b_6521_7, 4) == 0) { + unsigned char b_6505_11[4]= { 105, 25, 0, 0}; + if (memcmp(buf, b_6505_11, 4) == 0) { + printf("%d\n", 6505); + exit(0); + } + } + { + unsigned char b_6505_12[8]= { 105, 25, 0, 0, 0, 0, 0, 0}; + if (memcmp(buf, b_6505_12, 8) == 0) { + printf("%d\n", 6505); + exit(0); + } + } + { + unsigned char b_6521_13[4]= { 0, 0, 25, 121}; + if (memcmp(buf, b_6521_13, 4) == 0) { printf("%d\n", 6521); exit(0); } } { - unsigned char b_6521_8[4]= { 121, 25, 0, 0}; - if (memcmp(buf, b_6521_8, 4) == 0) { + unsigned char b_6521_14[4]= { 121, 25, 0, 0}; + if (memcmp(buf, b_6521_14, 4) == 0) { printf("%d\n", 6521); exit(0); } } { - unsigned char b_68000_9[8]= { 0, 0, 0, 0, 0, 1, 9, 160}; - if (memcmp(buf, b_68000_9, 8) == 0) { + unsigned char b_68000_15[4]= { 0, 1, 9, 160}; + if (memcmp(buf, b_68000_15, 4) == 0) { printf("%d\n", 68000); exit(0); } } { - unsigned char b_68000_10[8]= { 160, 9, 1, 0, 0, 0, 0, 0}; - if (memcmp(buf, b_68000_10, 8) == 0) { + unsigned char b_68000_16[8]= { 0, 0, 0, 0, 0, 1, 9, 160}; + if (memcmp(buf, b_68000_16, 8) == 0) { printf("%d\n", 68000); exit(0); } } { - unsigned char b_68002_11[8]= { 0, 0, 0, 0, 0, 1, 9, 162}; - if (memcmp(buf, b_68002_11, 8) == 0) { + unsigned char b_68000_17[4]= { 160, 9, 1, 0}; + if (memcmp(buf, b_68000_17, 4) == 0) { + printf("%d\n", 68000); + exit(0); + } + } + { + unsigned char b_68000_18[8]= { 160, 9, 1, 0, 0, 0, 0, 0}; + if (memcmp(buf, b_68000_18, 8) == 0) { + printf("%d\n", 68000); + exit(0); + } + } + { + unsigned char b_68002_19[4]= { 0, 1, 9, 162}; + if (memcmp(buf, b_68002_19, 4) == 0) { printf("%d\n", 68002); exit(0); } } { - unsigned char b_68002_12[8]= { 162, 9, 1, 0, 0, 0, 0, 0}; - if (memcmp(buf, b_68002_12, 8) == 0) { + unsigned char b_68002_20[8]= { 0, 0, 0, 0, 0, 1, 9, 162}; + if (memcmp(buf, b_68002_20, 8) == 0) { printf("%d\n", 68002); exit(0); } } { - unsigned char b_68003_13[8]= { 0, 0, 0, 0, 0, 1, 9, 163}; - if (memcmp(buf, b_68003_13, 8) == 0) { + unsigned char b_68002_21[4]= { 162, 9, 1, 0}; + if (memcmp(buf, b_68002_21, 4) == 0) { + printf("%d\n", 68002); + exit(0); + } + } + { + unsigned char b_68002_22[8]= { 162, 9, 1, 0, 0, 0, 0, 0}; + if (memcmp(buf, b_68002_22, 8) == 0) { + printf("%d\n", 68002); + exit(0); + } + } + { + unsigned char b_68003_23[4]= { 0, 1, 9, 163}; + if (memcmp(buf, b_68003_23, 4) == 0) { printf("%d\n", 68003); exit(0); } } { - unsigned char b_68003_14[8]= { 163, 9, 1, 0, 0, 0, 0, 0}; - if (memcmp(buf, b_68003_14, 8) == 0) { + unsigned char b_68003_24[8]= { 0, 0, 0, 0, 0, 1, 9, 163}; + if (memcmp(buf, b_68003_24, 8) == 0) { printf("%d\n", 68003); exit(0); } } { - unsigned char b_68019_15[8]= { 0, 0, 0, 0, 0, 1, 9, 179}; - if (memcmp(buf, b_68019_15, 8) == 0) { + unsigned char b_68003_25[4]= { 163, 9, 1, 0}; + if (memcmp(buf, b_68003_25, 4) == 0) { + printf("%d\n", 68003); + exit(0); + } + } + { + unsigned char b_68003_26[8]= { 163, 9, 1, 0, 0, 0, 0, 0}; + if (memcmp(buf, b_68003_26, 8) == 0) { + printf("%d\n", 68003); + exit(0); + } + } + { + unsigned char b_68019_27[4]= { 0, 1, 9, 179}; + if (memcmp(buf, b_68019_27, 4) == 0) { printf("%d\n", 68019); exit(0); } } { - unsigned char b_68019_16[8]= { 179, 9, 1, 0, 0, 0, 0, 0}; - if (memcmp(buf, b_68019_16, 8) == 0) { + unsigned char b_68019_28[4]= { 179, 9, 1, 0}; + if (memcmp(buf, b_68019_28, 4) == 0) { printf("%d\n", 68019); exit(0); } } { - unsigned char b_68021_17[8]= { 0, 0, 0, 0, 0, 1, 9, 181}; - if (memcmp(buf, b_68021_17, 8) == 0) { + unsigned char b_68021_29[4]= { 0, 1, 9, 181}; + if (memcmp(buf, b_68021_29, 4) == 0) { printf("%d\n", 68021); exit(0); } } { - unsigned char b_68021_18[8]= { 181, 9, 1, 0, 0, 0, 0, 0}; - if (memcmp(buf, b_68021_18, 8) == 0) { + unsigned char b_68021_30[4]= { 181, 9, 1, 0}; + if (memcmp(buf, b_68021_30, 4) == 0) { printf("%d\n", 68021); exit(0); } @@ -178,120 +262,204 @@ } } { - unsigned char b_6502_2[4]= { 102, 25, 0, 0}; - if (memcmp(buf, b_6502_2, 4) == 0) { + unsigned char b_6502_2[8]= { 0, 0, 0, 0, 0, 0, 25, 102}; + if (memcmp(buf, b_6502_2, 8) == 0) { printf("%d\n", 6502); exit(0); } } { - unsigned char b_6504_3[4]= { 0, 0, 25, 104}; - if (memcmp(buf, b_6504_3, 4) == 0) { + unsigned char b_6502_3[4]= { 102, 25, 0, 0}; + if (memcmp(buf, b_6502_3, 4) == 0) { + printf("%d\n", 6502); + exit(0); + } + } + { + unsigned char b_6502_4[8]= { 102, 25, 0, 0, 0, 0, 0, 0}; + if (memcmp(buf, b_6502_4, 8) == 0) { + printf("%d\n", 6502); + exit(0); + } + } + { + unsigned char b_6504_5[4]= { 0, 0, 25, 104}; + if (memcmp(buf, b_6504_5, 4) == 0) { printf("%d\n", 6504); exit(0); } } { - unsigned char b_6504_4[4]= { 104, 25, 0, 0}; - if (memcmp(buf, b_6504_4, 4) == 0) { + unsigned char b_6504_6[8]= { 0, 0, 0, 0, 0, 0, 25, 104}; + if (memcmp(buf, b_6504_6, 8) == 0) { printf("%d\n", 6504); exit(0); } } { - unsigned char b_6505_5[4]= { 0, 0, 25, 105}; - if (memcmp(buf, b_6505_5, 4) == 0) { + unsigned char b_6504_7[4]= { 104, 25, 0, 0}; + if (memcmp(buf, b_6504_7, 4) == 0) { + printf("%d\n", 6504); + exit(0); + } + } + { + unsigned char b_6504_8[8]= { 104, 25, 0, 0, 0, 0, 0, 0}; + if (memcmp(buf, b_6504_8, 8) == 0) { + printf("%d\n", 6504); + exit(0); + } + } + { + unsigned char b_6505_9[4]= { 0, 0, 25, 105}; + if (memcmp(buf, b_6505_9, 4) == 0) { printf("%d\n", 6505); exit(0); } } { - unsigned char b_6505_6[4]= { 105, 25, 0, 0}; - if (memcmp(buf, b_6505_6, 4) == 0) { + unsigned char b_6505_10[8]= { 0, 0, 0, 0, 0, 0, 25, 105}; + if (memcmp(buf, b_6505_10, 8) == 0) { printf("%d\n", 6505); exit(0); } } { - unsigned char b_6521_7[4]= { 0, 0, 25, 121}; - if (memcmp(buf, b_6521_7, 4) == 0) { + unsigned char b_6505_11[4]= { 105, 25, 0, 0}; + if (memcmp(buf, b_6505_11, 4) == 0) { + printf("%d\n", 6505); + exit(0); + } + } + { + unsigned char b_6505_12[8]= { 105, 25, 0, 0, 0, 0, 0, 0}; + if (memcmp(buf, b_6505_12, 8) == 0) { + printf("%d\n", 6505); + exit(0); + } + } + { + unsigned char b_6521_13[4]= { 0, 0, 25, 121}; + if (memcmp(buf, b_6521_13, 4) == 0) { printf("%d\n", 6521); exit(0); } } { - unsigned char b_6521_8[4]= { 121, 25, 0, 0}; - if (memcmp(buf, b_6521_8, 4) == 0) { + unsigned char b_6521_14[4]= { 121, 25, 0, 0}; + if (memcmp(buf, b_6521_14, 4) == 0) { printf("%d\n", 6521); exit(0); } } { - unsigned char b_68000_9[8]= { 0, 0, 0, 0, 0, 1, 9, 160}; - if (memcmp(buf, b_68000_9, 8) == 0) { + unsigned char b_68000_15[4]= { 0, 1, 9, 160}; + if (memcmp(buf, b_68000_15, 4) == 0) { printf("%d\n", 68000); exit(0); } } { - unsigned char b_68000_10[8]= { 160, 9, 1, 0, 0, 0, 0, 0}; - if (memcmp(buf, b_68000_10, 8) == 0) { + unsigned char b_68000_16[8]= { 0, 0, 0, 0, 0, 1, 9, 160}; + if (memcmp(buf, b_68000_16, 8) == 0) { printf("%d\n", 68000); exit(0); } } { - unsigned char b_68002_11[8]= { 0, 0, 0, 0, 0, 1, 9, 162}; - if (memcmp(buf, b_68002_11, 8) == 0) { + unsigned char b_68000_17[4]= { 160, 9, 1, 0}; + if (memcmp(buf, b_68000_17, 4) == 0) { + printf("%d\n", 68000); + exit(0); + } + } + { + unsigned char b_68000_18[8]= { 160, 9, 1, 0, 0, 0, 0, 0}; + if (memcmp(buf, b_68000_18, 8) == 0) { + printf("%d\n", 68000); + exit(0); + } + } + { + unsigned char b_68002_19[4]= { 0, 1, 9, 162}; + if (memcmp(buf, b_68002_19, 4) == 0) { printf("%d\n", 68002); exit(0); } } { - unsigned char b_68002_12[8]= { 162, 9, 1, 0, 0, 0, 0, 0}; - if (memcmp(buf, b_68002_12, 8) == 0) { + unsigned char b_68002_20[8]= { 0, 0, 0, 0, 0, 1, 9, 162}; + if (memcmp(buf, b_68002_20, 8) == 0) { printf("%d\n", 68002); exit(0); } } { - unsigned char b_68003_13[8]= { 0, 0, 0, 0, 0, 1, 9, 163}; - if (memcmp(buf, b_68003_13, 8) == 0) { + unsigned char b_68002_21[4]= { 162, 9, 1, 0}; + if (memcmp(buf, b_68002_21, 4) == 0) { + printf("%d\n", 68002); + exit(0); + } + } + { + unsigned char b_68002_22[8]= { 162, 9, 1, 0, 0, 0, 0, 0}; + if (memcmp(buf, b_68002_22, 8) == 0) { + printf("%d\n", 68002); + exit(0); + } + } + { + unsigned char b_68003_23[4]= { 0, 1, 9, 163}; + if (memcmp(buf, b_68003_23, 4) == 0) { printf("%d\n", 68003); exit(0); } } { - unsigned char b_68003_14[8]= { 163, 9, 1, 0, 0, 0, 0, 0}; - if (memcmp(buf, b_68003_14, 8) == 0) { + unsigned char b_68003_24[8]= { 0, 0, 0, 0, 0, 1, 9, 163}; + if (memcmp(buf, b_68003_24, 8) == 0) { printf("%d\n", 68003); exit(0); } } { - unsigned char b_68019_15[8]= { 0, 0, 0, 0, 0, 1, 9, 179}; - if (memcmp(buf, b_68019_15, 8) == 0) { + unsigned char b_68003_25[4]= { 163, 9, 1, 0}; + if (memcmp(buf, b_68003_25, 4) == 0) { + printf("%d\n", 68003); + exit(0); + } + } + { + unsigned char b_68003_26[8]= { 163, 9, 1, 0, 0, 0, 0, 0}; + if (memcmp(buf, b_68003_26, 8) == 0) { + printf("%d\n", 68003); + exit(0); + } + } + { + unsigned char b_68019_27[4]= { 0, 1, 9, 179}; + if (memcmp(buf, b_68019_27, 4) == 0) { printf("%d\n", 68019); exit(0); } } { - unsigned char b_68019_16[8]= { 179, 9, 1, 0, 0, 0, 0, 0}; - if (memcmp(buf, b_68019_16, 8) == 0) { + unsigned char b_68019_28[4]= { 179, 9, 1, 0}; + if (memcmp(buf, b_68019_28, 4) == 0) { printf("%d\n", 68019); exit(0); } } { - unsigned char b_68021_17[8]= { 0, 0, 0, 0, 0, 1, 9, 181}; - if (memcmp(buf, b_68021_17, 8) == 0) { + unsigned char b_68021_29[4]= { 0, 1, 9, 181}; + if (memcmp(buf, b_68021_29, 4) == 0) { printf("%d\n", 68021); exit(0); } } { - unsigned char b_68021_18[8]= { 181, 9, 1, 0, 0, 0, 0, 0}; - if (memcmp(buf, b_68021_18, 8) == 0) { + unsigned char b_68021_30[4]= { 181, 9, 1, 0}; + if (memcmp(buf, b_68021_30, 4) == 0) { printf("%d\n", 68021); exit(0); } |
Free forum by Nabble | Edit this page |