[4.1.5] Sprite Cycling

User avatar
AllDarnDavey
Posts: 227
Joined: Sat Jan 12, 2019 6:16 am
Location: Seattle

Re: [4.1.5] Sprite Cycling

Post by AllDarnDavey » Sat Dec 14, 2019 12:48 am

WillElm wrote:
Fri Dec 13, 2019 12:10 am
At some point this modification stopped working for me. The only other modification that I made to this script was the "make bosses not reset on hurt" trick from this thread: [url]http://www.nesmakers.com/viewtopic.php?f=40&t=2298&p=14039&hilit=timer#p14039[/url]

Any idea why this could be?
Hmm... I haven't used both these modifications together myself, but it doesn't look like they should conflict with each other, they are changing different areas of the file. It is possible though, there's weirdness like you can only jump so many lines, so adding changes might break a branch that used to work fine. It's hard to say.

Have you tried reaching out to [url=http://nesmakers.com/memberlist.php?mode=viewprofile&u=558]chronicleroflegends[/url]? There's a chance they are using both modifications together and so might have a working version.
WillElm
Posts: 116
Joined: Wed Mar 20, 2019 3:56 am

Re: [4.1.5] Sprite Cycling

Post by WillElm » Thu Dec 19, 2019 4:01 am

After putting it aside and working on other parts of my project, I remembered something really important. At one point I had disabled draw order, but had since reenabled it. However, I forgot to uncomment JSR UpdateDrawOrder at the beginning of the script. Uncommenting it fixed the sprite cycling code.
User avatar
AllDarnDavey
Posts: 227
Joined: Sat Jan 12, 2019 6:16 am
Location: Seattle

Re: [4.1.5] Sprite Cycling

Post by AllDarnDavey » Thu Dec 19, 2019 8:15 pm

Nice... glad you figured it out.
User avatar
hakota
Posts: 2
Joined: Thu Dec 26, 2019 9:44 pm

Re: [4.1.5] Sprite Cycling

Post by hakota » Fri Feb 14, 2020 4:42 pm

Just wanted to thank you for this awesome script!
User avatar
retrothunder
Posts: 25
Joined: Thu Aug 09, 2018 1:38 am

Re: [4.1.5] Sprite Cycling

Post by retrothunder » Wed May 06, 2020 3:32 am

Routines\Basic\ModuleScripts\HurtWinLoseDeath\HandleHurtMonster.asm(78): Unknown label.
Routines\Basic\\MainASM.asm(424): Unknown label.
Routines\Basic\\System\HandleUpdateObjects.asm(344): Unknown label.
demo.txt written.

IDK what I did wrong I removed and then replace the code
Attachments
NesM.png
NesM.png (151.79 KiB) Viewed 2066 times
User avatar
retrothunder
Posts: 25
Joined: Thu Aug 09, 2018 1:38 am

Re: [4.1.5] Sprite Cycling

Post by retrothunder » Wed May 06, 2020 3:37 am

then this happen
Attachments
NesMaker.png
NesMaker.png (328.06 KiB) Viewed 2064 times
User avatar
nathanlurker
Posts: 67
Joined: Tue Apr 07, 2020 3:56 pm
Location: Montreal, Canada

Re: [4.1.5] Sprite Cycling

Post by nathanlurker » Wed May 06, 2020 8:13 pm

Check line 78 from your Routines\Basic\ModuleScripts\HurtWinLoseDeath\HandleHurtMonster.asm & line 424 from Routines\Basic\\MainASM.asm & line 344 from Routines\Basic\\System\HandleUpdateObjects.asm. It says they all have ''unknown label''. on those lines, they probably all use a constant or variable or something, and that component has an issue. it will help to know what that unknown label refers to.

in your second screenshot, that's a message that will appear when your game can't compile. it can't create the .nes file of your game, because of the previously mentionned issue.
User avatar
AllDarnDavey
Posts: 227
Joined: Sat Jan 12, 2019 6:16 am
Location: Seattle

Re: [4.1.5] Sprite Cycling

Post by AllDarnDavey » Fri May 08, 2020 1:55 am

retrothunder wrote:
Wed May 06, 2020 3:32 am
Routines\Basic\ModuleScripts\HurtWinLoseDeath\HandleHurtMonster.asm(78): Unknown label.
Routines\Basic\\MainASM.asm(424): Unknown label.
Routines\Basic\\System\HandleUpdateObjects.asm(344): Unknown label.
demo.txt written.

IDK what I did wrong I removed and then replace the code
First thing I would do is go back to your original copy (you did backup the original I hope), see if it builds then. Just to make sure it isn't some other change you made.

I've gotten this error before when I'm trying to jump to a branch but made a typo and it can't find it (or I have more then one label named the same). A label is the first part of a code block that ends in a colon.

Code: Select all

UpdateDrawOrder:
or

Code: Select all

doneWithSwapItem:
when you have a branch statement like

Code: Select all

BEQ doneWithSwapItem
You're telling it to jump to that label if certain conditions are met. Now I've found out the hard way that you can only jump so many lines of code (up or down) during a branch. I once added just a few lines of code to another file and it stopped working because it suddenly couldn't find the label to branch anymore, and I had to reorder a bunch of code blocks to make it work again.

It could be something as simple as you have too many empty lines of code and now you cannot branch. Maybe try removing some of those empty lines you have. Also looking at your code compared to mine it looks like you might have accidentally removed too much. I have a whole

Code: Select all

HandleScroll:
block you appear to be missing. Unless you rearranged things more then just adding in sprite cycling.
MissingCodeBlock.PNG
MissingCodeBlock.PNG (45.1 KiB) Viewed 1869 times
User avatar
Elarath
Posts: 74
Joined: Fri Apr 05, 2019 6:33 am

Re: [4.1.5] Sprite Cycling

Post by Elarath » Mon Jun 01, 2020 8:42 am

Bit 5 of $2002 is labeled as sprite overflow. It is flagged when there are more than 8 sprites per scanline, though the wiki states that it is buggy. I haven't tested, but do you think it would be possible to use this in conjunction to your sprite cycling code, so that the cycling only occurs when needed?

https://wiki.nesdev.com/w/index.php/PPU ... _.3E_write
Check out my game!
Light From Within
User avatar
AllDarnDavey
Posts: 227
Joined: Sat Jan 12, 2019 6:16 am
Location: Seattle

Re: [4.1.5] Sprite Cycling

Post by AllDarnDavey » Mon Jun 01, 2020 8:21 pm

Elarath wrote:
Mon Jun 01, 2020 8:42 am
Bit 5 of $2002 is labeled as sprite overflow. It is flagged when there are more than 8 sprites per scanline, though the wiki states that it is buggy. I haven't tested, but do you think it would be possible to use this in conjunction to your sprite cycling code, so that the cycling only occurs when needed?

https://wiki.nesdev.com/w/index.php/PPU ... _.3E_write
Hmm... interesting. Seems like it would be possible to query that register value and branch out early if overflow isn't triggered. I'm a little worried it gives false positives and false negatives but that might not occur often enough to be a big of a deal. I'm not sure it would gain a whole lot though. Sprites now only flicker when they're more then 8 per line. The only thing this would affect would be overlapping sprites altering which draws in front even when they don't need to cycle. The early branch would save a bit of processing too when cycling isn't needed, but the savings is probably negligible. Looking at the list of games that use sprite overflow on purpose to hide sprites when underwater, cheat going downstairs, or even do some cheeky scanline splitting, I wonder if anyone of them use any tricks to determine when to use sprite cycling and when to not.
Post Reply