diff --git a/.github/workflows/WPCEmuCS-NuGet.yml b/.github/workflows/WPCEmuCS-NuGet.yml deleted file mode 100644 index 3f76bf2..0000000 --- a/.github/workflows/WPCEmuCS-NuGet.yml +++ /dev/null @@ -1,19 +0,0 @@ -name: WPCEmuCS NuGet - -on: [push, pull_request] - -jobs: - - wpcemu-cs-nuget: - runs-on: windows-latest - steps: - - uses: actions/checkout@v2 - - uses: actions/setup-dotnet@v1 - with: - dotnet-version: '3.1.x' - - name: Build - run: dotnet pack -c Release -o build/nupkg src/WPCEmu - - uses: actions/upload-artifact@v2 - with: - name: WPCEmuCS.nuget - path: build/nupkg/ diff --git a/.github/workflows/WPCEmuCS.yml b/.github/workflows/WPCEmuCS.yml deleted file mode 100644 index 1e4503b..0000000 --- a/.github/workflows/WPCEmuCS.yml +++ /dev/null @@ -1,66 +0,0 @@ -on: [push, pull_request] - -jobs: - wpcemu-cs-win-x64: - runs-on: windows-latest - steps: - - uses: actions/checkout@v2 - - uses: actions/setup-dotnet@v1 - with: - dotnet-version: '3.1.x' - - uses: nuget/setup-nuget@v1 - - name: Build - run: dotnet build -c Release -r win-x64 src - - name: Build Contents - run: ls -lart src/WPCEmu.Test/bin/Release/netcoreapp3.1/win-x64 - shell: bash - - name: Test - run: dotnet test -v n -r win-x64 src - shell: bash - - wpcemu-cs-win-x86: - runs-on: windows-latest - steps: - - uses: actions/checkout@v2 - - uses: actions/setup-dotnet@v1 - with: - dotnet-version: '3.1.x' - - uses: nuget/setup-nuget@v1 - - name: Build - run: dotnet build -c Release -r win-x86 src - - name: Build Contents - run: ls -lart src/WPCEmu.Test/bin/Release/netcoreapp3.1/win-x86 - shell: bash - - name: Test - run: dotnet test -v n -r win-x86 src - shell: bash - - wpcemu-cs-osx-x64: - runs-on: macos-latest - steps: - - uses: actions/checkout@v2 - - uses: actions/setup-dotnet@v1 - with: - dotnet-version: '3.1.x' - - uses: nuget/setup-nuget@v1 - - name: Build - run: dotnet build -c Release -r osx-x64 src - - name: Build Contents - run: ls -lart src/WPCEmu.Test/bin/Release/netcoreapp3.1/osx-x64 - - name: Test - run: dotnet test -v n -r osx-x64 src - - wpcemu-cs-linux-x64: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - uses: actions/setup-dotnet@v1 - with: - dotnet-version: '3.1.x' - - uses: nuget/setup-nuget@v1 - - name: Build - run: dotnet build -c Release -r linux-x64 src - - name: Build Contents - run: ls -lart src/WPCEmu.Test/bin/Release/netcoreapp3.1/linux-x64 - - name: Test - run: dotnet test -v n -r linux-x64 src diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..6d54912 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,46 @@ +name: Build +on: [push, pull_request] + +defaults: + run: + shell: bash + +jobs: + build: + name: Build ${{ matrix.rid }} + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + include: + - os: windows-latest + rid: win-x64 + - os: windows-latest + rid: win-x86 + - os: macos-latest + rid: osx-x64 + - os: ubuntu-latest + rid: linux-x64 + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-dotnet@v1 + with: + dotnet-version: '3.1.x' + - name: Build + run: | + cd src/WPCEmu + dotnet build WPCEmu.csproj -c Release -r ${{ matrix.rid }} + - name: Test + run: | + cd src/WPCEmu.Test + dotnet test WPCEmu.Test.csproj --runtime ${{ matrix.rid }} -v n + + dispatch: + runs-on: ubuntu-latest + needs: [ build ] + if: github.repository == 'jsm174/wpc-emu-cs' && github.ref == 'refs/heads/master' && github.event_name == 'push' + steps: + - uses: peter-evans/repository-dispatch@v1 + with: + token: ${{ secrets.GH_PAT }} + event-type: build-complete diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..dd8fb93 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,19 @@ +name: Publish +on: + repository_dispatch: + types: [ release-complete ] + +jobs: + publish: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + with: + ref: ${{ github.event.client_payload.commitish }} + - uses: actions/setup-dotnet@v1 + with: + dotnet-version: '3.1.x' + - run: | + cd src/WPCEmu + dotnet pack -c Release -o nupkg + nuget push nupkg/WPCEmu.*.nupkg -ApiKey ${{ secrets.NUGET_KEY }} -src https://api.nuget.org/v3/index.json diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..9cde384 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,58 @@ +name: Release +on: + repository_dispatch: + types: [ build-complete ] + +jobs: + release: + runs-on: ubuntu-latest + outputs: + nextVersion: ${{ steps.nextVersion.outputs.nextVersion }} + nextTag: ${{ steps.nextVersion.outputs.nextTag }} + commitish: ${{ steps.commit.outputs.commitish }} + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 0 + - id: nextVersion + run: | + sudo apt-get install xmlstarlet + cd src/WPCEmu + VERSION=$(npx semver -i prerelease $(xmlstarlet sel -t -v "//Project/PropertyGroup/PackageVersion" WPCEmu.csproj)) + xmlstarlet ed -L -u "//Project/PropertyGroup/PackageVersion" -v $VERSION WPCEmu.csproj + echo ::set-output name=nextVersion::${VERSION} + echo ::set-output name=nextTag::"v${VERSION}" + - name: Commit + id: commit + run: | + git config user.name "github-actions" + git config user.email "41898282+github-actions[bot]@users.noreply.github.com" + git add src/WPCEmu/WPCEmu.csproj + git commit -m "release: ${{ steps.nextVersion.outputs.nextTag }}." + git push + commitish=$(git rev-parse HEAD) + echo ::set-output name=commitish::${commitish} + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Create Release + uses: actions/create-release@v1 + with: + tag_name: ${{ steps.nextVersion.outputs.nextTag }} + release_name: ${{ steps.nextVersion.outputs.nextTag }} + prerelease: true + commitish: ${{ steps.commit.outputs.commitish }} + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + dispatch: + runs-on: ubuntu-latest + needs: [ release ] + steps: + - uses: peter-evans/repository-dispatch@v1 + with: + token: ${{ secrets.GH_PAT }} + event-type: release-complete + client-payload: '{ "run_id": "${{ github.run_id }}", + "nextVersion": "${{ needs.release.outputs.nextVersion }}", + "nextTag": "${{ needs.release.outputs.nextTag }}", + "commitish": "${{ needs.release.outputs.commitish }}" }' diff --git a/README.md b/README.md new file mode 100644 index 0000000..59946d5 --- /dev/null +++ b/README.md @@ -0,0 +1,29 @@ +# WPC-Emu CS + +[![CI status (x64 Linux, macOS and Windows)](https://github.com/jsm174/wpc-emu-cs/actions/workflows/build.yml/badge.svg?branch=master)](https://github.com/jsm174/wpc-emu-cs/actions) +[![NuGet](https://img.shields.io/nuget/vpre/WPCEmuCS.svg)](https://www.nuget.org/packages/WPCEmuCS) + +*Add WPC-Emu support to any .NET application* + +This Nuget package is C# port of neophob's amazing WPC Emulator [wpc-emu](https://github.com/neophob/wpc-emu). + +## Supported Platforms + +- .NET Core (.NETStandard 2.0 and higher on Windows, Linux and macOS) +- Mono + +## Setup + +To install this package, run: + +``` +Install-Package WPCEmuCS +``` + +## Usage + +See the [example project](https://github.com/jsm174/wpc-emu-cs/blob/master/src/WPCEmu.Example/Example.cs) for more information. + +## License + +[Apache License Version 2.0](LICENSE.txt) diff --git a/src/WPCEmu.Example/Example.cs b/src/WPCEmu.Example/Example.cs new file mode 100644 index 0000000..cd06c7a --- /dev/null +++ b/src/WPCEmu.Example/Example.cs @@ -0,0 +1,115 @@ +using System; +using System.IO; +using WPCEmu.Boards.Elements; +using System.Threading.Tasks; +using System.Threading; + +namespace WPCEmu.Example +{ + class Example + { + const int TICKS_PER_SECOND = 2000000; + const int TICKS_PER_STEP = 16; + const int INITIAL_FRAMERATE = 50; + + static string[] DOTS = new string[] + { + " ", + "░", + "▒", + "▓", + "▓" + }; + + static void Start(Emulator wpcSystem) + { + int ticksPerCall = TICKS_PER_SECOND / INITIAL_FRAMERATE; + int intervalTimingMs = 1000 / INITIAL_FRAMERATE; + + Task.Run(() => + { + new Timer(_ => wpcSystem.setCabinetInput(16), null, 1500, Timeout.Infinite); + + while (true) + { + wpcSystem.executeCycle(ticksPerCall, TICKS_PER_STEP); + + DumpDMD(wpcSystem); + + Thread.Sleep(intervalTimingMs); + } + }); + + while (true) + { + Thread.Sleep(intervalTimingMs); + } + } + + static void DumpDMD(Emulator wpcSystem) + { + var state = wpcSystem.getState(); + + var display = (OutputDmdDisplay.State)state.asic?.display; + + var dmd = ""; + + for (var y = 0; y < 32; y++) + { + for (var x = 0; x < 128; x++) + { + var pixel = y * 128 + x; + var value = display.dmdShadedBuffer[pixel]; + + dmd += DOTS[value]; + } + + dmd += "\n"; + } + + Console.SetCursorPosition(0, 0); + Console.WriteLine(dmd); + Console.WriteLine(state.cpuState.tickCount); + } + + static void Main(string[] args) + { + try + { + if (args.Length < 1) + { + throw new ArgumentException("USAGE: Example "); + } + + var u06 = File.ReadAllBytes(args[0]); + + var romObject = new RomBinary + { + u06 = u06 + }; + + var metaData = new RomMetaData + { + skipWpcRomCheck = false, + features = new string[] + { + "securityPic", + "wpc95" + }, + }; + + var wpcSystem = Emulator.initVMwithRom(romObject, metaData); + + wpcSystem.reset(); + wpcSystem.start(); + + Start(wpcSystem); + } + + catch (Exception e) + { + Console.WriteLine(e); + } + } + } +} \ No newline at end of file diff --git a/src/WPCEmu.Example/WPCEmu.Example.csproj b/src/WPCEmu.Example/WPCEmu.Example.csproj new file mode 100644 index 0000000..7b1138e --- /dev/null +++ b/src/WPCEmu.Example/WPCEmu.Example.csproj @@ -0,0 +1,9 @@ + + + netcoreapp3.1 + Exe + + + + + diff --git a/src/WPCEmu.Test/Boards/AsicTests.cs b/src/WPCEmu.Test/Boards/AsicTests.cs index 4b5d3db..26285e7 100644 --- a/src/WPCEmu.Test/Boards/AsicTests.cs +++ b/src/WPCEmu.Test/Boards/AsicTests.cs @@ -1,9 +1,9 @@ -using NUnit.Framework; +using NUnit.Framework; using WPCEmu.Boards; -namespace WPCEmu.Test.Boards -{ - [TestFixture] +namespace WPCEmu.Test.Boards +{ + [TestFixture] public class AsicTests { CpuBoardAsic wpc; @@ -20,7 +20,7 @@ public void Init() }); } - [Test, Order(1)] + [Test, Order(1)] public void ShouldSetZeroCrossFlag() { TestContext.WriteLine("wpc, should set zerocross flag"); @@ -29,7 +29,7 @@ public void ShouldSetZeroCrossFlag() Assert.That(wpc.zeroCrossFlag, Is.EqualTo(1)); } - [Test, Order(2)] + [Test, Order(2)] public void ShouldClearZeroCrossFlagWhenRead() { TestContext.WriteLine("wpc, should clear zerocross flag when read"); @@ -40,7 +40,7 @@ public void ShouldClearZeroCrossFlagWhenRead() Assert.That(wpc.zeroCrossFlag, Is.EqualTo(0)); } - [Test, Order(3)] + [Test, Order(3)] public void ShouldRespectOldZeroCrossFlagWhenRead() { TestContext.WriteLine("wpc, should respect old zerocross flag state when read"); @@ -52,7 +52,7 @@ public void ShouldRespectOldZeroCrossFlagWhenRead() Assert.That(wpc.zeroCrossFlag, Is.EqualTo(0)); } - [Test, Order(4)] + [Test, Order(4)] public void ShouldRespectOldZeroCrossFlagWhenReadXXX() { TestContext.WriteLine("wpc, should respect old zerocross flag state when read,xxx"); @@ -63,7 +63,7 @@ public void ShouldRespectOldZeroCrossFlagWhenReadXXX() Assert.That(wpc.zeroCrossFlag, Is.EqualTo(0)); } - [Test, Order(5)] + [Test, Order(5)] public void Should_WPC_SHIFTADDRL_By_0xFF() { TestContext.WriteLine("wpc, should WPC_SHIFTADDRL by 0xFF"); @@ -74,7 +74,7 @@ public void Should_WPC_SHIFTADDRL_By_0xFF() Assert.That(result, Is.EqualTo(0x27)); } - [Test, Order(6)] + [Test, Order(6)] public void Should_WPC_SHIFTADDRL_0x00_By_0x80() { TestContext.WriteLine("wpc, should WPC_SHIFTADDRL 0x00 by 0x80"); @@ -85,7 +85,7 @@ public void Should_WPC_SHIFTADDRL_0x00_By_0x80() Assert.That(result, Is.EqualTo(0x10)); } - [Test, Order(7)] + [Test, Order(7)] public void Should_WPC_SHIFTADDRL_0x00_By_0x40() { TestContext.WriteLine("wpc, should WPC_SHIFTADDRL 0x00 by 0x40"); @@ -96,7 +96,7 @@ public void Should_WPC_SHIFTADDRL_0x00_By_0x40() Assert.That(result, Is.EqualTo(0x08)); } - [Test, Order(8)] + [Test, Order(8)] public void Should_WPC_SHIFTADDRL_By_0x1() { TestContext.WriteLine("wpc, should WPC_SHIFTADDRL by 0x1 - not sure"); @@ -107,7 +107,7 @@ public void Should_WPC_SHIFTADDRL_By_0x1() Assert.That(result, Is.EqualTo(0x08)); } - [Test, Order(9)] + [Test, Order(9)] public void Should_WPC_SHIFTADDRH() { TestContext.WriteLine("wpc, should WPC_SHIFTADDRH - not sure"); @@ -119,7 +119,7 @@ public void Should_WPC_SHIFTADDRH() Assert.That(result, Is.EqualTo(0xA8)); } - [Test, Order(10)] + [Test, Order(10)] public void Should_WPC_SHIFTADDRH_MaxValue() { TestContext.WriteLine("wpc, should WPC_SHIFTADDRH, max value"); @@ -131,7 +131,7 @@ public void Should_WPC_SHIFTADDRH_MaxValue() Assert.That(result, Is.EqualTo(0x0)); } - [Test, Order(11)] + [Test, Order(11)] public void Should_WPC_SHIFTBIT_0x00_SetBit0() { TestContext.WriteLine("wpc, should WPC_SHIFTBIT 0x00 (set bit 0)"); @@ -141,7 +141,7 @@ public void Should_WPC_SHIFTBIT_0x00_SetBit0() Assert.That(result, Is.EqualTo(0x01)); } - [Test, Order(12)] + [Test, Order(12)] public void Should_WPC_SHIFTBIT_0x01_SetBit1() { TestContext.WriteLine("wpc, should WPC_SHIFTBIT 0x01 (set bit 1)"); @@ -151,7 +151,7 @@ public void Should_WPC_SHIFTBIT_0x01_SetBit1() Assert.That(result, Is.EqualTo(0x02)); } - [Test, Order(13)] + [Test, Order(13)] public void Should_WPC_SHIFTBIT_0x04_SetBit5() { TestContext.WriteLine("wpc, should WPC_SHIFTBIT 0x04 (set bit 5)"); @@ -161,7 +161,7 @@ public void Should_WPC_SHIFTBIT_0x04_SetBit5() Assert.That(result, Is.EqualTo(0x10)); } - [Test, Order(14)] + [Test, Order(14)] public void Should_WPC_SHIFTBIT_0x07_SetBit7() { TestContext.WriteLine("wpc, should WPC_SHIFTBIT 0x07 (set bit 7)"); @@ -171,7 +171,7 @@ public void Should_WPC_SHIFTBIT_0x07_SetBit7() Assert.That(result, Is.EqualTo(0x80)); } - [Test, Order(15)] + [Test, Order(15)] public void Should_WPC_SHIFTBIT2_0x07_SetBit7() { TestContext.WriteLine("wpc, should WPC_SHIFTBIT2 0x07 (set bit 7)"); @@ -181,7 +181,7 @@ public void Should_WPC_SHIFTBIT2_0x07_SetBit7() Assert.That(result, Is.EqualTo(0x80)); } - [Test, Order(16)] + [Test, Order(16)] public void Should_WPC_SHIFTBIT_0xFF_SetBit7() { TestContext.WriteLine("wpc, should WPC_SHIFTBIT 0xFF (set bit 7)"); @@ -191,7 +191,7 @@ public void Should_WPC_SHIFTBIT_0xFF_SetBit7() Assert.That(result, Is.EqualTo(0x80)); } - [Test, Order(17)] + [Test, Order(17)] public void UpdateActiveLamp() { TestContext.WriteLine("wpc, update active lamp"); @@ -215,7 +215,7 @@ public void UpdateActiveLamp() // Assert.That(wpc.ram[0x1808], Is.EqualTo(62)); //} - [Test, Order(19)] + [Test, Order(19)] public void WriteAndReadFliptronics() { TestContext.WriteLine("wpc, write and read fliptronics"); @@ -254,7 +254,7 @@ public void IgnoreEmptyState() Assert.That(result, Is.EqualTo(false)); } - [Test, Order(23)] + [Test, Order(23)] public void GetStateSetState() { TestContext.WriteLine("wpc, getState / setState"); @@ -266,7 +266,7 @@ public void GetStateSetState() Assert.That(wpc.romBank, Is.EqualTo(11)); } - [Test, Order(24)] + [Test, Order(24)] public void ShouldResetBlanking() { TestContext.WriteLine("wpc, should reset blanking"); @@ -275,7 +275,7 @@ public void ShouldResetBlanking() Assert.That(wpc.blankSignalHigh, Is.EqualTo(false)); } - [Test, Order(25)] + [Test, Order(25)] public void ShouldNotResetBlanking() { TestContext.WriteLine("wpc, should NOT reset blanking"); @@ -283,5 +283,5 @@ public void ShouldNotResetBlanking() wpc.write(CpuBoardAsic.OP.WPC_ZEROCROSS_IRQ_CLEAR, 0x04); Assert.That(wpc.blankSignalHigh, Is.EqualTo(true)); } - } + } } diff --git a/src/WPCEmu.Test/Boards/CpuBoardTests.cs b/src/WPCEmu.Test/Boards/CpuBoardTests.cs index bb5e388..b050dbb 100644 --- a/src/WPCEmu.Test/Boards/CpuBoardTests.cs +++ b/src/WPCEmu.Test/Boards/CpuBoardTests.cs @@ -1,10 +1,10 @@ -using System.Linq; -using NUnit.Framework; +using System.Linq; +using NUnit.Framework; using WPCEmu.Boards; -namespace WPCEmu.Test.Boards -{ - [TestFixture] +namespace WPCEmu.Test.Boards +{ + [TestFixture] public class CpuBoardTests { const ushort PAGESIZE = 0x4000; @@ -27,7 +27,7 @@ public void Init() cpuBoard = WpcCpuBoard.getInstance(initObject); } - [Test, Order(1)] + [Test, Order(1)] public void ShouldGetUIData() { TestContext.WriteLine("should get ui data"); @@ -45,7 +45,7 @@ public void ShouldGetUIData() Assert.That(result.version, Is.EqualTo(5)); } - [Test, Order(2)] + [Test, Order(2)] public void ShouldStartCpuBoard() { TestContext.WriteLine("should start cpu board"); @@ -55,7 +55,7 @@ public void ShouldStartCpuBoard() Assert.That(result.cpuState.tickCount, Is.EqualTo(0)); } - [Test, Order(3)] + [Test, Order(3)] public void ShouldIgnoreEmptySetState() { TestContext.WriteLine("should ignore empty setState"); @@ -65,7 +65,7 @@ public void ShouldIgnoreEmptySetState() Assert.That(result, Is.EqualTo(false)); } - [Test, Order(4)] + [Test, Order(4)] public void ShouldIgnoreInvalidVersion() { TestContext.WriteLine("should ignore empty setState"); @@ -78,7 +78,7 @@ public void ShouldIgnoreInvalidVersion() Assert.That(result, Is.EqualTo(false)); } - [Test, Order(5)] + [Test, Order(5)] public void ShouldChangeCabinetInput() { TestContext.WriteLine("should change cabinet input"); @@ -90,7 +90,7 @@ public void ShouldChangeCabinetInput() Assert.That(result[0], Is.EqualTo(1)); } - [Test, Order(6)] + [Test, Order(6)] public void ShouldChangeSwitchInput() { TestContext.WriteLine("should change switch input"); @@ -103,7 +103,7 @@ public void ShouldChangeSwitchInput() Assert.That(result[1], Is.EqualTo(5)); } - [Test, Order(7)] + [Test, Order(7)] public void ShouldChangeFliptronicsInput() { TestContext.WriteLine("should change fliptronics input"); @@ -115,7 +115,7 @@ public void ShouldChangeFliptronicsInput() Assert.That(result[9], Is.EqualTo(1)); } - [Test, Order(8)] + [Test, Order(8)] public void ShouldEnableToggleMidnightMadnessMode() { TestContext.WriteLine("should enable toggleMidnightMadnessMode"); @@ -127,7 +127,7 @@ public void ShouldEnableToggleMidnightMadnessMode() Assert.That(result, Does.Match("MM!$")); } - [Test, Order(9)] + [Test, Order(9)] public void ShouldBankSwitchedReadBank0() { TestContext.WriteLine("should _bankswitchedRead, bank 0"); @@ -139,7 +139,7 @@ public void ShouldBankSwitchedReadBank0() Assert.That(result, Is.EqualTo(12)); } - [Test, Order(10)] + [Test, Order(10)] public void ShouldBankSwitchedReadBank1() { TestContext.WriteLine("should _bankswitchedRead, bank 1"); @@ -151,7 +151,7 @@ public void ShouldBankSwitchedReadBank1() Assert.That(result, Is.EqualTo(12)); } - [Test, Order(11)] + [Test, Order(11)] public void ShouldBankSwitchedReadBank5() { TestContext.WriteLine("should _bankswitchedRead, bank 5"); @@ -163,7 +163,7 @@ public void ShouldBankSwitchedReadBank5() Assert.That(result, Is.EqualTo(12)); } - [Test, Order(12)] + [Test, Order(12)] public void ShouldBankSwitchedReadBank6_SystemRomOutOfBand() { TestContext.WriteLine("should _bankswitchedRead, bank 6 (systemrom, out of band)"); @@ -175,7 +175,7 @@ public void ShouldBankSwitchedReadBank6_SystemRomOutOfBand() Assert.That(result, Is.EqualTo(0)); } - [Test, Order(13)] + [Test, Order(13)] public void ShouldBankSwitchedReadBank8() { TestContext.WriteLine("should _bankswitchedRead, bank 8"); @@ -187,7 +187,7 @@ public void ShouldBankSwitchedReadBank8() Assert.That(result, Is.EqualTo(12)); } - [Test, Order(14)] + [Test, Order(14)] public void ShouldMirrorWpcAsicCallsInMemory() { TestContext.WriteLine("should mirror wpc asic calls in memory"); @@ -197,5 +197,5 @@ public void ShouldMirrorWpcAsicCallsInMemory() var result = cpuBoard.ram[WPC_ROM_BANK]; Assert.That(result, Is.EqualTo(BANK)); } - } -} + } +} diff --git a/src/WPCEmu.Test/Boards/DisplayBoardTests.cs b/src/WPCEmu.Test/Boards/DisplayBoardTests.cs index f8ac96d..2bc67f5 100644 --- a/src/WPCEmu.Test/Boards/DisplayBoardTests.cs +++ b/src/WPCEmu.Test/Boards/DisplayBoardTests.cs @@ -1,11 +1,11 @@ -using System.Collections.Generic; -using NUnit.Framework; +using System.Collections.Generic; +using NUnit.Framework; using WPCEmu.Boards; using WPCEmu.Boards.Elements; -namespace WPCEmu.Test.Boards -{ - [TestFixture] +namespace WPCEmu.Test.Boards +{ + [TestFixture] public class DisplayBoardTests { struct TestData @@ -28,7 +28,7 @@ public void Init() }); } - [Test, Order(1)] + [Test, Order(1)] public void ShouldWriteToHardwareRam() { TestContext.WriteLine("displayBoard, should write to hardwareRam"); @@ -37,7 +37,7 @@ public void ShouldWriteToHardwareRam() Assert.That(displayBoard.ram[0x3FBD], Is.EqualTo(0xFF)); } - [Test, Order(2)] + [Test, Order(2)] public void ShouldReadToWrite_WPC_DMD_SCANLINE() { TestContext.WriteLine("displayBoard, should read to WPC_DMD_SCANLINE"); @@ -46,7 +46,7 @@ public void ShouldReadToWrite_WPC_DMD_SCANLINE() Assert.That(result, Is.EqualTo(0x0)); } - [Test, Order(3)] + [Test, Order(3)] public void ShouldMap_WPC_DMD_LOW_PAGE() { TestContext.WriteLine("displayBoard, should map WPC_DMD_LOW_PAGE"); @@ -56,7 +56,7 @@ public void ShouldMap_WPC_DMD_LOW_PAGE() Assert.That(((OutputDmdDisplay.State)result).dmdPageMapping[0], Is.EqualTo(2)); } - [Test, Order(4)] + [Test, Order(4)] public void ShouldMap_WPC_DMD_LOW_PAGE_WrapValue() { TestContext.WriteLine("displayBoard, should map WPC_DMD_LOW_PAGE, wrap value"); @@ -66,7 +66,7 @@ public void ShouldMap_WPC_DMD_LOW_PAGE_WrapValue() Assert.That(((OutputDmdDisplay.State)result).dmdPageMapping[0], Is.EqualTo(0xF)); } - [Test, Order(5)] + [Test, Order(5)] public void ShouldMap_WPC_DMD_HIGH_PAGE() { TestContext.WriteLine("displayBoard, should map WPC_DMD_HIGH_PAGE"); @@ -76,7 +76,7 @@ public void ShouldMap_WPC_DMD_HIGH_PAGE() Assert.That(((OutputDmdDisplay.State)result).dmdPageMapping[1], Is.EqualTo(3)); } - [Test, Order(6)] + [Test, Order(6)] public void ShouldMap_WPC95_DMD_PAGE3000() { TestContext.WriteLine("displayBoard, should map WPC95_DMD_PAGE3000"); @@ -86,7 +86,7 @@ public void ShouldMap_WPC95_DMD_PAGE3000() Assert.That(((OutputDmdDisplay.State)result).dmdPageMapping[2], Is.EqualTo(5)); } - [Test, Order(7)] + [Test, Order(7)] public void ShouldMap_WPC95_DMD_PAGE3200() { TestContext.WriteLine("displayBoard, should map WPC95_DMD_PAGE3200"); @@ -96,7 +96,7 @@ public void ShouldMap_WPC95_DMD_PAGE3200() Assert.That(((OutputDmdDisplay.State)result).dmdPageMapping[3], Is.EqualTo(6)); } - [Test, Order(8)] + [Test, Order(8)] public void ShouldMap_WPC95_DMD_PAGE3400() { TestContext.WriteLine("displayBoard, should map WPC95_DMD_PAGE3400"); @@ -106,7 +106,7 @@ public void ShouldMap_WPC95_DMD_PAGE3400() Assert.That(((OutputDmdDisplay.State)result).dmdPageMapping[4], Is.EqualTo(7)); } - [Test, Order(9)] + [Test, Order(9)] public void ShouldMap_WPC95_DMD_PAGE3600() { TestContext.WriteLine("displayBoard, should map WPC95_DMD_PAGE3600"); @@ -116,7 +116,7 @@ public void ShouldMap_WPC95_DMD_PAGE3600() Assert.That(((OutputDmdDisplay.State)result).dmdPageMapping[5], Is.EqualTo(8)); } - [Test, Order(10)] + [Test, Order(10)] public void ShouldWriteNextActivePageWrapAround() { TestContext.WriteLine("displayBoard, should write next active page, wrap around"); @@ -126,7 +126,7 @@ public void ShouldWriteNextActivePageWrapAround() Assert.That(((OutputDmdDisplay.State)result).nextActivePage, Is.EqualTo(0xF)); } - [Test, Order(11)] + [Test, Order(11)] public void ShouldWriteToDmdRam() { List list = new List() diff --git a/src/WPCEmu.Test/Boards/Elements/BitmagicTests.cs b/src/WPCEmu.Test/Boards/Elements/BitmagicTests.cs index 97baa61..73d1f86 100644 --- a/src/WPCEmu.Test/Boards/Elements/BitmagicTests.cs +++ b/src/WPCEmu.Test/Boards/Elements/BitmagicTests.cs @@ -1,21 +1,21 @@ -using NUnit.Framework; -using WPCEmu.Boards.Elements; - -namespace WPCEmu.Test.Boards.Elements -{ - [TestFixture] +using NUnit.Framework; +using WPCEmu.Boards.Elements; + +namespace WPCEmu.Test.Boards.Elements +{ + [TestFixture] public class BitmagicTests { - [Test, Order(1)] + [Test, Order(1)] public void ShouldGetMsb_0x0A() { TestContext.WriteLine("bitmagic, should get msb from 0x0A"); var result = Bitmagic.findMsbBit(0x0A); Assert.That(result, Is.EqualTo(0)); - } - - [Test, Order(2)] + } + + [Test, Order(2)] public void ShouldGetMsb_0x80() { TestContext.WriteLine("bitmagic, should get msb from 0x80"); @@ -77,5 +77,5 @@ public void ShouldSetMsb_7() var result = Bitmagic.setMsbBit(7); Assert.That(result, Is.EqualTo(0x80)); } - } -} + } +} diff --git a/src/WPCEmu.Test/Boards/Elements/InputSwitchMatrixTests.cs b/src/WPCEmu.Test/Boards/Elements/InputSwitchMatrixTests.cs index a75db14..6e6c8d4 100644 --- a/src/WPCEmu.Test/Boards/Elements/InputSwitchMatrixTests.cs +++ b/src/WPCEmu.Test/Boards/Elements/InputSwitchMatrixTests.cs @@ -1,9 +1,9 @@ -using NUnit.Framework; -using WPCEmu.Boards.Elements; - -namespace WPCEmu.Test.Boards.Elements -{ - [TestFixture] +using NUnit.Framework; +using WPCEmu.Boards.Elements; + +namespace WPCEmu.Test.Boards.Elements +{ + [TestFixture] public class InputSwitchMatrixTests { InputSwitchMatrix inputSwitchMatrix; @@ -12,9 +12,9 @@ public class InputSwitchMatrixTests public void Init() { inputSwitchMatrix = InputSwitchMatrix.getInstance(); - } - - [Test, Order(1)] + } + + [Test, Order(1)] public void SetCabinetKey_0x1() { TestContext.WriteLine("InputSwitchMatrix, setCabinetKey - 0x1"); @@ -23,7 +23,7 @@ public void SetCabinetKey_0x1() Assert.That(inputSwitchMatrix.switchState[0], Is.EqualTo(1)); } - [Test, Order(2)] + [Test, Order(2)] public void SetCabinetKey_0x5() { TestContext.WriteLine("InputSwitchMatrix, setCabinetKey - 0x5"); @@ -32,7 +32,7 @@ public void SetCabinetKey_0x5() Assert.That(inputSwitchMatrix.switchState[0], Is.EqualTo(5)); } - [Test, Order(3)] + [Test, Order(3)] public void GetCabinetKey() { TestContext.WriteLine("InputSwitchMatrix, getCabinetKey"); @@ -41,7 +41,7 @@ public void GetCabinetKey() Assert.That(inputSwitchMatrix.getCabinetKey(), Is.EqualTo(5)); } - [Test, Order(4)] + [Test, Order(4)] public void SetFliptronicsInput_Invalid() { TestContext.WriteLine("InputSwitchMatrix, setFliptronicsInput invalid"); @@ -49,7 +49,7 @@ public void SetFliptronicsInput_Invalid() Assert.That(inputSwitchMatrix.getFliptronicsKeys(), Is.EqualTo(255)); } - [Test, Order(5)] + [Test, Order(5)] public void SetFliptronicsInput_true() { TestContext.WriteLine("InputSwitchMatrix, setFliptronicsInput true"); @@ -58,7 +58,7 @@ public void SetFliptronicsInput_true() Assert.That(inputSwitchMatrix.getFliptronicsKeys(), Is.EqualTo(255)); } - [Test, Order(6)] + [Test, Order(6)] public void SetFliptronicsInput_false() { TestContext.WriteLine("InputSwitchMatrix, setFliptronicsInput true"); @@ -67,7 +67,7 @@ public void SetFliptronicsInput_false() Assert.That(inputSwitchMatrix.getFliptronicsKeys(), Is.EqualTo(255)); } - [Test, Order(7)] + [Test, Order(7)] public void GetFliptronicsKeysInverted() { TestContext.WriteLine("InputSwitchMatrix, getFliptronicsKeys - return inverted value"); @@ -77,7 +77,7 @@ public void GetFliptronicsKeysInverted() Assert.That(inputSwitchMatrix.getFliptronicsKeys(), Is.EqualTo(223)); } - [Test, Order(8)] + [Test, Order(8)] public void GetRow() { TestContext.WriteLine("InputSwitchMatrix, getRow"); @@ -86,7 +86,7 @@ public void GetRow() Assert.That(result, Is.EqualTo(0)); } - [Test, Order(9)] + [Test, Order(9)] public void IgnoreInvalidKeySetInputKey() { TestContext.WriteLine("InputSwitchMatrix, ignore invalid key setInputKey"); @@ -95,7 +95,7 @@ public void IgnoreInvalidKeySetInputKey() Assert.That(inputSwitchMatrix.switchState[1], Is.EqualTo(0)); } - [Test, Order(10)] + [Test, Order(10)] public void ValidSetInputKey() { TestContext.WriteLine("InputSwitchMatrix, valid setInputKey"); @@ -104,7 +104,7 @@ public void ValidSetInputKey() Assert.That(inputSwitchMatrix.switchState[2], Is.EqualTo(24)); } - [Test, Order(11)] + [Test, Order(11)] public void SetInputKeyShouldSetKey() { TestContext.WriteLine("InputSwitchMatrix, setInputKey should set key"); @@ -113,7 +113,7 @@ public void SetInputKeyShouldSetKey() Assert.That(inputSwitchMatrix.switchState[2], Is.EqualTo(24)); } - [Test, Order(12)] + [Test, Order(12)] public void SetInputKeyShouldClearKey() { TestContext.WriteLine("InputSwitchMatrix, setInputKey should clear key"); @@ -121,5 +121,5 @@ public void SetInputKeyShouldClearKey() inputSwitchMatrix.setInputKey(25, false); Assert.That(inputSwitchMatrix.switchState[2], Is.EqualTo(8)); } - } -} + } +} diff --git a/src/WPCEmu.Test/Boards/Elements/MemoryPatchGameIdTests.cs b/src/WPCEmu.Test/Boards/Elements/MemoryPatchGameIdTests.cs index 814fa7f..558fdaf 100644 --- a/src/WPCEmu.Test/Boards/Elements/MemoryPatchGameIdTests.cs +++ b/src/WPCEmu.Test/Boards/Elements/MemoryPatchGameIdTests.cs @@ -1,12 +1,12 @@ -using NUnit.Framework; -using WPCEmu.Boards.Elements; - -namespace WPCEmu.Test.Boards.Elements -{ - [TestFixture] +using NUnit.Framework; +using WPCEmu.Boards.Elements; + +namespace WPCEmu.Test.Boards.Elements +{ + [TestFixture] public class MemoryPatchGameIdTests { - [Test, Order(1)] + [Test, Order(1)] public void ShouldReturnPatchedGameId() { TestContext.WriteLine("MemoryPatchGameId, should return a patched game id"); @@ -18,5 +18,5 @@ public void ShouldReturnPatchedGameId() Assert.That(gameIdLo?.value, Is.EqualTo(20)); Assert.That(gameIdHi?.value, Is.EqualTo(99)); } - } -} + } +} diff --git a/src/WPCEmu.Test/Boards/Elements/MemoryPatchSkipBootCheckTests.cs b/src/WPCEmu.Test/Boards/Elements/MemoryPatchSkipBootCheckTests.cs index bc76b3c..36122d7 100644 --- a/src/WPCEmu.Test/Boards/Elements/MemoryPatchSkipBootCheckTests.cs +++ b/src/WPCEmu.Test/Boards/Elements/MemoryPatchSkipBootCheckTests.cs @@ -1,12 +1,12 @@ -using NUnit.Framework; -using WPCEmu.Boards.Elements; - -namespace WPCEmu.Test.Boards.Elements -{ - [TestFixture] +using NUnit.Framework; +using WPCEmu.Boards.Elements; + +namespace WPCEmu.Test.Boards.Elements +{ + [TestFixture] public class MemoryPatchSkipBootCheckTests { - [Test, Order(1)] + [Test, Order(1)] public void ShouldReturnPatchedGameId() { TestContext.WriteLine("MemoryPatchSkipBootCheck, should return a patched game id"); @@ -18,5 +18,5 @@ public void ShouldReturnPatchedGameId() Assert.That(checkLo?.value, Is.EqualTo(0x00)); Assert.That(checkHi?.value, Is.EqualTo(0xFF)); } - } -} + } +} diff --git a/src/WPCEmu.Test/Boards/Elements/MemoryPatchTests.cs b/src/WPCEmu.Test/Boards/Elements/MemoryPatchTests.cs index 3022bbe..439699a 100644 --- a/src/WPCEmu.Test/Boards/Elements/MemoryPatchTests.cs +++ b/src/WPCEmu.Test/Boards/Elements/MemoryPatchTests.cs @@ -1,13 +1,13 @@ -using System.Linq; -using NUnit.Framework; -using WPCEmu.Boards.Elements; - -namespace WPCEmu.Test.Boards.Elements -{ - [TestFixture] +using System.Linq; +using NUnit.Framework; +using WPCEmu.Boards.Elements; + +namespace WPCEmu.Test.Boards.Elements +{ + [TestFixture] public class MemoryPatchTests { - [Test, Order(1)] + [Test, Order(1)] public void ShouldNotReturnValue() { TestContext.WriteLine("memoryPatch, should not return a value"); @@ -17,7 +17,7 @@ public void ShouldNotReturnValue() Assert.That(result, Is.EqualTo(null)); } - [Test, Order(2)] + [Test, Order(2)] public void ShouldReturnPatchedValue() { TestContext.WriteLine("memoryPatch, should return a patched value"); @@ -28,7 +28,7 @@ public void ShouldReturnPatchedValue() Assert.That(result?.value, Is.EqualTo(20)); } - [Test, Order(3)] + [Test, Order(3)] public void ShouldRemovePatchedValue() { TestContext.WriteLine("memoryPatch, should remove a patched value"); @@ -40,7 +40,7 @@ public void ShouldRemovePatchedValue() Assert.That(result, Is.EqualTo(null)); } - [Test, Order(4)] + [Test, Order(4)] public void ShouldAddVolatilePatch() { TestContext.WriteLine("memoryPatch, should add a volatile patch"); @@ -51,7 +51,7 @@ public void ShouldAddVolatilePatch() Assert.That(result?.value, Is.EqualTo(20)); } - [Test, Order(5)] + [Test, Order(5)] public void ShouldCleanupVolatilePatches() { TestContext.WriteLine("memoryPatch, should cleanup volatile patches"); @@ -70,7 +70,7 @@ public void ShouldCleanupVolatilePatches() Assert.That(result3?.value, Is.EqualTo(23)); } - [Test, Order(6)] + [Test, Order(6)] public void ShouldApplyPatchesToExposedMemory() { TestContext.WriteLine("memoryPatch, should applyPatchesToExposedMemory"); @@ -85,5 +85,5 @@ public void ShouldApplyPatchesToExposedMemory() Assert.That(result[10], Is.EqualTo(20)); Assert.That(result[11], Is.EqualTo(21)); } - } -} + } +} diff --git a/src/WPCEmu.Test/Boards/Elements/MemoryProtectionTests.cs b/src/WPCEmu.Test/Boards/Elements/MemoryProtectionTests.cs index 18df803..6633a0d 100644 --- a/src/WPCEmu.Test/Boards/Elements/MemoryProtectionTests.cs +++ b/src/WPCEmu.Test/Boards/Elements/MemoryProtectionTests.cs @@ -1,12 +1,12 @@ -using NUnit.Framework; -using WPCEmu.Boards.Elements; - -namespace WPCEmu.Test.Boards.Elements -{ - [TestFixture] +using NUnit.Framework; +using WPCEmu.Boards.Elements; + +namespace WPCEmu.Test.Boards.Elements +{ + [TestFixture] public class MemoryProtectionTests - { - [Test, Order(1)] + { + [Test, Order(1)] public void ShouldGetMemoryProtectionMask_0() { TestContext.WriteLine("memoryProtection, should get memoryProtection mask for 0"); @@ -15,7 +15,7 @@ public void ShouldGetMemoryProtectionMask_0() Assert.That(result, Is.EqualTo(0x1000)); } - [Test, Order(2)] + [Test, Order(2)] public void ShouldGetMemoryProtectionMask_1() { TestContext.WriteLine("memoryProtection, should get memoryProtection mask for 1"); @@ -24,7 +24,7 @@ public void ShouldGetMemoryProtectionMask_1() Assert.That(result, Is.EqualTo(0x1800)); } - [Test, Order(3)] + [Test, Order(3)] public void ShouldGetMemoryProtectionMask_15() { TestContext.WriteLine("memoryProtection, should get memoryProtection mask for 15"); @@ -33,7 +33,7 @@ public void ShouldGetMemoryProtectionMask_15() Assert.That(result, Is.EqualTo(0x1F00)); } - [Test, Order(4)] + [Test, Order(4)] public void ShouldGetMemoryProtectionMask_16() { TestContext.WriteLine("memoryProtection, should get memoryProtection mask for 16"); @@ -42,7 +42,7 @@ public void ShouldGetMemoryProtectionMask_16() Assert.That(result, Is.EqualTo(0x2000)); } - [Test, Order(5)] + [Test, Order(5)] public void ShouldGetMemoryProtectionMask_17() { TestContext.WriteLine("memoryProtection, should get memoryProtection mask for 17"); @@ -51,7 +51,7 @@ public void ShouldGetMemoryProtectionMask_17() Assert.That(result, Is.EqualTo(0x2800)); } - [Test, Order(6)] + [Test, Order(6)] public void ShouldGetMemoryProtectionMask_255_unsure() { TestContext.WriteLine("memoryProtection, should get memoryProtection mask for 255 - unsure"); @@ -60,7 +60,7 @@ public void ShouldGetMemoryProtectionMask_255_unsure() Assert.That(result, Is.EqualTo(0xF00)); } - [Test, Order(7)] + [Test, Order(7)] public void ShouldGetMemoryProtectionMask_256_wraparound() { TestContext.WriteLine("memoryProtection, should get memoryProtection mask for 256 (wrap around)"); @@ -68,5 +68,5 @@ public void ShouldGetMemoryProtectionMask_256_wraparound() var result = MemoryProtection.getMemoryProtectionMask(256); Assert.That(result, Is.EqualTo(0x1000)); } - } -} + } +} diff --git a/src/WPCEmu.Test/Boards/Elements/OutputAlphaDisplayTests.cs b/src/WPCEmu.Test/Boards/Elements/OutputAlphaDisplayTests.cs index efeddf5..b12f17e 100644 --- a/src/WPCEmu.Test/Boards/Elements/OutputAlphaDisplayTests.cs +++ b/src/WPCEmu.Test/Boards/Elements/OutputAlphaDisplayTests.cs @@ -1,11 +1,11 @@ -using System.Linq; +using System.Linq; using System.Security.Cryptography; -using NUnit.Framework; +using NUnit.Framework; using WPCEmu.Boards.Elements; -namespace WPCEmu.Test.Boards.Elements -{ - [TestFixture] +namespace WPCEmu.Test.Boards.Elements +{ + [TestFixture] public class OutputAlphaDisplayTests { OutputAlphaDisplay outputAlphaDisplay; @@ -16,7 +16,7 @@ public void Init() outputAlphaDisplay = OutputAlphaDisplay.getInstance(0x200); } - [Test, Order(1)] + [Test, Order(1)] public void SetSegmentColumn() { TestContext.WriteLine("outputAlphaDisplay, setSegmentColumn"); @@ -25,7 +25,7 @@ public void SetSegmentColumn() Assert.That(outputAlphaDisplay.segmentColumn, Is.EqualTo(0xF)); } - [Test, Order(2)] + [Test, Order(2)] public void GetState() { TestContext.WriteLine("outputAlphaDisplay, getState"); @@ -35,7 +35,7 @@ public void GetState() Assert.That(result.dmdShaddedBuffer, Is.EqualTo(Enumerable.Repeat((byte)0, 0x200 * 8).ToArray())); } - [Test, Order(3)] + [Test, Order(3)] public void EmptySetState() { TestContext.WriteLine("outputAlphaDisplay, empty setState"); @@ -44,7 +44,7 @@ public void EmptySetState() Assert.That(result, Is.EqualTo(false)); } - [Test, Order(4)] + [Test, Order(4)] public void SetState() { TestContext.WriteLine("outputAlphaDisplay, setState"); @@ -57,7 +57,7 @@ public void SetState() Assert.That(result.scanline, Is.EqualTo(5)); } - [Test, Order(5)] + [Test, Order(5)] public void SetRow1Low() { TestContext.WriteLine("outputAlphaDisplay, setRow1 low"); @@ -68,7 +68,7 @@ public void SetRow1Low() Assert.That(result[1], Is.EqualTo(0x0000)); } - [Test, Order(6)] + [Test, Order(6)] public void SetRow1High() { TestContext.WriteLine("outputAlphaDisplay, setRow1 high"); @@ -79,7 +79,7 @@ public void SetRow1High() Assert.That(result[1], Is.EqualTo(0x0000)); } - [Test, Order(7)] + [Test, Order(7)] public void SetRow2Low() { TestContext.WriteLine("outputAlphaDisplay, setRow2 low"); @@ -90,7 +90,7 @@ public void SetRow2Low() Assert.That(result[17], Is.EqualTo(0x00FF)); } - [Test, Order(8)] + [Test, Order(8)] public void SetRow2High() { TestContext.WriteLine("outputAlphaDisplay, setRow2 high"); @@ -101,7 +101,7 @@ public void SetRow2High() Assert.That(result[18], Is.EqualTo(0xFF00)); } - [Test, Order(9)] + [Test, Order(9)] public void Render() { TestContext.WriteLine("outputAlphaDisplay, render"); @@ -120,5 +120,5 @@ public void Render() var dmdHash = string.Join("", new SHA1Managed().ComputeHash(result.dmdShaddedBuffer).Select(x => x.ToString("x2")).ToArray()); Assert.That(dmdHash, Is.EqualTo("d3706dc84ddfc27e5fa0ba57a8f469fac4472bda")); } - } -} + } +} diff --git a/src/WPCEmu.Test/Boards/Elements/OutputDmdDispayTests.cs b/src/WPCEmu.Test/Boards/Elements/OutputDmdDispayTests.cs index 6ef9149..db80df9 100644 --- a/src/WPCEmu.Test/Boards/Elements/OutputDmdDispayTests.cs +++ b/src/WPCEmu.Test/Boards/Elements/OutputDmdDispayTests.cs @@ -1,11 +1,11 @@ -using System.Linq; +using System.Linq; using System.Security.Cryptography; -using NUnit.Framework; +using NUnit.Framework; using WPCEmu.Boards.Elements; -namespace WPCEmu.Test.Boards.Elements -{ - [TestFixture] +namespace WPCEmu.Test.Boards.Elements +{ + [TestFixture] public class OutputDmdDisplayTests { OutputDmdDisplay outputDmdDisplay; @@ -16,7 +16,7 @@ public void Init() outputDmdDisplay = OutputDmdDisplay.getInstance(0x200); } - [Test, Order(1)] + [Test, Order(1)] public void ShouldReturnUndefinedWhenNoScanlineCopied() { TestContext.WriteLine("outputDmdDisplay, should return undefined when no scanline is copied"); @@ -25,7 +25,7 @@ public void ShouldReturnUndefinedWhenNoScanlineCopied() Assert.That(result, Is.EqualTo(null)); } - [Test, Order(2)] + [Test, Order(2)] public void ShouldReturnJsonObjectWhenUndefinedWhenScanlineIsCopied() { TestContext.WriteLine("outputDmdDisplay, should return json object when scanline is copied"); @@ -36,7 +36,7 @@ public void ShouldReturnJsonObjectWhenUndefinedWhenScanlineIsCopied() } - [Test, Order(3)] + [Test, Order(3)] public void GetState() { TestContext.WriteLine("outputDmdDisplay, getState"); @@ -51,7 +51,7 @@ public void GetState() Assert.That(result.dmdPageMapping, Is.EqualTo(new byte[] { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 })); } - [Test, Order(4)] + [Test, Order(4)] public void SelectDmdPage() { TestContext.WriteLine("outputDmdDisplay, selectDmdPage"); @@ -61,7 +61,7 @@ public void SelectDmdPage() Assert.That(result.dmdPageMapping, Is.EqualTo(new byte[] { 0, 0xF, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 })); } - [Test, Order(5)] + [Test, Order(5)] public void SetNextActivePage() { TestContext.WriteLine("outputDmdDisplay, setNextActivePage"); @@ -71,7 +71,7 @@ public void SetNextActivePage() Assert.That(result.nextActivePage, Is.EqualTo(0xF)); } - [Test, Order(6)] + [Test, Order(6)] public void WriteVideoRamAndReadVideoRam() { TestContext.WriteLine("outputDmdDisplay, writeVideoRam and readVideoRam"); @@ -82,7 +82,7 @@ public void WriteVideoRamAndReadVideoRam() Assert.That(result, Is.EqualTo(33)); } - [Test, Order(7)] + [Test, Order(7)] public void ShouldSwitchToNextActivePage() { TestContext.WriteLine("outputDmdDisplay, should switch to next active page"); @@ -98,7 +98,7 @@ public void ShouldSwitchToNextActivePage() Assert.That(result.nextActivePage, Is.EqualTo(null)); } - [Test, Order(9)] + [Test, Order(9)] public void Render() { TestContext.WriteLine("outputDmdDisplay, render"); @@ -117,7 +117,7 @@ public void Render() Assert.That(dmdHash, Is.EqualTo("1ceaf73df40e531df3bfb26b4fb7cd95fb7bff1d")); } - [Test, Order(10)] + [Test, Order(10)] public void EmptySetState() { TestContext.WriteLine("outputDmdDisplay, empty setState"); @@ -125,5 +125,5 @@ public void EmptySetState() var result = outputDmdDisplay.setState(); Assert.That(result, Is.EqualTo(false)); } - } -} + } +} diff --git a/src/WPCEmu.Test/Boards/Elements/OutputGeneralIlluminationTests.cs b/src/WPCEmu.Test/Boards/Elements/OutputGeneralIlluminationTests.cs index f7bf33f..819936f 100644 --- a/src/WPCEmu.Test/Boards/Elements/OutputGeneralIlluminationTests.cs +++ b/src/WPCEmu.Test/Boards/Elements/OutputGeneralIlluminationTests.cs @@ -1,9 +1,9 @@ -using NUnit.Framework; +using NUnit.Framework; using WPCEmu.Boards.Elements; -namespace WPCEmu.Test.Boards.Elements -{ - [TestFixture] +namespace WPCEmu.Test.Boards.Elements +{ + [TestFixture] public class OutputGeneralIlluminationTests { OutputGeneralIllumination preWpc95; @@ -16,7 +16,7 @@ public void Init() wpc95 = OutputGeneralIllumination.getInstance(true); } - [Test, Order(1)] + [Test, Order(1)] public void UpdateWithValue0() { TestContext.WriteLine("generalIllumination, update with value 0"); @@ -33,7 +33,7 @@ public void UpdateWithValue0() Assert.That(generalIllumination.generalIlluminationState[7], Is.EqualTo(0x00)); } - [Test, Order(2)] + [Test, Order(2)] public void Wpc95UpdateWithValue0() { TestContext.WriteLine("generalIllumination wpc95, update with value 0"); @@ -50,7 +50,7 @@ public void Wpc95UpdateWithValue0() Assert.That(generalIllumination.generalIlluminationState[7], Is.EqualTo(0x00)); } - [Test, Order(3)] + [Test, Order(3)] public void UpdateWithValue0xFF() { TestContext.WriteLine("generalIllumination, update with value 0xFF"); @@ -67,7 +67,7 @@ public void UpdateWithValue0xFF() Assert.That(generalIllumination.generalIlluminationState[7], Is.EqualTo(0x07)); } - [Test, Order(4)] + [Test, Order(4)] public void Wpc95UpdateWithValue0xFF() { TestContext.WriteLine("generalIllumination wpc95, update with value 0xFF"); @@ -84,7 +84,7 @@ public void Wpc95UpdateWithValue0xFF() Assert.That(generalIllumination.generalIlluminationState[7], Is.EqualTo(0x07)); } - [Test, Order(5)] + [Test, Order(5)] public void UpdateWithValue0x2_0x4() { TestContext.WriteLine("generalIllumination, update with value 0x2 and 0x4"); @@ -98,7 +98,7 @@ public void UpdateWithValue0x2_0x4() Assert.That(generalIllumination.generalIlluminationState[3], Is.EqualTo(0x00)); } - [Test, Order(6)] + [Test, Order(6)] public void UpdateWithValue0x4_0x4() { TestContext.WriteLine("generalIllumination, update with value 0x4 and 0x4"); @@ -112,7 +112,7 @@ public void UpdateWithValue0x4_0x4() Assert.That(generalIllumination.generalIlluminationState[3], Is.EqualTo(0x00)); } - [Test, Order(7)] + [Test, Order(7)] public void GetUint8ArrayFromState() { TestContext.WriteLine("generalIllumination, getUint8ArrayFromState"); @@ -122,7 +122,7 @@ public void GetUint8ArrayFromState() Assert.That(result, Is.EqualTo(new byte[] { 8, 8, 8, 8, 8, 8, 8, 8 })); } - [Test, Order(8)] + [Test, Order(8)] public void ShouldDecreateValueDim() { TestContext.WriteLine("generalIllumination, should decrease value (dim)"); @@ -140,5 +140,5 @@ public void ShouldDecreateValueDim() Assert.That(generalIllumination.generalIlluminationState[6], Is.EqualTo(0x00)); Assert.That(generalIllumination.generalIlluminationState[7], Is.EqualTo(0x00)); } - } -} + } +} diff --git a/src/WPCEmu.Test/Boards/Elements/OutputSolenoidMatrixTests.cs b/src/WPCEmu.Test/Boards/Elements/OutputSolenoidMatrixTests.cs index a77c507..6ac9a7a 100644 --- a/src/WPCEmu.Test/Boards/Elements/OutputSolenoidMatrixTests.cs +++ b/src/WPCEmu.Test/Boards/Elements/OutputSolenoidMatrixTests.cs @@ -1,9 +1,9 @@ -using NUnit.Framework; +using NUnit.Framework; using WPCEmu.Boards.Elements; -namespace WPCEmu.Test.Boards.Elements -{ - [TestFixture] +namespace WPCEmu.Test.Boards.Elements +{ + [TestFixture] public class OutputSolenoidMatrixTests { const int UPDATE_AFTER_TICKS = 8; @@ -16,7 +16,7 @@ public void Init() solenoidMatrix = OutputSolenoidMatrix.getInstance(UPDATE_AFTER_TICKS); } - [Test, Order(1)] + [Test, Order(1)] public void UpdateAllHighPowerSolenoids() { TestContext.WriteLine("solenoidMatrix, update all high power solenoids"); @@ -27,7 +27,7 @@ public void UpdateAllHighPowerSolenoids() Assert.That(solenoidMatrix.solenoidState[8], Is.EqualTo(0)); } - [Test, Order(2)] + [Test, Order(2)] public void UpdateAllLowPowerSolenoids() { TestContext.WriteLine("solenoidMatrix, update all low power solenoids"); @@ -38,7 +38,7 @@ public void UpdateAllLowPowerSolenoids() Assert.That(solenoidMatrix.solenoidState[15], Is.EqualTo(0xFF)); } - [Test, Order(3)] + [Test, Order(3)] public void UpdateAllFlashlightSolenoids() { TestContext.WriteLine("solenoidMatrix, update all flashlight solenoids"); @@ -49,7 +49,7 @@ public void UpdateAllFlashlightSolenoids() Assert.That(solenoidMatrix.solenoidState[23], Is.EqualTo(0xFF)); } - [Test, Order(4)] + [Test, Order(4)] public void UpdateAllGenericSolenoids() { TestContext.WriteLine("solenoidMatrix, update all generic solenoids"); @@ -60,7 +60,7 @@ public void UpdateAllGenericSolenoids() Assert.That(solenoidMatrix.solenoidState[31], Is.EqualTo(0xFF)); } - [Test, Order(5)] + [Test, Order(5)] public void UpdateFliptronicsSolenoids() { TestContext.WriteLine("solenoidMatrix, update fliptronics solenoids"); @@ -72,7 +72,7 @@ public void UpdateFliptronicsSolenoids() Assert.That(solenoidMatrix.solenoidState[39], Is.EqualTo(0xFF)); } - [Test, Order(6)] + [Test, Order(6)] public void FailIfValueExceedsUnsignedByteRange() { TestContext.WriteLine("solenoidMatrix, fail if value exceeds unsigned byte range"); @@ -80,7 +80,7 @@ public void FailIfValueExceedsUnsignedByteRange() Assert.Throws(() => solenoidMatrix.write(0x3FE0, 0xFFF)); } - [Test, Order(7)] + [Test, Order(7)] public void FailIfAddressIsInvalid() { TestContext.WriteLine("solenoidMatrix, fail if address is invalid"); @@ -88,7 +88,7 @@ public void FailIfAddressIsInvalid() Assert.Throws(() => solenoidMatrix.write(0, 0xFF)); } - [Test, Order(8)] + [Test, Order(8)] public void UpdateCycles() { TestContext.WriteLine("solenoidMatrix, update cycles"); @@ -97,5 +97,5 @@ public void UpdateCycles() solenoidMatrix.executeCycle(UPDATE_AFTER_TICKS); Assert.That(solenoidMatrix.solenoidState[0], Is.EqualTo(0x7F)); } - } -} + } +} diff --git a/src/WPCEmu.Test/Boards/Elements/SoundSerialInterfaceTests.cs b/src/WPCEmu.Test/Boards/Elements/SoundSerialInterfaceTests.cs index 1f948ca..fa62d40 100644 --- a/src/WPCEmu.Test/Boards/Elements/SoundSerialInterfaceTests.cs +++ b/src/WPCEmu.Test/Boards/Elements/SoundSerialInterfaceTests.cs @@ -1,10 +1,10 @@ -using NUnit.Framework; -using System.Collections.Generic; +using NUnit.Framework; +using System.Collections.Generic; using WPCEmu.Boards.Elements; -namespace WPCEmu.Test.Boards.Elements -{ - [TestFixture] +namespace WPCEmu.Test.Boards.Elements +{ + [TestFixture] public class SoundSerialInterfaceTests { const bool PREDCS_SOUND = true; @@ -39,7 +39,7 @@ public void Init() }); } - [Test, Order(1)] + [Test, Order(1)] public void PreDCSNoControlDataAvailable() { TestContext.WriteLine("SoundSerialInterface preDCS, no control data available"); @@ -48,7 +48,7 @@ public void PreDCSNoControlDataAvailable() Assert.That(readControl, Is.EqualTo(0xFF)); } - [Test, Order(2)] + [Test, Order(2)] public void PreDCSShouldReadData() { TestContext.WriteLine("SoundSerialInterface preDCS, should read data"); @@ -57,7 +57,7 @@ public void PreDCSShouldReadData() Assert.That(readControl, Is.EqualTo(0x00)); } - [Test, Order(3)] + [Test, Order(3)] public void PreDCSShouldProcessVolumeCommand() { TestContext.WriteLine("SoundSerialInterface preDCS, should process volume command"); @@ -69,7 +69,7 @@ public void PreDCSShouldProcessVolumeCommand() Assert.That(preDcsData[0].value, Is.EqualTo(31)); } - [Test, Order(4)] + [Test, Order(4)] public void PreDCSShouldPlaySample1() { TestContext.WriteLine("SoundSerialInterface preDCS, should play sample 1"); @@ -79,7 +79,7 @@ public void PreDCSShouldPlaySample1() Assert.That(preDcsData[0].id, Is.EqualTo(1)); } - [Test, Order(5)] + [Test, Order(5)] public void PreDCSShouldStopAllSamples() { TestContext.WriteLine("SoundSerialInterface preDCS, should stop all samples"); @@ -88,7 +88,7 @@ public void PreDCSShouldStopAllSamples() Assert.That(preDcsData[0].command, Is.EqualTo("STOPSOUND")); } - [Test, Order(6)] + [Test, Order(6)] public void PreDCSShouldPlayExtendedSample() { TestContext.WriteLine("SoundSerialInterface preDCS, should play extended sample"); @@ -99,7 +99,7 @@ public void PreDCSShouldPlayExtendedSample() Assert.That(preDcsData[0].id, Is.EqualTo(31233)); } - [Test, Order(7)] + [Test, Order(7)] public void DCSWriteVolume() { TestContext.WriteLine("SoundSerialInterface DCS, write volume"); @@ -112,7 +112,7 @@ public void DCSWriteVolume() Assert.That(dcsData[0].value, Is.EqualTo(31)); } - [Test, Order(8)] + [Test, Order(8)] public void DCSPlaySample() { TestContext.WriteLine("SoundSerialInterface DCS, play sample"); @@ -123,7 +123,7 @@ public void DCSPlaySample() Assert.That(dcsData[0].id, Is.EqualTo(0x8877)); } - [Test, Order(9)] + [Test, Order(9)] public void DCSReplyFromUnknown_0x03D2_Command() { TestContext.WriteLine("SoundSerialInterface DCS, get reply from unknown 0x03D2 command (SAFE CRACKER)"); @@ -133,7 +133,7 @@ public void DCSReplyFromUnknown_0x03D2_Command() Assert.That(dcsSound.readData(), Is.EqualTo(0x01)); } - [Test, Order(10)] + [Test, Order(10)] public void DCSReplyFromUnknown_0x03D3_Command() { TestContext.WriteLine("SoundSerialInterface DCS, get reply from unknown 0x03D3 command (AFM + CONGO)"); @@ -143,7 +143,7 @@ public void DCSReplyFromUnknown_0x03D3_Command() Assert.That(dcsSound.readData(), Is.EqualTo(0x01)); } - [Test, Order(11)] + [Test, Order(11)] public void DCSReplyFromUnknown_0x03E7_Command() { TestContext.WriteLine("SoundSerialInterface DCS, get reply from getVersion call (0x03E7)"); @@ -152,5 +152,5 @@ public void DCSReplyFromUnknown_0x03E7_Command() dcsSound.writeData(0xE7); Assert.That(dcsSound.readData(), Is.EqualTo(0x10)); } - } -} + } +} diff --git a/src/WPCEmu.Test/Boards/Elements/SoundVolumeConvertTests.cs b/src/WPCEmu.Test/Boards/Elements/SoundVolumeConvertTests.cs index 77894a4..9d976b5 100644 --- a/src/WPCEmu.Test/Boards/Elements/SoundVolumeConvertTests.cs +++ b/src/WPCEmu.Test/Boards/Elements/SoundVolumeConvertTests.cs @@ -1,12 +1,12 @@ -using NUnit.Framework; -using WPCEmu.Boards.Elements; - -namespace WPCEmu.Test.Boards.Elements -{ - [TestFixture] +using NUnit.Framework; +using WPCEmu.Boards.Elements; + +namespace WPCEmu.Test.Boards.Elements +{ + [TestFixture] public class SoundVolumeConvertTests - { - [Test, Order(1)] + { + [Test, Order(1)] public void DCSConvertMinVolume() { TestContext.WriteLine("SoundVolumeConvert DCS, convert min volume"); @@ -15,7 +15,7 @@ public void DCSConvertMinVolume() Assert.That(result, Is.EqualTo(0)); } - [Test, Order(2)] + [Test, Order(2)] public void DCSConvertMaxVolume() { TestContext.WriteLine("SoundVolumeConvert DCS, convert max volume"); @@ -24,7 +24,7 @@ public void DCSConvertMaxVolume() Assert.That(result, Is.EqualTo(31)); } - [Test, Order(3)] + [Test, Order(3)] public void DCSRefuseInvalidVolume() { TestContext.WriteLine("SoundVolumeConvert DCS, refuse invalid volume"); @@ -33,7 +33,7 @@ public void DCSRefuseInvalidVolume() Assert.That(result, Is.EqualTo(null)); } - [Test, Order(4)] + [Test, Order(4)] public void PreDCSConvertMinVolume() { TestContext.WriteLine("SoundVolumeConvert preDCS, convert min volume"); @@ -42,7 +42,7 @@ public void PreDCSConvertMinVolume() Assert.That(result, Is.EqualTo(0)); } - [Test, Order(5)] + [Test, Order(5)] public void PreDCSConvertMaxVolume() { TestContext.WriteLine("SoundVolumeConvert preDCS, convert max volume"); @@ -51,7 +51,7 @@ public void PreDCSConvertMaxVolume() Assert.That(result, Is.EqualTo(31)); } - [Test, Order(6)] + [Test, Order(6)] public void PreDCSRefuseInvalidVolume() { TestContext.WriteLine("SoundVolumeConvert preDCS, refuse invalid volume"); @@ -59,5 +59,5 @@ public void PreDCSRefuseInvalidVolume() var result = SoundVolumeConvert.getRelativeVolumePreDcs(1, 1); Assert.That(result, Is.EqualTo(null)); } - } -} + } +} diff --git a/src/WPCEmu.Test/Boards/ExternalIoTests.cs b/src/WPCEmu.Test/Boards/ExternalIoTests.cs index 48eeb2f..804eb59 100644 --- a/src/WPCEmu.Test/Boards/ExternalIoTests.cs +++ b/src/WPCEmu.Test/Boards/ExternalIoTests.cs @@ -1,9 +1,9 @@ -using NUnit.Framework; +using NUnit.Framework; using WPCEmu.Boards; -namespace WPCEmu.Test.Boards -{ - [TestFixture] +namespace WPCEmu.Test.Boards +{ + [TestFixture] public class ExternalIoTests { ExternalIo ioBoard; @@ -14,7 +14,7 @@ public void Init() ioBoard = ExternalIo.getInstance(); } - [Test, Order(1)] + [Test, Order(1)] public void ShouldReadWriteToTicketDispense() { TestContext.WriteLine("external-io, should read write to ticket dispense"); @@ -24,5 +24,5 @@ public void ShouldReadWriteToTicketDispense() var result = ioBoard.read(offset); Assert.That(result, Is.EqualTo(0xFF)); } - } + } } diff --git a/src/WPCEmu.Test/Boards/Mapper/DmdTests.cs b/src/WPCEmu.Test/Boards/Mapper/DmdTests.cs index 1a5aea5..cd1ba1c 100644 --- a/src/WPCEmu.Test/Boards/Mapper/DmdTests.cs +++ b/src/WPCEmu.Test/Boards/Mapper/DmdTests.cs @@ -1,13 +1,13 @@ -using System; -using NUnit.Framework; -using WPCEmu.Boards.Mapper; - -namespace WPCEmu.Test.Boards.Mapper -{ - [TestFixture] +using System; +using NUnit.Framework; +using WPCEmu.Boards.Mapper; + +namespace WPCEmu.Test.Boards.Mapper +{ + [TestFixture] public class DmdTests - { - [Test, Order(1)] + { + [Test, Order(1)] public void ShouldGet_0x3000() { TestContext.WriteLine("DmdMapper, should get address, 0x3000"); @@ -23,7 +23,7 @@ public void ShouldGet_0x3000() Assert.That(result, Is.EqualTo(expectedResult)); } - [Test, Order(2)] + [Test, Order(2)] public void ShouldGet_0x3200() { TestContext.WriteLine("DmdMapper, should get address, 0x3200"); @@ -39,7 +39,7 @@ public void ShouldGet_0x3200() Assert.That(result, Is.EqualTo(expectedResult)); } - [Test, Order(3)] + [Test, Order(3)] public void ShouldGet_0x3400() { TestContext.WriteLine("DmdMapper, should get address, 0x3400"); @@ -55,7 +55,7 @@ public void ShouldGet_0x3400() Assert.That(result, Is.EqualTo(expectedResult)); } - [Test, Order(4)] + [Test, Order(4)] public void ShouldGet_0x3600() { TestContext.WriteLine("DmdMapper, should get address, 0x3600"); @@ -71,7 +71,7 @@ public void ShouldGet_0x3600() Assert.That(result, Is.EqualTo(expectedResult)); } - [Test, Order(5)] + [Test, Order(5)] public void ShouldGet_0x3800() { TestContext.WriteLine("DmdMapper, should get address, 0x3800"); @@ -87,7 +87,7 @@ public void ShouldGet_0x3800() Assert.That(result, Is.EqualTo(expectedResult)); } - [Test, Order(6)] + [Test, Order(6)] public void ShouldGet_0x3A00() { TestContext.WriteLine("DmdMapper, should get address, 0x3A00"); @@ -103,7 +103,7 @@ public void ShouldGet_0x3A00() Assert.That(result, Is.EqualTo(expectedResult)); } - [Test, Order(7)] + [Test, Order(7)] public void ShouldGet_0x3A00_CalculateOffset() { TestContext.WriteLine("DmdMapper, should get address, 0x3A00, should calculate offset correct"); @@ -119,7 +119,7 @@ public void ShouldGet_0x3A00_CalculateOffset() Assert.That(result, Is.EqualTo(expectedResult)); } - [Test, Order(8)] + [Test, Order(8)] public void ShouldGet_0x3FB9() { TestContext.WriteLine("DmdMapper, should get address, 0x3A00, should calculate offset correct"); diff --git a/src/WPCEmu.Test/Boards/Mapper/HardwareTests.cs b/src/WPCEmu.Test/Boards/Mapper/HardwareTests.cs index 5c74f4c..689924c 100644 --- a/src/WPCEmu.Test/Boards/Mapper/HardwareTests.cs +++ b/src/WPCEmu.Test/Boards/Mapper/HardwareTests.cs @@ -1,13 +1,13 @@ -using System; -using NUnit.Framework; -using WPCEmu.Boards.Mapper; - -namespace WPCEmu.Test.Boards.Mapper -{ - [TestFixture] +using System; +using NUnit.Framework; +using WPCEmu.Boards.Mapper; + +namespace WPCEmu.Test.Boards.Mapper +{ + [TestFixture] public class HardwareTests - { - [Test, Order(1)] + { + [Test, Order(1)] public void ShouldGetAddress_0x3FC2() { TestContext.WriteLine("HardwareMapper, should get address, 0x3FC2"); @@ -22,7 +22,7 @@ public void ShouldGetAddress_0x3FC2() Assert.That(result, Is.EqualTo(expectedResult)); } - [Test, Order(2)] + [Test, Order(2)] public void ShouldGetAddress_0() { TestContext.WriteLine("HardwareMapper, should get address, 0"); @@ -31,7 +31,7 @@ public void ShouldGetAddress_0() Assert.That(result.Message, Is.EqualTo("HW_GET_ADDRESS_INVALID_MEMORY_REGION_0x0")); } - [Test, Order(3)] + [Test, Order(3)] public void ShouldGet_Negative1() { TestContext.WriteLine("HardwareMapper, should get address, -1"); @@ -40,7 +40,7 @@ public void ShouldGet_Negative1() Assert.That(result.Message, Is.EqualTo("HW_GET_ADDRESS_INVALID_MEMORY_REGION_0xFFFF")); } - [Test, Order(4)] + [Test, Order(4)] public void ShouldGetAddress_0x3200() { TestContext.WriteLine("HardwareMapper, should get address, 0x3200 (DMD PAGE)"); @@ -55,7 +55,7 @@ public void ShouldGetAddress_0x3200() Assert.That(result, Is.EqualTo(expectedResult)); } - [Test, Order(5)] + [Test, Order(5)] public void ShouldGetAddress_0x3BFF() { TestContext.WriteLine("HardwareMapper, should get address, 0x3BFF (DMD PAGE)"); @@ -70,7 +70,7 @@ public void ShouldGetAddress_0x3BFF() Assert.That(result, Is.EqualTo(expectedResult)); } - [Test, Order(6)] + [Test, Order(6)] public void ShouldGetAddress_0x3800() { TestContext.WriteLine("HardwareMapper, should get address, 0x3800 (DMD PAGE 1)"); @@ -85,7 +85,7 @@ public void ShouldGetAddress_0x3800() Assert.That(result, Is.EqualTo(expectedResult)); } - [Test, Order(7)] + [Test, Order(7)] public void ShouldGetAddress_0x3A00() { TestContext.WriteLine("HardwareMapper, should get address, 0x3A00 (DMD PAGE 2)"); @@ -100,7 +100,7 @@ public void ShouldGetAddress_0x3A00() Assert.That(result, Is.EqualTo(expectedResult)); } - [Test, Order(8)] + [Test, Order(8)] public void ShouldFailGetAddress_0x4000() { TestContext.WriteLine("HardwareMapper, should fail to get address, 0x4000"); @@ -118,7 +118,7 @@ public void ShouldFailGetInvalidOffset() Assert.That(result.Message, Is.EqualTo("HW_GET_ADDRESS_UNDEFINED")); } - [Test, Order(10)] + [Test, Order(10)] public void ShouldFailGetAddress_0x2000() { TestContext.WriteLine("HardwareMapper, should fail to get address, 0x4000"); @@ -127,7 +127,7 @@ public void ShouldFailGetAddress_0x2000() Assert.That(result.Message, Is.EqualTo("HW_GET_ADDRESS_INVALID_MEMORY_REGION_0x2000")); } - [Test, Order(11)] + [Test, Order(11)] public void ShouldGetAddress_0x3C00() { TestContext.WriteLine("HardwareMapper, should get address, 0x3c00"); @@ -142,7 +142,7 @@ public void ShouldGetAddress_0x3C00() Assert.That(result, Is.EqualTo(expectedResult)); } - [Test, Order(12)] + [Test, Order(12)] public void ShouldGetAddress_0x3E66() { TestContext.WriteLine("HardwareMapper, should get address, 0x3E66 - WPC_SERIAL_CONTROL_PORT **FIXME**"); @@ -157,7 +157,7 @@ public void ShouldGetAddress_0x3E66() Assert.That(result, Is.EqualTo(expectedResult)); } - [Test, Order(13)] + [Test, Order(13)] public void ShouldGetAddress_0x3FC0() { TestContext.WriteLine("HardwareMapper, should get address, 0x3FC0"); @@ -172,7 +172,7 @@ public void ShouldGetAddress_0x3FC0() Assert.That(result, Is.EqualTo(expectedResult)); } - [Test, Order(14)] + [Test, Order(14)] public void ShouldGetAddress_0x3FD6() { TestContext.WriteLine("HardwareMapper, should get address, 0x3FD6"); @@ -187,7 +187,7 @@ public void ShouldGetAddress_0x3FD6() Assert.That(result, Is.EqualTo(expectedResult)); } - [Test, Order(15)] + [Test, Order(15)] public void ShouldGetAddress_0x3FDC_WPCS_DATA() { TestContext.WriteLine("HardwareMapper, should get address, 0x3FDC - WPCS_DATA"); @@ -202,7 +202,7 @@ public void ShouldGetAddress_0x3FDC_WPCS_DATA() Assert.That(result, Is.EqualTo(expectedResult)); } - [Test, Order(16)] + [Test, Order(16)] public void ShouldGetAddress_0x3FDD_WPCS_CONTROL_STATUS() { TestContext.WriteLine("HardwareMapper, should get address, 0x3FDD - WPCS_CONTROL_STATUS"); @@ -217,7 +217,7 @@ public void ShouldGetAddress_0x3FDD_WPCS_CONTROL_STATUS() Assert.That(result, Is.EqualTo(expectedResult)); } - [Test, Order(17)] + [Test, Order(17)] public void ShouldGetAddress_0x3FDE() { TestContext.WriteLine("HardwareMapper, should get address, 0x3FDE"); @@ -232,7 +232,7 @@ public void ShouldGetAddress_0x3FDE() Assert.That(result, Is.EqualTo(expectedResult)); } - [Test, Order(18)] + [Test, Order(18)] public void ShouldGetAddress_0x3FE0() { TestContext.WriteLine("HardwareMapper, should get address, 0x3FE0"); @@ -247,7 +247,7 @@ public void ShouldGetAddress_0x3FE0() Assert.That(result, Is.EqualTo(expectedResult)); } - [Test, Order(19)] + [Test, Order(19)] public void ShouldGetException_FliptronicsAddress() { TestContext.WriteLine("HardwareMapper, should get exception for fliptronics address"); @@ -262,7 +262,7 @@ public void ShouldGetException_FliptronicsAddress() Assert.That(result, Is.EqualTo(expectedResult)); } - [Test, Order(20)] + [Test, Order(20)] public void ShouldGetDisplayAddress_0x3FEB() { TestContext.WriteLine("HardwareMapper, should get display address, 0x3FEB"); @@ -277,7 +277,7 @@ public void ShouldGetDisplayAddress_0x3FEB() Assert.That(result, Is.EqualTo(expectedResult)); } - [Test, Order(21)] + [Test, Order(21)] public void ShouldGetDisplayAddressAlphaNumericDisplays_0x3FEB() { TestContext.WriteLine("HardwareMapper, should get display address for alpha numeric displays, 0x3FEB"); @@ -292,7 +292,7 @@ public void ShouldGetDisplayAddressAlphaNumericDisplays_0x3FEB() Assert.That(result, Is.EqualTo(expectedResult)); } - [Test, Order(22)] + [Test, Order(22)] public void ShouldGetDisplayAddress_0x3FEF() { TestContext.WriteLine("HardwareMapper, should get display address, 0x3FEF"); @@ -307,7 +307,7 @@ public void ShouldGetDisplayAddress_0x3FEF() Assert.That(result, Is.EqualTo(expectedResult)); } - [Test, Order(23)] + [Test, Order(23)] public void ShouldGetDisplayAddressAlphaNumericDisplays_0x3FEF() { TestContext.WriteLine("HardwareMapper, should get display address for alpha numeric displays, 0x3FEF"); @@ -322,7 +322,7 @@ public void ShouldGetDisplayAddressAlphaNumericDisplays_0x3FEF() Assert.That(result, Is.EqualTo(expectedResult)); } - [Test, Order(24)] + [Test, Order(24)] public void ShouldGetDCSData_0x3FDC() { TestContext.WriteLine("HardwareMapper, should get DCS data, 0x3FDC"); @@ -337,7 +337,7 @@ public void ShouldGetDCSData_0x3FDC() Assert.That(result, Is.EqualTo(expectedResult)); } - [Test, Order(25)] + [Test, Order(25)] public void ShouldGetDCSData_0x3FDD() { TestContext.WriteLine("HardwareMapper, should get DCS data, 0x3FDD"); @@ -351,5 +351,5 @@ public void ShouldGetDCSData_0x3FDD() var result = Hardware.getAddress(0x3FDD); Assert.That(result, Is.EqualTo(expectedResult)); } - } -} + } +} diff --git a/src/WPCEmu.Test/Boards/Mapper/MemoryTests.cs b/src/WPCEmu.Test/Boards/Mapper/MemoryTests.cs index d5ff4ee..dcb11fa 100644 --- a/src/WPCEmu.Test/Boards/Mapper/MemoryTests.cs +++ b/src/WPCEmu.Test/Boards/Mapper/MemoryTests.cs @@ -1,14 +1,14 @@ -using System; -using NUnit.Framework; - -namespace WPCEmu.Test.Boards.Mapper -{ - using Memory = WPCEmu.Boards.Mapper.Memory; - - [TestFixture] +using System; +using NUnit.Framework; + +namespace WPCEmu.Test.Boards.Mapper +{ + using Memory = WPCEmu.Boards.Mapper.Memory; + + [TestFixture] public class MemoryTests - { - [Test, Order(1)] + { + [Test, Order(1)] public void ShouldGet_16322() { TestContext.WriteLine("MemoryMapper, should get address, 16322"); @@ -23,7 +23,7 @@ public void ShouldGet_16322() Assert.That(result, Is.EqualTo(expectedResult)); } - [Test, Order(2)] + [Test, Order(2)] public void ShouldGet_49090() { TestContext.WriteLine("MemoryMapper, should get address, 49090 - this crashes the emu"); @@ -62,7 +62,7 @@ public void ShouldGet_Negative1() Assert.That(result, Is.EqualTo(expectedResult)); } - [Test, Order(5)] + [Test, Order(5)] public void ShouldGet_0() { TestContext.WriteLine("MemoryMapper, should get address, 0x0"); @@ -77,7 +77,7 @@ public void ShouldGet_0() Assert.That(result, Is.EqualTo(expectedResult)); } - [Test, Order(6)] + [Test, Order(6)] public void ShouldGet_0x2000() { TestContext.WriteLine("MemoryMapper, should get address, 0x2000"); @@ -92,7 +92,7 @@ public void ShouldGet_0x2000() Assert.That(result, Is.EqualTo(expectedResult)); } - [Test, Order(7)] + [Test, Order(7)] public void ShouldGet_0x2900() { TestContext.WriteLine("MemoryMapper, should get address, 0x2900"); @@ -107,7 +107,7 @@ public void ShouldGet_0x2900() Assert.That(result, Is.EqualTo(expectedResult)); } - [Test, Order(8)] + [Test, Order(8)] public void ShouldGet_0x4000() { TestContext.WriteLine("MemoryMapper, should get address, 0x4000"); @@ -122,7 +122,7 @@ public void ShouldGet_0x4000() Assert.That(result, Is.EqualTo(expectedResult)); } - [Test, Order(8)] + [Test, Order(8)] public void ShouldGet_0x8000() { TestContext.WriteLine("MemoryMapper, should get address, 0x8000"); @@ -137,7 +137,7 @@ public void ShouldGet_0x8000() Assert.That(result, Is.EqualTo(expectedResult)); } - [Test, Order(9)] + [Test, Order(9)] public void ShouldGet_0x10000() { TestContext.WriteLine("MemoryMapper, should get address, 0x10000"); @@ -152,7 +152,7 @@ public void ShouldGet_0x10000() Assert.That(result, Is.EqualTo(expectedResult)); } - [Test, Order(10)] + [Test, Order(10)] public void ShouldGet_0x3C00() { TestContext.WriteLine("MemoryMapper, should get address, 0x3C00"); @@ -167,7 +167,7 @@ public void ShouldGet_0x3C00() Assert.That(result, Is.EqualTo(expectedResult)); } - [Test, Order(11)] + [Test, Order(11)] public void ShouldGet_0x3FAF() { TestContext.WriteLine("MemoryMapper, should get address, 0x3FAF"); diff --git a/src/WPCEmu.Test/Boards/Memory/BcdTests.cs b/src/WPCEmu.Test/Boards/Memory/BcdTests.cs index b96b98e..ef76631 100644 --- a/src/WPCEmu.Test/Boards/Memory/BcdTests.cs +++ b/src/WPCEmu.Test/Boards/Memory/BcdTests.cs @@ -1,12 +1,12 @@ -using NUnit.Framework; -using WPCEmu.Boards.Memory; - -namespace WPCEmu.Test.Boards.Memory -{ - [TestFixture] +using NUnit.Framework; +using WPCEmu.Boards.Memory; + +namespace WPCEmu.Test.Boards.Memory +{ + [TestFixture] public class BcdTests - { - [Test, Order(1)] + { + [Test, Order(1)] public void toBCD_12345() { TestContext.WriteLine("BCD: toBCD, encode 12345 to BCD"); @@ -50,5 +50,5 @@ public void toNumber_Empty() var result = Bcd.toNumber(new byte[] { }); Assert.That(result, Is.EqualTo(0)); } - } -} + } +} diff --git a/src/WPCEmu.Test/Boards/Memory/ChecksumTests.cs b/src/WPCEmu.Test/Boards/Memory/ChecksumTests.cs index 8fe1eaa..2ceeb86 100644 --- a/src/WPCEmu.Test/Boards/Memory/ChecksumTests.cs +++ b/src/WPCEmu.Test/Boards/Memory/ChecksumTests.cs @@ -1,12 +1,12 @@ -using NUnit.Framework; -using WPCEmu.Boards.Memory; - -namespace WPCEmu.Test.Boards.Memory -{ - [TestFixture] +using NUnit.Framework; +using WPCEmu.Boards.Memory; + +namespace WPCEmu.Test.Boards.Memory +{ + [TestFixture] public class ChecksumTests - { - [Test, Order(1)] + { + [Test, Order(1)] public void CalculateMMHighscoreChecksum() { TestContext.WriteLine("Checksum: calculate MM Highscore Checksum"); @@ -19,5 +19,5 @@ public void CalculateMMHighscoreChecksum() }); Assert.That(result, Is.EqualTo(0xFB8F)); } - } -} + } +} diff --git a/src/WPCEmu.Test/Boards/MemoryHandlerTests.cs b/src/WPCEmu.Test/Boards/MemoryHandlerTests.cs index 7f46128..e3094b7 100644 --- a/src/WPCEmu.Test/Boards/MemoryHandlerTests.cs +++ b/src/WPCEmu.Test/Boards/MemoryHandlerTests.cs @@ -1,10 +1,10 @@ -using System.Linq; -using NUnit.Framework; +using System.Linq; +using NUnit.Framework; using WPCEmu.Boards; -namespace WPCEmu.Test.Boards -{ - [TestFixture] +namespace WPCEmu.Test.Boards +{ + [TestFixture] public class MemoryHandlerTests { MemoryHandler memoryHandler; @@ -28,7 +28,7 @@ public void Init() memoryHandler = MemoryHandler.getInstance(config, Enumerable.Repeat((byte)0, 8192).ToArray()); } - [Test, Order(1)] + [Test, Order(1)] public void ShouldNotUpdateChecksum() { TestContext.WriteLine("MemoryHandler: should not update checksum"); @@ -48,7 +48,7 @@ public void ShouldNotUpdateChecksum() Assert.That(valuesNotZero, Is.EqualTo(1)); } - [Test, Order(2)] + [Test, Order(2)] public void ShouldWriteNumberCheckChecksum() { TestContext.WriteLine("MemoryHandler: should write number, check checksum"); @@ -59,7 +59,7 @@ public void ShouldWriteNumberCheckChecksum() Assert.That(memoryHandler.ram[0x1D4A], Is.EqualTo(0xFE)); } - [Test, Order(3)] + [Test, Order(3)] public void ShouldWriteArrayCheckChecksum() { TestContext.WriteLine("MemoryHandler: should write number, check checksum"); @@ -70,7 +70,7 @@ public void ShouldWriteArrayCheckChecksum() Assert.That(memoryHandler.ram[0x1D4A], Is.EqualTo(0xFE)); } - [Test, Order(4)] + [Test, Order(4)] public void ShouldWriteStringCheckChecksum() { TestContext.WriteLine("MemoryHandler: should write string, check checksum"); @@ -81,7 +81,7 @@ public void ShouldWriteStringCheckChecksum() Assert.That(memoryHandler.ram[0x1D4A], Is.EqualTo(0xFE)); } - [Test, Order(5)] + [Test, Order(5)] public void ShouldUpdateChecksumStart() { TestContext.WriteLine("MemoryHandler: should update checksum (start)"); @@ -101,7 +101,7 @@ public void ShouldUpdateChecksumStart() Assert.That(valuesNotZero, Is.EqualTo(3)); } - [Test, Order(6)] + [Test, Order(6)] public void ShouldUpdateChecksumEnd() { TestContext.WriteLine("MemoryHandler: should update checksum (end)"); @@ -120,5 +120,5 @@ public void ShouldUpdateChecksumEnd() Assert.That(newValueWritten, Is.EqualTo(true)); Assert.That(valuesNotZero, Is.EqualTo(3)); } - } -} + } +} diff --git a/src/WPCEmu.Test/Boards/SoundBoardTests.cs b/src/WPCEmu.Test/Boards/SoundBoardTests.cs index 31e6c2d..0a505db 100644 --- a/src/WPCEmu.Test/Boards/SoundBoardTests.cs +++ b/src/WPCEmu.Test/Boards/SoundBoardTests.cs @@ -1,12 +1,12 @@ -using System.Collections.Generic; +using System.Collections.Generic; using System.Diagnostics; -using NUnit.Framework; +using NUnit.Framework; using WPCEmu.Boards; using WPCEmu.Boards.Elements; -namespace WPCEmu.Test.Boards -{ - [TestFixture] +namespace WPCEmu.Test.Boards +{ + [TestFixture] public class SoundBoardTests { const ushort WPC_SOUND_DATA = SoundBoard.OP.WPC_SOUND_DATA; @@ -61,7 +61,7 @@ public void Init() }); } - [Test, Order(1)] + [Test, Order(1)] public void ShouldValidateCallbackFunction() { TestContext.WriteLine("should validate callback function"); @@ -71,7 +71,7 @@ public void ShouldValidateCallbackFunction() Assert.That(result, Is.EqualTo(false)); } - [Test, Order(2)] + [Test, Order(2)] public void ShouldReadControlStatusNoDataAvailable() { TestContext.WriteLine("should read control status, no data available"); @@ -81,7 +81,7 @@ public void ShouldReadControlStatusNoDataAvailable() Assert.That(result, Is.EqualTo(0xFF)); } - [Test, Order(3)] + [Test, Order(3)] public void ShouldReadControlStatusDataAvailable() { TestContext.WriteLine("should read control status, data is available"); @@ -93,7 +93,7 @@ public void ShouldReadControlStatusDataAvailable() Assert.That(result, Is.EqualTo(0x80)); } - [Test, Order(4)] + [Test, Order(4)] public void ShouldHandleMultipleWrites() { TestContext.WriteLine("should handle multiple writes"); @@ -120,7 +120,7 @@ public void ShouldHandleMultipleWrites() Assert.That(playbackArray[5].id, Is.EqualTo(1)); } - [Test, Order(5)] + [Test, Order(5)] public void PreDCSSetVolume() { TestContext.WriteLine("preDcs: set volume"); @@ -133,7 +133,7 @@ public void PreDCSSetVolume() Assert.That(playbackArray[0].value, Is.EqualTo(11)); } - [Test, Order(6)] + [Test, Order(6)] public void DCSSetVolume() { TestContext.WriteLine("DCS: set volume"); @@ -147,7 +147,7 @@ public void DCSSetVolume() Assert.That(playbackArray[0].value, Is.EqualTo(22)); } - [Test, Order(7)] + [Test, Order(7)] public void DCSIgnoreFirst0ByteAfterSoundBoardResets() { TestContext.WriteLine("DCS: ignore first 0 byte after alot of sound board resets"); @@ -164,7 +164,7 @@ public void DCSIgnoreFirst0ByteAfterSoundBoardResets() Assert.That(actualState.writeControlBytes, Is.EqualTo(0)); } - [Test, Order(8)] + [Test, Order(8)] public void DCSSetAndGetState() { TestContext.WriteLine("DCS: set and get state"); @@ -188,7 +188,7 @@ public void DCSSetAndGetState() Assert.That(actualState.writeControlBytes, Is.EqualTo(88)); } - [Test, Order(9)] + [Test, Order(9)] public void DCSEmptySetState() { TestContext.WriteLine("DCS: empty setState"); diff --git a/src/WPCEmu.Test/Boards/UiTests.cs b/src/WPCEmu.Test/Boards/UiTests.cs index fd6ec71..54ee0dc 100644 --- a/src/WPCEmu.Test/Boards/UiTests.cs +++ b/src/WPCEmu.Test/Boards/UiTests.cs @@ -1,11 +1,11 @@ -using System.Linq; -using NUnit.Framework; +using System.Linq; +using NUnit.Framework; using WPCEmu.Boards; using WPCEmu.Boards.Elements; -namespace WPCEmu.Test.Boards -{ - [TestFixture] +namespace WPCEmu.Test.Boards +{ + [TestFixture] public class UiTests { MemoryPosition memoryPosition; @@ -65,7 +65,7 @@ public void Init() }; } - [Test, Order(1)] + [Test, Order(1)] public void ShouldFilterOutInvalidMemoryPositionEntries() { TestContext.WriteLine("UI: should filter out invalid memoryPosition entries"); @@ -73,7 +73,7 @@ public void ShouldFilterOutInvalidMemoryPositionEntries() Assert.That(ui.memoryPosition.Length, Is.EqualTo(4)); } - [Test, Order(2)] + [Test, Order(2)] public void ShouldFetchDataFromRam() { TestContext.WriteLine("UI: should fetch data from ram"); @@ -87,7 +87,7 @@ public void ShouldFetchDataFromRam() Assert.That(result.memoryPosition[3].value, Is.EqualTo(0x66676869)); } - [Test, Order(3)] + [Test, Order(3)] public void ShouldFetchDataFromRamString() { TestContext.WriteLine("UI: should fetch data from ram (string)"); @@ -96,7 +96,7 @@ public void ShouldFetchDataFromRamString() Assert.That(result.memoryPosition[0].value, Is.EqualTo("AAA")); } - [Test, Order(4)] + [Test, Order(4)] public void ShouldCapVeryLongString() { TestContext.WriteLine("UI: should cap very long string"); diff --git a/src/WPCEmu.Test/Boards/Up/Cpu6809DslTests.cs b/src/WPCEmu.Test/Boards/Up/Cpu6809DslTests.cs index a62bc86..d22d1b7 100644 --- a/src/WPCEmu.Test/Boards/Up/Cpu6809DslTests.cs +++ b/src/WPCEmu.Test/Boards/Up/Cpu6809DslTests.cs @@ -1,12 +1,12 @@ -using System; -using System.Collections.Generic; -using System.Linq; +using System; +using System.Collections.Generic; +using System.Linq; using NUnit.Framework; using WPCEmu.Boards.Up; -namespace WPCEmu.Test.Boards.Up +namespace WPCEmu.Test.Boards.Up { - [TestFixture] + [TestFixture] public class Cpu6809DslTests { struct InstructionData @@ -390,9 +390,9 @@ s Contains the carry from a shift operation. List readMemoryAddressAccess; List readMemoryAddress; - List writeMemoryAddress; + List writeMemoryAddress; - Cpu6809 cpu; + Cpu6809 cpu; byte ReadMemoryMock(ushort address) { @@ -596,7 +596,7 @@ private List marshall(string instructions) { List list = new List(); - foreach (var line in instructions.Split("\n")) + foreach (var line in instructions.Split(Environment.NewLine)) { if (line.StartsWith("|")) { @@ -624,5 +624,5 @@ private List marshall(string instructions) return list; } - } -} + } +} diff --git a/src/WPCEmu.Test/Boards/Up/Cpu6809OpcodesTests.cs b/src/WPCEmu.Test/Boards/Up/Cpu6809OpcodesTests.cs index 0c2df96..836f074 100644 --- a/src/WPCEmu.Test/Boards/Up/Cpu6809OpcodesTests.cs +++ b/src/WPCEmu.Test/Boards/Up/Cpu6809OpcodesTests.cs @@ -1,11 +1,11 @@ -using System; -using System.Collections.Generic; -using NUnit.Framework; -using WPCEmu.Boards.Up; - -namespace WPCEmu.Test.Boards.Up -{ - [TestFixture] +using System; +using System.Collections.Generic; +using NUnit.Framework; +using WPCEmu.Boards.Up; + +namespace WPCEmu.Test.Boards.Up +{ + [TestFixture] public class Cpu6809OpcodesTests { struct AddressValueData @@ -49,9 +49,9 @@ public TestData(byte offset, string register, ushort? initialValue, byte? initia List readMemoryAddressAccess; List readMemoryAddress; - List writeMemoryAddress; + List writeMemoryAddress; - Cpu6809 cpu; + Cpu6809 cpu; byte ReadMemoryMock(ushort address) { @@ -86,7 +86,7 @@ public void Init() cpu = Cpu6809.getInstance(WriteMemoryMock, ReadMemoryMock); } - [Test, Order(1)] + [Test, Order(1)] public void ShouldReadResetVectorOnBoot() { TestContext.WriteLine("should read RESET vector on boot"); @@ -96,7 +96,7 @@ public void ShouldReadResetVectorOnBoot() Assert.That(readMemoryAddressAccess[1], Is.EqualTo(RESET_VECTOR_OFFSET_HI)); } - [Test, Order(2)] + [Test, Order(2)] public void ROLA_0xFF() { TestContext.WriteLine("ROLA 0xFF"); @@ -109,7 +109,7 @@ public void ROLA_0xFF() Assert.That(cpu.flagsToString(), Is.EqualTo("eFhINzvC")); } - [Test, Order(3)] + [Test, Order(3)] public void ROLA_0xFF_CarryFlagSet() { TestContext.WriteLine("ROLA, 0xFF - carry flag set"); @@ -126,7 +126,7 @@ public void ROLA_0xFF_CarryFlagSet() Assert.That(cpu.flagsToString(), Is.EqualTo("eFhINzvC")); } - [Test, Order(4)] + [Test, Order(4)] public void RORA_0x01_NoOverflow() { TestContext.WriteLine("RORA, 0x01 (no overflow)"); @@ -139,7 +139,7 @@ public void RORA_0x01_NoOverflow() Assert.That(cpu.flagsToString(), Is.EqualTo("eFhInZvC")); } - [Test, Order(5)] + [Test, Order(5)] public void RORA_0xFF_CarryFlagNotSet() { TestContext.WriteLine("RORA, 0xFF - carry flag not set"); @@ -152,7 +152,7 @@ public void RORA_0xFF_CarryFlagNotSet() Assert.That(cpu.flagsToString(), Is.EqualTo("eFhInzvC")); } - [Test, Order(6)] + [Test, Order(6)] public void RORA_0xFF_CarryFlagSet() { TestContext.WriteLine("RORA, 0xFF - carry flag set"); @@ -169,7 +169,7 @@ public void RORA_0xFF_CarryFlagSet() Assert.That(cpu.flagsToString(), Is.EqualTo("eFhINzvC")); } - [Test, Order(7)] + [Test, Order(7)] public void ADDA_oADD() { TestContext.WriteLine("ADDA / oADD"); @@ -200,7 +200,7 @@ public void ADDA_oADD() Assert.That(cpu.flagsToString(), Is.EqualTo("eFHINzvC")); } - [Test, Order(8)] + [Test, Order(8)] public void LSRA() { TestContext.WriteLine("LSRA"); @@ -213,7 +213,7 @@ public void LSRA() Assert.That(cpu.flagsToString(), Is.EqualTo("eFhInzvC")); } - [Test, Order(9)] + [Test, Order(9)] public void ASLA_Overflow() { TestContext.WriteLine("ASLA, overflow"); @@ -226,7 +226,7 @@ public void ASLA_Overflow() Assert.That(cpu.flagsToString(), Is.EqualTo("eFhInzVC")); } - [Test, Order(10)] + [Test, Order(10)] public void ASLA_NoOverflow() { TestContext.WriteLine("ASLA, no overflow"); @@ -239,7 +239,7 @@ public void ASLA_NoOverflow() Assert.That(cpu.flagsToString(), Is.EqualTo("eFhInzvc")); } - [Test, Order(11)] + [Test, Order(11)] public void ASRA_0xFF() { TestContext.WriteLine("ASRA (0xFF)"); @@ -252,7 +252,7 @@ public void ASRA_0xFF() Assert.That(cpu.flagsToString(), Is.EqualTo("eFhINzvC")); } - [Test, Order(12)] + [Test, Order(12)] public void ASRA_0x7F() { TestContext.WriteLine("ASRA (0x7F)"); @@ -265,7 +265,7 @@ public void ASRA_0x7F() Assert.That(cpu.flagsToString(), Is.EqualTo("eFhInzvC")); } - [Test, Order(13)] + [Test, Order(13)] public void ASRA_0() { TestContext.WriteLine("ASRA (0)"); @@ -278,7 +278,7 @@ public void ASRA_0() Assert.That(cpu.flagsToString(), Is.EqualTo("eFhInZvc")); } - [Test, Order(14)] + [Test, Order(14)] public void oNEG_0x1() { TestContext.WriteLine("oNEG, 0x1"); @@ -291,7 +291,7 @@ public void oNEG_0x1() Assert.That(cpu.flagsToString(), Is.EqualTo("eFhINzvC")); } - [Test, Order(15)] + [Test, Order(15)] public void oNEG_0xFF() { TestContext.WriteLine("oNEG, 0xFF"); @@ -304,7 +304,7 @@ public void oNEG_0xFF() Assert.That(cpu.flagsToString(), Is.EqualTo("eFhInzvc")); } - [Test, Order(16)] + [Test, Order(16)] public void oDEC_0x80_NoOverflow() { TestContext.WriteLine("oDEC, 0x80 (no overflow)"); @@ -317,7 +317,7 @@ public void oDEC_0x80_NoOverflow() Assert.That(cpu.flagsToString(), Is.EqualTo("eFhInzVc")); } - [Test, Order(17)] + [Test, Order(17)] public void oDEC_0x0_Overflow() { TestContext.WriteLine("oDEC, 0x0 (overflow)"); @@ -330,7 +330,7 @@ public void oDEC_0x0_Overflow() Assert.That(cpu.flagsToString(), Is.EqualTo("eFhINzvc")); } - [Test, Order(18)] + [Test, Order(18)] public void oDEC_ExtendedMemory_0x0_Overflow() { TestContext.WriteLine("oDEC extended memory, 0x0 (overflow)"); @@ -344,7 +344,7 @@ public void oDEC_ExtendedMemory_0x0_Overflow() Assert.That(cpu.flagsToString(), Is.EqualTo("eFhINzvc")); } - [Test, Order(19)] + [Test, Order(19)] public void oINC_0x00_NoOverflow() { TestContext.WriteLine("oINC, 0x00 (no overflow)"); @@ -357,7 +357,7 @@ public void oINC_0x00_NoOverflow() Assert.That(cpu.flagsToString(), Is.EqualTo("eFhInzvc")); } - [Test, Order(20)] + [Test, Order(20)] public void oINC_0xFF_Overflow() { TestContext.WriteLine("oINC, 0xFF (overflow)"); @@ -370,7 +370,7 @@ public void oINC_0xFF_Overflow() Assert.That(cpu.flagsToString(), Is.EqualTo("eFhInZvc")); } - [Test, Order(21)] + [Test, Order(21)] public void oINC_ExtendedMemory_0xFF_Overflow() { TestContext.WriteLine("oINC extended memory, 0xFF (overflow)"); @@ -384,7 +384,7 @@ public void oINC_ExtendedMemory_0xFF_Overflow() Assert.That(cpu.flagsToString(), Is.EqualTo("eFhInZvc")); } - [Test, Order(22)] + [Test, Order(22)] public void PUSHB_ShouldWrapAround() { TestContext.WriteLine("PUSHB should wrap around"); @@ -395,7 +395,7 @@ public void PUSHB_ShouldWrapAround() Assert.That(writeMemoryAddress[0].value, Is.EqualTo(0x23)); } - [Test, Order(23)] + [Test, Order(23)] public void PUSHW_ShouldWrapAround() { TestContext.WriteLine("PUSHW should wrap around"); @@ -408,7 +408,7 @@ public void PUSHW_ShouldWrapAround() Assert.That(writeMemoryAddress[1].value, Is.EqualTo(0x12)); } - [Test, Order(24)] + [Test, Order(24)] public void PUSHBU_ShouldWrapAround() { TestContext.WriteLine("PUSHBU should wrap around"); @@ -419,7 +419,7 @@ public void PUSHBU_ShouldWrapAround() Assert.That(writeMemoryAddress[0].value, Is.EqualTo(0x23)); } - [Test, Order(25)] + [Test, Order(25)] public void PUSHWU_ShouldWrapAround() { TestContext.WriteLine("PUSHWU should wrap around"); @@ -476,7 +476,7 @@ void runExtendedMemoryTest(byte opcode, byte memoryContent, Action postCpuResetI Assert.That(readMemoryAddressAccess[5], Is.EqualTo(hardcodedReadOffset)); } - [Test, Order(26)] + [Test, Order(26)] public void PostByteSimpleX_0_15() { for (var offset = 0; offset < 16; offset++) { @@ -499,7 +499,7 @@ public void PostByteSimpleX_0_15() } } - [Test, Order(27)] + [Test, Order(27)] public void PostByteSimpleX_16_31() { for (var offset = 16; offset < 32; offset++) @@ -523,7 +523,7 @@ public void PostByteSimpleX_16_31() } } - [Test, Order(28)] + [Test, Order(28)] public void PostByteSimpleS_0x60_0x70() { for (var offset = 0x60; offset < 0x70; offset++) @@ -547,7 +547,7 @@ public void PostByteSimpleS_0x60_0x70() } } - [Test, Order(29)] + [Test, Order(29)] public void PostByteSimpleS_0x70_0x80() { for (var offset = 0x70; offset < 0x80; offset++) @@ -571,7 +571,7 @@ public void PostByteSimpleS_0x70_0x80() } } - [Test, Order(30)] + [Test, Order(30)] public void PostByteComplex() { List list = new List() @@ -671,7 +671,7 @@ public void PostByteComplex() }); } - [Test, Order(31)] + [Test, Order(31)] public void PostByteComplex_0x8C() { TestContext.WriteLine("postbyte complex 0x8C"); @@ -692,7 +692,7 @@ public void PostByteComplex_0x8C() Assert.That(readMemoryAddressAccess[1], Is.EqualTo(0x1001)); } - [Test, Order(32)] + [Test, Order(32)] public void PostByteComplex_0x8D() { TestContext.WriteLine("postbyte complex 0x8D"); @@ -714,4 +714,4 @@ public void PostByteComplex_0x8D() Assert.That(readMemoryAddressAccess[2], Is.EqualTo(0x1002)); } } -} +} diff --git a/src/WPCEmu.Test/Boards/Up/Cpu6809Tests.cs b/src/WPCEmu.Test/Boards/Up/Cpu6809Tests.cs index a902a40..a214c01 100644 --- a/src/WPCEmu.Test/Boards/Up/Cpu6809Tests.cs +++ b/src/WPCEmu.Test/Boards/Up/Cpu6809Tests.cs @@ -1,11 +1,11 @@ -using System.Collections.Generic; -using System.Linq; -using NUnit.Framework; -using WPCEmu.Boards.Up; - -namespace WPCEmu.Test.Boards.Up -{ - [TestFixture] +using System.Collections.Generic; +using System.Linq; +using NUnit.Framework; +using WPCEmu.Boards.Up; + +namespace WPCEmu.Test.Boards.Up +{ + [TestFixture] public class Cpu6809Tests { struct AddressValueData @@ -15,10 +15,10 @@ struct AddressValueData } List readMemoryAddress; - List writeMemoryAddress; + List writeMemoryAddress; Cpu6809 cpu; - + byte ReadMemoryMock(ushort address) { readMemoryAddress.Add(address); @@ -44,7 +44,7 @@ public void Init() cpu.reset(); } - [Test, Order(1)] + [Test, Order(1)] public void ReadInitialVector() { TestContext.WriteLine("read initial vector"); @@ -53,7 +53,7 @@ public void ReadInitialVector() Assert.That(readMemoryAddress[1], Is.EqualTo(0xFFFF)); } - [Test, Order(2)] + [Test, Order(2)] public void oCmp_8bit_CarryFlag() { TestContext.WriteLine("oCMP 8bit, carry flag"); @@ -63,7 +63,7 @@ public void oCmp_8bit_CarryFlag() Assert.That("efhinzvC", Is.EqualTo(cpu.flagsToString())); } - [Test, Order(3)] + [Test, Order(3)] public void oCmp_8bit_0xFF() { TestContext.WriteLine("oCMP 8bit, 0xFF"); @@ -73,7 +73,7 @@ public void oCmp_8bit_0xFF() Assert.That("efhiNzvc", Is.EqualTo(cpu.flagsToString())); } - [Test, Order(4)] + [Test, Order(4)] public void oCmp_8bit_NegativeFlag() { TestContext.WriteLine("oCMP 8bit, negative flag"); @@ -83,7 +83,7 @@ public void oCmp_8bit_NegativeFlag() Assert.That("efhiNzVC", Is.EqualTo(cpu.flagsToString())); } - [Test, Order(5)] + [Test, Order(5)] public void oCmp_8bit_Negative1() { TestContext.WriteLine("oCMP 8bit, -1"); @@ -93,7 +93,7 @@ public void oCmp_8bit_Negative1() Assert.That("efhiNzvC", Is.EqualTo(cpu.flagsToString())); } - [Test, Order(6)] + [Test, Order(6)] public void oCmp_8bit_ZeroFlag() { TestContext.WriteLine("oCMP 8bit, zero flag"); @@ -103,7 +103,7 @@ public void oCmp_8bit_ZeroFlag() Assert.That("efhinZvc", Is.EqualTo(cpu.flagsToString())); } - [Test, Order(7)] + [Test, Order(7)] public void oCmp_16bit_CarryFlag() { TestContext.WriteLine("oCMP 16bit, carry flag"); @@ -113,7 +113,7 @@ public void oCmp_16bit_CarryFlag() Assert.That("efhinzvC", Is.EqualTo(cpu.flagsToString())); } - [Test, Order(8)] + [Test, Order(8)] public void oCmp_16bit_0xFFFF() { TestContext.WriteLine("oCMP 16bit, 0xFFFF"); @@ -123,7 +123,7 @@ public void oCmp_16bit_0xFFFF() Assert.That("efhiNzvc", Is.EqualTo(cpu.flagsToString())); } - [Test, Order(9)] + [Test, Order(9)] public void oCmp_16bit_NegativeFlag() { TestContext.WriteLine("oCMP 16bit, negative flag"); @@ -133,7 +133,7 @@ public void oCmp_16bit_NegativeFlag() Assert.That("efhiNzVC", Is.EqualTo(cpu.flagsToString())); } - [Test, Order(10)] + [Test, Order(10)] public void oCmp_16bit_Negative1() { TestContext.WriteLine("oCMP 16bit, -1"); @@ -143,7 +143,7 @@ public void oCmp_16bit_Negative1() Assert.That("efhiNzvC", Is.EqualTo(cpu.flagsToString())); } - [Test, Order(11)] + [Test, Order(11)] public void oCmp_16bit_ZeroFlag() { TestContext.WriteLine("oCMP 16bit, zero flag"); @@ -153,7 +153,7 @@ public void oCmp_16bit_ZeroFlag() Assert.That("efhinZvc", Is.EqualTo(cpu.flagsToString())); } - [Test, Order(12)] + [Test, Order(12)] public void FlagsCorrectAfterIRQ_InitFlags_0x00() { TestContext.WriteLine("flags should be correct after calling irq(), init flags to 0x00"); @@ -170,7 +170,7 @@ public void FlagsCorrectAfterIRQ_InitFlags_0x00() Assert.That(readMemoryAddress[3], Is.EqualTo(0xFFF9)); } - [Test, Order(13)] + [Test, Order(13)] public void DetectFirqCouldNotBeTriggered() { TestContext.WriteLine("detect that firq could not be triggered"); @@ -180,7 +180,7 @@ public void DetectFirqCouldNotBeTriggered() Assert.That(0, Is.EqualTo(0)); } - [Test, Order(14)] + [Test, Order(14)] public void FlagsCorrectAfterIRQ_InitFlags_0xEF() { TestContext.WriteLine("flags should be correct after calling irq(), init flags to 0xef"); @@ -198,7 +198,7 @@ public void FlagsCorrectAfterIRQ_InitFlags_0xEF() Assert.That("EFHINZVC", Is.EqualTo(cpu.flagsToString())); } - [Test, Order(15)] + [Test, Order(15)] public void IRQNotCalledIf_F_IRQMASK_set() { TestContext.WriteLine("irq() should not be called if F_IRQMASK flag is set"); @@ -214,7 +214,7 @@ public void IRQNotCalledIf_F_IRQMASK_set() Assert.Throws(() => readMemoryAddress.ElementAt(3)); } - [Test, Order(16)] + [Test, Order(16)] public void FlagsCorrectAfterNMI() { TestContext.WriteLine("flags should be correct after calling nmi()"); @@ -231,7 +231,7 @@ public void FlagsCorrectAfterNMI() Assert.That(readMemoryAddress[3], Is.EqualTo(0xFFFD)); } - [Test, Order(17)] + [Test, Order(17)] public void FlagsCorrectAfterFIRQ_InitFlags_0x00() { TestContext.WriteLine("flags should be correct after calling firq(), init flags to 0x00"); @@ -248,7 +248,7 @@ public void FlagsCorrectAfterFIRQ_InitFlags_0x00() Assert.That(readMemoryAddress[3], Is.EqualTo(0xFFF7)); } - [Test, Order(18)] + [Test, Order(18)] public void FlagsCorrectAfterFIRQ_InitFlags_0xBF() { TestContext.WriteLine("flags should be correct after calling firq(), init flags to 0xbf"); @@ -266,7 +266,7 @@ public void FlagsCorrectAfterFIRQ_InitFlags_0xBF() Assert.That("eFHINZVC", Is.EqualTo(cpu.flagsToString())); } - [Test, Order(19)] + [Test, Order(19)] public void FIRQNotCalledIf_F_FIRQMASK_set() { TestContext.WriteLine("firq() should not be called if F_FIRQMASK flag is set"); @@ -282,7 +282,7 @@ public void FIRQNotCalledIf_F_FIRQMASK_set() Assert.Throws(() => readMemoryAddress.ElementAt(3)); } - [Test, Order(20)] + [Test, Order(20)] public void oNEG_CarryFlag() { TestContext.WriteLine("oNEG() should set CARRY flag correctly"); @@ -298,7 +298,7 @@ public void oNEG_CarryFlag() Assert.Throws(() => readMemoryAddress.ElementAt(3)); } - [Test, Order(21)] + [Test, Order(21)] public void SetOverflowFlag_8bit() { TestContext.WriteLine("set overflow flag (8bit)"); @@ -308,7 +308,7 @@ public void SetOverflowFlag_8bit() Assert.That("efhinzVc", Is.EqualTo(cpu.flagsToString())); } - [Test, Order(22)] + [Test, Order(22)] public void SetOverflowFlag_8bit_overflow_r() { TestContext.WriteLine("set overflow flag (8bit), overflow r value"); @@ -318,7 +318,7 @@ public void SetOverflowFlag_8bit_overflow_r() Assert.That("efhinzvc", Is.EqualTo(cpu.flagsToString())); } - [Test, Order(23)] + [Test, Order(23)] public void setOverflowFlag_16bit() { TestContext.WriteLine("set overflow flag (16bit)"); @@ -328,7 +328,7 @@ public void setOverflowFlag_16bit() Assert.That("efhinzVc", Is.EqualTo(cpu.flagsToString())); } - [Test, Order(24)] + [Test, Order(24)] public void SetOverflowFlag_16bit_overflow_r() { TestContext.WriteLine("set overflow flag (16bit), overflow r value"); @@ -338,7 +338,7 @@ public void SetOverflowFlag_16bit_overflow_r() Assert.That("efhinzvc", Is.EqualTo(cpu.flagsToString())); } - [Test, Order(25)] + [Test, Order(25)] public void Signed_5bit() { TestContext.WriteLine("signed 5bit"); @@ -355,7 +355,7 @@ public void Signed_5bit() //Assert.That(valUndef, Is.EqualTo(undefined)); } - [Test, Order(26)] + [Test, Order(26)] public void Signed_8bit() { TestContext.WriteLine("signed 8bit"); @@ -372,7 +372,7 @@ public void Signed_8bit() //Assert.That(valUndef, Is.EqualTo(undefined)); } - [Test, Order(27)] + [Test, Order(27)] public void Signed_16bit() { TestContext.WriteLine("signed 16bit"); @@ -389,7 +389,7 @@ public void Signed_16bit() //Assert.That(valUndef, Is.EqualTo(undefined)); } - [Test, Order(28)] + [Test, Order(28)] public void Flags_NZ16_0xFFFF() { TestContext.WriteLine("flagsNZ16 0xFFFF"); @@ -399,7 +399,7 @@ public void Flags_NZ16_0xFFFF() Assert.That("efhiNzvc", Is.EqualTo(cpu.flagsToString())); } - [Test, Order(29)] + [Test, Order(29)] public void FlagsNZ16_0x0000() { TestContext.WriteLine("flagsNZ16 0x0000"); @@ -409,7 +409,7 @@ public void FlagsNZ16_0x0000() Assert.That("efhinZvc", Is.EqualTo(cpu.flagsToString())); } - [Test, Order(30)] + [Test, Order(30)] public void WriteWord_0_0x1234() { TestContext.WriteLine("WriteWord(0, 0x1234)"); @@ -421,7 +421,7 @@ public void WriteWord_0_0x1234() Assert.That(writeMemoryAddress[1].value, Is.EqualTo(0x34)); } - [Test, Order(31)] + [Test, Order(31)] public void WriteWord_0xFFFF_0x1234() { TestContext.WriteLine("WriteWord(0xFFFF, 0x1234)"); @@ -433,7 +433,7 @@ public void WriteWord_0xFFFF_0x1234() Assert.That(writeMemoryAddress[1].value, Is.EqualTo(0x34)); } - [Test, Order(32)] + [Test, Order(32)] public void GetD() { TestContext.WriteLine("getD"); @@ -444,7 +444,7 @@ public void GetD() Assert.That(result, Is.EqualTo(0xFFEE)); } - [Test, Order(33)] + [Test, Order(33)] public void SetD_0xFFEE() { TestContext.WriteLine("setD(0xFFEE)"); @@ -454,7 +454,7 @@ public void SetD_0xFFEE() Assert.That(cpu.regB, Is.EqualTo(0xEE)); } - [Test, Order(34)] + [Test, Order(34)] public void dpadd_regDP_0() { TestContext.WriteLine("dpadd(), regDP = 0"); @@ -467,7 +467,7 @@ public void dpadd_regDP_0() Assert.That(result, Is.EqualTo(0xFF)); } - [Test, Order(35)] + [Test, Order(35)] public void dpadd_regDP_0xFF() { TestContext.WriteLine("dpadd(), regDP = 0xFF"); @@ -633,7 +633,7 @@ public void TFREXG_Exchange_B_DP() Assert.That(cpu.regDP, Is.EqualTo(0xFF)); } - [Test, Order(50)] + [Test, Order(50)] public void GetAndSetState() { TestContext.WriteLine("get and set state"); @@ -644,5 +644,5 @@ public void GetAndSetState() cpu.setState(state); Assert.That(cpu.regA, Is.EqualTo(0x44)); } - } -} + } +} diff --git a/src/WPCEmu.Test/Boards/Up/SecurityPicTests.cs b/src/WPCEmu.Test/Boards/Up/SecurityPicTests.cs index 7dea5a7..684dcfd 100644 --- a/src/WPCEmu.Test/Boards/Up/SecurityPicTests.cs +++ b/src/WPCEmu.Test/Boards/Up/SecurityPicTests.cs @@ -1,23 +1,23 @@ -using System.Linq; -using NUnit.Framework; -using WPCEmu.Boards.Up; - -namespace WPCEmu.Test.Boards.Up -{ - [TestFixture] +using System.Linq; +using NUnit.Framework; +using WPCEmu.Boards.Up; + +namespace WPCEmu.Test.Boards.Up +{ + [TestFixture] public class SecurityPicTests - { + { const int MACHINE_SERIAL = 530; - + SecurityPic securityPic; [SetUp] public void Init() { securityPic = SecurityPic.getInstance(MACHINE_SERIAL); - } - - [Test, Order(1)] + } + + [Test, Order(1)] public void Reset() { TestContext.WriteLine("SecurityPic, reset"); @@ -85,5 +85,5 @@ public void CalculateInitialSerialNumbers() Assert.That(securityPic.originalPicSerialNumber, Is.EqualTo(expectedPicSerial.ToArray())); Assert.That(securityPic.serialNumberScrambler, Is.EqualTo(0xA5)); } - } -} + } +} diff --git a/src/WPCEmu.Test/Db/GamelistTests.cs b/src/WPCEmu.Test/Db/GamelistTests.cs index bc34ea1..2b385a9 100644 --- a/src/WPCEmu.Test/Db/GamelistTests.cs +++ b/src/WPCEmu.Test/Db/GamelistTests.cs @@ -1,12 +1,12 @@ -using NUnit.Framework; +using NUnit.Framework; using WPCEmu.Db; -namespace WPCEmu.Test.Db -{ - [TestFixture] +namespace WPCEmu.Test.Db +{ + [TestFixture] public class GamelistTests { - [Test, Order(1)] + [Test, Order(1)] public void ShouldGetAllNames() { TestContext.WriteLine("gamelist, should getAllNames"); @@ -15,7 +15,7 @@ public void ShouldGetAllNames() Assert.That(result.Length > 20, Is.EqualTo(true)); } - [Test, Order(2)] + [Test, Order(2)] public void ShouldGetByName() { TestContext.WriteLine("gamelist, should getByName"); @@ -26,7 +26,7 @@ public void ShouldGetByName() Assert.That(result.version, Is.EqualTo("L-8")); } - [Test, Order(3)] + [Test, Order(3)] public void ShouldGetByPinmameName() { TestContext.WriteLine("gamelist, should getByPinmameName"); @@ -35,7 +35,7 @@ public void ShouldGetByPinmameName() Assert.That(result.pinmame?.gameName, Is.EqualTo("Twilight Zone")); } - [Test, Order(4)] + [Test, Order(4)] public void ShouldGetByPinmameNameUppercase() { TestContext.WriteLine("gamelist, should getByPinmameName (UPPERCASE)"); @@ -44,7 +44,7 @@ public void ShouldGetByPinmameNameUppercase() Assert.That(result.pinmame?.gameName, Is.EqualTo("Twilight Zone")); } - [Test, Order(5)] + [Test, Order(5)] public void ShouldGetByPinmameNameWithUnknownName() { TestContext.WriteLine("gamelist, getByPinmameName with unknown name"); @@ -52,5 +52,5 @@ public void ShouldGetByPinmameNameWithUnknownName() var result = Gamelist.getByPinmameName("i do not exist!"); Assert.That(result, Is.EqualTo(null)); } - } + } } diff --git a/src/WPCEmu.Test/EmulatorTests.cs b/src/WPCEmu.Test/EmulatorTests.cs index acd1f50..dc03b72 100644 --- a/src/WPCEmu.Test/EmulatorTests.cs +++ b/src/WPCEmu.Test/EmulatorTests.cs @@ -1,13 +1,13 @@ -using System.Linq; +using System.Linq; using System.Reflection; using NUnit.Framework; -namespace WPCEmu.Test -{ - [TestFixture] +namespace WPCEmu.Test +{ + [TestFixture] public class EmulatorTests { - [Test, Order(1)] + [Test, Order(1)] public void GetVersion() { TestContext.WriteLine("Emulator get version"); @@ -17,11 +17,22 @@ public void GetVersion() u06 = new byte[262144] }); + AssemblyName assemblyName = null; + + foreach (var tmpAssemblyName in Assembly.GetExecutingAssembly().GetReferencedAssemblies()) + { + if (tmpAssemblyName.Name == "WPCEmuCS") + { + assemblyName = tmpAssemblyName; + break; + } + } + var version = emulator.version(); - Assert.That(version, Is.EqualTo(Assembly.GetExecutingAssembly().GetName().Version.ToString())); + Assert.That(version, Is.EqualTo(assemblyName.Version.ToString())); } - [Test, Order(2)] + [Test, Order(2)] public void ToggleMidnightModeEnabled() { TestContext.WriteLine("Emulator toggle midnightModeEnabled"); @@ -35,7 +46,7 @@ public void ToggleMidnightModeEnabled() Assert.That(emulator.cpuBoard.asic?.midnightModeEnabled, Is.EqualTo(true)); } - [Test, Order(3)] + [Test, Order(3)] public void ToggleSwitchInput() { TestContext.WriteLine("Emulator toggle switch input"); @@ -51,7 +62,7 @@ public void ToggleSwitchInput() Assert.That(inputState2, Is.EqualTo(new byte[] { 0, 1, 8, 0, 0, 0, 0, 0, 0, 0 })); } - [Test, Order(4)] + [Test, Order(4)] public void ClearSwitchInput() { TestContext.WriteLine("Emulator clear switch input"); @@ -65,7 +76,7 @@ public void ClearSwitchInput() Assert.That(inputState, Is.EqualTo(new byte[] { 0, 0, 8, 0, 0, 0, 0, 0, 0, 0 })); } - [Test, Order(5)] + [Test, Order(5)] public void SetSwitchInput() { TestContext.WriteLine("Emulator set switch input"); @@ -79,7 +90,7 @@ public void SetSwitchInput() Assert.That(inputState, Is.EqualTo(new byte[] { 0, 1, 8, 0, 0, 0, 0, 0, 0, 0 })); } - [Test, Order(6)] + [Test, Order(6)] public void GetDefaultDipSwitchState() { TestContext.WriteLine("Emulator get default dip switch state"); @@ -92,7 +103,7 @@ public void GetDefaultDipSwitchState() Assert.That(result, Is.EqualTo(0)); } - [Test, Order(7)] + [Test, Order(7)] public void SetGetDefaultDipSwitchState() { TestContext.WriteLine("Emulator set/get default dip switch state"); diff --git a/src/WPCEmu.Test/Rom/GameIdTests.cs b/src/WPCEmu.Test/Rom/GameIdTests.cs index aea10e9..5536944 100644 --- a/src/WPCEmu.Test/Rom/GameIdTests.cs +++ b/src/WPCEmu.Test/Rom/GameIdTests.cs @@ -1,10 +1,10 @@ -using System.Linq; +using System.Linq; using NUnit.Framework; using WPCEmu.Rom; -namespace WPCEmu.Test.Rom -{ - [TestFixture] +namespace WPCEmu.Test.Rom +{ + [TestFixture] public class GameIdTests { static readonly byte[] MAGIC_STRING = { @@ -23,7 +23,7 @@ public class GameIdTests 0, 0, 0, 0, 0, 0, 0 }; - [Test, Order(1)] + [Test, Order(1)] public void ShouldReturnUndefinedIfMagixByteFound() { TestContext.WriteLine("gameId.search should return undefined if magix byte found"); @@ -32,7 +32,7 @@ public void ShouldReturnUndefinedIfMagixByteFound() Assert.That(result, Is.EqualTo(null)); } - [Test, Order(2)] + [Test, Order(2)] public void ShouldIgnoreMagixByteIfOnlyFoundOnce() { TestContext.WriteLine("gameId.search should ignore magic byte if only found once"); @@ -41,7 +41,7 @@ public void ShouldIgnoreMagixByteIfOnlyFoundOnce() Assert.That(result, Is.EqualTo(null)); } - [Test, Order(3)] + [Test, Order(3)] public void ShouldFindMagicByte() { TestContext.WriteLine("gameId.search should find magic byte"); diff --git a/src/WPCEmu.Test/Rom/RomParserTests.cs b/src/WPCEmu.Test/Rom/RomParserTests.cs index 7a0adc9..19486b4 100644 --- a/src/WPCEmu.Test/Rom/RomParserTests.cs +++ b/src/WPCEmu.Test/Rom/RomParserTests.cs @@ -1,14 +1,14 @@ -using System; -using System.Linq; +using System; +using System.Linq; using NUnit.Framework; using WPCEmu.Rom; -namespace WPCEmu.Test.Rom -{ - [TestFixture] +namespace WPCEmu.Test.Rom +{ + [TestFixture] public class RomParserTests { - [Test, Order(1)] + [Test, Order(1)] public void ShouldRejectEmptyRom() { TestContext.WriteLine("romParser should reject empty rom"); @@ -17,7 +17,7 @@ public void ShouldRejectEmptyRom() Assert.That(result.Message, Is.EqualTo("INVALID_ROM_DATA")); } - [Test, Order(2)] + [Test, Order(2)] public void ShouldRejectInvalidData() { TestContext.WriteLine("romParser should reject invalid data"); @@ -30,7 +30,7 @@ public void ShouldRejectInvalidData() Assert.That(result.Message, Is.EqualTo("INVALID_ROM_SIZE")); } - [Test, Order(3)] + [Test, Order(3)] public void ShouldParseGameRom() { TestContext.WriteLine("romParser should parse game rom"); @@ -45,7 +45,7 @@ public void ShouldParseGameRom() Assert.That(result.preDcsSoundboard, Is.EqualTo(false)); } - [Test, Order(4)] + [Test, Order(4)] public void ShouldParseWpc95Board() { TestContext.WriteLine("romParser should parse wpc95 board"); @@ -60,7 +60,7 @@ public void ShouldParseWpc95Board() Assert.That(result.hasSecurityPic, Is.EqualTo(true)); } - [Test, Order(5)] + [Test, Order(5)] public void ShouldParseWpcDmdBoard() { TestContext.WriteLine("romParser should parse wpcDmd board"); @@ -75,7 +75,7 @@ public void ShouldParseWpcDmdBoard() Assert.That(result.hasSecurityPic, Is.EqualTo(false)); } - [Test, Order(6)] + [Test, Order(6)] public void ShouldParseWpcFliptronicsBoard() { TestContext.WriteLine("romParser should parse wpcFliptronics board"); @@ -91,7 +91,7 @@ public void ShouldParseWpcFliptronicsBoard() Assert.That(result.hasAlphanumericDisplay, Is.EqualTo(false)); } - [Test, Order(7)] + [Test, Order(7)] public void ShouldParseWpcAlphanumericBoard() { TestContext.WriteLine("romParser should parse wpcAlphanumeric board"); @@ -105,7 +105,7 @@ public void ShouldParseWpcAlphanumericBoard() Assert.That(result.hasAlphanumericDisplay, Is.EqualTo(true)); } - [Test, Order(8)] + [Test, Order(8)] public void ShouldParseMemoryPosition() { TestContext.WriteLine("romParser should parse wpcAlphanumeric board"); diff --git a/src/WPCEmu.Test/WPCEmu.Test.csproj b/src/WPCEmu.Test/WPCEmu.Test.csproj index 6ea388c..6e15bb9 100644 --- a/src/WPCEmu.Test/WPCEmu.Test.csproj +++ b/src/WPCEmu.Test/WPCEmu.Test.csproj @@ -1,12 +1,11 @@ netcoreapp3.1 - 0.0.6 - - - + + + diff --git a/src/WPCEmu.Tracer/Disasm.cs b/src/WPCEmu.Tracer/Disasm.cs new file mode 100644 index 0000000..1b92356 --- /dev/null +++ b/src/WPCEmu.Tracer/Disasm.cs @@ -0,0 +1,576 @@ +using System; +using System.Collections.Generic; +using System.Linq; + +namespace WPCEmu.Tracer +{ + class Disasm + { + public struct Instruction + { + public string mnemo; + public string _params; + public byte bytes; + } + + public struct DS + { + public byte bytes; + public byte mode; + public string mnemo; + } + + /* + ILLEGAL 0 + DIRECT 1 + INHERENT 2 + BRANCH_REL_16 3 + IMMEDIAT_8 4 + BRANCH_REL_8 5 + INDEXED 6 + EXTENDED 7 + IMMEDIAT_16 8 + PSHS 10 + PSHU 11 + EXG, TFR 20 + */ + + static readonly DS[] ds = new DS[] { + //0 + new DS { bytes = 2, mode = 1, mnemo = "NEG" }, + new DS { bytes = 1, mode = 0, mnemo = "???" }, + new DS { bytes = 1, mode = 0, mnemo = "???" }, + new DS { bytes = 2, mode = 1, mnemo = "COM" }, + new DS { bytes = 2, mode = 1, mnemo = "LSR" }, + new DS { bytes = 1, mode = 0, mnemo = "???" }, + new DS { bytes = 2, mode = 1, mnemo = "ROR" }, + new DS { bytes = 2, mode = 1, mnemo = "ASR" }, + new DS { bytes = 2, mode = 1, mnemo = "LSL" }, + new DS { bytes = 2, mode = 1, mnemo = "ROL" }, + new DS { bytes = 2, mode = 1, mnemo = "DEC" }, + new DS { bytes = 1, mode = 0, mnemo = "???" }, + new DS { bytes = 2, mode = 1, mnemo = "INC" }, + new DS { bytes = 2, mode = 1, mnemo = "TST" }, + new DS { bytes = 2, mode = 1, mnemo = "JMP" }, + new DS { bytes = 2, mode = 1, mnemo = "CLR" }, + new DS { bytes = 1, mode = 0, mnemo = "Prefix" }, + new DS { bytes = 1, mode = 0, mnemo = "Prefix" }, + new DS { bytes = 1, mode = 2, mnemo = "NOP" }, + new DS { bytes = 1, mode = 2, mnemo = "SYNC" }, + + //20 + new DS { bytes = 1, mode = 0, mnemo = "???" }, + new DS { bytes = 1, mode = 0, mnemo = "???" }, + new DS { bytes = 3, mode = 3, mnemo = "LBRA" }, + new DS { bytes = 3, mode = 3, mnemo = "LBSR" }, + new DS { bytes = 1, mode = 0, mnemo = "???" }, + new DS { bytes = 1, mode = 2, mnemo = "DAA" }, + new DS { bytes = 2, mode = 4, mnemo = "ORCC" }, + new DS { bytes = 1, mode = 0, mnemo = "???" }, + new DS { bytes = 2, mode = 4, mnemo = "ANDCC" }, + new DS { bytes = 1, mode = 2, mnemo = "SEX" }, + new DS { bytes = 2, mode = 20, mnemo = "EXG" }, + new DS { bytes = 2, mode = 20, mnemo = "TFR" }, + new DS { bytes = 2, mode = 5, mnemo = "BRA" }, + new DS { bytes = 2, mode = 5, mnemo = "BRN" }, + new DS { bytes = 2, mode = 5, mnemo = "BHI" }, + new DS { bytes = 2, mode = 5, mnemo = "BLS" }, + new DS { bytes = 2, mode = 5, mnemo = "BCC" }, + new DS { bytes = 2, mode = 5, mnemo = "BCS" }, + new DS { bytes = 2, mode = 5, mnemo = "BNE" }, + new DS { bytes = 2, mode = 5, mnemo = "BEQ" }, + + //40 + new DS { bytes = 2, mode = 5, mnemo = "BVC" }, + new DS { bytes = 2, mode = 5, mnemo = "BVS" }, + new DS { bytes = 2, mode = 5, mnemo = "BPL" }, + new DS { bytes = 2, mode = 5, mnemo = "BMI" }, + new DS { bytes = 2, mode = 5, mnemo = "BGE" }, + new DS { bytes = 2, mode = 5, mnemo = "BLT" }, + new DS { bytes = 2, mode = 5, mnemo = "BGT" }, + new DS { bytes = 2, mode = 5, mnemo = "BLE" }, + new DS { bytes = 2, mode = 6, mnemo = "LEAX" }, + new DS { bytes = 2, mode = 6, mnemo = "LEAY" }, + new DS { bytes = 2, mode = 6, mnemo = "LEAS" }, + new DS { bytes = 2, mode = 6, mnemo = "LEAU" }, + new DS { bytes = 2, mode = 10, mnemo = "PSHS" }, + new DS { bytes = 2, mode = 10, mnemo = "PULS" }, + new DS { bytes = 2, mode = 11, mnemo = "PSHU" }, + new DS { bytes = 2, mode = 11, mnemo = "PULU" }, + new DS { bytes = 1, mode = 0, mnemo = "???" }, + new DS { bytes = 1, mode = 2, mnemo = "RTS" }, + new DS { bytes = 1, mode = 2, mnemo = "ABX" }, + new DS { bytes = 1, mode = 2, mnemo = "RTI" }, + + //60 + new DS { bytes = 2, mode = 2, mnemo = "CWAI" }, + new DS { bytes = 1, mode = 2, mnemo = "MUL" }, + new DS { bytes = 1, mode = 2, mnemo = "RESET" }, + new DS { bytes = 1, mode = 2, mnemo = "SWI1" }, + new DS { bytes = 1, mode = 2, mnemo = "NEGA" }, + new DS { bytes = 1, mode = 0, mnemo = "???" }, + new DS { bytes = 1, mode = 0, mnemo = "???" }, + new DS { bytes = 1, mode = 2, mnemo = "COMA" }, + new DS { bytes = 1, mode = 2, mnemo = "LSRA" }, + new DS { bytes = 1, mode = 0, mnemo = "???" }, + new DS { bytes = 1, mode = 2, mnemo = "RORA" }, + new DS { bytes = 1, mode = 2, mnemo = "ASRA" }, + new DS { bytes = 1, mode = 2, mnemo = "ASLA" }, + new DS { bytes = 1, mode = 2, mnemo = "ROLA" }, + new DS { bytes = 1, mode = 2, mnemo = "DECA" }, + new DS { bytes = 1, mode = 0, mnemo = "???" }, + new DS { bytes = 1, mode = 2, mnemo = "INCA" }, + new DS { bytes = 1, mode = 2, mnemo = "TSTA" }, + new DS { bytes = 1, mode = 0, mnemo = "???" }, + new DS { bytes = 1, mode = 2, mnemo = "CLRA" }, + + //80 + new DS { bytes = 1, mode = 2, mnemo = "NEGB" }, + new DS { bytes = 1, mode = 0, mnemo = "???" }, + new DS { bytes = 1, mode = 0, mnemo = "???" }, + new DS { bytes = 1, mode = 2, mnemo = "COMB" }, + new DS { bytes = 1, mode = 2, mnemo = "LSRB" }, + new DS { bytes = 1, mode = 0, mnemo = "???" }, + new DS { bytes = 1, mode = 2, mnemo = "RORB" }, + new DS { bytes = 1, mode = 2, mnemo = "ASRB" }, + new DS { bytes = 1, mode = 2, mnemo = "ASLB" }, + new DS { bytes = 1, mode = 2, mnemo = "ROLB" }, + new DS { bytes = 1, mode = 2, mnemo = "DECB" }, + new DS { bytes = 1, mode = 0, mnemo = "???" }, + new DS { bytes = 1, mode = 2, mnemo = "INCB" }, + new DS { bytes = 1, mode = 2, mnemo = "TSTB" }, + new DS { bytes = 1, mode = 0, mnemo = "???" }, + new DS { bytes = 1, mode = 2, mnemo = "CLRB" }, + new DS { bytes = 2, mode = 6, mnemo = "NEG" }, + new DS { bytes = 1, mode = 0, mnemo = "???" }, + new DS { bytes = 1, mode = 0, mnemo = "???" }, + new DS { bytes = 2, mode = 6, mnemo = "COM" }, + + //100 + new DS { bytes = 2, mode = 6, mnemo = "LSR" }, + new DS { bytes = 1, mode = 0, mnemo = "???" }, + new DS { bytes = 2, mode = 6, mnemo = "ROR" }, + new DS { bytes = 2, mode = 6, mnemo = "ASR" }, + new DS { bytes = 2, mode = 6, mnemo = "LSL" }, + new DS { bytes = 2, mode = 6, mnemo = "ROL" }, + new DS { bytes = 2, mode = 6, mnemo = "DEC" }, + new DS { bytes = 1, mode = 0, mnemo = "???" }, + new DS { bytes = 2, mode = 6, mnemo = "INC" }, + new DS { bytes = 2, mode = 6, mnemo = "TST" }, + new DS { bytes = 2, mode = 6, mnemo = "JMP" }, + new DS { bytes = 2, mode = 6, mnemo = "CLR" }, + new DS { bytes = 3, mode = 7, mnemo = "NEG" }, + new DS { bytes = 1, mode = 0, mnemo = "???" }, + new DS { bytes = 1, mode = 0, mnemo = "???" }, + new DS { bytes = 3, mode = 7, mnemo = "COM" }, + new DS { bytes = 3, mode = 7, mnemo = "LSR" }, + new DS { bytes = 1, mode = 0, mnemo = "???" }, + new DS { bytes = 3, mode = 7, mnemo = "ROR" }, + new DS { bytes = 3, mode = 7, mnemo = "ASR" }, + new DS { bytes = 3, mode = 7, mnemo = "LSL" }, + + //120 + new DS { bytes = 3, mode = 7, mnemo = "ROL" }, + new DS { bytes = 3, mode = 7, mnemo = "DEC" }, + new DS { bytes = 1, mode = 0, mnemo = "???" }, + new DS { bytes = 3, mode = 7, mnemo = "INC" }, + new DS { bytes = 3, mode = 7, mnemo = "TST" }, + new DS { bytes = 3, mode = 7, mnemo = "JMP" }, + new DS { bytes = 3, mode = 7, mnemo = "CLR" }, + new DS { bytes = 2, mode = 4, mnemo = "SUBA" }, + new DS { bytes = 2, mode = 4, mnemo = "CMPA" }, + new DS { bytes = 2, mode = 4, mnemo = "SBCA" }, + new DS { bytes = 3, mode = 8, mnemo = "SUBD" }, + new DS { bytes = 2, mode = 4, mnemo = "ANDA" }, + new DS { bytes = 2, mode = 4, mnemo = "BITA" }, + new DS { bytes = 2, mode = 4, mnemo = "LDA" }, + new DS { bytes = 1, mode = 0, mnemo = "???" }, + new DS { bytes = 2, mode = 4, mnemo = "EORA" }, + new DS { bytes = 2, mode = 4, mnemo = "ADCA" }, + new DS { bytes = 2, mode = 4, mnemo = "ORA" }, + new DS { bytes = 2, mode = 4, mnemo = "ADDA" }, + new DS { bytes = 3, mode = 8, mnemo = "CMPX" }, + new DS { bytes = 2, mode = 5, mnemo = "BSR" }, + + //140 + new DS { bytes = 3, mode = 8, mnemo = "LDX" }, + new DS { bytes = 1, mode = 0, mnemo = "???" }, + new DS { bytes = 2, mode = 1, mnemo = "SUBA" }, + new DS { bytes = 2, mode = 1, mnemo = "CMPA" }, + new DS { bytes = 2, mode = 1, mnemo = "SBCA" }, + new DS { bytes = 2, mode = 1, mnemo = "SUBd" }, + new DS { bytes = 2, mode = 1, mnemo = "ANDA" }, + new DS { bytes = 2, mode = 1, mnemo = "BITA" }, + new DS { bytes = 2, mode = 1, mnemo = "LDA" }, + new DS { bytes = 2, mode = 1, mnemo = "STA" }, + new DS { bytes = 2, mode = 1, mnemo = "EORA" }, + new DS { bytes = 2, mode = 1, mnemo = "ADCA" }, + new DS { bytes = 2, mode = 1, mnemo = "ORA" }, + new DS { bytes = 2, mode = 1, mnemo = "ADDA" }, + new DS { bytes = 2, mode = 1, mnemo = "CMPX" }, + new DS { bytes = 2, mode = 1, mnemo = "JSR" }, + new DS { bytes = 2, mode = 1, mnemo = "LDX" }, + new DS { bytes = 2, mode = 1, mnemo = "STX" }, + new DS { bytes = 2, mode = 6, mnemo = "SUBA" }, + new DS { bytes = 2, mode = 6, mnemo = "CMPA" }, + new DS { bytes = 2, mode = 6, mnemo = "SBCA" }, + + //160 + new DS { bytes = 2, mode = 6, mnemo = "SUBD" }, + new DS { bytes = 2, mode = 6, mnemo = "ANDA" }, + new DS { bytes = 2, mode = 6, mnemo = "BITA" }, + new DS { bytes = 2, mode = 6, mnemo = "LDA" }, + new DS { bytes = 2, mode = 6, mnemo = "STA" }, + new DS { bytes = 2, mode = 6, mnemo = "EORA" }, + new DS { bytes = 2, mode = 6, mnemo = "ADCA" }, + new DS { bytes = 2, mode = 6, mnemo = "ORA" }, + new DS { bytes = 2, mode = 6, mnemo = "ADDA" }, + new DS { bytes = 2, mode = 6, mnemo = "CMPX" }, + new DS { bytes = 2, mode = 6, mnemo = "JSR" }, + new DS { bytes = 2, mode = 6, mnemo = "LDX" }, + new DS { bytes = 2, mode = 6, mnemo = "STX" }, + new DS { bytes = 3, mode = 7, mnemo = "SUBA" }, + new DS { bytes = 3, mode = 7, mnemo = "CMPA" }, + new DS { bytes = 3, mode = 7, mnemo = "SBCA" }, + new DS { bytes = 3, mode = 7, mnemo = "SUBD" }, + new DS { bytes = 3, mode = 7, mnemo = "ANDA" }, + new DS { bytes = 3, mode = 7, mnemo = "BITA" }, + new DS { bytes = 3, mode = 7, mnemo = "LDA" }, + new DS { bytes = 3, mode = 7, mnemo = "STA" }, + + //180 + new DS { bytes = 3, mode = 7, mnemo = "EORA" }, + new DS { bytes = 3, mode = 7, mnemo = "ADCA" }, + new DS { bytes = 3, mode = 7, mnemo = "ORA" }, + new DS { bytes = 3, mode = 7, mnemo = "ADDA" }, + new DS { bytes = 3, mode = 7, mnemo = "CMPX" }, + new DS { bytes = 3, mode = 7, mnemo = "JSR" }, + new DS { bytes = 3, mode = 7, mnemo = "LDX" }, + new DS { bytes = 3, mode = 7, mnemo = "STX" }, + new DS { bytes = 2, mode = 4, mnemo = "SUBB" }, + new DS { bytes = 2, mode = 4, mnemo = "CMPB" }, + new DS { bytes = 2, mode = 4, mnemo = "SBCB" }, + new DS { bytes = 3, mode = 8, mnemo = "ADDD" }, + new DS { bytes = 2, mode = 4, mnemo = "ANDB" }, + new DS { bytes = 2, mode = 4, mnemo = "BITB" }, + new DS { bytes = 2, mode = 4, mnemo = "LDB" }, + new DS { bytes = 1, mode = 0, mnemo = "???" }, + new DS { bytes = 2, mode = 4, mnemo = "EORB" }, + new DS { bytes = 2, mode = 4, mnemo = "ADCB" }, + new DS { bytes = 2, mode = 4, mnemo = "ORB" }, + new DS { bytes = 2, mode = 4, mnemo = "ADDB" }, + new DS { bytes = 3, mode = 8, mnemo = "LDD" }, + new DS { bytes = 1, mode = 0, mnemo = "???" }, + new DS { bytes = 3, mode = 8, mnemo = "LDU" }, + new DS { bytes = 1, mode = 0, mnemo = "???" }, + new DS { bytes = 2, mode = 1, mnemo = "SUBB" }, + new DS { bytes = 2, mode = 1, mnemo = "CMPB" }, + new DS { bytes = 2, mode = 1, mnemo = "SBCB" }, + new DS { bytes = 2, mode = 1, mnemo = "ADDD" }, + new DS { bytes = 2, mode = 1, mnemo = "ANDB" }, + new DS { bytes = 2, mode = 1, mnemo = "BITB" }, + new DS { bytes = 2, mode = 1, mnemo = "LDB" }, + new DS { bytes = 2, mode = 1, mnemo = "STB" }, + new DS { bytes = 2, mode = 1, mnemo = "EORB" }, + new DS { bytes = 2, mode = 1, mnemo = "ADCB" }, + new DS { bytes = 2, mode = 1, mnemo = "ORB " }, + new DS { bytes = 2, mode = 1, mnemo = "ADDB" }, + new DS { bytes = 2, mode = 1, mnemo = "LDD " }, + new DS { bytes = 2, mode = 1, mnemo = "STD " }, + new DS { bytes = 2, mode = 1, mnemo = "LDU " }, + new DS { bytes = 2, mode = 1, mnemo = "STU " }, + new DS { bytes = 2, mode = 6, mnemo = "SUBB" }, + new DS { bytes = 2, mode = 6, mnemo = "CMPB" }, + new DS { bytes = 2, mode = 6, mnemo = "SBCB" }, + new DS { bytes = 2, mode = 6, mnemo = "ADDD" }, + new DS { bytes = 2, mode = 6, mnemo = "ANDB" }, + new DS { bytes = 2, mode = 6, mnemo = "BITB" }, + new DS { bytes = 2, mode = 6, mnemo = "LDB" }, + new DS { bytes = 2, mode = 6, mnemo = "STB" }, + new DS { bytes = 2, mode = 6, mnemo = "EORB" }, + new DS { bytes = 2, mode = 6, mnemo = "ADCB" }, + new DS { bytes = 2, mode = 6, mnemo = "ORB" }, + new DS { bytes = 2, mode = 6, mnemo = "ADDB" }, + new DS { bytes = 2, mode = 6, mnemo = "LDD" }, + new DS { bytes = 2, mode = 6, mnemo = "STD" }, + new DS { bytes = 2, mode = 6, mnemo = "LDU" }, + new DS { bytes = 2, mode = 6, mnemo = "STU" }, + new DS { bytes = 3, mode = 7, mnemo = "SUBB" }, + new DS { bytes = 3, mode = 7, mnemo = "CMPB" }, + new DS { bytes = 3, mode = 7, mnemo = "SBCB" }, + new DS { bytes = 3, mode = 7, mnemo = "ADDD" }, + new DS { bytes = 3, mode = 7, mnemo = "ANDB" }, + new DS { bytes = 3, mode = 7, mnemo = "BITB" }, + new DS { bytes = 3, mode = 7, mnemo = "LDB" }, + new DS { bytes = 3, mode = 7, mnemo = "STB" }, + new DS { bytes = 3, mode = 7, mnemo = "EORB" }, + new DS { bytes = 3, mode = 7, mnemo = "ADCB" }, + new DS { bytes = 3, mode = 7, mnemo = "ORB" }, + new DS { bytes = 3, mode = 7, mnemo = "ADDB" }, + new DS { bytes = 3, mode = 7, mnemo = "LDD" }, + new DS { bytes = 3, mode = 7, mnemo = "STD" }, + new DS { bytes = 3, mode = 7, mnemo = "LDU" }, + new DS { bytes = 3, mode = 7, mnemo = "STU" } + }; + + static readonly Dictionary ds11 = new Dictionary() + { + [0x3F] = new DS { bytes = 2, mode = 2, mnemo = "SWI3" }, + [0x83] = new DS { bytes = 4, mode = 8, mnemo = "CMPU" }, + [0x8C] = new DS { bytes = 4, mode = 8, mnemo = "CMPS" }, + [0x93] = new DS { bytes = 3, mode = 1, mnemo = "CMPU" }, + [0x9C] = new DS { bytes = 3, mode = 1, mnemo = "CMPS" }, + [0xA3] = new DS { bytes = 3, mode = 6, mnemo = "CMPU" }, + [0xAC] = new DS { bytes = 3, mode = 6, mnemo = "CMPS" }, + [0xB3] = new DS { bytes = 4, mode = 7, mnemo = "CMPU" }, + [0xBC] = new DS { bytes = 4, mode = 7, mnemo = "CMPS" }, + }; + + // format: bytes, mode, mnemo + // see http://techheap.packetizer.com/processors/6809/6809Instructions.html + static readonly Dictionary ds10 = new Dictionary() + { + [0x21] = new DS { bytes = 4, mode = 3, mnemo = "LBRN" }, + [0x22] = new DS { bytes = 4, mode = 3, mnemo = "LBHI" }, + [0x23] = new DS { bytes = 4, mode = 3, mnemo = "LBLS" }, + [0x24] = new DS { bytes = 4, mode = 3, mnemo = "LBCC" }, + [0x25] = new DS { bytes = 4, mode = 3, mnemo = "LBCS" }, + [0x26] = new DS { bytes = 4, mode = 3, mnemo = "LBNE" }, + [0x27] = new DS { bytes = 4, mode = 3, mnemo = "LBEQ" }, + [0x28] = new DS { bytes = 4, mode = 3, mnemo = "LBVC" }, + [0x29] = new DS { bytes = 4, mode = 3, mnemo = "LBVS" }, + [0x2a] = new DS { bytes = 4, mode = 3, mnemo = "LBPL" }, + [0x2b] = new DS { bytes = 4, mode = 3, mnemo = "LBMI" }, + [0x2c] = new DS { bytes = 4, mode = 3, mnemo = "LBGE" }, + [0x2d] = new DS { bytes = 4, mode = 3, mnemo = "LBLT" }, + [0x2e] = new DS { bytes = 4, mode = 3, mnemo = "LBGT" }, + [0x2f] = new DS { bytes = 4, mode = 3, mnemo = "LBLE" }, + [0x3F] = new DS { bytes = 2, mode = 2, mnemo = "SWI2" }, + [0x83] = new DS { bytes = 4, mode = 8, mnemo = "CMPD" }, + [0x8C] = new DS { bytes = 4, mode = 8, mnemo = "CMPY" }, + [0x8E] = new DS { bytes = 4, mode = 8, mnemo = "LDY" }, + [0x93] = new DS { bytes = 3, mode = 1, mnemo = "CMPD" }, + [0x9C] = new DS { bytes = 3, mode = 1, mnemo = "CMPY" }, + [0x9E] = new DS { bytes = 3, mode = 1, mnemo = "LDY" }, + [0x9F] = new DS { bytes = 3, mode = 1, mnemo = "STY" }, + [0xA3] = new DS { bytes = 3, mode = 6, mnemo = "CMPD" }, + [0xAC] = new DS { bytes = 3, mode = 6, mnemo = "CMPY" }, + [0xAE] = new DS { bytes = 3, mode = 6, mnemo = "LDY" }, + [0xAF] = new DS { bytes = 3, mode = 6, mnemo = "STY" }, + [0xB3] = new DS { bytes = 4, mode = 7, mnemo = "CMPD" }, + [0xBC] = new DS { bytes = 4, mode = 7, mnemo = "CMPY" }, + [0xBE] = new DS { bytes = 4, mode = 7, mnemo = "LDY" }, + [0xBF] = new DS { bytes = 4, mode = 7, mnemo = "STY" }, + [0xCE] = new DS { bytes = 4, mode = 8, mnemo = "LDS" }, + [0xDE] = new DS { bytes = 3, mode = 1, mnemo = "LDS" }, + [0xDF] = new DS { bytes = 3, mode = 1, mnemo = "STS" }, + [0xEE] = new DS { bytes = 3, mode = 6, mnemo = "LDS" }, + [0xEF] = new DS { bytes = 3, mode = 6, mnemo = "STS" }, + [0xFE] = new DS { bytes = 4, mode = 7, mnemo = "LDS" }, + [0xFF] = new DS { bytes = 4, mode = 7, mnemo = "STS" }, + }; + + /* + ILLEGAL 0 + DIRECT 1 + INHERENT 2 + BRANCH_REL_16 3 + IMMEDIAT_8 4 + BRANCH_REL_8 5 + INDEXED 6 + EXTENDED 7 + IMMEDIAT_16 8 + */ + + static string toHexN(ushort n, int d) { + //var s = n.toString(16); + //while (s.length> 5]; + if ((pb & 0x80) == 0) + { + //direct5 + var disp = (sbyte) (pb & 0x1f); + if (disp > 15) disp = (sbyte)(disp - 32); + if (disp >= 0) + { + _params = toHexN((ushort)disp, 1) + ',' + ixr; + } + else + { + // make sure we display negative hex values as mame + _params = "-$" + Math.Abs(disp) + "," + ixr; + } + break; + } + var ind = (byte) (pb & 0x10); + var mod = (byte) (pb & 0x0f); + var ofs8 = (b > 127) ? (b - 256) : b; + var ofs16 = ((b * 256 + c) > 32767) ? ((b * 256 + c) - 65536) : (b * 256 + c); + if (ind == 0) + { + switch (mod) + { + case 0: _params = "," + ixr + "+"; break; + case 1: _params = "," + ixr + "++"; break; + case 2: _params = ",-" + ixr; break; + case 3: _params = ",--" + ixr; break; + case 4: _params = "," + ixr; break; + case 5: _params = "B," + ixr; break; + case 6: _params = "A," + ixr; break; + case 7: _params = "???"; break; + case 8: + _params = toHex2((ushort)ofs8) + "," + ixr; + bytes++; + break; + case 9: + _params = toHex4((ushort)ofs16) + "," + ixr; + bytes += 2; + break; + case 10: _params = "???"; break; + case 11: _params = "D," + ixr; break; + case 12: _params = ofs8 + ",PC"; bytes++; break; + case 13: _params = ofs16 + ",PC"; bytes += 2; break; + case 14: _params = "???"; break; + case 15: + _params = toHex4((ushort)(b * 256 + c)); + bytes += 2; + break; + } + } + else + { + switch (mod) + { + case 0: _params = "???"; break; + case 1: _params = "[," + ixr + "++]"; break; + case 2: _params = "???"; break; + case 3: _params = "[,--" + ixr + "]"; break; + case 4: _params = "[," + ixr + "]"; break; + case 5: _params = "[B," + ixr + "]"; break; + case 6: _params = "[A," + ixr + "]"; break; + case 7: _params = "???"; break; + case 8: + _params = "[" + toHex2((ushort)ofs8) + "," + ixr + "]"; + bytes++; + break; + case 9: + _params = "[" + toHex4((ushort)ofs16) + "," + ixr + "]"; + bytes += 2; + break; + case 10: _params = "???"; break; + case 11: _params = "[D," + ixr + "]"; break; + case 12: _params = "[" + ofs8 + ",PC]"; bytes++; break; + case 13: _params = "[" + ofs16 + ",PC]"; bytes += 2; break; + case 14: _params = "???"; break; + case 15: _params = "[" + toHex4((ushort)(b * 256 + c)) + "]"; bytes += 2; break; + } + } + + break; + case 7: //extended + _params = toHex4((ushort)(a * 256 + b)); + break; + case 8: //imm16 + _params = "#" + toHex4((ushort)(a * 256 + b)); + break; + + case 10: //pshs, puls + rx = new string[] { "PC", "U", "Y", "X", "DP", "B", "A", "CC" }; + ro = new string[] { }; + for (j = 0; j < 8; j++) + { + if ((a & 1) != 0) { ro = ro.Concat(new[] { rx[7 - j] }).ToArray(); } + a >>= 1; + } + _params = string.Join(",", ro); + break; + case 11: //pshs, puls + rx = new string[] { "PC", "S", "Y", "X", "DP", "B", "A", "CC" }; + ro = new string[] { }; + for (j = 0; j < 8; j++) + { + if ((a & 1) != 0) { ro = ro.Concat(new[] { rx[7 - j] }).ToArray(); } + a >>= 1; + } + _params = string.Join(",", ro); + break; + case 20: //TFR etc + rx = new string[] { "D", "X", "Y", "U", "S", "PC", "?", "?", "A", "B", "CC", "DP", "?", "?", "?", "?" }; + _params = rx[a >> 4] + "," + rx[a & 0x0f]; + break; + } + + return new Instruction + { + mnemo = mnemo, + _params = _params, + bytes = bytes, + }; + } + } +} diff --git a/src/WPCEmu.Tracer/Tracer.cs b/src/WPCEmu.Tracer/Tracer.cs new file mode 100644 index 0000000..017eaee --- /dev/null +++ b/src/WPCEmu.Tracer/Tracer.cs @@ -0,0 +1,190 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; + +namespace WPCEmu.Tracer +{ + class Tracer + { + struct OutputSlice + { + public ushort pc; + public byte i1; + public byte i2; + public byte i3; + public byte i4; + public byte i5; + public byte cc; + public byte a; + public byte b; + public ushort x; + public ushort y; + public ushort s; + public ushort u; + } + + static uint MAXSTEPS = 0xFF000; + const int MAX_LOOPS = 64; + + static int traceLoops = 0; + static ushort[] lastPC = Enumerable.Repeat((ushort)0xFF, MAX_LOOPS).ToArray(); + + static List outputSlice = new List(); + + static void Trace(Emulator wpcSystem) + { + uint steps = 0; + while (steps++ < MAXSTEPS) + { + wpcSystem.executeCycle(1, 1); + var cpu = wpcSystem.cpuBoard.cpu; + + var pc = cpu.regPC; + + var i1 = cpu.memoryReadFunction(pc); + var i2 = cpu.memoryReadFunction((ushort) (pc + 1)); + var i3 = cpu.memoryReadFunction((ushort) (pc + 2)); + var i4 = cpu.memoryReadFunction((ushort) (pc + 3)); + var i5 = cpu.memoryReadFunction((ushort) (pc + 4)); + + outputSlice.Add(new OutputSlice + { + pc = pc, + i1 = i1, + i2 = i2, + i3 = i3, + i4 = i4, + i5 = i5, + cc = cpu.regCC, + a = cpu.regA, + b = cpu.regB, + x = cpu.regX, + y = cpu.regY, + s = cpu.regS, + u = cpu.regU + }); + + if (steps % (MAX_LOOPS * 100) == 0) + { + flushTraces(); + initTraceLoops(); + } + } + } + + static void initTraceLoops() + { + outputSlice.Clear(); + } + + static void flushTraces() + { + foreach (var line in outputSlice) { + var pc = line.pc; + var count = 0; + /* check for trace_loops - ripped from mame */ + for (var i = 0; i < MAX_LOOPS; i++) + { + if (lastPC[i] == pc) + { + count++; + } + } + + if (count > 1) + { + traceLoops++; + } + else + { + if (traceLoops > 0) + { + Console.WriteLine("\n (loops for " + traceLoops + " instructions)\n"); + traceLoops = 0; + } + var instr = Disasm.disasm(line.i1, line.i2, line.i3, line.i4, line.i5, pc); + printInstruction(pc, instr, line); + + for (var i = 1; i < MAX_LOOPS; i++) + { + lastPC[i - 1] = lastPC[i]; + } + lastPC[MAX_LOOPS - 1] = pc; + } + } + } + + static string formatRegister(ushort value, int padLength) + { + return value.ToString("X" + padLength) + " "; + } + + static void printInstruction(ushort pc, Disasm.Instruction instr, OutputSlice line) + { + string CC = "CC=" + formatRegister(line.cc, 2); + string A = "A=" + formatRegister(line.a, 4); + string B = "B=" + formatRegister(line.b, 4); + string X = "X=" + formatRegister(line.x, 4); + string Y = "Y=" + formatRegister(line.y, 4); + string S = "S=" + formatRegister(line.s, 4); + string U = "U=" + formatRegister(line.u, 4); + string REGS = CC + A + B + X + Y + S + U; + + if (instr._params.Length > 0) + { + Console.WriteLine(REGS + pc.ToString("X4") + ": " + instr.mnemo.PadRight(6) + instr._params); + } + else + { + Console.WriteLine(REGS + pc.ToString("X4") + ": " + instr.mnemo); + } + } + + static void Main(string[] args) + { + try + { + if (args.Length < 1) + { + throw new ArgumentException("USAGE: Tracer []"); + } + + var u06 = File.ReadAllBytes(args[0]); + + var romObject = new RomBinary + { + u06 = u06 + }; + + var metaData = new RomMetaData + { + skipWpcRomCheck = true, + features = new string[] + { + "wpcDcs", + "securityPic", + "wpc95", + }, + }; + + if (args.Length > 1) + { + MAXSTEPS = uint.Parse(args[1]); + } + + var wpcSystem = Emulator.initVMwithRom(romObject, metaData); + + wpcSystem.reset(); + wpcSystem.start(); + + Trace(wpcSystem); + } + + catch(Exception e) + { + Console.WriteLine(e); + } + } + } +} diff --git a/src/WPCEmu.Tracer/WPCEmu.Tracer.csproj b/src/WPCEmu.Tracer/WPCEmu.Tracer.csproj new file mode 100644 index 0000000..7b1138e --- /dev/null +++ b/src/WPCEmu.Tracer/WPCEmu.Tracer.csproj @@ -0,0 +1,9 @@ + + + netcoreapp3.1 + Exe + + + + + diff --git a/src/WPCEmu.sln b/src/WPCEmu.sln index d3c7b4c..97fa06b 100644 --- a/src/WPCEmu.sln +++ b/src/WPCEmu.sln @@ -5,6 +5,10 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WPCEmu", "WPCEmu\WPCEmu.csp EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WPCEmu.Test", "WPCEmu.Test\WPCEmu.Test.csproj", "{F13714E2-9E22-42D2-B35F-F0492AD034C0}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WPCEmu.Example", "WPCEmu.Example\WPCEmu.Example.csproj", "{56A48F0A-F80E-4CBD-86E7-C778EEC8ABDF}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WPCEmu.Tracer", "WPCEmu.Tracer\WPCEmu.Tracer.csproj", "{FB63D325-0B56-4CC1-B1B4-4D7B25994D19}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -19,5 +23,13 @@ Global {F13714E2-9E22-42D2-B35F-F0492AD034C0}.Debug|Any CPU.Build.0 = Debug|Any CPU {F13714E2-9E22-42D2-B35F-F0492AD034C0}.Release|Any CPU.ActiveCfg = Release|Any CPU {F13714E2-9E22-42D2-B35F-F0492AD034C0}.Release|Any CPU.Build.0 = Release|Any CPU + {56A48F0A-F80E-4CBD-86E7-C778EEC8ABDF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {56A48F0A-F80E-4CBD-86E7-C778EEC8ABDF}.Debug|Any CPU.Build.0 = Debug|Any CPU + {56A48F0A-F80E-4CBD-86E7-C778EEC8ABDF}.Release|Any CPU.ActiveCfg = Release|Any CPU + {56A48F0A-F80E-4CBD-86E7-C778EEC8ABDF}.Release|Any CPU.Build.0 = Release|Any CPU + {FB63D325-0B56-4CC1-B1B4-4D7B25994D19}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {FB63D325-0B56-4CC1-B1B4-4D7B25994D19}.Debug|Any CPU.Build.0 = Debug|Any CPU + {FB63D325-0B56-4CC1-B1B4-4D7B25994D19}.Release|Any CPU.ActiveCfg = Release|Any CPU + {FB63D325-0B56-4CC1-B1B4-4D7B25994D19}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection EndGlobal diff --git a/src/WPCEmu/Boards/Asic.cs b/src/WPCEmu/Boards/Asic.cs index 63b2948..fd4f12c 100644 --- a/src/WPCEmu/Boards/Asic.cs +++ b/src/WPCEmu/Boards/Asic.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Linq; using System.Diagnostics; using System.Collections.Generic; @@ -13,9 +13,9 @@ * this file emulates the ASIC CHIP */ -namespace WPCEmu.Boards -{ - public class CpuBoardAsic +namespace WPCEmu.Boards +{ + public class CpuBoardAsic { public static class OP { diff --git a/src/WPCEmu/Boards/CpuBoard.cs b/src/WPCEmu/Boards/CpuBoard.cs index 9bc0069..3426fa6 100644 --- a/src/WPCEmu/Boards/CpuBoard.cs +++ b/src/WPCEmu/Boards/CpuBoard.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Linq; using System.Diagnostics; using WPCEmu.Boards.Elements; @@ -7,8 +7,8 @@ using memoryMapper = WPCEmu.Boards.Mapper.Memory; using hardwareMapper = WPCEmu.Boards.Mapper.Hardware; -namespace WPCEmu.Boards -{ +namespace WPCEmu.Boards +{ public class WpcCpuBoard { public struct InitObject diff --git a/src/WPCEmu/Boards/DisplayBoard.cs b/src/WPCEmu/Boards/DisplayBoard.cs index 87adced..f4ac6a0 100644 --- a/src/WPCEmu/Boards/DisplayBoard.cs +++ b/src/WPCEmu/Boards/DisplayBoard.cs @@ -1,11 +1,11 @@ -using System.Collections.Generic; +using System.Collections.Generic; using System.Diagnostics; using WPCEmu.Boards.Elements; using dmdMapper = WPCEmu.Boards.Mapper.Dmd; -namespace WPCEmu.Boards -{ - public class DisplayBoard +namespace WPCEmu.Boards +{ + public class DisplayBoard { public static class OP { diff --git a/src/WPCEmu/Boards/Elements/Bitmagic.cs b/src/WPCEmu/Boards/Elements/Bitmagic.cs index 2fe6630..f409628 100644 --- a/src/WPCEmu/Boards/Elements/Bitmagic.cs +++ b/src/WPCEmu/Boards/Elements/Bitmagic.cs @@ -1,18 +1,18 @@ -using System; - -namespace WPCEmu.Boards.Elements -{ - public static class Bitmagic - { - public static byte findMsbBit(byte uint8Value) +using System; + +namespace WPCEmu.Boards.Elements +{ + public static class Bitmagic + { + public static byte findMsbBit(byte uint8Value) { int index = Array.IndexOf(new byte[] { 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80 }, uint8Value); return (byte)(index > -1 ? index + 1 : 0); } - public static byte setMsbBit(byte uint8Value = 0) + public static byte setMsbBit(byte uint8Value = 0) { return (uint8Value >= 0 && uint8Value <= 7) ? (new byte[] { 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80 })[uint8Value] : (byte) 0; } } -} +} diff --git a/src/WPCEmu/Boards/Elements/InputSwitchMatrix.cs b/src/WPCEmu/Boards/Elements/InputSwitchMatrix.cs index 74eda0c..c349455 100644 --- a/src/WPCEmu/Boards/Elements/InputSwitchMatrix.cs +++ b/src/WPCEmu/Boards/Elements/InputSwitchMatrix.cs @@ -1,10 +1,10 @@ -using System; -using System.Linq; -using System.Diagnostics; - -namespace WPCEmu.Boards.Elements -{ - public class InputSwitchMatrix +using System; +using System.Linq; +using System.Diagnostics; + +namespace WPCEmu.Boards.Elements +{ + public class InputSwitchMatrix { const byte INPUT_ALWAYS_CLOSED = 24; @@ -23,8 +23,8 @@ public class InputSwitchMatrix public static InputSwitchMatrix getInstance() { return new InputSwitchMatrix(); - } - + } + public InputSwitchMatrix() { // cabinet input keys (ESCAPE/+/-/ENTER) are wired seperatly @@ -151,4 +151,4 @@ void clearInputKeys() switchState = Enumerable.Repeat(ALL_SWITCHES_OFF, MATRIX_COLUMN_SIZE).ToArray(); } } -} +} diff --git a/src/WPCEmu/Boards/Elements/MemoryPatch.cs b/src/WPCEmu/Boards/Elements/MemoryPatch.cs index c424681..f94a352 100644 --- a/src/WPCEmu/Boards/Elements/MemoryPatch.cs +++ b/src/WPCEmu/Boards/Elements/MemoryPatch.cs @@ -1,9 +1,9 @@ -using System.Collections.Generic; +using System.Collections.Generic; using System.Linq; -namespace WPCEmu.Boards.Elements -{ - public class MemoryPatch +namespace WPCEmu.Boards.Elements +{ + public class MemoryPatch { const ushort MEMORY_LIMIT = 0x4000; @@ -12,8 +12,8 @@ public class MemoryPatch public static MemoryPatch getInstance() { return new MemoryPatch(); - } - + } + public MemoryPatch() { patch = new Dictionary(); @@ -71,4 +71,4 @@ public byte[] applyPatchesToExposedMemory(byte[] _ram) return ram; } } -} +} diff --git a/src/WPCEmu/Boards/Elements/MemoryPatchGameId.cs b/src/WPCEmu/Boards/Elements/MemoryPatchGameId.cs index 1b5eff6..f6e27c3 100644 --- a/src/WPCEmu/Boards/Elements/MemoryPatchGameId.cs +++ b/src/WPCEmu/Boards/Elements/MemoryPatchGameId.cs @@ -1,8 +1,8 @@ -using System.Diagnostics; - -namespace WPCEmu.Boards.Elements -{ - public static class MemoryPatchGameId +using System.Diagnostics; + +namespace WPCEmu.Boards.Elements +{ + public static class MemoryPatchGameId { const byte MEDIEVALMADNESS_GAMEID_LO = 20; const byte MEDIEVALMADNESS_GAMEID_HI = 99; @@ -15,4 +15,4 @@ public static MemoryPatch run(MemoryPatch memoryPatch, ushort gameIdMemoryPositi return memoryPatch; } } -} +} diff --git a/src/WPCEmu/Boards/Elements/MemoryPatchSkipBootCheck.cs b/src/WPCEmu/Boards/Elements/MemoryPatchSkipBootCheck.cs index abb92af..58f7f90 100644 --- a/src/WPCEmu/Boards/Elements/MemoryPatchSkipBootCheck.cs +++ b/src/WPCEmu/Boards/Elements/MemoryPatchSkipBootCheck.cs @@ -1,8 +1,8 @@ -using System.Diagnostics; - -namespace WPCEmu.Boards.Elements -{ - public static class MemoryPatchSkipBootCheck +using System.Diagnostics; + +namespace WPCEmu.Boards.Elements +{ + public static class MemoryPatchSkipBootCheck { // Disable ROM checksum check when booting (U6) // NOTE: enabling this will make FreeWPC games crash! @@ -14,4 +14,4 @@ public static MemoryPatch run(MemoryPatch memoryPatch) return memoryPatch; } } -} +} diff --git a/src/WPCEmu/Boards/Elements/MemoryProtection.cs b/src/WPCEmu/Boards/Elements/MemoryProtection.cs index cc8b273..ff75fa6 100644 --- a/src/WPCEmu/Boards/Elements/MemoryProtection.cs +++ b/src/WPCEmu/Boards/Elements/MemoryProtection.cs @@ -1,13 +1,13 @@ -namespace WPCEmu.Boards.Elements -{ - public static class MemoryProtection +namespace WPCEmu.Boards.Elements +{ + public static class MemoryProtection { // calculate memory protection, ripped from pinmame static readonly byte[] SWAP_NIBBLE = { 0, 8, 4, 12, 2, 10, 6, 14, 1, 9, 5, 13, 3, 11, 7, 15 }; - - public static ushort getMemoryProtectionMask(ushort value) + + public static ushort getMemoryProtectionMask(ushort value) { return (ushort) (0xFFFF & (SWAP_NIBBLE[value & 0x0F] + (value & 0xF0) + 0x10) << 8); } } -} +} diff --git a/src/WPCEmu/Boards/Elements/OutputAlphaDisplay.cs b/src/WPCEmu/Boards/Elements/OutputAlphaDisplay.cs index fe94d86..05810c0 100644 --- a/src/WPCEmu/Boards/Elements/OutputAlphaDisplay.cs +++ b/src/WPCEmu/Boards/Elements/OutputAlphaDisplay.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Linq; using System.Diagnostics; using WPCEmu.Boards.Static; @@ -10,9 +10,9 @@ * Williams part # D-12793 */ -namespace WPCEmu.Boards.Elements -{ - public class OutputAlphaDisplay +namespace WPCEmu.Boards.Elements +{ + public class OutputAlphaDisplay { public struct State { diff --git a/src/WPCEmu/Boards/Elements/OutputDmdDisplay.cs b/src/WPCEmu/Boards/Elements/OutputDmdDisplay.cs index 1e36a1f..3193d8b 100644 --- a/src/WPCEmu/Boards/Elements/OutputDmdDisplay.cs +++ b/src/WPCEmu/Boards/Elements/OutputDmdDisplay.cs @@ -1,4 +1,4 @@ -using System.Linq; +using System.Linq; using System.Diagnostics; using WPCEmu.Boards.Static; @@ -31,9 +31,9 @@ from 0x3800-0x39FF. Writes to this register take effect just prior to drawing scanline 0. */ -namespace WPCEmu.Boards.Elements -{ - public class OutputDmdDisplay +namespace WPCEmu.Boards.Elements +{ + public class OutputDmdDisplay { public struct State { diff --git a/src/WPCEmu/Boards/Elements/OutputGeneralIllumination.cs b/src/WPCEmu/Boards/Elements/OutputGeneralIllumination.cs index eed2c97..35a487d 100644 --- a/src/WPCEmu/Boards/Elements/OutputGeneralIllumination.cs +++ b/src/WPCEmu/Boards/Elements/OutputGeneralIllumination.cs @@ -1,9 +1,9 @@ -using System.Linq; +using System.Linq; using System.Diagnostics; -namespace WPCEmu.Boards.Elements -{ - public class OutputGeneralIllumination +namespace WPCEmu.Boards.Elements +{ + public class OutputGeneralIllumination { // general illumination supports up to 5 lamp groups, Coin door enable relay (Bit 5), Flipper enable relay (Bit 7) // TODO: brightness level 7+8 do not work, no IRQ count for those entries diff --git a/src/WPCEmu/Boards/Elements/OutputLampMatrix.cs b/src/WPCEmu/Boards/Elements/OutputLampMatrix.cs index c69a304..89e463a 100644 --- a/src/WPCEmu/Boards/Elements/OutputLampMatrix.cs +++ b/src/WPCEmu/Boards/Elements/OutputLampMatrix.cs @@ -1,9 +1,9 @@ -using System.Linq; +using System.Linq; using System.Diagnostics; -namespace WPCEmu.Boards.Elements -{ - public class OutputLampMatrix +namespace WPCEmu.Boards.Elements +{ + public class OutputLampMatrix { const byte MATRIX_COLUMN_SIZE = 64; const byte ALL_LAMPS_OFF = 0x00; diff --git a/src/WPCEmu/Boards/Elements/OutputSolenoidMatrix.cs b/src/WPCEmu/Boards/Elements/OutputSolenoidMatrix.cs index a39dd55..aa0feb8 100644 --- a/src/WPCEmu/Boards/Elements/OutputSolenoidMatrix.cs +++ b/src/WPCEmu/Boards/Elements/OutputSolenoidMatrix.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Linq; using System.Diagnostics; @@ -23,9 +23,9 @@ like small DC motors. $3FE3 Byte WPC_SOLENOID_LOWPOWER_OUTPUT (7-0: W: Enables for solenoids 9-16) */ -namespace WPCEmu.Boards.Elements -{ - public class OutputSolenoidMatrix +namespace WPCEmu.Boards.Elements +{ + public class OutputSolenoidMatrix { const byte NUMBER_OF_SOLENOIDS = 40; const byte ALL_SOLENOID_OFF = 0x00; diff --git a/src/WPCEmu/Boards/Elements/SoundSerialInterface.cs b/src/WPCEmu/Boards/Elements/SoundSerialInterface.cs index 07164b3..0e7b398 100644 --- a/src/WPCEmu/Boards/Elements/SoundSerialInterface.cs +++ b/src/WPCEmu/Boards/Elements/SoundSerialInterface.cs @@ -1,10 +1,10 @@ -using System; +using System; using System.Diagnostics; using System.Collections.Generic; -namespace WPCEmu.Boards.Elements -{ - public class SoundSerialInterface +namespace WPCEmu.Boards.Elements +{ + public class SoundSerialInterface { const byte SAMPLE_ID_STOP = 0x00; diff --git a/src/WPCEmu/Boards/Elements/SoundVolumeConvert.cs b/src/WPCEmu/Boards/Elements/SoundVolumeConvert.cs index 82d0395..155791b 100644 --- a/src/WPCEmu/Boards/Elements/SoundVolumeConvert.cs +++ b/src/WPCEmu/Boards/Elements/SoundVolumeConvert.cs @@ -1,8 +1,8 @@ -using System.Diagnostics; +using System.Diagnostics; -namespace WPCEmu.Boards.Elements -{ - public static class SoundVolumeConvert +namespace WPCEmu.Boards.Elements +{ + public static class SoundVolumeConvert { /* function to convert 16 bit sound volume to an absolute volume (0..32) @@ -26,8 +26,8 @@ function to convert 16 bit sound volume to an absolute volume (0..32) } return (byte)(volumeLo / 8); //Number.parseInt(volumeLo / 8, 10); - } - + } + public static byte? getRelativeVolumePreDcs(byte volumeLo, byte volumeHi) { byte complementaryVolume = (byte) (~volumeHi & 0xFF); @@ -40,4 +40,4 @@ function to convert 16 bit sound volume to an absolute volume (0..32) return volumeLo; //Number.parseInt(volumeLo, 10); } } -} +} diff --git a/src/WPCEmu/Boards/ExternalIo.cs b/src/WPCEmu/Boards/ExternalIo.cs index 53f1299..4550460 100644 --- a/src/WPCEmu/Boards/ExternalIo.cs +++ b/src/WPCEmu/Boards/ExternalIo.cs @@ -1,9 +1,9 @@ -using System.Diagnostics; +using System.Diagnostics; using System.Linq; -namespace WPCEmu.Boards -{ - public class ExternalIo +namespace WPCEmu.Boards +{ + public class ExternalIo { const byte EXTERNALIO_MEMORY_SIZE = 32; diff --git a/src/WPCEmu/Boards/Mapper/Dmd.cs b/src/WPCEmu/Boards/Mapper/Dmd.cs index 5626573..099e62a 100644 --- a/src/WPCEmu/Boards/Mapper/Dmd.cs +++ b/src/WPCEmu/Boards/Mapper/Dmd.cs @@ -1,8 +1,8 @@ -using System; +using System; -namespace WPCEmu.Boards.Mapper -{ - public static class Dmd +namespace WPCEmu.Boards.Mapper +{ + public static class Dmd { const ushort MEMORY_ADDR_DMD_PAGE3000 = 0x3000; const ushort MEMORY_ADDR_DMD_PAGE3200 = 0x3200; diff --git a/src/WPCEmu/Boards/Mapper/Hardware.cs b/src/WPCEmu/Boards/Mapper/Hardware.cs index 76cdf25..887334c 100644 --- a/src/WPCEmu/Boards/Mapper/Hardware.cs +++ b/src/WPCEmu/Boards/Mapper/Hardware.cs @@ -1,9 +1,9 @@ -using System; +using System; using System.Linq; -namespace WPCEmu.Boards.Mapper -{ - public static class Hardware +namespace WPCEmu.Boards.Mapper +{ + public static class Hardware { const ushort MEMORY_ADDR_EXPANSION_START = 0x3000; const ushort MEMORY_ADDR_DMD = 0x3FC0; @@ -166,4 +166,4 @@ are effectively ignored. >0=Periodic IRQ disabled >1=Periodic IRQ enabled 2: W: Writing a 1 here resets the watchdog. -*/ +*/ diff --git a/src/WPCEmu/Boards/Mapper/Memory.cs b/src/WPCEmu/Boards/Mapper/Memory.cs index 95645ad..99b8603 100644 --- a/src/WPCEmu/Boards/Mapper/Memory.cs +++ b/src/WPCEmu/Boards/Mapper/Memory.cs @@ -1,8 +1,8 @@ -using System; +using System; -namespace WPCEmu.Boards.Mapper -{ - public static class Memory +namespace WPCEmu.Boards.Mapper +{ + public static class Memory { const ushort MEMORY_ADDR_RAM = 0x3000; const ushort MEMORY_ADDR_RAM2_START = 0x3C00; diff --git a/src/WPCEmu/Boards/Memory/Bcd.cs b/src/WPCEmu/Boards/Memory/Bcd.cs index fab5563..76a312d 100644 --- a/src/WPCEmu/Boards/Memory/Bcd.cs +++ b/src/WPCEmu/Boards/Memory/Bcd.cs @@ -1,8 +1,8 @@ -using System.Linq; +using System.Linq; -namespace WPCEmu.Boards.Memory -{ - public static class Bcd +namespace WPCEmu.Boards.Memory +{ + public static class Bcd { // based on https://gist.githubusercontent.com/joaomaia/3892692/raw/cb5eaef7ff9b6103490d4fc29b04cf95c5fde0b1/bcd2number.js @@ -46,4 +46,4 @@ public static byte[] toBCD(long number) return bcd.Take(size).Reverse().ToArray(); } } -} +} diff --git a/src/WPCEmu/Boards/Memory/Checksum.cs b/src/WPCEmu/Boards/Memory/Checksum.cs index 5d7af93..ac22f39 100644 --- a/src/WPCEmu/Boards/Memory/Checksum.cs +++ b/src/WPCEmu/Boards/Memory/Checksum.cs @@ -1,8 +1,8 @@ -using System.Linq; +using System.Linq; -namespace WPCEmu.Boards.Memory -{ - public static class Checksum +namespace WPCEmu.Boards.Memory +{ + public static class Checksum { const ushort INITIAL_VALUE = 0xFFFF; @@ -13,4 +13,4 @@ public static ushort checksum16(byte[] uint8Array) return (ushort) (INITIAL_VALUE - sum); } } -} +} diff --git a/src/WPCEmu/Boards/MemoryHandler.cs b/src/WPCEmu/Boards/MemoryHandler.cs index e7cb580..9b701a3 100644 --- a/src/WPCEmu/Boards/MemoryHandler.cs +++ b/src/WPCEmu/Boards/MemoryHandler.cs @@ -1,9 +1,9 @@ -using System.Linq; +using System.Linq; using System.Diagnostics; using WPCEmu.Boards.Memory; -namespace WPCEmu.Boards -{ +namespace WPCEmu.Boards +{ public class MemoryHandler { /* diff --git a/src/WPCEmu/Boards/SoundBoard.cs b/src/WPCEmu/Boards/SoundBoard.cs index 7724843..7e50960 100644 --- a/src/WPCEmu/Boards/SoundBoard.cs +++ b/src/WPCEmu/Boards/SoundBoard.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Diagnostics; using WPCEmu.Boards.Elements; @@ -9,9 +9,9 @@ * this file emulates the ASIC CHIP */ -namespace WPCEmu.Boards -{ - public class SoundBoard +namespace WPCEmu.Boards +{ + public class SoundBoard { public struct State { diff --git a/src/WPCEmu/Boards/Static/DipSwitchCountry.cs b/src/WPCEmu/Boards/Static/DipSwitchCountry.cs index 269e729..8bfbda0 100644 --- a/src/WPCEmu/Boards/Static/DipSwitchCountry.cs +++ b/src/WPCEmu/Boards/Static/DipSwitchCountry.cs @@ -1,6 +1,6 @@ -namespace WPCEmu.Boards.Static -{ - public static class DipSwitchCountry +namespace WPCEmu.Boards.Static +{ + public static class DipSwitchCountry { /* define w15 - w18 diff --git a/src/WPCEmu/Boards/Static/Timing.cs b/src/WPCEmu/Boards/Static/Timing.cs index cffe164..cff4474 100644 --- a/src/WPCEmu/Boards/Static/Timing.cs +++ b/src/WPCEmu/Boards/Static/Timing.cs @@ -1,6 +1,6 @@ -namespace WPCEmu.Boards.Static -{ - public static class Timing +namespace WPCEmu.Boards.Static +{ + public static class Timing { /* Timing SOURCE: freewpc/build/sched_irq.c diff --git a/src/WPCEmu/Boards/Ui.cs b/src/WPCEmu/Boards/Ui.cs index 7a1a010..84429d3 100644 --- a/src/WPCEmu/Boards/Ui.cs +++ b/src/WPCEmu/Boards/Ui.cs @@ -1,12 +1,12 @@ -using System; +using System; using System.Text; using System.Linq; using WPCEmu.Boards.Elements; using WPCEmu.Boards.Memory; -namespace WPCEmu.Boards -{ - public class UiState +namespace WPCEmu.Boards +{ + public class UiState { public struct State { diff --git a/src/WPCEmu/Boards/Up/Cpu6809.cs b/src/WPCEmu/Boards/Up/Cpu6809.cs index bad32d3..4daacc8 100644 --- a/src/WPCEmu/Boards/Up/Cpu6809.cs +++ b/src/WPCEmu/Boards/Up/Cpu6809.cs @@ -1,4 +1,4 @@ -/* +/* seems to be based on 6809.c by Larry Bank TODO, see https://groups.google.com/forum/#!msg/comp.sys.m6809/ct2V1nGIy2c/4xfP-qI91TIJ @@ -48,14 +48,14 @@ FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ - -using System; -using System.Diagnostics; - -namespace WPCEmu.Boards.Up -{ - public class Cpu6809 +*/ + +using System; +using System.Diagnostics; + +namespace WPCEmu.Boards.Up +{ + public class Cpu6809 { public struct State { @@ -74,8 +74,8 @@ public struct State public int firqCount; public int nmiCount; public int tickCount; - } - + } + const byte F_CARRY = 1; const byte F_OVERFLOW = 2; const byte F_ZERO = 4; @@ -83,8 +83,8 @@ public struct State const byte F_IRQMASK = 16; const byte F_HALFCARRY = 32; const byte F_FIRQMASK = 64; - const byte F_ENTIRE = 128; - + const byte F_ENTIRE = 128; + const ushort vecRESET = 0xFFFE; const ushort vecFIRQ = 0xFFF6; const ushort vecIRQ = 0xFFF8; @@ -180,8 +180,8 @@ public struct State public static Cpu6809 getInstance(Action memoryWriteFunction, Func memoryReadFunction) { return new Cpu6809(memoryWriteFunction, memoryReadFunction); - } - + } + public Cpu6809(Action memoryWriteFunction, Func memoryReadFunction) { Debug.Print("INITIALIZE CPU"); @@ -1290,7 +1290,7 @@ public int step() break; case 0x22: //BHI saddr = signed(fetch()); - if ((regCC & (F_CARRY | F_ZERO)) == 0) + if (!((regCC & (F_CARRY | F_ZERO)) != 0)) { regPC = (ushort)(regPC + saddr); } @@ -1304,7 +1304,7 @@ public int step() break; case 0x24: //BCC saddr = signed(fetch()); - if ((regCC & F_CARRY) == 0) + if (!((regCC & F_CARRY) != 0)) { regPC = (ushort)(regPC + saddr); } @@ -1318,7 +1318,7 @@ public int step() break; case 0x26: //BNE saddr = signed(fetch()); - if ((regCC & F_ZERO) == 0) + if (!((regCC & F_ZERO) != 0)) { regPC = (ushort)(regPC + saddr); } @@ -1332,7 +1332,7 @@ public int step() break; case 0x28: //BVC saddr = signed(fetch()); - if ((regCC & F_OVERFLOW) == 0) + if (!((regCC & F_OVERFLOW) != 0)) { regPC = (ushort)(regPC + saddr); } @@ -1346,7 +1346,7 @@ public int step() break; case 0x2a: //BPL saddr = signed(fetch()); - if ((regCC & F_NEGATIVE) == 0) + if (!((regCC & F_NEGATIVE) != 0)) { regPC = (ushort)(regPC + saddr); } @@ -1360,7 +1360,7 @@ public int step() break; case 0x2c: //BGE saddr = signed(fetch()); - if (((regCC & F_NEGATIVE) ^ ((regCC & F_OVERFLOW) << 2)) == 0) + if (!(((regCC & F_NEGATIVE) ^ ((regCC & F_OVERFLOW) << 2)) != 0)) { regPC = (ushort)(regPC + saddr); } @@ -1375,8 +1375,8 @@ public int step() case 0x2e: //BGT saddr = signed(fetch()); if ( - (((regCC & F_NEGATIVE) ^ ((regCC & F_OVERFLOW) << 2)) == 0) || - ((regCC & F_ZERO) != 0) + !((((regCC & F_NEGATIVE) ^ ((regCC & F_OVERFLOW) << 2)) != 0) || + ((regCC & F_ZERO) != 0)) ) { regPC = (ushort)(regPC + saddr); diff --git a/src/WPCEmu/Boards/Up/SecurityPic.cs b/src/WPCEmu/Boards/Up/SecurityPic.cs index 85eab38..1ac9674 100644 --- a/src/WPCEmu/Boards/Up/SecurityPic.cs +++ b/src/WPCEmu/Boards/Up/SecurityPic.cs @@ -1,11 +1,11 @@ -using System; -using System.Linq; -using System.Diagnostics; - -namespace WPCEmu.Boards.Up -{ - public class SecurityPic - { +using System; +using System.Linq; +using System.Diagnostics; + +namespace WPCEmu.Boards.Up +{ + public class SecurityPic + { const int PIC_SERIAL_SIZE = 16; const byte WPC_PIC_RESET = 0x00; const byte WPC_PIC_COUNTER = 0x0D; @@ -16,23 +16,23 @@ public class SecurityPic // 123456: Serial number (it's that is registered on the labels) // 12345: Serial number n°2 (this number has no known utility) // 123: Unlock key of the matrix's contacts key (ALWAYS at the value of 123, it is used to generate the corresponding unlock code) - const int MEDIEVAL_MADNESS_GAME_ID = 559; - + const int MEDIEVAL_MADNESS_GAME_ID = 559; + const string GAME_SERIAL_SUFFIX = " 123456 12345 123"; - - byte[] unlockCode; - int unlockCodeCounter; - byte[] picSerialNumber; - public byte serialNumberScrambler; - public byte[] originalPicSerialNumber; + + byte[] unlockCode; + int unlockCodeCounter; + byte[] picSerialNumber; + public byte serialNumberScrambler; + public byte[] originalPicSerialNumber; public byte lastByteWrite; - byte writesUntilUnlockNeeded; - + byte writesUntilUnlockNeeded; + public static SecurityPic getInstance(int machineNumber = MEDIEVAL_MADNESS_GAME_ID) { return new SecurityPic(machineNumber); - } - + } + public SecurityPic(int machineNumber = MEDIEVAL_MADNESS_GAME_ID) { string gameSerialNumber = machineNumber + GAME_SERIAL_SUFFIX; @@ -181,6 +181,6 @@ public void write(byte data) public byte getScrambler() { return serialNumberScrambler; - } - } -} + } + } +} diff --git a/src/WPCEmu/Db/AFM.cs b/src/WPCEmu/Db/AFM.cs index e4205ac..5bf7b75 100644 --- a/src/WPCEmu/Db/AFM.cs +++ b/src/WPCEmu/Db/AFM.cs @@ -1,7 +1,7 @@ -using WPCEmu.Boards; +using WPCEmu.Boards; -namespace WPCEmu.Db -{ +namespace WPCEmu.Db +{ public class AttackFromMars : IDb { public string name => "WPC-95: Attack from Mars"; diff --git a/src/WPCEmu/Db/AFMFreeWPC.cs b/src/WPCEmu/Db/AFMFreeWPC.cs index d218c6d..562c26a 100644 --- a/src/WPCEmu/Db/AFMFreeWPC.cs +++ b/src/WPCEmu/Db/AFMFreeWPC.cs @@ -1,7 +1,7 @@ -using WPCEmu.Boards; +using WPCEmu.Boards; -namespace WPCEmu.Db -{ +namespace WPCEmu.Db +{ public class AttackFromMarsFreewpc : IDb { public string name => "WPC-95: Attack from Mars (FreeWPC)"; diff --git a/src/WPCEmu/Db/AFV.cs b/src/WPCEmu/Db/AFV.cs index 281aa0d..e510538 100644 --- a/src/WPCEmu/Db/AFV.cs +++ b/src/WPCEmu/Db/AFV.cs @@ -1,7 +1,7 @@ -using WPCEmu.Boards; +using WPCEmu.Boards; -namespace WPCEmu.Db -{ +namespace WPCEmu.Db +{ public class AddamsFamilyValues : IDb { public string name => "WPC-DCS: Addams Family Values (Redemption game)"; diff --git a/src/WPCEmu/Db/Addams.cs b/src/WPCEmu/Db/Addams.cs index 9a578ed..59bbaf3 100644 --- a/src/WPCEmu/Db/Addams.cs +++ b/src/WPCEmu/Db/Addams.cs @@ -1,7 +1,7 @@ -using WPCEmu.Boards; +using WPCEmu.Boards; -namespace WPCEmu.Db -{ +namespace WPCEmu.Db +{ public class TheAddamsFamilySpecial : IDb { public string name => "WPC-Fliptronics: The Addams Family Special Collectors Edition"; diff --git a/src/WPCEmu/Db/BR.cs b/src/WPCEmu/Db/BR.cs index 424926a..870d86b 100644 --- a/src/WPCEmu/Db/BR.cs +++ b/src/WPCEmu/Db/BR.cs @@ -1,7 +1,7 @@ -using WPCEmu.Boards; +using WPCEmu.Boards; -namespace WPCEmu.Db -{ +namespace WPCEmu.Db +{ public class BlackRose : IDb { public string name => "WPC-Fliptronics: Black Rose"; diff --git a/src/WPCEmu/Db/BSD.cs b/src/WPCEmu/Db/BSD.cs index 21be628..34fceaa 100644 --- a/src/WPCEmu/Db/BSD.cs +++ b/src/WPCEmu/Db/BSD.cs @@ -1,7 +1,7 @@ -using WPCEmu.Boards; +using WPCEmu.Boards; -namespace WPCEmu.Db -{ +namespace WPCEmu.Db +{ public class BramStokersDracula : IDb { public string name => "WPC-Fliptronics: Bram Stoker's Dracula"; diff --git a/src/WPCEmu/Db/CC.cs b/src/WPCEmu/Db/CC.cs index bc2d2f3..1aa87f8 100644 --- a/src/WPCEmu/Db/CC.cs +++ b/src/WPCEmu/Db/CC.cs @@ -1,5 +1,5 @@ -namespace WPCEmu.Db -{ +namespace WPCEmu.Db +{ public class CactusCanyon : IDb { public string name => "WPC-95: Cactus Canyon"; diff --git a/src/WPCEmu/Db/CFTBL.cs b/src/WPCEmu/Db/CFTBL.cs index d9b85de..af76540 100644 --- a/src/WPCEmu/Db/CFTBL.cs +++ b/src/WPCEmu/Db/CFTBL.cs @@ -1,5 +1,5 @@ -namespace WPCEmu.Db -{ +namespace WPCEmu.Db +{ public class CreatureFromTheBlackLagoon : IDb { public string name => "WPC-Fliptronics: Creature from the Black Lagoon"; diff --git a/src/WPCEmu/Db/CV.cs b/src/WPCEmu/Db/CV.cs index b850207..eed1236 100644 --- a/src/WPCEmu/Db/CV.cs +++ b/src/WPCEmu/Db/CV.cs @@ -1,5 +1,5 @@ -namespace WPCEmu.Db -{ +namespace WPCEmu.Db +{ public class CirqusVoltaire : IDb { public string name => "WPC-95: Cirqus Voltaire"; diff --git a/src/WPCEmu/Db/Congo.cs b/src/WPCEmu/Db/Congo.cs index 3314e6f..fae7087 100644 --- a/src/WPCEmu/Db/Congo.cs +++ b/src/WPCEmu/Db/Congo.cs @@ -1,5 +1,5 @@ -namespace WPCEmu.Db -{ +namespace WPCEmu.Db +{ public class Congo : IDb { public string name => "WPC-95: Congo"; diff --git a/src/WPCEmu/Db/Corv.cs b/src/WPCEmu/Db/Corv.cs index 47bc367..6a853d3 100644 --- a/src/WPCEmu/Db/Corv.cs +++ b/src/WPCEmu/Db/Corv.cs @@ -1,5 +1,5 @@ -namespace WPCEmu.Db -{ +namespace WPCEmu.Db +{ public class Corvette : IDb { public string name => "WPC-S: Corvette"; diff --git a/src/WPCEmu/Db/CorvFreeWPC.cs b/src/WPCEmu/Db/CorvFreeWPC.cs index 0b6995c..4a80908 100644 --- a/src/WPCEmu/Db/CorvFreeWPC.cs +++ b/src/WPCEmu/Db/CorvFreeWPC.cs @@ -1,5 +1,5 @@ -namespace WPCEmu.Db -{ +namespace WPCEmu.Db +{ public class CorvetteFreewpc : IDb { public string name => "WPC-S: Corvette (FreeWPC)"; diff --git a/src/WPCEmu/Db/DH.cs b/src/WPCEmu/Db/DH.cs index 5d37633..250383e 100644 --- a/src/WPCEmu/Db/DH.cs +++ b/src/WPCEmu/Db/DH.cs @@ -1,5 +1,5 @@ -namespace WPCEmu.Db -{ +namespace WPCEmu.Db +{ public class DirtyHarry : IDb { public string name => "WPC-S: Dirty Harry"; diff --git a/src/WPCEmu/Db/DM.cs b/src/WPCEmu/Db/DM.cs index 81292ec..bbab390 100644 --- a/src/WPCEmu/Db/DM.cs +++ b/src/WPCEmu/Db/DM.cs @@ -1,5 +1,5 @@ -namespace WPCEmu.Db -{ +namespace WPCEmu.Db +{ public class DemolitionMan : IDb { public string name => "WPC-DCS: Demolition Man"; diff --git a/src/WPCEmu/Db/DMFreeWPC.cs b/src/WPCEmu/Db/DMFreeWPC.cs index f05c7b0..7026250 100644 --- a/src/WPCEmu/Db/DMFreeWPC.cs +++ b/src/WPCEmu/Db/DMFreeWPC.cs @@ -1,5 +1,5 @@ -namespace WPCEmu.Db -{ +namespace WPCEmu.Db +{ public class DemolitionManFreewpc : IDb { public string name => "WPC-DCS: Demolition Man (FreeWPC)"; diff --git a/src/WPCEmu/Db/DW.cs b/src/WPCEmu/Db/DW.cs index 1d59f57..ae94c83 100644 --- a/src/WPCEmu/Db/DW.cs +++ b/src/WPCEmu/Db/DW.cs @@ -1,5 +1,5 @@ -namespace WPCEmu.Db -{ +namespace WPCEmu.Db +{ public class DrWho : IDb { public string name => "WPC-Fliptronics: Dr. Who"; diff --git a/src/WPCEmu/Db/DrDude.cs b/src/WPCEmu/Db/DrDude.cs index dfeeebc..96f9efc 100644 --- a/src/WPCEmu/Db/DrDude.cs +++ b/src/WPCEmu/Db/DrDude.cs @@ -1,5 +1,5 @@ -namespace WPCEmu.Db -{ +namespace WPCEmu.Db +{ public class DrDude : IDb { public string name => "WPC-ALPHA: Dr. Dude"; diff --git a/src/WPCEmu/Db/FH.cs b/src/WPCEmu/Db/FH.cs index 95b2bbf..657f07c 100644 --- a/src/WPCEmu/Db/FH.cs +++ b/src/WPCEmu/Db/FH.cs @@ -1,5 +1,5 @@ -namespace WPCEmu.Db -{ +namespace WPCEmu.Db +{ public class Funhouse : IDb { public string name => "WPC-ALPHA: Funhouse"; diff --git a/src/WPCEmu/Db/FHFreeWPC.cs b/src/WPCEmu/Db/FHFreeWPC.cs index fd8ef94..038d8b2 100644 --- a/src/WPCEmu/Db/FHFreeWPC.cs +++ b/src/WPCEmu/Db/FHFreeWPC.cs @@ -1,5 +1,5 @@ -namespace WPCEmu.Db -{ +namespace WPCEmu.Db +{ public class FunhouseFreeWpc : IDb { public string name => "WPC-ALPHA: Funhouse (FreeWPC)"; diff --git a/src/WPCEmu/Db/FishTails.cs b/src/WPCEmu/Db/FishTails.cs index 1b0565e..9843584 100644 --- a/src/WPCEmu/Db/FishTails.cs +++ b/src/WPCEmu/Db/FishTails.cs @@ -1,5 +1,5 @@ -namespace WPCEmu.Db -{ +namespace WPCEmu.Db +{ public class FishTales : IDb { public string name => "WPC-Fliptronics: Fish Tales"; diff --git a/src/WPCEmu/Db/Flintstones.cs b/src/WPCEmu/Db/Flintstones.cs index cd2eea0..aef7f78 100644 --- a/src/WPCEmu/Db/Flintstones.cs +++ b/src/WPCEmu/Db/Flintstones.cs @@ -1,5 +1,5 @@ -namespace WPCEmu.Db -{ +namespace WPCEmu.Db +{ public class TheFlintstones : IDb { public string name => "WPC-S: The Flintstones"; diff --git a/src/WPCEmu/Db/Gamelist.cs b/src/WPCEmu/Db/Gamelist.cs index 2d7981f..e25ddf1 100644 --- a/src/WPCEmu/Db/Gamelist.cs +++ b/src/WPCEmu/Db/Gamelist.cs @@ -1,9 +1,9 @@ -using System; +using System; using System.Linq; -namespace WPCEmu.Db -{ - public static class Gamelist +namespace WPCEmu.Db +{ + public static class Gamelist { static IDb[] wpcGames = { diff --git a/src/WPCEmu/Db/Gilligan.cs b/src/WPCEmu/Db/Gilligan.cs index 8f2cb06..fe5e9f1 100644 --- a/src/WPCEmu/Db/Gilligan.cs +++ b/src/WPCEmu/Db/Gilligan.cs @@ -1,5 +1,5 @@ -namespace WPCEmu.Db -{ +namespace WPCEmu.Db +{ public class GilligansIsland : IDb { public string name => "WPC-DMD: Gilligan's Island"; diff --git a/src/WPCEmu/Db/Harly.cs b/src/WPCEmu/Db/Harly.cs index 984786b..3c7e49d 100644 --- a/src/WPCEmu/Db/Harly.cs +++ b/src/WPCEmu/Db/Harly.cs @@ -1,5 +1,5 @@ -namespace WPCEmu.Db -{ +namespace WPCEmu.Db +{ public class Harly : IDb { public string name => "WPC-ALPHA: Harley Davidson"; diff --git a/src/WPCEmu/Db/HighSpeed2.cs b/src/WPCEmu/Db/HighSpeed2.cs index 4bd97a2..e9c90f9 100644 --- a/src/WPCEmu/Db/HighSpeed2.cs +++ b/src/WPCEmu/Db/HighSpeed2.cs @@ -1,5 +1,5 @@ -namespace WPCEmu.Db -{ +namespace WPCEmu.Db +{ public class HighSpeed2TheGetaway : IDb { public string name => "WPC-Fliptronics: High Speed II, The Getaway"; diff --git a/src/WPCEmu/Db/HotShot.cs b/src/WPCEmu/Db/HotShot.cs index 92013d6..8a16cf4 100644 --- a/src/WPCEmu/Db/HotShot.cs +++ b/src/WPCEmu/Db/HotShot.cs @@ -1,5 +1,5 @@ -namespace WPCEmu.Db -{ +namespace WPCEmu.Db +{ public class HotShotBasketball : IDb { public string name => "WPC-DMD: Hot Shot Basketball (Redemption game)"; diff --git a/src/WPCEmu/Db/Hurricane.cs b/src/WPCEmu/Db/Hurricane.cs index 05b4c4f..8d577cb 100644 --- a/src/WPCEmu/Db/Hurricane.cs +++ b/src/WPCEmu/Db/Hurricane.cs @@ -1,5 +1,5 @@ -namespace WPCEmu.Db -{ +namespace WPCEmu.Db +{ public class Hurricane : IDb { public string name => "WPC-DMD: Hurricane"; diff --git a/src/WPCEmu/Db/I500.cs b/src/WPCEmu/Db/I500.cs index d4440db..e28ef04 100644 --- a/src/WPCEmu/Db/I500.cs +++ b/src/WPCEmu/Db/I500.cs @@ -1,5 +1,5 @@ -namespace WPCEmu.Db -{ +namespace WPCEmu.Db +{ public class Indianapolis500 : IDb { public string name => "WPC-S: Indianapolis 500"; diff --git a/src/WPCEmu/Db/IDb.cs b/src/WPCEmu/Db/IDb.cs index 5cedc60..3120216 100644 --- a/src/WPCEmu/Db/IDb.cs +++ b/src/WPCEmu/Db/IDb.cs @@ -1,6 +1,6 @@ -namespace WPCEmu.Db +namespace WPCEmu.Db { - public interface IDb + public interface IDb { string name { get; } string version { get; } diff --git a/src/WPCEmu/Db/IndianaJones.cs b/src/WPCEmu/Db/IndianaJones.cs index 7affb1f..6c929a3 100644 --- a/src/WPCEmu/Db/IndianaJones.cs +++ b/src/WPCEmu/Db/IndianaJones.cs @@ -1,7 +1,7 @@ -using WPCEmu.Boards; +using WPCEmu.Boards; -namespace WPCEmu.Db -{ +namespace WPCEmu.Db +{ public class IndianaJonesThePinballAdventure : IDb { public string name => "WPC-DCS: Indiana Jones, The Pinball Adventure"; diff --git a/src/WPCEmu/Db/JB.cs b/src/WPCEmu/Db/JB.cs index 7c84d99..f34903a 100644 --- a/src/WPCEmu/Db/JB.cs +++ b/src/WPCEmu/Db/JB.cs @@ -1,5 +1,5 @@ -namespace WPCEmu.Db -{ +namespace WPCEmu.Db +{ public class JackBot : IDb { public string name => "WPC-S: Jack·Bot"; diff --git a/src/WPCEmu/Db/JD.cs b/src/WPCEmu/Db/JD.cs index a052795..e09783d 100644 --- a/src/WPCEmu/Db/JD.cs +++ b/src/WPCEmu/Db/JD.cs @@ -1,5 +1,5 @@ -namespace WPCEmu.Db -{ +namespace WPCEmu.Db +{ public class JudgeDredd : IDb { public string name => "WPC-DCS: Judge Dredd"; diff --git a/src/WPCEmu/Db/JM.cs b/src/WPCEmu/Db/JM.cs index 1b724ed..b7b049b 100644 --- a/src/WPCEmu/Db/JM.cs +++ b/src/WPCEmu/Db/JM.cs @@ -1,5 +1,5 @@ -namespace WPCEmu.Db -{ +namespace WPCEmu.Db +{ public class JohnnyMnemonic : IDb { public string name => "WPC-S: Johnny Mnemonic"; diff --git a/src/WPCEmu/Db/JY.cs b/src/WPCEmu/Db/JY.cs index b24d53f..c26aaa4 100644 --- a/src/WPCEmu/Db/JY.cs +++ b/src/WPCEmu/Db/JY.cs @@ -1,5 +1,5 @@ -namespace WPCEmu.Db -{ +namespace WPCEmu.Db +{ public class JunkYard : IDb { public string name => "WPC-95: Junk Yard"; diff --git a/src/WPCEmu/Db/LC.cs b/src/WPCEmu/Db/LC.cs index c89fa4c..3ceb828 100644 --- a/src/WPCEmu/Db/LC.cs +++ b/src/WPCEmu/Db/LC.cs @@ -1,5 +1,5 @@ -namespace WPCEmu.Db -{ +namespace WPCEmu.Db +{ public class LeagueChamp : IDb { public string name => "WPC-95: League Champ Shuffle Alley (Redemption game)"; diff --git a/src/WPCEmu/Db/MB.cs b/src/WPCEmu/Db/MB.cs index fca740b..3f194aa 100644 --- a/src/WPCEmu/Db/MB.cs +++ b/src/WPCEmu/Db/MB.cs @@ -1,5 +1,5 @@ -namespace WPCEmu.Db -{ +namespace WPCEmu.Db +{ public class MonsterBash : IDb { public string name => "WPC-95: Monster Bash"; diff --git a/src/WPCEmu/Db/MM.cs b/src/WPCEmu/Db/MM.cs index 9653f7e..fea8d73 100644 --- a/src/WPCEmu/Db/MM.cs +++ b/src/WPCEmu/Db/MM.cs @@ -1,7 +1,7 @@ -using WPCEmu.Boards; +using WPCEmu.Boards; -namespace WPCEmu.Db -{ +namespace WPCEmu.Db +{ public class MedievalMadness : IDb { public string name => "WPC-95: Medieval Madness"; diff --git a/src/WPCEmu/Db/NBA.cs b/src/WPCEmu/Db/NBA.cs index 67fa01c..195290e 100644 --- a/src/WPCEmu/Db/NBA.cs +++ b/src/WPCEmu/Db/NBA.cs @@ -1,5 +1,5 @@ -namespace WPCEmu.Db -{ +namespace WPCEmu.Db +{ public class NBAFastbreak : IDb { public string name => "WPC-95: NBA Fastbreak"; diff --git a/src/WPCEmu/Db/NGG.cs b/src/WPCEmu/Db/NGG.cs index c0610d2..a76498a 100644 --- a/src/WPCEmu/Db/NGG.cs +++ b/src/WPCEmu/Db/NGG.cs @@ -1,5 +1,5 @@ -namespace WPCEmu.Db -{ +namespace WPCEmu.Db +{ public class NoGoodGofers : IDb { public string name => "WPC-95: No Good Gofers"; diff --git a/src/WPCEmu/Db/NoFear.cs b/src/WPCEmu/Db/NoFear.cs index 07b7d85..31494be 100644 --- a/src/WPCEmu/Db/NoFear.cs +++ b/src/WPCEmu/Db/NoFear.cs @@ -1,5 +1,5 @@ -namespace WPCEmu.Db -{ +namespace WPCEmu.Db +{ public class NoFear : IDb { public string name => "WPC-S: No Fear"; diff --git a/src/WPCEmu/Db/PSTE.cs b/src/WPCEmu/Db/PSTE.cs index dd45e00..5fb2bee 100644 --- a/src/WPCEmu/Db/PSTE.cs +++ b/src/WPCEmu/Db/PSTE.cs @@ -1,5 +1,5 @@ -namespace WPCEmu.Db -{ +namespace WPCEmu.Db +{ public class PopeyeSavesTheEarth : IDb { public string name => "WPC-DCS: Popeye Saves the Earth"; diff --git a/src/WPCEmu/Db/RTRS.cs b/src/WPCEmu/Db/RTRS.cs index 33a8798..148111b 100644 --- a/src/WPCEmu/Db/RTRS.cs +++ b/src/WPCEmu/Db/RTRS.cs @@ -1,5 +1,5 @@ -namespace WPCEmu.Db -{ +namespace WPCEmu.Db +{ public class RedTedsRoadShow : IDb { public string name => "WPC-S: Red & Ted's Road Show"; diff --git a/src/WPCEmu/Db/SC.cs b/src/WPCEmu/Db/SC.cs index cb68f0a..1742d6d 100644 --- a/src/WPCEmu/Db/SC.cs +++ b/src/WPCEmu/Db/SC.cs @@ -1,5 +1,5 @@ -namespace WPCEmu.Db -{ +namespace WPCEmu.Db +{ public class SafeCracker : IDb { public string name => "WPC-95: Safe Cracker"; diff --git a/src/WPCEmu/Db/SF.cs b/src/WPCEmu/Db/SF.cs index 4875ee0..8ac1573 100644 --- a/src/WPCEmu/Db/SF.cs +++ b/src/WPCEmu/Db/SF.cs @@ -1,5 +1,5 @@ -namespace WPCEmu.Db -{ +namespace WPCEmu.Db +{ public class SlugFest : IDb { public string name => "WPC-DMD: SlugFest (Redemption game)"; diff --git a/src/WPCEmu/Db/SM.cs b/src/WPCEmu/Db/SM.cs index de19c41..ff42b10 100644 --- a/src/WPCEmu/Db/SM.cs +++ b/src/WPCEmu/Db/SM.cs @@ -1,5 +1,5 @@ -namespace WPCEmu.Db -{ +namespace WPCEmu.Db +{ public class StrikeMaster : IDb { public string name => "WPC-DMD: Strike Master Shuffle Alley (Redemption game)"; diff --git a/src/WPCEmu/Db/SS.cs b/src/WPCEmu/Db/SS.cs index 7214e76..7496126 100644 --- a/src/WPCEmu/Db/SS.cs +++ b/src/WPCEmu/Db/SS.cs @@ -1,5 +1,5 @@ -namespace WPCEmu.Db -{ +namespace WPCEmu.Db +{ public class ScaredStiff : IDb { public string name => "WPC-95: Scared Stiff"; diff --git a/src/WPCEmu/Db/STTNG.cs b/src/WPCEmu/Db/STTNG.cs index 4f4d732..04ec2c0 100644 --- a/src/WPCEmu/Db/STTNG.cs +++ b/src/WPCEmu/Db/STTNG.cs @@ -1,5 +1,5 @@ -namespace WPCEmu.Db -{ +namespace WPCEmu.Db +{ public class StarTrekTheNextGeneration : IDb { public string name => "WPC-DCS: Star Trek, The Next Generation"; diff --git a/src/WPCEmu/Db/T2.cs b/src/WPCEmu/Db/T2.cs index a1367b6..5f9badb 100644 --- a/src/WPCEmu/Db/T2.cs +++ b/src/WPCEmu/Db/T2.cs @@ -1,7 +1,7 @@ -using WPCEmu.Boards; +using WPCEmu.Boards; -namespace WPCEmu.Db -{ +namespace WPCEmu.Db +{ public class Terminator2 : IDb { public string name => "WPC-DMD: Terminator 2"; diff --git a/src/WPCEmu/Db/T2FreeWPC.cs b/src/WPCEmu/Db/T2FreeWPC.cs index 039a859..5f5b3cc 100644 --- a/src/WPCEmu/Db/T2FreeWPC.cs +++ b/src/WPCEmu/Db/T2FreeWPC.cs @@ -1,5 +1,5 @@ -namespace WPCEmu.Db -{ +namespace WPCEmu.Db +{ public class Terminator2Freewpc : IDb { public string name => "WPC-DMD: Terminator 2 (FreeWPC)"; diff --git a/src/WPCEmu/Db/TAF.cs b/src/WPCEmu/Db/TAF.cs index bcdc52b..2d9a315 100644 --- a/src/WPCEmu/Db/TAF.cs +++ b/src/WPCEmu/Db/TAF.cs @@ -1,7 +1,7 @@ -using WPCEmu.Boards; +using WPCEmu.Boards; -namespace WPCEmu.Db -{ +namespace WPCEmu.Db +{ public class AddamsFamily : IDb { public string name => "WPC-Fliptronics: The Addams Family"; diff --git a/src/WPCEmu/Db/TCP.cs b/src/WPCEmu/Db/TCP.cs index 580190f..f241039 100644 --- a/src/WPCEmu/Db/TCP.cs +++ b/src/WPCEmu/Db/TCP.cs @@ -1,5 +1,5 @@ -namespace WPCEmu.Db -{ +namespace WPCEmu.Db +{ public class TheChampionPub : IDb { public string name => "WPC-95: The Champion Pub"; diff --git a/src/WPCEmu/Db/TMBOP.cs b/src/WPCEmu/Db/TMBOP.cs index 029f764..842dd10 100644 --- a/src/WPCEmu/Db/TMBOP.cs +++ b/src/WPCEmu/Db/TMBOP.cs @@ -1,5 +1,5 @@ -namespace WPCEmu.Db -{ +namespace WPCEmu.Db +{ public class TheMachineBrideOfPinbot : IDb { public string name => "WPC-ALPHA: The Machine: Bride of Pin·bot"; diff --git a/src/WPCEmu/Db/TOM.cs b/src/WPCEmu/Db/TOM.cs index 9fb5c54..19d8061 100644 --- a/src/WPCEmu/Db/TOM.cs +++ b/src/WPCEmu/Db/TOM.cs @@ -1,5 +1,5 @@ -namespace WPCEmu.Db -{ +namespace WPCEmu.Db +{ public class TheatreOfMagic : IDb { public string name => "WPC-S: Theatre of Magic"; diff --git a/src/WPCEmu/Db/TOTAN.cs b/src/WPCEmu/Db/TOTAN.cs index 28bda14..3df578b 100644 --- a/src/WPCEmu/Db/TOTAN.cs +++ b/src/WPCEmu/Db/TOTAN.cs @@ -1,5 +1,5 @@ -namespace WPCEmu.Db -{ +namespace WPCEmu.Db +{ public class TalesOfTheArabianNights : IDb { public string name => "WPC-95: Tales of the Arabian Nights"; diff --git a/src/WPCEmu/Db/TPZ.cs b/src/WPCEmu/Db/TPZ.cs index 23a2221..71d11ec 100644 --- a/src/WPCEmu/Db/TPZ.cs +++ b/src/WPCEmu/Db/TPZ.cs @@ -1,5 +1,5 @@ -namespace WPCEmu.Db -{ +namespace WPCEmu.Db +{ public class ThePartyZone : IDb { public string name => "WPC-DMD: The Party Zone"; diff --git a/src/WPCEmu/Db/TS.cs b/src/WPCEmu/Db/TS.cs index a3fecdb..8ad4936 100644 --- a/src/WPCEmu/Db/TS.cs +++ b/src/WPCEmu/Db/TS.cs @@ -1,5 +1,5 @@ -namespace WPCEmu.Db -{ +namespace WPCEmu.Db +{ public class TheShadow : IDb { public string name => "WPC-S: The Shadow"; diff --git a/src/WPCEmu/Db/TTT.cs b/src/WPCEmu/Db/TTT.cs index 2a011e8..6d5ecac 100644 --- a/src/WPCEmu/Db/TTT.cs +++ b/src/WPCEmu/Db/TTT.cs @@ -1,5 +1,5 @@ -namespace WPCEmu.Db -{ +namespace WPCEmu.Db +{ public class TicketTacToe : IDb { public string name => "WPC-95: Ticket Tac Toe (Redemption game)"; diff --git a/src/WPCEmu/Db/TZ.cs b/src/WPCEmu/Db/TZ.cs index 8279170..dbaf0bb 100644 --- a/src/WPCEmu/Db/TZ.cs +++ b/src/WPCEmu/Db/TZ.cs @@ -1,5 +1,5 @@ -namespace WPCEmu.Db -{ +namespace WPCEmu.Db +{ public class TwilightZone : IDb { public string name => "WPC-Fliptronics: Twilight Zone"; diff --git a/src/WPCEmu/Db/TZFreeWPC.cs b/src/WPCEmu/Db/TZFreeWPC.cs index ccd25dc..817af81 100644 --- a/src/WPCEmu/Db/TZFreeWPC.cs +++ b/src/WPCEmu/Db/TZFreeWPC.cs @@ -1,5 +1,5 @@ -namespace WPCEmu.Db -{ +namespace WPCEmu.Db +{ public class TwilightZoneFreewpc : IDb { public string name => "WPC-Fliptronics: Twilight Zone (FreeWPC)"; diff --git a/src/WPCEmu/Db/WCS.cs b/src/WPCEmu/Db/WCS.cs index 4d1d810..2008cb9 100644 --- a/src/WPCEmu/Db/WCS.cs +++ b/src/WPCEmu/Db/WCS.cs @@ -1,5 +1,5 @@ -namespace WPCEmu.Db -{ +namespace WPCEmu.Db +{ public class WorldCupSoccer : IDb { public string name => "WPC-S: World Cup Soccer"; diff --git a/src/WPCEmu/Db/WCSFreeWPC.cs b/src/WPCEmu/Db/WCSFreeWPC.cs index e8f979d..abdc860 100644 --- a/src/WPCEmu/Db/WCSFreeWPC.cs +++ b/src/WPCEmu/Db/WCSFreeWPC.cs @@ -1,5 +1,5 @@ -namespace WPCEmu.Db -{ +namespace WPCEmu.Db +{ public class WorldCupSoccerFreewpc : IDb { public string name => "WPC-S: World Cup Soccer (FreeWPC)"; diff --git a/src/WPCEmu/Db/WD.cs b/src/WPCEmu/Db/WD.cs index 6ca72be..2fa74ac 100644 --- a/src/WPCEmu/Db/WD.cs +++ b/src/WPCEmu/Db/WD.cs @@ -1,5 +1,5 @@ -namespace WPCEmu.Db -{ +namespace WPCEmu.Db +{ public class WhoDunnit : IDb { public string name => "WPC-S: WHO Dunnit"; diff --git a/src/WPCEmu/Db/WPC95TestRom.cs b/src/WPCEmu/Db/WPC95TestRom.cs index 899cd8e..8c1526e 100644 --- a/src/WPCEmu/Db/WPC95TestRom.cs +++ b/src/WPCEmu/Db/WPC95TestRom.cs @@ -1,5 +1,5 @@ -namespace WPCEmu.Db -{ +namespace WPCEmu.Db +{ public class Wpc95Testrom : IDb { public string name => "WPC-95: WPC Test Fixture"; diff --git a/src/WPCEmu/Db/WPC95Upload.cs b/src/WPCEmu/Db/WPC95Upload.cs index 7470fe4..a6710ba 100644 --- a/src/WPCEmu/Db/WPC95Upload.cs +++ b/src/WPCEmu/Db/WPC95Upload.cs @@ -1,5 +1,5 @@ -namespace WPCEmu.Db -{ +namespace WPCEmu.Db +{ public class UploadWpc95 : IDb { public string name => "UPLOAD: WPC-95 Emulation"; diff --git a/src/WPCEmu/Db/WPCATestRom.cs b/src/WPCEmu/Db/WPCATestRom.cs index 75c40a2..70fac22 100644 --- a/src/WPCEmu/Db/WPCATestRom.cs +++ b/src/WPCEmu/Db/WPCATestRom.cs @@ -1,5 +1,5 @@ -namespace WPCEmu.Db -{ +namespace WPCEmu.Db +{ public class WpcAlphaTestrom : IDb { public string name => "WPC-ALPHA: WPC Test Fixture"; diff --git a/src/WPCEmu/Db/WPCAUpload.cs b/src/WPCEmu/Db/WPCAUpload.cs index e11bf34..7afc212 100644 --- a/src/WPCEmu/Db/WPCAUpload.cs +++ b/src/WPCEmu/Db/WPCAUpload.cs @@ -1,5 +1,5 @@ -namespace WPCEmu.Db -{ +namespace WPCEmu.Db +{ public class UploadWpcAlpha : IDb { public string name => "UPLOAD: WPC-Alphanumeric Emulation"; diff --git a/src/WPCEmu/Db/WPCFlipUpload.cs b/src/WPCEmu/Db/WPCFlipUpload.cs index 7739e78..a79ed5f 100644 --- a/src/WPCEmu/Db/WPCFlipUpload.cs +++ b/src/WPCEmu/Db/WPCFlipUpload.cs @@ -1,5 +1,5 @@ -namespace WPCEmu.Db -{ +namespace WPCEmu.Db +{ public class UploadWpcFlip : IDb { public string name => "UPLOAD: WPC-Fliptronics Emulation"; diff --git a/src/WPCEmu/Db/WPCSTestRom.cs b/src/WPCEmu/Db/WPCSTestRom.cs index d44b16d..569dbe6 100644 --- a/src/WPCEmu/Db/WPCSTestRom.cs +++ b/src/WPCEmu/Db/WPCSTestRom.cs @@ -1,5 +1,5 @@ -namespace WPCEmu.Db -{ +namespace WPCEmu.Db +{ public class WpcSTestrom : IDb { public string name => "WPC-S: WPC Test Fixture"; diff --git a/src/WPCEmu/Db/WPCSUpload.cs b/src/WPCEmu/Db/WPCSUpload.cs index ddef6ce..cc02b8f 100644 --- a/src/WPCEmu/Db/WPCSUpload.cs +++ b/src/WPCEmu/Db/WPCSUpload.cs @@ -1,5 +1,5 @@ -namespace WPCEmu.Db -{ +namespace WPCEmu.Db +{ public class UploadWpcS : IDb { public string name => "UPLOAD: WPC-S Emulation"; diff --git a/src/WPCEmu/Db/WPCTestRom.cs b/src/WPCEmu/Db/WPCTestRom.cs index 4076ef7..918bb55 100644 --- a/src/WPCEmu/Db/WPCTestRom.cs +++ b/src/WPCEmu/Db/WPCTestRom.cs @@ -1,5 +1,5 @@ -namespace WPCEmu.Db -{ +namespace WPCEmu.Db +{ public class WpcTestrom : IDb { public string name => "WPC-DMD: WPC Test Fixture"; diff --git a/src/WPCEmu/Db/WPCUpload.cs b/src/WPCEmu/Db/WPCUpload.cs index 3d16bca..d81c40f 100644 --- a/src/WPCEmu/Db/WPCUpload.cs +++ b/src/WPCEmu/Db/WPCUpload.cs @@ -1,5 +1,5 @@ -namespace WPCEmu.Db -{ +namespace WPCEmu.Db +{ public class UploadWpc : IDb { public string name => "UPLOAD: WPC-DCS/WPC-DMD Emulation"; diff --git a/src/WPCEmu/Db/WW.cs b/src/WPCEmu/Db/WW.cs index 5f9ffec..da9ef20 100644 --- a/src/WPCEmu/Db/WW.cs +++ b/src/WPCEmu/Db/WW.cs @@ -1,5 +1,5 @@ -namespace WPCEmu.Db -{ +namespace WPCEmu.Db +{ public class WhiteWater : IDb { public string name => "WPC-Fliptronics: White Water"; diff --git a/src/WPCEmu/Db/WWFreeWPC.cs b/src/WPCEmu/Db/WWFreeWPC.cs index cced2cd..5d09697 100644 --- a/src/WPCEmu/Db/WWFreeWPC.cs +++ b/src/WPCEmu/Db/WWFreeWPC.cs @@ -1,5 +1,5 @@ -namespace WPCEmu.Db -{ +namespace WPCEmu.Db +{ public class WhiteWaterFreewpc : IDb { public string name => "WPC-Fliptronics: White Water \"Bigfoot\" (FreeWPC)"; diff --git a/src/WPCEmu/Emulator.cs b/src/WPCEmu/Emulator.cs index 37dbb40..d30678e 100644 --- a/src/WPCEmu/Emulator.cs +++ b/src/WPCEmu/Emulator.cs @@ -1,32 +1,32 @@ -using System; +using System; using System.Diagnostics; using WPCEmu.Rom; using WPCEmu.Boards; using System.Reflection; -namespace WPCEmu -{ - public class Emulator +namespace WPCEmu +{ + public class Emulator { const int TICKS_PER_MILLISECOND = 2000; - long startTime; - - public WpcCpuBoard cpuBoard; - UiState uiFacade; - + long startTime; + + public WpcCpuBoard cpuBoard; + UiState uiFacade; + public Emulator(RomObject romObject) { cpuBoard = WpcCpuBoard.getInstance(romObject); uiFacade = UiState.getInstance(null); - } - + } + public void start() { Debug.Print("Start WPC Emulator"); startTime = new DateTimeOffset(DateTime.Now).ToUnixTimeMilliseconds(); cpuBoard.start(); - } - + } + public WpcCpuBoard.State getUiState(bool includeExpensiveData = true) { var uiState = cpuBoard.getState(); @@ -152,7 +152,7 @@ public static Emulator initVMwithRom(RomBinary romObject, RomMetaData? metaData skipWpcRomCheck = romData.skipWpcRomCheck, hasAlphanumericDisplay = romData.hasAlphanumericDisplay, preDcsSoundboard = romData.preDcsSoundboard - }; + }; return new Emulator(_romObject); } diff --git a/src/WPCEmu/Rom/GameId.cs b/src/WPCEmu/Rom/GameId.cs index 1a755d1..05db524 100644 --- a/src/WPCEmu/Rom/GameId.cs +++ b/src/WPCEmu/Rom/GameId.cs @@ -1,9 +1,9 @@ -using System; +using System; using System.Diagnostics; -namespace WPCEmu.Rom -{ - public static class GameId +namespace WPCEmu.Rom +{ + public static class GameId { const byte MAGIC_SEQUENCE_LENGTH = 7; diff --git a/src/WPCEmu/Rom/RomHelper.cs b/src/WPCEmu/Rom/RomHelper.cs index 07ed7ba..979e7c0 100644 --- a/src/WPCEmu/Rom/RomHelper.cs +++ b/src/WPCEmu/Rom/RomHelper.cs @@ -1,10 +1,10 @@ -using System; +using System; using System.Diagnostics; using System.Linq; -namespace WPCEmu.Rom -{ - public static class RomHelper +namespace WPCEmu.Rom +{ + public static class RomHelper { const uint WPC_ROM_SIZE_1MBIT = 128 * 1024; static readonly byte[] WPC_VALID_ROM_SIZES_IN_MBIT = { 1, 2, 4, 8 }; diff --git a/src/WPCEmu/Structs/ChecksumData.cs b/src/WPCEmu/Structs/ChecksumData.cs index 36a10d2..327dfbe 100644 --- a/src/WPCEmu/Structs/ChecksumData.cs +++ b/src/WPCEmu/Structs/ChecksumData.cs @@ -1,4 +1,4 @@ -namespace WPCEmu +namespace WPCEmu { public struct ChecksumData { diff --git a/src/WPCEmu/Structs/Flashlamp.cs b/src/WPCEmu/Structs/Flashlamp.cs index 05690e7..cd2829a 100644 --- a/src/WPCEmu/Structs/Flashlamp.cs +++ b/src/WPCEmu/Structs/Flashlamp.cs @@ -1,4 +1,4 @@ -namespace WPCEmu +namespace WPCEmu { public struct Flashlamp { diff --git a/src/WPCEmu/Structs/FliptronicsMapping.cs b/src/WPCEmu/Structs/FliptronicsMapping.cs index 6611bb3..ba22bec 100644 --- a/src/WPCEmu/Structs/FliptronicsMapping.cs +++ b/src/WPCEmu/Structs/FliptronicsMapping.cs @@ -1,4 +1,4 @@ -namespace WPCEmu +namespace WPCEmu { public struct FliptronicsMapping { diff --git a/src/WPCEmu/Structs/InitialAction.cs b/src/WPCEmu/Structs/InitialAction.cs index c25c902..8033723 100644 --- a/src/WPCEmu/Structs/InitialAction.cs +++ b/src/WPCEmu/Structs/InitialAction.cs @@ -1,4 +1,4 @@ -namespace WPCEmu +namespace WPCEmu { public struct InitialAction { diff --git a/src/WPCEmu/Structs/Initialise.cs b/src/WPCEmu/Structs/Initialise.cs index 3afa4b7..b4273fa 100644 --- a/src/WPCEmu/Structs/Initialise.cs +++ b/src/WPCEmu/Structs/Initialise.cs @@ -1,4 +1,4 @@ -namespace WPCEmu +namespace WPCEmu { public struct Initialise { diff --git a/src/WPCEmu/Structs/InterruptCallbackData.cs b/src/WPCEmu/Structs/InterruptCallbackData.cs index ae59d24..d044ef2 100644 --- a/src/WPCEmu/Structs/InterruptCallbackData.cs +++ b/src/WPCEmu/Structs/InterruptCallbackData.cs @@ -1,6 +1,6 @@ -using System; +using System; -namespace WPCEmu +namespace WPCEmu { public struct InterruptCallbackData { diff --git a/src/WPCEmu/Structs/Lamp.cs b/src/WPCEmu/Structs/Lamp.cs index 468cc7d..689e8c7 100644 --- a/src/WPCEmu/Structs/Lamp.cs +++ b/src/WPCEmu/Structs/Lamp.cs @@ -1,4 +1,4 @@ -namespace WPCEmu +namespace WPCEmu { public struct Lamp { diff --git a/src/WPCEmu/Structs/MapperModel.cs b/src/WPCEmu/Structs/MapperModel.cs index 246904c..f995cd8 100644 --- a/src/WPCEmu/Structs/MapperModel.cs +++ b/src/WPCEmu/Structs/MapperModel.cs @@ -1,4 +1,4 @@ -namespace WPCEmu +namespace WPCEmu { public struct MapperModel { diff --git a/src/WPCEmu/Structs/MemoryPatchData.cs b/src/WPCEmu/Structs/MemoryPatchData.cs index 4272d53..1b0c5eb 100644 --- a/src/WPCEmu/Structs/MemoryPatchData.cs +++ b/src/WPCEmu/Structs/MemoryPatchData.cs @@ -1,4 +1,4 @@ -namespace WPCEmu +namespace WPCEmu { public struct MemoryPatchData { diff --git a/src/WPCEmu/Structs/MemoryPosition.cs b/src/WPCEmu/Structs/MemoryPosition.cs index 1cc4a20..42c9d48 100644 --- a/src/WPCEmu/Structs/MemoryPosition.cs +++ b/src/WPCEmu/Structs/MemoryPosition.cs @@ -1,4 +1,4 @@ -namespace WPCEmu +namespace WPCEmu { public struct MemoryPosition { diff --git a/src/WPCEmu/Structs/MemoryPositionData.cs b/src/WPCEmu/Structs/MemoryPositionData.cs index 36f41da..9f0ce64 100644 --- a/src/WPCEmu/Structs/MemoryPositionData.cs +++ b/src/WPCEmu/Structs/MemoryPositionData.cs @@ -1,4 +1,4 @@ -namespace WPCEmu +namespace WPCEmu { public struct MemoryPositionData { diff --git a/src/WPCEmu/Structs/Pinmame.cs b/src/WPCEmu/Structs/Pinmame.cs index a6c858e..3d73332 100644 --- a/src/WPCEmu/Structs/Pinmame.cs +++ b/src/WPCEmu/Structs/Pinmame.cs @@ -1,4 +1,4 @@ -namespace WPCEmu +namespace WPCEmu { public struct Pinmame { diff --git a/src/WPCEmu/Structs/Playfield.cs b/src/WPCEmu/Structs/Playfield.cs index 16ab715..237b321 100644 --- a/src/WPCEmu/Structs/Playfield.cs +++ b/src/WPCEmu/Structs/Playfield.cs @@ -1,4 +1,4 @@ -namespace WPCEmu +namespace WPCEmu { public struct Playfield { diff --git a/src/WPCEmu/Structs/RomBinary.cs b/src/WPCEmu/Structs/RomBinary.cs index 7c1c5d8..23c3193 100644 --- a/src/WPCEmu/Structs/RomBinary.cs +++ b/src/WPCEmu/Structs/RomBinary.cs @@ -1,4 +1,4 @@ -namespace WPCEmu +namespace WPCEmu { public struct RomBinary { diff --git a/src/WPCEmu/Structs/RomData.cs b/src/WPCEmu/Structs/RomData.cs index b361e33..bc793fb 100644 --- a/src/WPCEmu/Structs/RomData.cs +++ b/src/WPCEmu/Structs/RomData.cs @@ -1,4 +1,4 @@ -namespace WPCEmu +namespace WPCEmu { public struct RomData { diff --git a/src/WPCEmu/Structs/RomFile.cs b/src/WPCEmu/Structs/RomFile.cs index 5ede28f..1e46d8c 100644 --- a/src/WPCEmu/Structs/RomFile.cs +++ b/src/WPCEmu/Structs/RomFile.cs @@ -1,4 +1,4 @@ -namespace WPCEmu +namespace WPCEmu { public struct RomFile { diff --git a/src/WPCEmu/Structs/RomMetaData.cs b/src/WPCEmu/Structs/RomMetaData.cs index 0fc9c5c..d749f66 100644 --- a/src/WPCEmu/Structs/RomMetaData.cs +++ b/src/WPCEmu/Structs/RomMetaData.cs @@ -1,4 +1,4 @@ -namespace WPCEmu +namespace WPCEmu { public struct RomMetaData { diff --git a/src/WPCEmu/Structs/RomObject.cs b/src/WPCEmu/Structs/RomObject.cs index 21a476b..9602cb6 100644 --- a/src/WPCEmu/Structs/RomObject.cs +++ b/src/WPCEmu/Structs/RomObject.cs @@ -1,4 +1,4 @@ -namespace WPCEmu +namespace WPCEmu { public struct RomObject { diff --git a/src/WPCEmu/Structs/SolenoidMapping.cs b/src/WPCEmu/Structs/SolenoidMapping.cs index e1f0fe1..2a5c4c8 100644 --- a/src/WPCEmu/Structs/SolenoidMapping.cs +++ b/src/WPCEmu/Structs/SolenoidMapping.cs @@ -1,4 +1,4 @@ -namespace WPCEmu +namespace WPCEmu { public struct SolenoidMapping { diff --git a/src/WPCEmu/Structs/SoundBoardCallbackData.cs b/src/WPCEmu/Structs/SoundBoardCallbackData.cs index 988bda3..55fbfc4 100644 --- a/src/WPCEmu/Structs/SoundBoardCallbackData.cs +++ b/src/WPCEmu/Structs/SoundBoardCallbackData.cs @@ -1,4 +1,4 @@ -namespace WPCEmu +namespace WPCEmu { public struct SoundBoardCallbackData { diff --git a/src/WPCEmu/Structs/SwitchMapping.cs b/src/WPCEmu/Structs/SwitchMapping.cs index 8232661..f3e5638 100644 --- a/src/WPCEmu/Structs/SwitchMapping.cs +++ b/src/WPCEmu/Structs/SwitchMapping.cs @@ -1,4 +1,4 @@ -namespace WPCEmu +namespace WPCEmu { public struct SwitchMapping { diff --git a/src/WPCEmu/WPCEmu.csproj b/src/WPCEmu/WPCEmu.csproj index fd87b4b..6819ed6 100644 --- a/src/WPCEmu/WPCEmu.csproj +++ b/src/WPCEmu/WPCEmu.csproj @@ -1,18 +1,17 @@ + netstandard2.0 C# port of neophob's amazing wpc-emu @ https://github.com/neophob/wpc-emu - 0.0.6 Jason Millard - netstandard2.0 true - Copyright 2020 © Jason Millard All rights reserved + Copyright 2020-2021 WPCEmuCS + 0.7.0 WPCEmuCS - - $(AssemblyVersion)$(PackagePrereleaseIdentifier) + 0.7.0-preview.0 https://github.com/jsm174/wpc-emu-cs LICENSE.txt - $(AssemblyVersion) + $(PackageVersion)