]> git.unchartedbackwaters.co.uk Git - francis/winuae.git/commitdiff
imported winuaesrc1400b9.zip
authorToni Wilen <twilen@winuae.net>
Tue, 27 Feb 2007 17:28:04 +0000 (19:28 +0200)
committerToni Wilen <twilen@winuae.net>
Mon, 22 Feb 2010 19:31:55 +0000 (21:31 +0200)
cdtv.c
cfgfile.c
debug.c
filesys.c
inputdevice.c
od-win32/blkdev_win32_ioctl.c
od-win32/mman.c
od-win32/win32.c
od-win32/win32.h
od-win32/win32gui.c
od-win32/winuaechangelog.txt

diff --git a/cdtv.c b/cdtv.c
index d1e1a97655b90f83524e5c3c04dfff097f7096a2..21ee3dffb4cc8925b8e69cbc1879b4079bfda891 100755 (executable)
--- a/cdtv.c
+++ b/cdtv.c
@@ -544,10 +544,9 @@ static void *dev_thread (void *p)
     for (;;) {
 
        uae_u32 b = read_comm_pipe_u32_blocking (&requests);
-       if (unitnum < 0) {
-           thread_alive = -1;
-           return NULL;
-       }
+       if (unitnum < 0)
+           continue;
+
        switch (b)
        {
            case 0x100:
@@ -572,6 +571,9 @@ static void *dev_thread (void *p)
            case 0x103: // unpause
            sys_command_cd_pause (DF_IOCTL, unitnum, 0);
            break;
+           case 0x104: // stop
+           cdaudiostop();
+           break;
            case 0x110: // do_play!
            do_play();
            break;
@@ -1059,10 +1061,8 @@ static void open_unit(void)
     int first = -1;
     int cdtvunit = -1, audiounit = -1;
 
-    if (unitnum >= 0) {
-       cdaudiostop();
+    if (unitnum >= 0)
        sys_command_close (DF_IOCTL, unitnum);
-    }
     unitnum = -1;
     cdtv_reset();
     if (!device_func_init(DEVICE_TYPE_ANY)) {
@@ -1230,6 +1230,7 @@ uae_u8 cdtv_battram_read (int addr)
 void cdtv_free (void)
 {
     if (thread_alive > 0) {
+        write_comm_pipe_u32 (&requests, 0x0104, 1);
        write_comm_pipe_u32 (&requests, 0xffff, 1);
        while (thread_alive > 0)
            sleep_millis(10);
@@ -1251,6 +1252,8 @@ void cdtv_init (void)
        while (!thread_alive)
            sleep_millis(10);
     }
+    write_comm_pipe_u32 (&requests, 0x0104, 1);
+   
 
     configured = 0;
     tp_a = tp_b = tp_c = tp_ad = tp_bd = tp_cd = 0;
index 28641b43af7e40d9422d87850aa10af09d78d2c3..af6e86988b72b5b9d49f570317496a6adf72af4d 100755 (executable)
--- a/cfgfile.c
+++ b/cfgfile.c
@@ -2825,7 +2825,7 @@ static int bip_cdtv (struct uae_prefs *p, int config, int compa, int romcheck)
     if (!configure_rom (p, roms, romcheck))
        return 0;
     p->bogomem_size = 0;
-    p->chipmem_size = 0x200000;
+    p->chipmem_size = 0x100000;
     p->chipset_mask = CSMASK_ECS_AGNUS | CSMASK_ECS_DENISE;
     p->cs_cdtvcd = p->cs_cdtvram = 1;
     if (config > 0)
diff --git a/debug.c b/debug.c
index 68c489244edecb34168eca4dbfa2ca240445a763..1837fa022163220d106ef1796e8fe78e83b04452 100755 (executable)
--- a/debug.c
+++ b/debug.c
@@ -47,6 +47,7 @@ int debug_sprite_mask = 0xff;
 static uaecptr debug_copper_pc;
 
 extern int audio_channel_mask;
+extern int inputdevice_logging;
 
 static FILE *logfile;
 
@@ -113,6 +114,7 @@ static char help[] = {
     "  sm <sprite mask>      Enable or disable sprites\n"
     "  di <mode> [<track>]   Break on disk access. R=DMA read,W=write,RW=both,P=PIO\n"
     "                        Also enables extended disk logging\n"
+    "  dj [<level bitmask>]  Enable joystick/mouse input debugging\n"
     "  dm                    Dump current address space map\n"
     "  q                     Quit the emulator. You don't want to use this command.\n\n"
 };
@@ -1909,7 +1911,13 @@ static void debug_1 (void)
            if (*inptr == 'i') {
                next_char(&inptr);
                disk_debug(&inptr);
-           }  else if(*inptr == 'm') {
+           } else if(*inptr == 'j') {
+               inptr++;
+               inputdevice_logging = 1 | 2;
+               if (more_params(&inptr))
+                   inputdevice_logging = readint(&inptr);
+               console_out("input logging level %d\n", inputdevice_logging);
+           } else if(*inptr == 'm') {
                memory_map_dump_2(0);
            } else {
                uae_u32 daddr;
index 880e6d6f646205c526d5d785e9a61c8006ee2092..6ccf9697e418eddda262eb9e89b2f49fb2c5dd0c 100755 (executable)
--- a/filesys.c
+++ b/filesys.c
@@ -1739,6 +1739,10 @@ static void free_lock (Unit *unit, uaecptr lock)
                break;
            current = next;
        }
+       if (!current) {
+           write_log("tried to unlock non-existing lock %x\n", lock);
+           return;
+       }
        put_long (current << 2, get_long (lock));
     }
     lock -= 4;
@@ -1847,14 +1851,13 @@ action_dup_lock (Unit *unit, dpacket packet)
 static void
 action_lock_from_fh (Unit *unit, dpacket packet)
 {
-    uaecptr out;
     Key *k = lookup_key (unit, GET_PCK_ARG1 (packet));
     TRACE(("ACTION_COPY_DIR_FH(0x%lx)\n", GET_PCK_ARG1 (packet)));
     if (k == 0) {
        PUT_PCK_RES1 (packet, DOS_FALSE);
        return;
     }
-    out = action_dup_lock_2 (unit, packet, k->aino->uniq);
+    action_dup_lock_2 (unit, packet, k->aino->uniq);
 }
 
 /* convert time_t to/from AmigaDOS time */
@@ -2361,9 +2364,8 @@ action_fh_from_lock (Unit *unit, dpacket packet)
     /* I don't think I need to play with shlock count here, because I'm
        opening from an existing lock ??? */
 
-    /* Is this right?  I don't completely understand how this works.  Do I
-       also need to free_lock() my lock, since nobody else is going to? */
     de_recycle_aino (unit, aino);
+    free_lock (unit, lock); /* lock must be unlocked */
     PUT_PCK_RES1 (packet, DOS_TRUE);
     /* PUT_PCK_RES2 (packet, k->uniq); - this shouldn't be necessary, try without it */
 }
index 668589a8c65de5229ba65639f070d674b2a3a045..325916ac81723237d4697c4b794e6d7cc5ce72d9 100755 (executable)
@@ -46,7 +46,6 @@
 #include "autoconf.h"
 
 int inputdevice_logging = 0;
-static int potgo_logging = 0;
 
 #define DIR_LEFT 1
 #define DIR_RIGHT 2
@@ -1056,7 +1055,7 @@ int getjoystate (int joy)
     int left = 0, right = 0, top = 0, bot = 0;
     uae_u16 v = 0;
 
-    if (inputdevice_logging > 2)
+    if (inputdevice_logging & 2)
        write_log("JOY%dDAT %x\n", joy, m68k_getpc(&regs));
     readinput ();
     if (joydir[joy] & DIR_LEFT)
@@ -1119,7 +1118,8 @@ void JOYTEST (uae_u16 v)
     mouse_frame_y[0] = mouse_y[0];
     mouse_frame_x[1] = mouse_x[1];
     mouse_frame_y[1] = mouse_y[1];
-//    write_log ("%d:%04.4X %p\n",vpos,v,m68k_getpc());
+    if (inputdevice_logging & 2)
+       write_log ("JOYTEST: %04.4X PC=%x\n", v , M68K_GETPC);
 }
 
 static uae_u8 parconvert (uae_u8 v, int jd, int shift)
@@ -1180,7 +1180,8 @@ uae_u8 handle_joystick_buttons (uae_u8 dra)
            but |= 0x40 << i;
        }
     }
-    //write_log("%02.2X:%02.2X %x\n", dra, but, M68K_GETPC);
+    if (inputdevice_logging & 4)
+       write_log("BFE001: %02.2X:%02.2X %x\n", dra, but, M68K_GETPC);
     return but;
 }
 
@@ -1330,8 +1331,8 @@ void POTGO (uae_u16 v)
 {
     int i;
 
-    if (potgo_logging)
-       write_log ("W:%d: %04.4X %p\n", vpos, v, M68K_GETPC);
+    if (inputdevice_logging & 16)
+       write_log ("POTGO_W: %04.4X %p\n", v, M68K_GETPC);
 #ifdef DONGLE_DEBUG
     if (notinrom ())
        write_log ("POTGO %04.4X %s\n", v, debuginfo(0));
@@ -1367,8 +1368,8 @@ uae_u16 POTGOR (void)
     if (notinrom ())
        write_log ("POTGOR %04.4X %s\n", v, debuginfo(0));
 #endif
-    if (potgo_logging)
-       write_log("R:%d:%04.4X %d %p\n", vpos, v, cd32_shifter[1], M68K_GETPC);
+    if (inputdevice_logging & 16)
+       write_log("POTGO_R: %04.4X %d %p\n", v, cd32_shifter[1], M68K_GETPC);
     return v;
 }
 
@@ -1447,7 +1448,7 @@ void inputdevice_do_keyboard (int code, int state)
            uae_reset (r);
        }
        record_key ((uae_u8)((key << 1) | (key >> 7)));
-       if (inputdevice_logging > 0)
+       if (inputdevice_logging & 1)
            write_log("Amiga key %02.2X %d\n", key & 0x7f, key >> 7);
        return;
     }
@@ -1625,7 +1626,7 @@ int handle_input_event (int nr, int state, int max, int autofire)
     if (nr <= 0)
        return 0;
     ie = &events[nr];
-    if (inputdevice_logging > 0)
+    if (inputdevice_logging & 1)
        write_log("'%s' %d %d\n", ie->name, state, max);
     if (autofire) {
        if (state)
index 05bbe8431f69389e7d260b68dfa11be28129f7c7..91434b67c7232eeb0cddfb9ae687d577a69d6906 100755 (executable)
@@ -33,7 +33,6 @@ struct dev_info_ioctl {
     int type;
     int blocksize;
     int mciid;
-    int mcimode;
     CDROM_TOC toc;
     UINT errormode;
     int playend;
index 4612032c3b4a465bf646d931557328b24fe21d29..fc652d102d78452da4c0c17485a0ef325c21f4cc 100755 (executable)
@@ -149,6 +149,24 @@ void init_shm(void)
 void mapped_free(uae_u8 *mem)
 {
     shmpiece *x = shm_start;
+
+    if (!p96mode && mem == p96fakeram) {
+       xfree (p96fakeram);
+       p96fakeram = NULL;
+       while(x) {
+           struct shmid_ds blah;
+           if (mem == x->native_address) {
+               int shmid = x->id;
+               shmids[shmid].key = -1;
+               shmids[shmid].name[0] = '\0';
+               shmids[shmid].size = 0;
+               shmids[shmid].attached = 0;
+           }
+           x = x->next;
+       }
+       return;
+    }
+
     while(x) {
        if(mem == x->native_address)
            shmdt(x->native_address);
@@ -250,6 +268,7 @@ void *shmat(int shmid, void *shmaddr, int shmflg)
                shmaddr = natmem_offset + p96ram_start;
            } else {
                p96ram_start = currprefs.z3fastmem_start + ((currprefs.z3fastmem_size + 0xffffff) & ~0xffffff);
+               shmaddr = natmem_offset + p96ram_start;
                VirtualFree(shmaddr, os_winnt ? size : 0, os_winnt ? MEM_DECOMMIT : MEM_RELEASE);
                xfree(p96fakeram);
                result = p96fakeram = xcalloc (size + 4096, 1);
index 74a18186637d1d93d8a62bbb46efb4b4695f7fa7..6080f13b2c0adce1b88caf7a57e43409f6683d6c 100755 (executable)
@@ -7,8 +7,7 @@
  * Copyright 1997-1999 Brian King
  */
 
-/* Uncomment this line if you want the logs time-stamped */
-/* #define TIMESTAMP_LOGS */
+//#define MEMDEBUG
 
 #include "sysconfig.h"
 
@@ -2717,8 +2716,10 @@ static int PASCAL WinMain2 (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR
        //tmp &= 0xffff;
        tmp |= _CRTDBG_CHECK_ALWAYS_DF;
        tmp |= _CRTDBG_CHECK_CRT_DF;
-       //tmp |=_CRTDBG_CHECK_EVERY_16_DF;
-       //tmp |= _CRTDBG_DELAY_FREE_MEM_DF;
+#ifdef MEMDEBUG
+       tmp |=_CRTDBG_CHECK_EVERY_16_DF;
+       tmp |= _CRTDBG_DELAY_FREE_MEM_DF;
+#endif
        _CrtSetDbgFlag(tmp);
     }
 #endif
index 55ec845a8e518c128ed5c6bde61045f0063dc657..5a9bd5ed642f4dac8aa4b043463582f85a8bcac7 100755 (executable)
@@ -15,9 +15,9 @@
 #define GETBDM(x) (((x) - ((x / 10000) * 10000)) / 100)
 #define GETBDD(x) ((x) % 100)
 
-#define WINUAEBETA 8
+#define WINUAEBETA 9
 #define WINUAEPUBLICBETA 1
-#define WINUAEDATE MAKEBD(2007, 2, 24)
+#define WINUAEDATE MAKEBD(2007, 2, 27)
 
 #define IHF_WINDOWHIDDEN 6
 #define NORMAL_WINDOW_STYLE (WS_VISIBLE | WS_BORDER | WS_CAPTION | WS_MINIMIZEBOX | WS_SYSMENU)
index 3469c70f3084c647a76d29dbe82298eb622037e0..b9a92c05de07b3506843f19533cb6eb83d490449 100755 (executable)
@@ -5684,11 +5684,12 @@ static void values_from_sounddlg (HWND hDlg)
     workprefs.sound_stereo_swap_ahi = (SendDlgItemMessage (hDlg, IDC_SOUNDSWAP, CB_GETCURSEL, 0, 0) & 2) ? 1 : 0;
 
     idx = SendDlgItemMessage (hDlg, IDC_SOUNDDRIVE, CB_GETCURSEL, 0, 0);
-    if (idx >= 0) {
+    if (idx != CB_ERR && idx >= 0) {
        LRESULT res = SendDlgItemMessage (hDlg, IDC_SOUNDDRIVESELECT, CB_GETCURSEL, 0, 0);
-       if (res >= 0) {
-           if (res > DS_BUILD_IN_SOUNDS + 2) {
-               int j = res - (DS_BUILD_IN_SOUNDS + 2 + 1);
+       if (res != CB_ERR && res >= 0) {
+           int xtra = driveclick_pcdrivemask ? 2 : 0;
+           if (res > DS_BUILD_IN_SOUNDS + xtra) {
+               int j = res - (DS_BUILD_IN_SOUNDS + xtra + 1);
                char *p = drivesounds;
                while (j-- > 0)
                    p += strlen (p) + 1;
index 419e9a21d557adc28f25256f8d45314f055f64eb..c7c79b9355025910301ad3d0d7345333506a80fb 100755 (executable)
@@ -1,4 +1,22 @@
 
+Beta 9: (RC 2)
+
+- non-ASPI CDTV CD audio didn't always stop when exiting/reseting
+- added dj [<mask>] command to debugger. Enable joystick/mouse
+  input logging  
+- CDTV quickstart chip ram size set to correct 1M (correct config
+  is more important than workaround for one game)
+- Fixed another filesystem lock leak in ACTION_FH_FROM_LOCK
+  (dos.library/OpenFromLock())
+- do not allow unlocking of non-existing locks in filesystem.
+  Previously it caused random memory corruption and also triggered
+  following (previously unknown) 1.0b2 issue:
+  "added workaround for AMOS filesystem emulation incompatibility
+  (infinite loop in filesystem code) Reason for freeze unknown,
+  proper fix unknown.. (filesystem emulation is confusing..)"
+- external drive sound selection GUI didn't work if fdrawcmd.sys
+  was not installed
+
 Beta 8: (RC 1)
 
 - uaehf.device unit >=30 crash fixed