Jump to content
IGNORED

2 PF colors on the same line


Recommended Posts

What I set out to do originally when I began learning Atari 2600 assembly was a port of the Odyssey 2 game I made about the Mr. Celery. While I ended up with a fun game, it wasn't what I set out to do. Now I'm going to attempt to make a straight port of the Odyssey 2 game. That begins with the title screen. I had the PF all one color, but then I thought "if I can remove the reflection of the PF0, PF1 and PF2, perhaps I could make them be a different color as well." I ended up with this:

post-9475-0-73031000-1472719738_thumb.png

Sort of a similarity to the Odyssey 2 title screen, shown here:

post-9475-0-54549000-1472719778_thumb.png

And yes, the score will be displayed on the title screen as well, I just haven't gotten that far yet. I was just playing around with what I could do. But there won't be a high score function, the title screen took up more room than you can imagine.

I just was awed at the discovery I made and am wondering what other 2600 games have two different PF colors on the same scanline.

celeryo20160901.zip

Link to comment
Share on other sites

As you noted in your file, bit1 set in CTRLPF sets the color of the playfield from the 2 players...ignoring COLUPF. This feature was used quite often in early games that use PF score digits. But that's not the only way. Cycle time permitting, you can alter COLUPF at any point within a scanline.

Link to comment
Share on other sites

OK, this is stupid. The game now is displaying a copy of player 1 so there's two player 1s and just one player 0. I copied and pasted code from CollectMini so it shouldn't be doing this, yet it is. What I want to know is WHY? And how can I just make there be one player 1?!

celeryo4.asm

Link to comment
Share on other sites

Its more obvious in the earlier games and is one of the features that reveals that the Atari was developed as a Pong machine with a cpu attached. (the PF colors in score mode).

 

If you have multiple players then try checking page 40 in the Stella manual. (NUSIZ)

Edited by BNE Jeff
Link to comment
Share on other sites

As BNE Jeff pointed out it's NUSIZ. Since you know it's player1 that's wrong, let Stella help you!

1) hit ` to enter the debugger

 

2) In the Prompt, type in the command trapwrite NUSIZ1
post-3056-0-34044400-1472824563_thumb.png

3) Click Exit. Stella will stop right away. You'll probably see what's wrong.

 

4) If not, it's helpful to click on the TIA tab
post-3056-0-20542900-1472824568_thumb.png

5) when done type in the command cleartraps

post-3056-0-29281800-1472824573_thumb.png

Link to comment
Share on other sites

I decided to switch the code over to the program that uses the Combat stack trick. Only trouble is, I want a playfield that isn't mirrored or anything. I tried the trick I did for the other program to make an unmirrored playfield, but there are a bunch of black lines. I was wondering if it is possible to get rid of them and have it be a solid green color like it was if I had mirrored it.

 

celeryo5.asm

post-9475-0-56657800-1472861243_thumb.png

Link to comment
Share on other sites

  • 9 months later...

As you noted in your file, bit1 set in CTRLPF sets the color of the playfield from the 2 players...ignoring COLUPF. This feature was used quite often in early games that use PF score digits. But that's not the only way. Cycle time permitting, you can alter COLUPF at any point within a scanline.

 

^you can alter COLUPF at any point within a scanline.^

 

HI, i`m newbie, can you pls show me a little code doing that?

 

would be really really helpfull !! cheers! and ty

 

pd: "learning asm "

Edited by zilog_z80a
Link to comment
Share on other sites

If you understand how a 6-sprite score routine works (which updates the sprite graphic registers mid-scanline after each has been drawn), changing PF color is basically the same principle - updating the color register after a certain number of cycles has passed (but before the start of the next scanline). The added limitation to this is that there are no VDEL and HM registers for PF - the visible portion of a scanline occupies cycles 22 to 75 (cycle 76 marks the beginning of the next scanline)...so a PF color change can only be possible every 4th horizontal position of the 160. "Bus stuffing" (i.e. using a coprocessor to handle the updates using a 2-cycle opcode) could lower this limitation to every 3rd horizontal position.

ldx   #$0F   ;2
Block:
sta WSYNC ;3 00
lda #$80 ;2 02
sta COLUBK ;3 05
ldy #$07 ;2 07
Delay:
dey ;2 09/14/19/24/29/34/39
bne Delay ;2 12/17/22/27/32/37/41
lda #$30 ;2 43
dex ;2 45
sta COLUBK ;3 48
bne Block ;2 50
sta WSYNC ;3 00
stx COLUBK ;3 03

This example draws a 15-scanline band (the X register used to count down the number of lines). Each scanline begins by resetting the background color to dark blue. A delay loop using the Y register wastes cycles on approach to the middle of the scanline, and then the background color is changed to dark red exactly at cycle 48 - the center of the visible screen. At the end of the Block loop, the X register is reused to set the background color to zero (black) on the following scanline.

  • Like 1
Link to comment
Share on other sites

Note that an easy way to alter the playfield pixel color exactly at cycle 48 is to use "Score mode" by setting bit 1 on + bit 2 off in register CTRLPF. Instead of using COLUPF for the pixel color, the display will use COLUP0 for the left half of the screen, and COLUP1 for the right half. This is a native hardware ability of the machine, so you might not find it very useful. Here's a code example similar to the above that alters the background color at a different point in each scanline.

ldx   #$0B   ;2
Block:
sta WSYNC ;3 00
lda #$80 ;2 02
sta COLUBK ;3 05
txa ;2 07
tay ;2 09
lda #$30 ;2 11
Delay:
dey ;2 13/18/23/28/33/38/43/48/53/58/63
bne Delay ;2 16/21/26/31/36/41/46/51/56/61/65
dex ;2 67
sta COLUBK ;3 70
bne Block ;2 72
sta WSYNC ;3 00
stx COLUBK ;3 03
The X registers' value is passed to Y for the delay time...so the result is that the color change uses a diagonal pattern instead of directly in the center of the screen.
  • Like 1
Link to comment
Share on other sites

Note that an easy way to alter the playfield pixel color exactly at cycle 48 is to use "Score mode" by setting bit 1 on + bit 2 off in register CTRLPF. Instead of using COLUPF for the pixel color, the display will use COLUP0 for the left half of the screen, and COLUP1 for the right half. This is a native hardware ability of the machine, so you might not find it very useful. Here's a code example similar to the above that alters the background color at a different point in each scanline.

ldx   #$0B   ;2
Block:
 sta   WSYNC  ;3 00
 lda   #$80   ;2 02
 sta   COLUBK ;3 05
 txa          ;2 07
 tay          ;2 09
 lda   #$30   ;2 11
Delay:
 dey          ;2 13/18/23/28/33/38/43/48/53/58/63
 bne   Delay  ;2 16/21/26/31/36/41/46/51/56/61/65
 dex          ;2 67
 sta   COLUBK ;3 70
 bne   Block  ;2 72
 sta   WSYNC  ;3 00
 stx   COLUBK ;3 03
The X registers' value is passed to Y for the delay time...so the result is that the color change uses a diagonal pattern instead of directly in the center of the screen.

 

 

ty Nukey Shay, sometimes i can imagine things but when people like you teachs is realy great!! cos this puts my ideas in the "yeh my friend you are in the right way"

 

ty very very much.

 

cheers.

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