Skip to content

Commit

Permalink
Release 0.5.6.6
Browse files Browse the repository at this point in the history
---------------
When in debug mode, only redraw the display twice per second instead of 60 times in run mode.
Added support for small tiles 8x8.
  • Loading branch information
Daniel Tremblay committed May 22, 2022
1 parent 4f2f883 commit 4707a05
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 74 deletions.
73 changes: 1 addition & 72 deletions Main/UI/AssetLoader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -187,78 +187,7 @@ private void StoreButton_Click(object sender, EventArgs e)
}
break;
}

if (res.Length > 0)
{
// write address offset by bank $b0
int imageAddress = destAddress - 0xB0_0000;
int regAddress = -1;
byte lutValue = (byte)LUTCombo.SelectedIndex;

// Determine which addresses to store the bitmap into.
if (FileTypesCombo.SelectedIndex < 2)
{
// Bitmaps
regAddress = MemoryLocations.MemoryMap.BITMAP_CONTROL_REGISTER_ADDR + FileTypesCombo.SelectedIndex * 8;
// enable the bitmap - TODO add the LUT
MemMgrRef.WriteByte(regAddress,(byte)(1 + lutValue * 2));

}
else if (FileTypesCombo.SelectedIndex < 6)
{
// Tilemaps 4
int tilemapIndex = FileTypesCombo.SelectedIndex - 1;
regAddress = MemoryLocations.MemoryMap.TILE_CONTROL_REGISTER_ADDR + tilemapIndex * 12;

// enable the tilemap
MemMgrRef.WriteByte(regAddress, (byte)(1 + (lutValue << 1)));

// TODO: Need to write the size of the tilemap
}
else if (FileTypesCombo.SelectedIndex < 14)
{
// Tilesets 8
int tilesetIndex = FileTypesCombo.SelectedIndex - 5;
regAddress = MemoryLocations.MemoryMap.TILESET_BASE_ADDR + tilesetIndex * 4;

MemMgrRef.WriteByte(regAddress + 3, lutValue); // TODO: Add the stride 256 bit 3.
}
else
{
// Sprites 64
int spriteIndex = FileTypesCombo.SelectedIndex - 14;
regAddress = MemoryLocations.MemoryMap.SPRITE_CONTROL_REGISTER_ADDR + spriteIndex * 8;

// enable the tilemap
MemMgrRef.WriteByte(regAddress, (byte)(1 + (lutValue << 1))); // TODO: Add sprite depth
// write address offset by bank $b0
// Set the sprite at (32,32)
MemMgrRef.WriteWord(regAddress + 4, 32);
MemMgrRef.WriteWord(regAddress + 6, 32);
}
// write address offset by bank $b0
MemMgrRef.WriteByte(regAddress + 1, LowByte(imageAddress));
MemMgrRef.WriteByte(regAddress + 2, MidByte(imageAddress));
MemMgrRef.WriteByte(regAddress + 3, HighByte(imageAddress));

StoreButton.Enabled = true;
}
if (res.Length != -1)
{
this.DialogResult = DialogResult.OK;
if (FileTypesCombo.SelectedIndex > 1 && FileTypesCombo.SelectedIndex < 6)
{
int layer = FileTypesCombo.SelectedIndex - 2;
//OnTileLoaded?.Invoke(layer);
}
Close();
}
else
{
// Keep the Asset Loader open
StoreButton.Enabled = true;
}

StoreButton.Enabled = res.Length > 0;
}

/*
Expand Down
2 changes: 0 additions & 2 deletions Release Notes.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
Release 0.5.6.6
---------------
** TODO: Users can now modify the CPU registers when in debug mode. The registers have a white background when editable.
** TODO: Implemented the various cursor modes and rates.
When in debug mode, only redraw the display twice per second instead of 60 times in run mode.
Added support for small tiles 8x8.

Expand Down
Binary file modified bin/Release/FoenixIDE.exe
Binary file not shown.

0 comments on commit 4707a05

Please sign in to comment.