NJ Arcade Emulators Source Translations
Now that NJ has officially ended production of his arcade emulators and released the sources, I went through the October 20th source package and translated all of the documents and comments. Although all of the various readme's are included here, they have already been translated in bits 'n pieces in other posts, so I don't imagine that this will have much value to anyone who isn't planning on delving into the inner workings of the program. Even then, it's most likely to be of only questionable value. But, just for posterity, here it is. My appologies for the multiple posts, but the information is too large for the single post limit...
************************************************** ***********
Note: any section that appears directly between two rows of astriks like this denotes the path to the file containing the original Japanese that was translated into the lines that follow. ROOT, fairly predictably, refers to the root folder of the unzipped download.
************************************************** ***********
---------------------------------------------------------------------------------
************************************************** *********************
ROOT -> source.txt:
************************************************** *********************
----------------------------------------------------------------------
Arcade Emulators For The PSP Source Code (20061015)
NJ (http://neocdz.hp.infoseek.co.jp/psp/)
----------------------------------------------------------------------
This is the source code for CPS1PSP/CPS2PSP/MVSPSP.
- 20061015 -
*Merged CPS2PSP's source code with the source code for CPS1PSP and MVSPSP.
I think that it would be hard to understand what's going on if I combined them too much, so I figured that it would be best to just leave them at this state.
*Following the changes in the formatting of the rominfo files, romcnv has also been updated.
*Since MVSPSP's timer is actually being processed as an int, it doesn't follow a proper clock. This is because when a double/float is used, the FM audio timer calculation causes the operational speed in crsword to drop significantly (for some reason it looks like the interrupts in this game only are extremely high).
*There was just so little reason for it, so I removed AdHoc.
----------------------------------------------------------------------
Below is a simple explanation of the source for CPS2PSP.
Basically, the other emulators are the same.
----------------------------------------------------------------------
Code used as reference
The basic processing flow (the CPU clock count and memory map, refresh timing, etc...) was created by referencing MAME.
For the sprite drawing order, I referenced a portion of FBA.
However, even porting the above emulators as-is to the PSP, they wouldn't operate at a respectable speed, so the emulators themselves have are entirely new, and take great advantage of the capabilities of the PSP's hardware. Overall, the layout is lacking in "general-purpose-ness", so I don't think that it'll be of much help if you are considering porting it to another machine.
----------------------------------------------------------------------
About the layout of the cache files
If I made them too complex, then time would be wasted on processing them and the speed would drop, so in reality, I'm not really doing much with them.
romcnv.exe, after reading (the rom) into memory, removes unnecessary data (such as duplicates and empty space), separates the sprite data into easily processed 64KB segments, and after creating the data display flags and processing flags, saves it all to gameName_cache.zip.
A detailed explanation is included with the released source, so I'll leave it at that.
CPS2PSP itself manages the cache data in a list layout, and used items move to the end of the list. Since the least used data is then inevitably at the top of the list, when it becomes necessary to load new data, this top data (the oldest) is deleted, and after the new data is loaded into this emptied space, it is then moved to the tail end of the list. The processing is just a repetition of this.
The reason why the sprite data is divided is that, you can't seek within a zip file, and after having played around with it a bit, I found that the 64KB size resulted in the best performance. If it weren't zip compressed, I think that the speed would drop drastically due to the slow speed of reading it off of the memory stick.
Also, it would probably be difficult to use cache processing as in Neo4All that directly manipulate the MMU. I don't even know if it would be possible with the PSP, but hypothetically, even if it could be done, I don't think that the performance would be that great on account of the slow memory stick transfer speed.
----------------------------------------------------------------------
About C68K and CZ80
I've greatly rewritten both in a form that would be easy for me to deal with, and they have no compatibility with the original source. If you try to reuse them, beware. I've fixed a bug in a portion of CZ80 (there's a bug in allocation and SBC16).
----------------------------------------------------------------------
If you could please use the link bellow in the occasion that you fix any bugs or make any improvements, that would help me out a lot. I'm sorry, but please refrain from using it for requests.
http://neocdz.hp.infoseek.co.jp/cgi-...oad/upload.cgi
************************************************** *********************
ROOT -> docs -> readme_cps1.txt:
************************************************** *********************
----------------------------------------------------------------------
CAPCOM CPS1 Emulator for PSP 1.01
NJ (http://neocdz.hp.infoseek.co.jp/psp/)
----------------------------------------------------------------------
<Summary>
This is an CAPCOM CPS1(Capcom Play System) emulator for the PSP.
----------------------------------------------------------------------
About Compatible ROM Sets
Since this is based on MAME 0.106, the zip file names must exactly match those required of ROM sets for MAME 0.106.
All ROM image files must be compressed in a zip file.
Other than the fact that it can't handle files that cascade into folders, it's basically exactly the same os MAME. Also, ROM sets that are incompatible with MAME are incompatible.
All of the games that are displayed in white in the file browser will run.
If it won't run, then the ROM set is different from the required one. Please make them match MAME 0.106's ROM set by using ClrMame Pro, RomCenter, or some other such tool.
If you absolutely want to run other emulators' or older MAME ROM sets, the you can edit rominfo.dat in notepad, etc..., however, I don't recommend it. If you don't understand the contents of rominfo.dat when looking at then please don't change it.
----------------------------------------------------------------------
Directory Setting
All of the directories will be automatically created the first time it's launched.
/PSP/GAME/
|
+- CPS1PSP/ (root directory)
| |
| +- EBOOT.PBP CPS1 Emulator binary
| +- cps1psp.ini software config file (create by emulator)
|
+- config/ (directory for key config file)
|
+- nvram/ (directory for SRAM)
|
+- snap/ (directory for screen shot)
|
+- state/ (directory for state data)
|
+- roms/ (put BIOS and rom files here. (zip compressed)
| |
| +- 1941.zip (example: 1941)
| +- sf2.zip (example: Street Fighter II (parent))
| +- sf2j.zip (example: Street Fighter II (clone: Japanese version))
| +- ...
----------------------------------------------------------------------
Controls
-Other than when running a game and the main menu, it's made so that a controls help screen will be displayed by pressing "R Trigger" in any of the menus.
If you don't understand, just go ahead and press "R Trigger".
I think you'll understand when you see it, so I'll omit the details.
-The menu for changing the game settings, etc... is displayed by pressing "START + SELECT" while a game is running.
-In Game Button Controls
It's possible to change the button allocation. I've written the defaults below.
In the conditions below, the button placement will automatically flip/rotate to match the screen, so you don't really need to make a conscious change for them.
-When 2 Player and the Cabinet item in the DIP switch is set to Cocktail
-When the Flip Screen item in the DIP switch is On
-When Rotate Screen is Yes for vertically scrolling games
Common
Up - Up or Analog Up
Down - Down or Analog Down
Left - Left or Analog Left
Right - Right or Analog Right
Start - Start
Coin - Select
2 Button Game
Button 1 - Square
Button 2 - Triangle
3 Button Game
Button 1 - Square
Button 2 - Triangle
Button 3 - Cross
Quiz Game (Directional Buttons Aren't Used)
Button 1 - Square
Button 2 - Triangle
Button 3 - Cross
Button 4 - Circle
Switch Player - L trigger
Street Fighter II Style Games (Including Street Fighter Zero CPS Changer ver.)
Button 1 - Square
Button 2 - Triangle
Button 3 - L trigger
Button 4 - Cross
Button 5 - Circle
Button 6 - R trigger
Forgotton World / Lost World
(Since there's nothing you can do about the loop lever on the PSP, the L/R triggers are used)
Button 1 - Square
Dial(rotate left) - L trigger
Dial(rotate right) - R trigger
Special Controls
START + SELECT: Open The Menu
L + R + SELECT: Service Switch (Also possible to allocate to a specific button)
L + R + START: 1P & 2P START (Used in the service menu)
----------------------------------------------------------------------
About "Raster Effects"
-There's a "Raster Effects' item in the game setting menu.
With this item you can specify whether the Line Scroll effect used in games like Street Fighter II, etc... is On/Off.
Since the burden of this item on emulation is extremely high (since sprites have to be drawn line-by-line, the draw passes increase several times above normal), it's normally "Off". If the misalignment of BG bothers you, the speed will drop quite a bit but, please change this to "On".
Also, it's made so that the BG is misaligned when "Off", it isn't a bug.
There is no methoud for displaying them normally other than when Raster Effects is "On".
With this inactive, Street Fighter II's screen falls apart and it turns into a rather atrocious state, but there's no real change in Street Fighter Zero, so it's better inactive.
----------------------------------------------------------------------
About "Auto Frameskip"
When inactive, naturally the overall speed of the game drop but, if you want to play a stable game, it's better left inactive.
*since 1.0, the default value is Off.
----------------------------------------------------------------------
About "Video Sync"
Improved operation in 1.0.
With it active the sound is slightly sacrificed but, screen flickering should improve. You should be better off turning it on for games such as King of Dragons where the character flickers every frame.
Basically, for games with heavy processing please make it inactive.
The recommended settings for Video Sync Yes are as follows.
Raster Effects Off
60fps Speed Limit Off
Sample Rate 11025Hz (It would probably struggle over 22050Hz)
----------------------------------------------------------------------
About the handling of bootleg version games
They were tentatively supported until about beta 3, however, they have all been deleted in 1.0. Basically, other than situations where the official game doesn't run due to encryption or other issues, the emulators that I create don't support bootleg versions.
(The reason is simply that I hate bootleg versions.)
I will release the source code in a few days, so if there's a necessity, please add them yourself using MAME, etc.. as reference.
----------------------------------------------------------------------
What's Changed
1.01
-Fixed a bug with Pang!3 where the state save was not being executed properly
-Merged the source code with CPS2PSP/MVSPSP
-Changed the extension of rominfo.dat and other resource files to .cps1
----------------------------------------------------------------------
1.0
-Changed the C68K core to be the same as CPS2PSP
-Changed the Z80 core to CZ80
-Fixed a number of CZ80 bugs
-Changed the basic processing to be on par with CPS2PSP
-Deleted all bootleg versions
-As a result of the rewrite of the draw processing, it looks like the speed has increased somewhat
-Fixed layer palette separation processing
-Added state Save/Load feature
-Improved the processing with VSYNC on
-Researched the dip switch values and changed them to values that should make them operate properly
-Changed Demo Sound and Allow Continue dip switch initial values to Yes
-Fixed a bug where the autofire feature wouldn't operate with Rotate Screen set to Yes
-Changed the screen shot image format to PNG
-Added Kernel Mode version
-Numerous other changes
************************************************** *********************
ROOT -> docs -> readme_cps2.txt:
************************************************** *********************
----------------------------------------------------------------------
CAPCOM CPS1 Emulator for PSP 1.02
NJ (http://neocdz.hp.infoseek.co.jp/psp/)
----------------------------------------------------------------------
<Summary>
This is a CAPCOM CPS2(Capcom Play System II) emulator for the PSP.
----------------------------------------------------------------------
About Compatible ROM Sets
Since this is based on MAME 0.107, the zip file names must exactly match those required of ROM sets for MAME 0.107.
All ROM image files must be compressed in a zip file.
Other than the fact that it can't handle files that cascade into folders, it's basically exactly the same os MAME. Also, ROM sets that are incompatible with MAME are incompatible.
All of the games that are displayed in white in the file browser will run.
If it won't run, then the ROM set is different from the required one. Please make them match MAME 0.106's ROM set by using ClrMame Pro, RomCenter, or some other such tool.
If you absolutely want to run other emulators' or older MAME ROM sets, the you can edit rominfo.dat in notepad, etc..., however, I don't recommend it. If you don't understand the contents of rominfo.dat when looking at then please don't change it.
Games that are displayed in grey in the file browser are encrypted ROMs that haven't been decrypted (there is no XOR table for them), so these will not run. They will not run even if you rename them since the file doesn't exist.
Put plainly, we need to wait until they are compatible with MAME.
Since there are still officially sold CPS2 encrypted games that are waiting to be decrypted, when these become compatible with MAME I plan to add compatibility for them.
----------------------------------------------------------------------
Directory Setting
All of the directories will be automatically created the first time it's launched.
/PSP/GAME/
|
+- CPS2PSP/ (root directory)
| |
| +- EBOOT.PBP CPS2 Emulator binary
| +- cps2psp.ini software config file (create by emulator)
|
+- cache/ (directory for sprite cache file)
|
+- config/ (directory for key config file)
|
+- nvram/ (directory for SRAM)
|
+- snap/ (directory for screen shot)
|
+- state/ (directory for state data)
|
+- roms/ (put BIOS and rom files here. (zip compressed)
| |
| +- 19xx.zip (example: 19xx)
| +- ssf2.zip (example: Super Street Fighter II (parent))
| +- ssf2j.zip (example: Super Street Fighter II (clone: Japanese version))
| +- ...
----------------------------------------------------------------------
Creating Cache Files
You need to create a graphic data cache for every game. Please create them with the included romcnv.exe. For how to use it, please refer to romcnv.exe's readme.txt.
However, unlike NEOGEO irregardless of the language version the graphic ROM contents are all the same, so it's OK to just create the parent set.
Of course, it also doesn't matter if you create one for each game.
Only ssf2t and it's various different language versions are an exception, so please be forewarned. This game added new characters and BG data to ssf2. Accordingly, while ROM set parent set is ssf2, if you don't create cache for ssf2t, a cache file without the added data will be created.
When creating the cache, place ssf2.zip and ssf2t.zip in the same folder and specify ssf2t.zip when you create it.
----------------------------------------------------------------------
Controls
-Other than when running a game and the main menu, it's made so that a controls help screen will be displayed by pressing "R Trigger" in any of the menus.
If you don't understand, just go ahead and press "R Trigger".
I think you'll understand when you see it, so I'll omit the details.
-The menu for changing the game settings, etc... is displayed by pressing "START + SELECT" while a game is running.
-In Game Button Controls
It's possible to change the button allocation. I've written the defaults below.
In the conditions below, the button placement will automatically flip/rotate to match the screen, so you don't really need to make a conscious change for them.
-When the Flip Screen item in the service menu is active
-When Rotate Screen is Yes for vertically scrolling games
Common
Up - Up or Analog Up
Down - Down or Analog Down
Left - Left or Analog Left
Right - Right or Analog Right
Start - Start
Coin - Select
2 Button Game
Button 1 - Square
Button 2 - Triangle
3 Button Game
Button 1 - Square
Button 2 - Triangle
Button 3 - Cross
6 Button Game
Button 1 - Square
Button 2 - Triangle
Button 3 - L trigger
Button 4 - Cross
Button 5 - Circle
Button 6 - R trigger
Quiz Nanairo Dreams Specific (Directional Buttons Aren't Used)
Button 1 - Square
Button 2 - Cross
Button 3 - Triangle
Button 4 - Circle
Switch Player - L trigger
Special Controls
START + SELECT: Open The Menu
L + R + SELECT: Service Switch (Also possible to allocate to a specific button)
L + R + START: 1P & 2P START (Used in the service menu)
----------------------------------------------------------------------
About "Raster Effects"
-There's a "Raster Effects' item in the game setting menu.
With this item you can specify whether the Line Scroll effect used in games like Street Fighter II, etc... is On/Off.
Since the burden of this item on emulation is extremely high (since sprites have to be drawn line-by-line, the draw passes increase several times above normal), it's normally "Off". If the misalignment of BG bothers you, the speed will drop quite a bit but, please change this to "On".
Also, it's made so that the BG is misaligned when "Off", it isn't a bug.
There is no methoud for displaying them normally other than when Raster Effects is "On".
----------------------------------------------------------------------
About "Auto Frameskip"
When inactive, naturally the overall speed of the game drop but, if you want to play a stable game, it's better left inactive.
*since 1.0, the default value is Off.
----------------------------------------------------------------------
About Sound
If you inactivate sound, then Q-Sound PCM data won't be loaded.
As a result, the amount of memory usable by cache increases and the cache read cycles decrease. There is not enough memory for the later fighting games so the cache is frequently read and lots of lags occur.
If you want to decrease lags by as much as possible, please inactivate sound.
----------------------------------------------------------------------
About eLoader 0.99 TIFF Loader
It won't run without changing eLoader's settings in loader 099.cfg.
If you launch it as-is then it will crash while trying to load the cache file.
*Looking at the crash details, it looks as though a coprocessor exception occurs, but as it's only loading files from a zip file, I don't believe that it would be using the coprocessor.
Normally, loader099.cfg is at ms0:/PSP/eloader/loader099.cfg
Please open it in notepad, etc... and add the following.
[CPS2PSP_3CC97646]
#************************************************* ************************#
#* CAPCOM CPS2 Emulator for PSP 1.0 (Kernel mode version) *#
#*-----------------------------------------------------------------------*#
#* LOADER: 0.98 (TIFF loader) *#
#* TIFF: 2.0 - YES : Only the small size games can be played. *#
#* GTA: 2.0 - YES *#
#* GTA: 2.01 - YES *#
#* GTA: 2.5 - YES *#
#* GTA: 2.6 - YES *#
#************************************************* ************************#
ebootname=CPS2PSP 1.0
limitedMemoryManager=Y
[CPS2PSP_3CC97526]
#************************************************* ************************#
#* CAPCOM CPS2 Emulator for PSP 1.0 *#
#*-----------------------------------------------------------------------*#
#* LOADER: 0.98 (TIFF loader) *#
#* TIFF: 2.0 - YES : Only the small size games can be played. *#
#* GTA: 2.0 - YES *#
#* GTA: 2.01 - YES *#
#* GTA: 2.5 - YES *#
#* GTA: 2.6 - YES *#
#************************************************* ************************#
ebootname=CPS2PSP 1.0
limitedMemoryManager=Y
As allocatable memory decreases by about 5MB, games with large content aren't playable due to insufficient memory, but since it's protected from freezing, when using the TIFF loader, please make sure to add the above settings to loader099.cfg.
On the other hand, just as it's been up until now, the GTA loader has slightly less memory available than FW1.5 but it should run with no problems. With the settings above the memory will only decrease and is unnecessary.