From 3102393acf948f5fd1648e924a7871455cbe086e Mon Sep 17 00:00:00 2001 From: David Griffith Date: Wed, 15 Aug 2012 13:49:51 -0700 Subject: [PATCH] More thrashing around with DOS Frotz --- src/blorb/blorblib.c | 8 ++++++++ src/dos/bcinit.c | 1 + 2 files changed, 9 insertions(+) diff --git a/src/blorb/blorblib.c b/src/blorb/blorblib.c index 0ea93a0..b0d4f71 100644 --- a/src/blorb/blorblib.c +++ b/src/blorb/blorblib.c @@ -95,10 +95,18 @@ bb_err_t bb_create_map(FILE *file, bb_map_t **newmap) if (err) return bb_err_Read; +/* FIXME. Under 16-bit DOS, this fails. + * From the following url: "'unsigned long' variables don't work in + * 16-bit mode." How do I get around this? + * http://www.digitalmars.com/d/archives/c++/dos/16-bits/45.html + */ readlen = fread(buffer, sizeof(uint32), 3, file); if (readlen != 3) return bb_err_Read; +printf("buffer0 %i should be %i\n", bb_native4(buffer[0]), bb_ID_FORM); +printf("buffer2 %i should be %i\n", bb_native4(buffer[2]), bb_ID_IFRS); + if (bb_native4(buffer[0]) != bb_ID_FORM) return bb_err_Format; if (bb_native4(buffer[2]) != bb_ID_IFRS) diff --git a/src/dos/bcinit.c b/src/dos/bcinit.c index 742fd6e..247e4b0 100644 --- a/src/dos/bcinit.c +++ b/src/dos/bcinit.c @@ -928,6 +928,7 @@ int dos_init_blorb(void) (char *)basename(blorb_file), 55) == 0) { if ((blorbfile = fopen(blorb_file, "rb")) == NULL) return bb_err_Read; +/* Under DOS, bb_create_map() returns bb_err_Format */ blorb_err = bb_create_map(blorbfile, &blorb_map); if (blorb_err != bb_err_None) { -- 2.34.1