Jump to content
IGNORED

Atari Lynx Game Development Tools and Tutorials (wip)


Turbo Laser Lynx

Recommended Posts

Excuse my ignorance, but I'm looking for information on how to set up / configure lynxass / BLL so I can build the hello_a.asm example. (I'm getting "Unsolved labels"error when I run lynxass).

 

Is there a best/latest version of BLL I can download, and some documentation on how to build a simple example? (BLL download on http://www.monlynx.de/lynx/bll.htmlis broken).

 

Alternatively is there any info/examples of how to build simple example using ca65?

 

Thanks and apologies if I am missing something obvious.

 

Edit: Nevermind - got it working by including the right macros/vardefs/includes.

Edited by jum
Link to comment
Share on other sites

Excuse my ignorance, but I'm looking for information on how to set up / configure lynxass / BLL so I can build the hello_a.asm example. (I'm getting "Unsolved labels"error when I run lynxass).

 

Is there a best/latest version of BLL I can download, and some documentation on how to build a simple example? (BLL download on http://www.monlynx.de/lynx/bll.htmlis broken).

 

Oh, yes, thanks for the info.

I am currently working on an update of BJL and BLL but should put at least something on the page.

 

Maybe I should put an .exe on the lyxass page.

Link to comment
Share on other sites

I have been using similar macros for developing asm code using ca65. Sage wrote some nice if/else macros for ca65. But it would be nice to be able to write structural assembly that compiles on ca65 as well. I don't have anything against using lyxass. It is just that linking lyxass object with cc65 objects does not really work so well.

 

So I wonder if BLJ and BLL could be extended to BLC also? (C - for linkable with C-code)

 

I really like the idea of structural assembly. It makes reading the code much easier.

Link to comment
Share on other sites

So I wonder if BLJ and BLL could be extended to BLC also? (C - for linkable with C-code)

 

I really like the idea of structural assembly. It makes reading the code much easier.

 

You mean, using an intermediate object format?

I doubt that this is an easy task to do.

For the Jaguar I do not see much of a benefit, as you can always export the symbols from lyxass and then import them in a stub assembly file together with the binary.

The GPU/DSP code needs to run in the internal RAM anyway, so not much of a code movement.

 

For cc65, this would be interesting. But it is likely easier to change ca65 to accept lyxass macro syntax.

  • Like 1
Link to comment
Share on other sites

I have been using similar macros for developing asm code using ca65.

 

I really like the idea of structural assembly. It makes reading the code much easier.

 

Do you have Lynx libs / macros you use with ca65? (I have a cc65 installation, which only has asminc/lynx.inc).

 

Or even a "ca65 Lynx toolkit"? (wishful thinking :) )

 

What is "structural assembly"?

Link to comment
Share on other sites

 

What is "structural assembly"?

 

Something like this:

  bit MATHE_AKKU
  _IFMI
    inc temp
    _IFEQ
      inc temp+1
    _ENDIF
  _ENDIF

Like in Pascal.

The macros hide the the branches.

 

Or:

 ldx #16
 _WHILENE X
   sta $fda0-1,x
   dex
 _WEND

See if_while.mac

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

You can actually see the ca65 macros in both sage's chipper and my abcmusic. They are identical to 42bs BLL macros. But only a small subset exists.

 

        lda SndActive,x
        _IFNE
                lda SndEnvVol,x
                _IFNE
                        phx
                        jsr SndChangeVol
                        plx
                _ENDIF
                lda SndEnvFrq,x
                _IFNE
                        phx
                        jsr SndChangeFrq
                        plx
                _ENDIF
                lda SndEnvWave,x
                _IFNE
                        phx
                        jsr SndChangeWave
                        plx
                _ENDIF
                jsr SndGetCmd
        _ENDIF
        plx
        dex

The only macro-kit that I have seen for ca65 is made by sage. But there is no while construct or other BLL goodies.

 

;----------------------------------------------------------------------------
; Macros
;


if_count        .set    0
nest_count      .set    0


.macro  _IFNE
        if_count        .set    if_count +1
        nest_count      .set    nest_count +1
        beq             .ident (.sprintf ("else%04d", if_count))
        .ident (.sprintf ("push%04d", nest_count)) .set if_count
.endmacro


.macro  _IFEQ
        if_count        .set    if_count +1
        nest_count      .set    nest_count +1
        bne             .ident (.sprintf ("else%04d", if_count))
        .ident (.sprintf ("push%04d", nest_count)) .set if_count
.endmacro


.macro  _IFMI
        if_count        .set    if_count +1
        nest_count      .set    nest_count +1
        bpl             .ident (.sprintf ("else%04d", if_count))
        .ident (.sprintf ("push%04d", nest_count)) .set if_count
.endmacro


.macro  _IFPL
        if_count        .set    if_count +1
        nest_count      .set    nest_count +1
        bmi             .ident (.sprintf ("else%04d", if_count))
        .ident (.sprintf ("push%04d", nest_count)) .set if_count
.endmacro


.macro  _IFGE
        if_count        .set    if_count +1
        nest_count      .set    nest_count +1
        bcc             .ident (.sprintf ("else%04d", if_count))
        .ident (.sprintf ("push%04d", nest_count)) .set if_count
.endmacro


.macro  _IFCS
        if_count        .set    if_count +1
        nest_count      .set    nest_count +1
        bcc             .ident (.sprintf ("else%04d", if_count))
        .ident (.sprintf ("push%04d", nest_count)) .set if_count
.endmacro


.macro  _IFCC
        if_count        .set    if_count +1
        nest_count      .set    nest_count +1
        bcs             .ident (.sprintf ("else%04d", if_count))
        .ident (.sprintf ("push%04d", nest_count)) .set if_count
.endmacro


.macro  _ELSE
        bra     .ident (.sprintf ("endif%04d", .ident (.sprintf ("push%04d", nest_count))))
        .ident  (.sprintf ("else%04d", .ident (.sprintf ("push%04d", nest_count)))) := *
.endmacro


.macro  _ENDIF
        .if .not .defined( .ident (.sprintf ("else%04d", .ident (.sprintf ("push%04d", nest_count)))))
                .ident  (.sprintf ("else%04d", .ident (.sprintf ("push%04d", nest_count)))) := *
        .endif
        .ident  (.sprintf ("endif%04d", .ident (.sprintf ("push%04d", nest_count)))) := *
        nest_count      .set    nest_count -1
.endmacro
  • Like 1
Link to comment
Share on other sites

  • 1 month later...

I've made this palette generator that I found useful when I was working on a game. Decided to put it up online for others to use now...

 

https://atarigamer.com/pages/atari-lynx-palette-generator

 

It creates an array of colours that can be passed into tgi_setpalette().

 

Ok for a starter ;-) Next would be a colour-picker, right?

Link to comment
Share on other sites

I've made this palette generator that I found useful when I was working on a game. Decided to put it up online for others to use now...

 

https://atarigamer.com/pages/atari-lynx-palette-generator

 

It creates an array of colours that can be passed into tgi_setpalette().

 

Very nice! Nifty tool! :thumbsup: I added the link to the top post.

  • Like 1
Link to comment
Share on other sites

What about adding the Lynx palette to sp65 output? Currently it outputs only the bitmaps. But we could build in a new keyword to also export the palette to the C-file.

sprpck does it "-p[0..2]", so if sp65 is derived from it ...

Link to comment
Share on other sites

sprpck does it "-p[0..2]", so if sp65 is derived from it ...

 

Actually the sp65 has nothing from sprpck. I wrote the stuff directly from the doc's and so it has completely different optimisations as well. Sometimes it mixes literal packing with runlength to save space. It also produce shaped sprites that allow for 16 colours in a sprite that is not rectangular. The output is also C-code.

 

heart0.c : maptiles.pcx
        $(SP) -r $< --slice 0,350,7,6 -c lynx-sprite,mode=literal,ay=3 -w $*.c,ident=$*

The command line syntax has 3 options

 

-r file --slice

-c lynx-sprite,mode,ax,ay

-w filename,objectname

 

I could add a keyword "palette" to the -c section for adding the palette to the output.

 

/*
 * This file was generated by sp65 2.13.9 from
 * Slice of maptiles.pcx (7x6, 16 colors, indexed)
 */


#define heart0_COLORS       16
#define heart0_WIDTH        7
#define heart0_HEIGHT       6
const unsigned char heart0[] = {
    0x05,0x01,0x22,0x24,0x00,0x05,0x00,0x12,0x40,0x00,0x05,0x00,0x01,0x00,0x00,0x01,
    0x05,0x12,0x2B,0x22,0x40,0x05,0x12,0xB1,0xBE,0x40,0x05,0x01,0x10,0x44,0x00,0x00,
};
Link to comment
Share on other sites

  • 1 month later...
  • 7 months later...

Please remember me the address of the fake register used to identify if the code is running on an emulator.

 

I want to use it to disable the calls to the Retro HQ cart when running on Handy because it hangs with my timeout patch I use to identify if a SD cart is not present. I know that register could not be implemented on other emulators, but handy is the only one to have a problem with my modified code.

 

This way I can finally release updated roms of my games with the LynxSD_Init() call, as requesed by @SainT

Link to comment
Share on other sites

  • 8 months later...

Hello. I'm just getting started in Lynx programming. As for my background, I have some recent Perl experience, but no c++ experience, and I did some assembly 20 years ago in college.

 

I'm not sure which way to go with the Lynx learning. Starting from a clean slate, would anybody recommend c++ over assembly? Or the other way around?

 

And now that it's 2020, and many of these resources have been around for several years, is there one resource that's more up-to-date than the others?

 

I'd appreciate it if anyone could help me get started on the right foot, and even if that means assembly instead of c++, that's totally fine with me.

 

Thanks for all your help.

 

 

 

 

Edited by OldAtAtari
Link to comment
Share on other sites

On 8/3/2020 at 2:01 PM, 42bs said:

I'd go for Assembly. Simply more fun ?

And that's what we're here for, right? Maybe I'll focus on Assembly. Programming in Assembly seems like the Holy Grail of writing code. Shifting bits around back and forth in a format that regular humans can read.

Do you have any suggestions for tutorials? I started looking at this last week (by way of AtariGamer.com): https://www.chibiakumas.com/6502/?theme=print

Thanks for the advice!

 

Edited by OldAtAtari
Link to comment
Share on other sites

41 minutes ago, OldAtAtari said:

And that's what we're here for, right? Maybe I'll focus on Assembly. Programming in Assembly seems like the Holy Grail of writing code. Shifting bits around back and forth in a format that regular humans can't read. ?

Do you have any suggestions for tutorials? I started looking at this last week (by way of AtariGamer.com): https://www.chibiakumas.com/6502/?theme=print

Thanks for the advice!

 

The BLL structural assembler is really cool for programming.

 

A small example attached.

ottelo.asm

  • Like 1
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...