Skip to content

Commit

Permalink
Removed 'DoGetPatternsInTick'
Browse files Browse the repository at this point in the history
  • Loading branch information
maziac committed Jul 31, 2020
1 parent ef611ae commit 18a0625
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 45 deletions.
4 changes: 4 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
# Changelog


## 1.5.0
- Removed 'DoGetPatternsInTick'
- Switched to CSpect 2.12.34

## 1.4.0
- Changed to DZRP 1.6.0: CMD_CLOSE and changed command numbers.
- Switched to CSpect 2.12.30
Expand Down
67 changes: 24 additions & 43 deletions Commands.cs
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@ protected enum AlternateCommand
// Stores if a PAUSE command has been sent.
protected static bool ManualBreak = false;

protected static bool DoGetPatternsInTick = false;

/**
* General initalization function.
Expand Down Expand Up @@ -173,8 +172,8 @@ protected static void PrintAllBpWp()

/**
* Start/stop debugger.
* @param start Starts the CPU if true (currently this is the only operation mode)
*/
// TODO start=false not used.
protected static void StartCpu(bool start)
{

Expand Down Expand Up @@ -380,15 +379,6 @@ public static void Tick()
}
}
}

// !!!!!!!! TODO: Doing the message parsing in the Tick routine helps, but I need to do this for all messages
// and need a clever way to do consecutive messages (I can't wait 20 ms on each message).
if(DoGetPatternsInTick)
{
GetSpritePatternsInTick();
DoGetPatternsInTick = false;
}

}


Expand Down Expand Up @@ -1131,40 +1121,31 @@ public static void GetSprites()
*/
public static void GetSpritePatterns()
{
DoGetPatternsInTick = true;
}
var cspect = Main.CSpect;
var prevRegs = cspect.GetRegs();

public static void GetSpritePatternsInTick()
// Start of memory
ushort index = CSpectSocket.GetDataByte();
// Get size
ushort count = CSpectSocket.GetDataByte();
if (Log.Enabled)
Log.WriteLine("Sprite pattern index={0}, count={1}", index, count);

// Respond
int address = index * 256;
int size = count * 256;
InitData(size);
byte[] values = cspect.PeekSprite(address, size);
foreach (byte value in values)
SetByte(value);
CSpectSocket.SendResponse(Data);

var afterRegs = cspect.GetRegs();
//Log.WriteLine("prevPC={0}/(0x{0:X4}), afterPC={1}/(0x{1:X4})", prevRegs.PC, afterRegs.PC);
if (prevRegs.PC != afterRegs.PC)
{
//ExecuteStopped(() =>
{
var cspect = Main.CSpect;
var prevRegs = cspect.GetRegs();

// Start of memory
ushort index = CSpectSocket.GetDataByte();
// Get size
ushort count = CSpectSocket.GetDataByte();
if (Log.Enabled)
Log.WriteLine("Sprite pattern index={0}, count={1}", index, count);

// Respond
int address = index * 256;
int size = count * 256;
InitData(size);
byte[] values = cspect.PeekSprite(address, size);
foreach (byte value in values)
SetByte(value);
CSpectSocket.SendResponse(Data);

var afterRegs = cspect.GetRegs();
//Log.WriteLine("prevPC={0}/(0x{0:X4}), afterPC={1}/(0x{1:X4})", prevRegs.PC, afterRegs.PC);
if (prevRegs.PC != afterRegs.PC)
{
Log.WriteLine("prevPC={0}/(0x{0:X4}), afterPC={1}/(0x{1:X4})", prevRegs.PC, afterRegs.PC);
Log.WriteLine("!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
}
}//);
Log.WriteLine("prevPC={0}/(0x{0:X4}), afterPC={1}/(0x{1:X4})", prevRegs.PC, afterRegs.PC);
}
}


Expand Down
2 changes: 1 addition & 1 deletion DeZogPlugin.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
<Reference Include="Plugin">
<HintPath>..\CSpect2_12_30\Plugin.dll</HintPath>
<HintPath>..\CSpect2_12_34\Plugin.dll</HintPath>
<Private>False</Private>
</Reference>
</ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
// The form "{Major}.{Minor}.*" will automatically update the build and revision,
// and "{Major}.{Minor}.{Build}.*" will update just the revision.

[assembly: AssemblyVersion("1.4.0.*")]
[assembly: AssemblyVersion("1.5.0.*")]

// The following attributes are used to specify the signing key for the assembly,
// if desired. See the Mono documentation for more information about signing.
Expand Down

0 comments on commit 18a0625

Please sign in to comment.