-
Notifications
You must be signed in to change notification settings - Fork 18
Description
Hi!
I'm opening this as an issue instead of a pull request as the following is a 45%-complete idea/proof of concept rather than a 100% integrated/finished implementation.
While surveying the current state of calculation emulation I recently stumbled on PockEmul (website, Play Store), and I really liked its simulation of LCD pixels:
However, PockEmul takes about 8-10 seconds to start on my phone (probably due to its use of Qt), while Emu48droid starts instantly 🙂 , so I wanted to make Emu48droid's LCD pixel border implementation to be like PockEmul, which felt superior.
After having an ah-ha moment understanding the purpose/approach of drawPixelBorder() ("ohh, it's drawing a grid of lines between the pixels") I initially trialed darkening the color of the grid lines in MainScreenView.java:
static void drawPixelBorder(...) {
int lcdBackgroundColor = 0xFF000000 | NativeLib.getLCDBackgroundColor();
int R = (lcdBackgroundColor >> 16) & 0xFF;
int G = (lcdBackgroundColor >> 8) & 0xFF;
int B = lcdBackgroundColor & 0xFF;
R -= 20;
G -= 20;
B -= 20;
lcdBackgroundColor = 0xFF000000 | (R << 16) | (G << 8) | B;
paintLCD.setColor(lcdBackgroundColor);
...This looked like this:
This looked a tad compelling, but didn't match the PockEmul style, which felt subjectively better. After some spelunking through and understanding the codebase, I patched the Emu48 file display.c:
VOID SetLcdColor(...) {
{
if (nId == 46) { // 'background' attribute ID in "Eric's Real 48GX (Large Full)" KML
nRed -= 25;
nGreen -= 25;
nBlue -= 25;
}
dwKMLColor[nId&0x3F] = ((nRed&0xFF)<<16)|((nGreen&0xFF)<<8)|(nBlue&0xFF);
return;
}Et voilà:
After vacillating back and forth between the two styles I eventually acknowledged the second one as the superior choice.
However my kludge modification of Emu48 obviously won't work in practice, and a proper integration is needed. How this will be accomplished is the interesting question 🙂
I noticed in real48gx-l.kml the mention of contrast settings. I cannot find anything related to adjusting contrast anywhere, either in Emu48android or desktop Emu48. (Was this a feature that was architected in but then never exposed anywhere?) Maybe the LCD display could be set using one of the darker contrast colors supplied in the KML file?
This is where I unfortunately don't (yet?) know enough to go any further, and can only provide the information and inspiration above.
If anyone sees this and wants to play around with what the styles above look like, here's a multipart ZIP file (to get around GitHub size limits) with styleA.apk showing the first style and styleB.apk showing the second style. Both are full builds of Emu48android and you'll need to remove your already-installed copy to install them. Be sure to select the "Eric's Real 48GX (Large Full)" calculator.
emu48.zip
emu48.z01.zip (rename to emu48.z01)
emu48.z02.zip (rename to emu48.z02)


