HENkaku is a native Homebrew Enabler for the PS Vita and PS TV. It lets you run homebrews on the PS Vita
#414191 by forcefiftythree
Tue Oct 11, 2016 12:19 pm
EDIT: Attached to this post now is a very early and rough but somewhat working version of the plugin!

Instructions:

* place plugin suprx file into ux0:plugins/
* edit game.txt in same directory to include line: "ux0:plugins/dukemod.suprx 1"
* start a supported dump of Duke3D

SHA1 hash of EBOOT.BIN from a dump (made with old version of Vitamin) that is guaranteed to work with the plugin:
Code: Select all864913971231897C015665FD0DED49B63426D0EA


You can use the plugin at the same time as eg. rinCheat, there should be no conficts. The plugin will disable itself after startup if you're not running Duke3D or your dump is not supported (memory layout not as expected). You will see a message on screen which tells you if the plugin is active. While this is message is showing, you can press X to toggle graphics filtering (by default OFF or CIRCLE to toggle debug text output (default ON).

When you get into the actual game, you can use the touchscreen to switch weapons quickly. The edges of the screen are divided into 4 equally sized sections, left edge is for weapons 3-6 (shotgun to pipebomb) and right edge is for weapons 7-10 (shrinker/grower to freezer). Center of the screen is for weapon 2 (pistol). There is no touch location for the foot, at least not for now. Place your finger on screen, if necessary move it around until the weapon number you see is the one you wanted to switch to, release finger and the weapon will be switched.

Currently the switching is implemented in a way which sometimes causes a small delay before the switch actually happens, I'll try to fix this later. The only debugging text you see currently (if you don't disable it on startup) is related to this, the plugin will tell you it's waiting for the weapon change in game code to start or end.

The switcher is also not currently disabled when you're not actually in game (but in menus or watching a demo / "user clip", between levels, etc...) and you can break things with this, will be fixed later.

Currently, the game's own touchscreen inputs (touching the left or right half of screen can be bound to an action in game) aren't disabled so bind something that doesn't get in the way when switching weapons to them. eg. I currently have quick kick bound to left half of screen and show scoreboard (does nothing in single player) bound to right half of screen in the game's own input configuration settings. I'll try to figure out a way to disable the inputs via memory patching or savedata config file hack ASAP.

Plugin source code will be released eventually when it's more complete.


Since there is no homebrew Duke 3D port for the Vita yet (and who knows if there ever will be anything or even a good port, Duke/Build codebase is not that clean and nice to work on or as easily portable as for example id's games are...), I thought I'd try to add some improvements to the reasonably well working closed source, official port we already have.

So far I've got a plugin that works with one version of the game (EU, unpatched I think, dumped with Vitamin 1.0) and allows quick switching of weapons from the touchscreen (and also disables graphics filtering but I'll make this optional later). Other features I've been thinking about would be quick weapon switching with analog sticks (via a weapon wheel or something) for Vita TV users, loading user maps and mods and accessing all PC version cheats (all the code is still there, it's just not possible to activate them).

Making multiplayer work without PSN would be nice too, but not a high priority for me (and possibly will be more difficult than what I listed above, but I have to see about that).

If anyone has any other feature suggestions, I'd like to hear them.

If you have any tips on how to get IDA to show names for sce* OS/library calls in dumped game ELFs, I'm interested. vitadump.py fixes a lot of the data references but I'm not seeing any function names... Oh well, at least Duke isn't that hard to hack regardless because partial source code available.

If you have any tips on how to patch game code on the fly from a plugin thread, I'm interested. Patching data is ok, but patching code will always cause a crash, I guess because executable memory is write protected. AFAIK HENkaku should at least allow allocating new blocks of writable+executable memory due to emulator coders requiring this for JIT. But can I change permissions for memory that the OS allocated for the game binary on startup somehow?

If you have any tips on how to deal with ASLR/relocation in a plugin thread that's supposed to read/write variables in the game's address space, I'm interested. I guess this is the problem that prevents me from reading/writing data too, when using a dump of the game that has been made with newer/better dumping tools than Vitamin 1.0. With the Vitamin v1 dump, using addresses taken straight from IDA in plugin code works as expected buth with a Vitamin v2 dump or MaiDumpTool dump it does not.

I guess one easy option would be to patch the eboot itself too (I'd want to use the newest and best version of the game as the base then), but I think it'd be much neater if everything could be kept in a single plugin PRX that would work with any version of the game I happen to have on hand for analysis...

If someone wants to play with it now, I can post the plugin as it is but it's still very rough and like I said only works with a Vitamin 1.0 dump of the game, SHA1 of eboot.bin = 864913971231897C015665FD0DED49B63426D0EA and size = 31,44 MB. I think it's already better than only having next/prev weapon binds, but there are still some problems to work out; there's often a small delay before the game actually switches weapons and I have to add code for disabling the game's own touchscreen inputs in the plugin. see above
Advertising
Attachments
Duke Nukem 3D enhanced plugin, first test version
(14.43 KiB) Downloaded 49 times
Last edited by forcefiftythree on Wed Oct 12, 2016 5:15 am, edited 3 times in total.
#414199 by fate6
Tue Oct 11, 2016 7:13 pm
I won't lock the thread just yet but

The Rules Yo wrote:12 - Avoid creating work in progress (or W.I.P.) topics unless there is significant progress (e.g. a beta download, etc.) to be posted. The mod team reserve the right to lock such topics. We don't like vaporware.
Advertising
#414210 by forcefiftythree
Wed Oct 12, 2016 4:59 am
fate6 wrote:I won't lock the thread just yet but

The Rules Yo wrote:12 - Avoid creating work in progress (or W.I.P.) topics unless there is significant progress (e.g. a beta download, etc.) to be posted. The mod team reserve the right to lock such topics. We don't like vaporware.


Ah, sorry about that. I edited the first post now and added a rough, early version of the plugin now as an attachment.

Is it ok to post game eboot/suprx files (not full game dumps) here? I could post the binaries for the version that's guaranteed to work with the plugin as it is currently if people want to try it.
#414215 by Shippo
Wed Oct 12, 2016 7:50 am
I was searching for the Version you made the Rincheat Codes for this Game. I Finally found it but the Cheats dont work (Maybe because its not the Vitamin 1.0 Version).

Would like to try this out, but i need to waiit for this to work on all Versions. Keep up the good work :D
#414233 by fate6
Wed Oct 12, 2016 8:59 pm
forcefiftythree wrote:
fate6 wrote:I won't lock the thread just yet but

The Rules Yo wrote:12 - Avoid creating work in progress (or W.I.P.) topics unless there is significant progress (e.g. a beta download, etc.) to be posted. The mod team reserve the right to lock such topics. We don't like vaporware.


Ah, sorry about that. I edited the first post now and added a rough, early version of the plugin now as an attachment.

Is it ok to post game eboot/suprx files (not full game dumps) here? I could post the binaries for the version that's guaranteed to work with the plugin as it is currently if people want to try it.


Sadly no you can't post anything from the games themselves but hey if they happen to find their way to say your github or a pastebin that you just happened to say the name of then there is nothing I could do about it ;)

Who is online

Users browsing this forum: No registered users and 6 guests