]> git.unchartedbackwaters.co.uk Git - francis/winuae.git/commitdiff
2600b13
authorToni Wilen <twilen@winuae.net>
Sat, 23 Mar 2013 14:08:48 +0000 (16:08 +0200)
committerToni Wilen <twilen@winuae.net>
Sat, 23 Mar 2013 14:08:48 +0000 (16:08 +0200)
18 files changed:
akiko.cpp
blitter.cpp
custom.cpp
drawing.cpp
filesys.cpp
newcpu.cpp
od-win32/cloanto/RetroPlatformGuestIPC.h
od-win32/cloanto/RetroPlatformIPC.h
od-win32/cloanto/RetroPlatformIPC_doc_draft.txt
od-win32/dinput.cpp
od-win32/direct3d.cpp
od-win32/dxwrap.cpp
od-win32/rp.cpp
od-win32/screenshot.cpp
od-win32/win32.h
od-win32/win32gfx.cpp
od-win32/win32gui.cpp
od-win32/winuaechangelog.txt

index dc4f644cf1ac040c74677fe5e1a8e75dacc3a468..2bdcc4f6bd0715433c47e1f30b583f9bd908ea21 100644 (file)
--- a/akiko.cpp
+++ b/akiko.cpp
@@ -807,25 +807,25 @@ static void cdrom_return_data (void)
        if (cdcomrxinx == cdcomrxcmp)
                return;
 
-       #if AKIKO_DEBUG_IO_CMD
-               write_log (_T("OUT IDX=0x%02X-0x%02X LEN=%d,%08x:"), cdcomrxinx, cdcomrxcmp, cdrom_receive_length, cmd_buf);
-       #endif
+#if AKIKO_DEBUG_IO
+       write_log (_T("OUT IDX=0x%02X-0x%02X LEN=%d,%08x:"), cdcomrxinx, cdcomrxcmp, cdrom_receive_length, cmd_buf);
+#endif
 
        if (cdrom_receive_offset < 0) {
                checksum = 0xff;
                for (i = 0; i < cdrom_receive_length; i++) {
                        checksum -= cdrom_result_buffer[i];
-       #if AKIKO_DEBUG_IO_CMD
+#if AKIKO_DEBUG_IO
                        write_log (_T("%02X "), cdrom_result_buffer[i]);
-       #endif
+#endif
                }
-#if AKIKO_DEBUG_IO_CMD
+#if AKIKO_DEBUG_IO
                write_log (_T("(%02X)\n"), checksum);
 #endif
                cdrom_result_buffer[cdrom_receive_length++] = checksum;
                cdrom_receive_offset = 0;
        } else {
-#if AKIKO_DEBUG_IO_CMD
+#if AKIKO_DEBUG_IO
                write_log (_T("\n"));
 #endif
        }
@@ -836,7 +836,7 @@ static void cdrom_return_data (void)
        }
        if (cdcomrxinx == cdcomrxcmp) {
                set_status (CDINTERRUPT_RXDMADONE);
-#if AKIKO_DEBUG_IO_CMD
+#if AKIKO_DEBUG_IO
                write_log (_T("RXDMADONE %d/%d\n"), cdrom_receive_offset, cdrom_receive_length);
 #endif
        }
index 9e33273c3bc2508ad8a7e5123500f69b34b8dff5..d9fdf071b4a3c4eba7cadfcabdef2069ee7a6896 100644 (file)
@@ -1155,6 +1155,11 @@ static void blitter_force_finish (void)
        }
 }
 
+static bool invstate (void)
+{
+       return bltstate != BLT_done && bltstate != BLT_init;
+}
+
 static void blit_bltset (int con)
 {
        int i;
@@ -1176,7 +1181,7 @@ static void blit_bltset (int con)
        blitfill = !!(bltcon1 & 0x18);
 
        // disable line draw if bltcon0 is written while it is active
-       if (!savestate_state && bltstate != BLT_done && blitline) {
+       if (!savestate_state && bltstate != BLT_done && bltstate != BLT_init && blitline) {
                blitline = 0;
                bltstate = BLT_done;
                blit_interrupt = 1;
@@ -1208,7 +1213,7 @@ static void blit_bltset (int con)
        // non-extra cycle to extra cycle: does not freeze but cycle diagram goes weird,
        // extra free cycle changes to another D write..
        // (Absolute Inebriation vector cube inside semi-filled vector object requires freezing blitter.)
-       if (!savestate_state && bltstate != BLT_done) {
+       if (!savestate_state && invstate ()) {
                static int freezes = 10;
                int isen = blit_diag >= &blit_cycle_diagram_fill[0][0] && blit_diag <= &blit_cycle_diagram_fill[15][0];
                int iseo = olddiag >= &blit_cycle_diagram_fill[0][0] && olddiag <= &blit_cycle_diagram_fill[15][0];
@@ -1233,7 +1238,7 @@ static void blit_bltset (int con)
 
        // on the fly switching from CH=1 to CH=D -> blitter stops writing (Rampage/TEK)
        // currently just switch to no-channels mode, better than crashing the demo..
-       if (!savestate_state && bltstate != BLT_done) {
+       if (!savestate_state && invstate ()) {
                static uae_u8 changetable[32 * 32];
                int o = original_ch + (original_fill ? 16 : 0);
                int n = blit_ch + (blitfill ? 16 : 0);
@@ -1310,6 +1315,27 @@ static bool waitingblits (void)
        return false;
 }
 
+static void blitter_start_init (void)
+{
+       blt_info.blitzero = 1;
+       preva = 0;
+       prevb = 0;
+       blit_frozen = 0;
+
+       blit_bltset (1 | 2);
+       blit_modset ();
+       ddat1use = ddat2use = 0;
+       blit_interrupt = 0;
+
+       if (blitline) {
+               blinea = blt_info.bltadat;
+               blineb = (blt_info.bltbdat >> blt_info.blitbshift) | (blt_info.bltbdat << (16 - blt_info.blitbshift));
+               blitonedot = 0;
+               blitlinepixel = 0;
+               blitsing = bltcon1 & 0x2;
+       }
+}
+
 static void do_blitter2 (int hpos, int copper)
 {
        int cycles;
@@ -1334,35 +1360,22 @@ static void do_blitter2 (int hpos, int copper)
        bltstate = BLT_done;
 
        blitter_cycle_exact = currprefs.blitter_cycle_exact;
-       blt_info.blitzero = 1;
-       preva = 0;
-       prevb = 0;
        blt_info.got_cycle = 0;
-       blit_frozen = 0;
-
+       last_blitter_hpos = hpos + 1;
        blit_firstline_cycles = blit_first_cycle = get_cycles ();
        blit_misscyclecounter = 0;
        blit_last_cycle = 0;
        blit_maxcyclecounter = 0;
-       last_blitter_hpos = hpos + 1;
        blit_cyclecounter = 0;
        blit_totalcyclecounter = 0;
 
-       blit_bltset (1 | 2);
-       blit_modset ();
-       ddat1use = ddat2use = 0;
-       blit_interrupt = 0;
+       blitter_start_init ();
 
        if (blitline) {
-               blinea = blt_info.bltadat;
-               blineb = (blt_info.bltbdat >> blt_info.blitbshift) | (blt_info.bltbdat << (16 - blt_info.blitbshift));
-               blitonedot = 0;
-               blitlinepixel = 0;
-               blitsing = bltcon1 & 0x2;
                cycles = blt_info.vblitsize;
        } else {
-               blit_firstline_cycles = blit_first_cycle + (blit_diag[0] * blt_info.hblitsize + cpu_cycles) * CYCLE_UNIT;
                cycles = blt_info.vblitsize * blt_info.hblitsize;
+               blit_firstline_cycles = blit_first_cycle + (blit_diag[0] * blt_info.hblitsize + cpu_cycles) * CYCLE_UNIT;
        }
 
        if (cleanstart) {
@@ -1435,7 +1448,9 @@ static void do_blitter2 (int hpos, int copper)
                return;
        }
 
-       blt_info.got_cycle = 1;
+       if (dmaen (DMA_BLITTER)) {
+               blt_info.got_cycle = 1;
+       }
        blit_waitcyclecounter = 0;
 
        if (currprefs.immediate_blits) {
@@ -1461,6 +1476,7 @@ void blitter_check_start (void)
 {
        if (bltstate != BLT_init)
                return;
+       blitter_start_init ();
        bltstate = BLT_work;
        if (currprefs.immediate_blits) {
                blitter_doit ();
index a634092fb44f77b790a34be7ea9eea647eafe6e3..3994e70a2e372e57541d377c75531ecab821d7a7 100644 (file)
@@ -3681,6 +3681,14 @@ static void DMACON (int hpos, uae_u16 v)
                        unset_special (SPCFLAG_COPPER);
                }
        }
+
+#if 0
+       int oldb = (oldcon & DMA_BLITTER) && (oldcon & DMA_MASTER);
+       int newb = (dmacon & DMA_BLITTER) && (dmacon & DMA_MASTER);
+       int oldbn = (oldcon & DMA_BLITPRI);
+       int newbn = (dmacon & DMA_BLITPRI);
+#endif
+
        if ((dmacon & DMA_BLITPRI) > (oldcon & DMA_BLITPRI) && bltstate != BLT_done)
                set_special (SPCFLAG_BLTNASTY);
 
@@ -5518,8 +5526,11 @@ static bool framewait (void)
                if ((int)start - (int)vsync_time >= 0 && (int)start - (int)vsync_time < vsynctimebase)
                        t += (int)start - (int)vsync_time;
 
-               if (!frame_shown)
+               if (!frame_shown) {
                        show_screen (1);
+                       if (currprefs.gfx_apmode[0].gfx_strobo)
+                               show_screen (2);
+               }
 
                int legacy_avg = mavg (&ma_legacy, t, MAVG_VSYNC_SIZE);
                if (t > legacy_avg)
index 9537eeeefd6a5e1849444a2b69f9d5923dacc0a8..8f498aedf8a7a155c5c528f885a2dbc91cb29d54 100644 (file)
@@ -2133,7 +2133,7 @@ static void do_color_changes (line_draw_func worker_border, line_draw_func worke
                } else if (regno >= 0) {
                        if (regno == 0 && (value & COLOR_CHANGE_BRDBLANK)) {
                                colors_for_drawing.borderblank = (value & 1) != 0;
-                               colors_for_drawing.bordersprite = (value & 2) != 0;
+                               colors_for_drawing.bordersprite = (value & 3) == 2;
                        } else {
                                color_reg_set (&colors_for_drawing, regno, value);
                                colors_for_drawing.acolors[regno] = getxcolor (value);
index 180fb0c65c04f5a92a3495c22ac598e3cd92b55e..15c06d61232e80b9773b340563c0b5c919c4e017 100644 (file)
@@ -6865,6 +6865,7 @@ static int dofakefilesys (UnitInfo *uip, uaecptr parmpacket, struct uaedev_confi
        struct zfile *zf;
        int ver = -1, rev = -1;
        uae_u32 dostype;
+       bool autofs = false;
 
        // we already have custom filesystem loaded for earlier hardfile?
        if (!ci->forceload) {
@@ -6874,7 +6875,7 @@ static int dofakefilesys (UnitInfo *uip, uaecptr parmpacket, struct uaedev_confi
                        put_long (parmpacket + PP_FSSIZE, 0);
                        put_long (parmpacket + PP_FSPTR, seg);
                        put_long (parmpacket + PP_ADDTOFSRES, 0);
-                       write_log (_T("HDF: faked RDB filesystem '%s' reused\n"), uip->filesysdir);
+                       write_log (_T("RDB: faked RDB filesystem '%s' reused\n"), uip->filesysdir);
                        return FILESYS_HARDFILE;
                }
        }
@@ -6899,6 +6900,7 @@ static int dofakefilesys (UnitInfo *uip, uaecptr parmpacket, struct uaedev_confi
                while (i > 0 && tmp[i - 1] != '/' && tmp[i - 1] != '\\')
                        i--;
                _tcscpy (tmp + i, _T("FastFileSystem"));
+               autofs = true;
        }
        if (tmp[0] == 0) {
                write_log (_T("RDB: no filesystem for dostype 0x%08X (%s)\n"), dostype, dostypes (dostype));
@@ -6919,6 +6921,29 @@ static int dofakefilesys (UnitInfo *uip, uaecptr parmpacket, struct uaedev_confi
                return FILESYS_HARDFILE;
        }
 
+       uae_u32 fsres, fsnode;
+       int oldversion = -1;
+       int oldrevision = -1;
+       fsres = get_long (parmpacket + PP_FSRES);
+       fsnode = get_long (fsres + 18);
+       while (get_long (fsnode)) {
+               uae_u32 fsdostype = get_long (fsnode + 14);
+               if (fsdostype == dostype) {
+                       oldversion = get_word (fsnode + 18);
+                       oldrevision = get_word (fsnode + 20);
+                       write_log (_T("RDB: %08X (%s) in FileSystem.resource version %d.%d\n"), dostype, dostypes (dostype), oldversion, oldrevision);
+                       break;
+               }
+               fsnode = get_long (fsnode);
+       }
+       // if automatically found FastFileSystem, do not replace matching FileSystem.resource FS
+       if (autofs && oldversion >= 0) {
+               zfile_fclose (zf);
+               addfakefilesys (parmpacket, dostype, ver, rev, ci);
+               write_log (_T("RDB: not replacing FileSystem.resource\n"));
+               return FILESYS_HARDFILE;
+       }
+
        zfile_fseek (zf, 0, SEEK_END);
        size = zfile_ftell (zf);
        if (size > 0) {
@@ -6965,28 +6990,13 @@ static int dofakefilesys (UnitInfo *uip, uaecptr parmpacket, struct uaedev_confi
        zfile_fclose (zf);
        uip->rdb_filesyssize = size;
 
-       uae_u32 fsres, fsnode;
-       int oldversion = -1;
-       int oldrevision = -1;
-       fsres = get_long (parmpacket + PP_FSRES);
-       fsnode = get_long (fsres + 18);
-       while (get_long (fsnode)) {
-               uae_u32 fsdostype = get_long (fsnode + 14);
-               if (fsdostype == dostype) {
-                       oldversion = get_word (fsnode + 18);
-                       oldrevision = get_word (fsnode + 20);
-                       write_log (_T("HDF: %08X (%s) in FileSystem.resource version %d.%d\n"), dostype, dostypes (dostype), oldversion, oldrevision);
-                       break;
-               }
-               fsnode = get_long (fsnode);
-       }
        // DOS\0 is not in fs.resource
        if (dostype == 0x444f5300 && oldversion < 0)
                oldversion = 0;
        put_long (parmpacket + PP_FSSIZE, uip->rdb_filesyssize);
        put_long (parmpacket + PP_ADDTOFSRES, oldversion < 0 ? -1 : 0);
        addfakefilesys (parmpacket, dostype, ver, rev, ci);
-       write_log (_T("HDF: faked RDB filesystem %08X (%s %d.%d) loaded. ADD2FS=%d\n"), dostype, dostypes (dostype), ver, rev, oldversion < 0 ? 1 : 0);
+       write_log (_T("RDB: faked RDB filesystem %08X (%s %d.%d) loaded. ADD2FS=%d\n"), dostype, dostypes (dostype), ver, rev, oldversion < 0 ? 1 : 0);
        return FILESYS_HARDFILE;
 }
 
index c6aaf05f4c763fb88c4abf0cf081f73c1ac98486..713c3d9effba84715affc490222ce29267ceaf54 100644 (file)
@@ -1216,6 +1216,14 @@ static void update_68k_cycles (void)
                }
        } else if (currprefs.cpu_frequency) {
                cpucycleunit = CYCLE_UNIT * baseclock / currprefs.cpu_frequency;
+       } else if (currprefs.cpu_cycle_exact && currprefs.cpu_clock_multiplier == 0) {
+               if (currprefs.cpu_model >= 68030) {
+                       cpucycleunit = CYCLE_UNIT / 8;
+               } else if (currprefs.cpu_model == 68020) {
+                       cpucycleunit = CYCLE_UNIT / 4;
+               } else {
+                       cpucycleunit = CYCLE_UNIT / 2;
+               }
        }
        if (cpucycleunit < 1)
                cpucycleunit = 1;
@@ -6098,8 +6106,8 @@ int getDivs68kCycles (uae_s32 dividend, uae_s16 divisor)
 }
 
 /* 68000 Z=1. NVC=0
- * 68020 Signed: Z=1 NVC=0. Unsigned: V=1 N<dst, Z=!N.
- * 68060 C=0.
+ * 68020 and 68030: Signed: Z=1 NVC=0. Unsigned: V=1, N<dst, Z=!N, C=0.
+ * 68040/68060 C=0.
  */
 void divbyzero_special (bool issigned, uae_s32 dst)
 {
index ed12b6b4ba75802c2a5b9a4492eb6dced66d5faa..68b0a837ce2e14096eac2de5e61209954d2f223d 100644 (file)
@@ -2,13 +2,14 @@
  Name    : RetroPlatformGuestIPC.h
  Project : RetroPlatform Player
  Client  : Cloanto Italia srl
- Legal   : Copyright 2007, 2008 Cloanto Italia srl - All rights reserved. This
-         : file is made available under the terms of the GNU General Public
-         : License version 2 as published by the Free Software Foundation.
+ Support : http://www.retroplatform.com
+ Legal   : Copyright 2007-2012 Cloanto Italia srl - All rights reserved. This
+         : file is made available under the terms of the Mozilla Public License
+         : version 2.0 as published by Mozilla Corporation.
  Authors : os
  Created : 2007-08-24 15:29:26
- Updated : 2008-06-10 13:42:00
- Comment : RP Player interprocess communication include file (guest side)
+ Updated : 2012-11-29 13:47:00
+ Comment : RetroPlatform Player interprocess communication include file (guest side)
  *****************************************************************************/
 
 #ifndef __CLOANTO_RETROPLATFORMGUESTIPC_H__
index b33d1410f6ea0fa026941c37bf39937e10fac89d..d21798603e71d6acaa82bb0ac4e759e6776745ca 100644 (file)
@@ -3,12 +3,12 @@
  Project : RetroPlatform Player
  Client  : Cloanto Italia srl
  Support : http://www.retroplatform.com
- Legal   : Copyright 2007-2012 Cloanto Italia srl - All rights reserved. This
+ Legal   : Copyright 2007-2013 Cloanto Italia srl - All rights reserved. This
          : file is made available under the terms of the Mozilla Public License
          : version 2.0 as published by Mozilla Corporation.
  Authors : os, mcb
  Created : 2007-08-27 13:55:49
- Updated : 2012-04-23 12:41:00
+ Updated : 2013-03-20 17:15:00
  Comment : RetroPlatform Player interprocess communication include file
  *****************************************************************************/
 
@@ -17,9 +17,9 @@
 
 #include <windows.h>
 
-#define RETROPLATFORM_API_VER       "3.3"
+#define RETROPLATFORM_API_VER       "3.4"
 #define RETROPLATFORM_API_VER_MAJOR  3
-#define RETROPLATFORM_API_VER_MINOR  3
+#define RETROPLATFORM_API_VER_MINOR  4
 
 #define RPIPC_HostWndClass   "RetroPlatformHost%s"
 #define RPIPC_GuestWndClass  "RetroPlatformGuest%d"
@@ -65,7 +65,6 @@
 
 #define RP_IPC_TO_GUEST_CLOSE               (WM_APP + 200)
 #define RP_IPC_TO_GUEST_SCREENMODE          (WM_APP + 202)
-#define RP_IPC_TO_GUEST_SCREENCAPTURE       (WM_APP + 203)
 #define RP_IPC_TO_GUEST_PAUSE               (WM_APP + 204)
 #define RP_IPC_TO_GUEST_RESET               (WM_APP + 206)
 #define RP_IPC_TO_GUEST_TURBO               (WM_APP + 207)
@@ -81,6 +80,7 @@
 #define RP_IPC_TO_GUEST_QUERYSCREENMODE     (WM_APP + 217)
 #define RP_IPC_TO_GUEST_GUESTAPIVERSION     (WM_APP + 218) // introduced in RetroPlatform API 3.0
 #define RP_IPC_TO_GUEST_DEVICECONTENT       (WM_APP + 219) // extended in RetroPlatform API 3.0
+#define RP_IPC_TO_GUEST_SCREENCAPTURE       (WM_APP + 220) // extended in RetroPlatform API 3.4
 
 // ****************************************************************************
 //  Message Data Structures and Defines
 
 // Guest Features
 #define RP_FEATURE_POWERLED                            0x00000001 // a power LED is emulated
-#define RP_FEATURE_SCREEN1X                            0x00000002 // 1x mode is available
+#define RP_FEATURE_SCREEN1X                            0x00000002 // 1x mode is available (1 Amiga hires interlaced/RTG pixel = 1 host pixel)
 #define RP_FEATURE_SCREEN2X                            0x00000004 // 2x mode is available
 #define RP_FEATURE_SCREEN3X                            0x00000008 // 3x mode is available
 #define RP_FEATURE_SCREEN4X                            0x00000010 // 4x mode is available
 #define RP_FEATURE_FULLSCREEN                          0x00000020 // fullscreen display is available
-#define RP_FEATURE_SCREENCAPTURE                       0x00000040 // screen capture functionality is available (see RP_IPC_TO_GUEST_SCREENCAPTURE message)
+#define RP_FEATURE_RESERVED                        0x00000040 // unused - reserved for future use (to not cause side effects during screen capture changes in 201303 beta)
 #define RP_FEATURE_PAUSE                               0x00000080 // pause functionality is available (see RP_IPC_TO_GUEST_PAUSE message)
 #define RP_FEATURE_TURBO_CPU                           0x00000100 // turbo CPU functionality is available (see RP_IPC_TO_GUEST_TURBO message)
 #define RP_FEATURE_VOLUME                              0x00000200 // volume adjustment is possible (see RP_IPC_TO_GUEST_VOLUME message)
 #define RP_FEATURE_TURBO_TAPE                          0x01000000 // turbo tape functionality is available (see RP_IPC_TO_GUEST_TURBO message)
 #define RP_FEATURE_MEMORY_BASIC                    0x02000000 // Memory I/O basic features: Read, Write
 #define RP_FEATURE_MEMORY_ADVANCED                 0x04000000 // Memory I/O advanced features: Watch, Find, Alert, Freeze, Lock, Unlock, Off (must set both flags if full set is supported!)
+#define RP_FEATURE_SCREENCAPTURE                       0x08000000 // new screen capture functionality is available (see RP_IPC_TO_GUEST_SCREENCAPTURE message)
 
 typedef struct RPScreenMode
 {
@@ -384,6 +385,37 @@ typedef struct RPDeviceContent
 #define RP_DEVICEACTIVITY_READ     RP_DEVICEACTIVITY_GREEN // device activity is a read operation
 #define RP_DEVICEACTIVITY_WRITE    RP_DEVICEACTIVITY_RED   // device activity is a write operation
 
+
+// RPScreenCapture (used by RP_IPC_TO_GUEST_SCREENCAPTURE to request one bitmap or two simultaneous bitmaps)
+
+typedef struct RPScreenCapture
+{
+       DWORD dwFlags;                      // currently set to 0
+       WCHAR szScreenRaw[260];             // "\0" or full path and name (Unicode) of the BMP file to save - unfiltered, unscaled, unclipped bitmap (i.e. close to guest representation)
+       WCHAR szScreenFiltered[260];        // "\0" or full path and name (Unicode) of the BMP file to save - filtered (e.g. scanline effects), scaled (e.g. line-doubled and 2X-multiplied), clipped (overscan cropped) bitmap (i.e. as displayed in host environment)
+} RPSCREENCAPTURE;
+
+// Return codes for RP_IPC_TO_GUEST_SCREENCAPTURE
+#define RP_SCREENCAPTURE_ERROR                      0x00000000  // non-error is always >= 1 (because of "MODE" flags)
+
+#define RP_GUESTSCREENFLAGS_MODE_DIGITAL            0x00000001  // "RTG" on Amiga, might be referred to as VGA or other digital (non-TV) mode on other systems
+#define RP_GUESTSCREENFLAGS_MODE_NTSC               0x00000002
+#define RP_GUESTSCREENFLAGS_MODE_PAL                0x00000003
+#define RP_GUESTSCREENFLAGS_MODEMASK                0x00000003
+#define RP_GUESTSCREENFLAGS_MODE(m)                 ((m) & RP_GUESTSCREENFLAGS_MODEMASK) // returns RP_GUESTSCREENFLAGS_MODE_DIGITAL, RP_GUESTSCREENFLAGS_MODE_NTSC or RP_GUESTSCREENFLAGS_MODE_PAL
+
+#define RP_GUESTSCREENFLAGS_VERTICAL_NONINTERLACED  0x00000000  // default also for RP_GUESTSCREENFLAGS_MODE_DIGITAL modes
+#define RP_GUESTSCREENFLAGS_VERTICAL_INTERLACED     0x00000004
+#define RP_GUESTSCREENFLAGS_VERTICALMASK            0x00000004
+#define RP_GUESTSCREENFLAGS_VERTICAL(m)             ((m) & RP_GUESTSCREENFLAGS_VERTICALMASK) // returns RP_GUESTSCREENFLAGS_VERTICAL_NONINTERLACED o RP_GUESTSCREENFLAGS_VERTICAL_INTERLACED
+
+#define RP_GUESTSCREENFLAGS_HORIZONTAL_LORES        0x00000008
+#define RP_GUESTSCREENFLAGS_HORIZONTAL_HIRES        0x00000000  // default also for RP_GUESTSCREENFLAGS_MODE_DIGITAL modes
+#define RP_GUESTSCREENFLAGS_HORIZONTAL_SUPERHIRES   0x00000018
+#define RP_GUESTSCREENFLAGS_HORIZONTALMASK          0x00000018
+#define RP_GUESTSCREENFLAGS_HORIZONTAL(m)           ((m) & RP_GUESTSCREENFLAGS_HORIZONTALMASK) // returns RP_GUESTSCREENFLAGS_HORIZONTAL_LORES, RP_GUESTSCREENFLAGS_HORIZONTAL_HIRES or RP_GUESTSCREENFLAGS_HORIZONTAL_SUPERHIRES
+
+
 // RP_IPC_TO_HOST_HOSTVERSION
 //   3 3 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1
 //   1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0
index 33e5521957d3214bf5046d1b28b4ff2b7acd19f7..424a5d8c304c39913749d4a318edd2304a402a0a 100644 (file)
@@ -4,12 +4,12 @@
  Client  : Cloanto Italia srl
  Support : http://www.retroplatform.com
  Legal   : CONFIDENTIAL TRADE SECRET PROPERTY OF CLOANTO ITALIA SRL
-         : Copyright Â© Cloanto Italia srl 2007-2011.
+         : Copyright Â© Cloanto Italia srl 2007-2013.
          : All rights reserved, except where licensed,
          : assigned or transferred by contract.
  Authors : os, mcb
  Created : 2007-08-23 10:08:25
- Updated : 2011-07-28 11:26:00
+ Updated : 2013-03-16 07:20:00
  Comment : Reference for RetroPlatformIPC.h (RP Player interprocess communication include file)
  *****************************************************************************/
 
 ****************************************************************************
 
 Message:
-   RPIPCGM_REGISTER
+   RP_IPC_TO_HOST_REGISTER
 Description:
    this is a private message and is automatically sent
    by the RPInitializeGuest() function
    to register the caller as a RetroPlatform guest
 
 
-Message:
-   RPIPCGM_FEATURES
-Description:
-   the guest uses this sequence of messages to tell the host
-   about the features it supports;
-   at startup time, the guest sends initialization messages
+Notes about startup:
+>>>
+   At startup time, the guest sends initialization messages
+   (terminated by RP_IPC_TO_HOST_SCREENMODE)
    so that the host can adapt the GUI based on the reported features;
    these messages include:
-      RPIPCGM_FEATURES (describes guest features),
-      RPIPCGM_INPUTDEVICE (enumerates available input devices)
-      RPIPCGM_POWERLED (turns on the power LED in the GUI),
-      RPIPCGM_DEVICES (one for each device category: tells the number of emulated devices),
-      RPIPCGM_DEVICECONTENT (one for each device with an image file or peripheral attached),
-      RPIPCGM_DEVICEREADWRITE (one for each device with an image file or peripheral attached - optional for non-floppy/non-hard disk which are always read-only),
-      RPIPCGM_TURBO (tells if some of the turbo modes are activated from the start),
-      RPIPCGM_VOLUME (reports about starting volume level),
-      RPIPCGM_SCREENMODE (communicates the screen mode, the clipping coordinates and the guest window handle);
+      RP_IPC_TO_HOST_FEATURES (describes guest features),
+      RP_IPC_TO_HOST_INPUTDEVICE (enumerates available input devices)
+      RP_IPC_TO_HOST_POWERLED (turns on the power LED in the GUI),
+      RP_IPC_TO_HOST_DEVICES (one for each device category: tells the number of emulated devices),
+      RP_IPC_TO_HOST_DEVICECONTENT (one for each device with an image file or peripheral attached),
+      RP_IPC_TO_HOST_DEVICEREADWRITE (one for each device with an image file or peripheral attached - optional for non-floppy/non-hard disk which are always read-only),
+      RP_IPC_TO_HOST_TURBO (tells if some of the turbo modes are activated from the start),
+      RP_IPC_TO_HOST_VOLUME (reports about starting volume level),
+      RP_IPC_TO_HOST_SCREENMODE (communicates the screen mode, the clipping coordinates and the guest window handle);
    note that at startup time the guest should create a borderless and hidden window
-   and send its handle using a RPIPCGM_SCREENMODE message, which must be the last
+   and send its handle using a RP_IPC_TO_HOST_SCREENMODE message, which must be the last
    of the initialization messages, since it displays the guest window
    and the host "frame window" (the part of the player user interface
    with command and status icons which can be used to drag the guest window, etc.);
    in some circumstances the host may decide not to display the guest window
-   when receiving the RPIPCGM_SCREENMODE message (e.g. in Express mode
+   when receiving the RP_IPC_TO_HOST_SCREENMODE message (e.g. in Express mode
    the guest may be immediately paused and an intro banner may be displayed;
    when the intro banner is dismissed the guest is resumed from pause mode
-   and its window is displayed)
+   and its window is displayed);
+<<<
+   
+Message:
+   RP_IPC_TO_HOST_FEATURES
+Description:
+   the guest uses this sequence of messages to tell the host
+   about the features it supports;
+   
+   at startup time, the guest sends RP_IPC_TO_HOST_FEATURES to describe
+   the guest features, so that the host can adapt the UI based on the
+   reported features; in this context, RP_IPC_TO_HOST_FEATURES is sent
+   together with the other initialization messages;
+
+   at runtime RP_IPC_TO_HOST_FEATURES may be sent with a fresh set of
+   attributes (e.g. because a new screen mode can be scaled in different ways, etc.)
+   
 Data sent:
    WPARAM = RP_FEATURE_* flags
 Response:
@@ -62,12 +76,15 @@ Response:
 
 
 Message:
-   RPIPCGM_INPUTDEVICE
+   RP_IPC_TO_HOST_INPUTDEVICE
 Description:
-   the guest sends one or more RPIPCGM_INPUTDEVICE messages
-   after sending the RPIPCGM_FEATURES messages, but before
-   sending the final RPIPCGM_SCREENMODE message, which also
-   indicates that no more RPIPCGM_INPUTDEVICE messages will follow.
+   the guest sends one or more consecutive RP_IPC_TO_HOST_INPUTDEVICE messages,
+   terminated by an RP_HOSTINPUT_END type device. This input device enumeration
+   must be done at startup (immediately after sending the RP_IPC_TO_HOST_FEATURES
+   messages and before the RP_IPC_TO_HOST_SCREENMODE message) and
+   should be done whenever a device is added or removed. The first message
+   of a series resets the list of input devices, which starts fresh from that first
+   input device, followed by more devices until the RP_HOSTINPUT_END dummy device.
    The messages enumerate the input-type devices (RP_DEVICECATEGORY_INPUTPORT
    category) found on the host.
 Data sent:
@@ -77,12 +94,12 @@ Response:
 
 
 Message:
-   RPIPCGM_CLOSED
+   RP_IPC_TO_HOST_CLOSED
 Description:
    this message is sent to the host when the guest is terminating;
    the RPPostMessage() function (instead of RPSendMessage()) should be used
    to send this message, since the host may wait for the guest process to terminate
-   when RPIPCGM_CLOSED is received
+   when RP_IPC_TO_HOST_CLOSED is received
 Data sent:
    none
 Response:
@@ -90,7 +107,7 @@ Response:
 
 
 Message:
-   RPIPCGM_ACTIVATED
+   RP_IPC_TO_HOST_ACTIVATED
 Description:
    the guest sends this message to the host
    when its window is being activated
@@ -101,7 +118,7 @@ Response:
 
 
 Message:
-   RPIPCGM_DEACTIVATED
+   RP_IPC_TO_HOST_DEACTIVATED
 Description:
    the guest sends this message to the host
    when its window is being deactivated
@@ -112,7 +129,7 @@ Response:
 
 
 Message:
-   RPIPCGM_ENABLED
+   RP_IPC_TO_HOST_ENABLED
 Description:
    the guest sends this message to the host when its window is being enabled
    (e.g. a WM_ENABLE message has been received with wParam set to TRUE);
@@ -124,7 +141,7 @@ Response:
 
 
 Message:
-   RPIPCGM_DISABLED
+   RP_IPC_TO_HOST_DISABLED
 Description:
    the guest sends this message to the host when its window is being disabled
    (e.g. a WM_ENABLE message has been received with wParam set to FALSE);
@@ -136,23 +153,27 @@ Response:
 
 
 Message:
-   RPIPCGM_SCREENMODE
+   RP_IPC_TO_HOST_SCREENMODE
 Description:
-   the guest sends a RPIPCGM_SCREENMODE message to notify the host
+   the guest sends a RP_IPC_TO_HOST_SCREENMODE message to notify the host
    about a change in its "screen mode"
    (1x/2x/3x/4x, full screen, clipping coordinates, etc.),
    or to keep the host updated about the guest window handle
    (just before destroying its window, the guest sends this message
    with the hGuestWindow field of the RPSCREENMODE structure set to NULL);
    screen mode changes requested by the host
-   (see the RPIPCHM_SCREENMODE message) must not be notified,
+   (see the RP_IPC_TO_GUEST_SCREENMODE message) must not be notified,
    unless this is an asynchronous screen mode change
    (i.e. the guest returned the INVALID_HANDLE_VALUE
-   response to a RPIPCHM_SCREENMODE host request);
-   at startup time, the guest must create
+   response to a RP_IPC_TO_GUEST_SCREENMODE host request).
+
+   At startup time, the guest must create
    a borderless and hidden window and send its handle
    using this message; the host will then take care
-   of preparing, positioning and showing the guest window
+   of preparing, positioning and showing the guest window.
+   RP_IPC_TO_HOST_SCREENMODE marks the end of the guest
+   initialization steps.
+
 Data sent:
    pData = a RPSCREENMODE structure
 Response:
@@ -160,17 +181,19 @@ Response:
 
 
 Message:
-   RPIPCGM_POWERLED
+   RP_IPC_TO_HOST_POWERLED
 Description:
    sent to the host to change the power LED state
 Data sent:
-   WPARAM = power LED intensity (min/off 0, max 100)
+   WPARAM = power LED intensity (off 0, min 1, max decimal 100)
+            in a dual-brightness LED system values 1-49 (decimal) indicate the
+            "dimmed" status (Amiga "low-pass filter off")
 Response:
    none
 
 
 Message:
-   RPIPCGM_DEVICES
+   RP_IPC_TO_HOST_DEVICES
 Description:
    this message is used to notify the host about a change
    in the number of emulated devices (floppy drives, hard disks, etc.)
@@ -185,7 +208,7 @@ Response:
 
 
 Message:
-   RPIPCGM_DEVICEACTIVITY
+   RP_IPC_TO_HOST_DEVICEACTIVITY
 Description:
    this message can be used to turn on or off the activity indicator
    of a specified device (a single LED on the original hardware)
@@ -217,14 +240,14 @@ Response:
 
 
 Message:
-   RPIPCGM_MOUSECAPTURE
+   RP_IPC_TO_HOST_MOUSECAPTURE
 Description:
    the guest sends this message when the mouse is captured/released
    (the mouse is "captured" when its movements are restricted to the guest window area
    and the system cursor is not visible);
    mouse capture changes requested by the host
-   (see the RPIPCHM_MOUSECAPTURE message) must not be notified;
-   for consistency across different guests, a guest which sends RPIPCGM_MOUSECAPTURE
+   (see the RP_IPC_TO_GUEST_MOUSECAPTURE message) must not be notified;
+   for consistency across different guests, a guest which sends RP_IPC_TO_HOST_MOUSECAPTURE
    messages should also implement a keyboard-actuated escape functionality
    (the preferred key for this purpose is included in the parameters sent from the
    host at startup time - see RPLaunchGuest() in RetroPlatformPlugin.h);
@@ -241,9 +264,9 @@ Response:
 
 
 Message:
-   RPIPCGM_HOSTAPIVERSION
+   RP_IPC_TO_HOST_HOSTAPIVERSION
 Description:
-    the guest can send a RPIPCGM_HOSTAPIVERSION to query the host
+    the guest can send a RP_IPC_TO_HOST_HOSTAPIVERSION to query the host
     about the RetroPlatform API version it implements;
     since the guest plugin already asks for a minimum version of the API
     on the host side, this message can be used to check the host API version
@@ -256,9 +279,9 @@ Response:
 
 
 Message:
-   RPIPCGM_HOSTVERSION
+   RP_IPC_TO_HOST_HOSTVERSION
 Description:
-    the guest can send a RPIPCGM_HOSTVERSION
+    the guest can send a RP_IPC_TO_HOST_HOSTVERSION
     to query the host about its version
 Data sent:
    none
@@ -268,13 +291,13 @@ Response:
 
 
 Message:
-   RPIPCGM_PAUSE
+   RP_IPC_TO_HOST_PAUSE
 Description:
    the guest sends this message to the host
    when it enters or exits pause mode;
    pause mode changes requested by the host
-   (see the RPIPCHM_PAUSE message) must not be notified,
-   unless the guest returned the value 2 as RPIPCHM_PAUSE response;
+   (see the RP_IPC_TO_GUEST_PAUSE message) must not be notified,
+   unless the guest returned the value 2 as RP_IPC_TO_GUEST_PAUSE response;
    note: when paused, the guest should release the mouse (if captured);
    during pause mode, the mouse should never be captured
 Data sent:
@@ -285,18 +308,22 @@ Response:
 
 
 Message:
-   RPIPCGM_DEVICECONTENT
+   RP_IPC_TO_HOST_DEVICECONTENT
 Description:
-   the guest sends a RPIPCGM_DEVICECONTENT message
+   the guest sends a RP_IPC_TO_HOST_DEVICECONTENT message
    to notify the host that an image file (e.g. a floppy disk image)
    or a peripheral (e.g. a joystick)
-   has been loaded into (or ejected from) an emulated device;
+   has been loaded/inserted into (or ejected from) an emulated device;
    this notification does not need to (must not) be sent when the event
-   has been requested by the host (see the RPIPCHM_DEVICECONTENT message).
+   has been requested by the host (see the RP_IPC_TO_GUEST_DEVICECONTENT message).
    If the host requested an unavailable device (e.g. tablet), the guest
-   should send an LRESULT 0 (error) in reply to the RPIPCHM_DEVICECONTENT
-   message, followed by an RPIPCGM_DEVICECONTENT message
+   should send an LRESULT 0 (error) in reply to the RP_IPC_TO_GUEST_DEVICECONTENT
+   message, followed by an RP_IPC_TO_HOST_DEVICECONTENT message
    indicating the actual content (empty, previous device, similar device, etc.)
+   Configuration details (e.g. keyboard-joystick layout) should be preserved, so
+   that the appropriate data can be sent to the host (e.g. Content set to
+   "KeyboardCustom Left=0x4B Right=0x4D Up=0x48 Down=0x50 Fire=0x52"), which in
+   turn may need to display it in the user interface.
 Data sent:
    pData = a RPDEVICECONTENT structure (see RetroPlatformIPC.h);
            the szContent field of the structure
@@ -312,13 +339,13 @@ Response:
 
 
 Message:
-   RPIPCGM_DEVICEREADWRITE
+   RP_IPC_TO_HOST_DEVICEREADWRITE
 Description:
-   the guest sends a RPIPCGM_DEVICEREADWRITE message
+   the guest sends a RP_IPC_TO_HOST_DEVICEREADWRITE message
    to notify the host about an initial status or a change in
    the read/write protection status;
    this notification is optional if the event
-   was requested by the host (see the RPIPCHM_DEVICEREADWRITE message);
+   was requested by the host (see the RP_IPC_TO_GUEST_DEVICEREADWRITE message);
    used for device categories RP_DEVICECATEGORY_FLOPPY, RP_DEVICECATEGORY_HD,
    RP_DEVICECATEGORY_TAPE, RP_DEVICECATEGORY_CARTRIDGE
 Data sent:
@@ -331,13 +358,13 @@ Response:
 
 
 Message:
-   RPIPCGM_TURBO
+   RP_IPC_TO_HOST_TURBO
 Description:
-   the guest sends a RPIPCGM_TURBO message
-   to notify the host about activation of "turbo" (maximum speed) mode
+   the guest sends a RP_IPC_TO_HOST_TURBO message
+   to notify the host about activation (e.g. from startup) of "turbo" (maximum speed) mode
    of some of its functionalities (e.g. floppy, CPU);
    turbo mode activations/deactivations requested by the host
-   (see the RPIPCHM_TURBO message) must not be notified;
+   (see the RP_IPC_TO_GUEST_TURBO message) must not be notified;
 Data sent:
    WPARAM = mask of functionalities affected (RP_TURBO_* flags)
    LPARAM = bits corresponding to those set in WPARAM
@@ -348,7 +375,7 @@ Response:
 
 
 Message:
-   RPIPCGM_PING
+   RP_IPC_TO_HOST_PING
 Description:
    this is a no-operation message and can be sent
    to check if the host is responsive and functional
@@ -359,12 +386,12 @@ Response:
 
 
 Message:
-   RPIPCGM_VOLUME
+   RP_IPC_TO_HOST_VOLUME
 Description:
-   the guest uses the RPIPCGM_VOLUME message
+   the guest uses the RP_IPC_TO_HOST_VOLUME message
    to notify the host about a change of its audio level;
    audio level changes requested by the host
-   (see the RPIPCHM_VOLUME message) must not be notified
+   (see the RP_IPC_TO_GUEST_VOLUME message) must not be notified
 Data sent:
    WPARAM = volume level (min/off 0, max 100)
 Response:
@@ -372,7 +399,7 @@ Response:
 
 
 Message:
-   RPIPCGM_ESCAPED
+   RP_IPC_TO_HOST_ESCAPED
 Description:
    this message is sent to notify the host
    that the escape key has been held down
@@ -383,7 +410,7 @@ Response:
 
 
 Message:
-   RPIPCGM_PARENT
+   RP_IPC_TO_HOST_PARENT
 Description:
    the guest sends this message to the host to get the handle
    of the parent for its window; the guest window must be created
@@ -396,7 +423,7 @@ Response:
 
 
 Message:
-   RPIPCGM_DEVICESEEK
+   RP_IPC_TO_HOST_DEVICESEEK
 Description:
    this message can be used to notify the host about a seek operation
    of a specified device (e.g. the head of a disk drive changes position;
@@ -411,7 +438,7 @@ Response:
 
 
 Message:
-   RPIPCGM_CLOSE
+   RP_IPC_TO_HOST_CLOSE
 Description:
    when the user presses ALT+F4 in the guest window
    the guest should intercept such an event
@@ -419,7 +446,7 @@ Description:
    send this notification message to the host
    and not close its window (i.e. not call the DefWindowProc() of its window);
    the host will then open its Close Options dialog
-   and will send a RPIPCHM_CLOSE command to the guest
+   and will send a RP_IPC_TO_GUEST_CLOSE command to the guest
    if the user confirms the close request
 Data sent:
    none
@@ -434,7 +461,7 @@ Response:
 ****************************************************************************
 
 Message:
-   RPIPCHM_CLOSE
+   RP_IPC_TO_GUEST_CLOSE
 Description:
    sent from the host when the emulation must be terminated
    (e.g. the user has hit the close button in the host window);
@@ -446,7 +473,7 @@ Response:
 
 
 Message:
-   RPIPCHM_SCREENMODE
+   RP_IPC_TO_GUEST_SCREENMODE
 Description:
    this message is sent to ask the guest to activate a specified screen mode
    and clipping coordinates;
@@ -469,25 +496,27 @@ Response:
    LRESULT = handle of the (new) guest window
              or NULL (the screen mode couldn't be changed)
              or INVALID_HANDLE_VALUE (the screen mode will be changed asynchronously
-             and the host will soon get a RPIPCGM_SCREENMODE notification)
+             and the host will soon get a RP_IPC_TO_HOST_SCREENMODE notification)
 
 
 Message:
-   RPIPCHM_SCREENCAPTURE
+   RP_IPC_TO_GUEST_SCREENCAPTURE
 Description:
-   with this message the host asks the guest to save its screen
-   to the specified file in BMP format
+   with this message the host asks the guest to save its screen bitmap(s)
+   (raw and/or filtered version) to the specified file(s), in BMP format.
 Data sent:
-   pData = (Unicode) full path and name of the file to save
-           (note: the file may exist and can be overwritten)
+   pData = a RPSCREENCAPTURE structure with one or two full path(s) and name(s)
+            (Unicode) of the file(s) to save. Note: existing files can be
+            overwritten.
 Response:
-   LRESULT = 1 if the guest successfully saved its screen to the file or 0 otherwise
+   LRESULT = RP_GUESTSCREENFLAGS_ if the guest successfully saved the
+             bitmap(s) to the file(s) or RP_SCREENCAPTURE_ERROR otherwise
 
 
 Message:
-   RPIPCHM_PAUSE
+   RP_IPC_TO_GUEST_PAUSE
 Description:
-   the RPIPCHM_PAUSE message sets the guest into pause mode
+   the RP_IPC_TO_GUEST_PAUSE message sets the guest into pause mode
    or resumes the guest from pause mode;
    note: when paused, the guest should release the mouse (if captured);
    during pause mode, the mouse should never be captured
@@ -497,14 +526,14 @@ Data sent:
 Response:
    LRESULT = 0 (error), 1 (command successfully executed)
              or 2 (the command will be asynchronously executed
-             and a RPIPCGM_PAUSE will be later sent from the guest
+             and a RP_IPC_TO_HOST_PAUSE will be later sent from the guest
              to confirm execution)
 
 
 Message:
-   RPIPCHM_DEVICECONTENT
+   RP_IPC_TO_GUEST_DEVICECONTENT
 Description:
-   the host sends a RPIPCHM_DEVICECONTENT message
+   the host sends a RP_IPC_TO_GUEST_DEVICECONTENT message
    to load an image file or a peripheral into an emulated device
    (e.g. an ADF floppy file into a floppy drive,
    or a physical or keyboard-emulated joystick into an input port)
@@ -521,9 +550,9 @@ Response:
 
 
 Message:
-   RPIPCHM_DEVICEREADWRITE
+   RP_IPC_TO_GUEST_DEVICEREADWRITE
 Description:
-   the host sends a RPIPCHM_DEVICEREADWRITE message
+   the host sends a RP_IPC_TO_GUEST_DEVICEREADWRITE message
    to set the read/write protection status
 Data sent:
    WPARAM = device category (RP_DEVICE_* value) and device number
@@ -535,7 +564,7 @@ Response:
 
 
 Message:
-   RPIPCHM_RESET
+   RP_IPC_TO_GUEST_RESET
 Description:
    the host sends this message to reset the guest
 Data sent:
@@ -545,7 +574,7 @@ Response:
 
 
 Message:
-   RPIPCHM_TURBO
+   RP_IPC_TO_GUEST_TURBO
 Description:
    the host sends this message to activate or deactivate
    the turbo mode of selected guest functionalities
@@ -559,7 +588,7 @@ Response:
 
 
 Message:
-   RPIPCHM_PING
+   RP_IPC_TO_GUEST_PING
 Description:
    this is a no-operation message and can be sent
    to check if the guest is responsive and functional
@@ -570,9 +599,9 @@ Response:
 
 
 Message:
-   RPIPCHM_VOLUME
+   RP_IPC_TO_GUEST_VOLUME
 Description:
-   the host uses the RPIPCHM_VOLUME message to set
+   the host uses the RP_IPC_TO_GUEST_VOLUME message to set
    the audio level of the guest
 Data sent:
    WPARAM = volume level (min 0, max 100)
@@ -581,9 +610,9 @@ Response:
 
 
 Message:
-   RPIPCHM_ESCAPEKEY
+   RP_IPC_TO_GUEST_ESCAPEKEY
 Description:
-   the host uses the RPIPCHM_ESCAPEKEY message
+   the host uses the RP_IPC_TO_GUEST_ESCAPEKEY message
    to change the escape key information
 Data sent:
    WPARAM = DirectInput DIK_* identifier of the escape key
@@ -595,21 +624,22 @@ Response:
 
 
 Message:
-   RPIPCHM_EVENT
+   RP_IPC_TO_GUEST_EVENT
 Description:
-   the host uses the RPIPCHM_EVENT message
-   to simulate keyboard, mouse, joystick (press/release)
+   the host uses the RP_IPC_TO_GUEST_EVENT message
+   to simulate keyboard, mouse, joystick, tape button press/release
    and other guest-specific events
 Data sent:
-   pData = (Unicode) event string (guest-specific)
+   pData = (Unicode) event string (guest-specific); for keyboard events ("KEY_"... string)
+   the event string is followed by a space and a "1"/"0" character (pressed/released).
 Response:
    LRESULT = 1 if the guest successfully simulated the specified event or 0 otherwise
 
 
 Message:
-   RPIPCHM_GUESTAPIVERSION
+   RP_IPC_TO_GUEST_GUESTAPIVERSION
 Description:
-    the host can send a RPIPCHM_GUESTAPIVERSION to query the guest
+    the host can send a RP_IPC_TO_GUEST_GUESTAPIVERSION to query the guest
     about the RetroPlatform API version it implements;
     this message can be used to check the guest API version
     and enable optional functionality
@@ -621,7 +651,7 @@ Response:
 
 
 Message:
-   RPIPCHM_MOUSECAPTURE
+   RP_IPC_TO_GUEST_MOUSECAPTURE
 Description:
    the host uses this message to ask the guest
    to capture or release the mouse (and activate/deactivate the magic mouse functionality)
@@ -632,7 +662,7 @@ Response:
 
 
 Message:
-   RPIPCHM_SAVESTATE
+   RP_IPC_TO_GUEST_SAVESTATE
 Description:
    with this message the host asks the guest to save
    the emulation status to the specified file
@@ -643,7 +673,7 @@ Response:
 
 
 Message:
-   RPIPCHM_LOADSTATE
+   RP_IPC_TO_GUEST_LOADSTATE
 Description:
    with this message the host asks the guest to load
    the emulation status from the specified file
@@ -654,9 +684,9 @@ Response:
 
 
 Message:
-   RPIPCHM_FLUSH
+   RP_IPC_TO_GUEST_FLUSH
 Description:
-   the host sends the RPIPCHM_FLUSH command to ask the guest
+   the host sends the RP_IPC_TO_GUEST_FLUSH command to ask the guest
    to flush any change applied to the emulated media
    and update the corresponding image files
 Data sent:
@@ -666,10 +696,10 @@ Response:
 
 
 Message:
-   RPIPCHM_QUERYSCREENMODE
+   RP_IPC_TO_GUEST_QUERYSCREENMODE
 Description:
    this message is used to ask the guest to send
-   a RPIPCGM_SCREENMODE notification as soon as possible
+   a RP_IPC_TO_HOST_SCREENMODE notification as soon as possible
    with updated screen mode and clipping information
 Data sent:
    none
index c9617842ed4eb1b471f4155a33803f83a2aa7ee3..4e2190ec6b3c51dde63ac787ba8e7f4168dacf2d 100644 (file)
@@ -1658,6 +1658,8 @@ static bool initialize_rawinput (void)
                                                        int buttoncnt = 0;
                                                        for (i = 0; i < size && buttoncnt < MAX_MAPPINGS; i++) {
                                                                int first, last;
+                                                               if (bcaps[i].UsagePage >= 0xff00)
+                                                                       continue;
                                                                if (bcaps[i].IsRange) {
                                                                        first = bcaps[i].Range.UsageMin;
                                                                        last = bcaps[i].Range.UsageMax;
@@ -1692,7 +1694,7 @@ static bool initialize_rawinput (void)
                                                        dumphidvaluecaps (vcaps, size);
                                                        int axiscnt = 0;
                                                        for (i = 0; i < size && axiscnt < MAX_MAPPINGS; i++) {
-                                                               int first, last;                                                
+                                                               int first, last;
                                                                if (vcaps[i].IsRange) {
                                                                        first = vcaps[i].Range.UsageMin;
                                                                        last = vcaps[i].Range.UsageMax;
@@ -1977,6 +1979,8 @@ static void handle_rawinput_2 (RAWINPUT *raw)
                                if (HidP_GetUsagesEx (HidP_Input, 0, did->usagelist, &usagelength, did->hidpreparseddata, rawdata, hid->dwSizeHid) == HIDP_STATUS_SUCCESS) {
                                        int k;
                                        for (k = 0; k < usagelength; k++) {
+                                               if (did->usagelist[k].UsagePage >= 0xff00)
+                                                       continue; // ignore vendor specific
                                                for (j = 0; j < did->maxusagelistlength; j++) {
                                                        if (did->usagelist[k].UsagePage == did->prevusagelist[j].UsagePage &&
                                                                did->usagelist[k].Usage == did->prevusagelist[j].Usage)
@@ -1995,6 +1999,8 @@ static void handle_rawinput_2 (RAWINPUT *raw)
                                                }
                                        }
                                        for (j = 0; j < did->maxusagelistlength; j++) {
+                                               if (did->prevusagelist[j].UsagePage >= 0xff00)
+                                                       continue; // ignore vendor specific
                                                if (did->prevusagelist[j].Usage) {
                                                        if (rawinput_log & 4)
                                                                write_log (_T("%d/%d OFF\n"), did->prevusagelist[j].UsagePage, did->prevusagelist[j].Usage);
index ffb90c5396e2158fb77647c3371c25f95e2f6ecf..fe8b7922443d1fdeec861bcc6776d64c2dd69870 100644 (file)
@@ -2271,7 +2271,7 @@ const TCHAR *D3D_init (HWND ahwnd, int w_w, int w_h, int depth, int mmult)
                                        if (d3dCaps.PresentationIntervals & D3DPRESENT_INTERVAL_TWO)
                                                dpp.PresentationInterval = D3DPRESENT_INTERVAL_TWO;
                                }  else {
-                                       vsync2 = -1;
+                                       vsync2 = -2;
                                }
                        } else if (hzmult > 0) {
                                vsync2 = 1;
@@ -3134,7 +3134,7 @@ void D3D_showframe (void)
                D3D_showframe2 (false);
        } else {
                D3D_showframe2 (true);
-               if (vsync2 < 0 && !currprefs.turbo_emulation) {
+               if (vsync2 == -1 && !currprefs.turbo_emulation) {
                        D3D_showframe2 (true);
                }
        }
index f2e36bf1f1bdefed505937e2f16822c4c47136e3..c516f8cfad11a867f1293fa8b2c6ca0335dbe537 100644 (file)
@@ -925,39 +925,59 @@ static void flip (void)
        if (dxdata.backbuffers == 2) {
                DirectDraw_Blit (dxdata.flipping[1], dxdata.flipping[0]);
                if (vsync) {
-                       if (currprefs.turbo_emulation || dxdata.vblank_skip == 0) {
-                               ddrval = IDirectDrawSurface7_Flip (dxdata.primary, NULL, flags);
-                       } else if (dxdata.vblank_skip > 0) {
-                               dxdata.vblank_skip_cnt ^= 1;
-                               if (dxdata.vblank_skip_cnt == 0)
-                                       return;
-                               ddrval = IDirectDrawSurface7_Flip (dxdata.primary, NULL, flags);
-                       } else if (flipinterval_supported && !novsync) {
-                               ddrval = IDirectDrawSurface7_Flip (dxdata.primary, NULL, flags | DDFLIP_INTERVAL2);
+                       if (ap->gfx_strobo) {
+                               if (currprefs.turbo_emulation) {
+                                       ddrval = IDirectDrawSurface7_Flip (dxdata.primary, NULL, flags);
+                               } else {
+                                       ddrval = IDirectDrawSurface7_Flip (dxdata.primary, NULL, flags);
+                                       DirectDraw_FillSurface (dxdata.flipping[0], NULL, 0);
+                                       ddrval = IDirectDrawSurface7_Flip (dxdata.primary, NULL, flags);
+                               }
                        } else {
-                               ddrval = IDirectDrawSurface7_Flip (dxdata.primary, NULL, flags);
-                               DirectDraw_Blit (dxdata.flipping[1], dxdata.primary);
-                               ddrval = IDirectDrawSurface7_Flip (dxdata.primary, NULL, flags);
+                               if (currprefs.turbo_emulation || dxdata.vblank_skip == 0) {
+                                       ddrval = IDirectDrawSurface7_Flip (dxdata.primary, NULL, flags);
+                               } else if (dxdata.vblank_skip > 0) {
+                                       dxdata.vblank_skip_cnt ^= 1;
+                                       if (dxdata.vblank_skip_cnt == 0)
+                                               return;
+                                       ddrval = IDirectDrawSurface7_Flip (dxdata.primary, NULL, flags);
+                               } else if (flipinterval_supported && !novsync) {
+                                       ddrval = IDirectDrawSurface7_Flip (dxdata.primary, NULL, flags | DDFLIP_INTERVAL2);
+                               } else {
+                                       ddrval = IDirectDrawSurface7_Flip (dxdata.primary, NULL, flags);
+                                       DirectDraw_Blit (dxdata.flipping[1], dxdata.primary);
+                                       ddrval = IDirectDrawSurface7_Flip (dxdata.primary, NULL, flags);
+                               }
                        }
                } else {
                        ddrval = IDirectDrawSurface7_Flip (dxdata.primary, NULL, flags);
                }
        } else if(dxdata.backbuffers == 1) {
                if (vsync) {
-                       if (currprefs.turbo_emulation || dxdata.vblank_skip == 0) {
-                               ddrval = IDirectDrawSurface7_Flip (dxdata.primary, NULL, flags);
-                       } else if (dxdata.vblank_skip > 0) {
-                               dxdata.vblank_skip_cnt ^= 1;
-                               if (dxdata.vblank_skip_cnt == 0)
-                                       return;
-                               ddrval = IDirectDrawSurface7_Flip (dxdata.primary, NULL, flags);
-                       } else if (flipinterval_supported && !novsync) {
-                               ddrval = IDirectDrawSurface7_Flip (dxdata.primary, NULL, flags | DDFLIP_INTERVAL2);
+                       if (ap->gfx_strobo) {
+                               if (currprefs.turbo_emulation) {
+                                       ddrval = IDirectDrawSurface7_Flip (dxdata.primary, NULL, flags);
+                               } else {
+                                       ddrval = IDirectDrawSurface7_Flip (dxdata.primary, NULL, flags);
+                                       DirectDraw_FillSurface (dxdata.flipping[0], NULL, 0);
+                                       ddrval = IDirectDrawSurface7_Flip (dxdata.primary, NULL, flags);
+                               }
                        } else {
-                               ddrval = IDirectDrawSurface7_Flip (dxdata.primary, NULL, flags);
-                               DirectDraw_Blit (dxdata.flipping[0], dxdata.primary);
-                               ddrval = IDirectDrawSurface7_Flip (dxdata.primary, NULL, flags);
-                               DirectDraw_Blit (dxdata.flipping[0], dxdata.primary);
+                               if (currprefs.turbo_emulation || dxdata.vblank_skip == 0) {
+                                       ddrval = IDirectDrawSurface7_Flip (dxdata.primary, NULL, flags);
+                               } else if (dxdata.vblank_skip > 0) {
+                                       dxdata.vblank_skip_cnt ^= 1;
+                                       if (dxdata.vblank_skip_cnt == 0)
+                                               return;
+                                       ddrval = IDirectDrawSurface7_Flip (dxdata.primary, NULL, flags);
+                               } else if (flipinterval_supported && !novsync) {
+                                       ddrval = IDirectDrawSurface7_Flip (dxdata.primary, NULL, flags | DDFLIP_INTERVAL2);
+                               } else {
+                                       ddrval = IDirectDrawSurface7_Flip (dxdata.primary, NULL, flags);
+                                       DirectDraw_Blit (dxdata.flipping[0], dxdata.primary);
+                                       ddrval = IDirectDrawSurface7_Flip (dxdata.primary, NULL, flags);
+                                       DirectDraw_Blit (dxdata.flipping[0], dxdata.primary);
+                               }
                        }
                } else {
                        ddrval = IDirectDrawSurface7_Flip (dxdata.primary, NULL, flags);
index acbd6d3237644879bfc5e4e86c8580c319e8cf6c..8300f10dcfb1f2fc98a4be2c5fef611023013002 100644 (file)
@@ -1021,15 +1021,32 @@ static LRESULT CALLBACK RPHostMsgFunction2 (UINT uMessage, WPARAM wParam, LPARAM
                }
        case RP_IPC_TO_GUEST_SCREENCAPTURE:
                {
-                       extern int screenshotf (const TCHAR *spath, int mode, int doprepare);
+                       extern int screenshotf (const TCHAR *spath, int mode, int doprepare, int imagemode);
                        extern int screenshotmode;
-                       int ok;
-                       int ossm = screenshotmode;
-                       TCHAR *s = (TCHAR*)pData;
-                       screenshotmode = 0;
-                       ok = screenshotf (s, 1, 1);
-                       screenshotmode = ossm;
-                       return ok ? TRUE : FALSE;
+                       struct RPScreenCapture *rpsc = (struct RPScreenCapture*)pData;
+                       if (rpsc->szScreenFiltered[0] || rpsc->szScreenRaw[0]) {
+                               int ossm = screenshotmode;
+                               DWORD ret = 0;
+                               int ok = 0;
+                               screenshotmode = 0;
+                               write_log (_T("'%s' '%s'\n"), rpsc->szScreenFiltered, rpsc->szScreenRaw);
+                               if (rpsc->szScreenFiltered[0])
+                                       ok = screenshotf (rpsc->szScreenFiltered, 1, 1, 0);
+                               if (rpsc->szScreenRaw[0])
+                                       ok |= screenshotf (rpsc->szScreenRaw, 1, 1, 1);
+                               screenshotmode = ossm;
+                               if (!ok)
+                                       return RP_SCREENCAPTURE_ERROR;
+                               if (WIN32GFX_IsPicassoScreen ()) {
+                                       ret |= RP_GUESTSCREENFLAGS_MODE_DIGITAL;
+                               } else {
+                                       ret |= currprefs.gfx_resolution == RES_LORES ? RP_GUESTSCREENFLAGS_HORIZONTAL_LORES : ((currprefs.gfx_resolution == RES_SUPERHIRES) ? RP_GUESTSCREENFLAGS_HORIZONTAL_SUPERHIRES : 0);
+                                       ret |= currprefs.ntscmode ? RP_GUESTSCREENFLAGS_MODE_NTSC : RP_GUESTSCREENFLAGS_MODE_PAL;
+                                       ret |= interlace_seen ? RP_GUESTSCREENFLAGS_VERTICAL_INTERLACED : 0;
+                               }
+                               return ret;
+                       }
+                       return RP_SCREENCAPTURE_ERROR;
                }
        case RP_IPC_TO_GUEST_SAVESTATE:
                {
@@ -1082,7 +1099,7 @@ static LRESULT CALLBACK RPHostMsgFunction2 (UINT uMessage, WPARAM wParam, LPARAM
                }
        case RP_IPC_TO_GUEST_GUESTAPIVERSION:
                {
-                       return MAKELONG(3, 0);
+                       return MAKELONG(3, 4);
                }
        }
        return FALSE;
index 94378c4c04ff9510f8699b904dc628d1b92808d6..c7180282cf061212ace1fa602f79944b3aaa5d0e 100644 (file)
@@ -92,7 +92,7 @@ void screenshot_free (void)
 
 static int rgb_rb, rgb_gb, rgb_bb, rgb_rs, rgb_gs, rgb_bs;
 
-int screenshot_prepare (void)
+int screenshot_prepare (int imagemode)
 {
        int width, height;
        HGDIOBJ hgdiobj;
@@ -101,8 +101,10 @@ int screenshot_prepare (void)
        screenshot_free ();
 
        regqueryint (NULL, _T("Screenshot_Original"), &screenshot_originalsize);
+       if (imagemode < 0)
+               imagemode = screenshot_originalsize;
 
-       if (screenshot_originalsize) {
+       if (imagemode) {
                int spitch, dpitch, x, y;
                uae_u8 *src, *dst, *mem;
                uae_u8 *palette = NULL;
@@ -258,6 +260,11 @@ oops:
        return 0;
 }
 
+int screenshot_prepare (void)
+{
+       return screenshot_prepare (-1);
+}
+
 void Screenshot_RGBinfo (int rb, int gb, int bb, int rs, int gs, int bs)
 {
        if (!bi)
@@ -358,7 +365,7 @@ static int savebmp (FILE *fp)
 /*
 Captures the Amiga display (DirectDraw, D3D or OpenGL) surface and saves it to file as a 24bit bitmap.
 */
-int screenshotf (const TCHAR *spath, int mode, int doprepare)
+int screenshotf (const TCHAR *spath, int mode, int doprepare, int imagemode)
 {
        static int recursive;
        FILE *fp = NULL;
@@ -372,8 +379,8 @@ int screenshotf (const TCHAR *spath, int mode, int doprepare)
 
        recursive++;
 
-       if (!screenshot_prepared || doprepare) {
-               if (!screenshot_prepare ())
+       if (!screenshot_prepared || doprepare) {        
+               if (!screenshot_prepare (imagemode))
                        goto oops;
        }
 
@@ -452,5 +459,5 @@ oops:
 
 void screenshot (int mode, int doprepare)
 {
-       screenshotf (NULL, mode, doprepare);
+       screenshotf (NULL, mode, doprepare, -1);
 }
index 3c80a75888e20637c342a302304323e0ee62c8ba..b20fba39e024b32ec0a00189e1df0f30acfedfdf 100644 (file)
 #define LANG_DLL 1
 
 #if WINUAEPUBLICBETA
-#define WINUAEBETA _T("12")
+#define WINUAEBETA _T("13")
 #else
 #define WINUAEBETA _T("")
 #endif
-#define WINUAEDATE MAKEBD(2013, 3, 17)
+#define WINUAEDATE MAKEBD(2013, 3, 23)
 #define WINUAEEXTRA _T("")
 //#define WINUAEEXTRA _T("AmiKit Preview")
 #define WINUAEREV _T("")
@@ -147,6 +147,7 @@ HMODULE WIN32_LoadLibrary2 (const TCHAR *);
 int isdllversion (const TCHAR *name, int version, int revision, int subver, int subrev);
 
 extern int screenshot_prepare (void);
+extern int screenshot_prepare (int);
 extern void screenshot_free (void);
 
 struct winuae_lang
index d1959046ec6bf1baabb167358f258b800ce1ac37..bdf993b12eb6d40b6e8476d721148de98df18b60 100644 (file)
@@ -1066,12 +1066,20 @@ void show_screen_special (void)
 void show_screen (int mode)
 {
        EnterCriticalSection (&screen_cs);
+       if (mode == 2) {
+               if (currentmode->flags & DM_D3D) {
+                       D3D_showframe_special (1);
+               }
+               LeaveCriticalSection (&screen_cs);
+               return;
+       }
        if (!render_ok) {
                LeaveCriticalSection (&screen_cs);
                return;
        }
        if (currentmode->flags & DM_D3D) {
                D3D_showframe ();
+
 #ifdef GFXFILTER
        } else if (currentmode->flags & DM_SWSCALE) {
                if (!dx_islost () && !picasso_on)
index e13ce16c2059e141c9b4e41180c0af540619a727..d7b3bee7efd5f8f7c70688f5079cf7117c0953d9 100644 (file)
@@ -15534,8 +15534,8 @@ int dragdrop (HWND hDlg, HDROP hd, struct uae_prefs *prefs, int currentpage)
                                        add_filesys_config (&workprefs, -1, &current_fsvdlg.ci);
                                }
                        } else {
-                               uci_set_defaults (&current_hfdlg.ci, false);
-                               current_hfdlg.forcedcylinders = 0;
+                               default_hfdlg (&current_hfdlg, false);
+                               _tcscpy (current_hfdlg.ci.rootdir, file);
                                updatehdfinfo (NULL, true, true);
                                add_filesys_config (&workprefs, -1, &current_hfdlg.ci);
                        }
index 95e08759e05ec30c052fb65f01a1c1f587a3eb93..a573e0278093ef2ca7956ab8962162c5a2f6f16d 100644 (file)
@@ -1,6 +1,17 @@
 
 - restore only single input target to default.
 
+Beta 13:
+
+- Ignore vendor specific USB usage pages also in received USB HID packets, fixes for example Logitech Precision gamepad ghost button events.
+- Fixed border sprite bug introduced in b12, border sprites should stay hidden if border blanking is also enabled.
+- Black frame insertion is now supported in legacy vsync D3D 100Hz+ modes. DirectDraw modes may also work.
+- 68020+ cycle-exact CPU speed changed after entering and exiting GUI in some situations.
+- Partition hardfile dragndrop didn't work.
+- Automatically loaded ROM path FastFileSystem file always replaced FileSystem.resource FFS when mounting FFS partition hardfiles (b1).
+- Blitter DMA disabled, writing to BLTSIZE, writing to other blitter register(s) and finally enabling blitter DMA appears
+  to start the blitter normally. (Pink Panther graphics corruption, probably worked accidentally in some old versions)
+
 Beta 12:
 
 - AGA border sprite feature emulation is now also cycle-exact. Similar update to borderblank was done in 2.5.0. For example