Hi all, QBITS PIXArt TGen Part Two
Down Load the Zip file and Install QBITSConfig and QBITS_PIXArt_TGen to win1_ or If not, you will need to change ‘win1_’ on line 1002 of QBITS_PIXArt_TGen to your preferred Drive.
If it successfully loads and runs then press any key to clear the Help screen and then ‘L’ to load the QBPIX-ELTile01_bmp file supplied. A set of Sprite Tiles displayed to screen, then Press ‘+’ to show the Sprite BITMAP in Grid Edit Mode. Pressing + or – moves forward and back through the Sprites list.
You can now switch to Screen Tile Mode by pressing ‘T’ then Press ‘A’ to add to Tile library, the Bitmap now appears in the top right Tile Viewer and the number below is incremented. Select other Bitmaps with -/+ from the loaded Sprit file. Now you can start to populate your background Screen, move cursor around and toggle ON/OFF Paint to copy Tiles to screen. Select different Tiles with Left < > Right Chevrons. As with Sprite Grid Mode you can also toggle Rubber ON/OFF to remove Tiles from background screen.
To Switch screens, Press Keys 1 to 9. Once you have created a number of screens you can Save to file. Just to make things easier a Screen File is included. Use the Load command to open and install QBPIXELScn01_bmp. This opens with screen 1, you can step through the other screens by pressing 1…9 to view the different layouts. The Tile commands (A)dd (D)elete are hopefully now obvious and control the Tile entries to the Tile Library. Displayed below is (M)APS[#]. If you now press ’M’ the background screen clears to display the Set Links screen, where each screen’s side can be linked to other screens. It can be set up for a logical A-B-C-B-A ar-rangement or become totally confusing as to where you might end up after travelling through several screen. I’ll let you experiment and find out for yourself.
Press Spacebar or Enter to return to the background displays. To Test the screen layouts Press ‘#’ hash. You will now find the cursor movement is limited to only the open spaces. If you move the cursor to one of the screen edge openings and if a screen link has been set up, the new screen will be displayed and the cursor now is place on the opposite side of the screen as in the direction of travel. For example, North connects to South of next screen. If there is no linked screen the cursor stays in present location until moved with cursors.
Have Fun…
UPDATE Notes:
In developing the code I’m taking my time over the File format and memory use. The Retro Games of the 1980’s used typical screen sizes to the QL’s 256x256 in Mode 8. The QBITS choice of a 320x192 main window was based on the 512x256 screen and space left for Headers, Menus and Guides etc.
1980’s Retro Games used 8x8 Tiles to build screen backgrounds and multiple Tiles for Sprite Characters. A screen Bitmap of 320x192 for Floating Point’s is 368,640Bytes (6Bytes/FP). For Integers 122,880 Bytes (2Bytes for each integer) with individual pixels colours represented by 1 byte this reduces to 61,440 Bytes. If we relate this to Tiles of 8x8 this is 40x24 or 960 Tiles. Most backgrounds can be sorted with maybe 10 to 20 Tile changes and having Sprite Characters of say 24x24 or 9 Tiles for each, again greatly reduces the total bytes for creating a Sprite Character including left, right, run, walk, jump changes when manoeuvring a Sprite.
For QBITS PIXEL Art I set on 32 for the number Sprite Characters (max size of 64x64x32=131,072Bytes). For storage the File Headers identify the type of ‘_bmp’ file, the first three bytes are set with QL8 or PAL which dis-tinguishes the QPC2 (SMSQ/E) Colour Palette used, the fourth (frt) the number of Frames. The fifth and sixth the individual Bitmap number of columns (cm) and rows (rm). The background colour (bg) is held in byte sev-en. Byte eight holds a check number (sz) for File further type definition.
The sz=0 identifies file with original 8 bit header, sz=1 for the 16 bit header this has an additional 8Bytes for the changes to the Colour Palette. Selecting a colour between 8 and 15 the (above 7 =white) pressing ‘P’ allows changes to the colour the Palette. These are saved with the Sprite File to provide combatable colours when re-loaded. For the Screen MAPS files sz=2 which includes data for Screen Links, Screen Maps and Tile matrix-es.36Bytes for the 9 Screens and their compass directional links. The Screen MAPS themselves are 20x12=240 Tile Positions and with 9 Screens requires 2160Bytes followed by the number of Tiles in the Library (16x16) max 96 = 24,576Bytes. Therefore, the Maximum File Size created being 8+8+36+2160+24,576=26,788.
For Screen/Tile files the variable frt (Frame Total) is swapped with tm number of Tiles.
At present the Prog uses FP and Int% variables when working with Arrays for storage. The data for bitmap files being converted into bytes for use with SBYTES/LBYTES. The Array sizes are high with floating Point numbers of a 64x64x32x6 being potentially 786,432bytes even with INT% this is 262,144Bytes. This may limit the QBITS PIXArt Prog to only run on QL Platforms with access to a megabyte of RAM or more. To reduce the amount of RAM one option to explore is use of PEEK and POKE byte entries in pre-allocated memory instead of the Arrays. This could potentially improve overall execution speeds as well as make it easier to compile.
QBITS
May The TINKERING in QL S/SuperBASIC be with YOU…
UPLOADS
QBITS_PIXELTile01_bmp is the Sprites for Background Screens Tile.
Note: When adding Tiles from a loaded Sprite File only the first 16x16 Bite will be copied across.
QBITS_PIXELScn01_bmp is a Screen file with the extended header of Screen Maps etc
Note: The Tiles Library can be added to or have Tile deleted. To add new design, they ned to be generated in Sprite Mode and copied across with Add in Tile Mode
QBITS_PIXArt_TGen is the PIXEL Art Prog with the Sprite and Background Screen Generators
Footnote: Further development Step 3 the Sprite Movement Controls will now continue into Next Year, my Christmas List keeping me busy. Have to keep the family Elf’s happy ELF and Safety and all that!
Enduring Lifelong Friends…