static void sendrw (void)
{
setcode (AK_RESETWARNING);
+ ciaasdr = kbcode;
kblostsynccnt = 8 * maxvpos * 8; // 8 frames * 8 bits.
ciaaicr |= 8;
RethinkICRA ();
val &= 0x7f; /* bit 7 is unused */
if ((val & 1) && !(ciaacra & 1))
ciaastarta = CIASTARTCYCLESCRA;
- if ((val & 0x40) != (ciaacra & 0x40)) {
+ if ((val & 0x40) == 0 && (ciaacra & 0x40) != 0) {
/* todo: check if low to high or high to low only */
kblostsynccnt = 0;
#if KB_DEBUG
- write_log (_T("KB_ACK %02x->%02x\n"), val, ciaacra);
+ write_log (_T("KB_ACK %02x->%02x\n"), ciaacra, val);
#endif
}
ciaacra = val;
static int lof_changed = 0, lof_changing = 0, interlace_changed = 0;
static int scandoubled_line;
static bool vsync_rendered, frame_shown;
+static int vsynctimeperline;
static int jitcount = 0;
+static int frameskiptime;
#define LOF_TOGGLES_NEEDED 4
#define NLACE_CNT_NEEDED 50
/* This can happen when program program crashes very badly */
if (next_color_entry >= COLOR_TABLE_SIZE)
return;
- if (remembered_color_entry == -1) {
+ if (remembered_color_entry < 0) {
/* The colors changed since we last recorded a color map. Record a
* new one. */
color_reg_cpy (curr_color_tables + next_color_entry, ¤t_colors);
remembered_color_entry = next_color_entry++;
}
thisline_decision.ctable = remembered_color_entry;
- if (color_src_match == -1 || color_dest_match != remembered_color_entry
+ if (color_src_match < 0 || color_dest_match != remembered_color_entry
|| line_decisions[next_lineno].ctable != color_src_match)
{
/* The remembered comparison didn't help us - need to compare again. */
int oldctable = line_decisions[next_lineno].ctable;
int changed = 0;
- if (oldctable == -1) {
+ if (oldctable < 0) {
changed = 1;
color_src_match = color_dest_match = -1;
} else {
lhdiw = 512;
if (lhdiw >= diw_hstrt && last_hdiw < diw_hstrt && hdiwstate == DIW_waiting_start) {
- if (thisline_decision.diwfirstword == -1)
+ if (thisline_decision.diwfirstword < 0)
thisline_decision.diwfirstword = diwfirstword < 0 ? 0 : diwfirstword;
hdiwstate = DIW_waiting_stop;
}
if (lhdiw >= diw_hstop && last_hdiw < diw_hstop && hdiwstate == DIW_waiting_stop) {
- if (thisline_decision.diwlastword == -1)
+ if (thisline_decision.diwlastword < 0)
thisline_decision.diwlastword = diwlastword < 0 ? 0 : diwlastword;
hdiwstate = DIW_waiting_start;
}
static void finish_playfield_line (void)
{
/* The latter condition might be able to happen in interlaced frames. */
- if (vpos >= minfirstline && (thisframe_first_drawn_line == -1 || vpos < thisframe_first_drawn_line))
+ if (vpos >= minfirstline && (thisframe_first_drawn_line < 0 || vpos < thisframe_first_drawn_line))
thisframe_first_drawn_line = vpos;
thisframe_last_drawn_line = vpos;
STATIC_INLINE void maybe_first_bpl1dat (int hpos)
{
- if (thisline_decision.plfleft != -1) {
+ if (thisline_decision.plfleft >= 0) {
// early bpl1dat crap fix (Sequential engine animation)
- if (plfleft_real == -1) {
+ if (plfleft_real < 0) {
int i;
for (i = 0; i < thisline_decision.nr_planes; i++) {
todisplay[i][0] = 0;
STATIC_INLINE void flush_display (int fm)
{
- if (toscr_nbits > 0 && thisline_decision.plfleft != -1)
+ if (toscr_nbits > 0 && thisline_decision.plfleft >= 0)
toscr (toscr_nbits, fm);
toscr_nbits = 0;
}
/* make sure fetch that goes beyond maxhpos is finished */
static void finish_final_fetch (int pos, int fm)
{
- if (thisline_decision.plfleft == -1)
+ if (thisline_decision.plfleft < 0)
return;
if (plf_state == plf_end)
return;
if (count >= fetchstart) {
count &= ~fetchstart_mask;
- if (thisline_decision.plfleft == -1) {
+ if (thisline_decision.plfleft < 0) {
compute_delay_offset ();
compute_toscr_delay_1 (bplcon1);
}
/* If someone already wrote BPL1DAT, clear the area between that point and
the real fetch start. */
if (!nodraw ()) {
- if (thisline_decision.plfleft != -1) {
+ if (thisline_decision.plfleft >= 0) {
out_nbits = (plfstrt - thisline_decision.plfleft) << (1 + toscr_res);
out_offs = out_nbits >> 5;
out_nbits &= 31;
decide_diw (hpos);
decide_line (hpos);
- if (thisline_decision.ctable == -1)
+ if (thisline_decision.ctable < 0)
remember_ctable ();
if ((regno < 0x1000 || regno == 0x1000 + 0x10c) && hpos < HBLANK_OFFSET && !(beamcon0 & 0x80) && prev_lineno >= 0) {
int sscanmask = 0x100 << sprite_buffer_res;
int gotdata = 0;
- if (thisline_decision.plfleft == -1 && !(bplcon3 & 2))
+ if (thisline_decision.plfleft < 0 && !(bplcon3 & 2))
return;
if (nodraw () || hpos < 0x14 || nr_armed == 0 || point == last_sprite_point)
decide_fetch (hpos);
record_color_change2 (hsyncstartpos, 0xffff, 0);
- if (thisline_decision.plfleft != -1 && thisline_decision.plflinelen == -1) {
+ if (thisline_decision.plfleft >= 0 && thisline_decision.plflinelen < 0) {
if (fetch_state != fetch_not_started) {
write_log (_T("fetch_state=%d plfleft=%d,len=%d,vpos=%d,hpos=%d\n"),
fetch_state, thisline_decision.plfleft, thisline_decision.plflinelen,
* there's a more-or-less full-screen DIW. */
if (hdiwstate == DIW_waiting_stop) {
thisline_decision.diwlastword = max_diwlastword;
- if (thisline_decision.diwfirstword == -1)
+ if (thisline_decision.diwfirstword < 0)
thisline_decision.diwfirstword = 0;
}
dip_old = prev_drawinfo + next_lineno;
dp = line_decisions + next_lineno;
changed = thisline_changed;
- if (thisline_decision.plfleft != -1 && thisline_decision.nr_planes > 0)
+ if (thisline_decision.plfleft >= 0 && thisline_decision.nr_planes > 0)
record_diw_line (thisline_decision.plfleft, diwfirstword, diwlastword);
decide_sprites (hpos + 1);
dip->last_sprite_entry = next_sprite_entry;
dip->last_color_change = next_color_change;
- if (thisline_decision.ctable == -1) {
- if (thisline_decision.plfleft == -1)
+ if (thisline_decision.ctable < 0) {
+ if (thisline_decision.plfleft < 0)
remember_ctable_for_border ();
else
remember_ctable ();
if (! changed && color_changes_differ (dip, dip_old))
changed = 1;
if (!changed && /* bitplane visible in this line OR border sprites enabled */
- (thisline_decision.plfleft != -1 || ((thisline_decision.bplcon0 & 1) && (thisline_decision.bplcon3 & 0x02) && !(thisline_decision.bplcon3 & 0x20)))
+ (thisline_decision.plfleft >= 0 || ((thisline_decision.bplcon0 & 1) && (thisline_decision.bplcon3 & 0x02) && !(thisline_decision.bplcon3 & 0x20)))
&& sprites_differ (dip, dip_old))
{
changed = 1;
}
stored_chipset_refresh = cr;
interlace_changed = 0;
+ gfxvidinfo.drawbuffer.inxoffset = -1;
+ gfxvidinfo.drawbuffer.inyoffset = -1;
if (beamcon0 & 0x80) {
int res = GET_RES_AGNUS (bplcon0);
int start = hbstrt;
int stop = hbstop;
- gfxvidinfo.drawbuffer.inwidth = (((start > stop ? (maxhpos - (maxhpos - start + stop)) : (maxhpos - (stop - start))) * 2) << res2);
+ gfxvidinfo.drawbuffer.inwidth = (((start > stop ? (maxhpos - (maxhpos - start + stop)) : (maxhpos - (stop - start) + 2)) * 2) << res2);
+ gfxvidinfo.drawbuffer.inxoffset = ((stop + 1) & ~1) * 2;
+
gfxvidinfo.drawbuffer.extrawidth = 0;
gfxvidinfo.drawbuffer.inwidth2 = gfxvidinfo.drawbuffer.inwidth;
reset_drawing ();
}
+ memset (line_decisions, 0, sizeof line_decisions);
+
compute_vsynctime ();
write_log (_T("%s mode%s%s V=%.4fHz H=%0.4fHz (%dx%d+%d) IDX=%d (%s)\n"),
else
hsyncstartpos = maxhpos + hbstrt;
if (hbstop > maxhpos)
- hsyncendpos = hbstop;
+ hsyncendpos = maxhpos - hbstop;
else
- hsyncendpos = maxhpos + hbstop;
+ hsyncendpos = hbstop;
} else {
hsyncstartpos = maxhpos_short + 13;
hsyncendpos = 24;
/* display mode changed (lores, doubling etc..), recalculate everything */
void init_custom (void)
{
- update_mirrors();
+ update_mirrors ();
create_cycle_diagram_table ();
reset_drawing ();
init_hz ();
sprres = expand_sprres (v, bplcon3);
}
#endif
- if (thisline_decision.plfleft == -1)
+ if (thisline_decision.plfleft < 0)
update_denise (hpos);
}
bpldmainitdelay (hpos);
- if (thisline_decision.plfleft == -1)
+ if (thisline_decision.plfleft < 0)
BPLCON0_Denise (hpos, v);
}
bplxdat[num] = v;
if (num == 0) {
bpl1dat_written = 1;
- if (thisline_decision.plfleft == -1) {
+ if (thisline_decision.plfleft < 0) {
thisline_decision.plfleft = hpos;
compute_delay_offset ();
}
}
#endif
+static void checkautoscalecol0 (void)
+{
+ if (!copper_access)
+ return;
+ if (vpos < 20)
+ return;
+ // autoscale if copper changes COLOR00 on top or bottom of screen
+ if (vpos >= minfirstline) {
+ int vpos2 = autoscale_bordercolors ? minfirstline : vpos;
+ if (first_planes_vpos == 0)
+ first_planes_vpos = vpos2 - 2;
+ if (plffirstline_total == current_maxvpos ())
+ plffirstline_total = vpos2 - 2;
+ if (vpos2 > last_planes_vpos || vpos2 > plflastline_total)
+ plflastline_total = last_planes_vpos = vpos2 + 3;
+ autoscale_bordercolors = 0;
+ } else {
+ autoscale_bordercolors++;
+ }
+}
+
static void COLOR_WRITE (int hpos, uae_u16 v, int num)
{
bool colzero = false;
colzero = true;
if (cval == current_colors.color_regs_aga[colreg])
- goto end;
+ return;
+
+ if (colreg == 0)
+ checkautoscalecol0 ();
/* Call this with the old table still intact. */
record_color_change (hpos, colreg, cval);
if (num && v == 0)
colzero = true;
if (current_colors.color_regs_ecs[num] == v)
- goto end;
+ return;
+ if (num == 0)
+ checkautoscalecol0 ();
+
/* Call this with the old table still intact. */
record_color_change (hpos, num, v);
remembered_color_entry = -1;
#ifdef AGA
}
#endif
-end:
- if (copper_access && colzero && vpos >= 20) {
- // autoscale if copper changes COLOR00 on top or bottom of screen
- if (vpos >= minfirstline) {
- int vpos2 = autoscale_bordercolors ? minfirstline : vpos;
- if (first_planes_vpos == 0)
- first_planes_vpos = vpos2 - 2;
- if (plffirstline_total == current_maxvpos ())
- plffirstline_total = vpos2 - 2;
- if (vpos2 > last_planes_vpos || vpos2 > plflastline_total)
- plflastline_total = last_planes_vpos = vpos2 + 3;
- autoscale_bordercolors = 0;
- } else {
- autoscale_bordercolors++;
- }
- }
-
}
/* The copper code. The biggest nightmare in the whole emulator.
static int rpt_vsync (void)
{
- int v = read_processor_time () - vsyncwaittime;
+ frame_time_t curr_time = read_processor_time ();
+ int v = curr_time - vsyncwaittime;
if (v > (int)syncbase || v < -((int)syncbase)) {
- vsyncmintime = vsyncmaxtime = vsyncwaittime = read_processor_time ();
+ vsyncmintime = vsyncmaxtime = vsyncwaittime = curr_time;
v = 0;
}
return v;
}
+static void rtg_vsync (void)
+{
+ frame_time_t start, end;
+ start = read_processor_time ();
+ picasso_handle_vsync ();
+ end = read_processor_time ();
+ frameskiptime += end - start;
+}
+
static void rtg_vsynccheck (void)
{
if (vblank_found_rtg) {
vblank_found_rtg = false;
- picasso_handle_vsync ();
+ rtg_vsync ();
}
}
curr_time = read_processor_time ();
vsyncwaittime = vsyncmaxtime = curr_time + vsynctimebase;
+ vsynctimeperline = vsynctimebase / maxvpos_nom;
render_screen ();
show_screen ();
frame_shown = true;
if (vs == -2 || vs == -3) {
// fastest possible
+ int max;
curr_time = read_processor_time ();
vsync_busywait_end ();
vsync_busywait_do (NULL, (bplcon0 & 4) != 0 && !lof_changed && !lof_changing, lof_store != 0);
vsyncmintime = curr_time;
vsyncwaittime = curr_time + vsynctimebase;
- vsyncmaxtime = curr_time + vsynctimebase * (1000 + currprefs.m68k_speed_throttle) / 1000;
+ max = vsynctimebase * (1000 + currprefs.m68k_speed_throttle) / 1000;
+ max -= frameskiptime + maxvpos_nom / 10;
+ frameskiptime = 0;
+ if (max < 0) {
+ max = 0;
+ vsynctimeperline = 1;
+ } else {
+ vsynctimeperline = max / maxvpos_nom;
+ }
+ vsyncmaxtime = max + curr_time;
} else {
vsyncmintime = curr_time;
vsyncwaittime = curr_time + vsynctimebase;
vsyncmaxtime = curr_time + vsynctimebase;
+ vsynctimeperline = vsynctimebase / maxvpos_nom;
if (!show) {
show_screen ();
if (extraframewait)
if (currprefs.m68k_speed < 0) {
- for (;;) {
- double v = rpt_vsync () / (syncbase / 1000.0);
- if (v >= -4)
- break;
- rtg_vsynccheck ();
- sleep_millis_main (2);
+ if (currprefs.m68k_speed_throttle) {
+ // this delay can safely overshoot frame time by 1-2 ms, following code will compensate for it.
+ for (;;) {
+ curr_time = read_processor_time ();
+ if ((int)vsyncwaittime - (int)curr_time <= 0)
+ break;
+ rtg_vsynccheck ();
+ sleep_millis_main (1);
+ }
+ } else {
+ curr_time = read_processor_time ();
}
- while (rpt_vsync () < 0)
- rtg_vsynccheck ();
- curr_time = read_processor_time ();
+
+ int max;
if ((int)curr_time - (int)vsyncwaittime > 0 && (int)curr_time - (int)vsyncwaittime < vsynctimebase / 2) {
- int adjust = curr_time - vsyncmaxtime;
- vsyncmaxtime = curr_time + vsynctimebase * (1000 + currprefs.m68k_speed_throttle) / 1000 - adjust;
+ int adjust = curr_time - vsyncwaittime;
+ max = vsynctimebase * (1000 + currprefs.m68k_speed_throttle) / 1000 - adjust;
vsyncwaittime = curr_time + vsynctimebase - adjust;
} else {
- vsyncmaxtime = curr_time + vsynctimebase * (1000 + currprefs.m68k_speed_throttle) / 1000;
+ max = vsynctimebase * (1000 + currprefs.m68k_speed_throttle) / 1000;
vsyncwaittime = curr_time + vsynctimebase;
}
vsyncmintime = curr_time;
+ vsynctimeperline /= maxvpos_nom;
+
+ max -= frameskiptime + maxvpos_nom / 10;
+ frameskiptime = 0;
+ if (max < 0) {
+ max = 0;
+ vsynctimeperline = 1;
+ } else {
+ vsynctimeperline = max / maxvpos_nom;
+ }
+ vsyncmaxtime = max + curr_time;
} else {
curr_time = read_processor_time ();
vsyncmintime = curr_time;
vsyncmaxtime = vsyncwaittime = curr_time + vsynctimebase;
+ vsynctimeperline = vsynctimebase / maxvpos_nom;
if (didrender)
show_screen ();
frame_shown = true;
#ifdef PICASSO96
if (isvsync_rtg () >= 0)
- picasso_handle_vsync ();
+ rtg_vsync ();
#endif
audio_vsync ();
blkdev_vsync ();
#endif
if (!vsync_rendered) {
- vsync_handle_redraw (lof_store, lof_changed);
+ frame_time_t start, end;
+ start = read_processor_time ();
+ vsync_handle_redraw (lof_store, lof_changed, bplcon0, bplcon3);
vsync_rendered = true;
if (vblank_hz_state) {
render_screen ();
show_screen_maybe (isvsync_chipset () >= 0);
}
}
+ end = read_processor_time ();
+ frameskiptime += end - start;
}
if (vblank_hz_mult > 0)
if (!nocustom ()) {
sync_copper_with_cpu (maxhpos, 0);
finish_decisions ();
- if (thisline_decision.plfleft != -1) {
+ if (thisline_decision.plfleft >= 0) {
if (currprefs.collision_level > 1)
do_sprite_collisions ();
if (currprefs.collision_level > 2)
if (currprefs.m68k_speed < 0) {
if (vpos + 1 == maxvpos + lof_store) {
/* really last line, just run the cpu emulation until whole vsync time has been used */
- is_syncline = 1;
- if (currprefs.m68k_speed_throttle)
+ if (currprefs.m68k_speed_throttle) {
vsyncmintime = read_processor_time (); /* end of CPU emulation time */
- else
+ } else {
vsyncmintime = vsyncmaxtime; /* emulate if still time left */
+ is_syncline = 1;
+ }
} else {
/* end of scanline, run cpu emulation as long as we still have time */
- vsyncmintime += (vsynctimebase * (1000 + currprefs.m68k_speed_throttle)) / (maxvpos_nom * 1000);
- if (!vblank_found_chipset && (int)vsyncmaxtime - (int)vsyncmintime > 0) {
- is_syncline = -1;
- frame_time_t rpt = read_processor_time ();
- /* No extra time left? Skip it */
- if ((int)rpt - (int)vsyncmintime >= 0)
- is_syncline = 0;
+ vsyncmintime += vsynctimeperline;
+ is_syncline = 0;
+ if (!vblank_found_chipset) {
+ if ((int)vsyncmaxtime - (int)vsyncmintime >= 0) {
+ frame_time_t rpt = read_processor_time ();
+ /* Extra time left? Do some extra CPU emulation */
+ if ((int)vsyncmintime - (int)rpt >= vsynctimeperline) {
+ is_syncline = -1;
+ }
+ }
}
}
} else {
}
}
-
if (!nocustom ()) {
int lineno = vpos;
if (lineno >= MAXVPOS)
}
if (diw_change == 0) {
if (vpos >= first_planes_vpos && vpos <= last_planes_vpos) {
- if (diwlastword > diwlastword_total)
+ if (diwlastword > diwlastword_total) {
diwlastword_total = diwlastword;
+ if (diwlastword_total > coord_diw_to_window_x (hsyncstartpos * 2))
+ diwlastword_total = coord_diw_to_window_x (hsyncstartpos * 2);
+ }
if (diwfirstword < diwfirstword_total) {
diwfirstword_total = diwfirstword;
+ if (diwfirstword_total < coord_diw_to_window_x (hsyncendpos * 2))
+ diwfirstword_total = coord_diw_to_window_x (hsyncendpos * 2);
firstword_bplcon1 = bplcon1;
}
}
diw_change--;
if (is_syncline > 0 && isvsync_chipset () == -2 && !vsync_rendered && currprefs.gfx_apmode[0].gfx_vflip == 0) {
+ frame_time_t start, end;
+ start = read_processor_time ();
/* fastest possible + last line and no vflip wait: render the frame as early as possible */
vsync_rendered = true;
- vsync_handle_redraw (lof_store, lof_changed);
+ vsync_handle_redraw (lof_store, lof_changed, bplcon0, bplcon3);
if (vblank_hz_state) {
render_screen ();
show_screen_maybe (false);
}
frame_shown = true;
+ end = read_processor_time ();
+ frameskiptime += end - start;
}
rtg_vsynccheck ();
int hpos, hpos_old;
blitter_nasty = 1;
- if (cpu_tracer == -1)
+ if (cpu_tracer < 0)
return current_hpos ();
if (!currprefs.cpu_cycle_exact)
return current_hpos ();
#include "cpummu.h"
#include "rommgr.h"
#include "inputrecord.h"
+#include "calc.h"
int debugger_active;
static uaecptr skipaddr_start, skipaddr_end;
return 1;
}
+
+static bool isoperator(TCHAR **cp)
+{
+ TCHAR c = **cp;
+ return c == '+' || c == '-' || c == '/' || c == '*' || c == '(' || c == ')';
+}
+
static void ignore_ws (TCHAR **c)
{
while (**c && _istspace(**c))
(*c)++;
}
+static TCHAR peekchar (TCHAR **c)
+{
+ return **c;
+}
+static TCHAR readchar (TCHAR **c)
+{
+ TCHAR cc = **c;
+ (*c)++;
+ return cc;
+}
+static TCHAR next_char (TCHAR **c)
+{
+ ignore_ws (c);
+ return *(*c)++;
+}
+static TCHAR peek_next_char (TCHAR **c)
+{
+ TCHAR *pc = *c;
+ return pc[1];
+}
+static int more_params (TCHAR **c)
+{
+ ignore_ws (c);
+ return (**c) != 0;
+}
static uae_u32 readint (TCHAR **c);
static uae_u32 readbin (TCHAR **c);
}
-static int checkvaltype (TCHAR **c, uae_u32 *val)
+static int checkvaltype2 (TCHAR **c, uae_u32 *val, TCHAR def)
{
TCHAR nc;
if (readregx (c, val))
return 1;
}
+ if (def == '!') {
+ *val = readintx (c);
+ return -1;
+ } else if (def == '$') {
+ *val = readhexx (c);
+ return -1;
+ } else if (def == '%') {
+ *val = readbinx (c);
+ return -1;
+ }
return 0;
}
static int readsize (int val, TCHAR **c)
{
- if ((*c)[0] == '.') {
- (*c)++;
- TCHAR cc = _totupper ((*c)[0]);
- (*c)++;
- if (cc == 'B')
- return 1;
- if (cc == 'W')
- return 2;
- if (cc == '3')
- return 3;
- if (cc == 'L')
- return 4;
- }
- if (val > 255 || val < -127)
+ TCHAR cc = _totupper (readchar(c));
+ if (cc == 'B')
+ return 1;
+ if (cc == 'W')
return 2;
- if (val > 65535 || val < -32767)
+ if (cc == '3')
+ return 3;
+ if (cc == 'L')
return 4;
- return 1;
+ return 0;
}
-static uae_u32 readint (TCHAR **c)
+static int checkvaltype (TCHAR **cp, uae_u32 *val, int *size, TCHAR def)
{
- uae_u32 val;
- if (checkvaltype (c, &val))
- return val;
- return readintx (c);
+ TCHAR form[256], *p;
+ bool gotop = false;
+ double out;
+
+ form[0] = 0;
+ *size = 0;
+ p = form;
+ for (;;) {
+ uae_u32 v;
+ if (!checkvaltype2 (cp, &v, def))
+ return 0;
+ *val = v;
+ // stupid but works!
+ _stprintf(p, L"%u", v);
+ p += _tcslen (p);
+ if (peekchar (cp) == '.') {
+ readchar (cp);
+ *size = readsize (v, cp);
+ }
+ if (!isoperator (cp))
+ break;
+ gotop = true;
+ *p++= readchar (cp);
+ *p = 0;
+ }
+ if (!gotop) {
+ if (*size == 0) {
+ uae_s32 v = (uae_s32)(*val);
+ if (v > 255 || v < -127) {
+ *size = 2;
+ } else if (v > 65535 || v < -32767) {
+ *size = 4;
+ } else {
+ *size = 1;
+ }
+ }
+ return 1;
+ }
+ if (calc (form, &out)) {
+ *val = (uae_u32)out;
+ if (*size == 0) {
+ uae_s32 v = (uae_s32)(*val);
+ if (v > 255 || v < -127) {
+ *size = 2;
+ } else if (v > 65535 || v < -32767) {
+ *size = 4;
+ } else {
+ *size = 1;
+ }
+ }
+ return 1;
+ }
+ return 0;
}
-static uae_u32 readhex (TCHAR **c)
+
+
+static uae_u32 readnum (TCHAR **c, int *size, TCHAR def)
{
uae_u32 val;
- if (checkvaltype (c, &val))
+ if (checkvaltype (c, &val, size, def))
return val;
- return readhexx (c);
+ return 0;
}
-static uae_u32 readint (TCHAR **c, int *size)
+
+static uae_u32 readint (TCHAR **c)
{
- uae_u32 val = readint (c);
- *size = readsize (val, c);
- return val;
+ int size;
+ return readnum (c, &size, '!');
}
-static uae_u32 readhex (TCHAR **c, int *size)
+static uae_u32 readhex (TCHAR **c)
{
- uae_u32 val = readhex (c);
- *size = readsize (val, c);
- return val;
+ int size;
+ return readnum (c, &size, '$');
}
static uae_u32 readbin (TCHAR **c)
{
- uae_u32 val;
- if (checkvaltype (c, &val))
- return val;
- return readbinx (c);
-}
-
-static TCHAR next_char (TCHAR **c)
-{
- ignore_ws (c);
- return *(*c)++;
+ int size;
+ return readnum (c, &size, '%');
}
-
-static TCHAR peek_next_char (TCHAR **c)
+static uae_u32 readint (TCHAR **c, int *size)
{
- TCHAR *pc = *c;
- return pc[1];
+ return readnum (c, size, '!');
}
-
-static int more_params (TCHAR **c)
+static uae_u32 readhex (TCHAR **c, int *size)
{
- ignore_ws (c);
- return (**c) != 0;
+ return readnum (c, size, '$');
}
static int next_string (TCHAR **c, TCHAR *out, int max, int forceupper)
int interlace_seen = 0;
#define AUTO_LORES_FRAMES 10
static int can_use_lores = 0, frame_res, frame_res_lace, last_max_ypos;
+static uae_u16 bplcon0_store, bplcon3_store;
/* Lookup tables for dual playfields. The dblpf_*1 versions are for the case
that playfield 1 has the priority, dbplpf_*2 are used if playfield 2 has
static int plf1pri, plf2pri, bplxor;
static uae_u32 plf_sprite_mask;
static int sbasecol[2] = { 16, 16 };
-static int brdsprt, brdblank, brdblank_changed, hposblank;
+static bool brdsprt, brdblank, brdblank_changed;
+static int hposblank;
bool picasso_requested_on;
bool picasso_on;
if (!plflastline_total)
plflastline_total = last_planes_vpos;
+ ddffirstword_total = coord_hw_to_window_x (ddffirstword_total * 2 + DIW_DDF_OFFSET);
+ ddflastword_total = coord_hw_to_window_x (ddflastword_total * 2 + DIW_DDF_OFFSET);
+
if (doublescan <= 0 && !programmedmode) {
int min = coord_diw_to_window_x (92);
int max = coord_diw_to_window_x (460);
diwfirstword_total = min;
if (diwlastword_total > max)
diwlastword_total = max;
- ddffirstword_total = coord_hw_to_window_x (ddffirstword_total * 2 + DIW_DDF_OFFSET);
- ddflastword_total = coord_hw_to_window_x (ddflastword_total * 2 + DIW_DDF_OFFSET);
if (ddffirstword_total < min)
ddffirstword_total = min;
if (ddflastword_total > max)
return xcolors[0x0f0];
else if (hposblank == 3)
return xcolors[0x00f];
+ else if (brdblank)
+ return xcolors[0x880];
#endif
return (brdblank || hposblank) ? 0 : colors_for_drawing.acolors[0];
}
* form. */
static void pfield_expand_dp_bplcon (void)
{
- int brdblank_2;
static int b2;
bplres = dp_for_drawing->bplres;
bpldualpf = (dp_for_drawing->bplcon0 & 0x400) == 0x400;
bpldualpfpri = (dp_for_drawing->bplcon2 & 0x40) == 0x40;
-#ifdef ECS_DENISE
- brdblank_2 = (currprefs.chipset_mask & CSMASK_ECS_DENISE) && (dp_for_drawing->bplcon0 & 1) && (dp_for_drawing->bplcon3 & 0x20);
- if (brdblank_2 != brdblank)
- brdblank_changed = 1;
- brdblank = brdblank_2;
-#endif
-
#ifdef AGA
bpldualpf2of = (dp_for_drawing->bplcon3 >> 10) & 7;
sbasecol[0] = ((dp_for_drawing->bplcon4 >> 4) & 15) << 4;
return 0;
}
+static void isbrdblank (void)
+{
+#ifdef ECS_DENISE
+ bool brdblank_2 = (currprefs.chipset_mask & CSMASK_ECS_DENISE) && (bplcon0_store & 1) && (bplcon3_store & 0x20);
+ if (brdblank_2 != brdblank)
+ brdblank_changed = true;
+ brdblank = brdblank_2;
+#endif
+}
+
static void pfield_expand_dp_bplconx (int regno, int v)
{
if (regno == 0xffff) {
dp_for_drawing->bplres = GET_RES_DENISE (v);
dp_for_drawing->nr_planes = GET_PLANES (v);
dp_for_drawing->ham_seen = isham (v);
+ bplcon0_store = v;
+ isbrdblank ();
break;
case 0x104:
dp_for_drawing->bplcon2 = v;
#ifdef ECS_DENISE
case 0x106:
dp_for_drawing->bplcon3 = v;
+ bplcon3_store = v;
+ isbrdblank ();
break;
#endif
#ifdef AGA
dp_for_drawing--;
dip_for_drawing--;
linestate[lineno] = LINE_DONE_AS_PREVIOUS;
- if (dp_for_drawing->plfleft == -1)
+ if (dp_for_drawing->plfleft < 0)
border = 1;
break;
return;
case LINE_DECIDED_DOUBLE:
- if (follow_ypos != -1) {
+ if (follow_ypos >= 0) {
do_double = 1;
linestate[lineno + 1] = LINE_DONE_AS_PREVIOUS;
}
/* fall through */
default:
- if (dp_for_drawing->plfleft == -1)
+ if (dp_for_drawing->plfleft < 0)
border = 1;
linestate[lineno] = LINE_DONE;
break;
visible_left_border = max_diwlastword - w;
//visible_left_border += gfxvidinfo.drawbuffer.extrawidth << currprefs.gfx_resolution;
} else {
- visible_left_border = 0;
+ if (gfxvidinfo.drawbuffer.inxoffset < 0) {
+ visible_left_border = 0;
+ } else {
+ visible_left_border = gfxvidinfo.drawbuffer.inxoffset - DISPLAY_LEFT_SHIFT;
+ }
}
visible_right_border = max_diwlastword;
thisframe_y_adjust = minfirstline;
- if (currprefs.gfx_ycenter && thisframe_first_drawn_line != -1 && !currprefs.gfx_filter_autoscale) {
+ if (currprefs.gfx_ycenter && thisframe_first_drawn_line >= 0 && !currprefs.gfx_filter_autoscale) {
if (thisframe_last_drawn_line - thisframe_first_drawn_line < max_drawn_amiga_line && currprefs.gfx_ycenter == 2)
thisframe_y_adjust = (thisframe_last_drawn_line - thisframe_first_drawn_line - max_drawn_amiga_line) / 2 + thisframe_first_drawn_line;
init_hardware_for_drawing_frame ();
- if (thisframe_first_drawn_line == -1)
+ if (thisframe_first_drawn_line < 0)
thisframe_first_drawn_line = minfirstline;
if (thisframe_first_drawn_line > thisframe_last_drawn_line)
thisframe_last_drawn_line = thisframe_first_drawn_line;
for (i = 0; i < sizeof linestate / sizeof *linestate; i++)
linestate[i] = LINE_UNDECIDED;
notice_screen_contents_lost ();
- brdblank_changed = 0;
+ brdblank_changed = false;
}
#endif
}
i = lineno - thisframe_y_adjust_real;
if (i >= 0 && i < max_ypos_thisframe) {
where = amiga2aspect_line_map[i+min_ypos_for_screen];
- if (where < gfxvidinfo.drawbuffer.outheight && where != -1)
+ if (where < gfxvidinfo.drawbuffer.outheight && where >= 0)
pfield_draw_line (lineno, where, amiga2aspect_line_map[i+min_ypos_for_screen+1]);
}
}
check_prefs_changed_cpu ();
}
-void vsync_handle_redraw (int long_frame, int lof_changed)
+void vsync_handle_redraw (int long_frame, int lof_changed, uae_u16 bplcon0p, uae_u16 bplcon3p)
{
last_redraw_point++;
if (lof_changed || interlace_seen <= 0 || last_redraw_point >= 2 || long_frame || doublescan < 0) {
if (isvsync_chipset ())
flush_screen (gfxvidinfo.inbuffer, 0, 0); /* vsync mode */
}
+
+ /* check borderblank here because bplcon0 or especially bplcon3 may only be written once outside of displayable area */
+ bplcon0_store = bplcon0p;
+ bplcon3_store = bplcon3p;
+ isbrdblank ();
+
gui_flicker_led (-1, 0, 0);
#ifdef AVIOUTPUT
frame_drawn ();
int pngprint = 0;
#ifdef C_LIBPNG
+#include <zlib.h>
#include <png.h>
#endif
uae_u64 uniq;
ui->cdfs_superblock = u->ui.cdfs_superblock = isofs_mount (ui->cddevno, &uniq);
u->rootnode.uniq_external = uniq;
- if (!u->ui.cdfs_superblock) {
- u->ui.unknown_media = true;
+ u->ui.unknown_media = true;
+ if (!u->ui.cdfs_superblock)
return 0;
- }
struct isofs_info ii;
set_highcyl (ui, 0);
- if (isofs_mediainfo (ui->cdfs_superblock, &ii) && ii.media) {
+ bool r = isofs_mediainfo (ui->cdfs_superblock, &ii);
+ if (r && ii.media) {
u->ui.unknown_media = ii.unknown_media;
if (!ii.unknown_media) {
u->ui.volname = ui->volname = my_strdup (ii.volumename);
{
struct fs_usage fsu;
int ret, err = ERROR_NO_FREE_STORE;
+ int blocksize, nr;
+ uae_u32 dostype;
+ blocksize = 1204;
+ /* not FFS because it is not understood by WB1.x C:Info */
+ dostype = DISK_TYPE_DOS;
+ nr = unit->unit;
if (unit->volflags & MYVOLUMEINFO_ARCHIVE) {
ret = zfile_fs_usage_archive (unit->ui.rootdir, 0, &fsu);
} else if (unit->volflags & MYVOLUMEINFO_CDFS) {
ret = isofs_mediainfo (unit->ui.cdfs_superblock, &ii) ? 0 : 1;
fsu.fsu_blocks = ii.blocks;
fsu.fsu_bavail = 0;
+ blocksize = ii.blocksize;
+ nr = unit->unit - cd_unit_offset;
} else {
ret = get_fs_usage (unit->ui.rootdir, 0, &fsu);
if (ret)
return;
}
put_long (info, 0); /* errors */
- put_long (info + 4, (unit->volflags & MYVOLUMEINFO_CDFS) ? unit->unit - cd_unit_offset : unit->unit); /* unit number */
+ put_long (info + 4, nr); /* unit number */
put_long (info + 8, unit->ui.readonly || unit->ui.locked ? 80 : 82); /* state */
- put_long (info + 20, (unit->volflags & MYVOLUMEINFO_CDFS) ? 2048 : 1024); /* bytesperblock */
+ put_long (info + 20, blocksize); /* bytesperblock */
if (disk_info && unit->ui.unknown_media) {
put_long (info + 12, 0);
put_long (info + 16, 0);
- put_long (info + 24, ('B' << 24) | ('A' << 16) | ('D' << 8) | 0); /* ID_UNREADABLE_DISK */
+ put_long (info + 24, ('B' << 24) | ('A' << 16) | ('D' << 8) | (0 << 0)); /* ID_UNREADABLE_DISK */
put_long (info + 28, 0);
} else if (disk_info && !filesys_isvolume (unit)) {
put_long (info + 12, 0);
} else {
put_long (info + 12, fsu.fsu_blocks ); /* numblocks */
put_long (info + 16, fsu.fsu_blocks - fsu.fsu_bavail); /* inuse */
- put_long (info + 24, (unit->volflags & MYVOLUMEINFO_CDFS) ? DISK_TYPE_DOS : DISK_TYPE_DOS_FFS); /* disk type */
+ put_long (info + 24, dostype); /* disk type */
put_long (info + 28, unit->volume >> 2); /* volume node */
}
put_long (info + 32, 0); /* inuse */
#define HBLANK_OFFSET 9
/* We ignore that many lores pixels at the start of the display. These are
* invisible anyway due to hardware DDF limits. */
-#define DISPLAY_LEFT_SHIFT 0x40
+#define DISPLAY_LEFT_SHIFT 0x38
#endif
#define PIXEL_XPOS(HPOS) (((HPOS)*2 - DISPLAY_LEFT_SHIFT + DIW_DDF_OFFSET - 1) << lores_shift)
#define MAX_VIDHEIGHT 2048
#endif
-/* No divisors for MAX_PIXELS_PER_LINE; we support AGA and may one day
-want to use SHRES sprites. */
+/* No divisors for MAX_PIXELS_PER_LINE; we support AGA and SHRES sprites */
#define MAX_SPR_PIXELS (((MAXVPOS + 1) * 2 + 1) * MAX_PIXELS_PER_LINE)
struct sprite_entry
};
extern void hsync_record_line_state (int lineno, enum nln_how, int changed);
-extern void vsync_handle_redraw (int long_frame, int lof_changed);
+extern void vsync_handle_redraw (int long_frame, int lof_changed, uae_u16, uae_u16);
extern void vsync_handle_check (void);
extern void init_hardware_for_drawing_frame (void);
extern void reset_drawing (void);
-#define AMIGA_WIDTH_MAX (752 / 2)
-#define AMIGA_HEIGHT_MAX (574 / 2)
-
#ifdef GFXFILTER
typedef unsigned char u8;
int xoffset; /* superhires pixels from left edge */
int yoffset; /* lines from top edge */
+
+ int inxoffset; /* positive if sync positioning */
+ int inyoffset;
};
extern bool isnativevidbuf (void);
int l = p[0];
char t = p[l];
p[l] = 0;
- au_copy (inode->i_comment + _tcslen (inode->i_comment), maxcomment + 1 - l, p + 1);
+ au_copy (inode->i_comment + _tcslen (inode->i_comment), maxcomment + 1 - _tcslen (inode->i_comment), p + 1);
p[l] = t;
}
break;
ii->totalblocks = totalblocks ? totalblocks : ii->blocks;
ii->creation = sb->root->i_ctime.tv_sec;
}
+ if (!ii->volumename[0] || !ii->blocks)
+ ii->unknown_media = true;
}
return true;
}
}
}
if (rawinput_log & 2)
- write_log (_T("HANDLE=%08x %04x %04x %04x %08x %3d %3d %08x M=%d\n"),
+ write_log (_T("%08x %04x %04x %04x %08x %3d %3d %08x M=%d\n"),
raw->header.hDevice,
rm->usFlags,
rm->usButtonFlags,
setmousebuttonstate (num, bnum + 1, -1);
}
}
- if (istest) {
- if (abs (rm->lLastX - lastx[num]) > 7) {
+ if (!rm->ulButtons) {
+ if (istest) {
+ if (abs (rm->lLastX - lastx[num]) > 7) {
+ setmousestate (num, 0, rm->lLastX, (rm->usFlags & (MOUSE_MOVE_ABSOLUTE | MOUSE_VIRTUAL_DESKTOP)) ? 1 : 0);
+ lastx[num] = rm->lLastX;
+ lasty[num] = rm->lLastY;
+ } else if (abs (rm->lLastY - lasty[num]) > 7) {
+ setmousestate (num, 1, rm->lLastY, (rm->usFlags & (MOUSE_MOVE_ABSOLUTE | MOUSE_VIRTUAL_DESKTOP)) ? 1 : 0);
+ lastx[num] = rm->lLastX;
+ lasty[num] = rm->lLastY;
+ }
+ } else {
setmousestate (num, 0, rm->lLastX, (rm->usFlags & (MOUSE_MOVE_ABSOLUTE | MOUSE_VIRTUAL_DESKTOP)) ? 1 : 0);
- lastx[num] = rm->lLastX;
- lasty[num] = rm->lLastY;
- } else if (abs (rm->lLastY - lasty[num]) > 7) {
setmousestate (num, 1, rm->lLastY, (rm->usFlags & (MOUSE_MOVE_ABSOLUTE | MOUSE_VIRTUAL_DESKTOP)) ? 1 : 0);
lastx[num] = rm->lLastX;
lasty[num] = rm->lLastY;
}
- } else {
- setmousestate (num, 0, rm->lLastX, (rm->usFlags & (MOUSE_MOVE_ABSOLUTE | MOUSE_VIRTUAL_DESKTOP)) ? 1 : 0);
- setmousestate (num, 1, rm->lLastY, (rm->usFlags & (MOUSE_MOVE_ABSOLUTE | MOUSE_VIRTUAL_DESKTOP)) ? 1 : 0);
- lastx[num] = rm->lLastX;
- lasty[num] = rm->lLastY;
}
}
if (isfocus () && !istest) {
int min = vcaps->LogicalMin;
if (vcaps->LogicalMax - min == 7) {
- if (val == min + 0 && type == AXISTYPE_POV_Y)
+ if ((val == min + 0 || val == min + 1 || val == min + 7) && type == AXISTYPE_POV_Y)
data = -127;
- if (val == min + 2 && type == AXISTYPE_POV_X)
+ if ((val == min + 2 || val == min + 3 || val == min + 1) && type == AXISTYPE_POV_X)
data = 127;
- if (val == min + 4 && type == AXISTYPE_POV_Y)
+ if ((val == min + 4 || val == min + 5 || val == min + 3) && type == AXISTYPE_POV_Y)
data = 127;
- if (val == min + 6 && type == AXISTYPE_POV_X)
+ if ((val == min + 6 || val == min + 7 || val == min + 5) && type == AXISTYPE_POV_X)
data = -127;
} else {
if (val == min + 0 && type == AXISTYPE_POV_Y)
}
}
-void clearsurface (LPDIRECTDRAWSURFACE7 surf)
+void DirectDraw_ClearSurface (LPDIRECTDRAWSURFACE7 surf)
{
if (surf == NULL)
surf = getlocksurface ();
}
-int locksurface (LPDIRECTDRAWSURFACE7 surf, LPDDSURFACEDESC2 desc)
+int DirectDraw_LockSurface (LPDIRECTDRAWSURFACE7 surf, LPDDSURFACEDESC2 desc)
{
static int cnt = 50;
HRESULT ddrval;
}
return 1;
}
-void unlocksurface (LPDIRECTDRAWSURFACE7 surf)
+void DirectDraw_UnlockSurface (LPDIRECTDRAWSURFACE7 surf)
{
HRESULT ddrval;
dxdata.swidth = width;
dxdata.sheight = height;
dxdata.pitch = 0;
- if (locksurface (surf, &desc)) {
+ if (DirectDraw_LockSurface (surf, &desc)) {
dxdata.pitch = desc.lPitch;
- unlocksurface (surf);
+ DirectDraw_UnlockSurface (surf);
} else {
write_log (_T("Couldn't get surface pitch!\n"));
}
}
if (dxdata.lockcnt > 0)
return 1;
- ok = locksurface (getlocksurface (), &dxdata.locksurface);
+ ok = DirectDraw_LockSurface (getlocksurface (), &dxdata.locksurface);
if (ok)
dxdata.lockcnt++;
return ok;
if (dxdata.lockcnt == 0)
return;
dxdata.lockcnt--;
- unlocksurface (getlocksurface ());
+ DirectDraw_UnlockSurface (getlocksurface ());
}
uae_u8 *DirectDraw_GetSurfacePointer (void)
dx = dstrect->left;
dy = dstrect->top;
}
- if (locksurface (dst, &dstd)) {
- if (locksurface (src, &srcd)) {
+ if (DirectDraw_LockSurface (dst, &dstd)) {
+ if (DirectDraw_LockSurface (src, &srcd)) {
bpp = srcd.ddpfPixelFormat.dwRGBBitCount / 8;
h = srcd.dwHeight;
w = srcd.dwWidth;
}
}
ok = 1;
- unlocksurface (src);
+ DirectDraw_UnlockSurface (src);
}
- unlocksurface (dst);
+ DirectDraw_UnlockSurface (dst);
}
return ok;
}
{
return DirectDraw_Blt (dst, dstrect, src, scrrect, FALSE);
}
-int DirectDraw_BlitRectCK (LPDIRECTDRAWSURFACE7 dst, RECT *dstrect, LPDIRECTDRAWSURFACE7 src, RECT *scrrect)
+static int DirectDraw_BlitRectCK (LPDIRECTDRAWSURFACE7 dst, RECT *dstrect, LPDIRECTDRAWSURFACE7 src, RECT *scrrect)
{
return DirectDraw_Blt (dst, dstrect, src, scrrect, TRUE);
}
-void DirectDraw_FillSurface (LPDIRECTDRAWSURFACE7 dst, RECT *rect, uae_u32 color)
+static void DirectDraw_FillSurface (LPDIRECTDRAWSURFACE7 dst, RECT *rect, uae_u32 color)
{
HRESULT ddrval;
DDBLTFX ddbltfx;
void DirectDraw_Release(void);
int DirectDraw_Start(void);
void DirectDraw_get_GUIDs (void);
-void clearsurface(LPDIRECTDRAWSURFACE7 surf);
-int locksurface (LPDIRECTDRAWSURFACE7 surf, LPDDSURFACEDESC2 desc);
-void unlocksurface (LPDIRECTDRAWSURFACE7 surf);
-HRESULT restoresurface (LPDIRECTDRAWSURFACE7 surf);
+void DirectDraw_ClearSurface (LPDIRECTDRAWSURFACE7 surf);
+int DirectDraw_LockSurface (LPDIRECTDRAWSURFACE7 surf, LPDDSURFACEDESC2 desc);
+void DirectDraw_UnlockSurface (LPDIRECTDRAWSURFACE7 surf);
LPDIRECTDRAWSURFACE7 allocsurface (int width, int height);
LPDIRECTDRAWSURFACE7 allocsystemsurface (int width, int height);
LPDIRECTDRAWSURFACE7 createsurface (uae_u8 *ptr, int pitch, int width, int height);
DWORD DirectDraw_GetPixelFormatBitMask (DirectDraw_Mask_e mask);
RGBFTYPE DirectDraw_GetPixelFormat (void);
DWORD DirectDraw_GetBytesPerPixel (void);
-HRESULT DirectDraw_GetDC(HDC *hdc);
-HRESULT DirectDraw_ReleaseDC(HDC hdc);
+HRESULT DirectDraw_GetDC (HDC *hdc);
+HRESULT DirectDraw_ReleaseDC (HDC hdc);
int DirectDraw_GetVerticalBlankStatus (void);
DWORD DirectDraw_CurrentRefreshRate (void);
void DirectDraw_GetPrimaryPixelFormat (DDSURFACEDESC2 *desc);
int DirectDraw_BlitToPrimaryScale (RECT *dstrect, RECT *srcrect);
int DirectDraw_Blit (LPDIRECTDRAWSURFACE7 dst, LPDIRECTDRAWSURFACE7 src);
int DirectDraw_BlitRect (LPDIRECTDRAWSURFACE7 dst, RECT *dstrect, LPDIRECTDRAWSURFACE7 src, RECT *scrrect);
-int DirectDraw_BlitRectCK (LPDIRECTDRAWSURFACE7 dst, RECT *dstrect, LPDIRECTDRAWSURFACE7 src, RECT *scrrect);
-void DirectDraw_FillSurface (LPDIRECTDRAWSURFACE7 dst, RECT *rect, uae_u32 color);
void DirectDraw_Fill (RECT *rect, uae_u32 color);
void DirectDraw_FillPrimary (void);
bool DD_getvblankpos (int *vpos);
EDITTEXT IDC_FILTERXLV,253,176,34,12,ES_CENTER | ES_READONLY\r
COMBOBOX IDC_FILTERSLR,253,151,33,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP\r
GROUPBOX "Presets",-1,0,203,296,36\r
- COMBOBOX IDC_FILTERPRESETS,8,217,119,150,CBS_DROPDOWN | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP\r
+ COMBOBOX IDC_FILTERPRESETS,8,217,119,150,CBS_DROPDOWN | CBS_SORT | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP\r
PUSHBUTTON "Load",IDC_FILTERPRESETLOAD,132,216,47,14\r
PUSHBUTTON "Save",IDC_FILTERPRESETSAVE,184,216,47,14\r
PUSHBUTTON "Delete",IDC_FILTERPRESETDELETE,236,216,47,14\r
#include "blkdev.h"
#include "registry.h"
#include "win32gui.h"
+#include "drawing.h"
#include <resource>
static int initialized;
break;
}
}
- if (wdnum >= 0)
+ if (wdnum >= 0) {
inputdevice_set_gameports_mapping (&changed_prefs, kb + j, wdnum, evtnum, inputmap_port);
+ inputdevice_set_gameports_mapping (&currprefs, kb + j, wdnum, evtnum, inputmap_port);
+ }
}
}
inputdevice_updateconfig (&changed_prefs);
+ inputdevice_updateconfig (&currprefs);
return TRUE;
}
_tcscpy (desc.szHostInputID, _T("KeyboardCustom"));
_tcscpy (desc.szHostInputName, _T("KeyboardCustom"));
desc.dwHostInputType = RP_HOSTINPUT_KEYJOY_CUSTOM;
- desc.dwInputDeviceFeatures = RP_FEATURE_INPUTDEVICE_JOYSTICK;
+ desc.dwInputDeviceFeatures = RP_FEATURE_INPUTDEVICE_JOYSTICK | RP_FEATURE_INPUTDEVICE_JOYPAD;
RPSendMessagex (RPIPCGM_INPUTDEVICE, 0, 0, &desc, sizeof desc, &guestinfo, NULL);
cnt = 0;
while ((cnt = rp_input_enum (&desc, cnt)) >= 0) {
static void _cdecl pngtest_blah (png_structp png_ptr, png_const_charp message)
{
+#if 0
TCHAR *name = au ("unknown");
if (png_ptr != NULL && png_ptr->error_ptr != NULL)
name = au ((char*)png_ptr->error_ptr);
write_log (_T("%s: libpng warning: %s\n"), name, message);
xfree (name);
+#endif
}
static int savepng (FILE *fp)
<RandomizedBaseAddress>false</RandomizedBaseAddress>
<TargetMachine>MachineX86</TargetMachine>
<AdditionalLibraryDirectories>$(SolutionDir)\..\lib\</AdditionalLibraryDirectories>
+ <IgnoreSpecificDefaultLibraries>LIBCMT</IgnoreSpecificDefaultLibraries>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
#define LANG_DLL 1
//#define WINUAEBETA _T("")
-#define WINUAEBETA _T("Beta 4")
-#define WINUAEDATE MAKEBD(2012, 4, 4)
+#define WINUAEBETA _T("Beta 6")
+#define WINUAEDATE MAKEBD(2012, 4, 13)
#define WINUAEEXTRA _T("")
//#define WINUAEEXTRA _T("AmiKit Preview")
#define WINUAEREV _T("")
SetRect (&sr, slx, 0, slx + lx, TD_TOTAL_HEIGHT);
SetRect (&dr, slx, sly, slx + lx, sly + TD_TOTAL_HEIGHT);
DirectDraw_BlitRect (tempsurf, &sr, NULL, &dr);
- if (locksurface (tempsurf, &desc)) {
+ if (DirectDraw_LockSurface (tempsurf, &desc)) {
for (y = 0; y < TD_TOTAL_HEIGHT; y++) {
uae_u8 *buf = (uae_u8*)desc.lpSurface + y * desc.lPitch;
draw_status_line_single (buf, dst_depth / 8, y, lx, rc, gc, bc, NULL);
}
- unlocksurface (tempsurf);
+ DirectDraw_UnlockSurface (tempsurf);
DirectDraw_BlitRect (NULL, &dr, tempsurf, &sr);
}
}
if (tempsurf == NULL)
return;
if (cleartemp) {
- clearsurface (tempsurf);
+ DirectDraw_ClearSurface (tempsurf);
cleartemp = 0;
}
- if (!locksurface (tempsurf, &desc))
+ if (!DirectDraw_LockSurface (tempsurf, &desc))
return;
pitch = desc.lPitch;
surfstart = (uae_u8*)desc.lpSurface;
if (d3d) {
;//D3D_unlocktexture (); unlock in win32gfx.c
} else {
- unlocksurface (tempsurf);
+ DirectDraw_UnlockSurface (tempsurf);
getfilterrect2 (&dr, &sr, &zr, dst_width, dst_height, aw, ah, scale, temp_width, temp_height);
//write_log (_T("(%d %d %d %d) - (%d %d %d %d) (%d %d)\n"), dr.left, dr.top, dr.right, dr.bottom, sr.left, sr.top, sr.right, sr.bottom, zr.left, zr.top);
void S2X_refresh (void)
{
- clearsurface (NULL);
+ DirectDraw_ClearSurface (NULL);
S2X_render ();
}
DirectDraw_Fill (NULL, 0);
DirectDraw_BlitToPrimary (NULL);
if (screen_is_picasso) {
- if (currprefs.win32_rtgscaleifsmall && (wc->native_width > picasso96_state.Width || wc->native_height > picasso96_state.Height))
+ if (currprefs.win32_rtgscaleifsmall && ((wc->native_width > picasso96_state.Width && wc->native_height >= picasso96_state.Height) || (wc->native_height > picasso96_state.Height && wc->native_width >= picasso96_state.Width)))
return -1;
if (currprefs.win32_rtgallowscaling && (picasso96_state.Width != wc->native_width || picasso96_state.Height != wc->native_height))
return -1;
+#if 0
+ if (wc->native_width < picasso96_state.Width || wc->native_height < picasso96_state.Height)
+ return 1;
+#endif
}
return -1;
}
currentmode->native_height = pr->res.height;
currentmode->current_width = currentmode->native_width;
currentmode->current_height = currentmode->native_height;
- break;
+ goto end;
}
}
// still not match? check all modes
currentmode->native_height = pr->res.height;
currentmode->current_width = currentmode->native_width;
currentmode->current_height = currentmode->native_height;
- break;
+ goto end;
}
}
index++;
}
+end:
if (index >= 0) {
currprefs.gfx_apmode[screen_is_picasso ? APMODE_RTG : APMODE_NATIVE].gfx_display =
changed_prefs.gfx_apmode[screen_is_picasso ? APMODE_RTG : APMODE_NATIVE].gfx_display = index;
currprefs.gfx_apmode[screen_is_picasso ? APMODE_RTG : APMODE_NATIVE].gfx_display_name[0] =
changed_prefs.gfx_apmode[screen_is_picasso ? APMODE_RTG : APMODE_NATIVE].gfx_display_name[0] = 0;
+ write_log (L"Can't find mode %dx%d ->\n", currentmode->native_width, currentmode->native_height);
write_log (L"Monitor switched to '%s'\n", md->adaptername);
}
return 1;
regqueryint (NULL, _T("MainPosX"), &stored_x);
regqueryint (NULL, _T("MainPosY"), &stored_y);
+ if (borderless) {
+ stored_x = currprefs.gfx_size_win.x;
+ stored_y = currprefs.gfx_size_win.y;
+ }
+
while (first) {
first--;
if (stored_x < GetSystemMetrics (SM_XVIRTUALSCREEN))
hAmigaWnd = CreateWindowEx (dxfs || d3dfs ? WS_EX_ACCEPTFILES | WS_EX_TOPMOST : WS_EX_ACCEPTFILES | WS_EX_TOOLWINDOW | (currprefs.win32_alwaysontop ? WS_EX_TOPMOST : 0),
_T("AmigaPowah"), _T("WinUAE"),
WS_POPUP,
- x, y, w, h,
+ 0, 0, w, h,
parent, NULL, hInst, NULL);
} else {
hAmigaWnd = CreateWindowEx (
init_colors ();
S2X_free ();
+ oldtex_w = oldtex_h = -1;
if (currentmode->flags & DM_D3D) {
const TCHAR *err = D3D_init (hAmigaWnd, currentmode->native_width, currentmode->native_height, currentmode->current_depth, screen_is_picasso ? 1 : currprefs.gfx_filter_filtermode + 1);
if (err) {
ret = -1;
goto oops;
}
- oldtex_w = oldtex_h = -1;
target_graphics_buffer_update ();
}
int w, h;
if (screen_is_picasso) {
- w = picasso_vidinfo.width;
- h = picasso_vidinfo.height;
+ w = picasso96_state.Width > picasso_vidinfo.width ? picasso96_state.Width : picasso_vidinfo.width;
+ h = picasso96_state.Height > picasso_vidinfo.height ? picasso96_state.Height : picasso_vidinfo.height;
} else {
struct vidbuffer *vb = gfxvidinfo.drawbuffer.tempbufferinuse ? &gfxvidinfo.tempbuffer : &gfxvidinfo.drawbuffer;
gfxvidinfo.outbuffer = vb;
S2X_free ();
if (currentmode->flags & DM_D3D) {
D3D_alloctexture (w, h);
+ } else {
+ DirectDraw_ClearSurface (NULL);
}
if (currentmode->flags & DM_SWSCALE) {
S2X_init (currentmode->native_width, currentmode->native_height, currentmode->native_depth);
_stprintf (bootpri_str, _T("%d"), uci->bootpri);
} else if (type == FILESYS_HARDFILE_RDB || type == FILESYS_HARDDRIVE || uci->controller) {
_stprintf (blocksize_str, _T("%d"), uci->blocksize);
- _tcscpy (devname_str, _T("n/a"));
+ _tcscpy (devname_str, _T("*UAE*"));
_tcscpy (volname_str, _T("n/a"));
_tcscpy (bootpri_str, _T("n/a"));
if (!_tcsncmp (rootdir, _T("HD_"), 3))
struct filterpreset {
TCHAR *name;
- int conf[25];
+ int conf[26];
};
static struct filterpreset filterpresets[] =
{
- { _T("PAL"), UAE_FILTER_PAL, 0, 0, 0, 0, 0, 0, 0, 50, 0, 0, 1, 1, 0, 0, 0, 10, 0, 0, 0, 300, 30, 0, 0, 0 },
- { _T("D3D Autoscale"), UAE_FILTER_NULL, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, 1 },
- { _T("D3D Full Scaling"), UAE_FILTER_NULL, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, 0 },
+ { _T("PAL"), UAE_FILTER_PAL, 0, 0, 0, 0, 0, 0, 0, 50, 0, 0, 1, 1, 0, 0, 0, 10, 0, 0, 0, 300, 30, 0, 0, 0, 0 },
+ { _T("D3D Autoscale"), UAE_FILTER_NULL, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, 4, 0 },
+ { _T("D3D Full Scaling"), UAE_FILTER_NULL, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, 0, 0 },
{ NULL }
};
j = 0;
SendDlgItemMessage (hDlg, IDC_FILTERPRESETS, CB_RESETCONTENT, 0, 0L);
- SendDlgItemMessage (hDlg, IDC_FILTERPRESETS, CB_ADDSTRING, 0, (LPARAM)_T(""));
- for (i = 0; filterpresets[i].name; i++) {
- TCHAR tmp[MAX_DPATH];
- _stprintf (tmp, _T("* %s"), filterpresets[i].name);
- SendDlgItemMessage (hDlg, IDC_FILTERPRESETS, CB_ADDSTRING, 0, (LPARAM)tmp);
- }
fkey = regcreatetree (NULL, _T("FilterPresets"));
if (fkey) {
int idx = 0;
SendDlgItemMessage (hDlg, IDC_FILTERPRESETS, CB_ADDSTRING, 0, (LPARAM)tmp);
idx++;
}
- SendDlgItemMessage (hDlg, IDC_FILTERPRESETS, CB_SETCURSEL, filterpreset_selected, 0);
regclosetree (fkey);
}
+ for (i = 0; filterpresets[i].name; i++) {
+ TCHAR tmp[MAX_DPATH];
+ _stprintf (tmp, _T("* %s"), filterpresets[i].name);
+ SendDlgItemMessage (hDlg, IDC_FILTERPRESETS, CB_INSERTSTRING, i, (LPARAM)tmp);
+ }
+ SendDlgItemMessage (hDlg, IDC_FILTERPRESETS, CB_INSERTSTRING, 0, (LPARAM)_T(""));
+ SendDlgItemMessage (hDlg, IDC_FILTERPRESETS, CB_SETCURSEL, filterpreset_selected, 0);
+
int ho, vo, hz, vz;
if (workprefs.gfx_filter_autoscale == AUTOSCALE_MANUAL) {
hz = workprefs.gfx_xcenter_size;
</ResourceCompile>
<Link>
<AdditionalOptions>/MACHINE:I386 %(AdditionalOptions)</AdditionalOptions>
- <AdditionalDependencies>ws2_32.lib;ddraw.lib;dxguid.lib;winmm.lib;comctl32.lib;version.lib;msacm32.lib;dsound.lib;dinput8.lib;d3d9.lib;d3dx9d.lib;winio.lib;setupapi.lib;wininet.lib;dxerr.lib;shlwapi.lib;zlibstat.lib;libpng.lib;lglcd.lib;wpcap.lib;packet.lib;openal32.lib;wintab32.lib;portaudio_x86.lib;vfw32.lib;wtsapi32.lib;enet.lib;prowizard.lib;lzmalib.lib;libFLAC_static.lib;Avrt.lib;hid.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalDependencies>ws2_32.lib;ddraw.lib;dxguid.lib;winmm.lib;comctl32.lib;version.lib;msacm32.lib;dsound.lib;dinput8.lib;d3d9.lib;d3dx9d.lib;winio.lib;setupapi.lib;wininet.lib;dxerr.lib;shlwapi.lib;zlibstat.lib;libpng15.lib;lglcd.lib;wpcap.lib;packet.lib;openal32.lib;wintab32.lib;portaudio_x86.lib;vfw32.lib;wtsapi32.lib;enet.lib;prowizard.lib;lzmalib.lib;libFLAC_static.lib;Avrt.lib;hid.lib;%(AdditionalDependencies)</AdditionalDependencies>
<ShowProgress>NotSet</ShowProgress>
<OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
<SuppressStartupBanner>true</SuppressStartupBanner>
<Culture>0x0409</Culture>
</ResourceCompile>
<Link>
- <AdditionalDependencies>ws2_32.lib;ddraw.lib;dxguid.lib;winmm.lib;comctl32.lib;version.lib;msacm32.lib;dsound.lib;dinput8.lib;d3d9.lib;d3dx9.lib;winio.lib;setupapi.lib;wininet.lib;dxerr.lib;shlwapi.lib;zlibstat.lib;libpng.lib;lglcd.lib;wpcap.lib;packet.lib;openal32.lib;wintab32.lib;portaudio_x86.lib;vfw32.lib;wtsapi32.lib;enet.lib;lzmalib.lib;prowizard.lib;libFLAC_static.lib;Avrt.lib;hid.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalDependencies>ws2_32.lib;ddraw.lib;dxguid.lib;winmm.lib;comctl32.lib;version.lib;msacm32.lib;dsound.lib;dinput8.lib;d3d9.lib;d3dx9.lib;winio.lib;setupapi.lib;wininet.lib;dxerr.lib;shlwapi.lib;libpng15.lib;lglcd.lib;wpcap.lib;packet.lib;openal32.lib;wintab32.lib;portaudio_x86.lib;vfw32.lib;wtsapi32.lib;enet.lib;lzmalib.lib;prowizard.lib;libFLAC_static.lib;Avrt.lib;hid.lib;zlibstat.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
<SuppressStartupBanner>true</SuppressStartupBanner>
<AdditionalLibraryDirectories>%(AdditionalLibraryDirectories);$(SolutionDir)\..\lib\</AdditionalLibraryDirectories>
<Culture>0x0409</Culture>
</ResourceCompile>
<Link>
- <AdditionalDependencies>ws2_32.lib;ddraw.lib;dxguid.lib;winmm.lib;comctl32.lib;version.lib;msacm32.lib;dsound.lib;dinput8.lib;d3d9.lib;d3dx9.lib;winio.lib;setupapi.lib;wininet.lib;dxerr.lib;shlwapi.lib;zlibstat.lib;libpng.lib;lglcd.lib;wpcap.lib;packet.lib;openal32.lib;wintab32.lib;portaudio_x86.lib;vfw32.lib;wtsapi32.lib;avrt.lib;enet.lib;prowizard.lib;lzmalib.lib;libFLAC_static.lib;Avrt.lib;hid.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalDependencies>ws2_32.lib;ddraw.lib;dxguid.lib;winmm.lib;comctl32.lib;version.lib;msacm32.lib;dsound.lib;dinput8.lib;d3d9.lib;d3dx9.lib;winio.lib;setupapi.lib;wininet.lib;dxerr.lib;shlwapi.lib;zlibstat.lib;libpng15.lib;lglcd.lib;wpcap.lib;packet.lib;openal32.lib;wintab32.lib;portaudio_x86.lib;vfw32.lib;wtsapi32.lib;avrt.lib;enet.lib;prowizard.lib;lzmalib.lib;libFLAC_static.lib;Avrt.lib;hid.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
<SuppressStartupBanner>true</SuppressStartupBanner>
<AdditionalLibraryDirectories>%(AdditionalLibraryDirectories);$(SolutionDir)\..\lib\</AdditionalLibraryDirectories>
-- cpu throttling
-- custom event autofire
-- cycle exact mode scanline sync
+
- restore only single input target to default.
- hdd from command line
+Beta 6:
+
+- Most CDFS RockRidge file comments were truncated. (Very stupid bug)
+- CDFS media change still crashed in some situations.
+- Show "UAE" as HD controller, not "n/a" (same as "IDE0" and others do)
+- Improved fastest possible CPU throttle option. (Less CPU% usage)
+- If fastest possible CPU does not have enough frame time for extra CPU emulation, reduce extra time in next frame to
+ prevent possible high CPU% usage and slowdowns.
+- Fullwindow RTG, D3D and scaling in Expansion panel enabled: switching to bigger RTG resolution than max fullwindow crashed. (b2)
+- Updated statically linked zlib and libpng to latest versions (1.2.6 and 1.5.10)
+- Debugger basic math operators support (+-*/) added, for example "m 8+100*4" lists memory beginning from 0x408. Note that space
+ is not allowed because it is parameter separator.
+- Borderblank didn't work if BPLCON3 was only written outside of displayable area (b5). This is still quite ugly implemention,
+ it should be done similar to COLOR0 handling but it would require too big changes. Later..
+- A2024 2 lowest RGB bits set correctly, was always cleared previously.
+- Keyboard reset warning fixed (2.4.0)
+- Fixed 1-3 line background color bar on top of screen in autoscale modes (2.4.0)
+- USB joypad/joystick rawinput dpad diagonal movement fix. (2.4.0)
+
+Beta 5:
+
+- Left edge display limit fix, it was correct when in lores but OCS/ECS hires max overscan
+ (or AGA in 16-bit fetchmode) can start 8 pixels earlier. (ECS SuperPlus missing left edge)
+- Tweaked programmed mode sync positioning algorithm.
+- Use config file gfx_top_windowed and gfx_left_windowed top/left window coordinates if borderless mode.
+- Sort filter presets alphabetically.
+- When calculating autoscale position, restrict left and right side of display inside hsync end and start positions,
+ fixes really wide display in promoted modes. Note that autoscale can't work correctly in (some?) promoted
+ modes because viewable area is larger than visible bitmap = borders are visible.
+- DirectDraw mode wasn't re-initialized correctly when window size changed causing blank screen.
+- Borderblank didn't blank topmost lines and last line. (Old bug which usually wasn't visible until now)
+- Clear display decision tables when switching modes to prevent old, now possibly unvailable lines to be visible in new mode.
+- Possible fix for mouse pointer jumping to (0,0) when pressing buttons and running on some virtual machines. (2.3.3)
+
+Beta 4:
+
- 68020 CE mode statefile CPUTRACE (CPU state can be saved even in mid instruction) support was not complete,
should fix "CPU trace: blah" errors when restoring statefiles. It can't fix already created broken statefiles.
- Fix built-in CDFS lowercase conversion. Only convert to lower case if plain ISO-9660 (without RockRidge or Joliet)
}
if (dbl == 1) {
c1 = (c1 + c2 + 1) / 2;
- c1 = (c1 << 6) | (c1 << 4) | (c1 << 2);
+ c1 = (c1 << 6) | (c1 << 4) | (c1 << 2) | (c1 << 0);
PRGB(dst, dstp1, c1, c1, c1);
} else {
- c1 = (c1 << 6) | (c1 << 4) | (c1 << 2);
- c2 = (c2 << 6) | (c2 << 4) | (c2 << 2);
+ c1 = (c1 << 6) | (c1 << 4) | (c1 << 2) | (c1 << 0);
+ c2 = (c2 << 6) | (c2 << 4) | (c2 << 2) | (c2 << 0);
PRGB(dst, dstp1, c1, c1, c1);
PRGB(dst, dstp2, c2, c2, c2);
dstp2 += dst->pixbytes;