Jump to content
IGNORED

Pepsi Invaders Graphic Mystery


Recommended Posts

I'm a complete newbie with 2600 hacks. Just for fun, I've been making my own graphics for Pepsi Invaders, but I've encountered a strange problem. I can't find the location of a specific graphic in the code!

 

I'm using showgfx. The top bar where it shows "COKE WINS" has graphics located 0b6e - 0ba9. The problem is I cannot find the left most vertical bar that composes the left part of the letter C in COKE. I simply want to shorten the 10 line bar to a 3 line bar, but I don't see where it's located. Can anyone help me find it?

 

EDIT: I've added the text file of the code. Again, 0b6e - 0ba9 seem to be the graphics section of focus.

pepsiinvaders.txt

Edited by jeff20
Link to comment
Share on other sites

0b6e | XX  XX |
0b6f |XXXXXXXX|
0b70 |XXXXXXXX|
0b71 |XX XX XX|
0b72 |XX XX XX|
0b73 |XX    XX|
0b74 |XX    XX|
0b75 |XX    XX|
0b76 |XX    XX|
0b77 |        |
0b78 |  XX  XX|
0b79 |  XX  XX|
0b7a |  XX  XX|
0b7b |  XX  XX|
0b7c |  XX  XX|
0b7d |  XX  XX|
0b7e |  XX  XX|
0b7f |  XX  XX|
0b80 |  XX  XX|
0b81 |        |
0b82 |    XX  |
0b83 |   XXX  |
0b84 |  XXXX  |
0b85 |  XXXX  |
0b86 | XX XX  |
0b87 |XX  XX  |
0b88 |XX  XX  |
0b89 |X   XX  |
0b8a |    XX  |
0b8b |        |
0b8c | XXXXXX |
0b8d |XXXXXXXX|
0b8e |      XX|
0b8f |      XX|
0b90 | XXXXXX |
0b91 |XX      |
0b92 |XX      |
0b93 |XXXXXXXX|
0b94 | XXXXXX |
0b95 |        |
0b96 |XX XXX X|
0b97 |XX XXX X|
0b98 |   X X X|
0b99 |   X X X|
0b9a |   X X X|
0b9b |   X X X|
0b9c |   X X X|
0b9d |   X X X|
0b9e |XX XXX X|
0b9f |XX XXX X|
0ba0 | XXX X  |
0ba1 | XXX X  |
0ba2 |   X  X |
0ba3 |   X  X |
0ba4 |  XX   X|
0ba5 |  XX   X|
0ba6 |   X  X |
0ba7 |   X  X |
0ba8 | XXX X  |
0ba9 | XXX X  |
0baa |  X  X  |
0bab |X  XXXXX|
0bac | X X    |
0bad | X   X  |
0bae |  X     |
0baf |XXXX  XX|
0bb0 |XXXXX XX|
0bb1 |X X X  X|
0bb2 |  XX X  |
0bb3 |X    X X|
0bb4 |XXX  X  |
0bb5 |X X X  X|
0bb6 |    XXX |

At 0b96 the letters for COKE begin, but notice how the C is truncated?

Link to comment
Share on other sites

Stella's Fixed Debug Colors mode can help, it changes this:

post-3056-0-23265800-1429358693_thumb.png

 

To this:

post-3056-0-08846500-1429358624_thumb.png

 

Using this color key:

post-3056-0-81198300-1429358651_thumb.gif

 

We can tell that COKE is drawn using the PLAYFIELD graphics.

 

If you've gone through the newbie course, you should recall the diagram in Session 14 which shows the weird way the playfield information is drawn.

 

Measuring out the pixels shows that the line that makes the left part of the C is the rightmost pixel of PF0. Additionally, notice how that line in the C extends upward? An educated guess says that $80 was stored in PF0 at the start of the kernel routine which draws COKE WINS. Why would they do that instead of using another table of graphics? It saves ROM and cycle time, both of which are in short supply on the Atari.

 

To see what's going on, enter Stella's Debugger by hitting the ` key (just to the left of your 1 key).

post-3056-0-12844000-1429360649_thumb.png

 

In the prompt enter the command trapwrite PF0

post-3056-0-20456200-1429360653_thumb.png

 

then exit. The debugger mode screen will briefly go away then come back. The Disassembly view in the bottom right will be positioned just after the write to PF0, so you might have to scroll it back a little bit to see the code where you'll see LDA #$80 followed by STA PF0 at address $F97F.

post-3056-0-62110000-1429360657_thumb.png

 

Also note how the display in the top-left is black & white - that means the current screen hasn't been drawn yet. Look closer and you'll notice a white square in the top-left of the B&W image. That's where the electron beam of the TV is currently at. If you start to hit the STEP button(top-right corner) the code will execute one instruction at a time and the screen will start to be drawn:

post-3056-0-60100900-1429361081_thumb.png

 

 

Check the list of Developer Keys in Stella's documentation to see other useful options you have.

  • Like 2
Link to comment
Share on other sites

Measuring out the pixels shows that the line that makes the left part of the C is the rightmost pixel of PF0. Additionally, notice how that line in the C extends upward? An educated guess says that $80 was stored in PF0 at the start of the kernel routine which draws COKE WINS. Why would they do that instead of using another table of graphics? It saves ROM and cycle time, both of which are in short supply on the Atari.

 

 

Thanks so much for the detailed and informative response! I need to read more. I couldn't understand the ROM savings , but the cycle time makes sense.

 

So, quick question. Just working with the binary, what code line would I change to remove that line in the C completely? Somehow I got confused because I can't make it go away.

Link to comment
Share on other sites

Thanks so much for the detailed and informative response! I need to read more. I couldn't understand the ROM savings , but the cycle time makes sense.

 

So, quick question. Just working with the binary, what code line would I change to remove that line in the C completely? Somehow I got confused because I can't make it go away.

 

No problem. The ROM savings is they only need to have 1 graphic value in ROM, vs 10 values if they'd updated it on every scanline.

 

The change would be to make the LDA #$80 at $F97F into LDA #$00, more specifically change the $80 found at $F980 into $00.

 

I'm not familiar with showgfx, but I gather there's a way to convert pepsiinvaders.txt back into a ROM file? That file starts at $0000 instead of $F000, so you'd change line 0980 from this:

0980 |X       |


to this:

0980 |        |
Edited by SpiceWare
Link to comment
Share on other sites

Will do! I'm working my way up to that. Big fan of your work!

 

BTW, has anyone ever created an annotation of Atari program codes (like a detailed annotation of Space Invaders, for example)? I'm easing my way into this, and it would be helpful to figure out one little variation at a time such as the changing the timer of this game from 3 to 1 minute or changing the colors. Just wondering. I'm content with the solution to this mystery though.

Edited by jeff20
Link to comment
Share on other sites

  • 3 weeks later...

You can find some over at http://www.qotile.net/minidig/

Ok, I've been studying and learned a lot in the last few weeks. I'm so glad for these resources.

 

I hate to be a bother again, but I've run into another murky area: the player's cannon. It seems to be stuck in some kind of multicolor mode. How do I escape/affect that?

 

I'm also confused by the cannon's destruction animation. It appears to be two frames, but I can't find the graphics anywhere in the code. I've looked at several Space Invader hacks, and I noticed none seem to change these graphics. Did I just not look hard enough? Or are they stored differently than the other graphics?

Link to comment
Share on other sites

Code at $F256 draws and colors the cannon.

 

Player's color table is located at F9E9.

 

Destruction graphics are drawn using both players. There's 2 images at FC14 and FC1E that are alternated for each player so that the colors of the pixels keep changing.

 

Space Invaders has concurrent 2-player game variations so most hacks won't use both players to draw a single ship's death sequence.

Link to comment
Share on other sites

Code at $F256 draws and colors the cannon.

 

Player's color table is located at F9E9.

 

Destruction graphics are drawn using both players. There's 2 images at FC14 and FC1E that are alternated for each player so that the colors of the pixels keep changing.

 

Space Invaders has concurrent 2-player game variations so most hacks won't use both players to draw a single ship's death sequence.

 

Is that Space Invaders or Pepsi Invaders code? Also, I'm using showgfx. WOuld that make the cannon $0257? Sorry I'm a slow learner.

Link to comment
Share on other sites

Pepsi Invaders code.

 

$F256 is programming code, not graphics - don't change that.

 

Color data is at F9E9, or so you'd change the values in your file starting at 09e9.

 

Likewise for the destroyed cannon graphics - drop the leading F for 0c14 and 0c1e.

 

The non-destroyed cannon graphics are at FC0A, or 0c0a.

Link to comment
Share on other sites

  • 1 month later...
  • 5 months later...

Separate...and slightly different (because the top border changes color from right to left to "hide" the text).

 

The color is fetched from ram location $e4/$e5 (so the colors are allowed to shift during attract). Hacking this is a little bit involved...since the same value is used to update another variable when $e5 is initialized. But if you don't mind an unchanging color, the method can go like this:

 

First, alter the $a5 value at rom address $x280 to be $a9, then put your chosen color value (such as blue $86) into rom address $x281.

 

ex

f280: a5 e5 -> f280: a9 86

 

That takes care of the bottom border. What was done was to change the LDA $zeropage instruction into LDA #immediate.

 

The first step of the top border is just as easy. Scroll down to rom address $x973 and alter it the same way:

 

ex

f973: a5 e4 -> f973: a9 86

 

If you run the game at this point, you'd notice that the playfield text is not hidden behind the "wins" bitmaps. You need to alter the loop instruction at rom address $x9b7 too (which is using LDX instead of LDA):

 

ex

f9b7: a6 e4 -> f9b7: a2 86

 

1 cycle was shaved off in the loop as a result, but it doesn't appear to affect anything.

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