]> git.unchartedbackwaters.co.uk Git - francis/winuae.git/commitdiff
imported winuaesrc1440b9.zip
authorToni Wilen <twilen@winuae.net>
Tue, 18 Sep 2007 16:42:20 +0000 (19:42 +0300)
committerToni Wilen <twilen@winuae.net>
Mon, 22 Feb 2010 19:35:56 +0000 (21:35 +0200)
13 files changed:
akiko.c
ar.c
filesys.asm
filesys.c
include/xwin.h
main.c
od-win32/bsdsock.c
od-win32/dxwrap.c
od-win32/fsdb_win32.c
od-win32/win32.h
od-win32/win32_scale2x.c
od-win32/win32gfx.c
od-win32/winuaechangelog.txt

diff --git a/akiko.c b/akiko.c
index 77e88da9881cf86f6b4772b23f454a4aaf22d1a7..4798faeaac621794e5e338a72f32dc1d69e9a4bc 100755 (executable)
--- a/akiko.c
+++ b/akiko.c
@@ -1067,11 +1067,11 @@ void AKIKO_hsync_handler (void)
                uae_u8 as = s[1];
                if (as == AUDIO_STATUS_IN_PROGRESS) {
                    int lsn = msf2lsn ((s[5 + 4] << 16) | (s[6 + 4] << 8) | (s[7 + 4] << 0));
-                   write_log("%d %d (%d %d)\n", lsn, msf2lsn (last_play_end) - lsn, cdrom_leadout, msf2lsn (last_play_end));
+                   //write_log("%d %d (%d %d)\n", lsn, msf2lsn (last_play_end) - lsn, cdrom_leadout, msf2lsn (last_play_end));
                    // make sure audio play really ends because not all drives report position accurately
                    if ((lsn >= cdrom_leadout - 3 * 75 || lsn >= msf2lsn(last_play_end) - 3 * 75) && !cdrom_audiotimeout) {
                        cdrom_audiotimeout = 3 * 312;
-                       write_log("audiotimeout starts\n");
+                       //write_log("audiotimeout starts\n");
                    }
                }
            }
diff --git a/ar.c b/ar.c
index d1faad7959ed4168af659f389eec8ffc4658a263..63b53df1d5b9f32e7caa128bdf97703c27a86a1b 100755 (executable)
--- a/ar.c
+++ b/ar.c
@@ -1104,10 +1104,12 @@ void action_replay_reset(void)
        if (armodel == 1) {
            /* We need to mark it as active here, because the kickstart rom jumps directly into it. */
            action_replay_flag = ACTION_REPLAY_ACTIVE;
+           hide_cart (0);
        } else {
            write_log_debug ("Setting flag to ACTION_REPLAY_WAITRESET\n");
            write_log_debug ("armode == %d\n", armode);
            action_replay_flag = ACTION_REPLAY_WAITRESET;
+           hide_cart (0);
        }
     }
 }
@@ -1670,7 +1672,6 @@ int action_replay_load (void)
     arrom_mask = arrom_size - 1;
     armemory_ram = (uae_u8*)xcalloc (arram_size, 1);
     write_log ("Action Replay %d installed at %08.8X, size %08.8X\n", armodel, arrom_start, arrom_size);
-    action_replay_setbanks ();
     action_replay_version();
     return armodel;
 }
@@ -1942,11 +1943,6 @@ void action_replay_version(void)
 /* This function doesn't reset the Cart memory, it is just called during a memory reset */
 void action_replay_memory_reset(void)
 {
-    #ifdef ACTION_REPLAY
-    if (armemory_rom) {
-       action_replay_hide ();
-    }
-    #endif
     #ifdef ACTION_REPLAY_HRTMON
     if (hrtmemory) {
        hrtmon_hide (); /* It is never really idle */
@@ -1960,7 +1956,10 @@ void action_replay_memory_reset(void)
     #endif
     action_replay_patch ();
     action_replay_checksum_info ();
+    action_replay_setbanks ();
     hrtmon_configure ();
+    if (armodel == 1)
+       action_replay_flag = ACTION_REPLAY_ACTIVE;
 }
 
 uae_u8 *save_hrtmon (int *len, uae_u8 *dstptr)
index 848ca47730944b60eeff58c7f3afe87b62fb7fff..3021fe2c5818f2436ada5fe470b83e62572bec97 100755 (executable)
@@ -69,22 +69,25 @@ filesys_init:
        move.l (a0),a5
        lea.l explibname(pc),a1 ; expansion lib name
        moveq #36,d0
-       moveq #0,d5
+       moveq #1,d5
        jsr  -552(a6) ; OpenLibrary
        tst.l d0
        bne.b FSIN_explibok
        lea.l explibname(pc),a1 ; expansion lib name
        moveq #0,d0
-       moveq #1,d5
+       moveq #0,d5
        jsr  -552(a6) ; OpenLibrary
 FSIN_explibok:
        move.l d0,a4
+
+       tst.l $10c(a5)
+       beq.s FSIN_none
+
        move.l #PP_TOTAL,d0
        move.l #$10001,d1
        jsr AllocMem(a6)
        move.l d0,a3  ; param packet
        move.l a4,PP_EXPLIB(a3)
-
        moveq #0,d6
 FSIN_init_units:
        cmp.l $10c(a5),d6
@@ -92,7 +95,10 @@ FSIN_init_units:
        move.l d6,-(sp)
 FSIN_nextsub:
        moveq #1,d7
-       move.l a3,-(sp)
+       tst.w d5
+       beq.s .oldks
+       bset #2,d7
+.oldks move.l a3,-(sp)
        move.l a3,a0
        bsr.w make_dev
        move.l (sp)+,a3
@@ -106,8 +112,13 @@ FSIN_nomoresub:
        move.l (sp)+,d6
        addq.w #1,d6
        bra.b  FSIN_init_units
-
 FSIN_units_ok:
+       move.l 4.w,a6
+       move.l a3,a1
+       move.l #PP_TOTAL,d0
+       jsr FreeMem(a6)
+
+FSIN_none:
        move.l 4.w,a6
        move.l a4,a1
        jsr -414(a6) ; CloseLibrary
@@ -502,28 +513,31 @@ addvolumenode
        jsr -$2A6(a6) ;AddDosEntry (Volume)
 .nvol  btst #1,d7
        beq.s .ndev
+       tst.b 158(a3)
+       bne.s .ndev
+       st 158(a3)
        move.l 180(a3),d1
-       jsr -$2a6(a6) ;AddDosEntry (Device)
+       jsr -$2A6(a6) ;AddDosEntry (Device)
 .ndev  moveq #(1<<1)+(1<<3)+(1<<2),d1 ;LDF_WRITE | LDF_VOLUMES | LDF_DEVICES
        jsr -$294(a6) ;UnLockDosList
        bra.s .end
 .prev37        move.l 4.w,a6
        jsr -$0084(a6) ; Forbid
-       move.l 160(a3),a0
-       move.l 34(a0),a0 ; rootnode
-       add.l a0,a0
-       add.l a0,a0
-       move.l 24(a0),a0 ; dosinfo
-       add.l a0,a0
-       add.l a0,a0
-       lea 32(a3),a1
-       move.l 4(a0),(a1)
-       move.l a1,d0
-       lsr.l #2,d0
-       move.l d0,4(a0)
-       jsr -$008a(a6) ;Permit
+       btst #0,d7
+       beq.s .nvol13
+       lea 32(a3),a0
+       bsr.w adddosentry13
+.nvol13        btst #1,d7
+       beq.s .ndev13
+       tst.b 158(a3)
+       bne.s .ndev13
+       st 158(a3)
+       move.l 180(a3),a0
+       bsr.w adddosentry13
+.ndev13        jsr -$008a(a6) ;Permit
 .end   movem.l (sp)+,d7/a6
        rts     
+
 remvolumenode
        movem.l d7/a2/a6,-(sp)
        move.l d0,d7
@@ -541,6 +555,9 @@ remvolumenode
        jsr -$2A0(a6) ;RemDosEntry (Volume)
 .nvol  btst #1,d7
        beq.s .ndev
+       tst.b 158(a3)
+       beq.s .ndev
+       clr.b 158(a3)
        move.l 180(a3),d1
        jsr -$2A0(a6) ;RemDosEntry (Device)
 .ndev  moveq #(1<<1)+(1<<3)+(1<<2),d1 ;LDF_WRITE | LDF_VOLUMES | LDF_DEVICES
@@ -548,30 +565,62 @@ remvolumenode
        bra.s .end
 .prev37        move.l 4.w,a6
        jsr -$0084(a6) ; Forbid
+       btst #0,d7
+       beq.s .nvol13
+       lea 32(a3),a0
+       bsr.w remdosentry13
+.nvol13        btst #1,d7
+       beq.s .ndev13
+       tst.b 158(a3)
+       beq.s .ndev13
+       clr.b 158(a3)
+       move.l 180(a3),a0
+       bsr.w remdosentry13
+.ndev13        jsr -$008a(a6) ;Permit
+.end   movem.l (sp)+,d7/a2/a6
+       rts
+
+adddosentry13:
+       move.l a0,a1
        move.l 160(a3),a0
-       move.l 34(a0),a0 ; rootnode
+       move.l 34(a0),a0 ; RootNode
+       move.l 24(a0),a0 ; DosInfo
        add.l a0,a0
        add.l a0,a0
-       move.l 24(a0),a0 ; dosinfo
+       move.l 4(a0),(a1) ; myentry->dl_Next = di_DevInfo
+       move.l a1,d0
+       lsr.l #2,d0
+       move.l d0,4(a0) ; di_DevInfo = myentry
+       rts
+
+remdosentry13:
+       move.l a0,a2
+       move.l 160(a3),a0
+       move.l 34(a0),a0 ; RootNode
+       move.l 24(a0),a0 ; DosInfo
        add.l a0,a0
        add.l a0,a0
-       lea 4(a0),a1
-       lea 32(a3),a2
-.pr2   move.l 4(a0),d0
-       beq.s .pr1
+       move.l 4(a0),a1 ; DosInfo->di_DevInfo
+       add.l a1,a1
+       add.l a1,a1
+       cmp.l a2,a1
+       bne.s .pr2
+       ; was first entry
+       move.l (a2),4(a0) ; di_DevInfo = myentry->dl_Next
+       bra.s .pr1
+.pr2   move.l a1,d0
+       beq.s .pr3
+       move.l (a1),d0 ; prevEntry->dl_Next
        add.l d0,d0
        add.l d0,d0
-       cmp.l d0,a2
+       cmp.l d0,a2 ; next is our entry?
        beq.s .pr3
        move.l d0,a1
-       move.l (a1),a0
-       add.l a0,a0
-       add.l a0,a0
        bra.s .pr2
-.pr3   move.l (a2),(a1)
-.pr1   jsr -$008a(a6) ;Permit
-.end   movem.l (sp)+,d7/a2/a6
-       rts
+.pr3   move.l a1,d0
+       beq.s .pr1
+       move.l (a2),(a1) ; prevEntry->dl_Next = myentry->dl_Next
+.pr1   rts
 
 diskinsertremove:
        movem.l d2/a2/a6,-(sp)
@@ -651,20 +700,23 @@ action_inhibit
        rts
 .add
        moveq #1,d0
-       moveq #1,d1
+       moveq #3,d1
        bsr dodiskchange
        rts
 
 diskchange
-       tst.b 172(a3)
+       move.b 172(a3),d0
        bmi.s .nodisk
        moveq #1,d0
-       moveq #1,d1
+       moveq #3,d1
        bsr dodiskchange
        rts
 .nodisk
-       moveq #0,d0
        moveq #1,d1
+       cmp.b #-2,d0 ;remove device node?
+       bne.s .nod1
+       moveq #3,d1
+.nod1  moveq #0,d0
        bsr dodiskchange
        rts
 
@@ -680,6 +732,7 @@ action_exall
        move.l a0,a5
        move.l 24(a4),a2 ;dp_Arg2, ExAllData
        move.l (a5),d7 ; eac_Entries
+       moveq #0,d5 ; previous entry
 .ex4   tst.l d7
        beq.s .ex3
        move.l a2,d0
@@ -711,24 +764,32 @@ action_exall
        ; need to delete current entry.. this is not really the proper way..
        move.l 4(a2),d0 ; pointer to filename (which is first address after structure)
        sub.l a2,d0 ; copy this much data
-       tst.l (a2) ; eac_Next
+       tst.l (a2) ; delete last? (eac_Next)
+       bne.s .ex10
+       ; need to clear previous eac_Next
+       move.l d5,d0
        beq.s .ex8
-       move.l (a2),a0
+       move.l d0,a0
+       clr.l (a0)
+       bra.s .ex8
+.ex10  move.l (a2),a0
        move.l a2,a1
 .ex9   move.l (a0)+,(a1)+
-       subq.l #4,d1
+       subq.l #4,d0
        bpl.s .ex9
 .ex8   subq.l #1,(a5) ; eac_Entries
        subq.l #1,d7
        bra.s .ex4
-.ex7   move.l (a2),a2 ; eac_Next
+.ex7   move.l a2,d5
+       move.l (a2),a2 ; eac_Next
        subq.l #1,d7
        bra.s .ex4
 .ex3   movem.l (sp)+,d2-d7/a2-a6
        rts
 
 
-make_dev: ; IN: A0 param_packet, D6: unit_no, D7: b0=autoboot,b1=onthefly, A4: expansionbase
+make_dev: ; IN: A0 param_packet, D6: unit_no, D7: b0=autoboot,b1=onthefly,b2=v36+
+       ; A4: expansionbase
 
        bsr.w fsres
        move.l d0,PP_FSRES(a0) ; pointer to FileSystem.resource
@@ -745,14 +806,16 @@ make_dev: ; IN: A0 param_packet, D6: unit_no, D7: b0=autoboot,b1=onthefly, A4: e
        jsr (a1)
        ; ret:0=virtual,1=hardfile,2=rdbhardfile,-1=hardfile-donotmount,-2=no more subunits
        move.l d0,d3
-       cmp.l #-2,d3
+       cmp.w #-2,d3
        beq.w general_ret
-       cmp.l #2,d3
-       beq.s mountalways
-       
+       cmp.w #1,d3
+       bne.s mountalways
+
        ; KS < V36: init regular hardfiles only if filesystem is loaded
-       and.l d5,d0
-       beq.s mountalways ; >= 36
+       btst #2,d7
+       bne.s mountalways ; >= 36
+       btst #1,d7
+       bne.s mountalways
        tst.l PP_FSSIZE(a0)
        beq.w general_ret ; no filesystem -> don't mount
 
@@ -823,8 +886,8 @@ nordbfs2:
 
 MKDV_is_filesys:
        move.l #6000,20(a3)     ; dn_StackSize
-       lea.l our_seglist(pc),a1
-       move.l a1,d0
+       lea.l our_seglist(pc),a0
+       move.l a0,d0
        lsr.l  #2,d0
        move.l d0,32(a3)        ; dn_SegList
        moveq #-1,d0
@@ -850,39 +913,98 @@ MKDV_doboot:
        move.l a3,16(a1)        ; devicenode
        lea.l  74(a4),a0 ; MountList
        jsr  -270(a6) ; Enqueue()
+       moveq #0,d0
        rts
 
 MKDV_noboot:
-       move.l a3,a0
+       move.l a1,a2 ; bootnode
+       move.l a3,a0 ; parmpacket
        moveq #0,d1
        move.l d1,a1
        btst #1,d7
        beq.s .nob
-       moveq #1,d1 ; ADNF_STARTPROC
+       btst #2,d7
+       beq.s .nob
+       moveq #1,d1 ; ADNF_STARTPROC (v36+)
 .nob   moveq #-20,d0
        move.l a4,a6 ; expansion base
        jsr  -150(a6) ; AddDosNode
+       btst #1,d7
+       beq.s .noproc
+       btst #2,d7
+       bne.s .noproc
+
+       ; 1.3 and need to start immediately
+       move.l (a2),a0 ; 'dh0' but need 'dh0:'
+       moveq #2,d2
+.devpr1        addq.l #1,d2
+       tst.b -3(a0,d2.l)
+       bne.s .devpr1
+       move.l 4.w,a6
+       move.l d2,d0
+       moveq #1,d1
+       jsr AllocMem(a6)
+       tst.l d0
+       beq.s .noproc
+       move.l (a2),a0
+       move.l d0,a2
+       move.l a2,a1
+.devpr2        move.b (a0)+,(a1)+
+       bne.s .devpr2
+       move.b #':',-1(a1)
+       clr.b (a1)
+       move.l 4.w,a6
+       lea doslibname(pc),a1
+       moveq #0,d0
+       jsr -$0228(a6) ; OpenLibrary
+       move.l d0,a6
+       move.l a2,d1
+       jsr -$0AE(a6) ; DeviceProc (start fs handler, ignore return code)
+       move.l a6,a1
+       move.l 4.w,a6
+       jsr -$019e(a6); CloseLibrary
+       move.l a2,a1
+       move.l d2,d0
+       jsr FreeMem(a6)
+.noproc
+       moveq #0,d0
        rts
 
 addfsonthefly ; d1 = fs index
        movem.l d2-d7/a2-a6,-(sp)
        move.l d1,d6
-       moveq #2,d7
-       moveq #0,d5
+       moveq #2+4,d7
        move.l 4.w,a6
        lea.l explibname(pc),a1 ; expansion lib name
+       moveq #36,d0
+       jsr  -552(a6) ; OpenLibrary
+       tst.l d0
+       bne.s .newks
+       bclr #2,d7
+       lea.l explibname(pc),a1 ; expansion lib name
        moveq #0,d0
        jsr  -552(a6) ; OpenLibrary
-       move.l d0,a4
+.newks move.l d0,a4
        move.l #PP_TOTAL,d0
        move.l #$10001,d1
        jsr AllocMem(a6)
        move.l d0,a0  ; param packet
+       tst.l d0
+       beq.s .nomem
        move.l a4,PP_EXPLIB(a0)
-       movem.l a4/a6,-(sp)
+.next  movem.l a0/a4/a6,-(sp)
        bsr.w make_dev
-       movem.l (sp)+,a4/a6
-       move.l a4,a1
+       movem.l (sp)+,a0/a4/a6
+       cmp.l #-2,d0
+       beq.s .nomsub
+       swap d6
+       addq.w #1,d6
+       swap d6
+       bra.s .next
+.nomsub        move.l a0,a1
+       move.l #PP_TOTAL,d0
+       jsr FreeMem(a6)
+.nomem move.l a4,a1
        jsr -414(a6) ; CloseLibrary
        movem.l (sp)+,d2-d7/a2-a6
        rts
@@ -907,6 +1029,7 @@ filesys_mainloop:
        ; 12: dummy message
        ; 32: the volume (44+80+1 bytes)
        ; 157: mousehack started-flag
+       ; 158: device node on/off status
        ; 160: dosbase
        ; 164: input.device ioreq (disk inserted/removed input message)
        ; 168: timer.device ioreq
@@ -922,6 +1045,7 @@ filesys_mainloop:
        move.l d6,4(a3)
        move.l d6,8(a3)
        move.l a2,160(a3)
+       st 158(a3)
 
        sub.l a1,a1
        jsr -294(a6) ; FindTask
@@ -1300,7 +1424,9 @@ createtask:
        move.l a2,a1
        move.l d3,a2
        sub.l a3,a3
+       move.l a1,d2
        jsr -$011a(a6) ;AddTask
+       move.l d2,d0
 .f     movem.l (sp)+,d2/d3/d4/a2/a3/a6
        rts
 
index a3a859f9ca987a56dacc25b13ba46b7faa278407..1ea97f857b02c5837c38846186aa17d1c364a57e 100755 (executable)
--- a/filesys.c
+++ b/filesys.c
@@ -2693,6 +2693,8 @@ int get_native_path(uae_u32 lock, char *out)
     return -1;
 }
 
+#define EXALL_DEBUG 0
+
 static ExAllKey *getexall (Unit *unit, int id)
 {
     int i;
@@ -2713,7 +2715,6 @@ static ExAllKey *getexall (Unit *unit, int id)
     return NULL;
 }
 
-
 static int exalldo (uaecptr exalldata, uae_u32 exalldatasize, uae_u32 type, uaecptr control, Unit *unit, a_inode *aino)
 {
     uaecptr exp = exalldata;
@@ -2783,7 +2784,10 @@ static int exalldo (uaecptr exalldata, uae_u32 exalldatasize, uae_u32 type, uaec
     if (exalldata + exalldatasize - exp < size + size2)
        return 0; /* not enough space */
 
-    //write_log("%d, %08x: '%s'%s\n", get_long (control + 0), exp, x, aino->dir ? " [DIR]" : "");
+#if EXALL_DEBUG > 0
+   write_log("ID=%d, %d, %08x: '%s'%s\n",
+       get_long (control + 4), get_long (control + 0), exp, x, aino->dir ? " [DIR]" : "");
+#endif
 
     put_long (exp, exp + size + size2); /* ed_Next */
     if (control >= 1) {
@@ -2873,6 +2877,9 @@ static int action_examine_all_end (Unit *unit, dpacket packet)
        return 0;
     id = get_long (control + 4);
     eak = getexall (unit, id);
+#if EXALL_DEBUG > 0
+    write_log ("EXALL_END ID=%d %x\n", id, eak);
+#endif
     if (!eak) {
         write_log ("FILESYS: EXALL_END non-existing ID %d\n", id);
         doserr = ERROR_OBJECT_WRONG_TYPE;
@@ -2910,7 +2917,7 @@ static int action_examine_all (Unit *unit, dpacket packet)
 
     ok = 0;
 
-#if 0
+#if EXALL_DEBUG > 0
     write_log ("exall: %08x %08x-%08x %d %d %08x\n",
        lock, exalldata, exalldata + exalldatasize, exalldatasize, type, control);
     write_log ("exall: MatchString %08x, MatchFunc %08x\n",
@@ -2954,7 +2961,9 @@ static int action_examine_all (Unit *unit, dpacket packet)
            base = lookup_aino (unit, get_long (lock + 4));
        if (base == 0)
            base = &unit->rootnode;
-       //write_log("exall: '%s'\n", base->nname);
+#if EXALL_DEBUG > 0
+       write_log("exall: ID=%d '%s'\n", eak->id, base->nname);
+#endif
        d = fs_opendir (unit, base->nname);
        if (!d)
            goto fail;
@@ -2984,7 +2993,9 @@ fail:
        exp = get_long (exp); /* ed_Next */
        i--;
     }
-    //write_log("ok=%d, err=%d, eac_Entries = %d\n", ok, ok ? -1 : doserr, get_long (control + 0));
+#if EXALL_DEBUG > 0
+    write_log("ok=%d, err=%d, eac_Entries = %d\n", ok, ok ? -1 : doserr, get_long (control + 0));
+#endif
 
     if (!ok) {
        PUT_PCK_RES1 (packet, DOS_FALSE);
index f1081293a0c2174609a61d862e0721cb2b189e12..281241026bd46790f38fe4e95e696445388c4fcf 100755 (executable)
@@ -69,7 +69,7 @@ struct vidbuf_description
      *   - set linemem to point at your buffer
      *   - implement flush_line to copy a single line to the screen
      */
-    uae_u8 *bufmem;
+    uae_u8 *bufmem, *bufmemend;
     uae_u8 *realbufmem;
     uae_u8 *linemem;
     uae_u8 *emergmem;
diff --git a/main.c b/main.c
index 3dfaae234461ea9f44e4f55293229b5c36cad62d..8ebe5b23909fee55f7d534d51fbe660068b3eb0a 100755 (executable)
--- a/main.c
+++ b/main.c
@@ -613,6 +613,9 @@ void do_leave_program (void)
 #endif
 #ifdef FILESYS
     filesys_cleanup ();
+#endif
+#ifdef BSDSOCKET
+    bsdlib_reset ();
 #endif
     device_func_reset ();
     savestate_free ();
index 9bde3c6046444063568dc2a3cc366a8f52211d1d..e0c292ca0ebedc914ad9a338a0b8b6911f36a8a3 100755 (executable)
@@ -201,20 +201,23 @@ int init_socket_layer(void)
                                wc.lpfnWndProc = SocketWindowProc;
                                wc.cbClsExtra = 0;
                                wc.cbWndExtra = 0;
-                               wc.hInstance = 0;
+                               wc.hInstance = hInst;
                                wc.hIcon = LoadIcon (GetModuleHandle (NULL), MAKEINTRESOURCE (IDI_APPICON));
                                wc.hCursor = LoadCursor (NULL, IDC_ARROW);
                                wc.hbrBackground = GetStockObject (BLACK_BRUSH);
                                wc.lpszMenuName = 0;
                                wc.lpszClassName = "SocketFun";
-                               if(RegisterClass(&wc)) {
-                                       bsd->hSockWnd = CreateWindowEx (0,
-                                               "SocketFun", "WinUAE Socket Window",
-                                               WS_POPUP,
-                                               0, 0,
-                                               1, 1,
-                                               NULL, NULL, 0, NULL);
-                                       bsd->hSockThread = THREAD(sock_thread, NULL);
+                               RegisterClass(&wc);
+                               bsd->hSockWnd = CreateWindowEx (0,
+                                       "SocketFun", "WinUAE Socket Window",
+                                       WS_POPUP,
+                                       0, 0,
+                                       1, 1,
+                                       NULL, NULL, 0, NULL);
+                               bsd->hSockThread = THREAD(sock_thread, NULL);
+                               if (!bsd->hSockWnd) {
+                                   deinit_socket_layer();
+                                   return 0;
                                }
                        }
                }
@@ -273,6 +276,7 @@ void deinit_socket_layer(void)
                bsd->hSockReqHandled = NULL;
                DestroyWindow (bsd->hSockWnd);
                bsd->hSockWnd = NULL;
+               UnregisterClass ("SocketFun", hInst);
        }
        close_selectget_threads ();
 }
index 34c1de952e8d285b435e1dc5e8456e83804df490..01fc8e7f3f1b4634f61c1dcf94f5ecb2818090af 100755 (executable)
@@ -254,7 +254,7 @@ static int LockStub( surface_type_e type )
     if(lockcnt)
     {
 #ifdef _DEBUG
-       DebugBreak();
+       //DebugBreak();
 #endif
        return 1;
     }
index b12864f9b9c7bde9c20a290ce0cf31acb62909c9..e2cf7590c47f0f254e24f5a0a8ef2e59007d33ee 100755 (executable)
@@ -517,6 +517,20 @@ static int recycle (const char *name)
        fos.fFlags = FOF_ALLOWUNDO | FOF_NOCONFIRMATION | FOF_NOERRORUI | FOF_NORECURSION | FOF_SILENT;
        v = SHFileOperation (&fos);
        xfree (p);
+       switch (v)
+       {
+           case 0xb7: //DE_ERROR_MAX
+           case 0x7c: //DE_INVALIDFILES
+           v = ERROR_FILE_NOT_FOUND;
+           break;
+           case 0x75: //DE_OPCANCELLED:
+           case 0x10000: //ERRORONDEST:
+           case 0x78: //DE_ACCESSDENIEDSRC:
+           case 0x74: //DE_ROOTDIR:
+           v = ERROR_ACCESS_DENIED;
+           break;
+       }
+       SetLastError (v);
        return v ? -1 : 0;
     }
 }
@@ -773,7 +787,6 @@ int dos_errno (void)
 
      case ERROR_SHARING_VIOLATION:
      case ERROR_BUSY:
-     /* SHFileOperation() returns this if file can't be deleted!?! */
      case ERROR_INVALID_HANDLE:
        return ERROR_OBJECT_IN_USE;
 
index 99abcbd2f74122eff6d494397fac430905a053bb..7c40908f1abcdd77e9290c6cd0536d55f8c121cd 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, 9, 16)
+#define WINUAEDATE MAKEBD(2007, 9, 18)
 #define WINUAEEXTRA ""
 #define WINUAEREV ""
 
index 9fc3fa2496f46aef1838dac6f1370b434549ca1c..12a5486ba92c8f90a8a6e00dbee4ccd9443c4660 100755 (executable)
@@ -105,8 +105,10 @@ void S2X_init (int dw, int dh, int aw, int ah, int mult, int ad, int dd)
     }
 
     if (usedfilter->type == UAE_FILTER_HQ) {
-       tempsurf2 = xmalloc (amiga_width * amiga_height * (amiga_depth / 8));
-       tempsurf3 = xmalloc (dst_width * dst_height * (dst_depth / 8) * 4);
+       int w = amiga_width > dst_width ? amiga_width : dst_width;
+       int h = amiga_height > dst_height ? amiga_height : dst_height;
+       tempsurf2 = xmalloc (w * h * (amiga_depth / 8));
+       tempsurf3 = xmalloc (w * h *(dst_depth / 8) * 4);
     }
 }
 
@@ -121,14 +123,14 @@ void S2X_render (void)
     DDSURFACEDESC2 desc;
 
     sptr = gfxvidinfo.bufmem;
-    v = (dst_width - amiga_width * scale) / 2;
+    v = (dst_width - amiga_width) / 2;
     aw += v;
     sptr -= v * (amiga_depth / 8);
-    v = (dst_height - amiga_height * scale) / 2;
+    v = (dst_height - amiga_height) / 2;
     ah += v;
     sptr -= v * gfxvidinfo.rowbytes;
 
-    endsptr = gfxvidinfo.realbufmem + (amiga_height - 1) * 3 * gfxvidinfo.rowbytes;
+    endsptr = gfxvidinfo.bufmemend;
 
     v = currprefs.gfx_filter ? currprefs.gfx_filter_horiz_offset : 0;
     v += (dst_width / scale - amiga_width) / 8;
index 9119204dd9673f278609a6160d4e907ff7b77a20..c8b9fbf9652246913cba4e0dee02d0acad0c3b65 100755 (executable)
@@ -2280,11 +2280,14 @@ static BOOL doInit (void)
        gfxvidinfo.bufmem = gfxvidinfo.realbufmem;
        gfxvidinfo.rowbytes = currentmode->amiga_width * gfxvidinfo.pixbytes;
     } else if (!(currentmode->flags & DM_D3D)) {
-       int size = (currentmode->amiga_width * 2) * (currentmode->amiga_height * 3) * gfxvidinfo.pixbytes;
+       int w = currentmode->amiga_width * 2;
+       int h = currentmode->amiga_height * 2;
+       int size = (w * 2) * (h * 3) * gfxvidinfo.pixbytes;
        gfxvidinfo.realbufmem = xmalloc (size);
        memset (gfxvidinfo.realbufmem, 0, size);
-       gfxvidinfo.bufmem = gfxvidinfo.realbufmem + (currentmode->amiga_width + (currentmode->amiga_width * 2) * currentmode->amiga_height) * gfxvidinfo.pixbytes;
-       gfxvidinfo.rowbytes = currentmode->amiga_width * 2 * gfxvidinfo.pixbytes;
+       gfxvidinfo.bufmem = gfxvidinfo.realbufmem + (w + (w * 2) * h) * gfxvidinfo.pixbytes;
+       gfxvidinfo.rowbytes = w * 2 * gfxvidinfo.pixbytes;
+       gfxvidinfo.bufmemend = gfxvidinfo.realbufmem + size - gfxvidinfo.rowbytes;
     }
 
     init_row_map ();
index 59203ee4fa213a8e20f9d502b11acc169bd6d6bf..3820063fa4d71b9b77ec04bfaf0f341df2a6fa0c 100755 (executable)
@@ -1,4 +1,13 @@
 
+Beta 9: RC2
+
+- deleting file, recycle bin support enabled and deletion fails:
+  return error code was wrong (SHFileOperation() is weird)
+- Action Replay 1/2/3 work again
+- bsdsocket froze if new configuration was loaded on the fly
+- filter crashes (old bug) if display was big, also centering code
+  is back to pre-b7
+
 Beta 8: (this is basically RC1 if bsdsocket is fixed)
 
 - ExAll ED_OWNER supported (return zero uid and gid) because