jimbobaby escribió:
-I don't know the difference between IRQ and FIRQ
-I know the concept of "chaining" ISRs (i mean, put your own interrupt handler, see if it's for you, and if not, chain to the older handler), but i don't know how to check who has generated the IRQ/FIRQ (between, for example, keyboard event or an OPL timer).
It's specific for each device, or there is a common place to check?
Well, after jltursan response (thank you!), poyos en hexa
, some reading and some tests i have mostly answered some of my own questions
Now i have some more
I have done IRQ testing (timer, keyb) and they work fine
. But still can't work out the Yamaha (PSG) timers (that have both of them much better granularity).
I have studied the sakura sample (
http://retrowiki.es/viewtopic.php?f=33& ... p200177001) (thanks malikto999!), and the Shounen Mike dissasembly (thanks Pere!), and have some doubts.
The FM7 family "abstracts" the programming of the audio chip with a layer in between ($FD15/$FD16), so you have another set of commands to talk to the Yamaha chip. You must send the $03 command and then you can use $02 to write and $01 to read. That's what it's documented. What is not documented (or i have not seen it yet on the docs that i have
) are the delays (only when writing) that both sample codes do (not much delay, 3 nops, between sending the writing command and writing the data). Why??
Also, i have seen another set of "unknown" commands used; on sakura, the $04 command (read status of the PSG timer?) and on Shounen the $09 command (for reading a data port of PSG?).
I'm interested because on my tests, i would create a handler for the IRQ ($FFF8), disable interrupts, program the timer (A or B, have tested both), enabled it (generating IRQ each tick), reenable interrupts, and then on the IRQ handler i would try to read PSG IRQ flag register (bits 2 and 3 of register $27), with the $03/$01 command sequence, to see the origin of the interrupt.
But doesn't work (generates the IRQ but fails afterward, still looking into it).
Also i tried to replicate what sakura's sample do (with the command $04) but again, to no luck...still
Can the PSG timers be used independent of the sound? (i mean, for another uses)
PD: After some tinkering, i can now run malikto999 c compiler native on my computer (no more virtual machines for development, yey!!
)