Search the web
Sign In
New User? Sign Up
gbadev
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Real people. Real stories. See how Yahoo! Groups impacts members worldwide.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
using a timer to pause   Message List  
Reply | Forward Message #10738 of 15019 |
Re: using a timer to pause

"John Q. Pretentious" <johnisaheadcase@y...> wrote:
> > > ScanlineCounter = (volatile u16*)0x4000006; //this is the
> > > scan line counter
> >
> > you should declare ScanlineCounter a vu16* (volatile).
>
> Er. Maybe I'm misunderstanding. Can't you get away with it during
> declaration like he did there? Like, I thought a typedef was
> really a special form of a macro?

C typedefs aren't true macros, but they act the same way.
(volatile u16 *) does work on hardware, even at GCC optimization
level 3. Here's an excerpt from the pin8gba.h that my demos use:

typedef unsigned char u8;
typedef unsigned short u16;
typedef unsigned int u32;
/* ... */
#define LCD_Y (*(volatile u16 *)0x04000006)
/* ... */
/* an array of four 16-bit registers */
#define BGCTRL ((volatile u16 *)0x04000008)

It goes on to set up other cute tricks such as defining the
background scroll registers and DMA registers as arrays of
structs, letting me write code that looks like this:

BGSCROLL[0].x = x;
BGSCROLL[0].y = y;

--
Damian Yerrick





Tue Apr 2, 2002 8:56 pm

yerricde
Offline Offline
Send Email Send Email

Forward
Message #10738 of 15019 |
Expand Messages Author Sort by Date

I'm using the code from devoto's pern project (the Wait() function) to attain the proper speed for some animation in mode 4. I'm making a call to this function...
j_north2002
Offline Send Email
Mar 29, 2002
6:26 pm

Is the Wait() function doing a vsync wait or just an empty loop wait? ... From: j_north2002 [mailto:jmartin10@...] Sent: 29 March 2002 18:19 To:...
Martin Piper
fnagaton
Offline Send Email
Mar 29, 2002
7:31 pm

... wait? Correction - dovoto not devoto sorry... I cut and pasted the code from his tutorial /************************************\ * Timers.h by dovoto * ...
j_north2002
Offline Send Email
Mar 29, 2002
9:21 pm

... _________________________________________________________ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com...
John Q. Pretentious
johnisaheadcase
Online Now Send Email
Mar 29, 2002
10:49 pm

... function) ... making a ... that ... simpler ... get them ... my current ... ok, i'm now calling the following code from a drawing loop to try to get some...
j_north2002
Offline Send Email
Mar 30, 2002
12:05 pm

you should declare ScanlineCounter a vu16* (volatile)....
Jan-Lieuwe Koopmans
jan-lieuwe@...
Send Email
Mar 30, 2002
2:42 pm

... _________________________________________________________ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com...
John Q. Pretentious
johnisaheadcase
Online Now Send Email
Apr 2, 2002
8:17 pm

... C typedefs aren't true macros, but they act the same way. (volatile u16 *) does work on hardware, even at GCC optimization level 3. Here's an excerpt from...
yerricde
Offline Send Email
Apr 2, 2002
9:06 pm

... That wasn't declaration, it was assignment. He cast 0x40000006 as a volatile u16* value, then assigned it to a non-volatile u16* variable. Since ...
Mike Danylchuk
evi1twin
Offline Send Email
Apr 2, 2002
9:34 pm

... had ... loop when ... I think all of the suggestions actually worked. I had just begun using double buffering and neglected to flip the buffers in a new ...
j_north2002
Offline Send Email
Apr 11, 2002
8:26 am

Hello, ... Just out of pure curiosity -- does anyone know whether there's any difference between this code and testing display status register (there are bits...
Maciej Sinilo
yarpen2002
Offline Send Email
Apr 11, 2002
7:46 pm

... _________________________________________________________ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com...
John Q. Pretentious
johnisaheadcase
Online Now Send Email
Apr 3, 2002
6:39 am
Advanced

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help