From 1102b028b135243bf8b21c8b26aacef021de296f Mon Sep 17 00:00:00 2001 From: Toni Wilen Date: Sun, 17 Sep 2023 18:08:51 +0300 Subject: [PATCH] 5100b1 --- expansion.cpp | 4 +-- idecontrollers.cpp | 22 +++++++++++++---- include/options.h | 2 +- od-win32/darkmode.cpp | 2 +- od-win32/machdep/maccess.h | 50 ++++++++++++++++++++++++++++++++++---- od-win32/win32.h | 6 ++--- od-win32/win32gui.cpp | 50 +++++++++++++++++++++++--------------- 7 files changed, 99 insertions(+), 37 deletions(-) diff --git a/expansion.cpp b/expansion.cpp index 93266a1e..42e6961c 100644 --- a/expansion.cpp +++ b/expansion.cpp @@ -5066,8 +5066,8 @@ static const struct expansionboardsettings nexus_settings[] = { }; static const struct expansionboardsettings buddha_settings[] = { { - _T("Model\0") _T("Buddha\0") _T("Catweasel Z2\0"), - _T("model\0") _T("buddha\0") _T("cwz2\0"), + _T("Model\0") _T("Buddha\0") _T("Buddha plus one\0") _T("Catweasel Z2\0"), + _T("model\0") _T("buddha\0") _T("buddhaplusone\0") _T("cwz2\0"), true, false, 0 }, { diff --git a/idecontrollers.cpp b/idecontrollers.cpp index c65e4a07..83ac7aa5 100644 --- a/idecontrollers.cpp +++ b/idecontrollers.cpp @@ -482,6 +482,11 @@ static int get_buddha_reg(uaecptr addr, struct ide_board *board, int *portnum) if (addr < 0x800 || addr >= 0xe00) return reg; *portnum = (addr - 0x800) / 0x200; + if ((board->aci->rc->device_settings & 3) == 1) { + if ((addr & 0xc0) == 0x80) { + return IDE_DATA; + } + } reg = (addr >> 2) & 15; if (addr & 0x100) reg |= IDE_SECONDARY; @@ -652,14 +657,15 @@ static uae_u32 ide_read_byte(struct ide_board *board, uaecptr addr) if (board->ide[portnum]) v = get_ide_reg_multi(board, regnum, portnum, 1); } else if (addr >= 0xf00 && addr < 0x1000) { - if ((addr & ~3) == 0xf00) + if ((addr & ~3) == 0xf00) { v = ide_irq_check(board->ide[0], false) ? 0x80 : 0x00; - else if ((addr & ~3) == 0xf40) + } else if ((addr & ~3) == 0xf40) { v = ide_irq_check(board->ide[1], false) ? 0x80 : 0x00; - else if ((addr & ~3) == 0xf80) + } else if ((addr & ~3) == 0xf80 && (board->aci->rc->device_settings & 3) != 1) { v = ide_irq_check(board->ide[2], false) ? 0x80 : 0x00; - else + } else { v = 0; + } } else if (addr >= 0x7fc && addr <= 0x7ff) { v = board->userdata; } else { @@ -2483,8 +2489,10 @@ bool buddha_init(struct autoconfig_info *aci) load_rom_rc(aci->rc, ROMTYPE_BUDDHA, 32768, 0, ide->rom, 65536, LOADROM_EVENONLY_ODDONE | LOADROM_FILL); for (int i = 0; i < 16; i++) { uae_u8 b = ert->autoconfig[i]; - if (i == 1 && (aci->rc->device_settings & 1)) + if (i == 1 && (aci->rc->device_settings & 3) == 2) b = 42; + if (i == 9 && (aci->rc->device_settings & 3) == 1) + b = 6; ew(ide, i * 4, b); } aci->addrbank = ide->bank; @@ -2494,6 +2502,10 @@ bool buddha_init(struct autoconfig_info *aci) void buddha_add_ide_unit(int ch, struct uaedev_config_info *ci, struct romconfig *rc) { add_ide_standard_unit(ch, ci, rc, buddha_board, BUDDHA_IDE, false, false, 6); + if ((rc->device_settings & 3) == 1) { + // 3rd port has no interrupt + buddha_board[ci->controller_type_unit]->ide[2]->irq_inhibit = true; + } } void rochard_add_idescsi_unit(int ch, struct uaedev_config_info *ci, struct romconfig *rc) diff --git a/include/options.h b/include/options.h index b83c9028..6e82c899 100644 --- a/include/options.h +++ b/include/options.h @@ -15,7 +15,7 @@ #include "traps.h" #define UAEMAJOR 5 -#define UAEMINOR 0 +#define UAEMINOR 1 #define UAESUBREV 0 #define MAX_AMIGADISPLAYS 4 diff --git a/od-win32/darkmode.cpp b/od-win32/darkmode.cpp index 637536c5..4b6467d6 100644 --- a/od-win32/darkmode.cpp +++ b/od-win32/darkmode.cpp @@ -149,7 +149,7 @@ static void GetDarkmodeFontColor(void) constexpr bool CheckBuildNumber(DWORD buildNumber) { - return buildNumber <= 22621; + return buildNumber <= 25999; } void InitDarkMode(int enable) diff --git a/od-win32/machdep/maccess.h b/od-win32/machdep/maccess.h index e36c20c4..8ec4ea12 100644 --- a/od-win32/machdep/maccess.h +++ b/od-win32/machdep/maccess.h @@ -17,6 +17,49 @@ #define ALIGN_POINTER_TO32(p) ((~(uae_u32)(p)) & 3) #endif +#define do_get_mem_byte(a) ((uae_u32)*(uae_u8 *)(a)) +STATIC_INLINE void do_put_mem_byte(uae_u8 *a, uae_u8 v) +{ + *a = v; +} + +#ifdef HAVE_MOVBE + +#include + +STATIC_INLINE uae_u64 do_get_mem_quad(uae_u64 *a) +{ + return _load_be_u64(a); +} + +STATIC_INLINE uae_u32 do_get_mem_long(uae_u32 *a) +{ + return _load_be_u32(a); +} + +STATIC_INLINE uae_u16 do_get_mem_word(uae_u16 *a) +{ + return _load_be_u16(a); +} + +STATIC_INLINE void do_put_mem_quad(uae_u64 *a, uae_u64 v) +{ + _store_be_u64(a, v); +} + +STATIC_INLINE void do_put_mem_long(uae_u32 *a, uae_u32 v) +{ + _store_be_u32(a, v); +} + +STATIC_INLINE void do_put_mem_word(uae_u16 *a, uae_u16 v) +{ + _store_be_u16(a, v); +} + + +#else + STATIC_INLINE uae_u64 do_get_mem_quad(uae_u64 *a) { return _byteswap_uint64(*a); @@ -32,7 +75,6 @@ STATIC_INLINE uae_u16 do_get_mem_word(uae_u16 *a) return _byteswap_ushort(*a); } -#define do_get_mem_byte(a) ((uae_u32)*(uae_u8 *)(a)) STATIC_INLINE void do_put_mem_quad(uae_u64 *a, uae_u64 v) { @@ -49,10 +91,8 @@ STATIC_INLINE void do_put_mem_word(uae_u16 *a, uae_u16 v) *a = _byteswap_ushort(v); } -STATIC_INLINE void do_put_mem_byte(uae_u8 *a, uae_u8 v) -{ - *a = v; -} + +#endif STATIC_INLINE uae_u64 do_byteswap_64(uae_u64 v) { diff --git a/od-win32/win32.h b/od-win32/win32.h index bc7c77ad..d6b6321d 100644 --- a/od-win32/win32.h +++ b/od-win32/win32.h @@ -15,17 +15,17 @@ #define GETBDM(x) (((x) - ((x / 10000) * 10000)) / 100) #define GETBDD(x) ((x) % 100) -#define WINUAEPUBLICBETA 0 +#define WINUAEPUBLICBETA 1 #define LANG_DLL 1 #define LANG_DLL_FULL_VERSION_MATCH 1 #if WINUAEPUBLICBETA -#define WINUAEBETA _T("") +#define WINUAEBETA _T("Beta 1") #else #define WINUAEBETA _T("") #endif -#define WINUAEDATE MAKEBD(2023, 5, 31) +#define WINUAEDATE MAKEBD(2023, 9, 17) //#define WINUAEEXTRA _T("AmiKit Preview") //#define WINUAEEXTRA _T("Amiga Forever Edition") diff --git a/od-win32/win32gui.cpp b/od-win32/win32gui.cpp index 0d4e17a8..d6823bbd 100644 --- a/od-win32/win32gui.cpp +++ b/od-win32/win32gui.cpp @@ -8022,10 +8022,10 @@ static INT_PTR CALLBACK AboutDlgProc (HWND hDlg, UINT msg, WPARAM wParam, LPARAM pages[ABOUT_ID] = hDlg; currentpage = ABOUT_ID; - font1 = CreateFont(getscaledfontsize(60), 0, 0, 0, 0, + font1 = CreateFont(getscaledfontsize(-1) * 3, 0, 0, 0, 0, 0, FALSE, FALSE, DEFAULT_CHARSET, 0, 0, PROOF_QUALITY, FF_DONTCARE, _T("Segoe UI")); - font2 = CreateFont(getscaledfontsize(32), 0, 0, 0, 0, + font2 = CreateFont(getscaledfontsize(-1) * 2, 0, 0, 0, 0, 0, FALSE, FALSE, DEFAULT_CHARSET, 0, 0, PROOF_QUALITY, FF_DONTCARE, _T("Segoe UI")); @@ -14991,7 +14991,7 @@ static void updatehdfinfo(HWND hDlg, bool force, bool defaults, bool realdrive) } } if (i == 16) { - hdf_read (&hfd, id, 0, 512); + hdf_read (&hfd, id, 0, 512, &error); current_hfdlg.dostype = (id[0] << 24) | (id[1] << 16) | (id[2] << 8) | (id[3] << 0); } } @@ -22297,25 +22297,29 @@ static int floppyslot_addfile2 (struct uae_prefs *prefs, const TCHAR *file, int return -1; return drv; } -static int floppyslot_addfile (struct uae_prefs *prefs, const TCHAR *file, int drv, int firstdrv, int maxdrv) -{ - struct zdirectory *zd = zfile_opendir_archive (file, ZFD_ARCHIVE | ZFD_NORECURSE); - if (zd && zfile_readdir_archive (zd, NULL, true) > 1) { - TCHAR out[MAX_DPATH]; - while (zfile_readdir_archive (zd, out, true)) { - struct zfile *zf = zfile_fopen (out, _T("rb"), ZFD_NORMAL); - if (zf) { - int type = zfile_gettype (zf); - if (type == ZFILE_DISKIMAGE) { - drv = floppyslot_addfile2 (prefs, out, drv, firstdrv, maxdrv); - if (drv < 0) - break; +static int floppyslot_addfile (struct uae_prefs *prefs, const TCHAR *filepath, const TCHAR *file, int drv, int firstdrv, int maxdrv) +{ + if (!filepath[0]) { + struct zdirectory *zd = zfile_opendir_archive (file, ZFD_ARCHIVE | ZFD_NORECURSE); + if (zd && zfile_readdir_archive (zd, NULL, true) > 1) { + TCHAR out[MAX_DPATH]; + while (zfile_readdir_archive (zd, out, true)) { + struct zfile *zf = zfile_fopen (out, _T("rb"), ZFD_NORMAL); + if (zf) { + int type = zfile_gettype (zf); + if (type == ZFILE_DISKIMAGE) { + drv = floppyslot_addfile2 (prefs, out, drv, firstdrv, maxdrv); + if (drv < 0) + break; + } } } + zfile_closedir_archive (zd); + } else { + drv = floppyslot_addfile2 (prefs, file, drv, firstdrv, maxdrv); } - zfile_closedir_archive (zd); } else { - drv = floppyslot_addfile2 (prefs, file, drv, firstdrv, maxdrv); + drv = floppyslot_addfile2(prefs, filepath, drv, firstdrv, maxdrv); } return drv; } @@ -22430,6 +22434,7 @@ int dragdrop (HWND hDlg, HDROP hd, struct uae_prefs *prefs, int currentpage) struct zfile *z; int type = -1, zip = 0; int mask; + TCHAR filepath[MAX_DPATH]; DragQueryFile (hd, i, file, sizeof (file) / sizeof (TCHAR)); my_resolvesoftlink (file, sizeof file / sizeof (TCHAR), true); @@ -22447,6 +22452,7 @@ int dragdrop (HWND hDlg, HDROP hd, struct uae_prefs *prefs, int currentpage) mask = ZFD_ALL; else mask = ZFD_NORMAL; + filepath[0] = 0; if (type < 0) { if (currentpage < 0) { z = zfile_fopen (file, _T("rb"), 0); @@ -22462,8 +22468,12 @@ int dragdrop (HWND hDlg, HDROP hd, struct uae_prefs *prefs, int currentpage) zip = 1; } else { type = zfile_gettype (z); - if (type == ZFILE_ROM) + if (type == ZFILE_ROM) { rd = getromdatabyzfile (z); + } + if (type > 0) { + _tcscpy(filepath, z->name); + } } zfile_fclose (z); z = NULL; @@ -22509,7 +22519,7 @@ int dragdrop (HWND hDlg, HDROP hd, struct uae_prefs *prefs, int currentpage) } else if (harddrive) { do_filesys_insert (file, cnt); } else { - drv = floppyslot_addfile (prefs, file, drv, firstdrv, i); + drv = floppyslot_addfile (prefs, filepath, file, drv, firstdrv, i); if (drv < 0) i = cnt; } -- 2.47.3