Implemented CPU Idle, removed Turbo CPU speed
- Turbo CPU speed is no longer needed, Fastest Possible is now actually as fast as possible CPU emulation! - Removed obsolete custom timing settings for Fastest CPU setting - Implemented CPU Idle slider in GUI, which allows to set how much time the CPU emulation should sleep when not in use (keeps the temperature down)
This commit is contained in:
parent
6e87d1cb7f
commit
8afd7eee50
15 changed files with 434 additions and 225 deletions
|
@ -42,7 +42,7 @@ STATIC_INLINE bool isaudio (void)
|
|||
|
||||
STATIC_INLINE bool usehacks(void)
|
||||
{
|
||||
return currprefs.cpu_model >= 68020 || currprefs.m68k_speed != 0;
|
||||
return !(currprefs.cs_hacks & 8) && (currprefs.cpu_model >= 68020 || currprefs.m68k_speed != 0 || (currprefs.cs_hacks & 4));
|
||||
}
|
||||
|
||||
#define SINC_QUEUE_MAX_AGE 2048
|
||||
|
|
|
@ -355,10 +355,12 @@ static void check_channel_mods (int hpos, int ch)
|
|||
// (or cycle where last D write would have been if
|
||||
// ONEDOT was active)
|
||||
|
||||
static void blitter_interrupt (void)
|
||||
static void blitter_interrupt (int done)
|
||||
{
|
||||
if (blit_interrupt)
|
||||
return;
|
||||
if (!done && (!blitter_cycle_exact || immediate_blits || currprefs.cpu_model >= 68030 || currprefs.cachesize || currprefs.m68k_speed < 0))
|
||||
return;
|
||||
blit_interrupt = 1;
|
||||
send_interrupt (6);
|
||||
}
|
||||
|
@ -367,7 +369,7 @@ static void blitter_done (int hpos)
|
|||
{
|
||||
ddat1use = ddat2use = 0;
|
||||
bltstate = blit_startcycles == 0 || !blitter_cycle_exact || immediate_blits ? BLT_done : BLT_init;
|
||||
blitter_interrupt ();
|
||||
blitter_interrupt (1);
|
||||
blitter_done_notify (hpos);
|
||||
event2_remevent (ev2_blitter);
|
||||
unset_special (SPCFLAG_BLTNASTY);
|
||||
|
@ -855,6 +857,15 @@ void decide_blitter (int hpos)
|
|||
blitter_doit();
|
||||
return;
|
||||
}
|
||||
|
||||
if (bltstate == BLT_done)
|
||||
return;
|
||||
|
||||
if (!blitter_cycle_exact)
|
||||
return;
|
||||
|
||||
if (hpos < 0)
|
||||
hpos = maxhpos;
|
||||
}
|
||||
|
||||
static void blitter_force_finish(void)
|
||||
|
|
|
@ -2097,7 +2097,7 @@ void cfgfile_save_options(struct zfile* f, struct uae_prefs* p, int type)
|
|||
}
|
||||
else
|
||||
{
|
||||
cfgfile_write_str(f, _T("cpu_speed"), (p->m68k_speed > -30 ? (p->m68k_speed < 0 ? _T("max") : _T("real")) : "turbo"));
|
||||
cfgfile_write_str(f, _T("cpu_speed"), p->m68k_speed < 0 ? _T("max") : _T("real"));
|
||||
}
|
||||
|
||||
/* do not reorder start */
|
||||
|
@ -4630,14 +4630,8 @@ static int cfgfile_parse_hardware(struct uae_prefs* p, const TCHAR* option, TCHA
|
|||
return 1;
|
||||
}
|
||||
|
||||
if (cfgfile_strval(option, value, _T("cpu_speed"), &p->m68k_speed, speedmode, 1))
|
||||
{
|
||||
if (_tcsicmp(value, _T("max")) == 0)
|
||||
p->m68k_speed = -1;
|
||||
else if (_tcsicmp(value, _T("turbo")) == 0)
|
||||
p->m68k_speed = -30;
|
||||
else
|
||||
p->m68k_speed--;
|
||||
if (cfgfile_strval(option, value, _T("cpu_speed"), &p->m68k_speed, speedmode, 1)) {
|
||||
p->m68k_speed--;
|
||||
return 1;
|
||||
}
|
||||
if (cfgfile_intval(option, value, _T("cpu_speed"), &p->m68k_speed, 1))
|
||||
|
@ -4645,6 +4639,12 @@ static int cfgfile_parse_hardware(struct uae_prefs* p, const TCHAR* option, TCHA
|
|||
p->m68k_speed *= CYCLE_UNIT;
|
||||
return 1;
|
||||
}
|
||||
if (cfgfile_doubleval(option, value, _T("cpu_throttle"), &p->m68k_speed_throttle)) {
|
||||
return 1;
|
||||
}
|
||||
if (cfgfile_doubleval(option, value, _T("cpu_x86_throttle"), &p->x86_speed_throttle)) {
|
||||
return 1;
|
||||
}
|
||||
if (cfgfile_intval(option, value, _T("finegrain_cpu_speed"), &p->m68k_speed, 1))
|
||||
{
|
||||
if (OFFICIAL_CYCLE_UNIT > CYCLE_UNIT)
|
||||
|
@ -4654,8 +4654,9 @@ static int cfgfile_parse_hardware(struct uae_prefs* p, const TCHAR* option, TCHA
|
|||
}
|
||||
if (_tcsicmp(value, _T("max")) == 0)
|
||||
p->m68k_speed = -1;
|
||||
if (_tcsicmp(value, _T("turbo")) == 0)
|
||||
p->m68k_speed = -30;
|
||||
return 1;
|
||||
}
|
||||
if (cfgfile_doubleval(option, value, _T("blitter_throttle"), &p->blitter_speed_throttle)) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
|
189
src/custom.cpp
189
src/custom.cpp
|
@ -47,10 +47,6 @@
|
|||
extern int speedup_cycles_jit_pal;
|
||||
extern int speedup_cycles_jit_ntsc;
|
||||
extern int speedup_cycles_nonjit;
|
||||
extern int speedup_timelimit_jit;
|
||||
extern int speedup_timelimit_nonjit;
|
||||
extern int speedup_timelimit_jit_turbo;
|
||||
extern int speedup_timelimit_nonjit_turbo;
|
||||
#endif
|
||||
|
||||
STATIC_INLINE bool nocustom (void)
|
||||
|
@ -80,7 +76,6 @@ static void uae_abort (const TCHAR *format,...)
|
|||
|
||||
#ifdef AMIBERRY
|
||||
int pissoff_value = speedup_cycles_jit_pal * CYCLE_UNIT;
|
||||
int speedup_timelimit = speedup_timelimit_jit;
|
||||
#endif
|
||||
|
||||
static unsigned int n_consecutive_skipped = 0;
|
||||
|
@ -484,23 +479,14 @@ void set_speedup_values(void)
|
|||
{
|
||||
if (currprefs.m68k_speed < 0) {
|
||||
if (currprefs.cachesize) {
|
||||
pissoff_value = ((vblank_hz > 55) ? speedup_cycles_jit_ntsc : speedup_cycles_jit_pal) * CYCLE_UNIT;
|
||||
if (currprefs.m68k_speed != -30)
|
||||
speedup_timelimit = speedup_timelimit_jit;
|
||||
else
|
||||
speedup_timelimit = speedup_timelimit_jit_turbo;
|
||||
pissoff_value = (vblank_hz > 55 ? speedup_cycles_jit_ntsc : speedup_cycles_jit_pal) * CYCLE_UNIT;
|
||||
}
|
||||
else {
|
||||
pissoff_value = speedup_cycles_nonjit * CYCLE_UNIT;
|
||||
if (currprefs.m68k_speed != -30)
|
||||
speedup_timelimit = speedup_timelimit_nonjit;
|
||||
else
|
||||
speedup_timelimit = speedup_timelimit_nonjit_turbo;
|
||||
}
|
||||
}
|
||||
else {
|
||||
pissoff_value = 0;
|
||||
speedup_timelimit = 0;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
@ -7409,10 +7395,10 @@ void init_hardware_for_drawing_frame (void)
|
|||
next_sprite_forced = 1;
|
||||
}
|
||||
|
||||
static int rpt_vsync ()
|
||||
static int rpt_vsync (int adjust)
|
||||
{
|
||||
frame_time_t curr_time = read_processor_time ();
|
||||
int v = curr_time - vsyncwaittime;
|
||||
int v = curr_time - vsyncwaittime + adjust;
|
||||
if (v > syncbase || v < -syncbase) {
|
||||
vsyncmintime = vsyncmaxtime = vsyncwaittime = curr_time;
|
||||
v = 0;
|
||||
|
@ -7556,12 +7542,12 @@ static bool framewait(void)
|
|||
t = read_processor_time() - start;
|
||||
}
|
||||
while (true) {
|
||||
auto v = rpt_vsync() / (syncbase / 1000.0);
|
||||
auto v = rpt_vsync(0) / (syncbase / 1000.0);
|
||||
if (v >= -2)
|
||||
break;
|
||||
cpu_sleep_millis(1);
|
||||
}
|
||||
while (rpt_vsync() < 0) {
|
||||
while (rpt_vsync(0) < 0) {
|
||||
}
|
||||
idletime += read_processor_time() - start;
|
||||
curr_time = read_processor_time();
|
||||
|
@ -7654,6 +7640,42 @@ static void fpscounter (bool frameok)
|
|||
static void vsync_handler_pre (void)
|
||||
{
|
||||
struct amigadisplay *ad = &adisplays;
|
||||
|
||||
if (currprefs.m68k_speed < 0) {
|
||||
if (regs.stopped) {
|
||||
if (cpu_last_stop_vpos >= 0) {
|
||||
cpu_stopped_lines += maxvpos - cpu_last_stop_vpos;
|
||||
}
|
||||
else {
|
||||
cpu_stopped_lines = 0;
|
||||
}
|
||||
}
|
||||
int mv = 12 - currprefs.cpu_idle / 15;
|
||||
if (mv >= 1 && mv <= 11) {
|
||||
mv = 11 - mv;
|
||||
if (cpu_stopped_lines >= maxvpos * (mv * 10) / 100) {
|
||||
cpu_sleepmode_cnt++;
|
||||
if (cpu_sleepmode_cnt >= 50) {
|
||||
cpu_sleepmode_cnt = 50;
|
||||
if (!cpu_sleepmode) {
|
||||
cpu_sleepmode = 1;
|
||||
//write_log(_T("sleep\n"));
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
reset_cpu_idle();
|
||||
}
|
||||
}
|
||||
else {
|
||||
reset_cpu_idle();
|
||||
}
|
||||
}
|
||||
if (regs.halted < 0)
|
||||
reset_cpu_idle();
|
||||
cpu_last_stop_vpos = 0;
|
||||
cpu_stopped_lines = 0;
|
||||
|
||||
if (bogusframe > 0)
|
||||
bogusframe--;
|
||||
|
||||
|
@ -7662,7 +7684,8 @@ static void vsync_handler_pre (void)
|
|||
timehack_alive--;
|
||||
|
||||
#ifdef PICASSO96
|
||||
rtg_vsync ();
|
||||
if (isvsync_rtg() >= 0)
|
||||
rtg_vsync ();
|
||||
#endif
|
||||
|
||||
if (!vsync_rendered) {
|
||||
|
@ -8228,33 +8251,143 @@ static void hsync_handler_post (bool onvsync)
|
|||
lof_lastline = lof_store != 0;
|
||||
}
|
||||
|
||||
if (currprefs.chipset_mask & CSMASK_ECS_AGNUS) {
|
||||
if (vpos == sprhstrt) {
|
||||
hhspr = 1;
|
||||
}
|
||||
if (vpos == sprhstop) {
|
||||
hhspr = 0;
|
||||
}
|
||||
if (vpos == bplhstrt) {
|
||||
hhbpl = 1;
|
||||
}
|
||||
if (vpos == bplhstop) {
|
||||
hhbpl = 0;
|
||||
}
|
||||
uae_u16 add = maxhpos + lol - 1;
|
||||
uae_u16 max = (new_beamcon0 & 0x040) ? htotal : add;
|
||||
uae_u16 hhpos_old = hhpos;
|
||||
hhpos += add;
|
||||
if (hhpos_old <= max || hhpos >= 0x100) {
|
||||
if (max)
|
||||
hhpos %= max;
|
||||
else
|
||||
hhpos = 0;
|
||||
}
|
||||
if (hhpos_hpos) {
|
||||
hhpos -= add - hhpos_hpos;
|
||||
hhpos_hpos = 0;
|
||||
}
|
||||
hhpos &= 0xff;
|
||||
}
|
||||
|
||||
#ifdef CPUEMU_13
|
||||
if (currprefs.cpu_memory_cycle_exact || currprefs.blitter_cycle_exact) {
|
||||
int hp = maxhpos - 1, i;
|
||||
for (i = 0; i < 4; i++) {
|
||||
alloc_cycle(hp, i == 0 ? CYCLE_STROBE : CYCLE_REFRESH); /* strobe */
|
||||
#ifdef DEBUGGER
|
||||
if (debug_dma) {
|
||||
uae_u16 strobe = 0x3c;
|
||||
if (vpos < equ_vblank_endline)
|
||||
strobe = 0x38;
|
||||
else if (vpos < minfirstline)
|
||||
strobe = 0x3a;
|
||||
else if (vpos + 1 == maxvpos + lof_store)
|
||||
strobe = 0x38;
|
||||
else if ((currprefs.chipset_mask & CSMASK_ECS_AGNUS) && lol)
|
||||
strobe = 0x3e;
|
||||
record_dma(i == 0 ? strobe : 0x1fe, 0xffff, 0xffffffff, hp, vpos, DMARECORD_REFRESH, i);
|
||||
}
|
||||
#endif
|
||||
hp += 2;
|
||||
if (hp >= maxhpos)
|
||||
hp -= maxhpos;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
events_dmal_hsync ();
|
||||
|
||||
if (currprefs.m68k_speed < 0) {
|
||||
if (!currprefs.cpu_thread && !cpu_sleepmode && currprefs.m68k_speed < 0 && !currprefs.cpu_memory_cycle_exact) {
|
||||
|
||||
static int sleeps_remaining;
|
||||
if (is_last_line()) {
|
||||
/* really last line, just run the cpu emulation until whole vsync time has been used */
|
||||
vsyncmintime = vsyncmaxtime; /* emulate if still time left */
|
||||
if (vsyncmaxtime - read_processor_time() > -speedup_timelimit)
|
||||
sleeps_remaining = (165 - currprefs.cpu_idle) / 6;
|
||||
if (sleeps_remaining < 0)
|
||||
sleeps_remaining = 0;
|
||||
if (regs.stopped && currprefs.cpu_idle) {
|
||||
// CPU in STOP state: sleep if enough time left.
|
||||
frame_time_t rpt = read_processor_time();
|
||||
while ((int)vsyncmintime - (int)(rpt + vsynctimebase / 10) > 0 && (int)vsyncmintime - (int)rpt < vsynctimebase) {
|
||||
//maybe_process_pull_audio();
|
||||
|
||||
if (cpu_sleep_millis(1) < 0)
|
||||
break;
|
||||
rpt = read_processor_time();
|
||||
}
|
||||
}
|
||||
else if (currprefs.m68k_speed_throttle) {
|
||||
vsyncmintime = read_processor_time(); /* end of CPU emulation time */
|
||||
events_reset_syncline();
|
||||
//maybe_process_pull_audio();
|
||||
}
|
||||
else {
|
||||
/* really last line, just run the cpu emulation until whole vsync time has been used */
|
||||
vsyncmintime = vsyncmaxtime; /* emulate if still time left */
|
||||
is_syncline_end = read_processor_time() + vsynctimebase; /* far enough in future, we never wait that long */
|
||||
is_syncline = -12;
|
||||
}
|
||||
}
|
||||
|
||||
else {
|
||||
static int linecounter;
|
||||
/* end of scanline, run cpu emulation as long as we still have time */
|
||||
vsyncmintime += vsynctimeperline;
|
||||
linecounter++;
|
||||
events_reset_syncline();
|
||||
if (int(vsyncmaxtime) - int(vsyncmintime) > 0) {
|
||||
if (int(vsyncwaittime) - int(vsyncmintime) > 0) {
|
||||
frame_time_t rpt = read_processor_time();
|
||||
/* Extra time left? Do some extra CPU emulation */
|
||||
if (int(vsyncmintime) - int(rpt) > -speedup_timelimit) {
|
||||
is_syncline = -11;
|
||||
if (int(vsyncmintime) - int(rpt) > 0) {
|
||||
if (regs.stopped && currprefs.cpu_idle && sleeps_remaining > 0) {
|
||||
// STOP STATE: sleep.
|
||||
cpu_sleep_millis(1);
|
||||
sleeps_remaining--;
|
||||
//maybe_process_pull_audio();
|
||||
}
|
||||
else {
|
||||
is_syncline = -11;
|
||||
/* limit extra time */
|
||||
is_syncline_end = int(rpt) + vsynctimeperline;
|
||||
linecounter = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (vpos + 1 < maxvpos + lof_store && (vpos == maxvpos_display * 1 / 3 || vpos == maxvpos_display * 2 / 3)) {
|
||||
else if (!currprefs.cpu_thread) {
|
||||
|
||||
// the rest
|
||||
static int nextwaitvpos;
|
||||
if (vpos == 0)
|
||||
nextwaitvpos = maxvpos_display * 1 / 4;
|
||||
|
||||
if (vpos + 1 < maxvpos + lof_store && vpos >= nextwaitvpos && vpos < maxvpos - (maxvpos / 3)) {
|
||||
nextwaitvpos += maxvpos_display * 1 / 3;
|
||||
vsyncmintime += vsynctimeperline;
|
||||
if (!currprefs.turbo_emulation) {
|
||||
frame_time_t rpt = read_processor_time();
|
||||
// sleep if more than 2ms "free" time
|
||||
while ((int)vsyncmintime - (int)(rpt + vsynctimebase / 10) > 0 && (int)vsyncmintime - (int)rpt < vsynctimebase) {
|
||||
//maybe_process_pull_audio();
|
||||
if (cpu_sleep_millis(1) < 0)
|
||||
break;
|
||||
rpt = read_processor_time();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -4204,13 +4204,13 @@ void drawing_init(void)
|
|||
reset_drawing();
|
||||
}
|
||||
|
||||
//int isvsync_chipset(void)
|
||||
//{
|
||||
// struct amigadisplay *ad = &adisplays;
|
||||
// if (ad->picasso_on)
|
||||
// return 0;
|
||||
// return 1;
|
||||
//}
|
||||
int isvsync_chipset(void)
|
||||
{
|
||||
struct amigadisplay *ad = &adisplays;
|
||||
if (ad->picasso_on)
|
||||
return 0;
|
||||
return 1;
|
||||
}
|
||||
|
||||
int isvsync_rtg(void)
|
||||
{
|
||||
|
|
|
@ -12,9 +12,10 @@
|
|||
#include "options.h"
|
||||
#include "include/memory.h"
|
||||
#include "newcpu.h"
|
||||
#include "xwin.h"
|
||||
|
||||
unsigned long int nextevent, currcycle;
|
||||
int is_syncline;
|
||||
int is_syncline, is_syncline_end;
|
||||
|
||||
frame_time_t vsyncmintime, vsyncmaxtime, vsyncwaittime;
|
||||
int vsynctimebase;
|
||||
|
@ -48,19 +49,69 @@ void events_schedule(void)
|
|||
static bool event_check_vsync(void)
|
||||
{
|
||||
/* Keep only CPU emulation running while waiting for sync point. */
|
||||
if (is_syncline)
|
||||
if (is_syncline == -1) {
|
||||
|
||||
if (!isvsync_chipset()) {
|
||||
events_reset_syncline();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else if (is_syncline == -2) {
|
||||
|
||||
if (!isvsync_chipset()) {
|
||||
events_reset_syncline();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else if (is_syncline == -3) {
|
||||
if (!isvsync_chipset()) {
|
||||
events_reset_syncline();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else if (is_syncline > 0)
|
||||
{
|
||||
int rpt = read_processor_time();
|
||||
int v = rpt - vsyncmintime;
|
||||
if (v > vsynctimebase || v < -vsynctimebase)
|
||||
{
|
||||
v = 0;
|
||||
if (!isvsync_chipset()) {
|
||||
events_reset_syncline();
|
||||
return false;
|
||||
}
|
||||
if (v < speedup_timelimit)
|
||||
{
|
||||
regs.pissoff = pissoff_value;
|
||||
return true;
|
||||
}
|
||||
else if (is_syncline <= -100) {
|
||||
|
||||
if (!isvsync_chipset()) {
|
||||
events_reset_syncline();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else if (is_syncline == -10) {
|
||||
|
||||
// wait is_syncline_end
|
||||
//if (event_wait) {
|
||||
int rpt = read_processor_time();
|
||||
int v = rpt - is_syncline_end;
|
||||
if (v < 0)
|
||||
{
|
||||
regs.pissoff = pissoff_value;
|
||||
return true;
|
||||
}
|
||||
//}
|
||||
events_reset_syncline();
|
||||
}
|
||||
else if (is_syncline < -10) {
|
||||
|
||||
// wait is_syncline_end/vsyncmintime
|
||||
//if (event_wait) {
|
||||
int rpt = read_processor_time();
|
||||
int v = rpt - vsyncmintime;
|
||||
int v2 = rpt - is_syncline_end;
|
||||
if (v > vsynctimebase || v < -vsynctimebase) {
|
||||
v = 0;
|
||||
}
|
||||
if (v < 0 && v2 < 0) {
|
||||
regs.pissoff = pissoff_value;
|
||||
return true;
|
||||
}
|
||||
//}
|
||||
events_reset_syncline();
|
||||
}
|
||||
return false;
|
||||
|
|
171
src/filesys.cpp
171
src/filesys.cpp
|
@ -45,6 +45,7 @@
|
|||
#include "bsdsocket.h"
|
||||
#include "uaeresource.h"
|
||||
#include "inputdevice.h"
|
||||
#include "newcpu.h"
|
||||
#include "picasso96.h"
|
||||
#include "rommgr.h"
|
||||
|
||||
|
@ -5444,99 +5445,103 @@ end:
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int handle_packet(TrapContext *ctx, Unit *unit, dpacket *pck, uae_u32 msg, int isvolume)
|
||||
static int handle_packet(TrapContext* ctx, Unit* unit, dpacket* pck, uae_u32 msg, int isvolume)
|
||||
{
|
||||
bool noidle = false;
|
||||
int ret = 1;
|
||||
uae_s32 type = GET_PCK_TYPE (pck);
|
||||
PUT_PCK_RES2 (pck, 0);
|
||||
uae_s32 type = GET_PCK_TYPE(pck);
|
||||
PUT_PCK_RES2(pck, 0);
|
||||
|
||||
if (unit->inhibited && isvolume
|
||||
&& type != ACTION_INHIBIT && type != ACTION_MORE_CACHE
|
||||
&& type != ACTION_DISK_INFO) {
|
||||
PUT_PCK_RES1 (pck, DOS_FALSE);
|
||||
PUT_PCK_RES2 (pck, ERROR_NOT_A_DOS_DISK);
|
||||
return 1;
|
||||
}
|
||||
if (type != ACTION_INHIBIT && type != ACTION_CURRENT_VOLUME
|
||||
&& type != ACTION_IS_FILESYSTEM && type != ACTION_MORE_CACHE
|
||||
&& type != ACTION_WRITE_PROTECT && type != ACTION_DISK_INFO
|
||||
&& type != ACTION_INHIBIT && type != ACTION_MORE_CACHE
|
||||
&& type != ACTION_DISK_INFO) {
|
||||
PUT_PCK_RES1(pck, DOS_FALSE);
|
||||
PUT_PCK_RES2(pck, ERROR_NOT_A_DOS_DISK);
|
||||
return 1;
|
||||
}
|
||||
if (type != ACTION_INHIBIT && type != ACTION_CURRENT_VOLUME
|
||||
&& type != ACTION_IS_FILESYSTEM && type != ACTION_MORE_CACHE
|
||||
&& type != ACTION_WRITE_PROTECT && type != ACTION_DISK_INFO
|
||||
&& !isvolume) {
|
||||
PUT_PCK_RES1 (pck, DOS_FALSE);
|
||||
PUT_PCK_RES2 (pck, unit->ui.unknown_media ? ERROR_NOT_A_DOS_DISK : ERROR_NO_DISK);
|
||||
return 1;
|
||||
}
|
||||
|
||||
switch (type) {
|
||||
case ACTION_LOCATE_OBJECT: action_lock (ctx, unit, pck); break;
|
||||
case ACTION_FREE_LOCK: action_free_lock (ctx, unit, pck); break;
|
||||
case ACTION_COPY_DIR: action_dup_lock (ctx, unit, pck); break;
|
||||
case ACTION_DISK_INFO: action_disk_info (ctx, unit, pck); break;
|
||||
case ACTION_INFO: action_info (ctx, unit, pck); break;
|
||||
case ACTION_EXAMINE_OBJECT: action_examine_object (ctx, unit, pck); break;
|
||||
case ACTION_EXAMINE_NEXT: action_examine_next (ctx, unit, pck, false); break;
|
||||
case ACTION_FIND_INPUT: action_find_input (ctx, unit, pck); break;
|
||||
case ACTION_FIND_WRITE: action_find_write (ctx, unit, pck); break;
|
||||
case ACTION_FIND_OUTPUT: action_find_output (ctx, unit, pck); break;
|
||||
case ACTION_END: action_end (ctx, unit, pck); break;
|
||||
case ACTION_READ: action_read(ctx, unit, pck); break;
|
||||
case ACTION_WRITE: action_write (ctx, unit, pck); break;
|
||||
case ACTION_SEEK: action_seek (ctx, unit, pck); break;
|
||||
case ACTION_SET_PROTECT: action_set_protect (ctx, unit, pck); break;
|
||||
case ACTION_SET_COMMENT: action_set_comment (ctx, unit, pck); break;
|
||||
case ACTION_SAME_LOCK: action_same_lock (ctx, unit, pck); break;
|
||||
case ACTION_PARENT: action_parent (ctx, unit, pck); break;
|
||||
case ACTION_CREATE_DIR: action_create_dir (ctx, unit, pck); break;
|
||||
case ACTION_DELETE_OBJECT: action_delete_object (ctx, unit, pck); break;
|
||||
case ACTION_RENAME_OBJECT: action_rename_object (ctx, unit, pck); break;
|
||||
case ACTION_SET_DATE: action_set_date (ctx, unit, pck); break;
|
||||
case ACTION_CURRENT_VOLUME: action_current_volume (ctx, unit, pck); break;
|
||||
case ACTION_RENAME_DISK: action_rename_disk (ctx, unit, pck); break;
|
||||
case ACTION_IS_FILESYSTEM: action_is_filesystem (ctx, unit, pck); break;
|
||||
case ACTION_FLUSH: action_flush (ctx, unit, pck); break;
|
||||
case ACTION_MORE_CACHE: action_more_cache (ctx, unit, pck); break;
|
||||
case ACTION_INHIBIT: action_inhibit (ctx, unit, pck); break;
|
||||
case ACTION_WRITE_PROTECT: action_write_protect (ctx, unit, pck); break;
|
||||
|
||||
/* 2.0+ packet types */
|
||||
case ACTION_SET_FILE_SIZE: action_set_file_size (ctx, unit, pck); break;
|
||||
case ACTION_EXAMINE_FH: action_examine_fh (ctx, unit, pck, false); break;
|
||||
case ACTION_FH_FROM_LOCK: action_fh_from_lock (ctx, unit, pck); break;
|
||||
case ACTION_COPY_DIR_FH: action_lock_from_fh (ctx, unit, pck); break;
|
||||
case ACTION_CHANGE_MODE: action_change_mode (ctx, unit, pck); break;
|
||||
case ACTION_PARENT_FH: action_parent_fh (ctx, unit, pck); break;
|
||||
case ACTION_ADD_NOTIFY: action_add_notify (ctx, unit, pck); break;
|
||||
case ACTION_REMOVE_NOTIFY: action_remove_notify (ctx, unit, pck); break;
|
||||
case ACTION_EXAMINE_ALL: ret = action_examine_all(ctx, unit, pck); break;
|
||||
case ACTION_EXAMINE_ALL_END: ret = action_examine_all_end(ctx, unit, pck); break;
|
||||
case ACTION_LOCK_RECORD: ret = action_lock_record (ctx, unit, pck, msg); break;
|
||||
case ACTION_FREE_RECORD: action_free_record (ctx, unit, pck); break;
|
||||
PUT_PCK_RES1(pck, DOS_FALSE);
|
||||
PUT_PCK_RES2(pck, unit->ui.unknown_media ? ERROR_NOT_A_DOS_DISK : ERROR_NO_DISK);
|
||||
return 1;
|
||||
}
|
||||
|
||||
switch (type) {
|
||||
case ACTION_LOCATE_OBJECT: action_lock(ctx, unit, pck); break;
|
||||
case ACTION_FREE_LOCK: action_free_lock(ctx, unit, pck); break;
|
||||
case ACTION_COPY_DIR: action_dup_lock(ctx, unit, pck); break;
|
||||
case ACTION_DISK_INFO: action_disk_info(ctx, unit, pck); break;
|
||||
case ACTION_INFO: action_info(ctx, unit, pck); break;
|
||||
case ACTION_EXAMINE_OBJECT: action_examine_object(ctx, unit, pck); break;
|
||||
case ACTION_EXAMINE_NEXT: noidle = true; action_examine_next(ctx, unit, pck, false); break;
|
||||
case ACTION_FIND_INPUT: action_find_input(ctx, unit, pck); break;
|
||||
case ACTION_FIND_WRITE: action_find_write(ctx, unit, pck); break;
|
||||
case ACTION_FIND_OUTPUT: action_find_output(ctx, unit, pck); break;
|
||||
case ACTION_END: action_end(ctx, unit, pck); break;
|
||||
case ACTION_READ: noidle = true; action_read(ctx, unit, pck); break;
|
||||
case ACTION_WRITE: noidle = true; action_write(ctx, unit, pck); break;
|
||||
case ACTION_SEEK: action_seek(ctx, unit, pck); break;
|
||||
case ACTION_SET_PROTECT: action_set_protect(ctx, unit, pck); break;
|
||||
case ACTION_SET_COMMENT: action_set_comment(ctx, unit, pck); break;
|
||||
case ACTION_SAME_LOCK: action_same_lock(ctx, unit, pck); break;
|
||||
case ACTION_PARENT: action_parent(ctx, unit, pck); break;
|
||||
case ACTION_CREATE_DIR: action_create_dir(ctx, unit, pck); break;
|
||||
case ACTION_DELETE_OBJECT: action_delete_object(ctx, unit, pck); break;
|
||||
case ACTION_RENAME_OBJECT: action_rename_object(ctx, unit, pck); break;
|
||||
case ACTION_SET_DATE: action_set_date(ctx, unit, pck); break;
|
||||
case ACTION_CURRENT_VOLUME: action_current_volume(ctx, unit, pck); break;
|
||||
case ACTION_RENAME_DISK: action_rename_disk(ctx, unit, pck); break;
|
||||
case ACTION_IS_FILESYSTEM: action_is_filesystem(ctx, unit, pck); break;
|
||||
case ACTION_FLUSH: action_flush(ctx, unit, pck); break;
|
||||
case ACTION_MORE_CACHE: action_more_cache(ctx, unit, pck); break;
|
||||
case ACTION_INHIBIT: action_inhibit(ctx, unit, pck); break;
|
||||
case ACTION_WRITE_PROTECT: action_write_protect(ctx, unit, pck); break;
|
||||
|
||||
/* 2.0+ packet types */
|
||||
case ACTION_SET_FILE_SIZE: action_set_file_size(ctx, unit, pck); break;
|
||||
case ACTION_EXAMINE_FH: action_examine_fh(ctx, unit, pck, false); break;
|
||||
case ACTION_FH_FROM_LOCK: action_fh_from_lock(ctx, unit, pck); break;
|
||||
case ACTION_COPY_DIR_FH: action_lock_from_fh(ctx, unit, pck); break;
|
||||
case ACTION_CHANGE_MODE: action_change_mode(ctx, unit, pck); break;
|
||||
case ACTION_PARENT_FH: action_parent_fh(ctx, unit, pck); break;
|
||||
case ACTION_ADD_NOTIFY: action_add_notify(ctx, unit, pck); break;
|
||||
case ACTION_REMOVE_NOTIFY: action_remove_notify(ctx, unit, pck); break;
|
||||
case ACTION_EXAMINE_ALL: noidle = true; ret = action_examine_all(ctx, unit, pck); break;
|
||||
case ACTION_EXAMINE_ALL_END: ret = action_examine_all_end(ctx, unit, pck); break;
|
||||
case ACTION_LOCK_RECORD: ret = action_lock_record(ctx, unit, pck, msg); break;
|
||||
case ACTION_FREE_RECORD: action_free_record(ctx, unit, pck); break;
|
||||
|
||||
/* OS4 packet types */
|
||||
case ACTION_FILESYSTEM_ATTR: action_filesystem_attr(ctx, unit, pck); break;
|
||||
case ACTION_CHANGE_FILE_POSITION64: action_change_file_position64 (ctx, unit, pck); break;
|
||||
case ACTION_GET_FILE_POSITION64: action_get_file_position64 (ctx, unit, pck); break;
|
||||
case ACTION_CHANGE_FILE_SIZE64: action_change_file_size64 (ctx, unit, pck); break;
|
||||
case ACTION_GET_FILE_SIZE64: action_get_file_size64 (ctx, unit, pck); break;
|
||||
case ACTION_FILESYSTEM_ATTR: action_filesystem_attr(ctx, unit, pck); break;
|
||||
case ACTION_CHANGE_FILE_POSITION64: action_change_file_position64(ctx, unit, pck); break;
|
||||
case ACTION_GET_FILE_POSITION64: action_get_file_position64(ctx, unit, pck); break;
|
||||
case ACTION_CHANGE_FILE_SIZE64: action_change_file_size64(ctx, unit, pck); break;
|
||||
case ACTION_GET_FILE_SIZE64: action_get_file_size64(ctx, unit, pck); break;
|
||||
|
||||
/* MOS packet types */
|
||||
case ACTION_SEEK64: action_seek64(ctx, unit, pck); break;
|
||||
case ACTION_SET_FILE_SIZE64: action_set_file_size64(ctx, unit, pck); break;
|
||||
case ACTION_EXAMINE_OBJECT64: action_examine_object64(ctx, unit, pck); break;
|
||||
case ACTION_EXAMINE_NEXT64: action_examine_next(ctx, unit, pck, true); break;
|
||||
case ACTION_EXAMINE_FH64: action_examine_fh(ctx, unit, pck, true); break;
|
||||
case ACTION_LOCK_RECORD64: ret = action_lock_record64(ctx, unit, pck, msg); break;
|
||||
case ACTION_FREE_RECORD64: action_free_record64(ctx, unit, pck); break;
|
||||
case ACTION_SEEK64: action_seek64(ctx, unit, pck); break;
|
||||
case ACTION_SET_FILE_SIZE64: action_set_file_size64(ctx, unit, pck); break;
|
||||
case ACTION_EXAMINE_OBJECT64: action_examine_object64(ctx, unit, pck); break;
|
||||
case ACTION_EXAMINE_NEXT64: noidle = true; action_examine_next(ctx, unit, pck, true); break;
|
||||
case ACTION_EXAMINE_FH64: action_examine_fh(ctx, unit, pck, true); break;
|
||||
case ACTION_LOCK_RECORD64: ret = action_lock_record64(ctx, unit, pck, msg); break;
|
||||
case ACTION_FREE_RECORD64: action_free_record64(ctx, unit, pck); break;
|
||||
|
||||
/* unsupported packets */
|
||||
case ACTION_MAKE_LINK:
|
||||
case ACTION_READ_LINK:
|
||||
case ACTION_FORMAT:
|
||||
write_log (_T("FILESYS: UNSUPPORTED PACKET %x\n"), type);
|
||||
return 0;
|
||||
default:
|
||||
write_log (_T("FILESYS: UNKNOWN PACKET %x\n"), type);
|
||||
return 0;
|
||||
}
|
||||
/* unsupported packets */
|
||||
case ACTION_MAKE_LINK:
|
||||
case ACTION_READ_LINK:
|
||||
case ACTION_FORMAT:
|
||||
write_log(_T("FILESYS: UNSUPPORTED PACKET %x\n"), type);
|
||||
return 0;
|
||||
default:
|
||||
write_log(_T("FILESYS: UNKNOWN PACKET %x\n"), type);
|
||||
return 0;
|
||||
}
|
||||
if (noidle) {
|
||||
m68k_cancel_idle();
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
|
@ -24,6 +24,7 @@
|
|||
#include "scsi.h"
|
||||
#include "gayle.h"
|
||||
#include "execio.h"
|
||||
#include "newcpu.h"
|
||||
#include "zfile.h"
|
||||
|
||||
#define HDF_SUPPORT_NSD 1
|
||||
|
@ -656,6 +657,7 @@ int hdf_write (struct hardfiledata *hfd, void *buffer, uae_u64 offset, int len)
|
|||
|
||||
static uae_u64 cmd_readx (struct hardfiledata *hfd, uae_u8 *dataptr, uae_u64 offset, uae_u64 len)
|
||||
{
|
||||
m68k_cancel_idle();
|
||||
gui_flicker_led (LED_HD, hfd->unitnum, 1);
|
||||
return hdf_read (hfd, dataptr, offset, len);
|
||||
}
|
||||
|
@ -689,6 +691,7 @@ static uae_u64 cmd_read(TrapContext *ctx, struct hardfiledata *hfd, uaecptr data
|
|||
}
|
||||
static uae_u64 cmd_writex (struct hardfiledata *hfd, uae_u8 *dataptr, uae_u64 offset, uae_u64 len)
|
||||
{
|
||||
m68k_cancel_idle();
|
||||
gui_flicker_led (LED_HD, hfd->unitnum, 2);
|
||||
return hdf_write (hfd, dataptr, offset, len);
|
||||
}
|
||||
|
|
|
@ -311,6 +311,8 @@ extern void check_t0_trace(void);
|
|||
#define x_do_cycles(c) do_cycles(c)
|
||||
|
||||
extern void m68k_setstopped (void);
|
||||
extern void m68k_resumestopped(void);
|
||||
extern void m68k_cancel_idle(void);
|
||||
|
||||
#define get_disp_ea_020(base,idx) _get_disp_ea_020(base)
|
||||
extern uae_u32 REGPARAM3 _get_disp_ea_020 (uae_u32 base) REGPARAM;
|
||||
|
@ -388,7 +390,7 @@ extern void exception3b (uae_u32 opcode, uaecptr addr, bool w, bool i, uaecptr p
|
|||
extern void exception2 (uaecptr addr, bool read, int size, uae_u32 fc);
|
||||
extern void cpureset (void);
|
||||
extern void cpu_halt (int id);
|
||||
extern void cpu_sleep_millis(int ms);
|
||||
extern int cpu_sleep_millis(int ms);
|
||||
|
||||
extern void fill_prefetch (void);
|
||||
|
||||
|
|
|
@ -41,7 +41,7 @@ extern int vsync_isdone(frame_time_t*);
|
|||
extern void doflashscreen (void);
|
||||
//extern int flashscreen;
|
||||
extern void updatedisplayarea();
|
||||
|
||||
extern int isvsync_chipset(void);
|
||||
extern int isvsync_rtg (void);
|
||||
extern int isvsync (void);
|
||||
|
||||
|
@ -173,12 +173,4 @@ struct amigadisplay
|
|||
|
||||
extern struct amigadisplay adisplays;
|
||||
|
||||
STATIC_INLINE int isvsync_chipset (void)
|
||||
{
|
||||
struct amigadisplay *ad = &adisplays;
|
||||
if (ad->picasso_on)
|
||||
return 0;
|
||||
return 1;
|
||||
}
|
||||
|
||||
#endif /* UAE_XWIN_H */
|
||||
|
|
|
@ -78,6 +78,8 @@ static uae_u64 fake_srp_030, fake_crp_030;
|
|||
static uae_u32 fake_tt0_030, fake_tt1_030, fake_tc_030;
|
||||
static uae_u16 fake_mmusr_030;
|
||||
|
||||
int cpu_last_stop_vpos, cpu_stopped_lines;
|
||||
|
||||
#if COUNT_INSTRS
|
||||
static uae_u32 instrcount[65536];
|
||||
static uae_u16 opcodenums[65536];
|
||||
|
@ -602,18 +604,30 @@ STATIC_INLINE uae_u32 adjust_cycles(uae_u32 cycles)
|
|||
return res;
|
||||
}
|
||||
|
||||
void m68k_cancel_idle(void)
|
||||
{
|
||||
cpu_last_stop_vpos = -1;
|
||||
}
|
||||
|
||||
static void m68k_set_stop(void)
|
||||
{
|
||||
if (regs.stopped)
|
||||
return;
|
||||
regs.stopped = 1;
|
||||
set_special(SPCFLAG_STOP);
|
||||
if (cpu_last_stop_vpos >= 0) {
|
||||
cpu_last_stop_vpos = vpos;
|
||||
}
|
||||
}
|
||||
|
||||
static void m68k_unset_stop(void)
|
||||
{
|
||||
regs.stopped = 0;
|
||||
unset_special(SPCFLAG_STOP);
|
||||
if (cpu_last_stop_vpos >= 0) {
|
||||
cpu_stopped_lines += vpos - cpu_last_stop_vpos;
|
||||
cpu_last_stop_vpos = vpos;
|
||||
}
|
||||
}
|
||||
|
||||
static void activate_trace(void)
|
||||
|
@ -1558,9 +1572,10 @@ static void check_uae_int_request(void)
|
|||
}
|
||||
}
|
||||
|
||||
void cpu_sleep_millis(int ms)
|
||||
int cpu_sleep_millis(int ms)
|
||||
{
|
||||
sleep_millis_main(ms);
|
||||
const auto ret = sleep_millis_main(ms);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static bool haltloop(void)
|
||||
|
@ -1598,8 +1613,6 @@ void doint(void)
|
|||
set_special(SPCFLAG_DOINT);
|
||||
}
|
||||
|
||||
static void m68k_resumestopped(void);
|
||||
|
||||
static int do_specialties(int cycles)
|
||||
{
|
||||
if (regs.spcflags & SPCFLAG_MODE_CHANGE)
|
||||
|
@ -2463,7 +2476,7 @@ actually stopping. */
|
|||
}
|
||||
}
|
||||
|
||||
static void m68k_resumestopped(void)
|
||||
void m68k_resumestopped(void)
|
||||
{
|
||||
if (!regs.stopped)
|
||||
return;
|
||||
|
|
|
@ -127,33 +127,11 @@ void set_key_configs(struct uae_prefs* p)
|
|||
int speedup_cycles_jit_pal = 18000;
|
||||
int speedup_cycles_jit_ntsc = 15000;
|
||||
int speedup_cycles_nonjit = 1024;
|
||||
// These are set to give enough time to hit 60 fps
|
||||
// on the ASUS tinker board, and giving the rest of the
|
||||
// time to the CPU (minus the 10% reserve above).
|
||||
// As these numbers are decreased towards -(SPEEDUP_CYCLES),
|
||||
// more chipset time is given and the CPU gets slower.
|
||||
// For your platform its best to tune these to the point where
|
||||
// you hit 60FPS in NTSC and not higher.
|
||||
// Do not tune above -(SPEEDUP_CYCLES) or the emulation will
|
||||
// become unstable.
|
||||
int speedup_timelimit_jit = -10000;
|
||||
int speedup_timelimit_nonjit = -960;
|
||||
// These define the maximum CPU possible and work well with
|
||||
// frameskip on and operation at 30fps at full chipset speed
|
||||
// They give the minimum possible chipset time. Do not make
|
||||
// these positive numbers. Doing so may give you a 500mhz
|
||||
// 68040 but your emulation will not be able to reset at this
|
||||
// speed.
|
||||
int speedup_timelimit_jit_turbo = 0;
|
||||
int speedup_timelimit_nonjit_turbo = 0;
|
||||
|
||||
#else
|
||||
int speedup_cycles_jit_pal = 10000;
|
||||
int speedup_cycles_jit_ntsc = 6667;
|
||||
int speedup_cycles_nonjit = 256;
|
||||
int speedup_timelimit_jit = -5000;
|
||||
int speedup_timelimit_nonjit = -5000;
|
||||
int speedup_timelimit_jit_turbo = 0;
|
||||
int speedup_timelimit_nonjit_turbo = 0;
|
||||
#endif
|
||||
|
||||
extern void signal_segv(int signum, siginfo_t* info, void* ptr);
|
||||
|
@ -522,6 +500,7 @@ void target_save_options(struct zfile* f, struct uae_prefs* p)
|
|||
cfgfile_write_bool(f, _T("amiberry.use_retroarch_menu"), p->use_retroarch_menu);
|
||||
cfgfile_write_bool(f, _T("amiberry.use_retroarch_reset"), p->use_retroarch_reset);
|
||||
|
||||
cfgfile_target_dwrite(f, _T("cpu_idle"), _T("%d"), p->cpu_idle);
|
||||
#ifdef ANDROID
|
||||
cfgfile_write(f, "amiberry.onscreen", "%d", p->onScreen);
|
||||
cfgfile_write(f, "amiberry.onscreen_textinput", "%d", p->onScreen_textinput);
|
||||
|
@ -629,6 +608,8 @@ int target_parse_option(struct uae_prefs* p, const char* option, const char* val
|
|||
return 1;
|
||||
if (cfgfile_string(option, value, "fullscreen_toggle", p->fullscreen_toggle, sizeof p->fullscreen_toggle))
|
||||
return 1;
|
||||
if (cfgfile_intval(option, value, _T("cpu_idle"), &p->cpu_idle, 1))
|
||||
return 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -956,14 +937,6 @@ void save_amiberry_settings(void)
|
|||
fputs(buffer, f);
|
||||
snprintf(buffer, MAX_DPATH, "speedup_cycles_nonjit=%d\n", speedup_cycles_nonjit);
|
||||
fputs(buffer, f);
|
||||
snprintf(buffer, MAX_DPATH, "speedup_timelimit_jit=%d\n", speedup_timelimit_jit);
|
||||
fputs(buffer, f);
|
||||
snprintf(buffer, MAX_DPATH, "speedup_timelimit_nonjit=%d\n", speedup_timelimit_nonjit);
|
||||
fputs(buffer, f);
|
||||
snprintf(buffer, MAX_DPATH, "speedup_timelimit_jit_turbo=%d\n", speedup_timelimit_jit_turbo);
|
||||
fputs(buffer, f);
|
||||
snprintf(buffer, MAX_DPATH, "speedup_timelimit_nonjit_turbo=%d\n", speedup_timelimit_nonjit_turbo);
|
||||
fputs(buffer, f);
|
||||
|
||||
// Paths
|
||||
snprintf(buffer, MAX_DPATH, "path=%s\n", currentDir);
|
||||
|
@ -1167,10 +1140,6 @@ void load_amiberry_settings(void)
|
|||
cfgfile_intval(option, value, "speedup_cycles_jit_pal", &speedup_cycles_jit_pal, 1);
|
||||
cfgfile_intval(option, value, "speedup_cycles_jit_ntsc", &speedup_cycles_jit_ntsc, 1);
|
||||
cfgfile_intval(option, value, "speedup_cycles_nonjit", &speedup_cycles_nonjit, 1);
|
||||
cfgfile_intval(option, value, "speedup_timelimit_jit", &speedup_timelimit_jit, 1);
|
||||
cfgfile_intval(option, value, "speedup_timelimit_nonjit", &speedup_timelimit_nonjit, 1);
|
||||
cfgfile_intval(option, value, "speedup_timelimit_jit_turbo", &speedup_timelimit_jit_turbo, 1);
|
||||
cfgfile_intval(option, value, "speedup_timelimit_nonjit_turbo", &speedup_timelimit_nonjit_turbo, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -111,11 +111,11 @@ static NavigationMap navMap[] =
|
|||
{"CPU internal", "68030", "Fastest", "68882", "FPUstrict"},
|
||||
{"FPUstrict", "68040", "Fastest", "CPU internal", "FPUJIT"},
|
||||
{"FPUJIT", "CPU24Bit", "Fastest", "FPUstrict", "FPUnone"},
|
||||
{"7 Mhz", "FPUnone", "CPU and FPU", "Turbo", "14 Mhz"},
|
||||
{"7 Mhz", "FPUnone", "CPU and FPU", "sldCpuIdle", "14 Mhz"},
|
||||
{"14 Mhz", "FPUnone", "CPU and FPU", "7 Mhz", "25 Mhz"},
|
||||
{"25 Mhz", "FPUnone", "CPU and FPU", "14 Mhz", "Fastest"},
|
||||
{"Fastest", "FPUnone", "CPU and FPU", "25 Mhz", "Turbo"},
|
||||
{"Turbo", "FPUnone", "CPU and FPU", "Fastest", "7 Mhz"},
|
||||
{"Fastest", "FPUnone", "CPU and FPU", "25 Mhz", "sldCpuIdle"},
|
||||
{"sldCpuIdle", "", "", "Fastest", "7 Mhz"},
|
||||
|
||||
// PanelChipset
|
||||
{"OCS", "Chipset", "ChipsetExtra", "CollFull", "ECS Agnus"},
|
||||
|
|
|
@ -31,9 +31,10 @@ static gcn::CheckBox* chkFPUJIT;
|
|||
static gcn::Window* grpCPUSpeed;
|
||||
static gcn::RadioButton* opt7Mhz;
|
||||
static gcn::RadioButton* opt14Mhz;
|
||||
static gcn::RadioButton* opt28Mhz;
|
||||
static gcn::RadioButton* opt25Mhz;
|
||||
static gcn::RadioButton* optFastest;
|
||||
static gcn::RadioButton* optTurbo;
|
||||
static gcn::Label* lblCpuIdle;
|
||||
static gcn::Slider* sldCpuIdle;
|
||||
|
||||
class CPUButtonActionListener : public gcn::ActionListener
|
||||
{
|
||||
|
@ -127,12 +128,10 @@ public:
|
|||
changed_prefs.m68k_speed = M68K_SPEED_7MHZ_CYCLES;
|
||||
else if (actionEvent.getSource() == opt14Mhz)
|
||||
changed_prefs.m68k_speed = M68K_SPEED_14MHZ_CYCLES;
|
||||
else if (actionEvent.getSource() == opt28Mhz)
|
||||
else if (actionEvent.getSource() == opt25Mhz)
|
||||
changed_prefs.m68k_speed = M68K_SPEED_25MHZ_CYCLES;
|
||||
else if (actionEvent.getSource() == optFastest)
|
||||
changed_prefs.m68k_speed = -1;
|
||||
else if (actionEvent.getSource() == optTurbo)
|
||||
changed_prefs.m68k_speed = -30;
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -217,6 +216,23 @@ public:
|
|||
|
||||
static FPUActionListener* fpuActionListener;
|
||||
|
||||
class CPUIdleSliderActionListener : public gcn::ActionListener
|
||||
{
|
||||
public:
|
||||
void action(const gcn::ActionEvent& actionEvent) override
|
||||
{
|
||||
if (actionEvent.getSource() == sldCpuIdle)
|
||||
{
|
||||
changed_prefs.cpu_idle = static_cast<int>(sldCpuIdle->getValue());
|
||||
if (changed_prefs.cpu_idle > 0)
|
||||
changed_prefs.cpu_idle = (12 - changed_prefs.cpu_idle) * 15;
|
||||
}
|
||||
RefreshPanelCPU();
|
||||
}
|
||||
};
|
||||
|
||||
static CPUIdleSliderActionListener* cpuIdleActionListener;
|
||||
|
||||
void InitPanelCPU(const struct _ConfigCategory& category)
|
||||
{
|
||||
cpuButtonActionListener = new CPUButtonActionListener();
|
||||
|
@ -224,6 +240,7 @@ void InitPanelCPU(const struct _ConfigCategory& category)
|
|||
cpuCompActionListener = new CPUCompActionListener();
|
||||
jitActionListener = new JITActionListener();
|
||||
fpuActionListener = new FPUActionListener();
|
||||
cpuIdleActionListener = new CPUIdleSliderActionListener();
|
||||
|
||||
optCPU68000 = new gcn::RadioButton("68000", "radiocpugroup");
|
||||
optCPU68000->setId("68000");
|
||||
|
@ -321,27 +338,33 @@ void InitPanelCPU(const struct _ConfigCategory& category)
|
|||
opt14Mhz->setId("14 Mhz");
|
||||
opt14Mhz->addActionListener(cpuSpeedButtonActionListener);
|
||||
|
||||
opt28Mhz = new gcn::RadioButton("25 Mhz", "radiocpuspeedgroup");
|
||||
opt28Mhz->setId("25 Mhz");
|
||||
opt28Mhz->addActionListener(cpuSpeedButtonActionListener);
|
||||
opt25Mhz = new gcn::RadioButton("25 Mhz", "radiocpuspeedgroup");
|
||||
opt25Mhz->setId("25 Mhz");
|
||||
opt25Mhz->addActionListener(cpuSpeedButtonActionListener);
|
||||
|
||||
optFastest = new gcn::RadioButton("Fastest", "radiocpuspeedgroup");
|
||||
optFastest->setId("Fastest");
|
||||
optFastest->addActionListener(cpuSpeedButtonActionListener);
|
||||
|
||||
optTurbo = new gcn::RadioButton("Turbo", "radiocpuspeedgroup");
|
||||
optTurbo->setId("Turbo");
|
||||
optTurbo->addActionListener(cpuSpeedButtonActionListener);
|
||||
lblCpuIdle = new gcn::Label("CPU Idle");
|
||||
sldCpuIdle = new gcn::Slider(0, 10);
|
||||
sldCpuIdle->setSize(70, SLIDER_HEIGHT);
|
||||
sldCpuIdle->setBaseColor(gui_baseCol);
|
||||
sldCpuIdle->setMarkerLength(20);
|
||||
sldCpuIdle->setStepLength(1);
|
||||
sldCpuIdle->setId("sldCpuIdle");
|
||||
sldCpuIdle->addActionListener(cpuIdleActionListener);
|
||||
|
||||
grpCPUSpeed = new gcn::Window("CPU Speed");
|
||||
grpCPUSpeed->setPosition(grpFPU->getX() + grpFPU->getWidth() + DISTANCE_NEXT_X, DISTANCE_BORDER);
|
||||
grpCPUSpeed->add(opt7Mhz, 5, 10);
|
||||
grpCPUSpeed->add(opt14Mhz, 5, 40);
|
||||
grpCPUSpeed->add(opt28Mhz, 5, 70);
|
||||
grpCPUSpeed->add(opt25Mhz, 5, 70);
|
||||
grpCPUSpeed->add(optFastest, 5, 100);
|
||||
grpCPUSpeed->add(optTurbo, 5, 130);
|
||||
grpCPUSpeed->add(lblCpuIdle, 5, 170);
|
||||
grpCPUSpeed->add(sldCpuIdle, lblCpuIdle->getWidth() + 10, 170);
|
||||
grpCPUSpeed->setMovable(false);
|
||||
grpCPUSpeed->setSize(100, 200);
|
||||
grpCPUSpeed->setSize(180, 250);
|
||||
grpCPUSpeed->setTitleBarHeight(TITLEBAR_HEIGHT);
|
||||
grpCPUSpeed->setBaseColor(gui_baseCol);
|
||||
|
||||
|
@ -379,9 +402,12 @@ void ExitPanelCPU()
|
|||
|
||||
delete opt7Mhz;
|
||||
delete opt14Mhz;
|
||||
delete opt28Mhz;
|
||||
delete opt25Mhz;
|
||||
delete optFastest;
|
||||
delete optTurbo;
|
||||
delete lblCpuIdle;
|
||||
delete sldCpuIdle;
|
||||
delete cpuIdleActionListener;
|
||||
|
||||
delete grpCPUSpeed;
|
||||
delete cpuSpeedButtonActionListener;
|
||||
}
|
||||
|
@ -441,11 +467,11 @@ void RefreshPanelCPU()
|
|||
else if (changed_prefs.m68k_speed == M68K_SPEED_14MHZ_CYCLES)
|
||||
opt14Mhz->setSelected(true);
|
||||
else if (changed_prefs.m68k_speed == M68K_SPEED_25MHZ_CYCLES)
|
||||
opt28Mhz->setSelected(true);
|
||||
opt25Mhz->setSelected(true);
|
||||
else if (changed_prefs.m68k_speed == -1)
|
||||
optFastest->setSelected(true);
|
||||
else if (changed_prefs.m68k_speed == -30)
|
||||
optTurbo->setSelected(true);
|
||||
|
||||
sldCpuIdle->setValue(changed_prefs.cpu_idle == 0 ? 0 : 12 - changed_prefs.cpu_idle / 15);
|
||||
}
|
||||
|
||||
bool HelpPanelCPU(std::vector<std::string>& helptext)
|
||||
|
@ -463,9 +489,12 @@ bool HelpPanelCPU(std::vector<std::string>& helptext)
|
|||
helptext.emplace_back("The option \"More compatible\" activates more accurate rounding and compare of two floats.");
|
||||
helptext.emplace_back(" ");
|
||||
helptext.emplace_back("With \"CPU Speed\" you can choose the clock rate of the emulated Amiga.");
|
||||
helptext.emplace_back("Use 7MHz for A500 or 14MHz for A1200 speed. Fastest uses more emulation time");
|
||||
helptext.emplace_back("for the CPU, and Turbo will give only the minimum time to the Chipset, using as");
|
||||
helptext.emplace_back("much as possible for the CPU, usually resulting in dropping frames also.");
|
||||
helptext.emplace_back("Use 7MHz for A500 or 14MHz for A1200 speed. Fastest Possible will give only the minimum time");
|
||||
helptext.emplace_back("to the Chipset, using as much as possible for the CPU, which might result in dropping");
|
||||
helptext.emplace_back("frames also.");
|
||||
helptext.emplace_back(" ");
|
||||
helptext.emplace_back("You can use the CPU Idle slider to set how much the CPU emulation should sleep when idle.");
|
||||
helptext.emplace_back("This is useful to keep the system temperature down.");
|
||||
helptext.emplace_back(" ");
|
||||
helptext.emplace_back("In current version, you will not see a difference in the performance for 68020,");
|
||||
helptext.emplace_back("68030 and 68040 CPUs. The CPU cycles for the opcodes are based on 68020. The different");
|
||||
|
|
|
@ -56,46 +56,46 @@ public:
|
|||
{
|
||||
if (actionEvent.getSource() == sldChipmem)
|
||||
{
|
||||
changed_prefs.chipmem_size = ChipMem_values[int(sldChipmem->getValue())];
|
||||
changed_prefs.chipmem_size = ChipMem_values[static_cast<int>(sldChipmem->getValue())];
|
||||
if ((changed_prefs.chipmem_size > 0x200000) && (changed_prefs.fastmem[0].size > 0))
|
||||
changed_prefs.fastmem[0].size = 0;
|
||||
}
|
||||
|
||||
if (actionEvent.getSource() == sldSlowmem)
|
||||
{
|
||||
changed_prefs.bogomem_size = SlowMem_values[int(sldSlowmem->getValue())];
|
||||
changed_prefs.bogomem_size = SlowMem_values[static_cast<int>(sldSlowmem->getValue())];
|
||||
}
|
||||
|
||||
if (actionEvent.getSource() == sldFastmem)
|
||||
{
|
||||
changed_prefs.fastmem[0].size = FastMem_values[int(sldFastmem->getValue())];
|
||||
changed_prefs.fastmem[0].size = FastMem_values[static_cast<int>(sldFastmem->getValue())];
|
||||
if (changed_prefs.fastmem[0].size > 0 && changed_prefs.chipmem_size > 0x200000)
|
||||
changed_prefs.chipmem_size = 0x200000;
|
||||
}
|
||||
|
||||
if (actionEvent.getSource() == sldZ3mem)
|
||||
{
|
||||
changed_prefs.z3fastmem[0].size = FastMem_values[int(sldZ3mem->getValue())];
|
||||
changed_prefs.z3fastmem[0].size = FastMem_values[static_cast<int>(sldZ3mem->getValue())];
|
||||
if (changed_prefs.z3fastmem[0].size > max_z3fastmem)
|
||||
changed_prefs.z3fastmem[0].size = max_z3fastmem;
|
||||
}
|
||||
|
||||
if (actionEvent.getSource() == sldGfxmem)
|
||||
{
|
||||
changed_prefs.rtgboards[0].rtgmem_size = FastMem_values[int(sldGfxmem->getValue())];
|
||||
changed_prefs.rtgboards[0].rtgmem_size = FastMem_values[static_cast<int>(sldGfxmem->getValue())];
|
||||
changed_prefs.rtgboards[0].rtgmem_type = GFXBOARD_UAE_Z3;
|
||||
}
|
||||
|
||||
if (actionEvent.getSource() == sldA3000Lowmem)
|
||||
{
|
||||
changed_prefs.mbresmem_low_size = A3000LowMem_values[int(sldA3000Lowmem->getValue())];
|
||||
changed_prefs.mbresmem_low_size = A3000LowMem_values[static_cast<int>(sldA3000Lowmem->getValue())];
|
||||
if (currprefs.mbresmem_low_size != changed_prefs.mbresmem_low_size)
|
||||
DisableResume();
|
||||
}
|
||||
|
||||
if (actionEvent.getSource() == sldA3000Highmem)
|
||||
{
|
||||
changed_prefs.mbresmem_high_size = A3000HighMem_values[int(sldA3000Highmem->getValue())];
|
||||
changed_prefs.mbresmem_high_size = A3000HighMem_values[static_cast<int>(sldA3000Highmem->getValue())];
|
||||
if (currprefs.mbresmem_high_size != changed_prefs.mbresmem_high_size)
|
||||
DisableResume();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue