From 59e70f74f8702f9f381303a33a21392773c2845b Mon Sep 17 00:00:00 2001 From: Toni Wilen Date: Sun, 28 Sep 2025 19:15:24 +0300 Subject: [PATCH] Mast fireball partition table fix --- filesys.cpp | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/filesys.cpp b/filesys.cpp index 3019d7e0..bbc555a9 100644 --- a/filesys.cpp +++ b/filesys.cpp @@ -8421,11 +8421,16 @@ static int pt_babe(TrapContext *ctx, uae_u8 *bufrdb, UnitInfo *uip, int unit_no, bad = rl(bufrdb + 4); if (bad) { - if (bad * hfd->ci.blocksize > FILESYS_MAX_BLOCKSIZE) - return 0; - hdf_read_rdb(hfd, bufrdb2, bad * hfd->ci.blocksize, hfd->ci.blocksize, &error); - if (bufrdb2[0] != 0xBA || bufrdb2[1] != 0xD1) - return 0; + if (bufrdb[0] == 0xba && bufrdb[1] == 0xbe) { + if (bad * hfd->ci.blocksize > FILESYS_MAX_BLOCKSIZE) + return 0; + hdf_read_rdb(hfd, bufrdb2, bad * hfd->ci.blocksize, hfd->ci.blocksize, &error); + if (bufrdb2[0] != 0xBA || bufrdb2[1] != 0xD1) + return 0; + } else { + // Only A2090 supports bad blocks. Fireball does not. + bad = 0; + } } if (partnum > 0) -- 2.47.3