SGDK only sub forum
2 posts • Page 1 of 1
To be correct, is it possible at all? I'm not even sure, that BEX allows to work with a certain registers directly. There is an example of lightgun interaction for BEX, but it lets to move a "crosshair" only. How to make it to react on the trigger pull, is absolutely unclear. There is a no code of lightgun model recognising in this sample also.
Getting a position from a lightgun is "easy" - all you do is enable the external interrupt and then in the int handler get the latched video beam position registers. Reading the buttons is harder as every gun uses a different method of toggling the port bits to read their gun buttons. The Menacer also needs very specific timing in addition. That's where all the inline assembly in joy.c comes in - getting that Menacer timing right.