Skip to content

Commit

Permalink
fix identation
Browse files Browse the repository at this point in the history
  • Loading branch information
midwan committed Nov 11, 2023
1 parent 37b5520 commit bc90bd9
Show file tree
Hide file tree
Showing 13 changed files with 156 additions and 153 deletions.
4 changes: 2 additions & 2 deletions src/audio.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -656,7 +656,7 @@ static void samplexx_sinc_handler (int *datasp, int ch_start, int ch_num)
else if (v < -32768)
v = -32768;
datasp[k] = v;
}
}
}

static void do_filter(int *data, int num)
Expand Down Expand Up @@ -1599,7 +1599,7 @@ static void loaddat (int nr, bool modper)
return;
if (modper && audap) {
if (cdp->dat == 0)
cdp[1].per = 65536 * CYCLE_UNIT;
cdp[1].per = 65536 * CYCLE_UNIT;
else if (cdp->dat > PERIOD_MIN)
cdp[1].per = cdp->dat * CYCLE_UNIT;
else
Expand Down
2 changes: 1 addition & 1 deletion src/calc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ struct calcstack
{
TCHAR *s;
double val;
TCHAR *vals;
TCHAR *vals;
};

static double stacktoval(struct calcstack *st)
Expand Down
72 changes: 36 additions & 36 deletions src/cfgfile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -396,24 +396,24 @@ static TCHAR *cfgfile_unescape(const TCHAR *s, const TCHAR **endpos, TCHAR separ
c = s[i + 1];
switch (c)
{
case 'X':
case 'x':
c2 = _totupper(s[i + 2]);
v = ((c2 >= 'A') ? c2 - 'A' : c2 - '0') << 4;
c2 = _totupper(s[i + 3]);
v |= (c2 >= 'A') ? c2 - 'A' : c2 - '0';
*p++ = c2;
i += 2;
break;
case 'r':
*p++ = '\r';
break;
case 'n':
*p++ = '\n';
break;
default:
*p++ = c;
break;
case 'X':
case 'x':
c2 = _totupper(s[i + 2]);
v = ((c2 >= 'A') ? c2 - 'A' : c2 - '0') << 4;
c2 = _totupper(s[i + 3]);
v |= (c2 >= 'A') ? c2 - 'A' : c2 - '0';
*p++ = c2;
i += 2;
break;
case 'r':
*p++ = '\r';
break;
case '\n':
*p++ = '\n';
break;
default:
*p++ = c;
break;
}
i++;
} else {
Expand Down Expand Up @@ -2726,9 +2726,9 @@ void cfgfile_save_options (struct zfile *f, struct uae_prefs *p, int type)
cfgfile_dwrite_strarr(f, _T("agnusmodel"), agnusmodel, p->cs_agnusmodel);
cfgfile_dwrite_strarr(f, _T("agnussize"), agnussize, p->cs_agnussize);
cfgfile_dwrite_strarr(f, _T("denisemodel"), denisemodel, p->cs_denisemodel);
if (p->seed) {
cfgfile_write(f, _T("rndseed"), _T("%d"), p->seed);
}
if (p->seed) {
cfgfile_write(f, _T("rndseed"), _T("%d"), p->seed);
}

if (is_board_enabled(p, ROMTYPE_CD32CART, 0)) {
cfgfile_dwrite_bool(f, _T("cd32fmv"), true);
Expand Down Expand Up @@ -6020,8 +6020,8 @@ static int cfgfile_parse_hardware (struct uae_prefs *p, const TCHAR *option, TCH
|| cfgfile_intval(option, value, _T("genlock_mix"), &p->genlock_mix, 1)
|| cfgfile_intval(option, value, _T("keyboard_handshake"), &p->cs_kbhandshake, 1)
|| cfgfile_intval(option, value, _T("eclockphase"), &p->cs_eclockphase, 1)
|| cfgfile_intval(option, value, _T("chipset_rtc_adjust"), &p->cs_rtc_adjust, 1)
|| cfgfile_intval(option, value, _T("rndseed"), &p->seed, 1))
|| cfgfile_intval(option, value, _T("chipset_rtc_adjust"), &p->cs_rtc_adjust, 1)
|| cfgfile_intval(option, value, _T("rndseed"), &p->seed, 1))
return 1;

if (cfgfile_strval(option, value, _T("comp_trustbyte"), &p->comptrustbyte, compmode, 0)
Expand Down Expand Up @@ -7154,20 +7154,20 @@ static int cfgfile_load_2 (struct uae_prefs *p, const TCHAR *filename, bool real
if (s) {
s++;
if (s[0] == '"') {
const TCHAR *end;
TCHAR *n = cfgfile_unescape(s, &end, 0, true);
_tcscpy(tmp, n);
s = tmp;
xfree(n);
} else {
const TCHAR *se = _tcschr(s, ',');
if (se) {
tmp[se - tmp] = 0;
}
const TCHAR *end;
TCHAR *n = cfgfile_unescape(s, &end, 0, true);
_tcscpy(tmp, n);
s = tmp;
xfree(n);
} else {
const TCHAR *se = _tcschr(s, ',');
if (se) {
tmp[se - tmp] = 0;
}
}
_tcscpy(p->mountconfig[0].ci.rootdir, s);
cfgfile_resolve_path_load(p->mountconfig[0].ci.rootdir, MAX_DPATH, isvsys ? PATH_DIR : PATH_HDF);
p->mountitems = 1;
_tcscpy(p->mountconfig[0].ci.rootdir, s);
cfgfile_resolve_path_load(p->mountconfig[0].ci.rootdir, MAX_DPATH, isvsys ? PATH_DIR : PATH_HDF);
p->mountitems = 1;
}
}
}
Expand Down
24 changes: 12 additions & 12 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -369,17 +369,17 @@ void fixup_cpu (struct uae_prefs *p)
error_log(_T("Data cache emulation requires Indirect UAE Boot ROM."));
}

// pre-4.4.0 didn't support cpu multiplier in prefetch mode without cycle-exact
// set pre-4.4.0 defaults first
if (!p->cpu_cycle_exact && p->cpu_compatible && !p->cpu_clock_multiplier && p->config_version) {
if (p->cpu_model < 68020) {
p->cpu_clock_multiplier = 2 * 256;
} else if (p->cpu_model == 68020) {
p->cpu_clock_multiplier = 4 * 256;
} else {
p->cpu_clock_multiplier = 8 * 256;
}
}
// pre-4.4.0 didn't support cpu multiplier in prefetch mode without cycle-exact
// set pre-4.4.0 defaults first
if (!p->cpu_cycle_exact && p->cpu_compatible && !p->cpu_clock_multiplier && p->config_version) {
if (p->cpu_model < 68020) {
p->cpu_clock_multiplier = 2 * 256;
} else if (p->cpu_model == 68020) {
p->cpu_clock_multiplier = 4 * 256;
} else {
p->cpu_clock_multiplier = 8 * 256;
}
}

}

Expand Down Expand Up @@ -1077,7 +1077,7 @@ static void parse_cmdline_and_init_file(int argc, TCHAR **argv)

parse_cmdline(argc, argv);

fixup_prefs(&currprefs, false);
fixup_prefs(&currprefs, false);
}

/* Okay, this stuff looks strange, but it is here to encourage people who
Expand Down
6 changes: 3 additions & 3 deletions src/osdep/amiberry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2046,11 +2046,11 @@ void target_default_options(struct uae_prefs* p, int type)
p->whdbootprefs.quit_on_exit = amiberry_options.default_whd_quit_on_exit;

// Disable Cycle-Exact modes that are not yet implemented
if (changed_prefs.cpu_cycle_exact || changed_prefs.cpu_memory_cycle_exact)
if (p->cpu_cycle_exact || p->cpu_memory_cycle_exact)
{
if (changed_prefs.cpu_model > 68010)
if (p->cpu_model > 68010)
{
changed_prefs.cpu_cycle_exact = changed_prefs.cpu_memory_cycle_exact = false;
p->cpu_cycle_exact = p->cpu_memory_cycle_exact = false;
}
}

Expand Down
3 changes: 3 additions & 0 deletions src/osdep/amiberry_gfx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -871,7 +871,10 @@ static void open_screen(struct uae_prefs* p)
}
#endif
if (isfullscreen() == 0 && !is_maximized)
{
SDL_SetWindowSize(mon->sdl_window, width, height);
SDL_SetWindowPosition(mon->sdl_window, SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED);
}
}

if (p->scaling_method == -1)
Expand Down
14 changes: 7 additions & 7 deletions src/osdep/amiberry_gui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -922,20 +922,20 @@ void hardfile_testrdb (struct hfdlg_vals* hdf)
{
uae_u8 id[512];
struct hardfiledata hfd{};
uae_u32 error = 0;
uae_u32 error = 0;

memset(id, 0, sizeof id);
memset(&hfd, 0, sizeof hfd);
hfd.ci.readonly = true;
hfd.ci.blocksize = 512;
if (hdf_open(&hfd, hdf->ci.rootdir) > 0) {
for (auto i = 0; i < 16; i++) {
hdf_read_rdb (&hfd, id, i * 512, 512, &error);
if (!error && i == 0 && !memcmp (id + 2, "CIS", 3)) {
hdf->ci.controller_type = HD_CONTROLLER_TYPE_CUSTOM_FIRST;
hdf->ci.controller_type_unit = 0;
break;
}
hdf_read_rdb (&hfd, id, i * 512, 512, &error);
if (!error && i == 0 && !memcmp (id + 2, "CIS", 3)) {
hdf->ci.controller_type = HD_CONTROLLER_TYPE_CUSTOM_FIRST;
hdf->ci.controller_type_unit = 0;
break;
}
auto babe = id[0] == 0xBA && id[1] == 0xBE; // A2090
if (!error && (!memcmp(id, "RDSK\0\0\0", 7) || !memcmp(id, "CDSK\0\0\0", 7) || !memcmp(id, "DRKS\0\0", 6) ||
(id[0] == 0x53 && id[1] == 0x10 && id[2] == 0x9b && id[3] == 0x13 && id[4] == 0 && id[5] == 0) || babe)) {
Expand Down
Loading

0 comments on commit bc90bd9

Please sign in to comment.