leuat / TRSE

Turbo Rascal Syntax Error full repo
GNU General Public License v3.0
241 stars 44 forks source link

New @Export directive for VBM sprites #168

Closed AndyHOvine closed 4 years ago

AndyHOvine commented 4 years ago

While this is initially for VBM Sprites, it will be useful for other situations and build targets. Later on I want to make a local S/W sprite feature that uses less RAM and would work on any Commodore machine inc, C64, Plus4 etc..

Anyway the detail of this request, add a new @ export directive to take data out of a TRSE character editor and produce BIN data in a required format.

@vbmsprExport startChar, CharWidth, CharHeight, ShiftIndex, AddressToStoreShiftedSpriteAt

This creates just one small BIN file.

eg: @vbmSprExport 100, 2, 2, 4, $2400

This would export from character 100, a 2 x 2 character, shifted 4 pixels * (see note) and stored at $2400

  1. Create a block of memory that is big enough for 3x2 characters (as shifting requires one extra character column)

  2. From character 100, extract 100, 140, 101, 141 in that order (the full screen char editor is 40 chars wide, char 140 is directly beneath 100)

  3. shift these characters by 4 pixels to the right and store in the 3x2 memory reserved in step 1.

  4. Save this 3x2 memory to a BIN file and load in to the TRSE program.

The programmer can then do one of two things:

1) use multiple exports for each preshifted frame 2) or use a different character for each preshifted frame (producing animation like in Jet Set Willy when he walks) * hope that makes sense.

AndyHOvine commented 4 years ago

BTW, char width and height could be a value from 1 to (a big number) - eg: say 10.

AndyHOvine commented 4 years ago

Example - exporting an 8x16 sprite character set. Imagine the TRSE character editor was only 6 characters wide for this example...

image

AndyHOvine commented 4 years ago

I'll close this - Think of a simpler export that we can use for VBM, for double height character mode (vic 20) and for other purposes in the future!