Topic: Neko Project II fmgen and PC-98 Touhou (guide now included)  (Read 14964 times)

0 Members and 1 Guest are viewing this topic.

Arcorann

  • hey girl
  • Surprisingly unkempt
  • LOOK AT ME
Neko Project II fmgen and PC-98 Touhou (guide now included)
« on: October 22, 2011, 08:12:45 am »
Neko Project II is an emulator for the PC-98x1 series of computers created by Yui. Although the official np21 variant has been able to play Touhou games since its introduction in 2004, it was only recently that the viability of the emulator was properly investigated, partly due to the appearance of unofficial builds such as the kai and fmgen builds. With better emulation than Anex86 and better performance than T98-Next, it is the recommended emulator for playing all of the PC-98 Touhou games (except possibly HRtP due to minor flickering).

It is also notable for having a native Linux/Mac OS X port in the form of Xnp2.

Following is a guide to configuring Neko Project II for emulating the PC-98 Touhou games (last updated 2013-08-25).

Installation
* Download the emulator. Currently the recommended version is the fmgen version; this link should guarantee that you have the latest build. Select the first entry in the list labelled np2fmgen.7z, the password should be 9801.
** As of 2013-08-25 the latest version is the 2013-08-02 build, password 9801.
* Extract anywhere. If you can't open .7z files, download 7-Zip.
* Download the YM2608 samples from this link if you don't already have them, and extract them into the same folder as your np2 install.

Configuration
These are the essentials to get Touhou game emulation to the standard of Anex86 or T98-Next. Optional stuff will be covered later.
* Start np21nt.exe (np21.exe is designed for Windows 9x computers, although it'll often work just as well on later Windows). Do not use the other .exe files, np2sx(nt) results in graphical glitches, while Touhou does not work with np2(nt) at all.
* Go to Emulate --> Configure. Change the CPU clock multiplier from x4 to x32 or higher (MS may require x40 or above for some areas), reduce the sound buffer to 100ms (you can go lower if you want, but I personally leave it at 100), check QFM, and increase the sampling rate to at least 44K.
* Enter the system setup menu by selecting Emulate --> Reset while holding End until the screen appears. Select the second option, then change GDC clock from 5MHz to 2.5MHz. This is required for PoDD to work properly.
** Alternatively, go into the .ini file and change DIPswtch to DIPswtch=3e f3 6b.

Usage
* Harddisk --> IDE #0 (SASI #0 on the official build) --> Open..., select the HDI file, then Emulate --> Reset.

Optional stuff and miscellany
Currently not very detailed, may add more later.
* Savestates: Add STATSAVE=true into np21(nt).ini, making sure that it is in the [NekoProject21] section. This causes a Stat menu to appear. Savestates range from 0 to 9.
* Alternate FM cores: Full explanation pending, see fsvgm777's post, new link is here (2013-06-10, password is fmdll) or see the readme in most recent fmgen
* Fullscreen: Screen menu, also Alt+Enter (this key combination can be disabled).
* Font: The emulator generates a usable font automatically from a system font; this should be sufficient for casual purposes (Neko's font handling is much better than Anex's). To replace it with a different font, go to Emulate --> Font and browse for the file (Anex86's .bmp font files and T98-Next's font.rom will both work; the latter is recommended), or simply place font.rom (font.bmp) in the same folder as your install.
* Keyboard shortcuts: Replace the zeroes in the Function=... with relevant codes (see Function.txt for details). For example, to set Home (0x24) as a shortcut for a screenshot (IDM_BMPSAVE, 40701, 0x9efd) replace a group of 00 00 00 00 with 00 24 fd 9e.
For a slightly more detailed guide on configuring Neko Project II, refer to Tokugawa Corp's FAQ. Note that it was written for the official version so some info may be out of date relative to the newest unofficial builds.
* Screen size: Click on the cat icon at the top left corner of the window. You will have the option to change between six preset window sizes.
* Running at over 100% speed ("90FPS"): The most recent builds have introduced the option to change the emulation speed, with a new menu under Emulate --> Speed. However, by default 150% speed, the most common used by Touhou players, is not included. To fix this, add the line CPUSMENU=25,50,75,100,150,200,400,800 into np21(nt).ini.
* Debug features: Add the line I286SAVE=true into np21(nt).ini. Click on the cat icon to access a few debug features, including a memory viewer and disassembler (albeit crappy ones).
* Making LLS lag less: If you're having problems with LLS running significantly slower than the other games, check to see if you have HIMEM.SYS and EMM386.EXE. If so, drop the contents of this archive into the root of your LLS disk (replacing the existing config.sys). If you don't have DiskExplorer to do so...


DiskExplorer
http://hp.vector.co.jp/authors/VA013937/editdisk/index_e.html is the link for the most recent English version (1.69 English, 2010-04-10). This program allows you to copy files to and from disk images such as .hdi files, making it a very useful tool for anyone using them.

Xnp2
There is a port of Neko Project II for Linux and Mac OS X called Xnp2. At the present time it seems to have some sound problems, requiring a rather large sound buffer to avoid stuttering; should you be annoyed by this, np2fmgen runs perfectly in Wine.

The program needs to be compiled from source. Grab the latest version from here and extract to a folder. To install dependencies:
Code: [Select]
$ sudo aptitude install build-essential nasm checkinstall libsdl1.2-dev libsdl-mixer1.2-dev libgtk2.0-dev libxxf86vm-dev
replacing aptitude with your package manager if necessary.

To compile, change to the source folder, then:
Code: [Select]
$ ./configure --enable-ia32
$ make
Make sure the --enable-ia32 flag is supplied. Otherwise, the i386 instructions will be missing and the games will not run (same as running np2.exe on fmgen). After this, follow the settings above to configure the system, but you may have to set the sound buffer up to 200ms or more to avoid stuttering; this may result in audio lag.


For archival purposes, below is the original post that I made:
Quote
So I'm trying out the Neko Project II fmgen, a version of Neko Project II that is being worked on by an anonymous poster in 2ch (which I first discovered in this thread, with the original 2ch thread located here).

The purpose of this thread is twofold: firstly, to spread awareness of this emulator to this site. Secondly, PoDD is utterly broken on this.

Firstly, after the splash screen:

(Attachment Link)

The solution was to click Emulate->Reset while holding down the End key on the keyboard so that BIOS appears, select the second option and set the GDC to 2.5 MHz. This got the game running.

Then, actual gameplay results in this:

(Attachment Link)

Thus, I would like to ask that someone look into this further so that we can make the most of this new emulator.
« Last Edit: September 04, 2013, 01:37:42 pm by Arcorann »

Momiji

  • Unperson
  • *
  • Cya
  • LOOK AT ME
Re: Neko Project II fmgen and PC-98 Touhou
« Reply #1 on: October 22, 2011, 08:58:43 am »
Ohoo, so NekoProject II is finally being extended to support the PC9821?  This should prove interesting.  I'll give this a shot.   ^.^

[Edit]  Oh right, I forgot.  I had come across this thread once before, and I was in the process of writing up a new PC98 how-to, but I lost the text accidentally.  T-T
« Last Edit: October 22, 2011, 09:15:06 am by Momiji »

Arcorann

  • hey girl
  • Surprisingly unkempt
  • LOOK AT ME
Re: Neko Project II fmgen and PC-98 Touhou
« Reply #2 on: October 24, 2011, 06:47:39 am »
OK, so I've done a little bit more testing with both np2sx and np21.

I can now confirm that graphical glitches appear in all five PC-98 Touhou games when using np2sx, and do not appear in np21. As far as I can tell there are no problems whatsoever when running in np21, apart from the aforementioned GDC error, which is easily fixed.

Momiji

  • Unperson
  • *
  • Cya
  • LOOK AT ME
Re: Neko Project II fmgen and PC-98 Touhou
« Reply #3 on: October 24, 2011, 12:05:24 pm »
Do I need a BIOS file for NP21?  Hitting End did nothing.

Arcorann

  • hey girl
  • Surprisingly unkempt
  • LOOK AT ME
Re: Neko Project II fmgen and PC-98 Touhou
« Reply #4 on: October 24, 2011, 10:26:01 pm »
You have to hold it from clicking Reset until the screen appears (a couple of seconds).

Momiji

  • Unperson
  • *
  • Cya
  • LOOK AT ME
Re: Neko Project II fmgen and PC-98 Touhou
« Reply #5 on: November 01, 2011, 04:07:34 pm »
NP21 interprets the keyhit as 1 regardless if Numlock is on or off.  Argh.  I guess I need to try this with a real keyboard.

Momiji

  • Unperson
  • *
  • Cya
  • LOOK AT ME
Re: Neko Project II fmgen and PC-98 Touhou
« Reply #6 on: December 14, 2011, 08:49:51 pm »
I did a bunch of load testing of NP21 during NEC.  Worked pretty darn well, didn't get any of the chugging you'd see with T98Next.  And compared to Anex86 the sound was pretty much complete, and the graphics were nice and smooth.  It helps that you can really crank up the CPU speed, plus I have a feeling the older emulators only support a 2.5MHz GDC (NP21 will do 2.5MHz and 5MHz).  We did notice that, after a long period of playing any given game, the emulated machine would lock up but continue to play whatever music was loaded into the sound driver (albeit faster than normal).  Hopefully that gets fixed, because I'm thinking this is probably my PC98 emulator of choice now.

[Edit]  I'm going to unlock/sticky this for the time being, while I gather more data for a new PC98 emulator howto thread.  Please test this out and post your results!
« Last Edit: December 14, 2011, 08:58:01 pm by Momiji »

fsvgm777

  • One of the only Touhou fans from Luxembourg... I guess.
  • Nickname: fsvgm
  • LOOK AT ME
Re: Neko Project II fmgen and PC-98 Touhou
« Reply #7 on: December 15, 2011, 08:35:01 am »
I did some testing with the newest Neko Project II fmgen (which can be found here) some days ago. It has some very interesting features, most notably that you can use a different FM engine (for instance MAME's core). However, the rhythm samples (2608_xxx.wav) are still required. Said MAME core can be found in the same link mentioned above, along with the YM2612 core from the Genesis Plus GX. In order to use a different core, you have to add the line "FMGenDll=<name_of_fm_core>.dll" (where <name_of_fm_core> is the name of the core you want to use, for instance mamefm) in np21nt.ini.

Now for the actual testing part:
All PC-98 Touhou games work very well for me, aside from a bit of slowdown during the fight against Alice in MS (probably because I set the multiplier to 32) and LLS using 25% of my CPU (I have a Core i5) and the emulator running slow. Dunno if that's related to the MS-DOS-like boot-up I see when booting up LLS, as it doesn't use much CPU when playing the other games. Lastly, I tested if the MIDI in SoEW works as opposed to T98-Next, and it does work (it uses Microsoft's GS wavetable synth for me).

In conclusion:
With some tweaks, I'm very pleased with Neko Project 21. It's very likely going to be my PC-98 emulator of choice for some time.

Agent of the BSoD

  • Barrier "Boundary of Life and Death"
  • *
  • It's super effective!
  • LOOK AT ME
Re: Neko Project II fmgen and PC-98 Touhou
« Reply #8 on: December 15, 2011, 08:43:42 am »
I just started messing with it about half an hour ago (latest), and the only thing I notice is a little lag from it, which I was able to fix in the config by giving it more power. The font is a little wacky if you ask me (when I tested HRtP) and the percussion in HRtP is missing entirely, as opposed to T98-Next, so it sounds more like Anex86 all over again. I even used the file for Next they put up for NP2's music core into Next and it doesn't have percussion either, though I don't know why I thought it would TBH. The music is pretty good, but I prefer the way Next handles it.

Let's hope the rest of the development goes really well. (also, that one version of Next that Momiji linked me some time way back, I still never got it to run smooth. It lags horribly. Luckily, it looks like NP2 is going to replace it anyway)

I figured out how to play midi in games with a different device on Win7 ^^
TF2 Backpack
Embodiment of Scarlet Hair English Patch is almost completed.
^ I didn't forget about this. I don't know what you're talking about. >_>

Momiji

  • Unperson
  • *
  • Cya
  • LOOK AT ME
Re: Neko Project II fmgen and PC-98 Touhou
« Reply #9 on: December 15, 2011, 12:30:36 pm »
You may want to put all the YM2608 rhythm WAVs into the emulator folder.  Then copy over the FONT.ROM from T98Next and use it (Emulate > Font).  Also, for sound emulation, make sure you're using a Speakboard (Device > Sound > Speak board).  Then you can increase the sound quality (Emulate > Configure > Sound section).  First set the sampling rate to either 55khz (or 88khz if your system will handle it), then enable QFM.  I also turned down the sound buffer to ~40ms.  On top of all that, I have the CPU set to ~2.5MHz x32 (~79MHz).  The faster it is, the smoother the game may be.

Agent of the BSoD

  • Barrier "Boundary of Life and Death"
  • *
  • It's super effective!
  • LOOK AT ME
Re: Neko Project II fmgen and PC-98 Touhou
« Reply #10 on: December 17, 2011, 08:20:20 am »
Yep, that all worked for me. Thanks! I've set my sound buffer to 80, because 40 is good, but has faint fuzzing if you listen well, though 80 is a bit lagged. :\ (50 destroys it for some reason)

But on another note, LLS runs exceedingly slow, but runs. (regardless of that 5 or 2.5 GHz change) I'm not sure what the problem with it is. MS runs fine though. (and it seems this computer can't run the games at full speed when lots of stuff is happening, since it slows down, reminiscent of T98-Next all over again. I already plan on getting a new system)

I figured out how to play midi in games with a different device on Win7 ^^
TF2 Backpack
Embodiment of Scarlet Hair English Patch is almost completed.
^ I didn't forget about this. I don't know what you're talking about. >_>

Momiji

  • Unperson
  • *
  • Cya
  • LOOK AT ME
Re: Neko Project II fmgen and PC-98 Touhou
« Reply #11 on: December 17, 2011, 08:24:57 pm »
But on another note, LLS runs exceedingly slow, but runs. (regardless of that 5 or 2.5 GHz change) I'm not sure what the problem with it is. MS runs fine though.
Yep, and I figured out what was doing it.  The LLS disk image loads some MS-DOS stuff that it really doesn't need.  I made a new MS-DOS disk that includes all the PC98 Touhou games on it, with updated MS-DOS and no extras on startup (HIMEM, etc.), and LLS worked fine.  In fact if you set the GDC to 2.5MHz you can basically play all the games from the same disk.  Although HRtP has problems but I think it was mis-copied, I think because some of the files were originally corrupted and make copy/xcopy mad.

Arcorann

  • hey girl
  • Surprisingly unkempt
  • LOOK AT ME
Re: Neko Project II fmgen and PC-98 Touhou
« Reply #12 on: December 28, 2011, 01:45:40 am »
I noticed the emulation speed slowdown on LLS as well; simply renaming config.sys fixes it to a similar speed to the other games.

Speaking of emulation speed, does anyone have an idea as to the lowest CPU multiplier setting that would run the games without in-game slowdown? There has to be a certain sweet spot (too low e.g. x20 and there is distinct slowdown in-game; too high and the emulation won't run at full speed).

And a couple of interesting things I've found out:
* It turns out that np21 has existed since version 0.80 (2004). Probably the reason why no-one in the western Touhou community ever found it was because the download link is non-obvious (it's the line below the source code downloads).
* Hourglass r81 seems to work with Neko Project II (the only major problem is that for some reason loading a savestate will cause a desync), which means that should anyone feel like creating a TAS of a PC-98 Touhou game using re-recording, they are now certainly able to.
« Last Edit: December 28, 2011, 05:19:56 am by Arcorann »

Momiji

  • Unperson
  • *
  • Cya
  • LOOK AT ME
Re: Neko Project II fmgen and PC-98 Touhou
« Reply #13 on: December 28, 2011, 03:06:15 am »
I run mine at x32 (78MHz), YMMV depending on the speed of your computer.

Agent of the BSoD

  • Barrier "Boundary of Life and Death"
  • *
  • It's super effective!
  • LOOK AT ME
Re: Neko Project II fmgen and PC-98 Touhou
« Reply #14 on: December 28, 2011, 05:49:25 am »
I run mine at x32 (78MHz), YMMV depending on the speed of your computer.
I run mine as well at that same speed. Seems to work well, even with this old hardware computer.

I figured out how to play midi in games with a different device on Win7 ^^
TF2 Backpack
Embodiment of Scarlet Hair English Patch is almost completed.
^ I didn't forget about this. I don't know what you're talking about. >_>

Goldom

  • Whee
Re: Neko Project II fmgen and PC-98 Touhou
« Reply #15 on: February 25, 2012, 07:39:03 pm »
Have there been any more updates to NP21, or has anyone found settings (or a particular older version) to avoid freezes?
Most of the games run decently on Next, but LLS is unusably slow, while too flickery in Anex. I just found NP, and it was running so perfectly, but then total lockup when I reached stage 4 boss  :(
I maintain a spreadsheet that records timing data across all Touhou games and a by game/by stage/EoSD spellcard checklist.
Timing spreadsheet: Download current revision |OR| View last major update (3.2) on Excel Web App
Checklist download: xlsx | xls (Last update: Aug 12: DDC checklists added)

fsvgm777

  • One of the only Touhou fans from Luxembourg... I guess.
  • Nickname: fsvgm
  • LOOK AT ME
Re: Neko Project II fmgen and PC-98 Touhou
« Reply #16 on: February 25, 2012, 08:26:45 pm »
There have been more updates to Neko Project 21:

Here's the latest one I found on 2ch.
Password (to be typed in the text box): 9801

This version also lets you choose which sound core you want to use, as shown in this pic (click for full size):



In order to use the alternate sound core(s), you need to download this (password: 9801), then place the files in the Neko Project folder. After that, you need to add a line in the INI file starting with "FMGenDll=" (without quotes). There, you can specify which alternate sound core to use. I personally use mamefm.dll as alternate sound core.

As for LLS locking up, I have something similar, except it happens just before the boss fight in Stage 5. Oddly enough, it only seems to happen with Reimu... unless the problem fixed by itself on my end? Granted, I changed the CPU multiplier to 48x, but I don't think this is related to the problem I have (had?).

Goldom

  • Whee
Re: Neko Project II fmgen and PC-98 Touhou
« Reply #17 on: February 25, 2012, 08:46:11 pm »
Hm, that version has the same version number as mine, but mine doesn't have that option.

I just went and tried it again, and I actually meant stage 5. I'm on Reimu, and it freezes every time in the pre-boss dialogue, even if I reload from a savestate from stage 4. Did you find any way to get past that point?
« Last Edit: February 25, 2012, 08:53:12 pm by Goldom »
I maintain a spreadsheet that records timing data across all Touhou games and a by game/by stage/EoSD spellcard checklist.
Timing spreadsheet: Download current revision |OR| View last major update (3.2) on Excel Web App
Checklist download: xlsx | xls (Last update: Aug 12: DDC checklists added)

fsvgm777

  • One of the only Touhou fans from Luxembourg... I guess.
  • Nickname: fsvgm
  • LOOK AT ME
Re: Neko Project II fmgen and PC-98 Touhou
« Reply #18 on: February 25, 2012, 09:00:42 pm »
Well, in order for the option to appear, you have to download the second link in my previous post, then follow the instructions in my previous post.

For the question:
MarisaB (and possibly MarisaA) doesn't lock up at that point for me for no apparent reason... which is why I only mentioned Reimu in my previous post.

Arcorann

  • hey girl
  • Surprisingly unkempt
  • LOOK AT ME
Re: Neko Project II fmgen and PC-98 Touhou
« Reply #19 on: February 26, 2012, 01:06:24 am »
Same problem happened to me, though I don't remember what I was using apart from it being a December build. We need to check if the problem still exists on current builds (such as the 20120223 linked), as well as on other emulators with the same HDI file.

EDIT: Replicated on 20120223 build with ReimuA.
« Last Edit: February 26, 2012, 01:29:13 am by Arcorann »

Goldom

  • Whee
Re: Neko Project II fmgen and PC-98 Touhou
« Reply #20 on: February 26, 2012, 02:25:54 am »
Well, at least MS worked flawlessly in it. I tried HRTP, and the bullets flickered out of visibility when there were too many, making it impossible. But that one runs fine on Next, so that's ok.
I maintain a spreadsheet that records timing data across all Touhou games and a by game/by stage/EoSD spellcard checklist.
Timing spreadsheet: Download current revision |OR| View last major update (3.2) on Excel Web App
Checklist download: xlsx | xls (Last update: Aug 12: DDC checklists added)

Goldom

  • Whee
Re: Neko Project II fmgen and PC-98 Touhou
« Reply #21 on: March 02, 2012, 07:41:04 am »
So I just made an interesting discovery. LLS Reimu is now freezing for me at the same place in Anex86 too. I KNOW it didn't used to, which leads me to believe that it's the disabling of DOS loading stuffs (required to remove stutter in NP21) that causes the freeze, not NP's own bug. I'll restore it tomorrow (all I did was rename config.sys > config.bak) and see if that fixes it. If so, I guess the bug NP21 needs to overcome is its slowness with that loaded, not the freezes themselves.

Upthread someone mentioned having rebuilt the whole game file without DOS - wondering if that version freezes too or not. And if not, how you did that exactly.
« Last Edit: March 02, 2012, 07:44:08 am by Goldom »
I maintain a spreadsheet that records timing data across all Touhou games and a by game/by stage/EoSD spellcard checklist.
Timing spreadsheet: Download current revision |OR| View last major update (3.2) on Excel Web App
Checklist download: xlsx | xls (Last update: Aug 12: DDC checklists added)

Momiji

  • Unperson
  • *
  • Cya
  • LOOK AT ME
Re: Neko Project II fmgen and PC-98 Touhou
« Reply #22 on: March 02, 2012, 09:21:07 am »
I used Disk Editor, and I just reduced the amount of stuff loading via autoexec.bat.  I haven't played LLS long enough to catch the freeze yet.
« Last Edit: March 02, 2012, 09:22:46 am by Momiji »

Goldom

  • Whee
Re: Neko Project II fmgen and PC-98 Touhou
« Reply #23 on: March 02, 2012, 05:33:47 pm »
Well this is strange. My autoexec.bat has nothing in it but
game

So nothing to try there for my copy... So I restored config.sys, confirmed slowdown returned, but then tried around other CPU settings. By turning it lower - down to 24x - it actually fixed the slowdown. I haven't yet made sure the freeze is gone (I'll update in a bit), but don't see why it wouldn't be. The only question is whether 24x is enough to deal with complex sections without lagging. (I tested a couple minutes in Extra without any, but I've never actually played LLS Extra before and so died before long.)

Update: Finished LLS Reimu A on Normal with no freeze! NP21, 24x CPU, config.sys intact. There were a few moments of lag, however - the final attack of boss 5, some fairy shots in stage 6, and Yuka's rotating yellow orbs caused framerate drops, but only for about 1s each. Overall, I'd call it adequate. Of course, it may lag worse on harder difficulties.

Also: I just realized that while 24x gets you 58 MHz and 32x is 78 MHz, if you set the CPU to 1.99 instead and then use 32x, you get in between: 63 MHz. That may be the best compromise - it looks unstuttered trying it out, but I'll have to play a full game with it later to check for the lag spots.
« Last Edit: March 02, 2012, 06:12:55 pm by Goldom »
I maintain a spreadsheet that records timing data across all Touhou games and a by game/by stage/EoSD spellcard checklist.
Timing spreadsheet: Download current revision |OR| View last major update (3.2) on Excel Web App
Checklist download: xlsx | xls (Last update: Aug 12: DDC checklists added)

Tack Frost

  • heeeeee-hoooo
  • Nickname: T-A-C
  • LOOK AT ME
Re: Neko Project II fmgen and PC-98 Touhou
« Reply #24 on: March 04, 2012, 04:49:14 pm »
Been trying LLS in NP21 0.83k8/fmgen. Game seems to run at full speed, but there seems to be an abnormal slowdown in the music when gameplay is occurring (the music returns to normal when game is paused). Attempting to rename config.sys to config.bak somehow caused sound stutter. Haven't seen if any of the other games have similar sound issues yet.

Tengukami

  • Nothing is "off the record".
  • *
  • I said, with a posed look.
  • Nickname: Amaterasu
  • LOOK AT ME
Re: Neko Project II fmgen and PC-98 Touhou
« Reply #25 on: March 06, 2012, 01:40:44 am »
I run mine at x32 (78MHz), YMMV depending on the speed of your computer.

Full memory and x32, np21nt runs perfectly well for me. I'm going to need to try the sound idea a little upthread, as sound tends to drop out for me, but this might also be due to other apps running and using - yes - PulseAudio. Apart from that, I'd say it runs very well.

Edit: Had some lag issues at busier stages, but dialing it down to x16 seemed to resolve this almost entirely. Lags are now seldom and very brief.
« Last Edit: March 06, 2012, 02:15:05 am by Tengukami »

Tumblr - MyAnimeList - YouTube - Fan Fiction - Twitter - Steam
"The past days are infinite. That's why it won't have a meaning if we don't have fun now. A thousand years or ten thousand years, there's nothing in them matching this moment."

Goldom

  • Whee
Re: Neko Project II fmgen and PC-98 Touhou
« Reply #26 on: March 06, 2012, 07:00:35 am »
I tried my above idea about doing 1.99x32. It ran marginally better than 2.4x24, and way better than 2.4x32, but still lagged in those same 3 spots.

Now, if I play in original-size windowed mode, I can run 2.4x32 completely smooth. It only gets choppy when trying to fullscreen (CPU usage shoots from 1-2% to 25% (on a 4-core, so that's 100% to the program), and then the lag happens). Problem is, windowed is unplayably tiny. I'm going to say 1.99x32 is the best I can get for an intact LLS disk. I'd test more, but it takes getting to stage 6 to notice the lag, so it takes a while =\.

I'll just go forward with this:
Playing as Reimu - intact disk, Anex86
Playing as Marisa - take out config.sys, 2.4x32 NP21

Anex flickers badly in fullscreen, but lets me stretch the window to near-full and runs basically fine then, minus some music quality. Actually, that makes me wonder... Huh, nope. I thought maybe a stretched NP21 window would similarly behave better than fullscreen. It actually ran even worse (1.99x32 was stuttery in large window right on stage 1, but fine in fullscreen).
« Last Edit: March 06, 2012, 07:04:01 am by Goldom »
I maintain a spreadsheet that records timing data across all Touhou games and a by game/by stage/EoSD spellcard checklist.
Timing spreadsheet: Download current revision |OR| View last major update (3.2) on Excel Web App
Checklist download: xlsx | xls (Last update: Aug 12: DDC checklists added)

Goldom

  • Whee
Re: Neko Project II fmgen and PC-98 Touhou
« Reply #27 on: March 15, 2012, 07:35:55 pm »
So I figured out a solution, and it was staring me in the face all along - really don't know why I didn't think of this. Change the desktop resolution before fullscreen-ing. Dropping it from 1920x1080 down to 1280x800 cut the CPU use of NP21 by about 80%, allowing me to turn the speed back up to x32 on an intact LLS without any stutter - CPU only hits about 10% (so 40% of one core).

For less of a hassle than changing system settings, you can also just uncheck "No change screen resolution" in NP21's Screen Option > FullScreen, but this leaves the game not using the full vertical space on a widescreen monitor.

After a full game, this is definitely the best so far - went through Hard, ReimuB, and this fixed 2 of 4 lag spots from my previous test. Only ones left are when stage 6 fairies shoot blue aimed lines in unison (it fixed the lag from each single shot), and Yuuka's very final spell. I left Performance Monitor running throughout, and it never went over 20% (80% of one), so these are lags due to insufficient emulation speed, not from hitting the processor limit. Unfortunately, even turning the speed up to the next setting (1.99 x48) shot the usage to max and caused CPU lag everywhere, regardless of screen size - even at 640x480.

This is even better on the other games: I can now turn 03 and 05 up to running at 2.4x56 without the CPU passing 5%, completely removing the 0.5-1% slowdown I was having at 2.4x32. (Full game on 05 now has just 0.03% slowdown). Obviously, specific numbers and lag point will vary by CPU - for reference, I have an i5 760, running at 2.8Ghz - but overall, cutting resolution makes a major impact without any visual difference as long as you maintain the same aspect ratio.

Now, because I'm the sort of person who would spend an hour figuring out how to automate a 10 second task, I created a batch file for running NP21 that changes the screen resolution automatically. It requires this command-line resolution changing program to work though. Brackets are notes.
Code: [Select]
cd "[directory of that program]"
start dc64.exe -width=1280 -height=800 /wait [change dc64 if you're not using 64bit version]
cd "[directory to NP]"
np21.exe /wait
cd "[first directory again]"
dc64.exe -width=1920 -height=1080 [or whatever your original res was]

Paste into notepad, make adjustments and save as whatever.bat. Make sure to change file type from "text documents" to "all files." Run that file instead of NP21.exe.
« Last Edit: March 16, 2012, 04:38:16 am by Goldom »
I maintain a spreadsheet that records timing data across all Touhou games and a by game/by stage/EoSD spellcard checklist.
Timing spreadsheet: Download current revision |OR| View last major update (3.2) on Excel Web App
Checklist download: xlsx | xls (Last update: Aug 12: DDC checklists added)

Arcorann

  • hey girl
  • Surprisingly unkempt
  • LOOK AT ME
Re: Neko Project II fmgen and PC-98 Touhou
« Reply #28 on: April 09, 2012, 07:41:48 am »
So, I've just tested an alternative resolution of sorts to the problem. Seeing as I play in windowed mode Goldom's method wouldn't help me, so I searched for an alternative memory manager to replace himem.sys and emm386.exe.

With this in mind, this link contains 3 files: config.sys, np2hma.sys and np2ems.sys. If you extract all three into the root of your TH04 disk, the game should work properly while running significantly faster (in terms of emulated CPU clock) than with himem.sys and emm386.exe. Given that they were designed specifically for NP21, I have no idea if the files will work with Anex86 or Next, so keep that in mind should you feel the need to switch emulators.
« Last Edit: April 09, 2012, 07:50:08 am by Arcorann »

Goldom

  • Whee
Re: Neko Project II fmgen and PC-98 Touhou
« Reply #29 on: April 14, 2012, 07:56:30 pm »
Very good. I tried those files out, and it's definitely an improvement even as-is. When combining both the new files AND the resolution change, it runs the best of anything yet. I'll try it through a game and see if it'll now get past the couple lag spots I had.

Oh, and it does still boot in Next and Anex, though I didn't try playing.

Edit: Yep, it's the best yet in a full game with both fixes at once. I moved up to 1.99x48 now, and the only remaining visible lag is those aimed blue shots. Full game on hard shows a 0.49% slowdown. And CPU was doing totally fine, so I could probably even go up to 2.4x48 and reduce it further. [Edit 2: I did, and it did go down to 0.14%.]
« Last Edit: April 15, 2012, 12:38:56 am by Goldom »
I maintain a spreadsheet that records timing data across all Touhou games and a by game/by stage/EoSD spellcard checklist.
Timing spreadsheet: Download current revision |OR| View last major update (3.2) on Excel Web App
Checklist download: xlsx | xls (Last update: Aug 12: DDC checklists added)
 

SMF 2.0.7 | SMF © 2013, Simple Machines
Theme based on ModernDark64 design by BlocWeb
Page created in 0.314 seconds with 25 queries.