Jump to content
Sign in to follow this  
José Pereira

Some questions about Missiles using

Recommended Posts

About Missiles what's the difference between (CPU/cycles, Assembly,...):

1.)- Have the four joined (5th Player) but as if they were one sprite (one next to the other)?

2.)- Have the same 5th Player enabled but they are eachone of the four at a different xPos and yPos on screen?

3.)- Use the more 'normal way' and they are Player and Missile (not 5th Player enabled) but they are not Player/Missile joined?

4.)- Use the more 'normal way' and they are Player and Missile (not 5th Player enabled) and they are joined in a single 10pixels wide?

 

 

Thanks.

José Pereira.

Edited by José Pereira

Share this post


Link to post
Share on other sites

Seperate missiles means you have to AND/OR mask the individual missiles plus the seperate X/YPos calculations are needed for each.

 

Joined 4 missiles means the draw can be done in a single set of operations and XPOS calculating is easy since the distance should always be constant.

 

Joined M to P means the AND/OR should be needed but the XPOS is easy.

 

Deliberate interaction with playfield for extra colours will add complexity no matter what the case, but a lot simpler for static stuff.

Share this post


Link to post
Share on other sites

Seperate missiles means you have to AND/OR mask the individual missiles plus the seperate X/YPos calculations are needed for each.

 

Joined 4 missiles means the draw can be done in a single set of operations and XPOS calculating is easy since the distance should always be constant.

 

Joined M to P means the AND/OR should be needed but the XPOS is easy.

 

Deliberate interaction with playfield for extra colours will add complexity no matter what the case, but a lot simpler for static stuff.

 

Why the AND/OR? Missiles just put on screen, why AND/OR and with wich stuff is it needed to AND/OR?

Share this post


Link to post
Share on other sites

Missiles are 2 pixels across each, so they're packed into the 1 byte.

 

Each Missile it's 2bits=2pixels and if you place it alone you waste 1byte (always working in coding with bytes width?), 4Missiles alone you'll waste 4bytes?

If a Missile alone it will take the same cycles as if you're droping a Player 8pixels wide on screen, is it this?

Share this post


Link to post
Share on other sites

There is only one byte for missile data, missile 0 is bits 0,1. Missile 1 bits 2,3... missile 2 bits 4,5 and missile4 bits 6,7 so you have to AND/OR when working with individual missiles.

Share this post


Link to post
Share on other sites

There is only one byte for missile data, missile 0 is bits 0,1. Missile 1 bits 2,3... missile 2 bits 4,5 and missile4 bits 6,7 so you have to AND/OR when working with individual missiles.

 

Yes, I think I am begining to understand now why the AND/OR stuff.

How many cycles would an AND/Or takes?

 

If I have the 4Missiles in different places I would have to do the AND/OR how many times? Four, three?

Share this post


Link to post
Share on other sites

You need do AND/OR for each line of each missile. So when you want draw missile 0 for example 4 lines high you generally need to do 4 times:

LDA pmg_missile_area
AND #$FC
ORA missile0_data
STA pmg_missile_area

.. to preserve other missile data at that position and put missile 0 data there. But it depends on the missile usage, if you know they are not at the same vertical positions, you can skip the AND/OR stuff.

Edited by MaPa

Share this post


Link to post
Share on other sites

You need do AND/OR for each line of each missile. So when you want draw missile 0 for example 4 lines high you generally need to do 4 times:

LDA pmg_missile_area
AND #$FC
ORA missile0_data
STA pmg_missile_area

.. to preserve other missile data at that position and put missile 0 data there. But it depends on the missile usage, if you know they are not at the same vertical positions, you can skip the AND/OR stuff.

 

 

Yes, I see now, that's exactly the same as in soft sprites Bitmap masking...

Correct me if I'm wrong:

For example M0 it's (11)

Inverse it you'll get (00) same way as in soft sprites (then Missiles would take, like this same as soft sprites Bitmap Masking 'normal cost' 21cycles?: 'LDA/AND/OR/STA')

 

(00000000) byte

AND

(11111100) Missile inverse ($FC)

---------------

(00000000)

OR

(00000011) Missile real Data

---------------

000000011

 

 

 

 

 

 

 

 

 

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