crazyjul Posted August 29, 2005 Share Posted August 29, 2005 (edited) I've looked at sprite code. It seems that VRAMmap is never initialized, so when the program writes data int othe vmemory, as the vram pointer is null, the write is just skipped. It seems that video memory remapping register is never written. Nobody knows any default value of it?? It maybe explained why some demo works (in fact, if they remap VRAM, it should work) I will have a look at this tonight. Crazyjul Edited August 29, 2005 by crazyjul Link to comment Share on other sites More sharing options...
doublec Posted August 29, 2005 Author Share Posted August 29, 2005 (edited) VRAMmap is initialized in MMUMaininit in dsmmumain.c. It is initialized to nulls and then modified by writes to the VRAM registers. This is a recent change to get memory mapping working correctly (from 0.4.6). If you look at the MMUMainremapVRAM_BANK_A, etc functions you'll see where the initialization is done. Not all of it is implemented as I'm unsure how things like extended palletes, image textures, etc work. I have noticed some demos don't map the VRAM by writing to the registers. I wrote a simple test of this and when writing to the memory area (VRAM_A for example), the write appears to work but when you read the value back you get 0x00, not what you wrote. So I assumed that there is no default mapping. This may not be the case for sprites, or may not be the general case and only happened to be the case for the one that I tested of course. Prior to me doing the VRAM mapping code sprites did not work correctly either so there may be something more fundamental wrong. Edited August 29, 2005 by doublec Link to comment Share on other sites More sharing options...
doublec Posted August 29, 2005 Author Share Posted August 29, 2005 There is a problem with Thumb code emulation. GPFerror noticed that some of his demos don't run on dsemu if compiled with '-mthumb' but do if recompiled with '-mthumb-interwork'. For the former all that would happen is a black screen. This may be the reason why some of the demos give only a black screen. I'm currently looking into this, to hopefully fix it for the 0.4.7 release. Link to comment Share on other sites More sharing options...
crazyjul Posted August 30, 2005 Share Posted August 30, 2005 (edited) VRAMmap is initialized in MMUMaininit in dsmmumain.c. It is initialized to nulls and then modified by writes to the VRAM registers. This is a recent change to get memory mapping working correctly (from 0.4.6). If you look at the MMUMainremapVRAM_BANK_A, etc functions you'll see where the initialization is done. Not all of it is implemented as I'm unsure how things like extended palletes, image textures, etc work. I have noticed some demos don't map the VRAM by writing to the registers. I wrote a simple test of this and when writing to the memory area (VRAM_A for example), the write appears to work but when you read the value back you get 0x00, not what you wrote. So I assumed that there is no default mapping. This may not be the case for sprites, or may not be the general case and only happened to be the case for the one that I tested of course. Prior to me doing the VRAM mapping code sprites did not work correctly either so there may be something more fundamental wrong.<{POST_SNAPBACK}> So I'll try to make a lot of test. I'll start from scratch. From what I've understood, there are default value in vram mapping register, when I'll get my flasher, I'll try to read them. I will also do some test. For the demo that does not work when not intializing the vram, they seem to write sprite at 0x06004000. On DsTekWiki, this is shown as Sprte memory, maybe when no memory is map to this address space. Crazyjul Edited August 30, 2005 by crazyjul Link to comment Share on other sites More sharing options...
crazyjul Posted August 30, 2005 Share Posted August 30, 2005 The darcs repository has been emptied and fill with tutorial Where all the code had gone??Where can I found the source?? Thanks Crazyjul Link to comment Share on other sites More sharing options...
doublec Posted August 30, 2005 Author Share Posted August 30, 2005 Oops, my fault. Copied stuff into the wrong area. I've fixed it now and the repository is back online. Link to comment Share on other sites More sharing options...
crazyjul Posted September 5, 2005 Share Posted September 5, 2005 From what I've seen, it seems that DS graphic mode is close to GBA graphic mode when nothing is initialized. Does somebody can approve this?? Crazyjul Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now