Fix mangled formatting caused by clang-format.

This commit is contained in:
dg
2023-05-09 21:39:35 +00:00
parent 466c3c34e5
commit baaeb0bca7
10 changed files with 231 additions and 418 deletions

View File

@@ -9,14 +9,13 @@
#include "fmt/format.h"
#include <string.h>
// clang-format off
/*
* data: X X X X X X X X X - - X - X - X - X X - X
* - X - = 0xff956a flux: 01 01 01 01 01 01 01 01 01 00 10 01 00 01 00
* 01 00 01 01 00 01 00 01 00 = 0x555549111444
*
* data: X X X X X X X X - X X - X - X - X - - X -
* X - X = 0xff6a95 flux: 01 01 01 01 01 01 01 01 00 01 01 00 01 00 01
* 00 01 00 10 01 00 01 00 01 = 0x555514444911
* data: X X X X X X X X X - - X - X - X - X X - X - X - = 0xff956a
* flux: 01 01 01 01 01 01 01 01 01 00 10 01 00 01 00 01 00 01 01 00 01 00 01 00 = 0x555549111444
*
* data: X X X X X X X X - X X - X - X - X - - X - X - X = 0xff6a95
* flux: 01 01 01 01 01 01 01 01 00 01 01 00 01 00 01 00 01 00 10 01 00 01 00 01 = 0x555514444911
*
* Each pattern is prefixed with this one:
*
@@ -32,8 +31,8 @@
* 0100010010010010 = MFM encoded
* 1000100100100100 = with trailing zero
* - - - X - - X - = effective bitstream = 0x12
*
*/
// clang-format on
static const FluxPattern SECTOR_PATTERN(64, SECTOR_ID);
static const FluxPattern DATA_PATTERN(64, DATA_ID);

View File

@@ -43,8 +43,8 @@ FluxFileProto loadFl2File(const std::string filename)
ifs.read(buffer, sizeof(buffer));
if (strncmp(buffer, "SQLite format 3", 16) == 0)
error(
"this flux file is too old; please use the "
"upgrade-flux-file tool to upgrade it");
"this flux file is too old; please use the upgrade-flux-file tool "
"to upgrade it");
FluxFileProto proto;
ifs.seekg(0);

View File

@@ -43,14 +43,10 @@ void FlagGroup::addFlag(Flag* flag)
void FlagGroup::applyOption(const OptionProto& option)
{
if (option.config().option_size() > 0)
error(
"option '{}' has an option inside it, which isn't "
"allowed",
error("option '{}' has an option inside it, which isn't allowed",
option.name());
if (option.config().option_group_size() > 0)
error(
"option '{}' has an option group inside it, which isn't "
"allowed",
error("option '{}' has an option group inside it, which isn't allowed",
option.name());
Logger() << fmt::format("OPTION: {}",

View File

@@ -19,8 +19,7 @@ public:
~AuFluxSink()
{
std::cerr << "Warning: do not play these files, or you will break your "
"speakers"
" and/or ears!\n";
"speakers and/or ears!\n";
}
public:

View File

@@ -144,8 +144,8 @@ public:
else if (currentTrackTrack != track)
{
error(
"D88: all sectors in a track must belong to the "
"same track");
"D88: all sectors in a track must belong to the same "
"track");
}
if (trackSectorSize < 0)
{
@@ -194,8 +194,8 @@ public:
else if (trackSectorSize != sectorSize)
{
error(
"D88: multiple sector sizes per track are "
"currently unsupported");
"D88: multiple sector sizes per track are currently "
"unsupported");
}
Bytes data(sectorSize);
inputFile.read((char*)data.begin(), data.size());

View File

@@ -100,14 +100,14 @@ public:
else if (currentTrackTrack != track)
{
error(
"NFD: all sectors in a track must belong to the "
"same track");
"NFD: all sectors in a track must belong to the same "
"track");
}
else if (currentTrackHead != head)
{
error(
"NFD: all sectors in a track must belong to the "
"same head");
"NFD: all sectors in a track must belong to the same "
"head");
}
if (trackSectorSize < 0)
{
@@ -142,8 +142,8 @@ public:
else if (trackSectorSize != sectorSize)
{
error(
"NFD: multiple sector sizes per track are "
"currently unsupported");
"NFD: multiple sector sizes per track are currently "
"unsupported");
}
Bytes data(sectorSize);
inputFile.read((char*)data.begin(), data.size());

View File

@@ -13,9 +13,8 @@
#include <ctime>
/*
* Where to get the type of encoding FM or MFM? Now solved with options in
*proto config
*
* Where to get the type of encoding FM or MFM? Now solved with options in
* proto config
*/
static const char LABEL[] = "IMD archive by fluxengine on"; // 22 karakters
static uint8_t getModulationandSpeed(
@@ -48,8 +47,8 @@ static uint8_t getModulationandSpeed(
}
}
else if ((flags > 1475) and (flags < 1575)) // SD disk
/* 300 kbps*/
{
/* 300 kbps*/
if (mode == ImdOutputProto::RECMODE_FM)
{
return 1;
@@ -60,8 +59,8 @@ static uint8_t getModulationandSpeed(
}
}
else if ((flags > 1900) and (flags < 2100)) // DD disk
/* 250 kbps */
{
/* 250 kbps */
if (mode == ImdOutputProto::RECMODE_FM)
{
return 2;
@@ -120,30 +119,37 @@ static uint8_t setSectorSize(int flags)
#define HEAD_MASK 0x3F
#define END_OF_FILE 0x1A
// clang-format off
/*
*IMAGE FILE FORMAT
*The overall layout of an ImageDisk .IMD image file is:
*IMD v.vv: dd/mm/yyyy hh:mm:ss
*Comment (ASCII only - unlimited size)
*1A byte - ASCII EOF character
*- For each track on the disk:
*1 byte Mode value (0-5) see
*getModulationspeed for definition 1 byte Cylinder
*(0-n) 1 byte Head (0-1) 1 byte number of sectors in track
*(1-n) 1 byte sector size
*(0-6) see getsectorsize for definition sector numbering map
*IMD start numbering sectors with 1. sector cylinder map (optional)
*definied in high byte of head (since head is 0 or 1) sector head map
*(optional) definied in high byte of head (since
*head is 0 or 1) sector data records For each data record: 1 byte Sector
*status 0: Sector data unavailable - could not be read 1: Normal data: (Sector
*Size) bytes follow 2: Compressed: All bytes in sector have same value (xx) 3:
*Normal data with "Deleted-Data address mark" 4: Compressed with "Deleted-Data
*address mark" 5: Normal data read with data error 6: Compressed read with data
*error" 7: Deleted data read with data error" 8: Compressed, Deleted read with
*data error" sector size of Sector data <End of file>
* IMAGE FILE FORMAT
* The overall layout of an ImageDisk .IMD image file is:
* IMD v.vv: dd/mm/yyyy hh:mm:ss
* Comment (ASCII only - unlimited size)
* 1A byte - ASCII EOF character
* - For each track on the disk:
* 1 byte Mode value (0-5) see getModulationspeed for definition
* 1 byte Cylinder (0-n)
* 1 byte Head (0-1)
* 1 byte number of sectors in track (1-n)
* 1 byte sector size (0-6) see getsectorsize for definition
* sector numbering map IMD start numbering sectors with 1.
* sector cylinder map (optional) definied in high byte of head (since head is 0 or 1)
* sector head map (optional) definied in high byte of head (since head is 0 or 1)
* sector data records For each data record:
* 1 byte Sector status
* 0: Sector data unavailable - could not be read
* 1: Normal data: (Sector Size) bytes follow
* 2: Compressed: All bytes in sector have same value (xx)
* 3: Normal data with "Deleted-Data address mark"
* 4: Compressed with "Deleted-Data address mark"
* 5: Normal data read with data error
* 6: Compressed read with data error"
* 7: Deleted data read with data error"
* 8: Compressed, Deleted read with data error"
* sector size of Sector data
* <End of file>
*/
// clang-format on
class ImdImageWriter : public ImageWriter
{
public:
@@ -368,24 +374,28 @@ public:
sectorId++)
{
// const auto& sector = sectors.get(track, head,
//sectorId);
// sectorId);
bw.write_8(sector->logicalSide); // 1 byte logical side
}
}
// Now read data and write to file
for (int sectorId = 0; sectorId < numSectorsinTrack; sectorId++)
{
/* For each data record:
* 1 byte Sector status
* 0: Sector data unavailable - could not be
*read 1: Normal data: (Sector Size) bytes follow 2:
*Compressed: All bytes in sector have same value (xx) 3:
*Normal data with "Deleted-Data address mark" 4: Compressed
*with "Deleted-Data address mark" 5: Normal data read with
*data error 6: Compressed read with data error" 7: Deleted
*data read with data error" 8: Compressed, Deleted read
*with data error" sector size of Sector data
*/
// clang-format off
/* For each data record:
* 1 byte Sector status
* 0: Sector data unavailable - could not be read
* 1: Normal data: (Sector Size) bytes follow
* 2: Compressed: All bytes in sector have same value (xx)
* 3: Normal data with "Deleted-Data address mark"
* 4: Compressed with "Deleted-Data address mark"
* 5: Normal data read with data error
* 6: Compressed read with data error"
* 7: Deleted data read with data error"
* 8: Compressed, Deleted read with data error"
* sector size of Sector data
*/
// clang-format on
// read sector
const auto& sector = image.get(track, head, sectorId + 1);
bool blnCompressable =
@@ -429,22 +439,19 @@ public:
}
switch (sector->status)
{
/*fluxengine knows of a few sector statussen but not
*all of the statussen in IMD.
* // the statussen are in sector.h. Translation to
*fluxengine is as follows: Statussen fluxengine
*| Status IMD
*--------------------------------------------------------------------------------------------------------------------
* OK, | 1, 2 (Normal
*data: (Sector Size) of (compressed) bytes follow)
* BAD_CHECKSUM, | 5, 6, 7,
*8 MISSING, sector not found
*| 0 (Sector data unavailable - could not be read)
* DATA_MISSING, sector present but no data found
*| 3, 4 CONFLICT,
*| INTERNAL_ERROR
*|
*/
// clang-format off
/* fluxengine knows of a few sector statussen but not all of the statussen in IMD.
* // the statussen are in sector.h. Translation to fluxengine is as follows:
* Statussen fluxengine | Status IMD
*--------------------------------------------------------------------------------------------------------------------
* OK, | 1, 2 (Normal data: (Sector Size) of (compressed) bytes follow)
* BAD_CHECKSUM, | 5, 6, 7, 8
* MISSING, sector not found | 0 (Sector data unavailable - could not be read)
* DATA_MISSING, sector present but no data found | 3, 4
* CONFLICT, |
* INTERNAL_ERROR |
*/
// clang-format on
case Sector::MISSING: /* Sector data unavailable -
could not be read */

View File

@@ -70,14 +70,12 @@ static void test_reads()
assert(br.read_8() == 0x01);
assert(br.read_8() == 0x02);
br.seek(0);
assert(br.read_be24() == 0x010203);
br.seek(0);
assert(br.read_le24() == 0x030201);
br.seek(0);
assert(br.read_be32() == 0x01020304);
br.seek(0);
assert(br.read_le32() == 0x04030201);
// clang-format off
br.seek(0); assert(br.read_be24() == 0x010203);
br.seek(0); assert(br.read_le24() == 0x030201);
br.seek(0); assert(br.read_be32() == 0x01020304);
br.seek(0); assert(br.read_le32() == 0x04030201);
// clang-format on
}
static void test_writes()
@@ -97,24 +95,14 @@ static void test_writes()
bw.seek(0);
};
reset();
bw.write_le16(0x0102);
assert((b == Bytes{2, 1}));
reset();
bw.write_be16(0x0102);
assert((b == Bytes{1, 2}));
reset();
bw.write_le24(0x010203);
assert((b == Bytes{3, 2, 1}));
reset();
bw.write_be24(0x010203);
assert((b == Bytes{1, 2, 3}));
reset();
bw.write_le32(0x01020304);
assert((b == Bytes{4, 3, 2, 1}));
reset();
bw.write_be32(0x01020304);
assert((b == Bytes{1, 2, 3, 4}));
// clang-format off
reset(); bw.write_le16(0x0102); assert((b == Bytes{2, 1}));
reset(); bw.write_be16(0x0102); assert((b == Bytes{1, 2}));
reset(); bw.write_le24(0x010203); assert((b == Bytes{3, 2, 1}));
reset(); bw.write_be24(0x010203); assert((b == Bytes{1, 2, 3}));
reset(); bw.write_le32(0x01020304); assert((b == Bytes{4, 3, 2, 1}));
reset(); bw.write_be32(0x01020304); assert((b == Bytes{1, 2, 3, 4}));
// clang-format on
reset();
bw += {1, 2, 3, 4, 5};

View File

@@ -5,68 +5,18 @@
#include "bytes.h"
#include "ldbs.h"
static Bytes testdata{'L',
'B',
'S',
0x01,
'D',
'S',
'K',
0x02,
0x29,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x34,
0x12,
0x00,
0x00,
'L',
'D',
'B',
0x01,
0x00,
0x00,
0x00,
0x01,
0x01,
0x00,
0x00,
0x00,
0x01,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x01,
'L',
'D',
'B',
0x01,
0x00,
0x00,
0x00,
0x02,
0x01,
0x00,
0x00,
0x00,
0x01,
0x00,
0x00,
0x00,
0x14,
0x00,
0x00,
0x00,
0x02};
static Bytes testdata{
// clang-format off
'L', 'B', 'S', 0x01, 'D', 'S', 'K', 0x02,
0x29, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x34, 0x12, 0x00, 0x00, 'L', 'D', 'B', 0x01,
0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00,
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x01, 'L', 'D', 'B', 0x01, 0x00, 0x00, 0x00,
0x02, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00,
0x00, 0x14, 0x00, 0x00, 0x00, 0x02
// clang-format on
};
static void assertBytes(const Bytes& want, const Bytes& got)
{

View File

@@ -110,256 +110,130 @@ void writeBootSector(const Dirent& dirent, uint16_t checksum)
uint8_t ckhi = checksum >> 8;
uint8_t machineCode[] = {
/* 6000 */ 0x55, /* magic number? */
/* 6001 */ 0xf3, /* di */
/* 6002 */ 0x31,
0x00,
0x00, /* ld sp, $0000 */
/* 6005 */ 0x3e,
0x00, /* ld a, $00 */
/* 6007 */ 0xed,
0x39,
0x34, /* out0 ($34), a */
/* 600a */ 0x3e,
0x0f, /* ld a, $0f */
/* 600c */ 0xed,
0x39,
0x0a, /* out0 ($0a), a */
/* 600f */ 0x3e,
0x00, /* ld a,$00 */
/* 6011 */ 0xed,
0x39,
0xd8, /* out0 ($d8),a */
/* 6014 */ 0x3e,
0xe7, /* ld a,$e7 */
/* 6016 */ 0xed,
0x39,
0x3a, /* out0 ($3a),a */
/* 6019 */ 0x3e,
0x16, /* ld a,$16 */
/* 601b */ 0xed,
0x39,
0x38, /* out0 ($38),a */
/* 601e */ 0x3e,
0x20, /* ld a,$20 */
/* 6020 */ 0xed,
0x39,
0x39, /* out0 ($39),a */
/* 6023 */ 0x01,
sslo,
sshi, /* ld bc, start sector */
/* 6026 */ 0x21,
0x00,
0xf8, /* ld hl,$f800 */
/* 6029 */ 0x1e,
scnt, /* ld e, sector count */
/* 602b */ 0x16,
0x70, /* ld d,$70 */
/* 602d */ 0xc5, /* push bc */
/* 602e */ 0xd5, /* push de */
/* 602f */ 0xe5, /* push hl */
/* 6030 */ 0x3e,
0x06, /* ld a,$06 */
/* 6032 */ 0xef, /* rst $28 */
/* 6033 */ 0xda,
0xd3,
0x60, /* jp c,$60d3 */
/* 6036 */ 0xe1, /* pop hl */
/* 6037 */ 0xd1, /* pop de */
/* 6038 */ 0xc1, /* pop bc */
/* 6039 */ 0x3e,
0x00, /* ld a,$00 */
/* 603b */ 0xed,
0x39,
0x20, /* out0 ($20),a */
/* 603e */ 0x3e,
0x58, /* ld a,$58 */
/* 6040 */ 0xed,
0x39,
0x21, /* out0 ($21),a */
/* 6043 */ 0x3e,
0x02, /* ld a,$02 */
/* 6045 */ 0xed,
0x39,
0x22, /* out0 ($22),a */
/* 6048 */ 0x3e,
0x00, /* ld a,$00 */
/* 604a */ 0xed,
0x39,
0x23, /* out0 ($23),a */
/* 604d */ 0x7a, /* ld a,d */
/* 604e */ 0xed,
0x39,
0x24, /* out0 ($24),a */
/* 6051 */ 0x3e,
0x02, /* ld a,$02 */
/* 6053 */ 0xed,
0x39,
0x25, /* out0 ($25),a */
/* 6056 */ 0x3e,
0x00, /* ld a,$00 */
/* 6058 */ 0xed,
0x39,
0x26, /* out0 ($26),a */
/* 605b */ 0x3e,
0x01, /* ld a,$01 */
/* 605d */ 0xed,
0x39,
0x27, /* out0 ($27),a */
/* 6060 */ 0x3e,
0x02, /* ld a,$02 */
/* 6062 */ 0xed,
0x39,
0x31, /* out0 ($31),a */
/* 6065 */ 0x3e,
0x40, /* ld a,$40 */
/* 6067 */ 0xed,
0x39,
0x30, /* out0 ($30),a */
/* 606a */ 0x03, /* inc bc */
/* 606b */ 0x14, /* inc d */
/* 606c */ 0x1d, /* dec e */
/* 606d */ 0x7b, /* ld a,e */
/* 606e */ 0xfe,
0x00, /* cp $00 */
/* 6070 */ 0x20,
0xbb, /* jr nz,$602d */
/* 6072 */ 0x3e,
0x02, /* ld a,$02 */
/* 6074 */ 0xef, /* rst $28 */
/* 6075 */ 0x3e,
0x20, /* ld a,$20 */
/* 6077 */ 0xed,
0x39,
0x38, /* out0 ($38),a */
/* 607a */ 0x3e,
0x0c, /* ld a,$0c */
/* 607c */ 0xed,
0x39,
0x39, /* out0 ($39),a */
/* 607f */ 0x3e,
0x64, /* ld a,$64 */
/* 6081 */ 0xed,
0x39,
0x3a, /* out0 ($3a),a */
/* 6084 */ 0x3e,
0x0f, /* ld a,$0f */
/* 6086 */ 0xed,
0x39,
0x0a, /* out0 ($0a),a */
// clang-format off
/* 6000 */ 0x55, /* magic number? */
/* 6001 */ 0xf3, /* di */
/* 6002 */ 0x31, 0x00, 0x00, /* ld sp, $0000 */
/* 6005 */ 0x3e, 0x00, /* ld a, $00 */
/* 6007 */ 0xed, 0x39, 0x34, /* out0 ($34), a */
/* 600a */ 0x3e, 0x0f, /* ld a, $0f */
/* 600c */ 0xed, 0x39, 0x0a, /* out0 ($0a), a */
/* 600f */ 0x3e, 0x00, /* ld a,$00 */
/* 6011 */ 0xed, 0x39, 0xd8, /* out0 ($d8),a */
/* 6014 */ 0x3e, 0xe7, /* ld a,$e7 */
/* 6016 */ 0xed, 0x39, 0x3a, /* out0 ($3a),a */
/* 6019 */ 0x3e, 0x16, /* ld a,$16 */
/* 601b */ 0xed, 0x39, 0x38, /* out0 ($38),a */
/* 601e */ 0x3e, 0x20, /* ld a,$20 */
/* 6020 */ 0xed, 0x39, 0x39, /* out0 ($39),a */
/* 6023 */ 0x01, sslo, sshi, /* ld bc, start sector */
/* 6026 */ 0x21, 0x00, 0xf8, /* ld hl,$f800 */
/* 6029 */ 0x1e, scnt, /* ld e, sector count */
/* 602b */ 0x16, 0x70, /* ld d,$70 */
/* 602d */ 0xc5, /* push bc */
/* 602e */ 0xd5, /* push de */
/* 602f */ 0xe5, /* push hl */
/* 6030 */ 0x3e, 0x06, /* ld a,$06 */
/* 6032 */ 0xef, /* rst $28 */
/* 6033 */ 0xda, 0xd3, 0x60, /* jp c,$60d3 */
/* 6036 */ 0xe1, /* pop hl */
/* 6037 */ 0xd1, /* pop de */
/* 6038 */ 0xc1, /* pop bc */
/* 6039 */ 0x3e, 0x00, /* ld a,$00 */
/* 603b */ 0xed, 0x39, 0x20, /* out0 ($20),a */
/* 603e */ 0x3e, 0x58, /* ld a,$58 */
/* 6040 */ 0xed, 0x39, 0x21, /* out0 ($21),a */
/* 6043 */ 0x3e, 0x02, /* ld a,$02 */
/* 6045 */ 0xed, 0x39, 0x22, /* out0 ($22),a */
/* 6048 */ 0x3e, 0x00, /* ld a,$00 */
/* 604a */ 0xed, 0x39, 0x23, /* out0 ($23),a */
/* 604d */ 0x7a, /* ld a,d */
/* 604e */ 0xed, 0x39, 0x24, /* out0 ($24),a */
/* 6051 */ 0x3e, 0x02, /* ld a,$02 */
/* 6053 */ 0xed, 0x39, 0x25, /* out0 ($25),a */
/* 6056 */ 0x3e, 0x00, /* ld a,$00 */
/* 6058 */ 0xed, 0x39, 0x26, /* out0 ($26),a */
/* 605b */ 0x3e, 0x01, /* ld a,$01 */
/* 605d */ 0xed, 0x39, 0x27, /* out0 ($27),a */
/* 6060 */ 0x3e, 0x02, /* ld a,$02 */
/* 6062 */ 0xed, 0x39, 0x31, /* out0 ($31),a */
/* 6065 */ 0x3e, 0x40, /* ld a,$40 */
/* 6067 */ 0xed, 0x39, 0x30, /* out0 ($30),a */
/* 606a */ 0x03, /* inc bc */
/* 606b */ 0x14, /* inc d */
/* 606c */ 0x1d, /* dec e */
/* 606d */ 0x7b, /* ld a,e */
/* 606e */ 0xfe, 0x00, /* cp $00 */
/* 6070 */ 0x20, 0xbb, /* jr nz,$602d */
/* 6072 */ 0x3e, 0x02, /* ld a,$02 */
/* 6074 */ 0xef, /* rst $28 */
/* 6075 */ 0x3e, 0x20, /* ld a,$20 */
/* 6077 */ 0xed, 0x39, 0x38, /* out0 ($38),a */
/* 607a */ 0x3e, 0x0c, /* ld a,$0c */
/* 607c */ 0xed, 0x39, 0x39, /* out0 ($39),a */
/* 607f */ 0x3e, 0x64, /* ld a,$64 */
/* 6081 */ 0xed, 0x39, 0x3a, /* out0 ($3a),a */
/* 6084 */ 0x3e, 0x0f, /* ld a,$0f */
/* 6086 */ 0xed, 0x39, 0x0a, /* out0 ($0a),a */
/* checksum routine */
/* 6089 */ 0x01,
0x00,
0x70, /* ld bc,$7000 */
/* 608c */ 0x11,
0x00,
0x00, /* ld de,$0000 */
/* 608f */ 0x21,
0x00,
0x00, /* ld hl,$0000 */
/* 6092 */ 0x0a, /* ld a,(bc) */
/* 6093 */ 0x5f, /* ld e,a */
/* 6094 */ 0x19, /* add hl,de */
/* 6095 */ 0x03, /* inc bc */
/* 6096 */ 0x79, /* ld a,c */
/* 6097 */ 0xfe,
0x00, /* cp $00 */
/* 6099 */ 0x20,
0xf7, /* jr nz,$6092 */
/* 609b */ 0x78, /* ld a,b */
/* 609c */ 0xfe,
end, /* cp end page */
/* 609e */ 0x20,
0xf2, /* jr nz,$6092 */
/* 60a0 */ 0x11,
0xf3,
0x60, /* ld de,$60f3 */
/* 60a3 */ 0x1a, /* ld a,(de) */
/* 60a4 */ 0xbd, /* cp l */
/* 60a5 */ 0x20,
0x2f, /* jr nz,$60d6 */
/* 60a7 */ 0x13, /* inc de */
/* 60a8 */ 0x1a, /* ld a,(de) */
/* 60a9 */ 0xbc, /* cp h */
/* 60aa */ 0x20,
0x2a, /* jr nz,$60d6 */
/* checksum routine */
/* 6089 */ 0x01, 0x00, 0x70, /* ld bc,$7000 */
/* 608c */ 0x11, 0x00, 0x00, /* ld de,$0000 */
/* 608f */ 0x21, 0x00, 0x00, /* ld hl,$0000 */
/* 6092 */ 0x0a, /* ld a,(bc) */
/* 6093 */ 0x5f, /* ld e,a */
/* 6094 */ 0x19, /* add hl,de */
/* 6095 */ 0x03, /* inc bc */
/* 6096 */ 0x79, /* ld a,c */
/* 6097 */ 0xfe, 0x00, /* cp $00 */
/* 6099 */ 0x20, 0xf7, /* jr nz,$6092 */
/* 609b */ 0x78, /* ld a,b */
/* 609c */ 0xfe, end, /* cp end page */
/* 609e */ 0x20, 0xf2, /* jr nz,$6092 */
/* 60a0 */ 0x11, 0xf3, 0x60, /* ld de,$60f3 */
/* 60a3 */ 0x1a, /* ld a,(de) */
/* 60a4 */ 0xbd, /* cp l */
/* 60a5 */ 0x20, 0x2f, /* jr nz,$60d6 */
/* 60a7 */ 0x13, /* inc de */
/* 60a8 */ 0x1a, /* ld a,(de) */
/* 60a9 */ 0xbc, /* cp h */
/* 60aa */ 0x20, 0x2a, /* jr nz,$60d6 */
/* reset and execute */
/* 60ac */ 0x3e,
0xff, /* ld a,$ff */
/* 60ae */ 0xed,
0x39,
0x88, /* out0 ($88),a */
/* 60b1 */ 0x01,
0xff,
0x0f, /* ld bc,$0fff */
/* 60b4 */ 0x21,
0x00,
0x40, /* ld hl,$4000 */
/* 60b7 */ 0x11,
0x01,
0x40, /* ld de,$4001 */
/* 60ba */ 0x36,
0x00, /* ld (hl),$00 */
/* 60bc */ 0xed,
0xb0, /* ldir */
/* 60be */ 0x01,
0xff,
0x0f, /* ld bc,$0fff */
/* 60c1 */ 0x21,
0x00,
0x50, /* ld hl,$5000 */
/* 60c4 */ 0x11,
0x01,
0x50, /* ld de,$5001 */
/* 60c7 */ 0x36,
0x20, /* ld (hl),$20 */
/* 60c9 */ 0xed,
0xb0, /* ldir */
/* 60cb */ 0x3e,
0xfe, /* ld a,$fe */
/* 60cd */ 0xed,
0x39,
0x88, /* out0 ($88),a */
/* 60d0 */ 0xc3,
0x00,
0x70, /* jp $7000 */
/* reset and execute */
/* 60ac */ 0x3e, 0xff, /* ld a,$ff */
/* 60ae */ 0xed, 0x39, 0x88, /* out0 ($88),a */
/* 60b1 */ 0x01, 0xff, 0x0f, /* ld bc,$0fff */
/* 60b4 */ 0x21, 0x00, 0x40, /* ld hl,$4000 */
/* 60b7 */ 0x11, 0x01, 0x40, /* ld de,$4001 */
/* 60ba */ 0x36, 0x00, /* ld (hl),$00 */
/* 60bc */ 0xed, 0xb0, /* ldir */
/* 60be */ 0x01, 0xff, 0x0f, /* ld bc,$0fff */
/* 60c1 */ 0x21, 0x00, 0x50, /* ld hl,$5000 */
/* 60c4 */ 0x11, 0x01, 0x50, /* ld de,$5001 */
/* 60c7 */ 0x36, 0x20, /* ld (hl),$20 */
/* 60c9 */ 0xed, 0xb0, /* ldir */
/* 60cb */ 0x3e, 0xfe, /* ld a,$fe */
/* 60cd */ 0xed, 0x39, 0x88, /* out0 ($88),a */
/* 60d0 */ 0xc3, 0x00, 0x70, /* jp $7000 */
/* 60d3 */ 0xe1, /* pop hl */
/* 60d4 */ 0xd1, /* pop de */
/* 60d5 */ 0xc1, /* pop bc */
/* 60d6 */ 0x01,
0x00,
0x00, /* ld bc,$0000 */
/* 60d9 */ 0x0b, /* dec bc */
/* 60da */ 0x3e,
0xfe, /* ld a,$fe */
/* 60dc */ 0xed,
0x39,
0x90, /* out0 ($90),a */
/* 60df */ 0x78, /* ld a,b */
/* 60e0 */ 0xb1, /* or c */
/* 60e1 */ 0x20,
0xf6, /* jr nz,$60d9 */
/* 60e3 */ 0x31,
0x00,
0x00, /* ld sp,$0000 */
/* 60e6 */ 0x3e,
0xff, /* ld a,$ff */
/* 60e8 */ 0xed,
0x39,
0x90, /* out0 ($90),a */
/* 60eb */ 0x3e,
0x0f, /* ld a,$0f */
/* 60ed */ 0xed,
0x39,
0x0a, /* out0 ($0a),a */
/* 60f0 */ 0xc3,
0x00,
0x00, /* jp $0000 */
/* 60f3 */ cklo,
ckhi, /* checksum */
/* 60d3 */ 0xe1, /* pop hl */
/* 60d4 */ 0xd1, /* pop de */
/* 60d5 */ 0xc1, /* pop bc */
/* 60d6 */ 0x01, 0x00, 0x00, /* ld bc,$0000 */
/* 60d9 */ 0x0b, /* dec bc */
/* 60da */ 0x3e, 0xfe, /* ld a,$fe */
/* 60dc */ 0xed, 0x39, 0x90, /* out0 ($90),a */
/* 60df */ 0x78, /* ld a,b */
/* 60e0 */ 0xb1, /* or c */
/* 60e1 */ 0x20, 0xf6, /* jr nz,$60d9 */
/* 60e3 */ 0x31, 0x00, 0x00, /* ld sp,$0000 */
/* 60e6 */ 0x3e, 0xff, /* ld a,$ff */
/* 60e8 */ 0xed, 0x39, 0x90, /* out0 ($90),a */
/* 60eb */ 0x3e, 0x0f, /* ld a,$0f */
/* 60ed */ 0xed, 0x39, 0x0a, /* out0 ($0a),a */
/* 60f0 */ 0xc3, 0x00, 0x00, /* jp $0000 */
/* 60f3 */ cklo, ckhi, /* checksum */
// clang-format on
};
file.seekp(0xc00, std::ifstream::beg);