Jump to content
IGNORED

PFPIXEL ON and OFF cycles?


yuppicide

Recommended Posts

Roughly how many cycles would a PFPIXEL ON and OFF command take

It's going to vary based on three factors-- (1) what kind of parameters are you using, (2) are you using bankswitching, and (3) are you using the Superchip option?

 

The first factor doesn't affect the pfpixel routine itself, but affects how many cycles it takes to load the A, X, and Y registers before the pfpixel routine is called. If you're using numbers, it will take 2 cycles for each parameter. If you're using zero-page RAM or ROM addresses, it will take 1 extra cycle for each parameter. If you're using Superchip RAM or absolute (2-byte) ROM addresses, it will 2 extra cycles for each parameter. I don't think you can use arrays (indexed modes) for the parameters, although you could read an array to get a parameter and then store the value read in another variable first, in which case reading the array and storing the value read would add more cycles as well.

 

The other two factors-- bankswitching and the Superchip option-- affect how the routine gets compiled, and make a big difference in the number of cycles used. However, I tried bankswitching both with and without the Superchip option, and the Superchip option didn't seem to make any difference in the number of cycles used, even though it does affect the way the routine gets compiled.

 

Anyway, I tried three commands to see how long they took. This is using numbers for the parameters, with no bankswitching and no Superchip:

 

pfpixel 15 5 on -- 82 cycles

pfpixel 15 5 off -- 88 cycles

pfpixel 15 5 flip -- 85 cycles

 

That includes loading the parameters and then calling the actual routine. The cycles would be increased by 1 or 2 cycles per parameter if you use zero-page variables (1-byte addresses) or Superchip variables (2-byte addresses).

 

I then tried pfpixel on with 8k bankswitching and 8kSC bankswitching:

 

set romsize 8k

pfpixel 15 5 on -- 177 cycles

 

set romsize 8kSC

pfpixel 15 5 on -- 177 cycles

 

I haven't tried pfpixel off, or pfpixel flip, but they should show a similar increase.

 

Michael

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