]> git.unchartedbackwaters.co.uk Git - francis/winuae.git/commitdiff
2200b10
authorToni Wilen <twilen@winuae.net>
Tue, 15 Jun 2010 16:16:11 +0000 (19:16 +0300)
committerToni Wilen <twilen@winuae.net>
Tue, 15 Jun 2010 16:16:11 +0000 (19:16 +0300)
24 files changed:
ar.cpp
audio.cpp
cfgfile.cpp
custom.cpp
drawing.cpp
driveclick.cpp
gfxutil.cpp
include/ar.h
include/drawing.h
include/driveclick.h
include/fsdb.h
include/options.h
include/rommgr.h
inputdevice.cpp
od-win32/clipboard_win32.cpp
od-win32/dinput.cpp
od-win32/fsdb_mywin32.cpp
od-win32/sounddep/sound.cpp
od-win32/win32.h
od-win32/win32gfx.cpp
od-win32/win32gui.cpp
od-win32/winuae_msvc10/winuae_msvc.vcxproj
od-win32/winuaechangelog.txt
rommgr.cpp

diff --git a/ar.cpp b/ar.cpp
index 6895c185f722058df0d379258227e1851d12d572..2cd4387ee12db82d5aea9e9077ccb1ce98ef121d 100644 (file)
--- a/ar.cpp
+++ b/ar.cpp
@@ -602,6 +602,8 @@ STATIC_INLINE int ar3a (uaecptr addr, uae_u8 b, int writing)
        return 0;
 }
 
+static void action_replay_chipwrite (void);
+
 void REGPARAM2 chipmem_lput_actionreplay1 (uaecptr addr, uae_u32 l)
 {
        uae_u32 *m;
@@ -618,7 +620,7 @@ void REGPARAM2 chipmem_wput_actionreplay1 (uaecptr addr, uae_u32 w)
 
        addr -= chipmem_start & chipmem_mask;
        addr &= chipmem_mask;
-       if (addr == 0x62 && !is_ar_pc_in_rom())
+       if (addr == 0x60 && !is_ar_pc_in_rom())
                action_replay_chipwrite ();
        m = (uae_u16 *)(chipmemory + addr);
        do_put_mem_word (m, w);
@@ -1143,7 +1145,7 @@ int action_replay_freeze (void)
        return 0;
 }
 
-void action_replay_chipwrite (void)
+static void action_replay_chipwrite (void)
 {
        if (armodel == 2 || armodel == 3) {
                action_replay_flag = ACTION_REPLAY_DORESET;
index 447485662dd708e0619245a6b2601fdca232a2c2..5337f684b4cc9da1645b95775e0cd6419c4c9f06 100644 (file)
--- a/audio.cpp
+++ b/audio.cpp
 
 int audio_channel_mask = 15;
 
-STATIC_INLINE int isaudio(void)
+STATIC_INLINE bool isaudio (void)
 {
-       if (!currprefs.produce_sound)
-               return 0;
-       return 1;
+       return currprefs.produce_sound != 0;
 }
 
-static int debugchannel (int ch)
+static bool debugchannel (int ch)
 {
-       if ((1 << ch) & DEBUG_CHANNEL_MASK)
-               return 1;
-       return 0;
+       return ((1 << ch) & DEBUG_CHANNEL_MASK) != 0;
+}
+
+STATIC_INLINE bool usehacks (void)
+{
+       return currprefs.cpu_model >= 68020 && !currprefs.cpu_cycle_exact;
 }
 
 #define SINC_QUEUE_MAX_AGE 2048
@@ -1096,11 +1097,11 @@ static int isirq (int nr)
        return INTREQR () & (0x80 << nr);
 }
 
-static void setirq (int nr)
+static void setirq (int nr, int which)
 {
 #ifdef DEBUG_AUDIO
        if (debugchannel (nr))
-               write_log (L"SETIRQ %d %08X\n", nr, M68K_GETPC);
+               write_log (L"SETIRQ %d (%d) %08X\n", nr, which, M68K_GETPC);
 #endif
        INTREQ (0x8000 | (0x80 << nr));
 }
@@ -1159,7 +1160,7 @@ static void audio_handler (int nr)
                        cdp->state = 1;
                        cdp->wlen = cdp->len;
                        /* there are too many stupid sound routines that fail on "too" fast cpus.. */
-                       if (currprefs.cpu_model >= 68020 && !currprefs.cpu_cycle_exact)
+                       if (usehacks ())
                                cdp->pt = cdp->lc;
 #ifdef DEBUG_AUDIO
                        if (debugchannel (nr))
@@ -1172,7 +1173,7 @@ static void audio_handler (int nr)
                } else if (!cdp->dmaen && cdp->request_word < 0 && !isirq (nr)) {
                        cdp->evtime = 0;
                        cdp->state = 2;
-                       setirq (nr);
+                       setirq (nr, 0);
                        audio_handler (nr);
                        return;
                }
@@ -1200,7 +1201,7 @@ static void audio_handler (int nr)
                        cdp->request_word = 2;
                        return;
                }
-               setirq (nr);
+               setirq (nr, 5);
                if (!cdp->dmaen) {
                        cdp->state = 0;
                        cdp->request_word = 0;
@@ -1230,7 +1231,7 @@ static void audio_handler (int nr)
                /* Period attachment? */
                if (audap) {
                        if (cdp->intreq2 && cdp->dmaen)
-                               setirq (nr);
+                               setirq (nr, 2);
                        cdp->intreq2 = 0;
                        cdp->request_word = 1;
                        cdp->dat = cdp->dat2;
@@ -1248,6 +1249,7 @@ static void audio_handler (int nr)
        case 3:
                if (currprefs.produce_sound == 0)
                        cdp->per = PERIOD_MAX;
+
                state23 (cdp);
                cdp->state = 2;
                cdp->evtime = cdp->per;
@@ -1258,10 +1260,11 @@ static void audio_handler (int nr)
                        if (napnav)
                                cdp->request_word = 1;
                        if (cdp->intreq2 && napnav)
-                               setirq (nr);
+                               setirq (nr, 3);
                } else {
-                       if (napnav)
-                               setirq (nr);
+                       if (napnav) {
+                               setirq (nr, 4);
+                       }
                }
                cdp->intreq2 = 0;
 
@@ -1370,7 +1373,7 @@ void check_prefs_changed_audio (void)
                clear_sound_buffers ();
        }
        set_audio ();
-       audio_activate();
+       audio_activate ();
 }
 
 void set_audio (void)
@@ -1691,7 +1694,7 @@ void AUDxDAT (int nr, uae_u16 v)
                write_log (L"AUD%dDAT: %04X STATE=%d IRQ=%d %08X\n", nr,
                v, cdp->state, isirq(nr) ? 1 : 0, M68K_GETPC);
 #endif
-       audio_activate();
+       audio_activate ();
        update_audio ();
        cdp->dat2 = v;
        if (cdp->request_word >= 2 && cdp->request_word_skip == 0)
@@ -1699,12 +1702,12 @@ void AUDxDAT (int nr, uae_u16 v)
        cdp->request_word = -1;
        cdp->request_word_skip = 0;
        /* cpu >= 68020: another "too fast" memory/CPU hack */
-       if (cdp->state == 0 || (currprefs.cpu_model >= 68020 && !currprefs.cpu_cycle_exact)) {
+       if (cdp->state == 0 || usehacks ()) {
                cdp->state = 2;
                cdp->wlen = cdp->len;
                cdp->pt = cdp->lc;
-               if (currprefs.cpu_model >= 68020 && !currprefs.cpu_cycle_exact)
-                       INTREQ (0x80 << nr);
+               if (usehacks ())
+                       setirq (nr, -1);
                audio_handler (nr);
                schedule_audio ();
                events_schedule ();
@@ -1713,9 +1716,10 @@ void AUDxDAT (int nr, uae_u16 v)
 
 void AUDxLCH (int nr, uae_u16 v)
 {
-       audio_activate();
+       struct audio_channel_data *cdp = audio_channel + nr;
+       audio_activate ();
        update_audio ();
-       audio_channel[nr].lc = (audio_channel[nr].lc & 0xffff) | ((uae_u32)v << 16);
+       cdp->lc = (cdp->lc & 0xffff) | ((uae_u32)v << 16);
 #ifdef DEBUG_AUDIO
        if (debugchannel (nr))
                write_log (L"AUD%dLCH: %04X %08X\n", nr, v, M68K_GETPC);
@@ -1724,9 +1728,10 @@ void AUDxLCH (int nr, uae_u16 v)
 
 void AUDxLCL (int nr, uae_u16 v)
 {
-       audio_activate();
+       struct audio_channel_data *cdp = audio_channel + nr;
+       audio_activate ();
        update_audio ();
-       audio_channel[nr].lc = (audio_channel[nr].lc & ~0xffff) | (v & 0xFFFE);
+       cdp->lc = (cdp->lc & ~0xffff) | (v & 0xFFFE);
 #ifdef DEBUG_AUDIO
        if (debugchannel (nr))
                write_log (L"AUD%dLCL: %04X %08X\n", nr, v, M68K_GETPC);
@@ -1735,28 +1740,37 @@ void AUDxLCL (int nr, uae_u16 v)
 
 void AUDxPER (int nr, uae_u16 v)
 {
+       struct audio_channel_data *cdp = audio_channel + nr;
        unsigned long per = v * CYCLE_UNIT;
 
-       audio_activate();
+       audio_activate ();
        update_audio ();
        if (per == 0)
                per = PERIOD_MAX - 1;
 
+#if 0
+       // too fast CPU compatibility hack. KS sets AUDxPER == 8 or 1 when ending the sound, this does not
+       // always work correctly in JIT modes if sound is immediately restarted.
+       if (usehacks () && per < 10 * CYCLE_UNIT && !cdp->dmaen) {
+               zerostate (cdp);
+       }
+#endif
+
        if (per < maxhpos * CYCLE_UNIT / 2 && currprefs.produce_sound < 3)
                per = maxhpos * CYCLE_UNIT / 2;
        else if (per < 4 * CYCLE_UNIT)
                /* smaller values would cause extremely high cpu usage */
                per = 4 * CYCLE_UNIT;
 
-       if (audio_channel[nr].per == PERIOD_MAX - 1 && per != PERIOD_MAX - 1) {
-               audio_channel[nr].evtime = CYCLE_UNIT;
-               if (isaudio()) {
+       if (cdp->per == PERIOD_MAX - 1 && per != PERIOD_MAX - 1) {
+               cdp->evtime = CYCLE_UNIT;
+               if (isaudio ()) {
                        schedule_audio ();
                        events_schedule ();
                }
        }
 
-       audio_channel[nr].per = per;
+       cdp->per = per;
 #ifdef DEBUG_AUDIO
        if (debugchannel (nr))
                write_log (L"AUD%dPER: %d %08X\n", nr, v, M68K_GETPC);
@@ -1765,9 +1779,10 @@ void AUDxPER (int nr, uae_u16 v)
 
 void AUDxLEN (int nr, uae_u16 v)
 {
-       audio_activate();
+       struct audio_channel_data *cdp = audio_channel + nr;
+       audio_activate ();
        update_audio ();
-       audio_channel[nr].len = v;
+       cdp->len = v;
 #ifdef DEBUG_AUDIO
        if (debugchannel (nr))
                write_log (L"AUD%dLEN: %d %08X\n", nr, v, M68K_GETPC);
@@ -1776,11 +1791,12 @@ void AUDxLEN (int nr, uae_u16 v)
 
 void AUDxVOL (int nr, uae_u16 v)
 {
+       struct audio_channel_data *cdp = audio_channel + nr;
        int v2 = v & 64 ? 63 : v & 63;
 
-       audio_activate();
+       audio_activate ();
        update_audio ();
-       audio_channel[nr].vol = v2;
+       cdp->vol = v2;
 #ifdef DEBUG_AUDIO
        if (debugchannel (nr))
                write_log (L"AUD%dVOL: %d %08X\n", nr, v2, M68K_GETPC);
@@ -1818,7 +1834,7 @@ void audio_update_adkmasks (void)
        audio_channel[2].adk_mask = (((t >> 2) & 1) - 1);
        audio_channel[3].adk_mask = (((t >> 3) & 1) - 1);
        if ((prevcon & 0xff) != (adkcon & 0xff)) {
-               audio_activate();
+               audio_activate ();
 #ifdef DEBUG_AUDIO
                write_log (L"ADKCON=%02x %08X\n", adkcon & 0xff, M68K_GETPC);
 #endif
index 8399c0ca24d9a9bce6de578850d16531ba1e2a04..6ea2a5d99860e7b2d735b1b57d69c79b92505425 100644 (file)
@@ -562,6 +562,7 @@ void cfgfile_save_options (struct zfile *f, struct uae_prefs *p, int type)
        cfgfile_write (f, L"nr_floppies", L"%d", p->nr_floppies);
        cfgfile_write (f, L"floppy_speed", L"%d", p->floppy_speed);
        cfgfile_write (f, L"floppy_volume", L"%d", p->dfxclickvolume);
+       cfgfile_dwrite (f, L"floppy_channel_mask", L"0x%x", p->dfxclickchannelmask);
        cfgfile_write_bool (f, L"parallel_on_demand", p->parallel_demand);
        cfgfile_write_bool (f, L"serial_on_demand", p->serial_demand);
        cfgfile_write_bool (f, L"serial_hardware_ctsrts", p->serial_hwctsrts);
@@ -1171,6 +1172,7 @@ static int cfgfile_parse_host (struct uae_prefs *p, TCHAR *option, TCHAR *value)
                || cfgfile_intval (option, value, L"floppy1sound", &p->dfxclick[1], 1)
                || cfgfile_intval (option, value, L"floppy2sound", &p->dfxclick[2], 1)
                || cfgfile_intval (option, value, L"floppy3sound", &p->dfxclick[3], 1)
+               || cfgfile_intval (option, value, L"floppy_channel_mask", &p->dfxclickchannelmask, 1)
                || cfgfile_intval (option, value, L"floppy_volume", &p->dfxclickvolume, 1))
                return 1;
 
@@ -2449,8 +2451,11 @@ void cfgfile_backup (const TCHAR *path)
 
        fetch_configurationpath (dpath, sizeof (dpath) / sizeof (TCHAR));
        _tcscat (dpath, L"configuration.backup");
+       bool hidden = my_isfilehidden (dpath);
        my_unlink (dpath);
        my_rename (path, dpath);
+       if (hidden)
+               my_setfilehidden (dpath, hidden);
 }
 
 int cfgfile_save (struct uae_prefs *p, const TCHAR *filename, int type)
@@ -3511,6 +3516,7 @@ void default_prefs (struct uae_prefs *p, int type)
        p->floppy_random_bits_min = 1;
        p->floppy_random_bits_max = 3;
        p->dfxclickvolume = 33;
+       p->dfxclickchannelmask = 0xffff;
 
        p->statecapturebuffersize = 20 * 1024 * 1024;
        p->statecapturerate = 5 * 50;
@@ -4244,8 +4250,8 @@ void config_check_vsync (void)
        }
        cnt--;
        if (config_changed) {
-               if (config_changed == 1)
-                       write_log (L"* configuration check trigger\n");
+//             if (config_changed == 1)
+//                     write_log (L"* configuration check trigger\n");
                config_changed++;
                if (config_changed > 10)
                        config_changed = 0;
index 9bccf37970dfbed1a1777e58cb1ef46af5d7864f..a3cd40fda4dab3f1ceff2fc345ba124f40d7859a 100644 (file)
@@ -325,9 +325,9 @@ static int current_change_set;
 static struct sprite_entry sprite_entries[2][MAX_SPR_PIXELS / 16];
 static struct color_change color_changes[2][MAX_REG_CHANGE];
 
-struct decision line_decisions[2 * (MAXVPOS + 1) + 1];
-static struct draw_info line_drawinfo[2][2 * (MAXVPOS + 1) + 1];
-#define COLOR_TABLE_SIZE (MAXVPOS + 1) * 2
+struct decision line_decisions[2 * (MAXVPOS + 2) + 1];
+static struct draw_info line_drawinfo[2][2 * (MAXVPOS + 2) + 1];
+#define COLOR_TABLE_SIZE (MAXVPOS + 2) * 2
 static struct color_entry color_tables[2][COLOR_TABLE_SIZE];
 
 static int next_sprite_entry = 0;
@@ -2784,6 +2784,8 @@ void init_hz (void)
                dumpsync ();
                hzc = 1;
        }
+       if (maxvpos_nom >= MAXVPOS)
+               maxvpos_nom = MAXVPOS;
        if (currprefs.gfx_scandoubler && doublescan == 0)
                doublescan = -1;
        if (doublescan != odbl || maxvpos != omaxvpos)
index 9c80e9889e11a310fd7de147b28e1e6e313ea4f6..4f49adc053d16f738f64b895c295fe41b71e9715 100644 (file)
@@ -180,9 +180,9 @@ typedef void (*line_draw_func)(int, int);
 #define LINE_DONE_AS_PREVIOUS 8
 #define LINE_REMEMBERED_AS_PREVIOUS 9
 
-static uae_u8 linestate[(MAXVPOS + 1) * 2 + 1];
+static uae_u8 linestate[(MAXVPOS + 2) * 2 + 1];
 
-uae_u8 line_data[(MAXVPOS + 1) * 2][MAX_PLANES * MAX_WORDS_PER_LINE * 2];
+uae_u8 line_data[(MAXVPOS + 2) * 2][MAX_PLANES * MAX_WORDS_PER_LINE * 2];
 
 /* Centering variables.  */
 static int min_diwstart, max_diwstop;
@@ -1967,8 +1967,8 @@ static void pfield_draw_line (int lineno, int gfx_ypos, int follow_ypos)
        switch (linestate[lineno])
        {
        case LINE_REMEMBERED_AS_PREVIOUS:
-               if (!warned)
-                       write_log (L"Shouldn't get here... this is a bug.\n"), warned++;
+//             if (!warned) // happens when program messes up with VPOSW
+//                     write_log (L"Shouldn't get here... this is a bug.\n"), warned++;
                return;
 
        case LINE_BLACK:
index 6e1b1093ddf7d9573d47617b9d9bb66687d8e293..45eeb80f391a14da68a0ca7ca2803462dc4f3cd5 100644 (file)
@@ -327,7 +327,7 @@ STATIC_INLINE uae_s16 limit (uae_s32 v)
        return v;
 }
 
-void driveclick_mix (uae_s16 *sndbuffer, int size)
+void driveclick_mix (uae_s16 *sndbuffer, int size, int channelmask)
 {
        int i;
 
@@ -340,36 +340,49 @@ void driveclick_mix (uae_s16 *sndbuffer, int size)
        case 6:
                for (i = 0; i < size / 6; i++) {
                        uae_s16 s = clickbuffer[i];
-                       sndbuffer[0] = limit (((sndbuffer[0] + s) * 2) / 3);
-                       sndbuffer[1] = limit (((sndbuffer[1] + s) * 2) / 3);
-                       sndbuffer[2] = limit (((sndbuffer[2] + s) * 2) / 3);
-                       sndbuffer[3] = limit (((sndbuffer[3] + s) * 2) / 3);
-                       sndbuffer[4] = limit (((sndbuffer[4] + s) * 2) / 3);
-                       sndbuffer[5] = limit (((sndbuffer[5] + s) * 2) / 3);
+                       if (channelmask & 1)
+                               sndbuffer[0] = limit (((sndbuffer[0] + s) * 2) / 3);
+                       if (channelmask & 2)
+                               sndbuffer[1] = limit (((sndbuffer[1] + s) * 2) / 3);
+                       if (channelmask & 4)
+                               sndbuffer[2] = limit (((sndbuffer[2] + s) * 2) / 3);
+                       if (channelmask & 8)
+                               sndbuffer[3] = limit (((sndbuffer[3] + s) * 2) / 3);
+                       if (channelmask & 16)
+                               sndbuffer[4] = limit (((sndbuffer[4] + s) * 2) / 3);
+                       if (channelmask & 32)
+                               sndbuffer[5] = limit (((sndbuffer[5] + s) * 2) / 3);
                        sndbuffer += 6;
                }
                break;
        case 4:
                for (i = 0; i < size / 4; i++) {
                        uae_s16 s = clickbuffer[i];
-                       sndbuffer[0] = limit (((sndbuffer[0] + s) * 2) / 3);
-                       sndbuffer[1] = limit (((sndbuffer[1] + s) * 2) / 3);
-                       sndbuffer[2] = limit (((sndbuffer[2] + s) * 2) / 3);
-                       sndbuffer[3] = limit (((sndbuffer[3] + s) * 2) / 3);
+                       if (channelmask & 1)
+                               sndbuffer[0] = limit (((sndbuffer[0] + s) * 2) / 3);
+                       if (channelmask & 2)
+                               sndbuffer[1] = limit (((sndbuffer[1] + s) * 2) / 3);
+                       if (channelmask & 4)
+                               sndbuffer[2] = limit (((sndbuffer[2] + s) * 2) / 3);
+                       if (channelmask & 8)
+                               sndbuffer[3] = limit (((sndbuffer[3] + s) * 2) / 3);
                        sndbuffer += 4;
                }
                break;
        case 2:
                for (i = 0; i < size / 2; i++) {
                        uae_s16 s = clickbuffer[i];
-                       sndbuffer[0] = limit (((sndbuffer[0] + s) * 2) / 3);
-                       sndbuffer[1] = limit (((sndbuffer[1] + s) * 2) / 3);
+                       if (channelmask & 1)
+                               sndbuffer[0] = limit (((sndbuffer[0] + s) * 2) / 3);
+                       if (channelmask & 2)
+                               sndbuffer[1] = limit (((sndbuffer[1] + s) * 2) / 3);
                        sndbuffer += 2;
                }
                break;
        case 1:
                for (i = 0; i < size; i++) {
-                       sndbuffer[0] = limit (((sndbuffer[0] + clickbuffer[i]) * 2) / 3);
+                       if (channelmask & 1)
+                               sndbuffer[0] = limit (((sndbuffer[0] + clickbuffer[i]) * 2) / 3);
                        sndbuffer++;
                }
                break;
index 22355738e3408620ce16230ee626e411cac47d31..8dad9023848b01aff10dc463d30e582e3dac143c 100644 (file)
@@ -426,7 +426,7 @@ void alloc_colors64k (int rw, int gw, int bw, int rs, int gs, int bs, int aw, in
        xredcolor_s = rs;
        xgreencolor_s = gs;
        xbluecolor_s = bs;
-       xredcolor_m = (1 << rw) - 1;
-       xgreencolor_m = (1 << gw) - 1;
-       xbluecolor_m = (1 << bw) - 1;
+       xredcolor_m = ((1 << rw) - 1) << xredcolor_s;
+       xgreencolor_m = ((1 << gw) - 1) << xgreencolor_s;
+       xbluecolor_m = ((1 << bw) - 1) << xbluecolor_s;
 }
index cb74192ef769f4df01665fa66ea1c1ea6bbb59b2..88091bfd3e1289fe8156082bc58c1c2c1abecec1 100644 (file)
@@ -42,7 +42,6 @@ extern int action_replay_load (void);
 extern void action_replay_memory_reset (void);
 extern void action_replay_init (int);
 extern void action_replay_cleanup (void);
-extern void action_replay_chipwrite (void);
 extern void action_replay_map_banks (void);
 extern void REGPARAM3 chipmem_lput_actionreplay23 (uaecptr addr, uae_u32 l) REGPARAM;
 extern void REGPARAM3 chipmem_wput_actionreplay23 (uaecptr addr, uae_u32 w) REGPARAM;
index 6ee3d55ce8111354065597a4af51c679fdcc6dfb..27e6fa6fe902c6bbe4d4e808468e20207d7edf29 100644 (file)
@@ -206,7 +206,7 @@ extern struct color_change *color_changes[2];
 extern struct color_change color_changes[2][MAX_REG_CHANGE];
 #endif
 
-extern struct color_entry color_tables[2][(MAXVPOS + 1) * 2];
+extern struct color_entry color_tables[2][(MAXVPOS + 2) * 2];
 extern struct color_entry *curr_color_tables, *prev_color_tables;
 
 extern struct sprite_entry *curr_sprite_entries, *prev_sprite_entries;
@@ -243,10 +243,10 @@ struct draw_info {
 
 extern int next_sprite_entry;
 
-extern struct decision line_decisions[2 * (MAXVPOS + 1) + 1];
-extern struct draw_info line_drawinfo[2][2 * (MAXVPOS + 1) + 1];
+extern struct decision line_decisions[2 * (MAXVPOS + 2) + 1];
+extern struct draw_info line_drawinfo[2][2 * (MAXVPOS + 2) + 1];
 
-extern uae_u8 line_data[(MAXVPOS + 1) * 2][MAX_PLANES * MAX_WORDS_PER_LINE * 2];
+extern uae_u8 line_data[(MAXVPOS + 2) * 2][MAX_PLANES * MAX_WORDS_PER_LINE * 2];
 
 /* Functions in drawing.c.  */
 extern int coord_native_to_amiga_y (int);
index 6be25f24ac4703e4a8ab9e52b2b0569f7b52e93c..fabc7b99a9e8f3fbd5a647a18fd0788a117713f1 100644 (file)
@@ -30,7 +30,7 @@ extern void driveclick_insert (int drive, int eject);
 extern void driveclick_init (void);
 extern void driveclick_free (void);
 extern void driveclick_reset (void);
-extern void driveclick_mix (uae_s16*, int);
+extern void driveclick_mix (uae_s16*, int, int);
 extern int driveclick_loadresource (struct drvsample*, int);
 extern void driveclick_check_prefs (void);
 extern uae_s16 *decodewav (uae_u8 *s, int *len);
index 60e7e50e467a3969df8cf80a1ca91dff4878604c..08abbf3fc0ae4b865b3048c190edf8a12956522d 100644 (file)
@@ -132,6 +132,8 @@ extern int my_mkdir (const TCHAR*);
 extern int my_unlink (const TCHAR*);
 extern int my_rename (const TCHAR*, const TCHAR*);
 extern int my_setcurrentdir (const TCHAR *curdir, TCHAR *oldcur);
+bool my_isfilehidden (const TCHAR *path);
+void my_setfilehidden (const TCHAR *path, bool hidden);
 
 extern struct my_openfile_s *my_open (const TCHAR*, int);
 extern void my_close (struct my_openfile_s*);
index 9bb3a237dc858ab7b2c8b3509c9b97ff82d1e32a..43ced3bddee1cd1d5a1b1ece530caa77fccbbcc3 100644 (file)
@@ -324,6 +324,7 @@ struct uae_prefs {
        int dfxclick[4];
        TCHAR dfxclickexternal[4][256];
        int dfxclickvolume;
+       int dfxclickchannelmask;
 
        /* Target specific options */
 
index bd5db1b90e77aa325492463dc2ee2b46c41b1b7b..38281747d9b079b8b21a09817665c34c284bda98 100644 (file)
@@ -1,28 +1,28 @@
 extern int decode_cloanto_rom_do (uae_u8 *mem, int size, int real_size);
 
-#define ROMTYPE_KICK       0x000001
-#define ROMTYPE_KICKCD32    0x000002
-#define ROMTYPE_EXTCD32            0x000004
-#define ROMTYPE_EXTCDTV            0x000008
-#define ROMTYPE_A2091BOOT   0x000010
-#define ROMTYPE_A4091BOOT   0x000020
-#define ROMTYPE_AR         0x000040
-#define ROMTYPE_SUPERIV            0x000080
-#define ROMTYPE_KEY        0x000100
-#define ROMTYPE_ARCADIABIOS 0x000200
-#define ROMTYPE_ARCADIAGAME 0x000400
-#define ROMTYPE_HRTMON     0x000800
-#define ROMTYPE_NORDIC     0x001000
-#define ROMTYPE_XPOWER     0x002000
-#define ROMTYPE_CD32CART    0x004000
-#define ROMTYPE_SPECIALKICK 0x008000
-#define ROMTYPE_MASK       0x01ffff
-#define ROMTYPE_EVEN       0x020000
-#define ROMTYPE_ODD        0x040000
-#define ROMTYPE_8BIT       0x080000
-#define ROMTYPE_BYTESWAP    0x100000
-#define ROMTYPE_CD32       0x200000
-#define ROMTYPE_SCRAMBLED   0x400000
+#define ROMTYPE_KICK           0x000001
+#define ROMTYPE_KICKCD32       0x000002
+#define ROMTYPE_EXTCD32                0x000004
+#define ROMTYPE_EXTCDTV                0x000008
+#define ROMTYPE_A2091BOOT      0x000010
+#define ROMTYPE_A4091BOOT      0x000020
+#define ROMTYPE_AR                     0x000040
+#define ROMTYPE_SUPERIV                0x000080
+#define ROMTYPE_KEY                    0x000100
+#define ROMTYPE_ARCADIABIOS    0x000200
+#define ROMTYPE_ARCADIAGAME    0x000400
+#define ROMTYPE_HRTMON         0x000800
+#define ROMTYPE_NORDIC         0x001000
+#define ROMTYPE_XPOWER         0x002000
+#define ROMTYPE_CD32CART       0x004000
+#define ROMTYPE_SPECIALKICK    0x008000
+#define ROMTYPE_MASK           0x01ffff
+#define ROMTYPE_EVEN           0x020000
+#define ROMTYPE_ODD                    0x040000
+#define ROMTYPE_8BIT           0x080000
+#define ROMTYPE_BYTESWAP       0x100000
+#define ROMTYPE_CD32           0x200000
+#define ROMTYPE_SCRAMBLED      0x400000
 
 struct romheader {
        TCHAR *name;
index 1f7ed072f717157f4c662bcd6a2ad708989fc736..18f7dba44f3843b404a35f6c96b7bb2bdd612211 100644 (file)
@@ -681,7 +681,9 @@ static void write_kbr_config (struct zfile *f, int idnum, int devnum, struct uae
                        kbr->port[i][SPARE_SUB_EVENT] &&
                        keyboard_default[k].evt == kbr->eventid[i][SPARE_SUB_EVENT] && keyboard_default[k].flags == (kbr->flags[i][SPARE_SUB_EVENT] & ID_FLAG_SAVE_MASK);
 
-               if (kbr->port[i][0] > 0 && !(kbr->flags[i][0] & ID_FLAG_GAMEPORTSCUSTOM) && (kbr->port[i][SPARE_SUB_EVENT] == 0 || isdefaultspare))
+               if (kbr->port[i][0] > 0 && !(kbr->flags[i][0] & ID_FLAG_GAMEPORTSCUSTOM) && 
+                       (kbr->eventid[i][1] <= 0 && kbr->eventid[i][2] <= 0 && kbr->eventid[i][3] <= 0) &&
+                       (kbr->port[i][SPARE_SUB_EVENT] == 0 || isdefaultspare))
                        skip = 1;
                if (kbr->eventid[i][0] == 0 && (kbr->flags[i][0] & ID_FLAG_SAVE_MASK) == 0 && keyboard_default[k].scancode < 0)
                        skip = 1;
@@ -722,8 +724,7 @@ static void write_kbr_config (struct zfile *f, int idnum, int devnum, struct uae
                        }
                }
                idf->get_widget_type (devnum, i, tmp5, NULL);
-               p = tmp5 + _tcslen (tmp5) + 1;
-               _stprintf (tmp3, L"%d%s%s", kbr->extra[i], p[0] ? L"." : L"", p[0] ? p : L"");
+               _stprintf (tmp3, L"%d%s%s", kbr->extra[i], tmp5[0] ? L"." : L"", tmp5[0] ? tmp5 : L"");
                kbrlabel (tmp3);
                _stprintf (tmp1, L"keyboard.%d.button.%s", devnum, tmp3);
                _stprintf (tmp4, L"input.%d.%s", idnum + 1, tmp1);
@@ -4912,10 +4913,7 @@ void inputdevice_get_eventname (const struct inputevent *ie, TCHAR *out)
 {
        if (!out)
                return;
-       if (ie->allow_mask == AM_K)
-               _stprintf (out, L"%s (0x%02X)", ie->name, ie->data);
-       else
-               _tcscpy (out, ie->name);
+       _tcscpy (out, ie->name);
 }
 
 int inputdevice_iterate (int devnum, int num, TCHAR *name, int *af)
@@ -5598,7 +5596,7 @@ int inputdevice_joyport_config (struct uae_prefs *p, TCHAR *value, int portnum,
                                struct inputdevice_functions *idf;
                                int type = IDTYPE_MOUSE;
                                int idnum = JSEM_MICE;
-                               if (j == 0) {
+                               if (j > 0) {
                                        type = IDTYPE_JOYSTICK;
                                        idnum = JSEM_JOYS;
                                }
@@ -5619,20 +5617,23 @@ int inputdevice_joyport_config (struct uae_prefs *p, TCHAR *value, int portnum,
                break;
        case 0:
                {
-                       int start = JPORT_NONE, got = 0;
+                       int start = JPORT_NONE, got = 0, max = 0;
                        TCHAR *pp = 0;
                        if (_tcsncmp (value, L"kbd", 3) == 0) {
                                start = JSEM_KBDLAYOUT;
                                pp = value + 3;
                                got = 1;
+                               max = JSEM_LASTKBD;
                        } else if (_tcsncmp (value, L"joy", 3) == 0) {
                                start = JSEM_JOYS;
                                pp = value + 3;
                                got = 1;
+                               max = idev[IDTYPE_JOYSTICK].get_num ();
                        } else if (_tcsncmp (value, L"mouse", 5) == 0) {
                                start = JSEM_MICE;
                                pp = value + 5;
                                got = 1;
+                               max = idev[IDTYPE_MOUSE].get_num ();
                        } else if (_tcscmp (value, L"none") == 0) {
                                got = 2;
                        } else if (_tcscmp (value, L"custom") == 0) {
@@ -5646,6 +5647,8 @@ int inputdevice_joyport_config (struct uae_prefs *p, TCHAR *value, int portnum,
                                                if (start == JSEM_KBDLAYOUT && v > 0)
                                                        v--;
                                                if (v >= 0) {
+                                                       if (v >= max)
+                                                               v = 0;
                                                        start += v;
                                                        got = 2;
                                                }
index 773381c9c874313713d5665c9ba5fea52712134f..d43a247e62b95934273fd7ceb1fb2c94be717796 100644 (file)
@@ -457,7 +457,8 @@ static void from_iff_ilbm (uaecptr ilbm, uae_u32 len)
 
        addr += 12;
        for (;;) {
-               uae_u8 chunk[4], csize;
+               int csize;
+               uae_u8 chunk[4];
                uae_u8 *paddr, *ceaddr;
 
                paddr = addr;
index 643d6318710c04ae99a65e60db74bcea9011994a..38ec6d1ef8f08db4d09342a85c38b5c20fa91387 100644 (file)
@@ -909,7 +909,7 @@ static int initialize_rawinput (void)
                                                j++;
                                        }
                                        if (!tmp[0])
-                                               _stprintf (tmp, L"Key %02X", k + 1);
+                                               _stprintf (tmp, L"KEY_%02X", k + 1);
                                        did->buttonname[k] = my_strdup (tmp);
                                        did->buttonmappings[k] = k + 1;
                                        did->buttonsort[k] = k + 1;
@@ -1847,11 +1847,8 @@ static int get_kb_widget_first (int kb, int type)
 
 static int get_kb_widget_type (int kb, int num, TCHAR *name, uae_u32 *code)
 {
-       if (name) {
-               _stprintf (name, L"[%02X] %s", di_keyboard[kb].buttonmappings[num], di_keyboard[kb].buttonname[num]);
-               name += _tcslen (name) + 1;
+       if (name)
                _tcscpy (name, di_keyboard[kb].buttonname[num]);
-       }
        if (code)
                *code = di_keyboard[kb].buttonmappings[num];
        return IDEV_WIDGET_KEY;
@@ -1890,8 +1887,8 @@ static uae_u32 get_leds (void)
                        led |= KBLED_NUMLOCK;
                if (OutputBuffer.LedFlags & KEYBOARD_CAPS_LOCK_ON)
                        led |= KBLED_CAPSLOCK;
-               if (OutputBuffer.LedFlags & KEYBOARD_SCROLL_LOCK_ON) led
-                       |= KBLED_SCROLLLOCK;
+               if (OutputBuffer.LedFlags & KEYBOARD_SCROLL_LOCK_ON)
+                       led |= KBLED_SCROLLLOCK;
 #endif
        }
        return led;
index 5d647a864122e29fee9bbe115e322193a90183ee..be2c8e65e8751bdc7d598b6e767b797d66754f2e 100644 (file)
@@ -7,6 +7,27 @@
 #include "win32.h"
 #include <windows.h>
 
+bool my_isfilehidden (const TCHAR *path)
+{
+       DWORD attr = GetFileAttributes (path);
+       if (attr != INVALID_FILE_ATTRIBUTES && (attr & FILE_ATTRIBUTE_HIDDEN))
+               return true;
+       return false;
+}
+void my_setfilehidden (const TCHAR *path, bool hidden)
+{
+       DWORD attr = GetFileAttributes (path);
+       if (attr == INVALID_FILE_ATTRIBUTES)
+               return;
+       DWORD attro = attr;
+       attr &= ~FILE_ATTRIBUTE_HIDDEN;
+       if (hidden)
+               attr |= FILE_ATTRIBUTE_HIDDEN;
+       if (attro == attr)
+               return;
+       SetFileAttributes (path, attr);
+}
+
 int my_setcurrentdir (const TCHAR *curdir, TCHAR *oldcur)
 {
        int ret = 0;
index 7e9c5f17e1fbe029958505335b94e05887f43978..7271c6f2b62d238a6fc9d059309ff7772592dd93 100644 (file)
@@ -1879,7 +1879,7 @@ void finish_sound_buffer (void)
                        channelswap6 ((uae_s16*)paula_sndbuffer, sdp->sndbufsize / 2);
        }
 #ifdef DRIVESOUND
-       driveclick_mix ((uae_s16*)paula_sndbuffer, sdp->sndbufsize / 2);
+       driveclick_mix ((uae_s16*)paula_sndbuffer, sdp->sndbufsize / 2, currprefs.dfxclickchannelmask);
 #endif
 #ifdef AVIOUTPUT
        if (avioutput_enabled && avioutput_audio)
index b708e384cfd3f50cb1110924a66cada61b515627..397ec326e6466dc68e7225e95ed64d1bdb9a38c1 100644 (file)
@@ -18,9 +18,9 @@
 #define WINUAEPUBLICBETA 1
 #define LANG_DLL 1
 
-#define WINUAEBETA L"8"
-#define WINUAEDATE MAKEBD(2010, 6, 11)
-#define WINUAEEXTRA L""
+#define WINUAEBETA L"10"
+#define WINUAEDATE MAKEBD(2010, 6, 15)
+#define WINUAEEXTRA L"RC1"
 #define WINUAEREV L""
 
 #define IHF_WINDOWHIDDEN 6
index 87124dde87f9363a9657f5b565d2565a44d1cacc..831181f19d816b8850ade9ea3beebeda6e8e5ecb 100644 (file)
@@ -1751,7 +1751,7 @@ bool vsync_switchmode (int hz, int oldhz)
                }
        }
        if (!found) {
-               tempvsync = currprefs.gfx_avsync;
+               tempvsync = currprefs.gfx_avsync != 0;
                changed_prefs.gfx_avsync = 0;
                write_log (L"refresh rate changed to %d but no matching screenmode found, vsync disabled\n", hz);
        } else {
index fd8dc6308e91ee65d0aedfac9ea41f7000798fca..39d9494ac1e3766a0bf760cb24c6cec1cc37599a 100644 (file)
@@ -2630,9 +2630,12 @@ static void flushconfigcache (const TCHAR *cachepath)
        if (zcache == NULL)
                return;
        fclose (zcache);
+       bool hidden = my_isfilehidden (cachepath);
+       my_setfilehidden (cachepath, false);
        zcache = _tfopen (cachepath, L"w+, ccs=UTF-8");
        if (zcache)
                fclose (zcache);
+       my_setfilehidden (cachepath, hidden);
        write_log (L"'%s' flushed\n", cachepath);
 }
 
@@ -2899,6 +2902,8 @@ static void writeconfigcache (const TCHAR *path)
        if (!configurationcache)
                return;
        getconfigcache (cachepath, path);
+       bool hidden = my_isfilehidden (cachepath);
+       my_setfilehidden (cachepath, false);
        zcache = _tfopen (cachepath, L"w, ccs=UTF-8");
        if (!zcache)
                return;
@@ -2921,6 +2926,7 @@ static void writeconfigcache (const TCHAR *path)
                        writeconfigcacheentry (zcache, path2, cs);
        }
        fclose (zcache);
+       my_setfilehidden (cachepath, hidden);
        write_log (L"'%s' created\n", cachepath);
 }
 
@@ -3279,7 +3285,7 @@ static int inputmap_handle (HWND list, int currentdevnum, int currentwidgetnum,
 
                                if (list) {
                                        LVGROUP group;
-                                       group.cbSize = sizeof(LVGROUP);
+                                       group.cbSize = sizeof (LVGROUP);
                                        group.mask = LVGF_HEADER | LVGF_GROUPID;
                                        group.pszHeader = (TCHAR*)evt->name;
                                        group.iGroupId = cntgroup;
@@ -11300,6 +11306,7 @@ static void CALLBACK timerfunc (HWND hDlg, UINT uMsg, UINT_PTR idEvent, DWORD dw
                                int op = inputmap_port;
                                if (inputmap_handle (NULL, input_selected_device, input_selected_widget, &op, &inputmap_index, state)) {
                                        if (op == inputmap_port) {
+                                               ListView_EnsureVisible (h, 1, FALSE);
                                                ListView_EnsureVisible (h, inputmap_index, FALSE);
                                                ListView_SetItemState (h, -1, 0, LVIS_SELECTED | LVIS_FOCUSED);
                                                ListView_SetItemState (h, inputmap_index, LVIS_SELECTED , LVIS_SELECTED);
index ea6f4f2e8d0e06eaec1bffa7ef56cedd1a93c357..1cf74857ed903a62e4c9bc09e5229f6f0adb97bf 100644 (file)
       <SuppressStartupBanner>true</SuppressStartupBanner>
       <AdditionalLibraryDirectories>%(AdditionalLibraryDirectories);$(SolutionDir)\..\lib\</AdditionalLibraryDirectories>
       <IgnoreSpecificDefaultLibraries>%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
-      <DelayLoadDLLs>wpcap.dll;packet.dll;d3dx9_42.dll;openal32.dll;wintab32.dll;portaudio_x64.dll;ws2_32.dll;msacm32.dll;wtsapi32.dll;dsound.dll;%(DelayLoadDLLs)</DelayLoadDLLs>
+      <DelayLoadDLLs>wpcap.dll;packet.dll;d3dx9_43.dll;openal32.dll;wintab32.dll;portaudio_x64.dll;ws2_32.dll;msacm32.dll;wtsapi32.dll;dsound.dll;%(DelayLoadDLLs)</DelayLoadDLLs>
       <GenerateDebugInformation>true</GenerateDebugInformation>
       <ProgramDatabaseFile>$(Platform)\$(Configuration)\winuae.pdb</ProgramDatabaseFile>
       <SubSystem>Windows</SubSystem>
       <Culture>0x0409</Culture>
     </ResourceCompile>
     <Link>
-      <AdditionalDependencies>ws2_32.lib;ddraw.lib;dxguid.lib;winmm.lib;comctl32.lib;version.lib;vfw32.lib;msacm32.lib;dsound.lib;dinput8.lib;d3d9.lib;d3dx9.lib;setupapi.lib;wininet.lib;dxerr.lib;shlwapi.lib;zlibstat.lib;portaudio_x64.lib;packet.lib;wpcap.lib;openal32.lib;libpng.lib;lglcd.lib;wtsapi32.lib;wntab32x.lib;enet_x64.lib;prowizard.lib;%(AdditionalDependencies)</AdditionalDependencies>
+      <AdditionalDependencies>ws2_32.lib;ddraw.lib;dxguid.lib;winmm.lib;comctl32.lib;version.lib;vfw32.lib;msacm32.lib;dsound.lib;dinput8.lib;d3d9.lib;d3dx9.lib;setupapi.lib;wininet.lib;dxerr.lib;shlwapi.lib;zlibstat.lib;portaudio_x64.lib;packet.lib;wpcap.lib;openal32.lib;libpng.lib;lglcd.lib;wtsapi32.lib;wntab32x.lib;enet_x64.lib;prowizard_x64.lib;lzmalib.lib;%(AdditionalDependencies)</AdditionalDependencies>
       <ShowProgress>NotSet</ShowProgress>
       <OutputFile>d:\amiga\winuae64.exe</OutputFile>
       <SuppressStartupBanner>true</SuppressStartupBanner>
       <AdditionalLibraryDirectories>%(AdditionalLibraryDirectories);$(SolutionDir)\..\lib\</AdditionalLibraryDirectories>
       <IgnoreSpecificDefaultLibraries>%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
-      <DelayLoadDLLs>wpcap.dll;packet.dll;d3dx9_42.dll;openal32.dll;wintab32.dll;portaudio_x64.dll;freetype6.dll;ws2_32.dll;msacm32.dll;wtsapi32.dll;dsound.dll;avrt.dll;%(DelayLoadDLLs)</DelayLoadDLLs>
+      <DelayLoadDLLs>wpcap.dll;packet.dll;d3dx9_43.dll;openal32.dll;wintab32.dll;portaudio_x64.dll;ws2_32.dll;msacm32.dll;wtsapi32.dll;dsound.dll;%(DelayLoadDLLs)</DelayLoadDLLs>
       <GenerateDebugInformation>true</GenerateDebugInformation>
       <ProgramDatabaseFile>$(Platform)\$(Configuration)\winuae.pdb</ProgramDatabaseFile>
       <SubSystem>Windows</SubSystem>
index eb6a274be426faf5002479d9eba48840e0c9b653..81e65c57766d6042929d0173fcb0fdf5c180563c 100644 (file)
@@ -1,8 +1,37 @@
 
+Beta 10: (RC1, official release before Midsummer)
+
+- some V(H)POSW modifications corrupted memory (AR3 for example)
+- AR3 3.09 odd/even pair rom image didn't load correctly
+- AR1 has never worked in cycle-exact mode
+- Amiga->Windows image clipboard sharing didn't work if any IFF
+  chunk (except body) size was more than 255 bytes
+- removed confusing and useless Input keyboard key numbers
+- GamePorts test mode list vertical centering improved
+- configuration file joyportX=kbdZ/joyZ/mouseZ (where Z is larger
+  than max available devices) was not checked
+- floppy sound channel mask added, configuration file only (floppy_channel_mask),
+  default is all channels. 1=left,2=right,4=center,8=sub,16=surleft,32=surright.
+- keyboard input configuration slots 2/3/4 not saved if slot 1 contained port
+  configuration and stored slot 1 was mapped to default keyboard key
+- configuration.backup and configuration.cache remembers hidden file attribute
+
+Beta 9:
+
+- "megachip" was added even if disabled (was fixed in b8 update)
+- fixed DX detection on XP (was fixed in b8 update)
+- removed "*" from DirectInput keyboard and mouse name strings
+- uaeunp/virtual archives: if input file was inside archive and it had multiple output
+  files (most raw disk image formats can have .ima, .adf and .ext.adf output files)
+  only first supported file was listed. Plain files worked correctly.
+- added "scanning ROMs" dialog
+- fixed old memory corruption bug if rom scan data has single rom from odd/even pair
+  (unpaired rom removal code was buggy)
+
 Beta 8:
 
-- Z3Chip is not a Z3 board anymore, now also compatible with KS 1.x (32-bit addressing
-  capable CPU required)
+- Z3Chip is not a Z3 board anymore, now also compatible with KS 1.x (don't forget that
+  32-bit addressing capable CPU is required)
 - rawkeyboard RIDEV_NOHOTKEYS flag was missing (Disables Windows keys etc..)
 - GamePorts remap/test GUI updated
 - GamePorts remap when in Configuration#x mode didn't update GamePorts input mappings
index e3069f4b0ccea2589962bdac9422a58316302008..c4d200ed08be977290b2ca3fe1f3ca6fb425f498 100644 (file)
@@ -377,7 +377,7 @@ static void romlist_cleanup (void)
        }
 }
 
-struct romlist **getromlistbyident(int ver, int rev, int subver, int subrev, TCHAR *model, int all)
+struct romlist **getromlistbyident (int ver, int rev, int subver, int subrev, TCHAR *model, int all)
 {
        int i, j, ok, out, max;
        struct romdata *rd;
@@ -1146,7 +1146,18 @@ struct zfile *read_rom (struct romdata **prd)
                        }
                        if (get_crc32 (buf, size) == crc32) {
                                ok = 1;
-                       } else {
+                       }
+                       if (!ok && (rd->type & ROMTYPE_AR)) {
+                               uae_u8 tmp[2];
+                               tmp[0] = buf[0];
+                               tmp[1] = buf[1];
+                               buf[0] = buf[1] = 0;
+                               if (get_crc32 (buf, size) == crc32)
+                                       ok = 1;
+                               buf[0] = tmp[0];
+                               buf[1] = tmp[1];
+                       }
+                       if (!ok) {
                                /* perhaps it is byteswapped without byteswap entry? */
                                byteswap (buf, size);
                                if (get_crc32 (buf, size) == crc32)