From 79f4bf31964e82eb011ca54533e2c147b10406db Mon Sep 17 00:00:00 2001 From: Toni Wilen Date: Sun, 28 Oct 2007 16:01:50 +0200 Subject: [PATCH] imported winuaesrc1450b6.zip --- akiko.c | 91 ++++++++++++----------- custom.c | 11 ++- debug.c | 1 + drawing.c | 4 +- filesys.c | 30 +++++--- od-win32/blkdev_win32_aspi.c | 9 ++- od-win32/dxwrap.c | 4 +- od-win32/parser.c | 6 +- od-win32/win32.h | 4 +- od-win32/win32gfx.c | 8 +- od-win32/win32gui.c | 18 +++-- od-win32/winuae_msvc/winuae_msvc.8.vcproj | 2 +- od-win32/winuae_msvc/winuae_msvc.vcproj | 8 +- od-win32/winuaechangelog.txt | 19 +++++ 14 files changed, 126 insertions(+), 89 deletions(-) diff --git a/akiko.c b/akiko.c index 4d180d8d..ae4057f3 100644 --- a/akiko.c +++ b/akiko.c @@ -1168,21 +1168,41 @@ static void REGPARAM3 akiko_bput (uaecptr, uae_u32) REGPARAM; static uae_u32 akiko_bget2 (uaecptr addr, int msg) { - uae_u8 v; + uae_u8 v = 0; addr &= 0xffff; - uae_sem_wait (&akiko_sem); + switch (addr) { /* "CAFE" = Akiko identification. * Kickstart ignores Akiko C2P if this ID isn't correct */ - case 0x02: - v = 0xCA; - break; - case 0x03: - v = 0xFE; - break; + case 0x02: + return 0xCA; + case 0x03: + return 0xFE; + /* NVRAM */ + case 0x30: + case 0x31: + case 0x32: + case 0x33: + if (currprefs.cs_cd32nvram) + v = akiko_nvram_read (addr - 0x30); + return v; + + /* C2P */ + case 0x38: + case 0x39: + case 0x3a: + case 0x3b: + if (currprefs.cs_cd32c2p) + v = akiko_c2p_read (addr - 0x38); + return v; + } + + uae_sem_wait (&akiko_sem); + switch (addr) + { if (currprefs.cs_cd32cd) { /* CDROM control */ case 0x04: @@ -1235,24 +1255,6 @@ static uae_u32 akiko_bget2 (uaecptr addr, int msg) break; } - /* NVRAM */ - case 0x30: - case 0x31: - case 0x32: - case 0x33: - if (currprefs.cs_cd32nvram) - v = akiko_nvram_read (addr - 0x30); - break; - - /* C2P */ - case 0x38: - case 0x39: - case 0x3a: - case 0x3b: - if (currprefs.cs_cd32c2p) - v = akiko_c2p_read (addr - 0x38); - break; - default: write_log ("akiko_bget: unknown address %08.8X\n", addr); v = 0; @@ -1324,8 +1326,29 @@ static void akiko_bput2 (uaecptr addr, uae_u32 v, int msg) addr &= 0xffff; v &= 0xff; + if(msg && addr < 0x30 && AKIKO_DEBUG_IO) write_log ("akiko_bput %08.8X: %08.8X=%02.2X\n", M68K_GETPC, addr, v & 0xff); + + switch (addr) + { + case 0x30: + case 0x31: + case 0x32: + case 0x33: + if (currprefs.cs_cd32nvram) + akiko_nvram_write (addr - 0x30, v); + return; + + case 0x38: + case 0x39: + case 0x3a: + case 0x3b: + if (currprefs.cs_cd32c2p) + akiko_c2p_write (addr - 0x38, v); + return; + } + uae_sem_wait (&akiko_sem); switch (addr) { @@ -1390,22 +1413,6 @@ static void akiko_bput2 (uaecptr addr, uae_u32 v, int msg) break; } - case 0x30: - case 0x31: - case 0x32: - case 0x33: - if (currprefs.cs_cd32nvram) - akiko_nvram_write (addr - 0x30, v); - break; - - case 0x38: - case 0x39: - case 0x3a: - case 0x3b: - if (currprefs.cs_cd32c2p) - akiko_c2p_write (addr - 0x38, v); - break; - default: write_log ("akiko_bput: unknown address %08.8X\n", addr); break; diff --git a/custom.c b/custom.c index 38127892..091c96ea 100644 --- a/custom.c +++ b/custom.c @@ -3308,10 +3308,10 @@ void dump_aga_custom (void) c2 = c1 + 64; c3 = c2 + 64; c4 = c3 + 64; - rgb1 = current_colors.color_regs_aga[c1]; - rgb2 = current_colors.color_regs_aga[c2]; - rgb3 = current_colors.color_regs_aga[c3]; - rgb4 = current_colors.color_regs_aga[c4]; + rgb1 = current_colors.color_regs_aga[c1] | (color_regs_aga_genlock[c1] << 31); + rgb2 = current_colors.color_regs_aga[c2] | (color_regs_aga_genlock[c2] << 31); + rgb3 = current_colors.color_regs_aga[c3] | (color_regs_aga_genlock[c3] << 31); + rgb4 = current_colors.color_regs_aga[c4] | (color_regs_aga_genlock[c4] << 31); console_out("%3d %08.8X %3d %08.8X %3d %08.8X %3d %08.8X\n", c1, rgb1, c2, rgb2, c3, rgb3, c4, rgb4); } @@ -4752,8 +4752,7 @@ void customreset (int hardreset) bogusframe = 1; - sprite_buffer_res = (currprefs.chipset_mask & CSMASK_AGA) ? RES_SUPERHIRES : ((currprefs.chipset_mask & CSMASK_ECS_DENISE) ? RES_HIRES : RES_LORES); - //sprite_buffer_res = RES_HIRES; + sprite_buffer_res = (currprefs.chipset_mask & CSMASK_AGA) ? RES_SUPERHIRES : RES_LORES; if (savestate_state == STATE_RESTORE) { uae_u16 v; uae_u32 vv; diff --git a/debug.c b/debug.c index 41557b8e..c5f77822 100644 --- a/debug.c +++ b/debug.c @@ -133,6 +133,7 @@ static char help[] = { " Also enables level 1 disk logging\n" " did Enable disk logging\n" " dj [] Enable joystick/mouse input debugging\n" + " smc Enable self-modifying code detector\n" " dm Dump current address space map\n" #ifdef _WIN32 " x Close debugger.\n" diff --git a/drawing.c b/drawing.c index 698fc252..78285a81 100644 --- a/drawing.c +++ b/drawing.c @@ -971,7 +971,6 @@ STATIC_INLINE void draw_sprites_2 (struct sprite_entry *e, int ham, int dualpf, #endif } else if (ham) { - col = color_reg_get (&colors_for_drawing, col); #ifdef AGA if (aga) { @@ -985,6 +984,7 @@ STATIC_INLINE void draw_sprites_2 (struct sprite_entry *e, int ham, int dualpf, } else { #endif + col = color_reg_get (&colors_for_drawing, col); ham_linebuf[window_pos] = col; if (sizedoubling) ham_linebuf[window_pos + 1] = col; @@ -1673,7 +1673,7 @@ static void pfield_draw_line (int lineno, int gfx_ypos, int follow_ypos) /* The problem is that we must call decode_ham() BEFORE we do the sprites. */ - if (! border && dp_for_drawing->ham_seen) { + if (dp_for_drawing->ham_seen) { init_ham_decoding (); if (dip_for_drawing->nr_color_changes == 0) { /* The easy case: need to do HAM decoding only once for the diff --git a/filesys.c b/filesys.c index d9424c62..b3c1dfdb 100644 --- a/filesys.c +++ b/filesys.c @@ -996,6 +996,20 @@ void filesys_vsync (void) } } } +static void filesys_delayed_change (Unit *u, int frames, const char *rootdir, const char *volume, int readonly, int flags) +{ + u->reinsertdelay = 50; + u->newflags = flags; + u->newreadonly = readonly; + u->newrootdir = my_strdup (rootdir); + if (volume) + u->newvolume = my_strdup (volume); + filesys_eject(u->unit); + if (!rootdir || strlen (rootdir) == 0) + u->reinsertdelay = 0; + if (u->reinsertdelay > 0) + write_log ("FILESYS: delayed insert %d: '%s' ('%s')\n", u->unit, volume ? volume : "", rootdir); +} int filesys_media_change (const char *rootdir, int inserted, struct uaedev_config_info *uci) { @@ -1014,8 +1028,10 @@ int filesys_media_change (const char *rootdir, int inserted, struct uaedev_confi if (is_hardfile (u->unit) == FILESYS_VIRTUAL) { ui = &mountinfo.ui[u->unit]; if (ui->rootdir && !memcmp (ui->rootdir, rootdir, strlen (rootdir)) && strlen (rootdir) + 3 >= strlen (ui->rootdir)) { - if (filesys_isvolume (u) && inserted) + if (filesys_isvolume (u) && inserted) { + filesys_delayed_change (u, 50, rootdir, uci->volname, uci->readonly, 0); return 0; + } nr = u->unit; break; } @@ -1140,17 +1156,7 @@ int filesys_insert (int nr, char *volume, const char *rootdir, int readonly, int if (is_hardfile(nr) != FILESYS_VIRTUAL) return 0; if (filesys_isvolume (u)) { - u->reinsertdelay = 50; - u->newflags = flags; - u->newreadonly = readonly; - u->newrootdir = my_strdup (rootdir); - if (volume) - u->newvolume = my_strdup (volume); - filesys_eject(nr); - if (!rootdir || strlen (rootdir) == 0) - u->reinsertdelay = 0; - if (u->reinsertdelay > 0) - write_log ("FILESYS: delayed insert %d '%s' ('%s')\n", nr, volume ? volume : "", rootdir); + filesys_delayed_change (u, 50, rootdir, volume, readonly, flags); return -1; } u->mountcount++; diff --git a/od-win32/blkdev_win32_aspi.c b/od-win32/blkdev_win32_aspi.c index 0fa60c3e..def901b2 100644 --- a/od-win32/blkdev_win32_aspi.c +++ b/od-win32/blkdev_win32_aspi.c @@ -106,7 +106,7 @@ const char *get_aspi_path(int aspitype) if (nero < 0) return NULL; nero = -1; - if (RegOpenKeyEx (HKEY_LOCAL_MACHINE, "SOFTWARE\\Ahead\\shared", 0, KEY_ALL_ACCESS, &key) == ERROR_SUCCESS) { + if (RegOpenKeyEx (HKEY_LOCAL_MACHINE, "SOFTWARE\\Ahead\\shared", 0, KEY_READ, &key) == ERROR_SUCCESS) { if (RegQueryValueEx (key, "NeroAPI", 0, &type, (LPBYTE)path_nero, &size) == ERROR_SUCCESS) { if (path_nero[strlen(path_nero) - 1] != '\\') strcat (path_nero, "\\"); @@ -173,7 +173,7 @@ static int open_driver (SCSI *scgp) int nero, frog; /* - * Check if ASPI library is already loaded yet + * Check if ASPI library is already loaded */ if (AspiLoaded == TRUE) return TRUE; @@ -217,7 +217,7 @@ static int open_driver (SCSI *scgp) pfnGetASPI32SupportInfo = (DWORD(*)(void))GetProcAddress(hAspiLib, "GetASPI32SupportInfo"); pfnSendASPI32Command = (DWORD(*)(LPSRB))GetProcAddress(hAspiLib, "SendASPI32Command"); - if ((pfnGetASPI32SupportInfo == NULL) || (pfnSendASPI32Command == NULL)) { + if (pfnGetASPI32SupportInfo == NULL || pfnSendASPI32Command == NULL) { write_log ("ASPI: obsolete wnaspi32.dll found\n"); return FALSE; } @@ -256,7 +256,8 @@ static int open_driver (SCSI *scgp) static void close_driver (void) { - if (!AspiLoaded) return; + if (!AspiLoaded) + return; AspiLoaded = FALSE; pfnGetASPI32SupportInfo = NULL; pfnSendASPI32Command = NULL; diff --git a/od-win32/dxwrap.c b/od-win32/dxwrap.c index 01fc8e7f..91ccf728 100644 --- a/od-win32/dxwrap.c +++ b/od-win32/dxwrap.c @@ -17,7 +17,7 @@ #include #include #include -#include +#include #include "sysdeps.h" #include "options.h" @@ -197,7 +197,7 @@ const char *DXError (HRESULT ddrval) HRESULT_FACILITY(ddrval), HRESULT_CODE(ddrval), HRESULT_CODE(ddrval), - DXGetErrorDescription8 (ddrval)); + DXGetErrorDescription9 (ddrval)); return dderr; } diff --git a/od-win32/parser.c b/od-win32/parser.c index 4600e260..82ad4640 100644 --- a/od-win32/parser.c +++ b/od-win32/parser.c @@ -331,9 +331,9 @@ int load_ghostscript (void) } if (!gsdll) { HKEY key; - DWORD ret = RegOpenKeyEx (HKEY_LOCAL_MACHINE, "SOFTWARE\\AFPL Ghostscript", 0, KEY_ALL_ACCESS, &key); + DWORD ret = RegOpenKeyEx (HKEY_LOCAL_MACHINE, "SOFTWARE\\AFPL Ghostscript", 0, KEY_READ, &key); if (ret |= ERROR_SUCCESS) - ret = RegOpenKeyEx (HKEY_LOCAL_MACHINE, "SOFTWARE\\GPL Ghostscript", 0, KEY_ALL_ACCESS, &key); + ret = RegOpenKeyEx (HKEY_LOCAL_MACHINE, "SOFTWARE\\GPL Ghostscript", 0, KEY_READ, &key); if (ret == ERROR_SUCCESS) { int idx = 0, cnt = 20; char tmp1[MAX_DPATH]; @@ -342,7 +342,7 @@ int load_ghostscript (void) FILETIME ft; if (RegEnumKeyEx (key, idx, tmp1, &size1, NULL, NULL, NULL, &ft) == ERROR_SUCCESS) { HKEY key2; - if (RegOpenKeyEx (key, tmp1, 0, KEY_ALL_ACCESS, &key2) == ERROR_SUCCESS) { + if (RegOpenKeyEx (key, tmp1, 0, KEY_READ, &key2) == ERROR_SUCCESS) { DWORD type = REG_SZ; DWORD size = sizeof (path); if (RegQueryValueEx (key2, "GS_DLL", 0, &type, (LPBYTE)path, &size) == ERROR_SUCCESS) { diff --git a/od-win32/win32.h b/od-win32/win32.h index 8be9115b..f5f57388 100644 --- a/od-win32/win32.h +++ b/od-win32/win32.h @@ -15,9 +15,9 @@ #define GETBDM(x) (((x) - ((x / 10000) * 10000)) / 100) #define GETBDD(x) ((x) % 100) -#define WINUAEBETA 5 +#define WINUAEBETA 6 #define WINUAEPUBLICBETA 1 -#define WINUAEDATE MAKEBD(2007, 10, 27) +#define WINUAEDATE MAKEBD(2007, 10, 28) #define WINUAEEXTRA "" #define WINUAEREV "" diff --git a/od-win32/win32gfx.c b/od-win32/win32gfx.c index c290e9dd..93f5d838 100644 --- a/od-win32/win32gfx.c +++ b/od-win32/win32gfx.c @@ -47,7 +47,7 @@ #include "parser.h" #include "lcd.h" -#define AMIGA_WIDTH_MAX 736 +#define AMIGA_WIDTH_MAX 752 #define AMIGA_HEIGHT_MAX 568 #define DM_DX_FULLSCREEN 1 @@ -2220,8 +2220,12 @@ static BOOL doInit (void) currentmode->native_depth = currentmode->current_depth; #if defined (GFXFILTER) if (currentmode->flags & (DM_OPENGL | DM_D3D | DM_SWSCALE)) { - currentmode->amiga_width = AMIGA_WIDTH_MAX >> (currprefs.gfx_resolution ? 0 : 1); + currentmode->amiga_width = AMIGA_WIDTH_MAX; currentmode->amiga_height = AMIGA_HEIGHT_MAX >> (currprefs.gfx_linedbl ? 0 : 1); + if (currprefs.gfx_resolution == 0) + currentmode->amiga_width >>= 1; + else if (currprefs.gfx_resolution > 1) + currentmode->amiga_width <<= 1; if (usedfilter) { if (usedfilter->x[0]) { currentmode->current_depth = (currprefs.gfx_filter_filtermode / 2) ? 32 : 16; diff --git a/od-win32/win32gui.c b/od-win32/win32gui.c index bebc3bdd..983490b3 100644 --- a/od-win32/win32gui.c +++ b/od-win32/win32gui.c @@ -5977,7 +5977,7 @@ struct fsvdlg_vals int rdb; }; -static struct fsvdlg_vals empty_fsvdlg = { "", "", "", 0, 1, 1, 0 }; +static struct fsvdlg_vals empty_fsvdlg = { "", "", "", 0, 1, 1, 1, 0 }; static struct fsvdlg_vals current_fsvdlg; struct hfdlg_vals @@ -6024,12 +6024,12 @@ static INT_PTR CALLBACK VolumeSettingsProc (HWND hDlg, UINT msg, WPARAM wParam, SetDlgItemText (hDlg, IDC_VOLUME_DEVICE, current_fsvdlg.device); SetDlgItemText (hDlg, IDC_PATH_NAME, current_fsvdlg.rootdir); SetDlgItemInt (hDlg, IDC_VOLUME_BOOTPRI, current_fsvdlg.bootpri >= -127 ? current_fsvdlg.bootpri : -127, TRUE); - if (archivehd) + if (archivehd > 0) current_fsvdlg.rw = 0; CheckDlgButton (hDlg, IDC_FS_RW, current_fsvdlg.rw); CheckDlgButton (hDlg, IDC_FS_AUTOBOOT, current_fsvdlg.autoboot); current_fsvdlg.donotmount = 0; - ew (hDlg, IDC_FS_RW, !archivehd); + ew (hDlg, IDC_FS_RW, archivehd <= 0); recursive--; } return TRUE; @@ -6044,8 +6044,8 @@ static INT_PTR CALLBACK VolumeSettingsProc (HWND hDlg, UINT msg, WPARAM wParam, case IDC_FS_SELECT_EJECT: SetDlgItemText (hDlg, IDC_PATH_NAME, ""); SetDlgItemText (hDlg, IDC_VOLUME_NAME, ""); - CheckDlgButton (hDlg, IDC_FS_RW, FALSE); - ew (hDlg, IDC_FS_RW, FALSE); + CheckDlgButton (hDlg, IDC_FS_RW, TRUE); + ew (hDlg, IDC_FS_RW, TRUE); archivehd = -1; break; case IDC_FS_SELECT_FILE: @@ -6388,8 +6388,12 @@ static void new_filesys (HWND hDlg, int entry) uci = add_filesys_config (&workprefs, entry, current_fsvdlg.device, current_fsvdlg.volume, current_fsvdlg.rootdir, ! current_fsvdlg.rw, 0, 0, 0, 0, bp, 0, 0, 0); - if (uci) - filesys_media_change (uci->rootdir, 1, uci); + if (uci) { + if (uci->rootdir[0]) + filesys_media_change (uci->rootdir, 1, uci); + else + filesys_eject (uci->configoffset); + } } static void new_hardfile (HWND hDlg, int entry) diff --git a/od-win32/winuae_msvc/winuae_msvc.8.vcproj b/od-win32/winuae_msvc/winuae_msvc.8.vcproj index f215ca5b..3090904e 100644 --- a/od-win32/winuae_msvc/winuae_msvc.8.vcproj +++ b/od-win32/winuae_msvc/winuae_msvc.8.vcproj @@ -1087,7 +1087,7 @@ /> - - diff --git a/od-win32/winuaechangelog.txt b/od-win32/winuaechangelog.txt index 66995e99..57b05766 100644 --- a/od-win32/winuaechangelog.txt +++ b/od-win32/winuaechangelog.txt @@ -1,4 +1,23 @@ +Beta 6: + +- do not call CD32 CD emulation handler when non-CD controller + Akiko registers are accessed. Fixes slowdown when program uses + C2P feature of Akiko (Wing Commander CD32, perhaps others) +- debugger ea command AGA genlock color bit support +- smc command added to debugger help +- Ghostscript and neroaspi registry detection didn't work without + admin privileges +- directory harddrive read/write status and volume name change + work again on the fly +- directory harddrive eject-button works again +- directory harddrive readwrite checkbox is not disabled anymore if + no path entered +- filter superhires support +- ECS Denise hires sprite support removed, hires/shres sprite support + is not compatible with OCS ham modes (and who needs ECS hires sprites + when AGA is much better choice..) + Beta 5: - AGA T (genlock transparency) color register bit emulated -- 2.47.3