Hi Robin,
the new version doesn't work (some columns are fucked up) but it is indeed faster (10.5ms) so I'll try to fix it, or re-unroll it from scratch, it looks worth it!
But first I'm gonna investigate the debug console.
Graphics don't seem right
Moderator: ScummVM Team
- robinwatts
- ScummVM Developer
- Posts: 84
- Joined: Sat Apr 07, 2007 5:16 pm
- Location: Hook Norton, Oxfordshire, UK
- robinwatts
- ScummVM Developer
- Posts: 84
- Joined: Sat Apr 07, 2007 5:16 pm
- Location: Hook Norton, Oxfordshire, UK
- robinwatts
- ScummVM Developer
- Posts: 84
- Joined: Sat Apr 07, 2007 5:16 pm
- Location: Hook Norton, Oxfordshire, UK
New version in the usual place. Should fix an error in 1 in every 4 columns, and incorporates your offset fix above - thanks for that.Tramboi wrote:One column is still garbage
By the way when you STMFD a new register at the beginning, think about offsetting r9 in
LDR r9, [r13,#9*4] @ r9 = palette
I don't have too much time to check it though so hopefully you'll find it by rereading the code
Thanks for trying this stuff out - I don't have an NDS to test on. I certainly don't expect you to debug my code for me - but your efforts so far have been brilliant!
Hopefully this should be sorted now, but if it still goes wrong, it'd be nice to know how many columns are broken (1 out of 4 say), and even, if you can tell by looking at the screen, which ones are broken...
Thanks,
Robin
Hi folks, just noticed this thread, interesting to read.
Regarding dirty rectangles: I recommend to first concentrate on making the fullscreen blitter as fast as possible. Reason: Many games (e.g. COMI, Dig, FT, and various non-SCUMM games) unfortunately make little to no effort to do "small" blits, they just do full screen blits all the time. OK, those three SCUMM games might be out of the league anyway, but still for non-SCUMM games, you may have to use a fast fullscreen blitter.
Also, we've been offering a "framebuffer" API for the engines for some time now, and that requires full screen updates, too. The reason for that API, btw (as was explained on a scummvm-devel post at some point) is/was that in many cases, what takes most time is several stages of scaling/blitting etc. on various backends. Those backends get a better speedup if they just "manually" compare which pixels changed, and then only blit those. But I guess that is out of question for the NDS...
It's difficult to design a graphics API which can be optimized for several backends, I am afraid :-/. Suggestions are always welcome, though. Speed is no issue on the desktop, but we must accommodate the NDS, PSP, Symbian/Palm/WinCE devices and others.
BTW, anybody who knows a good MIPS code (PSP), send 'em over .
Regarding dirty rectangles: I recommend to first concentrate on making the fullscreen blitter as fast as possible. Reason: Many games (e.g. COMI, Dig, FT, and various non-SCUMM games) unfortunately make little to no effort to do "small" blits, they just do full screen blits all the time. OK, those three SCUMM games might be out of the league anyway, but still for non-SCUMM games, you may have to use a fast fullscreen blitter.
Also, we've been offering a "framebuffer" API for the engines for some time now, and that requires full screen updates, too. The reason for that API, btw (as was explained on a scummvm-devel post at some point) is/was that in many cases, what takes most time is several stages of scaling/blitting etc. on various backends. Those backends get a better speedup if they just "manually" compare which pixels changed, and then only blit those. But I guess that is out of question for the NDS...
It's difficult to design a graphics API which can be optimized for several backends, I am afraid :-/. Suggestions are always welcome, though. Speed is no issue on the desktop, but we must accommodate the NDS, PSP, Symbian/Palm/WinCE devices and others.
BTW, anybody who knows a good MIPS code (PSP), send 'em over .
That's my idea about the thingy Max : optimize the worst case firstfingolfin wrote:Hi folks, just noticed this thread, interesting to read.
Regarding dirty rectangles: I recommend to first concentrate on making the fullscreen blitter as fast as possible. Reason: Many games (e.g. COMI, Dig, FT, and various non-SCUMM games) unfortunately make little to no effort to do "small" blits, they just do full screen blits all the time. OK, those three SCUMM games might be out of the league anyway, but still for non-SCUMM games, you may have to use a fast fullscreen blitter.
Also, we've been offering a "framebuffer" API for the engines for some time now, and that requires full screen updates, too. The reason for that API, btw (as was explained on a scummvm-devel post at some point) is/was that in many cases, what takes most time is several stages of scaling/blitting etc. on various backends. Those backends get a better speedup if they just "manually" compare which pixels changed, and then only blit those. But I guess that is out of question for the NDS...
It's difficult to design a graphics API which can be optimized for several backends, I am afraid :-/. Suggestions are always welcome, though. Speed is no issue on the desktop, but we must accommodate the NDS, PSP, Symbian/Palm/WinCE devices and others.
And that's right, abstracting so many hardwares is just bound to need tradeoffs on some platforms. Let's just live with it!
A good code for what? A PSP scaler?fingolfin wrote:BTW, anybody who knows a good MIPS code (PSP), send 'em over .
I don't know if the PSP is really similar to the PS2, but if so there is certainly something to be done using the VU0, double buffering, and the asynchronous DMAs!
I find it difficult to believe that manually comparing two frames is efficient on any platform. The scaler would have to be pretty slow to benefit from this.Also, we've been offering a "framebuffer" API for the engines for some time now, and that requires full screen updates, too. The reason for that API, btw (as was explained on a scummvm-devel post at some point) is/was that in many cases, what takes most time is several stages of scaling/blitting etc. on various backends. Those backends get a better speedup if they just "manually" compare which pixels changed, and then only blit those. But I guess that is out of question for the NDS...
On the DS, the old dirty rectangle API was far superior to the new API, and many of the games run slower than they did. Admittedly, there were a lot of games that did a whole full screen blit anyway, and those are no worse. But in my opinion, we should be moving those games towards dirty rectangles, and only using the new framebuffer api for those games that really need it (like for scrolling sections).
[/quote]
But it is so -- think of the case where you just did a palette rotation (thus, dirtying the whole screen), and are using the (veeeery slow) hq2x scaler, plus aspect ratio correction, and you can get huge boosts if the palette rotation only affected small portions of the screen.agentq wrote:I find it difficult to believe that manually comparing two frames is efficient on any platform. The scaler would have to be pretty slow to benefit from this.
I was skeptical, too, but I know several emulators which implement this technique for a major speed boost. Of course on a low end platform with slow memory and a small cache, it will be bad. And if you only have one stage, because you combine scaling+ASR+rotation into a single function, *and* you have a quick scaler like AdvMame2x, then you don't want to do this.
In many cases, dirty rectangles are just not possible. At least not without major changes to the involved engines. And with palette rotation, you will still have to check the whole screen, unless you happen to run on a device which has 8bit color as its native mode anyway.agentq wrote: On the DS, the old dirty rectangle API was far superior to the new API, and many of the games run slower than they did. Admittedly, there were a lot of games that did a whole full screen blit anyway, and those are no worse. But in my opinion, we should be moving those games towards dirty rectangles, and only using the new framebuffer api for those games that really need it (like for scrolling sections).