| |
Digger
Registered: Mar 2005 Posts: 437 |
Static sprite multiplexing under moving FLD
So, I have an 8-sprite static multiplexer under a classic moving FLD and need to switch sprite pointers at constant rasterlines.
Since FLD pushes badlines down too, the pointer switching code executes at various places (including badlines), which basically desyncs everything including the FLD itself.
Any known (and simple enough) solutions to this?
Should I try a clockslide with a delay cycles LUT to compensate?
Thanks!
Digger/ESM |
|
| |
chatGPZ
Registered: Dec 2001 Posts: 11386 |
for example: you could just swap the screen location every line in the fld loop, and adjust the value from outside the table. |
| |
Digger
Registered: Mar 2005 Posts: 437 |
Quote: for example: you could just swap the screen location every line in the fld loop, and adjust the value from outside the table.
Thanks, but no screen memory. it's for intro compo, max $4000 bytes.
Another fact, sprite pointers switches happen _after_ FLD. |
| |
Oswald
Registered: Apr 2002 Posts: 5094 |
Quote: Thanks, but no screen memory. it's for intro compo, max $4000 bytes.
Another fact, sprite pointers switches happen _after_ FLD.
I doubt that, afaik VICII reads sprite pointers _every_ line (when sprite is present) no matter what, totally independently from bad lines. if it needs to read sprite data spr pointer read happens. hardwired behaviour. |
| |
oziphantom
Registered: Oct 2014 Posts: 490 |
how is your raster set up, are you just burning clocks per line? Could you switch to putting the triggers on a NMI off a Timer? then use a table to switch the NMI ptr to handle the cases where you need to set ptrs, just exit, restore sprite data etc? |
| |
Digger
Registered: Mar 2005 Posts: 437 |
@Oswald: Exactly, but I meant I have to switch my sprite pointers after FLD, at the same rasterline every time despite of various FLD offsets.
@oziphantom: Thought about timers too, but then is variable timing too, depending on the FLD and badline offset, right? |
| |
oziphantom
Registered: Oct 2014 Posts: 490 |
I was thinking you just fire it off every line, not sure how much FLD or what type of FLD you are doing exactly. and so each timer you change the NMI handler to do what you need for that line. which might just be, dec line counter and rti |
| |
chatGPZ
Registered: Dec 2001 Posts: 11386 |
without saying what *exactly* you are trying to do, nothing can be said :) i dont see a problem at all with switching sprite pointers _after_ FLD for that matter - just do it :) |
| |
Oswald
Registered: Apr 2002 Posts: 5094 |
how about manipulating a speedcode from the outside, speedcode does d011, d018 access every line, but it is either lda or sta, then if you need new spritepointers you stick in an sta d018, if you are in fld you stick in sta d011's, if you are in an unfld-d char row have lda d011's instead of sta d011's. then timing is same for all lines at the price of a complicated manipulator running in the top / bottom borders.
edit: badlines will stop this from working correctly, well then some bne's to for skipping nops on badlines ? :P |
| |
chatGPZ
Registered: Dec 2001 Posts: 11386 |
might also want to use overlapping sprite data. ever since i worked that out i use it for all kinds of things, makes "all of sprite" things like this almost trivial =) |
| |
Oswald
Registered: Apr 2002 Posts: 5094 |
btw I remember a release from recently doing just this? fullcr sprite layer + fld ? |
| |
Digger
Registered: Mar 2005 Posts: 437 |
I am just an idiot. It won't work with waiting by wasting cycles comparing $d012, but obviously switching to a new IRQ just solved it.
Fine to close this thread. |
| |
Rastah Bar Account closed
Registered: Oct 2012 Posts: 336 |
@Oswald: probably this one
Ghosts'n Goblins Demo
I think Digger's problem is that he sometimes needs to switch sprite pointers on a badline (when the change in sprite images has to appear one line after a badline). Groepaz made a good suggestion of using overlapping sprite data to solve that. |
| |
oziphantom
Registered: Oct 2014 Posts: 490 |
You can patch and fix as well.
So you put the top of the sprite into the bottom of the sprites.. switch the ptrs, then mid sprite you restore the bottom back, no vertical loss, loose timings ( credit to DanP for the tip ) |