Well, I'm back! After a looooooooong period of silence!

I have a project that's 75% done, which I'll announce very, very soon. It's an 83+/84+ game in application form. The program is written so that compressed picture data doesn't have to fit entirely in one page -- the data can start on one page and finish on another page. The problem is, for now, if I have 2400 bytes of picture data and only 1000 will fit on a page, I have to manually copy and paste the other 1400 bytes of data onto the next page. It would be nice if this process were automatic. I'm currently using spasm and app.inc, but I'll gladly switch compilers if the compiler can automatically say "Ah, there's not enough space on page 1 for this data. Let's put the rest of the data on page 2." Any suggestions?

P.S. I'd rather not use AppVars for this purpose if it can be avoided.
Hot Dog! Very long time no see!
I'd probably have to see your project setup though in order to see what can be done to assist.
Example (spasm with app.inc)

;Variables

#include "c:/main.asm"

defpage(1)

#include "c:/Levels.asm" ;13000 bytes
#include "c:/Level1Tiles.asm" ;4000 bytes of compressed picture data

defpage(2)
#include "c:/Level2Tiles.asm"
#include "c:/Level3Tiles.asm"

Spasm spits out an error that says "Page 1 overflow by 700 bytes" and refuses to finish compiling the program. Instead, I want it to take the other 700 bytes and move them to the beginning of page 2.
Are you using plain old spasm or spasm-ng? I don't see any error message like that in spasm-ng so it may do what you expect whereas old spasm might not.
The old doggy's back =]
How mandatory are those defpage directives?
I don't know spasm at all, but maybe you could just get rid of them, and the assembler would simply put everything back to back.
That would work with Brass if the app doesn't exceed 4 pages, after what rabbitsign would automatically do the splitting work.

EDIT: Forget it, you would then struggle knowing which page to map to interact with specific data.
the_mad_joob wrote:
The old doggy's back =]
How mandatory are those defpage directives?
I don't know spasm at all, but maybe you could just get rid of them, and the assembler would simply put everything back to back.


Maybe defpage directives actually aren't that necessary. Perhaps I could use something like this, and with wabbitsign:


;Variables

#include "c:/main.asm"

relocate($4000)

StartOfPage1Data:
#include "c:/Levels.asm" ;13000 bytes
#include "c:/Level1Tiles.asm" ;4000 bytes of compressed picture data
EndOfPage1Data:

relocate($4000+StartOfPage1Data-EndOfPage1Data)
StartOfPage2Data:
#include "c:/Level2Tiles.asm"
#include "c:/Level3Tiles.asm"
EndOfPage2Data
If spasm supports that trick, why not.
As long as the code is able to map the right page to access the data, that should do it.
Beware of a potential trap though, which is that the code might not handle the possibility that one tile exists on multiple pages.
the_mad_joob wrote:

Beware of a potential trap though, which is that the code might not handle the possibility that one tile exists on multiple pages.


Fair point, although I've already taken this into account. The decompression routine I'm using will automatically detect a page change and switch to the next page, and of course once the decompressed data is in RAM, there's nothing else to worry about.
the_mad_joob wrote:
The old doggy's back =]
How mandatory are those defpage directives?
I don't know spasm at all, but maybe you could just get rid of them, and the assembler would simply put everything back to back.
That would work with Brass if the app doesn't exceed 4 pages, after what rabbitsign would automatically do the splitting work.

EDIT: Forget it, you would then struggle knowing which page to map to interact with specific data.


Thank you, the_mad_joob! Taking out the defpage directives and using wabbitsign has solved the problem.
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 1 of 1
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement