Jump to content
IGNORED

Lynx Developer Docs Online


Albert

Recommended Posts

LynxDocs.jpgFor all you budding Lynx programmers out there, we've just put a large slew of Lynx Developer Docs online. This is the original documentation used by Lynx developers for creating Lynx games, and contains a wealth of information on the Lynx hardware and how to write software for it. Thanks to Ray Ryland and Carl Forhan for getting this documentation into our hands. You can view a list of the individual documents and download them all here.
Link to comment
Share on other sites

sprpck | more

sprpck > help.txt

 

Surely one of those has got to work from an XP command line!? If not:

 

Usage :

sprpck [-c][-v][-s#][-t#][-u][-p#]

[-axxxyyy][-Swwwhhh][-oxxxyyy][-iwwwhhh]

[-rxxxyyy] [-z] [-Pfilename] in [out]

or

sprpck batchfile

-c       : compress color index

-v       : don't be quiet

-s       : sprite-depth 4,3,2,1 bit(s) per pixel (4 default)

-t       : type 0 = 4bit raw,  1 = 8bit raw, 2 = SPS, 3 = PCX (3 is default)

          type 4 = 1bit raw type 5 = PI1 (Atari ST), 6 = MS Windows BMP 

-u       : unpacked     (packed is default)

-p       : palette output-format : 0 - C, 1 - ASM, 2 - LYXASS(default)

-Pfilename adjust the colour palettes of input picture and given PAL-file

-axxxyyy : action point (e.g. -a200020)

-Swwwhhh : sprite width and height (input-size is default)

-oxxxyyy : offset in data (e.g. -o010200 )

-iwwwhhh : input size (not needed for PCX)

-rxxxyyy : split picture into yyy * xxx tiles

-z       : (only possible with -c) auto-set sprite-depth 

in       : input data

out      : output filename, optional, default is in.spr



Note: With -p0 the sprite is saveed as cc65-Object file !



In batchmode, lines must have the same format as in command

line-mode, only if a input-file is defined in one line it can be

omitted in the following lines.



1bit raw =  8 pels per byte ( => -s1 is default )

4bit raw => 2 pels per byte

8bit raw => 1 pel  per byte

SPS      => ASCII-hex-number per pel (blank = 0)

PCX      => either 8 bits / 1 plane or 1 bit /4 planes

PI1      => 1 bit / 4 planes , Atari ST Low Rez-format

BMP      => either 8 bits or 4 bits not RLE encoded

Link to comment
Share on other sites

now i am sticked with another problem... i have a tile map (e.g. a bitmap font) how the hell can i make tiles/sprites out of this one bitmap? sprpck has an option to do this automaticly... would much help as i dont had to cut every single char out of the bitmap...

 

hve

Link to comment
Share on other sites

From my makefile...

 

CRAFTFLAGS= -c -p0 -t6 -S032024 -a032024 -r005004

 

craft000000.obj:

sprpck $(CRAFTFLAGS) craft.bmp

 

My bitmap was 5 images/row in 4 rows. The command above produces:

craft000000.obj craft001000.obj craft002000.obj craft003000.obj

craft000001.obj craft001001.obj craft002001.obj craft003001.obj

craft000002.obj craft001002.obj craft002002.obj craft003002.obj

craft000003.obj craft001003.obj craft002003.obj craft003003.obj

craft000004.obj craft001004.obj craft002004.obj craft003004.obj

 

In C-code I use it as:

extern char *crafttbl[];

 

#asm

global _crafttbl

xref _craft000000

xref _craft000001

xref _craft000002

xref _craft000003

xref _craft000004

xref _craft001000

xref _craft001001

xref _craft001002

xref _craft001003

xref _craft001004

xref _craft002000

xref _craft002001

xref _craft002002

xref _craft002003

xref _craft002004

xref _craft003000

xref _craft003001

xref _craft003002

xref _craft003003

xref _craft003004

_crafttbl

dc.w _craft000000

dc.w _craft000001

dc.w _craft000002

dc.w _craft000003

dc.w _craft000004

dc.w _craft001000

dc.w _craft001001

dc.w _craft001002

dc.w _craft001003

dc.w _craft001004

dc.w _craft002000

dc.w _craft002001

dc.w _craft002002

dc.w _craft002003

dc.w _craft002004

dc.w _craft003000

dc.w _craft003001

dc.w _craft003002

dc.w _craft003003

dc.w _craft003004

#endasm

 

Later in the code I can then choose my bitmap with:

return crafttbl[roll + type * 5];

 

The options of sprpck are:

Usage :

sprpck [-c][-v][-s#][-t#][-u][-p#]

[-axxxyyy][-Swwwhhh][-oxxxyyy][-iwwwhhh]

[-rxxxyyy] [-z] in [out]

or

sprpck batchfile

-c : compress color index

-v : don't be quiet

-s : sprite-depth 4,3,2,1 bit(s) per pixel (4 default)

-t : type 0 = 4bit raw, 1 = 8bit raw, 2 = SPS, 3 = PCX (3 is default)

type 4 = 1bit raw type 5 = PI1 (Atari ST), 6 = MS Windows BMP

-u : unpacked (packed is default)

-p : palette output-format : 0 - C, 1 - ASM, 2 - LYXASS(default)

-axxxyyy : action point (e.g. -a200020)

-Swwwhhh : sprite width and height (input-size is default)

-oxxxyyy : offset in data (e.g. -o010200 )

-iwwwhhh : input size (not needed for PCX)

-rxxxyyy : split picture into yyy * xxx tiles

-z : (only possible with -c) auto-set sprite-depth

in : input data

out : output filename, optional, default is in.spr

 

Note: With -p0 the sprite is saveed as cc65-Object file !

 

In batchmode, lines must have the same format as in command

line-mode, only if a input-file is defined in one line it can be

omitted in the following lines.

 

1bit raw = 8 pels per byte ( => -s1 is default )

4bit raw => 2 pels per byte

8bit raw => 1 pel per byte

SPS => ASCII-hex-number per pel (blank = 0)

PCX => either 8 bits / 1 plane or 1 bit /4 planes

PI1 => 1 bit / 4 planes , Atari ST Low Rez-format

BMP => either 8 bits or 4 bits not RLE encoded

 

Does this help?

 

--

Karri

Link to comment
Share on other sites

can somebody please describe how i can use sprpck???? unfortunatly the commands scroll too fast and i don't know how to read the important "-tx" commands in XP command window.....

 

hve

 

You can scroll up/down in XP command window (I use it for my project). If you're not seeing the scrollbar, right click title bar and select properties. Then go to layout and increase the screen buffer size height.

 

Sprpck works for me fine with XP prof.

Link to comment
Share on other sites

one last riddle to solve... after tiling is no prob anymore... how can i get the colors set correctly when converting 8 color fonts into sprites? the sprpck output .pal file contains just 01,23,45,67,... and an empty "blackend" pallette... any help?

 

hve

 

ps. sorry to discuss this here and not in the programming forums...

pss. did i dreamt that the lynx can rotate sprites?`

psss. the games are brilliant for lynx... i love the "afterburner" clone...

Link to comment
Share on other sites

one last riddle to solve... after tiling is no prob anymore... how can i get the colors set correctly when converting 8 color fonts into sprites? the sprpck output .pal file contains just 01,23,45,67,... and an empty "blackend" pallette... any help?

sprpck has some problems with bmp palette.

also pi1 and neo does not work correctly in the pc version.

 

ps. sorry to discuss this here and not in the programming forums...

This IS the right place.

pss. did i dreamt that the lynx can rotate sprites?`

no, it cant.

no rotating, no tiling.

only stretching and tilting.

 

Tschau,

Sage

Link to comment
Share on other sites

Hello!

 

Send me the BMP and i'll investigate the problem.

(And the DOS-command line you used for SPRCK)

 

But you shouldn't forget that the Lynx has only 4bits per colour, so if you have used True colour pixels with very low colour values (only bits in the lower nybble set) these will all set to 0.

 

Matthias

Link to comment
Share on other sites

Mattias, i thought i convert in photoshop just the bitmap into a 16 color pcx and that's it...

 

i'll tried to tile & convert this one:

 

http://www.algonet.se/~guld1/fonts/010.gif

 

with

 

sprpcx -v -u -S016016 -r020003 filename.pcx

 

unpacked because i need that for my textroutine... so the offsets are the same for all chars...

 

another difficulty i find is... after having nearly 30 different .spr files with the separate sprites... is there a possibility to export the sprites into 1 .obj file where i can adress them with font+char*length??? and write the desired adresses into the SPCBs? (btw...same "linked list" principle does have Playstation1 & 2)

 

hve

Link to comment
Share on other sites

Hello!

 

Mattias, i thought i convert in photoshop just the bitmap into a 16 color pcx and that's it...

 

During the years we have noticed that there are PCX-files which can't be handled properly by SRPCK. I don't know why.

 

So i suggest that you use the BMP-fileformat if you are working in a Windows-environment.

 

 

i'll tried to tile & convert this one:

 

http://www.algonet.se/~guld1/fonts/010.gif

 

with  

 

sprpcx -v -u -S016016 -r020003 filename.pcx

 

I have converted this GIF to a BMP-file called HE.BMP (two-letter name because the SPRPCK will add 6 digits to identifly the tiles).

 

My command line looked like this:

sprpck -v -u -t6 -S016016 -r020003 HE.BMP

 

I got a lot of SPR-files and a palette file (in LYXASS-format) with this content:

 

he_redir:

dc.b $01,$23,$45,$67,$89,$AB,$CD,$EF

he_pal:

DP 000,DDD,9B6,204,206,429,BD9,694,64B,B9F,462,96D,000,000,000,000

 

It shows 12 colours (he_pal), the same as your GIF.

So for me it worked as expected.

 

Matthias

Link to comment
Share on other sites

another difficulty i find is... after having nearly 30 different .spr files with the separate sprites... is there a possibility to export the sprites into 1 .obj file where i can adress them with font+char*length??? and write the desired adresses into the SPCBs? (btw...same "linked list" principle does have Playstation1 & 2)

 

hve

 

You can create a library file. This is from the 3d makefile:

 

sprpck -t6 -u -s4 -a000016 -S001032 -p0 -r032001 v.bmp

del wall.olb

libr65 a wall.olb w000000.obj

libr65 a wall.olb w000001.obj

...

libr65 a wall.olb w000031.obj

 

You can reference by object name (w00000) in your cc65 based C file.

However I just changed this by having a PC editor creating one big binary file with a mapping in the beginning.

Link to comment
Share on other sites

is there a possibility to export the sprites into 1 .obj file where i can adress them with font+char*length??? and write the desired adresses into the SPCBs? (btw...same "linked list" principle does have Playstation1 & 2)

 

hve

 

Forgot the 2nd part. You could do this in your code (cc65):

 

extern char w000000[]; // or use an indexer containing addresses lo/hi

#asm

_sprObject1:

dc.b BITS4|TYPE_NORMAL,RELOAD_HV|REUSEPAL,NO_COLLIDE

dc.w _w000000, _sprObject2

dc.w 0,50

dc.w $0100,$0100

_sprObject2:

dc.b BITS4|TYPE_NORMAL,RELOAD_HV|REUSEPAL,NO_COLLIDE

dc.w _w000002,_sprObject3

dc.w 0,50

dc.w $0100,$0100

...

_sprObject30:

dc.b BITS4|TYPE_NORMAL,RELOAD_HV|REUSEPAL,NO_COLLIDE

dc.w _w000030, 0

dc.w 0,50

dc.w $0100,$0100

 

#endasm

Link to comment
Share on other sites

ok next stone on my way to lynx heaven appeared...

 

with the BLL macros, how do i implement a VBL???? as my 1st lynx attempt will be a scroller... (suprise...) now i have the font converted into sprites and now i need the VBL for drawing/scrolling/moving the sprites to get a scroller...

 

any help of the masters much appreiated.

 

hve

Link to comment
Share on other sites

Hello!

 

I know some C, found this to be somewhat interesing, just out of curiousity, not really looking at any source, is any asm required if you use the C-compiler?

 

 

Look into the C-demos (either those which come with CC65 or those on my Lynx-page, and those on Sage's page) and you'll see that you can

do some C-only programming but for efficiency reasons you should be able to do some things in 6502-asm.

At least you should be able to understand structures laid out in asm-code

(sprite control blocks).

 

Regards

Matthias

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...