home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
No Fragments Archive 10: Diskmags
/
nf_archive_10.iso
/
MAGS
/
ST_USER
/
1992
/
USERMR92.MSA
/
DSK_DATAKIT.DOC
< prev
next >
Wrap
Text File
|
1991-11-27
|
5KB
|
118 lines
**************************************************************************
* Data Statement Kit v0.2 *
**************************************************************************
1. Introduction
-----------------
Data Statement Kit is a handy tool for programmers of Devpac 1 and most
types of Basic. How many times have you wished that you could have an
'INCBIN' directive in Devpac 1 ? How many times have you been using GFA
Basic and wished you could put all your Machine Code Routines at the end
of your program as 'DATA' statements ? You could even put your Sprite
Files at the end of your basic program as 'DATA' statements. This saves
all the hassle of 'BLOADING' files in from disk or in Assembler having
to use GEMDOS to read in data files. What this utility does is takes a
file in and creates a new file. The new file is constructed totally of
ASCII so that you can use the 'Merge' option to include this output in
your programs. Most of you Programmers out there will know that being
able to include any file in an Assembler listing or Basic Listing saves
time and makes things easy for the programmer.
2. Features
---------------
Data Statement Kit allows the Programmer to do the following things:
1. Take ANY File less than 40 K and convert it
to mergable DATA statements that are compatible
with GFA BASIC.
2. Take ANY File less than 40K and convert it
to mergable DATA statements with line numbers
(some basics only use line numbers).
3. Take ANY File less than 40K and convert it
to mergable DC.L statements that can be used
in ANY good Assembler.
3. Merging routines into GFA Basic
---------------------------------------
Lets say for example you have coded a sprite routine and you want to
use it from a GFA-Basic Program, follow the following steps:
1. Compile the Sprite Routine in your Assembler
2. Load up DSK.PRG
3. Select Option 1
4. Select your compiled file as the input file
5. Wait a few seconds for the new file to be created
6. Select an Output Filename making sure it ends
with .LST so that you can merge it with GFA.
7. Boot up GFA Basic and press F2 (Merge)
8. Insert the disk containing the new file
9. Select the file and that's it.
10. Lots of Longword sized DATA statements will
appear in the GFA editor window.
The following GFA Basic statements show how to use the DATA from your
program:
dim code%(1000/4) ! Make a buffer for the Code
restore ! Reset Data Statement Pointer
codeaddr=varptr(code%(0)) ! Get addr of buffer
backup=codeaddr
repeat
read a ! read a longword of DATA
lpoke backup,a ! Poke it to the Buffer
backup=backup+4 ! Increment Buffer addr
until a=-1 ! Repeat until data ends
call codeaddr ! Call the code
4. Merging DATA into other basics
-------------------------------------
Some basics require line numbers so you may have to use option 2 from
the main menu. This option is no different from the above option
except that it adds line numbers. The Program will ask you for the
line starting number and this number must not be more than 30,000 for
overflow reasons. If an overflow occurs by some chance, the program
will insert (NUMBER OVER) in place of the line numbers and if this
happens try lower line number and you should be okay.
5. Creating Define Constants for Assemblers
-----------------------------------------------
Hands up who owns DEVPAC 1 like me, and wish they had an INCBIN
directive for merging files into one program ? Well you to can now
merge files into one program! Just following the same procedure
that is used for option 1 (GFA Basic) and load up DEVPAC 1. Now
simply use the INSERT FILE feature that it has and bobs your uncle
your in business, the file ends up in one program, but as Constants
in your source code.
6. Speed, Compatibility and Bug Reports
--------------------------------------------
You may notice that the conversion process is turbo fast, depending
on the size of the input file it may take a split second to 2 seconds
at most! Data Statement Kit has been tested for STE Compatibility and
it seems to work well on all ST's. A word of warning to 520 Owners is
that if you have alot of Desk acc's installed when running the program,
you may get the message (Remove Acc's and Memory Resident Programs).
This is becuase the Program requires a buffer of 200K at least to
work! Last but not least if you happen to stumble across any bugs then
don't hesitate to get in contact with me about it and remember to state
your TOS Version, RAM Size and Atari Model (STM,STFM,STE,TT).
Anyway I hope that coders, developers find this program handy.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Craig Smith
84 Lomond Place
Castlepark
Irvine
AYRSHIRE
KA12 9PG.