Merge pull request #10 from NovaSquirrel/master

Merge from NovaSquirrel
This commit is contained in:
mkwong98 2021-07-14 09:31:35 +08:00 committed by GitHub
commit 6ca2ef5b18
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 64 additions and 11 deletions

20
.github/workflows/linux-build.yml vendored Normal file
View file

@ -0,0 +1,20 @@
name: "Linux build"
on: push
jobs:
win-build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up dependencies
run: |
sudo apt-get -qq update
sudo apt-get install -yq libsdl2-dev mono-devel
- name: Build
run: |
make
# - name: Upload binary
# uses: actions/upload-artifact@v1
# with:
# name: Mesen-win
# path: bin/Any CPU/Release/Mesen.exe

27
.github/workflows/win-build.yml vendored Normal file
View file

@ -0,0 +1,27 @@
name: "Windows build"
on: push
jobs:
win-build:
runs-on: windows-2019
steps:
- uses: actions/checkout@v2
- name: Set up dependencies
shell: bash
run: |
mkdir -p "bin/Any CPU/Release"
cp -v -r GUI.NET/Dependencies "bin/Any CPU/Release"
git describe --tags --dirty --always >"bin\Any CPU\Release\Dependencies\DevBuild.txt"
- name: Build core
working-directory: bin
shell: cmd
run: |
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
msbuild ..\Mesen.sln /t:Build /p:Configuration=Release /p:Platform=x64
copy "x64\Release\MesenCore.dll" "Any CPU\Release\Dependencies\MesenCore.x64.dll"
msbuild ..\Mesen.sln /t:Build /p:Configuration=Release /p:Platform="Any CPU" /property:DefineConstants="HIDETESTMENU;AUTOBUILD"
- name: Upload binary
uses: actions/upload-artifact@v1
with:
name: Mesen-win
path: bin/Any CPU/Release/Mesen.exe

View file

@ -4,9 +4,12 @@
#include "MMC3.h" #include "MMC3.h"
//Most likely incorrect/incomplete, but works (with minor glitches) with the 2 games marked as mapper 198 that I am aware of. //Most likely incorrect/incomplete, but works (with minor glitches) with the 2 games marked as mapper 198 that I am aware of.
//Game 1: 吞食天地2 (CHR RAM, but uses chr banking?, has save ram at 6000-7FFF?) //Game 1: 吞食天地: 三国外传 (Tūnshí Tiāndì - Sānguó Wàizhuàn) (CHR RAM, but uses chr banking?, has save ram at 6000-7FFF)
//Game 2: Cheng Ji Si Han (ES-1110) (Ch) (CHR RAM, work ram mirrored from 5000-7FFF?, doesn't use chr banking) // 吞食天地: 三国外传 (Tūnshí Tiāndì - Sānguó Wàizhuàn) uses ram 5000-7FFF (Add Chinese character process program in 5000-5FFF)
//These games may actually use different mappers. // Original 1994 Hong Kong release by an unknown publisher, 640 KiB PRG-ROM.
//Game 2: 成吉思汗 (Chéngjísīhán) (CHR RAM, work ram mirrored from 5000-7FFF?, doesn't use chr banking)
// 成吉思汗 (Chéngjísīhán) could actually be using MMC3_199 in reality according to the Nesdev wiki.
//These games may actually use different mappers altogether.
class MMC3_198 : public MMC3 class MMC3_198 : public MMC3
{ {
private: private:
@ -44,7 +47,7 @@ protected:
void WriteRegister(uint16_t addr, uint8_t value) override void WriteRegister(uint16_t addr, uint8_t value) override
{ {
if(addr == 0x8001 && (GetState().Reg8000 & 0x07) >= 6) { if(addr == 0x8001 && (GetState().Reg8000 & 0x07) >= 6) {
_exRegs[(GetState().Reg8000 & 0x07) - 6] = value & (value >= 0x40 ? 0x4F : 0x3F); _exRegs[(GetState().Reg8000 & 0x07) - 6] = value & 0x7F;
} }
MMC3::WriteRegister(addr, value); MMC3::WriteRegister(addr, value);
} }
@ -62,4 +65,4 @@ protected:
MMC3::UpdateChrMapping(); MMC3::UpdateChrMapping();
} }
} }
}; };

View file

@ -27,11 +27,12 @@ protected:
{ {
if(_extraReg & 0x40) { if(_extraReg & 0x40) {
page &= 0x7F; page &= 0x7F;
page |= ((_extraReg & 0x04) | ((_extraReg >> 4) & 0x03)) << 7; page |= (((_extraReg & 0x20) >> 3) | ((_extraReg & 0x10) >> 4) | ((_extraReg & 0x04) >> 1)) << 7;
} else { } else {
page &= 0xFF; page &= 0xFF;
page |= ((_extraReg & 0x04) | ((_extraReg >> 4) & 0x02)) << 7; page |= (((_extraReg & 0x20) >> 3) | ((_extraReg & 0x10) >> 4)) << 7;
} }
MMC3::SelectCHRPage(slot, page, memoryType); MMC3::SelectCHRPage(slot, page, memoryType);
} }
@ -62,4 +63,4 @@ protected:
MMC3::WriteRegister(addr, value); MMC3::WriteRegister(addr, value);
} }
} }
}; };

View file

@ -11,13 +11,15 @@ If you want to support this project, please consider making a donation:
## Development Builds ## Development Builds
Development builds of the latest commit are available from Appveyor. For stable release builds, see the **Releases** section below. Development builds of the latest commit are available from GitHub actions. For stable release builds, see the **Releases** section below.
**Warning:** These are development builds and may be ***unstable***. Using them may also increase the chances of your settings being corrupted, or having issues when upgrading to the next official release. Additionally, these builds are currently not optimized via PGO and will typically run 20-30% slower than the official release builds. **Warning:** These are development builds and may be ***unstable***. Using them may also increase the chances of your settings being corrupted, or having issues when upgrading to the next official release. Additionally, these builds are currently not optimized via PGO and will typically run 20-30% slower than the official release builds.
Windows: [![Build status](https://ci.appveyor.com/api/projects/status/d4i7rqbfi386wdyw/branch/master?svg=true)](https://ci.appveyor.com/project/Sour/mesen/build/artifacts) Follow either of these, select the top-most entry in the list, and then click the link under "Artifacts" near the bottom.
Linux: [![Build status](https://ci.appveyor.com/api/projects/status/uuoxwu7o5kkqjp4e/branch/master?svg=true)](https://ci.appveyor.com/project/Sour/mesen-nyf7v/build/artifacts) Windows: [![Build status](https://github.com/NovaSquirrel/Mesen/actions/workflows/win-build.yml/badge.svg)](https://github.com/NovaSquirrel/Mesen/actions/workflows/win-build.yml)
Linux: [![Build status](https://github.com/NovaSquirrel/Mesen/actions/workflows/linux-build.yml/badge.svg)](https://github.com/NovaSquirrel/Mesen/actions/workflows/linux-build.yml)
## Releases ## Releases