From a703276adc97fae897589e133290ab76e1806d87 Mon Sep 17 00:00:00 2001 From: Ian C Date: Thu, 5 Jan 2017 15:34:45 +0000 Subject: Tweaks to (still broken) CPC output. --- src/cpcout.c | 19 ++++++++++++++----- src/example/Makefile | 2 +- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/src/cpcout.c b/src/cpcout.c index c893097..b962340 100644 --- a/src/cpcout.c +++ b/src/cpcout.c @@ -165,11 +165,11 @@ int CPCOutput(const char *filename, const char *filename_bank, first = 0; last = 0; - WriteWord(fp, 10); + WriteWord(fp, 0x10); WriteWord(fp, 1000); - WriteWord(fp, 0x1d + 2); + WriteWord(fp, 0x40 + 2); - WriteWord(fp, 0x1d); + WriteWord(fp, 0x40); WriteByte(fp, 0x2c); if (f == 0) @@ -189,7 +189,15 @@ int CPCOutput(const char *filename, const char *filename_bank, if (block == 0) { first = 255; - blocklen = BLOCK_SIZE; + + if (len > BLOCK_SIZE) + { + blocklen = BLOCK_SIZE; + } + else + { + blocklen = len; + } } if (block == blocks) @@ -205,12 +213,13 @@ int CPCOutput(const char *filename, const char *filename_bank, WriteByte(fp, first); WriteWord(fp, len); WriteWord(fp, options.start_addr); + WriteString(fp, "", 64 - 28, 0, CP_ASCII); addr += blocklen; /* Output file data */ - WriteWord(fp, 10); + WriteWord(fp, 0x10); WriteWord(fp, 1000); WriteWord(fp, blocklen + 5); diff --git a/src/example/Makefile b/src/example/Makefile index a1807a2..93bef30 100644 --- a/src/example/Makefile +++ b/src/example/Makefile @@ -36,7 +36,7 @@ spectrum.tap: spectrum.asm $(CASM) c64.t64: c64.asm $(CASM) $(CASM) c64.asm -cpc.cdt: cpc.asm +cpc.cdt: cpc.asm $(CASM) $(CASM) cpc.asm zx81.p: zx81.asm $(CASM) -- cgit v1.2.3