Skip to content

Commit

Permalink
Sync with upstream version 1.51.1
Browse files Browse the repository at this point in the history
  • Loading branch information
rdanbrook committed Aug 27, 2021
1 parent c924b9d commit e23cc70
Show file tree
Hide file tree
Showing 15 changed files with 476 additions and 47 deletions.
49 changes: 49 additions & 0 deletions NstDatabase.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27011,4 +27011,53 @@
</board>
</cartridge>
</game>-->
<game>
<peripherals>
<device type="fourplayer" />
</peripherals>
<cartridge system="NES-NTSC" dump="ok" crc="4E6B9078" sha1="93FF8CEC778771C7200F785798E0D1599EE8FEB5">
<board type="NES-NROM-256" mapper="0">
<prg size="32k" />
<chr size="8k" />
<pad h="0" v="1" />
</board>
</cartridge>
</game>
<game>
<cartridge system="Famicom" dump="ok" crc="8589652D" sha1="0CC7ED7F5D7EE0959EE3724C3AF06EF8DF397C59">
<board type="NANJING" mapper="163">
<prg size="2048k" />
<wram size="8k" battery="1" />
<pad h="0" v="1" />
</board>
</cartridge>
</game>
<game>
<cartridge system="NES-NTSC" dump="ok" crc="F312D1DE" sha1="35C157A921156E47FD3F6573D150F54108D0EDFC">
<board type="NES-TXROM" mapper="4">
<prg size="16k" />
<chip type="MMC3A" />
</board>
</cartridge>
</game>
<game>
<cartridge system="NES-NTSC" dump="ok" crc="A512BDF6" sha1="F794FDA12D34E611D58E652319ED583AE61B81E0">
<board type="NES-HKROM" mapper="4">
<prg size="32k" />
<chr size="8k" />
<pad h="0" v="1" />
<chip type="MMC6B" battery="0" />
</board>
</cartridge>
</game>
<game>
<cartridge system="NES-NTSC" dump="ok" crc="633AFE6F" sha1="2F29F3DC724027FAD926BC9D4470A481884E42A5">
<board type="NES-HKROM" mapper="4">
<prg size="32k" />
<chr size="8k" />
<pad h="0" v="1" />
<chip type="MMC6B" battery="0" />
</board>
</cartridge>
</game>
</database>
1 change: 1 addition & 0 deletions libretro/Makefile.common
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,7 @@ SOURCES_CXX += $(CORE_DIR)/source/core/board/NstBoardUxRom.cpp
SOURCES_CXX += $(CORE_DIR)/source/core/board/NstBoardVsSystem.cpp
SOURCES_CXX += $(CORE_DIR)/source/core/board/NstBoardWaixing.cpp
SOURCES_CXX += $(CORE_DIR)/source/core/board/NstBoardWaixingFfv.cpp
SOURCES_CXX += $(CORE_DIR)/source/core/board/NstBoardWaixingFs304.cpp
SOURCES_CXX += $(CORE_DIR)/source/core/board/NstBoardWaixingPs2.cpp
SOURCES_CXX += $(CORE_DIR)/source/core/board/NstBoardWaixingSecurity.cpp
SOURCES_CXX += $(CORE_DIR)/source/core/board/NstBoardWaixingSgz.cpp
Expand Down
2 changes: 1 addition & 1 deletion libretro/libretro.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

#include "nstdatabase.hpp"

#define NST_VERSION "1.51.0"
#define NST_VERSION "1.51.1"

#define MIN(a,b) ((a)<(b)?(a):(b))
#define MAX(a,b) ((a)>(b)?(a):(b))
Expand Down
2 changes: 1 addition & 1 deletion libretro/nstdatabase.hpp

Large diffs are not rendered by default.

12 changes: 9 additions & 3 deletions source/core/NstApu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2325,9 +2325,15 @@ namespace Nes

cpu.StealCycles( cpu.GetClock(1) );

// This is disabled until a real solution is discovered
//if ((readAddress & 0xF000) != 0x4000)
// cpu.Peek( readAddress );
/* According to dmc_dma_during_read4/dma_2007_read, DMC DMA during read causes
* 2-3 extra $2007 reads before the real read. The nesdev wiki states that this
* also happens when polling $2002 for vblank.
*/
if ((readAddress & 0xF000) != 0x4000)
{
cpu.Peek( readAddress );
cpu.Peek( readAddress );
}

cpu.StealCycles( cpu.GetClock(1) );
cpu.Peek( readAddress );
Expand Down
3 changes: 3 additions & 0 deletions source/core/NstCpu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1282,6 +1282,7 @@ namespace Nes

NST_SINGLE_CALL void Cpu::Rts()
{
opcode = map.Peek8( pc );
pc = Pull16() + 1;
cycles.count += cycles.clock[RTS_CYCLES-1];
}
Expand All @@ -1292,6 +1293,7 @@ namespace Nes

{
const uint packed = Pull8();
opcode = map.Peek8( pc );
pc = Pull16();
flags.Unpack( packed );
}
Expand Down Expand Up @@ -1804,6 +1806,7 @@ namespace Nes
{
NST_DEBUG_MSG("6502 BRK");

opcode = map.Peek8( pc );
Push16( pc + 1 );
Push8( flags.Pack() | Flags::B );
flags.i = Flags::I;
Expand Down
25 changes: 24 additions & 1 deletion source/core/board/NstBoard.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1103,13 +1103,15 @@ namespace Nes
{ "UNL-AX5705", Type::BTL_AX5705 },
{ "UNL-CC-21", Type::UNL_CC21 },
{ "UNL-EDU2000", Type::UNL_EDU2000 },
{ "UNL-FS304", Type::UNL_FS304 },
{ "UNL-H2288", Type::KAY_H2288 },
{ "UNL-KOF97", Type::UNL_KINGOFFIGHTERS97 },
{ "UNL-KS7013B", Type::KAISER_KS7013B },
{ "UNL-KS7016", Type::KAISER_KS7016 },
{ "UNL-KS7031", Type::KAISER_KS7031 },
{ "UNL-KS7032", Type::KAISER_KS7032 },
{ "UNL-KS7037", Type::KAISER_KS7037 },
{ "UNL-KS7057", Type::KAISER_KS7057 },
{ "UNL-N625092", Type::UNL_N625092 },
{ "UNL-SA-0036", Type::SACHEN_SA0036 },
{ "UNL-SA-0037", Type::SACHEN_SA0037 },
Expand Down Expand Up @@ -1449,7 +1451,7 @@ namespace Nes
case 4:

if (submapper == 1)
{ // StarTropics/Zoda's Revenge - might not be correct
{ // StarTropics/Zoda's Revenge
chips.Add(L"MMC6B");
name = "NES-HKROM";
id = Type::STD_HKROM;
Expand Down Expand Up @@ -2778,6 +2780,12 @@ namespace Nes
id = Type::BANDAI_LZ93D50_24C01;
break;

case 162:

name = "UNL-FS304";
id = Type::UNL_FS304;
break;

case 163:

name = "NANJING";
Expand Down Expand Up @@ -3438,6 +3446,12 @@ namespace Nes
id = Type::BMC_8157;
break;

case 302:

name = "UNL-KS7057";
id = Type::KAISER_KS7057;
break;

case 305:

name = "UNL-KS7031";
Expand Down Expand Up @@ -3498,6 +3512,12 @@ namespace Nes
id = Type::BTL_AX5705;
break;

case 554:

name = "UNL-KS7010";
id = Type::KAISER_KS7010;
break;

default:

return false;
Expand Down Expand Up @@ -3766,12 +3786,14 @@ namespace Nes
case Type::JYCOMPANY_TYPE_B :
case Type::JYCOMPANY_TYPE_C : return new JyCompany::Standard(c);
case Type::KAISER_KS202 : return new Kaiser::Ks202(c);
case Type::KAISER_KS7010 : return new Kaiser::Ks7010(c);
case Type::KAISER_KS7013B : return new Kaiser::Ks7013b(c);
case Type::KAISER_KS7016 : return new Kaiser::Ks7016(c);
case Type::KAISER_KS7022 : return new Kaiser::Ks7022(c);
case Type::KAISER_KS7031 : return new Kaiser::Ks7031(c);
case Type::KAISER_KS7032 : return new Kaiser::Ks7032(c);
case Type::KAISER_KS7037 : return new Kaiser::Ks7037(c);
case Type::KAISER_KS7057 : return new Kaiser::Ks7057(c);
case Type::KAISER_KS7058 : return new Kaiser::Ks7058(c);
case Type::KASING_STD : return new Kasing::Standard(c);
case Type::KAY_H2288 : return new Kay::H2288(c);
Expand Down Expand Up @@ -3868,6 +3890,7 @@ namespace Nes
case Type::UNL_A9746 : return new Unlicensed::A9746(c);
case Type::UNL_CC21 : return new Unlicensed::Cc21(c);
case Type::UNL_EDU2000 : return new Unlicensed::Edu2000(c);
case Type::UNL_FS304 : return new Waixing::Fs304(c);
case Type::UNL_KINGOFFIGHTERS96 : return new Unlicensed::KingOfFighters96(c);
case Type::UNL_KINGOFFIGHTERS97 : return new Unlicensed::KingOfFighters97(c);
case Type::UNL_MORTALKOMBAT2 : return new Unlicensed::MortalKombat2(c);
Expand Down
3 changes: 3 additions & 0 deletions source/core/board/NstBoard.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -418,12 +418,14 @@ namespace Nes
JYCOMPANY_TYPE_C = MakeId< 211, 2048, 2048, 0, 0, CRM_0, NMT_X, 0 >::ID,
// Kaiser
KAISER_KS202 = MakeId< 56, 256, 128, 8, 0, CRM_0, NMT_V, 0 >::ID,
KAISER_KS7010 = MakeId< 554, 128, 128, 0, 0, CRM_0, NMT_V, 1 >::ID,
KAISER_KS7013B = MakeId< 312, 128, 0, 0, 0, CRM_8, NMT_X, 0 >::ID,
KAISER_KS7016 = MakeId< 306, 128, 0, 0, 0, CRM_8, NMT_V, 0 >::ID,
KAISER_KS7022 = MakeId< 175, 256, 128, 0, 0, CRM_0, NMT_V, 0 >::ID,
KAISER_KS7031 = MakeId< 305, 128, 0, 0, 0, CRM_8, NMT_V, 0 >::ID,
KAISER_KS7032 = MakeId< 142, 128, 0, 0, 0, CRM_8, NMT_X, 0 >::ID,
KAISER_KS7037 = MakeId< 307, 128, 0, 0, 8, CRM_8, NMT_X, 0 >::ID,
KAISER_KS7057 = MakeId< 302, 128, 0, 0, 0, CRM_8, NMT_X, 0 >::ID,
KAISER_KS7058 = MakeId< 171, 32, 32, 0, 0, CRM_0, NMT_X, 0 >::ID,
// Kasing
KASING_STD = MakeId< 115, 512, 512, 0, 0, CRM_0, NMT_V, 0 >::ID,
Expand Down Expand Up @@ -541,6 +543,7 @@ namespace Nes
UNL_A9746 = MakeId< 219, 128, 256, 0, 0, CRM_0, NMT_X, 0 >::ID,
UNL_CC21 = MakeId< 27, 32, 8, 0, 0, CRM_0, NMT_Z, 0 >::ID,
UNL_EDU2000 = MakeId< 329, 1024, 0, 0, 32, CRM_8, NMT_Z, 0 >::ID,
UNL_FS304 = MakeId< 162, 2048, 0, 8, 0, CRM_8, NMT_X, 0 >::ID,
UNL_KINGOFFIGHTERS96 = MakeId< 187, 512, 512, 0, 0, CRM_0, NMT_X, 0 >::ID,
UNL_KINGOFFIGHTERS97 = MakeId< 263, 256, 256, 0, 0, CRM_0, NMT_X, 0 >::ID,
UNL_MORTALKOMBAT2 = MakeId< 91, 256, 512, 0, 0, CRM_0, NMT_X, 0 >::ID,
Expand Down
Loading

0 comments on commit e23cc70

Please sign in to comment.