A couple of notes to say here. Rather than re-coding all the structure
type stuff out of the equation, I've hacked up a number of read/write
handlers for each of the object types which approximate to the best of
my ability, what the C++ code was doing. Therefore there may be a
quicker way of doing this. Calls to FNs/PROCs ending in "_readdata",
"_writedata", "_incdata" and "_decdata" from within the BASIC code are
examples of this. There are others, but I've been dealing with
populating the object and monster databases for a while now and
haven't taken a look at the game code for over a month...
http://www.garethlock.com/acorn/umoria/devtools.zip : Contains
development tools and associated shared code.
http://www.garethlock.com/acorn/umoria/moriawip.zip : Contains the
bulk of the code I've already ported.
Again... Not all the source files are complete and not all the source
files are present. I haven't tried grouping all the code together yet.
The directory viewer just contains displays the BASIC equivalents of
the C++ source.
Hope you enjoy it...
Thanks for the publicity, but it's at least 3 months off being able to
run it, leave alone getting the bugs out of it. I'll keep this post
active with any other developments.
Got some more monster records entered into the database.
hex$=LEFT$(hex$,FNdev_getlastchr(hex$))
This fixes an issue where a string containing trailing spaces but with
an otherwise valid hex number was always returning 0. "FFA5 " would
return 0 rather than FFA5.
In other news, that's all the monsters defined. Now for the third big
static data table. Monster Attacks.
SYS"XOS_ReadUnsigned",16,hex$ TO ,,num%;flags%
IF flags%AND1 THEN <not valid> ELSE =num%
This ignores leading spaces and reads the string up to the first non-hex
character, ignoring the rest. It accepts a leading '&' if present. Hope
this helps.
Thanks... I'll look into it, but the routine I've written will take PC
representation "0x12345" with the optional "L" to signify a long INT
as well as the more conventional "&12345" that's used on the Acorn/
RISC OS platform. The original data tables came from C/C++ source
written to compile on a PC, so all the hex notation is like this.
I would look to alter the data to fit the fast routine I already have. A
quick search and replace in StrongED or Zap would do that in this case.
Often, more work formatting static data can save a lot of programming
effort.
Even so, it takes only one line before the above to detect '0x'. I think
the 'L' suffix is irrelevant with RISC OS integers so you can ignore it:
IF LEFT$(hex$,2)="0x" THEN LEFT$(hex$,2)=" &"
or
i%=INSTR(hex$,"0x"):IF i% THEN hex$=MID$(hex$,i%+2)
Of course, if you were using Basalt the original two liner could be
replaced by:
num%=NUM(hex$,16)
;-)
Downloads are up to date, I'm going to be away for a week, so won't be
able to continue during that time, but will be reading this thread
whilst I'm away.