diff --git a/src/OpenSHC/UI/Rendering/PencilRenderCore/dimHorizontalLine.cpp b/src/OpenSHC/UI/Rendering/PencilRenderCore/dimHorizontalLine.cpp new file mode 100644 index 0000000000..09a24e4f27 --- /dev/null +++ b/src/OpenSHC/UI/Rendering/PencilRenderCore/dimHorizontalLine.cpp @@ -0,0 +1,64 @@ +#include "../PencilRenderCore.func.hpp" + +#include "OpenSHC/Rendering/ColorMode.hpp" + +#include "OpenSHC/Globals/DAT_PencilRenderCore.hpp" +#include "OpenSHC/Globals/DAT_WindowAndDirectDraw.hpp" + +namespace OpenSHC { +namespace UI { + namespace Rendering { + + // Every bit but the lowest of each colour channel, so that halving a pixel shifts no bit into the channel + // below: red starts at bit 11 in RGB565 and at bit 10 in RGB555. + enum { + HALVING_MASK_RGB565 = 65535 & ~((1 << 11) | (1 << 5) | 1), + HALVING_MASK_RGB555 = 32767 & ~((1 << 10) | (1 << 5) | 1) + }; + + // FUNCTION: STRONGHOLDCRUSADER 0x00468EA0 + void PencilRenderCore::dimHorizontalLine() + { + // The asm below names DAT_PencilRenderCore, which inline asm can only do once C++ code has instantiated + // it; sizeof does that without generating any code. + (void)sizeof(DAT_PencilRenderCore::instance); + int const startX = this->drawStartX; + int const startY = this->drawStartY; + int const endX = this->drawEndX; + int halvingMask; + if (DAT_WindowAndDirectDraw::instance.colorBitMode == OpenSHC::Rendering::RGB_555) { + halvingMask = HALVING_MASK_RGB555; + } else { + halvingMask = HALVING_MASK_RGB565; + } + // Halves the brightness of row startY from startX to endX, on the global pencil's surface, not on this + // one's. Handwritten assembly in the original, transcribed from the binary. + __asm { + mov edi, DAT_PencilRenderCore::instance.surfacePtr + mov eax, startX + add eax, eax + add edi, eax + mov eax, startY + mov edx, DAT_PencilRenderCore::instance.horizontalByteSize + mul edx + add edi, eax + mov eax, startX + mov ebx, endX + mov dx, word ptr halvingMask + next_pixel: + cmp eax, ebx + jg done + mov cx, word ptr [edi] + and cx, dx + shr cx, 1 + mov word ptr [edi], cx + add edi, 2 + add eax, 1 + jmp next_pixel + done: + } + } + + } +} +} diff --git a/src/OpenSHC/UI/Rendering/PencilRenderCore/drawBorderedBoxWithBlendedBackground.cpp b/src/OpenSHC/UI/Rendering/PencilRenderCore/drawBorderedBoxWithBlendedBackground.cpp new file mode 100644 index 0000000000..fca487fc6d --- /dev/null +++ b/src/OpenSHC/UI/Rendering/PencilRenderCore/drawBorderedBoxWithBlendedBackground.cpp @@ -0,0 +1,65 @@ +#include "../PencilRenderCore.func.hpp" + +#include "OpenSHC/UI/Rendering/TextureRenderCore.func.hpp" +#include "OpenSHC/IO/Graphics/GmID.hpp" + +#include "OpenSHC/Globals/DAT_PencilRenderCore.hpp" +#include "OpenSHC/Globals/DAT_TextureRenderCoreObject.hpp" + +namespace OpenSHC { +namespace UI { + namespace Rendering { + + // The border is drawn in tiles of 24 by 24 pixels. Each row of tiles has a left, a middle and a right picture + // in GID_INTERFACE_ICONS_3, followed by their three alpha masks; these are the rows' first pictures. + enum { + BORDER_TILE_SIZE = 24, + BORDER_TOP_PICTURES = 1, + BORDER_MIDDLE_PICTURES = 7, + BORDER_BOTTOM_PICTURES = 13 + }; + + // FUNCTION: STRONGHOLDCRUSADER 0x00471340 + void PencilRenderCore::drawBorderedBoxWithBlendedBackground(int xPos, int yPos, int width, int height) + { + // Rounded up to whole tiles + width = ((width - 1) / BORDER_TILE_SIZE + 1) * BORDER_TILE_SIZE; + height = ((height - 1) / BORDER_TILE_SIZE + 1) * BORDER_TILE_SIZE; + // The custom version's blends for blendStrength 0: 0 on the tiles, 16 (half-way to 32) on the background + for (int y = 0; y < height; y += BORDER_TILE_SIZE) { + int rowPictures; + if (y == 0) { + rowPictures = BORDER_TOP_PICTURES; + } else if (y == height - BORDER_TILE_SIZE) { + rowPictures = BORDER_BOTTOM_PICTURES; + } else { + rowPictures = BORDER_MIDDLE_PICTURES; + } + for (int x = 0; x < width; x += BORDER_TILE_SIZE) { + // The left picture first, replaced further in: a flat else-if chain doesn't match + int picture = rowPictures; + if (x != 0) { + if (x == width - BORDER_TILE_SIZE) { + picture = rowPictures + 2; + } else { + // The inside of the box is left to the blended background + if (rowPictures == BORDER_MIDDLE_PICTURES) { + continue; + } + picture = rowPictures + 1; + } + } + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::renderGMWithAlphaMask, + DAT_TextureRenderCoreObject::ptr)(OpenSHC::IO::Graphics::GID_INTERFACE_ICONS_3, picture, + x + xPos, y + yPos, OpenSHC::IO::Graphics::GID_INTERFACE_ICONS_3, picture + 3, 0); + } + } + // The background always goes on the global pencil, not on this one. + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::PencilRenderCore_Func::drawBlendedBlackBox, + DAT_PencilRenderCore::ptr)(xPos + BORDER_TILE_SIZE, yPos + BORDER_TILE_SIZE, + xPos + width - BORDER_TILE_SIZE - 1, yPos + height - BORDER_TILE_SIZE - 1, 16); + } + + } +} +} diff --git a/src/OpenSHC/UI/Rendering/PencilRenderCore/drawBorderedBoxWithCustomBlendedBackground.cpp b/src/OpenSHC/UI/Rendering/PencilRenderCore/drawBorderedBoxWithCustomBlendedBackground.cpp new file mode 100644 index 0000000000..0632fcdaa5 --- /dev/null +++ b/src/OpenSHC/UI/Rendering/PencilRenderCore/drawBorderedBoxWithCustomBlendedBackground.cpp @@ -0,0 +1,67 @@ +#include "../PencilRenderCore.func.hpp" + +#include "OpenSHC/UI/Rendering/TextureRenderCore.func.hpp" +#include "OpenSHC/IO/Graphics/GmID.hpp" + +#include "OpenSHC/Globals/DAT_PencilRenderCore.hpp" +#include "OpenSHC/Globals/DAT_TextureRenderCoreObject.hpp" + +namespace OpenSHC { +namespace UI { + namespace Rendering { + + // The border is drawn in tiles of 24 by 24 pixels. Each row of tiles has a left, a middle and a right picture + // in GID_INTERFACE_ICONS_3, followed by their three alpha masks; these are the rows' first pictures. + enum { + BORDER_TILE_SIZE = 24, + BORDER_TOP_PICTURES = 1, + BORDER_MIDDLE_PICTURES = 7, + BORDER_BOTTOM_PICTURES = 13 + }; + + // FUNCTION: STRONGHOLDCRUSADER 0x00471440 + void PencilRenderCore::drawBorderedBoxWithCustomBlendedBackground( + int xPos, int yPos, int width, int height, int blendStrength) + { + // Rounded up to whole tiles + width = ((width - 1) / BORDER_TILE_SIZE + 1) * BORDER_TILE_SIZE; + height = ((height - 1) / BORDER_TILE_SIZE + 1) * BORDER_TILE_SIZE; + for (int y = 0; y < height; y += BORDER_TILE_SIZE) { + int rowPictures; + if (y == 0) { + rowPictures = BORDER_TOP_PICTURES; + } else if (y == height - BORDER_TILE_SIZE) { + rowPictures = BORDER_BOTTOM_PICTURES; + } else { + rowPictures = BORDER_MIDDLE_PICTURES; + } + for (int x = 0; x < width; x += BORDER_TILE_SIZE) { + // The left picture first, replaced further in: a flat else-if chain doesn't match + int picture = rowPictures; + if (x != 0) { + if (x == width - BORDER_TILE_SIZE) { + picture = rowPictures + 2; + } else { + // The inside of the box is left to the blended background + if (rowPictures == BORDER_MIDDLE_PICTURES) { + continue; + } + picture = rowPictures + 1; + } + } + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::renderGMWithAlphaMask, + DAT_TextureRenderCoreObject::ptr)(OpenSHC::IO::Graphics::GID_INTERFACE_ICONS_3, picture, + x + xPos, y + yPos, OpenSHC::IO::Graphics::GID_INTERFACE_ICONS_3, picture + 3, blendStrength); + } + } + // The background always goes on the global pencil, not on this one. + // Half-way to full strength (32); * 16 / 32 gives the original's shl / sar, where / 2 doesn't. + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::PencilRenderCore_Func::drawBlendedBlackBox, + DAT_PencilRenderCore::ptr)(xPos + BORDER_TILE_SIZE, yPos + BORDER_TILE_SIZE, + xPos + width - BORDER_TILE_SIZE - 1, yPos + height - BORDER_TILE_SIZE - 1, + (blendStrength - 32) * 16 / 32 + 32); + } + + } +} +} diff --git a/src/OpenSHC/UI/Rendering/PencilRenderCore/drawBoxWithRoundedEdges.cpp b/src/OpenSHC/UI/Rendering/PencilRenderCore/drawBoxWithRoundedEdges.cpp new file mode 100644 index 0000000000..21062c42db --- /dev/null +++ b/src/OpenSHC/UI/Rendering/PencilRenderCore/drawBoxWithRoundedEdges.cpp @@ -0,0 +1,60 @@ +#include "../PencilRenderCore.func.hpp" + +#include "OpenSHC/Globals/DAT_TextInputDefinedData.hpp" + +namespace OpenSHC { +namespace UI { + namespace Rendering { + + // FUNCTION: STRONGHOLDCRUSADER 0x004710A0 + void PencilRenderCore::drawBoxWithRoundedEdges( + int left, int top, int right, int bottom, RoundedBoxEdgeRoundingLevel roundingLevel) + { + // How far each of the first roundingLevel rows is indented at both ends, outermost row first. + int* rowIndents; + switch (roundingLevel) { + case OpenSHC::UI::Enums::RBERL_SLIGHT: + rowIndents = DAT_TextInputDefinedData::instance.field_0x0; + break; + case OpenSHC::UI::Enums::RBERL_STRONG: + rowIndents = DAT_TextInputDefinedData::instance.field_0x2c; + break; + default: + return; + } + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::PencilRenderCore_Func::setupPencilSurface, this)(); + // Darkens the box instead of filling it: setupPencil's colour is not used. + if (!MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::PencilRenderCore_Func::setupPencil, this)( + left, top, right, bottom, 0)) { + return; + } + // Too low for both rounded ends + if (this->drawEndY - this->drawStartY < roundingLevel * 2) { + return; + } + int const startX = this->drawStartX; + int const endX = this->drawEndX; + for (int row = 0; row < roundingLevel && this->currentHeight_0x2c >= 0; ++row) { + this->drawStartX = rowIndents[row] + startX; + this->drawEndX = endX - rowIndents[row]; + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::PencilRenderCore_Func::dimHorizontalLine, this)(); + --this->currentHeight_0x2c; + ++this->drawStartY; + } + this->drawStartX = startX; + this->drawEndX = endX; + for (; this->currentHeight_0x2c >= roundingLevel; --this->currentHeight_0x2c, ++this->drawStartY) { + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::PencilRenderCore_Func::dimHorizontalLine, this)(); + } + for (int row = roundingLevel - 1; row >= 0 && this->currentHeight_0x2c >= 0; --row) { + this->drawStartX = rowIndents[row] + startX; + this->drawEndX = endX - rowIndents[row]; + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::PencilRenderCore_Func::dimHorizontalLine, this)(); + --this->currentHeight_0x2c; + ++this->drawStartY; + } + } + + } +} +} diff --git a/src/OpenSHC/UI/Rendering/PencilRenderCore/drawBoxWithRoundedEdgesAndColor.cpp b/src/OpenSHC/UI/Rendering/PencilRenderCore/drawBoxWithRoundedEdgesAndColor.cpp new file mode 100644 index 0000000000..a95b2204fc --- /dev/null +++ b/src/OpenSHC/UI/Rendering/PencilRenderCore/drawBoxWithRoundedEdgesAndColor.cpp @@ -0,0 +1,59 @@ +#include "../PencilRenderCore.func.hpp" + +#include "OpenSHC/Globals/DAT_TextInputDefinedData.hpp" + +namespace OpenSHC { +namespace UI { + namespace Rendering { + + // FUNCTION: STRONGHOLDCRUSADER 0x00470EE0 + void PencilRenderCore::drawBoxWithRoundedEdgesAndColor( + int left, int top, int right, int bottom, ushort color, RoundedBoxEdgeRoundingLevel roundingLevel) + { + // How far each of the first roundingLevel rows is indented at both ends, outermost row first. + int* rowIndents; + switch (roundingLevel) { + case OpenSHC::UI::Enums::RBERL_SLIGHT: + rowIndents = DAT_TextInputDefinedData::instance.field_0x0; + break; + case OpenSHC::UI::Enums::RBERL_STRONG: + rowIndents = DAT_TextInputDefinedData::instance.field_0x2c; + break; + default: + return; + } + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::PencilRenderCore_Func::setupPencilSurface, this)(); + if (!MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::PencilRenderCore_Func::setupPencil, this)( + left, top, right, bottom, color)) { + return; + } + // Too low for both rounded ends + if (this->drawEndY - this->drawStartY < roundingLevel * 2) { + return; + } + int const startX = this->drawStartX; + int const endX = this->drawEndX; + for (int row = 0; row < roundingLevel && this->currentHeight_0x2c >= 0; ++row) { + this->drawStartX = rowIndents[row] + startX; + this->drawEndX = endX - rowIndents[row]; + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::PencilRenderCore_Func::drawHorizontalLine, this)(); + --this->currentHeight_0x2c; + ++this->drawStartY; + } + this->drawStartX = startX; + this->drawEndX = endX; + for (; this->currentHeight_0x2c >= roundingLevel; --this->currentHeight_0x2c, ++this->drawStartY) { + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::PencilRenderCore_Func::drawHorizontalLine, this)(); + } + for (int row = roundingLevel - 1; row >= 0 && this->currentHeight_0x2c >= 0; --row) { + this->drawStartX = rowIndents[row] + startX; + this->drawEndX = endX - rowIndents[row]; + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::PencilRenderCore_Func::drawHorizontalLine, this)(); + --this->currentHeight_0x2c; + ++this->drawStartY; + } + } + + } +} +} diff --git a/src/OpenSHC/UI/Rendering/PencilRenderCore/drawCurrentPixel.cpp b/src/OpenSHC/UI/Rendering/PencilRenderCore/drawCurrentPixel.cpp new file mode 100644 index 0000000000..83de94d993 --- /dev/null +++ b/src/OpenSHC/UI/Rendering/PencilRenderCore/drawCurrentPixel.cpp @@ -0,0 +1,36 @@ +#include "../PencilRenderCore.func.hpp" + +#include "OpenSHC/Globals/DAT_PencilRenderCore.hpp" + +namespace OpenSHC { +namespace UI { + namespace Rendering { + + // FUNCTION: STRONGHOLDCRUSADER 0x00468F20 + void PencilRenderCore::drawCurrentPixel() + { + // The asm below names DAT_PencilRenderCore, which inline asm can only do once C++ code has instantiated + // it; sizeof does that without generating any code. + (void)sizeof(DAT_PencilRenderCore::instance); + int const x = this->currentX; + int const y = this->currentY; + int const color = this->drawColor; + // Sets the pixel at (currentX, currentY) to the colour, on the global pencil's surface, not on this one's. + // Handwritten assembly in the original, transcribed from the binary. + __asm { + mov edi, DAT_PencilRenderCore::instance.surfacePtr + mov eax, x + add eax, eax + add edi, eax + mov eax, y + mov edx, DAT_PencilRenderCore::instance.horizontalByteSize + mul edx + add edi, eax + mov cx, word ptr color + mov word ptr [edi], cx + } + } + + } +} +} diff --git a/src/OpenSHC/UI/Rendering/PencilRenderCore/drawHorizontalLine.cpp b/src/OpenSHC/UI/Rendering/PencilRenderCore/drawHorizontalLine.cpp new file mode 100644 index 0000000000..06e6fd79c1 --- /dev/null +++ b/src/OpenSHC/UI/Rendering/PencilRenderCore/drawHorizontalLine.cpp @@ -0,0 +1,47 @@ +#include "../PencilRenderCore.func.hpp" + +#include "OpenSHC/Globals/DAT_PencilRenderCore.hpp" + +namespace OpenSHC { +namespace UI { + namespace Rendering { + + // FUNCTION: STRONGHOLDCRUSADER 0x00468DE0 + void PencilRenderCore::drawHorizontalLine() + { + // The asm below names DAT_PencilRenderCore, which inline asm can only do once C++ code has instantiated + // it; sizeof does that without generating any code. + (void)sizeof(DAT_PencilRenderCore::instance); + int const startX = this->drawStartX; + int const startY = this->drawStartY; + int const endX = this->drawEndX; + int const color = this->drawColor; + // Fills row startY from startX to endX with the colour, on the global pencil's surface, not on this one's. + // Handwritten assembly in the original, transcribed from the binary. + __asm { + mov edi, DAT_PencilRenderCore::instance.surfacePtr + mov eax, startX + add eax, eax + add edi, eax + mov eax, startY + mov edx, DAT_PencilRenderCore::instance.horizontalByteSize + mul edx + add edi, eax + mov eax, startX + mov ebx, endX + mov cx, word ptr color + mov edx, 2 + next_pixel: + cmp eax, ebx + jg done + mov word ptr [edi], cx + add edi, edx + add eax, 1 + jmp next_pixel + done: + } + } + + } +} +} diff --git a/src/OpenSHC/UI/Rendering/PencilRenderCore/drawLine.cpp b/src/OpenSHC/UI/Rendering/PencilRenderCore/drawLine.cpp new file mode 100644 index 0000000000..57cb89cf9a --- /dev/null +++ b/src/OpenSHC/UI/Rendering/PencilRenderCore/drawLine.cpp @@ -0,0 +1,33 @@ +#include "../PencilRenderCore.func.hpp" + +namespace OpenSHC { +namespace UI { + namespace Rendering { + + // FUNCTION: STRONGHOLDCRUSADER 0x00472B20 + void PencilRenderCore::drawLine(int x1, int y1, int x2, int y2, ushort color) + { + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::PencilRenderCore_Func::setupPencilSurface, this)(); + if (!MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::PencilRenderCore_Func::setupPencil, this)( + x1, y1, x2, y2, color)) { + return; + } + if (this->currentWidth_0x28 == 0) { + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::PencilRenderCore_Func::drawVerticalLine, this)(); + return; + } + if (this->currentHeight_0x2c == 0) { + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::PencilRenderCore_Func::drawHorizontalLine, this)(); + return; + } + if (this->currentHeight_0x2c > this->currentWidth_0x28) { + MACRO_CALL_MEMBER( + OpenSHC::UI::Rendering::PencilRenderCore_Func::drawDiagonalHeigherThanWideUnk, this)(); + return; + } + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::PencilRenderCore_Func::drawDiagonalWiderThanHighUnk, this)(); + } + + } +} +} diff --git a/src/OpenSHC/UI/Rendering/PencilRenderCore/drawPixelPattern4x4.cpp b/src/OpenSHC/UI/Rendering/PencilRenderCore/drawPixelPattern4x4.cpp new file mode 100644 index 0000000000..53514dc68b --- /dev/null +++ b/src/OpenSHC/UI/Rendering/PencilRenderCore/drawPixelPattern4x4.cpp @@ -0,0 +1,56 @@ +#include "../PencilRenderCore.func.hpp" + +#include "OpenSHC/Globals/DAT_PencilRenderCore.hpp" + +namespace OpenSHC { +namespace UI { + namespace Rendering { + + // The pattern's colours in RGB565 (red << 11 | green << 5 | blue); black is 0. + enum { + PATTERN_GREY = (15 << 11) | (30 << 5) | 15, + PATTERN_WHITE = (31 << 11) | (63 << 5) | 31, + PATTERN_DARK_GREY = (7 << 11) | (14 << 5) | 7 + }; + + // FUNCTION: STRONGHOLDCRUSADER 0x00468F70 + void PencilRenderCore::drawPixelPattern4x4(int drawX, int drawY) + { + // The asm below names DAT_PencilRenderCore, which inline asm can only do once C++ code has instantiated + // it; sizeof does that without generating any code. + (void)sizeof(DAT_PencilRenderCore::instance); + // A 4x4 pattern at (drawX, drawY), on the global pencil's surface, not on this one's, two pixels per store, + // the left one in the low word. Handwritten assembly in the original, transcribed from the binary. + __asm { + mov edi, DAT_PencilRenderCore::instance.surfacePtr + mov eax, drawX + add eax, eax + add edi, eax + mov eax, drawY + mov edx, DAT_PencilRenderCore::instance.horizontalByteSize + mul edx + add edi, eax + mov ecx, 0 + mov edx, DAT_PencilRenderCore::instance.horizontalByteSize + mov eax, PATTERN_GREY + PATTERN_WHITE * 65536 + mov ebx, PATTERN_DARK_GREY * 65536 + mov dword ptr [edi + ecx], eax + mov dword ptr [edi + ecx + 4], ebx + add ecx, edx + mov eax, PATTERN_GREY + PATTERN_GREY * 65536 + mov dword ptr [edi + ecx], eax + mov dword ptr [edi + ecx + 4], ebx + add ecx, edx + mov eax, PATTERN_DARK_GREY + PATTERN_DARK_GREY * 65536 + mov dword ptr [edi + ecx], eax + mov dword ptr [edi + ecx + 4], ebx + add ecx, edx + mov eax, 0 + mov dword ptr [edi + ecx], eax + mov dword ptr [edi + ecx + 4], eax + } + } + + } +} +} diff --git a/src/OpenSHC/UI/Rendering/PencilRenderCore/drawVerticalLine.cpp b/src/OpenSHC/UI/Rendering/PencilRenderCore/drawVerticalLine.cpp new file mode 100644 index 0000000000..c7b69597d4 --- /dev/null +++ b/src/OpenSHC/UI/Rendering/PencilRenderCore/drawVerticalLine.cpp @@ -0,0 +1,47 @@ +#include "../PencilRenderCore.func.hpp" + +#include "OpenSHC/Globals/DAT_PencilRenderCore.hpp" + +namespace OpenSHC { +namespace UI { + namespace Rendering { + + // FUNCTION: STRONGHOLDCRUSADER 0x00468E40 + void PencilRenderCore::drawVerticalLine() + { + // The asm below names DAT_PencilRenderCore, which inline asm can only do once C++ code has instantiated + // it; sizeof does that without generating any code. + (void)sizeof(DAT_PencilRenderCore::instance); + int const startX = this->drawStartX; + int const startY = this->drawStartY; + int const endY = this->drawEndY; + int const color = this->drawColor; + // Fills column startX from startY to endY with the colour, on the global pencil's surface, not on this + // one's. Handwritten assembly in the original, transcribed from the binary. + __asm { + mov edi, DAT_PencilRenderCore::instance.surfacePtr + mov eax, startX + add eax, eax + add edi, eax + mov eax, startY + mov edx, DAT_PencilRenderCore::instance.horizontalByteSize + mul edx + add edi, eax + mov eax, startY + mov ebx, endY + mov cx, word ptr color + mov edx, DAT_PencilRenderCore::instance.horizontalByteSize + next_pixel: + cmp eax, ebx + jg done + mov word ptr [edi], cx + add edi, edx + add eax, 1 + jmp next_pixel + done: + } + } + + } +} +} diff --git a/status/addresses-SHC-3BB0A8C1.txt b/status/addresses-SHC-3BB0A8C1.txt index bc8541dd21..085c7ab69a 100644 --- a/status/addresses-SHC-3BB0A8C1.txt +++ b/status/addresses-SHC-3BB0A8C1.txt @@ -20101,15 +20101,15 @@ SHC_3BB0A8C1_0x00468C50 | 100.0% | Reimplemented SHC_3BB0A8C1_0x00468C80 | 0.0% | Pending -SHC_3BB0A8C1_0x00468DE0 | 0.0% | Pending +SHC_3BB0A8C1_0x00468DE0 | 100.0% | Reimplemented -SHC_3BB0A8C1_0x00468E40 | 0.0% | Pending +SHC_3BB0A8C1_0x00468E40 | 100.0% | Reimplemented -SHC_3BB0A8C1_0x00468EA0 | 0.0% | Pending +SHC_3BB0A8C1_0x00468EA0 | 100.0% | Reimplemented -SHC_3BB0A8C1_0x00468F20 | 0.0% | Pending +SHC_3BB0A8C1_0x00468F20 | 100.0% | Reimplemented -SHC_3BB0A8C1_0x00468F70 | 0.0% | Pending +SHC_3BB0A8C1_0x00468F70 | 100.0% | Reimplemented SHC_3BB0A8C1_0x00468FE0 | 0.0% | Pending @@ -21267,7 +21267,7 @@ SHC_3BB0A8C1_0x00470BC0 | 100.0% | Reimplemented, requires SHC_3BB0A8C1_0x0046CC SHC_3BB0A8C1_0x00470E90 | 100.0% | Reimplemented -SHC_3BB0A8C1_0x00470EE0 | 0.0% | Pending +SHC_3BB0A8C1_0x00470EE0 | 100.0% | Reimplemented SHC_3BB0A8C1_0x00470FC0 | 0.0% | Pending @@ -21275,7 +21275,7 @@ SHC_3BB0A8C1_0x00471000 | 0.0% | Pending SHC_3BB0A8C1_0x00471050 | 100.0% | Reimplemented -SHC_3BB0A8C1_0x004710A0 | 0.0% | Pending +SHC_3BB0A8C1_0x004710A0 | 100.0% | Reimplemented SHC_3BB0A8C1_0x004711B0 | 0.0% | Pending @@ -21285,9 +21285,9 @@ SHC_3BB0A8C1_0x00471280 | 100.0% | Reimplemented SHC_3BB0A8C1_0x004712E0 | 100.0% | Reimplemented -SHC_3BB0A8C1_0x00471340 | 0.0% | Pending +SHC_3BB0A8C1_0x00471340 | 100.0% | Reimplemented -SHC_3BB0A8C1_0x00471440 | 0.0% | Pending +SHC_3BB0A8C1_0x00471440 | 100.0% | Reimplemented SHC_3BB0A8C1_0x00471570 | 0.0% | Pending @@ -21417,7 +21417,7 @@ SHC_3BB0A8C1_0x004729B0 | 0.0% | Pending SHC_3BB0A8C1_0x00472A90 | 100.0% | Reimplemented -SHC_3BB0A8C1_0x00472B20 | 0.0% | Pending +SHC_3BB0A8C1_0x00472B20 | 100.0% | Reimplemented SHC_3BB0A8C1_0x00472B90 | 0.0% | Pending