[Atsoft-commit] CVS: dcgen/gui options.c,1.3,1.4
Brought to you by:
atani
|
From: Mike D. <at...@us...> - 2002-04-10 04:53:12
|
Update of /cvsroot/atsoft/dcgen/gui
In directory usw-pr-cvs1:/tmp/cvs-serv25081/gui
Modified Files:
options.c
Log Message:
Various speed hacks, fixes to the options screen and auto-frameskip code.
new feature: auto-frameskip.
Index: options.c
===================================================================
RCS file: /cvsroot/atsoft/dcgen/gui/options.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** options.c 21 Feb 2002 06:44:36 -0000 1.3
--- options.c 10 Apr 2002 04:53:08 -0000 1.4
***************
*** 15,47 ****
char desc[80];
uint8 *variable;
! int boolean;
! int max_value;
! T_OPTION_STRING *opts;
} T_OPTIONS;
! T_OPTION_STRING render_opts[2] =
! {
! {"Complex", 0},
! {"Simple (cell)", 1},
! };
T_OPTIONS options[] =
{
// SOUND OPTIONS
! {"sound enabled", &sound_on, 1},
// VIDEO OPTIONS
! {"Rendering System", &ui_vdpsimple, 0, 2, (T_OPTION_STRING *)&render_opts},
! {"VDP LayerB Enable", &vdp_layerB, 1},
! {"VDP LayerB Priority Enable", &vdp_layerBp, 1},
! {"VDP LayerA Enable", &vdp_layerA, 1},
! {"VDP LayerA Priority Enable", &vdp_layerAp, 1},
! {"VDP LayerW Enable", &vdp_layerW, 1},
! {"VDP LayerW Priority Enable", &vdp_layerWp, 1},
! {"VDP LayerS Enable", &vdp_layerS, 1},
! {"VDP LayerS Priority Enable", &vdp_layerSp, 1},
// NULL OPTION TO SIGNAL END OF LIST
! {"\0", NULL, 0, 0, NULL},
};
--- 15,42 ----
char desc[80];
uint8 *variable;
! uint8 current;
! uint8 max;
} T_OPTIONS;
! extern uint8 auto_frameskip;
! extern uint8 auto_frameskip_count;
! extern uint8 ui_vdpsimple;
! extern unsigned int cpuz80_on;
T_OPTIONS options[] =
{
// SOUND OPTIONS
! {"sound enabled", &sound_on, 0, 1},
// VIDEO OPTIONS
! {"Simple [cell]", &ui_vdpsimple, 1},
! {"Auto-Frameskip [experimental]", &auto_frameskip, 0, 1},
! {"Frameskip Count [experimental]", &auto_frameskip_count, 4, 10},
!
! // CPU OPTIONS
! {"Z80 Emulation", (uint8*)&cpuz80_on, 0, 1},
// NULL OPTION TO SIGNAL END OF LIST
! {"\0", NULL, 1, 1},
};
***************
*** 54,64 ****
while(options[counter].variable != NULL)
{
! if(options[counter].boolean)
{
! draw_poly_strf(32.0f, y, 616.0f, 1.0f, 1.0f, 1.0f, 1.0f, "%s: %s", options[counter].desc, (*(options[counter].variable)? "Yes": "No"));
}
else
{
! draw_poly_strf(32.0f, y, 616.0f, 1.0f, 1.0f, 1.0f, 1.0f, "%s: %s", options[counter].desc, options[counter].opts[(*(options[counter].variable))].string);
}
if(counter == selected)
--- 49,59 ----
while(options[counter].variable != NULL)
{
! if(options[counter].max > 1)
{
! draw_poly_strf(32.0f, y, 616.0f, 1.0f, 1.0f, 1.0f, 1.0f, "%s: %u", options[counter].desc, options[counter].current);
}
else
{
! draw_poly_strf(32.0f, y, 616.0f, 1.0f, 1.0f, 1.0f, 1.0f, "%s: %s", options[counter].desc, (options[counter].current ? "Yes": "No"));
}
if(counter == selected)
***************
*** 79,84 ****
{
cont_cond_t cond, oldcond;
! unsigned char times = 0;
! unsigned char exit = 0;
int current = 0;
--- 74,79 ----
{
cont_cond_t cond, oldcond;
! uint8 times = 0;
! uint8 exit = 0;
int current = 0;
***************
*** 99,106 ****
exit = 1;
}
- else if(!(cond.buttons & CONT_START))
- {
- exit = 1;
- }
else if(!(cond.buttons & CONT_DPAD_UP))
{
--- 94,97 ----
***************
*** 126,136 ****
if(oldcond.buttons & CONT_A)
{
! if(options[current].boolean)
{
! *(options[current].variable) = !*(options[current].variable);
}
else
{
! *(options[current].variable) = options[current].opts[*(options[current].variable)++].value;
}
}
--- 117,143 ----
if(oldcond.buttons & CONT_A)
{
! if(options[current].max > 1)
{
! if(options[current].current < options[current].max)
! {
! options[current].current++;
! }
}
else
{
! options[current].current = !options[current].current;
! }
! }
! }
! else if(!(cond.buttons & CONT_B))
! {
! if(oldcond.buttons & CONT_B)
! {
! if(options[current].max > 1)
! {
! if(options[current].current)
! {
! options[current].current--;
! }
}
}
***************
*** 143,151 ****
}
}
-
-
times++;
times %= 12;
oldcond = cond;
}
}
--- 150,163 ----
}
}
times++;
times %= 12;
oldcond = cond;
+ }
+
+ current = 0;
+ while(options[current].variable != NULL)
+ {
+ *(options[current].variable) = options[current].current;
+ current++;
}
}
|