Had some hard fights the last days with the source - a dumb bug in a simple emu-command fooled me a lot and did cost a lot of time.
For the graphics thing I could read out some basics from the source of DosBox (which is for old DOS-games the same as UAE for the Amiga).
Then found the basic chip-description of the VGA-chips in an Intel-PDF.
But - even this needed a lot of analysis and tests - and then this bug, which caused to compute false values for the table which manipulates the floor graphic.
Now about those graphics:
Once inflated, there are two types of files:
Both begin with a directory, then the datasets of those entries.
- first one got a directory in the beginning with four byte: word data offset, then two bytes.
- second one got a directory in the beginning with six bytes: word data offset, then follow four bytes.
While the extrabytes of the first one simply describe kind of bitmap-width and height, are the additional bytes of the second one for
masked blitting.
Told you already that there are 17 graphic routines.
Here a short description:
gfxfunc01 - loads the behemoth, shows it on the screen, and inflates then all graphic-files.
gfxfunc02 - palette setting
gfxfunc03 - clear screen
gfxfunc04 - blit framebuffer to screen
gfxfunc05 - icon 4-type I
gfxfunc06 - viewportrendering - ceiling/floor. There is an extra table needed to blit those perspectivic lines.
gfxfunc07 - helper for inventory/stats,/scroll
gfxfunc08 - icon 6-type I
gfxfunc09 - icon 4-type II
gfxfunc10 - icon 6-type II
gfxfunc11 - not hit yet, but is solved
gfxfunc12 - not hit yet, can't say if I got that one
gfxfunc13 - text, blits characters
gfxfunc14 - draw vertical line
gfxfunc15 - draw horizontal line
those two also used for filled (background) rectangles
gfxfunc16 - and ...
gfxfunc17 - are about the mice - don't know if I will keep them (costs massive time)
with other words - this chapter leaves just a few questions.
One of them is: can that be easily translated into routines that can be used for all purposes, like truecolor-PC-graphics, perhaps enhanced amiga-gfx and in the end for your Java-script-project.
At least I should make a bundle and send the inflated gfx-files to you.
Allegro allows to load png-files (that include alpha-channel infos), so probably we end up with those.
I have to continue now - wondering why it will not blit walls and other characters - that's the next one.
Then (and those are not so good news):
I made a subroutine-tree.
There are three issues where routines may call (over some indirections) recursively. And there is a problem:
The assembly knows jumps and calls.
Now, a lot of routines simple jumps (or runs) into each other, local stacks are almost never used, parts of routines are here and here, and often another routine calls the same one that it finally runs into.
That is PURE SPAGHETTI!
No idea if that one was programmed in GFA-Basic that also could compile. But must be something like that - that really doesn't look like a C-compiler did that! Has the good thing, that we don't have to fear stack-problems (except recursivity), all variables are global and for that structures probably can be analyzed with not that much problems. But routine parametrization can hurt.
So far now.
I do have a plan (in different steps) how to continue to make that all readable in the end, but for now all those emu-glyphes are necessary to keep it as bugfree as possible.
A first complete version could be ready by the end of the next week, I hope...
Plans ..... - what is a plan?
Now looking where the monsters are...