jum Posted February 20, 2019 Share Posted February 20, 2019 (edited) 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 February 20, 2019 by jum Quote Link to comment Share on other sites More sharing options...
42bs Posted February 20, 2019 Share Posted February 20, 2019 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. Quote Link to comment Share on other sites More sharing options...
+karri Posted February 20, 2019 Share Posted February 20, 2019 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. Quote Link to comment Share on other sites More sharing options...
42bs Posted February 20, 2019 Share Posted February 20, 2019 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. 1 Quote Link to comment Share on other sites More sharing options...
jum Posted February 20, 2019 Share Posted February 20, 2019 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"? Quote Link to comment Share on other sites More sharing options...
42bs Posted February 20, 2019 Share Posted February 20, 2019 (edited) 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 February 20, 2019 by 42bs 1 Quote Link to comment Share on other sites More sharing options...
+karri Posted February 20, 2019 Share Posted February 20, 2019 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 1 Quote Link to comment Share on other sites More sharing options...
42bs Posted February 20, 2019 Share Posted February 20, 2019 Wow, cool, an sprintf to generate labels. Quote Link to comment Share on other sites More sharing options...
jum Posted February 21, 2019 Share Posted February 21, 2019 And ca65 macros for Lynx-specific functions (like INITMIKEY, INITSUZY, FRAMERATE 60 etc) ??? Do they exist? Quote Link to comment Share on other sites More sharing options...
+karri Posted February 21, 2019 Share Posted February 21, 2019 There is similar asm routines that could be called by macros in cc65/libsrc/lib/lynx. But I have not seen anything except _IF/_ELSE stuff. 1 Quote Link to comment Share on other sites More sharing options...
Igor Posted March 27, 2019 Share Posted March 27, 2019 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(). 3 Quote Link to comment Share on other sites More sharing options...
42bs Posted March 28, 2019 Share Posted March 28, 2019 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? Quote Link to comment Share on other sites More sharing options...
Igor Posted March 28, 2019 Share Posted March 28, 2019 Not a bad idea with the colour picker. I used this approach because I used a palette export file from GIMP so my colours were already picked Quote Link to comment Share on other sites More sharing options...
+karri Posted March 28, 2019 Share Posted March 28, 2019 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. Quote Link to comment Share on other sites More sharing options...
Igor Posted March 28, 2019 Share Posted March 28, 2019 I've not used sp65 yet, been using sprpck instead...I see the '--dump-palette' option in the github version of cc65, is that pretty much what you're after? Quote Link to comment Share on other sites More sharing options...
Turbo Laser Lynx Posted March 28, 2019 Author Share Posted March 28, 2019 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! I added the link to the top post. 1 Quote Link to comment Share on other sites More sharing options...
42bs Posted March 28, 2019 Share Posted March 28, 2019 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 ... Quote Link to comment Share on other sites More sharing options...
+karri Posted March 28, 2019 Share Posted March 28, 2019 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, }; Quote Link to comment Share on other sites More sharing options...
Igor Posted April 29, 2019 Share Posted April 29, 2019 I've started putting together this page - https://atarigamer.com/pages/atari-lynx-programming-resources Based on feedback from some people I discussed it with, I've added general 6502/C tutorial links as well as some game development tutorials that I found useful in the past. 1 Quote Link to comment Share on other sites More sharing options...
Nop90 Posted December 1, 2019 Share Posted December 1, 2019 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 Quote Link to comment Share on other sites More sharing options...
Nop90 Posted December 1, 2019 Share Posted December 1, 2019 Found it in the sources: 0xfd97 Quote Link to comment Share on other sites More sharing options...
OldAtAtari Posted August 3, 2020 Share Posted August 3, 2020 (edited) 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 August 3, 2020 by OldAtAtari Quote Link to comment Share on other sites More sharing options...
42bs Posted August 3, 2020 Share Posted August 3, 2020 I'd go for Assembly. Simply more fun ? 1 Quote Link to comment Share on other sites More sharing options...
OldAtAtari Posted August 3, 2020 Share Posted August 3, 2020 (edited) 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 January 8 by OldAtAtari Quote Link to comment Share on other sites More sharing options...
+karri Posted August 3, 2020 Share Posted August 3, 2020 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 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.