Skip to content

Commit

Permalink
Merge remote-tracking branch 'tonioni/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
midwan committed Feb 16, 2025
2 parents 29e0152 + 922c92d commit 767dc80
Show file tree
Hide file tree
Showing 10 changed files with 134 additions and 66 deletions.
46 changes: 36 additions & 10 deletions cfgfile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1296,7 +1296,9 @@ static void write_filesys_config (struct uae_prefs *p, struct zfile *f)
if (ci->type == UAEDEV_DIR) {
_stprintf (tmp, _T("%s,%s:%s:%s,%d"), ci->readonly ? _T("ro") : _T("rw"),
ci->devname ? ci->devname : _T(""), ci->volname, str1c, bp);
cfgfile_write_str (f, _T("filesystem2"), tmp);
if (p->got_fs2_hdf2 >= 0) {
cfgfile_write_str (f, _T("filesystem2"), tmp);
}
_tcscpy (tmp3, tmp);
#if 0
_stprintf (tmp2, _T("filesystem=%s,%s:%s"), uci->readonly ? _T("ro") : _T("rw"),
Expand Down Expand Up @@ -1377,8 +1379,9 @@ static void write_filesys_config (struct uae_prefs *p, struct zfile *f)
_tcscat(tmp3, _T(",identity"));
}

if (ci->type == UAEDEV_HDF)
if (ci->type == UAEDEV_HDF && p->got_fs2_hdf2 >= 0) {
cfgfile_write_str (f, _T("hardfile2"), tmp);
}
#if 0
_stprintf (tmp2, _T("hardfile=%s,%d,%d,%d,%d,%s"),
uci->readonly ? "ro" : "rw", uci->sectors,
Expand Down Expand Up @@ -5316,7 +5319,7 @@ static int cfgfile_parse_newfilesys (struct uae_prefs *p, int nr, int type, TCHA
_tcscpy (uci.devname, devname);
if (! getintval (&tmpp, &uci.bootpri, 0))
goto empty_fs;
} else if (type == 1 || ((type == 2 || type == 3) && uaehfentry)) {
} else if (type == 1 || ((type == 2 || type == 3 || type == 4) && uaehfentry)) {
tmpp = _tcschr (value, ':');
if (tmpp == 0)
goto invalid_fs;
Expand All @@ -5340,6 +5343,16 @@ static int cfgfile_parse_newfilesys (struct uae_prefs *p, int nr, int type, TCHA
*tmpp++ = 0;
_tcscpy (uci.rootdir, tmpp2);
}
if (type == 4) {
const TCHAR *tmppr = tmpp;
const TCHAR *tmppr2 = tmpp;
TCHAR *root2 = getnextentry(&tmppr, ',');
if (root2) {
_tcscat(uci.rootdir, root2);
xfree(root2);
}
tmpp += tmppr - tmppr2;
}
if (uci.rootdir[0] != ':')
get_hd_geometry (&uci);
_tcscpy (uci.devname, devname);
Expand Down Expand Up @@ -5474,6 +5487,9 @@ static int cfgfile_parse_filesys (struct uae_prefs *p, const TCHAR *option, TCHA
TCHAR tmp[100];
_stprintf (tmp, _T("uaehf%d"), i);
if (!_tcscmp (option, tmp)) {
if (!p->got_fs2_hdf2) {
p->got_fs2_hdf2 = -1;
}
for (;;) {
int type = -1;
int unit = -1;
Expand All @@ -5482,9 +5498,12 @@ static int cfgfile_parse_filesys (struct uae_prefs *p, const TCHAR *option, TCHA
return 1;
*tmpp++ = 0;
if (_tcsicmp (value, _T("hdf")) == 0) {
type = 1;
cfgfile_parse_partial_newfilesys (p, -1, type, tmpp, unit, true);
return 1;
if (p->got_fs2_hdf2 > 0) {
type = 1;
cfgfile_parse_partial_newfilesys (p, -1, type, tmpp, unit, true);
return 1;
}
type = 4;
} else if (_tcsnicmp (value, _T("cd"), 2) == 0 && (value[2] == 0 || value[3] == 0)) {
unit = 0;
if (value[2] > 0)
Expand All @@ -5499,9 +5518,11 @@ static int cfgfile_parse_filesys (struct uae_prefs *p, const TCHAR *option, TCHA
if (unit >= 0 && unit <= MAX_TOTAL_SCSI_DEVICES) {
type = 3;
}
} else if (_tcsicmp (value, _T("dir")) != 0) {
} else if (_tcsicmp (value, _T("dir")) == 0) {
if (p->got_fs2_hdf2 > 0) {
return 1;
}
type = 0;
return 1; /* ignore for now */
}
if (type >= 0)
cfgfile_parse_newfilesys (p, -1, type, tmpp, unit, true);
Expand Down Expand Up @@ -5594,10 +5615,14 @@ static int cfgfile_parse_filesys (struct uae_prefs *p, const TCHAR *option, TCHA

}

if (_tcscmp (option, _T("filesystem2")) == 0)
if (_tcscmp (option, _T("filesystem2")) == 0) {
p->got_fs2_hdf2 = 1;
return cfgfile_parse_newfilesys (p, -1, 0, value, -1, false);
if (_tcscmp (option, _T("hardfile2")) == 0)
}
if (_tcscmp (option, _T("hardfile2")) == 0) {
p->got_fs2_hdf2 = 1;
return cfgfile_parse_newfilesys (p, -1, 1, value, -1, false);
}
if (_tcscmp (option, _T("filesystem_extra")) == 0) {
int idx = 0;
TCHAR *s = value;
Expand Down Expand Up @@ -8412,6 +8437,7 @@ void default_prefs (struct uae_prefs *p, bool reset, int type)
p->gfx_scandoubler = false;
p->start_gui = true;
p->start_debugger = false;
p->got_fs2_hdf2 = 0;

p->all_lines = 0;
/* Note to porters: please don't change any of these options! UAE is supposed
Expand Down
18 changes: 12 additions & 6 deletions custom.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ static struct rgabuf rga_pipe[RGA_SLOT_TOTAL + 1];
struct denise_rga rga_denise[DENISE_RGA_SLOT_TOTAL];
static struct linestate *current_line_state;
static struct linestate lines[MAX_SCANDOUBLED_LINES][2];
static int rga_denise_cycle, rga_denise_cycle_start, rga_denise_cycle_start_prev, rga_denise_cycle_count;
static int rga_denise_cycle, rga_denise_cycle_start, rga_denise_cycle_count;
static int rga_denise_cycle_line = 1;
static struct pipeline_reg preg;
static struct pipeline_func pfunc[MAX_PIPELINE_REG];
Expand Down Expand Up @@ -2263,7 +2263,7 @@ static int GETHPOS(void)
if (islightpentriggered()) {
return hpos_lpen;
}
if (!eventtab[ev_sync].active) {
if (!eventtab[ev_sync].active || syncs_stopped) {
return agnus_hpos;
}
evt_t c = get_cycles();
Expand Down Expand Up @@ -10177,7 +10177,6 @@ static int wclks_prev;

static void next_denise_rga(void)
{
rga_denise_cycle_start_prev = rga_denise_cycle_start;
rga_denise_cycle_start = rga_denise_cycle;
rga_denise_cycle_count = 0;
rga_denise[(rga_denise_cycle - 1) & DENISE_RGA_SLOT_MASK].line++;
Expand Down Expand Up @@ -10206,6 +10205,7 @@ static void decide_line_end(void)
static int getlinetype(void)
{
int type;

if (agnus_vb_active) {
type = LINETYPE_BLANK;
} else if (vdiwstate == diw_states::DIW_waiting_start || GET_PLANES(bplcon0) == 0 || !dmaen(DMA_BITPLANE)) {
Expand Down Expand Up @@ -10431,7 +10431,7 @@ static void draw_line(void)
int cslen = 10;
draw_denise_line(dvp, nextline_how, rga_denise_cycle_line, rga_denise_cycle_start, rga_denise_cycle_count,
display_hstart_cyclewait_skip, display_hstart_cyclewait_skip2,
wclks, cs, cslen);
wclks, cs, cslen, lol);
}

static void dmal_fast(void)
Expand Down Expand Up @@ -10607,10 +10607,12 @@ static void quick_denise_rga(void)
for (int i = 0; i < rga_denise_cycle_count; i++) {
int off = i + rga_denise_cycle_start;
struct denise_rga *rd = &rga_denise[off & DENISE_RGA_SLOT_MASK];
if (rd->line == rga_denise_cycle_line && rd->rga != 0x1fe) {
if (rd->line == rga_denise_cycle_line && rd->rga != 0x1fe && (rd->rga < 0x38 || rd->rga >= 0x40)) {
denise_update_reg(rd->rga, rd->v);
}
}
uae_u16 strobe = get_strobe_reg(0);
denise_handle_quick_strobe(strobe, display_hstart_fastmode);
}

static void do_draw_line(void)
Expand Down Expand Up @@ -10683,6 +10685,7 @@ static int can_fast_custom(void)
}
compute_spcflag_copper();
if (copper_enabled_thisline) {

#if 0
// if copper is waiting, wake up is inside blank/border and
// it is followed by only writes to color registers:
Expand Down Expand Up @@ -11958,7 +11961,7 @@ static void fast_strobe(void)
if (prev_strobe == 0x3c && str != 0x3c) {
INTREQ_INT(5, 0);
}
denise_handle_quick_strobe(str);
denise_handle_quick_strobe(str, display_hstart_fastmode);
prev_strobe = str;
}

Expand Down Expand Up @@ -12015,6 +12018,9 @@ static void sync_equalline_handler(void)

custom_trigger_start();

int dvp = calculate_linetype(linear_display_vpos);
denise_set_line(dvp);

if (eventtab[ev_sync].active) {
check_extra();
do_imm_dmal();
Expand Down
1 change: 1 addition & 0 deletions debug.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7731,6 +7731,7 @@ void debug (void)
uae_ppc_pause(0);
#endif
setmouseactive(0, wasactive ? 2 : 0);
target_inputdevice_acquire();

last_cycles1 = get_cycles();
last_vpos1 = vpos;
Expand Down
Loading

0 comments on commit 767dc80

Please sign in to comment.