Comments (3)
Hi xOr,
this process has been done manually by me, since I know C and x86 assembly very well.
The code, I have translated, was not optimized by the compiler, so it was a straight forward process.
I also have the compiler, Borland C++ 3.1, which has been used to compile that binary.
So I did the following for each function separately of the original binary:
- analyze the code of the function
- write that code in C
- compile the C code again with Borland C++ 3.1
- compare the binary code of the rewritten function with the binary code of the original
- When they differ goto 1. When they are the same DONE.
There are no DOSBox pseudo instructions, a rewritten function is executed natively on the host processor.
I've hooked into the two call instructions of the software DOSBox-CPU.
If a function I have rewritten is called:
- I get the parameters from the stack
- call my rewritten function with the parameters
- place the return value of the function into register AX
- skip the emulation of that function call
Otherwise DOSBox emulates that function call.
But I think, that will not help you for masm2c, since you are doing something general with that.
I had only a special case.
I hope to find time next month to reactivate Bright-Eyes,
and I'll try out masm2c on one function which I did not managed to translate correctly.
Feel free to ask, if you want more details.
from bright-eyes.
Thanks mostly clear and interesting. I will try to prepare Borland C++ Dos as target of my translator.
from bright-eyes.
Testing resulting code on Dos might be easier before porting sound, graphics, etc to SDL.
The problem is reversed code is a code modification and no tests available.
Good solution for it is binary equality as in your case.
from bright-eyes.
Related Issues (19)
- Original-Bug: Compass disappeares HOT 1
- repair of magical items even if it is not needed
- Bright-Eyes crashes if a enemy mage moves HOT 1
- Bright Eyes character generation stores CHR files in wrong directory HOT 1
- Bright Eyes: Spell cast "Skelettarius" is corrupted
- Bright Eyes: SDL.dll wrong? HOT 1
- saving in gen105
- Build Error - Windows HOT 1
- Original-Bug: Infinite loop in GRP_switch_to_next()
- FIG_choose_next_enemy() can loop forever HOT 1
- Infinite loop in FIG_choose_next_hero() HOT 2
- Typo-de: Magieresitenz
- Original-Bug: get_random_hero() can loop forever HOT 1
- access to status bits HOT 2
- traveling times for ship passages HOT 1
- Original-Bug: invalid number of items
- Original-Bug: permanent LE-damage is deleted on game end HOT 1
- Original-Bug: Infinite Loop in loose_random_item()
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 bright-eyes.