From ddb923a7248a8afd0b0f340d2688e45b6b41d14f Mon Sep 17 00:00:00 2001 From: rajko-horvat Date: Sat, 9 Sep 2023 11:52:44 +0200 Subject: [PATCH] Change .NET Framework back to 4.8 --- CPU/CPUFlags.cs | 1 - CPU/CPUMemory.cs | 1 - CPU/CPUMemoryRegion.cs | 1 - CPU/CPURegister.cs | 1 - CPU/FileStreamItem.cs | 1 - Compression/CRC32.cs | 1 - Compression/LZW.cs | 1 - Compression/LZWWord.cs | 1 - Compression/RLE.cs | 1 - GPU/CivRectangle.cs | 1 - GPU/Fonts/CivFont.cs | 1 - GPU/Fonts/CivFontCharacter.cs | 1 - GPU/Fonts/CivFonts.cs | 1 - GPU/VGAForm.cs | 1 - {GameData => GameState}/City.cs | 3 +-- GameData/GameData.cs => GameState/GameState.cs | 6 ++---- {GameData => GameState}/Player.cs | 3 +-- {GameData => GameState}/StrategicLocation.cs | 3 +-- {GameData => GameState}/Unit.cs | 3 +-- {GameData => GameState}/UnitDefinition.cs | 3 +-- Helpers/LogWrapper.cs | 1 - Helpers/StringMatch.cs | 1 - OpenCiv1.cs | 6 +++--- OpenCiv1.csproj | 16 ++++++++-------- OpenCiv1Globals.cs | 1 - Program.cs | 3 +-- README.md | 4 ++-- Readme.txt | 4 +++- Segments/{Overlay_16.cs => CivQuiz.cs} | 4 ++-- Segments/Segment_1238.cs | 6 ++++-- app.config | 2 +- 31 files changed, 31 insertions(+), 52 deletions(-) rename {GameData => GameState}/City.cs (95%) rename GameData/GameData.cs => GameState/GameState.cs (95%) rename {GameData => GameState}/Player.cs (97%) rename {GameData => GameState}/StrategicLocation.cs (82%) rename {GameData => GameState}/Unit.cs (90%) rename {GameData => GameState}/UnitDefinition.cs (91%) rename Segments/{Overlay_16.cs => CivQuiz.cs} (99%) diff --git a/CPU/CPUFlags.cs b/CPU/CPUFlags.cs index 81c556e..71b1ce9 100644 --- a/CPU/CPUFlags.cs +++ b/CPU/CPUFlags.cs @@ -1,6 +1,5 @@ using System; using System.Collections.Generic; -using System.Linq; using System.Text; namespace Disassembler diff --git a/CPU/CPUMemory.cs b/CPU/CPUMemory.cs index 5d94758..5b82165 100644 --- a/CPU/CPUMemory.cs +++ b/CPU/CPUMemory.cs @@ -2,7 +2,6 @@ using System; using System.Collections.Generic; using System.Drawing; -using System.Linq; using System.Net; using System.Text; using static System.Windows.Forms.VisualStyles.VisualStyleElement.TextBox; diff --git a/CPU/CPUMemoryRegion.cs b/CPU/CPUMemoryRegion.cs index 9724f49..8593e06 100644 --- a/CPU/CPUMemoryRegion.cs +++ b/CPU/CPUMemoryRegion.cs @@ -1,6 +1,5 @@ using System; using System.Collections.Generic; -using System.Linq; using System.Text; namespace Disassembler diff --git a/CPU/CPURegister.cs b/CPU/CPURegister.cs index 40a7002..90f9600 100644 --- a/CPU/CPURegister.cs +++ b/CPU/CPURegister.cs @@ -1,6 +1,5 @@ using System; using System.Collections.Generic; -using System.Linq; using System.Text; namespace Disassembler diff --git a/CPU/FileStreamItem.cs b/CPU/FileStreamItem.cs index 40e2d5c..e542331 100644 --- a/CPU/FileStreamItem.cs +++ b/CPU/FileStreamItem.cs @@ -1,7 +1,6 @@ using System; using System.Collections.Generic; using System.IO; -using System.Linq; using System.Text; namespace OpenCiv1 diff --git a/Compression/CRC32.cs b/Compression/CRC32.cs index 863634d..5959685 100644 --- a/Compression/CRC32.cs +++ b/Compression/CRC32.cs @@ -1,7 +1,6 @@ using System; using System.Collections.Generic; using System.Drawing; -using System.Linq; using System.Net.Sockets; using System.Text; diff --git a/Compression/LZW.cs b/Compression/LZW.cs index 4ee15e2..7cac994 100644 --- a/Compression/LZW.cs +++ b/Compression/LZW.cs @@ -2,7 +2,6 @@ using System; using System.Collections.Generic; using System.IO; -using System.Linq; namespace OpenCiv1.Compression { diff --git a/Compression/LZWWord.cs b/Compression/LZWWord.cs index 1fb8687..627ab5b 100644 --- a/Compression/LZWWord.cs +++ b/Compression/LZWWord.cs @@ -1,6 +1,5 @@ using System; using System.Collections.Generic; -using System.Linq; using System.Text; namespace OpenCiv1.Compression diff --git a/Compression/RLE.cs b/Compression/RLE.cs index 1cdfaa6..71a1b05 100644 --- a/Compression/RLE.cs +++ b/Compression/RLE.cs @@ -1,7 +1,6 @@ using System; using System.Collections.Generic; using System.IO; -using System.Linq; using System.Text; namespace OpenCiv1.Compression diff --git a/GPU/CivRectangle.cs b/GPU/CivRectangle.cs index 5f2006c..96056a4 100644 --- a/GPU/CivRectangle.cs +++ b/GPU/CivRectangle.cs @@ -1,7 +1,6 @@ using Disassembler; using System; using System.Collections.Generic; -using System.Linq; using System.Text; namespace OpenCiv1 diff --git a/GPU/Fonts/CivFont.cs b/GPU/Fonts/CivFont.cs index cc7ee65..af72f27 100644 --- a/GPU/Fonts/CivFont.cs +++ b/GPU/Fonts/CivFont.cs @@ -2,7 +2,6 @@ using System; using System.Collections.Generic; using System.IO; -using System.Linq; using System.Text; using System.Xml.Serialization; diff --git a/GPU/Fonts/CivFontCharacter.cs b/GPU/Fonts/CivFontCharacter.cs index dd653af..1be8b4b 100644 --- a/GPU/Fonts/CivFontCharacter.cs +++ b/GPU/Fonts/CivFontCharacter.cs @@ -1,6 +1,5 @@ using System; using System.Collections.Generic; -using System.Linq; using System.Text; using System.Xml.Serialization; diff --git a/GPU/Fonts/CivFonts.cs b/GPU/Fonts/CivFonts.cs index 689550c..29d0222 100644 --- a/GPU/Fonts/CivFonts.cs +++ b/GPU/Fonts/CivFonts.cs @@ -3,7 +3,6 @@ using System.Collections.Generic; using System.IO; using System.IO.Compression; -using System.Linq; using System.Text; using System.Xml.Serialization; diff --git a/GPU/VGAForm.cs b/GPU/VGAForm.cs index b65eac5..3d1e105 100644 --- a/GPU/VGAForm.cs +++ b/GPU/VGAForm.cs @@ -6,7 +6,6 @@ using System.ComponentModel; using System.Data; using System.Drawing; -using System.Linq; using System.Runtime.CompilerServices; using System.Text; using System.Windows.Forms; diff --git a/GameData/City.cs b/GameState/City.cs similarity index 95% rename from GameData/City.cs rename to GameState/City.cs index d9bef58..9bd4dd8 100644 --- a/GameData/City.cs +++ b/GameState/City.cs @@ -1,9 +1,8 @@ using System; using System.Collections.Generic; -using System.Linq; using System.Text; -namespace OpenCiv1.GameData +namespace OpenCiv1.GameState { public class City { diff --git a/GameData/GameData.cs b/GameState/GameState.cs similarity index 95% rename from GameData/GameData.cs rename to GameState/GameState.cs index 7038243..e3185fa 100644 --- a/GameData/GameData.cs +++ b/GameState/GameState.cs @@ -1,12 +1,11 @@ using OpenCiv1.Properties; using System; using System.Collections.Generic; -using System.Linq; using System.Text; -namespace OpenCiv1.GameData +namespace OpenCiv1.GameState { - public class GameData + public class GameState { public ushort GameTurnCount = 0; public short Year = 0; @@ -64,6 +63,5 @@ public class GameData public short PlayerSpaceshipSuccessRate; public short AISpaceshipSuccessRate; - public GameData() { } } } diff --git a/GameData/Player.cs b/GameState/Player.cs similarity index 97% rename from GameData/Player.cs rename to GameState/Player.cs index a7f65c8..ffea5c8 100644 --- a/GameData/Player.cs +++ b/GameState/Player.cs @@ -1,9 +1,8 @@ using System; using System.Collections.Generic; -using System.Linq; using System.Text; -namespace OpenCiv1.GameData +namespace OpenCiv1.GameState { public class Player { diff --git a/GameData/StrategicLocation.cs b/GameState/StrategicLocation.cs similarity index 82% rename from GameData/StrategicLocation.cs rename to GameState/StrategicLocation.cs index 5775f0a..baedbfc 100644 --- a/GameData/StrategicLocation.cs +++ b/GameState/StrategicLocation.cs @@ -1,9 +1,8 @@ using System; using System.Collections.Generic; -using System.Linq; using System.Text; -namespace OpenCiv1.GameData +namespace OpenCiv1.GameState { public class StrategicLocation { diff --git a/GameData/Unit.cs b/GameState/Unit.cs similarity index 90% rename from GameData/Unit.cs rename to GameState/Unit.cs index 185b2d6..3ccfcd2 100644 --- a/GameData/Unit.cs +++ b/GameState/Unit.cs @@ -1,9 +1,8 @@ using System; using System.Collections.Generic; -using System.Linq; using System.Text; -namespace OpenCiv1.GameData +namespace OpenCiv1.GameState { public class Unit { diff --git a/GameData/UnitDefinition.cs b/GameState/UnitDefinition.cs similarity index 91% rename from GameData/UnitDefinition.cs rename to GameState/UnitDefinition.cs index a5fb157..81c5ebf 100644 --- a/GameData/UnitDefinition.cs +++ b/GameState/UnitDefinition.cs @@ -1,9 +1,8 @@ using System; using System.Collections.Generic; -using System.Linq; using System.Text; -namespace OpenCiv1.GameData +namespace OpenCiv1.GameState { public class UnitDefinition { diff --git a/Helpers/LogWrapper.cs b/Helpers/LogWrapper.cs index 9b714d9..5e911df 100644 --- a/Helpers/LogWrapper.cs +++ b/Helpers/LogWrapper.cs @@ -2,7 +2,6 @@ using System; using System.Collections.Generic; using System.IO; -using System.Linq; using System.Text; namespace OpenCiv1 diff --git a/Helpers/StringMatch.cs b/Helpers/StringMatch.cs index 2073b4b..1f29085 100644 --- a/Helpers/StringMatch.cs +++ b/Helpers/StringMatch.cs @@ -1,7 +1,6 @@ using Disassembler; using System; using System.Collections.Generic; -using System.Linq; using System.Text; namespace OpenCiv1 diff --git a/OpenCiv1.cs b/OpenCiv1.cs index 8ae0c47..84d5ffa 100644 --- a/OpenCiv1.cs +++ b/OpenCiv1.cs @@ -58,7 +58,7 @@ public partial class OpenCiv1 private Overlay_17 oOverlay_17; private Overlay_10 oOverlay_10; private Overlay_15 oOverlay_15; - private Overlay_16 oOverlay_16; + private CivQuiz oOverlay_16; private MSCAPI oMSCAPI; private VGADriver oVGADriver; private NSound oSoundDriver; @@ -135,7 +135,7 @@ public OpenCiv1() this.oOverlay_17 = new Overlay_17(this); this.oOverlay_10 = new Overlay_10(this); this.oOverlay_15 = new Overlay_15(this); - this.oOverlay_16 = new Overlay_16(this); + this.oOverlay_16 = new CivQuiz(this); this.oMSCAPI = new MSCAPI(this); this.oVGADriver = new VGADriver(this); this.oSoundDriver = new NSound(this); @@ -742,7 +742,7 @@ public Overlay_15 Overlay_15 get { return this.oOverlay_15; } } - public Overlay_16 Overlay_16 + public CivQuiz Overlay_16 { get { return this.oOverlay_16; } } diff --git a/OpenCiv1.csproj b/OpenCiv1.csproj index b0a0c90..d768638 100644 --- a/OpenCiv1.csproj +++ b/OpenCiv1.csproj @@ -9,7 +9,7 @@ Properties OpenCiv1 OpenCiv1 - v3.5 + v4.8 512 @@ -55,12 +55,12 @@ - - - - - - + + + + + + @@ -98,7 +98,7 @@ - + diff --git a/OpenCiv1Globals.cs b/OpenCiv1Globals.cs index 67922e1..91b8cc4 100644 --- a/OpenCiv1Globals.cs +++ b/OpenCiv1Globals.cs @@ -1,6 +1,5 @@ using System; using System.Collections.Generic; -using System.Linq; using System.Text; namespace OpenCiv1 diff --git a/Program.cs b/Program.cs index 60675d4..09d5637 100644 --- a/Program.cs +++ b/Program.cs @@ -1,7 +1,6 @@ using Disassembler; using System; using System.Collections.Generic; -using System.Linq; using System.Threading; using System.Windows; using System.Windows.Forms; @@ -13,7 +12,7 @@ static class Program /// /// The main entry point for the application. /// - [MTAThread] + [STAThread] static void Main() { OpenCiv1 oGame = null; diff --git a/README.md b/README.md index fcdffe9..ffd5034 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ ## Repository description -

This is a direct re-write of Civilization 1 Game designed by Sid Meier and Bruce Shelley in year 1991.

+

This is a direct Source Code re-write of Civilization 1 Game designed by Sid Meier and Bruce Shelley in year 1991.

The code logic is Based on original DOS CIV I version 475.05 disassembly.

The game is still very popular and easy to play. But the obsoletness of DOS or Windows 16-bit platform and the bugs that have never been fixed are hindering the popularity of the game.

@@ -11,7 +11,7 @@ and the bugs that have never been fixed are hindering the popularity of the game If you want to compile the code, it is assumed that:

  • You are using VS2022 community version (don't know if this is important).
  • -
  • You have .NET Framework 3.5 installed.
  • +
  • You have .NET Framework 4.8 installed.
  • You have installed DOS CIV I game at 'c:\dos\civ\'. It's where it's home directory resides (Images, palettes, text and save games are loaded/saved there, for now).
diff --git a/Readme.txt b/Readme.txt index 99673c8..3096fad 100644 --- a/Readme.txt +++ b/Readme.txt @@ -1,6 +1,8 @@ +Alpha Pre-Release + The file OpenCiv1.exe should be copied directly into installed and working DOS Civilization 1 directory. The Debug mode can be toggled by pressing Alt + D Key. -The only dependency is .NET Framework 3.5 +The only dependency is .NET Framework 4.8 I hope you enjoy this Alpha Pre-Release! diff --git a/Segments/Overlay_16.cs b/Segments/CivQuiz.cs similarity index 99% rename from Segments/Overlay_16.cs rename to Segments/CivQuiz.cs index a680c9b..1cdcdd6 100644 --- a/Segments/Overlay_16.cs +++ b/Segments/CivQuiz.cs @@ -2,13 +2,13 @@ namespace OpenCiv1 { - public class Overlay_16 + public class CivQuiz { private OpenCiv1 oParent; private CPU oCPU; private ushort usSegment = 0; - public Overlay_16(OpenCiv1 parent) + public CivQuiz(OpenCiv1 parent) { this.oParent = parent; this.oCPU = parent.CPU; diff --git a/Segments/Segment_1238.cs b/Segments/Segment_1238.cs index 97de10d..55263e7 100644 --- a/Segments/Segment_1238.cs +++ b/Segments/Segment_1238.cs @@ -570,12 +570,14 @@ public void F0_1238_0092() if (this.oCPU.Flags.NE) goto L0416; this.oCPU.CMPWord(this.oCPU.ReadUInt16(this.oCPU.DS.Word, 0xb220), 0x0); if (this.oCPU.Flags.GE) goto L0416; + + Console.Write("Civilization Quiz"); // Call to overlay - this.oCPU.PushWord(this.oCPU.CS.Word); // stack management - push return segment + /*this.oCPU.PushWord(this.oCPU.CS.Word); // stack management - push return segment this.oCPU.PushWord(0x0416); // stack management - push return offset this.oParent.Overlay_16.F16_0000_0000(); this.oCPU.PopDWord(); // stack management - pop return offset and segment - this.oCPU.CS.Word = 0x1238; // restore this function segment + this.oCPU.CS.Word = 0x1238; // restore this function segment*/ L0416: this.oCPU.TESTByte(this.oCPU.ReadUInt8(this.oCPU.DS.Word, 0x19c0), 0x2); diff --git a/app.config b/app.config index 2fa6e95..3e0e37c 100644 --- a/app.config +++ b/app.config @@ -1,3 +1,3 @@ - +