From: Toni Wilen Date: Tue, 10 Aug 2010 16:02:23 +0000 (+0300) Subject: 2300b10 X-Git-Tag: 2300~12 X-Git-Url: https://git.unchartedbackwaters.co.uk/w/?a=commitdiff_plain;h=af64578505f9e9a348ab65680cfa445f8c61df0f;p=francis%2Fwinuae.git 2300b10 --- diff --git a/a2091.cpp b/a2091.cpp index 2a07e7af..9b1a6534 100644 --- a/a2091.cpp +++ b/a2091.cpp @@ -1197,9 +1197,9 @@ static void freescsi (struct scsi_data *sd) scsi_free (sd); } -int addscsi (int ch, TCHAR *path, int blocksize, int readonly, - TCHAR *devname, int sectors, int surfaces, int reserved, - int bootpri, TCHAR *filesys, int scsi_level) +int addscsi (int ch, const TCHAR *path, int blocksize, int readonly, + const TCHAR *devname, int sectors, int surfaces, int reserved, + int bootpri, const TCHAR *filesys, int scsi_level) { struct hd_hardfiledata *hfd; @@ -1269,9 +1269,9 @@ static void addnativescsi (void) } } -int a3000_add_scsi_unit (int ch, TCHAR *path, int blocksize, int readonly, - TCHAR *devname, int sectors, int surfaces, int reserved, - int bootpri, TCHAR *filesys) +int a3000_add_scsi_unit (int ch, const TCHAR *path, int blocksize, int readonly, + const TCHAR *devname, int sectors, int surfaces, int reserved, + int bootpri, const TCHAR *filesys) { return addscsi (ch, path, blocksize, readonly, devname, sectors, surfaces, reserved, bootpri, filesys, 2); } @@ -1286,9 +1286,9 @@ void a3000scsi_free (void) freenativescsi (); } -int a2091_add_scsi_unit (int ch, TCHAR *path, int blocksize, int readonly, - TCHAR *devname, int sectors, int surfaces, int reserved, - int bootpri, TCHAR *filesys) +int a2091_add_scsi_unit (int ch, const TCHAR *path, int blocksize, int readonly, + const TCHAR *devname, int sectors, int surfaces, int reserved, + int bootpri, const TCHAR *filesys) { return addscsi (ch, path, blocksize, readonly, devname, sectors, surfaces, reserved, bootpri, filesys, 1); } diff --git a/archivers/zip/unzip.cpp b/archivers/zip/unzip.cpp index 6c28b8d6..c85ed4c5 100644 --- a/archivers/zip/unzip.cpp +++ b/archivers/zip/unzip.cpp @@ -374,8 +374,11 @@ extern unzFile ZEXPORT unzOpen (struct zfile *fin) if (unzlocal_getShort(fin,&number_entry_CD)!=UNZ_OK) err=UNZ_ERRNO; - if ((number_entry_CD!=us.gi.number_entry) || - (number_disk_with_CD!=0) || +// if ((number_entry_CD!=us.gi.number_entry) || +// (number_disk_with_CD!=0) || +// (number_disk!=0)) +// err=UNZ_BADZIPFILE; + if ((number_disk_with_CD!=0) || (number_disk!=0)) err=UNZ_BADZIPFILE; @@ -791,11 +794,11 @@ local int unzlocal_CheckCurrentFileCoherencyHeader (unz_s *s, uInt *piSizeVar, err=UNZ_ERRNO; else if ((err==UNZ_OK) && (uData!=s->cur_file_info.compression_method)) err=UNZ_BADZIPFILE; - +/* if ((err==UNZ_OK) && (s->cur_file_info.compression_method!=0) && - (s->cur_file_info.compression_method!=Z_DEFLATED)) - err=UNZ_BADZIPFILE; - + (s->cur_file_info.compression_method!=Z_DEFLATED && s->cur_file_info.compression_method!=ZIP_BZIP2)) + err=UNZ_BADZIPFILE; +*/ if (unzlocal_getLong(s->file,&uData) != UNZ_OK) /* date/time */ err=UNZ_ERRNO; @@ -882,8 +885,10 @@ extern int ZEXPORT unzOpenCurrentFile (unzFile file) pfile_in_zip_read_info->stream_initialised=0; if ((s->cur_file_info.compression_method!=0) && - (s->cur_file_info.compression_method!=Z_DEFLATED)) + (s->cur_file_info.compression_method!=Z_DEFLATED)) { + write_log (L"ZIP: unknown compression method %d\n", s->cur_file_info.compression_method); err=UNZ_BADZIPFILE; + } Store = s->cur_file_info.compression_method==0; pfile_in_zip_read_info->crc32_wait=s->cur_file_info.crc; diff --git a/archivers/zip/unzip.h b/archivers/zip/unzip.h index ecd2b82c..73882a2c 100644 --- a/archivers/zip/unzip.h +++ b/archivers/zip/unzip.h @@ -68,6 +68,8 @@ typedef voidp unzFile; #endif +#define ZIP_BZIP2 12 + #define UNZ_OK (0) #define UNZ_END_OF_LIST_OF_FILE (-100) #define UNZ_ERRNO (Z_ERRNO) diff --git a/blkdev_cdimage.cpp b/blkdev_cdimage.cpp index 6cf75342..88be9a03 100644 --- a/blkdev_cdimage.cpp +++ b/blkdev_cdimage.cpp @@ -731,7 +731,11 @@ static int command_rawread (int unitnum, uae_u8 *data, int sector, int size, int } else if (sectorsize == 2048 && t->size == 2352) { // 2352 -> 2048 while (size-- > 0) { - zfile_fseek (t->handle, t->offset + sector * t->size + 16, SEEK_SET); + uae_u8 b = 0; + zfile_fseek (t->handle, t->offset + sector * t->size + 15, SEEK_SET); + zfile_fread (&b, 1, 1, t->handle); + if (b == 2) // MODE2? + zfile_fseek (t->handle, t->offset + sector * t->size + 24, SEEK_SET); zfile_fread (data, sectorsize, 1, t->handle); sector++; data += sectorsize; @@ -806,21 +810,26 @@ static int command_read (int unitnum, uae_u8 *data, int sector, int size) return 0; struct cdtoc *t = findtoc (cdu, §or); - int offset; if (!t || t->handle == NULL) return NULL; cdda_stop (cdu); if (t->size == 2048) { - int offset = 0; - zfile_fseek (t->handle, t->offset + sector * t->size + offset, SEEK_SET); + zfile_fseek (t->handle, t->offset + sector * t->size, SEEK_SET); zfile_fread (data, size, 2048, t->handle); sector += size; } else { - offset = 16; while (size-- > 0) { - zfile_fseek (t->handle, t->offset + sector * t->size + offset, SEEK_SET); - zfile_fread (data, size, 2048, t->handle); + if (t->size == 2352) { + uae_u8 b = 0; + zfile_fseek (t->handle, t->offset + sector * t->size + 15, SEEK_SET); + zfile_fread (&b, 1, 1, t->handle); + if (b == 2) // MODE2? + zfile_fseek (t->handle, t->offset + sector * t->size + 24, SEEK_SET); + } else { + zfile_fseek (t->handle, t->offset + sector * t->size + 16, SEEK_SET); + } + zfile_fread (data, 1, 2048, t->handle); data += 2048; sector++; } diff --git a/cdtv.cpp b/cdtv.cpp index e89107f6..3d97b25c 100644 --- a/cdtv.cpp +++ b/cdtv.cpp @@ -215,7 +215,7 @@ static int pause_audio (int pause) static int read_sectors (int start, int length) { -#ifdef CDTV_DEBUG +#ifdef CDTV_DEBUG_CMD write_log (L"READ DATA sector %d, %d sectors (blocksize=%d)\n", start, length, cdtv_sectorsize); #endif cdrom_sector = start; @@ -340,7 +340,7 @@ static int play_cdtrack (uae_u8 *p) play_start = start; last_play_pos = start; last_play_end = end; -#ifdef CDTV_DEBUG +#ifdef CDTV_DEBUG_CMD write_log (L"PLAY CD AUDIO from %d-%d, %06X (%d) to %06X (%d)\n", track_start, track_end, start, start, end, end); #endif @@ -382,7 +382,7 @@ static int play_cd (uae_u8 *p) play_start = start; last_play_pos = start; last_play_end = end; -#ifdef CDTV_DEBUG +#ifdef CDTV_DEBUG_CMD write_log (L"PLAY CD AUDIO from %06X (%d) to %06X (%d)\n", lsn2msf (start), start, lsn2msf (end), end); #endif @@ -678,7 +678,7 @@ static void dma_do_thread (void) if (!cdtv_sectorsize) return; cnt = dmac_wtc; -#ifdef CDTV_DEBUG +#ifdef CDTV_DEBUG_CMD write_log (L"DMAC DMA: sector=%d, addr=%08X, words=%d (of %d)\n", cdrom_offset / cdtv_sectorsize, dmac_acr, cnt, cdrom_length / 2); #endif @@ -687,6 +687,8 @@ static void dma_do_thread (void) uae_u8 buffer[2352]; if (!didread || readsector != (cdrom_offset / cdtv_sectorsize)) { readsector = cdrom_offset / cdtv_sectorsize; + if (readsector > 3000) + write_log (L""); if (cdtv_sectorsize != 2048) didread = read_raw (readsector, buffer, cdtv_sectorsize); else @@ -789,7 +791,7 @@ static void init_play (int start, int end) play_start = start; last_play_pos = start; last_play_end = end; -#ifdef CDTV_DEBUG +#ifdef CDTV_DEBUG_CMD write_log (L"PLAY CD AUDIO from %06X (%d) to %06X (%d)\n", lsn2msf (start), start, lsn2msf (end), end); #endif @@ -1138,7 +1140,7 @@ void CDTV_hsync_handler (void) if (dma_wait >= 0 && dma_wait < 1024 && dma_finished) { if ((dmac_cntr & (CNTR_INTEN | CNTR_TCEN)) == (CNTR_INTEN | CNTR_TCEN)) { dmac_istr |= ISTR_INT_P | ISTR_E_INT; -#ifdef CDTV_DEBUG +#ifdef CDTV_DEBUG_CMD write_log (L"DMA finished\n"); #endif } @@ -1188,6 +1190,13 @@ void CDTV_hsync_handler (void) subchannelcounter = 200; } } + if (!scor && !cd_playing) { + // frame interrupts happen all the time motor is running + scor = 1; + tp_check_interrupts (); + scor = 0; + subchannelcounter = 200; + } } if (cdtv_hsync < 200 && cdtv_hsync >= 0) @@ -1219,7 +1228,7 @@ void CDTV_hsync_handler (void) cd_led |= LED_CD_ACTIVE; else cd_led &= ~LED_CD_ACTIVE; - if (cd_led && !cd_playing) + if ((cd_led & ~LED_CD_ACTIVE2) && !cd_playing) gui_flicker_led (LED_CD, 0, cd_led); subqcnt--; @@ -1259,7 +1268,7 @@ void bleh (void) #endif } -static void cdtv_reset (void) +static void cdtv_reset_int (void) { write_log (L"CDTV: reset\n"); cdaudiostop (); @@ -1369,7 +1378,7 @@ static void dmac_bput2 (uaecptr addr, uae_u32 b) case 0x43: dmac_cntr = b; if (dmac_cntr & CNTR_PREST) - cdtv_reset (); + cdtv_reset_int (); break; case 0x80: dmac_wtc &= 0x00ffffff; @@ -1554,6 +1563,12 @@ static void open_unit (void) sys_command_info (unitnum, &di, 0); write_log (L"using drive %s (unit %d, media %d)\n", di.label, unitnum, di.media_inserted); } +static void close_unit (void) +{ + if (unitnum >= 0) + sys_command_close (unitnum); + unitnum = -1; +} static void ew (int addr, uae_u32 value) { @@ -1700,15 +1715,14 @@ void cdtv_free (void) write_comm_pipe_u32 (&requests, 0xffff, 1); while (thread_alive > 0) sleep_millis (10); + uae_sem_destroy (&sub_sem); } thread_alive = 0; - if (unitnum >= 0) - sys_command_close (unitnum); - unitnum = -1; - uae_sem_destroy (&sub_sem); + close_unit (); configured = 0; } + #ifdef ROMHACK2 extern uae_u8 *extendedkickmemory, *cardmemory; static void romhack (void) @@ -1752,11 +1766,13 @@ static void romhack (void) void cdtv_init (void) { + close_unit (); if (!thread_alive) { init_comm_pipe (&requests, 100, 1); uae_start_thread (L"cdtv", dev_thread, NULL, NULL); while (!thread_alive) sleep_millis(10); + uae_sem_init (&sub_sem, 0, 1); } write_comm_pipe_u32 (&requests, 0x0104, 1); @@ -1774,8 +1790,6 @@ void cdtv_init (void) ew (0x20, 0x00); /* ser.no. Byte 2 */ ew (0x24, 0x00); /* ser.no. Byte 3 */ - uae_sem_init (&sub_sem, 0, 1); - /* KS autoconfig handles the rest */ map_banks (&dmac_bank, 0xe80000 >> 16, 0x10000 >> 16, 0x10000); if (!savestate_state) { diff --git a/cfgfile.cpp b/cfgfile.cpp index 75bbdbfe..d0dfd982 100644 --- a/cfgfile.cpp +++ b/cfgfile.cpp @@ -584,6 +584,8 @@ void cfgfile_save_options (struct zfile *f, struct uae_prefs *p, int type) } } + if (p->statefile[0]) + cfgfile_write_str (f, L"statefile", p->statefile); if (p->quitstatefile[0]) cfgfile_write_str (f, L"statefile_quit", p->quitstatefile); @@ -761,7 +763,11 @@ void cfgfile_save_options (struct zfile *f, struct uae_prefs *p, int type) cfgfile_dwrite (f, L"gfx_gamma", L"%d", p->gfx_gamma); cfgfile_dwrite_str (f, L"gfx_filter_mask", p->gfx_filtermask); if (p->gfx_filteroverlay[0]) { - cfgfile_dwrite (f, L"gfx_filter_overlay", L"%s:%d%s,%d%s,%d%s,%d%s", + cfgfile_dwrite (f, L"gfx_filter_overlay", L"%s%s", + p->gfx_filteroverlay, _tcschr (p->gfx_filteroverlay, ',') ? L"," : L""); + +#if 0 + cfgfile_dwrite (f, L"gfx_filter_overlay", L"%s,%d%s:%d%s:%d%s:%d%s:%d%%", p->gfx_filteroverlay, p->gfx_filteroverlay_pos.x >= -24000 ? p->gfx_filteroverlay_pos.x : -p->gfx_filteroverlay_pos.x - 30000, p->gfx_filteroverlay_pos.x >= -24000 ? L"" : L"%", @@ -769,9 +775,11 @@ void cfgfile_save_options (struct zfile *f, struct uae_prefs *p, int type) p->gfx_filteroverlay_pos.y >= -24000 ? L"" : L"%", p->gfx_filteroverlay_pos.width >= -24000 ? p->gfx_filteroverlay_pos.width : -p->gfx_filteroverlay_pos.width - 30000, p->gfx_filteroverlay_pos.width >= -24000 ? L"" : L"%", - p->gfx_filteroverlay_pos.height >= -24000 ? p->gfx_filteroverlay_pos.height : -p->gfx_filteroverlay_pos.height - 300000, - p->gfx_filteroverlay_pos.height >= -24000 ? L"" : L"%" + p->gfx_filteroverlay_pos.height >= -24000 ? p->gfx_filteroverlay_pos.height : -p->gfx_filteroverlay_pos.height - 30000, + p->gfx_filteroverlay_pos.height >= -24000 ? L"" : L"%", + p->gfx_filteroverlay_overscan ); +#endif } #endif @@ -1352,13 +1360,21 @@ static int cfgfile_parse_host (struct uae_prefs *p, TCHAR *option, TCHAR *value) #ifdef GFXFILTER if (_tcscmp (option, L"gfx_filter_overlay") == 0) { - TCHAR *s = _tcschr (value, ':'); + TCHAR *s = _tcschr (value, ','); + p->gfx_filteroverlay_overscan = 0; p->gfx_filteroverlay_pos.x = 0; p->gfx_filteroverlay_pos.y = 0; p->gfx_filteroverlay_pos.width = 0; p->gfx_filteroverlay_pos.height = 0; + if (s) + *s = 0; while (s) { *s++ = 0; + p->gfx_filteroverlay_overscan = _tstol (s); + s = _tcschr (s, ':'); + if (!s) + break; +#if 0 p->gfx_filteroverlay_pos.x = _tstol (s); s = _tcschr (s, ','); if (!s) @@ -1381,12 +1397,17 @@ static int cfgfile_parse_host (struct uae_prefs *p, TCHAR *option, TCHAR *value) p->gfx_filteroverlay_pos.width = -30000 - p->gfx_filteroverlay_pos.width; *s++ = 0; p->gfx_filteroverlay_pos.height = _tstol (s); + s = _tcschr (s, ','); + if (!s) + break; + if (s[-1] == '%') + p->gfx_filteroverlay_pos.height = -30000 - p->gfx_filteroverlay_pos.height; + *s++ = 0; + p->gfx_filteroverlay_overscan = _tstol (s); TCHAR *s2 = _tcschr (s, ','); if (s2) *s2 = 0; - s = s + _tcslen (s); - if (s[-1] == '%') - p->gfx_filteroverlay_pos.height = -30000 - p->gfx_filteroverlay_pos.height; +#endif break; } _tcsncpy (p->gfx_filteroverlay, value, sizeof p->gfx_filteroverlay / sizeof (TCHAR) - 1); @@ -1516,6 +1537,7 @@ static int cfgfile_parse_host (struct uae_prefs *p, TCHAR *option, TCHAR *value) return 1; if (cfgfile_path (option, value, L"statefile", tmpbuf, sizeof tmpbuf / sizeof (TCHAR))) { + _tcscpy (p->statefile, tmpbuf); _tcscpy (savestate_fname, tmpbuf); if (zfile_exists (savestate_fname)) { savestate_state = STATE_DORESTORE; @@ -1536,8 +1558,17 @@ static int cfgfile_parse_host (struct uae_prefs *p, TCHAR *option, TCHAR *value) *p = 0; } } - if (!ok) - savestate_fname[0] = 0; + if (!ok) { + TCHAR tmp[MAX_DPATH]; + fetch_statefilepath (tmp, sizeof tmp / sizeof (TCHAR)); + _tcscat (tmp, savestate_fname); + if (zfile_exists (tmp)) { + _tcscpy (savestate_fname, tmp); + savestate_state = STATE_DORESTORE; + } else { + savestate_fname[0] = 0; + } + } } return 1; } @@ -3579,6 +3610,7 @@ void default_prefs (struct uae_prefs *p, int type) p->gfx_filter_scanlineratio = (1 << 4) | 1; p->gfx_filter_keep_aspect = 0; p->gfx_filter_autoscale = 0; + p->gfx_filteroverlay_overscan = 0; _tcscpy (p->floppyslots[0].df, L"df0.adf"); _tcscpy (p->floppyslots[1].df, L"df1.adf"); diff --git a/custom.cpp b/custom.cpp index d42f8464..4546f5df 100644 --- a/custom.cpp +++ b/custom.cpp @@ -2736,7 +2736,7 @@ void init_hz (void) if ((beamcon0 & 0xA0) != (new_beamcon0 & 0xA0)) hzc = 1; if (beamcon0 != new_beamcon0) { - write_log (L"BEAMCON0 %04x -> %04x\n", beamcon0, new_beamcon0); + write_log (L"BEAMCON0 %04x -> %04x PC%=%08x\n", beamcon0, new_beamcon0, M68K_GETPC); vpos_count = vpos_count_prev = 0; } beamcon0 = new_beamcon0; @@ -3740,6 +3740,7 @@ static void DIWSTRT (int hpos, uae_u16 v) { if (diwstrt == v && ! diwhigh_written) return; + decide_diw (hpos); decide_line (hpos); diwhigh_written = 0; diwstrt = v; @@ -3750,6 +3751,7 @@ static void DIWSTOP (int hpos, uae_u16 v) { if (diwstop == v && ! diwhigh_written) return; + decide_diw (hpos); decide_line (hpos); diwhigh_written = 0; diwstop = v; @@ -5915,7 +5917,10 @@ void dumpcustom (void) console_out_f (L"COP1LC: %08lx, COP2LC: %08lx COPPTR: %08lx\n", (unsigned long)cop1lc, (unsigned long)cop2lc, cop_state.ip); console_out_f (L"DIWSTRT: %04x DIWSTOP: %04x DDFSTRT: %04x DDFSTOP: %04x\n", (unsigned int)diwstrt, (unsigned int)diwstop, (unsigned int)ddfstrt, (unsigned int)ddfstop); - console_out_f (L"BPLCON 0: %04x 1: %04x 2: %04x 3: %04x 4: %04x LOF=%d/%d\n", bplcon0, bplcon1, bplcon2, bplcon3, bplcon4, lof_current, lof_store); + console_out_f (L"BPLCON 0: %04x 1: %04x 2: %04x 3: %04x 4: %04x LOF=%d/%d HDIW=%d VDIW=%d\n", + bplcon0, bplcon1, bplcon2, bplcon3, bplcon4, + lof_current, lof_store, + hdiwstate == DIW_waiting_start ? 0 : 1, diwstate == DIW_waiting_start ? 0 : 1); if (timeframes) { console_out_f (L"Average frame time: %.2f ms [frames: %d time: %d]\n", (double)frametime / timeframes, timeframes, frametime); diff --git a/filesys.cpp b/filesys.cpp index 0b32bd9d..ca9b96f7 100644 --- a/filesys.cpp +++ b/filesys.cpp @@ -5356,22 +5356,39 @@ static TCHAR *device_dupfix (uaecptr expbase, TCHAR *devname) return my_strdup (newname); } -static void dump_partinfo (uae_u8 *name, int num, uaecptr pp, int partblock) +static void dump_partinfo (struct hardfiledata *hfd, const uae_u8 *name, int num, uaecptr pp, int partblock) { TCHAR *s = au ((char*)name); uae_u32 dostype = get_long (pp + 80); uae_u64 size; + int blocksize, surfaces, spb, spt, reserved; + int lowcyl, highcyl; + uae_u32 block; + uae_u8 buf[512]; size = ((uae_u64)get_long (pp + 20)) * 4 * get_long (pp + 28) * get_long (pp + 36) * (get_long (pp + 56) - get_long (pp + 52) + 1); + blocksize = get_long (pp + 20) * 4; + surfaces = get_long (pp + 28); + spb = get_long (pp + 32); + spt = get_long (pp + 36); + reserved = get_long (pp + 40); + lowcyl = get_long (pp + 52); + highcyl = get_long (pp + 56); write_log (L"RDB: '%s' dostype=%08X. PartBlock=%d\n", s, dostype, partblock); write_log (L"BlockSize: %d, Surfaces: %d, SectorsPerBlock %d\n", - get_long (pp + 20) * 4, get_long (pp + 28), get_long (pp + 32)); + blocksize, surfaces, spb); write_log (L"SectorsPerTrack: %d, Reserved: %d, LowCyl %d, HighCyl %d, Size %dM\n", - get_long (pp + 36), get_long (pp + 40), get_long (pp + 52), get_long (pp + 56), (uae_u32)(size >> 20)); - + get_long (pp + 36), get_long (pp + 40), lowcyl, highcyl, (uae_u32)(size >> 20)); write_log (L"Buffers: %d, BufMemType: %08x, MaxTransfer: %08x, BootPri: %d\n", get_long (pp + 60), get_long (pp + 64), get_long (pp + 68), get_long (pp + 76)); + + block = lowcyl * surfaces * spt; + if (hdf_read (hfd, buf, (uae_u64)blocksize * block, sizeof buf)) { + write_log (L"First block %d dostype: %08X\n", block, (buf[0] << 24) | (buf[1] << 16) | (buf[2] << 8) | (buf[3] << 0)); + } else { + write_log (L"First block %d read failed!\n", block); + } xfree (s); } @@ -5493,7 +5510,7 @@ static int rdb_mount (UnitInfo *uip, int unit_no, int partnum, uaecptr parmpacke put_long (parmpacket + 12, 0); /* Device flags */ for (i = 0; i < PP_MAXSIZE; i++) put_byte (parmpacket + 16 + i, buf[128 + i]); - dump_partinfo (buf + 37, uip->devno, parmpacket, partblock); + dump_partinfo (hfd, buf + 37, uip->devno, parmpacket, partblock); dostype = get_long (parmpacket + 80); if (dostype == 0) { diff --git a/hardfile.cpp b/hardfile.cpp index 146d16eb..86c8585d 100644 --- a/hardfile.cpp +++ b/hardfile.cpp @@ -462,8 +462,6 @@ extern int get_guid_target (uae_u8 *out); static uae_u64 vhd_read (struct hardfiledata *hfd, void *v, uae_u64 offset, uae_u64 len) { - uae_u32 bamoffset; - uae_u32 sectoroffset; uae_u64 read; uae_u8 *dataptr = (uae_u8*)v; @@ -474,19 +472,19 @@ static uae_u64 vhd_read (struct hardfiledata *hfd, void *v, uae_u64 offset, uae_ if (len & 511) return read; while (len > 0) { - bamoffset = (offset / hfd->vhd_blocksize) * 4 + hfd->vhd_bamoffset; - sectoroffset = gl (hfd->vhd_header + bamoffset); + uae_u32 bamoffset = (offset / hfd->vhd_blocksize) * 4 + hfd->vhd_bamoffset; + uae_u32 sectoroffset = gl (hfd->vhd_header + bamoffset); if (sectoroffset == 0xffffffff) { memset (dataptr, 0, 512); read += 512; } else { int bitmapoffsetbits; int bitmapoffsetbytes; - int sectormapblock; + uae_u64 sectormapblock; bitmapoffsetbits = (offset / 512) % (hfd->vhd_blocksize / 512); bitmapoffsetbytes = bitmapoffsetbits / 8; - sectormapblock = sectoroffset * 512 + (bitmapoffsetbytes & ~511); + sectormapblock = sectoroffset * (uae_u64)512 + (bitmapoffsetbytes & ~511); if (hfd->vhd_sectormapblock != sectormapblock) { // read sector bitmap //write_log (L"BM %08x\n", sectormapblock); @@ -499,7 +497,7 @@ static uae_u64 vhd_read (struct hardfiledata *hfd, void *v, uae_u64 offset, uae_ // block allocated in bitmap? if (hfd->vhd_sectormap[bitmapoffsetbytes & 511] & (1 << (7 - (bitmapoffsetbits & 7)))) { // read data block - int block = sectoroffset * 512 + hfd->vhd_bitmapsize + bitmapoffsetbits * 512; + uae_u64 block = sectoroffset * (uae_u64)512 + hfd->vhd_bitmapsize + bitmapoffsetbits * 512; //write_log (L"DB %08x\n", block); if (hdf_read_target (hfd, dataptr, block, 512) != 512) { write_log (L"vhd_read: data read error\n"); @@ -556,8 +554,6 @@ static int vhd_write_enlarge (struct hardfiledata *hfd, uae_u32 bamoffset) static uae_u64 vhd_write (struct hardfiledata *hfd, void *v, uae_u64 offset, uae_u64 len) { - uae_u32 bamoffset; - uae_u32 sectoroffset; uae_u64 written; uae_u8 *dataptr = (uae_u8*)v; @@ -568,8 +564,8 @@ static uae_u64 vhd_write (struct hardfiledata *hfd, void *v, uae_u64 offset, uae if (len & 511) return written; while (len > 0) { - bamoffset = (offset / hfd->vhd_blocksize) * 4 + hfd->vhd_bamoffset; - sectoroffset = gl (hfd->vhd_header + bamoffset); + uae_u32 bamoffset = (offset / hfd->vhd_blocksize) * 4 + hfd->vhd_bamoffset; + uae_u32 sectoroffset = gl (hfd->vhd_header + bamoffset); if (sectoroffset == 0xffffffff) { if (!vhd_write_enlarge (hfd, bamoffset)) return written; @@ -577,11 +573,10 @@ static uae_u64 vhd_write (struct hardfiledata *hfd, void *v, uae_u64 offset, uae } else { int bitmapoffsetbits; int bitmapoffsetbytes; - int sectormapblock; bitmapoffsetbits = (offset / 512) % (hfd->vhd_blocksize / 512); bitmapoffsetbytes = bitmapoffsetbits / 8; - sectormapblock = sectoroffset * 512 + (bitmapoffsetbytes & ~511); + uae_u64 sectormapblock = sectoroffset * (uae_u64)512 + (bitmapoffsetbytes & ~511); if (hfd->vhd_sectormapblock != sectormapblock) { // read sector bitmap if (hdf_read_target (hfd, hfd->vhd_sectormap, sectormapblock, 512) != 512) { @@ -591,7 +586,7 @@ static uae_u64 vhd_write (struct hardfiledata *hfd, void *v, uae_u64 offset, uae hfd->vhd_sectormapblock = sectormapblock; } // write data - if (hdf_write_target (hfd, dataptr, sectoroffset * 512 + hfd->vhd_bitmapsize + bitmapoffsetbits * 512, 512) != 512) { + if (hdf_write_target (hfd, dataptr, sectoroffset * (uae_u64)512 + hfd->vhd_bitmapsize + bitmapoffsetbits * 512, 512) != 512) { write_log (L"vhd_write: data write error\n"); return written; } @@ -953,11 +948,11 @@ static uae_u64 cmd_write (struct hardfiledata *hfd, uaecptr dataptr, uae_u64 off return cmd_writex (hfd, bank_data->xlateaddr (dataptr), offset, len); } -static int checkbounds(struct hardfiledata *hfd, uae_u64 offset, uae_u64 len) +static int checkbounds (struct hardfiledata *hfd, uae_u64 offset, uae_u64 len) { - if (offset >= hfd->physsize) + if (offset >= hfd->virtsize) return 0; - if (offset + len > hfd->physsize) + if (offset + len > hfd->virtsize) return 0; return 1; } diff --git a/include/a2091.h b/include/a2091.h index ae596366..70d4f30e 100644 --- a/include/a2091.h +++ b/include/a2091.h @@ -24,15 +24,15 @@ extern struct scsi_data *scsis[8]; #define WD33C93 L"WD33C93" #define SCSIID (scsis[wdregs[WD_DESTINATION_ID] & 7]) -extern int a2091_add_scsi_unit (int ch, TCHAR *path, int blocksize, int readonly, - TCHAR *devname, int sectors, int surfaces, int reserved, - int bootpri, TCHAR *filesys); -extern int a3000_add_scsi_unit (int ch, TCHAR *path, int blocksize, int readonly, - TCHAR *devname, int sectors, int surfaces, int reserved, - int bootpri, TCHAR *filesys); - -extern int addscsi (int ch, TCHAR *path, int blocksize, int readonly, - TCHAR *devname, int sectors, int surfaces, int reserved, - int bootpri, TCHAR *filesys, int scsi_level); +extern int a2091_add_scsi_unit (int ch, const TCHAR *path, int blocksize, int readonly, + const TCHAR *devname, int sectors, int surfaces, int reserved, + int bootpri, const TCHAR *filesys); +extern int a3000_add_scsi_unit (int ch, const TCHAR *path, int blocksize, int readonly, + const TCHAR *devname, int sectors, int surfaces, int reserved, + int bootpri, const TCHAR *filesys); + +extern int addscsi (int ch, const TCHAR *path, int blocksize, int readonly, + const TCHAR *devname, int sectors, int surfaces, int reserved, + int bootpri, const TCHAR *filesys, int scsi_level); #endif diff --git a/include/options.h b/include/options.h index 3dfd5d62..6ccfc75c 100644 --- a/include/options.h +++ b/include/options.h @@ -213,6 +213,7 @@ struct uae_prefs { TCHAR gfx_filtermask[MAX_DPATH]; TCHAR gfx_filteroverlay[MAX_DPATH]; struct wh gfx_filteroverlay_pos; + int gfx_filteroverlay_overscan; int gfx_filter_scanlines; int gfx_filter_scanlineratio; int gfx_filter_scanlinelevel; @@ -299,6 +300,7 @@ struct uae_prefs { TCHAR a2065name[MAX_DPATH]; struct cdslot cdslots[MAX_TOTAL_SCSI_DEVICES]; TCHAR quitstatefile[MAX_DPATH]; + TCHAR statefile[MAX_DPATH]; TCHAR path_floppy[256]; TCHAR path_hardfile[256]; diff --git a/include/uae.h b/include/uae.h index 31943da3..13d4b5bc 100644 --- a/include/uae.h +++ b/include/uae.h @@ -57,5 +57,6 @@ extern void fetch_saveimagepath (TCHAR*, int, int); extern void fetch_configurationpath (TCHAR *out, int size); extern void fetch_screenshotpath (TCHAR *out, int size); extern void fetch_ripperpath (TCHAR *out, int size); +extern void fetch_statefilepath (TCHAR *out, int size); extern void fetch_datapath (TCHAR *out, int size); extern int uaerand (void); diff --git a/newcpu.cpp b/newcpu.cpp index 2962088e..8ce65408 100644 --- a/newcpu.cpp +++ b/newcpu.cpp @@ -2763,8 +2763,8 @@ STATIC_INLINE int do_specialties (int cycles) //static uae_u32 pcs[1000]; -//#define DEBUG_CD32IO -#ifdef DEBUG_CD32IO +//#define DEBUG_CD32CDTVIO +#ifdef DEBUG_CD32CDTVIO static uae_u32 cd32nextpc, cd32request; @@ -2856,7 +2856,7 @@ static void m68k_run_1 (void) count_instr (opcode); -#ifdef DEBUG_CD32IO +#ifdef DEBUG_CD32CDTVIO out_cd32io (m68k_getpc ()); #endif @@ -2903,6 +2903,9 @@ static void m68k_run_1_ce (void) ipl_fetch (); for (;;) { uae_u32 opcode = r->ir; +#ifdef DEBUG_CD32CDTVIO + out_cd32io (m68k_getpc ()); +#endif (*cpufunctbl[opcode])(opcode); if (r->spcflags) { if (do_specialties (0)) @@ -3135,7 +3138,7 @@ static void m68k_run_2p (void) uae_u32 opcode; uae_u32 pc = m68k_getpc (); -#ifdef DEBUG_CD32IO +#ifdef DEBUG_CD32CDTVIO out_cd32io (m68k_getpc ()); #endif diff --git a/od-win32/blkdev_win32_ioctl.cpp b/od-win32/blkdev_win32_ioctl.cpp index 1f3bf6e7..9fafdca8 100644 --- a/od-win32/blkdev_win32_ioctl.cpp +++ b/od-win32/blkdev_win32_ioctl.cpp @@ -1050,7 +1050,6 @@ static int ioctl_command_toc (int unitnum, struct cd_toc_head *tocout) if (!open_createfile (ciw, 0)) return 0; - gui_flicker_led (LED_CD, unitnum, LED_CD_ACTIVE); while (cnt-- > 0) { seterrormode (ciw); if (!DeviceIoControl (ciw->h, IOCTL_CDROM_READ_TOC, NULL, 0, toc, sizeof (CDROM_TOC), &len, NULL)) { @@ -1097,7 +1096,6 @@ static int ioctl_command_toc (int unitnum, struct cd_toc_head *tocout) t->paddress = th->lastaddress; t++; - gui_flicker_led (LED_CD, unitnum, LED_CD_ACTIVE); memcpy (tocout, th, sizeof (struct cd_toc_head)); return 1; } diff --git a/od-win32/direct3d.cpp b/od-win32/direct3d.cpp index 8cf1c257..63570387 100644 --- a/od-win32/direct3d.cpp +++ b/od-win32/direct3d.cpp @@ -42,8 +42,10 @@ static D3DDISPLAYMODEEX modeex; static IDirect3DDevice9 *d3ddev; static IDirect3DDevice9Ex *d3ddevex; static D3DSURFACE_DESC dsdbb; -static LPDIRECT3DTEXTURE9 texture, sltexture, ledtexture, masktexture, mask2texture; -static int masktexture_w, masktexture_h, mask2texture_w, mask2texture_h; +static LPDIRECT3DTEXTURE9 texture, sltexture, ledtexture, masktexture, mask2texture, blanktexture; +static int masktexture_w, masktexture_h; +static float mask2texture_w, mask2texture_h, mask2texture_ww, mask2texture_wh; +static float mask2texture_multx, mask2texture_multy, mask2texture_offsetw; static LPDIRECT3DTEXTURE9 lpWorkTexture1, lpWorkTexture2, lpTempTexture; LPDIRECT3DTEXTURE9 cursorsurfaced3d; static LPDIRECT3DVOLUMETEXTURE9 lpHq2xLookupTexture; @@ -54,6 +56,7 @@ static int devicelost; static int locked, fulllocked; static int cursor_offset_x, cursor_offset_y; static float maskmult_x, maskmult_y; +static RECT mask2rect; static D3DXMATRIX m_matProj, m_matProj2; static D3DXMATRIX m_matWorld, m_matWorld2; @@ -1198,6 +1201,33 @@ static void createscanlines (int force) sltexture->UnlockRect (0); } +static int findedge (D3DLOCKED_RECT *lock, int w, int h, int dx, int dy) +{ + int x = w / 2; + int y = h / 2; + + if (dx != 0) + x = dx < 0 ? 0 : w - 1; + if (dy != 0) + y = dy < 0 ? 0 : h - 1; + + for (;;) { + uae_u32 *p = (uae_u32*)((uae_u8*)lock->pBits + y * lock->Pitch + x * 4); + int alpha = (*p) >> 24; + if (alpha != 255) + break; + x -= dx; + y -= dy; + if (x <= 0 || y <= 0) + break; + if (x >= w - 1 || y >= h - 1) + break; + } + if (dx) + return x; + return y; +} + static int createmask2texture (const TCHAR *filename) { struct zfile *zf; @@ -1210,6 +1240,7 @@ static int createmask2texture (const TCHAR *filename) if (filename[0] == 0 || WIN32GFX_IsPicassoScreen ()) return 0; + zf = NULL; for (int i = 0; i < 2; i++) { if (i == 0) { @@ -1218,18 +1249,48 @@ static int createmask2texture (const TCHAR *filename) } else { _tcscpy (tmp, filename); } - zf = zfile_fopen (tmp, L"rb", ZFD_NORMAL); - if (zf) - break; - TCHAR tmp2[MAX_DPATH]; - TCHAR *s = _tcsrchr (tmp, '.'); + TCHAR tmp2[MAX_DPATH], tmp3[MAX_DPATH]; + _tcscpy (tmp3, tmp); + TCHAR *s = _tcsrchr (tmp3, '.'); if (s) { + TCHAR *s2 = s; + while (s2 > tmp3) { + TCHAR v = *s2; + if (v == '_') { + s = s2; + break; + } + if (v == 'X' || v == 'x') { + s2--; + continue; + } + if (!_istdigit (v)) + break; + s2--; + } _tcscpy (tmp2, s); _stprintf (s, L"_%dx%d%s", window_w, window_h, tmp2); - zf = zfile_fopen (tmp, L"rb", ZFD_NORMAL); + zf = zfile_fopen (tmp3, L"rb", ZFD_NORMAL); if (zf) break; + float aspect = (float)window_w / window_h; + int ax = -1, ay = -1; + if (abs (aspect - 16.0 / 10.0) <= 0.1) + ax = 16, ay = 10; + if (abs (aspect - 16.0 / 9.0) <= 0.1) + ax = 16, ay = 9; + if (abs (aspect - 4.0 / 3.0) <= 0.1) + ax = 4, ay = 3; + if (ax > 0 && ay > 0) { + _stprintf (s, L"_%dx%d%s", ax, ay, tmp2); + zf = zfile_fopen (tmp3, L"rb", ZFD_NORMAL); + if (zf) + break; + } } + zf = zfile_fopen (tmp, L"rb", ZFD_NORMAL); + if (zf) + break; } if (!zf) { write_log (L"%s: couldn't open overlay '%s'\n", D3DHEAD, filename); @@ -1240,7 +1301,7 @@ static int createmask2texture (const TCHAR *filename) zfile_fread (buf, size, 1, zf); zfile_fclose (zf); hr = D3DXCreateTextureFromFileInMemoryEx (d3ddev, buf, size, - D3DX_DEFAULT_NONPOW2, D3DX_DEFAULT_NONPOW2, D3DX_DEFAULT, D3DUSAGE_DYNAMIC, D3DFMT_A8R8G8B8, + D3DX_DEFAULT_NONPOW2, D3DX_DEFAULT_NONPOW2, 1, D3DUSAGE_DYNAMIC, D3DFMT_A8R8G8B8, D3DPOOL_DEFAULT, D3DX_FILTER_NONE, D3DX_FILTER_NONE, 0, &dinfo, NULL, &tx); xfree (buf); if (FAILED (hr)) { @@ -1250,6 +1311,53 @@ static int createmask2texture (const TCHAR *filename) mask2texture_w = dinfo.Width; mask2texture_h = dinfo.Height; mask2texture = tx; + mask2rect.left = 0; + mask2rect.top = 0; + mask2rect.right = mask2texture_w; + mask2rect.bottom = mask2texture_h; + + D3DLOCKED_RECT lock; + if (SUCCEEDED (hr = mask2texture->LockRect (0, &lock, NULL, 0))) { + mask2rect.left = findedge (&lock, mask2texture_w, mask2texture_h, -1, 0); + mask2rect.right = findedge (&lock, mask2texture_w, mask2texture_h, 1, 0); + mask2rect.top = findedge (&lock, mask2texture_w, mask2texture_h, 0, -1); + mask2rect.bottom = findedge (&lock, mask2texture_w, mask2texture_h, 0, 1); + mask2texture->UnlockRect (0); + } + if (mask2rect.left >= mask2texture_w / 2 || mask2rect.top >= mask2texture_h / 2 || + mask2rect.right <= mask2texture_w / 2 || mask2rect.bottom <= mask2texture_h / 2) { + mask2rect.left = 0; + mask2rect.top = 0; + mask2rect.right = mask2texture_w; + mask2rect.bottom = mask2texture_h; + } + mask2texture_multx = (float)window_w / mask2texture_w; + mask2texture_multy = (float)window_h / mask2texture_h; + mask2texture_offsetw = 0; + + if (isfullscreen () > 0) { + struct MultiDisplay *md = getdisplay (&currprefs); + float deskw = md->rect.right - md->rect.left; + float deskh = md->rect.bottom - md->rect.top; + //deskw = 800; deskh = 600; + float dstratio = deskw / deskh; + float srcratio = mask2texture_w / mask2texture_h; + mask2texture_multx *= srcratio / dstratio; + } else { + mask2texture_multx = mask2texture_multy; + } + + mask2texture_wh = window_h; + mask2texture_ww = mask2texture_w * mask2texture_multx; + + mask2texture_offsetw = (window_w - mask2texture_ww) / 2; + + blanktexture = createtext (mask2texture_offsetw + 1, window_h, D3DFMT_X8R8G8B8); + + write_log (L"%s: overlay '%s' %.0f*%.0f (%d*%d - %d*%d)\n", + D3DHEAD, tmp, mask2texture_w, mask2texture_h, + mask2rect.left, mask2rect.top, mask2rect.right, mask2rect.bottom); + return 1; end: if (tx) @@ -1289,7 +1397,7 @@ static int createmasktexture (const TCHAR *filename) zfile_fread (buf, size, 1, zf); zfile_fclose (zf); hr = D3DXCreateTextureFromFileInMemoryEx (d3ddev, buf, size, - D3DX_DEFAULT_NONPOW2, D3DX_DEFAULT_NONPOW2, D3DX_DEFAULT, D3DUSAGE_DYNAMIC, D3DFMT_X8R8G8B8, + D3DX_DEFAULT_NONPOW2, D3DX_DEFAULT_NONPOW2, 1, D3DUSAGE_DYNAMIC, D3DFMT_X8R8G8B8, D3DPOOL_DEFAULT, D3DX_FILTER_NONE, D3DX_FILTER_NONE, 0, &dinfo, NULL, &tx); xfree (buf); if (FAILED (hr)) { @@ -1372,6 +1480,9 @@ static void setupscenecoords (void) //write_log (L"%dx%d %dx%d %dx%d\n", tin_w, tin_h, tin_w, tin_h, window_w, window_h); + float mw = mask2rect.right - mask2rect.left; + float mh = mask2rect.bottom - mask2rect.top; + getfilterrect2 (&dr, &sr, &zr, window_w, window_h, tin_w / mult, tin_h / mult, mult, tin_w, tin_h); if (memcmp (&sr, &sr2, sizeof RECT) || memcmp (&dr, &dr2, sizeof RECT) || memcmp (&zr, &zr2, sizeof RECT)) { @@ -1383,63 +1494,63 @@ static void setupscenecoords (void) dr2 = dr; zr2 = zr; } - cursor_offset_x = -zr.left; - cursor_offset_y = -zr.top; dw = dr.right - dr.left; dh = dr.bottom - dr.top; w = sr.right - sr.left; h = sr.bottom - sr.top; - MatrixOrthoOffCenterLH (&m_matProj, 0, w, 0, h, 0.0f, 1.0f); - MatrixTranslation (&m_matView, - -0.5f + dw * tin_w / window_w / 2 - zr.left - sr.left, // - (tin_w - 2 * zr.left - w), - +0.5f + dh * tin_h / window_h / 2 - zr.top - (tin_h - 2 * zr.top - h) + sr.top, // <- ??? - 0); + float tx, ty; + float sw, sh; - float sw = dw * tin_w / window_w; - float sh = dh * tin_h / window_h; - MatrixScaling (&m_matWorld, sw, sh, 1.0f); + if (mask2texture) { -#if 0 + float winw = mw * mask2texture_multx; + float winh = mh * mask2texture_multy; + dw *= winw / window_w; + dh *= winh / window_h; + tx = -0.5f + dw * tin_w / winw / 2; + ty = +0.5f + dh * tin_h / winh / 2; - MatrixOrthoOffCenterLH (&m_matProj, 0, w, 0, h, 0.0f, 1.0f); + float xshift = -zr.left - sr.left; + float yshift = +zr.top + sr.top - (tin_h - h); - float ww = dw * tin_w / window_w; - float hh = dh * tin_h / window_h; + sw = dw * tin_w / window_w; + sh = dh * tin_h / window_h; - MatrixTranslation (&m_matView, - -0.5f + ww / 2 - zr.left - sr.left, // - (tin_w - 2 * zr.left - w), - 0.5f + hh / 2- zr.top - (tin_h - 2 * zr.top - h) + sr.top, // <- ??? - 0); + tx += xshift; + ty += yshift; - MatrixOrthoOffCenterLH (&m_matProj, 0.0f, 1.0f, 0.0f, 1.0f, 0.0f, 1.0f); - MatrixOrthoOffCenterLH (&m_matProj, 0, dw, 0, dh, 0.0f, 1.0f); - float mx = w / ww; - float my = h / hh; + } else { - MatrixTranslation (&m_matView, 0.5f - 0.5f / window_w, 0.5f + 0.5f / window_h, 0.0f); - MatrixTranslation (&m_matView, - 0.5f + (dw / 2) - (zr.left - sr.left), - 0.5f + (dh / 2) - (zr.top - (tin_h - 2 * zr.top - h) + sr.top) * 0, // <- ??? - 0); + tx = -0.5f + dw * tin_w / window_w / 2; + ty = +0.5f + dh * tin_h / window_h / 2; + tx += - zr.left - sr.left; // - (tin_w - 2 * zr.left - w), + ty += + zr.top + sr.top - (tin_h - h); + + sw = dw * tin_w / window_w; + sh = dh * tin_h / window_h; + } - MatrixScaling (&m_matWorld, ww / w * dw, hh / h * dh, 1.0f); -#endif + MatrixTranslation (&m_matView, tx, ty, 1.0f); + MatrixScaling (&m_matWorld, sw, sh, 1.0f); + + cursor_offset_x = -zr.left; + cursor_offset_y = -zr.top; - //write_log (L"%.1fx%.1f %.1fx%.1f %.1fx%.1f\n", dw, dh, w, h, ww, hh); + //write_log (L"%.1fx%.1f %.1fx%.1f %.1fx%.1f\n", dw, dh, w, h, sw, sh); - float ww = dw * tin_w / window_w; - float hh = dh * tin_h / window_h; + // ratio between Amiga texture and overlay mask texture + float sw2 = dw * tin_w / window_w; + float sh2 = dh * tin_h / window_h; - // ratio between Amiga texture and overlay texture - maskmult.x = ww * maskmult_x / w; - maskmult.y = hh * maskmult_y / h; + maskmult.x = sw2 * maskmult_x / w; + maskmult.y = sh2 * maskmult_y / h; maskshift.x = 1.0f / maskmult_x; maskshift.y = 1.0f / maskmult_y; @@ -1447,7 +1558,6 @@ static void setupscenecoords (void) D3DXMATRIX tmp; D3DXMatrixMultiply (&tmp, &m_matWorld, &m_matView); D3DXMatrixMultiply (&postproj, &tmp, &m_matProj); - } uae_u8 *getfilterbuffer3d (int *widthp, int *heightp, int *pitch, int *depth) @@ -1521,6 +1631,7 @@ static void settransform (void) psEffect_SetMatrices (&m_matProj, &m_matView, &m_matWorld); MatrixOrthoOffCenterLH (&m_matProj2, 0.0f, 1.0f, 0.0f, 1.0f, 0.0f, 1.0f); + MatrixTranslation (&m_matView2, 0.5f - 0.5f / window_w, 0.5f + 0.5f / window_h, 0.0f); D3DXMatrixIdentity (&m_matWorld2); } @@ -1551,6 +1662,10 @@ static void invalidatedeviceobjects (void) mask2texture->Release (); mask2texture = NULL; } + if (blanktexture) { + blanktexture->Release (); + blanktexture = NULL; + } if (lpTempTexture) { lpTempTexture->Release (); lpTempTexture = NULL; @@ -2203,27 +2318,35 @@ static void D3D_render22 (void) sprite->SetTransform (&t); sprite->Draw (cursorsurfaced3d, NULL, NULL, &v, 0xffffffff); MatrixScaling (&t, 1, 1, 0); + sprite->Flush (); sprite->SetTransform (&t); } if (mask2texture) { D3DXMATRIX t; - float w = (float)window_w / mask2texture_w; - float h = (float)window_h / mask2texture_h; - + RECT r; + float srcw = mask2texture_w; + float srch = mask2texture_h; + float aspectsrc = srcw / srch; + float aspectdst = (float)window_w / window_h; + float w, h; + + w = mask2texture_multx; + h = mask2texture_multy; +#if 0 if (currprefs.gfx_filteroverlay_pos.width > 0) - w = (float)currprefs.gfx_filteroverlay_pos.width / mask2texture_w; + w = (float)currprefs.gfx_filteroverlay_pos.width / srcw; else if (currprefs.gfx_filteroverlay_pos.width == -1) w = 1.0; else if (currprefs.gfx_filteroverlay_pos.width <= -24000) w = w * (-currprefs.gfx_filteroverlay_pos.width - 30000) / 100.0; if (currprefs.gfx_filteroverlay_pos.height > 0) - h = (float)currprefs.gfx_filteroverlay_pos.height / mask2texture_h; + h = (float)currprefs.gfx_filteroverlay_pos.height / srch; else if (currprefs.gfx_filteroverlay_pos.height == -1) h = 1; else if (currprefs.gfx_filteroverlay_pos.height <= -24000) h = h * (-currprefs.gfx_filteroverlay_pos.height - 30000) / 100.0; - +#endif MatrixScaling (&t, w, h, 0); v.x = 0; @@ -2244,11 +2367,40 @@ static void D3D_render22 (void) v.x /= w; v.y /= h; + v.x = v.y = 0; v.z = 0; + v.x += mask2texture_offsetw / w; + + r.left = 0; + r.top = 0; + r.right = mask2texture_w; + r.bottom = mask2texture_h; + sprite->SetTransform (&t); - sprite->Draw (mask2texture, NULL, NULL, &v, 0xffffffff); + sprite->Draw (mask2texture, &r, NULL, &v, 0xffffffff); + sprite->Flush (); MatrixScaling (&t, 1, 1, 0); sprite->SetTransform (&t); + + if (mask2texture_offsetw > 0) { + v.x = 0; + v.y = 0; + r.left = 0; + r.top = 0; + r.right = mask2texture_offsetw + 1; + r.bottom = window_h; + sprite->Draw (blanktexture, &r, NULL, &v, 0xffffffff); + if (window_w > mask2texture_offsetw + mask2texture_ww) { + v.x = mask2texture_offsetw + mask2texture_ww; + v.y = 0; + r.left = 0; + r.top = 0; + r.right = window_w - (mask2texture_offsetw + mask2texture_ww) + 1; + r.bottom = window_h; + sprite->Draw (blanktexture, &r, NULL, &v, 0xffffffff); + } + } + } if (ledtexture && (((currprefs.leds_on_screen & STATUSLINE_RTG) && WIN32GFX_IsPicassoScreen ()) || ((currprefs.leds_on_screen & STATUSLINE_CHIPSET) && !WIN32GFX_IsPicassoScreen ()))) { v.x = 0; diff --git a/od-win32/win32.cpp b/od-win32/win32.cpp index ec482f91..212d285e 100644 --- a/od-win32/win32.cpp +++ b/od-win32/win32.cpp @@ -2890,6 +2890,10 @@ void fetch_ripperpath (TCHAR *out, int size) { fetch_path (L"RipperPath", out, size); } +void fetch_statefilepath (TCHAR *out, int size) +{ + fetch_path (L"StatefilePath", out, size); +} void fetch_datapath (TCHAR *out, int size) { fetch_path (NULL, out, size); @@ -2940,6 +2944,8 @@ void fetch_path (const TCHAR *name, TCHAR *out, int size) _tcscat (out, L"..\\shared\\rom\\"); if (!_tcscmp (name, L"ConfigurationPath")) _tcscat (out, L"Configurations\\"); + if (!_tcscmp (name, L"StatefilePath")) + _tcscat (out, L"Savestates\\"); if (start_data >= 0) regquerystr (NULL, name, out, &size); if (GetFileAttributes (out) == INVALID_FILE_ATTRIBUTES) diff --git a/od-win32/win32.h b/od-win32/win32.h index 12c96856..188ce05f 100644 --- a/od-win32/win32.h +++ b/od-win32/win32.h @@ -18,8 +18,8 @@ #define WINUAEPUBLICBETA 1 #define LANG_DLL 1 -#define WINUAEBETA L"9" -#define WINUAEDATE MAKEBD(2010, 8, 4) +#define WINUAEBETA L"10" +#define WINUAEDATE MAKEBD(2010, 8, 10) #define WINUAEEXTRA L"" #define WINUAEREV L"" diff --git a/od-win32/win32_scaler.cpp b/od-win32/win32_scaler.cpp index b07e91c7..f38347e9 100644 --- a/od-win32/win32_scaler.cpp +++ b/od-win32/win32_scaler.cpp @@ -179,8 +179,8 @@ void getfilterrect2 (RECT *sr, RECT *dr, RECT *zr, int dst_width, int dst_height aws = aw * scale; ahs = ah * scale; - extraw = -aws * filter_horiz_zoom / 2000; - extrah = -ahs * filter_vert_zoom / 2000; + extraw = -aws * (filter_horiz_zoom - currprefs.gfx_filteroverlay_overscan * 10) / 2000; + extrah = -ahs * (filter_vert_zoom - currprefs.gfx_filteroverlay_overscan * 10) / 2000; SetRect (sr, 0, 0, dst_width, dst_height); SetRect (zr, 0, 0, 0, 0); @@ -231,7 +231,7 @@ void getfilterrect2 (RECT *sr, RECT *dr, RECT *zr, int dst_width, int dst_height OffsetRect (zr, cx * scale - (dst_width - ww) / 2, cy * scale - (dst_height - hh) / 2); goto cont; - } else if (currprefs.gfx_filter_autoscale == 2 && isfullscreen () == 0) { + } else if (currprefs.gfx_filter_autoscale == 2 && isfullscreen () == 0 && !currprefs.gfx_filteroverlay[0]) { static int lastresize = 0; static int lastdelay = 1; static int ocw, och, ocx, ocy, lcw, lch, lcx, lcy; @@ -341,6 +341,11 @@ void getfilterrect2 (RECT *sr, RECT *dr, RECT *zr, int dst_width, int dst_height filteroffsety += diff / 2; } + v = filter_horiz_offset; + OffsetRect (zr, (int)(-v * aws / 1000.0), 0); + v = filter_vert_offset; + OffsetRect (zr, 0, (int)(-v * ahs / 1000.0)); + diff = dr->right - dr->left; filterxmult = diff * 1000 / (dst_width * scale); diff = dr->bottom - dr->top; diff --git a/od-win32/win32gui.cpp b/od-win32/win32gui.cpp index ee7d9624..25cde563 100644 --- a/od-win32/win32gui.cpp +++ b/od-win32/win32gui.cpp @@ -10009,28 +10009,6 @@ static void swapperhili (HWND hDlg, int entry) SetDlgItemText (hDlg, IDC_DISKTEXT, workprefs.dfxlist[entry]); } -static void addswapperfile (HWND hDlg, int entry, TCHAR *newpath) -{ - TCHAR path[MAX_DPATH]; - int lastentry = entry; - - path[0] = 0; - if (newpath) - _tcscpy (path, newpath); - if (MultiDiskSelection (hDlg, -1, 0, &changed_prefs, path)) { - TCHAR dpath[MAX_DPATH]; - loopmulti (path, NULL); - while (loopmulti (path, dpath) && entry < MAX_SPARE_DRIVES) { - _tcscpy (workprefs.dfxlist[entry], dpath); - fullpath (workprefs.dfxlist[entry], MAX_DPATH); - lastentry = entry; - entry++; - } - InitializeListView (hDlg); - swapperhili (hDlg, lastentry); - } -} - static void diskswapper_addfile2 (struct uae_prefs *prefs, const TCHAR *file) { int list = 0; @@ -10044,6 +10022,7 @@ static void diskswapper_addfile2 (struct uae_prefs *prefs, const TCHAR *file) while (list < MAX_SPARE_DRIVES) { if (!prefs->dfxlist[list][0]) { _tcscpy (prefs->dfxlist[list], file); + fullpath (prefs->dfxlist[list], MAX_DPATH); break; } list++; @@ -10071,6 +10050,27 @@ static void diskswapper_addfile (struct uae_prefs *prefs, const TCHAR *file) } } +static void addswapperfile (HWND hDlg, int entry, TCHAR *newpath) +{ + TCHAR path[MAX_DPATH]; + int lastentry = entry; + + path[0] = 0; + if (newpath) + _tcscpy (path, newpath); + if (MultiDiskSelection (hDlg, -1, 0, &changed_prefs, path)) { + TCHAR dpath[MAX_DPATH]; + loopmulti (path, NULL); + while (loopmulti (path, dpath) && entry < MAX_SPARE_DRIVES) { + diskswapper_addfile (&workprefs, path); + lastentry = entry; + entry++; + } + InitializeListView (hDlg); + swapperhili (hDlg, lastentry); + } +} + static INT_PTR CALLBACK SwapperDlgProc (HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam) { static int recursive = 0; @@ -11985,7 +11985,7 @@ static void enable_for_hw3ddlg (HWND hDlg) { int v = workprefs.gfx_filter ? TRUE : FALSE; int vv = FALSE, vv2 = FALSE, vv3 = FALSE; - int as = workprefs.gfx_filter_autoscale == 1 || workprefs.gfx_filter_autoscale == 2; + int as = workprefs.gfx_filter_autoscale == 2; struct uae_filter *uf; int i, isfilter; diff --git a/od-win32/winuaechangelog.txt b/od-win32/winuaechangelog.txt index 61a665f7..0d7c2a09 100644 --- a/od-win32/winuaechangelog.txt +++ b/od-win32/winuaechangelog.txt @@ -1,4 +1,29 @@ +Beta 10: + +- archive dragndrop worked too well, it unpacked everything, including adf filesystem etc.. +- do not expand zipped filename when dragdropping if zip only contains single file +- insert floppy image dialog in disk swapper also "extracts" images inside selected archive +- MODE1 "raw" 2352 data tracks didn't work in CDTV and image mounter + uaescsi.device non-direct scsi mode +- MODE2 FORM1 data tracks didn't work in uaescsi.device SCSI emulation mode +- CDTV mode didn't close CD handle when reseting +- CDTV frame interrupts in non audio CD play mode stopped working (broke when CD+G was implemented) +- overlay height configuration file setting was written incorrectly if it had non-zero value +- statefile configuration entry is not lost when configuration is load and saved again +- scan zip directory even if compression method is unknown +- hardfile scsi emulation block validation checked against physical size, not virtual size: + direct-scsi filesystem installed on dynamic hardfile didn't work very well.. +- dynamic hdf corrupted data if hdf's physical file size grew over 4G +- bezel overlay support improved, aspect ratio correction, visible area autodetection, + (image positioning is not yet pixel perfect) +- pointless bezel configuration file size parameters (temporarily?) removed, bezel overlay + configuration needs to be reset (it had stupid design fault) +- DIWSTRT/DIWSTOP writes didn't check if hdiw state should have changed since last hsync + (has always been broken but it wasn't really needed until Denise "bug" update in 2.0) + fixes Friday at Eight / Polka Brothers + +Beta 9: + - when attempting to play CD32 data track: return normal "playing" status and "play ended with error" flag in next status packet (Mission Impossible 2025 CD32) - return error status when CD32 qcode command packet is received and currently played CD @@ -10,7 +35,7 @@ 1x = normal, 2x = internal texture is twice the size of display etc.. Big texture support required, makes some shader filters look more smoother when combined with bilinear filtering (for example hq2x) -- crash when entering or exiting GUI when ASPI SCSI mode enabled (b6) +- crash when entering or exiting GUI when ASPI SCSI mode is enabled (b6) - cd32 pad shift register should stay in reset state in 2-button mode (F17 Challenge CD32) - added cd insert/eject to systray menu - added configuration file delayed cd insert, add "delay" to end of path ("cdimage0=,delay"), @@ -19,7 +44,7 @@ - fixed cue+mp3 size detection if mp3 frames included checksum data - only accept 8 or 32-bit Windows clipboard image input (instead of crashing..) - diskswapper and floppy/quickstart archive dragndrop: add all disk images inside the - archive (I don't know why this was done ages ago..) + archive (I don't know why this was not done ages ago..) Beta 8: