Jump to content
IGNORED

Possible Flickering


Primordial Ooze

Recommended Posts

I was told that the atari 2600 couldn't handle alot of instructions. My code is as follows:

   rem 2600 De Amigo
  rem a Samba De Amimo clone for the 2600
  rem Updated: October 11, 2008
  rem Website: http://planetarydefense.freepgs.com

  rem includes
  
  rem 6 lives kernal
  rem include 6lives.asm
 
  rem setup all the game variables
 
  rem variable to hold note direction
  dim notedirection = a
  
  rem set the rom size
  set romsize 4k
 
  rem set the tv format to NTSC
  set tv ntsc
 
  rem turn on smartbranching
  set smartbranching on

  rem kernel options
 
  rem enable no blank lines
  set kernel_options no_blank_lines

  rem set the color of the background to white
  COLUBK = 0
  
  rem set the playfield color to black
  COLUPF = 14

  rem set the score field color
  scorecolor = 128

  rem set the color of the miss counter
  lifecolor = 66

  rem define the playfield
  playfield:
  ................................
  ................................
  ................X...............
  ................................
  ................................
  ................................
  ........X..............X........
  ................................
  ................................
  ................X...............
  ................................
  ................................
end

  rem enable the "High Definition" playfield hack
  pfscroll upup : pfscroll upup

  rem define first note sprite
  player0:
  %00111100
  %00111100
  %00111100
  %00111100
  %00111100
  %00111100
  %00111100
  %00111100
end

  rem define second note sprite
  player1:
  %00000000
  %00000000
  %00111100
  %00111100
  %00111100
  %00111100
  %00000000
  %00000000
end

rem start a new game

startNewGame

rem start the player with 0 strikes
lives = 0

rem define the miss counter
lives:
%00000000
%01000010
%00100100
%00011000
%00011000
%00100100
%01000010
%00000000
end

rem reset player's score to 0
score = 0

rem set first note's inital x position off screen
player0x = 79

rem set first note's inital y position off screen
player0y = 51

rem set second note's initial x position off screen
player1x = 0

rem set the enemie's initial y position off screen
player1y = 0

rem set the note's initial direction to 0 (none)
notedirection = 1

gameLoop

rem if the reset switch is pressed, start a new game
if switchreset then startNewGame

rem set first note's color to white
COLUP0 = 14

rem set second note's color to white
COLUP1 = 14

rem move the note cue based on the notes direction

rem if notedirection is 1(up) move the note cue up
if notedirection = 1 then player0y = player0y - 1

rem if notedirection is 2(down) move the note cue down
if notedirection = 2 then player0y = player0y + 1

rem if notedirection is 3(left) move the note cue left
if notedirection = 3 then player0x = player0x - 1

rem if notedirection is 4(left) move the note cue right
if notedirection = 4 then player0x = player0x + 1

rem if the notedirection is up(1)
rem on the joystick while it is colliding with the playfield
rem give the user 5 points
if !collision(player0, playfield) then skipplayerscoresup

if !joy0up then skipplayerscoresup

if notedirection <> 1 then skipplayerscoresup

rem player gains 1 point
score = score + 1

rem move the arrow back to the center
player0x = 79
player0y = 51

rem if the player doesn't score on the up arrow then the
rem  instructions are skipped to here
skipplayerscoresup

rem if the player misses the up note then give the
rem player a miss
if player0y > 16 then skipmissup

rem if the player misses the up note then give the
rem player a miss
lives = lives + 32

rem move the arrow back to the center
player0x = 79
player0y = 51

skipmissup

rem if the notedirection is down(2) and the joystick is
rem down while it is colliding with the playfield
rem give the user 5 points
if !collision(player0, playfield) then skipplayerscoresdown

if !joy0down then skipplayerscoresdown

if notedirection <> 2 then skipplayerscoresdown

rem player gains 1 point
score = score + 1

rem move the arrow back to the center
player0x = 79
player0y = 51

rem if the player doesn't score on the down arrow then the
rem  instructions are skipped to here
skipplayerscoresdown

rem if the player misses the down note then give the
rem player a miss
if player0y < 78 then skipmissdown

rem if the player misses the down note then give the
rem player a miss
lives = lives + 32

rem move the arrow back to the center
player0x = 79
player0y = 51

skipmissdown

rem if the notedirection is left(3) and the joystick is
rem left while it is colliding with the playfield
rem give the user 5 points
if !collision(player0, playfield) then skipplayerscoresleft

if !joy0left then skipplayerscoresleft

if notedirection <> 3 then skipplayerscoresleft

rem player gains 1 point
score = score + 1

rem move the arrow back to the center
player0x = 79
player0y = 51

rem if the player doesn't score on the left arrow then the
rem  instructions are skipped to here
skipplayerscoresleft

rem if the player misses the left note then give the
rem player a miss
if player0x > 44 then skipmissleft

rem if the player misses the left note then give the
rem player a miss
lives = lives + 32

rem move the arrow back to the center
player0x = 79
player0y = 51

skipmissleft

rem if the notedirection is right(4) and the joystick is
rem rightt while it is colliding with the playfield
rem give the user 5 points
if !collision(player0, playfield) then skipplayerscoresright

if !joy0right then skipplayerscoresright

if notedirection <> 4 then skipplayerscoresright

rem player gains 1 point
score = score + 1

rem move the arrow back to the center
player0x = 79
player0y = 51

rem if the player doesn't score on the right arrow then the
rem  instructions are skipped to here
skipplayerscoresright

rem if the player misses the rightt note then give the
rem player a miss
if player0x < 109 then skipmissright

rem if the player misses the right note then give the
rem player a miss
lives = lives + 32

rem move the arrow back to the center
player0x = 79
player0y = 51

skipmissright

rem if the player misses 3 times it's game over
if lives > 64 then gameOver

rem draw the screen
drawscreen

goto gameLoop

rem Game Over Screen
gameOver

gameOverLoop
rem if the reset switch is pressed, start a new game
if switchreset then startNewGame

rem if the joystick fire button is pressed start a new game
if joy0fire then startNewGame

rem set first note's color to white
COLUP0 = 14

rem set second note's color to white
COLUP1 = 14

rem draw the screen
drawscreen

goto gameOverLoop

 

if i repeat this code and modify it for the right joystick

	rem if the notedirection is up(1)
rem on the joystick while it is colliding with the playfield
rem give the user 5 points
if !collision(player0, playfield) then skipplayerscoresup

if !joy0up then skipplayerscoresup

if notedirection <> 1 then skipplayerscoresup

rem player gains 1 point
score = score + 1

rem move the arrow back to the center
player0x = 79
player0y = 51

rem if the player doesn't score on the up arrow then the
rem  instructions are skipped to here
skipplayerscoresup

rem if the player misses the up note then give the
rem player a miss
if player0y > 16 then skipmissup

rem if the player misses the up note then give the
rem player a miss
lives = lives + 32

rem move the arrow back to the center
player0x = 79
player0y = 51

skipmissup

rem if the notedirection is down(2) and the joystick is
rem down while it is colliding with the playfield
rem give the user 5 points
if !collision(player0, playfield) then skipplayerscoresdown

if !joy0down then skipplayerscoresdown

if notedirection <> 2 then skipplayerscoresdown

rem player gains 1 point
score = score + 1

rem move the arrow back to the center
player0x = 79
player0y = 51

rem if the player doesn't score on the down arrow then the
rem  instructions are skipped to here
skipplayerscoresdown

rem if the player misses the down note then give the
rem player a miss
if player0y < 78 then skipmissdown

rem if the player misses the down note then give the
rem player a miss
lives = lives + 32

rem move the arrow back to the center
player0x = 79
player0y = 51

skipmissdown

rem if the notedirection is left(3) and the joystick is
rem left while it is colliding with the playfield
rem give the user 5 points
if !collision(player0, playfield) then skipplayerscoresleft

if !joy0left then skipplayerscoresleft

if notedirection <> 3 then skipplayerscoresleft

rem player gains 1 point
score = score + 1

rem move the arrow back to the center
player0x = 79
player0y = 51

rem if the player doesn't score on the left arrow then the
rem  instructions are skipped to here
skipplayerscoresleft

rem if the player misses the left note then give the
rem player a miss
if player0x > 44 then skipmissleft

rem if the player misses the left note then give the
rem player a miss
lives = lives + 32

rem move the arrow back to the center
player0x = 79
player0y = 51

skipmissleft

rem if the notedirection is right(4) and the joystick is
rem rightt while it is colliding with the playfield
rem give the user 5 points
if !collision(player0, playfield) then skipplayerscoresright

if !joy0right then skipplayerscoresright

if notedirection <> 4 then skipplayerscoresright

rem player gains 1 point
score = score + 1

rem move the arrow back to the center
player0x = 79
player0y = 51

rem if the player doesn't score on the right arrow then the
rem  instructions are skipped to here
skipplayerscoresright

rem if the player misses the rightt note then give the
rem player a miss
if player0x < 109 then skipmissright

rem if the player misses the right note then give the
rem player a miss
lives = lives + 32

rem move the arrow back to the center
player0x = 79
player0y = 51

skipmissright

 

Will it be too much for the atari to handle or would it be ok? If i can add this code, how much "breathing space" would i have?

 

Sincerely,

 

Open Source Pong

Link to comment
Share on other sites

If you're talking about space for your code and you use Visual batari Basic, the Information Pane tells you how much space is left after compiling. If you run out of room, you can use bankswitching.

 

If you're talking about using too many cycles, the info under Timing on the following page tells you how you can use Stella to make sure you're not using too many cycles:

 

http://www.randomterrain.com/atari-2600-me...nds.html#timing

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