Jump to content

Photo

Atari Lynx programming tools and tutorials (wip)


43 replies to this topic

#1 Turbo Laser Lynx OFFLINE  

Turbo Laser Lynx

    Dragonstomper

  • 540 posts
  • Location:Finland

Posted Mon Sep 5, 2016 2:58 PM

Atari Lynx programming 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 assembler)
     - This is the older version of cc65 for the lynx.
     - Fairly easy to set up on Windows. (I've had it running on XP and 8.1) I will put up windows version somewhere.
     - add link(s)
     - I will add 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.
     - Note: sage's remarks on chipper and the BLL kit: http://atariage.com/...-wip/?p=4012070
 
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 
- CC65 (mostly C) the newer CC65 "Remake" and further updated one.
     - LX.net tutorial for setting it up on Windows with Visual studio
     - Easy to set up on Linux / Raspberry Pi. http://atariage.com/...-wip/?p=4011786
     - Is there a place where we could host the rather big premade Lynx Raspberry Pi SD cart image with CC65/Retropie installed?
 
Templates for 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:
 
     - Another nice (but old) game template for starting out:PegsolitaireV1.4.zip (the one furthest down)
 
 
     - Karri among others have been updating this version and creates great tools for it.
     - Chipper also exports for this version of CC65 (thanks sage!)
 
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 
Graphics:
- Tiny Sprite Editor for Lynx: http://atariage.com/...lynx/?p=3911758
- 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.c...lette-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"
     - Chipper getting started guide: http://atariage.com/...-wip/?p=4137925
     - add documentation / more documentation would be needed
     - can convert simple mods to Lynx
 
- abc music, ascii notation for creating Lynx music and sfx
     - 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: 
- Menu for RetroHQ sd cart: http://atariage.com/...d-cart-menu-14/
 
Cartridge programmer:
- Karri's cart burner/programmer for producing real Lynx cartridges of your games:
 
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)
     - Note: Some remarks to handy sound: http://atariage.com/...-wip/?p=4012070
- Developer Handy (a tutorial how to use it would be great). Add Link.
- mednafen
 
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:
- 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:
 
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

Attached Files


Edited by Turbo Laser Lynx, Mon Apr 29, 2019 3:48 AM.

  • jum likes this

#2 LordKraken ONLINE  

LordKraken

    Chopper Commander

  • 155 posts
  • Location:Sverige

Posted Mon Sep 5, 2016 3:46 PM

Nice! I have been lost a couple of time amongst all lynx resources and tools. This is definitely useful!


Edited by LordKraken, Mon Sep 5, 2016 3:47 PM.


#3 karri OFFLINE  

karri

    River Patroller

  • 2,693 posts
  • Location:Espoo, Finland

Posted Mon Sep 5, 2016 11:36 PM

A small note about Shaken. I am continuing development on this one in the trunk. If you want to compile something playable get an earlier snapshot of it. The idea is to make a real game out of this.

#4 Turbo Laser Lynx OFFLINE  

Turbo Laser Lynx

    Dragonstomper

  • Topic Starter
  • 540 posts
  • Location:Finland

Posted Tue Sep 6, 2016 1:21 AM

@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/...red/?hl= shaken


Edited by Turbo Laser Lynx, Tue Sep 6, 2016 1:22 AM.


#5 Turbo Laser Lynx OFFLINE  

Turbo Laser Lynx

    Dragonstomper

  • Topic Starter
  • 540 posts
  • Location:Finland

Posted Fri Apr 20, 2018 2:41 PM

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

 

Easy as pie!

 

git clone https://karri@bitbuc...rilynx/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, Sat Apr 21, 2018 1:17 PM.


#6 karri OFFLINE  

karri

    River Patroller

  • 2,693 posts
  • Location:Espoo, Finland

Posted Sat Apr 21, 2018 1:34 AM

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, Sat Apr 21, 2018 1:58 AM.


#7 sage OFFLINE  

sage

    Stargunner

  • 1,007 posts
  • Location:Germany

Posted Sat Apr 21, 2018 2:34 AM

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.



#8 Turbo Laser Lynx OFFLINE  

Turbo Laser Lynx

    Dragonstomper

  • Topic Starter
  • 540 posts
  • Location:Finland

Posted Sat Apr 21, 2018 1:16 PM

Thanks for adding info guys! :waving:



#9 Turbo Laser Lynx OFFLINE  

Turbo Laser Lynx

    Dragonstomper

  • Topic Starter
  • 540 posts
  • Location:Finland

Posted Sat Oct 20, 2018 6:22 AM

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:
tracker arrows.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:
simple instrument arrows.jpg
 
Manual for the more technically minded:
I attached a pdf manual I found on the internet by cTrix^disasterarea

Attached Files


Edited by Turbo Laser Lynx, Sat Oct 20, 2018 6:29 AM.


#10 karri OFFLINE  

karri

    River Patroller

  • 2,693 posts
  • Location:Espoo, Finland

Posted Sun Jan 27, 2019 7:20 AM

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.



#11 Greenious OFFLINE  

Greenious

    Chopper Commander

  • 241 posts
  • -= Elite =-
  • Location:Sweden

Posted Mon Jan 28, 2019 5:38 PM

This might interest some of you :

 

http://www.chibiakumas.com/6502/

 

Site dedicated to Learn Multi platform 6502 Assembly Programming, covering Lynx aswell as other platforms.



#12 sage OFFLINE  

sage

    Stargunner

  • 1,007 posts
  • Location:Germany

Posted Tue Jan 29, 2019 2:27 AM

yea might be a good replacement for lyxass



#13 karri OFFLINE  

karri

    River Patroller

  • 2,693 posts
  • Location:Espoo, Finland

Posted Tue Jan 29, 2019 3:38 AM

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).



#14 karri OFFLINE  

karri

    River Patroller

  • 2,693 posts
  • Location:Espoo, Finland

Posted Tue Jan 29, 2019 3:46 AM

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, Tue Jan 29, 2019 3:52 AM.


#15 Turbo Laser Lynx OFFLINE  

Turbo Laser Lynx

    Dragonstomper

  • Topic Starter
  • 540 posts
  • Location:Finland

Posted Tue Jan 29, 2019 4:25 AM

Hey, thanks for adding these tips! I added links to them in the first post under 'cc65 tips'.



#16 sage OFFLINE  

sage

    Stargunner

  • 1,007 posts
  • Location:Germany

Posted Tue Jan 29, 2019 10:23 PM

I use a patched dcc6502 for disassembly. the code produced can directly reassebled with lyxass.



#17 necrocia ONLINE  

necrocia

    Dragonstomper

  • 550 posts

Posted Wed Jan 30, 2019 4:10 AM

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.



#18 42bs OFFLINE  

42bs

    Moonsweeper

  • 326 posts
  • Location:Germany/Southest West

Posted Mon Feb 4, 2019 1:49 AM

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


#19 karri OFFLINE  

karri

    River Patroller

  • 2,693 posts
  • Location:Espoo, Finland

Posted Mon Feb 4, 2019 2:33 AM

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)
;
; }
;

 



#20 jum OFFLINE  

jum

    Chopper Commander

  • 133 posts
  • Location:Cape Town

Posted Tue Feb 19, 2019 8:22 AM

yea might be a good replacement for lyxass

 

The chibiakumas stuff ( http://www.chibiakum...502DevTools.php) seems to use older version of BLL / lynxass.

 

PS: Just built lynxass 0.50 for Windows console in VS - only issue was replacing strcasecmp() with stricmp().



#21 sage OFFLINE  

sage

    Stargunner

  • 1,007 posts
  • Location:Germany

Posted Tue Feb 19, 2019 8:47 AM

0.50? hmm... seems someone has a independent numbering scheme?



#22 42bs OFFLINE  

42bs

    Moonsweeper

  • 326 posts
  • Location:Germany/Southest West

Posted Tue Feb 19, 2019 9:11 AM

 

The chibiakumas stuff ( http://www.chibiakum...502DevTools.php) seems to use older version of BLL / lynxass.

 

PS: Just built lynxass 0.50 for Windows console in VS - only issue was replacing strcasecmp() with stricmp().

 

Did you use the version from github?

 

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



#23 42bs OFFLINE  

42bs

    Moonsweeper

  • 326 posts
  • Location:Germany/Southest West

Posted Tue Feb 19, 2019 9:32 AM

 

The chibiakumas stuff ( http://www.chibiakum...502DevTools.php) seems to use older version of BLL / lynxass.

And no credit. Shame on him.



#24 jum OFFLINE  

jum

    Chopper Commander

  • 133 posts
  • Location:Cape Town

Posted Tue Feb 19, 2019 12:12 PM

 

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/...d/#entry4091378

(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, Tue Feb 19, 2019 12:14 PM.


#25 42bs OFFLINE  

42bs

    Moonsweeper

  • 326 posts
  • Location:Germany/Southest West

Posted Tue Feb 19, 2019 1:10 PM

 

No, I downloaded the version from this post (from sage) on AtariAge Lynx programming: http://atariage.com/...d/#entry4091378

(The github version seems to be 0.44/0.45)

 

Not quite. Some more fixes and changes.






0 user(s) are browsing this forum

0 members, 0 guests, 0 anonymous users