comparison dis.c @ 2251:80dde7fb445b

Fix bug in disassembler SCD header handling
author Michael Pavone <pavone@retrodev.com>
date Sun, 27 Nov 2022 23:39:14 -0800
parents 53411df7fc71
children ff726f53d75a
comparison
equal deleted inserted replaced
2250:646d1797f20d 2251:80dde7fb445b
195 { 195 {
196 defer_disasm(context, filebuf[2] << 16 | filebuf[3]); 196 defer_disasm(context, filebuf[2] << 16 | filebuf[3]);
197 add_label(context, "reset", filebuf[2] << 16 | filebuf[3]); 197 add_label(context, "reset", filebuf[2] << 16 | filebuf[3]);
198 } 198 }
199 } else if (filesize > 0x1000) { 199 } else if (filesize > 0x1000) {
200 long boot_size = filesize > (32*1024) ? 32*1024 : filesize; 200 long boot_size = filesize > (16*2352) ? 16*2352 : filesize;
201 filebuf = malloc(boot_size); 201 filebuf = malloc(boot_size);
202 if (fread(filebuf, 1, boot_size, f) != boot_size) { 202 if (fread(filebuf, 1, boot_size, f) != boot_size) {
203 fprintf(stderr, "Failure while reading file %s\n", argv[1]); 203 fprintf(stderr, "Failure while reading file %s\n", argv[1]);
204 return 1; 204 return 1;
205 } 205 }