Jump to content
IGNORED

Atari Lynx Game Development Tools and Tutorials (wip)


Turbo Laser Lynx

Recommended Posts

Atari Lynx Game Development Tools and Tutorials (work in progress)

 

This thread is for collecting all Atari Lynx programming tools and tutorials in one place. *Work in progress*

 

*Please post in this thread if you want me to add something to this top post*

 

 

Toolchains for Lynx programming

 

*What are the pros and cons of the different setups? Please help me add reasons for using a specific setup
 
- BLL (Behind Lynx Lines) kit from Bastian Schick (mostly assembler)

 

 

- I think both version of CC65 still uses things from BLL

 

 

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

 

 

- newCC65 (C and assembly)

 

- Despite its name, this is the older version of cc65 for the lynx. Apparently it is a patched version of the cc65 from back in the 90s (how amazing/fun is that!), but it's still easy to set up and works just fine for creating Lynx games.

 

- Easy to set up on Windows if you don't want to do Linux. (I've had it running on XP and 8.1) I will put up windows version somewhere.

 

- todo: add link(s)
- todo: Simple tutorial for setting up on Windows

 

- sage has created many great tools for this version and still does.
Chipper, HiColor Engine, Slideshow builder etc.

 

 

 

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

 

- CC65 "Remake" / "Karri's CC65". (C and assembly optional)

 

 
- One of the great things about this version are the template(s) and make files that exist for this version, they pretty much make it a small game development framework for the Lynx in C.
 
- Another great thing about this version is that the template features a system for loading data from a Lynx cartridge (which is hard to set up). This means that you can for example add levels to your game and load them from cart, in other words build bigger games.

 

 

 

 

Templates for CC65 "Remake" / "Karri's CC65":

 

Karri's newest template here:
Starting point for a complete game that's loading in new parts (segments) from cart to ram

 

 

Karri's newest template with addons from Nop90:

 

 

- Karri among others have been updating this version and creates great tools for it.

 

- Chipper also exports for this version of CC65 (thanks sage!)

 

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

 

- Official up to date CC65

- Some of the guys on this forum have been using this version of CC65 too, but I'm unsure of the level of support this version has here for the Lynx. I think you have to build up a lot from scratch yourself when using this.

- LX.net tutorial for setting it up on Windows with Visual studio

 

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

- 8-bit Unity

- A high level cross development tool for various 8-bit systems including the Lynx.

- Todo: Write more details about it. I'm not well versed about it at the moment, but it looks really fab!
 

https://www.youtube.com/channel/UC1JehkCjK5MW0CtJe9YY-Lg/videos
http://8bit-unity.com/

 

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

 

Graphics:

 

 

- Gimp seems to be really nice these days https://www.gimp.org/ works nicely for Lynx graphics.

 

- Aseprite. Costs 14,99$ but is a joy to use for pixel art and supports indexed colours etc. https://www.aseprite.org/

 

- The Lynx palette is not so easy to understand if you have no experience of 12-bit indexed palette colours. Fortunately LX.net has written a nice tutorial about that too:

 

 

- Nifty palette code generator by necrocia: https://atarigamer.com/pages/atari-lynx-palette-generator

 

 

Creating music for Lynx games:

 

- Chipper, a tracker for Lynx http://lynxdev.atari.org

 

- Note: Chipper can export songs/code for all the usual 'tool chains': BLL LyxAss, NewCC65 and CC65 "Remake"

 

 

- add documentation / more documentation would be needed

 

- can convert simple mods to Lynx

 

- abc music, ascii notation for creating Lynx music and sfx (there should be versions both for newcc65 and cc65 remake).

 

- all versions available in the Lynx bitbucket:

 

 

- documentation / my notes (File attached)

 

 

- HandyMusic driver

 

 

- Documentation and/or a tutorial needed

 

 

 
Hardware:

 

Cartridges for testing your game on real Lynx Hardware:

 

- Lynx Flashcartridge RetroHQ:

 

 

 
 
Cartridge programmer:

 

 

- Karri's cart burner/programmer for producing real Lynx cartridges of your games:

 

- todo: add up to date link to 3D print for the cart

 

 

Comlynx multiplayer:

 

- Creating a Comlynx to USB cable:

 

 

- Redeye Comlynx code: https://bitbucket.org/atarilynx/lynx

 

 

Emulators for testing:

 

- Handy 1.9x with better sound. GadgetUK fixed some of the broken sound issues on Handy, cheers! (File attached)

 

 

- Developer Handy (a tutorial how to use it would be great). Add Link.

 

- mednafen
 
- A cross platform handy debugger by obschan: https://github.com/LLeny/VkHandybug

 

 

 
Tutorials:

 

LX.net's excellent Atari Lynx Programming Tutorial (Windows/Visual Studio) Pinned in this forum. This tutorial really covers a big area of Lynx programming:

 

 

 

Atari Lynx Programming Resources on Atarigamer.com

 

 

Atari Lynx original developer documentation:
 
Text online:
 
Scanned:
 
 
CC65 Tips:
 
- CC65 coding hints
 
- Advanced optimizations in CC65
 
- ca65 assembler and da65 disassembler compability tip:

 

--add-source switch in cc65 for looking into assembly files created by the compiler:

 

Other Links:

 

Atari Lynx bitbucket, tools and contributions:
https://bitbucket.org/atarilynx/lynx (Download repository)

 

Sage's Lynx page:
Chipper, HiColor Engine, Slideshow builder etc.

 

 
*Edit 20.4.2018
- Added Raspberry Pi CC65 installing instructions
- Added Karri's CC65 'Mini Manual'

 

 

*Edit 21.4.2018
- Added Karri's notes on Raspi installation
- Added sage's remarks on chipper, the BLL kit and Handy Sound

 

 

*Edit 24.9.2018
- Added Tiny sprite editor and Aseprite under Graphics

 

 

*Edit 10.10.2018
- Added Links to Atari Lynx original developer documentation

 

 

*Edit 20.10.2018
- Added Chipper notes
- Added Chipper getting started guide

 

 

*Edit 21.1.2019
- Added link to Karri's newest cc65 game template

 

 

*Edit 29.1.2019
- Added links to CC65 Tips

 

 

*Edit 28.3.2019
- Added link to necrocias palette generator

 

 

*Edit 14.4.2019
- Added link to Karri's newest template with addons from Nop90

 

 

*Edit 29.4.2019
- Added link to Atarigamer.com Atari Lynx Programming Resources

*Edit 9.8.2020
- Misc small corrections and additions
- Added links to cc65 optimisation hints
- Added 8-bit unity
 
*Edit 15.11.2023
- Added cross platform handy debugger by obschan.

 

 

Handy0.971.zip

 

Lynx abc music notation.txt

Edited by Turbo Laser Lynx
- Added cross platform handy debugger by obschan.
  • Like 1
Link to comment
Share on other sites

@LordKraken Thanks, I'm hoping it's going to be useful to someone.

 

@Karri I added your note. I wanted to add it to the list because it's a good example of memory segments and loading from cart to ram.

 

To anyone who wants to try the playable version of the game: http://atariage.com/forums/topic/223176-shaken-not-stirred/?hl=+shaken

Edited by Turbo Laser Lynx
Link to comment
Share on other sites

  • 1 year later...

Installing CC65 on a Raspberry Pi / (Linux) from https://bitbucket.org/atarilynx/lynx

 

Easy as pie!

 

git clone https://karri@bitbucket.org/atarilynx/lynx.git

cd lynx/tools sudo make -f Makefile.deb

 

The install script on Raspberry Pi compiles sp65 but it does not copy the binary to the right location /usr/local/bin so that has to be done manually.

 

*Edit *Please Note: Continues in next post in this thread :waving: or read quote right here:

 

The script generates installable packets.

 

You can then distribute the resulting cc65.deb and install it with

 

sudo dpkg -i cc65.deb

 

You also get packages lyxass and bll.

 

The packages can be uninstalled with

 

sudo dpkg -r cc65

Edited by Turbo Laser Lynx
  • Like 1
Link to comment
Share on other sites

The script generates installable packets.

 

You can then distribute the resulting cc65.deb and install it with

 

sudo dpkg -i cc65.deb

 

You also get packages lyxass and bll.

 

The packages can be uninstalled with

 

sudo dpkg -r cc65

Edited by karri
  • Like 1
Link to comment
Share on other sites

Just a remarks to handy sound:

Not all sound issues are finally fixed. This would requiere to rewrite some interrupt code.

It alse depends a bit on the output system of the emulators host, thus mednafen and retroarch sound better than handy even so they use exactly the same code.

 

The main changes in hand 0.97xxx and/to 0.98 are proper stereo and attenuation as well as experimental eeprom support. as well as getting rid of the boot rom and loading plain roms (wo lnx header).

 

Remark to chipper:

Event so chipper originally was written for the BLL sound driver, it export now to a modified BLL and TailChao music driver.

 

Remark BLL kit:

What you find on my site, are updates to the bll code and tools. E.g. lyxass does not compile for 64 bit systems and makes problems with newest compilers.

But its correct that example ocde is only for old cc65 and bll.

  • Like 1
Link to comment
Share on other sites

  • 5 months later...
Chipper - Getting Started Guide


Download Chipper v.1.7.6 from sage's site:



You might also want to download the 'HiColor Slideshow Builder' from his site, that might contain more instruments and example songs etc.


- Note: Chipper can export songs/code for all the usual Lynx programming 'tool chains': BLL LyxAss, NewCC65 and CC65 "Remake"


Chipper features/windows:

- Tracker

- Simple Instrument (Instrument/sound creation)

- Sorted by wavelength (list of all possible waveforms)

- Timeline

- Waveform editor creator

- Envelopes (tremolo, vibrato, waveform)

- Effect Editor

- Mod to lynx converter


Quick Start:


1. Eye through some general tracker basics, for example here: http://wiki.openmpt.org/Manual:_Basics

2. In every row of every column there's three cells where you can put in:

- CELL1: the number of the simple instrument you're going to use for that note. (This is really smart 'cause you can get a lot of stuff done with only four channels).

- CELL2: the note or nothing (a pause)

- CELL3: the part of the song in the playlist

3. The simple instrument is for creating sounds but there's already some good sounds in the insts folder if it proves difficult to create your own instruments.

4. There's some really great songs in the demosongs folder to look at too.

5. There's demosongs, instruments, tremolos, waveforms and vibratos in the data folder


Note: you put in the notes with the keys of your keyboard (I was clicking aroung with the mouse for much longer than I care to admit) :P


Note: you can copy one track (one fourth of a song-part) just by writing in the number on a new row in the playlist, in any of the four spaces, so that's the same thing as copying all of the notes in only one of the tracks.


Tracker Window:

post-2915-0-37455000-1540038140_thumb.jpg



Instrument creation (Simple Instrument window) notes by Karri from 'chipper sound collection' thread.

- The shifter + feedback tabs control how many states the sound has before it repeats.

- My understanding is that you need to choose sounds that have an equal length to keep them in tune related to each other.

- You can also choose sounds where the length is a multiple of each other.

- But choosing one instrument with a length of 5 and another with a length of 6 will always produce sounds out of tune.

- Some of the sounds are also symmetrical (as many 0 bits ad 1 bits in the pattern) while other are not symmetrical (the sound drifts to either max or min if you choose the integration bit on).

- Chipper has both tick boxes to choose the symmetrical waveforms and some indication of the length of the sound pattern


Karri's instrument collection:





Simple Instrument Window:

post-2915-0-60410200-1540038151_thumb.jpg



Manual for the more technically minded:

I attached a pdf manual I found on the internet by cTrix^disasterarea

LynxChipper-0.1-ENG.pdf

Edited by Turbo Laser Lynx
Link to comment
Share on other sites

  • 3 months later...

I wonder if it would be possible to have all these amazing tutorials as some kind of eBook for a tablet. Hosting them on the web is great, but sometimes it would be cool to have everything in this thread available locally. The graphical layout is good as it is now.

  • Like 2
Link to comment
Share on other sites

Actually there is also ca65 - the assembler used for cc65 programs. What is interesting here that it is compatible with da65 - disassembler. Here is a small nugget of code disassembled with da65 from RoadRiot.

 

draw_scroll_sp:
        ldx     #$AD                            ; 0587 A2 AD
        ldy     #$27                            ; 0589 A0 27
        lda     L1277                           ; 058B AD 77 12
         sta     VIDBASL                         ; 058E 8D 08 FC
        lda     L1278                           ; 0591 AD 78 12
        sta     VIDBASH                         ; 0594 8D 09 FC
        stz     SDONEACK                        ; 0597 9C 90 FD
draw_sp:stx     SCBNEXTL                        ; 059A 8E 10 FC
        sty     SCBNEXTH                        ; 059D 8C 11 FC
        lda     #$01                            ; 05A0 A9 01
        sta     SPRGO                           ; 05A2 8D 91 FC
L05A5:  lda     #$01                            ; 05A5 A9 01
        tsb     MAPCTL                          ; 05A7 0C F9 FF
        stz     CPUSLEEP                        ; 05AA 9C 91 FD
        trb     MAPCTL                          ; 05AD 1C F9 FF
        lda     SPRSYS                          ; 05B0 AD 92 FC
        lsr     a                               ; 05B3 4A
        bcs     L05A5                           ; 05B4 B0 EF
        stz     SDONEACK                        ; 05B6 9C 90 FD
        rts                                     ; 05B9 60

In order to get highly readable disassemblys of binary blobs it has a nice feature that you can feed an info file to the da65 with what you know about the code.

 

GLOBAL {
    OUTPUTNAME  "init.s";
    INPUTNAME   "file002";
    STARTADDR   $0400;
    PAGELENGTH  0;
    CPU         "65sc02";
};


RANGE { START $0400; END $0636; TYPE Code; };
RANGE { START $0637; END $127F; TYPE ByteTable; };
RANGE { START $27B0; END $27B3; TYPE AddrTable; };
LABEL { NAME "irq_handler"; ADDR $1280; };
LABEL { NAME "blackpalette"; ADDR $05BA; };
LABEL { NAME "swap_scroll_offsets"; ADDR $0560; };
LABEL { NAME "draw_sp"; ADDR $059A; };
LABEL { NAME "draw_scroll_sp"; ADDR $0587; };
LABEL { NAME "pixelsp"; ADDR $27AD; };
LABEL { NAME "pixel"; ADDR $27BD; };
LABEL { NAME "HOFFL"; ADDR $FC04; };
LABEL { NAME "HOFFH"; ADDR $FC05; };
LABEL { NAME "VOFFL"; ADDR $FC06; };
LABEL { NAME "VOFFH"; ADDR $FC07; };

The cc65 suite is already multi-platform. It even has multi-platform graphics conversion (sp65).

  • Like 1
Link to comment
Share on other sites

Don't forget the switch --add-source in cc65. If you are unhappy with the speed of your code you can always look into what kind of garbage cc65 puts out of your code.

cc65 -t lynx --add-source lvl01.c

This will produce a file lvl01.s where all C-lines are embedded in the assembly source.

 

;
; if (target_saved) {
;
L0A0B:  lda     _target_saved
        jeq     L0A10
;
; if (target_health) target_health--;
;
        lda     _target_health
        jeq     L0A10
        ldx     #$00
        lda     _target_health
        pha
        dea
        sta     _target_health
        pla
;
; }
;
L0A10:  rts

Obviously this was garbage. So I add some optimization to the compiler.

cc65 -t lynx --add-source -O3 lvl01.c

This simplifies the code considerably.

 

;
; if (target_saved) {
;
L0A0B:  lda     _target_saved
        beq     L0A10
;
; if (target_health) target_health--;
;
        lda     _target_health
        beq     L0A10
        dea
        sta     _target_health
;
; }
;
L0A10:  rts

 

 

Edited by karri
  • Like 1
Link to comment
Share on other sites

I wonder if it would be possible to have all these amazing tutorials as some kind of eBook for a tablet. Hosting them on the web is great, but sometimes it would be cool to have everything in this thread available locally. The graphical layout is good as it is now.

 

 

I've talked to several people about having a consolidated Lynx programming section over at Atari Gamer and was surprisingly met with little willingness to cooperate. I might pull info from this thread into a tutorial-like series of pages though, if only for my own benefit. Still trying to figure out how to make it easier to navigate a linked collection of pages on the website so probably should solve that first.

Link to comment
Share on other sites

Post increment/decrement is always a bad idea: You are telling the compiler: "I want to use the original value later."

; cc65 V2.17 - Git 88d1d20c
;
; ++b;
;
        ldy     #$00
        ldx     #$00
        clc
        lda     #$01
        adc     (sp),y
        sta     (sp),y

;
; b++;
;
        ldy     #$00
        ldx     #$00
        lda     (sp),y
        pha
        ina
        ldy     #$00
        sta     (sp),y
        pla
Link to comment
Share on other sites

If you use the -O flag while compiling the things look a bit different and post incrementing is better

.proc   _increment: near


.segment        "CODE"


;
; ++a;
;
        jsr     decsp1
        clc
        lda     #$01
        adc     (sp)
        sta     (sp)
;
; }
;


.proc   _increment: near


.segment        "CODE"


;
; a++;
;
        jsr     decsp1
        lda     (sp)
        ina
        sta     (sp)
;
; }
;

 

Link to comment
Share on other sites

  • 3 weeks later...

 

Did you use the version from github?

 

https://github.com/42Bastian/lyxass

 

No, I downloaded the version from this post (from sage) on AtariAge Lynx programming: http://atariage.com/forums/topic/259067-lyxass-updated/?do=findComment&comment=4091378

(The github version seems to be 0.44/0.45)

 

Correction: From chibiakuma's youtube videos ("keith s" on youtube), it looks like he's using VASM. However, his 6502 toolkit download also contains BLL and lynxass (in the Sources folder). (Interestingly, it also contains my Atari 5200 emulator "Jum52" :)

 

And yes, no credits, but I'm not too bothered as his toolkit is "training material" and it looks like he put a lot of work into it.

Edited by jum
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

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