@@ -120,11 +120,15 @@ int const CARTRIDGE_kb[CARTRIDGE_LAST_SUPPORTED + 1] = {
120
120
32 * 1024 , /* CARTRIDGE_THECART_32M */
121
121
64 * 1024 , /* CARTRIDGE_THECART_64M */
122
122
64 , /* CARTRIDGE_XEGS_64_8F */
123
+ 128 , /* CARTRIDGE_ATRAX_128_RAW */
124
+ 32 , /* CARTRIDGE_ADAWLIAH_32 */
125
+ 64 , /* CARTRIDGE_ADAWLIAH_64 */
123
126
64 , /* CARTRIDGE_5200_SUPER_64 */
124
127
128 , /* CARTRIDGE_5200_SUPER_128 */
125
128
256 , /* CARTRIDGE_5200_SUPER_256 */
126
129
512 , /* CARTRIDGE_5200_SUPER_512 */
127
130
1024 , /* CARTRIDGE_ATMAX_NEW_1024 */
131
+ 40 , /* CARTRIDGE_5200_40_ALT */
128
132
};
129
133
130
134
int CARTRIDGE_autoreboot = TRUE;
@@ -135,6 +139,7 @@ static int CartIsFor5200(int type)
135
139
case CARTRIDGE_5200_32 :
136
140
case CARTRIDGE_5200_EE_16 :
137
141
case CARTRIDGE_5200_40 :
142
+ case CARTRIDGE_5200_40_ALT :
138
143
case CARTRIDGE_5200_NS_16 :
139
144
case CARTRIDGE_5200_8 :
140
145
case CARTRIDGE_5200_4 :
@@ -451,6 +456,21 @@ static void MapActiveCart(void)
451
456
MEMORY_readmap [0x5f ] = CARTRIDGE_BountyBob2GetByte ;
452
457
MEMORY_writemap [0x4f ] = CARTRIDGE_BountyBob1PutByte ;
453
458
MEMORY_writemap [0x5f ] = CARTRIDGE_BountyBob2PutByte ;
459
+ #endif
460
+ break ;
461
+ case CARTRIDGE_5200_40_ALT :
462
+ MEMORY_CopyROM (0x4000 , 0x4fff , active_cart -> image + 0x2000 + (active_cart -> state & 0x03 ) * 0x1000 );
463
+ MEMORY_CopyROM (0x5000 , 0x5fff , active_cart -> image + 0x6000 + ((active_cart -> state & 0x0c ) >> 2 ) * 0x1000 );
464
+ MEMORY_CopyROM (0x8000 , 0x9fff , active_cart -> image );
465
+ MEMORY_CopyROM (0xa000 , 0xbfff , active_cart -> image );
466
+ #ifndef PAGED_ATTRIB
467
+ MEMORY_SetHARDWARE (0x4ff6 , 0x4ff9 );
468
+ MEMORY_SetHARDWARE (0x5ff6 , 0x5ff9 );
469
+ #else
470
+ MEMORY_readmap [0x4f ] = CARTRIDGE_BountyBob1GetByte ;
471
+ MEMORY_readmap [0x5f ] = CARTRIDGE_BountyBob2GetByte ;
472
+ MEMORY_writemap [0x4f ] = CARTRIDGE_BountyBob1PutByte ;
473
+ MEMORY_writemap [0x5f ] = CARTRIDGE_BountyBob2PutByte ;
454
474
#endif
455
475
break ;
456
476
case CARTRIDGE_5200_NS_16 :
@@ -1123,7 +1143,10 @@ void CARTRIDGE_BountyBob1(UWORD addr)
1123
1143
if (Atari800_machine_type == Atari800_MACHINE_5200 ) {
1124
1144
if (addr >= 0x4ff6 && addr <= 0x4ff9 ) {
1125
1145
addr -= 0x4ff6 ;
1126
- MEMORY_CopyROM (0x4000 , 0x4fff , active_cart -> image + addr * 0x1000 );
1146
+ if (active_cart -> type == CARTRIDGE_5200_40_ALT )
1147
+ MEMORY_CopyROM (0x4000 , 0x4fff , active_cart -> image + 0x2000 + addr * 0x1000 );
1148
+ else
1149
+ MEMORY_CopyROM (0x4000 , 0x4fff , active_cart -> image + addr * 0x1000 );
1127
1150
active_cart -> state = (active_cart -> state & 0x0c ) | addr ;
1128
1151
}
1129
1152
} else {
@@ -1140,7 +1163,10 @@ void CARTRIDGE_BountyBob2(UWORD addr)
1140
1163
if (Atari800_machine_type == Atari800_MACHINE_5200 ) {
1141
1164
if (addr >= 0x5ff6 && addr <= 0x5ff9 ) {
1142
1165
addr -= 0x5ff6 ;
1143
- MEMORY_CopyROM (0x5000 , 0x5fff , active_cart -> image + 0x4000 + addr * 0x1000 );
1166
+ if (active_cart -> type == CARTRIDGE_5200_40_ALT )
1167
+ MEMORY_CopyROM (0x5000 , 0x5fff , active_cart -> image + 0x6000 + addr * 0x1000 );
1168
+ else
1169
+ MEMORY_CopyROM (0x5000 , 0x5fff , active_cart -> image + 0x4000 + addr * 0x1000 );
1144
1170
active_cart -> state = (active_cart -> state & 0x03 ) | (addr << 2 );
1145
1171
}
1146
1172
}
@@ -1437,8 +1463,7 @@ void CARTRIDGE_ColdStart(void) {
1437
1463
}
1438
1464
1439
1465
#ifdef __LIBRETRO__
1440
- #include "atari5200_hash.h"
1441
- #include "atari800_hash.h"
1466
+ #include "carts_hash.h"
1442
1467
#include "esc.h"
1443
1468
#include "pokeysnd.h"
1444
1469
extern int autorunCartridge ;
@@ -1489,7 +1514,7 @@ static int InsertCartridge(const char *filename, CARTRIDGE_image_t *cart)
1489
1514
len >>= 10 ; /* number of kilobytes */
1490
1515
cart -> size = len ;
1491
1516
#ifdef __LIBRETRO__
1492
- if (autorunCartridge == 1 ) {
1517
+ if (autorunCartridge == A5200_CART ) {
1493
1518
int match = 0 , i = 0 ;
1494
1519
printf ("Hack Libretro:crc A5200 ON sz:%d crc:%x\n" , cart -> size , crc );
1495
1520
while (a5200_game [i ].type != -1 ) {
@@ -1515,6 +1540,11 @@ static int InsertCartridge(const char *filename, CARTRIDGE_image_t *cart)
1515
1540
cart -> type = CARTRIDGE_5200_40 ;
1516
1541
POKEYSND_stereo_enabled = FALSE;
1517
1542
}
1543
+ else if (a5200_game [i ].type == a5200_40_ALT ) {
1544
+ /* Bounty Bob don't like stereo pokey (game locks) */
1545
+ cart -> type = CARTRIDGE_5200_40_ALT ;
1546
+ POKEYSND_stereo_enabled = FALSE;
1547
+ }
1518
1548
else if (a5200_game [i ].type == a5200_ee_16 )
1519
1549
cart -> type = CARTRIDGE_5200_EE_16 ;
1520
1550
else if (a5200_game [i ].type == a5200_64 )
@@ -1525,21 +1555,47 @@ static int InsertCartridge(const char *filename, CARTRIDGE_image_t *cart)
1525
1555
cart -> type = CARTRIDGE_5200_SUPER_256 ; // I've yet to see this type
1526
1556
else if (a5200_game [i ].type == a5200_512 )
1527
1557
cart -> type = CARTRIDGE_5200_SUPER_512 ;
1558
+ else if (a5200_game [i ].type == a5200_unsupported ) {
1559
+ match = 3 ;
1560
+ cart -> type = CARTRIDGE_NONE ;
1561
+ }
1562
+ else if (a5200_game [i ].type == a5200_incomplete ) {
1563
+ match = 4 ;
1564
+ cart -> type = CARTRIDGE_NONE ;
1565
+ }
1566
+ else if (a5200_game [i ].type == a5200_bad_dump ) {
1567
+ match = 5 ;
1568
+ cart -> type = CARTRIDGE_NONE ;
1569
+ }
1528
1570
1529
- printf ("Hack Libretro:A5200 cart-> type:%d %x\n" , cart -> type , crc );
1571
+ printf ("Hack Libretro:A5200 cart name:%s type:%d crc32: %x\n" , a5200_game [ i ]. name , cart -> type , crc );
1530
1572
break ;
1531
1573
}
1532
1574
i ++ ;
1533
1575
}
1534
1576
1535
1577
if (match == 1 ) {
1536
1578
if (!RetroMsgShown )
1537
- retro_message ("5200 Cart found in DB." , 1000 , 0 );
1538
-
1579
+ retro_message ("Atari 5200 cart detected." , 1000 , 0 );
1580
+ goto label_fin ;
1581
+ }
1582
+ else if (match == 3 ) {
1583
+ if (!RetroMsgShown )
1584
+ retro_message ("Atari 5200 unsupported cart detected." , 1000 , 0 );
1585
+ goto label_fin ;
1586
+ }
1587
+ else if (match == 4 ) {
1588
+ if (!RetroMsgShown )
1589
+ retro_message ("Atari 5200 incomplete cart detected." , 1000 , 0 );
1590
+ goto label_fin ;
1591
+ }
1592
+ else if (match == 5 ) {
1593
+ if (!RetroMsgShown )
1594
+ retro_message ("Atari 5200 bad dump detected." , 1000 , 0 );
1539
1595
goto label_fin ;
1540
1596
}
1541
1597
}
1542
- else if (autorunCartridge == 2 ) {
1598
+ else if (autorunCartridge == A800_CART ) {
1543
1599
int match = 0 , i = 0 ;
1544
1600
printf ("Hack Libretro:crc A800 ON sz:%d crc:%x\n" , cart -> size , crc );
1545
1601
while (a800_game [i ].type != -1 ) {
@@ -1578,27 +1634,67 @@ static int InsertCartridge(const char *filename, CARTRIDGE_image_t *cart)
1578
1634
match = 2 ;
1579
1635
cart -> type = CARTRIDGE_ATMAX_1024 ;
1580
1636
}
1637
+ else if (a800_game [i ].type == a800_TURBOSOFT_64 ) {
1638
+ match = 2 ;
1639
+ cart -> type = CARTRIDGE_TURBOSOFT_64 ;
1640
+ }
1641
+ else if (a800_game [i ].type == a800_TURBOSOFT_128 ) {
1642
+ match = 2 ;
1643
+ cart -> type = CARTRIDGE_TURBOSOFT_128 ;
1644
+ }
1645
+ else if (a800_game [i ].type == a800_TURBOSOFT_64_WILL ) {
1646
+ match = 2 ;
1647
+ cart -> type = CARTRIDGE_WILL_64 ;
1648
+ }
1649
+ else if (a800_game [i ].type == a800_OSS_M091_16 ) {
1650
+ cart -> type = CARTRIDGE_OSS_M091_16 ;
1651
+ }
1652
+ else if (a800_game [i ].type == a800_unsupported ) {
1653
+ match = 3 ;
1654
+ cart -> type = CARTRIDGE_NONE ;
1655
+ }
1656
+ else if (a800_game [i ].type == a800_incomplete ) {
1657
+ match = 4 ;
1658
+ cart -> type = CARTRIDGE_NONE ;
1659
+ }
1660
+ else if (a800_game [i ].type == a800_bad_dump ) {
1661
+ match = 5 ;
1662
+ cart -> type = CARTRIDGE_NONE ;
1663
+ }
1581
1664
1582
- printf ("Hack Libretro:A800 cart-> type:%d %x\n" , cart -> type , crc );
1665
+ printf ("Hack Libretro:A800 cart name:%s type:%d crc32: %x\n" , a800_game [ i ]. name , cart -> type , crc );
1583
1666
break ;
1584
1667
}
1585
1668
i ++ ;
1586
1669
}
1587
1670
1588
1671
if (match == 1 ) {
1589
1672
if (!RetroMsgShown )
1590
- retro_message ("800 Cart found in DB." , 1000 , 0 );
1591
-
1673
+ retro_message ("Atari 800 cart detected." , 1000 , 0 );
1592
1674
goto label_fin ;
1593
1675
}
1594
1676
else if (match == 2 ) {
1595
1677
if (!RetroMsgShown )
1596
- retro_message ("800 Cart found in DB. Some ATMAX carts need SIO Accleration disabled." , 1000 , 0 );
1597
-
1678
+ retro_message ("Atari 800 cart detected. This cart may need SIO Acceleration disabled." , 1000 , 0 );
1679
+ goto label_fin ;
1680
+ }
1681
+ else if (match == 3 ) {
1682
+ if (!RetroMsgShown )
1683
+ retro_message ("Atari 800 unsupported cart detected." , 1000 , 0 );
1684
+ goto label_fin ;
1685
+ }
1686
+ else if (match == 4 ) {
1687
+ if (!RetroMsgShown )
1688
+ retro_message ("Atari 800 incomplete cart detected." , 1000 , 0 );
1689
+ goto label_fin ;
1690
+ }
1691
+ else if (match == 5 ) {
1692
+ if (!RetroMsgShown )
1693
+ retro_message ("Atari 800 bad dump detected." , 1000 , 0 );
1598
1694
goto label_fin ;
1599
1695
}
1600
1696
else if (!RetroMsgShown )
1601
- retro_message ("800 Cart NOT found in DB." , 6000 , 0 );
1697
+ retro_message ("Atari 800 unknown cart (not in DB) ." , 6000 , 0 );
1602
1698
}
1603
1699
1604
1700
RetroMsgShown = TRUE;
@@ -1615,8 +1711,8 @@ static int InsertCartridge(const char *filename, CARTRIDGE_image_t *cart)
1615
1711
}
1616
1712
#ifdef __LIBRETRO__
1617
1713
label_fin :
1618
- #endif
1619
1714
RetroMsgShown = TRUE;
1715
+ #endif
1620
1716
1621
1717
if (cart -> type != CARTRIDGE_NONE ) {
1622
1718
InitCartridge (cart );
0 commit comments