Jump to content

Photo

Pausing on the Atari 2600 and 7800 with the COLOR/BW switch?


32 replies to this topic

#1 Random Terrain OFFLINE  

Random Terrain

    Visual batari Basic User

  • 24,324 posts
  • Controlled Randomness
    Replay Value
    Nonlinear
  • Location:North Carolina (USA)

Posted Mon Sep 26, 2011 3:31 PM

If we pause a game using the COLOR/BW switch, is there anything special we need to do to make sure it will also work on an Atari 7800?


Thanks.

#2 Random Terrain OFFLINE  

Random Terrain

    Visual batari Basic User

  • Topic Starter
  • 24,324 posts
  • Controlled Randomness
    Replay Value
    Nonlinear
  • Location:North Carolina (USA)

Posted Mon Sep 26, 2011 7:30 PM

Here's a related post:

http://www.atariage....00#entry2203500

"Color/B&W" switch on the 2600 = "Pause" switch on the 7800. How the switch is read by software is exactly the same (bit3 of SWCHB). If, when, and how a program implements the switch is entirely up to the program in question.

If a 2600 game switches to a B&W palette when using the switch on a 2600...the same effect will happen using the game with a 7800's "pause" switch. However...on the 7800, the switch itself will spring back to it's original position the same way that Select and Reset do (so you would need some way of keeping the switch pressed down if the game was not coded with this "springy action" in mind).

Beany Bopper, for example, uses the switch to pause the game on a 2600. This does not work correctly on the 7800...since the switch automatically springs back and unpauses the game.

Some modern homebrews and hacks are written to detect which console the game is being run on (and include decision branches to handle either case), so an assigned function will work for either platform.

Does anyone know what should be done in a batari Basic program to handle either case?

If someone has a good answer for this, I'll add it to the bB page.


Thanks.

#3 ScumSoft OFFLINE  

ScumSoft

    Moonsweeper

  • 348 posts
  • Location:Polysorbate 60

Posted Mon Sep 26, 2011 9:55 PM

Pause the game with b/w set to a, when returned to b keep the game paused until the fire button is pressed?

#4 Schizophretard OFFLINE  

Schizophretard

    River Patroller

  • 2,778 posts

Posted Mon Sep 26, 2011 10:52 PM

There is no a and b. Only color or b/w.

#5 Random Terrain OFFLINE  

Random Terrain

    Visual batari Basic User

  • Topic Starter
  • 24,324 posts
  • Controlled Randomness
    Replay Value
    Nonlinear
  • Location:North Carolina (USA)

Posted Tue Sep 27, 2011 2:57 AM

If I was doing it only for the Atari 2600, I'd have the program look at the position of the switch just before the game starts, then the opposite position would pause the game. That way the game would never be paused from the start.

That wouldn't work on the Atari 7800.

Edited by Random Terrain, Tue Sep 27, 2011 3:21 AM.


#6 Schizophretard OFFLINE  

Schizophretard

    River Patroller

  • 2,778 posts

Posted Tue Sep 27, 2011 5:57 AM

If I was doing it only for the Atari 2600, I'd have the program look at the position of the switch just before the game starts, then the opposite position would pause the game. That way the game would never be paused from the start.

That wouldn't work on the Atari 7800.


I sent you a more complex PM but could you use the fire button on the right controller as pause and the fire button on the left controller as unpause?

#7 Random Terrain OFFLINE  

Random Terrain

    Visual batari Basic User

  • Topic Starter
  • 24,324 posts
  • Controlled Randomness
    Replay Value
    Nonlinear
  • Location:North Carolina (USA)

Posted Tue Sep 27, 2011 6:11 AM

I sent you a more complex PM but could you use the fire button on the right controller as pause and the fire button on the left controller as unpause?

I could do something like that, but some people don't even have a second joystick plugged in. And some people hate games that use two controllers for any reason.

If somebody with a bigger brain comes along with the info I'm looking for, it would probably be a good idea to stick with the COLOR/BW switch since that's what the Atari 7800 already uses as a pause button.

#8 theloon OFFLINE  

theloon

    Quadrunner

  • 6,961 posts

Posted Tue Sep 27, 2011 10:01 AM

Can't you just increment a counter every frame the pause is pressed/toggled? If it's pressed more than 10 frames on a 7800 then pause. If it's a 2600 then this will happen as well.

Edited by theloon, Tue Sep 27, 2011 10:01 AM.


#9 Random Terrain OFFLINE  

Random Terrain

    Visual batari Basic User

  • Topic Starter
  • 24,324 posts
  • Controlled Randomness
    Replay Value
    Nonlinear
  • Location:North Carolina (USA)

Posted Tue Sep 27, 2011 12:17 PM

Can't you just increment a counter every frame the pause is pressed/toggled? If it's pressed more than 10 frames on a 7800 then pause. If it's a 2600 then this will happen as well.

The black and white switch doesn't bounce back on an Atari 2600 and we have to remember that a player could hold in the pause button on an Atari 7800, so a counter will not work unless we can start the counter after they let go of the pause button..

#10 RevEng ONLINE  

RevEng

    River Patroller

  • 3,154 posts
  • bit player
  • Location:Canada

Posted Tue Sep 27, 2011 1:00 PM

Here's an example that accomplishes pause on both systems...

dim atari7800=z
 
rem ** this has to happen before a drawscreen or subroutine, or anything
rem ** else that may obliterate temp1...
atari7800=temp1&1
 
rem ** uncomment the following line to test 7800 pausing in stella.
rem ** changing from color to BW will pause.
rem **	 switching back to color will remain paused.
rem ** changing from color to BW will unpause.
rem **	 switching back to color will will remain unpaused.
 
rem atari7800=1
 
rem ** For a 2600 atari7800 is now 0. For a 7800 atari7800 is now 1.
 
  scorecolor=$0a
 
  player0:
  %01111110
  %11000011
  %11000011
  %00000000
  %00000000
  %01100110
  %01100110
end
  player0x=40:player0y=40
 
mainloop
  COLUBK=0
  COLUP0=$0a
 
  player0x=player0x+1
 
  drawscreen
 
  rem **2600 pause handling...
  if atari7800=0 && switchbw then goto pausegame
 
  rem **7800 pause handling...
  if atari7800=1 && switchbw then atari7800=%00000011: goto pausegame
  if atari7800>1 && !switchbw then atari7800=1
 
  goto mainloop
 
pausegame
  COLUBK=$a4
  COLUP0=$0a
  drawscreen
 
  rem ** this code should be at the bottom of the pause loop
 
  rem ** 2600 pause handling...
  if atari7800=0 && !switchbw then goto mainloop
  if atari7800=0 then goto pausegame
 
  rem ** 7800 pause handling...
  if atari7800=%00000011 && switchbw then goto pausegame
  atari7800=%00000111
  if switchbw then goto mainloop
  goto pausegame
 

In this case, an assembly solution is a bit less involved, but I figured I'd keep it purely bB.

An unrelated note: the forum is no longer eating %00000000 binary after the upgrade. Huzzah!

#11 Random Terrain OFFLINE  

Random Terrain

    Visual batari Basic User

  • Topic Starter
  • 24,324 posts
  • Controlled Randomness
    Replay Value
    Nonlinear
  • Location:North Carolina (USA)

Posted Tue Sep 27, 2011 1:21 PM

An unrelated note: the forum is no longer eating %00000000 binary after the upgrade. Huzzah!

Yay!

If I'm reading that correctly, temp1 lets the program know if it is an Atari 2600 or Atari 7800? Do you know what happens with temp1 when the consoles start that is different?


Thanks.

#12 RevEng ONLINE  

RevEng

    River Patroller

  • 3,154 posts
  • bit player
  • Location:Canada

Posted Tue Sep 27, 2011 1:42 PM

The 7800 has a bios that it runs and that leaves the memory in a predictable state. Before it clears the ram, the bB startup code checks a few ram locations to see if it was started by a 7800, and sets temp1 accordingly.

#13 Random Terrain OFFLINE  

Random Terrain

    Visual batari Basic User

  • Topic Starter
  • 24,324 posts
  • Controlled Randomness
    Replay Value
    Nonlinear
  • Location:North Carolina (USA)

Posted Tue Sep 27, 2011 1:52 PM

The 7800 has a bios that it runs and that leaves the memory in a predictable state. Before it clears the ram, the bB startup code checks a few ram locations to see if it was started by a 7800, and sets temp1 accordingly.

Oh, I see it's on the bB page:

http://www.randomter....html#atari7800

I'll add an adapted version of your code to the bB page some time in October. If you have any related information that you want bB users to know, please post it here and I'll add it.


Thanks.

Edited by Random Terrain, Tue Sep 27, 2011 1:55 PM.


#14 RevEng ONLINE  

RevEng

    River Patroller

  • 3,154 posts
  • bit player
  • Location:Canada

Posted Tue Sep 27, 2011 5:27 PM

Just a heads up that I simplified the 7800 unpause code slightly.

Also, it's worth mentioning that the 7800 detection won't work with Harmony in menu mode, since the menu program changes these memory locations. There was a request to have this fixed in the Harmony firmware, but even if that goes in it appears they're using values that differ from the ones bB looks for.

#15 Schizophretard OFFLINE  

Schizophretard

    River Patroller

  • 2,778 posts

Posted Tue Sep 27, 2011 10:43 PM

Just a heads up that I simplified the 7800 unpause code slightly.

Also, it's worth mentioning that the 7800 detection won't work with Harmony in menu mode, since the menu program changes these memory locations. There was a request to have this fixed in the Harmony firmware, but even if that goes in it appears they're using values that differ from the ones bB looks for.


Is it possible to have a pause work for a game by having the game recognize the fire button being rapidly pushed a number of times in a few seconds? For an example, 10 times in 3 seconds is pause.

Or is it possible to make a game treat switching from color to bw and back to color again as pause? So, on the 2600 you switch twice to copy the action of the 7800 pause button? And maybe even treat the position the switch is in as color at the start of the game, so it doesn't start in pause?

#16 Random Terrain OFFLINE  

Random Terrain

    Visual batari Basic User

  • Topic Starter
  • 24,324 posts
  • Controlled Randomness
    Replay Value
    Nonlinear
  • Location:North Carolina (USA)

Posted Wed Sep 28, 2011 12:21 AM

Just a heads up that I simplified the 7800 unpause code slightly.

Also, it's worth mentioning that the 7800 detection won't work with Harmony in menu mode, since the menu program changes these memory locations. There was a request to have this fixed in the Harmony firmware, but even if that goes in it appears they're using values that differ from the ones bB looks for.

Thanks. I'll add that info to the bB page too.

#17 Random Terrain OFFLINE  

Random Terrain

    Visual batari Basic User

  • Topic Starter
  • 24,324 posts
  • Controlled Randomness
    Replay Value
    Nonlinear
  • Location:North Carolina (USA)

Posted Wed Sep 28, 2011 1:36 AM

If I was doing it only for the Atari 2600, I'd have the program look at the position of the switch just before the game starts, then the opposite position would pause the game. That way the game would never be paused from the start.

Holy cow! I think I just had an idea based on what I said above that might work on the Atari 2600 and Atari 7800, but lets you un-pause using the fire button.

What would happen if I did this:
  • Before the game starts, the program checks the position of the COLOR/BW switch and stores that info in a bit.
    _
  • During the game, the program checks to see if the position of the COLOR/BW switch has changed by seeing if it's different from the stored bit.
    _
  • If the position is different than the stored bit, the program immediately jumps to the pause section.
    _
  • If the player presses the fire button while in the pause section, the program checks the position of the COLOR/BW switch and stores that info in the same bit as before, then returns to the game.

Unless I'm forgetting something or overlooking something, that should work on the Atari 7800 and let Atari 2600 users pause by flipping the COLOR/BW switch (whether it's on Color or BW).


I adapted the example program posted above to see if it would work:


   ;===============================================================
   ;===============================================================
   ;
   ;
   ;  Create aliases for variables.
   ;
   ;
   ;----------------------------------------------------------------
   ;
   ;  (You can have more than one alias for each variable.)
   ;
   ;----------------------------------------------------------------
 
 
   ;----------------------------------------------------------------
   ;  
   ;  Pause position.
   ;  
   ;  
   dim Bit0_Pause_Position = z
 
 
   ;----------------------------------------------------------------
   ;  
   ;  Pause Check.
   ;  
   ;  
   dim Bit1_Pause_Check = z
 
 
 
 
 
   ;===============================================================
   ;===============================================================
   ;
   ;
   ;
   ;  START/RESTART SETUP
   ;
   ;
   ;
   ;===============================================================
   ;===============================================================
  
   scorecolor = $0A
 
  
   player0:
   %01111110
   %11000011
   %11000011
   %00000000
   %00000000
   %01100110
   %01100110
end
 
 
   player0x = 2 : player0y = 40 : a = 1
 
 
 
   ;===============================================================
   ;===============================================================
   ;
   ;
   ;  Remembers position of COLOR/BW switch.
   ;
   ;
   Bit0_Pause_Position{0} = 0
 
   if switchbw then Bit0_Pause_Position{0} = 1
 
 
 
 
 
   ;===============================================================
   ;===============================================================
   ;
   ;
   ;
   ;  MAIN LOOP
   ;
   ;
   ;
   ;===============================================================
   ;===============================================================
 
__Main_Loop
 
 
   COLUBK = 0
 
   COLUP0 = $0A
  
   player0x = player0x + a
 
   if player0x < 2 then a = 1
 
   if player0x > 150 then a = 255
  
   drawscreen
 
 
 
 
   ;===============================================================
   ;===============================================================
   ;
   ;
   ;  Pause check.
   ;
   ;
   ;----------------------------------------------------------------
 
   ;----------------------------------------------------------------
   ;
   ;  Checks current position of COLOR/BW switch.
   ;
   ;
   Bit1_Pause_Check{1} = 0
 
   if switchbw then Bit1_Pause_Check{1} = 1
 
 
   ;----------------------------------------------------------------
   ;
   ;  Compares bits to see if COLOR/BW switch has moved.
   ;  ---- If the switch has moved, the game is paused.
   ;
   ;
   if Bit0_Pause_Position{0} then if !Bit1_Pause_Check{1} then goto __Pause_Game
 
   if !Bit0_Pause_Position{0} then if Bit1_Pause_Check{1} then goto __Pause_Game
 
 
 
 
   goto __Main_Loop
 
 
 
 
  
__Pause_Game
 
   COLUBK = $A4
 
   COLUP0 = $0A
 
   drawscreen
 
 
 
 
   ;===============================================================
   ;===============================================================
   ;
   ;
   ;  Unpause when fire button is pressed.
   ;
   ;
   ;----------------------------------------------------------------
 
   ;----------------------------------------------------------------
   ;
   ;  If fire button is not pressed, skip.
   ;
   ;
   if !joy0fire then goto __Skip_Pause_Fire
 
 
   ;----------------------------------------------------------------
   ;
   ;  Remembers position of COLOR/BW switch and returns to game.
   ;
   ;
   Bit0_Pause_Position{0} = 0
 
   if switchbw then Bit0_Pause_Position{0} = 1
 
   goto __Main_Loop
 
 
__Skip_Pause_Fire
 
 
 
 
   goto __Pause_Game


Attached File  pause_test_01.bin   4KB   87 downloads

I don't know where my Atari 7800 is right now, so I can't test it on there until I find the box I put it in. If anyone has a Harmony cart and an Atari 7800, please test the .bin file above and let me know if hitting the pause button works.


Thanks.

Edited by Random Terrain, Wed Sep 28, 2011 3:27 AM.


#18 Schizophretard OFFLINE  

Schizophretard

    River Patroller

  • 2,778 posts

Posted Wed Sep 28, 2011 3:52 AM

Test one:

7800 with expansion interface

Serial number: 72R4BR A1715019372

Smiley face moving on screen.

Pause pushed.

Smiley face stops and screen turns blue.

Fire button pushed.

Smiley face moving on screen.

Pause button held down for 10 seconds.

Smiley face stops and screen turns blue.

Fire button pushed.

Smiley face moving on screen.

Results: Success.

#19 Random Terrain OFFLINE  

Random Terrain

    Visual batari Basic User

  • Topic Starter
  • 24,324 posts
  • Controlled Randomness
    Replay Value
    Nonlinear
  • Location:North Carolina (USA)

Posted Wed Sep 28, 2011 3:58 AM

Results: Success.

Thanks for testing. That's great news. Now I can have pause on the Atari 7800 and the type of pause I want on the Atari 2600 where the position of the COLOR/BW switch doesn't matter (just flipping it in the opposite direction is all you need to do).

Edited by Random Terrain, Wed Sep 28, 2011 3:59 AM.


#20 Schizophretard OFFLINE  

Schizophretard

    River Patroller

  • 2,778 posts

Posted Wed Sep 28, 2011 3:58 AM

Test Two:

7800 without expansion interface and hole filled in.

Serial number: 72R4BR A1 85 5066487

Smiley face moving on screen.

Pause pushed.

Smiley face stops and screen turns blue.

Fire button pushed.

Smiley face moving on screen.

Pause button held down for 10 seconds.

Smiley face stops and screen turns blue.

Fire button pushed.

Smiley face moving on screen.

Results: Success.

#21 Schizophretard OFFLINE  

Schizophretard

    River Patroller

  • 2,778 posts

Posted Wed Sep 28, 2011 4:07 AM

Test three:

7800 without expansion interface and no hole.

Serial number: 72R4BR A1 85 5068065

Smiley face moving on screen.

Pause pushed.

Smiley face stops and screen turns blue.

Fire button pushed.

Smiley face moving on screen.

Pause button held down for 10 seconds.

Smiley face stops and screen turns blue.

Fire button pushed.

Smiley face moving on screen.

Results: Success.

#22 Schizophretard OFFLINE  

Schizophretard

    River Patroller

  • 2,778 posts

Posted Wed Sep 28, 2011 4:15 AM

Test four:

7800 without expansion interface and hole filled in.

Serial number: 72R4BR A30 75 298298

Smiley face moving on screen.

Pause pushed.

Smiley face stops and screen turns blue.

Fire button pushed.

Smiley face moving on screen.

Pause button held down for 10 seconds.

Smiley face stops and screen turns blue.

Fire button pushed.

Smiley face moving on screen.

Results: Success.

#23 Schizophretard OFFLINE  

Schizophretard

    River Patroller

  • 2,778 posts

Posted Wed Sep 28, 2011 4:48 AM

I just tested it with my modified Colecovision Expansion Module. It worked no matter which way I had the switch when turning it on. Is there a way to do the same thing but make it that pushing pause again or flipping the switch again would work as well as the fire button? It is a minor problem but someone might be an idiot, think the game froze, and not even think to try the fire button.

#24 Random Terrain OFFLINE  

Random Terrain

    Visual batari Basic User

  • Topic Starter
  • 24,324 posts
  • Controlled Randomness
    Replay Value
    Nonlinear
  • Location:North Carolina (USA)

Posted Wed Sep 28, 2011 5:05 AM

I just tested it with my modified Colecovision Expansion Module. It worked no matter which way I had the switch when turning it on. Is there a way to do the same thing but make it that pushing pause again or flipping the switch again would work as well as the fire button? It is a minor problem but someone might be an idiot, think the game froze, and not even think to try the fire button.

I can try it. It may not work on my first try, though. I'll go and adjust the code right now.

#25 Random Terrain OFFLINE  

Random Terrain

    Visual batari Basic User

  • Topic Starter
  • 24,324 posts
  • Controlled Randomness
    Replay Value
    Nonlinear
  • Location:North Carolina (USA)

Posted Wed Sep 28, 2011 7:22 AM


I just tested it with my modified Colecovision Expansion Module. It worked no matter which way I had the switch when turning it on. Is there a way to do the same thing but make it that pushing pause again or flipping the switch again would work as well as the fire button? It is a minor problem but someone might be an idiot, think the game froze, and not even think to try the fire button.

I can try it. It may not work on my first try, though. I'll go and adjust the code right now.

I spent all this time trying to do it, but the only reason why it works is because I activate pause with the COLOR/BW switch or pause button and un-pause with the fire button. Trying to use the same switch brings us back to the need for atari7800=temp1&1 which doesn't work from the SD card.

If players in the future with no manual pause the game and can't figure out that they should press the fire button to unpause, I'm sure they'll be able to find help on the Internet. Or if they have a grabby pet monkey in the room, the fire button will get pressed sooner or later

Edited by Random Terrain, Wed Sep 28, 2011 7:23 AM.





0 user(s) are browsing this forum

0 members, 0 guests, 0 anonymous users