DC-SWAT Forum
how can I get the value of I/O in the Dreamcast? - Версия для печати

+- DC-SWAT Forum (http://www.dc-swat.ru/forum)
+-- Форум: Sega Dreamcast (/forum-2.html)
+--- Форум: Programming (/forum-8.html)
+--- Тема: how can I get the value of I/O in the Dreamcast? (/thread-2311.html)



how can I get the value of I/O in the Dreamcast? - kof888 - 16.08.2015 09:23

Dreamcast inside the handle button I/O is how to get the value? And I/O's MD as fixed? Or is it a fixed address?

THANK YOU REPLYSmile


RE: how can I get the value of I/O in the Dreamcast? - SWAT - 16.08.2015 09:59

What the button? Lid open/close detection? No more buttons inside... But you can get some free GPIO directly from CPU.


RE: how can I get the value of I/O in the Dreamcast? - kof888 - 16.08.2015 10:34

Is the game of the handle of the button, Dreamcast is how to detect the press of a button on the handle of the game? What specific functions do not have?

For example, I press the start button, the function is how to get it?

Can you give me an example? Thank you


RE: how can I get the value of I/O in the Dreamcast? - SWAT - 16.08.2015 20:18

Aah you mean the joystick.
So it's named as Maple Bus with some specific packet interface. You can look docs or KallistiOS source code for it.
It's hard to be say by two words how it's works.


RE: how can I get the value of I/O in the Dreamcast? - kof888 - 17.08.2015 05:01

thank you

I try to find the.


RE: how can I get the value of I/O in the Dreamcast? - SWAT - 18.08.2015 11:01

http://sourceforge.net/p/cadcdev/kallistios/ci/master/tree/kernel/arch/dreamcast/hardware/maple/


RE: how can I get the value of I/O in the Dreamcast? - developer - 21.08.2015 20:01

Just a little example

First initialize input device, for instance joystick
PHP код:
maple_device_tjoy maple_enum_type(0MAPLE_FUNC_CONTROLLER); 

Then, poll joy's buttons state
PHP код:
cont_state_t *joy_state = (cont_state_t *)maple_dev_status(joy);
if (
joy_state->joyx != || joy_state->joyy != 0)
{
    
Ball->Move(joy_state->joyxjoy_state->joyy);




RE: how can I get the value of I/O in the Dreamcast? - SWAT - 22.08.2015 08:42

I think for kof888 need code without big libs...

For example, you can get simple implementation from here https://code.google.com/p/sylverant/source/browse/trunk/pso_patcher/patcher/maple.c (see usage in patcher.c)


RE: how can I get the value of I/O in the Dreamcast? - kof888 - 18.12.2020 18:04

I'm very sorry. I just remember this post now. I'm so forgetful.........