Hello, I've been attempting SNES development again. I'm using the official dev docs, Fullsnes docs, wikis, Yoshi docs, these forums etc for info but there are lots of things I don't understand.
Lots of questions:
1. The flow chart in chapter 23 in the dev docs doesn't mention shadow OAM. Is it commonly used in SNES games? I reserved space for my OAM data from WRAM page 2 anyway. I guess a VRAM buffer and a CGRAM buffer would be good to have too.
2. There seems to be three CPU speeds. I guess 1.79MHz mode is used in emulation mode for compatibility with 6502? It's also used for controllers it seems.
3. . According to the dev docs, low 8 kB WRAM can be accessed from any bank between $00~$3F and $80~$BF. If you access them rom bank $80+, wouldn't they gain the benefit from high speed mode, or are they too slow chips?
4. When doing DMA for CGRAM, I couldn't load the colours unless I picked source bank 1 for DMA. But I put the data in bank 7! What's going on? I'll upload my code soon.
5. When using DMA, do I need to wait a bit before using the same channel again so it won't interfere with the first transfer? The dev docs flow chart says to initialize CGRAM and OAM "using 2 channels DMA", what do they mean by that? I just put two DMA transfers after each other using channel 0 for CGRAM and channel 1 for OAM. But in that case wouldn't you need to use at least three channels for BG, sprites and a tilemap when initializing VRAM? The dev docs is a bit confusing for this part.
6. The flow chart also says to make a loop for the VRAM DMA transfers like this:
How would this be done in practice? I'd guess I'd read the VRAM using $2139 and $213A and somehow compare it with my data in ROM to see if it's been transferred properly. I haven't seen anyone do this though.
7. Although SEI was used at the beginning of the program, it seems I don't need to use CLI to enable interrupts again like on NES. I don't understand why.
8. The flow chart in chapter 23 says to enable NMI and controllers at $4200 in the beginning of every main program loop. Is this really needed? Haven't seen anyone enabling it more than once.
Thanks in advance!
Lots of questions:
1. The flow chart in chapter 23 in the dev docs doesn't mention shadow OAM. Is it commonly used in SNES games? I reserved space for my OAM data from WRAM page 2 anyway. I guess a VRAM buffer and a CGRAM buffer would be good to have too.
2. There seems to be three CPU speeds. I guess 1.79MHz mode is used in emulation mode for compatibility with 6502? It's also used for controllers it seems.
3. . According to the dev docs, low 8 kB WRAM can be accessed from any bank between $00~$3F and $80~$BF. If you access them rom bank $80+, wouldn't they gain the benefit from high speed mode, or are they too slow chips?
4. When doing DMA for CGRAM, I couldn't load the colours unless I picked source bank 1 for DMA. But I put the data in bank 7! What's going on? I'll upload my code soon.
5. When using DMA, do I need to wait a bit before using the same channel again so it won't interfere with the first transfer? The dev docs flow chart says to initialize CGRAM and OAM "using 2 channels DMA", what do they mean by that? I just put two DMA transfers after each other using channel 0 for CGRAM and channel 1 for OAM. But in that case wouldn't you need to use at least three channels for BG, sprites and a tilemap when initializing VRAM? The dev docs is a bit confusing for this part.
6. The flow chart also says to make a loop for the VRAM DMA transfers like this:
Code:
loop:
"VRAM address H/L INC" settings
"VRAM address Sequence Mode" settings
"VRAM address" settings
register 2115h 2116h 2117h
VRAM transfer by DMA
OBJ, BG data, BG SC data transferred?
If No: goto loop
If Yes: next
"VRAM address H/L INC" settings
"VRAM address Sequence Mode" settings
"VRAM address" settings
register 2115h 2116h 2117h
VRAM transfer by DMA
OBJ, BG data, BG SC data transferred?
If No: goto loop
If Yes: next
How would this be done in practice? I'd guess I'd read the VRAM using $2139 and $213A and somehow compare it with my data in ROM to see if it's been transferred properly. I haven't seen anyone do this though.
7. Although SEI was used at the beginning of the program, it seems I don't need to use CLI to enable interrupts again like on NES. I don't understand why.
8. The flow chart in chapter 23 says to enable NMI and controllers at $4200 in the beginning of every main program loop. Is this really needed? Haven't seen anyone enabling it more than once.
Thanks in advance!