Skip to content

Commit

Permalink
Update to .NET 8
Browse files Browse the repository at this point in the history
  • Loading branch information
EngstromJimmy committed Aug 7, 2023
1 parent 3329bc0 commit 261dbc4
Show file tree
Hide file tree
Showing 9 changed files with 152 additions and 141 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:

- uses: actions/setup-dotnet@v1
with:
dotnet-version: '7.0.x'
dotnet-version: '8.0.x'
include-prerelease: true

- name: Install tools
Expand Down
2 changes: 1 addition & 1 deletion Platforms/ZXBox.Blazor/Hardware/Keyboard.cs
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ public int Input(int Port, int tstates)
if (GetKeyStatus("t"))
returnvalue &= ~16;
break;
case 0x07: //1, 2, 3, 4, 5n
case 0x07: //1, 2, 3, 4, 5
//if (ks.IsKeyDown(Keys.D1) || IsNextKey(Keys.D1) || (JoystickType == JoystickTypeEnum.Sinclair1 && (State.DPad.Left == ButtonState.Pressed || ks.IsKeyDown(Keys.Left))))
if (GetKeyStatus("1"))
returnvalue &= ~1;
Expand Down
2 changes: 1 addition & 1 deletion Platforms/ZXBox.Blazor/ZXBox.Blazor.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.BlazorWebAssembly">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<RunAOTCompilation>true</RunAOTCompilation>

</PropertyGroup>
Expand Down
8 changes: 0 additions & 8 deletions Platforms/ZXBox.Blazor/wwwroot/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,6 @@
let source = audiocontext.createBufferSource();
source.buffer = myArrayBuffer;

//source.connect(gainNode);


gainNode.connect(audiocontext.destination);
source.connect(gainNode);
if (nextStartTime == 0) nextStartTime = audiocontext.currentTime + (myArrayBuffer.length / myArrayBuffer.sampleRate);
Expand Down Expand Up @@ -127,15 +124,12 @@
//console.log(pressedKeys);
}
window.onkeydown = function (e) {


var key = GetKey(e.keyCode);
const index = pressedKeys.indexOf(key);
if (index == -1) {
pressedKeys.push(key);
}
event.preventDefault();
//console.log(pressedKeys);
}

window.getKeyStatus = function () {
Expand All @@ -161,8 +155,6 @@
imageData.data.set(Uint8ClampedArray.from(Module.HEAPU8.subarray(dataPtr, dataPtr + imageData.data.length)));
context.putImageData(imageData, 0, 0);
context.drawImage(canvas, 0, 0, canvas.width, canvas.height);
//console.log((performance.now() - lastcall).toFixed(2));
lastcall = performance.now();
return true;
}
</script>
Expand Down
9 changes: 9 additions & 0 deletions ZXBox.Core.Tests/FileFormats/TapFileFormatTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,16 @@ public void LoadTapFileTest()

Assert.AreEqual(tf.Blocks.Count, 2);
}
[TestMethod]
public void LoadSentinelTapFileTest()
{
var filename = @"C:\Users\Jimmy\Downloads\SentinelThe.tap\SENTINEL.TAP";
var tf = new TapFormat();
var bytes = File.ReadAllBytes(filename);
tf.ReadFile(bytes);

Assert.AreEqual(tf.Blocks.Count, 2);
}
[TestMethod]
public void DecodeTapFileTest()
{
Expand Down
2 changes: 1 addition & 1 deletion ZXBox.Core.Tests/ZXBox.Core.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>

<IsPackable>false</IsPackable>
</PropertyGroup>
Expand Down
262 changes: 136 additions & 126 deletions ZXBox.Core/Cpus/Z80/Z80NOPrefixInstructions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -302,20 +302,30 @@ public void DoNoPrefixInstruction()
A = ReadByteFromMemory(GetNextPCWord());
SubtractNumberOfTStatesLeft(13);
break;
case 0x7F: //LD A,A
case 0x78: //LD A,B
case 0x79: //LD A,C
case 0x7A: //LD A,D
case 0x7B: //LD A,E
A = RegisterValueFromOP(0);
SubtractNumberOfTStatesLeft(4);
break;
case 0x7C: //LD A,H
A = H;
SubtractNumberOfTStatesLeft(4);
break;
case 0x7D: //LD A,L
A = L;
//case 0x7F: //LD A,A
//case 0x78: //LD A,B
//case 0x79: //LD A,C
//case 0x7A: //LD A,D
//case 0x7B: //LD A,E
// A = RegisterValueFromOP(0);
// SubtractNumberOfTStatesLeft(4);
// break;
//case 0x7C: //LD A,H
// A = H;
// SubtractNumberOfTStatesLeft(4);
// break;
//case 0x7D: //LD A,L
// A = L;
// SubtractNumberOfTStatesLeft(4);
// break;
case >= 0x78 and <= 0x7D or 0x7F: //LD A,r
case >= 0x40 and <= 0x43 or 0x47: //LD B,r
case >= 0x48 and <= 0x4D or 0x4F: //LD C,r
case >= 0x50 and <= 0x55 or 0x57: //LD D,r
case >= 0x58 and <= 0x5D or 0x5F: //LD E,r
case >= 0x60 and <= 0x65 or 0x67: //LD H,r
case >= 0x68 and <= 0x6D or 0x6F: //LD L,r
Registers[BitValueFromOP] = RegisterValueFromOP(0);
SubtractNumberOfTStatesLeft(4);
break;
case 0x3E: //LD A,n
Expand All @@ -326,14 +336,14 @@ public void DoNoPrefixInstruction()
B = ReadByteFromMemory(HL);
SubtractNumberOfTStatesLeft(7);
break;
case 0x47: //LD B,A
case 0x40: //LD B,B
case 0x41: //LD B,C
case 0x42: //LD B,D
case 0x43: //LD B,E
B = RegisterValueFromOP(0);
SubtractNumberOfTStatesLeft(4);
break;
//case 0x47: //LD B,A
//case 0x40: //LD B,B
//case 0x41: //LD B,C
//case 0x42: //LD B,D
//case 0x43: //LD B,E
// B = RegisterValueFromOP(0);
// SubtractNumberOfTStatesLeft(4);
// break;
case 0x44: //LD B,H
B = H;
SubtractNumberOfTStatesLeft(4);
Expand All @@ -354,22 +364,22 @@ public void DoNoPrefixInstruction()
C = ReadByteFromMemory(HL);
SubtractNumberOfTStatesLeft(7);
break;
case 0x4F: //LD C,A
case 0x48: //LD C,B
case 0x49: //LD C,C
case 0x4A: //LD C,D
case 0x4B: //LD C,E
C = RegisterValueFromOP(0);
SubtractNumberOfTStatesLeft(4);
break;
case 0x4C: //LD C,H
C = H;
SubtractNumberOfTStatesLeft(4);
break;
case 0x4D://LD C,L
C = L;
SubtractNumberOfTStatesLeft(4);
break;
//case 0x4F: //LD C,A
//case 0x48: //LD C,B
//case 0x49: //LD C,C
//case 0x4A: //LD C,D
//case 0x4B: //LD C,E
// C = RegisterValueFromOP(0);
// SubtractNumberOfTStatesLeft(4);
// break;
//case 0x4C: //LD C,H
// C = H;
// SubtractNumberOfTStatesLeft(4);
// break;
//case 0x4D://LD C,L
// C = L;
// SubtractNumberOfTStatesLeft(4);
// break;
case 0x0E: //LD C,n
C = GetNextPCByte();
SubtractNumberOfTStatesLeft(7);
Expand All @@ -378,22 +388,22 @@ public void DoNoPrefixInstruction()
D = ReadByteFromMemory(HL);
SubtractNumberOfTStatesLeft(7);
break;
case 0x57: //LD D,A
case 0x50: //LD D,B
case 0x51: //LD D,C
case 0x52: //LD D,D
case 0x53: //LD D,E
D = RegisterValueFromOP(0);
SubtractNumberOfTStatesLeft(4);
break;
case 0x54: //LD D,H
D = H;
SubtractNumberOfTStatesLeft(4);
break;
case 0x55: //LD D,L
D = L;
SubtractNumberOfTStatesLeft(4);
break;
//case 0x57: //LD D,A
//case 0x50: //LD D,B
//case 0x51: //LD D,C
//case 0x52: //LD D,D
//case 0x53: //LD D,E
// D = RegisterValueFromOP(0);
// SubtractNumberOfTStatesLeft(4);
// break;
//case 0x54: //LD D,H
// D = H;
// SubtractNumberOfTStatesLeft(4);
// break;
//case 0x55: //LD D,L
// D = L;
// SubtractNumberOfTStatesLeft(4);
// break;
case 0x16: //LD D,n
D = GetNextPCByte();
SubtractNumberOfTStatesLeft(7);
Expand All @@ -406,22 +416,22 @@ public void DoNoPrefixInstruction()
E = ReadByteFromMemory(HL);
SubtractNumberOfTStatesLeft(7);
break;
case 0x5F: //LD E,A
case 0x58: //LD E,B
case 0x59: //LD E,C
case 0x5A: //LD E,D
case 0x5B: //LD E,E
E = RegisterValueFromOP(0);
SubtractNumberOfTStatesLeft(4);
break;
case 0x5C: //LD E,H
E = H;
SubtractNumberOfTStatesLeft(4);
break;
case 0x5D://LD E,L
E = L;
SubtractNumberOfTStatesLeft(4);
break;
//case 0x5F: //LD E,A
//case 0x58: //LD E,B
//case 0x59: //LD E,C
//case 0x5A: //LD E,D
//case 0x5B: //LD E,E
// E = RegisterValueFromOP(0);
// SubtractNumberOfTStatesLeft(4);
// break;
//case 0x5C: //LD E,H
// E = H;
// SubtractNumberOfTStatesLeft(4);
// break;
//case 0x5D://LD E,L
// E = L;
// SubtractNumberOfTStatesLeft(4);
// break;
case 0x1E: //LD E,n
E = GetNextPCByte();
SubtractNumberOfTStatesLeft(7);
Expand All @@ -430,34 +440,34 @@ public void DoNoPrefixInstruction()
H = ReadByteFromMemory(HL);
SubtractNumberOfTStatesLeft(7);
break;
case 0x67: //LD H,A
H = A;
SubtractNumberOfTStatesLeft(4);
break;
case 0x60: //LD H,B
H = B;
SubtractNumberOfTStatesLeft(4);
break;
case 0x61: //LD H,C
H = C;
SubtractNumberOfTStatesLeft(4);
break;
case 0x62: //LD H,D
H = D;
SubtractNumberOfTStatesLeft(4);
break;
case 0x63: //LD H,E
H = E;
SubtractNumberOfTStatesLeft(4);
break;
case 0x64: //LD H,H
H = H;
SubtractNumberOfTStatesLeft(4);
break;
case 0x65://LD H,L
H = L;
SubtractNumberOfTStatesLeft(4);
break;
//case 0x67: //LD H,A
// H = A;
// SubtractNumberOfTStatesLeft(4);
// break;
//case 0x60: //LD H,B
// H = B;
// SubtractNumberOfTStatesLeft(4);
// break;
//case 0x61: //LD H,C
// H = C;
// SubtractNumberOfTStatesLeft(4);
// break;
//case 0x62: //LD H,D
// H = D;
// SubtractNumberOfTStatesLeft(4);
// break;
//case 0x63: //LD H,E
// H = E;
// SubtractNumberOfTStatesLeft(4);
// break;
//case 0x64: //LD H,H
// H = H;
// SubtractNumberOfTStatesLeft(4);
// break;
//case 0x65://LD H,L
// H = L;
// SubtractNumberOfTStatesLeft(4);
// break;
case 0x26: //LD H,n
H = GetNextPCByte();
SubtractNumberOfTStatesLeft(7);
Expand All @@ -466,34 +476,34 @@ public void DoNoPrefixInstruction()
L = ReadByteFromMemory(HL);
SubtractNumberOfTStatesLeft(7);
break;
case 0x6F://LD L,A
L = A;
SubtractNumberOfTStatesLeft(4);
break;
case 0x68: //LD L,B
L = B;
SubtractNumberOfTStatesLeft(4);
break;
case 0x69: //LD L,C
L = C;
SubtractNumberOfTStatesLeft(4);
break;
case 0x6A: //LD L,D
L = D;
SubtractNumberOfTStatesLeft(4);
break;
case 0x6B: //LD L,E
L = E;
SubtractNumberOfTStatesLeft(4);
break;
case 0x6C: //LD L,H
L = H;
SubtractNumberOfTStatesLeft(4);
break;
case 0x6D://LD L,L
L = L;
SubtractNumberOfTStatesLeft(4);
break;
//case 0x6F://LD L,A
// L = A;
// SubtractNumberOfTStatesLeft(4);
// break;
//case 0x68: //LD L,B
// L = B;
// SubtractNumberOfTStatesLeft(4);
// break;
//case 0x69: //LD L,C
// L = C;
// SubtractNumberOfTStatesLeft(4);
// break;
//case 0x6A: //LD L,D
// L = D;
// SubtractNumberOfTStatesLeft(4);
// break;
//case 0x6B: //LD L,E
// L = E;
// SubtractNumberOfTStatesLeft(4);
// break;
//case 0x6C: //LD L,H
// L = H;
// SubtractNumberOfTStatesLeft(4);
// break;
//case 0x6D://LD L,L
// L = L;
// SubtractNumberOfTStatesLeft(4);
// break;
case 0x2E: //LD L ,n
L = GetNextPCByte();
SubtractNumberOfTStatesLeft(7);
Expand Down
Loading

0 comments on commit 261dbc4

Please sign in to comment.