Jump to content

Recommended Posts

Can someone give me a sample code that will change the playfield color to different colors using batari BASIC 0.99b? I mean within the same screen, line 1 be one color, line 2 be a different one, etc.

Edited by atari2600land
Link to comment
https://forums.atariage.com/topic/92783-changing-playfield-color/
Share on other sites

I've asked the same thing, with no luck. It involves altering the kernel, something people are leaving to Batari, unfortunately. I mean, he's really good at it, but it's a disgusting amount of work for one person.

 

I'd be thrilled with being able to split the background color into two seperate halves...

Can someone give me a sample code that will change the playfield color to different colors using batari BASIC 0.99b? I mean within the same screen, line 1 be one color, line 2 be a different one, etc.

Is this what you mean? The "set kernel_options pfcolors" line is crucial. The "pfcolors" statement sets the playfield color for each line (or row) of playfield pixels. However, the color of the first row doesn't come from the first "pfcolors" value, it either comes from the last value, or you can set "COLUPF" to the first value inside the loop before you call "drawscreen." You can use decimal values if you want; I just prefer using hex values for the colors. You must compile with DASM 2.20.07 or else the code won't compile, because DASM 2.20.10 has a bug.

 

MR

 

  set kernel_options pfcolors
  COLUBK = $06
  playfield:
  XXXXXX.XXXXXX..XXXXX.XXXXXX.....
  ..XX...XX.....XX.......XX.......
  ..XX...XXXX....XXXX....XX.......
  ..XX...XX.........XX...XX.......
  ..XX...XXXXXX.XXXXX....XX.......
  ................................
  .....XXXXXX.XXXXXX..XXXXX.XXXXXX
  .......XX...XX.....XX.......XX..
  .......XX...XXXX....XXXX....XX..
  .......XX...XX.........XX...XX..
  .......XX...XXXXXX.XXXXX....XX..
end
  pfcolors:
  $1A
  $18
  $16
  $14
  $12
  $10
  $20
  $22
  $24
  $26
  $28
end
loop
  COLUPF = $1A
  drawscreen
  goto loop

 

test_pfcolors.bas

 

test_pfcolors.bas.bin

 

post-7456-1156742028_thumb.jpg

Yes, this is what I mean. I use 2600IDE to compile. Will this work with every version of 2600IDE?

2600IDE isn't a compiler, it's just an editor that can call a compiler and an emulator. When you compile through 2600IDE, there will be a line that says which version of DASM is being used (see below, down by the "bytes free" message). If it isn't 2.20.07, you'll get a lot of compile errors when you try to use many of bB 0.99's new features. DASM 2.20.07 is at http://www.atari2600.org/DASM/.

 

MR

 

> "C:\Atari2600\bB\2600bas.bat" C:\Atari2600\bB\Projects\test_pfcolors.bas

C:\Atari2600\bB>cd Includes 

C:\Atari2600\bB\Includes>..\preprocess.exe   0<C:\Atari2600\bB\Projects\test_pfcolors.bas  | ..\2600basic.exe  1>bB.asm 
2600 Basic compilation complete.

C:\Atari2600\bB\Includes>..\postprocess.exe  1>C:\Atari2600\bB\Projects\test_pfcolors.bas.asm 

C:\ATARI2~1\bB\Includes>..\dasm.exe C:\Atari2600\bB\Projects\test_pfcolors.bas.asm -f3 -oC:\Atari2600\bB\Projects\test_pfcolors.bas.bin 
DASM V2.20.07, Macro Assembler (C)1988-2003
  bytes of ROM space left
  2777 bytes of ROM space left
Complete.

> Terminated with exit code 0.

Why won't v. 2.07 compile the .bas file I attached at the bottom?

It compiled for me with no problem. Are you sure you're using the 0.99c version of bB?

 

MR

I'm using 99b. There's a 99c?

Why won't v. 2.07 compile the .bas file I attached at the bottom?

It compiled for me with no problem. Are you sure you're using the 0.99c version of bB?

 

MR

I'm using 99b. There's a 99c?

0.99c is the version that Batari hasn't posted yet in his blog, although he's emailed it to everyone who's asked him for a copy of it. I thought you had asked him to email it to you? Did you reinstall version 0.99b over 0.99c? I think 0.99c is probably buggier than 0.99b is, but 0.99c has all of the newest features, possibly including some things that aren't in 0.99b. If I'm not mistaken, 0.99b has the multisprite kernel, but it doesn't have the multicolor playfield option.

 

MR

Edited by SeaGtGruff

Sorry, I was confused because I thought you were asking if there was a way to do it in thte older build of bB.

 

Zach - I meant horizontally, not vertically. Sorry I wasn't clear on that.

MausBoy, I just realized that you *can* change the background color in bB 0.99c, the same way you change the pfcolors. It took me a while to figure out how it works. I'm writing another session in the tutorial about the background, and I'll talk about it in there. Should be ready this weekend. :)

 

MR

Yeah it took me a couple tries to figure it out too, and it looks just plain ugly. It offsets every line by one pixel about 1/4th way in from the left.

 

What I'm after is a way to split the background color into two seperate colors, and specify on which line the split occurs. And without losing the ability to specify multiple pfheight tables, which is what happens when you use the 'background' kernel option.

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