mirror of
https://github.com/Oibaf66/fbzx-wii.git
synced 2024-12-26 16:41:55 +01:00
Added support for Open SE basic ROM for 48k model
This commit is contained in:
parent
4016b6e9e0
commit
a24121dcb4
BIN
spectrum-roms/opense.rom
Normal file
BIN
spectrum-roms/opense.rom
Normal file
Binary file not shown.
@ -557,7 +557,7 @@ void register_screen (SDL_Surface * pantalla) {
|
|||||||
|
|
||||||
ordenador.tstados_counter_sound = 0;
|
ordenador.tstados_counter_sound = 0;
|
||||||
ordenador.current_buffer = sound[0];
|
ordenador.current_buffer = sound[0];
|
||||||
ordenador.num_buff = 0; // first buffer
|
//ordenador.num_buff = 0; // first buffer
|
||||||
ordenador.sound_cuantity = 0;
|
ordenador.sound_cuantity = 0;
|
||||||
//ordenador.sound_current_value = 0;
|
//ordenador.sound_current_value = 0;
|
||||||
|
|
||||||
@ -1190,6 +1190,7 @@ inline void paint_one_pixel(unsigned char *colour,unsigned char *address ) {
|
|||||||
inline void read_keyboard () {
|
inline void read_keyboard () {
|
||||||
|
|
||||||
unsigned int temporal_io;
|
unsigned int temporal_io;
|
||||||
|
unsigned char model128k;
|
||||||
SDL_Event evento,*pevento;
|
SDL_Event evento,*pevento;
|
||||||
enum joystate_x {JOY_CENTER_X, JOY_LEFT, JOY_RIGHT};
|
enum joystate_x {JOY_CENTER_X, JOY_LEFT, JOY_RIGHT};
|
||||||
enum joystate_y {JOY_CENTER_Y, JOY_UP, JOY_DOWN};
|
enum joystate_y {JOY_CENTER_Y, JOY_UP, JOY_DOWN};
|
||||||
@ -1346,7 +1347,15 @@ inline void read_keyboard () {
|
|||||||
case SDLK_F9:
|
case SDLK_F9:
|
||||||
//Emulate load ""
|
//Emulate load ""
|
||||||
countdown_buffer=8;
|
countdown_buffer=8;
|
||||||
switch (ordenador.mode128k)
|
model128k = ordenador.mode128k;
|
||||||
|
|
||||||
|
if ((ordenador.mport1 & 0x10)&&(ordenador.mode128k!=4)) //ROM 48k
|
||||||
|
model128k =0;
|
||||||
|
|
||||||
|
if ((ordenador.mode128k==0)&&(ordenador.se_basic))
|
||||||
|
model128k =4;
|
||||||
|
|
||||||
|
switch (model128k)
|
||||||
{
|
{
|
||||||
case 4://Spanish 128k
|
case 4://Spanish 128k
|
||||||
ordenador.keyboard_buffer[0][8]= SDLK_l;
|
ordenador.keyboard_buffer[0][8]= SDLK_l;
|
||||||
@ -1371,16 +1380,6 @@ inline void read_keyboard () {
|
|||||||
case 2: //+2
|
case 2: //+2
|
||||||
case 1: //128k
|
case 1: //128k
|
||||||
ordenador.kbd_buffer_pointer=2;
|
ordenador.kbd_buffer_pointer=2;
|
||||||
if (ordenador.mport1 & 0x10) //ROM 48k
|
|
||||||
{
|
|
||||||
ordenador.keyboard_buffer[0][5]= SDLK_j; //Load
|
|
||||||
ordenador.keyboard_buffer[1][5]= 0;
|
|
||||||
ordenador.keyboard_buffer[0][4]= SDLK_p; //"
|
|
||||||
ordenador.keyboard_buffer[1][4]= SDLK_LCTRL;
|
|
||||||
ordenador.keyboard_buffer[0][3]= SDLK_p; //"
|
|
||||||
ordenador.keyboard_buffer[1][3]= SDLK_LCTRL;
|
|
||||||
ordenador.kbd_buffer_pointer=5;
|
|
||||||
}
|
|
||||||
ordenador.keyboard_buffer[0][2]= SDLK_RETURN; // Return
|
ordenador.keyboard_buffer[0][2]= SDLK_RETURN; // Return
|
||||||
ordenador.keyboard_buffer[1][2]= 0;
|
ordenador.keyboard_buffer[1][2]= 0;
|
||||||
ordenador.keyboard_buffer[0][1]= SDLK_F6; //F6 - play
|
ordenador.keyboard_buffer[0][1]= SDLK_F6; //F6 - play
|
||||||
|
@ -133,7 +133,7 @@ struct computer {
|
|||||||
unsigned char sound_bit_mic;
|
unsigned char sound_bit_mic;
|
||||||
unsigned int tstados_counter_sound;
|
unsigned int tstados_counter_sound;
|
||||||
unsigned int *current_buffer;
|
unsigned int *current_buffer;
|
||||||
unsigned char num_buff;
|
//unsigned char num_buff;
|
||||||
unsigned int sound_cuantity; // counter for the buffer
|
unsigned int sound_cuantity; // counter for the buffer
|
||||||
unsigned char ay_registers[16]; // registers for the AY emulation
|
unsigned char ay_registers[16]; // registers for the AY emulation
|
||||||
unsigned int aych_a,aych_b,aych_c,aych_n,aych_envel; // counters for AY emulation
|
unsigned int aych_a,aych_b,aych_c,aych_n,aych_envel; // counters for AY emulation
|
||||||
@ -162,6 +162,7 @@ struct computer {
|
|||||||
unsigned char issue; // 2= 48K issue 2, 3= 48K issue 3
|
unsigned char issue; // 2= 48K issue 2, 3= 48K issue 3
|
||||||
unsigned char mode128k; // 0=48K, 1=128K, 2=+2, 3=+3 4=sp
|
unsigned char mode128k; // 0=48K, 1=128K, 2=+2, 3=+3 4=sp
|
||||||
unsigned char videosystem; //0=PAL, 1=NTSC
|
unsigned char videosystem; //0=PAL, 1=NTSC
|
||||||
|
unsigned char se_basic; //0=0ff; 1=0n
|
||||||
unsigned char joystick[2]; // 0=cursor, 1=kempston, 2=sinclair1, 3=sinclair2, 4=Fuller, 5=QAOP
|
unsigned char joystick[2]; // 0=cursor, 1=kempston, 2=sinclair1, 3=sinclair2, 4=Fuller, 5=QAOP
|
||||||
unsigned char port254;
|
unsigned char port254;
|
||||||
|
|
||||||
|
@ -394,7 +394,7 @@ void load_rom(char type) {
|
|||||||
|
|
||||||
switch(type) {
|
switch(type) {
|
||||||
case 0:
|
case 0:
|
||||||
filenames[0]="spectrum-roms/48.rom";
|
if (ordenador.se_basic) filenames[0]="spectrum-roms/opense.rom"; else filenames[0]="spectrum-roms/48.rom";
|
||||||
filenames[1]=NULL;
|
filenames[1]=NULL;
|
||||||
if (rom_cartridge[0]) retval = load_rom_cartridge(); else retval=load_a_rom(filenames);
|
if (rom_cartridge[0]) retval = load_rom_cartridge(); else retval=load_a_rom(filenames);
|
||||||
if (retval) {
|
if (retval) {
|
||||||
@ -761,6 +761,7 @@ int save_config(struct computer *object, char *filename) {
|
|||||||
fprintf(fconfig,"mode=%c%c",48+object->mode128k,10);
|
fprintf(fconfig,"mode=%c%c",48+object->mode128k,10);
|
||||||
fprintf(fconfig,"issue=%c%c",48+object->issue,10);
|
fprintf(fconfig,"issue=%c%c",48+object->issue,10);
|
||||||
fprintf(fconfig,"ntsc=%c%c",48+object->videosystem,10);
|
fprintf(fconfig,"ntsc=%c%c",48+object->videosystem,10);
|
||||||
|
fprintf(fconfig,"se_basic=%c%c",48+object->se_basic,10);
|
||||||
fprintf(fconfig,"joystick1=%c%c",48+object->joystick[0],10);
|
fprintf(fconfig,"joystick1=%c%c",48+object->joystick[0],10);
|
||||||
fprintf(fconfig,"joystick2=%c%c",48+object->joystick[1],10);
|
fprintf(fconfig,"joystick2=%c%c",48+object->joystick[1],10);
|
||||||
fprintf(fconfig,"ay_sound=%c%c",48+object->ay_emul,10);
|
fprintf(fconfig,"ay_sound=%c%c",48+object->ay_emul,10);
|
||||||
@ -956,7 +957,7 @@ int load_config(struct computer *object, char *filename) {
|
|||||||
unsigned char volume=255,mode128k=255,issue=255,ntsc=255, joystick1=255,joystick2=255,ay_emul=255,mdr_active=255,
|
unsigned char volume=255,mode128k=255,issue=255,ntsc=255, joystick1=255,joystick2=255,ay_emul=255,mdr_active=255,
|
||||||
dblscan=255,framerate =255, screen =255, text=255, precision=255, bw=255, tap_fast=255, audio_mode=255,
|
dblscan=255,framerate =255, screen =255, text=255, precision=255, bw=255, tap_fast=255, audio_mode=255,
|
||||||
joypad1=255, joypad2=255, rumble1=255, rumble2=255, joy_n=255, key_n=255, port=255, autoconf=255, turbo=225, vk_auto=255, vk_rumble=255,
|
joypad1=255, joypad2=255, rumble1=255, rumble2=255, joy_n=255, key_n=255, port=255, autoconf=255, turbo=225, vk_auto=255, vk_rumble=255,
|
||||||
rewind_on_reset=255, pause_instant_load =255, ignore_z80_joy_conf=255, gui_sound=255, fuller_box_sound=255, currah_active = 255;
|
rewind_on_reset=255, pause_instant_load =255, ignore_z80_joy_conf=255, gui_sound=255, fuller_box_sound=255, currah_active = 255, se_basic =255;
|
||||||
|
|
||||||
if (filename) strcpy(config_path,filename);
|
if (filename) strcpy(config_path,filename);
|
||||||
else return -2;
|
else return -2;
|
||||||
@ -1002,6 +1003,10 @@ int load_config(struct computer *object, char *filename) {
|
|||||||
ntsc=line[5]-'0';
|
ntsc=line[5]-'0';
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
if (!strncmp(line,"se_basic=",9)) {
|
||||||
|
se_basic=line[9]-'0';
|
||||||
|
continue;
|
||||||
|
}
|
||||||
if (!strncmp(line,"joystick1=",10)) {
|
if (!strncmp(line,"joystick1=",10)) {
|
||||||
joystick1=line[10]-'0';
|
joystick1=line[10]-'0';
|
||||||
continue;
|
continue;
|
||||||
@ -1131,6 +1136,9 @@ int load_config(struct computer *object, char *filename) {
|
|||||||
if (ntsc<2) {
|
if (ntsc<2) {
|
||||||
object->videosystem=ntsc;
|
object->videosystem=ntsc;
|
||||||
}
|
}
|
||||||
|
if (se_basic<2) {
|
||||||
|
object->se_basic=se_basic;
|
||||||
|
}
|
||||||
if (joystick1<6) {
|
if (joystick1<6) {
|
||||||
object->joystick[0]=joystick1;
|
object->joystick[0]=joystick1;
|
||||||
}
|
}
|
||||||
|
@ -87,11 +87,14 @@ static const char *emulation_messages[] = {
|
|||||||
/*03*/ "48K model",
|
/*03*/ "48K model",
|
||||||
/*04*/ "^|issue2|issue3",
|
/*04*/ "^|issue2|issue3",
|
||||||
/*05*/ " ",
|
/*05*/ " ",
|
||||||
/*06*/ "Frame rate",
|
/*06*/ "Open SE Basic",
|
||||||
/*07*/ "^|100%|50%|33%|25%|20%",
|
/*07*/ "^|on|off",
|
||||||
/*08*/ " ",
|
/*08*/ " ",
|
||||||
/*09*/ "Precision",
|
/*09*/ "Frame rate",
|
||||||
/*10*/ "^|on|off",
|
/*10*/ "^|100%|50%|33%|25%|20%",
|
||||||
|
/*11*/ " ",
|
||||||
|
/*12*/ "Precision",
|
||||||
|
/*13*/ "^|on|off",
|
||||||
NULL
|
NULL
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -427,6 +430,7 @@ void create_tapfile_sdl() {
|
|||||||
static int manage_tape(int which)
|
static int manage_tape(int which)
|
||||||
{
|
{
|
||||||
int retorno=0; //Stay in menu as default
|
int retorno=0; //Stay in menu as default
|
||||||
|
unsigned char model128k;
|
||||||
switch (which)
|
switch (which)
|
||||||
{
|
{
|
||||||
case 0: //Insert
|
case 0: //Insert
|
||||||
@ -434,7 +438,15 @@ static int manage_tape(int which)
|
|||||||
break;
|
break;
|
||||||
case 1: //Emulate load ""
|
case 1: //Emulate load ""
|
||||||
countdown_buffer=8;
|
countdown_buffer=8;
|
||||||
switch (ordenador.mode128k)
|
model128k = ordenador.mode128k;
|
||||||
|
|
||||||
|
if ((ordenador.mport1 & 0x10)&&(ordenador.mode128k!=4)) //ROM 48k
|
||||||
|
model128k =0;
|
||||||
|
|
||||||
|
if ((ordenador.mode128k==0)&&(ordenador.se_basic))
|
||||||
|
model128k =4;
|
||||||
|
|
||||||
|
switch (model128k)
|
||||||
{
|
{
|
||||||
case 4://Spanish 128k
|
case 4://Spanish 128k
|
||||||
ordenador.keyboard_buffer[0][8]= SDLK_l;
|
ordenador.keyboard_buffer[0][8]= SDLK_l;
|
||||||
@ -459,16 +471,6 @@ static int manage_tape(int which)
|
|||||||
case 2: //+2
|
case 2: //+2
|
||||||
case 1: //128k
|
case 1: //128k
|
||||||
ordenador.kbd_buffer_pointer=2;
|
ordenador.kbd_buffer_pointer=2;
|
||||||
if (ordenador.mport1 & 0x10) //ROM 48k
|
|
||||||
{
|
|
||||||
ordenador.keyboard_buffer[0][5]= SDLK_j; //Load
|
|
||||||
ordenador.keyboard_buffer[1][5]= 0;
|
|
||||||
ordenador.keyboard_buffer[0][4]= SDLK_p; //"
|
|
||||||
ordenador.keyboard_buffer[1][4]= SDLK_LCTRL;
|
|
||||||
ordenador.keyboard_buffer[0][3]= SDLK_p; //"
|
|
||||||
ordenador.keyboard_buffer[1][3]= SDLK_LCTRL;
|
|
||||||
ordenador.kbd_buffer_pointer=5;
|
|
||||||
}
|
|
||||||
ordenador.keyboard_buffer[0][2]= SDLK_RETURN; // Return
|
ordenador.keyboard_buffer[0][2]= SDLK_RETURN; // Return
|
||||||
ordenador.keyboard_buffer[1][2]= 0;
|
ordenador.keyboard_buffer[1][2]= 0;
|
||||||
ordenador.keyboard_buffer[0][1]= SDLK_F6; //F6 - play
|
ordenador.keyboard_buffer[0][1]= SDLK_F6; //F6 - play
|
||||||
@ -588,7 +590,7 @@ static void set_machine_model(int which)
|
|||||||
|
|
||||||
static int emulation_settings(void)
|
static int emulation_settings(void)
|
||||||
{
|
{
|
||||||
unsigned int submenus[4],submenus_old[4];
|
unsigned int submenus[5],submenus_old[5];
|
||||||
int opt, i, retorno;
|
int opt, i, retorno;
|
||||||
unsigned char old_mode, old_videosystem;
|
unsigned char old_mode, old_videosystem;
|
||||||
|
|
||||||
@ -598,10 +600,11 @@ static int emulation_settings(void)
|
|||||||
|
|
||||||
submenus[0] = get_machine_model();
|
submenus[0] = get_machine_model();
|
||||||
submenus[1] = ordenador.issue-2;
|
submenus[1] = ordenador.issue-2;
|
||||||
submenus[2] = jump_frames;
|
submenus[2] = !ordenador.se_basic;
|
||||||
submenus[3] = !ordenador.precision;
|
submenus[3] = jump_frames;
|
||||||
|
submenus[4] = !ordenador.precision;
|
||||||
|
|
||||||
for (i=0; i<4; i++) submenus_old[i] = submenus[i];
|
for (i=0; i<5; i++) submenus_old[i] = submenus[i];
|
||||||
old_mode=ordenador.mode128k;
|
old_mode=ordenador.mode128k;
|
||||||
old_videosystem = ordenador.videosystem;
|
old_videosystem = ordenador.videosystem;
|
||||||
|
|
||||||
@ -617,11 +620,15 @@ static int emulation_settings(void)
|
|||||||
|
|
||||||
if (ordenador.mode128k==0) ordenador.issue= submenus[1]+2; else ordenador.issue = 3;
|
if (ordenador.mode128k==0) ordenador.issue= submenus[1]+2; else ordenador.issue = 3;
|
||||||
|
|
||||||
jump_frames = submenus[2];
|
ordenador.se_basic = !submenus[2];
|
||||||
|
|
||||||
if (submenus[3] != submenus_old[3])
|
if (submenus[2]!=submenus_old[2]) {ResetComputer ();retorno=-2;}
|
||||||
|
|
||||||
|
jump_frames = submenus[3];
|
||||||
|
|
||||||
|
if (submenus[3] != submenus_old[4])
|
||||||
{
|
{
|
||||||
ordenador.precision = !submenus[3];
|
ordenador.precision = !submenus[4];
|
||||||
ordenador.precision_old=ordenador.precision;
|
ordenador.precision_old=ordenador.precision;
|
||||||
if (ordenador.turbo_state!=1) //Tape is not loading with auto mode
|
if (ordenador.turbo_state!=1) //Tape is not loading with auto mode
|
||||||
if (ordenador.precision)
|
if (ordenador.precision)
|
||||||
@ -996,6 +1003,9 @@ void load_mdr_file(void)
|
|||||||
if ((ordenador.mport1 & 0x10)&&(ordenador.mode128k!=4)) //ROM 48k
|
if ((ordenador.mport1 & 0x10)&&(ordenador.mode128k!=4)) //ROM 48k
|
||||||
model128k =0;
|
model128k =0;
|
||||||
|
|
||||||
|
if ((ordenador.mode128k==0)&&(ordenador.se_basic))
|
||||||
|
model128k =4;
|
||||||
|
|
||||||
//Emulate load *"m";1;"run"
|
//Emulate load *"m";1;"run"
|
||||||
countdown_buffer=8;
|
countdown_buffer=8;
|
||||||
ordenador.kbd_buffer_pointer=17;
|
ordenador.kbd_buffer_pointer=17;
|
||||||
@ -1934,7 +1944,7 @@ static void save_load_general_configurations(int which)
|
|||||||
{
|
{
|
||||||
|
|
||||||
int retorno;
|
int retorno;
|
||||||
unsigned char old_bw,old_mode, old_currah;
|
unsigned char old_bw,old_mode, old_currah, old_se_basic;
|
||||||
char config_path[MAX_PATH_LENGTH];
|
char config_path[MAX_PATH_LENGTH];
|
||||||
int length;
|
int length;
|
||||||
FILE *fconfig;
|
FILE *fconfig;
|
||||||
@ -1963,10 +1973,12 @@ static void save_load_general_configurations(int which)
|
|||||||
old_bw = ordenador.bw;
|
old_bw = ordenador.bw;
|
||||||
old_mode= ordenador.mode128k;
|
old_mode= ordenador.mode128k;
|
||||||
old_currah = ordenador.currah_active;
|
old_currah = ordenador.currah_active;
|
||||||
|
old_se_basic = ordenador.se_basic;
|
||||||
if (!load_config(&ordenador,config_path)) msgInfo("General confs loaded",3000,NULL);
|
if (!load_config(&ordenador,config_path)) msgInfo("General confs loaded",3000,NULL);
|
||||||
if (old_bw!=ordenador.bw) computer_set_palete();
|
if (old_bw!=ordenador.bw) computer_set_palete();
|
||||||
if (ordenador.currah_rom_unavailable) ordenador.currah_active =0;
|
if (ordenador.currah_rom_unavailable) ordenador.currah_active =0;
|
||||||
if ((old_mode != ordenador.mode128k)||(old_currah != ordenador.currah_active)) ResetComputer();
|
if ((old_mode != ordenador.mode128k)||(old_currah != ordenador.currah_active)||
|
||||||
|
(old_se_basic != ordenador.se_basic)) ResetComputer();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
else // Delete config file
|
else // Delete config file
|
||||||
|
Loading…
Reference in New Issue
Block a user