gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

DS Misc > no$gba vcount accuracy

#159645 - Fury - Thu Jul 03, 2008 2:39 pm

Hi guys
Do any of you know how accurate the VCOUNT register in no$ is? I am trying to 'profile' in an approximate way by keeping track of it at certain points, I can't test it on the DS because my uSD just died :(

My gut feeling is that it isn't cycle-for-cycle accurate, but erring on the side of performance as most games would sync to the vblank anyway.

Does anyone know?

#159679 - elwing - Fri Jul 04, 2008 8:41 am

I have no idea for the DS but for the GBA no$gba seems to mimic the exact hardware timing. tonc contains some time mesurement for some copy method, the DMA copy example is the best one... VBA run the copy 99% faster than the actual hardware when no$gba stay within a few percent of difference, it seems like some emulator are made for gamer and some emulator are made for devs, no$gba seems one of the later, not sure if it applies to DS 3d hardware trough...

#159683 - Cydrak - Fri Jul 04, 2008 9:59 am

I often noticed that certain code runs faster on the DS, whereas other code runs faster on NO$GBA. Usually NO$GBA is slower for me. (As measured by the timers, not VCOUNT, but if they don't match up then the emulator is quite broken. :P)

I don't know the particulars, but I suspect that some subtleties aren't well or at all emulated. Such as the ARM9 cache (far faster than RAM), or the delays incurred when competing with the display for VRAM (slower on the DS it seems).

Anyway, sometimes it's quite visible, such as sound stuttering/lagging sooner, or some vblank code suddenly spilling into the frame. And sometimes, it doesn't matter at all (as with startup tasks). The most extreme cases I saw were CPU-heavy, cache-friendly code, such as fractals and sound synths.

For just gauging relative cost, I'd guess it's probably fine... just be aware, discrepancies may emerge if you push the system.

#159688 - sgeos - Fri Jul 04, 2008 10:55 am

Always do your final testing on hardware. (Assuming that is your final target.)

-Brendan

#159754 - Fury - Sun Jul 06, 2008 9:36 am

Thanks for the replies
I am fairly satisfied that it is close enough (but still have no new sd card to test), but I approximated the cpu use based on the number of vcount lines, then by turning off vsync and saw how much further things progressed, again approx, but the two results were close enough to eachother to satisfy me that my code isn't breaking the bank.

When I get some real hardware results I'll post them here for everyone elses benifit, unless someone wants to try my code and see.

Also from what I've been reading about no$, the dude is somewhat of an accuracy nazi. It is quite an amazing piece of software.

#159755 - sgeos - Sun Jul 06, 2008 10:12 am

Fury wrote:
When I get some real hardware results I'll post them here for everyone elses benifit, unless someone wants to try my code and see.

Post a link. Someone may or may not take you up on that.

-Brendan

#159758 - Fury - Sun Jul 06, 2008 10:52 am

OK here's the link:

http://www.savefile.com/files/1650074

The vcount#'s are the five numbers in the middle of the second screen, under each number is the maximum for each point.

The buttons are:
X to switch between two weapons
Y to upgrade selected weapon
R for 'overdrive' mode
Start, then Select to reset

The most cpu intensive is laser at level 4 with overdrive on :)

#159761 - silent_code - Sun Jul 06, 2008 11:34 am

Serious sidenote: Please, don't call anybody a (whatever-) nazi (especially when that person is from Germany) - it's not funny.

That said, I have to tell you, the game looks and plays good. :^)
Besides the collision detection (when pushed through solids by the background) and being invurnerable, everything works as expected. :^)

I like the fast scrolling! :^D

Keep up the good work. :^)
_________________
July 5th 08: "Volumetric Shadow Demo" 1.6.0 (final) source released
June 5th 08: "Zombie NDS" WIP released!
It's all on my page, just click WWW below.

#159762 - Fury - Sun Jul 06, 2008 11:51 am

silent_code wrote:
Serious sidenote: Please, don't call anybody a (whatever-) nazi (especially when that person is from Germany) - it's not funny.


:( Sorry, my bad. I meant it as a compliment, that he has attention to detail, but poor choice of phrase you are right

And cheers, it's a work in progress as you can see... more collision detections coming...

Ultimately you will just die if the bg pushes you off the screen, also enemies won't be able to shoot at you through the bg.

#159772 - tepples - Sun Jul 06, 2008 3:31 pm

silent_code wrote:
Serious sidenote: Please, don't call anybody a (whatever-) nazi (especially when that person is from Germany) - it's not funny.

Is "nutsy" OK?
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#159774 - silent_code - Sun Jul 06, 2008 4:02 pm

<LOL>
*That's* funny! (Although not in the sense it was meant to be by the author.) ;^D
I was just like: "Wow, now 'nazi' is a compliment or what?" Well, I understand the intention. ;^) But others might not and feel *very* offended.
_________________
July 5th 08: "Volumetric Shadow Demo" 1.6.0 (final) source released
June 5th 08: "Zombie NDS" WIP released!
It's all on my page, just click WWW below.

#159792 - sgeos - Sun Jul 06, 2008 8:55 pm

Germany is fanatically sensitive about the subject at this point.
Swasticas are illegal, and someone sporting an swastica tatoo with a cross through it (like the no smoking sign) got in a lot of trouble even though everyone thought it was silly.

-Brendan

#159794 - silent_code - Sun Jul 06, 2008 10:09 pm

People have been arrested and punished for display of illegal symbols, even though they were clearly meant "anti." This is too much, Imho.
Now think about it: Prior to the Nazis' abuse, the Swastika has been a well known symbol for luck, just like a four-leaf clover.

Symbols are symbols, but the term "NAZI" (which is not a symbol) shall always remind us of that special, very recent part of our history, a horrible chapter that still, after generations, has its influence on our lives. We should never change it's meaning, for we forget too fast.

On a personal note: No more Nazi talk, please.
Not even about shooting Nazis, because it's just horrible when there have been people in your family, who have been forced to fight of a country and its "leaders" they hated at the time. A country whose army took your grounds and killed your people - and those members of your family "gave" their lives for that country and that "leader" they would have liked to see dead - forced to fight in a Nazi uniform, merely disguised as the enemy.
If we were jewish or considered otherwise "unworthy" to even die on the battlegrounds, they wouldn't have put those men, some of them still boys, into uniforms, they would have put them into gas chambers.

I don't have strong feelings against the country I live in and I don't dislike its people. All I want to say here is: "Don't forget."
There's a reason for this "taboo." Some people may get easily offended (even though usually I am not one of them) when writing about that subject in inappropriate ways. Calling someone a Nazi (no matter the intend), is calling somebody something, you don't want to be called yourself.

<End of sentimental stuff.>

PS @ Fury: This is not directed to you, personally. I'm ok with it, I just wanted to shed some light on a serious subject from this point of view. Be asured, that I'm totally ok with you (as of now.) ;^)
_________________
July 5th 08: "Volumetric Shadow Demo" 1.6.0 (final) source released
June 5th 08: "Zombie NDS" WIP released!
It's all on my page, just click WWW below.

#159826 - elwing - Mon Jul 07, 2008 6:53 am

sgeos wrote:
Germany is fanatically sensitive about the subject at this point.


every nation has that kind of problem, isn't "boobs" the problem in america?

#159834 - silent_code - Mon Jul 07, 2008 10:44 am

Only that boobs didn't kill millions of people... ;^)

But yes, nearly every nation has their own dark chapters, and in some countries, even today, mass-killings and ethnic cleansing is taking place. :^C

But let's get back on topic, please.
_________________
July 5th 08: "Volumetric Shadow Demo" 1.6.0 (final) source released
June 5th 08: "Zombie NDS" WIP released!
It's all on my page, just click WWW below.

#159850 - Fury - Mon Jul 07, 2008 2:53 pm

LOL. Ok now I feel _really_ bad. I shouldn't forget that we live in a global community and something that noone on this side of the world would give a second thought to might mean somthing quite different to others more connected.

Anyway I truly meant no offense and hope that none was taken.

OK, back to the plot... well sortof

I was surprised to learn that the bulk (about 2/3) of the cpu time being used was for the map scrolling. I was worried about collision detection eating it up, but it's nothing.

I think I read somewhere that the video memory is a lot quicker than the 4MB main memory (or is it 2?), anyway I've just been blitting the whole screen from the map data everytime it scrolls, when I think I should be shifting what is already on the screen, then just topping up the end from map data.

Still all it seems to matter at this point is that the arm9 would be idling more, and saving battery power. LOL