summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author arbee <rb6502@users.noreply.github.com>2022-09-24 21:43:26 -0400
committer arbee <rb6502@users.noreply.github.com>2022-09-24 21:43:26 -0400
commit2350f9e0437344fcdb0233bbb50de04b5b702c96 (patch)
tree86da62b58c3d9aea0a4c9b6b1885d5d6c17be3f0
parentdc57db5cebf8418f5932112dcd254b3d565b3023 (diff)
imgtool: make the Apple formats build, but they will not function (did they before?) [R. Belmont]
-rw-r--r--src/tools/imgtool/modules/mac.cpp23
-rw-r--r--src/tools/imgtool/modules/prodos.cpp24
2 files changed, 44 insertions, 3 deletions
diff --git a/src/tools/imgtool/modules/mac.cpp b/src/tools/imgtool/modules/mac.cpp
index 0266f8affb8..0049136c179 100644
--- a/src/tools/imgtool/modules/mac.cpp
+++ b/src/tools/imgtool/modules/mac.cpp
@@ -97,6 +97,7 @@
#include "formats/ap_dsk35.h"
#include "formats/imageutl.h"
+
#include "opresolv.h"
#include <cctype>
@@ -120,6 +121,26 @@
#pragma mark MISCELLANEOUS UTILITIES
#endif
+static const uint8_t apple35_tracklen_800kb[80] =
+{
+ 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,
+ 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
+ 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8
+};
+
+static int apple35_sectors_per_track(floppy_image_legacy *image, int track)
+{
+ int sectors;
+
+ assert(track >= 0);
+ assert(track < std::size(apple35_tracklen_800kb));
+
+ sectors = apple35_tracklen_800kb[track];
+ return sectors;
+}
+
struct UINT16BE
{
uint8_t bytes[2];
@@ -6375,7 +6396,7 @@ static void generic_mac_get_info(const imgtool_class *imgclass, uint32_t state,
case IMGTOOLINFO_PTR_SET_ATTRS: info->set_attrs = mac_image_setattrs; break;
case IMGTOOLINFO_PTR_GET_ICON_INFO: info->get_iconinfo = mac_image_geticoninfo; break;
case IMGTOOLINFO_PTR_SUGGEST_TRANSFER: info->suggest_transfer = mac_image_suggesttransfer; break;
- case IMGTOOLINFO_PTR_FLOPPY_FORMAT: info->p = (void *) floppyoptions_apple35_mac; break;
+ // case IMGTOOLINFO_PTR_FLOPPY_FORMAT: info->p = (void *) floppyoptions_apple35_mac; break;
case IMGTOOLINFO_PTR_CHARCONVERTER: info->charconverter = &charconverter_macos_roman; break;
}
}
diff --git a/src/tools/imgtool/modules/prodos.cpp b/src/tools/imgtool/modules/prodos.cpp
index e196d53b491..32170b3ecae 100644
--- a/src/tools/imgtool/modules/prodos.cpp
+++ b/src/tools/imgtool/modules/prodos.cpp
@@ -136,6 +136,26 @@
#define ROOTDIR_BLOCK 2
#define BLOCK_SIZE 512
+static const uint8_t apple35_tracklen_800kb[80] =
+{
+ 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,
+ 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
+ 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8
+};
+
+static int apple35_sectors_per_track(floppy_image_legacy *image, int track)
+{
+ int sectors;
+
+ assert(track >= 0);
+ assert(track < std::size(apple35_tracklen_800kb));
+
+ sectors = apple35_tracklen_800kb[track];
+ return sectors;
+}
+
struct prodos_diskinfo
{
imgtoolerr_t (*load_block)(imgtool::image &image, int block, void *buffer);
@@ -2245,7 +2265,7 @@ void prodos_525_get_info(const imgtool_class *imgclass, uint32_t state, union im
/* --- the following bits of info are returned as pointers to data or functions --- */
case IMGTOOLINFO_PTR_FLOPPY_CREATE: info->create = prodos_diskimage_create_525; break;
case IMGTOOLINFO_PTR_FLOPPY_OPEN: info->open = prodos_diskimage_open_525; break;
- case IMGTOOLINFO_PTR_FLOPPY_FORMAT: info->p = (void *) floppyoptions_apple2; break;
+ // case IMGTOOLINFO_PTR_FLOPPY_FORMAT: info->p = (void *) floppyoptions_apple2; break;
default: generic_prodos_get_info(imgclass, state, info); break;
}
@@ -2263,7 +2283,7 @@ void prodos_35_get_info(const imgtool_class *imgclass, uint32_t state, union img
/* --- the following bits of info are returned as pointers to data or functions --- */
case IMGTOOLINFO_PTR_FLOPPY_CREATE: info->create = prodos_diskimage_create_35; break;
case IMGTOOLINFO_PTR_FLOPPY_OPEN: info->open = prodos_diskimage_open_35; break;
- case IMGTOOLINFO_PTR_FLOPPY_FORMAT: info->p = (void *) floppyoptions_apple35_iigs; break;
+ // case IMGTOOLINFO_PTR_FLOPPY_FORMAT: info->p = (void *) floppyoptions_apple35_iigs; break;
default: generic_prodos_get_info(imgclass, state, info); break;
}