Jump to content
IGNORED

Okay... I want to learn


EricDeLee

Recommended Posts

Okay... if I were to start from scratch...

 

Square one....

 

No prior programming... nothing... nada.

 

What direction would I need to be faced at in order to start programming for the Lynx? Mind you.. it could be nothing more than wishful dreaming, but my love for the system has kind of made me want to do something for the community. I was thinking about two different games I'd like to do. One a port of a Java based game. The other... a more original port. Very exciting... but not sure if I can pull it off.

 

Again... I'm not afraid to read... learn... whatever. Just throw some general guidance at me. Possibly a "how to" guide... etc. Then I will vanish until I run into a problem! LOL :)

 

Thanks...

Link to comment
Share on other sites

I'd love to learn Lynx programming as well. I've taken a glance at the compiler tools and it made my head spin. I haven't sat down yet to try and absorb it.

 

Here's a link I found via Google. This page has links to other Lynx programming pages (including the compiler). (how many times can I say Lynx/links?)

 

 

EDIT: I guess it'd help to actually add the Lynx link (damn there I go again!)

http://jum.pdroms.de/lynx/lynxprog.html

Edited by Emehr
Link to comment
Share on other sites

The first thing is to get the proper tools. I suggest to buy a U3 memory stick. I am using a 512M stick from SanDisk. After that get my cc65.u3p compilation from my site http://sipo.fi/cc65.u3p and install that on the stick using the Install tool of the stick.

 

This package contains all usable tools for making code for the Atari Lynx. The lyxass assembler, the BLL toolkit for assembler programming, the C-compiler cc65, the graphics, joypad, keypad, music libraries. Cart linking tools, editors, handy for running the code, make-tools and so on.

 

Once you plug in the stick click on the icon cc65 and it opens a window. Type

 

source bashrc

 

After this you can run all compilers from the command line.

 

lyxass myprog.asm

 

cc65 -t lynx myprog.c

 

Then I suggest learning a little C and compiling stuff for the Lynx. Run it in Handy.

 

--

Karri

Link to comment
Share on other sites

  • 2 months later...

The first thing is to get the proper tools. I suggest to buy a U3 memory stick. I am using a 512M stick from SanDisk. After that get my cc65.u3p compilation from my site http://sipo.fi/cc65.u3p and install that on the stick using the Install tool of the stick.

 

This package contains all usable tools for making code for the Atari Lynx. The lyxass assembler, the BLL toolkit for assembler programming, the C-compiler cc65, the graphics, joypad, keypad, music libraries. Cart linking tools, editors, handy for running the code, make-tools and so on.

 

Once you plug in the stick click on the icon cc65 and it opens a window. Type

 

source bashrc

 

After this you can run all compilers from the command line.

 

lyxass myprog.asm

 

cc65 -t lynx myprog.c

 

Then I suggest learning a little C and compiling stuff for the Lynx. Run it in Handy.

 

--

Karri

 

 

I have to second Karri's suggestion for the U3 stick... for $20 at Best Buy, you can set up a simple and portable Lynx dev environment. Skip the pain of searching for all the tools, updating your environment variables to include the right paths, and so on, and focus on writing games. ;)

 

 

 

Okay... I installed everything onto my 2GB U3 memory stick.

 

I clicked on the menu where it shows I installed and got a pop up window. Now... I've typed everything you told me to type Karri... yet I get an error that says: Well... basically that I suck. LOL

 

I've got some learning to do... I'm not going to give up on this quite yet.

Link to comment
Share on other sites

You would wanna download Karri's megapack template. Here's the topic on that:

http://www.atariage.com/forums/index.php?showtopic=104103

 

unzip and save an unmodified copy of the megapack folder somewhere/anywhere for later use (if you happen to edit the first one so it wont work anymore)

 

All you need for starters actually reads in the megapak readme. How to compile etc.

 

Place a copy of the MegaPak folder on the root of c:

C:/MegaPak

 

install and start up the lynx cc65 for u3 (it's a command prompt)

 

everytime you start it up you should write

source bashrc

 

go to the right folder

cd c:/MegaPak

 

to compile/build the cart write

make

 

to check it out on handy write

handy MegaPak.lnx

 

 

 

Now you can edit mygame.c located in C:\MegaPak\mygame

 

(You might wanna use something like crimson editor which is a free text editor for programming)

 

For Hello world put in:

tgi_setcolor(2);
tgi_outtextxy(10, 10, "Hello World!");

between "tgi_sprite(&Sdoor1);" and "break;" (between line numbers 87 and 88 in mygame.c)

 

Good luck :)

Link to comment
Share on other sites

You would wanna download Karri's megapack template. Here's the topic on that:

http://www.atariage.com/forums/index.php?showtopic=104103

 

unzip and save an unmodified copy of the megapack folder somewhere/anywhere for later use (if you happen to edit the first one so it wont work anymore)

 

All you need for starters actually reads in the megapak readme. How to compile etc.

 

Place a copy of the MegaPak folder on the root of c:

C:/MegaPak

 

install and start up the lynx cc65 for u3 (it's a command prompt)

 

everytime you start it up you should write

source bashrc

 

go to the right folder

cd c:/MegaPak

 

to compile/build the cart write

make

 

to check it out on handy write

handy MegaPak.lnx

 

 

 

Now you can edit mygame.c located in C:\MegaPak\mygame

 

(You might wanna use something like crimson editor which is a free text editor for programming)

 

For Hello world put in:

tgi_setcolor(2);
tgi_outtextxy(10, 10, "Hello World!");

between "tgi_sprite(&Sdoor1);" and "break;" (between line numbers 87 and 88 in mygame.c)

 

Good luck :)

 

There is an editor included as well. Just type:

 

cd c:/MegaPak/mygame

vi mygame.c

 

And you have a pretty good editor with color coded stuff. (It is not really vi, it is Scintilla).

 

In the next version of cc65.u3p I will include the Notepad++ editor. It is the next version of the current Scintilla editor. I have added 6502 syntax highlighting, command completion and other goodies.

 

I should really write a tutorial about this. I am using lots of shortcuts myself. Like F7 builds the cart, Ctrl+F7 compiles the file I am editing, F5 runs handy etc. Running things in the editor open a new pane to the right where you see on which lines you have errors etc. Then you just click on the error to find the place in your code that is wrong.

 

To make these shortcuts work I have created a file called C:/Documents and Settings/karkak/SciTEUser.properties

command.compile.*.c=make

command.build.directory.*.c=..

command.build.*.c=make

command.compile.*.s=make

command.build.directory.*.s=..

command.build.*.s=make

 

Obviously your user name may not be karkak. In MegaPak the "build" directory is c:/MegaPak while the "compile" directory may be c:/MegaPak/mygame

 

So this system is slowly becoming a real Integrated Developement Environment for Lynx coding.

 

--

Karri

Edited by karri
Link to comment
Share on other sites

  • 3 weeks later...
This is a great thread. Thanks for the help guys, especily Karri, you have done a wonderful job. It has inspired me to learn programming on the lynx.

 

Wow. Thank you for the compliments.

 

The MegaPak template can be used for your own releases also. Just change the graphics MegaPak to something else and also change the Songbird logo at the startup screen.

 

You can also write a completely different main menu system from scratch. Just delete everything in intro/intro.c except the last routine doing the hard boot initialisation. You can then write whatever you want in the routine intro(). That is the code for the MegaPak main menu (the LOL operating system).

 

Fadest has shown the way to go by releasing Yastuna 2 for free. After MegaPak I will try to follow this route with my HeroQuest cart that I am currently working on.

 

--

Karri

Link to comment
Share on other sites

This is a great thread. Thanks for the help guys, especily Karri, you have done a wonderful job. It has inspired me to learn programming on the lynx.

 

Wow. Thank you for the compliments.

 

The MegaPak template can be used for your own releases also. Just change the graphics MegaPak to something else and also change the Songbird logo at the startup screen.

 

You can also write a completely different main menu system from scratch. Just delete everything in intro/intro.c except the last routine doing the hard boot initialisation. You can then write whatever you want in the routine intro(). That is the code for the MegaPak main menu (the LOL operating system).

 

Fadest has shown the way to go by releasing Yastuna 2 for free. After MegaPak I will try to follow this route with my HeroQuest cart that I am currently working on.

 

--

Karri

 

Your hard work certainly makes it easier for the lynx fans to get into game dev. Cant wait to see some of your games.

 

If you still need help with your Heroquest port, send me a pm. Regards Ben.

Link to comment
Share on other sites

  • 8 months later...

lost track for a while... trying to get back to this. Starting from scratch again.

 

I decided to try a few things. Just for fun.

Simple stuff though... but I'd figure I'd ask anyways:

 

In the 'Hello World' message... I decided to chage the bg to something different. Just to have a bit of fun with it.

 

Why did the colors change once I loaded it up? I have a bright yellow background and a few polka dots. Nothing too major. Of course it was still scrolling. But I'll figure that out next. I saw this line in the code... so I know I have to alter this to change the scrolling:

 

/* Scroll background down */

 

Is there a general guidance for what number stands for what color? Is that just something I'll learn while trying to learn how to Code? Just curious. Yes... basic questions... but I'm just trying to get a quick grasp of things.

Link to comment
Share on other sites

Also... perhaps some one can answer this.

 

When I first changed my background image... (away from the matrix looking thing)... it easily changed. The colors were strange... but it still changed. Now... for the life of me I can not get it to change. If still shows the background I changed to. Any clues?

Link to comment
Share on other sites

Also... perhaps some one can answer this.

 

When I first changed my background image... (away from the matrix looking thing)... it easily changed. The colors were strange... but it still changed. Now... for the life of me I can not get it to change. If still shows the background I changed to. Any clues?

 

Aha. Time for a color tutorial.

 

The easiest way to deal with colors is to let the Lynx use its default palette.

 

tgi_setpalette(tgi_getdefaultpalette());

 

Now you can ask for colors using real color names like:

 

tgi_setcolor(COLOR_BLUE);

tgi_bar(10,10,20,20);

 

This draws a blue box.

 

But if you want to really make your own colors then you need to define a real palette of your own.

 

char pal[] = {

0xNNN >> 8,

0xNNN >> 8,

0xNNN >> 8,

0xNNN >> 8,

0xNNN >> 8,

0xNNN >> 8,

0xNNN >> 8,

0xNNN >> 8,

0xNNN >> 8,

0xNNN >> 8,

0xNNN >> 8,

0xNNN >> 8,

0xNNN >> 8,

0xNNN >> 8,

0xNNN >> 8,

0xNNN >> 8,

0xNNN && 0xff,

0xNNN && 0xff,

0xNNN && 0xff,

0xNNN && 0xff,

0xNNN && 0xff,

0xNNN && 0xff,

0xNNN && 0xff,

0xNNN && 0xff,

0xNNN && 0xff,

0xNNN && 0xff,

0xNNN && 0xff,

0xNNN && 0xff,

0xNNN && 0xff,

0xNNN && 0xff,

0xNNN && 0xff,

0xNNN && 0xff

);

 

If you now want to make pen 5 to RGB value R=1 G=2 B=3 then you need to make NNN = 231. The NNN = GBR, not RGB. The entries for pen 5 has to be put into the 6th entry and the 16+6=22nd entry in the table above. You can use pens 0..15 for drawing.

 

To use pen 5 for drawing you need to do

 

tgi_setpalette(&pal);

tgi_setcolor(5);

tgi_bar(10,10,20,20);

 

--

Karri

Edited by karri
Link to comment
Share on other sites

There is an editor included as well. Just type:

 

cd c:/MegaPak/mygame

vi mygame.c

 

And you have a pretty good editor with color coded stuff. (It is not really vi, it is Scintilla).

 

In the next version of cc65.u3p I will include the Notepad++ editor. I have added 6502 syntax highlighting, command completion and other goodies.

 

That's cool! I feel stupid though not knowing about it.

 

I should really write a tutorial about this.

 

Yes please do! :D That would be super for us apprentices.

Link to comment
Share on other sites

I took the plunge and picked up a 1GB U3 stick at Best Buy and got it going on my Mac (running Windows with VMWare's Fusion). Programming for the Lynx is something I've wanted to try for many years now and I just wanted to extend a big "thank you" to Karri for these tools. I got the template code to compile and run in Handy and it was amazingly simple! That was the biggest concern I had: just getting something to build. With Karri's tools I can just focus on coding for the Lynx. Thanks, Karri!

Link to comment
Share on other sites

  • 5 months later...

Sounds interesting...but now I have a question.

 

After careful studying...I've noticed that the 520ST I plan to use for developing 7800 programs can also be used for Lynx development. Does anyone know of any documents that will teach me how to do this on a REAL ATARI 520ST and LYNX?? My idea is that if I did create 7800 programs they may be easily converted to the Lynx as well. I'm looking into it but in the meantime, a point in the right direction would be nice.

 

Also, I'm having no luck finding a 7800 console. I don't need any games for it, just the console, one ProLine controller and the neccessary hook-ups. If anyone out there has one and would be willing to part with it, please drop me a line...the ebay thing isn't working for me.

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