Search found 710 matches

by djcouchycouch
Fri Mar 23, 2012 1:57 am
Forum: Megadrive/Genesis
Topic: Efficient C Question: Global variables
Replies: 17
Views: 11951

Efficient C Question: Global variables

Hi, I've been looking at the documents suggested in the "Best practices for writing C on 68000?" thread and one thing that the docs don't talk about much is global variables. Are there any performance penalties with using them? Lots of my functions will be using them and I'm not sure that having glo...
by djcouchycouch
Thu Mar 22, 2012 2:08 am
Forum: Demos
Topic: Goplanes
Replies: 194
Views: 123377

Thanks Shiru, those suggestions helped a lot!

Scrolling is much, much smoother now, as you can see from my latest update:

http://www.youtube.com/watch?v=RWLPk1tap8M
by djcouchycouch
Mon Mar 19, 2012 12:54 am
Forum: Demos
Topic: Goplanes
Replies: 194
Views: 123377

Goplanes

*********** EDIT: January 4th, 2013 *************** A bit of unfortunate news. I'm stopping all development for this project. Art and videos will also be taken down. I wish and hope to revisit this project again, but won't be happening any time soon. Thanks for watching, DJCC. *********** Hi, The f...
by djcouchycouch
Mon Mar 19, 2012 12:39 am
Forum: SGDK
Topic: GFX_WRITE_VRAM_ADDR is expensive? (was: code benchmarking)
Replies: 19
Views: 12611

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
by djcouchycouch
Fri Mar 16, 2012 1:30 pm
Forum: SGDK
Topic: GFX_WRITE_VRAM_ADDR is expensive? (was: code benchmarking)
Replies: 19
Views: 12611

Isn't GCC optimizer is smart enough to detect that the value is never used so it does not even try to calculate it, i.e. your u16 tileNumber ... line does not execute at all when you comment out its use? Yeah. I realized that the compiler was stripping that out right after posting. Should've though...
by djcouchycouch
Fri Mar 16, 2012 1:23 am
Forum: SGDK
Topic: GFX_WRITE_VRAM_ADDR is expensive? (was: code benchmarking)
Replies: 19
Views: 12611

I played around some more with the code, following the pseudocode I wrote earlier. It definitely helps with performance. Again, running 1000 times, the benchmark number drops to around 42240 ticks. But by accident I discovered something weird. So I'm caching the tile flag like this: u16 tileAttr = T...
by djcouchycouch
Thu Mar 15, 2012 5:06 pm
Forum: SGDK
Topic: GFX_WRITE_VRAM_ADDR is expensive? (was: code benchmarking)
Replies: 19
Views: 12611

Stef wrote: By the way, can't you use the following method ?

Code: Select all

void VDP_setTileMapRect(u16 plan, const u16 *data, u16 index, u16 flags, u16 x, u16 y, u16 w, u16 h);
I probably could. I didn't think of it at the time. I'll try it out later today.
by djcouchycouch
Thu Mar 15, 2012 1:32 pm
Forum: SGDK
Topic: GFX_WRITE_VRAM_ADDR is expensive? (was: code benchmarking)
Replies: 19
Views: 12611

auto increment register does wonders How would I use that, like this? // pseudocode-ish code ahead. // pre-loop setup plctrl = (u32 *) GFX_CTRL_PORT; pwdata = (u16 *) GFX_DATA_PORT; addr = <some location in the plane I want to write to> *plctrl = GFX_WRITE_VRAM_ADDR(addr); // only calling this once...
by djcouchycouch
Thu Mar 15, 2012 11:01 am
Forum: SGDK
Topic: GFX_WRITE_VRAM_ADDR is expensive? (was: code benchmarking)
Replies: 19
Views: 12611

In the last SGDK i replaced the GFX_WRITE_VRAM_ADDR macro : #define GFX_WRITE_VRAM_ADDR(adr) vramwrite_tab[adr] Yes, that's the version I have. It is noticeably faster than the version Shiru mentioned. Anyway as Shiru said, i think there is something wrong in your code... If thoe methods slow down ...
by djcouchycouch
Thu Mar 15, 2012 2:41 am
Forum: SGDK
Topic: GFX_WRITE_VRAM_ADDR is expensive? (was: code benchmarking)
Replies: 19
Views: 12611

GFX_WRITE_VRAM_ADDR is expensive? (was: code benchmarking)

Hi, I've been using getTick()/getSubTick() as suggested in the Code Benchmarking techniques thread, running a thousand iterations and measuring the time it takes. For example, I've been benchmarking a loop that sets a column of tiles at the edge of the screen when the screen scrolls. One surprising ...
by djcouchycouch
Wed Mar 14, 2012 2:37 am
Forum: Megadrive/Genesis
Topic: Code benchmarking techniques?
Replies: 14
Views: 10950

Maybe I spoke too soon. To get general idea of what my main loop performs like, I call getTick() at the beginning (starttime) and the end (endtime). But if I do a endtime - starttime I get zero. I also get zero if I use getSubTick(). But if I call getSubTick before and after some calls to VDP_setTil...
by djcouchycouch
Wed Mar 14, 2012 2:04 am
Forum: Megadrive/Genesis
Topic: Code benchmarking techniques?
Replies: 14
Views: 10950

I'm calling getSubTick() before and after the code I'm trying to benchmark and I'm getting numbers! And when I optimize the code the numbers get smaller! :)

So it seems to be working for me. Thanks!
by djcouchycouch
Tue Mar 13, 2012 1:48 pm
Forum: Megadrive/Genesis
Topic: Code benchmarking techniques?
Replies: 14
Views: 10950

One idea I've got is to find the code I want to benchmark and set it to run a thousand or ten thousand times, and have something visible happen when it's done. Because it's looping many, many times, the amount of time it takes should be measurable with a stopwatch. Not the most friendly way, but it ...
by djcouchycouch
Tue Mar 13, 2012 1:41 pm
Forum: Blabla
Topic: General 68000 Discussion Forum?
Replies: 3
Views: 4071

General 68000 Discussion Forum?

Hi,

Are there any general discussion forums for the 68000 CPU? Somewhere I can post general CPU questions. I was hoping to find something similar to www.6502.org, which has a pretty active community.

Thanks!
DJCC
by djcouchycouch
Tue Mar 13, 2012 1:31 pm
Forum: Megadrive/Genesis
Topic: Code benchmarking techniques?
Replies: 14
Views: 10950

Let's say I want to benchmark a while loop in my main game loop. How would your suggested technique work? If I understand it, the color would change only for a fraction of a second, which would be hard to time manually.