I was playing with the light phaser library and I figured out that the inlib_pollLightPhaser_position function does not work properly in 50Hz emulicious.
Note that in 60Hz, the function works fine.
From what I was able to dig in Emulicious, it seems to be this code that runs differently depending on the PAL/NTSC emulation :
|
wait_th_lowA: |
|
in a, (#0xDD) ; Read port DD and check if bit |
|
and a, #0x40 ; 6 (TH port A) is low. |
|
jp Z, th_lowA ; If it is, light has been sensed! |
|
|
|
in a, (#0x7E) ; Read vertical counter port to |
|
cp a, #192 ; check if this frame is complete. |
|
jp C, wait_th_lowA |
|
|
|
jp frame_doneA |
When I run step-by-step on 50Hz, I never step into the th_lowA function. Ending to fall in the phaser_common_timeout function...
Not sure if this a the core of the problem...
Here you have the code I use to test ( it's basically the same as the test file for phaser ) :
light_phaser_test.c.txt
I was playing with the light phaser library and I figured out that the
inlib_pollLightPhaser_positionfunction does not work properly in 50Hz emulicious.Note that in 60Hz, the function works fine.
From what I was able to dig in Emulicious, it seems to be this code that runs differently depending on the PAL/NTSC emulation :
inlib/src/inlib_phaser.c
Lines 46 to 55 in ea3eae6
When I run step-by-step on 50Hz, I never step into the
th_lowAfunction. Ending to fall in thephaser_common_timeoutfunction...Not sure if this a the core of the problem...
Here you have the code I use to test ( it's basically the same as the test file for phaser ) :
light_phaser_test.c.txt