#9237 - abilyk - Thu Jul 31, 2003 5:53 am
Quick question:
My current macro for setting the display mode is as follows:
Through this method, I have to set every option I want each time I call the macro. If I call
and then
The MODE_0 option from the first call is overwritten, obviously.
Now, in my mind,
should do what I want and allow me to add options as shown above. However, this just gives me a blank screen.
I could have my SetMode macro update a 16-bit variable and just set REG_DISPCNT to that variable each time, but is there a more efficient way to do it? Why won't the above macro work?
Also, tepples, from some of your code....
Why are you ORing with 0? Is this just a stylistic habit of yours, or is there a specific reason you're doing that?
Thanks,
Andrew
My current macro for setting the display mode is as follows:
Code: |
#define SetMode(mode) (REG_DISPCNT = (mode)) |
Through this method, I have to set every option I want each time I call the macro. If I call
Code: |
SetMode(MODE_0 | BG0_ENABLE); |
Code: |
SetMode(BG1_ENABLE); |
The MODE_0 option from the first call is overwritten, obviously.
Now, in my mind,
Code: |
#define SetMode(mode) (REG_DISPCNT = (REG_DISPCNT | (mode))) |
I could have my SetMode macro update a 16-bit variable and just set REG_DISPCNT to that variable each time, but is there a more efficient way to do it? Why won't the above macro work?
Also, tepples, from some of your code....
Code: |
LCDMODE = 0 | LCDMODE_BG0 | LCDMODE_SPR; |
Why are you ORing with 0? Is this just a stylistic habit of yours, or is there a specific reason you're doing that?
Thanks,
Andrew