diff options
author | 2020-04-13 19:14:36 +1000 | |
---|---|---|
committer | 2020-04-13 19:14:36 +1000 | |
commit | de72f97b90b885e7fa5b0aa237098c945e02f1b5 (patch) | |
tree | ccdebacc984f5298783ca8aa7b4ecfa38af23983 /src/lib/formats/apridisk.cpp | |
parent | 404e7321a63548d2e77e50ec0dc7572b3298d5f4 (diff) |
(nw) formats: reduce dependencies on libemu
The only link dependency left is emu_fatalerror. The format handlers
really shouldn't be throwing fatal errors at all - they should just
fail to load an image they can't handle. Maybe the interface should
be enhanced to allow better propagation of errors up from the format
handlers so they can be displayed in a UI rather than just logged.
The only other two dependencies are on logmacro.h (pure macros) and
the PAIR type from emucore.h (possibly worth moving to util).
Diffstat (limited to 'src/lib/formats/apridisk.cpp')
-rw-r--r-- | src/lib/formats/apridisk.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/lib/formats/apridisk.cpp b/src/lib/formats/apridisk.cpp index d023448f3fb..4c2cad2123c 100644 --- a/src/lib/formats/apridisk.cpp +++ b/src/lib/formats/apridisk.cpp @@ -8,10 +8,13 @@ ***************************************************************************/ -#include "emu.h" -#include "imageutl.h" #include "apridisk.h" +#include "imageutl.h" + +#include "emucore.h" // emu_fatalerror + + apridisk_format::apridisk_format() { } @@ -97,7 +100,7 @@ bool apridisk_format::load(io_generic *io, uint32_t form_factor, floppy_image *i uint16_t length = pick_integer_le(comp, 0, 2); if (length != SECTOR_SIZE) - fatalerror("apridisk_format: Invalid compression length %04x\n", length); + throw emu_fatalerror("apridisk_format: Invalid compression length %04x\n", length); memset(data_ptr, comp[2], SECTOR_SIZE); } @@ -108,7 +111,7 @@ bool apridisk_format::load(io_generic *io, uint32_t form_factor, floppy_image *i break; default: - fatalerror("apridisk_format: Invalid compression %04x\n", compression); + throw emu_fatalerror("apridisk_format: Invalid compression %04x\n", compression); } sectors[track][head][sector - 1].data = data_ptr; |