|
Xemu [doxygen]
hyppo 0a42be3a057156924bc1b626a687bd6e27349c45 @ Sat 19 Mar 02:15:11 CET 2022
|
Go to the documentation of this file.
30 static const Uint8 xep_rom_image[] = {
31 #include "rom/ep128/xep_rom.hex"
37 static int reloading = 0;
39 #define ROM_REQUEST_LIST_MAX_SIZE 32
44 static int rom_request_list_size = 0;
50 const char *p = strchr(optname,
'@');
52 return "rom option should specify segment, ie: rom@XX (XX=hex)";
55 if ((*p >=
'A' && *p <=
'F') || (*p >=
'a' && *p <=
'f'))
56 seg = (
seg << 4) + (*p & 0xF) + 9;
57 else if (*p >=
'0' && *p <=
'9')
58 seg = (
seg << 4) + *p -
'0';
60 return "Invalid HEX value character after rom@ in the option name";
63 return "Invalid segment specified after the rom@ option";
66 return "too many rom options!";
67 rom_request_list[rom_request_list_size].seg =
seg;
68 rom_request_list[rom_request_list_size].fn =
xemu_strdup(optvalue);
69 rom_request_list_size++;
90 for (
int a = 0; a < 0x100; a++ )
97 static int load_rom_image (
int seg,
const char *
fn )
99 if (seg < 0 || seg >= 0xFC)
100 FATAL(
"Invalid ROM segment: %02Xh",
seg);
102 FATAL(
"Invalid ROM name: NULL or empty string for segment #%02Xh",
seg);
103 int size =
xemu_load_file(
fn, NULL, 0x4000, 0x400000 - 0x10000,
"Cannot open/load requested ROM");
109 if ((
size & 0x3FFF)) {
153 memset(
memory, 0xFF, 0x400000);
156 for (
int i = 0; i < rom_request_list_size; i++) {
157 load_rom_image(rom_request_list[i].
seg, rom_request_list[i].
fn);
158 free((
void*)rom_request_list[i].
fn);
161 ERROR_WINDOW(
"Invalid config, segment zero must be ROM");
166 if (rom_request_list_size) {
169 ERROR_WINDOW(
"Invalid config: No ROM image was defined for segment 0!");
179 rom_request_list_size = 0;
193 DEBUGPRINT(
"CONFIG: ROM: could not find place for XEP ROM ..." NL);
198 DEBUGPRINT(
"CONFIG: ROM: XEP ROM is disabled by configuration!" NL);
199 INFO_WINDOW(
"XEP internal ROM image is disabled by configuration.\nXep128 will work, but no XEP feature will be available.");
212 DEBUGPRINT(
"CONFIG: ROM: XEP internal ROM image CANNOT be installed because segment %02Xh is used!!" NL,
xep_rom_seg);
213 ERROR_WINDOW(
"XEP internal ROM image cannot be installed.\nXep128 will work, but no XEP feature will be available.");
int sram_save_segment(int seg)
const char * rom_name_tab[0x100]
const char UNUSED_SEGMENT[]
#define ROM_REQUEST_LIST_MAX_SIZE
int sram_load_segment(int seg)
#define SRAM_BACKUP_FILE_FORMAT
const char SRAM_SEGMENT[]
const char * memory_segment_map[0x100]
const char XEPROM_SEGMENT[]
void xep_set_default_device_name(const char *name)
#define ERROR_WINDOW(...)
const char * rom_parse_opt(const char *optname, const char *optvalue)
const char VRAM_SEGMENT[]
int sram_save_all_segments(void)