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.

Announcements And Comments > Just pimping my demo in it's current state.

#20405 - Lord Graga - Mon May 10, 2004 4:41 pm

Hey all!

I just want to pimp my demo so far. There's only two scenes, but I'd really like to hear what you think. It uses funky compression method to stay that tiny.


Download it here! (6.164 byte).

#20412 - Lupin - Mon May 10, 2004 8:50 pm

Really nice demo you have there! I like the old scoolish vblank sine wave effect :)

You planned to write it in asm using arm ads, right?
_________________
Team Pokeme
My blog and PM ASM tutorials

#20413 - isildur - Mon May 10, 2004 9:04 pm

Hey, I like it! :)

#20414 - Lord Graga - Mon May 10, 2004 9:52 pm

Lupin wrote:
Really nice demo you have there! I like the old scoolish vblank sine wave effect :)

You planned to write it in asm using arm ads, right?
ARM SDT :P

But yes, it was planned to be in pure ASM. Saddly it became C instead :P

#20415 - tepples - Mon May 10, 2004 10:13 pm

You can still make it pure asm. Once you have your algorithms working in C, you can switch it to assembly language by telling your compiler to skip assembling the result of code generation into object code. I don't know the command in ARM's tools, but in GCC it's gcc -Wall -O3 -marm -mthumb-interwork -S xform.c -o xform.s
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#20431 - Daniel Andersen - Tue May 11, 2004 5:49 am

Hey Graga, nice demo! Good job! :)

tepples wrote:
You can still make it pure asm. Once you have your algorithms working in C, you can switch it to assembly language by telling your compiler to skip assembling the result of code generation into object code. I don't know the command in ARM's tools, but in GCC it's gcc -Wall -O3 -marm -mthumb-interwork -S xform.c -o xform.s


I won't recommend that. Actually, why would you do that? You had better rewrite the critical functions - or all of them one by one, if you want to rewrite the whole thing - by scratch in assembly; there need not be an 1-1 mapping between your C-code and your assembly code.

When coding assembly, I stick to - when writing complex functions, at least - trying to write them in C before writing them in assembly. In that way you get a feel of what you are to do, but not necessarely precesily *how* you are to do it; just a quick scetch.

But of course, using GCC is a possibility, just beware that compilers do not always produce nice - or even fast! - assembly code! :)

#20450 - tepples - Tue May 11, 2004 4:05 pm

Daniel Andersen wrote:
tepples wrote:
[gist: Look at the assembly language code that GCC generates.]

I won't recommend that. Actually, why would you do that?

Prototyping a function in a high-er-level language makes it easier to get the system working at first:
  1. Get an algorithm working in C.
  2. See the asm code that GCC generates.
  3. Hand-optimize the asm code.
  4. Optimize across the whole program.
  5. SPEED!
Which is almost like what you do:

Quote:
When coding assembly, I stick to - when writing complex functions, at least - trying to write them in C before writing them in assembly. In that way you get a feel of what you are to do, but not necessarely precesily *how* you are to do it; just a quick scetch.

I guess the difference of approach hinges on whether or not one looks at GCC's attempt at code generation. I guess that because I use C for everything except some ISRs and signal processing, I need a bit more help.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#20470 - Lupin - Tue May 11, 2004 9:31 pm

It is always good to look at the ASM output of your C code because the compiler sometimes does some tricky optimizations that you might not think of, but for complex functions it is sometimes hard to understand the complex asm output that the compiler will give you and therefor i most likely only take parts of the C code into my asm implementation.
_________________
Team Pokeme
My blog and PM ASM tutorials

#20471 - Daniel Andersen - Tue May 11, 2004 9:34 pm

Quote:
I guess the difference of approach hinges on whether or not one looks at GCC's attempt at code generation.


Yes, when prototyping in C I don't use GCC to output assembly. Rather, modulo optimizations, compilers have stardard compilation patterns for the different types of constructs which means that essentially the compiler does not know what it's doing - a clever person, however, who knows his assembly language will (sometimes at least) know how to write it in another problem-specific way. Especially GCC has to my knowledge bad optimizations.

But you're right, why use assembly language today? Mostly it is not worth it, if not for fun. Even on the Amiga people used C or Amos, and as far as I have heard those two machines are equally fast - someone correct me here if I'm wrong... :)