It is currently Mon Oct 23, 2017 1:03 am

All times are UTC - 7 hours





Post new topic Reply to topic  [ 5 posts ] 
Author Message
PostPosted: Sun Sep 20, 2015 9:27 am 
Offline

Joined: Mon Nov 10, 2008 3:09 pm
Posts: 430
I just noticed that the GBC Wizardry ports/remakes trigger OAM DMA in code that runs directly out of ROM, rather than jumping into the FF80-FFFE internal RAM region to do it like you're "supposed" to. The DMA source page they use is in work RAM; they're not doing the "DMA from VRAM to OAM" thing (which I've never actually seen--can anyone name a game that does that?)

These games do still spin in a loop for 40*4*4 master clocks after triggering the DMA.

Since these games evidently work on real GBC hardware, I guess the GBC CPU has separate buses to the cartridge slot and to work RAM to make this possible? I'm assuming that during the DMA it's possible to access ROM but not RAM, and that's why the games still have to spin in a loop until the DMA is done...

Another thing about OAM DMA I'm curious about: a certain document says that the original GB doesn't support DMA from ROM to OAM--the source page has to be within the range [80, DF]. Is this actually true, and if so, why? I've seen schematics for the original GB and it certainly looks like the cartridge slot and work RAM are on the same bus. Is the high bit of the data written to FF46 simply ignored by the hardware?


Top
 Profile  
 
PostPosted: Sun Sep 20, 2015 12:59 pm 
Offline

Joined: Thu Aug 12, 2010 3:43 am
Posts: 1589
If I recall correctly, that internal RAM is needed on the GB, not on the GBC. Yeah, the DMA hardware changed between them (and that's a good thing, the GB's DMA support is awful).


Top
 Profile  
 
PostPosted: Sun Sep 20, 2015 10:48 pm 
Offline

Joined: Mon Nov 10, 2008 3:09 pm
Posts: 430
Well, I've never seen that listed as a difference between GB and GBC in any document, and other GBC-exclusive games like Shantae do copy the standard trigger-OAM-DMA-and-spin subroutine into high RAM, so it surprised me.


Top
 Profile  
 
PostPosted: Mon Sep 21, 2015 7:22 am 
Offline

Joined: Thu Aug 12, 2010 3:43 am
Posts: 1589
I meant the DMA hardware in general. I know that the GB has DMA for filling up all of CHR-RAM, but it's awfully limited (only all of CHR-RAM, source must be 8KB-aligned, and CPU needs to spin from that special RAM to not interfere with the bus). The GBC added a much more forgiving DMA that doesn't have the special RAM requirement and has a granurality of 16 bytes.


Top
 Profile  
 
PostPosted: Mon Sep 21, 2015 8:02 am 
Offline

Joined: Mon Nov 10, 2008 3:09 pm
Posts: 430
Sik wrote:
I meant the DMA hardware in general. I know that the GB has DMA for filling up all of CHR-RAM, but it's awfully limited (only all of CHR-RAM, source must be 8KB-aligned, and CPU needs to spin from that special RAM to not interfere with the bus). The GBC added a much more forgiving DMA that doesn't have the special RAM requirement and has a granurality of 16 bytes.


I think you're getting confused... the only DMA on the original GB is for OAM (the sprite list), not VRAM (the character definitions and tilemaps). VRAM DMA was added in the GBC. The only way to write to VRAM on the GB is a byte at a time via CPU instructions, the same as on the NES.

OAM DMA and the GBC-only VRAM DMA are completely separate functions, controlled by different registers. VRAM DMA halts the CPU until it's done, like DMA on the SNES does. OAM DMA takes over whichever bus it's transferring from but doesn't halt the CPU. Other than that it's much like OAM DMA on the NES--it always transfers the entire size of OAM (160 bytes on the GB/GBC as opposed to 256 bytes on the NES) and the source has to be aligned on a 256-byte page.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC - 7 hours


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group