Skip to content

Commit

Permalink
Code refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
morphx666 committed Feb 13, 2019
1 parent 0b6001e commit 3cdd05e
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 24 deletions.
4 changes: 2 additions & 2 deletions GenOpCodes/My Project/AssemblyInfo.vb
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,5 @@ Imports System.Runtime.InteropServices
' by using the '*' as shown below:
' <Assembly: AssemblyVersion("1.0.*")>

<Assembly: AssemblyVersion("2019.2.1.420")>
<Assembly: AssemblyFileVersion("2019.2.1.420")>
<Assembly: AssemblyVersion("2019.2.13.422")>
<Assembly: AssemblyFileVersion("2019.2.13.422")>
4 changes: 2 additions & 2 deletions RunTests/My Project/AssemblyInfo.vb
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,5 @@ Imports System.Runtime.InteropServices
' by using the '*' as shown below:
' <Assembly: AssemblyVersion("1.0.*")>

<Assembly: AssemblyVersion("2019.2.1.719")>
<Assembly: AssemblyFileVersion("2019.2.1.719")>
<Assembly: AssemblyVersion("2019.2.13.721")>
<Assembly: AssemblyFileVersion("2019.2.13.721")>
4 changes: 2 additions & 2 deletions x8086NetEmu/Adapters/WebUI.vb
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ Public Class WebUI

Public Sub New(cpu As X8086, dBmp As DirectBitmap, syncObj As Object)
Me.cpu = cpu
Me.mBitmap = dBmp
Me.syncObj = syncObj
mBitmap = dBmp

CreateClient()

Expand Down Expand Up @@ -188,7 +188,7 @@ Public Class WebUI
Try
SyncLock syncObj
' FIXME: When using the VGA adapter and UseVRAM is true we need to send the VGA adapter's RAM instead
Return CType(Bitmap, Byte())
Return CType(mBitmap, Byte())
End SyncLock
Catch
Return Nothing
Expand Down
16 changes: 4 additions & 12 deletions x8086NetEmu/Helpers/ConsoleCrayon.vb
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,9 @@ Public NotInheritable Class ConsoleCrayon
If foreColor <> Console.ForegroundColor Then Console.ForegroundColor = foreColor
If backColor <> Console.BackgroundColor Then Console.BackgroundColor = backColor

'If row = Console.WindowHeight - 1 AndAlso col + text.Length >= Console.WindowWidth Then
Dim index As Integer = col + row * Console.WindowWidth
Dim size As Integer = Console.WindowWidth * Console.WindowHeight
If index + text.Length >= size Then
'text = text.Substring(0, text.Length * 2 + col - Console.WindowWidth - 1)
text = text.Substring(0, size - index - 1)
End If
If index + text.Length >= size Then text = text.Substring(0, size - index - 1)

Console.Write(text)
End If
Expand Down Expand Up @@ -194,11 +190,7 @@ Public NotInheritable Class ConsoleCrayon
Dim a As Double

If dy = 0 Then
If dx > 0 Then
a = 0
Else
a = 180
End If
a = If(dx > 0, 0, 180)
Else
a = Math.Atan(dy / dx) * toDegrees
Select Case a
Expand Down Expand Up @@ -295,8 +287,8 @@ Public NotInheritable Class ConsoleCrayon
End Select
End Function

Private Const ESC = Chr(27) + "["
Private Const ColorReset = ESC + "0m"
Private Const ESC As String = Chr(27) + "["
Private Const ColorReset As String = ESC + "0m"
Private Shared Function GetAnsiColorControlCode(color As ConsoleColor, isForeground As Boolean) As String
' lighter fg colours are 90 -> 97 rather than 30 -> 37
' lighter bg colours are 100 -> 107 rather than 40 -> 47
Expand Down
4 changes: 2 additions & 2 deletions x8086NetEmu/My Project/AssemblyInfo.vb
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,5 @@ Imports System.Runtime.InteropServices
' by using the '*' as shown below:
' <Assembly: AssemblyVersion("1.0.*")>

<Assembly: AssemblyVersion("2019.2.1.6526")>
<Assembly: AssemblyFileVersion("2019.2.1.6519")>
<Assembly: AssemblyVersion("2019.2.13.6529")>
<Assembly: AssemblyFileVersion("2019.2.13.6522")>
4 changes: 2 additions & 2 deletions x8086NetEmuConsole/My Project/AssemblyInfo.vb
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,5 @@ Imports System.Runtime.InteropServices
' by using the '*' as shown below:
' <Assembly: AssemblyVersion("1.0.*")>

<Assembly: AssemblyVersion("2019.2.1.789")>
<Assembly: AssemblyFileVersion("2019.2.1.784")>
<Assembly: AssemblyVersion("2019.2.13.792")>
<Assembly: AssemblyFileVersion("2019.2.13.787")>
4 changes: 2 additions & 2 deletions x8086NetEmuWinForms/My Project/AssemblyInfo.vb
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,5 @@ Imports System.Runtime.InteropServices
' by using the '*' as shown below:
' <Assembly: AssemblyVersion("1.0.*")>

<Assembly: AssemblyVersion("2019.2.1.6348")>
<Assembly: AssemblyFileVersion("2019.2.1.6346")>
<Assembly: AssemblyVersion("2019.2.13.6350")>
<Assembly: AssemblyFileVersion("2019.2.13.6348")>

0 comments on commit 3cdd05e

Please sign in to comment.