Jump to content
IGNORED

Using MADS Macros


snicklin

Recommended Posts

[ IGNORE THIS POST ]

 

I was wondering if anyone could help with this. I am using MADS and I have an array of 8 structures as you can see here, pre-initialised to zeroes. There are some bytes and some words in there.

 

spriteData dta spriteDataStruct [8] \
( 0, 0, 0,0,0,0,0,0, 0,0, 0,0,0,0,0,0,0 ) \
( 0, 0, 0,0,0,0,0,0, 0,0, 0,0,0,0,0,0,0 ) \
( 0, 0, 0,0,0,0,0,0, 0,0, 0,0,0,0,0,0,0 ) \
( 0, 0, 0,0,0,0,0,0, 0,0, 0,0,0,0,0,0,0 ) \
( 0, 0, 0,0,0,0,0,0, 0,0, 0,0,0,0,0,0,0 ) \
( 0, 0, 0,0,0,0,0,0, 0,0, 0,0,0,0,0,0,0 ) \
( 0, 0, 0,0,0,0,0,0, 0,0, 0,0,0,0,0,0,0 ) \
( 0, 0, 0,0,0,0,0,0, 0,0, 0,0,0,0,0,0,0 )

 

Now because of the way that I wish to split the code up, I want to then set the values of the data above instead of zeroes. I want to use a macro so that no actual code is created, but it is all handled by the compiler.

 

Here is an example of the macro that I wish to use, the first value is an index into which row in 'spriteData' which I am referring to:
mAddEnemy 0,96,96,100,1,1,1,0,1,100,1,30000,0,0,1,0,1,2

 

Yes, I know that I could just set all the values directly in spriteData but I want to put this into a library which the coder cannot update and then they can set the values using 'mAddEnemy'.

 

How can I use this to create a macro which updates values in 'spriteData'? It's critical that the compiler does all the work though, I don't want code created.

Edited by snicklin
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...