GFX_WRITE_VRAM_ADDR is expensive? (was: code benchmarking)

SGDK only sub forum

Moderator: Stef

Chilly Willy
Very interested
Posts: 2993
Joined: Fri Aug 17, 2007 9:33 pm

Post by Chilly Willy »

I'll try those two using 4.6.2 and see what I get. I might also try making it use short addressing on the ram to see how that affects the speed.
djcouchycouch
Very interested
Posts: 710
Joined: Sat Feb 18, 2012 2:44 am

Post by djcouchycouch »

Hi,

Just wanted to let you guys know I tried out your suggestions and it's definitely helped. The benchmark numbers for that routine has dropped to 13045, a pretty dramatic improvement!. :)

Thanks again for your help!
DJCC
Stef
Very interested
Posts: 3131
Joined: Thu Nov 30, 2006 9:46 pm
Location: France - Sevres
Contact:

Post by Stef »

Chilly Willy wrote:I'll try those two using 4.6.2 and see what I get. I might also try making it use short addressing on the ram to see how that affects the speed.
Nice, i think it could be interesting :) How can you force the compiler for short RAM addressing ? define RAM area at FFFF0000-FFFFFFFF is enough ?
Stef
Very interested
Posts: 3131
Joined: Thu Nov 30, 2006 9:46 pm
Location: France - Sevres
Contact:

Post by Stef »

djcouchycouch wrote:Hi,

Just wanted to let you guys know I tried out your suggestions and it's definitely helped. The benchmark numbers for that routine has dropped to 13045, a pretty dramatic improvement!. :)

Thanks again for your help!
DJCC
Glad you get it, it's a nice improvement indeed :)
Chilly Willy
Very interested
Posts: 2993
Joined: Fri Aug 17, 2007 9:33 pm

Post by Chilly Willy »

Stef wrote:
Chilly Willy wrote:I'll try those two using 4.6.2 and see what I get. I might also try making it use short addressing on the ram to see how that affects the speed.
Nice, i think it could be interesting :) How can you force the compiler for short RAM addressing ? define RAM area at FFFF0000-FFFFFFFF is enough ?
Yeah, just change the ram address in the linker script to 0xFFFF8000 and the length to 0x8000. I also change the stack to 0xFFFF8000 at the same time so the stack doesn't "waste" any of the short addressing space.

I did this once before, but I've forgotten if I used any switches with that. It's not something I normally do for MD homebrew.

If you use the built-in allocator, you could also change the linker script to set _end/__end to 0xFF0000 so that the heap gets put at the start of ram; then you could malloc up to the stack.
Post Reply