Jump to content
LaunchBox Community Forums

Neko Project 21/w integration made easy!


xiron

Recommended Posts

Hello,

I wanted to use Neko Project 21/w with LaunchBox but noticed that unfortunatey NP21/w doesn't have the command line options to automatically launch HDI-based games or games with CD, etc.

For this reason I have created this small AutoHotKey script https://gist.github.com/bitgamma/acb3001732ba722feb4bc0539941e133

You should place it in the same folder as the np21/w (better if you compile it to .exe first using Ahk2Exe) and configure LaunchBox to use it instead of the emulator. You should leave the command line parameters to the default, and generally import the hdi file (if available) or the hdm file in your library.

The script will automatically generate an appropriate ini file for the game and launch it. To do this, it makes a few assumptions (which generally hold if you use games from Neo Kobe collection, at least those I tried out)

  • HDD extension is .hdi
  • FDD extension is .hdm
  • CD are in .ccd/.img/.sub format

It expects all files related to the same game to have the same exact name, save for the file extension. As long as they follow this rule, they will be automatically found and added to the ini file as needed.

Additionally, if you create an empty file with the same name as the game, but with the .25 extension (for example Rusty.25 placed next to Rusty.hdi), it will set the GDC speed to 2.5mhz instead of the default 5.0mhz. This is needed for some games.

This script has been developed for personal purpouses and isn't meant to cover any use case other than mine. I am posting it in the hope it will be useful to someone, either as-is or as a basis for further adaptation.

  • Like 1
  • Thanks 1
Link to comment
Share on other sites

  • 1 year later...

Thanks mate for sharing your AHK script to make it easier to launch these game titles from LB. It was very inspiring and I've incorparate some elements in my scripts.

Instead of using a single AHK file and feed in the rompath by LB, I created scripts to generate AHK script per game title to take care of the different boot order/media that might differ for some games. Having an AHK script per game is convenient if one decided to decouple from any front ends (RL or LB) and wanted to double click the old fashion way instead. I've also added scripts to consolidate the set and adding keybindings (global and user specific). What initially started as a script to extract files and organize the game by media types has soon started to grow in features :) More details in https://github.com/dsync89/neokobe-nec-pc98-ahk-gen-toolkit

To sum some of the features:

  1. List and group all games by Game Title and Media Type.
  2. Extract games in the folder hierarchy of [Media Type] > [Game Title]. There are three folders based on Media Type: [FD, HD, or CD]. You can decide on the location for these media type folders.
  3. AHK file per game title allowing you to double click and execute the game directly, without having to use any front end such as LaunchBox or RocketLauncher. You can also easily integrate these AHK files to LB by simply importing the .ahk files, then configure them to launch these fles using AutoHotKey program.
  4. User defined keybindings per game to the game AHK files
Edited by dsync89
Link to comment
Share on other sites

  • 1 month later...

Hey guys, I actually was wondering if anyone could help me get this all setup. I tried @xiron's script and it doesn't launch any game (but I also am using games that have multiple disks for hdm files, so I don't know if it is suppose to work).

As for the @dsync89 I am getting the full set that you linked currently and when i run it it rezipos the files. Is this by design? Then once it zips them all in the correct folder structure am I then support to extract them to each archive? I am trying to create a ahk file for Abunai Tengu Densetsu. I have the files in the extracted folder you linked called pc98. Also included my config.json.

Sorry if I am just oblivious, any help would be appreciated

image.thumb.png.6578339fb183499555186b7cd2beb4ae.pngimage.thumb.png.226c0a040a93cd5261e3eaaaef56a2f7.png

Link to comment
Share on other sites

20 hours ago, HisokaRyodan said:

Hey guys, I actually was wondering if anyone could help me get this all setup. I tried @xiron's script and it doesn't launch any game (but I also am using games that have multiple disks for hdm files, so I don't know if it is suppose to work).

As for the @dsync89 I am getting the full set that you linked currently and when i run it it rezipos the files. Is this by design? Then once it zips them all in the correct folder structure am I then support to extract them to each archive? I am trying to create a ahk file for Abunai Tengu Densetsu. I have the files in the extracted folder you linked called pc98. Also included my config.json.

Sorry if I am just oblivious, any help would be appreciated

image.thumb.png.6578339fb183499555186b7cd2beb4ae.pngimage.thumb.png.226c0a040a93cd5261e3eaaaef56a2f7.png

 

Thanks for the feedback! My previous old script will do the extraction and restructure that 9801 set to [Game title] folder instead of [Publisher] -> [Game title]. With the latest I decouple it and left it to rommanager instead and you could use ROMManager that uses DAT to restructure. If you find it difficult you can try to copy/paste a certain game folder then run the following scripts. Just to test if you see `.gamedb` file and its AHK.

Try to run the following in the right order:

  • gen_gamedb.py: Generate a .gamedb.txt file which contains all the boot source media types for each game titles.
  • gen_gamedb_with_overrides.py: Override .gamedb.txt with the entry in gamedb/gamedb_overwrite.txt to override the default boot order.
  • gen_ahk_files.py: Generate AHK files for each game to run it.
  • add_keymapper_to_ahk.py

If it's correct you should see the following files in your rom_dir.

 

image.thumb.png.6fc2cc0bfa9f9d3c024b71f067e7481d.png

Link to comment
Share on other sites

@update: BTW my AHK script will handle the multi disk game and load them appropriately since it will lookup all possible detected media from the generated .gamedb.txt file and setup the right media config based its order. Hence you might find some game require reordering the media source if it doesn't boot. Let me know if you'd like to contribute and I'll help out !

Link to comment
Share on other sites

it wasn't running due to me not having the python from windows store, shame on me for using windows and not running everything via command line.... BUT THANK YOU SO MUCH!!

 

I do have a few questions. So if i try and run your ahkv2 script, it says that it requires Autohotkey 1.3, however if I run it with Autohotkey 1.3, all of the ahk files give an error. That eror specificaly is attached. Error, line 52.

image.png.51ea42adf9bec75cf1918ae65a78a873.png

 

If i manually point the emulator to AutoHotKey 2.exe the games will run. I assume your script does a bunch of other things so realy want to get that going. I did copy and paste the contents of ahkv2 into the 'Running Script' Portion of Emulator tab in launchbox, and it actually runs it and allows for escape to exit so I know its working, but that same error line 52 pops up as well.

 

Thanks again for all your help! This is so great

 

 

Link to comment
Share on other sites

Actually I added "#Requires AutoHotkey v2.0-a" to the top of a AHK file and it ran without the error message when having "AutoHotKey2.exe" *i know thats not the name of the exe* path for the emulator and having the v2 ahk script copied into the "Running Script Portion". If I put "#Requires AutoHotkey v2.0-a" at the top of the "Running script" portion it still pipes out the error. 

 

image.thumb.png.847046e96fb2111bd122d69163ed7126.png

Link to comment
Share on other sites

Disregard all my other posts, I dunno if its common practice on this forum to edit those or just delete them, so if they need to be deleted or edited I will do that. I got everything pretty much setup how I want! Just want to give a shout out to @xiron and @dsync89 I actually study japanese and can read/play video games without issue, so being able to live through this system is actually amazing!!! Just to edit above, I realize that you meant pointing the emulator to the actual AutoHotKeyv2.exe, not your template... this was my bad. I should have taken the time to actually logically go through step by step what you were doing.. 

Things I did to make this my own/Easier for Launchbox/Playing Games:


Have Launchbox Default to HD games instead of FD games:
I wanted to have Launchbox auto group the games together to make it cleaner. Unfortunately, because of the way Launchbox is setup, you cannot define a default "version" per emulator, and since no region is associated with these (I believe USA is the default region if 3 regions per game are included), I found out that it defaults to alphabetical order. Due to this Game 1 [FD] always comes before Game 1 [HD] due to alphebet. So what I did was before running the final run.py script, I used auto renamer to rename every folder to the following:
[HD to [1HD
[FD to [2FD
[CD to [3CD

This way 1HD always is first in the list. This way if there is a game that needs FD to be first (I actually found one game... its a hentai santaclaus question game... that asks video game questions....its absolutely hilariously wild) you can simply set the default "App" to FD. In this game, if you boot from HD the image is stretched off the screen. It has like an aspect ratio of 1080x1920 so half of it is off screen. The FD actually runs correctly tho.

 

Had to Add AutoHotKey v2 Lines to the AHK File:
I believe the AHK script in Launchbox is v1 (the default one in thirdparty folder) so my machine was getting confused as to what to do. I have to go into the ".\neokobe-toolkit-main\templates\nec-pc-9801\ahkv2" file and modify the "gametitle.ahk". If you were lazy like me, essentially the script uses this as a template to create the per game AHK files. So if you add something here, it gets added to every game. What I did was add the following at the top, which allowed everything to run without issue.

#Requires AutoHotkey v2.0-a

 

Created a Joytokey Profile that uses Retroarch Button Mappings and Modified AHK file to AutoClose/Open the correct profile on Launch/Close
I could NOT 
for the life of me get joytokey profiles working with its default application switcher. This is probably due to the fact I have joytokey always running a default profile that has F1,F2,F3,F4,Escape,F10 also mapped so every emulator functions relatively the same always. But I had issues with it seemlessly switching so I added an ahk script to that same "gametitle.ahk" file so that when any game runs the first thing it does is close Jottokey, then opens it with a profile named "PC9801". Then upon exit (when hitting escape), it will close joytokey then launch joytokey with the "Default" profile. This actually works GREAT. If you want to see how I mapped it I used this as a template: NEC - PC-98 (Neko Project II Kai) - Libretro Docs if you scroll down itll show you the retroarch mapping.

I did mine different tho, in that the "Enter" key is equivalant to "Start" on some games and is also "Action" on others. Because of this I made start equivalent to PlayStation controllers Circle, and I made Space X. This way, Circle controls action in all games (I play games in japanese, and mainly PS1/2 so Circle as action was most confortable). I also mapped R2 and L2 to mouse clicks. Left and right click respectively. The left analog gets mapped to mouse movement. and Select gets mapped to F12. If a game doesn't support controller, I simply hit select, and I now can use the ingame mouse with the controller. I also have F11 mapped (to a combo action) so if I have to switch disk, or change emulator options, I can hit that, then use the mouse and right click to function as a real mouse, not just an emulator mouse:

---------------------------------------------------------------------------------

*This is added right under the AutoHotKeyv2 Section I put above*

ProcessClose "joytokey.exe"
sleep 1000
Run "A:\LaunchBox\ThirdParty\JoyToKey\JoyToKey.exe C:\Users\Hisoka\Documents\JoyToKey\PC9801.cfg"

 

*This replaces the provided Esc section within the "Key Bindings" section

Esc::
{
    ProcessClose "joytokey.exe"
    sleep 1000
    Run "A:\LaunchBox\ThirdParty\JoyToKey\JoyToKey.exe C:\Users\Hisoka\Documents\JoyToKey\Default.cfg"
    
    sleep 1000
       ProcessClose "np21w.exe"
    Run "taskkill /im np21w.exe /F",, "Hide"
    ExitApp
}
------------------------------------------------------------------------------------------

 

 

I have attached my gametitle.ahk file that resides in "templates\nec-pc-9801\ahkv2" along with my PC9801 config that resides in "C:\Users\Hisoka\Documents\JoyToKey" should anyone want to see or use. 

 

THANK YOU AGAIN!!! I want to go through all the games and mark which work and don't work. I had a few games say it needs a data disk which isn't in that set, and tell me disk 3 had a key I needed to enter (don't know what it was refering to) but other then that, had 10-15 games work without issue. 

gametitle.ahk PC9801.cfg

  • Thanks 1
Link to comment
Share on other sites

Wow thanks for the detailed writeup on how you use this @HisokaRyodan! Glad my script benefits your setup. 
 

I am typing this on phone while on the go so allow me to answer your first question since I’ve tackled that problem already. 
 

Indeed there could be different media types for a game and I actually generated a 1G1R (one game one Rom) DAT and used Rom manager to run against the complete collection to just select a rom for each title. 
 

Eg if a title has HD and FD, it will select it instead of both. I could share the DAT or even upload the whole 1G1R collection that I had generated based on this DAT to archive.org if you’d like to try it out. I did heavy programming to make sure the workflow is as smooth as possible, and did some logic to select the right media for the game. Though it might missed out some titles that need to be weed out manually.
 

You probably figured out already that the boot media selection is based on the .gamedb file that has a list of all bootable media. If you’re interested to feedback on these titles we could collaborate on this to refine the .gamedb and I can fix the game that require a certain boot order. 
 

FYI I also followed this methodology for other NeoKobe set like 8801, Sharp X1 and x68000 🙂. I could read and understand a bit of Japanese too and enough to get me through some error during boot. But it’s excited to know someone that is studying Japanese and also well verse in English!
 

 

Link to comment
Share on other sites

14 minutes ago, dsync89 said:

Wow thanks for the detailed writeup on how you use this @HisokaRyodan! Glad my script benefits your setup. 
 

I am typing this on phone while on the go so allow me to answer your first question since I’ve tackled that problem already. 
 

Indeed there could be different media types for a game and I actually generated a 1G1R (one game one Rom) DAT and used Rom manager to run against the complete collection to just select a rom for each title. 
 

Eg if a title has HD and FD, it will select it instead of both. I could share the DAT or even upload the whole 1G1R collection that I had generated based on this DAT to archive.org if you’d like to try it out. I did heavy programming to make sure the workflow is as smooth as possible, and did some logic to select the right media for the game. Though it might missed out some titles that need to be weed out manually.
 

You probably figured out already that the boot media selection is based on the .gamedb file that has a list of all bootable media. If you’re interested to feedback on these titles we could collaborate on this to refine the .gamedb and I can fix the game that require a certain boot order. 
 

FYI I also followed this methodology for other NeoKobe set like 8801, Sharp X1 and x68000 🙂. I could read and understand a bit of Japanese too and enough to get me through some error during boot. But it’s excited to know someone that is studying Japanese and also well verse in English!
 

 

Oh man, had I actually known that, and took the time to actually research what was going on, that 1g1r probably would have saved me some time... lol, but I'm actually glad I didn't since now I actually understand what is going on with everything. This is fantastic news, and I see that in the 1g1r set, the one game i was talking about that needs the HD is actually the one you boot, so this is fantastic!!! 

 

I am going to copy my main 9801 rom folder, hopefully use the 1g1r to get it the way it needs to be, then do the process again and report back. I am excited to get the other systems setup also! And thats awesome about japanese, i play all my games in japanese, so my emulation machine has enough storage to hold both USA and Japanese releases of every system :) currently playing Chrono Cross for the first time (in japanese), and having a blast, and will def play some of these absolute atrocious visual novel games for pc9801 once i finish :)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...