Jump to content
IGNORED

Gosub


atari2600land

Recommended Posts

Yeah thats good.!

ive also noted i can get past most levels wwith out touching the octopus as it just wanders aimlessly. i was thinking maybe if you added metal loving sharks that pop out of the water randomly combined with the octopus it would make it much harder. the sharks woudnt move, just pop up randomly

Edited by rheffera
Link to comment
Share on other sites

Michael, have you done any tinkering with the octopus yet?

I've been doing a little tinkering, but I'm not happy with the results yet.

 

One thing I'd like to suggest is that you do away with the black-and-white version-- or rather, use the "TV TYPE" switch to select between NTSC and PAL/60 versions. I don't think there's a need for a black-and-white version, and a PAL/60 version would let PAL users enjoy the game.

 

I also changed the color of the octopus. If the sub is close enough to see the octopus, it changes from blue (or the same color as the water) to purple. But if the sub gets close enough to alarm or agitate the octopus, it changes from purple to red and goes after the sub. I'll keep tinkering on the movement, and post the changes tomorrow night.

 

Michael

Link to comment
Share on other sites

Michael, have you done any tinkering with the octopus yet?

One thing I'd like to suggest is that you do away with the black-and-white version-- or rather, use the "TV TYPE" switch to select between NTSC and PAL/60 versions. I don't think there's a need for a black-and-white version, and a PAL/60 version would let PAL users enjoy the game.

OK, we can get rid of the b/w game, although I am a little sad to see it go. Plus on the other hand, there would be no need to produce 2 different carts. So what's the difference between NTSC and PAL? Just colors, then?

Link to comment
Share on other sites

Michael, have you done any tinkering with the octopus yet?

One thing I'd like to suggest is that you do away with the black-and-white version-- or rather, use the "TV TYPE" switch to select between NTSC and PAL/60 versions. I don't think there's a need for a black-and-white version, and a PAL/60 version would let PAL users enjoy the game.

OK, we can get rid of the b/w game, although I am a little sad to see it go. Plus on the other hand, there would be no need to produce 2 different carts. So what's the difference between NTSC and PAL? Just colors, then?

You don't have to get rid of black-and-white if you don't want to-- it's your game! :) I just don't know how much demand there is from people who need to play games on a black-and-white TV. It seems like a PAL/60 version would be more in demand.

 

NTSC and PAL/60 have the same number of scan lines per screen (262), but they use different color palettes. So a PAL user can play NTSC games if they display them in PAL/60 mode on their TVs, but the colors are all messed up. A game that's designed to be PAL-compatible uses the PAL color palette, so the colors will look right on PAL TVs.

 

You know, if you really want to keep black-and-white, you could have three color settings-- NTSC, PAL/60, and black-and-white (which would work on either NTSC or PAL TVs). You could use the "TV TYPE" switch to select between the NTSC or PAL color palette, and use the "GAME SELECT" switch to select between color or black-and-white:

 

Game 1 = color, without octopus

Game 2 = color, with octopus

Game 3 = black-and-white, without octopus

Game 4 = black-and-white, with octopus

 

I can make the necessary changes, if you'd like.

 

Michael

Link to comment
Share on other sites

You know, if you really want to keep black-and-white, you could have three color settings-- NTSC, PAL/60, and black-and-white (which would work on either NTSC or PAL TVs). You could use the "TV TYPE" switch to select between the NTSC or PAL color palette, and use the "GAME SELECT" switch to select between color or black-and-white:

 

Game 1 = color, without octopus

Game 2 = color, with octopus

Game 3 = black-and-white, without octopus

Game 4 = black-and-white, with octopus

Yeah, go ahead and do that. And, we'll just get rid of the timer, since it's not really needed, seeing as there's an octopus to liven things up.

Link to comment
Share on other sites

Have you had any time to work on the game lately, Michael?

I did some more editing of the code to make it a little easier for me to follow, and I have worked a bit on the octopus's color, but I think there is more work that needs to be done with the octopus's movement. Here's the code as is so far.

 

Michael

gosub012507.bas

gosub012507.bas.bin

Link to comment
Share on other sites

The next step to GoSub is translating to PAL colors and figuring out which switches to use to get between PAL and NTSC. At the same time, Mike is working on the octopus. It's true, I have been slacking off a little on it, but the main reason is because I don't want Mike to have to put new code into his already changed code for the game. I guess this could be solved by posting code changes here and saying where they go. I'll work some more on this game this week. :)

Link to comment
Share on other sites

The next step to GoSub is translating to PAL colors and figuring out which switches to use to get between PAL and NTSC. At the same time, Mike is working on the octopus. It's true, I have been slacking off a little on it, but the main reason is because I don't want Mike to have to put new code into his already changed code for the game. I guess this could be solved by posting code changes here and saying where they go. I'll work some more on this game this week. :)

I just remembered something: Batari BASIC doesn't have a way of using PAL and NTSC at the same time because at the beginning of the code, you put "set tv pal", so this would be something that would have to be done in ASM, which I have no idea how to do.

Link to comment
Share on other sites

The next step to GoSub is translating to PAL colors and figuring out which switches to use to get between PAL and NTSC. At the same time, Mike is working on the octopus. It's true, I have been slacking off a little on it, but the main reason is because I don't want Mike to have to put new code into his already changed code for the game. I guess this could be solved by posting code changes here and saying where they go. I'll work some more on this game this week. :)

I just remembered something: Batari BASIC doesn't have a way of using PAL and NTSC at the same time because at the beginning of the code, you put "set tv pal", so this would be something that would have to be done in ASM, which I have no idea how to do.

That "set tv pal" option doesn't have anything to do with the color palette, it's strictly related to the number of scan lines that get drawn on the screen-- 262 ("NTSC") or 312 ("PAL"). The so-called "PAL/60" mode uses 262 lines, just like NTSC, so there's no ASM changes needed. The only thing you have to do is change the color values that you're using to conform to whichever palette has been selected. For example, in the NTSC palette, color $38 (decimal 56) is reddish-orange, but in the PAL palette, color $38 is yellowish-green.

 

There are two ways you can handle that in your program. You can do something like the following:

 

  if !c{1} then COLUP0=$60 else COLUP0=$40
  rem * this is similar to how you handled color vs. b&w

Or you can do something like the following:

 

  dim palette=p
  if c{1} then palette=0 else palette=1
  rem * palette=0=ntsc, palette=1=pal
  COLUP0=purple_octopus[palette]
  data purple_octopus
  $60,$40
end

The advantages of the second approach are that, (1) once you've set the palette variable, you don't need to keep using if statements to determine which color to use; and (2) you can have any number of palettes that you're using, such as NTSC for TVs, NTSC for the standard Stella emulator palette, NTSC for the z26 emulator palette, PAL for TVs, PAL for the standard Stella palette, PAL for the z26 palette, SECAM for TVs, SECAM for the z26 palette, black-and-white for TVs, black-and-white for the standard Stella palette, black-and-white for the z26 palette, etc. Instead of having to use a huge series of ifs or on...goto statements, you can just say COLUxx=desired_color[palette], where the palette variable is used as an index to a color table. :)

 

Michael

Link to comment
Share on other sites

That "set tv pal" option doesn't have anything to do with the color palette, it's strictly related to the number of scan lines that get drawn on the screen-- 262 ("NTSC") or 312 ("PAL"). The so-called "PAL/60" mode uses 262 lines, just like NTSC, so there's no ASM changes needed.

Are you sure about this? I started a thread about this a while back, and thought I had PAL60 figured out (for support in Stella). So you're saying PAL60 is defined as follows:

 

1) 262 scanlines

2) 60 Hz

3) PAL palette

 

Is this correct?? Because the current Stella release assumes the following for PAL60:

 

1) 312 scanlines

2) 60 Hz

3) PAL palette

 

Is there some place where this standard is definitively documented??

Link to comment
Share on other sites

That "set tv pal" option doesn't have anything to do with the color palette, it's strictly related to the number of scan lines that get drawn on the screen-- 262 ("NTSC") or 312 ("PAL"). The so-called "PAL/60" mode uses 262 lines, just like NTSC, so there's no ASM changes needed.

Are you sure about this? I started a thread about this a while back, and thought I had PAL60 figured out (for support in Stella). So you're saying PAL60 is defined as follows:

 

1) 262 scanlines

2) 60 Hz

3) PAL palette

 

Is this correct?? Because the current Stella release assumes the following for PAL60:

 

1) 312 scanlines

2) 60 Hz

3) PAL palette

 

Is there some place where this standard is definitively documented??

I don't know about official, definitive documentation, but here are a couple of non-official references:

 

http://en.wikipedia.org/wiki/PAL (brief reference to PAL-60/525 in section on PAL-M)

 

http://www.avforums.com/forums/archive/ind...hp/t-32488.html (answer by Mr.D)

 

If you think about it for a moment and let the light bulb come on, it should become obvious. :) The TV signal can't speed up or slow down-- its rate (as measured by how many times one thing or other occurs per second) remains constant. So the only way you can increase or decrease the number of frames per second is to decrease or increase the number of lines per frame, since the number of lines per second is constant.

 

The old black-and-white NTSC standard had 262.5 lines per field, and 60 fields per second, giving a total of 15750 lines per second.

 

When the color NTSC standard was adopted, the field rate (and consequently the frame rate as well) was decreased very slightly by multiplying it times a factor of 1000/1001, giving 60 * 1000 / 1001 equals approximately 59.94 fields per second-- about 59.94 Hz, although many people continue to refer to it as 60 Hz. The line rate thus became 262.5 * 60 * 1000 / 1001 equals approximately 15734.27 lines per second.

 

The color PAL standard usually has 312.5 lines per field, and 50 fields per second, giving a total of 15625 lines per second-- very similar to the NTSC line rate.

 

If the PAL signal is divided up into 262.5 lines per field, instead of the usual 312.5 lines per field, it gives a field rate of 15625 / 262.5 equals approximately 59.52 fields per second-- which is generally referred to as 60 Hz for convenience.

 

That's for TV. The Atari is a bit different, because its signal doesn't conform exactly to the standards.

 

The NTSC TV signal has 227.5 color cycles per line, and 262.5 lines per field, so the color subcarrier frequency is 227.5 * 262.5 * 60 * 1000 / 1001 equals approximately 3579545 color cycles per second. But the NTSC Atari's signal has 228 color cycles per line, and 262 lines per field (or frame, because 1 field equals 1 frame since the screen isn't interlaced). To get the NTSC Atari's frame rate, we divide the color frequency by the lines per frame and color cycles per line, so the actual frame rate is approximately 3579545 / 262 / 228 equals approximately 59.92 frames per second.

 

The PAL TV signal has 283.7516 color cycles per line, and 312.5 lines per field, so the color subcarrier frequency is 283.7516 * 312.5 * 50 equals exactly 4433618.75 color cycles per second. But the PAL Atari's signal has 228 color cycles (or color clocks) per line, which is different than the PAL color cycles per line. The color clock rate is (about?) four-fifths of the PAL color frequency, or 4433618.75 * 4 / 5 equals 3546895 color clocks per second (although the data sheets say 3546894). So the PAL Atari has a frame rate of 3546895 / 312 / 228 equals approximately 49.86 frames per second (or 3546894 / 312 / 228, which is still approximately 49.86 frames per second).

 

If we generate the VSYNC every 262 lines on the PAL Atari, instead of every 312 lines, the frame rate is 3546895 / 262 / 228 equals approximately 59.38 frames per second (or 3546894 / 262 / 228, which is still approximately 59.38 frames per second).

 

The number of scan lines or color clocks or machine CPU cycles per second is unchanging, so the only way to get a faster frame rate is to draw fewer lines per frame. :)

 

Michael

Edited by SeaGtGruff
Link to comment
Share on other sites

That "set tv pal" option doesn't have anything to do with the color palette, it's strictly related to the number of scan lines that get drawn on the screen-- 262 ("NTSC") or 312 ("PAL"). The so-called "PAL/60" mode uses 262 lines, just like NTSC, so there's no ASM changes needed.

Are you sure about this? I started a thread about this a while back, and thought I had PAL60 figured out (for support in Stella). So you're saying PAL60 is defined as follows:

 

1) 262 scanlines

2) 60 Hz

3) PAL palette

 

Is this correct?? Because the current Stella release assumes the following for PAL60:

 

1) 312 scanlines

2) 60 Hz

3) PAL palette

 

Is there some place where this standard is definitively documented??

I don't know about official, definitive documentation, but here are a couple of non-official references:

 

http://en.wikipedia.org/wiki/PAL (brief reference to PAL-60/525 in section on PAL-M)

 

http://www.avforums.com/forums/archive/ind...hp/t-32488.html (answer by Mr.D)

 

If you think about it for a moment and let the light bulb come on, it should become obvious. :) The TV signal can't speed up or slow down-- its rate (as measured by how many times one thing or other occurs per second) remains constant. So the only way you can increase or decrease the number of frames per second is to decrease or increase the number of lines per frame, since the number of lines per second is constant.

Makes sense, I guess. But it does mean I open a window that's too large for PAL60 in Stella. I only wish I'd received this reply in the other thread when I asked about PAL60 support :) I will fix it for a future release.

 

Edit: I just thought about it a little more, and perhaps I'm not explaining what I really mean. If you run a PAL60 game (with 262 scanlines) on a PAL TV, wouldn't the TV itself still consist of a larger vertical area than an NTSC set? And if so, there would be borders around the top and bottom of the image? My whole point of asking this is how large a window to create in Stella when emulating PAL60 mode. The SDL screen can be thought of as the TV screen, so if there are borders on a real set, it makes sense to have them in Stella as well. So basically, although a PAL60 image only consists of 262 scanlines, it's still displayed on a device of 312 scanlines, and the others just aren't used. Is this more correct??

Edited by stephena
Link to comment
Share on other sites

Edit: I just thought about it a little more, and perhaps I'm not explaining what I really mean. If you run a PAL60 game (with 262 scanlines) on a PAL TV, wouldn't the TV itself still consist of a larger vertical area than an NTSC set? And if so, there would be borders around the top and bottom of the image? My whole point of asking this is how large a window to create in Stella when emulating PAL60 mode. The SDL screen can be thought of as the TV screen, so if there are borders on a real set, it makes sense to have them in Stella as well. So basically, although a PAL60 image only consists of 262 scanlines, it's still displayed on a device of 312 scanlines, and the others just aren't used. Is this more correct??

That depends on your TV set. Multi-standard TVs with 60Hz support might stretch the display vertically, so that it will fill the entire screen. Normal PAL-only TVs will only use the center 262 scanlines of the screen and therefore have a black border at the top and bottom. At least the borders are black, if you don't forget to turn on VBLANK during the vertical sync. Otherwise you'll get a spooky glow instead. :)

 

If the black borders don't slow down the rendering, you could keep them to make Stella look more real. But to be fully authentic you'd have to keep the 4:3 aspect ratio for the 312 line display.

 

 

Ciao, Eckhard Stolberg

Link to comment
Share on other sites

Here's the latest ROM and bBasic file. Setting the right difficulty switch to A is PAL and right difficulty switch setting B is NTSC. I've noticed the NTSC to PAL conversion chart is a bit off. It told me that a light green setting in NTSC is actually a light blue setting in PAL. I don't know what's up with that. Anyway, this is probably just the emulator I'm using (Stella), but if I set the TV type to PAL, a big huge black space appears at the bottom, like it's missing something. Would this black space be there if it was on an actual PAL TV?

gosub013007.bas.bin

gosub013007.bas

Link to comment
Share on other sites

Realized B&W mode wasn't working, so I added some code in. What I added I put ": rem - ADDED" next to. In the cases of colors_bw and colors_bw_title, I added the whole thing in. Mike, could you go in the code and change the colors of the octopus to b&w shades instead of color and convert the color shades to PAL? I don't know where in the code that is.

gosub013007a.bas

gosub013007a.bas.bin

Edited by atari2600land
Link to comment
Share on other sites

Here's the latest ROM and bBasic file. Setting the right difficulty switch to A is PAL and right difficulty switch setting B is NTSC. I've noticed the NTSC to PAL conversion chart is a bit off. It told me that a light green setting in NTSC is actually a light blue setting in PAL. I don't know what's up with that. Anyway, this is probably just the emulator I'm using (Stella), but if I set the TV type to PAL, a big huge black space appears at the bottom, like it's missing something. Would this black space be there if it was on an actual PAL TV?

When using PAL/60 (which is what you're doing), you need to choose "PAL60" in the Stella emulator, which I think was only just added in version 2.3.5, or maybe 2.3 (I forget). The "PAL60" mode in Stella does indeed show a large black area at the bottom of the screen, which is not how it should be displayed. As Eckhard said, the actual appearance on a PAL TV would depend on how the set handles a 262-line display, and the game screen ought to be "stretched" a bit vertically to get a display that fills the entire screen (like an NTSC picture), or else the game screen ought to be centered. I don't have a PAL TV or PAL Atari, so I can't verify that, but there should be plenty of AtariAgers in Europe, the United Kingdom, or other areas of the world where PAL is used, who can verify that-- and maybe even take photographs of their TVs to show the rest of us how a PAL/60 game looks! :)

 

The color conversion tables that I've posted aren't perfect, because the colors in the NTSC palette don't necessarily have an exact correspondence to the colors in the PAL palette, and vice versa. All you can do is use the color conversion tables as a rough starting point, and then tweak the values from there to get a better correlation. It's hard for me to tell what the best correlations should be, since the emulator palettes aren't perfect matches for the actual colors as displayed on a TV, plus the actual results on a TV can vary depending on the brightness, contrast, and (on NTSC TVs) the tint settings, plus the adjustment of the color pot on the Atari itself.

 

Michael

Link to comment
Share on other sites

Realized B&W mode wasn't working, so I added some code in. What I added I put ": rem - ADDED" next to. In the cases of colors_bw and colors_bw_title, I added the whole thing in. Mike, could you go in the code and change the colors of the octopus to b&w shades instead of color and convert the color shades to PAL? I don't know where in the code that is.

Do you mean change the octopus to black-and-white for the black-and-white version? I'm totally beat right now, so I can't do it tonight, but I'll go through the code tomorrow night and post it.

 

Michael

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