ZX Spectrum Next Sprite Database Manager
A downloadable tool
Sprite Database Manager (SDM)
Overview:
SDM facilitates the rapid population and alteration of Sprite data for NextBASIC programs.
SDM and its data is designed to be operated from banks. Only a small amount of code is required to be added to your programs to load the banks, allow the use of SDM and of course to utilise the sprite data as you require.
Version 1.2
This version builds on V1.1 by making additional banks (total of 5) available for sprite data storage.
Features:
Up to 5 banks of sprite data storage. Each bank contains up to 26 pages. Each page holds up to 15 sets of sprite data. This equates to data sets for 1960 sprites.
Populate and edit your sprite data and see the changes without ever having to exit the NextBASIC editor and your program.
Supports production of relative sprites.
Key Functions:
Cursor Keys - move cursor
Enter - begin editing, accept data input, exit editing
H - Display Help Page
S - Save current bank
A - Save all banks
Q - select previous bank
W - select next bank
Delete - erase column
I - insert column
C - copy column
P - paste column
J - jump to page nn (enter page number) in current bank
Database Manager Instructions:
Using a combination of cursor keys, Q, W and J, navigate to the column you wish to edit. By pressing Enter, you can begin entering in numbers within the selected column. Not all of the column needs populating - only enough to direct the sprite to be displayed if that is the intention. Refer to the NextBASIC manual for information on the commands SPRITE and SPRITE CONTINUE.
Once data input has been completed, press Enter again after accepting a data input to finish editing.
Once all data entry has been completed, press S to save current bank or A to save all banks.
For each single sprite or anchor sprite, note the address that the top most data point is stored. This is important. For relative sprites, note the number of sprites including the anchor sprite.
When entering values for RUN/STOP, enter 0 for STOP and any other number for RUN (suggest 1).
Execution:
Within your program, you need to add the following:
- lines to load the SDM and sprite data bank files into 6 banks.
- Line that will execute the SDM. Using GOTO 9200 for example will run the SDM in bank n.
- A PROC that will access the sprite data and execute the necessary commands to produce and move/animate the sprites.
All of this should be able to be merged into your existing program from the supplied SDMSetUp.bnk file.
To access a specific data set, we’ll use the following example:
A game that is being designed uses sprites to represent enemies and lifts. Some lifts are static and some move. All enemies are constructed from relative sprites.
Each room in the game has a different set of sprites for enemies and lifts. This information is stored as data:
; %r - room number, %t = numbers of lifts, %e = number of enemies, %a = address, %n = number of sprites.
3000 RESTORE %4000+r: READ %t,%e
3010 IF %t THEN FOR %l=%1 to %t:READ %a,%n:PROC spritesetup(%a,%n):NEXT %l
3020 IF %e THEN FOR %l=%1 to %e:READ %a,%n:PROC spritesetup(%a,%n):NEXT %l
~~~~~~~~~~~~~
4020 DATA %2,%1: DATA %420,%1:DATA %462,%10:DATA %882,%4
After PROC spritesetup() has been executed, all the required sprites are now configured and will function as required at the execution of each SPRITE MOVE.
Some Technical Stuff:
Each sprite data bank consists of 15750 bytes of sprite data (25 pages of 15 columns for 375 sprites) and 500 bytes for descriptions of each page of sprite data.
Sprite data is displayed in the same order that is required for the commands SPRITE and SPRITE CONTINUE in accordance with the manual.
Resource Requirements:
Banks 40-45 are utilised by SDM. 46 is used as a holding place for insert/delete functions.
Known Issues:
When exiting SDM, ensure cursor is not on the bottom row as this will cause your Next to crash.
Download
Click download now to get access to the following files:
Leave a comment
Log in with itch.io to leave a comment.