From a22c5c3eeb51dccb6a8551664dec8653a3735191 Mon Sep 17 00:00:00 2001 From: Tim Allen Date: Wed, 8 Mar 2023 17:12:30 +1100 Subject: [PATCH 1/5] Cirrus CI: Build macOS binaries on AArch64. --- .cirrus.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.cirrus.yml b/.cirrus.yml index 3ba01927..d3ca995e 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -70,10 +70,9 @@ windows-x86_64-binaries_task: bsnes-nightly_artifacts: path: "bsnes-nightly.zip" -macOS-x86_64-binaries_task: - osx_instance: - image: mojave-base - +macOS-aarch64-binaries_task: + macos_instance: + image: ghcr.io/cirruslabs/macos-ventura-base:latest compile_script: - make -C bsnes local=false From 5cefce5c08f74cfc80eee3f82a32d846144e5277 Mon Sep 17 00:00:00 2001 From: orbea Date: Tue, 7 Mar 2023 12:59:19 -0800 Subject: [PATCH 2/5] nall: Fix the build for gcc13 --- nall/arithmetic/natural.hpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/nall/arithmetic/natural.hpp b/nall/arithmetic/natural.hpp index fcc902b8..cc1bd907 100644 --- a/nall/arithmetic/natural.hpp +++ b/nall/arithmetic/natural.hpp @@ -1,3 +1,5 @@ +#include + #define ConcatenateType(Size) uint##Size##_t #define DeclareType(Size) ConcatenateType(Size) From 3ca0504e67e89d37e24fce87183332f7ec577867 Mon Sep 17 00:00:00 2001 From: Tim Allen Date: Mon, 22 May 2023 23:55:38 +1000 Subject: [PATCH 3/5] Extend the Super Famicom LOROM-RAM#A memory map. Although Nintendo made many different cartridge circuit boards with different memory mappings, ROMs do not indicate which specific board they are intended to work with. Super Famicom emulators traditionally group mutually-compatible mappings together and use heuristics to guess which family of mappings the game expects. There's one family of mappings that maps ROM data to the top half ($8000-$FFFF) of memory banks in the Super Famicom address space. For historical reasons, this family is called "LoROM" and has three main variants: 1. ROM only, mapped to the top half of every possible bank. The boards database calls this "LOROM". 2. ROM mapped to the top half of every possible bank, RAM mapped to the bottom half of banks 70-7d,f0-ff. The boards database calls this "LOROM-RAM" 3. ROM mapped to the top half of low-numbered banks, RAM mapped to both halves of banks 70-7d,f0-ff. The boards database calls this "LOROM-RAM#A" The largest official game that used variant 3 was 1MiB, so a common heuristic is "if the ROM is 2MiB or less, use variant 3, otherwise use variant 2". 2MiB is used as the threshold instead of 1MiB, perhaps so somebody can expand a commercial ROM that uses variant 3 without having to rework it to suit a different mapping. Since v107 or so, higan (and by extension, bsnes) has implemented variant 3 by mapping ROM to banks 00-3f,80-bf, which exactly fits a 2MiB ROM. However, other emulators like Mesen, snes9x and higan v106 implement it by mapping ROM to banks 00-6f,80-ef, all the space that is left after the RAM is mapped. This doesn't affect any verified games in the `Super Famicom.bml` database, since those have specific, accurate memory maps. It also won't affect well-written games that only read from memory addresses they have populated. However, homebrew games and ROM hacks that have never existed on a real circuit board depend on these heuristics across all devices that read Super Famicom ROMs, including software emulators, flash-carts, and FPGA implementations, so bsnes should match what other emulators do. Fixes #278. --- bsnes/target-bsnes/resource/resource.cpp | 2 +- bsnes/target-bsnes/resource/system/boards.bml | 2 +- bsnes/target-libretro/resources.hpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/bsnes/target-bsnes/resource/resource.cpp b/bsnes/target-bsnes/resource/resource.cpp index 57386d6a..f8554e74 100644 --- a/bsnes/target-bsnes/resource/resource.cpp +++ b/bsnes/target-bsnes/resource/resource.cpp @@ -2713,7 +2713,7 @@ const unsigned char Boards[32230] = { 97,112,32,97,100,100,114,101,115,115,61,55,48,45,55,100,44,102,48,45,102,102,58,48,48,48,48,45,55,102,102,102, 32,109,97,115,107,61,48,120,56,48,48,48,10,10,98,111,97,114,100,58,32,76,79,82,79,77,45,82,65,77,35,65, 10,32,32,109,101,109,111,114,121,32,116,121,112,101,61,82,79,77,32,99,111,110,116,101,110,116,61,80,114,111,103,114, - 97,109,10,32,32,32,32,109,97,112,32,97,100,100,114,101,115,115,61,48,48,45,51,102,44,56,48,45,98,102,58,56, + 97,109,10,32,32,32,32,109,97,112,32,97,100,100,114,101,115,115,61,48,48,45,54,102,44,56,48,45,101,102,58,56, 48,48,48,45,102,102,102,102,32,109,97,115,107,61,48,120,56,48,48,48,10,32,32,109,101,109,111,114,121,32,116,121, 112,101,61,82,65,77,32,99,111,110,116,101,110,116,61,83,97,118,101,10,32,32,32,32,109,97,112,32,97,100,100,114, 101,115,115,61,55,48,45,55,100,44,102,48,45,102,102,58,48,48,48,48,45,102,102,102,102,32,109,97,115,107,61,48, diff --git a/bsnes/target-bsnes/resource/system/boards.bml b/bsnes/target-bsnes/resource/system/boards.bml index d0cbe9ec..b40029b4 100644 --- a/bsnes/target-bsnes/resource/system/boards.bml +++ b/bsnes/target-bsnes/resource/system/boards.bml @@ -827,7 +827,7 @@ board: LOROM-RAM board: LOROM-RAM#A memory type=ROM content=Program - map address=00-3f,80-bf:8000-ffff mask=0x8000 + map address=00-6f,80-ef:8000-ffff mask=0x8000 memory type=RAM content=Save map address=70-7d,f0-ff:0000-ffff mask=0x8000 diff --git a/bsnes/target-libretro/resources.hpp b/bsnes/target-libretro/resources.hpp index 7f4dfac8..7675e744 100644 --- a/bsnes/target-libretro/resources.hpp +++ b/bsnes/target-libretro/resources.hpp @@ -848,7 +848,7 @@ const unsigned char Boards[32230] = { 97,112,32,97,100,100,114,101,115,115,61,55,48,45,55,100,44,102,48,45,102,102,58,48,48,48,48,45,55,102,102,102, 32,109,97,115,107,61,48,120,56,48,48,48,10,10,98,111,97,114,100,58,32,76,79,82,79,77,45,82,65,77,35,65, 10,32,32,109,101,109,111,114,121,32,116,121,112,101,61,82,79,77,32,99,111,110,116,101,110,116,61,80,114,111,103,114, - 97,109,10,32,32,32,32,109,97,112,32,97,100,100,114,101,115,115,61,48,48,45,51,102,44,56,48,45,98,102,58,56, + 97,109,10,32,32,32,32,109,97,112,32,97,100,100,114,101,115,115,61,48,48,45,54,102,44,56,48,45,101,102,58,56, 48,48,48,45,102,102,102,102,32,109,97,115,107,61,48,120,56,48,48,48,10,32,32,109,101,109,111,114,121,32,116,121, 112,101,61,82,65,77,32,99,111,110,116,101,110,116,61,83,97,118,101,10,32,32,32,32,109,97,112,32,97,100,100,114, 101,115,115,61,55,48,45,55,100,44,102,48,45,102,102,58,48,48,48,48,45,102,102,102,102,32,109,97,115,107,61,48, From e658f50da2f0b142f672452abad987341e81efd4 Mon Sep 17 00:00:00 2001 From: Tim Allen Date: Thu, 8 Jun 2023 21:40:33 +1000 Subject: [PATCH 4/5] nall: Add needed #include Taken from ares commit 6a7898396a14eef257e63cd002fb26ffbf6e2581 Apparently this is needed by GCC 13. --- nall/arithmetic.hpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/nall/arithmetic.hpp b/nall/arithmetic.hpp index 388370f1..85a383c4 100644 --- a/nall/arithmetic.hpp +++ b/nall/arithmetic.hpp @@ -3,6 +3,8 @@ //multi-precision arithmetic //warning: each size is quadratically more expensive than the size before it! +#include + #include #include #include From 7ec3077079445c1ab591d542d475da5fa121632e Mon Sep 17 00:00:00 2001 From: Tim Allen Date: Fri, 9 Jun 2023 17:49:28 +1000 Subject: [PATCH 5/5] Revert "nall: Add needed #include " This reverts commit e658f50da2f0b142f672452abad987341e81efd4. bsnes' compatibility with GCC 13 was already fixed in a different way in 5cefce5c08f74cfc80eee3f82a32d846144e5277. --- nall/arithmetic.hpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/nall/arithmetic.hpp b/nall/arithmetic.hpp index 85a383c4..388370f1 100644 --- a/nall/arithmetic.hpp +++ b/nall/arithmetic.hpp @@ -3,8 +3,6 @@ //multi-precision arithmetic //warning: each size is quadratically more expensive than the size before it! -#include - #include #include #include