Ignore .z80 joystick conf option, longer pause before activating tape

This commit is contained in:
fabio.olimpieri 2013-02-19 08:50:27 +00:00
parent 3ee3ad572f
commit 526d10d6b4
7 changed files with 32 additions and 11 deletions

View File

@ -208,7 +208,7 @@ void virtkey_ir_run(void)
int key_h = 64/RATIO; int key_h = 64/RATIO;
int border_x = VirtualKeyboard.sel_x/RATIO; int border_x = VirtualKeyboard.sel_x/RATIO;
int border_y = VirtualKeyboard.sel_y/RATIO; int border_y = VirtualKeyboard.sel_y/RATIO;
int key = 0; int key_sel = 0;
SDL_Joystick *joy; SDL_Joystick *joy;
static int joy_bottons_last[4]; static int joy_bottons_last[4];
static char countdown_rumble=0; static char countdown_rumble=0;
@ -223,7 +223,7 @@ void virtkey_ir_run(void)
(SDL_JoystickGetButton(joy, 3) && !joy_bottons_last[1]) || /* 2 */ (SDL_JoystickGetButton(joy, 3) && !joy_bottons_last[1]) || /* 2 */
(SDL_JoystickGetButton(joy, 9) && !joy_bottons_last[2]) || /* CA */ (SDL_JoystickGetButton(joy, 9) && !joy_bottons_last[2]) || /* CA */
(SDL_JoystickGetButton(joy, 10) && !joy_bottons_last[3])) /* CB */ (SDL_JoystickGetButton(joy, 10) && !joy_bottons_last[3])) /* CB */
key = KEY_SELECT; key_sel = KEY_SELECT;
joy_bottons_last[0]=SDL_JoystickGetButton(joy, 0) ; /* A */ joy_bottons_last[0]=SDL_JoystickGetButton(joy, 0) ; /* A */
joy_bottons_last[1] =SDL_JoystickGetButton(joy, 3) ; /* 2 */ joy_bottons_last[1] =SDL_JoystickGetButton(joy, 3) ; /* 2 */
@ -231,7 +231,7 @@ void virtkey_ir_run(void)
joy_bottons_last[3] =SDL_JoystickGetButton(joy, 10) ; /* CB */ joy_bottons_last[3] =SDL_JoystickGetButton(joy, 10) ; /* CB */
if (key==KEY_SELECT) if (key_sel==KEY_SELECT)
{ {
SDL_GetMouseState(&xm, &ym); SDL_GetMouseState(&xm, &ym);
x = (xm-border_x); x = (xm-border_x);
@ -273,6 +273,7 @@ void virtkey_ir_run(void)
draw_vk(); draw_vk();
SDL_ShowCursor(SDL_ENABLE); SDL_ShowCursor(SDL_ENABLE);
} }
key_sel=0;
} }
} }

View File

@ -597,7 +597,7 @@ void load_snap(struct z80snapshot *snap) {
break; break;
} }
ordenador.joystick[0]=snap->joystick; //Only one Joystick in Z80 file if (ordenador.ignore_z80_joy_conf==0) ordenador.joystick[0]=snap->joystick; //Only one Joystick in Z80 file
procesador.Rm.br.A=snap->A; procesador.Rm.br.A=snap->A;
procesador.Rm.br.F=snap->F; procesador.Rm.br.F=snap->F;

View File

@ -173,7 +173,7 @@ void computer_init () { //Called only on start-up
strcpy (ordenador.SmbShare, "Share"); strcpy (ordenador.SmbShare, "Share");
strcpy (ordenador.SmbIp, "192.168.0.1"); strcpy (ordenador.SmbIp, "192.168.0.1");
ordenador.autoconf=0; ordenador.autoconf=0;
ordenador.ignore_z80_joy_conf=0;
ordenador.cpufreq = 3500000; // values for 48K mode ordenador.cpufreq = 3500000; // values for 48K mode
ordenador.fetch_state =0; ordenador.fetch_state =0;
ordenador.last_selected_poke_file[0]='\0'; ordenador.last_selected_poke_file[0]='\0';

View File

@ -144,6 +144,8 @@ struct computer {
signed char ay_envel_value; signed char ay_envel_value;
unsigned char ay_envel_way; unsigned char ay_envel_way;
//unsigned char sound_current_value; //unsigned char sound_current_value;
//Z80 instruction variables
unsigned int wr; unsigned int wr;
unsigned int r_fetch; unsigned int r_fetch;
unsigned int io; unsigned int io;
@ -245,6 +247,10 @@ struct computer {
unsigned char vk_auto; unsigned char vk_auto;
unsigned char vk_rumble; unsigned char vk_rumble;
unsigned char vk_is_active; unsigned char vk_is_active;
unsigned char autoconf;
unsigned char ignore_z80_joy_conf;
//Port variables
unsigned char port; //SD, USB, SMB or FTP unsigned char port; //SD, USB, SMB or FTP
unsigned char smb_enable; unsigned char smb_enable;
unsigned char SmbUser[32]; unsigned char SmbUser[32];
@ -258,7 +264,7 @@ struct computer {
unsigned char FTPIp[64]; unsigned char FTPIp[64];
unsigned char FTPPassive; unsigned char FTPPassive;
unsigned short FTPPort; unsigned short FTPPort;
unsigned char autoconf;
}; };
void computer_init(); void computer_init();

View File

@ -718,6 +718,7 @@ int save_config(struct computer *object, char *filename) {
fprintf(fconfig,"rumble2=%c%c",48+object->rumble[1],10); fprintf(fconfig,"rumble2=%c%c",48+object->rumble[1],10);
fprintf(fconfig,"port=%c%c",48+object->port,10); fprintf(fconfig,"port=%c%c",48+object->port,10);
fprintf(fconfig,"autoconf=%c%c",48+object->autoconf,10); fprintf(fconfig,"autoconf=%c%c",48+object->autoconf,10);
fprintf(fconfig,"ignore_z80_joy_conf=%c%c",48+object->ignore_z80_joy_conf,10);
fprintf(fconfig,"turbo=%c%c",48+object->turbo,10); fprintf(fconfig,"turbo=%c%c",48+object->turbo,10);
fprintf(fconfig,"vk_auto=%c%c",48+object->vk_auto,10); fprintf(fconfig,"vk_auto=%c%c",48+object->vk_auto,10);
fprintf(fconfig,"vk_rumble=%c%c",48+object->vk_rumble,10); fprintf(fconfig,"vk_rumble=%c%c",48+object->vk_rumble,10);
@ -889,7 +890,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; rewind_on_reset=255, pause_instant_load =255, ignore_z80_joy_conf=255;
if (filename) strcpy(config_path,filename); if (filename) strcpy(config_path,filename);
else return -2; else return -2;
@ -1019,6 +1020,10 @@ int load_config(struct computer *object, char *filename) {
autoconf=line[9]-'0'; autoconf=line[9]-'0';
continue; continue;
} }
if (!strncmp(line,"ignore_z80_joy_conf=",20)) {
ignore_z80_joy_conf=line[20]-'0';
continue;
}
if (!strncmp(line,"turbo=",6)) { if (!strncmp(line,"turbo=",6)) {
turbo=line[6]-'0'; turbo=line[6]-'0';
continue; continue;
@ -1113,6 +1118,9 @@ int load_config(struct computer *object, char *filename) {
if (autoconf<2) { if (autoconf<2) {
object->autoconf=autoconf; object->autoconf=autoconf;
} }
if (ignore_z80_joy_conf<2) {
object->ignore_z80_joy_conf=ignore_z80_joy_conf;
}
if (turbo<2) { if (turbo<2) {
object->turbo=turbo; object->turbo=turbo;
} }

View File

@ -199,6 +199,10 @@ static const char *confs_messages[] = {
/*05*/ " ", /*05*/ " ",
/*06*/ "Load confs automatically", /*06*/ "Load confs automatically",
/*07*/ "^|on|off", /*07*/ "^|on|off",
/*08*/ " ",
/*09*/ "Ignore .z80 joystick confs",
/*10*/ "^|on|off",
NULL NULL
}; };
@ -1794,7 +1798,7 @@ static void save_load_general_configurations(int which)
static void manage_configurations() static void manage_configurations()
{ {
int opt , retorno; int opt , retorno;
int submenus[3]; int submenus[4];
memset(submenus, 0, sizeof(submenus)); memset(submenus, 0, sizeof(submenus));
@ -1802,6 +1806,7 @@ static void manage_configurations()
retorno = -1; //Exit from menu as default retorno = -1; //Exit from menu as default
submenus[2]=!ordenador.autoconf; submenus[2]=!ordenador.autoconf;
submenus[3]=!ordenador.ignore_z80_joy_conf;
opt = menu_select_title("Configurations file menu", opt = menu_select_title("Configurations file menu",
confs_messages, submenus); confs_messages, submenus);
@ -1809,6 +1814,7 @@ static void manage_configurations()
return; return;
ordenador.autoconf=!submenus[2]; ordenador.autoconf=!submenus[2];
ordenador.ignore_z80_joy_conf=!submenus[3];
switch(opt) switch(opt)
{ {

View File

@ -1187,7 +1187,7 @@ void fastload_block_tzx (FILE * fichero) {
jump_frames=7; jump_frames=7;
ordenador.turbo_state=4; ordenador.turbo_state=4;
} }
ordenador.tape_start_countdwn=((unsigned int)pause[0]+256*(unsigned int)pause[1])/30+1; //autoplay countdown ordenador.tape_start_countdwn=((unsigned int)pause[0]+256*(unsigned int)pause[1])/20+1; //autoplay countdown
} }
else if (ordenador.pause_instant_load) else if (ordenador.pause_instant_load)
{ {