From ac29a8c49753d2763213720c850456bb2dd8ec4a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Fran=C3=A7ois=20DEL=20NERO?= Date: Mon, 25 Dec 2023 13:10:36 +0100 Subject: [PATCH] Working WOZ image loader ! --- libhxcfe/sources/init.script | 6 + libhxcfe/sources/init_script.h | 257 +++++++++--------- .../sources/loaders/woz_loader/woz_format.h | 10 +- .../sources/loaders/woz_loader/woz_loader.c | 221 +++++++++++++-- 4 files changed, 335 insertions(+), 159 deletions(-) diff --git a/libhxcfe/sources/init.script b/libhxcfe/sources/init.script index 631ac9e4..502b70df 100644 --- a/libhxcfe/sources/init.script +++ b/libhxcfe/sources/init.script @@ -265,6 +265,12 @@ set A2RLOADER_BITRATE 0 # Force the bitrate. (no au set A2RLOADER_BMPEXPORT 0 # Export/plot the inputs stream tracks to BMP images. set A2RLOADER_SKIP_INTER_TRACKS 1 # Skip inter tracks. Just process the normal tracks. +# +# WOZ loader parameters +# + +set WOZLOADER_INTERTRACKSLOADING 0 # Load 0.25,0.50 and 0.75 tracks positions + # ---------------------------------------------------------------------------- # ---------------------------------------------------------------------------- diff --git a/libhxcfe/sources/init_script.h b/libhxcfe/sources/init_script.h index 488c6409..7b1ccfcd 100644 --- a/libhxcfe/sources/init_script.h +++ b/libhxcfe/sources/init_script.h @@ -5,8 +5,8 @@ // // File: init.script // -// Original size: 13287 Bytes -// Packed size: 6328 Bytes +// Original size: 13413 Bytes +// Packed size: 6380 Bytes // #ifndef DATATYPEDEF @@ -297,133 +297,136 @@ unsigned char data__init_script[] = 0x0b,0x59,0x93,0x90,0x22,0xa7,0x90,0x76,0xe6,0x2d,0xc9,0x0b,0xa2,0xd7,0x5e,0xd3, 0x00,0xa1,0x15,0x67,0xc8,0x97,0x8d,0x39,0x5f,0x37,0x45,0x7e,0x0f,0xb5,0x10,0xb2, 0x7d,0x85,0xe4,0xec,0x09,0x4c,0xfe,0xd1,0x60,0xde,0x76,0xb4,0xa2,0x3f,0x71,0x8f, - 0x64,0x26,0x49,0x8a,0x66,0x7a,0x68,0xfa,0x87,0xa8,0x86,0xb1,0x52,0x3a,0x8b,0xa9, - 0x1a,0x92,0x67,0x14,0x5c,0xe9,0x58,0x5f,0x86,0x20,0xee,0x22,0xf4,0x9f,0x7c,0x59, - 0xf3,0x6f,0xe8,0x7f,0x97,0xe8,0x8a,0x8e,0xc8,0x38,0x83,0xd3,0xef,0x9b,0xa0,0x65, - 0x4c,0x38,0x05,0x86,0x29,0xb3,0x40,0xc3,0x4c,0x96,0x16,0xc0,0x8e,0x28,0xea,0x86, - 0x80,0xbf,0x3d,0xe8,0x70,0x87,0x79,0x83,0x9b,0xf8,0x62,0xee,0xba,0xc6,0x90,0xba, - 0x31,0xab,0x1a,0xd2,0x0b,0x08,0xf2,0x89,0x95,0xb0,0x84,0x5a,0xbd,0x1d,0xb4,0xc5, - 0x4c,0x00,0x60,0x4d,0xfa,0xe7,0xaa,0xfa,0xd0,0x8e,0xfa,0xf0,0x8f,0x68,0xa0,0x8f, - 0xf2,0x98,0x90,0x67,0x52,0x68,0xb9,0x0e,0xa1,0x16,0xe3,0xaa,0x02,0x25,0x65,0xf8, - 0x87,0x7c,0x7a,0xaa,0x85,0x70,0x22,0xc5,0x29,0x0e,0x83,0x9b,0x09,0xab,0x48,0x6e, - 0x8a,0x08,0x4e,0x87,0xba,0xcb,0xb3,0x00,0x97,0xb3,0x5a,0xea,0x8e,0xfb,0x3d,0x58, - 0x80,0x68,0xc4,0xa7,0x14,0xea,0xa3,0x50,0x6d,0x83,0x51,0x64,0x42,0x42,0x2b,0x82, - 0xfc,0x52,0xb6,0x08,0x27,0xe5,0x80,0x22,0xeb,0x1c,0xc8,0x35,0x84,0x50,0xa3,0x97, - 0x84,0xe0,0xe8,0xb5,0x13,0x76,0x27,0xe0,0xc4,0x6e,0x68,0x04,0x80,0x9b,0x23,0x64, - 0xcf,0x5c,0x40,0x86,0xf1,0x85,0xa4,0x1a,0x81,0x03,0xaf,0x68,0x1a,0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08,0xdc,0x85,0x58,0x3d,0xb4,0xb9, - 0x2f,0x71,0x19,0x33,0xa1,0x37,0x44,0x08,0xfd,0x8f,0x46,0xa8,0x74,0xa0,0x79,0x95, - 0x0c,0xf6,0x41,0x02,0xdd,0xfb,0x7a,0x8b,0x36,0xa2,0x99,0x0b,0xd5,0xfc,0xad,0xb4, - 0x6a,0xc6,0x0b,0x27,0xa8,0x62,0xa0,0x60,0x0f,0x0e,0x8d,0x76,0x91,0x82,0x2f,0xc0, - 0xda,0xf4,0x84,0x43,0x03,0x57,0x6c,0x05,0xe9,0xe8,0x9b,0xc5,0x3b,0x87,0xdb,0x1c, - 0x23,0xa0,0xf2,0x4a,0xe7,0x0e,0x0c,0xa3,0x39,0x2c,0x19,0x63,0x69,0x25,0x6e,0x2d, - 0x0e,0x40,0x73,0xc2,0x1b,0x30,0xde,0x38,0x54,0x06,0x58,0x28,0xbe,0x2b,0x67,0xbe, - 0x00,0x35,0x45,0x07,0x6a,0xc0,0xc2,0x25,0x5b,0x18,0x04,0x7e,0x0f,0xde,0x73,0xe0, - 0x09,0x60,0xbe,0x07,0x20,0x6c,0x0a,0x80,0xa0,0x09,0x26,0x29,0x51,0xfe,0x22,0x98, - 0x64,0x17,0xe2,0xaf,0x6c,0x35,0x83,0xf6,0x33,0x44,0x96,0x65,0xa7,0x70,0x57,0x46, - 0x20,0x6e,0x90,0x36,0xbf,0xc2,0x09,0xe7,0x9b,0xe1,0xe1,0x28,0x77,0xe8,0x7e,0x8a, - 0x62,0x7e,0x8f,0x84,0xa2,0x3b,0xe8,0x83,0x12,0xcc,0xc0,0xcf,0x45,0xcc,0x56,0x08, - 0xc0,0x40,0x09,0x84,0x5e,0x59,0xae,0x04,0x4c,0x36,0xcf,0xaa,0x76,0xfd,0x0d,0x36, - 0xbd,0xed,0x0b,0x90,0xe7,0x2e,0xe1,0x02,0x35,0x12,0xd3,0x7e,0x7f,0x50,0xe9,0xb2, - 0x87,0xbe,0x76,0x85,0x40,0xa6,0xe7,0x4a,0xc0,0xe7,0x55,0x13,0xbb,0x2f,0xce,0x78, - 0xe8,0x45,0xf0,0x88,0x3e,0x0d,0xa3,0x06,0x0c,0x84,0x97,0x45,0xde,0xd6,0x0c,0xe4, - 0xb5,0x4e,0x02,0xae,0x6a,0x03,0x3c,0x95,0x56,0x7c,0x71,0x19,0xed,0x92,0x3b,0x2b, - 0xee,0x60,0x9e,0x08,0xec,0x3d,0x5a,0x08,0x43,0x7d,0x33,0x55,0xbe,0xd4,0xac,0x62, - 0x7c,0xf8,0x79,0x9f,0x42,0xac,0x15,0x01,0x41,0xff,0x49,0x06,0x07,0x9f,0x20,0xdf, - 0x50,0x06,0x69,0x0b,0xf5,0x7f,0x45,0xf5,0xc0,0xb3,0xf6,0x00,0xa7,0x9a,0x55,0x15, - 0x8c,0x88,0xfd,0x1d,0x88,0xa7,0xf6,0xdf,0x41,0xf7,0x13,0xdd,0xf6,0x0c,0x30,0x8e, - 0x5c,0xd2,0x83,0x9d,0x6e,0x08,0xce,0x77,0x21,0x75,0x25,0xf8,0x7f,0x59,0xf4,0x67, - 0xc9,0xf9,0x11,0xcd,0xd1,0xdf,0x99,0xf9,0xd5,0x1d,0xfa,0x3f,0x8b,0xf5,0xf7,0x8f, - 0xc4,0x5d,0x12,0x85,0x5f,0x6f,0xf5,0xbf,0x8c,0x7f,0x59,0x5f,0x5b,0x83,0x20,0x79, - 0x5e,0xd5,0xed,0x83,0x3c,0x56,0xc0,0xaf,0xaa,0x3b,0x27,0x9f,0x1e,0xe5,0x75,0x67, - 0x94,0x0b,0xe0,0xae,0x0a,0x50,0x64,0x7c,0x9f,0xed,0xff,0x09,0xd2,0x8f,0x53,0xa2, - 0x08,0xa2,0x02,0x9e,0x76,0xb7,0x35,0xf8,0xdc,0x80,0x20,0x01,0x08,0x0f,0x56,0x12, - 0x46,0x70,0x24,0xb4,0x91,0x2c,0xae,0xaa,0x69,0xca,0xd5,0xc2,0x8e,0x27,0x55,0x17, - 0x0a,0x7c,0x26,0xa8,0x75,0x02,0x5b,0xfa,0x85,0x44,0x02,0x07,0xf6,0xbf,0xbd,0x7c, - 0x2d,0x94,0x6a,0xa2,0x1a,0x60,0x25,0x01,0x47,0xfa,0xbf,0xdd,0x15,0x80,0x4c,0x22, - 0x72,0x0c,0x88,0x24,0x87,0x94,0x99,0x36,0xa1,0xec,0x04,0xa2,0x08,0x28,0x13,0x04, - 0x1a,0x49,0x81,0x11,0x36,0xb4,0x33,0xc0,0x64,0x0a,0x51,0x29,0x86,0xe8,0x03,0x60, - 0x18,0x80,0xd0,0xba,0x6d,0xc4,0x0a,0x3b,0xbc,0x02,0x27,0x01,0xf3,0x14,0xc0,0x85, - 0xff,0x0b,0xe9,0x4f,0x81,0x58,0x00,0xa4,0xe8,0xe0,0x2a,0x81,0x38,0x08,0xc3,0xd8, - 0x2b,0x30,0x15,0x0c,0x66,0xe8,0xe5,0xff,0x91,0x41,0x45,0xc0,0x4f,0x08,0xb8,0x96, - 0xe0,0x29,0x01,0x61,0x4a,0xc0,0x65,0xb2,0x50,0x1b,0x7f,0x8b,0xab,0x88,0x54,0x3d, - 0x83,0x0f,0x40,0x81,0x6b,0xc3,0xc5,0x02,0x3a,0x39,0x87,0xa0,0xa4,0x02,0xb1,0x8f, - 0xb8,0xc5,0xed,0x2f,0x6b,0x78,0xe6,0x8d,0xf4,0xc2,0xa0,0xf6,0x9b,0xc9,0x0a,0x10, - 0x34,0x0a,0x68,0xc0,0xc4,0x28,0x1a,0x37,0x73,0x2d,0x3d,0xe4,0xaf,0x26,0x4b,0x11, - 0x7b,0x43,0x1e,0x9b,0xd0,0xcd,0x9b,0xa8,0xb2,0x4c,0xe9,0x47,0x49,0x14,0xd2,0x1a, - 0x9f,0x90,0x21,0x06,0x40,0x5e,0xcb,0x37,0x17,0x08,0x08,0x00,0x8a,0x06,0xd5,0x9e, - 0x2b,0x0d,0xf3,0xad,0x54,0x14,0xb1,0xee,0xc0,0xa8,0x81,0x10,0x10,0x00,0xac,0x9b, - 0x67,0xce,0x4f,0x38,0xd9,0x92,0xfc,0x1a,0x12,0xc6,0x06,0x5c,0x50,0x6d,0xd1,0x21, - 0x54,0x22,0x00,0xbe,0xb8,0x12,0x67,0x01,0x3d,0xc6,0x60,0x59,0x70,0x09,0x06,0x93, - 0x54,0x93,0x26,0xce,0x1f,0xa4,0xac,0xed,0xa4,0x21,0x73,0x57,0x08,0xfc,0x5c,0xa5, - 0x17,0x2c,0xd1,0xea,0x63,0x25,0x82,0xe8,0xac,0x05,0xa6,0x1d,0x20,0x16,0x8e,0xec, - 0x27,0xe1,0x1f,0x0e,0x92,0x26,0x4d,0x56,0x18,0xd8,0x46,0x2c,0xe4,0x57,0xe5,0xf8, - 0x1d,0xbc,0x24,0x0c,0xcc,0xac,0x31,0x5b,0x43,0x24,0x27,0x68,0x67,0x6e,0x82,0x8e, - 0xd4,0x8a,0x41,0xa3,0xe4,0x20,0x2e,0x16,0x26,0x2b,0x50,0x68,0x11,0x00,0x88,0x7e, - 0xb2,0x48,0x00,0x88,0x84,0xc0,0x32,0x01,0x71,0x1f,0x80,0x70,0x02,0xe2,0x29,0x00, - 0xb8,0x06,0xe9,0x6e,0x1a,0x28,0xac,0x82,0x1a,0x05,0xf1,0x6f,0xac,0xe0,0x0f,0x23, - 0x18,0x83,0x90,0x10,0xa1,0xe7,0x03,0x20,0x21,0x9d,0x6c,0x27,0x6b,0x15,0x03,0x08, - 0xbf,0xc5,0xcc,0xa7,0xb2,0xc7,0x04,0x40,0x23,0x81,0x76,0x18,0x60,0x9a,0x44,0x14, - 0x28,0x54,0x0e,0x0d,0xa8,0x73,0xc2,0x1a,0x11,0x92,0x54,0x20,0x66,0x28,0x51,0xdc, - 0x40,0xc6,0x0e,0x4a,0xa5,0x87,0xd1,0x47,0x80,0x7c,0x03,0xd2,0x81,0x8b,0xc8,0x08, - 0x6f,0x29,0x0e,0xc1,0x66,0x82,0xd2,0x25,0xf7,0x99,0xc1,0xc5,0x58,0x66,0xed,0x13, - 0x38,0x81,0x0e,0xda,0x62,0x00,0x21,0x10,0xda,0x05,0x07,0x3d,0x85,0x53,0x36,0x62, - 0x4e,0x93,0x24,0x98,0x24,0xc8,0x89,0x6a,0xdb,0x0b,0x58,0x5b,0x46,0x24,0xa9,0x21, - 0x78,0x97,0x65,0xfd,0xe8,0xd3,0x88,0xf8,0x44,0x22,0x43,0x03,0x25,0x01,0x9b,0xb9, - 0x29,0xe4,0xad,0x0c,0x60,0x98,0xd6,0x44,0x65,0x68,0x9b,0x9c,0xa8,0x5e,0x43,0xac, - 0x03,0x70,0x09,0xcd,0x00,0xfe,0xf7,0x8c,0x93,0x74,0x34,0x71,0x3c,0x0a,0x64,0x4f, - 0x8f,0xfd,0x12,0x20,0xd4,0x1e,0xea,0x25,0xee,0x4b,0x89,0x52,0xb5,0x89,0x72,0x05, - 0x08,0x97,0x44,0xad,0xbe,0x29,0x97,0x89,0x90,0x10,0x55,0xb6,0xfd,0x03,0x1c,0x1a, - 0x40,0xe4,0x61,0xb2,0x24,0xe1,0xa4,0x83,0x3e,0x8d,0x16,0x28,0x19,0xe4,0xd8,0x4a, - 0x36,0x0c,0x58,0xda,0x84,0xe4,0x35,0x45,0x75,0x05,0x1c,0x8d,0xa9,0x19,0x4d,0xe9, - 0x76,0xc3,0xd9,0x11,0x12,0x01,0x05,0x28,0xd6,0x64,0xc8,0x33,0x20,0xc8,0x4a,0x3c, - 0x21,0xa4,0xa7,0x05,0x4c,0x5a,0x07,0x5a,0x03,0x71,0x99,0x12,0x32,0x60,0x26,0x72, - 0x8b,0xc8,0x0d,0xa0,0x79,0x1b,0xe0,0x0b,0xa3,0x10,0x97,0xb8,0xc9,0x8d,0xf0,0x0b, - 0xf1,0x88,0x01,0x70,0xb4,0x22,0xd2,0xb0,0x98,0x18,0x3c,0x5c,0x0e,0x46,0xe7,0x29, - 0xcc,0x5c,0xd7,0xe9,0x17,0x93,0xb0,0x0e,0xdc,0x45,0x27,0xa7,0x8c,0xb8,0xdd,0x23, - 0x17,0x18,0x40,0xeb,0xc6,0x3c,0x3e,0xc6,0x03,0x29,0xa4,0x66,0x47,0x11,0x19,0x60, - 0x32,0x06,0xb4,0x8c,0xf1,0xb6,0x0b,0x44,0x67,0x42,0x1a,0xa3,0xb0,0x21,0x26,0xa8, - 0xe7,0xca,0xf5,0x57,0xb9,0x07,0x1b,0x48,0xb8,0xa2,0x09,0x2a,0x10,0xe7,0xaa,0x41, - 0x52,0xd3,0x99,0x1f,0x12,0xdf,0x16,0xbb,0xa3,0x98,0x83,0xe6,0xa1,0x4e,0xd3,0x63, - 0x59,0xc4,0x8d,0x64,0xdd,0x86,0x79,0xa6,0x61,0x5e,0x40,0xe0,0x08,0x8c,0xcc,0xa6, - 0xf3,0x8a,0x05,0x1c,0x31,0x06,0xc6,0x18,0x7c,0x17,0x82,0x26,0x05,0x54,0xf8,0x11, - 0x2d,0x4b,0x0f,0xbc,0x39,0xb2,0x96,0x55,0x14,0x17,0xc8,0xef,0xa1,0x68,0x29,0xa8, - 0x25,0x11,0x1c,0x3b,0x08,0x1a,0x73,0x81,0xe1,0xb9,0xa1,0x4b,0x11,0xc1,0x02,0xa4, - 0x70,0xc9,0x75,0x1c,0x51,0xf2,0x01,0x4c,0xe7,0xa4,0x16,0x02,0x4a,0x10,0x40,0x44, - 0x96,0xe8,0xfb,0xa6,0x8e,0x3f,0x48,0x0b,0x8f,0xe4,0x7f,0x95,0xec,0x3d,0x04,0x56, - 0x21,0xd5,0xb3,0x72,0x05,0x0b,0xe4,0x82,0x1f,0xc3,0x20,0xa8,0xf5,0x48,0x32,0x38, - 0x44,0xb8,0x8f,0xfc,0x84,0x1a,0x58,0xe6,0x98,0x32,0x81,0x52,0x09,0x60,0x52,0x82, - 0x69,0xf3,0x24,0x13,0x1f,0x99,0x0c,0xc7,0x40,0x96,0x44,0x4b,0x72,0x71,0xa7,0xa4, - 0x47,0x22,0x52,0x1e,0x80,0x00,0x20,0x00 + 0x64,0x26,0x49,0x8a,0x66,0x8a,0x0a,0xe0,0x9f,0x9b,0x99,0x21,0x7c,0x59,0xf3,0x6f, + 0xe2,0x27,0xa8,0x60,0xb5,0x6b,0xd0,0xe0,0x7a,0x1a,0x5a,0xc6,0x07,0xe3,0x7f,0x9a, + 0x13,0x4c,0x40,0x40,0x09,0x84,0x5e,0xe8,0x91,0xd4,0x05,0x8e,0x4f,0x1d,0x66,0x06, + 0xe4,0xe0,0x6e,0x06,0xb8,0x5c,0xcc,0x2c,0xd5,0x4d,0xd0,0x40,0x5b,0x6f,0xa8,0x68, + 0xfa,0xd3,0xad,0x5a,0xd2,0x67,0xba,0xd7,0xad,0xda,0xde,0x66,0xf4,0x5c,0xe9,0x58, + 0x5f,0x86,0x20,0xee,0x22,0xf4,0x9f,0xa8,0xf6,0xfd,0x0d,0x3a,0x30,0x88,0xa8,0xec, + 0x83,0x88,0x3d,0x3e,0xf9,0xba,0x06,0x54,0xc3,0x80,0x58,0x62,0x9b,0x34,0x0c,0x34, + 0xc9,0x61,0x6c,0x08,0xe2,0x8e,0xa8,0x68,0x0b,0xf3,0xde,0x87,0x08,0x77,0x98,0x39, + 0xbf,0x86,0x2e,0xeb,0xb1,0x09,0x0b,0xaf,0x9b,0x1a,0x88,0xe0,0xb0,0x8f,0x28,0x99, + 0x5b,0x08,0x45,0xb0,0x71,0xdb,0xaa,0xbb,0x42,0x4d,0xfb,0x31,0x97,0xfa,0xfb,0xb1, + 0xc8,0xf0,0x89,0x5b,0x3c,0x89,0xc8,0xa0,0x8f,0xf2,0x98,0x90,0x67,0x52,0x68,0xb9, + 0x0e,0xa1,0x16,0xe3,0xae,0xc2,0x25,0x65,0xf8,0x87,0x7c,0x7a,0x92,0x85,0x70,0x22, + 0xc5,0x29,0x0e,0x83,0x9b,0x35,0xaf,0xe8,0x6e,0x8a,0x08,0x4e,0x87,0xbb,0x15,0xb7, + 0xc0,0x97,0xb8,0x1b,0x50,0x8e,0xfb,0x89,0x58,0x80,0x68,0xc4,0xa7,0x14,0xea,0xa3, + 0x50,0x6d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35,0x61,0xc2,0xdd,0xab,0xda,0xfd,0xb3,0xdb,0x67,0x8a,0xf8,0x2f,0x87, + 0xdb,0xea,0x3f,0xb2,0x9d,0xc6,0xbe,0x54,0x98,0x35,0xbd,0xce,0x5b,0x7d,0xd2,0x37, + 0x14,0x6b,0xdd,0xac,0xb9,0xbc,0xa3,0x9e,0x7d,0x97,0xbc,0x6f,0x67,0x10,0x8d,0xc8, + 0x55,0x83,0xdb,0x97,0x92,0xf7,0x11,0x93,0x3a,0xa8,0xf1,0xe2,0x0a,0x08,0xfd,0xd5, + 0x46,0xa8,0x74,0xa0,0x79,0x95,0x0c,0xf6,0x41,0x02,0xde,0x43,0x7a,0x8b,0x36,0xa2, + 0x99,0x0b,0xda,0x5d,0x0f,0xb9,0x2a,0xc6,0x0b,0x27,0xa8,0x62,0xa0,0x60,0x0f,0x0e, + 0x8d,0x76,0x91,0x82,0x2f,0xc0,0xda,0xf4,0x84,0x43,0x03,0x57,0x6c,0x05,0xe9,0xe8, + 0x9b,0xc5,0x3b,0x87,0xdb,0x68,0x23,0xa0,0xf2,0x4a,0xe7,0x0e,0x0c,0xa3,0x39,0x2c, + 0x19,0x63,0x69,0x25,0x6e,0x2d,0x0e,0x40,0x73,0xc2,0x1b,0x30,0xde,0x80,0x54,0x06, + 0x58,0x28,0xbe,0x73,0x67,0xbe,0x48,0x35,0x45,0x07,0x6a,0xc0,0xc2,0x25,0x5b,0x64, + 0x04,0x7e,0x57,0xe2,0xd3,0xe0,0x09,0x60,0xbe,0x07,0x20,0x6c,0x0a,0x80,0xa0,0x09, + 0x26,0x29,0x51,0xfe,0x6a,0x98,0x64,0x17,0xe7,0x2f,0x6c,0x35,0x83,0xf6,0x33,0x44, + 0x96,0x65,0xa7,0x70,0x57,0x46,0x20,0x6e,0x90,0x36,0xbf,0xc2,0x09,0xec,0x1c,0x2d, + 0xe5,0xa8,0x77,0xec,0xfe,0xd2,0x62,0x7e,0xd7,0x84,0xa2,0x3b,0xed,0x03,0x12,0x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0xc7,0x94,0x05,0xf0,0x2b,0x81,0x49,0x06, + 0x43,0xe4,0x80,0xcc,0x06,0xc9,0xd2,0x47,0xa4,0xe8,0x81,0x15,0x3c,0xed,0x93,0x6a, + 0xa9,0xb9,0x00,0x40,0x02,0x10,0x1e,0xac,0x24,0x8c,0xef,0xaf,0x12,0x1a,0x59,0x5d, + 0x9a,0xd3,0x95,0xab,0x85,0x1c,0x4e,0xaa,0x2e,0x14,0xf8,0x4d,0x50,0xea,0x04,0xb8, + 0x06,0x8a,0x56,0x02,0x10,0x12,0x5f,0x0b,0x6e,0x9a,0x90,0x86,0x98,0x1a,0xc0,0xde, + 0x03,0x10,0x1a,0x45,0x63,0xea,0x52,0x04,0x42,0xe4,0x3c,0xa4,0xc9,0xb9,0xcf,0x84, + 0x25,0x10,0x41,0x40,0x98,0x20,0xd2,0x4c,0x08,0x89,0xba,0x61,0x9e,0x03,0x20,0x52, + 0x89,0x4c,0x37,0x40,0x1b,0x00,0xc4,0x06,0x85,0xd3,0x6f,0x50,0x51,0xde,0x26,0x11, + 0x38,0x20,0x98,0xa6,0x08,0x70,0x1b,0x5f,0x4a,0x7c,0x0a,0xc0,0x05,0x27,0x5a,0x01, + 0x54,0x09,0xc0,0x46,0x1e,0xc1,0x59,0x80,0xa8,0x63,0x37,0x5a,0x2f,0xfc,0x8a,0x0a, + 0x2e,0x02,0x78,0x45,0xc4,0xb7,0x03,0x78,0x1c,0x8b,0x36,0x07,0x6d,0xb8,0x81,0xec, + 0x05,0x1f,0x2a,0x11,0x31,0xec,0x18,0x7a,0x08,0x4b,0x5e,0x1e,0x28,0x11,0xd1,0xcc, + 0x3d,0x05,0x20,0x15,0x8c,0x7d,0xc6,0x2f,0x69,0x7b,0x65,0x07,0x34,0x6f,0xa6,0x15, + 0x07,0xb4,0xde,0x48,0x50,0x82,0xa8,0x53,0x46,0x06,0x21,0x40,0xd1,0xbc,0x25,0x69, + 0xef,0x49,0x7a,0x52,0x58,0x8b,0xda,0x18,0xf4,0xde,0x86,0x6c,0xdd,0x45,0x92,0x67, + 0x4a,0x3a,0x48,0xa6,0x90,0xd4,0xfc,0x81,0x08,0x32,0x02,0xf6,0x59,0xb8,0xb8,0x40, + 0x40,0x04,0x50,0x36,0xac,0xf1,0x58,0x6f,0xc0,0x6a,0x40,0xa5,0x8f,0x76,0x05,0x44, + 0x08,0x80,0x80,0x05,0x64,0xdb,0x3e,0x72,0x79,0xc6,0xcc,0x97,0xe0,0xd0,0x96,0x30, + 0x32,0xe2,0x83,0x6f,0xb9,0x0a,0xa1,0x52,0x05,0xf5,0xc0,0x93,0x38,0x09,0xee,0x64, + 0x02,0xcb,0x89,0xc8,0x34,0x9a,0xa4,0x99,0x37,0x08,0xfd,0x25,0x67,0x6e,0x51,0x0b, + 0x9b,0x02,0x47,0xe2,0xe5,0x28,0xb9,0x66,0x8f,0x77,0x19,0x2c,0x1f,0x85,0x60,0x2d, + 0x30,0xe9,0x00,0xb4,0x77,0x61,0x3f,0x08,0xf8,0x74,0x91,0x32,0x6a,0xb0,0xc6,0xc2, + 0xb5,0x67,0x22,0xbf,0x2f,0xc0,0xed,0xe1,0x62,0x66,0x65,0x61,0x8a,0xda,0x1d,0x41, + 0x3b,0x43,0x3b,0x7d,0x94,0x76,0xa4,0x52,0x0d,0x1f,0x21,0x01,0x70,0xd2,0x31,0x5a, + 0x83,0x40,0x88,0x04,0x43,0xf5,0x92,0x40,0x04,0x44,0x26,0x01,0x90,0x0b,0x88,0xfc, + 0x03,0x80,0x17,0x11,0x48,0x05,0xc0,0x37,0x4b,0x70,0xd1,0x45,0x64,0x10,0xd0,0x2f, + 0x8b,0x7d,0x67,0x00,0x79,0x18,0xc4,0x24,0xc0,0x85,0x11,0x48,0x29,0x81,0x0c,0xeb, + 0x61,0x3b,0x58,0xa8,0x18,0x45,0xfe,0x2e,0x65,0x3d,0x96,0x38,0x22,0x01,0x1c,0x0b, + 0xb0,0xc3,0x04,0xd2,0x20,0xa1,0x42,0xa0,0x70,0x6d,0x43,0x9e,0x10,0xd0,0x8c,0x92, + 0xa1,0x05,0x41,0x42,0x8e,0xe2,0x0a,0x50,0x93,0x55,0x2c,0x46,0xca,0x3c,0x03,0xe0, + 0x1e,0x94,0x0c,0x5e,0x40,0x43,0x7a,0x68,0x76,0x0b,0x34,0x16,0x91,0x2f,0xbd,0x5e, + 0x12,0x4a,0xc3,0x37,0x68,0x99,0xc4,0x08,0x76,0xd3,0x10,0x01,0x08,0x86,0xd0,0x49, + 0x39,0xec,0x32,0xd9,0xb3,0x14,0x84,0x99,0x24,0xc1,0x26,0x44,0x4b,0x56,0xd8,0x5a, + 0xc2,0xda,0x31,0x25,0x49,0x0b,0xc4,0xbb,0x30,0x12,0x46,0x9c,0x50,0x02,0x21,0x14, + 0x28,0x29,0xa8,0x0c,0xdd,0xc9,0x4f,0x25,0x68,0x63,0x04,0xc6,0xb2,0x23,0x2b,0x45, + 0x60,0xe5,0x42,0xf2,0x1d,0x60,0x1b,0x80,0x4e,0x68,0x08,0x09,0x3c,0xf4,0x9b,0xa1, + 0xa3,0x8a,0xe8,0x53,0x22,0xbe,0x7f,0xe8,0xa1,0x86,0xa0,0xf7,0x51,0x50,0x73,0x7c, + 0x52,0xd5,0xac,0x4b,0x90,0x28,0x45,0x3e,0x29,0x8e,0x17,0x4c,0xbc,0x54,0xc0,0x82, + 0xad,0xb7,0xf9,0x98,0xe0,0xd2,0x07,0x23,0x0d,0x91,0x27,0x0d,0x24,0x19,0xf4,0x68, + 0xb1,0x40,0xcf,0x26,0xc2,0x51,0xb0,0x62,0xc6,0xd4,0x27,0x21,0xaa,0x2b,0xa8,0x28, + 0xe4,0x6d,0x48,0xca,0x6f,0x4b,0xb6,0x1e,0xc8,0x99,0x10,0x08,0x29,0x46,0xb3,0x26, + 0x41,0x99,0x06,0x42,0x51,0xe1,0x0d,0x25,0x38,0x2a,0x62,0xd0,0x3a,0xd0,0x1b,0x8c, + 0xc8,0x91,0x93,0x01,0x33,0x94,0x5e,0x40,0x6d,0x03,0xc8,0xdf,0x00,0x5d,0x1a,0x94, + 0xbd,0xc6,0xd0,0x6f,0x80,0x5f,0x8d,0x48,0x0b,0x85,0xa1,0x18,0xa5,0x84,0xc1,0x45, + 0xe7,0x60,0x72,0x37,0x39,0x4e,0x63,0x28,0xbf,0x48,0xcd,0x1d,0x80,0x76,0xe2,0x29, + 0x3d,0x3c,0x6e,0x06,0xe9,0x1a,0xc8,0xd2,0x87,0x5e,0x36,0x01,0xf6,0x30,0x19,0x4d, + 0x23,0x74,0x38,0x88,0xdb,0x81,0x90,0x35,0xa4,0x67,0x8e,0xb8,0x5a,0x23,0x7c,0x10, + 0xd5,0x1d,0x81,0x09,0x35,0x47,0x3e,0x57,0xaa,0xbd,0xc8,0x38,0xdc,0xa5,0xc5,0x10, + 0x49,0x50,0x87,0x3d,0x52,0x0a,0x96,0x90,0x16,0xa8,0x02,0x27,0xb8,0x5d,0xb3,0x88, + 0xe6,0x20,0xf9,0xa8,0x53,0xb4,0xdb,0x36,0x71,0x23,0x59,0x37,0x61,0x9e,0x69,0x98, + 0x57,0x90,0x38,0x02,0x23,0x33,0x29,0xbc,0xe2,0x81,0x47,0x0c,0x41,0xb1,0x86,0x1f, + 0x07,0xf4,0xbe,0x27,0xc0,0x89,0x6a,0x58,0x7e,0xf1,0xcd,0x94,0xb2,0xa8,0xa0,0xbe, + 0x48,0x05,0x0b,0x41,0x4d,0x41,0x28,0x88,0xe2,0x1a,0x40,0xd3,0x9c,0x0f,0x0d,0xd1, + 0xca,0x58,0x8f,0x10,0x15,0x23,0xc8,0x4b,0xa8,0xf3,0x0f,0x90,0x0a,0x67,0x3d,0x7c, + 0xe2,0x10,0x40,0x44,0x96,0xe9,0x0c,0x26,0x8e,0x43,0x68,0x0b,0x90,0xec,0x87,0xd5, + 0xec,0xd4,0xf1,0xf2,0x21,0xd5,0xb8,0x20,0x49,0x91,0x34,0x8a,0x1f,0x2d,0x22,0xa9, + 0x05,0xc8,0xb2,0x3c,0x64,0xb8,0x91,0x04,0x8c,0x15,0xae,0xe8,0xf8,0x43,0x01,0x52, + 0x0d,0x80,0x52,0x83,0x71,0xf3,0x24,0x53,0x21,0xa9,0x1c,0xc7,0xc8,0x96,0x44,0x4b, + 0x73,0x91,0xa7,0xa4,0x87,0x24,0x52,0x1e,0x80,0x00,0x20,0x00 }; static datatype data_init_script[]= { - { 255, 13287, 6328, data__init_script, 0 } + { 255, 13413, 6380, data__init_script, 0 } }; diff --git a/libhxcfe/sources/loaders/woz_loader/woz_format.h b/libhxcfe/sources/loaders/woz_loader/woz_format.h index 475e2895..067079eb 100644 --- a/libhxcfe/sources/loaders/woz_loader/woz_format.h +++ b/libhxcfe/sources/loaders/woz_loader/woz_format.h @@ -52,7 +52,6 @@ typedef struct woz_chunk_ uint8_t data[]; // Data }woz_chunk; - typedef struct woz_info_ { // Rev 1,2 & 3 @@ -70,7 +69,7 @@ typedef struct woz_info_ uint16_t compatible_hw; // 0x0001 = Apple ][, 0x0002 = Apple ][ Plus, 0x0004 = Apple //e (unenhanced), 0x0008 = Apple //c, 0x0010 = Apple //e Enhanced // 0x0020 = Apple IIgs, 0x0040 = Apple //c Plus, 0x0080 = Apple ///, 0x0100 = Apple /// Plus uint16_t required_ram; // In kB - uint16_t largest_track; // in 512 blocks number. + uint16_t largest_track; // In 512 blocks number. // Rev 3 uint16_t flux_block; @@ -78,4 +77,11 @@ typedef struct woz_info_ }woz_info; +typedef struct woz_trk_ +{ + uint16_t starting_block; // 1 Block = 512 bytes. From the beginning of the file. + uint16_t block_count; // Area size in blocks. + uint32_t bit_count; // Number of bits to use. +}woz_trk; + #pragma pack() diff --git a/libhxcfe/sources/loaders/woz_loader/woz_loader.c b/libhxcfe/sources/loaders/woz_loader/woz_loader.c index c835b307..0708cb2b 100644 --- a/libhxcfe/sources/loaders/woz_loader/woz_loader.c +++ b/libhxcfe/sources/loaders/woz_loader/woz_loader.c @@ -130,14 +130,28 @@ static int get_woz_chunk(unsigned char * buf, int buf_size, int offset, uint32_ int WOZ_libLoad_DiskFile(HXCFE_IMGLDR * imgldr_ctx,HXCFE_FLOPPY * floppydisk,char * imgfile,void * parameters) { + HXCFE_CYLINDER* currentcylinder; + HXCFE_SIDE* currentside; FILE * f; woz_fileheader fileheader; + woz_info * info; woz_chunk * chunk; + woz_trk * trks; int offset; int filesize; unsigned char * file_buffer; uint32_t crc32; char * tmp_str; + char tmp_str_buf[64]; + unsigned char * tmap_array; + int tmap_array_size; + int i, j, k, rpm; + int max_track; + int intertracks; + unsigned char woz_track; + unsigned char * track_dat; + + intertracks = 0; imgldr_ctx->hxcfe->hxc_printf(MSG_DEBUG,"WOZ_libLoad_DiskFile %s",imgfile); @@ -200,10 +214,39 @@ int WOZ_libLoad_DiskFile(HXCFE_IMGLDR * imgldr_ctx,HXCFE_FLOPPY * floppydisk,cha { imgldr_ctx->hxcfe->hxc_printf(MSG_ERROR,"BAD CRC32, Corrupted file !",imgfile); free(file_buffer); - hxc_fclose(f); return HXCFE_BADFILE; } + offset = sizeof(woz_fileheader); + while( offset < filesize) + { + chunk = (woz_chunk *)&file_buffer[offset]; + switch(chunk->id) + { + case CHUNK_INFO: + imgldr_ctx->hxcfe->hxc_printf(MSG_DEBUG,"INFO Chunk id : 0x%.8X, Offset : 0x%.8X, Size : %d",chunk->id,offset,chunk->size); + break; + case CHUNK_TMAP: + imgldr_ctx->hxcfe->hxc_printf(MSG_DEBUG,"TMAP Chunk id : 0x%.8X, Offset : 0x%.8X, Size : %d",chunk->id,offset,chunk->size); + break; + case CHUNK_TRKS: + imgldr_ctx->hxcfe->hxc_printf(MSG_DEBUG,"TRKS Chunk id : 0x%.8X, Offset : 0x%.8X, Size : %d",chunk->id,offset,chunk->size); + break; + case CHUNK_META: + imgldr_ctx->hxcfe->hxc_printf(MSG_DEBUG,"META Chunk id : 0x%.8X, Offset : 0x%.8X, Size : %d",chunk->id,offset,chunk->size); + break; + case CHUNK_WRIT: + imgldr_ctx->hxcfe->hxc_printf(MSG_DEBUG,"WRIT Chunk id : 0x%.8X, Offset : 0x%.8X, Size : %d",chunk->id,offset,chunk->size); + break; + + default: + imgldr_ctx->hxcfe->hxc_printf(MSG_DEBUG,"Unknown Chunk id : 0x%.8X, Offset : 0x%.8X, Size : %d",chunk->id,offset,chunk->size); + break; + } + + offset += (8 + chunk->size); + } + // Get and print the metadatas if available... offset = get_woz_chunk(file_buffer, filesize, 0, CHUNK_META); if( offset > 0 ) @@ -228,51 +271,169 @@ int WOZ_libLoad_DiskFile(HXCFE_IMGLDR * imgldr_ctx,HXCFE_FLOPPY * floppydisk,cha { imgldr_ctx->hxcfe->hxc_printf(MSG_ERROR,"No INFO Chunk ?!"); free(file_buffer); - hxc_fclose(f); return HXCFE_BADFILE; } - /* - offset = sizeof(woz_fileheader); - while( offset < filesize) + info = (woz_info *)&file_buffer[offset + 8]; + + imgldr_ctx->hxcfe->hxc_printf(MSG_DEBUG,"INFO Version : %d",info->version); + imgldr_ctx->hxcfe->hxc_printf(MSG_INFO_1,"Disk type : %d",info->disk_type); + memset(tmp_str_buf,0,sizeof(tmp_str_buf)); + memcpy(tmp_str_buf,info->creator,32); + imgldr_ctx->hxcfe->hxc_printf(MSG_INFO_1,"Creator : %s",tmp_str_buf); + + // Get the tracks map array + offset = get_woz_chunk(file_buffer, filesize, 0, CHUNK_TMAP); + if( offset < 0 ) { + imgldr_ctx->hxcfe->hxc_printf(MSG_ERROR,"No TMAPs array ?!"); + free(file_buffer); + return HXCFE_BADFILE; + } - switch(chunk->id) + tmap_array_size = ((woz_chunk *)(&file_buffer[offset]))->size; // Should be 160. + tmap_array = (unsigned char*)&file_buffer[offset + 8]; + + // Get the tracks data area + offset = get_woz_chunk(file_buffer, filesize, 0, CHUNK_TRKS); + if( offset < 0 ) + { + imgldr_ctx->hxcfe->hxc_printf(MSG_ERROR,"No TRKS area ?!"); + free(file_buffer); + return HXCFE_BADFILE; + } + + trks = (woz_trk*)&file_buffer[offset + 8]; + + max_track = 0; + switch( info->disk_type ) + { + case 1: + // 5.25" + for(i=0;ifloppyNumberOfSide = 1; + rpm = 300; + + intertracks = hxcfe_getEnvVarValue( imgldr_ctx->hxcfe, "WOZLOADER_INTERTRACKSLOADING" ); + + if(intertracks) + max_track = max_track * 4; + break; + + case 2: + // 3.5" + i = (tmap_array_size/2) - 1; + while( i ) + { + if(tmap_array[i*2] != 0xFF || tmap_array[(i*2)+1] != 0xFF ) + { + if( max_track < i ) + max_track = i; + } + i--; + } + + if( max_track < 82 ) + max_track = 82; + + floppydisk->floppyNumberOfSide = 2; + rpm = 300; + + break; + + default: + imgldr_ctx->hxcfe->hxc_printf(MSG_ERROR,"Unsupported disk type : %d", info->disk_type ); + free(file_buffer); + return HXCFE_BADFILE; + break; + } + + floppydisk->floppySectorPerTrack = -1; + floppydisk->floppyNumberOfTrack = max_track; + floppydisk->floppyBitRate = 250000; + floppydisk->floppyiftype = GENERIC_SHUGART_DD_FLOPPYMODE; + + floppydisk->tracks = (HXCFE_CYLINDER**)calloc( 1, sizeof(HXCFE_CYLINDER*)*floppydisk->floppyNumberOfTrack ); + if( !floppydisk->tracks ) + { + free(file_buffer); + return HXCFE_INTERNALERROR; + } + + for(j=0;jfloppyNumberOfTrack;j++) + { + floppydisk->tracks[j] = allocCylinderEntry(rpm,floppydisk->floppyNumberOfSide); + currentcylinder=floppydisk->tracks[j]; + + for(i=0;ifloppyNumberOfSide;i++) { - case CHUNK_INFO: - printf("info chunk id :0x%.8X\n",chunk->id); - break; - case CHUNK_TMAP: - printf("tmap chunk id :0x%.8X\n",chunk->id); - break; - case CHUNK_TRKS: - printf("trks chunk id :0x%.8X\n",chunk->id); - break; - case CHUNK_META: - if(chunk->size > 0 && chunk->size < 1*1024*1024 ) + hxcfe_imgCallProgressCallback(imgldr_ctx,(j<<1) + (i&1),floppydisk->floppyNumberOfTrack*2 ); + + if( info->disk_type == 2 ) + { + woz_track = tmap_array[(j*2)+i]; + } + else + { + if(intertracks) + woz_track = tmap_array[j]; + else + woz_track = tmap_array[j*4]; + } + + if( woz_track != 0xFF ) + { + currentcylinder->sides[i] = tg_alloctrack(floppydisk->floppyBitRate,ISOIBM_MFM_ENCODING,rpm,trks[woz_track].bit_count*2,3800,0,0); + currentside = currentcylinder->sides[i]; + + if( trks[woz_track].starting_block * 512 < filesize) { - tmp_str = calloc( 1, chunk->size + 1); - if( tmp_str ) - { - memcpy( tmp_str, chunk->data, chunk->size ); - imgldr_ctx->hxcfe->hxc_printf(MSG_INFO_1,"%s",tmp_str); + track_dat = &file_buffer[(trks[woz_track].starting_block * 512)]; - free(tmp_str); + for(k=0;k>3)] & (0x80>>(k&7)) ) + { + currentside->databuffer[(k*2)>>3] |= (0x80>>((k*2)&7)); + } } } - break; + } + else + { + currentcylinder->sides[i] = tg_alloctrack(floppydisk->floppyBitRate,ISOIBM_MFM_ENCODING,rpm,50000*2,3800,0,TG_ALLOCTRACK_ALLOCFLAKEYBUFFER); + currentside = currentcylinder->sides[i]; - default: - imgldr_ctx->hxcfe->hxc_printf(MSG_DEBUG,"Unknown chunk id ! : 0x%.8X (size : %d)",chunk->id,chunk->size); - break; + for(k=0;k<50000/2;k++) + { + currentside->databuffer[(k*4)>>3] |= (0x80>>((k*4)&7)); + } + + for(k=0;k<50000*2;k++) + { + currentside->flakybitsbuffer[k>>3] |= (0x80>>(k&7)); + } + } } + } - offset += (8 + chunk->size); - }*/ + hxcfe_sanityCheck(imgldr_ctx->hxcfe,floppydisk); + + imgldr_ctx->hxcfe->hxc_printf(MSG_INFO_1,"track file successfully loaded and encoded!"); free(file_buffer); - return HXCFE_INTERNALERROR; + return HXCFE_NOERROR; } int WOZ_libGetPluginInfo(HXCFE_IMGLDR * imgldr_ctx,uint32_t infotype,void * returnvalue)