Jump to content
peteym5

Stretch Missile across the full width of screen

Recommended Posts

I know this had been mentioned several times, but I cannot find a specific posting on how to do this.

Some people say its possible with the player/missile graphics to stretch the missile across the full width of the screen.

Where can I find code on how to do this?

Share this post


Link to post
Share on other sites

You need to change the player width as its drawing the player (cycle exact). The shift register gets confused. The Altirra hardware reference manual has details.

  • Like 2

Share this post


Link to post
Share on other sites

I've not tried it yet and get the feeling it probably won't work but with VBXE - the GTIA modes aren't properly implemented, I think it's the colour only mode where the background inherits the luma value from COLBAK, but the proper behaviour of that mode is that background shoud always be luma 0, with nonzero pixel values inheriting the luma value of that register.

By having a PM object stretched as an underlay it might be able to fix static pictures as to work properly on VBXE.

 

Then again, it'd probably be just as easy to setup a repeating solid graphics overlay that sits under the GTIA display to override and produce the wanted background colour.

Edited by Rybags

Share this post


Link to post
Share on other sites

To reveal some of the trickery, run in Altirra. Press F8 and enter from the debug console E D01A A2

(changes background colour)

 

From what I can work out, he's using the size trick each scanline to make missiles 0 and 2 persistent. Missile 0 is positioned to start the triangle, Missile 2 at the end to mask it back to background colour.

Share this post


Link to post
Share on other sites

From what I can gather you can only shut it off by changing size to a value other than 2 or when the object is triggered for redisplay when the HPOS comparitor matches.

 

Earlier explanation of mine a bit out.

Kernal loop starts.

Just after WSync, missiles 0/2 are positioned at HPOS=0C. Colours - Missile 0 is black, Missile 2 is red.

SIZEM set to 33 then 22 which makes the 2 missiles persistent. Due to M0 priority over M2, the display is black.

The kernal then sets each missile to the trigger position which will empty the shift register and stop display of each. Missile 0 (black) ends where the triangle starts. Missile 2 (red) is the triangle. The position change for missile 2 empties it's shift register at the end of the triangle.

Then repeat for each scanline.

 

Explanation of PM persistence bug on pages 100-101 of the 2016-03 Altirra HW reference manual.

Edited by Rybags
  • Like 4

Share this post


Link to post
Share on other sites

How would that work ontop of a gr. 9 screen?

I thought the same thing. Colored shapes mixed with 16 shades.

  • Like 1

Share this post


Link to post
Share on other sites

This can be merged into GR.9, but there are a couple of caveats. First, only the missiles can be used as fifth player mode must be enabled. GTIA 9/11 count as background instead of playfield for priority purposes and the playfield is shut off whenever any players or missiles are active, regardless of priority setting (PRIOR[0:3]). The fifth player, though, isn't counted as P/M graphics for this and so it will merge with the playfield. Therefore, you can tint a GR.9 screen with the missiles.

 

The second problem is that this technique effectively only gives you windows on the left side. This is because the locking up the player or missile requires a tight register write sequence, while turning the P/M object back off can be done via the HPOS register. The problem is that you can't XOR the missiles, so you have to overlap them -- and if fifth player mode is enabled, this doesn't do you any good because all of the missiles are the same color and are effectively ORed together. You can draw colored shapes on top of GR.9 this way, but you're stuck with the shapes that extend all the way to the left border, or at least where you elect to toggle the missiles on with the CPU. An underlay beneath GR.8 would be possible, though, since the hires layer is completely unaffected by P/M graphics.

 

One possibility that I had thought of was using the fifth player conflict trick. It is possible to stencil the fifth player with PF0-PF1 and the players by setting PRIOR[0:3]=%1000; this would theoretically allow one of the players to subtract from the left side of a missile and allow the missile to draw a double-sided shape beneath a 2-color playfield. Switching from two missiles to player+missile requires two more writes to size registers, though, which makes the scanline timing tighter.

 

In any case, using this for a cooler demo is left as an exercise for the reader. :)

 

  • Like 4

Share this post


Link to post
Share on other sites

The biggest strength of this trick might be as extra colour underlays for normal 160x multicolour modes. Though the problem is that since the size and position setup is required that takes away from time to do colour register changes.

 

Maybe pictures could be done in a venetian effect. First scanline has colour changes, second scanline has background underlays.

Edited by Rybags
  • Like 1

Share this post


Link to post
Share on other sites

This is the type of thing that amazes me! I'm hoping a skilled game dev will make a racing game like Power Drift using this for the road so that scrolling / DLIST isn't used up for the road creation. Especially if this can be done twice, for all 4 missiles, giving us two separate colored shapes for the grey middle & striped sides of the road. Keep discovering stuff like this please :)

  • Like 1

Share this post


Link to post
Share on other sites

btw. guys.... simply check Numen "Turbovecs" which are done by PM only.... ;)

 

https://youtu.be/HVuEd742Yyg?t=686

 

ah... need to check Avery's code as Atari 800 Mac version does only show bands and not filled...

 

PM only? Nice! Why didn't you guys put gfx behind it?

 

I tried this missile-stretch stuff a while ago on Altirra and it worked as advertised. Very impressive stuff.

I didn't go into the details and I was into my own ideas for REHARDEN, but I thought this needs to be used for road...

  • Like 1

Share this post


Link to post
Share on other sites

No gfx because no dma steal ;)

I'd bet, people still stumble into that trap on and on. As long as they read the wrong books ;)

 

Testing "Sprites" with DMA OFF is beyond reality ;)

 

IF some routine is usable, you only could get to a real production, if the DMA is enabled to the maximum possible.

Share this post


Link to post
Share on other sites

No gfx because no dma steal ;)

 

There is some DMA used to fill in the center of the largest faces but it's minimal because it's ANTIC mode 8 with the pixels crunched down from 8 scan-lines per pixel to 1 scan-line per pixel via VSCROL. Here's the DMA pattern in Altirra:

 

post-21021-0-29356500-1513709239.png

 

Here's one of the kernels where you can see VSCROL getting updated every scan-line and DLISTL getting updated every other scan-line:

 

 

 

post-21021-0-58642800-1513710014_thumb.png

 

 

 

Edit: Correction on how often DLISTL gets updated.

Edited by Xuel
  • Like 1

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

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...