From ff4f290ccfbb7b268c898de62cabfca61e1467bc Mon Sep 17 00:00:00 2001 From: Toni Wilen Date: Wed, 20 Aug 2014 16:32:53 +0300 Subject: [PATCH] 2900b13 --- a2065.cpp | 17 ++++++++- blkdev_cdimage.cpp | 10 ++++- drawing.cpp | 33 ++++++++++++++--- hardfile.cpp | 22 +++++++---- od-win32/win32.h | 4 +- od-win32/win32gui.cpp | 72 +++++++++++++++++++++++++++--------- od-win32/winuaechangelog.txt | 11 ++++++ 7 files changed, 132 insertions(+), 37 deletions(-) diff --git a/a2065.cpp b/a2065.cpp index a0027566..b9358d20 100644 --- a/a2065.cpp +++ b/a2065.cpp @@ -111,6 +111,8 @@ static uae_u8 broadcast[6] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }; #define RX_STP 0x0200 #define RX_ENP 0x0100 +DECLARE_MEMORY_FUNCTIONS(a2065); + static uae_u16 gword2 (uae_u8 *p) { return (p[0] << 8) | p[1]; @@ -828,12 +830,23 @@ static void REGPARAM2 a2065_lput (uaecptr addr, uae_u32 l) a2065_wput (addr + 2, l); } -DECLARE_MEMORY_FUNCTIONS(a2065); +uae_u8 *REGPARAM2 a2065_xlate(uaecptr addr) +{ + if ((addr & 65535) >= RAM_OFFSET) + return &boardram[addr & RAM_MASK]; + return default_xlate(addr); +} + +int REGPARAM2 a2065_check(uaecptr a, uae_u32 b) +{ + a &= 65535; + return a >= RAM_OFFSET && a + b < 65536; +} static addrbank a2065_bank = { a2065_lget, a2065_wget, a2065_bget, a2065_lput, a2065_wput, a2065_bput, - default_xlate, default_check, NULL, NULL, _T("A2065 Z2 Ethernet"), + a2065_xlate, a2065_check, NULL, NULL, _T("A2065 Z2 Ethernet"), a2065_lgeti, a2065_wgeti, ABFLAG_IO }; diff --git a/blkdev_cdimage.cpp b/blkdev_cdimage.cpp index 0e0cbea0..ffc666b0 100644 --- a/blkdev_cdimage.cpp +++ b/blkdev_cdimage.cpp @@ -149,9 +149,11 @@ static int do_read (struct cdunit *cdu, struct cdtoc *t, uae_u8 *data, int secto if (t->enctype == ENC_CHD) { #ifdef WITH_CHD int type = CD_TRACK_MODE1_RAW; + uae_u8 tmpbuf[2352]; + if (size > 2352) + return 0; switch (size) { - default: case 2352: type = CD_TRACK_MODE1_RAW; break; @@ -164,7 +166,11 @@ static int do_read (struct cdunit *cdu, struct cdtoc *t, uae_u8 *data, int secto } if (audio && size == 2352) type = CD_TRACK_AUDIO; - return cdrom_read_data(cdu->chd_cdf, sector + t->offset, data, type, true) != 0; + if (cdrom_read_data(cdu->chd_cdf, sector + t->offset, tmpbuf, type, true)) { + memcpy(data, tmpbuf + offset, size); + return 1; + } + return 0; #endif } else if (t->handle) { int ssize = t->size + t->skipsize; diff --git a/drawing.cpp b/drawing.cpp index d36b114f..e068b103 100644 --- a/drawing.cpp +++ b/drawing.cpp @@ -1824,6 +1824,14 @@ static void gen_pfield_tables (void) dblpf_ind1[i] = i >= 128 ? i & 0x7F : (plane1 == 0 ? plane2 : plane1); dblpf_ind2[i] = i >= 128 ? i & 0x7F : (plane2 == 0 ? plane1 : plane2); + // Hack for OCS/ECS-only dualplayfield chipset bug. + // If PF2P2 is invalid (>5), playfield color becomes transparent but + // playfield still hides playfield under it! (if plfpri is set) + if (i & 64) { + dblpf_ind2[i] = 0; + dblpf_ind1[i] = 0; + } + sprite_offs[i] = (i & 15) ? 0 : 2; clxtab[i] = ((((i & 3) && (i & 12)) << 9) @@ -1922,16 +1930,29 @@ static void clear_bitplane_border_aga (void) } #endif -/* emulate OCS/ECS only undocumented "SWIV" hardware feature */ static void weird_bitplane_fix (int start, int end) { - int i; int sh = lores_shift; uae_u8 *p = pixdata.apixels + pixels_offset; - for (i = start >> sh; i < end >> sh; i++) { - if (p[i] > 16) - p[i] = 16; + start >>= sh; + end >>= sh; + if (bplplanecnt == 5 && !bpldualpf) { + /* emulate OCS/ECS only undocumented "SWIV" hardware feature */ + for (int i = start; i < end; i++) { + if (p[i] & 16) + p[i] = 16; + } + } else if (bpldualpf && bpldualpfpri) { + /* in dualplayfield mode this feature is even more strange.. */ + for (int i = start; i < end; i++) { + if (p[i] & (2 | 8 | 32)) + p[i] |= 0x40; + } + } else if (bpldualpf && !bpldualpfpri) { + for (int i = start; i < end; i++) { + p[i] &= ~(2 | 8 | 32); + } } } @@ -2362,7 +2383,7 @@ static void do_color_changes (line_draw_func worker_border, line_draw_func worke // playfield if (nextpos_in_range > lastpos && lastpos >= playfield_start && lastpos < playfield_end) { int t = nextpos_in_range <= playfield_end ? nextpos_in_range : playfield_end; - if (plf2pri > 5 && bplplanecnt == 5 && !(currprefs.chipset_mask & CSMASK_AGA)) + if (plf2pri > 5 && !(currprefs.chipset_mask & CSMASK_AGA)) weird_bitplane_fix (lastpos, t); if (bplxor && may_require_hard_way && worker_pfield != pfield_do_linetoscr_bordersprite_aga) playfield_hard_way(worker_pfield, lastpos, t); diff --git a/hardfile.cpp b/hardfile.cpp index 3ad51b1c..e611c039 100644 --- a/hardfile.cpp +++ b/hardfile.cpp @@ -69,10 +69,10 @@ struct hardfileprivdata { uaecptr changeint; }; -#define HFD_VHD_DYNAMIC 4 -#define HFD_VHD_FIXED 3 -#define HFD_CHD_OTHER 2 -#define HFD_CHD_HD 1 +#define HFD_CHD_OTHER 5 +#define HFD_CHD_HD 4 +#define HFD_VHD_DYNAMIC 3 +#define HFD_VHD_FIXED 2 STATIC_INLINE uae_u32 gl (uae_u8 *p) { @@ -486,13 +486,19 @@ int hdf_open (struct hardfiledata *hfd, const TCHAR *pname) zf = zfile_fopen (nametmp, _T("rb")); } if (zf) { - int err; + int err = CHDERR_FILE_NOT_WRITEABLE; hard_disk_file *chdf; chd_file *cf = new chd_file(); - err = cf->open(*zf, false, NULL); + if (!chd_readonly) + err = cf->open(*zf, true, NULL); + if (err == CHDERR_FILE_NOT_WRITEABLE) { + chd_readonly = true; + err = cf->open(*zf, false, NULL); + } if (err != CHDERR_NONE) { zfile_fclose (zf); - goto nonvhd; + delete cf; + goto end; } chdf = hard_disk_open(cf); if (!chdf) { @@ -503,7 +509,7 @@ int hdf_open (struct hardfiledata *hfd, const TCHAR *pname) hfd->hfd_type = HFD_CHD_HD; hfd->chd_handle = chdf; } - if (cf->compressed() || chd_readonly) + if (chd_readonly) hfd->ci.readonly = true; hfd->virtsize = cf->logical_bytes (); hfd->handle_valid = -1; diff --git a/od-win32/win32.h b/od-win32/win32.h index b632ced8..ddfa8124 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("12") +#define WINUAEBETA _T("13") #else #define WINUAEBETA _T("") #endif -#define WINUAEDATE MAKEBD(2014, 8, 17) +#define WINUAEDATE MAKEBD(2014, 8, 20) //#define WINUAEEXTRA _T("AmiKit Preview") //#define WINUAEEXTRA _T("Amiga Forever Edition") diff --git a/od-win32/win32gui.cpp b/od-win32/win32gui.cpp index c01c17e1..106ec67e 100644 --- a/od-win32/win32gui.cpp +++ b/od-win32/win32gui.cpp @@ -1613,9 +1613,9 @@ static int listrom (int *roms) static void show_rom_list (void) { TCHAR *p; - TCHAR unavail[MAX_DPATH], avail[MAX_DPATH]; TCHAR *p1, *p2; int *rp; + bool first = true; int romtable[] = { 5, 4, -1, -1, // A500 1.2 6, 32, -1, -1, // A500 1.3 @@ -1627,20 +1627,54 @@ static void show_rom_list (void) 16, 46, 31, 13, 12, -1, -1, // A4000 17, -1, -1, // A4000T 18, -1, 19, -1, -1, // CD32 - 18, -1, 19, -1, 74, 23, -1, -1, // CD32 FMV 20, 21, 22, -1, 6, 32, -1, -1, // CDTV - 49, 50, 75, 51, 76, 77, -1, 5, 4, -1, -1, // ARCADIA - 46, 16, 17, 31, 13, 12, -1, -1, // highend, any 3.x A4000 + 49, 50, 75, 51, 76, 77, -1, 5, 4, -1, -2, // ARCADIA + 53, 54, 55, 56, -1, -1, // A590/A2091 57, 58, -1, -1, // A4091 + 18, -1, 19, -1, 74, 23, -1, -1, // CD32 FMV + 91, -1, -2, // Picasso IV + + 89, -1, -1, // 1230-IV + 89, -1, 94, -1, -1, // 1230-IV SCSI + 90, -1, -1, // 1260 + 90, -1, 94, -1, -1, // 1260 SCSI + 92, -1, -1, // 2060 + 93, -1, -1, // Warp Engine + 95, 101, -1, -1, // CS MK I + 96, -1, -1, // CS MK II + 97, -1, -1, // CS MK III + 99, 100, -1, -1, // BPPC + 98, -1 ,-2, // CSPPC + + 69, 67, 70, -1, -1, // nordic power + 65, 68, -1, -1, // x-power + 62, 60, -1, -1, // action cartridge + 52, 25, -1, -1, // ar 1 + 26, 27, 28, -1, -1, // ar 2 + 29, 30, -1, -1, // ar 3 + 0, 0, 0 }; - WIN32GUI_LoadUIString (IDS_ROM_AVAILABLE, avail, sizeof (avail) / sizeof (TCHAR)); - WIN32GUI_LoadUIString (IDS_ROM_UNAVAILABLE, unavail, sizeof (avail) / sizeof (TCHAR)); - _tcscat (avail, _T("\n")); - _tcscat (unavail, _T("\n")); - p1 = _T("A500 Boot ROM 1.2\0A500 Boot ROM 1.3\0A500+\0A600\0A1000\0A1200\0A3000\0A4000\0A4000T\0CD32\0CD32 FMV\0CDTV\0Arcadia Multi Select\0High end WinUAE\0A590/A2091 SCSI Boot ROM\0A4091 SCSI Boot ROM\0\0"); + p1 = _T("A500 Boot ROM 1.2\0A500 Boot ROM 1.3\0A500+\0A600\0A1000\0A1200\0A3000\0A4000\0A4000T\0") + _T("CD32\0CDTV\0Arcadia Multi Select\0") + + _T("A590/A2091 SCSI\0A4091 SCSI\0") + _T("CD32 Full Motion Video\0") + _T("Picasso IV\0") + + _T("Blizzard 1230-IV\0Blizzard 1260\0") + _T("Blizzard 1230-IV/SCSI\0Blizzard 1260/SCSI\0") + _T("Blizzard 2060\0Warp Engine\0") + _T("CyberStorm MK I\0CyberStorm MK II\0CyberStorm MK III\0") + _T("Blizzard PPC\0CyberStorm PPC\0") + + _T("Nordic Power\0X-Power Professional 500\0Action Cartridge Super IV Professional\0") + _T("Action Replay MK I\0Action Replay MK II\0Action Replay MK III\0") + _T("Action Replay 1200\0") + + _T("\0"); p = xmalloc (TCHAR, 100000); if (!p) @@ -1652,21 +1686,25 @@ static void show_rom_list (void) while(rp[0]) { int ok = 1; p2 = p1 + _tcslen (p1) + 1; - _tcscat (p, _T(" ")); - _tcscat (p, p1); _tcscat (p, _T(": ")); - while (*rp != -1) { + while (*rp >= 0) { if (ok) { ok = 0; if (listrom (rp)) ok = 1; } - while(*rp++ != -1); + while(*rp++ >= 0); + } + if (ok) { + if (!first) + _tcscat (p, _T(", ")); + first = false; + _tcscat (p, p1); + } + if (*rp == -2) { + _tcscat(p, _T("\n\n")); + first = true; } rp++; - if (ok) - _tcscat (p, avail); - else - _tcscat (p, unavail); p1 = p2; } diff --git a/od-win32/winuaechangelog.txt b/od-win32/winuaechangelog.txt index 4c4d12f4..95d4a74d 100644 --- a/od-win32/winuaechangelog.txt +++ b/od-win32/winuaechangelog.txt @@ -18,6 +18,17 @@ Things that may happen in 2015: - restore only single input target to default. +Beta 13: + +- Fixed vhd hardfiles. (b12) +- Emulated strange OCS/ECS feature similar to "SWIV scoreboard" feature (plane color > 16 becomes 16 when PF2PRI + is set to invalid value). It gets more interesting if mode is dual playfield and PF2P2 is invalid: odd planes + become transparent and it still hides even planes behind it if PF2PRI is set! (Running Man / Scoopex) +- A2065 buffer ram is now directly accessible, if someone wants to do some weird stuff with it (xlate and check + memory functions supported) +- ROM scanner result window redesigned, all expansions that need rom images added. +- Fixed CHD CD crash when sector size conversion was required. + Beta 12: - Windowed mode status bar button mouse click off-by-one fix. -- 2.47.3