Jump to content
IGNORED

COLUP0/COLUP1 Not Working


Scott_B
 Share

Recommended Posts



set romsize 2k
set kernel_options player1colors pfcolors
player1:
%00000000
%00011000
%00100000
%01000000
%01110000
%11101000
%10100000
%11100000
end
player0:
%11100111
%10100101
%11101111
%01110100
%01101100
%00000100
%00011111
%00000000
end
pfcolors:
$00
$1E
$1E
$1E
$00
$92
$D6
$1E
$40
$C0
$C0
end
playfield:
................................
.........................XXXX...
.........................XXXX...
.........................XXXX...
................................
...............................X
..............................XX
............................XXXX
.........................XXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
end
set optimization inlinerand
set optimization speed
COLUBK = $BE
player0x=20
player0y=72
COLUP0 = $00
COLUP1 = $04
loop
drawscreen
AUDF0 = 20
AUDC0 = 3
AUDF0 = 3
if joy0left then player0x=player0x-1
if joy0right then player0x=player0x+1
if joy0up then player0y=player0y-1
if joy0down then player0y=player0y+1
player1x=player0x
player1y=player0y-2
goto loop


When I compile this, the bicyicle (player0) and the stick figure (player1) are not different colors. WTF?!

58255a61105f0.png

Edited by Scott_B
Link to comment
Share on other sites




here I've rearranged your code to be more to my liking



I moved the kernel options stuff to the beginning


I added a player1color statement


I poked holes in player0 so player1 would show through


I moved the player0 color assignment (COLUP0 = $00) to just before drawscreen

(you'll end up with COLUP0 being the leftover score color from the previous drawscreen otherwise)


edit COLUP0 has to be set before the next drawscreen but it doesn't matter where






set romsize 2k
set kernel_options player1colors pfcolors
set optimization inlinerand
set optimization speed

player1:
%00000000
%00011000
%00100000
%01000000
%01110000
%11101000
%10100000
%11100000
end

player1color:
$42
$44
$46
$48
$4A
$4C
$4E
$50
end

player0:
%11100111
%10100101
%11101111
%01100100
%01001100
%00000100
%00001111
%00000000
end

pfcolors:
$00
$1E
$1E
$1E
$00
$92
$D6
$1E
$40
$C0
$C0
end

playfield:
................................
.........................XXXX...
.........................XXXX...
.........................XXXX...
................................
...............................X
..............................XX
............................XXXX
.........................XXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
end

COLUBK = $BE
player0x=20
player0y=72

loop
COLUP0 = $00
drawscreen

AUDF0 = 20
AUDC0 = 3
AUDF0 = 3

if joy0left then player0x=player0x-1
if joy0right then player0x=player0x+1
if joy0up then player0y=player0y-1
if joy0down then player0y=player0y+1
player1x=player0x
player1y=player0y-2

goto loop


Edited by bogax
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...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...