Jump to content
IGNORED

Challenge: Write a game in Atari Basic under 4K


NuY

Recommended Posts

but still question. MC inside possible? or not allowed?

Not allowed ;) You can us as many tricks as you like, and put whatever values you like into whatever memory location as long as the tokenised Basic ends up no larger than 4K! Just as long as not a single line of 6502 ASM is executed outside the Basic intepreter ;)
Link to comment
Share on other sites

tempted now...

 

can I even remember how to program in BASIC though?

 

EDIT: Starting to get the hang of this using the 'paste into Altirra' method. Nobody told me about those bloody error messages in Atari BASIC (or rather the lack of...)

 

Hint: Use TurboBASIC, but use only code which will work in Atari BASIC for compatibility reasons. Turbo gives you more legible error messages. :)

Good plan, but remember that as a stock XL/XE is the target, what runs well in Turbo will run about 10x slower in Atari Basic ;)
Link to comment
Share on other sites

I'm 1.5 K over (without optimising) but the basic game concept is working - sort of... I find the hardest part creating decent sound effects! I've enjoyed getting back into programming and have learned a bit more about display lists today (I think) I have piles of atari books everywhere :D

Link to comment
Share on other sites

This is what just over 1K, about an hour of free time and 15 years without writing any BASIC gets you

post-3837-0-92010000-1345552500_thumb.png

 

It's a suprisingly hard language to return to when you've been away for so long and I can't say I miss it much

I do like a good Breakout clone; if it was only an hour and 1K of code up to now, that could be a hit :)

 

We all like a good breakout clone - when I come across one I'll let you know :)

 

It's mostly the clunky ball movement methinks - time to plumb in some PM graphics to improve things a bit...

Link to comment
Share on other sites

but still question. MC inside possible? or not allowed?

Not allowed ;) You can us as many tricks as you like, and put whatever values you like into whatever memory location as long as the tokenised Basic ends up no larger than 4K! Just as long as not a single line of 6502 ASM is executed outside the Basic intepreter ;)

 

DATA and USR allowed?

Link to comment
Share on other sites

but still question. MC inside possible? or not allowed?

Not allowed ;) You can us as many tricks as you like, and put whatever values you like into whatever memory location as long as the tokenised Basic ends up no larger than 4K! Just as long as not a single line of 6502 ASM is executed outside the Basic intepreter ;)

 

DATA and USR allowed?

DATA yes. USR means MC, and MC is bad (in the context of this!) and is banned ;)
Link to comment
Share on other sites

so I can just code it BASIC V2 style? :)

 

That's all i did really... loads of POKEs to build the display list, more to set the player up and move it horizontally, another one to write in the random block that starts appearing after a few screens and some PEEKing and POKEing of collision registers.

Link to comment
Share on other sites

NuY said "Just as long as not a single line of 6502 ASM is executed outside the Basic intepreter" - any VBI or DLI routine is going to be disallowed because, despite not being invoked directly from BASIC, it's not part of the everyday system. Now stop trying to cheat and write something already! =-)

  • Like 3
Link to comment
Share on other sites

Now to find somewhere safe to stash display lists, PMs and stuff like that...

 

Just keep 'em fairly high up, you're only using 4K of BASIC so there shouldn't be a problem.

 

Where's SIO99, i thought he'd be all over this competition like a rash!

  • Like 1
Link to comment
Share on other sites

You can reserve Ram at the top of memory easily.

 

RT=PEEK(740)-16 : POKE 106,RT : GR. 0

 

RT will have the page value of your reserved "safe" 4K. Note that 400/800 OS has a bug where a clear screen operation can sometimes go past where it should, so it's probably a good idea to not use the first 256 bytes of your reserved area.

Link to comment
Share on other sites

I have this basic program I wrote a long long time ago I thought might be good... Then I realized it's about 16K too large!

You could always update it and enter it into the abbuc software contest instead (you have until the end of the month I think.

My 4K game is nearly finished just testing the levels / difficulty :)

Link to comment
Share on other sites

Couple of hints on memory saving that might be helpful...

 

Re-use constants. Compare:-

1 N0=0:GRAPHICS N0:POKE 82,N0:SETCOLOR 2,N0,N0:? FRE(0)

with

1 GRAPHICS 0:POKE 82,0:SETCOLOR 2,0,0:? FRE(0)

 

So use a constant var if you're using the same number 4 or more times.

 

and do a

LIST "H:FILE.LST"

NEW

ENTER "H:FILE.LST"

SAVE"H:FILE.BAS"

 

at the end to rebuild the variable table and clear out any mistakes, which otherwise get remembered FOREVER.

 

I might have something half decent in a day or two!

Edited by wesmond
Link to comment
Share on other sites

I feel a little bit of a traitor but my 4K game 4K " Keep on Koastin' " has turned out much better than I expected, so I've decided to enter it into the abbuc software contest as there's still a few days to go before the deadline (may as well go for the hat-trick of last places after Gorilla Warfare and Gwobby Strikes Back!)... I can release here it once the voting has finished ;)

 

It's a simple idea but seems to play quite well... once you get an idea in your head then it's much easier to create something. Thanks for the inspiration from this thread NuY :thumbsup: now I really must make more effort to do something with the assembler :ponder:

Link to comment
Share on other sites

Here's my (first) effort - old fashioned slider puzzle, with "authentic" Windows progress bar while it initialises... FRE(0) works out at 3693 bytes. Controls: 4-way joystick. My 4-year old boy loves it... sort of.

 

I'd also note that while this is well under 4k, it is not nice! To SIO99 - from our earlier thread, I'm afraid you'd despise my code here... it's full of pokes to screen memory to keep it fast, rather than locate...position...print, which would work, but rather too sluggishly (and memory costly as well). Some lines are VERY long to save bytes, the variables are quite short, lots of constants/reuse, and the DATA for the graphics is as ASCII data, with code "155" manually fixed (as you can't type it). Even strings of 2-byte hex values took me over the limit by some 80 bytes that I just couldn't optimise out... so I converted the data to ASCII, saved 1k, and got lazy after that.

 

So, there's no machine code, but that doesn't make it pleasant to code! (in fact, I suggest, machine code would be rather easier - and a thing of beauty compared to this!)

 

Anyhow... it's been a fun challenge - I might try an action game like TMR did when I've recovered my sanity. Hope you enjoy it (for maybe a few seconds til maybe you get fed up with it!)

 

W.

SLIDER.zip

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