diff --git a/Makefile b/Makefile index de9a3df..cbfa6dd 100644 --- a/Makefile +++ b/Makefile @@ -116,6 +116,7 @@ dist: $(BUILD) mkdir -p $@/fbzx-wii/spectrum-roms mkdir -p $@/fbzx-wii/tapes mkdir -p $@/fbzx-wii/snapshots + mkdir -p $@/fbzx-wii/snapshots/rom-cartridges mkdir -p $@/fbzx-wii/microdrives mkdir -p $@/fbzx-wii/scr mkdir -p $@/fbzx-wii/scr2 @@ -145,6 +146,7 @@ dist: $(BUILD) cp AMSTRAD CAPABILITIES COPYING FAQ README README.TZX VERSIONS VERSIONS.wii $@/apps/fbzx-wii/doc touch $@/fbzx-wii/tapes/dummy touch $@/fbzx-wii/snapshots/dummy + touch $@/fbzx-wii/snapshots/rom-cartridges/dummy touch $@/fbzx-wii/microdrives/dummy touch $@/fbzx-wii/scr/dummy touch $@/fbzx-wii/scr2/dummy diff --git a/Makefile.win b/Makefile.win index 3e5eebd..a92aaf7 100644 --- a/Makefile.win +++ b/Makefile.win @@ -126,6 +126,7 @@ dist: $(BUILD) mkdir -p $@/fbzx-wii/spectrum-roms mkdir -p $@/fbzx-wii/tapes mkdir -p $@/fbzx-wii/snapshots + mkdir -p $@/fbzx-wii/snapshots/rom-cartridges mkdir -p $@/fbzx-wii/microdrives mkdir -p $@/fbzx-wii/scr mkdir -p $@/fbzx-wii/scr2 @@ -155,6 +156,7 @@ dist: $(BUILD) cp AMSTRAD CAPABILITIES COPYING FAQ README README.TZX VERSIONS VERSIONS.wii README_WIN.txt $@/fbzx-wii/doc touch $@/fbzx-wii/tapes/dummy touch $@/fbzx-wii/snapshots/dummy + touch $@/fbzx-wii/snapshots/rom-cartridges/dummy touch $@/fbzx-wii/microdrives/dummy touch $@/fbzx-wii/scr/dummy touch $@/fbzx-wii/scr2/dummy diff --git a/README_WIN.txt b/README_WIN.txt index 56e40eb..3d11443 100644 --- a/README_WIN.txt +++ b/README_WIN.txt @@ -1,5 +1,5 @@ FBZX Wii was written to run on WII, for testing purpose FBZX Wii was adapted -to run also on Windows. Anyhow the windows version is yet usable. +to run also on Windows even if some WII features cannot be used. These are the basic instructions: @@ -20,7 +20,8 @@ FBZX WII Menu Menu key (it is the key near CTRL Rigth) or gamepad 7 key to access FBZX Wii menu. Left ALT key to toggle Full Screen. -The virtual keyboard is accessed passing the mouse on the screen or through CTRL Rigth or gamepad button 6 (if depends on the selected option). +The virtual keyboard is accessed passing the mouse on the screen or through CTRL Rigth +or gamepad button 6 (it depends on the auto virtual ketboard option). * In menu Gamepad pad or keyboard keys for menu navigation. @@ -47,7 +48,7 @@ Gamepad -------- WII ****************** Original FBZX Menu ****************** -F1-F12 to access the original FBZX (not Wii) menu (not all the features are available here). +F1-F12 to access the original FBZX menu (not all the features are available here). F1 key to access FBZX help menu. \ No newline at end of file diff --git a/src/computer.c b/src/computer.c index 275907d..1481bd6 100644 --- a/src/computer.c +++ b/src/computer.c @@ -178,6 +178,8 @@ void computer_init () { //Called only on start-up ordenador.npixels=4; ordenador.progressive=0; ordenador.audio_mode=2; //ACB + + rom_cartridge[0] = 0; } void computer_set_palete() { @@ -1725,7 +1727,9 @@ void ResetComputer () { Z80free_reset (&procesador); load_rom (ordenador.mode128k); - + + rom_cartridge[0] = 0; + // reset the AY-3-8912 for (bucle = 0; bucle < 16; bucle++) diff --git a/src/emulator.c b/src/emulator.c index 5eb866b..ba975b1 100644 --- a/src/emulator.c +++ b/src/emulator.c @@ -79,6 +79,7 @@ char load_path_snaps[MAX_PATH_LENGTH]; char load_path_taps[MAX_PATH_LENGTH]; char load_path_scr1[MAX_PATH_LENGTH]; char load_path_poke[MAX_PATH_LENGTH]; +char rom_cartridge[MAX_PATH_LENGTH]; unsigned int colors[80]; unsigned int jump_frames,curr_frames, turbo_n; @@ -366,6 +367,23 @@ char *load_a_rom(char **filenames) { return (NULL); } +char *load_rom_cartridge(void) { + + FILE *fichero; + int size; + + printf("Opening %s\n", rom_cartridge); + fichero=fopen(rom_cartridge,"rb"); + if(fichero==NULL) { + return (rom_cartridge); + } + size=fread(ordenador.memoria,1,16384,fichero); + if (size != 16384) return (rom_cartridge); + + fclose(fichero); + return (0); +} + void load_rom(char type) { char *retval; @@ -377,7 +395,7 @@ void load_rom(char type) { case 0: filenames[0]="spectrum-roms/48.rom"; filenames[1]=NULL; - retval=load_a_rom(filenames); + if (rom_cartridge[0]) retval = load_rom_cartridge(); else retval=load_a_rom(filenames); if (retval) { printf("Can't load file %s\n",retval); exit(1); diff --git a/src/emulator.h b/src/emulator.h index adece1c..baa4637 100644 --- a/src/emulator.h +++ b/src/emulator.h @@ -44,6 +44,7 @@ extern char load_path_snaps[MAX_PATH_LENGTH]; extern char load_path_taps[MAX_PATH_LENGTH]; extern char load_path_scr1[MAX_PATH_LENGTH]; extern char load_path_poke[MAX_PATH_LENGTH]; +extern char rom_cartridge[MAX_PATH_LENGTH]; extern unsigned int colors[80]; extern unsigned int jump_frames,curr_frames, turbo_n; diff --git a/src/gui_sdl.c b/src/gui_sdl.c index 6b6ad2d..d93c8e0 100644 --- a/src/gui_sdl.c +++ b/src/gui_sdl.c @@ -1665,7 +1665,17 @@ static int save_load_snapshot(int which) if (!filename) return 0; - + + //Load ROM Cartridge + if ((ext_matches(filename, ".rom")|ext_matches(filename, ".ROM"))&(which == 0)) + { + set_machine_model(0); + strcpy(rom_cartridge, filename); + free((void*)filename); + ResetComputer (); + return -1; + } + if (ext_matches(filename, ".z80")|ext_matches(filename, ".Z80")| ext_matches(filename, ".sna")|ext_matches(filename, ".SNA")) { diff --git a/src/menu_sdl.c b/src/menu_sdl.c index c06e86d..edc399a 100644 --- a/src/menu_sdl.c +++ b/src/menu_sdl.c @@ -317,7 +317,7 @@ static const char **get_file_list_zip(const char *path) } const char *exts[] = {".tap", ".TAP", ".tzx", ".TZX", ".z80",".Z80",".sna", ".SNA", - ".mdr", ".MDR", ".scr", ".SCR", ".conf", ".CONF",".pok", ".POK" ,NULL}; + ".mdr", ".MDR", ".scr", ".SCR", ".conf", ".CONF",".pok", ".POK" ,".rom", ".ROM", NULL}; if (ext_matches_list(filename_inzip, exts)) { @@ -369,7 +369,7 @@ static const char **get_file_list(const char *base_dir) { char buf[255]; const char *exts[] = {".tap", ".TAP", ".tzx", ".TZX", ".z80",".Z80",".sna", ".SNA", - ".mdr", ".MDR", ".scr", ".SCR", ".conf", ".CONF",".pok", ".POK", ".zip", ".ZIP",NULL}; + ".mdr", ".MDR", ".scr", ".SCR", ".conf", ".CONF",".pok", ".POK", ".zip", ".ZIP",".rom", ".ROM",NULL}; struct stat st; snprintf(buf, 255, "%s/%s", base_dir, de->d_name);