From fa7577b8e3c084e966f977b89d202882b405a44d Mon Sep 17 00:00:00 2001 From: Toni Wilen Date: Sat, 20 Feb 2021 19:00:04 +0200 Subject: [PATCH] 4500b17 --- cpuboard.cpp | 33 +++++++++++------ custom.cpp | 2 +- disk.cpp | 69 ++++++++++++++++++++++++++++-------- od-win32/posixemu.cpp | 2 +- od-win32/win32.h | 4 +-- od-win32/winuaechangelog.txt | 14 ++++++++ 6 files changed, 94 insertions(+), 30 deletions(-) diff --git a/cpuboard.cpp b/cpuboard.cpp index 90dee071..2ab3c5e8 100644 --- a/cpuboard.cpp +++ b/cpuboard.cpp @@ -585,15 +585,15 @@ MEMORY_XLATE(blizzardmaprom); static void REGPARAM2 blizzardmaprom_lput(uaecptr addr, uae_u32 l) { +#if MAPROM_DEBUG + write_log(_T("MAPROM LPUT %08x %08x %d %08x\n"), addr, l, maprom_state, M68K_GETPC); +#endif uae_u32 *m; if (is_blizzard2060(&currprefs) && !maprom_state) return; addr &= blizzardmaprom_bank.mask; m = (uae_u32 *)(blizzardmaprom_bank.baseaddr + addr); do_put_mem_long(m, l); -#if MAPROM_DEBUG - write_log(_T("LPUT %08x %08x %d %08x\n"), addr, l, maprom_state, M68K_GETPC); -#endif if (maprom_state > 0 && !(addr & 0x80000)) { no_rom_protect(); m = (uae_u32 *)(kickmem_bank.baseaddr + addr); @@ -602,15 +602,15 @@ static void REGPARAM2 blizzardmaprom_lput(uaecptr addr, uae_u32 l) } static void REGPARAM2 blizzardmaprom_wput(uaecptr addr, uae_u32 w) { +#if MAPROM_DEBUG + write_log(_T("MAPROM WPUT %08x %08x %d\n"), addr, w, maprom_state); +#endif uae_u16 *m; if (is_blizzard2060(&currprefs) && !maprom_state) return; addr &= blizzardmaprom_bank.mask; m = (uae_u16 *)(blizzardmaprom_bank.baseaddr + addr); do_put_mem_word(m, w); -#if MAPROM_DEBUG - write_log(_T("WPUT %08x %08x %d\n"), addr, w, maprom_state); -#endif if (maprom_state > 0 && !(addr & 0x80000)) { no_rom_protect(); m = (uae_u16 *)(kickmem_bank.baseaddr + addr); @@ -619,13 +619,13 @@ static void REGPARAM2 blizzardmaprom_wput(uaecptr addr, uae_u32 w) } static void REGPARAM2 blizzardmaprom_bput(uaecptr addr, uae_u32 b) { +#if MAPROM_DEBUG + write_log(_T("MAPROM LPUT %08x %08x %d\n"), addr, b, maprom_state); +#endif if (is_blizzard2060(&currprefs) && !maprom_state) return; addr &= blizzardmaprom_bank.mask; blizzardmaprom_bank.baseaddr[addr] = b; -#if MAPROM_DEBUG - write_log(_T("LPUT %08x %08x %d\n"), addr, b, maprom_state); -#endif if (maprom_state > 0 && !(addr & 0x80000)) { no_rom_protect(); kickmem_bank.baseaddr[addr] = b; @@ -1183,7 +1183,9 @@ void blizzardppc_irq(int id, int level) static uae_u32 REGPARAM2 blizzardio_bget(uaecptr addr) { uae_u8 v = 0; - //write_log(_T("CS IO XBGET %08x=%02X PC=%08x\n"), addr, v & 0xff, M68K_GETPC); +#if CPUBOARD_IO_LOG > 1 + write_log(_T("CS IO XBGET %08x=%02X PC=%08x\n"), addr, v & 0xff, M68K_GETPC); +#endif if (is_magnum40(&currprefs)) { if ((addr & 0xff0f) == 0x0c0c) { int reg = (addr >> 4) & 7; @@ -1234,6 +1236,9 @@ static uae_u32 REGPARAM2 blizzardio_bget(uaecptr addr) } static uae_u32 REGPARAM2 blizzardio_wget(uaecptr addr) { +#if CPUBOARD_IO_LOG > 1 + write_log(_T("CS IO XWGET %08x PC=%08x\n"), addr, M68K_GETPC); +#endif if (is_csmk3(&currprefs) || is_blizzardppc(&currprefs)) { ;//write_log(_T("CS IO WGET %08x\n"), addr); //activate_debugger(); @@ -1277,7 +1282,9 @@ static uae_u32 REGPARAM2 blizzardio_wget(uaecptr addr) } static uae_u32 REGPARAM2 blizzardio_lget(uaecptr addr) { +#if CPUBOARD_IO_LOG > 1 write_log(_T("CS IO LGET %08x PC=%08x\n"), addr, M68K_GETPC); +#endif if (is_blizzard2060(&currprefs) && mapromconfigured()) { if (addr & 0x10000000) { maprom_state = 0; @@ -1504,10 +1511,12 @@ static void REGPARAM2 blizzardio_bput(uaecptr addr, uae_u32 v) } static void REGPARAM2 blizzardio_wput(uaecptr addr, uae_u32 v) { +#if CPUBOARD_IO_LOG > 1 + write_log(_T("CS IO WPUT %08x %04x PC=%08x\n"), addr, v, M68K_GETPC); +#endif if (is_fusionforty(&currprefs)) { write_log(_T("FusionForty IO WPUT %08x %04x %08x\n"), addr, v, M68K_GETPC); } else if (is_blizzard(&currprefs)) { - write_log(_T("CS IO WPUT %08x %04x\n"), addr, v); if((addr & 65535) == (BLIZZARD_BOARD_DISABLE & 65535)) { if (v != 0xcafe) return; @@ -1532,7 +1541,9 @@ static void REGPARAM2 blizzardio_wput(uaecptr addr, uae_u32 v) } static void REGPARAM2 blizzardio_lput(uaecptr addr, uae_u32 v) { +#if CPUBOARD_IO_LOG > 1 write_log(_T("CPU IO LPUT %08x %08x\n"), addr, v); +#endif if (is_csmk1(&currprefs)) { if (addr == 0x80f80000) { maprom_state = 1; diff --git a/custom.cpp b/custom.cpp index 090dd3b5..f9adc301 100644 --- a/custom.cpp +++ b/custom.cpp @@ -9159,7 +9159,7 @@ static bool linesync_beam_single_single(void) while (!currprefs.turbo_emulation && sync_timeout_check(maxtime)) { maybe_process_pull_audio(); vp = target_get_display_scanline(-1); - if (vp >= 0 && vp < vp < vsync_activeheight / 2) + if (vp >= 0 && vp < vsync_activeheight / 2) break; if (currprefs.m68k_speed < 0 && !was_syncline) { is_syncline = -3; diff --git a/disk.cpp b/disk.cpp index 34e184ec..12d3f14c 100644 --- a/disk.cpp +++ b/disk.cpp @@ -263,7 +263,7 @@ static uae_u32 disk_checksum (uae_u8 *p, uae_u8 *c) int i; for (i = 0; i < FS_FLOPPY_BLOCKSIZE; i+= 4) cs += (p[i] << 24) | (p[i+1] << 16) | (p[i+2] << 8) | (p[i+3] << 0); - cs = -cs; + cs = (~cs) + 1; if (c) { c[0] = cs >> 24; c[1] = cs >> 16; c[2] = cs >> 8; c[3] = cs >> 0; } @@ -335,7 +335,7 @@ static void createrootblock (uae_u8 *sector, const TCHAR *disk_name) sector[12+3] = 0x48; sector[312] = sector[313] = sector[314] = sector[315] = (uae_u8)0xff; sector[316+2] = 881 >> 8; sector[316+3] = 881 & 255; - sector[432] = strlen (dn2); + sector[432] = (uae_u8)strlen (dn2); strcpy ((char*)sector + 433, dn2); sector[508 + 3] = 1; disk_date (sector + 420); @@ -383,7 +383,7 @@ static int createdirheaderblock (uae_u8 *sector, int parent, const char *filenam pl (sector, 0, 2); pl (sector, 4, block); disk_date (sector + 512 - 92); - sector[512 - 80] = strlen (filename); + sector[512 - 80] = (uae_u8)strlen (filename); strcpy ((char*)sector + 512 - 79, filename); pl (sector, 512 - 12, parent); pl (sector, 512 - 4, 2); @@ -402,7 +402,7 @@ static int createfileheaderblock (struct zfile *z,uae_u8 *sector, int parent, co int size; zfile_fseek (src, 0, SEEK_END); - size = zfile_ftell (src); + size = (int)zfile_ftell (src); zfile_fseek (src, 0, SEEK_SET); extensions = (size + FS_OFS_DATABLOCKSIZE - 1) / FS_OFS_DATABLOCKSIZE; @@ -413,7 +413,7 @@ static int createfileheaderblock (struct zfile *z,uae_u8 *sector, int parent, co pl (sector, 16, datablock); pl (sector, FS_FLOPPY_BLOCKSIZE - 188, size); disk_date (sector + FS_FLOPPY_BLOCKSIZE - 92); - sector[FS_FLOPPY_BLOCKSIZE - 80] = strlen (filename); + sector[FS_FLOPPY_BLOCKSIZE - 80] = (uae_u8)strlen (filename); strcpy ((char*)sector + FS_FLOPPY_BLOCKSIZE - 79, filename); pl (sector, FS_FLOPPY_BLOCKSIZE - 12, parent); pl (sector, FS_FLOPPY_BLOCKSIZE - 4, -3); @@ -511,7 +511,7 @@ static int createimagefromexe (struct zfile *src, struct zfile *dst) memset (bitmap, 0, sizeof bitmap); zfile_fseek (src, 0, SEEK_END); - exesize = zfile_ftell (src); + exesize = (int)zfile_ftell (src); blocks = (exesize + blocksize - 1) / blocksize; extensionblocks = (blocks + FS_EXTENSION_BLOCKS - 1) / FS_EXTENSION_BLOCKS; /* bootblock=2, root=1, bitmap=1, startup-sequence=1+1, exefileheader=1 */ @@ -1194,7 +1194,7 @@ static int drive_insert (drive * drv, struct uae_prefs *p, int dnum, const TCHAR if (drv->diskfile) { zfile_fread (buffer, sizeof (char), 8, drv->diskfile); zfile_fseek (drv->diskfile, 0, SEEK_END); - size = zfile_ftell (drv->diskfile); + size = (int)zfile_ftell (drv->diskfile); zfile_fseek (drv->diskfile, 0, SEEK_SET); } @@ -1973,7 +1973,7 @@ static void decode_diskspare (drive *drv) while (i < 512 + 8) chk ^= mfmbuf[i++]; secbuf[2] = chk >> 8; - secbuf[3] = chk; + secbuf[3] = (uae_u8)chk; deven = ((secbuf[0] << 24) | (secbuf[1] << 16) | (secbuf[2] << 8) | (secbuf[3])); @@ -2619,7 +2619,7 @@ static void floppy_get_rootblock (uae_u8 *dst, int block, const TCHAR *disk_name dst[312] = dst[313] = dst[314] = dst[315] = (uae_u8)0xff; // bitmap valid dst[316+2] = (block + 1) >> 8; dst[316+3] = (block + 1) & 255; // bitmap pointer char *s = ua ((disk_name && _tcslen (disk_name) > 0) ? disk_name : _T("empty")); - dst[432] = strlen (s); // name length + dst[432] = (uae_u8)strlen (s); // name length strcpy ((char*)dst + 433, s); // name xfree (s); dst[508 + 3] = 1; // secondary type @@ -3690,6 +3690,40 @@ static void wordsync_detected(bool startup) } } +static void disk_doupdate_read_reallynothing(int floppybits, bool state) +{ + // Only because there is at least one demo that checks wrong bit + // and hangs unless DSKSYNC bit it set with zero DSKSYNC value... + if (INTREQR() & 0x1000) + return; + while (floppybits >= get_floppy_speed()) { + bool skipbit = false; + word <<= 1; + word |= (state ? 1 : 0); + // MSBSYNC + if (adkcon & 0x200) { + if ((word & 0x0001) == 0 && bitoffset == 0) { + word = 0; + skipbit = true; + } + if ((word & 0x0001) == 0 && bitoffset == 8) { + word >>= 1; + skipbit = true; + } + } + if (!skipbit && (bitoffset & 7) == 7) { + dskbytr_val = word & 0xff; + dskbytr_val |= 0x8000; + } + if (!(adkcon & 0x200) && word == dsksync) { + INTREQ(0x8000 | 0x1000); + } + bitoffset++; + bitoffset &= 15; + floppybits -= get_floppy_speed(); + } +} + static void disk_doupdate_read_nothing(int floppybits) { while (floppybits >= get_floppy_speed()) { @@ -4010,8 +4044,9 @@ void DISK_update (int tohpos) for (dr = 0; dr < MAX_FLOPPY_DRIVES; dr++) { drive *drv = &floppy[dr]; - if (drv->motoroff || !drv->tracklen || !drv->trackspeed) + if (drv->motoroff || !drv->tracklen || !drv->trackspeed) { continue; + } drv->floppybitcounter += cycles; if ((selected | disabled) & (1 << dr)) { drv->mfmpos += drv->floppybitcounter / drv->trackspeed; @@ -4019,8 +4054,9 @@ void DISK_update (int tohpos) drv->floppybitcounter %= drv->trackspeed; continue; } - if (drv->diskfile) - drive_fill_bigbuf (drv, 0); + if (drv->diskfile) { + drive_fill_bigbuf(drv, 0); + } drv->mfmpos %= drv->tracklen; } int didaccess = 0; @@ -4036,10 +4072,11 @@ void DISK_update (int tohpos) done_jitter = true; } /* write dma and wordsync enabled: read until wordsync match found */ - if (dskdmaen == DSKDMA_WRITE && dma_enable) + if (dskdmaen == DSKDMA_WRITE && dma_enable) { disk_doupdate_write(drv->floppybitcounter, drv->trackspeed); - else + } else { disk_doupdate_read(drv, drv->floppybitcounter); + } drv->floppybitcounter %= drv->trackspeed; didaccess = 1; @@ -4050,6 +4087,8 @@ void DISK_update (int tohpos) disk_doupdate_read_nothing(cycles); } else if (dskdmaen == DSKDMA_WRITE) { disk_doupdate_write(cycles, get_floppy_speed()); + } else { + //disk_doupdate_read_reallynothing(cycles, true); } } @@ -4726,7 +4765,7 @@ static uae_u32 getadfcrc (drive *drv) if (!drv->diskfile) return 0; zfile_fseek (drv->diskfile, 0, SEEK_END); - size = zfile_ftell (drv->diskfile); + size = (int)zfile_ftell (drv->diskfile); b = xmalloc (uae_u8, size); if (!b) return 0; diff --git a/od-win32/posixemu.cpp b/od-win32/posixemu.cpp index 0fba9e22..2581fd36 100644 --- a/od-win32/posixemu.cpp +++ b/od-win32/posixemu.cpp @@ -56,7 +56,7 @@ void gettimeofday (struct timeval *tv, void *blah) ftime (&time); - tv->tv_sec = time.time; + tv->tv_sec = (long)time.time; tv->tv_usec = time.millitm * 1000; #else SYSTEMTIME st; diff --git a/od-win32/win32.h b/od-win32/win32.h index 42a03521..c93f5161 100644 --- a/od-win32/win32.h +++ b/od-win32/win32.h @@ -20,12 +20,12 @@ #define LANG_DLL_FULL_VERSION_MATCH 1 #if WINUAEPUBLICBETA -#define WINUAEBETA _T("Beta 16") +#define WINUAEBETA _T("Beta 17") #else #define WINUAEBETA _T("") #endif -#define WINUAEDATE MAKEBD(2021, 1, 23) +#define WINUAEDATE MAKEBD(2021, 2, 20) //#define WINUAEEXTRA _T("AmiKit Preview") //#define WINUAEEXTRA _T("Amiga Forever Edition") diff --git a/od-win32/winuaechangelog.txt b/od-win32/winuaechangelog.txt index 358adea1..e1ffe46e 100644 --- a/od-win32/winuaechangelog.txt +++ b/od-win32/winuaechangelog.txt @@ -1,4 +1,18 @@ +Beta 17: + +- OSD led status bar positioning fixed (b16) +- OSD led status bar is now DPI aware. (NOTE: moving window from monitor to another monitor with different DPI does not yet work correctly) +- BPLCON0 UHRES-bit also disables DDFSTRT/STOP limits according to Alice schematics. +- Sprites in right border were still not fully correct when they crossed "hidden" hpos=0 position. Sprite didn't disappear if start position was after hpos=0 wraparound and sprite wrap around if it started just before hpos=0 stopped too early, last few pixels were missing before start of hblank. (Thanks ross for test program) +- One more blitter fix, last D write was done even if blit didn't have D channel enabled. +- CPU Idle slider value added to GUI. (It was not very clear which end of slider disabled it) +- Loading CD32 statefile with CD audio playback active: mute state was not always correctly restored. +- Loading CD32 statefile with CD audio playback active but paused: pause state was ignored. +- Loading CDTV statefile with CD audio playback active but paused: very short bit of audio was played before audio paused. +- Added "Restart emulation" input target. Does same as GUI "Restart" button. +- Reverted few b1 bitplane emulation changes. Complete rewrite will be planned for later because current emulation behavior is not really correct when compared against Alice schematics. + Beta 16: - Hard reset leaked indirect mode allocated memory banks (outside of JIT compatible address range), for example Z3 RAM outside of partially outside of first ~2G of address space. -- 2.47.3