Commodore 64 (C64) Forum Index
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
WinVice 2.3.17 C64 w/Programmable gamepad buttons
Goto page 1, 2  Next
 
Post new topic   Reply to topic    Commodore 64 (C64) Forum Index -> New Releases
View previous topic :: View next topic  
Author Message
dink
Master of C64
Master of C64


Joined: 03 Jan 2012
Posts: 1360
Location: detroit

PostPosted: Sun Mar 04, 2012 8:04 pm    Post subject: WinVice 2.3.17 C64 w/Programmable gamepad buttons Reply with quote

Vice 2.3.17 C64 [x64.exe] With programmable buttons - May 2, 2012 v.401
(Programmable gamepad button code by dink @ lemon64)

Whats the purpose of this?
...2 Things...
1 - It enables the use of a D-Pad on a gamepad which the D-Pad
wont work in Vice (without Joy2Key or some other clever hack).
2 - It gives you the ability to program the extra buttons on your gamepad.
3 - Temporarily Disables your screensaver while Vice is running (if you have one/new in v.401)
...If you can imagine how frustrating it is to be playing a game and the
screensaver kicks in...

Here are the programmable button options:

Pause - this is self explanitory..
Press "space" - games like Gryzor, Skyshark..etc. that use
"space" as a second fire button can be played 100%
via joystick/gamepad!! Or get past an intro screen.
Warpmode - toggle Warpmode on/off to get past those annoying
disk loads, intros or slow parts.
Swap Ports - This will swap Joy Port1 -> port2 / Port2 -> port1
Enable D-Pad - some gamepads have a D-Pad which don't work in
Vice. Now you can make this work without stupid
hacks (joy2key..etc.)
QuickSaveState - Save a snapshot of a game or something (do this before you think
you're gonna die Wink
QuickLoadState - Re-load the snapshot of the game (do this after you die Wink
QuickSaveStateUndo - So, you saved the state after you died? (woops!) Use This to go back to the previous one.

The update (src incl.) is available @
http://www.mediafire.com/?9k3efp1pfrj743j

Read the txt file for instructions!


Last edited by dink on Wed May 02, 2012 6:08 pm; edited 7 times in total
Back to top
View user's profile Send private message
groepaz
Immortal Grandmaster of C64
Immortal Grandmaster of C64


Joined: 13 Oct 2004
Posts: 4792

PostPosted: Sun Mar 04, 2012 8:31 pm    Post subject: Reply with quote

source?
_________________
Back to top
View user's profile Send private message
dink
Master of C64
Master of C64


Joined: 03 Jan 2012
Posts: 1360
Location: detroit

PostPosted: Sun Mar 04, 2012 9:21 pm    Post subject: Reply with quote

groepaz: I'd like to get it checked into sourceforge sometime in the future. First I'd like to get some feedback from others to see if it works on systems other than mine / fix bugs if any, then I need to clean the code up a bit.

best regards,
- dink
Back to top
View user's profile Send private message
groepaz
Immortal Grandmaster of C64
Immortal Grandmaster of C64


Joined: 13 Oct 2004
Posts: 4792

PostPosted: Sun Mar 04, 2012 9:41 pm    Post subject: Reply with quote

you might want to read up on what the GPL thinks about this :=)
_________________
Back to top
View user's profile Send private message
dink
Master of C64
Master of C64


Joined: 03 Jan 2012
Posts: 1360
Location: detroit

PostPosted: Sun Mar 04, 2012 9:46 pm    Post subject: Reply with quote

the code will become available as soon as I decide to release it, it will be soon though. eod
Back to top
View user's profile Send private message
Unseen
Über Groupie
Über Groupie


Joined: 26 Feb 2008
Posts: 368

PostPosted: Sun Mar 04, 2012 10:03 pm    Post subject: Reply with quote

dink wrote:
the code will become available as soon as I decide to release it, it will be soon though. eod

In that case you must not distribute binaries either, you're currently in violation of the licence you received the VICE source code under.

Edit: One more thing...
Quote:
I'd like to get it checked into sourceforge sometime in the future.

I think you're currently lowering your chances for that.
_________________
Code:
10 a=rnd(-1294):fori=1to52:a=rnd(1):next
20 fori=1to5:printchr$(rnd(1)*11+69);:next
30 printint(rnd(1)*4711)-3590

sd2iec homepage
Back to top
View user's profile Send private message
dink
Master of C64
Master of C64


Joined: 03 Jan 2012
Posts: 1360
Location: detroit

PostPosted: Sun Mar 04, 2012 10:37 pm    Post subject: Reply with quote

When I started to code this a few days ago, I didn't know anyone else that was in the project, and I had nobody to talk to regarding advice as to releasing this and whatnot. So with the next release I would like to go by this a different and more respectful way. Knowing this, I welcome anyone in the Vice project to contact me privately and help me get my code cleaned up, tested and released the proper way.

best regards,
- dink
Back to top
View user's profile Send private message
Unseen
Über Groupie
Über Groupie


Joined: 26 Feb 2008
Posts: 368

PostPosted: Sun Mar 04, 2012 11:00 pm    Post subject: Reply with quote

dink wrote:
When I started to code this a few days ago, I didn't know anyone else that was in the project, and I had nobody to talk to regarding advice as to releasing this and whatnot.

Did you notice that there is a "Contact" section on http://vice-emu.sourceforge.net? The same page is also included as index.html in the html directory in every WinVICE binary release and it's also in doc/html in the source code package.

Quote:
Knowing this, I welcome anyone in the Vice project to contact me privately and help me get my code cleaned up, tested and released the proper way.

Do you really need a private message from groepaz, me or another VICE team member that tells you once more to start by not distributing modified binaries without source code?
_________________
Code:
10 a=rnd(-1294):fori=1to52:a=rnd(1):next
20 fori=1to5:printchr$(rnd(1)*11+69);:next
30 printint(rnd(1)*4711)-3590

sd2iec homepage
Back to top
View user's profile Send private message
dink
Master of C64
Master of C64


Joined: 03 Jan 2012
Posts: 1360
Location: detroit

PostPosted: Sun Mar 04, 2012 11:27 pm    Post subject: Reply with quote

the source code diffs have been appended to the top of the first message.

best regards,
- dink
Back to top
View user's profile Send private message
Rekrul
Master of C64
Master of C64


Joined: 05 Aug 2009
Posts: 1141

PostPosted: Sun Mar 25, 2012 9:09 am    Post subject: Reply with quote

Regardless of what rules he might have broken, I think dink's idea is quite good, and it should be included in the official distribution of VICE. Preferably with a nice GUI interface from within the program.
Back to top
View user's profile Send private message
groepaz
Immortal Grandmaster of C64
Immortal Grandmaster of C64


Joined: 13 Oct 2004
Posts: 4792

PostPosted: Sun Mar 25, 2012 10:00 am    Post subject: Reply with quote

Quote:
the source code diffs have been appended to the top of the first message.

"Invalid or Deleted File."
_________________
Back to top
View user's profile Send private message
faustXXX
Newbie


Joined: 11 May 2011
Posts: 11

PostPosted: Sun Mar 25, 2012 11:47 am    Post subject: Reply with quote

Heh.... my mirror:

http://www.mediafire.com/?mfd6reqry2dzvrf

BTW. Maybe Dink shoud patch 2.3.16, it is very usefull thing. I have a problem with this diff file.
_________________
Regards
Faust

http://www.try2emu.net.pl
EmuNewsSite [polish]

-=\\ Elephant can fly //=-
Back to top
View user's profile Send private message
groepaz
Immortal Grandmaster of C64
Immortal Grandmaster of C64


Joined: 13 Oct 2004
Posts: 4792

PostPosted: Sun Mar 25, 2012 2:59 pm    Post subject: Reply with quote

mmmh i looked at the files, some comments:
- one patch per issue please. sneaking in a SetPriorityClass with an otherwise unrelated patch is a nono :=)
- no fancy function names and comments please. credits go into the contributors section of the docs, adding stuff like that into the code is a nono.
- please read docs/coding-guidelines.txt ... eg c++ style comments are prohibited in vice code.

Quote:
Maybe Dink shoud patch 2.3.16, it is very usefull thing. I have a problem with this diff file.

one problem is that the patch to ui.h is not an actuall diff Smile
_________________
Back to top
View user's profile Send private message
Rekrul
Master of C64
Master of C64


Joined: 05 Aug 2009
Posts: 1141

PostPosted: Sun Mar 25, 2012 5:24 pm    Post subject: Reply with quote

groepaz wrote:
mmmh i looked at the files, some comments:


Any comments on the usefulness of his mod and whether or not his idea can/will be incorporated into the official releases?
Back to top
View user's profile Send private message
groepaz
Immortal Grandmaster of C64
Immortal Grandmaster of C64


Joined: 13 Oct 2004
Posts: 4792

PostPosted: Mon Mar 26, 2012 11:18 am    Post subject: Reply with quote

i am not using or developing for windows, so i cant tell how useful it is. But what i can tell is that for the reasons above, chances to get the patch accepted in its current form are quite slim.

other than that i am not sure wether spawning a new thread just to press space is a good idea at all (or calling non thread aware emulator functions from within such thread for that matter).
_________________
Back to top
View user's profile Send private message
dink
Master of C64
Master of C64


Joined: 03 Jan 2012
Posts: 1360
Location: detroit

PostPosted: Mon Mar 26, 2012 11:50 am    Post subject: Reply with quote

regarding the new thread for pressing space - I tried just about every other way to send space to the engine, but because everything is in a single thread, sending space+keydown then waiting some ms, then sending key up in the main thread just won't work for obvious reasons Wink So I had to resort to creating a new thread, and it works really good. Smile Windows creates threads really fast with no noticable latency even with a gamepad button like this..
Now consider the other option to do this (and other features I've added). Joy2Key is a background process that polls the gamepad and sends window commands to the current window depending on which keys you set up... Anyways, you see, I'm just going with the lesser evil here. Wink

Anyways, some more news about this project - updated the code base to 2.3.16 & I've made it possible to bind a game key to do a quick snapshot save & load, and "undo last quick snapshot save" for hardcore gamers... wicked yea..

I hope to get around to releasing it within the next couple of days so stay tuned. Massive respect to anyone interested, and the Vice team of course (sorry about the initial misscomunications guys, I'm new around here Smile

Best regards,
- dink
Back to top
View user's profile Send private message
dink
Master of C64
Master of C64


Joined: 03 Jan 2012
Posts: 1360
Location: detroit

PostPosted: Mon Mar 26, 2012 12:13 pm    Post subject: Reply with quote

Heres 2.3.16 + dinkmods v.2, source diffs included in the same file:

http://www.mediafire.com/?ep53cz5f695a4w2

This is the version with quickstate save/load buttons, see the accompanying text file for more info.

p.s.
It doesn't contain the undo last quicksave feature which I talked about above, I need to work out a few bugs first and I'll post it back here in a day or 2..hopefully Smile

best regards,
- dink
Back to top
View user's profile Send private message
groepaz
Immortal Grandmaster of C64
Immortal Grandmaster of C64


Joined: 13 Oct 2004
Posts: 4792

PostPosted: Mon Mar 26, 2012 1:12 pm    Post subject: Reply with quote

Quote:
regarding the new thread for pressing space - I tried just about every other way to send space to the engine, but because everything is in a single thread, sending space+keydown then waiting some ms, then sending key up in the main thread just won't work for obvious reasons

VICE has its own alarm handling system to deal with this kind of stuff, look at alarm.h, alarm_new and alarm_set in particular =) see src/keyboard.c or src/joystick.c for some usage examples.

using a second thread is really a bad idea, since as said the respective code is not thread aware, and calling these functions in such an async way *will* screw up the internal data integrity, which will result in broken event recording for example.

that said, i think it might be an even better idea to simply translate button press to keydown, and button release to key up.
_________________
Back to top
View user's profile Send private message
dink
Master of C64
Master of C64


Joined: 03 Jan 2012
Posts: 1360
Location: detroit

PostPosted: Mon Mar 26, 2012 5:12 pm    Post subject: Reply with quote

groepaz: thanks for the info and help, its really appreciated!

p.s. do you know anything about the blank horizontal line that I talk about in the Vice 2.3 thread above? It seems like there might be some sort of corruption (maybe?) not related to my patches. most of the time its blank, but today its multi-colored (tested with unmodified winvice 2.3.12, .13, .14 & .16)
this is a link to a screen capture: http://imageshack.us/photo/my-...ntalp.jpg/ p.p.s: if this is a known problem, sorry to waste your time.

best regards,
- dink
Back to top
View user's profile Send private message
nojoopa
Groupie in Training
Groupie in Training


Joined: 21 Oct 2006
Posts: 50

PostPosted: Mon Mar 26, 2012 5:27 pm    Post subject: Reply with quote

Another day, another VICE fork. Improved controller support, eh? Some ideas:
- allow controller directions (not just buttons) to be remapped
- allow one controller to act as both joystick 1 and 2 (plus the 4 player adapter extras)

Handy for, say, 1-person 2-player dual-stick gamepad Bubble Bobble madness.

The trainer Y/N questions and applications that use something else than space for "secondary fire" type purposes shouldn't require a keyboard, so:
- virtual keyboard for pressing other keys
- allow mapping buttons to keys using the virtual keyboard

But what about the "insert disk 2" situations, or simply starting an another game? Surely that should be possible to do with the controller, hence:
- make UI usable with controller (file dialogs included)
- allow mapping UI functions (warp, quicksave/load, attach disk to drive 8, ...) to controller input

Since editing configuration files by hand is tedious and we are using a controller:
- allow the configuration to be done with the controller

While at it, let's go wild and debug some 6510 from the comfort of our couch:
- implement virtual keyboard for UI text entry too
- support it in the monitor

Just to be generic, this all should work on the other emulators (x64sc, x128, xvic, ...) too and shouldn't be restricted to win32.

... oh wait, all of that is done in the SDL UI, available via the VICE homepage. Since it doesn't support the pointy-clicky usage model, nobody uses it. You may want to take a peek at arch/sdl/joy.c for some inspiration.

As for your patch itself:
groepaz wrote:
that said, i think it might be an even better idea to simply translate button press to keydown, and button release to key up.

Indeed.

groepaz already pointed out the most glaring flaws, here's a few more:
- the case of multiple controllers doesn't seem to be addressed
- the srcdiffs.zip format is horrible; use "svn diff > blah.patch" or if you're not using svn for some odd reason, something like "diff -unR vice-2.3.x/ vice-dinkhacks/ > blah.patch" should do it

I'd wish you good luck on getting this usable, bug-free and merged, but with the DINK!age, GPL ignorance and consistent misspelling of "VICE", I'll pass this time.
Back to top
View user's profile Send private message
Rekrul
Master of C64
Master of C64


Joined: 05 Aug 2009
Posts: 1141

PostPosted: Mon Mar 26, 2012 5:36 pm    Post subject: Reply with quote

groepaz wrote:
i am not using or developing for windows, so i cant tell how useful it is.


You don't think that being able to map various keys and emulator functions to unused controller buttons would be useful on systems other than Windows?

groepaz wrote:
But what i can tell is that for the reasons above, chances to get the patch accepted in its current form are quite slim.

other than that i am not sure wether spawning a new thread just to press space is a good idea at all (or calling non thread aware emulator functions from within such thread for that matter).


I wasn't asking if this specific patch/mod could be included, but rather that the idea be implemented into VICE. Being able to map keypresses to unused buttons would be EXTREMELY helpful in many games. Such as pressing Space to throw grenades in Commando, or detach the pod in R-Type. Or how about assigning 'B' to a button so that you can easily drop bait in Ghostbusters? What about being able to map most of the functions of Elite to controller buttons?

My suggestion would be that instead of having special keys or events that you can assign to buttons, simply make it so that any of the buttons on a controller can be assigned to send any keypress to VICE. In other words, don't make a special Warp setting to assign to a button, just make it possible to assign Alt-W to a button. You press the button, VICE interprets it as you having pressed Alt-W and Warp mode is toggled. This would allow any keyboard controlled function to be assigned to a button. In effect, incorporating the function of Joy2Key right into the program itself and removing the need to run that program separately.

If you think about it, VICE already does something similar with the keymaps. You can re-map the keyboard and assign any C64 key to any real key on the keyboard. This would be the same idea, except that you'd be assigning them to the controller buttons, and you could assign any key combination to a button.

However, if that's too difficult, I would be happy just to be able to assign C64 keys to buttons, such that you can use a button to push Space, B, whatever.
Back to top
View user's profile Send private message
groepaz
Immortal Grandmaster of C64
Immortal Grandmaster of C64


Joined: 13 Oct 2004
Posts: 4792

PostPosted: Mon Mar 26, 2012 6:10 pm    Post subject: Reply with quote

Quote:
p.s. do you know anything about the blank horizontal line that I talk about in the Vice 2.3 thread above?

if this is with a recent svn build, please report a bug on the bugtracker - looks like a windows specific gui bug to me.
Quote:
I wasn't asking if this specific patch/mod could be included, but rather that the idea be implemented into VICE. Being able to map keypresses to unused buttons would be EXTREMELY helpful in many games.

We have lots of ideas on what to implement, look here for example. Unfortunately an idea is just that, it needs someone to implement it in actual code. And while i agree that it would be a nice feature, i dont see anyone of the core team working on it anytime soon, since we have more than enough other stuff on our todo list. Thats where external patches come into play Smile
_________________
Back to top
View user's profile Send private message
dink
Master of C64
Master of C64


Joined: 03 Jan 2012
Posts: 1360
Location: detroit

PostPosted: Mon Mar 26, 2012 10:22 pm    Post subject: Reply with quote

I know it might be bad taste to release 2 versions in one day, but after a session of hardcore gaming using the new feature (described below) I feel bad about keeping this all to myself Smile

Here is a new version, v.3, with a new assignable button - QuickStateSave Undo - undo the last QuickStateSave... You'll know what I mean once you get used to saving the state while gaming often Wink

This version also uses a non-threaded way for the space button mod, thanks to groepaz for help with this one.

http://www.mediafire.com/?pvd4u8hpk48468r
Back to top
View user's profile Send private message
maiki
Groupie in Training
Groupie in Training


Joined: 01 Nov 2008
Posts: 139

PostPosted: Wed Apr 11, 2012 11:03 am    Post subject: Reply with quote

Yes, the support for custom mapping should really be implemented into VICE emulator (just like M.A.M.E.). Currently I can only specify which of the buttons I can use as auto fire and that's it. The controller-S digital pad is not working at all and no chance to map it. Only the analog stick and all buttons as one fire button? That is very limiting considering VICE could support at least 2 independent buttons plus digital controls...

Speedlink Xbox to USB controller, Windows XP
Back to top
View user's profile Send private message
dink
Master of C64
Master of C64


Joined: 03 Jan 2012
Posts: 1360
Location: detroit

PostPosted: Wed Apr 11, 2012 11:29 am    Post subject: Reply with quote

maiki: this patch I have released for WinVice (see above for mediafire link) will fix your problems with the D-Pad, and let you configure some buttons (please re-read the first message in this thread) Very Happy . also see the .txt file DOCS for a how-to.

best regards
- dink
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Commodore 64 (C64) Forum Index -> New Releases All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Tip: Get C64 Forever for super-comfy C64 emulation with pre-installed games, demos and other goodies!


Powered by phpBB © 2001, 2005 phpBB Group