
The API is currently somewhat bare and simple, but I think it's nice like that. Documentation which clarifies all the fields and their formats will be made soon enough.
Sample code
Output from jvs_io_dump
Let me know what y'all think.
RegalSin wrote:Street Fighters. We need to aviod them when we activate time accellerator.
Code: Select all
// Declare this at whatever size I dont care
bool[] mbPressed;
bool[] mbWasPressed;
// In some loop...
void SomeReallyLateUpdateLoop()
{
// We want to call this at the end of an update loop to cache the state of all switches this frame
for (int i=0; i<mbPressed.length();++i)
{
mbWasPressed[i] = mbPressed[i];
}
}
/*-----------------------------
* On to helpers..
-----------------------------*/
// return whether the switch is held down (useful for levers and fire buttons)
bool IsSwitchOn(int alX)
{
return mbPressed[alX];
}
// return whether the switch was held down last frame
bool WasSwitchOn(int alX)
{
return mbWasPressed[alX];
}
// return true only if switch has been pressed this frame
bool IsSwitchPressed(int alX)
{
if (mbPressed[alX] && !mbWasPressed[alX]) return true;
return false;
}
// return true only if switch has been released this frame
bool IsSwitchReleased(int alX)
{
if (mbWasPressed[alX] && !mbPressed[alX]) return true;
return false;
}
Actually this is exactly what I wanted to see/hearn0rtygames wrote:I can already feel your reaction from all the way over here in foggy UK and I know it's not pretty... however, it's the feedback you need to hear.. not what you want to hear/see
I can't see any reason this should be the case...trap15 wrote:I'll see what I can come up with, but at some level it'll still involve bitwise operations and knowledge of the controls attached.
I wish you'd stop taking offence to every comment about Gamemaker! I didn't mean to imply that you were a moron, but we do have other GM users here who by their own admission are "not the best programmers" and probably don't have a clue what half of Traps voodoo does.BPzeBanshee wrote:As for n0rty's jip on Game Maker
Every comment?! <insertsocialjusticewarriorslanghere>!1I wish you'd stop taking offence to every comment about Gamemaker!
I've already got it on bitbucket, as a private repo. I don't want it public until there's a stable API and for all intents and purposes it's complete.Stompp wrote:What about hosting the project on GitHub? That way anyone how wants can contribute or fork
Taito TypeX games are not written for specific cabinets, they're written for a minimum button count usually. The game has no say in how the buttons are mapped or where they're located. JVS is extremely open-ended. You could have a mahjong panel, or a 4 player panel with 6 buttons each, or a 1 player panel with two sticks and 200 buttons, and it all is reported the same way through JVS.n0rtygames wrote:I can't see any reason this should be the case...
Are Taito Type X games written for specific cabinet setups? By this I mean - if I'm looking to run Raiden IV, how is my cabinet wired up? Am I configuring what each button does with the software itself? Or is it a wire that goes from button to pin which dictates which switch that is? What is the issue requiring me to have intimate knowledge of hex codes in order to write for this? If I was writing for a console sure I'd still need to check this stuff to properly poll inputs from gamepads etc if I was writing input manager components but... its standardized hardware. I thougt the TypeX was standardized too? What's the deviation between setups that requires me to think so much? How is it all wired up?!!? I have no idea
Code: Select all
DWORD jvs_io_get_player(JVS_IO *info, UINT player);
Code: Select all
enum {
JVS_SW_START = 0x80000000,
JVS_SW_SERVICE = 0x40000000,
JVS_SW_UP = 0x20000000,
JVS_SW_DOWN = 0x10000000,
JVS_SW_LEFT = 0x08000000,
JVS_SW_RIGHT = 0x04000000,
JVS_SW_BTN1 = 0x02000000,
JVS_SW_BTN2 = 0x01000000,
JVS_SW_BTN3 = 0x00800000,
JVS_SW_BTN4 = 0x00400000,
JVS_SW_BTN5 = 0x00200000,
JVS_SW_BTN6 = 0x00100000,
[...]
};
Code: Select all
DWORD btns = jvs_io_get_player(jvs_io, 0);
if(btns & JVS_SW_START)
// start game
if(btns & JVS_SW_BTN1)
// shoot bullet, idk
if(btns & JVS_SW_BTN2)
// bonbaaaaa
wTf?? Didn't know that you were making a shmup!!!trap15 wrote:Code: Select all
DWORD btns = jvs_io_get_player(jvs_io, 0); if(btns & JVS_SW_START) // start game if(btns & JVS_SW_BTN1) // shoot bullet, idk if(btns & JVS_SW_BTN2) // bonbaaaaa
trap15 wrote:I've already got it on bitbucket, as a private repo. I don't want it public until there's a stable API and for all intents and purposes it's complete.Stompp wrote:What about hosting the project on GitHub? That way anyone how wants can contribute or fork