View Single Post
Old 13 June 2016, 20:37   #36
Mrs Beanbag
Glastonbridge Software
 
Mrs Beanbag's Avatar
 
Join Date: Jan 2012
Location: Edinburgh/Scotland
Posts: 2,243
using AMOS "Bload" command you can load arbitrary binary files into memory. You can load into a bank or into a memory address. You have to reserve the bank first, and make sure it's big enough to load the file in (otherwise unspecified bad things will happen).

if you want to automatically load a file of any length you can get the length of the file (this is quite obtuse but it's what you've got to do, unless you need your data in Chip RAM in which case you can cheat and use the Track Load instruction! It's for Tracker mods, but it doesn't check!):

Code:
Open In 1,"MyFile.txt"
LENGTH=Lof(1)
Close 1
Then reserve the bank and load the data:
Code:
Reserve as Data BANKNUMBER, LENGTH
Bload "MyFile.map", BANKNUMBER
Then you can change the bank name by
Code:
Poke$ start(BANKNUMBER)-8,"BANKNAME"
(substitute your own values for BANKNUMBER and BANKNAME there, bearing in mind the name MUST be 8 characters, pad with spaces if it is shorter) this way you can call it "Tile Map" or somesuch and see what it is when you Listbank.

Data banks will be saved along with your program, just like your Sprite and Icon banks, music banks, packed pictures &c.

Use Peek/Poke for reading/modifying the map data.
Mrs Beanbag is offline  
 
Page generated in 0.05638 seconds with 11 queries