]> git.unchartedbackwaters.co.uk Git - francis/winuae.git/commitdiff
2500b25
authorToni Wilen <twilen@winuae.net>
Sat, 10 Nov 2012 19:27:38 +0000 (21:27 +0200)
committerToni Wilen <twilen@winuae.net>
Sat, 10 Nov 2012 19:27:38 +0000 (21:27 +0200)
26 files changed:
ar.cpp
cfgfile.cpp
custom.cpp
drawing.cpp
hardfile.cpp
include/ar.h
include/custom.h
include/filesys.h
include/uae.h
main.cpp
newcpu.cpp
od-win32/bsdsock.cpp
od-win32/direct3d.cpp
od-win32/hardfile_win32.cpp
od-win32/lib/prowizard.lib
od-win32/lib/prowizard_x64.lib
od-win32/resources/resource.h [changed mode: 0644->0755]
od-win32/resources/winuae.rc [changed mode: 0644->0755]
od-win32/rp.cpp
od-win32/rp.h
od-win32/win32.h
od-win32/win32gfx.cpp
od-win32/win32gui.cpp
od-win32/win32gui_extra.cpp
od-win32/winuaechangelog.txt
prowizard/rippers/AC1D_packer.c

diff --git a/ar.cpp b/ar.cpp
index a25e33133c57bd0cfb4e931ee3c4fd36018a858e..d15c5f2fc06a986f8955dbd61cc79b883c54e013 100644 (file)
--- a/ar.cpp
+++ b/ar.cpp
@@ -911,7 +911,7 @@ static void hide_cart (int hide)
 {
 #ifdef ACTION_REPLAY_HIDE_CARTRIDGE
        if(hide) {
-               ;//action_replay_unmap_banks ();
+               action_replay_unmap_banks ();
        } else {
                action_replay_map_banks ();
        }
@@ -927,7 +927,7 @@ static void hide_cart (int hide)
 
 static void action_replay_go (void)
 {
-       write_log (_T("AR GO %d\n"), armode);
+       //write_log (_T("AR GO %d\n"), armode);
        cartridge_enter();
        hide_cart (0);
        memcpy (armemory_ram + 0xf000, ar_custom, 2 * 256);
@@ -1080,7 +1080,7 @@ void check_prefs_changed_carts (int in_memory_reset)
        }
 }
 
-void action_replay_reset (bool hardreset)
+void action_replay_reset (bool hardreset, bool keyboardreset)
 {
        if (hrtmemory) {
                if (isrestore ()) {
@@ -1111,7 +1111,7 @@ void action_replay_reset (bool hardreset)
                        write_log_debug (_T("Setting flag to ACTION_REPLAY_WAITRESET (%d)\n"), hardreset);
                        write_log_debug (_T("armode == %d\n"), armode);
                        action_replay_flag = ACTION_REPLAY_WAITRESET;
-                       if (hardreset)
+                       if (hardreset || keyboardreset || armodel == 2)
                                action_replay_hardreset = true;
                        hide_cart (0);
                }
@@ -1156,7 +1156,7 @@ int action_replay_freeze (void)
 
 static void action_replay_chipwrite (void)
 {
-       write_log (_T("AR CW\n"));
+       //write_log (_T("AR CW\n"));
        if (armodel == 2 || armodel == 3) {
                action_replay_flag = ACTION_REPLAY_DORESET;
                set_special (SPCFLAG_ACTION_REPLAY);
index 7331922c22cb573b15ee9940d98acfaa102dd9a6..0d3e2a230f038fc8c553f77fcf87e95496def59c 100644 (file)
@@ -2186,7 +2186,7 @@ struct uaedev_config_info *add_filesys_config (struct uae_prefs *p, int index,
        int cyls, int secspertrack, int surfaces, int reserved,
        int blocksize, int bootpri,
        const TCHAR *filesysdir, int hdc, int flag,
-       int pcyls, int psecs, int pheads)
+       int pcyls, int pheads, int psecs)
 {
        struct uaedev_config_info *uci;
        int i;
@@ -2223,6 +2223,8 @@ struct uaedev_config_info *add_filesys_config (struct uae_prefs *p, int index,
        uci->bootpri = bootpri;
        uci->donotmount = 0;
        uci->autoboot = 0;
+       if (!pcyls || !pheads || !psecs)
+               pcyls = pheads = psecs = 0;
        uci->pcyls = pcyls;
        uci->pheads = pheads;
        uci->psecs = psecs;
index e047aefb42e0cbb92c60b7e107ec77dc56b1598a..e59d8e388840e7b9675e095e93c01d03d99d2999 100644 (file)
@@ -4977,6 +4977,13 @@ static void compute_spcflag_copper (int hpos)
                        hpos = maxhpos_short & ~1;
                cop_state.hpos = hpos;
        }
+
+       // if COPJMPx was written while DMA was disabled, advance to next state,
+       // COP_strobe_extra is single cycle only and does not need free bus.
+       // (copper state emulation does not run if DMA is disabled)
+       if (!wasenabled && cop_state.state == COP_strobe_extra)
+               cop_state.state = COP_strobe_delay1;
+
        copper_enabled_thisline = 1;
        set_special (SPCFLAG_COPPER);
 }
@@ -6580,7 +6587,7 @@ void custom_prepare (void)
        hsync_handler_post (true);
 }
 
-void custom_reset (int hardreset)
+void custom_reset (bool hardreset, bool keyboardreset)
 {
        int i;
        int zero = 0;
@@ -6764,7 +6771,7 @@ void custom_reset (int hardreset)
 
 #ifdef ACTION_REPLAY
        /* Doing this here ensures we can use the 'reset' command from within AR */
-       action_replay_reset (hardreset != 0);
+       action_replay_reset (hardreset, keyboardreset);
 #endif
 #if defined(ENFORCER)
        enforcer_disable ();
index 19aae919557d92423feb910f061fe27ac0cfb447..d383f4599d985b50ec4da4f00f551e1e5fce8213 100644 (file)
@@ -415,9 +415,17 @@ int get_custom_limits (int *pw, int *ph, int *pdx, int *pdy, int *prealh)
                ret = -1;
 
        if (interlace_seen) {
+               static int interlace_count;
                // interlace = only use long frames
+               if (lof_store && (interlace_count & 1) == 0)
+                       interlace_count++;
+               if (!lof_store && (interlace_count & 1) != 0)
+                       interlace_count++;
+               if (interlace_count < 3)
+                       return ret;
                if (!lof_store)
                        return ret;
+               interlace_count = 0;
                /* program may have set last visible line as last possible line (CD32 boot screen) */
                if (last_planes_vpos < maxvpos)
                        last_planes_vpos++;
index 32800cfebb287ac344d50d17d1205ba82752c165..3415d052da64df869459ac30520705c2885a0800 100644 (file)
@@ -134,7 +134,7 @@ static void getchs2 (struct hardfiledata *hfd, int *cyl, int *cylsec, int *head,
        *head = heads;
 }
 
-static void getchs (struct hardfiledata *hfd, int *cyl, int *cylsec, int *head, int *tracksec)
+static void getchsx (struct hardfiledata *hfd, int *cyl, int *cylsec, int *head, int *tracksec)
 {
        getchs2 (hfd, cyl, cylsec, head, tracksec);
        hf_log (_T("CHS: %08X-%08X %d %d %d %d %d\n"),
@@ -228,20 +228,32 @@ void getchsgeometry_hdf (struct hardfiledata *hfd, uae_u64 size, int *pcyl, int
        getchsgeometry2 (size, pcyl, phead, psectorspertrack, 2);
 }
 
-static void getchshd (struct hardfiledata *hfd, int *pcyl, int *phead, int *psectorspertrack)
+void getchspgeometry (uae_u64 total, int *pcyl, int *phead, int *psectorspertrack, bool idegeometry)
 {
-       uae_u64 total = hfd->virtsize / 512;
+       uae_u64 blocks = total / 512;
 
-       if (total > 16515072) {
+       if (blocks > 16515072) {
                /* >8G, CHS=16383/16/63 */
                *pcyl = 16383;
                *phead = 16;
                *psectorspertrack = 63;
                return;
        }
-       getchsgeometry (hfd->virtsize, pcyl, phead, psectorspertrack);
+       if (idegeometry) {
+               *phead = 16;
+               *psectorspertrack = 63;
+               *pcyl = blocks / ((*psectorspertrack) * (*phead));
+               return;
+       }
+       getchsgeometry (total, pcyl, phead, psectorspertrack);
 }
 
+static void getchshd (struct hardfiledata *hfd, int *pcyl, int *phead, int *psectorspertrack)
+{
+       getchspgeometry (hfd->virtsize, pcyl, phead, psectorspertrack, false);
+}
+
+
 static void pl (uae_u8 *p, int off, uae_u32 v)
 {
        p += off * 4;
@@ -1170,7 +1182,7 @@ int scsi_emulate (struct hardfiledata *hfd, struct hd_hardfiledata *hdhfd, uae_u
                                tracksec = hdhfd->secspertrack;
                                cylsec = 0;
                        } else {
-                               getchs (hfd, &cyl, &cylsec, &head, &tracksec);
+                               getchsx (hfd, &cyl, &cylsec, &head, &tracksec);
                        }
                        //write_log (_T("MODE SENSE PC=%d CODE=%d DBD=%d\n"), pc, pcode, dbd);
                        p = r;
@@ -1236,7 +1248,7 @@ int scsi_emulate (struct hardfiledata *hfd, struct hd_hardfiledata *hdhfd, uae_u
                                tracksec = hdhfd->secspertrack;
                                cylsec = 0;
                        } else {
-                               getchs (hfd, &cyl, &cylsec, &head, &tracksec);
+                               getchsx (hfd, &cyl, &cylsec, &head, &tracksec);
                        }
                        if (pmi == 0 && lba != 0)
                                goto errreq;
@@ -1770,7 +1782,7 @@ no_disk:
        case CMD_GETNUMTRACKS:
                {
                        int cyl, cylsec, head, tracksec;
-                       getchs (hfd, &cyl, &cylsec, &head, &tracksec);
+                       getchsx (hfd, &cyl, &cylsec, &head, &tracksec);
                        actual = cyl * head;
                        break;
                }
@@ -1779,7 +1791,7 @@ no_disk:
                {
                        int cyl, cylsec, head, tracksec;
                        uae_u64 size;
-                       getchs (hfd, &cyl, &cylsec, &head, &tracksec);
+                       getchsx (hfd, &cyl, &cylsec, &head, &tracksec);
                        put_long (dataptr + 0, hfd->blocksize);
                        size = hfd->virtsize / hfd->blocksize;
                        if (size > 0x00ffffffff)
index b6c2ef2e9164698b10702bdec4ea9ae0fb65a0e9..0a272e52f1bd484d13a657a656761c5aaa28f176 100644 (file)
@@ -36,7 +36,7 @@ extern int is_ar_pc_in_ram(void);
 extern void action_replay_enter (void);
 extern void action_replay_ciaread (void);
 extern void action_replay_hide (void);
-extern void action_replay_reset (bool hardreset);
+extern void action_replay_reset (bool hardreset, bool keyboardreset);
 extern int action_replay_load (void);
 extern int action_replay_unload (int in_memory_reset);
 
index 9c1b52030e35d2bae8effe3020159812c0252a4b..83a7d2aa0ec6b3f1bacdbe0ebf8da249dddb97b3 100644 (file)
@@ -22,7 +22,7 @@ uae_u32 get_copper_address (int copno);
 
 extern int custom_init (void);
 extern void custom_prepare (void);
-extern void custom_reset (int hardreset);
+extern void custom_reset (bool hardreset, bool keyboardreset);
 extern int intlev (void);
 extern void dumpcustom (void);
 
index 27c4c9feccc63b5c082b02e8cf45f4bb16044282..d73ceddc7228cc2934c0d75f4f17ddbd1e31dcfe 100644 (file)
@@ -143,3 +143,5 @@ extern int hdf_write_target (struct hardfiledata *hfd, void *buffer, uae_u64 off
 extern int hdf_resize_target (struct hardfiledata *hfd, uae_u64 newsize);
 extern void getchsgeometry (uae_u64 size, int *pcyl, int *phead, int *psectorspertrack);
 extern void getchsgeometry_hdf (struct hardfiledata *hfd, uae_u64 size, int *pcyl, int *phead, int *psectorspertrack);
+extern void getchspgeometry (uae_u64 total, int *pcyl, int *phead, int *psectorspertrack, bool idegeometry);
+
index f890e8a0efc2828f7c9b83e422f726e2245d6e70..2180d22e55a00ebf64b50df355a90d7b08178f1e 100644 (file)
@@ -18,9 +18,14 @@ extern void sleep_millis_main (int ms);
 extern void sleep_millis_busy (int ms);
 extern int sleep_resolution;
 
+#define UAE_QUIT 1
+#define UAE_RESET 2
+#define UAE_RESET_KEYBOARD 3
+#define UAE_RESET_HARD 4
+
 extern void uae_reset (int, int);
 extern void uae_quit (void);
-extern void uae_restart (int, TCHAR*);
+extern void uae_restart (int, const TCHAR*);
 extern void reset_all_systems (void);
 extern void target_reset (void);
 extern void target_addtorecent (const TCHAR*, int);
index 518862a5c31b16367975fd569155f3fb2bceeb88..66b564ed06635596b85d939119949b26caba2f2e 100644 (file)
--- a/main.cpp
+++ b/main.cpp
@@ -522,9 +522,11 @@ void uae_reset (int hardreset, int keyboardreset)
        currprefs.quitstatefile[0] = changed_prefs.quitstatefile[0] = 0;
 
        if (quit_program == 0) {
-               quit_program = -2;
+               quit_program = -UAE_RESET;
+               if (keyboardreset)
+                       quit_program = -UAE_RESET_KEYBOARD;
                if (hardreset)
-                       quit_program = -3;
+                       quit_program = -UAE_RESET_HARD;
        }
 
 }
@@ -532,13 +534,13 @@ void uae_reset (int hardreset, int keyboardreset)
 void uae_quit (void)
 {
        deactivate_debugger ();
-       if (quit_program != -1)
-               quit_program = -1;
+       if (quit_program != -UAE_QUIT)
+               quit_program = -UAE_QUIT;
        target_quit ();
 }
 
 /* 0 = normal, 1 = nogui, -1 = disable nogui */
-void uae_restart (int opengui, TCHAR *cfgfile)
+void uae_restart (int opengui, const TCHAR *cfgfile)
 {
        uae_quit ();
        restart_program = opengui > 0 ? 1 : (opengui == 0 ? 2 : 3);
@@ -795,7 +797,7 @@ extern int DummyException (LPEXCEPTION_POINTERS blah, int n_except)
 
 void do_start_program (void)
 {
-       if (quit_program == -1)
+       if (quit_program == -UAE_QUIT)
                return;
        if (!canbang && candirect < 0)
                candirect = 0;
@@ -804,7 +806,7 @@ void do_start_program (void)
        /* Do a reset on startup. Whether this is elegant is debatable. */
        inputdevice_updateconfig (&currprefs);
        if (quit_program >= 0)
-               quit_program = 2;
+               quit_program = UAE_RESET;
 #if (defined (_WIN32) || defined (_WIN64)) && !defined (NO_WIN32_EXCEPTION_HANDLER)
        extern int EvalException (LPEXCEPTION_POINTERS blah, int n_except);
        __try
index f1a606df6017ea7ceb3b8055c1ba6173d7fe8902..301c69b6b238707fe0e37a9e9d9cf1e7fdc16ead 100644 (file)
@@ -4405,14 +4405,15 @@ void m68k_go (int may_quit)
                if (currprefs.inprecfile[0] && input_play) {
                        inprec_open (currprefs.inprecfile, NULL);
                        changed_prefs.inprecfile[0] = currprefs.inprecfile[0] = 0;
-                       quit_program = 2;
+                       quit_program = UAE_RESET;
                }
                if (input_play || input_record)
                        inprec_startup ();
 
                if (quit_program > 0) {
-                       int hardreset = (quit_program == 3 ? 1 : 0) | hardboot;
-                       if (quit_program == 1)
+                       int hardreset = (quit_program == UAE_RESET_HARD ? 1 : 0) | hardboot;
+                       bool kbreset = quit_program == UAE_RESET_KEYBOARD;
+                       if (quit_program == UAE_QUIT)
                                break;
                        int restored = 0;
 
@@ -4430,7 +4431,7 @@ void m68k_go (int may_quit)
                                savestate_rewind ();
 #endif
                        set_cycles (start_cycles);
-                       custom_reset (hardreset);
+                       custom_reset (hardreset != 0, kbreset);
                        m68k_reset (hardreset);
                        if (hardreset) {
                                memory_clear ();
@@ -5481,7 +5482,7 @@ void cpureset (void)
 
        send_internalevent (INTERNALEVENT_CPURESET);
        if ((currprefs.cpu_compatible || currprefs.cpu_cycle_exact) && currprefs.cpu_model <= 68020) {
-               custom_reset (0);
+               custom_reset (false, false);
                return;
        }
        pc = m68k_getpc ();
@@ -5489,11 +5490,11 @@ void cpureset (void)
                addrbank *b = &get_mem_bank (pc);
                if (b->check (pc, 2 + 2)) {
                        /* We have memory, hope for the best.. */
-                       custom_reset (0);
+                       custom_reset (false, false);
                        return;
                }
                write_log (_T("M68K RESET PC=%x, rebooting..\n"), pc);
-               custom_reset (0);
+               custom_reset (false, false);
                m68k_setpc (ksboot);
                return;
        }
@@ -5503,14 +5504,14 @@ void cpureset (void)
                int reg = ins & 7;
                uae_u32 addr = m68k_areg (regs, reg);
                write_log (_T("reset/jmp (ax) combination emulated -> %x\n"), addr);
-               custom_reset (0);
+               custom_reset (false, false);
                if (addr < 0x80000)
                        addr += 0xf80000;
                m68k_setpc (addr - 2);
                return;
        }
        write_log (_T("M68K RESET PC=%x, rebooting..\n"), pc);
-       custom_reset (0);
+       custom_reset (false, false);
        m68k_setpc (ksboot);
 }
 
index 17264948080562750620a697aa18169d9216a924..b38dbbaa6d1c88ed65c94f4dc9d8adbcef3c564b 100644 (file)
@@ -618,7 +618,7 @@ int host_socket(TrapContext *context, SB, int af, int type, int protocol)
 
        sb->ftable[sd-1] = SF_BLOCKING;
        ioctlsocket(s,FIONBIO,&nonblocking);
-       BSDTRACE((_T(" -> Socket=%d\n"),sd));
+       BSDTRACE((_T(" -> Socket=%d %x\n"),sd,s));
 
        if (type == SOCK_RAW) {
                if (protocol==IPPROTO_UDP) {
@@ -1694,7 +1694,7 @@ int host_CloseSocket(TrapContext *context, SB, int sd)
 
 // For the sake of efficiency, we do not malloc() the fd_sets here.
 // 64 sockets should be enough for everyone.
-static void makesocktable(SB, uae_u32 fd_set_amiga, struct fd_set *fd_set_win, int nfds, SOCKET addthis)
+static void makesocktable(SB, uae_u32 fd_set_amiga, struct fd_set *fd_set_win, int nfds, SOCKET addthis, const TCHAR *name)
 {
        int i, j;
        uae_u32 currlong, mask;
@@ -1731,6 +1731,7 @@ static void makesocktable(SB, uae_u32 fd_set_amiga, struct fd_set *fd_set_win, i
                                s = getsock(sb,j+i+1);
 
                                if (s != INVALID_SOCKET) {
+                                       BSDTRACE((_T("%s:%d=%x\n"), name, fd_set_win->fd_count, s));
                                        fd_set_win->fd_array[fd_set_win->fd_count++] = s;
 
                                        if (fd_set_win->fd_count >= FD_SETSIZE) {
@@ -1808,11 +1809,11 @@ static unsigned int thread_WaitSelect2(void *indexp)
                        wscnt = args->wscnt;
 
                        // construct descriptor tables
-                       makesocktable(sb, readfds, &readsocks, nfds, sb->sockAbort);
+                       makesocktable(sb, readfds, &readsocks, nfds, sb->sockAbort, _T("R"));
                        if (writefds)
-                               makesocktable(sb, writefds, &writesocks, nfds, INVALID_SOCKET);
+                               makesocktable(sb, writefds, &writesocks, nfds, INVALID_SOCKET, _T("W"));
                        if (exceptfds)
-                               makesocktable(sb, exceptfds, &exceptsocks, nfds, INVALID_SOCKET);
+                               makesocktable(sb, exceptfds, &exceptsocks, nfds, INVALID_SOCKET, _T("E"));
 
                        if (timeout) {
                                tv.tv_sec = get_long (timeout);
@@ -1822,8 +1823,11 @@ static unsigned int thread_WaitSelect2(void *indexp)
 
                        BSDTRACE((_T("tWS2(%d) -> "), wscnt));
 
-                       resultval = select(nfds+1, &readsocks, writefds ? &writesocks : NULL,
-                               exceptfds ? &exceptsocks : NULL, timeout ? &tv : 0);
+                       resultval = select(nfds+1,
+                               readsocks.fd_count > 0 ? &readsocks : NULL,
+                               writefds && writesocks.fd_count > 0 ? &writesocks : NULL,
+                               exceptfds && exceptsocks.fd_count > 0 ? &exceptsocks : NULL,
+                               timeout ? &tv : NULL);
                        if (bsd->hEvents[index] == NULL)
                                break;
 
@@ -1836,7 +1840,7 @@ static unsigned int thread_WaitSelect2(void *indexp)
                        if (sb->resultval == SOCKET_ERROR) {
                                // select was stopped by sb->sockAbort
                                if (readsocks.fd_count > 1) {
-                                       makesocktable(sb, readfds, &readsocks, nfds, INVALID_SOCKET);
+                                       makesocktable(sb, readfds, &readsocks, nfds, INVALID_SOCKET, _T("R2"));
                                        tv.tv_sec = 0;
                                        tv.tv_usec = 10000;
                                        // Check for 10ms if data is available
@@ -1932,11 +1936,11 @@ void host_WaitSelect(TrapContext *context, SB, uae_u32 nfds, uae_u32 readfds, ua
 
        wssigs = sigmp ? get_long (sigmp) : 0;
 
-       BSDTRACE((_T("WaitSelect(%d,0x%x,0x%x,0x%x,0x%x,0x%x):%d "),
+       BSDTRACE((_T("WaitSelect(%d,0x%x,0x%x,0x%x,0x%x,0x%x):%d\n"),
                nfds, readfds, writefds, exceptfds, timeout, wssigs, wscnt));
-       fddebug(_T("read"), nfds, readfds);
-       fddebug(_T("write"), nfds, writefds);
-       fddebug(_T("except"), nfds, exceptfds);
+       fddebug(_T("read  :"), nfds, readfds);
+       fddebug(_T("write :"), nfds, writefds);
+       fddebug(_T("except:"), nfds, exceptfds);
 
        if (!readfds && !writefds && !exceptfds && !timeout && !wssigs) {
                sb->resultval = 0;
index 0d1007f43b39e4fab908afacc9c5680bef7a4e06..e74b4c31b50be4f5bd174c9266062ba818478665 100644 (file)
@@ -45,6 +45,8 @@ static int psEnabled, psActive, psPreProcess, shaderon;
 
 static bool showoverlay = true;
 
+#define MAX_PASSES 2
+
 static D3DFORMAT tformat;
 static int d3d_enabled, d3d_ex;
 static IDirect3D9 *d3d;
@@ -61,7 +63,7 @@ static int masktexture_w, masktexture_h;
 static float mask2texture_w, mask2texture_h, mask2texture_ww, mask2texture_wh;
 static float mask2texture_wwx, mask2texture_hhx, mask2texture_minusx, mask2texture_minusy;
 static float mask2texture_multx, mask2texture_multy, mask2texture_offsetw;
-static LPDIRECT3DTEXTURE9 lpWorkTexture1, lpWorkTexture2, lpTempTexture;
+static LPDIRECT3DTEXTURE9 lpWorkTexture1[2], lpWorkTexture2[2], lpTempTexture;
 LPDIRECT3DTEXTURE9 cursorsurfaced3d;
 static LPDIRECT3DVOLUMETEXTURE9 lpHq2xLookupTexture;
 static IDirect3DVertexBuffer9 *vertexBuffer;
@@ -75,6 +77,7 @@ RECT mask2rect;
 static bool wasstilldrawing_broken;
 static bool renderdisabled;
 static HANDLE filenotificationhandle;
+static int extrapasses;
 
 static bool fakemode;
 static uae_u8 *fakebitmap;
@@ -1093,6 +1096,20 @@ static LPDIRECT3DTEXTURE9 createtext (int w, int h, D3DFORMAT format)
 
 static int worktex_width, worktex_height;
 
+static int allocextratextures (int index, int w, int h)
+{
+       HRESULT hr;
+       if (FAILED (hr = d3ddev->CreateTexture (w, h, 1, D3DUSAGE_RENDERTARGET, D3DFMT_A8R8G8B8, D3DPOOL_DEFAULT, &lpWorkTexture1[index], NULL))) {
+               write_log (_T("%s: Failed to create temp texture: %s\n"), D3DHEAD, D3D_ErrorString (hr));
+               return 0;
+       }
+       if (FAILED (hr = d3ddev->CreateTexture (w, h, 1, D3DUSAGE_RENDERTARGET, D3DFMT_A8R8G8B8, D3DPOOL_DEFAULT, &lpWorkTexture2[index], NULL))) {
+               write_log (_T("%s: Failed to create working texture2: %s\n"), D3DHEAD, D3D_ErrorString (hr));
+               return 0;
+       }
+       return 1;
+}
+
 static int createamigatexture (int w, int h)
 {
        HRESULT hr;
@@ -1103,14 +1120,8 @@ static int createamigatexture (int w, int h)
        write_log (_T("%s: %d*%d texture allocated, bits per pixel %d\n"), D3DHEAD, w, h, t_depth);
        if (psActive) {
                D3DLOCKED_BOX lockedBox;
-               if (FAILED (hr = d3ddev->CreateTexture (w, h, 1, D3DUSAGE_RENDERTARGET, D3DFMT_A8R8G8B8, D3DPOOL_DEFAULT, &lpWorkTexture1, NULL))) {
-                       write_log (_T("%s: Failed to create temp texture: %s\n"), D3DHEAD, D3D_ErrorString (hr));
+               if (!allocextratextures (0, w, h))
                        return 0;
-               }
-               if (FAILED (hr = d3ddev->CreateTexture (w, h, 1, D3DUSAGE_RENDERTARGET, D3DFMT_A8R8G8B8, D3DPOOL_DEFAULT, &lpWorkTexture2, NULL))) {
-                       write_log (_T("%s: Failed to create working texture2: %s\n"), D3DHEAD, D3D_ErrorString (hr));
-                       return 0;
-               }
                if (FAILED (hr = lpHq2xLookupTexture->LockBox (0, &lockedBox, NULL, 0))) {
                        write_log (_T("%s: Failed to lock box of volume texture: %s\n"), D3DHEAD, D3D_ErrorString (hr));
                        return 0;
@@ -1143,6 +1154,10 @@ static int createtexture (int ow, int oh, int win_w, int win_h)
        texelsize.x = 1.0f / w; texelsize.y = 1.0f / h; texelsize.z = 1; texelsize.w = 1; 
 
        if (psActive) {
+               if (extrapasses) {
+                       if (!allocextratextures (1, w, h))
+                               return 0;
+               }
                if (FAILED (hr = d3ddev->CreateVolumeTexture (256, 16, 256, 1, D3DUSAGE_DYNAMIC, D3DFMT_A8R8G8B8, D3DPOOL_DEFAULT, &lpHq2xLookupTexture, NULL))) {
                        write_log (_T("%s: Failed to create volume texture: %s\n"), D3DHEAD, D3D_ErrorString (hr));
                        return 0;
@@ -1803,13 +1818,15 @@ static void freetextures (void)
                lpTempTexture->Release ();
                lpTempTexture = NULL;
        }
-       if (lpWorkTexture1) {
-               lpWorkTexture1->Release ();
-               lpWorkTexture1 = NULL;
-       }
-       if (lpWorkTexture2) {
-               lpWorkTexture2->Release ();
-               lpWorkTexture2 = NULL;
+       for (int i = 0; i < MAX_PASSES; i++) {
+               if (lpWorkTexture1[i]) {
+                       lpWorkTexture1[i]->Release ();
+                       lpWorkTexture1[i] = NULL;
+               }
+               if (lpWorkTexture2[i]) {
+                       lpWorkTexture2[i]->Release ();
+                       lpWorkTexture2[i] = NULL;
+               }
        }
        if (lpHq2xLookupTexture) {
                lpHq2xLookupTexture->Release ();
@@ -2558,7 +2575,7 @@ static void D3D_render2 (void)
                        LPDIRECT3DTEXTURE9 lpWorkTexture;
 
                        settransform ();
-                       if (!psEffect_SetTextures (texture, lpWorkTexture1, lpWorkTexture2, lpHq2xLookupTexture))
+                       if (!psEffect_SetTextures (texture, lpWorkTexture1[0], lpWorkTexture2[0], lpHq2xLookupTexture))
                                return;
                        if (psPreProcess) {
                                if (!psEffect_SetMatrices (&m_matPreProj, &m_matPreView, &m_matPreWorld))
@@ -2566,7 +2583,7 @@ static void D3D_render2 (void)
 
                                if (FAILED (hr = d3ddev->GetRenderTarget (0, &lpRenderTarget)))
                                        write_log (_T("%s: GetRenderTarget: %s\n"), D3DHEAD, D3D_ErrorString (hr));
-                               lpWorkTexture = lpWorkTexture1;
+                               lpWorkTexture = lpWorkTexture1[0];
                                lpNewRenderTarget = NULL;
        pass2:
                                if (FAILED (hr = lpWorkTexture->GetSurfaceLevel (0, &lpNewRenderTarget)))
@@ -2575,7 +2592,7 @@ static void D3D_render2 (void)
                                        write_log (_T("%s: SetRenderTarget: %s\n"), D3DHEAD, D3D_ErrorString (hr));
 
                                uPasses = 0;
-                               if (psEffect_Begin (pEffect, (lpWorkTexture == lpWorkTexture1) ? psEffect_PreProcess1 : psEffect_PreProcess2, &uPasses)) {
+                               if (psEffect_Begin (pEffect, (lpWorkTexture == lpWorkTexture1[0]) ? psEffect_PreProcess1 : psEffect_PreProcess2, &uPasses)) {
                                        for (uPass = 0; uPass < uPasses; uPass++) {
                                                if (psEffect_BeginPass (pEffect, uPass)) {
                                                        if (FAILED (hr = d3ddev->DrawPrimitive (D3DPT_TRIANGLESTRIP, 4, 2))) {
@@ -2590,8 +2607,8 @@ static void D3D_render2 (void)
                                        write_log (_T("%s: Effect RenderTarget reset failed: %s\n"), D3DHEAD, D3D_ErrorString (hr));
                                lpNewRenderTarget->Release ();
                                lpNewRenderTarget = NULL;
-                               if (psEffect_hasPreProcess2 () && lpWorkTexture == lpWorkTexture1) {
-                                       lpWorkTexture = lpWorkTexture2;
+                               if (psEffect_hasPreProcess2 () && lpWorkTexture == lpWorkTexture1[0]) {
+                                       lpWorkTexture = lpWorkTexture2[0];
                                        goto pass2;
                                }
                                lpRenderTarget->Release ();
@@ -2631,6 +2648,7 @@ static void D3D_render2 (void)
                }
 
        }
+
 #if TWOPASS
        if (shaderon > 0 && postEffect) {
 
index 93ecb77af07d65a613e451b3012c9697d306bb4e..e76f93754322969012532cb70b28e5fdb84595c7 100644 (file)
@@ -56,6 +56,7 @@ struct uae_driveinfo {
        int nomedia;
        int dangerous;
        int readonly;
+       int cylinders, sectors, heads;
 };
 
 #define HDF_HANDLE_WIN32 1
@@ -988,7 +989,7 @@ static void generatestorageproperty (struct uae_driveinfo *udi, int ignoreduplic
 {
        _tcscpy (udi->vendor_id, _T("UAE"));
        _tcscpy (udi->product_id, _T("DISK"));
-       _tcscpy (udi->product_rev, _T("1.1"));
+       _tcscpy (udi->product_rev, _T("1.2"));
        _stprintf (udi->device_name, _T("%s"), udi->device_path);
        udi->removablemedia = 1;
 }
@@ -1226,6 +1227,9 @@ static BOOL GetDevicePropertyFromName(const TCHAR *DevicePath, DWORD Index, DWOR
                        dg.BytesPerSector, dg.Cylinders.QuadPart, dg.TracksPerCylinder, dg.SectorsPerTrack, dg.MediaType);
                udi->size = (uae_u64)dg.BytesPerSector * (uae_u64)dg.Cylinders.QuadPart *
                        (uae_u64)dg.TracksPerCylinder * (uae_u64)dg.SectorsPerTrack;
+               udi->cylinders = dg.Cylinders.QuadPart > 65535 ? 0 : dg.Cylinders.LowPart;
+               udi->sectors = dg.SectorsPerTrack;
+               udi->heads = dg.TracksPerCylinder;
        }
        if (gli_ok)
                udi->size = gli.Length.QuadPart;
index 48c358c8b176a77ac70f4d26dba0aa051f935984..9bb893f181f4c114a1a6309ef65f8911af5cab3f 100644 (file)
Binary files a/od-win32/lib/prowizard.lib and b/od-win32/lib/prowizard.lib differ
index b9716ade9da873b7e81acd9f8a169daeb33bfb3c..6b286d3a47f94d1017fbcb218684d68fec647df5 100644 (file)
Binary files a/od-win32/lib/prowizard_x64.lib and b/od-win32/lib/prowizard_x64.lib differ
old mode 100644 (file)
new mode 100755 (executable)
index 0a989cf..8689c90
 #define IDC_DBG_DASM2                   1781
 #define IDC_HF_DYNAMIC                  1781
 #define IDC_DBG_MEM2                    1782
+#define IDC_HDFINFO2                    1782
 #define IDC_DBG_MEMINPUT2               1783
 #define IDC_DBG_ADDRINPUTTXT            1784
 #define IDC_RTG_SCALE                   1785
old mode 100644 (file)
new mode 100755 (executable)
index 8b4e476..702bcc9
@@ -528,13 +528,13 @@ BEGIN
     CONTROL         "USB mode",IDC_KBLED_USB,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,264,298,64,11\r
 END\r
 \r
-IDD_HARDFILE DIALOGEX 0, 0, 396, 245\r
+IDD_HARDFILE DIALOGEX 0, 0, 396, 263\r
 STYLE DS_LOCALEDIT | DS_SETFONT | DS_MODALFRAME | DS_SETFOREGROUND | DS_3DLOOK | DS_CENTER | DS_CENTERMOUSE | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU\r
 EXSTYLE WS_EX_ACCEPTFILES\r
 CAPTION "Hardfile Settings"\r
 FONT 8, "MS Sans Serif", 0, 0, 0x0\r
 BEGIN\r
-    GROUPBOX        "Settings",IDC_STATIC,2,5,392,146\r
+    GROUPBOX        "Settings",IDC_STATIC,2,2,392,164\r
     RTEXT           "Path:",IDC_HARDFILE_DIR_TEXT,25,18,22,10\r
     EDITTEXT        IDC_PATH_NAME,52,15,325,15,ES_AUTOHSCROLL\r
     PUSHBUTTON      "...",IDC_SELECTOR,380,14,11,15\r
@@ -560,17 +560,18 @@ BEGIN
     RTEXT           "Block size:",IDC_BLOCKSIZE_TEXT,261,113,50,10\r
     EDITTEXT        IDC_BLOCKSIZE,317,111,40,15,ES_NUMBER\r
     EDITTEXT        IDC_HDFINFO,5,131,385,12,ES_CENTER | ES_READONLY\r
-    GROUPBOX        "New hard disk image file",IDC_STATIC,2,155,392,62\r
-    PUSHBUTTON      "Create",IDC_HF_CREATE,58,171,80,14\r
-    COMBOBOX        IDC_HF_TYPE,58,195,80,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP\r
-    EDITTEXT        IDC_HF_SIZE,154,171,61,15,ES_NUMBER\r
-    LTEXT           "MB",IDC_STATIC,220,174,53,10,SS_CENTERIMAGE\r
-    EDITTEXT        IDC_HF_DOSTYPE,154,194,61,15\r
-    LTEXT           "DOS type",IDC_STATIC,222,196,51,10,SS_CENTERIMAGE\r
-    CONTROL         "Sparse file",IDC_HF_SPARSE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,280,180,87,10\r
-    CONTROL         "Dynamic HDF",IDC_HF_DYNAMIC,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,280,192,87,10\r
-    PUSHBUTTON      "OK",IDOK,147,226,50,14\r
-    PUSHBUTTON      "Cancel",IDCANCEL,203,226,50,14\r
+    GROUPBOX        "New hard disk image file",IDC_STATIC,2,171,392,62\r
+    PUSHBUTTON      "Create",IDC_HF_CREATE,58,187,80,14\r
+    COMBOBOX        IDC_HF_TYPE,58,211,80,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP\r
+    EDITTEXT        IDC_HF_SIZE,154,187,61,15,ES_NUMBER\r
+    LTEXT           "MB",IDC_STATIC,220,190,53,10,SS_CENTERIMAGE\r
+    EDITTEXT        IDC_HF_DOSTYPE,154,210,61,15\r
+    LTEXT           "DOS type",IDC_STATIC,222,212,51,10,SS_CENTERIMAGE\r
+    CONTROL         "Sparse file",IDC_HF_SPARSE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,280,196,87,10\r
+    CONTROL         "Dynamic HDF",IDC_HF_DYNAMIC,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,280,208,87,10\r
+    PUSHBUTTON      "OK",IDOK,147,242,50,14\r
+    PUSHBUTTON      "Cancel",IDCANCEL,203,242,50,14\r
+    EDITTEXT        IDC_HDFINFO2,5,147,385,12,ES_CENTER | ES_READONLY\r
 END\r
 \r
 IDD_FILESYS DIALOGEX 15, 25, 396, 111\r
@@ -625,9 +626,9 @@ BEGIN
     CONTROL         "NTSC [] North American and Japanese display standard, 60Hz refresh rate. Other countries use PAL (50Hz. display refresh rate)",IDC_NTSC,\r
                     "Button",BS_AUTOCHECKBOX | WS_TABSTOP,114,47,86,10\r
     CONTROL         "Cycle-exact [] The most compatible A500/A1200 emulation mode. Very fast PC recommended.",IDC_CYCLEEXACT,\r
-                    "Button",BS_AUTOCHECKBOX | BS_LEFT | WS_GROUP | WS_TABSTOP,25,69,170,10\r
-    RTEXT           "Chipset Extra",IDC_STATIC,30,89,71,15,SS_CENTERIMAGE\r
-    COMBOBOX        IDC_CS_EXT,105,90,49,65,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP\r
+                    "Button",BS_AUTOCHECKBOX | BS_LEFT | WS_GROUP | WS_TABSTOP,14,69,170,10\r
+    RTEXT           "Chipset Extra:",IDC_STATIC,72,89,71,15,SS_CENTERIMAGE\r
+    COMBOBOX        IDC_CS_EXT,148,90,49,65,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP\r
     GROUPBOX        "Options",IDC_STATIC,221,0,173,111\r
     CONTROL         "Immediate Blitter [] Faster but less compatible blitter emulation.",IDC_BLITIMM,\r
                     "Button",BS_AUTOCHECKBOX | WS_TABSTOP,234,16,150,10\r
@@ -804,20 +805,22 @@ BEGIN
     PUSHBUTTON      "Delete",IDC_FILTERPRESETDELETE,325,259,55,14\r
 END\r
 \r
-IDD_HARDDRIVE DIALOGEX 0, 0, 396, 74\r
+IDD_HARDDRIVE DIALOGEX 0, 0, 396, 109\r
 STYLE DS_LOCALEDIT | DS_SETFONT | DS_MODALFRAME | DS_SETFOREGROUND | DS_3DLOOK | DS_CENTER | DS_CENTERMOUSE | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU\r
 CAPTION "Harddrive Settings"\r
 FONT 8, "MS Sans Serif", 0, 0, 0x0\r
 BEGIN\r
     LTEXT           "Hard drive:",IDC_STATIC,7,11,80,10\r
     COMBOBOX        IDC_HARDDRIVE,49,9,339,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP\r
-    DEFPUSHBUTTON   "Create hard disk image file",IDC_HARDDRIVE_IMAGE,49,29,115,14\r
-    EDITTEXT        IDC_PATH_NAME,183,29,97,15,ES_AUTOHSCROLL | NOT WS_VISIBLE\r
-    RTEXT           "HD Controller:",IDC_STATIC,12,52,65,10,SS_CENTERIMAGE\r
-    COMBOBOX        IDC_HDF_CONTROLLER,91,51,61,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP\r
-    CONTROL         "Read/write",IDC_HDF_RW,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,172,52,60,10\r
-    DEFPUSHBUTTON   "Add hard drive",IDOK,236,49,73,14\r
-    PUSHBUTTON      "Cancel",IDCANCEL,316,49,73,14\r
+    DEFPUSHBUTTON   "Create hard disk image file",IDC_HARDDRIVE_IMAGE,49,67,115,14\r
+    EDITTEXT        IDC_PATH_NAME,183,67,97,15,ES_AUTOHSCROLL | NOT WS_VISIBLE\r
+    RTEXT           "HD Controller:",IDC_STATIC,12,90,65,10,SS_CENTERIMAGE\r
+    COMBOBOX        IDC_HDF_CONTROLLER,91,89,61,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP\r
+    CONTROL         "Read/write",IDC_HDF_RW,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,172,90,60,10\r
+    DEFPUSHBUTTON   "Add hard drive",IDOK,236,87,73,14\r
+    PUSHBUTTON      "Cancel",IDCANCEL,316,87,73,14\r
+    EDITTEXT        IDC_HDFINFO,5,29,385,12,ES_CENTER | ES_READONLY\r
+    EDITTEXT        IDC_HDFINFO2,5,46,385,12,ES_CENTER | ES_READONLY\r
 END\r
 \r
 IDD_MISC2 DIALOGEX 0, 0, 396, 263\r
@@ -1344,6 +1347,7 @@ BEGIN
 \r
     IDD_HARDDRIVE, DIALOG\r
     BEGIN\r
+        BOTTOMMARGIN, 108\r
     END\r
 \r
     IDD_MISC2, DIALOG\r
index bc3ab8bdd61651dc95594af4edcd0475ca69ecdb..77f86f1bc132cfd23340d7554e7ffc944a1a842f 100644 (file)
@@ -57,7 +57,7 @@ static int recursive_device, recursive;
 static int currentpausemode;
 static int gameportmask[MAX_JPORTS];
 static DWORD storeflags;
-static bool screenmode_request;
+static int screenmode_request;
 static HWND guestwindow;
 
 static int cando (void)
@@ -1030,7 +1030,7 @@ static LRESULT CALLBACK RPHostMsgFunction2 (UINT uMessage, WPARAM wParam, LPARAM
                return 1;
        case RP_IPC_TO_GUEST_QUERYSCREENMODE:
                {
-                       screenmode_request = true;
+                       screenmode_request = 1;
                        return 1;
                }
        case RP_IPC_TO_GUEST_GUESTAPIVERSION:
@@ -1571,6 +1571,12 @@ void rp_set_hwnd (HWND hWnd)
        RPSendMessagex (RP_IPC_TO_HOST_SCREENMODE, 0, 0, &sm, sizeof sm, &guestinfo, NULL); 
 }
 
+void rp_screenmode_changed (void)
+{
+       if (!screenmode_request)
+               screenmode_request = 2;
+}
+
 void rp_set_enabledisable (int enabled)
 {
        if (!cando ())
@@ -1609,10 +1615,12 @@ void rp_vsync (void)
        if (!initialized)
                return;
        if (screenmode_request) {
-               struct RPScreenMode sm = { 0 };
-               get_screenmode (&sm, &currprefs);
-               RPSendMessagex (RP_IPC_TO_HOST_SCREENMODE, 0, 0, &sm, sizeof sm, &guestinfo, NULL);
-               screenmode_request = false;
+               screenmode_request--;
+               if (screenmode_request == 0) {
+                       struct RPScreenMode sm = { 0 };
+                       get_screenmode (&sm, &currprefs);
+                       RPSendMessagex (RP_IPC_TO_HOST_SCREENMODE, 0, 0, &sm, sizeof sm, &guestinfo, NULL);
+               }
        }
        if (magicmouse_alive () != mousemagic)
                rp_mouse_magic (magicmouse_alive ());
index 02e283f597f2e52875616ae2ef342d827535acc9..fe356a759eec37e822c1840ab995470b4cddc1fc 100644 (file)
@@ -16,6 +16,7 @@ extern int rp_isactive (void);
 extern void rp_vsync (void);
 extern HWND rp_getparent (void);
 extern void rp_rtg_switch (void);
+extern void rp_screenmode_changed (void);
 
 extern TCHAR *rp_param;
 extern int rp_rpescapekey;
index af1a44bf2d3576dc4615b442e69dc86651d11ae8..0186ba9870218f96756f4c336f32ab95980630ae 100644 (file)
@@ -19,9 +19,9 @@
 #define LANG_DLL 1
 
 //#define WINUAEBETA _T("")
-#define WINUAEBETA _T("24")
-#define WINUAEDATE MAKEBD(2012, 11, 5)
-#define WINUAEEXTRA _T("")
+#define WINUAEBETA _T("25")
+#define WINUAEDATE MAKEBD(2012, 11, 10)
+#define WINUAEEXTRA _T(" RC1")
 //#define WINUAEEXTRA _T("AmiKit Preview")
 #define WINUAEREV _T("")
 
index cfb0e82871b492906192197d454e607cc1d59be3..da75c5d5e2411974721f0e85cb2338ec6bd76eec 100644 (file)
@@ -3526,9 +3526,7 @@ static int create_windows_2 (void)
                write_log (_T("window already open (%dx%d %dx%d)\n"),
                        amigawin_rect.left, amigawin_rect.top, amigawin_rect.right - amigawin_rect.left, amigawin_rect.bottom - amigawin_rect.top);
                updatemouseclip ();
-#ifdef RETROPLATFORM
-               rp_set_hwnd (hAmigaWnd);
-#endif
+               rp_screenmode_changed ();
                return 1;
        }
 
index f19c7a7e49b348eca3679e99733ebe9937643de7..94225570386d2fbc086db289faba2dce9f680d0a 100644 (file)
@@ -91,7 +91,7 @@
 #include "rp.h"
 #endif
 
-#define GUI_SCALE_DEFAULT 90
+#define GUI_SCALE_DEFAULT 100
 #define MIN_GUI_INTERNAL_WIDTH 512
 #define MIN_GUI_INTERNAL_HEIGHT 400
 
@@ -8182,9 +8182,9 @@ static INT_PTR MiscDlgProc (HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam)
                                        v--;
                                        v = 110 - v * 10;
                                }
-                               double m = scaleresource_getdpimult ();
-                               gui_width = (int)(GUI_INTERNAL_WIDTH * v * m / 100);
-                               gui_height = (int)(GUI_INTERNAL_HEIGHT * v * m / 100);
+                               //double m = scaleresource_getdpimult ();
+                               gui_width = (int)(GUI_INTERNAL_WIDTH * v / 100);
+                               gui_height = (int)(GUI_INTERNAL_HEIGHT * v / 100);
                                scaleresource_setmult (guiDlg, gui_width, gui_height);
                                gui_size_changed = 1;
                        }
@@ -9373,7 +9373,7 @@ static void updatehdfinfo (HWND hDlg, bool force, bool defaults)
        static uae_u8 id[512];
        int blocks, cyls, i;
        TCHAR tmp[200], tmp2[200];
-       TCHAR idtmp[9];
+       TCHAR idtmp[17];
 
        bsize = 0;
        if (force) {
@@ -9394,9 +9394,19 @@ static void updatehdfinfo (HWND hDlg, bool force, bool defaults)
                        if (i == 16)
                                hdf_read (&hfd, id, 0, 512);
                }
-               if (defaults && current_hfdlg.blocksize * current_hfdlg.sectors * current_hfdlg.surfaces) {
-                       getchsgeometry_hdf (open ? &hfd : NULL, bsize, &current_hfdlg.cylinders, &current_hfdlg.surfaces, &current_hfdlg.sectors);
-                       current_hfdlg.original = 0;
+               if (defaults) {
+                       if (hfd.flags & HFD_FLAGS_REALDRIVE) {
+                               if (current_hfdlg.controller >= HD_CONTROLLER_IDE0 && current_hfdlg.controller <= HD_CONTROLLER_IDE3) {
+                                       getchspgeometry (bsize, &current_hfdlg.cylinders, &current_hfdlg.surfaces, &current_hfdlg.sectors, true);
+                                       if (current_hfdlg.forcedcylinders == 0)
+                                               current_hfdlg.forcedcylinders = current_hfdlg.cylinders;
+                               } else {
+                                       getchspgeometry (bsize, &current_hfdlg.cylinders, &current_hfdlg.surfaces, &current_hfdlg.sectors, false);
+                               }
+                       } else if (current_hfdlg.blocksize * current_hfdlg.sectors * current_hfdlg.surfaces) {
+                               getchsgeometry_hdf (open ? &hfd : NULL, bsize, &current_hfdlg.cylinders, &current_hfdlg.surfaces, &current_hfdlg.sectors);
+                               current_hfdlg.original = 0;
+                       }
                }
                hdf_close (&hfd);
        }
@@ -9406,6 +9416,8 @@ static void updatehdfinfo (HWND hDlg, bool force, bool defaults)
                cyls = bsize / (current_hfdlg.blocksize * current_hfdlg.sectors * current_hfdlg.surfaces);
        }
        blocks = cyls * (current_hfdlg.sectors * current_hfdlg.surfaces);
+       if (!blocks && current_hfdlg.blocksize)
+               blocks = bsize / current_hfdlg.blocksize;
        for (i = 0; i < sizeof (idtmp) / sizeof (TCHAR) - 1; i++) {
                TCHAR c = id[i];
                if (c < 32 || c > 126)
@@ -9416,22 +9428,29 @@ static void updatehdfinfo (HWND hDlg, bool force, bool defaults)
 
        tmp[0] = 0;
        if (bsize) {
-               _stprintf (tmp2, _T(" %s [%02X%02X%02X%02X%02X%02X%02X%02X]"), idtmp, id[0], id[1], id[2], id[3], id[4], id[5], id[6], id[7]);
-               if (!cyls || !blocks) {
+               _stprintf (tmp2, _T(" %s [%02X%02X%02X%02X %02X%02X%02X%02X %02X%02X%02X%02X %02X%02X%02X%02X]"), idtmp,
+                       id[0], id[1], id[2], id[3], id[4], id[5], id[6], id[7],
+                       id[8], id[9], id[10], id[11], id[12], id[13], id[14], id[15]);
+               if (!blocks) {
                        _stprintf (tmp, _T("%dMB"), bsize / (1024 * 1024));
+               } else if (blocks && !cyls) {
+                       _stprintf (tmp, _T("%u blocks, %.1fMB"),
+                               blocks,
+                               (double)bsize / (1024.0 * 1024.0));             
                } else {
-                       _stprintf (tmp, _T("%u cyls, %u blocks, %.1fMB/%.1fMB"),
-                               cyls, blocks,
+                       _stprintf (tmp, _T("%u/%u/%u, %u/%u blocks, %.1fMB/%.1fMB"),
+                               cyls, current_hfdlg.surfaces, current_hfdlg.sectors,
+                               blocks, (int)(bsize / 512),
                                (double)blocks * 1.0 * current_hfdlg.blocksize / (1024.0 * 1024.0),
                                (double)bsize / (1024.0 * 1024.0));
                        if (cyls > 65535) {
-                               _stprintf (tmp2, _T(" %4.4s [%02X%02X%02X%02X]"), idtmp, id[0], id[1], id[2], id[3]);
-                               _tcscat (tmp, _T(" [Too many cyls]"));
+                               _tcscat (tmp2, _T(" [Too many cyls]"));
                        }
                }
-               _tcscat (tmp, tmp2);
-               if (hDlg != NULL)
+               if (hDlg != NULL) {
                        SetDlgItemText (hDlg, IDC_HDFINFO, tmp);
+                       SetDlgItemText (hDlg, IDC_HDFINFO2, tmp2);
+               }
        }
 }
 
@@ -9674,25 +9693,6 @@ static INT_PTR CALLBACK HarddriveSettingsProc (HWND hDlg, UINT msg, WPARAM wPara
                if (recursive)
                        break;
                recursive++;
-               posn = SendDlgItemMessage (hDlg, IDC_HARDDRIVE, CB_GETCURSEL, 0, 0);
-               if (oposn != posn && posn != CB_ERR) {
-                       oposn = posn;
-                       if (posn >= 0) {
-                               BOOL ena ;
-                               int dang = 1;
-                               hdf_getnameharddrive (posn, 1, NULL, &dang);
-                               ena = dang >= 0;
-                               ew (hDlg, IDC_HARDDRIVE_IMAGE, ena);
-                               ew (hDlg, IDOK, ena);
-                               ew (hDlg, IDC_HDF_RW, !dang);
-                               if (dang)
-                                       current_hfdlg.rw = FALSE;
-                               ew (hDlg, IDC_HDF_CONTROLLER, ena);
-                               hardfile_testrdb (hDlg, &current_hfdlg);
-                               SendDlgItemMessage (hDlg, IDC_HDF_CONTROLLER, CB_SETCURSEL, current_hfdlg.controller, 0);
-                               CheckDlgButton(hDlg, IDC_HDF_RW, current_hfdlg.rw);
-                       }
-               }
                if (HIWORD (wParam) == BN_CLICKED) {
                        switch (LOWORD (wParam)) {
                        case IDOK:
@@ -9702,17 +9702,58 @@ static INT_PTR CALLBACK HarddriveSettingsProc (HWND hDlg, UINT msg, WPARAM wPara
                                EndDialog (hDlg, 0);
                                break;
                        case IDC_HARDDRIVE_IMAGE:
+                               posn = SendDlgItemMessage (hDlg, IDC_HARDDRIVE, CB_GETCURSEL, 0, 0);
                                if (posn != CB_ERR)
                                        harddrive_to_hdf (hDlg, &workprefs, posn);
                                break;
+                       case IDC_HDF_RW:
+                               posn = SendDlgItemMessage (hDlg, IDC_HARDDRIVE, CB_GETCURSEL, 0, 0);
+                               if (posn != CB_ERR) {
+                                       int dang = 1;
+                                       hdf_getnameharddrive (posn, 1, NULL, &dang);
+                                       current_hfdlg.rw = ischecked (hDlg, IDC_HDF_RW) && !dang;
+                               }
+                               break;
+                       }
+               }
+               if (LOWORD (wParam) == IDC_HARDDRIVE) {
+                       posn = SendDlgItemMessage (hDlg, IDC_HARDDRIVE, CB_GETCURSEL, 0, 0);
+                       if (oposn != posn && posn != CB_ERR) {
+                               oposn = posn;
+                               if (posn >= 0) {
+                                       BOOL ena;
+                                       int dang = 1;
+                                       hdf_getnameharddrive (posn, 1, NULL, &dang);
+                                       _tcscpy (current_hfdlg.filename, hdf_getnameharddrive (posn, 0, NULL, &dang));
+                                       ena = dang >= 0;
+                                       ew (hDlg, IDC_HARDDRIVE_IMAGE, ena);
+                                       ew (hDlg, IDOK, ena);
+                                       ew (hDlg, IDC_HDF_RW, !dang);
+                                       if (dang)
+                                               current_hfdlg.rw = FALSE;
+                                       current_hfdlg.blocksize = 512;
+                                       current_hfdlg.forcedcylinders = 0;
+                                       current_hfdlg.cylinders = current_hfdlg.sectors = current_hfdlg.surfaces = 0;
+                                       ew (hDlg, IDC_HDF_CONTROLLER, ena);
+                                       SetDlgItemText (hDlg, IDC_HDFINFO, _T(""));
+                                       SetDlgItemText (hDlg, IDC_HDFINFO2, _T(""));
+                                       updatehdfinfo (hDlg, true, true);
+                                       SendDlgItemMessage (hDlg, IDC_HDF_CONTROLLER, CB_SETCURSEL, current_hfdlg.controller, 0);
+                                       CheckDlgButton(hDlg, IDC_HDF_RW, current_hfdlg.rw);
+                                       _tcscpy (current_hfdlg.filename, hdf_getnameharddrive ((int)posn, 0, &current_hfdlg.blocksize, NULL));
+                               }
+                       }
+               } else if (LOWORD (wParam) == IDC_HDF_CONTROLLER) {
+                       posn = SendDlgItemMessage (hDlg, IDC_HDF_CONTROLLER, CB_GETCURSEL, 0, 0);
+                       if (posn != CB_ERR) {
+                               current_hfdlg.controller = posn;
+                               current_hfdlg.forcedcylinders = 0;
+                               current_hfdlg.cylinders = current_hfdlg.sectors = current_hfdlg.surfaces = 0;
+                               SetDlgItemText (hDlg, IDC_HDFINFO, _T(""));
+                               SetDlgItemText (hDlg, IDC_HDFINFO2, _T(""));
+                               updatehdfinfo (hDlg, true, true);
                        }
                }
-               if (posn != CB_ERR)
-                       _tcscpy (current_hfdlg.filename, hdf_getnameharddrive ((int)posn, 0, &current_hfdlg.blocksize, NULL));
-               current_hfdlg.rw = ischecked (hDlg, IDC_HDF_RW);
-               posn = SendDlgItemMessage (hDlg, IDC_HDF_CONTROLLER, CB_GETCURSEL, 0, 0);
-               if (posn != CB_ERR)
-                       current_hfdlg.controller = posn;
                recursive--;
                break;
        }
@@ -9768,7 +9809,7 @@ static void new_harddrive (HWND hDlg, int entry)
        uci = add_filesys_config (&workprefs, entry, 0, 0,
                current_hfdlg.filename, ! current_hfdlg.rw, 0, 0, 0,
                0, current_hfdlg.blocksize, 0, 0, current_hfdlg.controller, 0,
-               0, 0, 0);
+               current_hfdlg.forcedcylinders, current_hfdlg.surfaces, current_hfdlg.sectors);
        if (uci)
                hardfile_do_disk_change (uci, 1);
 }
@@ -14563,9 +14604,9 @@ static void getguisize (HWND hDlg, int *width, int *height)
 {
        RECT r;
 
-       GetClientRect (hDlg, &r);
-       *width = r.right;
-       *height = r.bottom;
+       GetWindowRect (hDlg, &r);
+       *width = r.right - r.left;
+       *height = r.bottom - r.top;
 }
 
 static HWND updatePanel (int id)
@@ -15208,7 +15249,7 @@ static INT_PTR CALLBACK DialogProc (HWND hDlg, UINT msg, WPARAM wParam, LPARAM l
                if (dialogreturn < 0) {
                        dialogreturn = 0;
                        if (allow_quit) {
-                               quit_program = 1;
+                               quit_program = UAE_QUIT;
                                regs.spcflags |= SPCFLAG_BRK;
                        }
                }
@@ -15288,7 +15329,7 @@ static INT_PTR CALLBACK DialogProc (HWND hDlg, UINT msg, WPARAM wParam, LPARAM l
                                dialogreturn = 0;
                                DestroyWindow (hDlg);
                                if (allow_quit) {
-                                       quit_program = 1;
+                                       quit_program = UAE_QUIT;
                                        regs.spcflags |= SPCFLAG_BRK;
                                }
                                guiDlg = NULL;
@@ -15499,8 +15540,8 @@ static void blah(void)
 
 static void setdefaultguisize (void)
 {
-       gui_width = GUI_INTERNAL_WIDTH * 90 / 100;
-       gui_height = GUI_INTERNAL_HEIGHT * 90 / 100;
+       gui_width = GUI_INTERNAL_WIDTH * 100 / 100;
+       gui_height = GUI_INTERNAL_HEIGHT * 100 / 100;
 }
 
 static int GetSettings (int all_options, HWND hwnd)
@@ -15587,10 +15628,6 @@ static int GetSettings (int all_options, HWND hwnd)
                }
                if (!regexists) {
                        scaleresource_setdefaults ();
-                       setdefaultguisize ();
-                       double m = scaleresource_getdpimult ();
-                       gui_width = (int)(gui_width * m);
-                       gui_height = (int)(gui_height * m);
                        fmultx = 0;
                        write_log (_T("GUI default size\n"));
                        regsetint (NULL, _T("GUIResize"), 0);
@@ -15612,16 +15649,16 @@ static int GetSettings (int all_options, HWND hwnd)
                if (first)
                        write_log (_T("Entering GUI idle loop\n"));
 
-               if (fmultx > 0) {
+               if (fmultx > 0)
                        scaleresource_setmult (hwnd, -fmultx, -fmulty);
-               } else {
+               else
                        scaleresource_setmult (hwnd, gui_width, gui_height);
-                       write_log (_T("Requested GUI size = %dx%d (%dx%d)\n"), gui_width, gui_height, workprefs.gfx_size.width, workprefs.gfx_size.height);
-                       if (dodialogmousemove () && isfullscreen() > 0) {
-                               if (gui_width >= workprefs.gfx_size.width || gui_height >= workprefs.gfx_size.height) {
-                                       write_log (_T("GUI larger than screen, resize disabled\n"));
-                                       gui_resize_allowed = false;
-                               }
+               fmultx = 0;
+               write_log (_T("Requested GUI size = %dx%d (%dx%d)\n"), gui_width, gui_height, workprefs.gfx_size.width, workprefs.gfx_size.height);
+               if (dodialogmousemove () && isfullscreen() > 0) {
+                       if (gui_width >= workprefs.gfx_size.width || gui_height >= workprefs.gfx_size.height) {
+                               write_log (_T("GUI larger than screen, resize disabled\n"));
+                               gui_resize_allowed = false;
                        }
                }
 
@@ -15649,7 +15686,6 @@ static int GetSettings (int all_options, HWND hwnd)
                                break;
                        }
 
-
                        setguititle (dhwnd);
                        ShowWindow (dhwnd, SW_SHOW);
                        MapDialogRect (dhwnd, &dialog_rect);
@@ -15666,6 +15702,7 @@ static int GetSettings (int all_options, HWND hwnd)
                                        WaitMessage();
                                }
                                dialogmousemove (dhwnd);
+
                                while ((v = PeekMessage (&msg, NULL, 0, 0, PM_REMOVE))) {
                                        if (dialogreturn >= 0)
                                                break;
index eca82a003e6a6e95f3dce428f9ba923674688a35..07608e5ce787862e021fcc5697cb18b437e1056f 100644 (file)
@@ -404,18 +404,63 @@ void scaleresource_setdefaults (void)
        openfont (true);
 }
 
-static int lpx, lpy;
+#define BASEMULT 1000
+static int baseunitx, baseunity;
+static RECT baserect, baseclientrect;
+static int baseborderwidth, baseborderheight;
+static int basewidth, baseheight;
+static int baseclientwidth, baseclientheight;
+
+static INT_PTR CALLBACK TestProc (HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam)
+{
+       if (msg == WM_INITDIALOG) {
+               RECT r;
+               // there really is no better way?
+               r.left = 0;
+               r.top = 0;
+               r.bottom = BASEMULT;
+               r.right = BASEMULT;
+               MapDialogRect (hDlg, &r);
+               baseunitx = r.right * 4 / BASEMULT;
+               baseunity = r.bottom * 8 / BASEMULT;
+               GetWindowRect (hDlg, &baserect);
+               GetClientRect (hDlg, &baseclientrect);
+       }
+       return 0;
+}
 
-double scaleresource_getdpimult (void)
+// horrible or what?
+static void getbaseunits (void)
 {
-       HDC hdc = GetDC (NULL);
-       int m = GetDeviceCaps (hdc, LOGPIXELSY);
-       ReleaseDC (NULL, hdc);
-       if (m > 96) {
-               m -= 96;
-               return 1.0 + m / 250.0;
+       struct newresource *nr, *nr2;
+       HWND hwnd;
+       
+       nr = getresource (IDD_PANEL);
+       if (!nr) {
+               write_log (_T("getbaseunits fail\n"));
+               abort();
+       }
+       multx = multy = 100;
+       nr2 = scaleresource (nr, NULL, -1);
+       hwnd = CreateDialogIndirect (nr2->inst, nr2->resource, NULL, TestProc);
+       if (hwnd) {
+               DestroyWindow(hwnd);
+       } else {
+               baserect.left = baserect.top = 0;
+               baserect.right = 800;
+               baserect.bottom = 600;
+               baseclientrect.left = baseclientrect.top = 0;
+               baseclientrect.right = 800;
+               baseclientrect.bottom = 600;
        }
-       return 1.0;
+       freescaleresource (nr2);
+       freescaleresource (nr);
+       basewidth = baserect.right - baserect.left;
+       baseheight = baserect.bottom - baserect.top;
+       baseclientwidth = baseclientrect.right - baseclientrect.left;
+       baseclientheight = baseclientrect.bottom - baseclientrect.top;
+       baseborderwidth = basewidth - baseclientwidth;
+       baseborderheight = baseheight - baseclientheight;
 }
 
 void scaleresource_init (const TCHAR *prefix)
@@ -425,11 +470,6 @@ void scaleresource_init (const TCHAR *prefix)
 
        fontprefix = prefix;
 
-       HDC hdc = GetDC (NULL);
-       lpx = GetDeviceCaps (hdc, LOGPIXELSX);
-       lpy = GetDeviceCaps (hdc, LOGPIXELSY);
-       ReleaseDC (NULL, hdc);
-
        setdeffont ();
 
        regqueryfont (NULL, fontprefix, fontreg[0], fontname_gui, &fontsize_gui, &fontstyle_gui, &fontweight_gui);
@@ -438,9 +478,12 @@ void scaleresource_init (const TCHAR *prefix)
        //write_log (_T("GUI font %s:%d:%d:%d\n"), fontname_gui, fontsize_gui, fontstyle_gui, fontweight_gui);
        //write_log (_T("List font %s:%d:%d:%d\n"), fontname_list, fontsize_list, fontstyle_list, fontweight_list);
 
+       getbaseunits ();
+
        openfont (true);
 }
 
+#if 0
 static void sizefont (HWND hDlg, const TCHAR *name, int size, int style, int weight, int *width, int *height)
 {
        /* ARGH!!! */
@@ -465,35 +508,18 @@ static void sizefont (HWND hDlg, const TCHAR *name, int size, int style, int wei
        }
        ReleaseDC (hDlg, hdc);
 }
+#endif
 
 void scaleresource_setmult (HWND hDlg, int w, int h)
 {
-       int width, height, width2, height2;
-       
        if (w < 0) {
                multx = -w;
                multy = -h;
                return;
        }
 
-       int cy = GetSystemMetrics (SM_CYSIZEFRAME);
-       int cx = GetSystemMetrics (SM_CXSIZEFRAME);
-       int caption = GetSystemMetrics (SM_CYCAPTION);
-
-       sizefont (hDlg, fontname_gui, fontsize_gui, fontstyle_gui, fontweight_gui, &width, &height);
-       sizefont (hDlg, wfont_old, 8, REGULAR_FONTTYPE, FW_REGULAR, &width2, &height2);
-
-       int yy = cy * 2 + caption;
-       int xx = cx * 2;
-
-       w += xx;
-       h += yy;
-
-       multx = (w * width2) * 100.0 / (GUI_INTERNAL_WIDTH * width);
-       multy = (h * height2) * 100.0 / (GUI_INTERNAL_HEIGHT * height);
-
-       multx = MulDiv (multx, 96, lpx);
-       multy = MulDiv (multy, 96, lpy);
+       multx = w * 100.0 / basewidth;
+       multy = h * 100.0 / baseheight;
 
        if (multx < 50)
                multx = 50;
index 2d5652590756291e5bbac2e541e1c22e7786f93e..bf1435b1cbb071fac9c4eeac14946268adc2fc7f 100644 (file)
@@ -1,6 +1,16 @@
 
 - restore only single input target to default.
 
+Beta 25 RC1:
+
+- Switching to interlaced mode and autoscale enabled: don't calculate new size until 2 frames have been drawn to prevent multiple display size changes.
+- More accurate GUI resizing algorithm.
+- Show also first few bytes of disk in harddrive selection GUI.
+- Add real harddrive as IDE: calculate physical CHS values using H=16,S=63,C=total blocks/(H*S) formula to better match with real hardware.
+  (ROM built-in IDE drivers use IDE identify device CHS values to calculate last accessible block of drive, LBA support was added in ROM updates)
+- Action Replay 2 copper list detection code hang tweak.
+- Prowizard AC1D update (Asle)
+
 Beta 24:
 
 - CDFS: ACTION_DISK_INFO no disk status really works now.
index 6924504ec0968bef49370e5b94204e9e69004fdd..b582f851d31ebe1f9b93ac3614382b61bf12e3b0 100644 (file)
@@ -1,5 +1,5 @@
-/* testAC1D()    */
-/* Rip_AC1D()    */
+/* testAC1D() */
+/* Rip_AC1D() */
 /* Depack_AC1D() */
 
 #include "globals.h"
@@ -9,13 +9,17 @@
 short testAC1D ( void )
 {
   /* test #1 */
-  /*  if ( PW_i<2 )*/
+  /* if ( PW_i<2 )*/
   if ( test_1_start(2) == BAD )
     return BAD;
 
-  /* test #2 */
+  /* test #2 
+  * 20121104 - testing also if the pattern list isn't empty
+  */
   PW_Start_Address = PW_i-2;
-  if ( (in_data[PW_Start_Address] > 0x7f) || ((PW_Start_Address+896)>PW_in_size) )
+  if ( (in_data[PW_Start_Address] > 0x7f) ||
+  (in_data[PW_Start_Address] == 0x00) ||
+  ((PW_Start_Address+896)>PW_in_size) )
   {
     return BAD;
   }
@@ -58,22 +62,22 @@ void Rip_AC1D ( void )
   Save_Rip ( "AC1D Packed module", AC1D_packer );
   
   if ( Save_Status == GOOD )
-    PW_i += (OutputSize - 4);  /* 3 should do but call it "just to be sure" :) */
+    PW_i += (OutputSize - 4); /* 3 should do but call it "just to be sure" :) */
 }
 
 
 
 /*
- *   ac1d.c   1996-1997 (c) Asle / ReDoX
- *
- * Converts AC1D packed MODs back to PTK MODs
- * thanks to Gryzor and his ProWizard tool ! ... without it, this prog
- * would not exist !!!
- *
- * Last update: 30/11/99
- *   - removed open() (and other fread()s and the like)
- *   - general Speed & Size Optmizings
- * 20051002 : testing fopen() ...
+* ac1d.c 1996-1997 (c) Asle / ReDoX
+*
+* Converts AC1D packed MODs back to PTK MODs
+* thanks to Gryzor and his ProWizard tool ! ... without it, this prog
+* would not exist !!!
+*
+* Last update: 30/11/99
+* - removed open() (and other fread()s and the like)
+* - general Speed & Size Optmizings
+* 20051002 : testing fopen() ...
 */
 void Depack_AC1D ( void )
 {
@@ -240,11 +244,11 @@ void Depack_AC1D ( void )
   fwrite ( &in_data[Where] , WholeSampleSize , 1 , out );
 
   /* crap ... */
-  Crap ( "   AC1D Packer    " , BAD , BAD , out );
+  Crap ( " AC1D Packer " , BAD , BAD , out );
 
   fflush ( out );
   fclose ( out );
 
   printf ( "done\n" );
   return; /* useless ... but */
-}
+}
\ No newline at end of file