Jump to content
IGNORED

A Game Idea.


Atari Master

Recommended Posts

i was messin around just makin a sound pitch thing where each joystick direction makes a different pitch to annoy the dog because she freaks out at high pitched noises.. i figured i would try the paddle thing, as I never knew how to program paddle sounds... on line 20 i got an ERROR then it listed the line.. did I forget to define something, or does the XEGS just not like me?

Link to comment
Share on other sites

Way to go on the Basic tutorial Nukey!

 

Liquid Sky - if you're still stuck, could be zeros and o's problem. all but the sound and goto should be zeros. Just double check

 

Cool idea for a game Atari Master. Remember clearly something similar on 8-bit, instead of more balls, the walls shrunk each round. It was a great game - very addictive gameplay. Can't remember what it was called - Think it was a type in listing from a UK mag..

Link to comment
Share on other sites

liquid_sky--

If Basic is giving you an error message just after you enter a line, it means that it didn't understand what was typed. This is usually a typo, but could also be a missing parentesis, comma, etc. (Basic expects something to be there, and it's not).

 

Was it this line? 20 SOUND 0,PADDLE(0),10,10 : GOTO 10

Double-check to see that all the commas are there.

Link to comment
Share on other sites

calamari--

The problem with DLI's (especially if used in Basic) is that you don't have a lot of cycle time to update on a given scanline. You usually only have enough time to grab a couple of values at a time and store them...so working in four values at a time would be a challenge (if at all possible). If you overstay your DLI, Antic will butt in and take over. Since m/l is so quick, you could forgo DLI's in favor of displaying objects on seperate refreshes. Naturally, this would be impossible in Basic. There's a couple of routines that do two values per DLI in this forum a while back (I think it's one of Cafeman's "Koffi" threads).

Link to comment
Share on other sites

BTW one trick involving DLI's would be to have an increasing number of horizontally-moving objects... and just have one or two others moving diagonally. The DLI's would only require one player object (since the horizontally-moving sprites never cross each other's path). This could make the game just as challenging IMO.

Link to comment
Share on other sites

lol

Try this one and you can bug him "in stereo".

 

10 VOL=(1-PTRIG(0))*10 : SOUND 0,PADDLE(0),10,VOL : SOUND 1,PADDLE(0)+4,10,VOL : GOTO 10

 

 

Keep in mind that if you use a paddle to control volume, the maximum that is allowed in the SOUND command is 15. So you will need to divide the paddle value by 15 or so. i.e...

VOL=PADDLE(1)/15

 

Dividing a paddle value can also be a great way of eliminating "jitters" (I wonder why Atari didn't use this more often?)

PDL=INT(PADDLE(1)/2)*2

In machine language, you would simply AND #$FE

This has the effect of changing any odd number to the lower even number.

 

"If you look...all the dials go to eleven. Right across the board." -Spinal Tap

Link to comment
Share on other sites

Here's something that was just briefly explained before...

 

INPUT and variables

 

When Basic executes the INPUT command, a question mark (?) will be printed on the screen and the program will pause until the user enters data and hits the enter key. This data will be stored in the variables shown in the line. You can also use the INPUT command to print a question that would give the user some idea as to what type of data it needs (i.e. your name, game skill level, etc.).

 

INPUT {"text";}X{,Y,Z...} There are a couple things in {brackets}, because neither is required. If "text"; is used, that text will be PRINTed on the screen before the computer waits for the user to enter something. Multiple INPUTs can also be done with one command...you must seperate each variable by a semicolon or comma (; or ,).

 

Examples:

INPUT A,B

INPUT "What is your age";AGE

INPUT "Enter coordinates";X,Y

 

Text can be put into a variable ONLY if the variable is a string variable. These variables are named just like any other variable, except that a dollar sign ($) is placed at the end (i.e. A$, NAM$, PLR0$, etc.). Unlike other Basics, Atari Basic requires that you define the length of that variable using the DIM command. This DIM command only needs to be done once, before the variable is used in the program. This can be done right at the beginning of the program, or later, but it can ONLY be done once for that variable. If it is done more than once for the same variable, the program will crash. Just as the INPUT statement, multiple strings can be dimensioned on a single line.

 

DIM A$(X) {,B$(Y),C$(Z),...} Set the length of the string variable given to be X number of characters. The DIM command is also used to set up arrays and matrixes, but I'll skip those for now.

 

Example :

DIM NAME$(15)

INPUT "WHAT IS YOUR NAME";NAME$

 

Program example...

10 DIM FL$(20),CL$(20),N$(20),ADJ$(20)

20 INPUT "ENTER A FLOWER'S NAME";FL$

30 INPUT "ENTER IT'S COLOR";CL$

40 INPUT "ENTER THE NAME OF ANYTHING";N$

50 INPUT "ENTER A WORD THAT DESCRIBES THAT";ADJ$

60 PRINT FL$; : IF FL$(LEN(FL$))="S" THEN PRINT "E";

70 PRINT "S ARE ";CL$

80 PRINT "VIOLETS ARE BLUE,"

90 PRINT N$; : IF N$(LEN(N$))="S" THEN PRINT "E";

100 PRINT "S ARE ";ADJ$

110 PRINT "AND SO ARE YOU!"

120 PRINT : GOTO 20

 

Using the method above, you could write a "story" that puts all kinds of random things in it, or make one that prints the user's name as the main character! Note how line 120 jumps back to line 20...jumping back to line 10 would cause the program to crash (since the variables are already DIMensioned).

Link to comment
Share on other sites

I've been reading this thread VERY closely, and I am an ULTRA beginner wannabe programmer of Atari 2600 too.

 

I was at The Midwest Classic talking to the maker of Warring Worms Billy Eno...

 

He gave me what I'd consider to be "insider" tips on the secrets of programming the Atari 2600.

 

After telling me his background in computer programming, and the fact that it took him a good part of a year to actually write an Atari 2600 program, he went into the nitty gritty.

 

 

He pointed at the screen of Warring Worms...we weren't playing it at the time, but he pointed to the upper left hand corner of the screen. He wanted me to understand that the whole screen was like a GRID. Each inch of the screen had to be programmed, using scanlines (X and Y axis), in the actually programming.

 

Like I don't even know Atari basic, but maybe there are coordinates like depending on the resolution of the entire screen....like 300 x 300 pixels or something.

 

So each sector had to be programmed, and then ENGAGED in the program.

 

I downloaded dasm, but it isn't doing me much good right now.

I've started to "read" The Stella's Programming Guide (1979), and that is as clear as mud.

 

I don't even know where to type in the code, or how to generate a bin file out of it for use in my emulator.

 

I'm spinning my tires just trying to grasp the simplest concepts of WHERE do you put the lines for programming, and THEN how does that go into a BIN file?

 

I can't even open my dasm, I don't know how.

Link to comment
Share on other sites

There seems to be some confusion about what Dasm does. It interprets the source code into a binary file. It doesn't help you write the code, you have to learn that beforehand (by learning machine language instructions). Once you have a source code file, you let it "assemble" it into a binary file for you by flipping to the MSdos prompt and typing:

asm filename.asm

Substitute filename.asm for the name of the source code. The output binary file will be created for you, and named as an .out file by default. You can specify your own filename by using the switch -oname:filename.bin (output name), and you can have it compile in 2600-compatable binary by using the -f3 switch. Let's assume that you wish to compile a source code called zork.asm into a 2600 binary file called zork.bin...you would type this:

asm zork.asm -f3 -oname:zork.bin

Note that the assembler doesn't actually teach you how to write...you have to learn that beforehand. The file EXAMPLE.ASM shows the syntax you should use for various commands (you can open it right into notepad to look at).

Link to comment
Share on other sites

Here's a few functions that you'll probably use often in Basic:

 

INT(X) This command is slightly different that it exists in standard math. It will eliminate any fraction in the original value. INT(3.14) is equal to 3 for example. It simply "forgets" anything to the right of the decimal point.

 

RND(X) This command will fetch a random fraction that is greater than zero, but less than 1. Contrary to how many Basics work, the number used as X is irrelivant. To get a range of values, you simply multiply it by another number. For example, 5*RND(1) will give you a random number greater than zero, but less than 5. Since fractions will still be a part of the value, many people combine this function with the integer function. INT(RND(1)*10) will give you a random whole number between 0 and 9.

 

ABS(X) This function will always return a positive value for X. ABS(-20) is equal to 20.

 

CHR$(X) will return the string character that is mapped to the X value. If you want to put the result in a variable, it must be a string variable. See the FAQ's for the Atascii codes. PRINT CHR$(0) will print a heart on the screen.

 

VAL(X$) will return the numerical value for the string variable specified. If X$ contains "123", VAL(X$) will be equal to 123. Useful if you want to prevent INPUT statements from crashing out.

 

STR$(X) does the opposite than the previous function...it changes a numerical value into a string. If X=5, STR$(X) will be "5".

Link to comment
Share on other sites

I think learning programming (or even learning assembler programming only) for the VCS is the worst idea you can have.

 

After some general programming knowledge (BASIC, C, Pascal etc.) you should start learning 650x assembler on a machine like the Atari 8 Bit computers or the C64.

 

Even the rather simple and common things like the grid layout of the screen are different (and much more complicated) for the VCS due to it's limited hardware.

 

Trying to understand everything at once will end in a disaster.

Link to comment
Share on other sites

Right you are...which is why I've been detailing the Basic language from the ground floor. Simply understanding what the machine language opcodes do is not enough (on any platform...especially the 2600). There is a lot of trial-and-error involved, and machine language often doesn't give you a clue to what you're doing wrong (where Basic frequently does). Naturally, graduating from learning Basic to writing a complete 2600 game from scratch is a mighty big leap...and it won't happen in one go.

Put in to perspective...from scratch, I can make the 2600 do this:

*beep*

...and that's about it. Hey, but I'm working at it! I mean it's as good as Sputnik could do!!

Link to comment
Share on other sites

In all seriousness, how would I create a BIN file for use in my Atari 2600 emulator that would simply make a BEEP?

 

Let me try to walk myself through it...

 

I have a text editor (with TXT extensions).

I have dasm

 

I'm ready to rock, and make the BEEP noise BIN file...

 

 

I type in something crazy goofy in the txt file like:

Text file will be named: kaz

 

$sound839

$soundon

 

I don't know what the code actually is...

 

OK, I'm ready to move on to making that code into a bin file.

 

dasm kaz.txt -f -okaz.bin

 

Yes? Does that make a beep sound when I go to "play" it on my atari emulator?

Link to comment
Share on other sites

and what WOULD be the correct code, assuming that the rest of the steps were correct?

You must start learning/understanding 6502/6507 assembler now. There where some thread on this board that tell you how to do this. But a good book or browse the week.

 

After you have mastered that task, try understanding the Stella Programmer's Guide.

 

For a simple beep, you should read the part about the AUDxx registers. Then with some assembler knowledge yoiu can start modiying "How to draw a Playfield".

 

To give you an idea what you have to learn:

The syntax of assembler is much more simplier than BASIC, but therefore you need a lot more commands. The code for a beep would look like this:

 

LDA #$0c

STA AUDC0 ; select the type of sound

LDA #$0f

STA AUDV0 ; select maximum volume

LDA #$08

STA AUDF0 ; select a frequency

 

Add that to the GameCalc subroutine of the example program (before RTS).

Link to comment
Share on other sites

Thanks for all the help Thomas, that is so complex I don't even know how to respond.

 

I guess there isn't just a tiny easy way to go through the process, just to make a simple bin file...to create a beep.

 

Not even a playfield...but you load it up and it repeatedly beeps at you only.

 

It would give me an idea at least how to use dasm to create a bin file from a text file

 

It is like me wanting to know where the car is I'll be driving...

but the person teaching me won't tell me where it is, but instead tries to teach me HOW to drive the car. Like what if I didn't even know what a car looks like at all?

 

It is true, once I actually get to the car, there's nothing I can do at that point, but it would calm me to know the steps of the process.

Link to comment
Share on other sites

It would give me an idea at least how to use dasm to create a bin file from a text file

 

Judging from above, it seems that you already know how to make a bin from a .txt file using DASM. All you need is a good .txt file with some good source code in it to do something simple right?

 

Why don't you just take the source of "how to draw a playfield". http://www.neonghost.com/the-dig/dox/nbtia_1_asm.txt, then save it to a txt file. Then try to compile it to a .bin and see how that goes? The way I see it, that's a lot of good code right there to start off on... which is what you're looking for right? Then once you got your .bin file, try running it in an emulator and whammo blammo, you compiled your first program!

 

Then you could mod that from that point because it seems from what these guys are saying, that's about as basic a 2600 program as you're going to get!

 

Just remember that anything after a ";" (colon) is a COMMENT and not compiled as part of the source. If you really want to see how it looks like just take those all out. Here's how the first few lines would look for example:

 

processor 6502

include vcs.h

org $F000

Temp = $80

PlayfieldY = $90

START

SEI

CLD

LDX #$FF

TXS

LDA #0

B1 STA 0,X

DEX

BNE B1

JSR GameInit

MainLoop

JSR VerticalBlank

JSR CheckSwitches

JSR GameCalc

JSR DrawScreen

JSR OverScan

JMP MainLoop

VerticalBlank

LDX #0

LDA #2

STA WSYNC

STA WSYNC

STA WSYNC

STA VSYNC

STA WSYNC

STA WSYNC

LDA #44

STA TIM64T

LDA #0

STA CXCLR

STA WSYNC

STA VSYNC

RTS

LDA #0

STA COLUBK ; Background will be black.

RTS

GameCalc

INC PlayfieldY ;Inch up the playfield

RTS

DrawScreen

LDA INTIM

BNE DrawScreen

STA WSYNC

STA VBLANK

 

etc. etc. etc...

 

 

So why don't you do that and THEN try and mod it to make it beep? :)

Link to comment
Share on other sites

Sounds good, I'll find this playfield source code from the net, and stick it into my text file, and then I'll do the magical dasm command, and I'll see what it does.

 

It is like I go to a bunch of classes to learn how to play the piano, but all I really want to do is to play one note on a real piano.

 

It is the difference between theory and the practical side.

 

I'm gonna go do the practical thing now.

 

I'll let you know if it turned out in disaster or not.

Link to comment
Share on other sites

I copied your code to a text file, and am going to run it through dasm to see what it does...

 

I realize what you wrote there isn't the whole code....but that site you listed just doesn't list it as nicely as you did.

 

They comment about every little thing, and so I don't know what goes first, second, or what to copy to the text file to try.

Link to comment
Share on other sites

I copied your code to a text file, and am going to run it through dasm to see what it does...

 

I realize what you wrote there isn't the whole code....but that site you listed just doesn't list it as nicely as you did.

 

They comment about every little thing, and so I don't know what goes first, second, or what to copy to the text file to try.

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