Skip to content

Commit

Permalink
Merge pull request #16 from damieng/clean-up
Browse files Browse the repository at this point in the history
Minor clean up of code
  • Loading branch information
damieng authored Oct 21, 2022
2 parents 856a3f2 + 9b2409c commit 55f5bf4
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
3 changes: 2 additions & 1 deletion Common/DumpScanners/SpectrumDumpScanner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public static class SpectrumDumpScanner
{
public static List<Font> Read(BinaryReader reader, string name)
{
var buffer = reader.ReadBytes(1024 * 1024); // 1MB is enough for any Speccy
var buffer = reader.ReadBytes(1024 * 2048); // 2MB is enough for any Speccy

var offsets = GetOffsets(buffer);

Expand All @@ -28,6 +28,7 @@ public static List<Font> Read(BinaryReader reader, string name)

private static IEnumerable<int> GetOffsets(byte[] buffer)
{
var address = buffer.Length == 65536 ? 16384 : 0;
var candidates = SpectrumDisplay.GetCandidates(buffer, 16384);

var rst = EnvironmentGuidedFinder.FindOffsets(buffer);
Expand Down
2 changes: 1 addition & 1 deletion Common/Formatters/CHeaderFontFormatter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public static void CreateFontHeaderConst(string byteType, List<string> fileNames
output.AppendLine($"static const {byteType} FONT_{cFontName}_BITMAP[] = {{");
foreach (var glyph in font.Glyphs)
{
output.Append("\t");
output.Append('\t');
for (var y = 0; y < font.Height; y++)
{
var b = new Byte();
Expand Down
3 changes: 1 addition & 2 deletions Common/Formatters/FzxFontFormatter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ namespace PixelWorld.Formatters
{
public static class FZXFontFormatter
{
public static void Write(Font font, Stream output, IReadOnlyDictionary<int, char> charset,
bool makeProportional = false)
public static void Write(Font font, Stream output, bool makeProportional = false)
{
if (makeProportional)
font = FontSpacer.MakeProportional(font);
Expand Down
2 changes: 1 addition & 1 deletion Common/Tools/ConvertTo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public static void FZX(List<string> fileNames, IReadOnlyDictionary<int, char> ch
using var reader = new BinaryReader(source);
var font = ByteFontFormatter.Create(reader, Path.GetFileNameWithoutExtension(fileName), 0, charset);
using var target = File.Create(Utils.MakeFileName(fileName, "fzx", outputFolder));
FZXFontFormatter.Write(font, target, Spectrum.UK, makeProportional);
FZXFontFormatter.Write(font, target, makeProportional);
}
}

Expand Down

0 comments on commit 55f5bf4

Please sign in to comment.