gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

DS development > Do NDS7 and NDS9 share the same LYC register?

#177477 - Dwedit - Wed Jun 20, 2012 5:57 pm

Do the NDS7 and NDS9 share the same Dispstat, and LYC registers? Or are they separate?
_________________
"We are merely sprites that dance at the beck and call of our button pressing overlord."

#177478 - elhobbs - Wed Jun 20, 2012 6:52 pm

gbatek indicates that they behave a little differently in regards to hblank. and I am not sure if they are writable from arm7. they use the same memory addresses on arm9 and arm7 so I would think they are the same. what is your real question - why does this matter?

#177479 - Dwedit - Wed Jun 20, 2012 7:44 pm

Mainly because I want to use scanline IRQs, but different scanline IRQs for the ARM7 and the ARM9. The default ARM7 core from devkitarm also wants to use a scanline IRQ for certain tasks.
I just want to know if this is possible, or if I'll need to cook up something more complicated to make them share it.
_________________
"We are merely sprites that dance at the beck and call of our button pressing overlord."

#177480 - elhobbs - Wed Jun 20, 2012 9:47 pm

I believe that you are referring to a separate issue. in addition to enabling an interrupt you also specify an interrupt handler. the handlers are separate for each cpu - you can have vblank handler on arm9 do one thing and a separate arm7 handler do something else.

#177481 - Dwedit - Thu Jun 21, 2012 6:29 am

I'm not talking about vblank though, or assigning IRQ handlers. I just want to know if trying to use VCOUNT IRQs on the NDS7 and NDS9 will conflict with each other or not. Because one might want an interrupt at scanline 20, and the other might want an interrupt at scanline 80 for example.
_________________
"We are merely sprites that dance at the beck and call of our button pressing overlord."

#177482 - elhobbs - Thu Jun 21, 2012 11:52 am

Ok. Sorry I did not understand. I would guess that they are separate based on the gbatek description indicating that they behave a little differently. Also I believe there is precedence - I think timers are separate and they use the same registers. As I am sure you can tell - I do not know. You will probably have to test it.

#177483 - sverx - Fri Jun 22, 2012 11:24 am

ARM7 default code is (was?) using VCOUNT IRQ (for touch screen handling, AFAIR), and I remember once I was using VCOUNT IRQ on ARM9 with no problems... so I'm sure you can set two "LYC" values, one for each processor.
http://nocash.emubase.de/gbatek.htm#lcdiointerruptsandstatus
_________________
libXM7|NDS programming tutorial (Italiano)|Waimanu DS / GBA|A DS Homebrewer's Diary