]> git.unchartedbackwaters.co.uk Git - francis/winuae.git/commitdiff
Minimal Casablanca support, loads ROM, decodes it, inits a bit and then it hangs.
authorToni Wilen <twilen@winuae.net>
Sat, 7 Apr 2018 17:47:34 +0000 (20:47 +0300)
committerToni Wilen <twilen@winuae.net>
Sat, 7 Apr 2018 17:47:34 +0000 (20:47 +0300)
casablanca.cpp [new file with mode: 0644]
cfgfile.cpp
include/casablanca.h [new file with mode: 0644]
include/options.h
memory.cpp
od-win32/resources/resource.h
od-win32/resources/winuae.rc
od-win32/win32gui.cpp
od-win32/winuae_msvc15/winuae_msvc.vcxproj
rommgr.cpp

diff --git a/casablanca.cpp b/casablanca.cpp
new file mode 100644 (file)
index 0000000..a67a329
--- /dev/null
@@ -0,0 +1,60 @@
+#include "sysconfig.h"
+#include "sysdeps.h"
+
+#include "options.h"
+#include "uae.h"
+#include "memory.h"
+#include "newcpu.h"
+#include "casablanca.h"
+
+static uae_u32 REGPARAM2 casa_lget(uaecptr addr)
+{
+       write_log(_T("casa_lget %08x %08x\n"), addr, M68K_GETPC);
+       return 0;
+}
+static uae_u32 REGPARAM2 casa_wget(uaecptr addr)
+{
+       write_log(_T("casa_wget %08x %08x\n"), addr, M68K_GETPC);
+       return 0;
+}
+
+static uae_u32 REGPARAM2 casa_bget(uaecptr addr)
+{
+       uae_u8 v = 0;
+       write_log(_T("casa_bget %08x %08x\n"), addr, M68K_GETPC);
+
+       if (addr == 0x020007c3)
+               v = 4;
+
+       return v;
+}
+
+static void REGPARAM2 casa_lput(uaecptr addr, uae_u32 l)
+{
+       write_log(_T("casa_lput %08x %08x %08x\n"), addr, l, M68K_GETPC);
+}
+static void REGPARAM2 casa_wput(uaecptr addr, uae_u32 w)
+{
+       write_log(_T("casa_wput %08x %04x %08x\n"), addr, w & 0xffff, M68K_GETPC);
+}
+
+static void REGPARAM2 casa_bput(uaecptr addr, uae_u32 b)
+{
+       write_log(_T("casa_bput %08x %02x %08x\n"), addr, b & 0xff, M68K_GETPC);
+}
+
+static addrbank casa_ram_bank = {
+       casa_lget, casa_wget, casa_bget,
+       casa_lput, casa_wput, casa_bput,
+       default_xlate, default_check, NULL, NULL, _T("Casablanca IO"),
+       dummy_lgeti, dummy_wgeti, ABFLAG_IO | ABFLAG_SAFE, S_READ, S_WRITE,
+};
+
+
+void casablanca_map_overlay(void)
+{
+       // Casablanca has ROM at address zero, no chip ram, no overlay.
+       map_banks(&kickmem_bank, 524288 >> 16, 524288 >> 16, 0);
+       map_banks(&extendedkickmem_bank, 0 >> 16, 524288 >> 16, 0);
+       map_banks(&casa_ram_bank, 0x02000000 >> 16, 0x01000000 >> 16, 0);
+}
index 47fbb2329240eda396c1058ad46e961c0604ee16..c088afcf505487b37ca0a37a6e2a4381138b640d 100644 (file)
@@ -177,7 +177,7 @@ static const TCHAR *ksmirrortype[] = { _T("none"), _T("e0"), _T("a8+e0"), 0 };
 static const TCHAR *cscompa[] = {
        _T("-"), _T("Generic"), _T("CDTV"), _T("CDTV-CR"), _T("CD32"), _T("A500"), _T("A500+"), _T("A600"),
        _T("A1000"), _T("A1200"), _T("A2000"), _T("A3000"), _T("A3000T"), _T("A4000"), _T("A4000T"),
-       _T("Velvet"),
+       _T("Velvet"), _T("Casablanca"),
        NULL
 };
 static const TCHAR *qsmodes[] = {
@@ -8256,6 +8256,41 @@ static int bip_arcadia (struct uae_prefs *p, int config, int compa, int romcheck
        return 1;
 }
 
+static int bip_casablanca(struct uae_prefs *p, int config, int compa, int romcheck)
+{
+       int roms[8];
+
+       roms[0] = 231;
+       roms[1] = -1;
+
+       p->bogomem_size = 0;
+       p->chipmem_size = 0x200000;
+       switch (config)
+       {
+       default:
+       case 1:
+               p->cpu_model = 68040;
+               p->fpu_model = 68040;
+               p->mmu_model = 68040;
+               break;
+       case 2:
+               p->cpu_model = 68060;
+               p->fpu_model = 68060;
+               p->mmu_model = 68040;
+               break;
+       }
+       p->chipset_mask = CSMASK_AGA | CSMASK_ECS_AGNUS | CSMASK_ECS_DENISE;
+       p->cpu_compatible = p->address_space_24 = 0;
+       p->m68k_speed = -1;
+       p->immediate_blits = 0;
+       p->produce_sound = 2;
+       p->floppyslots[0].dfxtype = DRV_NONE;
+       p->floppyslots[1].dfxtype = DRV_NONE;
+       p->cs_compatible = CP_CASABLANCA;
+       built_in_chipset_prefs(p);
+       return configure_rom(p, roms, romcheck);
+}
+
 int built_in_prefs (struct uae_prefs *p, int model, int config, int compa, int romcheck)
 {
        int v = 0;
@@ -8294,9 +8329,12 @@ int built_in_prefs (struct uae_prefs *p, int model, int config, int compa, int r
                v = bip_cdtv (p, config, compa, romcheck);
                break;
        case 10:
-               v = bip_arcadia (p, config , compa, romcheck);
+               v = bip_arcadia(p, config, compa, romcheck);
                break;
        case 11:
+               v = bip_casablanca(p, config, compa, romcheck);
+               break;
+       case 12:
                v = bip_super (p, config, compa, romcheck);
                break;
        }
@@ -8495,6 +8533,8 @@ int built_in_chipset_prefs (struct uae_prefs *p)
                p->cs_z3autoconfig = true;
                p->cs_unmapped_space = 1;
                break;
+       case CP_CASABLANCA:
+               break;
        }
        if (p->cpu_model >= 68040)
                p->cs_bytecustomwritebug = true;
diff --git a/include/casablanca.h b/include/casablanca.h
new file mode 100644 (file)
index 0000000..b1b15b1
--- /dev/null
@@ -0,0 +1,2 @@
+
+void casablanca_map_overlay(void);
index 77fef87d242f3d49bc3efc749d15c9b9f812c85e..4a4fd96f361d626c97b4c2a794435193f790637e 100644 (file)
@@ -239,7 +239,7 @@ struct uaedev_config_data
 };
 
 enum { CP_GENERIC = 1, CP_CDTV, CP_CDTVCR, CP_CD32, CP_A500, CP_A500P, CP_A600, CP_A1000,
-       CP_A1200, CP_A2000, CP_A3000, CP_A3000T, CP_A4000, CP_A4000T, CP_VELVET };
+       CP_A1200, CP_A2000, CP_A3000, CP_A3000T, CP_A4000, CP_A4000T, CP_VELVET, CP_CASABLANCA };
 
 #define IDE_A600A1200 1
 #define IDE_A4000 2
index c544eeb40e7b97c4c43edfe4d81b2b7ebac0e910..ceab91cf18a4abd438a4b1d1606449da6fcb0f4a 100644 (file)
@@ -41,6 +41,7 @@
 #include "uae/ppc.h"
 #include "devices.h"
 #include "inputdevice.h"
+#include "casablanca.h"
 
 bool canbang;
 static bool rom_write_enabled;
@@ -2375,6 +2376,11 @@ void map_overlay (int chip)
        int size;
        addrbank *cb;
 
+       if (currprefs.cs_compatible == CP_CASABLANCA) {
+               casablanca_map_overlay();
+               return;
+       }
+
        size = chipmem_bank.allocated_size >= 0x180000 ? (chipmem_bank.allocated_size >> 16) : 32;
        if (bogomem_aliasing)
                size = 8;
@@ -3505,3 +3511,4 @@ uaecptr strcpyha_safe (uaecptr dst, const uae_char *src)
        } while (b);
        return res;
 }
+
index d110c827cc5dfb7aa94e5e9abad88effb51f8044..51aa0df0b5103e7a65d91563da754ff9d91eb7c3 100644 (file)
 #define IDS_QS_MODEL_A3000              1010
 #define IDS_QS_MODEL_A4000              1011
 #define IDS_QS_MODEL_A4000T             1012
+#define IDS_QS_MODEL_CASABLANCA         1013
 #define IDC_RESOLUTION                  1021
 #define IDC_SERIAL                      1022
 #define IDC_REFRESHRATE                 1022
index be3d724467074b94ebdeacf3c060ebfc47f1f08c..c05d7083cfc9dd8b5f7e33d0e07c0087b11985d3 100644 (file)
@@ -2023,7 +2023,7 @@ END
 
 STRINGTABLE
 BEGIN
-    IDS_QS_MODELS           "A500\nA500+\nA600\nA1000\nA1200\nA3000\nA4000\nCD32\nCDTV\nArcadia Multi Select system\nExpanded WinUAE example configuration"
+    IDS_QS_MODELS           "A500\nA500+\nA600\nA1000\nA1200\nA3000\nA4000\nCD32\nCDTV\nArcadia Multi Select system\nMacrosystem Casablanca\nExpanded WinUAE example configuration\n"
     IDS_QS_MODEL_A500       "1.3 ROM, OCS, 512 KB Chip + 512 KB Slow RAM (most common)\nThis configuration is capable of running most games and demos produced for first-generation hardware. Only few exceptions need a different configuration (e.g. the oldest games tend to be incompatible with this configuration).\n1.3 ROM, ECS Agnus, 512 KB Chip RAM + 512 KB Slow RAM\nLater hardware revision of the A500. Nearly 100% compatible with the previous configuration.\n1.3 ROM, ECS Agnus, 1 MB Chip RAM\nFew newer games and demos require this configuration.\n1.3 ROM, OCS Agnus, 512 KB Chip RAM\nVery old (e.g. pre-1988) games and demos may require this configuration.\n1.2 ROM, OCS Agnus, 512 KB Chip RAM\nAs available for the A1000, and installed on the first A500 and A2000 series. Some very old programs only work correctly with this configuration. Note: This system ROM version can only boot from floppy disk (no hard disk boot support).\n1.2 ROM, OCS Agnus, 512 KB Chip RAM + 512 KB Slow RAM\nThis configuration adds expansion memory to the first A500 produced. Try this if your game does not work with newer configurations, but works with the previous one. It could add some features to the game, including faster loading times. Note: This system ROM version can only boot from floppy disk (no hard disk boot support)."
     IDS_QS_MODEL_A500P      "Basic non-expanded configuration\nThe A500+ adds an ECS Agnus chip, 1 MB of Chip RAM and a 2.0 ROM to the A500. Many A500 games and demos don't work properly on an A500+.\n2 MB Chip RAM expanded configuration\n\n4 MB Fast RAM expanded configuration\n"
     IDS_QS_MODEL_A600       "Basic non-expanded configuration\nThe A600 is smaller than the A500+ and has an updated 2.0 ROM.\n2 MB Chip RAM expanded configuration\n\n4 MB Fast RAM expanded configuration\n"
@@ -2039,7 +2039,8 @@ BEGIN
     IDS_QS_MODEL_ARCADIA    "Arcadia\nArcadia Multi Select system is arcade platform developed by Arcadia and  Mastertronic. It is based on an A500 mainboard with ROM cage attached to expansion port. Arcadia ROM files go to ""Cartridge ROM File"" in ROM-panel."
     IDS_QS_MODEL_A3000      "1.4 ROM, 2MB Chip + 8MB Fast\n\n2.04 ROM, 2MB Chip + 8MB Fast\n\n3.1 ROM, 2MB Chip + 8MB Fast\n"
     IDS_QS_MODEL_A4000      "68030, 3.1 ROM, 2MB Chip + 8MB Fast\n\n68040, 3.1 ROM, 2MB Chip + 8MB Fast\n\nCyberStorm PPC\n"
-    IDS_QS_MODEL_A4000T     "A4000T (test)\nA4000T"
+    IDS_QS_MODEL_A4000T     "A4000T (test)\nA4000T\n"
+    IDS_QS_MODEL_CASABLANCA "Macrosystem Casablanca\n"
 END
 
 STRINGTABLE
index f119825864c4caea76e8beac23e0cbbd6cf1c2d7..69860f032bcb10cb0540e0d9e748f7d30341568f 100644 (file)
@@ -7980,24 +7980,25 @@ static INT_PTR CALLBACK ChipsetDlgProc (HWND hDlg, UINT msg, WPARAM wParam, LPAR
                pages[CHIPSET_ID] = hDlg;
                currentpage = CHIPSET_ID;
 
-               SendDlgItemMessage (hDlg, IDC_CS_EXT, CB_RESETCONTENT, 0, 0);
-               SendDlgItemMessage (hDlg, IDC_CS_EXT, CB_ADDSTRING, 0, (LPARAM)_T("Custom"));
+               SendDlgItemMessage(hDlg, IDC_CS_EXT, CB_RESETCONTENT, 0, 0);
+               SendDlgItemMessage(hDlg, IDC_CS_EXT, CB_ADDSTRING, 0, (LPARAM)_T("Custom"));
                WIN32GUI_LoadUIString(IDS_GENERIC, buffer, sizeof buffer / sizeof (TCHAR));
-               SendDlgItemMessage (hDlg, IDC_CS_EXT, CB_ADDSTRING, 0, (LPARAM)buffer);
-               SendDlgItemMessage (hDlg, IDC_CS_EXT, CB_ADDSTRING, 0, (LPARAM)_T("CDTV"));
-               SendDlgItemMessage (hDlg, IDC_CS_EXT, CB_ADDSTRING, 0, (LPARAM)_T("CDTV-CR"));
+               SendDlgItemMessage(hDlg, IDC_CS_EXT, CB_ADDSTRING, 0, (LPARAM)buffer);
+               SendDlgItemMessage(hDlg, IDC_CS_EXT, CB_ADDSTRING, 0, (LPARAM)_T("CDTV"));
+               SendDlgItemMessage(hDlg, IDC_CS_EXT, CB_ADDSTRING, 0, (LPARAM)_T("CDTV-CR"));
                SendDlgItemMessage(hDlg, IDC_CS_EXT, CB_ADDSTRING, 0, (LPARAM)_T("CD32"));
                SendDlgItemMessage(hDlg, IDC_CS_EXT, CB_ADDSTRING, 0, (LPARAM)_T("A500"));
-               SendDlgItemMessage (hDlg, IDC_CS_EXT, CB_ADDSTRING, 0, (LPARAM)_T("A500+"));
-               SendDlgItemMessage (hDlg, IDC_CS_EXT, CB_ADDSTRING, 0, (LPARAM)_T("A600"));
-               SendDlgItemMessage (hDlg, IDC_CS_EXT, CB_ADDSTRING, 0, (LPARAM)_T("A1000"));
-               SendDlgItemMessage (hDlg, IDC_CS_EXT, CB_ADDSTRING, 0, (LPARAM)_T("A1200"));
-               SendDlgItemMessage (hDlg, IDC_CS_EXT, CB_ADDSTRING, 0, (LPARAM)_T("A2000"));
-               SendDlgItemMessage (hDlg, IDC_CS_EXT, CB_ADDSTRING, 0, (LPARAM)_T("A3000"));
-               SendDlgItemMessage (hDlg, IDC_CS_EXT, CB_ADDSTRING, 0, (LPARAM)_T("A3000T"));
-               SendDlgItemMessage (hDlg, IDC_CS_EXT, CB_ADDSTRING, 0, (LPARAM)_T("A4000"));
-               SendDlgItemMessage (hDlg, IDC_CS_EXT, CB_ADDSTRING, 0, (LPARAM)_T("A4000T"));
-               SendDlgItemMessage (hDlg, IDC_CS_EXT, CB_ADDSTRING, 0, (LPARAM)_T("Velvet"));
+               SendDlgItemMessage(hDlg, IDC_CS_EXT, CB_ADDSTRING, 0, (LPARAM)_T("A500+"));
+               SendDlgItemMessage(hDlg, IDC_CS_EXT, CB_ADDSTRING, 0, (LPARAM)_T("A600"));
+               SendDlgItemMessage(hDlg, IDC_CS_EXT, CB_ADDSTRING, 0, (LPARAM)_T("A1000"));
+               SendDlgItemMessage(hDlg, IDC_CS_EXT, CB_ADDSTRING, 0, (LPARAM)_T("A1200"));
+               SendDlgItemMessage(hDlg, IDC_CS_EXT, CB_ADDSTRING, 0, (LPARAM)_T("A2000"));
+               SendDlgItemMessage(hDlg, IDC_CS_EXT, CB_ADDSTRING, 0, (LPARAM)_T("A3000"));
+               SendDlgItemMessage(hDlg, IDC_CS_EXT, CB_ADDSTRING, 0, (LPARAM)_T("A3000T"));
+               SendDlgItemMessage(hDlg, IDC_CS_EXT, CB_ADDSTRING, 0, (LPARAM)_T("A4000"));
+               SendDlgItemMessage(hDlg, IDC_CS_EXT, CB_ADDSTRING, 0, (LPARAM)_T("A4000T"));
+               SendDlgItemMessage(hDlg, IDC_CS_EXT, CB_ADDSTRING, 0, (LPARAM)_T("Velvet"));
+               SendDlgItemMessage(hDlg, IDC_CS_EXT, CB_ADDSTRING, 0, (LPARAM)_T("Casablanca"));
 
                SendDlgItemMessage(hDlg, IDC_GENLOCKMODE, CB_RESETCONTENT, 0, 0);
                SendDlgItemMessage(hDlg, IDC_GENLOCKMODE, CB_ADDSTRING, 0, (LPARAM)_T("-"));
index d0a7ee5b03f93461b314d3c04b28469bf90b0107..90ef139915b49e4381ac7f611c17da265ada1619 100644 (file)
     <ClCompile Include="..\..\archivers\zip\zip.cpp" />
     <ClCompile Include="..\..\aros.rom.cpp" />
     <ClCompile Include="..\..\calc.cpp" />
+    <ClCompile Include="..\..\casablanca.cpp" />
     <ClCompile Include="..\..\cd32_fmv_genlock.cpp" />
     <ClCompile Include="..\..\cdtvcr.cpp" />
     <ClCompile Include="..\..\cpuboard.cpp" />
index f6200134c32c8844a5bff396fa4e10ba7824fa56..4e6e4e48397492f28dc3814730de868aac1acf6c 100644 (file)
@@ -95,7 +95,7 @@ struct romdata *getromdatabypath (const TCHAR *path)
        return NULL;
 }
 
-#define NEXT_ROM_ID 231
+#define NEXT_ROM_ID 232
 
 #define ALTROM(id,grp,num,size,flags,crc32,a,b,c,d,e) \
 { _T("X"), 0, 0, 0, 0, 0, size, id, 0, 0, flags, (grp << 16) | num, 0, NULL, crc32, a, b, c, d, e },
@@ -190,6 +190,11 @@ static struct romdata roms[] = {
        { _T("KS ROM v3.X (A4000)(Cloanto)"), 3, 10, 45, 57, _T("A4000\0"), 524288, 46, 2 | 4, 1, ROMTYPE_KICK, 0, 0, NULL,
        0x3ac99edc, 0x3cbfc9e1,0xfe396360,0x157bd161,0xde74fc90,0x1abee7ec },
 
+       { _T("Casablanca 74095 - 00 717 - 02"), 3, 1, 0, 0, _T("CASABLANCA\0"), 524288 * 2, 231, 2 | 4, 0, ROMTYPE_KICK, 0, 0, NULL,
+       0x2ec384e3,0x47f9ee6d, 0x0f8ac5a6,0x5c6eddc3,0x0bcd47c8,0x574d8725 },
+       ALTROMPN(231, 1, 1, 524288, ROMTYPE_EVEN, _T("74095 00 717 02 01 U4"), 0x1bdcd18c, 0xabc7b734,0x1f8df24d,0xd4f1d062,0xfc0f7680,0x4d1053b9)
+       ALTROMPN(231, 1, 2, 524288, ROMTYPE_ODD , _T("74095 00 717 02 02 U5"), 0x6ccb0431, 0xa2a43444,0xbeda38be,0x1fa5cabe,0x75fc4def,0x063bcd7a)
+
        { _T("CD32 KS ROM v3.1"), 3, 1, 40, 60, _T("CD32\0"), 524288, 18, 1, 0, ROMTYPE_KICKCD32, 0, 0, NULL,
        0x1e62d4a5, 0x3525BE88,0x87F79B59,0x29E017B4,0x2380A79E,0xDFEE542D },
        { _T("CD32 extended ROM"), 3, 1, 40, 60, _T("CD32\0"), 524288, 19, 1, 0, ROMTYPE_EXTCD32, 0, 0, NULL,