Skip to content

Commit

Permalink
Release 0.6.0.6
Browse files Browse the repository at this point in the history
---------------
Fixed sprite layer ordering for the F256Jr.
Fixed incorrect text mode in F256Jr.
The GPU now imitates the F256Jr FPGA bug - the tile attributes are offset by 16-bit.
  • Loading branch information
Daniel Tremblay committed May 24, 2023
1 parent 4250ccd commit 905b104
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 15 deletions.
10 changes: 7 additions & 3 deletions Main/Display/GPU_Common.cs
Original file line number Diff line number Diff line change
Expand Up @@ -438,9 +438,12 @@ private unsafe void DrawTiles(int* p, bool gammaCorrection, byte TextColumns, in

// we always read tiles 0 to width/TILE_SIZE + 1 - this is to ensure we can display partial tiles, with X,Y offsets
int tilemapItemCount = (dX ? width / 2 : width) / tileSize + 1;
byte[] tiles = new byte[tilemapItemCount * 2];
// The + 2 below is to take an FPGA but in the F256Jr into account
byte[] tiles = new byte[tilemapItemCount * 2 + 2];
int[] tilesetOffsets = new int[tilemapItemCount];
VRAM.CopyIntoBuffer(tilemapAddress + (1 + tilemapWindowX / tileSize) * 2 + (tileRow + 0) * tilemapWidth * 2, tilemapItemCount * 2, tiles);

// The + 2 below is to take an FPGA but in the F256Jr into account
VRAM.CopyIntoBuffer(tilemapAddress + (1 + tilemapWindowX / tileSize) * 2 + (tileRow + 0) * tilemapWidth * 2, tilemapItemCount * 2 + 2, tiles);

// cache of tilesetPointers
int[] tilesetPointers = new int[8];
Expand Down Expand Up @@ -498,7 +501,8 @@ private unsafe void DrawTiles(int* p, bool gammaCorrection, byte TextColumns, in
int clrVal = 0;
for (int t = startTileX; t < endTileX; t++)
{
byte tilesetReg = tiles[t * 2 + 1];
// The (mode==0 ? 1 : 3) below is to take an FPGA but in the F256Jr into account
byte tilesetReg = tiles[t * 2 + (mode == 0 ? 1 : 3)];
byte lutIndex = (byte)((tilesetReg & 0x38) >> 3);
//int lutAddress = MemoryMap.GRP_LUT_BASE_ADDR - VICKY.StartAddress + lutIndex * 1024;
int tilesetOffsetAddress = tilesetOffsets[t]; // + startOffset
Expand Down
11 changes: 6 additions & 5 deletions Main/Display/Gpu.cs
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,6 @@ unsafe void Gpu_Paint(object sender, PaintEventArgs e)
if (VICKY != null)
{
byte MCRegister = VICKY.ReadByte(MCRAddress); // Reading address $AF:0000
byte MCRHigh = (byte)(VICKY.ReadByte(MCRAddress + 1) & 3); // Reading address $AF:0001

pixVals = new byte[res.X];
int top = 0; // top gets modified if error messages are displayed
Expand Down Expand Up @@ -381,6 +380,8 @@ unsafe void Gpu_Paint(object sender, PaintEventArgs e)
}
else
{
byte MCRHigh = (byte)(VICKY.ReadByte(MCRAddress + 1) & 7);

// Tiny Vicky Layers for Bitmaps, Tilemaps and sprites
byte LayerMgr0 = (byte)(VICKY.ReadByte(0xD002 - 0xC000) & 0x7);
byte LayerMgr1 = (byte)(VICKY.ReadByte(0xD002 - 0xC000) >> 4);
Expand All @@ -391,7 +392,7 @@ unsafe void Gpu_Paint(object sender, PaintEventArgs e)

if ((MCRegister & 0x20) != 0)
{
DrawSprites(bitmapPointer, gammaCorrection, 0, displayBorder, borderXSize, borderYSize, line, res.X, BitmapY, doubleX, doubleY);
DrawSprites(bitmapPointer, gammaCorrection, 3, displayBorder, borderXSize, borderYSize, line, res.X, BitmapY, doubleX, doubleY);
}
if ((MCRegister & 0x8) != 0 || (MCRegister & 0x10) != 0)
{
Expand Down Expand Up @@ -420,7 +421,7 @@ unsafe void Gpu_Paint(object sender, PaintEventArgs e)
}
if ((MCRegister & 0x20) != 0)
{
DrawSprites(bitmapPointer, gammaCorrection, 1, displayBorder, borderXSize, borderYSize, line, res.X, BitmapY, doubleX, doubleY);
DrawSprites(bitmapPointer, gammaCorrection, 2, displayBorder, borderXSize, borderYSize, line, res.X, BitmapY, doubleX, doubleY);
}
if ((MCRegister & 0x8) != 0 || (MCRegister & 0x10) != 0)
{
Expand Down Expand Up @@ -449,7 +450,7 @@ unsafe void Gpu_Paint(object sender, PaintEventArgs e)
}
if ((MCRegister & 0x20) != 0)
{
DrawSprites(bitmapPointer, gammaCorrection, 2, displayBorder, borderXSize, borderYSize, line, res.X, BitmapY, doubleX, doubleY);
DrawSprites(bitmapPointer, gammaCorrection, 1, displayBorder, borderXSize, borderYSize, line, res.X, BitmapY, doubleX, doubleY);
}
if ((MCRegister & 0x8) != 0 || (MCRegister & 0x10) != 0)
{
Expand Down Expand Up @@ -478,7 +479,7 @@ unsafe void Gpu_Paint(object sender, PaintEventArgs e)
}
if ((MCRegister & 0x20) != 0)
{
DrawSprites(bitmapPointer, gammaCorrection, 3, displayBorder, borderXSize, borderYSize, line, res.X, BitmapY, doubleX, doubleY);
DrawSprites(bitmapPointer, gammaCorrection, 0, displayBorder, borderXSize, borderYSize, line, res.X, BitmapY, doubleX, doubleY);
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions Main/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("0.6.0.5")]
[assembly: AssemblyFileVersion("0.6.0.5")]
[assembly: AssemblyVersion("0.6.0.6")]
[assembly: AssemblyFileVersion("0.6.0.6")]
16 changes: 11 additions & 5 deletions Release Notes.txt
Original file line number Diff line number Diff line change
@@ -1,16 +1,22 @@
Release 0.6.0.5
Release 0.6.0.6
---------------
Interrupt handler for the Real-time clock (RTC)
Added .hex loading in asset loader.
Added a default font for F256Jr.
Fix the painting of layers in F256Jr.
Fixed sprite layer ordering for the F256Jr.
Fixed incorrect text mode in F256Jr.
The GPU now imitates the F256Jr FPGA bug - the tile attributes are offset by 16-bit.

** TODO: Update the Keyboard device for F256Jr.
** TODO: Users can now modify the CPU registers when in debug mode. The registers have a white background when editable.
** TODO: Add breakpoints on read/write of memory addresses.
** TODO: Implemented the various cursor modes and rates.
** TODO: Add breaklines in debugger listing, when memory is not contiguous.

Release 0.6.0.5
---------------
Interrupt handler for the Real-time clock (RTC)
Added .hex loading in asset loader.
Added a default font for F256Jr.
Fix the painting of layers in F256Jr.

Release 0.6.0.4
---------------
Fix the Uploader to disable the "Flash" checkbox when a non-bin file is selected.
Expand Down
Binary file modified bin/Release/FoenixIDE.exe
Binary file not shown.

0 comments on commit 905b104

Please sign in to comment.