Comments (7)
I don't know the answer to this offhand; I'll need to spend some time investigating.
from wcdx.
That would be great if you would have a look. I've already looked myself to death and tried different things.
Could this be due to the VisualC ++ 3.1 compiler that was used at the time?
from wcdx.
I could imagine that this has something to do with sign-extending a char
to an integer offset, but that's just speculation. I'll take a look when I have some free time; maybe this weekend, we'll see.
from wcdx.
Yup, it's sign-extending the char
value. That means that values above 127 are treated as negative offsets into the font table, which explains what you're seeing. It's fixable, but there are a lot of locations to track down.
from wcdx.
I would like to fix it myself so that I can translate the Kilrathi Saga WC1. But now I don't know where to look for it in the code. Do you like to do that?
Kilrathi Saga WC2. I have not yet checked whether it is the same as with WC1.
regards
from wcdx.
I don't include my IDA databases in the wcdx repo because they contain complete program code for the executables that originally shipped as part of Kilrathi Saga, and those executables do not belong to me. That makes it a bit harder to collaborate on the disassembling and patching aspects of this project, but I can at least point you in the right direction. Wing1.exe has a function at virtual address 0x43AD4E (file offset 0x3A14E) that I have named DrawText
, which takes a const char*
argument:
void __stdcall DrawText(const char* text)
It references a static structure located at virtual address 0x62264C that I've named ActiveTextContext
. That structure has this layout:
#pragma pack(1)
struct TextContext
{
Viewport* viewport;
int16_t x;
int16_t y;
void* font; // font data loaded from a resource file
uint8_t foregroundColor;
uint8_t backgroundColor;
const char* textFirst;
const char* textLast;
uint8_t alignment; // specifies left, center, or right alignment
void* fontSomething; // haven't figured this one out yet
Viewport* anotherViewport; // not sure what this is used for yet, either
uint8_t somethingElse; // not sure about this one, either
};
The text context determines where text will be drawn to the screen. The textFirst
and textLast
fields are used to compose a row of text; they point into the string passed into the DrawText
function.
Hopefully that's enough to get you going in the right direction. At some point, I'll revisit this myself and see if I can get your translation working.
from wcdx.
Hi,
Many thanks . That’s a start. I'll take a look .. but it's still a little bit of new territory for me.
from wcdx.
Related Issues (9)
- fyi -- wcpatch.exe detected by Windows Defender as Trojan:Win32/Wacatac.C!ml HOT 4
- Windows Defender reports "Trojan:Win32/Cryptinject!ml" in patchmusic.exe and wcpatch.exe, VirusTotal sees multiple viruses in both .exe files. HOT 8
- Can't launch WCDX on non-SSE2 processor HOT 5
- HRTF 3D positional audio support HOT 2
- Special Operations 2, Missing Music from Jazz's Courtroom Scene HOT 1
- Force Feedback Support in Wing Commander 1 and 2. HOT 2
- Incorrect firing angle when cockpit is hidden on Dralthi HOT 1
- Can't install - no exe files HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from wcdx.