Skip to content

Commit

Permalink
Change .NET Framework back to 4.8
Browse files Browse the repository at this point in the history
  • Loading branch information
rajko-horvat committed Sep 9, 2023
1 parent 1ddc282 commit ddb923a
Show file tree
Hide file tree
Showing 31 changed files with 31 additions and 52 deletions.
1 change: 0 additions & 1 deletion CPU/CPUFlags.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Disassembler
Expand Down
1 change: 0 additions & 1 deletion CPU/CPUMemory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 0 additions & 1 deletion CPU/CPUMemoryRegion.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Disassembler
Expand Down
1 change: 0 additions & 1 deletion CPU/CPURegister.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Disassembler
Expand Down
1 change: 0 additions & 1 deletion CPU/FileStreamItem.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;

namespace OpenCiv1
Expand Down
1 change: 0 additions & 1 deletion Compression/CRC32.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Net.Sockets;
using System.Text;

Expand Down
1 change: 0 additions & 1 deletion Compression/LZW.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;

namespace OpenCiv1.Compression
{
Expand Down
1 change: 0 additions & 1 deletion Compression/LZWWord.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace OpenCiv1.Compression
Expand Down
1 change: 0 additions & 1 deletion Compression/RLE.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;

namespace OpenCiv1.Compression
Expand Down
1 change: 0 additions & 1 deletion GPU/CivRectangle.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
using Disassembler;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace OpenCiv1
Expand Down
1 change: 0 additions & 1 deletion GPU/Fonts/CivFont.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Xml.Serialization;

Expand Down
1 change: 0 additions & 1 deletion GPU/Fonts/CivFontCharacter.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml.Serialization;

Expand Down
1 change: 0 additions & 1 deletion GPU/Fonts/CivFonts.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
1 change: 0 additions & 1 deletion GPU/VGAForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
3 changes: 1 addition & 2 deletions GameData/City.cs → GameState/City.cs
Original file line number Diff line number Diff line change
@@ -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
{
Expand Down
6 changes: 2 additions & 4 deletions GameData/GameData.cs → GameState/GameState.cs
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -64,6 +63,5 @@ public class GameData
public short PlayerSpaceshipSuccessRate;
public short AISpaceshipSuccessRate;

public GameData() { }
}
}
3 changes: 1 addition & 2 deletions GameData/Player.cs → GameState/Player.cs
Original file line number Diff line number Diff line change
@@ -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
{
Expand Down
Original file line number Diff line number Diff line change
@@ -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
{
Expand Down
3 changes: 1 addition & 2 deletions GameData/Unit.cs → GameState/Unit.cs
Original file line number Diff line number Diff line change
@@ -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
{
Expand Down
3 changes: 1 addition & 2 deletions GameData/UnitDefinition.cs → GameState/UnitDefinition.cs
Original file line number Diff line number Diff line change
@@ -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
{
Expand Down
1 change: 0 additions & 1 deletion Helpers/LogWrapper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;

namespace OpenCiv1
Expand Down
1 change: 0 additions & 1 deletion Helpers/StringMatch.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
using Disassembler;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace OpenCiv1
Expand Down
6 changes: 3 additions & 3 deletions OpenCiv1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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; }
}
Expand Down
16 changes: 8 additions & 8 deletions OpenCiv1.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>OpenCiv1</RootNamespace>
<AssemblyName>OpenCiv1</AssemblyName>
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<TargetFrameworkProfile />
</PropertyGroup>
Expand Down Expand Up @@ -55,12 +55,12 @@
<Compile Include="Compression\LZW.cs" />
<Compile Include="Compression\LZWWord.cs" />
<Compile Include="Compression\RLE.cs" />
<Compile Include="GameData\City.cs" />
<Compile Include="GameData\Player.cs" />
<Compile Include="GameData\GameData.cs" />
<Compile Include="GameData\StrategicLocation.cs" />
<Compile Include="GameData\Unit.cs" />
<Compile Include="GameData\UnitDefinition.cs" />
<Compile Include="GameState\City.cs" />
<Compile Include="GameState\Player.cs" />
<Compile Include="GameState\GameState.cs" />
<Compile Include="GameState\StrategicLocation.cs" />
<Compile Include="GameState\Unit.cs" />
<Compile Include="GameState\UnitDefinition.cs" />
<Compile Include="OpenCiv1.cs" />
<Compile Include="Collections\Generic\BDictionary.cs" />
<Compile Include="Collections\Generic\BHashSet.cs" />
Expand Down Expand Up @@ -98,7 +98,7 @@
<Compile Include="Segments\Overlay_13.cs" />
<Compile Include="Segments\Overlay_14.cs" />
<Compile Include="Segments\Overlay_15.cs" />
<Compile Include="Segments\Overlay_16.cs" />
<Compile Include="Segments\CivQuiz.cs" />
<Compile Include="Segments\Overlay_17.cs" />
<Compile Include="Segments\Overlay_18.cs" />
<Compile Include="Segments\Overlay_19.cs" />
Expand Down
1 change: 0 additions & 1 deletion OpenCiv1Globals.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace OpenCiv1
Expand Down
3 changes: 1 addition & 2 deletions Program.cs
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -13,7 +12,7 @@ static class Program
/// <summary>
/// The main entry point for the application.
/// </summary>
[MTAThread]
[STAThread]
static void Main()
{
OpenCiv1 oGame = null;
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
## Repository description
<p>This is a direct re-write of Civilization 1 Game designed by Sid Meier and Bruce Shelley in year 1991.</p>
<p>This is a direct Source Code re-write of Civilization 1 Game designed by Sid Meier and Bruce Shelley in year 1991.</p>
<p>The code logic is <b>Based on original DOS CIV I version 475.05</b> disassembly.</p>
<p>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.<p>
Expand All @@ -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:
<ul>
<li>You are using VS2022 community version (don't know if this is important).</li>
<li>You have .NET Framework 3.5 installed.</li>
<li>You have .NET Framework 4.8 installed.</li>
<li>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).</li>
</ul>
Expand Down
4 changes: 3 additions & 1 deletion Readme.txt
Original file line number Diff line number Diff line change
@@ -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!
4 changes: 2 additions & 2 deletions Segments/Overlay_16.cs → Segments/CivQuiz.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
6 changes: 4 additions & 2 deletions Segments/Segment_1238.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion app.config
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup><supportedRuntime version="v2.0.50727"/></startup></configuration>
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8"/></startup></configuration>

0 comments on commit ddb923a

Please sign in to comment.