Jump to content
IGNORED

Lynx Programming


Ze_ro

Recommended Posts

I've recently become interested in Lynx programming, and was pleasantly surprised to find out that it wasn't as hard as I thought it would be (Of course, this is after I already tried my hand at programming the 2600 ). I haven't actually gotten too far into anything, but for anyone else who might be interested, I was able to write a simple paint program:

 

Downloads:

 

The program has a .o extension, but will work fine through Handy. The D-Pad moves the cursor around, which draws automatically. Press B to change colors (quickly!), and press Option 1 to clear the screen.

 

It's a very simple program, and it doesn't even use sprites or anything fancy at all, so it should be pretty simple to read as long as you know C.

 

--Zero

Link to comment
Share on other sites

Yep, pretty cool isn't it? Shows you just how easy it is to get started, and from that point, doing simple Space Invaders or other one-screen classic games is not too hard to do.

 

For your next lesson, use double buffering to swap between your displayed screen and your working screen. For an added challenge, only move the "cursor" around once per joypad press.

 

BTW, you don't need the InitIRQ or InstallUploader in your routine, and OUTSIDE == A button and INSIDE == B button.

Link to comment
Share on other sites

quote:

Originally posted by Songbird:

For your next lesson, use double buffering to swap between your displayed screen and your working screen.

 

I've never been completely clear on the idea of double buffering... is that basically just holding two copies of the screen so you can modify the currently-undisplayed one, then swap them?

 

In any case, I was planning on taking a look at sprites next... they look a little tricky, but once I get a hang of the data structure, they're probably not that hard.

 

quote
BTW, you don't need the InitIRQ or InstallUploader in your routine, and OUTSIDE == A button and INSIDE == B button.  

 

Heheh, yeah, I know about the outside/inside thing... the story behind that is that I was looking through Epyx's developer manual to figure out how to read the joystick... and the D-Pad, and both option buttons were grouped together with two bits labelled "Inside" and "Outside". I didn't know what they were at first, and since I didn't see A and B referenced anywhere, I guessed (correctly) that those were them. I was going to use A and B within the code, but I figured something like "#define A joystick&0x01" would have some ... well.. "unwanted" effects

 

As for the InitIRQ and InstallUploader stuff, they're remnants from one of the demo programs that I picked apart to figure things out. I'm guessing that InitIRQ sets up all the interrupt stuff (Which, of course, isn't used in this program), but what does InstallUploader do? Does it have something to do with the BLL stuff?

 

--Zero

Link to comment
Share on other sites

quote:

Originally posted by Ze_ro:

I was going to use A and B within the code, but I figured something like "#define A joystick&0x01" would have some ... well.. "unwanted" effects


 

Obviously, don't use just A or B. Use things like in the provided header files: JOY_A for example. Same with JOY_UP, JOY_OPT1, etc.

 

what does InstallUploader do? Does it have something to do with the BLL stuff?

 

Yes, it installs the BLL loader. Which is not a bad thing to have in your program, I was merely pointing out it is not required.

 

Double buffering is quite simply: displaying one screen while drawing another. So you make all your updates to backgrounds, foregrounds, characters, etc. (usually each one a sprite), tell Suzy to paint the sprites, then display that screen. In the meantime, you start the process all over again but on a different screen buffer which is the exact same size as the first. Then you merely need to swap buffer pointers between screen refreshes.

Link to comment
Share on other sites

Actually it would be cool to start collecting this knowledge, it could be the beginning of a new Lynx developer kit, if not "Lynx for Dummies". I started messing with newcc65 but I wouldn't count on me to produce anything you'd want to publish anytime soon, since I'm busy with a startup company.

 

Eric

Link to comment
Share on other sites

The InstallUploader function will enable BLL in your program, which means you can download games from your PC to Lynx RAM via a custom-made Lynx/PC cable.

 

This function has nothing to do with booting a Lynx game or making it run on a real Lynx.

 

Hope this helps...

Link to comment
Share on other sites

quote:

Originally posted by meltdown71835:

Did you use assembely language, 68k whatever that is that was used for the jaguar, or a high level language?

 

No, everything is written in simple C. Luckily, there are already some libraries out there that do most of the hard work for you (like drawing stuff on the screen). I believe Bastian Schick wrote them. Of course, you CAN still use assembly language if you want to, but it's not necessary.

 

Once all the C code is finished, I used Bastian's newcc65 compiler (a modified version of CC65) to compile it into 6502 assembly language... then another program converts that assembly into an actual binary that can be run. So, there's a bunch of programs that have to be run before you get an actual binary... but as long as you can do the C programming, passing it through a handful of programs isn't a problem

 

Carl: What exactly does the BLL loader do? I mean, this is for uploading it to an actual Lynx, right? So why does the game need to have specific code in it for that to work? (I basically only read the programming parts of the dev-kit)

 

--Zero

Link to comment
Share on other sites

lynx is really easy to code... i coded a sample programm where a 256x128x16 taquart sprite could be zoomed in & out...

 

but there is no fast emulator for it unfortunatly so i haven't done much more on it (as handy sux... )

 

if there is another emulator which runs perfect on p3 500mhz i will give a try next time...

 

1st i finish timepilot for atari 800xl

2nd i finish timepilot port for 5200

3rd i finish timepilot for a7800 or gameboy

4th maybe lynx

 

only tough shit will be gameboy because of z80... so maybe 1st all 6502 machines because the core engine & game logic are the same...

http://www.s-direktnet.de/homepages/k_nadj.../timepilot.html

 

ps. i am still in jetlag after e3... is this possible????

Link to comment
Share on other sites

steve,

 

i gave every data the .raw extension when the data has

 

a) no atari compatible binary header

b) the data structure is unique and just unique for the project (no .mic, no .tif, etc...)

 

raw data is stored in atari hardware format. f.e. the gamelogo is in raw because you can load it directly into vram.

 

try in turbo basic:

 

0 gr.15

1 open #1,4,0,"d:logo.raw"

2 bget #1,dpeek(88),7680

3 close#1

 

it should quit with an eol error but you should see the timepilot logo appearing on the screen...

 

the timepilot sprites are stored in "raw" as well but they have a slighty different data structure...

 

maybe more conventional should be ".bin" but bin means in atari world "binary executable", right?

 

i hope this helps...

 

hve

 

ps. "raw" = "raw data" = "not packed"

Link to comment
Share on other sites

just downloaded some roms for lynx...

 

shadow of the beast rocks!

 

a lot of games are quite good programmed... but what me makes wonder is that centipede sux... its more like milipede...with sidescrolling???

 

anyway... timepilot will be ported to lynx...

decision made...

 

hve

Link to comment
Share on other sites

quote:

Originally posted by Heaven/TQA:

1st i finish timepilot for atari 800xl

2nd i finish timepilot port for 5200

3rd i finish timepilot for a7800 or gameboy

4th maybe lynx

 

For whatever it's worth, here is one 7800 fan that would really like to see your timepilot version ported to the 7800. I have follwed your posts and the game looks great!

 

The 7800 needs all the games it can get.

 

Any plans for finishing Senso?

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