From: Toni Wilen Date: Sat, 16 Apr 2005 10:21:10 +0000 (+0300) Subject: imported winuaesrc1000b6.zip X-Git-Tag: 2100~315 X-Git-Url: https://git.unchartedbackwaters.co.uk/w/?a=commitdiff_plain;h=8cf094333adabc3b950d123c1a23628b07990119;p=francis%2Fwinuae.git imported winuaesrc1000b6.zip --- diff --git a/audio.c b/audio.c index 532e07ae..c11beae6 100755 --- a/audio.c +++ b/audio.c @@ -23,6 +23,8 @@ #include "audio.h" #include "savestate.h" #include "driveclick.h" +#include "zfile.h" +#include "uae.h" #ifdef AVIOUTPUT #include "avioutput.h" #endif @@ -54,6 +56,179 @@ struct audio_channel_data { int request_word, request_word_skip; }; +int sampleripper_enabled; +struct ripped_sample +{ + struct ripped_sample *next; + uae_u8 *sample; + int len, per, changed; +}; + +static struct ripped_sample *ripped_samples; + +void write_wavheader (struct zfile *wavfile, uae_u32 size, uae_u32 freq) +{ + uae_u16 tw; + uae_u32 tl; + int bits = 8, channels = 1; + + zfile_fseek (wavfile, 0, SEEK_SET); + zfile_fwrite ("RIFF", 1, 4, wavfile); + tl = 0; + if (size) + tl = size - 8; + zfile_fwrite (&tl, 1, 4, wavfile); + zfile_fwrite ("WAVEfmt ", 1, 8, wavfile); + tl = 16; + zfile_fwrite (&tl, 1, 4, wavfile); + tw = 1; + zfile_fwrite (&tw, 1, 2, wavfile); + tw = channels; + zfile_fwrite (&tw, 1, 2, wavfile); + tl = freq; + zfile_fwrite (&tl, 1, 4, wavfile); + tl = freq * channels * bits / 8; + zfile_fwrite (&tl, 1, 4, wavfile); + tw = channels * bits / 8; + zfile_fwrite (&tw, 1, 2, wavfile); + tw = bits; + zfile_fwrite (&tw, 1, 2, wavfile); + zfile_fwrite ("data", 1, 4, wavfile); + tl = 0; + if (size) + tl = size - 44; + zfile_fwrite (&tl, 1, 4, wavfile); +} + +static void convertsample(uae_u8 *sample, int len) +{ + int i; + for (i = 0; i < len; i++) + sample[i] += 0x80; +} + +static void namesplit (char *s) +{ + int l; + + l = strlen (s) - 1; + while (l >= 0) { + if (s[l] == '.') + s[l] = 0; + if (s[l] == '\\' || s[l] == '/' || s[l] == ':' || s[l] == '?') { + l++; + break; + } + l--; + } + if (l > 0) + memmove (s, s + l, strlen (s + l) + 1); +} + +void audio_sampleripper(int mode) +{ + struct ripped_sample *rs = ripped_samples; + int cnt = 1; + char path[MAX_DPATH], name[MAX_DPATH], filename[MAX_DPATH]; + char underline[] = "_"; + char extension[4]; + struct zfile *wavfile; + + if (mode < 0) { + while (rs) { + struct ripped_sample *next = rs->next; + xfree(rs); + rs = next; + } + ripped_samples = NULL; + return; + } + + while (rs) { + if (rs->changed) { + rs->changed = 0; + fetch_screenshotpath(path, sizeof (path)); + name[0] = 0; + if (currprefs.dfxtype[0] >= 0) + strcpy (name, currprefs.df[0]); + if (!name[0]) + underline[0] = 0; + namesplit (name); + strcpy(extension, "wav"); + sprintf(filename,"%s%s%s%03.3d.%s", path, name, underline, cnt, extension); + wavfile = zfile_fopen(filename, "wb"); + if (wavfile) { + int freq = rs->per > 0 ? (currprefs.ntscmode ? 3579545 : 3546895 / rs->per) : 8000; + write_wavheader(wavfile, 0, 0); + convertsample(rs->sample, rs->len); + zfile_fwrite(rs->sample, rs->len, 1, wavfile); + convertsample(rs->sample, rs->len); + write_wavheader(wavfile, zfile_ftell(wavfile), freq); + zfile_fclose(wavfile); + write_log("SAMPLERIPPER: %d: %dHz %d bytes\n", cnt, freq, rs->len); + } else { + write_log("SAMPLERIPPER: failed to open '%s'\n", filename); + } + } + cnt++; + rs = rs->next; + } +} + +static void do_samplerip(struct audio_channel_data *adp) +{ + struct ripped_sample *rs = ripped_samples, *prev; + int len = adp->len * 2; + uae_u8 *smp = chipmem_bank.xlateaddr(adp->pt); + int cnt = 0, i; + + if (!smp || !chipmem_bank.check(adp->pt, len)) + return; + for (i = 0; i < len; i++) { + if (smp[i] != 0) + break; + } + if (i == len || len <= 2) + return; + prev = NULL; + while(rs) { + if (rs->sample) { + if (len == rs->len && !memcmp(rs->sample, smp, len)) + break; + /* replace old identical but shorter sample */ + if (len > rs->len && !memcmp(rs->sample, smp, rs->len)) { + xfree(rs->sample); + rs->sample = xmalloc(len); + memcpy(rs->sample, smp, len); + write_log("SAMPLERIPPER: replaced sample %d (%d -> %d)\n", cnt, rs->len, len); + rs->len = len; + rs->per = adp->per / CYCLE_UNIT; + rs->changed = 1; + audio_sampleripper(0); + return; + } + } + prev = rs; + rs = rs->next; + cnt++; + } + if (rs) + return; + rs = xmalloc(sizeof(struct ripped_sample)); + if (prev) + prev->next = rs; + else + ripped_samples = rs; + rs->len = len; + rs->per = adp->per / CYCLE_UNIT; + rs->sample = xmalloc(len); + memcpy(rs->sample, smp, len); + rs->next = NULL; + rs->changed = 1; + write_log("SAMPLERIPPER: sample added (%06.6X, %d bytes), total %d samples\n", adp->pt, len, ++cnt); + audio_sampleripper(0); +} + STATIC_INLINE int current_hpos (void) { return (get_cycles () - eventtab[ev_hsync].oldcycles) / CYCLE_UNIT; @@ -553,6 +728,8 @@ static void state23 (struct audio_channel_data *cdp) cdp->wlen = cdp->len; cdp->pt = cdp->lc; cdp->intreq2 = 1; + if (sampleripper_enabled) + do_samplerip(cdp); #ifdef DEBUG_AUDIO if (debugchannel (cdp - audio_channel)) write_log ("Channel %d looped, LC=%08.8X LEN=%d\n", cdp - audio_channel, cdp->pt, cdp->wlen); @@ -901,6 +1078,8 @@ void audio_hsync (int dmaaction) if (cdp->state == 5) { cdp->pt = cdp->lc; + if (sampleripper_enabled) + do_samplerip(cdp); #ifdef DEBUG_AUDIO if (debugchannel (nr)) write_log ("%d:>5: LEN=%d PT=%08.8X\n", nr, cdp->wlen, cdp->pt); diff --git a/custom.c b/custom.c index eb89d1a1..aad77fa9 100755 --- a/custom.c +++ b/custom.c @@ -2450,6 +2450,8 @@ STATIC_INLINE void COP2LCL (uae_u16 v) { cop2lc = (cop2lc & ~0xffff) | (v & 0xff static void COPJMP (int num) { int was_active = eventtab[ev_copper].active; + int oldstrobe = cop_state.strobe; + eventtab[ev_copper].active = 0; if (was_active) events_schedule (); @@ -2458,12 +2460,17 @@ static void COPJMP (int num) cop_state.state = COP_read1; cop_state.vpos = vpos; cop_state.hpos = current_hpos () & ~1; - cop_state.strobe = num; copper_enabled_thisline = 0; + cop_state.strobe = num; if (dmaen (DMA_COPPER)) { copper_enabled_thisline = 1; set_special (SPCFLAG_COPPER); + } else if (oldstrobe != num) { + /* dma disabled and accessing both COPxJMPs -> copper stops! */ + cop_state.state = COP_stop; + copper_enabled_thisline = 0; + unset_special (SPCFLAG_COPPER); } } @@ -2574,7 +2581,7 @@ int intlev (void) if (currprefs.cachesize) { uae_u16 imask = intreq & intena; if (imask && (intena & 0x4000)) { - if (imask & 0x2000) + if (imask & 0x6000) il = 6; if (imask & 0x1800) il = 5; @@ -4434,19 +4441,21 @@ static void hsync_handler (void) decide_blitter (hpos); memset (cycle_line, 0, MAXHPOS); #if 1 +{ cycle_line[maxhpos - 1] = CYCLE_REFRESH; cycle_line[2] = CYCLE_REFRESH; cycle_line[4] = CYCLE_REFRESH; cycle_line[6] = CYCLE_REFRESH; +} #else { int i; + for (i = 12; i < 0x16; i += 2) + cycle_line[i] = CYCLE_NOCPU; cycle_line[4] = CYCLE_REFRESH; cycle_line[6] = CYCLE_REFRESH; cycle_line[8] = CYCLE_REFRESH; cycle_line[10] = CYCLE_REFRESH; - for (i = 12; i < 0x16; i += 2) - cycle_line[i] = CYCLE_NOCPU; } #endif } diff --git a/debug.c b/debug.c index de406db8..aa2ca77f 100755 --- a/debug.c +++ b/debug.c @@ -105,6 +105,7 @@ static char help[] = { " h,? Show this help page\n" " b Step to previous state capture position\n" " am Enable or disable audio channels\n" + " di [] Break on disk access. R=DMA read,W=write,RW=both,P=PIO\n" " q Quit the emulator. You don't want to use this command.\n\n" }; @@ -169,19 +170,25 @@ static uae_u32 readint (char **c) return val * (negative ? -1 : 1); } -static char next_char( char **c) +static char next_char(char **c) { ignore_ws (c); return *(*c)++; } +static char peek_next_char(char **c) +{ + char *pc = *c; + return pc[1]; +} + static int more_params (char **c) { ignore_ws (c); return (**c) != 0; } -static int next_string (char **c, char *out, int max) +static int next_string (char **c, char *out, int max, int forceupper) { char *p = out; @@ -191,8 +198,10 @@ static int next_string (char **c, char *out, int max) ignore_ws (c); return strlen (out); } - *p++ = next_char (c); - *p = 0; + *p = next_char (c); + if (forceupper) + *p = toupper(*p); + *++p = 0; max--; if (max <= 1) break; @@ -1204,16 +1213,44 @@ static int staterecorder (char **cc) return 0; } +static void disk_debug(char **inptr) +{ + char parm[10]; + int i; + + disk_debug_mode = 0; + disk_debug_track = -1; + ignore_ws(inptr); + if (!next_string (inptr, parm, sizeof (parm), 1)) + goto end; + for (i = 0; i < strlen(parm); i++) { + if (parm[i] == 'R') + disk_debug_mode |= DISK_DEBUG_DMA_READ; + if (parm[i] == 'W') + disk_debug_mode |= DISK_DEBUG_DMA_WRITE; + if (parm[i] == 'P') + disk_debug_mode |= DISK_DEBUG_PIO; + } + if (more_params(inptr)) + disk_debug_track = readint(inptr); + if (disk_debug_track < 0 || disk_debug_track > 2 * 83) + disk_debug_track = -1; +end: + console_out("disk breakpoint mode %c%c%c track %d\n", + disk_debug_mode & DISK_DEBUG_DMA_READ ? 'R' : '-', + disk_debug_mode & DISK_DEBUG_DMA_WRITE ? 'W' : '-', + disk_debug_mode & DISK_DEBUG_PIO ? 'P' : '-', + disk_debug_track); +} + static void m68k_modify (char **inptr) { uae_u32 v; char parm[10]; char c1, c2; - if (!next_string (inptr, parm, sizeof (parm))) + if (!next_string (inptr, parm, sizeof (parm), 1)) return; - for (v = 0; parm[v]; v++) - parm[v] = toupper (parm[v]); c1 = toupper (parm[0]); c2 = toupper (parm[1]); if (c1 == 'A' || c1 == 'D' || c1 == 'P') { @@ -1282,7 +1319,7 @@ static void debug_1 (void) case 'w': memwatch (&inptr); break; case 'S': savemem (&inptr); break; case 's': - if (more_params(&inptr) && next_char(&inptr) == 'c') { + if (*inptr == 'c') { screenshot (1); } else { searchmem (&inptr); @@ -1290,18 +1327,22 @@ static void debug_1 (void) break; case 'd': { - uae_u32 daddr; - int count; - - if (more_params(&inptr)) - daddr = readhex(&inptr); - else - daddr = nxdis; - if (more_params(&inptr)) - count = readhex(&inptr); - else - count = 10; - m68k_disasm (stdout, daddr, &nxdis, count); + if (*inptr == 'i') { + next_char(&inptr); + disk_debug(&inptr); + } else { + uae_u32 daddr; + int count; + if (more_params(&inptr)) + daddr = readhex(&inptr); + else + daddr = nxdis; + if (more_params(&inptr)) + count = readhex(&inptr); + else + count = 10; + m68k_disasm (stdout, daddr, &nxdis, count); + } } break; case 'T': show_exec_tasks (); break; diff --git a/disk.c b/disk.c index 789b6bf0..6370464e 100755 --- a/disk.c +++ b/disk.c @@ -32,6 +32,7 @@ #include "execlib.h" #include "savestate.h" #include "cia.h" +#include "debug.h" #ifdef FDI2RAW #include "fdi2raw.h" #endif @@ -176,6 +177,9 @@ typedef struct { #endif } drive; +int disk_debug_mode; +int disk_debug_track = -1; + #define MIN_STEPLIMIT_CYCLE (CYCLE_UNIT * 150) static uae_u16 bigmfmbufw[0x4000 * DDHDMULT]; @@ -2288,6 +2292,12 @@ static void disk_doupdate_read (drive * drv, int floppybits) #endif } +static void disk_dma_debugmsg(void) +{ + write_dlog ("LEN=%04.4X (%d) SYNC=%04.4X PT=%08.8X ADKCON=%04.4X PC=%08.8X\n", + dsklength, dsklength, (adkcon & 0x400) ? dsksync : 0xffff, dskpt, adkcon, m68k_getpc()); +} + #if 0 /* disk DMA fetch happens on real Amiga at the beginning of next horizontal line (cycles 9, 11 and 13 according to hardware manual) We transfer all DMA'd @@ -2324,6 +2334,22 @@ uae_u16 DSKBYTR (int hpos) #ifdef DISK_DEBUG2 write_dlog ("DSKBYTR=%04.4X hpos=%d\n", v, hpos); #endif + if (disk_debug_mode & DISK_DEBUG_PIO) { + int dr; + for (dr = 0; dr < MAX_FLOPPY_DRIVES; dr++) { + drive *drv = &floppy[dr]; + if (drv->motoroff) + continue; + if (!(selected & (1 << dr))) { + if (disk_debug_track < 0 || disk_debug_track == 2 * drv->cyl + side) { + disk_dma_debugmsg(); + write_log ("DSKBYTR=%04.4X\n", v); + activate_debugger(); + break; + } + } + } + } return v; } @@ -2461,6 +2487,23 @@ void DSKLEN (uae_u16 v, int hpos) DISK_start (); } + if (((disk_debug_mode & DISK_DEBUG_DMA_READ) && dskdmaen == 2) || + ((disk_debug_mode & DISK_DEBUG_DMA_WRITE) && dskdmaen == 3)) + { + for (dr = 0; dr < MAX_FLOPPY_DRIVES; dr++) { + drive *drv = &floppy[dr]; + if (drv->motoroff) + continue; + if (!(selected & (1 << dr))) { + if (disk_debug_track < 0 || disk_debug_track == 2 * drv->cyl + side) { + disk_dma_debugmsg(); + activate_debugger(); + break; + } + } + } + } + #ifdef DISK_DEBUG for (dr = 0; dr < MAX_FLOPPY_DRIVES; dr++) { drive *drv = &floppy[dr]; @@ -2478,8 +2521,7 @@ void DSKLEN (uae_u16 v, int hpos) floppy[dr].cyl * 2 + side, floppy[dr].mfmpos); update_drive_gui (dr); } - write_dlog ("LEN=%04.4X (%d) SYNC=%04.4X PT=%08.8X ADKCON=%04.4X PC=%08.8X\n", - dsklength, dsklength, (adkcon & 0x400) ? dsksync : 0xffff, dskpt, adkcon, m68k_getpc()); + disk_dma_debugmsg(); #endif for (dr = 0; dr < MAX_FLOPPY_DRIVES; dr++) diff --git a/include/audio.h b/include/audio.h index 5ae517d3..39be9fc1 100755 --- a/include/audio.h +++ b/include/audio.h @@ -30,3 +30,6 @@ extern void audio_hsync (int); extern void update_adkmasks (void); extern void update_sound (int freq); +extern void audio_sampleripper(int); +extern int sampleripper_enabled; +extern void write_wavheader (struct zfile *wavfile, uae_u32 size, uae_u32 freq); diff --git a/include/disk.h b/include/disk.h index 73f68f73..60caccc3 100755 --- a/include/disk.h +++ b/include/disk.h @@ -37,3 +37,10 @@ extern void DSKDAT (uae_u16); extern void DSKSYNC (int, uae_u16); extern void DSKPTL (uae_u16); extern void DSKPTH (uae_u16); + +extern int disk_debug_mode; +extern int disk_debug_track; +#define DISK_DEBUG_DMA_READ 1 +#define DISK_DEBUG_DMA_WRITE 2 +#define DISK_DEBUG_PIO 4 + diff --git a/include/memory.h b/include/memory.h index f0ceb0f1..e4bb3b82 100755 --- a/include/memory.h +++ b/include/memory.h @@ -35,7 +35,7 @@ extern uae_u32 allocated_chipmem; extern uae_u32 allocated_fastmem; extern uae_u32 allocated_bogomem; extern uae_u32 allocated_gfxmem; -extern uae_u32 allocated_z3fastmem; +extern uae_u32 allocated_z3fastmem, max_z3fastmem; extern uae_u32 allocated_a3000mem; extern uae_u32 wait_cpu_cycle_read (uaecptr addr, int mode); diff --git a/include/uae.h b/include/uae.h index aa3c239f..6944a7e6 100755 --- a/include/uae.h +++ b/include/uae.h @@ -43,3 +43,4 @@ struct bstring { extern char *colormodes[]; extern void fetch_saveimagepath (char*, int, int); extern void fetch_configurationpath (char *out, int size); +extern void fetch_screenshotpath (char *out, int size); diff --git a/main.c b/main.c index fd271cb1..488f2a09 100755 --- a/main.c +++ b/main.c @@ -145,8 +145,10 @@ void fixup_prefs (struct uae_prefs *p) err = 1; } if ((p->z3fastmem_size & (p->z3fastmem_size - 1)) != 0 - || (p->z3fastmem_size != 0 && (p->z3fastmem_size < 0x100000 || p->z3fastmem_size > 0x20000000))) + || (p->z3fastmem_size != 0 && (p->z3fastmem_size < 0x100000 || p->z3fastmem_size > max_z3fastmem))) { + if (p->z3fastmem_size > max_z3fastmem) + p->z3fastmem_size = max_z3fastmem; p->z3fastmem_size = 0; write_log ("Unsupported Zorro III fastmem size!\n"); err = 1; diff --git a/memory.c b/memory.c index 7428d569..2fe8fbba 100755 --- a/memory.c +++ b/memory.c @@ -44,6 +44,8 @@ uae_u32 allocated_gfxmem; uae_u32 allocated_z3fastmem; uae_u32 allocated_a3000mem; +uae_u32 max_z3fastmem = 512 * 1024 * 1024; + static long chip_filepos; static long bogo_filepos; static long rom_filepos; diff --git a/od-win32/mman.c b/od-win32/mman.c index fa506eca..5e75be28 100755 --- a/od-win32/mman.c +++ b/od-win32/mman.c @@ -17,13 +17,26 @@ static uae_u32 gfxoffs; uae_u32 natmem_offset = 0; -void init_shm( void ) +void init_shm(void) { int i; LPVOID blah = NULL; LPBYTE address = (LPBYTE)0x10000000; // Letting the system decide doesn't seem to work on some systems - int size = 0x19000000; - int add = 0x1000000; + uae_u32 size; + uae_u32 add = 0x11000000; + uae_u32 inc = 0x100000; + MEMORYSTATUS memstats; + + memstats.dwLength = sizeof(memstats); + GlobalMemoryStatus(&memstats); + max_z3fastmem = 16 * 1024 * 1024; + + while ((uae_u64)memstats.dwAvailPageFile + (uae_u64)memstats.dwAvailPhys >= ((uae_u64)max_z3fastmem << 1) + && max_z3fastmem != ((uae_u64)2048 * 1024 * 1024)) + max_z3fastmem <<= 1; + size = max_z3fastmem; + if (size > 512 * 1024 * 1024) + size = 512 * 1024 * 1024; canbang = 0; gfxoffs = 0; @@ -35,30 +48,49 @@ void init_shm( void ) shmids[i].addr = NULL; shmids[i].name[0] = 0; } + for (;;) { + blah = VirtualAlloc(NULL, size + add, MEM_RESERVE, PAGE_EXECUTE_READWRITE); + if (blah) + break; + size >>= 1; + if (size < 0x10000000) { + write_log("NATMEM: No special area could be allocated (2)!\n"); + return; + } + } if (os_winnt) { - natmem_offset = VirtualAlloc(NULL, size, MEM_RESERVE, PAGE_EXECUTE_READWRITE); + natmem_offset = (uae_u32)blah; } else { + VirtualFree(blah, 0, MEM_RELEASE); while (address < (LPBYTE)0xa0000000) { - blah = VirtualAlloc(address, size, MEM_RESERVE, PAGE_EXECUTE_READWRITE); + blah = VirtualAlloc(address, size + add, MEM_RESERVE, PAGE_EXECUTE_READWRITE); if (blah == NULL) { - address += add; + address += inc; } else { VirtualFree (blah, 0, MEM_RELEASE); - address += add * 32; - natmem_offset = (uae_u8*)address; + address += inc * 32; + natmem_offset = (uae_u32)address; break; } } } + if (!natmem_offset) { - write_log("NATMEM: No special area could be allocated!\n"); + write_log("NATMEM: No special area could be allocated! (1)\n"); } else { - write_log("NATMEM: Our special area: 0x%p-0x%p\n", - natmem_offset, (uae_u8*)natmem_offset + size); + max_z3fastmem = size; + write_log("NATMEM: Our special area: 0x%p-0x%p (%dM)\n", + natmem_offset, (uae_u8*)natmem_offset + size + add, (size + add) >> 20); canbang = 1; } + + while (memstats.dwAvailPageFile + memstats.dwAvailPhys < max_z3fastmem) + max_z3fastmem <<= 1; + + write_log("Max Z3FastRAM %dM\n", max_z3fastmem >> 20); } + void mapped_free(uae_u8 *mem) { shmpiece *x = shm_start; @@ -205,7 +237,7 @@ void *shmat(int shmid, LPVOID shmaddr, int shmflg) } #endif - if( ( shmids[shmid].key == shmid ) && shmids[shmid].size ) { + if ((shmids[shmid].key == shmid) && shmids[shmid].size) { got = FALSE; if (got == FALSE) { if (shmaddr) { @@ -213,11 +245,13 @@ void *shmat(int shmid, LPVOID shmaddr, int shmflg) } result = VirtualAlloc(shmaddr, size, os_winnt ? MEM_COMMIT : (MEM_RESERVE | MEM_COMMIT), PAGE_EXECUTE_READWRITE); - if( result == NULL ) { - result = (void *)-1; - write_log ("VirtualAlloc %p %x failed %d\n", shmaddr, size, GetLastError ()); + if (result == NULL) { + result = (void*)-1; + write_log ("VirtualAlloc %p-%p %x (%dk) failed %d\n", shmaddr, (uae_u8*)shmaddr + size, + size, size >> 10, GetLastError()); } else { - shmids[shmid].attached=result; + shmids[shmid].attached = result; + write_log ("VirtualAlloc %p-%p %x (%dk) ok\n", shmaddr, (uae_u8*)shmaddr + size, size, size >> 10); } } else { shmids[shmid].attached = shmaddr; @@ -239,7 +273,7 @@ int shmget(key_t key, size_t size, int shmflg, char *name) if( ( key == IPC_PRIVATE ) || ( ( shmflg & IPC_CREAT ) && ( find_shmkey( key ) == -1) ) ) { - write_log( "shmget of size %d for %s\n", size, name ); + write_log( "shmget of size %d (%dk) for %s\n", size, size >> 10, name ); if( ( result = get_next_shmkey() ) != -1 ) { diff --git a/od-win32/picasso96_win.c b/od-win32/picasso96_win.c index 868b790d..267bb691 100755 --- a/od-win32/picasso96_win.c +++ b/od-win32/picasso96_win.c @@ -2679,7 +2679,7 @@ uae_u32 picasso_BlitTemplate (void) special_mem|=picasso_is_special_read|picasso_is_special; #ifdef LOCK_UNLOCK_MADNESS - PICASSO96_Unlock(); // @@@ We need to unlock here, because do_blit (later) needs to lock... + //PICASSO96_Unlock(); // @@@ We need to unlock here, because do_blit (later) needs to lock... #else wgfx_flushline (); #endif diff --git a/od-win32/resources/resource.h b/od-win32/resources/resource.h index 22d09a19..05234511 100755 --- a/od-win32/resources/resource.h +++ b/od-win32/resources/resource.h @@ -21,6 +21,7 @@ #define IDS_MISC2 16 #define IDS_PATHS 17 #define IDS_QUICKSTART 18 +#define IDS_FRONTEND 19 #define IDS_EXTTEXT 100 #define IDS_EXTACTUAL 101 #define IDS_SOUND 102 @@ -215,6 +216,10 @@ #define IDS_SELECTFS 244 #define IDS_KEYJOY 245 #define IDB_XARCADE 246 +#define IDS_STATEFILE_UNCOMPRESSED 246 +#define IDS_STATEFILE_RAMDUMP 247 +#define IDS_STATEFILE_WAVE 248 +#define IDD_FRONTEND 249 #define IDS_NUMSG_NEEDEXT2 300 #define IDS_NUMSG_NOROMKEY 301 #define IDS_NUMSG_KSROMCRCERROR 302 @@ -645,6 +650,7 @@ #define IDC_OPENGLHZ 1616 #define IDC_INPUTAMIGACNT 1616 #define IDC_FILTERHZ 1616 +#define IDC_SAMPLERIPPER_ACTIVATED 1616 #define IDC_AVIOUTPUT_BORDER_TRIM 1617 #define IDC_OPENGLVZ 1617 #define IDC_FILTERVZ 1617 @@ -806,6 +812,10 @@ #define IDC_PRINTERAUTOFLUSH 1697 #define IDC_PRINTERAUTOFLUSHTXT 1698 #define IDC_DISKTEXT 1699 +#define IDC_FE_LIST 1700 +#define IDC_FE_INFO 1701 +#define IDC_FE_INFO2 1702 +#define IDC_FE_SCREENSHOT 1702 #define ID__FLOPPYDRIVES 40004 #define ID_FLOPPYDRIVES_DF0 40005 #define ID_ST_CONFIGURATION 40010 @@ -824,9 +834,9 @@ #ifndef APSTUDIO_READONLY_SYMBOLS #define _APS_NO_MFC 1 #define _APS_3D_CONTROLS 1 -#define _APS_NEXT_RESOURCE_VALUE 247 +#define _APS_NEXT_RESOURCE_VALUE 249 #define _APS_NEXT_COMMAND_VALUE 40021 -#define _APS_NEXT_CONTROL_VALUE 1700 +#define _APS_NEXT_CONTROL_VALUE 1703 #define _APS_NEXT_SYMED_VALUE 101 #endif #endif diff --git a/od-win32/resources/winuae.rc b/od-win32/resources/winuae.rc index 8c05ae72..32481f25 100755 --- a/od-win32/resources/winuae.rc +++ b/od-win32/resources/winuae.rc @@ -682,7 +682,7 @@ BEGIN BS_AUTORADIOBUTTON | WS_TABSTOP,39,197,95,10 END -IDD_AVIOUTPUT DIALOGEX 0, 0, 197, 210 +IDD_AVIOUTPUT DIALOGEX 0, 0, 197, 233 STYLE DS_SETFONT | DS_CONTROL | WS_CHILD FONT 8, "MS Sans Serif", 0, 0, 0x1 BEGIN @@ -712,9 +712,11 @@ BEGIN TBS_NOTICKS | TBS_ENABLESELRANGE | WS_TABSTOP,21,137,120, 11 LTEXT "fps",IDC_AVIOUTPUT_FPS_STATIC,148,138,23,8 - PUSHBUTTON "Save Screenshot",IDC_SCREENSHOT,15,176,95,14 - GROUPBOX "Ripper",IDC_STATIC,5,160,184,41 - PUSHBUTTON "Pro Wizard",IDC_PROWIZARD,127,176,49,14,WS_DISABLED + PUSHBUTTON "Save Screenshot",IDC_SCREENSHOT,15,176,85,14 + GROUPBOX "Ripper",IDC_STATIC,5,160,184,63 + PUSHBUTTON "Pro Wizard",IDC_PROWIZARD,112,176,69,14,WS_DISABLED + CONTROL "Sampleripper",IDC_SAMPLERIPPER_ACTIVATED,"Button", + BS_AUTORADIOBUTTON | BS_PUSHLIKE | BS_FLAT,15,198,84,14 END IDD_INPUT DIALOGEX 0, 0, 300, 242 @@ -956,6 +958,17 @@ BEGIN BS_AUTOCHECKBOX | BS_LEFT | WS_TABSTOP,199,222,94,10 END +IDD_FRONTEND DIALOGEX 0, 0, 420, 242 +STYLE DS_SETFONT | DS_3DLOOK | DS_CONTROL | WS_CHILD +FONT 8, "MS Sans Serif", 0, 0, 0x1 +BEGIN + CONTROL "",IDC_FE_LIST,"SysListView32",LVS_REPORT | + LVS_SINGLESEL | LVS_SHOWSELALWAYS | LVS_ALIGNLEFT | + LVS_NOSORTHEADER | WS_BORDER | WS_TABSTOP,6,9,235,124 + GROUPBOX "",IDC_FE_INFO,249,140,160,95 + GROUPBOX "",IDC_FE_SCREENSHOT,249,7,160,128 +END + #ifdef APSTUDIO_INVOKED ///////////////////////////////////////////////////////////////////////////// @@ -1097,12 +1110,6 @@ BEGIN BOTTOMMARGIN, 187 END - IDD_PANEL, DIALOG - BEGIN - LEFTMARGIN, 7 - TOPMARGIN, 7 - END - IDD_QUICKSTART, DIALOG BEGIN RIGHTMARGIN, 299 @@ -1190,6 +1197,7 @@ BEGIN IDS_MISC2 "Priority" IDS_PATHS "Paths" IDS_QUICKSTART "Quickstart" + IDS_FRONTEND "Frontend" END STRINGTABLE @@ -1368,6 +1376,9 @@ BEGIN IDS_HF_FS_CUSTOM "Custom" IDS_SELECTFS "Select filesystem handler (FastFileSystem, SmartFilesystem,...)" IDS_KEYJOY "Keyboard Layout A (Numeric keypad, 0 and 5 = fire)\nKeyboard Layout B (Cursor keys, right CTRL and ALT = fire)\nKeyboard Layout C (T=up B=down F=left H=right, left ALT = fire)\nX-Arcade (Left)\nX-Arcade (Right)" + IDS_STATEFILE_UNCOMPRESSED "Uncompressed" + IDS_STATEFILE_RAMDUMP "RAM dump" + IDS_STATEFILE_WAVE "Wave audio dump" END STRINGTABLE diff --git a/od-win32/win32.c b/od-win32/win32.c index 0a9f525f..32111ca5 100755 --- a/od-win32/win32.c +++ b/od-win32/win32.c @@ -108,7 +108,7 @@ static int timermode, timeon; static HANDLE timehandle; char *start_path; -char help_file[ MAX_DPATH ]; +char help_file[MAX_DPATH]; extern int harddrive_dangerous, do_rdbdump, aspi_allow_all, no_rawinput; int log_scsi; @@ -331,7 +331,7 @@ static int figure_processor_speed (void) write_log("\n"); } - SetThreadPriority ( GetCurrentThread(), THREAD_PRIORITY_NORMAL); + SetThreadPriority(GetCurrentThread(), THREAD_PRIORITY_NORMAL); dummythread_die = 1; sleep_resolution = 1; @@ -1777,6 +1777,10 @@ void fetch_configurationpath (char *out, int size) { fetch_path ("ConfigurationPath", out, size); } +void fetch_screenshotpath (char *out, int size) +{ + fetch_path ("ScreenshotPath", out, size); +} static void strip_slashes (char *p) { @@ -2134,7 +2138,7 @@ static int osdetect (void) pGetNativeSystemInfo = (PGETNATIVESYSTEMINFO)GetProcAddress( GetModuleHandle("kernel32.dll"), "GetNativeSystemInfo"); - GetNativeSystemInfo(&SystemInfo); + GetSystemInfo(&SystemInfo); if (pGetNativeSystemInfo) pGetNativeSystemInfo(&SystemInfo); osVersion.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); @@ -2143,9 +2147,9 @@ static int osdetect (void) (osVersion.dwMajorVersion <= 4)) { /* WinUAE not supported on this version of Windows... */ - char szWrongOSVersion[ MAX_DPATH ]; - WIN32GUI_LoadUIString( IDS_WRONGOSVERSION, szWrongOSVersion, MAX_DPATH ); - pre_gui_message( szWrongOSVersion ); + char szWrongOSVersion[MAX_DPATH]; + WIN32GUI_LoadUIString(IDS_WRONGOSVERSION, szWrongOSVersion, MAX_DPATH); + pre_gui_message(szWrongOSVersion); return FALSE; } if (osVersion.dwPlatformId == VER_PLATFORM_WIN32_NT) diff --git a/od-win32/win32.h b/od-win32/win32.h index 6d25d480..c48a2d2b 100755 --- a/od-win32/win32.h +++ b/od-win32/win32.h @@ -22,7 +22,7 @@ extern int manual_palette_refresh_needed; extern int mouseactive, focus; extern int ignore_messages_all; #define WINUAEBETA 1 -#define WINUAEBETASTR " Beta 5" +#define WINUAEBETASTR " Beta 6" extern void my_kbd_handler (int, int, int); extern void clearallkeys(void); diff --git a/od-win32/win32gfx.c b/od-win32/win32gfx.c index adad967c..74252414 100755 --- a/od-win32/win32gfx.c +++ b/od-win32/win32gfx.c @@ -986,6 +986,7 @@ static int open_windows (void) ret = doInit (); } while (ret < 0); + setpriority(&priorities[currprefs.win32_active_priority]); setmouseactive (1); for (i = 0; i < NUM_LEDS; i++) gui_led (i, 0); diff --git a/od-win32/win32gui.c b/od-win32/win32gui.c index 4ea57909..d0accb98 100755 --- a/od-win32/win32gui.c +++ b/od-win32/win32gui.c @@ -7,6 +7,8 @@ * ***************************************************************************/ +#define FRONTEND 0 + #include #include #include @@ -45,6 +47,7 @@ #include "keyboard.h" #include "zfile.h" #include "parallel.h" +#include "audio.h" #include "dxwrap.h" #include "win32.h" @@ -113,7 +116,7 @@ static int C_PAGES; static int LOADSAVE_ID = -1, MEMORY_ID = -1, KICKSTART_ID = -1, CPU_ID = -1, DISPLAY_ID = -1, HW3D_ID = -1, CHIPSET_ID = -1, SOUND_ID = -1, FLOPPY_ID = -1, DISK_ID = -1, HARDDISK_ID = -1, PORTS_ID = -1, INPUT_ID = -1, MISC1_ID = -1, MISC2_ID = -1, AVIOUTPUT_ID = -1, - PATHS_ID = -1, QUICKSTART_ID = -1, ABOUT_ID = -1; + PATHS_ID = -1, QUICKSTART_ID = -1, ABOUT_ID = -1, FRONTEND_ID = -1; static HWND pages[MAX_C_PAGES]; #define MAX_IMAGETOOLTIPS 10 static HWND guiDlg, panelDlg, ToolTipHWND; @@ -717,12 +720,12 @@ void gui_display( int shortcut ) savestate_state = 0; } } else if (shortcut >= 0 && shortcut < 4) { - DiskSelection (hAmigaWnd, IDC_DF0+shortcut, 0, &changed_prefs, 0); + DiskSelection(hAmigaWnd, IDC_DF0+shortcut, 0, &changed_prefs, 0); } else if (shortcut == 5) { - if (DiskSelection (hAmigaWnd, IDC_DOSAVESTATE, 9, &changed_prefs, 0)) + if (DiskSelection(hAmigaWnd, IDC_DOSAVESTATE, 9, &changed_prefs, 0)) save_state (savestate_fname, "Description!"); } else if (shortcut == 4) { - if (DiskSelection (hAmigaWnd, IDC_DOLOADSTATE, 10, &changed_prefs, 0)) + if (DiskSelection(hAmigaWnd, IDC_DOLOADSTATE, 10, &changed_prefs, 0)) savestate_state = STATE_DORESTORE; } manual_painting_needed--; /* So that WM_PAINT doesn't need to use custom refreshing */ @@ -926,25 +929,36 @@ int DiskSelection_2 (HWND hDlg, WPARAM wParam, int flag, struct uae_prefs *prefs break; case 9: case 10: - WIN32GUI_LoadUIString( flag == 10 ? IDS_RESTOREUSS : IDS_SAVEUSS, szTitle, MAX_DPATH ); - WIN32GUI_LoadUIString( IDS_USS, szFormat, MAX_DPATH ); + WIN32GUI_LoadUIString(flag == 10 ? IDS_RESTOREUSS : IDS_SAVEUSS, szTitle, MAX_DPATH); + WIN32GUI_LoadUIString(IDS_USS, szFormat, MAX_DPATH); sprintf( szFilter, "%s ", szFormat ); if (flag == 10) { - memcpy( szFilter + strlen( szFilter ), USS_FORMAT_STRING_RESTORE, sizeof (USS_FORMAT_STRING_RESTORE) + 1); + memcpy(szFilter + strlen(szFilter), USS_FORMAT_STRING_RESTORE, sizeof (USS_FORMAT_STRING_RESTORE) + 1); all = 1; } else { - memcpy( szFilter + strlen( szFilter ), USS_FORMAT_STRING_SAVE, sizeof (USS_FORMAT_STRING_SAVE) + 1); + char tmp[MAX_DPATH]; + memcpy(szFilter + strlen(szFilter), USS_FORMAT_STRING_SAVE, sizeof (USS_FORMAT_STRING_SAVE) + 1); p = szFilter; while (p[0] != 0 || p[1] !=0 ) p++; p++; - strcpy (p, "Uncompressed (*.uss)"); + WIN32GUI_LoadUIString(IDS_STATEFILE_UNCOMPRESSED, tmp, sizeof(tmp)); + strcat(p, tmp); + strcat(p, " (*.uss"); p += strlen(p) + 1; - strcpy (p, "*.uss"); + strcpy(p, "*.uss"); p += strlen(p) + 1; - strcpy (p, "RAM dump (*.dat)"); + WIN32GUI_LoadUIString(IDS_STATEFILE_RAMDUMP, tmp, sizeof(tmp)); + strcat(p, tmp); + strcat(p, " (*.dat)"); p += strlen(p) + 1; strcpy (p, "*.dat"); p += strlen(p) + 1; + WIN32GUI_LoadUIString(IDS_STATEFILE_WAVE, tmp, sizeof(tmp)); + strcat(p, tmp); + strcat(p, " (*.wav)"); + p += strlen(p) + 1; + strcpy (p, "*.wav"); + p += strlen(p) + 1; *p = 0; all = 0; } @@ -1085,10 +1099,10 @@ int DiskSelection_2 (HWND hDlg, WPARAM wParam, int flag, struct uae_prefs *prefs savestate_initsave (full_path, openFileName.nFilterIndex); break; case IDC_CREATE: - disk_creatediskfile( full_path, 0, SendDlgItemMessage( hDlg, IDC_FLOPPYTYPE, CB_GETCURSEL, 0, 0L )); + disk_creatediskfile(full_path, 0, SendDlgItemMessage(hDlg, IDC_FLOPPYTYPE, CB_GETCURSEL, 0, 0L)); break; case IDC_CREATE_RAW: - disk_creatediskfile( full_path, 1, SendDlgItemMessage( hDlg, IDC_FLOPPYTYPE, CB_GETCURSEL, 0, 0L )); + disk_creatediskfile(full_path, 1, SendDlgItemMessage(hDlg, IDC_FLOPPYTYPE, CB_GETCURSEL, 0, 0L)); break; case IDC_LOAD: if (target_cfgfile_load(&workprefs, full_path, 0, 0) == 0) { @@ -1140,11 +1154,11 @@ int DiskSelection_2 (HWND hDlg, WPARAM wParam, int flag, struct uae_prefs *prefs } return result; } -int DiskSelection (HWND hDlg, WPARAM wParam, int flag, struct uae_prefs *prefs, char *path_out) +int DiskSelection(HWND hDlg, WPARAM wParam, int flag, struct uae_prefs *prefs, char *path_out) { return DiskSelection_2 (hDlg, wParam, flag, prefs, path_out, NULL); } -int MultiDiskSelection (HWND hDlg, WPARAM wParam, int flag, struct uae_prefs *prefs, char *path_out) +int MultiDiskSelection(HWND hDlg, WPARAM wParam, int flag, struct uae_prefs *prefs, char *path_out) { int multi = 0; return DiskSelection_2 (hDlg, wParam, flag, prefs, path_out, &multi); @@ -1243,6 +1257,7 @@ static const char *memsize_names[] = { /* 13*/ "1 GB", /* 14*/ "1.5MB", /* 15*/ "1.8MB", +/* 16*/ "2 GB", }; static unsigned long memsizes[] = { @@ -1262,12 +1277,13 @@ static unsigned long memsizes[] = { /* 13*/ 0x40000000, //1GB /* 14*/ 0x00180000, //1.5MB /* 15*/ 0x001C0000, //1.8MB +/* 16*/ 0x80000000, //2GB }; static int msi_chip[] = { 1, 2, 3, 4, 5, 6 }; static int msi_bogo[] = { 0, 2, 3, 14, 15 }; static int msi_fast[] = { 0, 3, 4, 5, 6 }; -static int msi_z3fast[] = { 0, 3, 4, 5, 6, 7, 8, 9, 10,11,12,13 }; +static int msi_z3fast[] = { 0, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 16 }; static int msi_gfx[] = { 0, 3, 4, 5, 6,7,8}; static int CalculateHardfileSize (HWND hDlg) @@ -1469,12 +1485,12 @@ static char *HandleConfiguration (HWND hDlg, int flag, struct ConfigStruct *conf switch (flag) { case CONFIG_SAVE_FULL: - DiskSelection( hDlg, IDC_SAVE, 5, &workprefs, 0); + DiskSelection(hDlg, IDC_SAVE, 5, &workprefs, 0); break; case CONFIG_LOAD_FULL: - DiskSelection (hDlg, IDC_LOAD, 4, &workprefs, 0); - EnableWindow (GetDlgItem (hDlg, IDC_VIEWINFO), workprefs.info[0]); + DiskSelection(hDlg, IDC_LOAD, 4, &workprefs, 0); + EnableWindow(GetDlgItem (hDlg, IDC_VIEWINFO), workprefs.info[0]); break; case CONFIG_SAVE: @@ -3890,6 +3906,7 @@ static void values_to_memorydlg (HWND hDlg) case 0x10000000: mem_size = 9; break; /* 256-megs */ case 0x20000000: mem_size = 10; break; /* 512-megs */ case 0x40000000: mem_size = 11; break; /* 1 GB */ + case 0x80000000: mem_size = 12; break; /* 2 GB */ } SendDlgItemMessage (hDlg, IDC_Z3FASTMEM, TBM_SETPOS, TRUE, mem_size); @@ -3920,8 +3937,6 @@ static void fix_values_memorydlg (void) static BOOL CALLBACK MemoryDlgProc (HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam) { static int recursive = 0; - unsigned int max_z3_mem = MAX_Z3_MEM; - MEMORYSTATUS memstats; switch (msg) { @@ -3929,15 +3944,10 @@ static BOOL CALLBACK MemoryDlgProc (HWND hDlg, UINT msg, WPARAM wParam, LPARAM l pages[MEMORY_ID] = hDlg; currentpage = MEMORY_ID; - memstats.dwLength = sizeof( memstats ); - GlobalMemoryStatus( &memstats ); - while( ( memstats.dwAvailPageFile + memstats.dwAvailPhys - 32000000) < (DWORD)( 1 << (max_z3_mem + 19) ) ) - max_z3_mem--; - SendDlgItemMessage (hDlg, IDC_CHIPMEM, TBM_SETRANGE, TRUE, MAKELONG (MIN_CHIP_MEM, MAX_CHIP_MEM)); SendDlgItemMessage (hDlg, IDC_FASTMEM, TBM_SETRANGE, TRUE, MAKELONG (MIN_FAST_MEM, MAX_FAST_MEM)); SendDlgItemMessage (hDlg, IDC_SLOWMEM, TBM_SETRANGE, TRUE, MAKELONG (MIN_SLOW_MEM, MAX_SLOW_MEM)); - SendDlgItemMessage (hDlg, IDC_Z3FASTMEM, TBM_SETRANGE, TRUE, MAKELONG (MIN_Z3_MEM, max_z3_mem)); + SendDlgItemMessage (hDlg, IDC_Z3FASTMEM, TBM_SETRANGE, TRUE, MAKELONG (MIN_Z3_MEM, MAX_Z3_MEM)); SendDlgItemMessage (hDlg, IDC_P96MEM, TBM_SETRANGE, TRUE, MAKELONG (MIN_P96_MEM, MAX_P96_MEM)); case WM_USER: @@ -4126,17 +4136,17 @@ static BOOL CALLBACK KickstartDlgProc (HWND hDlg, UINT msg, WPARAM wParam, LPARA switch (LOWORD (wParam)) { case IDC_KICKCHOOSER: - DiskSelection( hDlg, IDC_ROMFILE, 6, &workprefs, 0); + DiskSelection(hDlg, IDC_ROMFILE, 6, &workprefs, 0); values_to_kickstartdlg (hDlg); break; case IDC_ROMCHOOSER2: - DiskSelection( hDlg, IDC_ROMFILE2, 6, &workprefs, 0); + DiskSelection(hDlg, IDC_ROMFILE2, 6, &workprefs, 0); values_to_kickstartdlg (hDlg); break; case IDC_FLASHCHOOSER: - DiskSelection( hDlg, IDC_FLASHFILE, 11, &workprefs, 0); + DiskSelection(hDlg, IDC_FLASHFILE, 11, &workprefs, 0); values_to_kickstartdlg (hDlg); break; case IDC_FLASHFILE: @@ -4145,7 +4155,7 @@ static BOOL CALLBACK KickstartDlgProc (HWND hDlg, UINT msg, WPARAM wParam, LPARA break; case IDC_CARTCHOOSER: - DiskSelection( hDlg, IDC_CARTFILE, 6, &workprefs, 0); + DiskSelection(hDlg, IDC_CARTFILE, 6, &workprefs, 0); values_to_kickstartdlg (hDlg); break; @@ -4355,11 +4365,11 @@ static BOOL MiscDlgProc (HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam) switch( wParam ) { case IDC_DOSAVESTATE: - if (DiskSelection( hDlg, wParam, 9, &workprefs, 0)) + if (DiskSelection(hDlg, wParam, 9, &workprefs, 0)) save_state (savestate_fname, "Description!"); break; case IDC_DOLOADSTATE: - if (DiskSelection( hDlg, wParam, 10, &workprefs, 0)) + if (DiskSelection(hDlg, wParam, 10, &workprefs, 0)) savestate_state = STATE_DORESTORE; break; case IDC_STATE_CAPTURE: @@ -6123,7 +6133,7 @@ static BOOL CALLBACK FloppyDlgProc (HWND hDlg, UINT msg, WPARAM wParam, LPARAM l DiskSelection (hDlg, wParam, 1, &workprefs, 0); break; case IDC_CREATE_RAW: - DiskSelection( hDlg, wParam, 1, &workprefs, 0); + DiskSelection(hDlg, wParam, 1, &workprefs, 0); break; } recursive--; @@ -7699,6 +7709,7 @@ static void values_to_avioutputdlg(HWND hDlg) CheckDlgButton (hDlg, IDC_AVIOUTPUT_FRAMELIMITER, avioutput_framelimiter ? FALSE : TRUE); CheckDlgButton (hDlg, IDC_AVIOUTPUT_ACTIVATED, avioutput_requested ? BST_CHECKED : BST_UNCHECKED); + CheckDlgButton (hDlg, IDC_SAMPLERIPPER_ACTIVATED, sampleripper_enabled ? BST_CHECKED : BST_UNCHECKED); } static void values_from_avioutputdlg(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam) @@ -7817,6 +7828,11 @@ static BOOL CALLBACK AVIOutputDlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM moduleripper (); break; #endif + case IDC_SAMPLERIPPER_ACTIVATED: + sampleripper_enabled = sampleripper_enabled ? 0 : 1; + audio_sampleripper(-1); + break; + case IDC_AVIOUTPUT_ACTIVATED: avioutput_requested = !avioutput_requested; SendMessage(hDlg, WM_HSCROLL, (WPARAM) NULL, (LPARAM) NULL); @@ -7944,6 +7960,7 @@ struct GUIPAGE { int idx; const char *help; HACCEL accel; + int fullpanel; }; static int GetPanelRect (HWND hDlg, RECT *r) @@ -8106,6 +8123,7 @@ static HWND updatePanel (HWND hDlg, int id) static HWND hwndTT; RECT r1c, r1w, r2c, r2w, r3c, r3w; int w, h, pw, ph, x , y, i; + int fullpanel; EnableWindow (GetDlgItem (guiDlg, IDC_RESETAMIGA), full_property_sheet ? FALSE : TRUE); EnableWindow (GetDlgItem (guiDlg, IDOK), TRUE); @@ -8139,6 +8157,7 @@ static HWND updatePanel (HWND hDlg, int id) return NULL; } + fullpanel = ppage[id].fullpanel; GetWindowRect (GetDlgItem (hDlg, IDC_PANEL_FRAME), &r1w); GetClientRect (GetDlgItem (hDlg, IDC_PANEL_FRAME), &r1c); GetWindowRect (hDlg, &r2w); @@ -8160,8 +8179,13 @@ static HWND updatePanel (HWND hDlg, int id) GetClientRect (panelDlg, &r3c); x -= r3w.left - r2w.left - 1; y -= r3w.top - r2w.top - 1; - SetWindowPos (panelDlg, HWND_TOP, x + (pw - w) / 2, y + (ph - h) / 2, 0, 0, - SWP_NOSIZE | SWP_NOOWNERZORDER); + if (!fullpanel) { + SetWindowPos (panelDlg, HWND_TOP, x + (pw - w) / 2, y + (ph - h) / 2, 0, 0, + SWP_NOSIZE | SWP_NOOWNERZORDER); + } + ShowWindow(GetDlgItem(hDlg, IDC_PANEL_FRAME), FALSE); + ShowWindow(GetDlgItem(hDlg, IDC_PANEL_FRAME_OUTER), !fullpanel); + ShowWindow(GetDlgItem(hDlg, IDC_PANELTREE), !fullpanel); ShowWindow (panelDlg, TRUE); EnableWindow (GetDlgItem (hDlg, IDHELP), pHtmlHelp && ppage[currentpage].help ? TRUE : FALSE); @@ -8252,6 +8276,9 @@ static void createTreeView (HWND hDlg, int currentpage) CN(PATHS_ID); CN(QUICKSTART_ID); CN(LOADSAVE_ID); +#if FRONTEND == 1 + CN(FRONTEND_ID); +#endif p = CreateFolderNode (TVhDlg, IDS_TREEVIEW_HARDWARE, root, LOADSAVE_ID, CONFIG_TYPE_HARDWARE); CN(CPU_ID); @@ -8541,6 +8568,8 @@ static int init_page (int tmpl, int icon, int title, accels = EmptyAccel; while (accels[++i].key); ppage[id].accel = CreateAcceleratorTable (accels, i); + if (tmpl == IDD_FRONTEND) + ppage[id].fullpanel = TRUE; id++; return id - 1; } @@ -8588,7 +8617,8 @@ static int GetSettings (int all_options, HWND hwnd) PATHS_ID = init_page (IDD_PATHS, IDI_PATHS, IDS_PATHS, PathsDlgProc, NULL, "gui/paths.htm"); QUICKSTART_ID = init_page (IDD_QUICKSTART, IDI_QUICKSTART, IDS_QUICKSTART, QuickstartDlgProc, NULL, "gui/quickstart.htm"); ABOUT_ID = init_page (IDD_ABOUT, IDI_ABOUT, IDS_ABOUT, AboutDlgProc, NULL, NULL); - C_PAGES = ABOUT_ID + 1; + FRONTEND_ID = init_page (IDD_FRONTEND, IDI_QUICKSTART, IDS_FRONTEND, AboutDlgProc, NULL, NULL); + C_PAGES = FRONTEND_ID + 1; init_called = 1; if (quickstart && !qs_override) currentpage = QUICKSTART_ID; diff --git a/savestate.c b/savestate.c index c0ce13fa..963efdab 100755 --- a/savestate.c +++ b/savestate.c @@ -58,6 +58,7 @@ #include "savestate.h" #include "uae.h" #include "gui.h" +#include "audio.h" int savestate_state = 0; @@ -74,7 +75,7 @@ static int frameextra; struct zfile *savestate_file; static uae_u8 *replaybuffer, *replaybufferend; -static int savestate_docompress, savestate_ramdump; +static int savestate_docompress, savestate_specialdump; static int replaybuffersize; char savestate_fname[MAX_DPATH]; @@ -479,12 +480,12 @@ void savestate_restore_finish (void) savestate_state = 0; } -/* 1=compressed,2=not compressed,3=ram dump */ +/* 1=compressed,2=not compressed,3=ram dump,4=audio dump */ void savestate_initsave (char *filename, int mode) { strcpy (savestate_fname, filename); savestate_docompress = (mode == 1) ? 1 : 0; - savestate_ramdump = (mode == 3) ? 1 : 0; + savestate_specialdump = (mode == 3) ? 1 : (mode == 4) ? 2 : 0; } static void save_rams (struct zfile *f, int comp) @@ -532,11 +533,28 @@ void save_state (char *filename, char *description) custom_prepare_savestate (); - f = zfile_fopen (filename, "wb"); + f = zfile_fopen (filename, "w+b"); if (!f) return; - if (savestate_ramdump) { + if (savestate_specialdump) { + size_t pos; + if (savestate_specialdump == 2) + write_wavheader(f, 0, 22050); + pos = zfile_ftell(f); save_rams (f, -1); + if (savestate_specialdump == 2) { + int len, len2, i; + uae_u8 *tmp; + len = zfile_ftell(f) - pos; + tmp = xmalloc(len); + zfile_fseek(f, pos, SEEK_SET); + len2 = zfile_fread(tmp, 1, len, f); + for (i = 0; i < len2; i++) + tmp[i] += 0x80; + write_wavheader(f, len, 22050); + zfile_fwrite(tmp, len2, 1, f); + xfree(tmp); + } zfile_fclose (f); return; }