summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
b2b15ca)
Confirmed to be working this way on a real Amiga, removes the need for separate ROM image maps in the config file for 256/512KB ROM images.
}
fseek(in, 0, SEEK_SET);
cfg->map_data[index] = (unsigned char *)calloc(1, cfg->map_size[index]);
}
fseek(in, 0, SEEK_SET);
cfg->map_data[index] = (unsigned char *)calloc(1, cfg->map_size[index]);
+ cfg->rom_size[index] = (cfg->map_size[index] <= file_size) ? cfg->map_size[index] : file_size;
if (!cfg->map_data[index]) {
printf("ERROR: Unable to allocate memory for mapped ROM!\n");
goto mapping_failed;
}
memset(cfg->map_data[index], 0x00, cfg->map_size[index]);
if (!cfg->map_data[index]) {
printf("ERROR: Unable to allocate memory for mapped ROM!\n");
goto mapping_failed;
}
memset(cfg->map_data[index], 0x00, cfg->map_size[index]);
- fread(cfg->map_data[index], (cfg->map_size[index] <= file_size) ? cfg->map_size[index] : file_size, 1, in);
+ fread(cfg->map_data[index], cfg->rom_size[index], 1, in);
fclose(in);
break;
case MAPTYPE_REGISTER:
fclose(in);
break;
case MAPTYPE_REGISTER:
unsigned char map_type[MAX_NUM_MAPPED_ITEMS];
long map_offset[MAX_NUM_MAPPED_ITEMS];
unsigned int map_size[MAX_NUM_MAPPED_ITEMS];
unsigned char map_type[MAX_NUM_MAPPED_ITEMS];
long map_offset[MAX_NUM_MAPPED_ITEMS];
unsigned int map_size[MAX_NUM_MAPPED_ITEMS];
+ unsigned int rom_size[MAX_NUM_MAPPED_ITEMS];
unsigned char *map_data[MAX_NUM_MAPPED_ITEMS];
int map_mirror[MAX_NUM_MAPPED_ITEMS];
char *map_id[MAX_NUM_MAPPED_ITEMS];
unsigned char *map_data[MAX_NUM_MAPPED_ITEMS];
int map_mirror[MAX_NUM_MAPPED_ITEMS];
char *map_id[MAX_NUM_MAPPED_ITEMS];
# Sets CPU type. Valid types are (probably) 68000, 68010, 68020, 68EC020, 68030, 68EC030, 68040, 68EC040, 68LC040 and some STTTT thing.
cpu 68020
# Map 512KB kickstart ROM to default offset.
# Sets CPU type. Valid types are (probably) 68000, 68010, 68020, 68EC020, 68030, 68EC030, 68040, 68EC040, 68LC040 and some STTTT thing.
cpu 68020
# Map 512KB kickstart ROM to default offset.
-map type=rom address=0xF80000 size=0x80000 file=kick512.rom ovl=0
-# This is for mapping a 256KB kickstart ROM. I can probably add some additional thing about kicking this file into low/high area.
-#map type=rom address=0xFC0000 size=0x40000 file=kick256.rom ovl=0
+map type=rom address=0xF80000 size=0x80000 file=kick.rom ovl=0
# Want to map an extended ROM, such as CDTV or CD32?
# Want to map an extended ROM, such as CDTV or CD32?
-#map type=rom address=0xF00000 size=0x90000 file=cdtv.rom
+#map type=rom address=0xF00000 size=0x80000 file=cdtv.rom
# Map 256MB of Fast RAM at 0x8000000.
map type=ram address=0x08000000 size=128M
# Map Gayle as a register range.
# Map 256MB of Fast RAM at 0x8000000.
map type=ram address=0x08000000 size=128M
# Map Gayle as a register range.
switch(cfg->map_type[i]) {
case MAPTYPE_ROM:
if (CHKRANGE(addr, cfg->map_offset[i], cfg->map_size[i]))
switch(cfg->map_type[i]) {
case MAPTYPE_ROM:
if (CHKRANGE(addr, cfg->map_offset[i], cfg->map_size[i]))
- read_addr = cfg->map_data[i] + (addr - cfg->map_offset[i]);
+ read_addr = cfg->map_data[i] + ((addr - cfg->map_offset[i]) % cfg->rom_size[i]);
else if (cfg->map_mirror[i] != -1 && mirror && CHKRANGE(addr, cfg->map_mirror[i], cfg->map_size[i]))
else if (cfg->map_mirror[i] != -1 && mirror && CHKRANGE(addr, cfg->map_mirror[i], cfg->map_size[i]))
- read_addr = cfg->map_data[i] + (addr - cfg->map_mirror[i]);
+ read_addr = cfg->map_data[i] + ((addr - cfg->map_mirror[i]) % cfg->rom_size[i]);
break;
case MAPTYPE_RAM:
if (CHKRANGE(addr, cfg->map_offset[i], cfg->map_size[i]))
break;
case MAPTYPE_RAM:
if (CHKRANGE(addr, cfg->map_offset[i], cfg->map_size[i]))