Skip to content

Commit 1072adf

Browse files
committed
Merged latest WinUAE updates
Added support for Picmatic Tierras Salvajes and Marbella Vice
1 parent fb86164 commit 1072adf

File tree

3 files changed

+60
-10
lines changed

3 files changed

+60
-10
lines changed

src/arcadia.cpp

Lines changed: 48 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@
44
* Arcadia
55
* American Laser games
66
* Cubo
7+
* Picmatic
78
*
8-
* Copyright 2005-2017 Toni Wilen
9+
* Copyright 2005-2024 Toni Wilen
910
*
1011
*
1112
*/
@@ -611,7 +612,7 @@ static int algmemory_modified;
611612
static int algmemory_initialized;
612613
static int alg_game_id;
613614
static int alg_picmatic_nova;
614-
static uae_u8 picmatic_io;
615+
static uae_u8 picmatic_io, picmatic_ply;
615616

616617
static void alg_nvram_write (void)
617618
{
@@ -652,8 +653,36 @@ static uae_u32 REGPARAM2 alg_wget (uaecptr addr)
652653

653654
static uae_u32 REGPARAM2 alg_bget (uaecptr addr)
654655
{
655-
if (alg_picmatic_nova == 1 && (addr & 0xffff0000) == 0xf60000) {
656-
return 0;
656+
if ((addr & 0xffff0001) == 0xf60001) {
657+
if (alg_picmatic_nova == 1) {
658+
// Picmatic 100Hz games
659+
int reg = (addr >> 12) & 15;
660+
uae_u8 v = 0;
661+
uae_u16 x = lightpen_x[1 - picmatic_ply];
662+
uae_u16 y = lightpen_y[1 - picmatic_ply] >> currprefs.gfx_vresolution;
663+
if (reg == 3) {
664+
v = 0xff;
665+
// left trigger
666+
if (alg_flag & 64)
667+
v &= ~0x20;
668+
// right trigger
669+
if (alg_flag & 128)
670+
v &= ~0x10;
671+
// left holster
672+
if (alg_flag & 256)
673+
v &= ~0x80;
674+
// right holster
675+
if (alg_flag & 512)
676+
v &= ~0x40;
677+
} else if (reg == 0) {
678+
v = y & 0xff;
679+
} else if (reg == 1) {
680+
v = x & 0xff;
681+
} else if (reg == 2) {
682+
v = ((x >> 8) << 4) | (y >> 8);
683+
}
684+
return v;
685+
}
657686
}
658687
uaecptr addr2 = addr;
659688
addr >>= 1;
@@ -673,9 +702,17 @@ static void REGPARAM2 alg_wput (uaecptr addr, uae_u32 w)
673702
static void REGPARAM2 alg_bput (uaecptr addr, uae_u32 b)
674703
{
675704
if (alg_picmatic_nova == 1 && (addr & 0xffff0000) == 0xf60000) {
676-
if (!(addr & 0xffff)) {
705+
int reg = (addr >> 12) & 15;
706+
if (reg == 0) {
677707
picmatic_io = b;
708+
} if (reg == 5) {
709+
// Picmatic 100Hz games
710+
picmatic_ply = 0;
711+
} else if (reg == 6) {
712+
// Picmatic 100Hz games
713+
picmatic_ply = 1;
678714
}
715+
//write_log(_T("ALG BPUT %08X %02X %08X\n"), addr, b & 255, M68K_GETPC);
679716
return;
680717
}
681718
uaecptr addr2 = addr;
@@ -1529,15 +1566,15 @@ void alg_map_banks(void)
15291566
algmemory_initialized = 1;
15301567
}
15311568
struct romdata *rd = get_alg_rom(currprefs.romextfile);
1532-
if (rd->id == 198 || rd->id == 301 || rd->id == 302) {
1569+
if (rd->id == 198 || rd->id == 301 || rd->id == 302 || rd->id == 315 || rd->id == 314) {
15331570
map_banks(&alg_ram_bank, 0xf4, 1, 0);
15341571
} else if (rd->id == 182 || rd->id == 273 || rd->size < 0x40000) {
15351572
map_banks(&alg_ram_bank, 0xf5, 1, 0);
15361573
} else {
15371574
map_banks(&alg_ram_bank, 0xf7, 1, 0);
15381575
}
15391576
alg_game_id = rd->id;
1540-
alg_picmatic_nova = rd->id == 198 || rd->id == 301 || rd->id == 302 ? 1 : (rd->id == 197 ? 2 : 0);
1577+
alg_picmatic_nova = rd->id == 198 || rd->id == 301 || rd->id == 302 || rd->id == 315 || rd->id == 314 ? 1 : (rd->id == 197 ? 2 : 0);
15411578
if (alg_picmatic_nova == 1) {
15421579
map_banks(&alg_ram_bank, 0xf6, 1, 0);
15431580
}
@@ -1559,6 +1596,7 @@ void alg_map_banks(void)
15591596
}
15601597
} else {
15611598
picmatic_io = 0;
1599+
picmatic_ply = 0;
15621600
ld_repcnt = -1;
15631601
ld_mark = -1;
15641602
ld_audio = 0;
@@ -1619,6 +1657,8 @@ uae_u8 *restore_alg(uae_u8 *src)
16191657
for (int i = 0; i < 32; i++) {
16201658
ld_uidx_data[i] = restore_u8();
16211659
}
1660+
picmatic_ply = restore_u8();
1661+
16221662
return src;
16231663
}
16241664

@@ -1668,6 +1708,7 @@ uae_u8 *save_alg(size_t *len)
16681708
for (int i = 0; i < 32; i++) {
16691709
save_u8(ld_uidx_data[i]);
16701710
}
1711+
save_u8(picmatic_ply);
16711712
*len = dst - dstbak;
16721713
return dstbak;
16731714
}

src/inputdevice.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9254,7 +9254,6 @@ static void swapjoydevice (struct uae_input_device *uid, const int **swaps)
92549254
// swap gameports ports, remember to handle customized ports too
92559255
void inputdevice_swap_compa_ports (struct uae_prefs *prefs, int portswap)
92569256
{
9257-
struct jport tmp;
92589257
#if 0
92599258
if ((prefs->jports[portswap].id == JPORT_CUSTOM || prefs->jports[portswap + 1].id == JPORT_CUSTOM)) {
92609259
const int *swaps[2];
@@ -9267,10 +9266,11 @@ void inputdevice_swap_compa_ports (struct uae_prefs *prefs, int portswap)
92679266
}
92689267
}
92699268
#endif
9269+
struct jport tmp = { 0 };
92709270
memcpy (&tmp, &prefs->jports[portswap], sizeof (struct jport));
92719271
memcpy (&prefs->jports[portswap], &prefs->jports[portswap + 1], sizeof (struct jport));
92729272
memcpy (&prefs->jports[portswap + 1], &tmp, sizeof (struct jport));
9273-
inputdevice_updateconfig (NULL, prefs);
9273+
inputdevice_updateconfig(NULL, prefs);
92749274
}
92759275

92769276
// swap device "devnum" ports 0<>1 and 2<>3

src/rommgr.cpp

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ struct romdata *getromdatabypath (const TCHAR *path)
9797
return NULL;
9898
}
9999

100-
#define NEXT_ROM_ID 314
100+
#define NEXT_ROM_ID 316
101101

102102
#if NEXT_ROM_ID >= MAX_ROMMGR_ROMS
103103
#error Increase MAX_ROMMGR_ROMS!
@@ -1026,6 +1026,15 @@ static struct romdata roms[] = {
10261026
0xf78c8fa2, 0x07656cbf,0xdb6135f2,0x6add3b5f,0xa4ce5d46,0xdda706f9, NULL, NULL, 10 },
10271027
ALTROMPN(302, 1, 1, 65536, ROMTYPE_EVEN | ROMTYPE_8BIT, NULL, 0x01c9a503, 0xf61ec2cd,0x241b2bf8,0xa982e81e,0x5a181786,0x01f0a0a0)
10281028
ALTROMPN(302, 1, 2, 65536, ROMTYPE_ODD | ROMTYPE_8BIT, NULL, 0x78eb6fd6, 0xe4048180,0x95f03b6e,0x0746620f,0x5ce48c3f,0x7149b8a0)
1029+
{ _T("Picmatic Marbella Vice (100Hz TV)"), 0, 0, 0, 0, _T("ALG\0"), 131072, 315, 0, 0, ROMTYPE_ALG, 0, 0, NULL,
1030+
0xae2d2805, 0x0e392b46,0x15777fe5,0x24ed27ab,0xf8539d4b,0xb1e3ba9d, NULL, NULL, 10 },
1031+
ALTROMPN(315, 1, 1, 65536, ROMTYPE_EVEN | ROMTYPE_8BIT, NULL, 0xd2b5e5ca, 0xde765039,0x61076aca,0xd405db9e,0x83bd5334,0xb02bf908)
1032+
ALTROMPN(315, 1, 2, 65536, ROMTYPE_ODD | ROMTYPE_8BIT, NULL, 0x2c9ebccb, 0x4e8dcb85,0x26a8debb,0x70f3f567,0x13903ba8,0xbfbb3ed5)
1033+
// spilz0d4-odd-27-9-95-salvajes-displays-27c512.u4, spilz0d4-even-27-9-95-salvajes-displays-27c512.u5
1034+
{ _T("Picmatic Tierras Salvajes (100Hz TV)"), 0, 0, 0, 0, _T("ALG\0"), 131072, 314, 0, 0, ROMTYPE_ALG, 0, 0, NULL,
1035+
0xe6c539ec, 0xa5f70818,0xd93ab33c,0xa4149a50,0xc38b2a13,0x0ee5d7ab, NULL, NULL, 10 },
1036+
ALTROMPN(314, 1, 1, 65536, ROMTYPE_EVEN | ROMTYPE_8BIT, NULL, 0x730e4696, 0x4db0cc7d,0x160de5e7,0x0f1d1842,0xfa94adb8,0xee7f954f)
1037+
ALTROMPN(314, 1, 2, 65536, ROMTYPE_ODD | ROMTYPE_8BIT, NULL, 0xd46dd5e0, 0x7d808c6e,0xd88bf9a9,0x8cdb468c,0xe71c0952,0xb0b5d7b2)
10291038

10301039
{ NULL }
10311040

0 commit comments

Comments
 (0)