Adding an external macro compiler

Chris H.'s Ultima / ACS-style game development system!

Moderators: Ice Cream Jonsey, joltcountry

rld
Posts: 223
Joined: Sun Jan 25, 2009 2:17 am
Location: Dallas, TX

Adding an external macro compiler

Post by rld »

I have been picking through the innards of the macro data and macro index files, and found out that they are not actually too convoluted and I might have a chance at figuring them out.

This made me take a second look at something I have been considering for a while. Basically, I would like to see if it is possible to write a standalone compiler for ACK macros that would translate from text files (similar to the exported MACROS.TXT) into the ACK native macro file.

Once the compiler had been executed, the resulting macro file could be used in-game just like one that had been created in the ACK macro editor. But having an external compiler to feed macros in would add several new feature possibilities:

o Macro code could be commented (// comment)
o Labels could be named (instead of "IF A=2 THEN 25", "IF A=2 THEN UnlockDoor")
o Variables could be named (instead of "IF K>10...", you could have "IF LockPickSkill > 10..."
o The 'hack' commands tied into DRAW could be translated from more-meaningful names - instead of DRAW 999 0 ...., you could enter a command like DRAWTILE, and the proper sequence of parameters would be generated.

I might also be able to implement macros that call other macros as subroutines (nested macros), and maybe even do something about the 255-macro limit. You probably wouldn't be able to open macros over 255 in the editor, and they would probably only be callable by other macros, but it would be something.

And of course this would make it much easier to port macros from one game to another.

If anyone thinks this would be useful, let me know, and I will take a crack at it.

User avatar
Tdarcos
Posts: 9333
Joined: Fri May 16, 2008 9:25 am
Location: Arlington, Virginia
Contact:

Re: Adding an external macro compiler

Post by Tdarcos »

rld wrote:If anyone thinks this would be useful, let me know, and I will take a crack at it.
Let me tell you a story.

Back around 1977 I was using the Univac 90/60 mainframe at my school using the VS/9 operating system, and was a known "troublemaker" because I kept trying to find out things and sometimes discovering things nobody expected.

On VS/9 the file containing a program that had been compiled was known as the "EAM OMF" and had the name *.

If you ran a compiler you tried your program via
/EXEC *

So my thought was, what would happen if there was a command in the EAM OMF consisting of INCLUDE *?

Basically the system had no protection against the file * including the file *, over and over until it ran out of memory and even beyond.

So you might want to have a protection against endless loops.

Visit My Site; now with more than 103,716% more content than Pnback's!
Last edited by Tdarcos on Sun Mar 13, 2011 10:06 pm, edited 1 time in total.
Alan Francis wrote a book containing everything men understand about women. It consisted of 100 blank pages.

User avatar
pinback
Posts: 17672
Joined: Sat Apr 27, 2002 3:00 pm
Contact:

Re: Adding an external macro compiler

Post by pinback »

Tdarcos wrote:
rld wrote:If anyone thinks this would be useful, let me know, and I will take a crack at it.
Let me tell you a story.
Sorry about this, folks. We try to keep him "above the fold", away from you decent people. Go on about your business.
I don't have to say anything. I'm a doctor, too.

User avatar
Tdarcos
Posts: 9333
Joined: Fri May 16, 2008 9:25 am
Location: Arlington, Virginia
Contact:

Re: Adding an external macro compiler

Post by Tdarcos »

pinback wrote:
Tdarcos wrote:
rld wrote:If anyone thinks this would be useful, let me know, and I will take a crack at it.
Let me tell you a story.
Sorry about this, folks. We try to keep him "above the fold", away from you decent people.
Look who's talking; did you ever mention any of your arrests for philately?

Visit My Site; now with more than 103,716% more content than Pnback's!
Last edited by Tdarcos on Sun Mar 13, 2011 10:06 pm, edited 2 times in total.
Alan Francis wrote a book containing everything men understand about women. It consisted of 100 blank pages.

Garth

Re: Adding an external macro compiler

Post by Garth »

rld wrote: If anyone thinks this would be useful, let me know, and I will take a crack at it.
If anyone thinks this would be useful? Are you kidding me rld?! Of course we would!!!! :D

Post Reply