Open mikolajmikolajczyk opened 3 months ago
interesting
a while back I experimented with only starting up the PS/2 mouse support when a "mouse enable" command is received. as noted against #126 this did not work, and would crash the VDP
I suspect the approach you've used here will suffer with essentially the same issues, i.e. you'll have a VDP where you can never use the mouse
attempting to fix the issues inside vdp-gl that prevent fabgl::PS2Controller::begin
from being called twice is hard. back in April when I looked into this, I tried to look into that, and didn't manage to spot any reason why it would crash. ideally this would be possible (i.e. to be able to at will enable/disable the mouse port), but for now this isn't a practical possibility
one potential solution to this issue, and #126, is via #36 - i.e. support a persistent configuration option for dictating that the VDP should start up with the mouse port disabled. changing the config to enable the mouse port would require a reboot, but that's probably an acceptable compromise.
for this issue, i.e. allowing ZDI to work, I suspect the better solution may be to just use different GPIO pins on the ESP32. those seem to be configured on lines 12 and 13 of zdi.h
. perhaps using pins ESP37 and ESP38?
(I've never tried to set up and use ZDI debugging on either of my Agon systems, so I've not worked out how to set this up and test it)
pins ESP26 and ESP27 are defined as the default PS/2 mouse port for fab-gl system boards, so that's the model that Bernado used when designing the Console8, as the Agon hardware design builds on the fab-gl design. this is therefore what the firmware will use for any Agon model to attempt to support a mouse. i don't understand enough about how the ZDI support in the VDP works to know if there's a reason why different ESP pins can't be used
In newest Console8 VDP (and classic 1.0.4) ZDI interface is broken.
This is caused by ZDI pins (26 and 27 on VDP) being also used by fabgl::PS2Controller default configuration.
https://github.com/AgonConsole8/vdp-gl/blob/c16101479337e9967aa5c61b06b3fc0447e56f64/src/comdrivers/ps2controller.cpp#L1209
Simple solution I found is to recompile VDP soft with mouse disabled like this:
in this line: https://github.com/AgonConsole8/agon-vdp/blob/471dc92cba4df160048d40dc71a397cd3b37fe16/video/agon_ps2.h#L49
I tried to disable mouse to make ZDI work again while agon is working but either I'm missing something or it cannot be done after CPU already started.
I tried these in
vdu_sys.h
(as test only):This works for me on my fork: https://github.com/mikolajmikolajczyk/agon-vdp/pull/2/files