Jump to content

Photo

Tiny Sprite Editor for Lynx


9 replies to this topic

#1 jum OFFLINE  

jum

    Chopper Commander

  • 123 posts
  • Location:Cape Town

Posted Thu Dec 14, 2017 2:43 AM

I have modified the online "Tiny Sprite Editor" ( http://tmtg.net/tinyspriteeditor/) made by Boris van Schooten, so that you can use it to create sprites for Atari Lynx.

 

Double-click the .html file in the attached zip to run it.

 

Currently you can export the sprite data as C code or ASM code (literal sprites only for now, can add RLE compressed sprites later).

 

Usage:

1. Run the .html file in Chrome (may work in other browsers too).

2. Set the "Palette" drop down to "Atari Lynx" BEFORE you draw anything.

3. Draw a pretty picture (background must be pen 0 (black))

4. In the "Text Format" dropdown, select "Lynx C code (literal)"

5. Click the "Export" button.

6. The C code will appear in the textbox at the bottom of the page.

 

Note: you cannot import C code at this stage. If you want to "Save" your sprites to work on later, then export as "Data URL".

 

Let me know how it works for you. I am sure many improvements can be made.

 

The main purpose is to make it easier to create Lynx sprites for your projects, without having to hassle with Gimp and PCX and sprpck/sp65 and bin2c...

 

Have fun!

 

Also have added to github as a fork of the original: https://github.com/j...inyspriteeditor

Attached Files


Edited by jum, Sat Dec 16, 2017 12:47 AM.


#2 karri OFFLINE  

karri

    River Patroller

  • 2,592 posts
  • Location:Espoo, Finland

Posted Thu Dec 14, 2017 2:53 AM

Such a nice editor. The literal sprites are ok for most purposes.

 

It works in Firefox too.


Edited by karri, Thu Dec 14, 2017 2:53 AM.

  • jum likes this

#3 jum OFFLINE  

jum

    Chopper Commander

  • Topic Starter
  • 123 posts
  • Location:Cape Town

Posted Thu Dec 14, 2017 3:01 AM

Such a nice editor. The literal sprites are ok for most purposes.

 

It works in Firefox too.

Thanks for testing Karri. Has some impressive features for a "Tiny" editor (Copy/Paste/Sprite sheets/Animation preview).



#4 Turbo Laser Lynx OFFLINE  

Turbo Laser Lynx

    Dragonstomper

  • 500 posts
  • Location:Finland

Posted Thu Dec 14, 2017 2:21 PM

Very nice stuff, thanks for sharing man!


  • jum likes this

#5 LordKraken OFFLINE  

LordKraken

    Chopper Commander

  • 145 posts
  • Location:Sverige

Posted Thu Dec 14, 2017 3:07 PM

Looks pretty cool but I haven't figure out how to modify the palette yet... or is it even possible? (having black for pen 0 is not optimal since pen 0 is also the transparent color).



#6 jum OFFLINE  

jum

    Chopper Commander

  • Topic Starter
  • 123 posts
  • Location:Cape Town

Posted Fri Dec 15, 2017 12:46 AM

Looks pretty cool but I haven't figure out how to modify the palette yet... or is it even possible? (having black for pen 0 is not optimal since pen 0 is also the transparent color).

You can modify the palette in the HTML source code, or add your own palette. You can change pen 0 to pink if you prefer.

 

Probably would be nice to be able to import a Lynx palette, either from C file data or from .gpl palette file. Let me know what format(s) would be most useful.

 

Also have added to github as a fork of the original: https://github.com/j...inyspriteeditor


Edited by jum, Fri Dec 15, 2017 1:33 AM.


#7 Bochum_Boy OFFLINE  

Bochum_Boy

    Star Raider

  • 50 posts

Posted Fri Aug 17, 2018 6:19 AM

Classical noob question: How do I implement a C-Struct array in a Lynx programm? I read the tutorial on the sprite with .o objects, any idea how to implement a TinySprite?



#8 karri OFFLINE  

karri

    River Patroller

  • 2,592 posts
  • Location:Espoo, Finland

Posted Fri Aug 17, 2018 8:18 AM

The tiny sprite exports the bitmap as bytes.

 

unsigned char sprite_0_0[] = {
0x7,   0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 
0x7,   0x0, 0x0, 0x0, 0xf, 0x0, 0x0, 
0x7,   0x0, 0x0, 0x0, 0xff, 0x0, 0x0, 
0x7,   0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 
0x7,   0x0, 0xff, 0xff, 0xf0, 0x0, 0x0, 
0x7,   0x0, 0xff, 0xff, 0xff, 0x0, 0x0, 
0x7,   0x0, 0xf0, 0xff, 0xff, 0x0, 0x0, 
0x7,   0x0, 0xf, 0xff, 0xff, 0x0, 0x0, 
0x7,   0x0, 0xff, 0xff, 0xf, 0x0, 0x0, 
0x7,   0x0, 0x0, 0xf, 0x0, 0x0, 0x0, 
0x7,   0x0, 0x0, 0xf, 0xf, 0xf, 0xf0, 
0x7,   0x0, 0x0, 0x0, 0x0, 0x0, 0xf0, 0x00
}
In the cc65 library _suzy.h you have different type of sprite structs like:
 
typedef struct SCB_REHVST_PAL {             // SCB with all attributes
  unsigned char sprctl0;
  unsigned char sprctl1;
  unsigned char sprcoll;
  char *next;
  unsigned char *data;
  signed int hpos;
  signed int vpos;
  unsigned int hsize;
  unsigned int vsize;
  unsigned int stretch;
  unsigned int tilt;
  unsigned char penpal[8];
} SCB_REHVST_PAL;
static SCB_REHVST_PAL Sastonmartin = {
    BPP_4 | TYPE_NORMAL,REHVST|LITERAL,NO_COLLIDE,
    0,
    sprite_0_0,
    80, 100,
    0x100, 0x100,
    0x000, 0x000,
    {0x01,0x23,0x45,0x67,0x89,0xab,0xcd,0xef}
};
 
Then you can paint this on screen with:
 
tgi_sprite(&Sastonmartin);
tgi_updatedisplay()


#9 Bochum_Boy OFFLINE  

Bochum_Boy

    Star Raider

  • 50 posts

Posted Tue Aug 21, 2018 2:04 AM

Thanks Karri - that made the trick!



#10 SlidellMan OFFLINE  

SlidellMan

    Moonsweeper

  • 317 posts
  • Location:Slidell, Louisiana

Posted Mon Aug 27, 2018 5:11 PM

Not a bad tool, if I do say so myself.






0 user(s) are browsing this forum

0 members, 0 guests, 0 anonymous users