-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
634 additions
and
153 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 20 additions & 16 deletions
36
ZXBStudio/DocumentEditors/ZXRamDisk/Classes/ZXRamDiskFile.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,43 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.ComponentModel.DataAnnotations; | ||
using System.IO; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using ZXBasicStudio.Classes; | ||
using ZXBasicStudio.Emulator.Classes; | ||
|
||
namespace ZXBasicStudio.DocumentEditors.ZXRamDisk.Classes | ||
{ | ||
public class ZXRamDiskFile | ||
{ | ||
public required string DiskName { get; set; } | ||
public RamDiskBank Bank { get; set; } | ||
public List<ZXRamDiskContainedFile> Files { get; set; } = new List<ZXRamDiskContainedFile>(); | ||
public bool EnableIndirect { get; set; } | ||
public int IndirectBufferSize { get; set; } | ||
public bool RelocateStack { get; set; } | ||
public ZXRamDiskLogicBank[] Banks { get; set; } = new ZXRamDiskLogicBank[] | ||
{ | ||
new ZXRamDiskLogicBank{ Bank = ZXMemoryBank.Bank4 }, | ||
new ZXRamDiskLogicBank{ Bank = ZXMemoryBank.Bank6 }, | ||
new ZXRamDiskLogicBank{ Bank = ZXMemoryBank.Bank1 }, | ||
new ZXRamDiskLogicBank{ Bank = ZXMemoryBank.Bank3 }, | ||
new ZXRamDiskLogicBank{ Bank = ZXMemoryBank.Bank7 }, | ||
}; | ||
} | ||
|
||
public class ZXRamDisk | ||
public class ZXRamDiskLogicBank | ||
{ | ||
public RamDiskBank Bank { get; set; } | ||
public required byte[] Data { get; set; } | ||
public ZXMemoryBank Bank { get; set; } | ||
public List<ZXRamDiskContainedFile> Files { get; set; } = new List<ZXRamDiskContainedFile>(); | ||
} | ||
|
||
public class ZXRamDiskContainedFile | ||
{ | ||
public required string Name { get; set; } | ||
public required string SourcePath { get; set; } | ||
public required byte[] Content { get; set; } | ||
public int Size => Content?.Length ?? 0; | ||
public byte[] Content { get { return File.ReadAllBytes(Path.Combine(ZXProjectManager.Current.ProjectPath, SourcePath)); } } | ||
public int Size => Content.Length; | ||
} | ||
|
||
public enum RamDiskBank | ||
{ | ||
Bank1 = 1, | ||
Bank3 = 3, | ||
Bank4 = 4, | ||
Bank6 = 6, | ||
Bank7 = 7 | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace ZXBasicStudio.Emulator.Classes | ||
{ | ||
public class ZXBinaryBank | ||
{ | ||
public ZXMemoryBank Bank { get; set; } | ||
public required byte[] Data { get; set; } | ||
} | ||
public enum ZXMemoryBank | ||
{ | ||
Bank1 = 1, | ||
Bank2 = 2, | ||
Bank3 = 3, | ||
Bank4 = 4, | ||
Bank5 = 5, | ||
Bank6 = 6, | ||
Bank7 = 7 | ||
} | ||
|
||
} |
Oops, something went wrong.