#41681 - wiz - Sun May 01, 2005 3:34 am
Sorry just a quick question, I have tried searching but not had much luck with my results
Am I missing something when I specify:
u16 XOFF = REG_BG0HOFS;
The value I get from REG_BG0HOFS is constant '14371' ... even when I *set* REG_BG0HOFS = 49; in the line before (setting works just fine!?)
-- declared as #define REG_BG0HOFS *(volatile u16*)0x4000010
Very late now, over a simple problem :(
Thanks very much for reading
#41692 - tepples - Sun May 01, 2005 5:53 am
Some GBA I/O registers are write-only. If you want to know the last value you wrote to a write-only register, keep track of it in a separate variable. If you want to know whether a write "took", look at the screen.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.
#41704 - wiz - Sun May 01, 2005 10:39 am
ahh...
Cheers for the answer :)
#41827 - Ultima2876 - Mon May 02, 2005 6:20 am
Out of interest, know why it reutnrs that specific value?
#41832 - FluBBa - Mon May 02, 2005 9:00 am
No$GBA doc wrote: |
Reading from Unused Memory (00004000-1FFFFFF0,10000000-FFFFFFFF)
Accessing unused memory returns the recently pre-fetched opcode, ie. the 32bit opcode at $+8 in ARM state, or the 16bit-opcode at $+4 in THUMB state, in the later case the 16bit opcode is mirrored across both upper/lower 16bits of the returned 32bit data.
Note: This is caused by the prefetch pipeline in the CPU itself, not by the external gamepak prefetch, ie. it works for code in RAM as well.
Reading from Unused or Write-Only I/O Ports
Works like above unused memory when the entire 32bit memory fragment is Unused (eg. 0E0h) and/or Write-Only (eg. DMA0SAD). And otherwise, returns zero if the lower 16bit fragment is readable (eg. 04C=MOSAIC, 04E=NOTUSED/ZERO). |
Weee! my 0x100 post =)
_________________
I probably suck, my not is a programmer.
#41870 - poslundc - Mon May 02, 2005 5:39 pm
FluBBa wrote: |
Weee! my 0x100 post =) |
Your 1000th post is the most exciting, because there's only a 24-post gap between it having both decimal and binary significance.
Dan.