Jump to content
IGNORED

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


Random Terrain

Recommended Posts

Here's a related post:

 

http://www.atariage.com/forums/topic/176821-pause/page__p__2203500#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.

Link to comment
Share on other sites

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
Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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!

  • Like 2
Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.randomterrain.com/atari-2600-memories-batari-basic-commands.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
Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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:

  1. Before the game starts, the program checks the position of the COLOR/BW switch and stores that info in a bit.
    _
  2. 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.
    _
  3. If the position is different than the stored bit, the program immediately jumps to the pause section.
    _
  4. 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

 

 

pause_test_01.bin

 

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
  • Like 1
Link to comment
Share on other sites

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.

  • Like 1
Link to comment
Share on other sites

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
  • Like 1
Link to comment
Share on other sites

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.

  • Like 1
Link to comment
Share on other sites

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.

  • Like 1
Link to comment
Share on other sites

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.

  • Like 1
Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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