Jump to content
Sign in to follow this  
José Pereira

PF2 AND PF3

Recommended Posts

Hello.

 

I "dreamed" this last night:

If I have a screen full of chars, using PFs. and Backgr., what will happen if a software sprite with PF2 cross a Char with PF3? I know we can use 5th Player, but this one will be always above PF2, and will mask it"... What a coder do when two chars with PF2 and PF3 overlap?

My idea it's PF2 Char overlap PF3 Char, then OR command, I can choose if I'll get PF2 or PF3...

Someone can help?

 

Another question: For example, if I have White as PF2 and Brown as PF3, can I change PF2 Char to Inverse(PF3), maintaining White colour and the same for PF3 (Change to PF2, maintaning Green colour). This will be very usefull to use with 5th Player and Priorities)?

 

 

Any help? Thanks?

Jose Pereira.

Share this post


Link to post
Share on other sites

You've just got to decide which is the "best" of what is going to be a mess.

 

On Exploding Fist one of the guys is PF2 the other PF3 to get the white and red "suits". Of course then some of the background also uses those colours so depending on what that graphic is, some white "blossom" in a tree for example, I have a different set of character definitions for that area for when "Red" goes over them. Usually in that case the white blossom is swapped for pink blossom so you're not likely to notice much change. In solid colour areas (the red tower in Fist) it's a little more tricky because of course part of the tower will either turn white or maybe pink or grey if I used the same method of having a new definition of that graphic. If you've got PMGs free to help then you can use them and/or the other method at the same time, redefine the character AND replace the colour with a PMG. For some of the unavoidable "attribute clash" (eww a speccy!) I'm relying on the fact that the players will probably be moving reasonably fast when they jump into those areas and hoping it doesn't get noticed too much ;)

 

 

Pete

Share this post


Link to post
Share on other sites

Hi again.

 

PeteD you have one White and the other Red, O.K. What I want is one time I get White, and on another ocasion I'll get Red. Think you're two White/Red PFs. in a pseudo 3D like LN/Knight Lore/..., you sometimes have White priority, others Red priority.

 

I think my second question would fix this, 5th Player (PF3) always above all PFs (almost all times,... that 2+16 bug).

White PF2 change to PF3 and inverse, than use 5th Player. O.k., this will only work in 8pixels normal size (not in your FIST guys of course). Try to underswtand my 2nd question. What you think?

 

Thanks.

Jose Pereira.

Share this post


Link to post
Share on other sites

Yeah, for 8 pixels then drawing the data into P5 will mask PF2. Switching PF2 and PF3 colours will of course only work if you're not using them elsewhere, or you'd have to inverse the whole screen. I'm not sure exactly what you mean to do with that? If the COLPF2 and 3 registers are white and brown then changing bit 7 of the char will just switch the char from white to brown or vice versa. There's no way to keep one of those colours and not mess up the rest of the screen. I think maybe I just don't understand yet what you're expecting to happen ;)

 

 

Pete

Share this post


Link to post
Share on other sites

Yeah, for 8 pixels then drawing the data into P5 will mask PF2. Switching PF2 and PF3 colours will of course only work if you're not using them elsewhere, or you'd have to inverse the whole screen. I'm not sure exactly what you mean to do with that? If the COLPF2 and 3 registers are white and brown then changing bit 7 of the char will just switch the char from white to brown or vice versa. There's no way to keep one of those colours and not mess up the rest of the screen. I think maybe I just don't understand yet what you're expecting to happen ;)

 

 

Pete

 

 

I'll change PF2toPF3 and PF3toPF2. Than I'll have to change also PF2 colour(White) to Red and the inverse.

 

If you're two guys were only 8pixels, you can get one time white Priority and other time Red Priority. Understand now the idea?

 

Jose Pereira.

Share this post


Link to post
Share on other sites

Yes, but as soon as you start swapping COLPFx registers the rest of the screen will change colour. If you're not using PF2/3 anywhere else then the theory is sound.

 

 

Pete

Share this post


Link to post
Share on other sites

I wouldn't use pf2/3 on the soft sprites at all, only on the backgrounds. There's no issue that way.

Share this post


Link to post
Share on other sites

Not an option in my case :( Probably José's as well if I'm following all his posts properly ;)

 

Certainly designing a game from scratch I'd try to do it that way.

 

 

Pete

Share this post


Link to post
Share on other sites

Not an option in my case :( Probably José's as well if I'm following all his posts properly ;)

 

Certainly designing a game from scratch I'd try to do it that way.

 

 

Pete

 

Here I am again.

 

This is just one more of my questions to learn some more possible ways to do some things.

 

Yes, I'll change all screen...

Taking your example>:

 

White(PF2) -> PF3 (Change PF3 colour from Red to white)

Red(PF3) -> PF2 (Change PF2 colour from White to Red.

I think now it's simply for you to understand.

 

 

 

 

As I understand Sotware Sprite movement/overlap Playfield routines are made by logical (AND/OR/...) operations.

What I am trying to know if in some way the programmer forget and a char using PF2 overlap another with PF3 (Logical operation between 11(>127) AND/OR 11(>128)).

(something like different priority bits set on Priority modes, you get Black colour)

 

Thanks,

José Pereira.

Share this post


Link to post
Share on other sites

Changing the whole screens char definitions just to flip PF2/PF3 for a sprite overlap seems a bit overkill? That's flipping a bit in 960 bytes at a time. Unless of course you keep a map of which ones need changing but if your background is complex that'll be just as intensive an operation.

 

If a programmer was to "forget" that a PF2 based char was moving over a PF3 based one then the only outcome of that forgetting would be the background (currently containing PF3) would change colour (to PF2). The >127 or <128 is the char index not the definition so the AND/OR is an operation on a different aspect of the spriting code and makes no difference to PF2/PF3 choice.

 

 

 

Pete

Share this post


Link to post
Share on other sites

Thanks Pete.

 

So, from what you said: PF2 win.

 

O.K. but in "this programmer's forget" what wins the PF from Sotware Sprite Char or PF2 always win?

 

Sorry about this one more questions?

 

Best regards,

José Pereira.

Share this post


Link to post
Share on other sites

It depends on how the code works. If the code takes notice of what is currently there then it can decide to do some "special case" code if it's drawing a PF2 sprite char over a PF3 background char. If the background is the same PF as the sprite, everything will be fine. If one is different then some choice has to be made as to which colour will be lost (or changed to the new colour). Usually it would be to just let the background colour change to the sprite colour as that's what is now in the foreground but if there's a lot of background colour and not much foreground that can look really bad.

 

If our forgetful coder misses any of this functionality and just draws to the current characters definition it will be whatever colour is currently there.

 

eg a char looking like - at a position on the screen is char number 10, therefore PF2, and along comes | over the top of it. | is meant to be PF3 but if the code doesn't handle that and draws it to char 10 you'll get a PF2 + If the code changes the char number to 138 you'll get a PF3 +

 

 

Pete

Share this post


Link to post
Share on other sites

Hi Jose,

 

I'm not sure whether I exactly understand your question/problem, but suppose PF3 is white (so are the missiles, when 5th player bit is selected in the PRIOR register). Now suppose the player software-sprite needs BG,PF0,PF1 and white. Then wouldn't it be the simplest to use the missiles as overlays? Don't use both PF2 or PF3 for the sprite? (Remember, PF3 has highest priority!). Then, when the sprite starts overlapping a piece of background, then its character-codes' 7th bit (for selecting PF2 or PF3), can just be imitated by the char-codes of the sprite. The white missiles overlaying it, will always be there and have the highest priority. F.e. when you put value $14 into PRIOR, you can use the 4 Players as underlays (quad size if needed), and the 5th player is on top of everything.

Share this post


Link to post
Share on other sites

Hi Jose,

 

I'm not sure whether I exactly understand your question/problem, but suppose PF3 is white (so are the missiles, when 5th player bit is selected in the PRIOR register). Now suppose the player software-sprite needs BG,PF0,PF1 and white. Then wouldn't it be the simplest to use the missiles as overlays? Don't use both PF2 or PF3 for the sprite? (Remember, PF3 has highest priority!). Then, when the sprite starts overlapping a piece of background, then its character-codes' 7th bit (for selecting PF2 or PF3), can just be imitated by the char-codes of the sprite. The white missiles overlaying it, will always be there and have the highest priority. F.e. when you put value $14 into PRIOR, you can use the 4 Players as underlays (quad size if needed), and the 5th player is on top of everything.

 

I think it was José's original idea to use P5 to overlay stuff to "fix" the colours, it's just limited in that it can only "fix" anything that was PF3 and got overwritten because it'll always be that colour. If for example a background "tile" had PF3 and was overwritten by a softsprite of PF2 then it's easy to put the PF3 data (after the sprite masking of course) into P5 and the background will still appear to be the same colour :) Other circumstances though can cause a mess. José was talking about switching COLPF2 and 3 and then flipping all the chars on the screen so you could "fix" the opposite situation to above where PF2 is the one needing the "fix". There are of course methods to do the above without flipping anything just by sorting out the PF data and kind of doing an inverse mask so the lower one (of PF2/3) is left intact and the top one becomes the P5 data. Now I bet he's even more confused lol Poor guy asks a couple of questions in threads and ends up with coders contemplating complex softsprite routines :)

 

 

Pete

Share this post


Link to post
Share on other sites

Well, I don't know in what situation Jose wants to use it (I'm not that familiar with LN), and possibly another problem is me being a non-native english speaker, and neither is he. So, I already have a lot of trouble understanding what he's writing....sorry for confusion. So, I guess the problem is: there are multiple software sprites on screen using PF2 (or 3)?

Edited by analmux

Share this post


Link to post
Share on other sites

hehe yeah, not to offend José but sometimes I can't reply to his threads because I just don't understand them ;)

 

Because of that, I'm not totally sure still "exactly" what he wants to do but I think the kind of thing I posted above is it. :)

 

Whatever it is, it's very limited with P5 to do this "fix".

 

Pete

Edited by PeteD

Share this post


Link to post
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.

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...
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...