Jump to content

Too many sprites bug ?


Zapf Bandit

Recommended Posts

All,

 

I am making Frogger for the DS.

 

It is all working well so far except for the fact that when I have over 12 sprites on the sub (top) screen they start copying incorrectly in wierd and wonderful ways... I also have about 13 sprites on the main screen so it could be the total number. I'll do some more investigation and find the exact issue. Just a heads-up for now.

 

Excellent work though to the author. This is a top notch emulator considering the time the ds has been out. I'm going to buy a DS and passthrough soon since I really want to get this working.

 

Cheers,

Zapf Bandit

Link to comment
Share on other sites

Roger Wilco to you both,

 

I am currently on holiday until Wed morn (Australian time).

 

I will post the demo first thing for analysis.

 

It could just be me but it seems painfully reproducable.

 

The main screen seems fine regardless of the number of sprites it is only the top (sub) screen that is as issue.

 

Anyway, I could forward to posting it first thing on Wednesday.

 

Thanks for the interest,

Zapf Bandit

 

 

Zapf Bandit, if you could post a link to your webspace, I would like to try your demo on the various emus and versions that I have - thanks.

Link to comment
Share on other sites

Okay...

 

http://www.zapfbandit.com/downloads/Frogger.zip

 

There is an emu rom and a hardware rom.

 

For a screenshot of how it looks for me:

http://www.zapfbandit.com/gba.html

and scroll to the bottom.

 

The dodgy sprites are the last 2 turtles and the log bits.

 

If I reduce the number of sprites down the log work perfectly. It seems that only the first 11 sprites work correctly on the sub display.

 

There is no difference between the two dodgy turtles and the rest. Here is the code that sets the OAM record entries for the turtles.

 

Note: not all the sprites have been added and thus don't move yet (they are part of the background).

 

Also note: this is nowhere near finished yet.

 

Thanks,

Zapf Bandit

 

No problems I will wait.

Edited by Zapf Bandit
Link to comment
Share on other sites

Ah ha...

 

I've found the exact bug...

 

I tried adding more sprites to the main (bottom) screen and found that the problem sprites started working.

 

It appears that the number of sprites onscreen on the sub (top) screen cannot exceed those on the main screen.

 

In order to hide sprites initially i do the following:

 

for (uint16 i=0; i<128; i++)

{

OAM[4*i] = 192;

OAM_SUB[4*i] = 192;

}

 

Then for each sprite I use I assign the correct OAM values.

 

I don't know the Dualis code but pehaps you are setting the maximum number of sprites used based on only on the main display. Don't know...

 

Thanks,

Zapf Bandit

Link to comment
Share on other sites

Thanks for that!

 

Downloaded and extracted. Renamed to my "standard", frogger.bin, and frogger.pme (for ideas emu).

 

Tried on versions of Ideas. Blank screen always.

 

Tried on versions of DSemu. Version 2g gave the best results, with the correct number of rows. The last row of cars is corrupt, the frog is missing, and it freezes at the start.

frogger.jpg

 

Tried on versions of Dualis. Only starts on R8. Earlier revisions crash the emu. The screen has exactly the same bug as in your screenshot. I noticed the rows of logs and cars is twice as many as should be. Dualis r8 is the only emu where you can make the frog hop around.

 

Note: not all the sprites have been added and thus don't move yet (they are part of the background).

 

Also note: this is nowhere near finished yet.

You are certainly correct. But I think it's an excellent start. Keep up the good work! :P

 

EDIT: the above post was responding to your post at 2:14pm, the one with the links.

Edited by robbbert
Link to comment
Share on other sites

There's no special limitation for either core. You're allowed to have 128 visible sprites on both cores, for a total of 256.

 

Okay...

 

It still seems to be the problem... Last night I added all the cars and as I predicted I was able to add a lot more sprites above but at the same point (same number as visible on bottom) they stopped working... I am going to try using transparent sprites for those I'm not using and see whether the problem disappears. I suspect that it will...

 

I'll keep you posted.

 

Zapf

 

 

<Some time slightly later>

 

I'm a complete idiot...

 

I just had a close look at my sprite movement code and it appears that I was using my old GBA code for some parts and thus using some of the main screen sprite chacteristics for the sub screen. The wierd frogs were due to the fact that the trucks were 32*16 sprites and this size was being used. All the others were fine since the other sprites are all 16*16.

 

Many appologies for the false accusations. I'll be more careful next time.

 

Mic you are indeed a legend having such a polished emulator so early in the show... I'm looking forward to your next release.

 

Zapf

Edited by Zapf Bandit
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...