snicklin Posted December 17, 2015 Share Posted December 17, 2015 (edited) [ 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 December 17, 2015 by snicklin Quote Link to comment Share on other sites More sharing options...
snicklin Posted December 17, 2015 Author Share Posted December 17, 2015 Please ignore the above post. I think that it is better if I just load the data in from file. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.