Search found 85 matches

by Manveru
Sat Feb 06, 2016 6:31 pm
Forum: SGDK
Topic: Is it possible to 'scale' sprites?
Replies: 25
Views: 16379

Re: Is it possible to 'scale' sprites?

I don't know if this is what you are asking for, but you can try. I did and i have good results, but slow if you update it every frame: http://www.drdobbs.com/architecture-and-design/fast-bitmap-rotation-and-scaling/184416337 I've also used this technique. If I remember correctly, it would instantl...
by Manveru
Thu Feb 04, 2016 7:21 pm
Forum: SGDK
Topic: Is it possible to 'scale' sprites?
Replies: 25
Views: 16379

Re: Is it possible to 'scale' sprites?

I don't know if this is what you are asking for, but you can try. I did and i have good results, but slow if you update it every frame:
http://www.drdobbs.com/architecture-and ... /184416337
by Manveru
Wed Jan 27, 2016 12:10 pm
Forum: SGDK
Topic: C optimizations
Replies: 20
Views: 12485

Re: C optimizations

In gcc 3.4.6 i have tested it various times and prefix operations are faster. When you do i++, the process first copies i for the required operation and after that operation it modifies the var. With ++i there is not a value copy because we use the already modified var, so this makes ++i a bit faster.
by Manveru
Wed Jan 27, 2016 7:06 am
Forum: SGDK
Topic: C optimizations
Replies: 20
Views: 12485

Re: C optimizations

You can force the compile to make a function inline with the attribute: __attribute__((always_inline)) You can see more info in this link https://gcc.gnu.org/onlinedocs/gcc/Inline.html I do not recomend you using inline functions which returns a value. They are slower than a macro, but functions wit...
by Manveru
Fri Dec 25, 2015 4:36 pm
Forum: SGDK
Topic: Couldn't Allocate Heap, win32 error ...
Replies: 22
Views: 15153

Re: Couldn't Allocate Heap, win32 error ...

I solved this bug first with a register fix program, but i forgot its name. After that, i solved this error instaling PC Tools Firewall (it is not a joke). Casually the errors disappeared and after some time i discovered it was because of the firewall. Just disabling this firewall causes the errors ...
by Manveru
Thu Dec 03, 2015 5:55 pm
Forum: Megadrive/Genesis
Topic: Sprite table to VRAM with or without DMA?
Replies: 6
Views: 4706

Re: Sprite table to VRAM with or without DMA?

Ok i understand. Thanks guys!!!
by Manveru
Thu Dec 03, 2015 2:01 pm
Forum: Megadrive/Genesis
Topic: Sprite table to VRAM with or without DMA?
Replies: 6
Views: 4706

Re: Sprite table to VRAM with or without DMA?

Now I keep a local copy of the entire sprite table in RAM, and DMA it across in the vertical interrupt routine. Works a treat! I usually do that, but in some wikis say that DMA works fine but the cache should not be completely update, causing some problems with the drawn sprites. I have some random...
by Manveru
Thu Dec 03, 2015 9:42 am
Forum: Megadrive/Genesis
Topic: Sprite table to VRAM with or without DMA?
Replies: 6
Views: 4706

Sprite table to VRAM with or without DMA?

Hi guys!

I am reading some info about sending the sprite table without DMA because DMA can cause some glitches for this operation. Is that right? Do you know the reason for that?

Thanks!
by Manveru
Fri Nov 13, 2015 5:31 am
Forum: SGDK
Topic: How distance_approx() works??
Replies: 4
Views: 4130

Re: How distance_approx() works??

If you need just an approximation, you can do something like this:

Code: Select all

#define get_approx_distance( _x1, _x2, _y1, _y2 ) \
	const u16 dx = abs( (_x1) - (_x2) ); \
	const u16 dy = abs( (_y1) - (_y2) ); \
	const u16 approx_distance = MAX( dx, dy ) + ( MIN( dx, dy ) >> 2 )
by Manveru
Mon Jan 26, 2015 11:12 pm
Forum: SGDK
Topic: Use a pointer multiple times, or assign pointer to local var
Replies: 12
Views: 7709

My guess is that it's leaving the pointer in an address register and using address register relative addressing to access the variable, which only needs a word to access the var rather than a long absolute pointer. Of course, you could also try "register fix32 speed = obj->speed;" for even better s...
by Manveru
Mon Jan 26, 2015 10:15 am
Forum: SGDK
Topic: Use a pointer multiple times, or assign pointer to local var
Replies: 12
Views: 7709

At least on the GCC i'm using with SGDK, it helps a lot to use local variable to speed up the code. Then it is right that performance and the generated code can change a lot between different versions of GCC. I didnt know so much about this, but after some learning reading in webs like stackoverflo...
by Manveru
Mon Jan 26, 2015 1:03 am
Forum: SGDK
Topic: Use a pointer multiple times, or assign pointer to local var
Replies: 12
Views: 7709

Thats right, this is the best way, but you can try some test to know what code has better performance, specially if you know nothing about ASM and because of that you work with C instead of ASM to dev Megadrive games, like me :oops:
by Manveru
Sun Jan 25, 2015 2:39 pm
Forum: SGDK
Topic: Use a pointer multiple times, or assign pointer to local var
Replies: 12
Views: 7709

I remember to get better results with the first code. After some code tips reading, i discover that the first time the obj->speed pointer is used it will be placed on the cache, so the next times you use it (if cache is not overwriten) the access to it will be a lot faster than the first time, so cr...
by Manveru
Mon Nov 24, 2014 6:26 am
Forum: SGDK
Topic: Sega Genesis Dev Kit (SGDK)
Replies: 852
Views: 1174555

I just released SGDK 1.00 :) I was tired of version 0.9x so i jump to 1.00, also this version bring the new XGM driver which should really help when playing with music and sound =) As usual you can find that on the SGDK project page : https://code.google.com/p/sgdk/ Great job Stef, congratulations ...
by Manveru
Wed May 28, 2014 4:33 pm
Forum: SGDK
Topic: Sega Genesis Dev Kit (SGDK)
Replies: 852
Views: 1174555

Stef wrote:New version released !
As usual, you can download and get changelog on the SGDK project page
Great job Stef, thanks for it.