]> git.unchartedbackwaters.co.uk Git - francis/winuae.git/commitdiff
imported winuaesrc1320b1.zip
authorToni Wilen <twilen@winuae.net>
Tue, 22 Aug 2006 13:14:28 +0000 (16:14 +0300)
committerToni Wilen <twilen@winuae.net>
Mon, 22 Feb 2010 19:29:15 +0000 (21:29 +0200)
17 files changed:
akiko.c
ar.c
cfgfile.c
custom.c
expansion.c
fdi2raw.c
include/options.h
inputdevice.c
main.c
memory.c
od-win32/mman.c
od-win32/parser.c
od-win32/resources/winuae.rc
od-win32/win32.h
od-win32/win32gfx.c
od-win32/win32gui.c
savestate.c

diff --git a/akiko.c b/akiko.c
index 8b368dfa67fe4c9f5cb3710a18078bf8cafa3a43..f7e3b6bd49858d328d4a9acb5f856d1872fc3dbc 100755 (executable)
--- a/akiko.c
+++ b/akiko.c
@@ -25,6 +25,7 @@
 #include "threaddep/thread.h"
 #include "akiko.h"
 #include "gui.h"
+#include "crc32.h"
 
 #define AKIKO_DEBUG_NVRAM 0
 #define AKIKO_DEBUG_IO 0
@@ -343,6 +344,7 @@ static uae_u8 cdrom_command;
 #define        MAX_TOC_ENTRIES 103 /* tracks 1-99, A0,A1 and A2 */
 static int cdrom_toc_entries;
 static int cdrom_toc_counter;
+static uae_u32 cdrom_toc_crc;
 static uae_u8 cdrom_toc_buffer[MAX_TOC_ENTRIES*13];
 
 static int cdrom_disk, cdrom_paused, cdrom_playing;
@@ -436,7 +438,7 @@ static int cd_qcode (uae_u8 *d)
     if (as != 0x11 && as != 0x12 && as != 0x13 && as != 0x15) /* audio status ok? */
        return 0;
     s = buf + 4;
-    last_play_pos = (s[9] << 16) | (s[10] << 8) | (s[11] << 0);
+    last_play_pos = (s[5] << 16) | (s[6] << 8) | (s[7] << 0);
     if (!d)
        return 0;
     /* ??? */
@@ -505,13 +507,14 @@ static int cdrom_toc (void)
        if (s[3] == 0xa2)
            cdrom_leadout = msf2lsn ((s[8] << 16) | (s[9] << 8) | (s[10] << 0));
     }
+    cdrom_toc_entries = i;
+    cdrom_toc_crc = get_crc32(cdrom_toc_buffer, cdrom_toc_entries * 13);
     if (datatrack) {
        if (secondtrack)
            cdrom_data_end = secondtrack;
        else
            cdrom_data_end = cdrom_leadout;
     }
-    cdrom_toc_entries = i;
     return 0;
 }
 
@@ -967,7 +970,8 @@ static void *akiko_thread (void     *null)
        uae_sem_wait (&akiko_sem);
        sector = cdrom_current_sector;
        for (i = 0; i < SECTOR_BUFFER_SIZE; i++) {
-           if (sector_buffer_info_1[i] == 0xff) break;
+           if (sector_buffer_info_1[i] == 0xff)
+               break;
        }
        if (cdrom_data_end > 0 && sector >= 0 && (sector_buffer_sector_1 < 0 || sector < sector_buffer_sector_1 || sector >= sector_buffer_sector_1 + SECTOR_BUFFER_SIZE * 2 / 3 || i != SECTOR_BUFFER_SIZE)) {
            memset (sector_buffer_info_2, 0, SECTOR_BUFFER_SIZE);
@@ -1335,10 +1339,10 @@ int akiko_init (void)
            patchrom ();
        }
     }
+    uae_sem_init (&akiko_sem, 0, 1);
     if (!savestate_state) {
        cdrom_playing = cdrom_paused = 0;
        cdrom_data_offset = -1;
-       uae_sem_init (&akiko_sem, 0, 1);
     }
     if (cdromok && !akiko_thread_running) {
        akiko_thread_running = 1;
@@ -1382,13 +1386,20 @@ uae_u8 *save_akiko(int *len)
     save_u8 ((uae_u8)akiko_read_offset);
     save_u8 ((uae_u8)akiko_write_offset);
 
-    save_u32 ((cdrom_playing ? 1 : 0) | (cdrom_paused ? 2 : 0));
+    save_u32 ((cdrom_playing ? 1 : 0) | (cdrom_paused ? 2 : 0) | (cdrom_disk ? 4 : 0));
     if (cdrom_playing)
        cd_qcode (0);
     save_u32 (last_play_pos);
     save_u32 (last_play_end);
     save_u8 ((uae_u8)cdrom_toc_counter);
 
+    save_u8 (cdrom_speed);
+    save_u8 (cdrom_current_sector);
+
+    save_u32 (cdrom_toc_crc);
+    save_u8 (cdrom_toc_entries);
+    save_u32 (cdrom_leadout);
+
     *len = dst - dstbak;
     return dstbak;
 }
@@ -1428,7 +1439,6 @@ uae_u8 *restore_akiko(uae_u8 *src)
        akiko_buffer[i] = restore_u32 ();
     akiko_read_offset = restore_u8 ();
     akiko_write_offset = restore_u8 ();
-    akiko_c2p_do ();
 
     cdrom_playing = cdrom_paused = 0;
     v = restore_u32 ();
@@ -1436,16 +1446,33 @@ uae_u8 *restore_akiko(uae_u8 *src)
        cdrom_playing = 1;
     if (v & 2)
        cdrom_paused = 1;
+
     last_play_pos = restore_u32 ();
     last_play_end = restore_u32 ();
-    cdrom_toc_counter = restore_u8 ();
-    if (cdrom_toc_counter == 255)
-       cdrom_toc_counter = -1;
-    if (cdrom_playing)
-       sys_command_cd_play (DF_IOCTL, unitnum, last_play_pos, last_play_end, 0);
+    cdrom_toc_counter = (uae_s8)restore_u8 ();
+    cdrom_speed = restore_u8 ();
+    cdrom_current_sector = (uae_s8)restore_u8 ();
+
+    restore_u32();
+    restore_u8();
+    restore_u32();
 
     return src;
 }
+
+void restore_akiko_finish(void)
+{
+    if (!cd32_enabled)
+       return;
+    akiko_c2p_do ();
+    sys_command_cd_pause (DF_IOCTL, unitnum, 0);
+    sys_command_cd_stop (DF_IOCTL, unitnum);
+    sys_command_cd_pause (DF_IOCTL, unitnum, 1);
+    if (cdrom_playing)
+       sys_command_cd_play (DF_IOCTL, unitnum, last_play_pos, last_play_end, 0);
+}
+
+
 void akiko_entergui (void)
 {
     if (cdrom_playing)
diff --git a/ar.c b/ar.c
index d3364034652a75e65080de92f56610c95b91722f..453826ba8d7dcf793bf2db4ef851d08249cf8dfb 100755 (executable)
--- a/ar.c
+++ b/ar.c
@@ -187,6 +187,7 @@ static uae_u8 *armemory_rom = 0, *armemory_ram = 0;
 static uae_u32 hrtmem_mask;
 static uae_u8 *hrtmon_custom, *hrtmon_ciaa, *hrtmon_ciab;
 uae_u32 hrtmem_start, hrtmem_size;
+static int triggered_once;
 
 static void hrtmon_unmap_banks(void);
 
@@ -282,7 +283,7 @@ static uae_u8 REGPARAM2 *hrtmem_xlate (uaecptr addr)
 static addrbank hrtmem_bank = {
     hrtmem_lget, hrtmem_wget, hrtmem_bget,
     hrtmem_lput, hrtmem_wput, hrtmem_bput,
-    hrtmem_xlate, hrtmem_check, NULL, "HRTMon memory"
+    hrtmem_xlate, hrtmem_check, NULL, "HRTMon memory",
 };
 
 static void copyfromamiga(uae_u8 *dst,uaecptr src,int len)
@@ -684,12 +685,12 @@ static uae_u8 REGPARAM2 *arrom_xlate (uaecptr addr)
 static addrbank arrom_bank = {
     arrom_lget, arrom_wget, arrom_bget,
     arrom_lput, arrom_wput, arrom_bput,
-    arrom_xlate, arrom_check, NULL, "Action Replay ROM"
+    arrom_xlate, arrom_check, NULL, "Action Replay ROM",
 };
 static addrbank arram_bank = {
     arram_lget, arram_wget, arram_bget,
     arram_lput, arram_wput, arram_bput,
-    arram_xlate, arram_check, NULL, "Action Replay RAM"
+    arram_xlate, arram_check, NULL, "Action Replay RAM",
 };
 
 static void action_replay_unmap_banks()
@@ -789,6 +790,7 @@ static void hrtmon_go (void)
     uaecptr old;
     int i;
    
+    triggered_once = 1;
     cartridge_enter();
     hrtmon_flag = ACTION_REPLAY_ACTIVE;
     set_special (SPCFLAG_ACTION_REPLAY);
@@ -834,6 +836,7 @@ void action_replay_enter(void)
 {
     if (!armemory_rom)
        return;
+    triggered_once = 1;
     if (armodel == 1) {
        write_log("AR1: Enter PC:%p\n", m68k_getpc());
        action_replay_go1 (7);
@@ -1305,7 +1308,7 @@ int action_replay_unload(int in_memory_reset)
                "ACTION_REPLAY_HIDE",
        };
 
-       write_log_debug("Action Replay State:(%s) Hrtmon State:(%s)\n", state[action_replay_flag+3],state[hrtmon_flag+3] );
+       write_log_debug("Action Replay State:(%s)\nHrtmon State:(%s)\n", state[action_replay_flag+3],state[hrtmon_flag+3] );
        
        if ( armemory_rom && armodel == 1 )
        {
@@ -1460,8 +1463,9 @@ static void hrtmon_configure(void)
     cfg->novbr = TRUE;
     cfg->hexmode = TRUE;
     cfg->entered = 0;
-    cfg->key = hrtmon_lang;
+    cfg->keyboard = hrtmon_lang;
     do_put_mem_long(&cfg->max_chip, currprefs.chipmem_size);
+    do_put_mem_long(&cfg->mon_size, 0x800000);
 }
 
 int hrtmon_load(void)
@@ -1475,6 +1479,7 @@ int hrtmon_load(void)
     if (hrtmemory)
       return 0;
 
+    triggered_once = 0;
     armodel = 0;
     hrtmem_start = 0xa10000;
     if (!currprefs.cart_internal) {
@@ -1632,6 +1637,8 @@ uae_u8 *save_hrtmon (int *len, uae_u8 *dstptr)
 
     if (!hrtmemory)
        return 0;
+    if (!triggered_once)
+       return 0;
     if (dstptr)
        dstbak = dst = dstptr;
     else
index 5578284e090f41404706c591db17f2ad3930fcee..64a0352d9c37e80451d8f0cf0b43ea322759cccd 100755 (executable)
--- a/cfgfile.c
+++ b/cfgfile.c
@@ -428,6 +428,7 @@ void cfgfile_save_options (struct zfile *f, struct uae_prefs *p, int type)
     cfgfile_write (f, "fastmem_size=%d\n", p->fastmem_size / 0x100000);
     cfgfile_write (f, "a3000mem_size=%d\n", p->a3000mem_size / 0x100000);
     cfgfile_write (f, "z3mem_size=%d\n", p->z3fastmem_size / 0x100000);
+    cfgfile_write (f, "z3mem_start=0x%x\n", p->z3fastmem_start);
     cfgfile_write (f, "bogomem_size=%d\n", p->bogomem_size / 0x40000);
     cfgfile_write (f, "gfxcard_size=%d\n", p->gfxmem_size / 0x100000);
     cfgfile_write (f, "chipmem_size=%d\n", (p->chipmem_size == 0x40000) ? 0 : p->chipmem_size / 0x80000);
@@ -1022,6 +1023,7 @@ static int cfgfile_parse_hardware (struct uae_prefs *p, char *option, char *valu
        || cfgfile_intval (option, value, "fastmem_size", &p->fastmem_size, 0x100000)
        || cfgfile_intval (option, value, "a3000mem_size", &p->a3000mem_size, 0x100000)
        || cfgfile_intval (option, value, "z3mem_size", &p->z3fastmem_size, 0x100000)
+       || cfgfile_intval (option, value, "z3mem_start", &p->z3fastmem_start, 1)
        || cfgfile_intval (option, value, "bogomem_size", &p->bogomem_size, 0x40000)
        || cfgfile_intval (option, value, "gfxcard_size", &p->gfxmem_size, 0x100000)
        || cfgfile_intval (option, value, "floppy_speed", &p->floppy_speed, 1)
@@ -2516,6 +2518,7 @@ void default_prefs (struct uae_prefs *p, int type)
     p->fastmem_size = 0x00000000;
     p->a3000mem_size = 0x00000000;
     p->z3fastmem_size = 0x00000000;
+    p->z3fastmem_start = 0x10000000;
     p->chipmem_size = 0x00080000;
     p->bogomem_size = 0x00080000;
     p->gfxmem_size = 0x00000000;
index dd9a886e4d2172bdff45fd73404a5106b49e3793..cd085e92f3933bc9796d988aa49dc31056095a65 100755 (executable)
--- a/custom.c
+++ b/custom.c
@@ -4573,7 +4573,6 @@ void customreset (void)
        CLXCON2 (clxcon2);
        calcdiw ();
        write_log ("State restored\n");
-       dumpcustom ();
        for (i = 0; i < 8; i++)
            nr_armed += spr[i].armed != 0;
        if (! currprefs.produce_sound) {
index 461df3ca19bea79613c93525a253a322acdd2566..28dee526c973db08505139163d51afde87c4040d 100755 (executable)
@@ -260,7 +260,7 @@ static void REGPARAM2 expamem_wput (uaecptr addr, uae_u32 value)
         case 0x44:
            if (expamem_type() == zorroIII) {
                // +Bernd Roesch
-               value = value - 0x3000;  // maps to 0x10000000
+               value = (value - 0x4000) + (z3fastmem_start >> 16); /* hack address */
                chipmem_wput (regs.regs[11] + 0x20, value);
                chipmem_wput (regs.regs[11] + 0x28, value);
                // -Bernd Roesch
@@ -877,7 +877,7 @@ static void expamem_init_z3fastmem (void)
 
     expamem_write (0x40, 0x00); /* Ctrl/Statusreg.*/
 
-    z3fastmem_start = 0x10000000;
+    z3fastmem_start = currprefs.z3fastmem_start;
 
     map_banks (&z3fastmem_bank, z3fastmem_start >> 16, currprefs.z3fastmem_size >> 16,
        allocated_z3fastmem);
index 20c314e298b17e01b6a2e709a417823e6fb643d3..b8ab9e8d2245bf5c0563c35379ad1791c71df3f4 100755 (executable)
--- a/fdi2raw.c
+++ b/fdi2raw.c
 //#include "types.h"
 
 #include "fdi2raw.h"
+#include "crc32.h"
 
 #undef DEBUG
 #define VERBOSE
-#undef VERBOSE
 
 #include <assert.h>
 
@@ -139,6 +139,7 @@ struct fdi {
        int bit_rate;
        int disk_type;
        int write_protect;
+       int reversed_side;
        int err;
        uae_u8 header[2048];
        int track_offsets[MAX_TRACKS];
@@ -1923,7 +1924,7 @@ static int decode_lowlevel_track (FDI *fdi, int track, struct fdi_cache *cache)
                idxp[i] = sum;
        }
        len = totalavg / 100000;
-       outlog("totalavg=%u index=%d (%d) maxidx=%d weakbits=%d len=%d\n",
+       debuglog("totalavg=%u index=%d (%d) maxidx=%d weakbits=%d len=%d\n",
                totalavg, indexoffset, maxidx, weakbits, len);
        cache->avgp = avgp;
        cache->idxp = idxp;
@@ -2024,11 +2025,21 @@ FDI *fdi2raw_header(struct zfile *f)
                fdi_free(fdi);
                return NULL;
        }
-       if ((fdi->header[140] != 1 && fdi->header[140] != 2) || fdi->header[141] != 0) {
+       if (fdi->header[140] != 1 && fdi->header[140] != 2) {
                fdi_free(fdi);
                return NULL;
        }
 
+       if (fdi->header[140] * 256 + fdi->header[141] >= 2 * 256 + 1) {
+               uae_u32 crc = get_crc32(fdi->header, 508);
+               uae_u32 crc2 = (fdi->header[508] << 24) | (fdi->header[509] << 16) | (fdi->header[510] << 8) | fdi->header[511];
+               if (crc != crc2) {
+                       outlog("FDI: header checksum error\n");
+                       fdi_free(fdi);
+                       return NULL;
+               }
+       }
+
        fdi->mfmsync_buffer = fdi_malloc (MAX_MFM_SYNC_BUFFER * sizeof(int));
        fdi->track_src_buffer = fdi_malloc (MAX_SRC_BUFFER);
        fdi->track_dst_buffer = fdi_malloc (MAX_DST_BUFFER);
@@ -2042,8 +2053,9 @@ FDI *fdi2raw_header(struct zfile *f)
        fdi->disk_type = fdi->header[145];
        fdi->rotation_speed = fdi->header[146] + 128;
        fdi->write_protect = fdi->header[147] & 1;
+       fdi->reversed_side = (fdi->header[147] & 4) ? 1 : 0;
        outlog ("FDI version %d.%d\n", fdi->header[140], fdi->header[141]);
-       outlog ("last_track=%d rotation_speed=%d\n",fdi->last_track,fdi->rotation_speed);
+       outlog ("last_track=%d rotation_speed=%d\n", fdi->last_track, fdi->rotation_speed);
 
        offset = 512;
        i = fdi->last_track;
@@ -2072,7 +2084,7 @@ FDI *fdi2raw_header(struct zfile *f)
 }
 
 
-int fdi2raw_loadrevolution_2 (FDI *fdi, uae_u16 *mfmbuf, uae_u16 *tracktiming, int track, int *tracklength, int *indexoffsetp, int *multirev, int mfm)
+static int fdi2raw_loadrevolution_2 (FDI *fdi, uae_u16 *mfmbuf, uae_u16 *tracktiming, int track, int *tracklength, int *indexoffsetp, int *multirev, int mfm)
 {
        struct fdi_cache *cache = &fdi->cache[track];
        int len, i, idx;
@@ -2083,7 +2095,7 @@ int fdi2raw_loadrevolution_2 (FDI *fdi, uae_u16 *mfmbuf, uae_u16 *tracktiming, i
                cache->avgp, cache->minp, cache->maxp, cache->idxp,
                cache->maxidx, &idx, cache->pulses, mfm);
        //fdi2_gcr_decode (fdi, totalavg, avgp, minp, maxp, idxp, idx_off1, idx_off2, idx_off3, maxidx, pulses);
-       outlog("track %d: nbits=%d avg len=%.2f weakbits=%d idx=%d\n",
+       debuglog("track %d: nbits=%d avg len=%.2f weakbits=%d idx=%d\n",
                track, bitoffset, (double)cache->totalavg / bitoffset, cache->weakbits, cache->indexoffset);
        len = fdi->out;
        if (cache->weakbits >= 10 && multirev)
@@ -2102,6 +2114,7 @@ int fdi2raw_loadrevolution_2 (FDI *fdi, uae_u16 *mfmbuf, uae_u16 *tracktiming, i
 
 int fdi2raw_loadrevolution (FDI *fdi, uae_u16 *mfmbuf, uae_u16 *tracktiming, int track, int *tracklength, int mfm)
 {
+       track ^= fdi->reversed_side;
        return fdi2raw_loadrevolution_2 (fdi, mfmbuf, tracktiming, track, tracklength, 0, 0, mfm);
 }
 
@@ -2111,6 +2124,7 @@ int fdi2raw_loadtrack (FDI *fdi, uae_u16 *mfmbuf, uae_u16 *tracktiming, int trac
        int outlen, i, indexoffset = 0;
        struct fdi_cache *cache = &fdi->cache[track];
 
+       track ^= fdi->reversed_side;
        if (cache->lowlevel)
                return fdi2raw_loadrevolution_2 (fdi, mfmbuf, tracktiming, track, tracklength, indexoffsetp, multirev, mfm);
 
@@ -2136,7 +2150,7 @@ int fdi2raw_loadtrack (FDI *fdi, uae_u16 *mfmbuf, uae_u16 *tracktiming, int trac
        else
                fdi->bit_rate = 250;
 
-       outlog ("track %d: srclen: %d track_type: %02.2X, bitrate: %d\n",
+       debuglog ("track %d: srclen: %d track_type: %02.2X, bitrate: %d\n",
                fdi->current_track, fdi->track_src_len, fdi->track_type, fdi->bit_rate);
 
        if ((fdi->track_type & 0xc0) == 0x80) {
index 3c832e82c86ec182894351566b2dbeb05e04407c..2eb52b58398e3bac7ce4cfd4112447891ecf19ef 100755 (executable)
@@ -9,7 +9,7 @@
 
 #define UAEMAJOR 1
 #define UAEMINOR 3
-#define UAESUBREV 1
+#define UAESUBREV 2
 
 typedef enum { KBD_LANG_US, KBD_LANG_DK, KBD_LANG_DE, KBD_LANG_SE, KBD_LANG_FR, KBD_LANG_IT, KBD_LANG_ES } KbdLang;
 
@@ -193,6 +193,7 @@ struct uae_prefs {
     int address_space_24;
 
     uae_u32 z3fastmem_size;
+    uae_u32 z3fastmem_start;
     uae_u32 fastmem_size;
     uae_u32 chipmem_size;
     uae_u32 bogomem_size;
index e3ca3715ba56860263420ff7aa9e49491588fddd..99c4de6a1155df3dc2b575b01c24c0bb937ce538 100755 (executable)
@@ -1479,19 +1479,10 @@ int handle_input_event (int nr, int state, int max, int autofire)
                    delta = state;
                }
                mouse_delta[joy][ie->data] += delta;
-           } else if (ie->type & 32) {
-               int speed = currprefs.input_joymouse_speed;
 
-               /* button mouse emulation */
-               if (state && (ie->data & DIR_LEFT)) {
-                   mouse_delta[joy][0] = -speed;
-                   mouse_deltanoreset[joy][0] = 1;
-               } else if (state && (ie->data & DIR_RIGHT)) {
-                   mouse_delta[joy][0] = speed;
-                   mouse_deltanoreset[joy][0] = 1;
-               } else
-                   mouse_deltanoreset[joy][0] = 0;
+           } else if (ie->type & 32) { /* button mouse emulation vertical */
 
+               int speed = currprefs.input_joymouse_speed;
                if (state && (ie->data & DIR_UP)) {
                    mouse_delta[joy][1] = -speed;
                    mouse_deltanoreset[joy][1] = 1;
@@ -1501,7 +1492,19 @@ int handle_input_event (int nr, int state, int max, int autofire)
                } else
                    mouse_deltanoreset[joy][1] = 0;
 
-           } else if (ie->type & 64) { /* analog (paddle) */
+           } else if (ie->type & 64) { /* button mouse emulation horizontal */
+
+               int speed = currprefs.input_joymouse_speed;
+               if (state && (ie->data & DIR_LEFT)) {
+                   mouse_delta[joy][0] = -speed;
+                   mouse_deltanoreset[joy][0] = 1;
+               } else if (state && (ie->data & DIR_RIGHT)) {
+                   mouse_delta[joy][0] = speed;
+                   mouse_deltanoreset[joy][0] = 1;
+               } else
+                   mouse_deltanoreset[joy][0] = 0;
+
+           } else if (ie->type & 128) { /* analog (paddle) */
                int deadzone = currprefs.input_joymouse_deadzone * max / 100;
                if (max) {
                    if (state < deadzone && state > -deadzone) {
diff --git a/main.c b/main.c
index 1af5acd3609ba28325835c10fa8525d2c1f922b5..2315c5c22f306717fbd11981348c14deb4bbc97a 100755 (executable)
--- a/main.c
+++ b/main.c
@@ -151,6 +151,10 @@ void fixup_prefs (struct uae_prefs *p)
        write_log ("Unsupported Zorro III fastmem size!\n");
        err = 1;
     }
+    p->z3fastmem_start &= ~0xffff;
+    if (p->z3fastmem_start < 0x1000000)
+       p->z3fastmem_start = 0x1000000;
+
     if (p->address_space_24 && (p->gfxmem_size != 0 || p->z3fastmem_size != 0)) {
        p->z3fastmem_size = p->gfxmem_size = 0;
        write_log ("Can't use a graphics card or Zorro III fastmem when using a 24 bit\n"
index 45f409beed8c22a04aba50e02c64edc65385d002..98c94ba37f53bd7adce4550b3aac0b4cc20e6eec 100755 (executable)
--- a/memory.c
+++ b/memory.c
@@ -1474,7 +1474,8 @@ static char *kickstring = "exec.library";
 int read_kickstart (struct zfile *f, uae_u8 *mem, int size, int dochecksum, int *cloanto_rom)
 {
     unsigned char buffer[20];
-    int i, j, cr = 0;
+    int i, j;
+    int cr = 0, kickdisk = 0;
 
     if (cloanto_rom)
        *cloanto_rom = 0;
@@ -1484,7 +1485,10 @@ int read_kickstart (struct zfile *f, uae_u8 *mem, int size, int dochecksum, int
        zfile_fseek (f, 0, SEEK_SET);
     }
     i = zfile_fread (buffer, 1, 11, f);
-    if (strncmp ((char *)buffer, "AMIROMTYPE1", 11) != 0) {
+    if (!memcmp(buffer, "KICK", 4)) {
+       zfile_fseek (f, 512, SEEK_SET);
+       kickdisk = 1;
+    } else if (strncmp ((char *)buffer, "AMIROMTYPE1", 11) != 0) {
        zfile_fseek (f, 0, SEEK_SET);
     } else {
        cr = 1;
@@ -1494,6 +1498,8 @@ int read_kickstart (struct zfile *f, uae_u8 *mem, int size, int dochecksum, int
        *cloanto_rom = cr;
 
     i = zfile_fread (mem, 1, size, f);
+    if (kickdisk && i > 262144)
+       i = 262144;
     zfile_fclose (f);
     if ((i != 8192 && i != 65536) && i != 131072 && i != 262144 && i != 524288) {
        notify_user (NUMSG_KSROMREADERROR);
@@ -2288,23 +2294,40 @@ void restore_bram (int len, long filepos)
 
 uae_u8 *restore_rom (uae_u8 *src)
 {
-    uae_u32 crc32;
+    uae_u32 crc32, mem_start, mem_size, mem_type, version;
     int i;
 
-    restore_u32 ();
-    restore_u32 ();
-    restore_u32 ();
-    restore_u32 ();
+    mem_start = restore_u32 ();
+    mem_size = restore_u32 ();
+    mem_type = restore_u32 ();
+    version = restore_u32 ();
     crc32 = restore_u32 ();
     for (i = 0; i < romlist_cnt; i++) {
        if (rl[i].rd->crc32 == crc32 && crc32) {
-           strncpy (changed_prefs.romfile, rl[i].path, 255);
+           switch (mem_type)
+           {
+               case 0:
+               strncpy (changed_prefs.romfile, rl[i].path, 255);
+               break;
+               case 1:
+               strncpy (changed_prefs.romextfile, rl[i].path, 255);
+               break;
+           }
            break;
        }
     }
     src += strlen (src) + 1;
-    if (zfile_exists(src))
-       strncpy (changed_prefs.romfile, src, 255);
+    if (zfile_exists(src)) {
+       switch (mem_type)
+       {
+           case 0:
+           strncpy (changed_prefs.romfile, src, 255);
+           break;
+           case 1:
+           strncpy (changed_prefs.romextfile, src, 255);
+           break;
+       }
+    }
     src += strlen (src) + 1;
     return src;
 }
@@ -2314,18 +2337,24 @@ uae_u8 *save_rom (int first, int *len, uae_u8 *dstptr)
     static int count;
     uae_u8 *dst, *dstbak;
     uae_u8 *mem_real_start;
-    int mem_start, mem_size, mem_type, i, saverom;
+    uae_u32 version;
+    char *path;
+    int mem_start, mem_size, mem_type, saverom;
+    int i;
+    char tmpname[1000];
 
+    version = 0;
     saverom = 0;
     if (first)
        count = 0;
     for (;;) {
        mem_type = count;
        switch (count) {
-       case 0:         /* Kickstart ROM */
+       case 0: /* Kickstart ROM */
            mem_start = 0xf80000;
            mem_real_start = kickmemory;
            mem_size = kickmem_size;
+           path = currprefs.romfile;
            /* 256KB or 512KB ROM? */
            for (i = 0; i < mem_size / 2 - 4; i++) {
                if (longget (i + mem_start) != longget (i + mem_start + mem_size / 2))
@@ -2335,7 +2364,17 @@ uae_u8 *save_rom (int first, int *len, uae_u8 *dstptr)
                mem_size /= 2;
                mem_start += 262144;
            }
-           mem_type = 0;
+           version = longget (mem_start + 12); /* version+revision */
+           sprintf (tmpname, "Kickstart %d.%d", wordget (mem_start + 12), wordget (mem_start + 14));
+           break;
+       case 1: /* Extended ROM */
+           if (!extendedkickmem_size)
+               break;
+           mem_start = extendedkickmem_start;
+           mem_real_start = extendedkickmemory;
+           mem_size = extendedkickmem_size;
+           path = currprefs.romextfile;
+           sprintf (tmpname, "CD32 Extended");
            break;
        default:
            return 0;
@@ -2351,11 +2390,11 @@ uae_u8 *save_rom (int first, int *len, uae_u8 *dstptr)
     save_u32 (mem_start);
     save_u32 (mem_size);
     save_u32 (mem_type);
-    save_u32 (longget (mem_start + 12));       /* version+revision */
-    save_u32 (get_crc32 (kickmemory, mem_size));
-    sprintf (dst, "Kickstart %d.%d", wordget (mem_start + 12), wordget (mem_start + 14));
+    save_u32 (version);
+    save_u32 (get_crc32 (mem_real_start, mem_size));
+    strcpy (dst, tmpname);
     dst += strlen (dst) + 1;
-    strcpy (dst, currprefs.romfile);/* rom image name */
+    strcpy (dst, path);/* rom image name */
     dst += strlen(dst) + 1;
     if (saverom) {
        for (i = 0; i < mem_size; i++)
index 3dbaa743148f84731d8d7b84696e4a0a4642282c..f236f43ded458cc2e3f7c414212210f155d5c057 100755 (executable)
@@ -244,7 +244,7 @@ void *shmat(int shmid, void *shmaddr, int shmflg)
            size+=32;
        }
        if(!strcmp(shmids[shmid].name,"z3")) {
-           shmaddr=natmem_offset+0x10000000;
+           shmaddr=natmem_offset+currprefs.z3fastmem_start;
            if (allocated_z3fastmem<0x1000000)
                gfxoffs=0x1000000;
            else
@@ -253,7 +253,7 @@ void *shmat(int shmid, void *shmaddr, int shmflg)
        }
        if(!strcmp(shmids[shmid].name,"gfx"))
        {
-           shmaddr=natmem_offset+0x10000000+gfxoffs;
+           shmaddr=natmem_offset+currprefs.z3fastmem_start+gfxoffs;
            got = TRUE;
            size+=32;
            result=malloc(size);
index 7f15e32b386ee24ed7552788c629555752e029ac..e5bcf4b7b715bfd704c3cbee125d057cb07aede8 100755 (executable)
@@ -817,7 +817,7 @@ void hsyncstuff(void)
        }
        keycheck = 0;
     }
-    if (currprefs.parallel_autoflush_time) {
+    if (currprefs.parallel_autoflush_time && !currprefs.parallel_postscript_detection) {
        parflush++;
        if (parflush / ((currprefs.ntscmode ? MAXVPOS_NTSC : MAXVPOS_PAL) * MAXHPOS_PAL / maxhpos) >= currprefs.parallel_autoflush_time * 50) {
            flushprinter ();
index ce0b423088d349f281d90fddd10c38be2c0ce76a..b40d7175aaba83a5a06859e24ddf6483d0fd2464 100755 (executable)
@@ -838,8 +838,8 @@ IDI_PATHS               ICON                    "paths.ico"
 //
 
 VS_VERSION_INFO VERSIONINFO
- FILEVERSION 1,3,1,0
- PRODUCTVERSION 1,3,1,0
+ FILEVERSION 1,3,2,0
+ PRODUCTVERSION 1,3,2,0
  FILEFLAGSMASK 0x3fL
 #ifdef _DEBUG
  FILEFLAGS 0x1L
@@ -855,12 +855,12 @@ BEGIN
         BLOCK "040904b0"
         BEGIN
             VALUE "FileDescription", "WinUAE"
-            VALUE "FileVersion", "1.3.1"
+            VALUE "FileVersion", "1.3.2"
             VALUE "InternalName", "WinUAE"
             VALUE "LegalCopyright", "© 1996-2006 under the GNU Public License (GPL)"
             VALUE "OriginalFilename", "WinUAE.exe"
             VALUE "ProductName", "WinUAE"
-            VALUE "ProductVersion", "1.3.1"
+            VALUE "ProductVersion", "1.3.2"
         END
     END
     BLOCK "VarFileInfo"
index c97326621fdce875cd5405822329e356c6e96d06..561ee344d638dc75b9b7fd1f9ae08a01af7217a9 100755 (executable)
@@ -21,8 +21,8 @@ extern int manual_painting_needed;
 extern int manual_palette_refresh_needed;
 extern int mouseactive, focus;
 extern int ignore_messages_all;
-#define WINUAEBETA 0
-#define WINUAEBETASTR ""
+#define WINUAEBETA 1
+#define WINUAEBETASTR " Beta 1"
 
 extern char start_path_exe[MAX_DPATH];
 extern char start_path_data[MAX_DPATH];
index 28e2db6c22fc62796a3833c4b923d48bdb01e29e..64ca7a4fa6cbb78ce7e00623a28305dbb8f457d5 100755 (executable)
@@ -1755,7 +1755,6 @@ int graphics_setup (void)
 void graphics_leave (void)
 {
     close_windows ();
-    dumpcustom ();
 }
 
 uae_u32 OSDEP_minimize_uae( void )
index 510e9e6acac7a6cc3c96306f318686a0261d8d9d..ecd70280e64391ea74370d24a3db350931fd1c06 100755 (executable)
@@ -399,10 +399,14 @@ static struct romdata *scan_single_rom_2 (struct zfile *f, uae_u8 *keybuf, int k
     zfile_fseek (f, 0, SEEK_END);
     size = zfile_ftell (f);
     zfile_fseek (f, 0, SEEK_SET);
-    if (size > 600000)
+    if (size > 1760 * 512) /* don't skip KICK disks */
        return 0;
     zfile_fread (buffer, 1, 11, f);
-    if (!memcmp (buffer, "AMIROMTYPE1", 11)) {
+    if (!memcmp (buffer, "KICK", 4)) {
+       zfile_fseek (f, 512, SEEK_SET);
+       if (size > 262144)
+           size = 262144;
+    } else if (!memcmp (buffer, "AMIROMTYPE1", 11)) {
        cl = 1;
        if (keybuf == 0)
            cl = -1;
index da45750a77da472204e95c874df746044584da1b..79ec4b70839774541adc420b7ba0ed6b026224d1 100755 (executable)
@@ -333,7 +333,7 @@ void restore_state (char *filename)
 {
     struct zfile *f;
     uae_u8 *chunk,*end;
-    char name[5], prevchunk[5];
+    char name[5];
     long len, totallen;
     long filepos;
 
@@ -355,12 +355,9 @@ void restore_state (char *filename)
     changed_prefs.chipmem_size = 0;
     changed_prefs.fastmem_size = 0;
     savestate_state = STATE_RESTORE;
-    prevchunk[0] = 0;
     for (;;) {
+       name[0] = 0;
        chunk = end = restore_chunk (f, name, &len, &totallen, &filepos);
-       if (!strcmp (name, prevchunk))
-           break;
-       strcpy (prevchunk, name);
        write_log ("Chunk '%s' size %d (%d)\n", name, len, totallen);
        if (!strcmp (name, "END "))
            break;