fruit-bat / pico-zxspectrum

ZX Spectrum for Raspberry Pico Pi RP2040
487 stars 54 forks source link

Feature/menu controll by joystick #156

Closed DPRCZ closed 4 months ago

DPRCZ commented 4 months ago

Add to main.c on just for one board. Idea enter to menu by button4 and escape by button1 (fire) - movement on menu by direction buttons.

fruit-bat commented 4 months ago

Does this allow menu navigation yet? I can just see code to exit the menu system... sorry if I am not being observant.

DPRCZ commented 4 months ago

if (showMenu) { r = picoWinHidKeyboard.processHidReport(report, prev_report); s = picoWinHidKeyboard.processJoystick(hidJoystick.joy1()); // Processing Joystick in Menu mode, see pico_menu pull r|=s; } else { r = keyboard2.processHidReport(report, prev_report); s = hidJoystick.testbt4press(); //Enter to menu from spectrum mode } if (r == 1) { if (r | s) { toggleMenu = true; picoRootWin.repaint(); }

fruit-bat commented 4 months ago

Ah sorry, just spotted the other pull request.

fruit-bat commented 4 months ago

Many thanks for this!

fruit-bat commented 4 months ago

I've had to mess about with it a little to make it work. See what you think to the changes in the last commit. See my additions to hdml/main.cpp Let me know if I have miss understood some of it.

DPRCZ commented 4 months ago

It is looks ok to me.