Editor
Joined: 3/10/2010
Posts: 899
Location: Sweden
Good news everyone, Ilari has made a rerecording fork of JPC so that we can TAS DOS games. It already does several fun games, with more as he figures out wtf is wrong with the emulation. Here are some that seems to work:
  • Jetpack
  • God of thunder
  • Epic pinball
  • Bio Menance
  • Blake Stone: Aliens Of Gold
  • Mega man x
  • Charlie the duck
  • Ducks
  • Theme Park
One issue that he has right now is how to do the GUI for mouse entry. If you have any ideas on how to do it, feel free to say so here.
Patashu
He/Him
Joined: 10/2/2005
Posts: 4043
Placeable cursor on the screen, plus editable textboxes for its exact co-ordinates, plus progressively faded targets for the cursor locations of the past X frames?
My Chiptune music, made in Famitracker: http://soundcloud.com/patashu My twitch. I stream mostly shmups & rhythm games http://twitch.tv/patashu My youtube, again shmups and rhythm games and misc stuff: http://youtube.com/user/patashu
Editor
Joined: 3/10/2010
Posts: 899
Location: Sweden
I forgot to mention a tiny little thing, encoders will have a new challenge. You see, DOS games are free to change video mode, so the resolution (and aspect ratio in theory) can change during the movie. Oh, and there should probably be some sort of optimization for the text mode screens, lossy encodings really suck for text.
Editor, Skilled player (1440)
Joined: 3/31/2010
Posts: 2109
henke37 wrote:
I forgot to mention a tiny little thing, encoders will have a new challenge. You see, DOS games are free to change video mode, so the resolution (and aspect ratio in theory) can change during the movie. Oh, and there should probably be some sort of optimization for the text mode screens, lossy encodings really suck for text.
Perhaps instead of encoding, screen capture + lossless codec might work, if the staff allows it. After all, the captured video isn't there for verification, the emulator movie file is.
Editor
Joined: 3/10/2010
Posts: 899
Location: Sweden
Correct, it is not for verification. However, many people (myself included) doesn't want to bother with running the emulator themself. They instead watch the encode.
Editor, Active player (297)
Joined: 3/8/2004
Posts: 7469
Location: Arzareth
henke37 wrote:
Oh, and there should probably be some sort of optimization for the text mode screens, lossy encodings really suck for text.
x264 is quite good with text and patterned video in general. Large motion vectors and reference frames enable the screens to be encoded very optimally. Of course, pixels are still subject to the same chroma supersampling as regular graphics, but text usually has quite good contrast, unless you have dark dark blue on black background -- but that is not a problem particular to text; any content where the major details are in the subtle contrasts of blue or red hues is going to be blurry / blocky. The screen resolution changing is a more significant problem. Changing from 720x400 (or 640x400 if 9-pixel text displays are not supported) to 640x480 requires some clever ideas. Changes between 640x400 and 320x200 are more trivial. This problem is not specific to DOS in particular. PSX has the same problem. For example, Chrono Cross has content in 320x240, 512x480 and 256x240 in order of commonness. In any case, you will have to pick one of these two: A) Produce video that really changes the resolution (i.e. each screenmode change begins a new video stream). Not many players support this. B) Pick the most commonly occurring resolution and scale all video to that resolution. E.g. in case of CC, above, 320x240. C) Pick a resolution that is an integer multiple of all input resolutions (e.g. 640x400 for mode-13 VGA games, 2560x480 for CC) and scale all video to that resolution. D) Pick a resolution that is an integer multiple of the largest resolution, and display all content within that window, with integer-ratio scaling at most; i.e. black borders around the video in other cases. For example, with Chrono Cross, use 512x480 for the video. Display 320x240 with borders (96 pixels on each side, 120 pixels on top and bottom), 512x480 verbatim and 256x240 with 2x scaling. Or use 640x480 for the video; display 320x240 with 2x scaling, 512x480 with borders and 256x240 with 2x scaling and borders. This is likely the least preferable solution, for a number of reasons (ugliness, aspect ratio ignorance). (Yet, this is what was done with several Gens encodes.) When scaling the video, you should probably use a point filter for content that is intended to be pixelated (unless your scaling ratio is uneven) and a high-quality lanczos filter for content that is not intended to appear pixelated.
Joined: 6/4/2009
Posts: 570
Location: 33°07'41"S, 160°42'04"W
If the resolution change few times you can have more files? Like "game-TAS-part1.avi", "game-TAS-part2.avi", etc. Of course this is good for less than 5 parts otherwise there are too many files. If resolution change a lot then you shouldn't. [quote="henke37"]Epic pinball[/quote] Epic pinball is not a good TAS candidate, as you can play forever and the score will overflow at 4 billions. I was sad when that happened to me.
Warepire
He/Him
Editor
Joined: 3/2/2010
Posts: 2178
Location: A little to the left of nowhere (Sweden)
Thank you for posting these news henke37. While Java may not be the best language for an emulator it is better than no emulator at all. The JavaVM itself might actually cause a few desyncs due to the fact that it runs the final compile pass on the code as the code is executed. I have seen Java applications that slow down or act strange when the CPU is under heavy load. For sound emulation I think that there should be a general audio processor that all soundcards are mapped to. If I am not mistaken this is mainly what DOSbox does.
Skilled player (1652)
Joined: 11/15/2004
Posts: 2202
Location: Killjoy
I'm going to write up quick instructions, as I got this working. This worked for me in windows XP, 32 bit.
1. Download and install Java Dev Kit 6. Available here: 
http://java.sun.com/javase/downloads/widget/jdk6.jsp

2. Download the original jpc, available here
http://javapc.sourceforge.net/jpcsource.zip

3. only unzip these files .\resource\bios\bios.bin   .\resource\bios\vgabios.bin  and  .\resource\images\floppy.img, put them in your jpcc\library folder

4. Open a command prompt.
Start > Run > cmd

5. Type: 
path = "C:\Program Files\Java\jdk1.6.0_19\bin"

7. Switch to your jpc directory, i.e. Type:
cd C:\jpcrr

8. Type:
compile

9. Type:
java JPCApplication -library library -autoexec assemble.bat

10. Dismiss the Bios Error

11.  Under Drives > Important Image,  Select your BIOS file in jpc\library, and then name it BIOS. It will auto-select the image-type. 

12. Repeat for vgabios, name it VGABIOS. 

13. Repeat for floppy.img. Name it BOOTFLOPPY. Click the check box for standard geometry.

14. Repeat for your game directory. Make sure you select Hard drive Name it after the game. My example will be BARBARIAN

15. Go to System > Assemble. 
BIOS image will be BIOS,  VGA BIOS will be VGABIOS. Fda image will be BOOTFLOPPY, Hda will be BARBARIAN. Make sure Boot device is set to fda. This is the default. Click Assemble.

16. Go to System > Start

17. Type in JPC, using the virtual keyboard:
C:

18. Type in JPC, using the virtual keyboard, the games executable. 

Sage advice from a friend of Jim: So put your tinfoil hat back in the closet, open your eyes to the truth, and realize that the government is in fact causing austismal cancer with it's 9/11 fluoride vaccinations of your water supply.
Editor
Joined: 3/10/2010
Posts: 899
Location: Sweden
If you have a game that needs the FPU, you must load the FPU module manually. Similarly, the SoundCard module is not loaded by default either. Use this string in the assemble window to load them: org.jpc.modules.BasicFPU,org.jpc.modules.SoundCard
creaothceann
He/Him
Editor
Joined: 4/7/2005
Posts: 1874
Location: Germany
320x200, 640x400 etc. should be stretched to a 4:3 ratio, but that could be done by the player.
sgrunt
He/Him
Emulator Coder, Former player
Joined: 10/28/2007
Posts: 1360
Location: The dark horror in the back of your mind
creaothceann wrote:
320x200, 640x400 etc. should be stretched to a 4:3 ratio, but that could be done by the player.
We normally set the aspect ratio to 4:3 in our encodes; it's still our policy to leave the video data alone where possible.
Skilled player (1652)
Joined: 11/15/2004
Posts: 2202
Location: Killjoy
henke37 wrote:
If you have a game that needs the FPU, you must load the FPU module manually. Similarly, the SoundCard module is not loaded by default either. Use this string in the assemble window to load them: org.jpc.modules.BasicFPU,org.jpc.modules.SoundCard
When I put those it, it tells me they aren't found...
Sage advice from a friend of Jim: So put your tinfoil hat back in the closet, open your eyes to the truth, and realize that the government is in fact causing austismal cancer with it's 9/11 fluoride vaccinations of your water supply.
Editor
Joined: 3/10/2010
Posts: 899
Location: Sweden
Looks like he put them into a separate fork, you will have to download them separately I suppose. Edit: I created a custom dos boot disk that should work with anything. It loads mouse and cd drivers and properly sets up the environment. It is memory optimized and leaves plenty of conventional memory so that anything will work. Unless you are framewhoring, it should be a one size fits everyone. And for the lazy, I also made a hd image with some stuff that may or may not run.
arflech
He/Him
Joined: 5/3/2008
Posts: 1120
I should mention that it might be easier to just permanently add the JDK bin directory to your PATH, using the System Properties dialog that can be accessed by typing WinKey+Break; also now the latest version of the JDK is 1.6.0_20, it's too bad Sun Oracle doesn't add its own environment variable for the JDK and update it with each new installation so that you could just say "PATH=%JDK%;%PATH%" Oh, and on a related note, your steps should have the user prepend the JDK bin directory to the PATH rather than overwriting the PATH.
i imgur com/QiCaaH8 png
Joined: 7/27/2007
Posts: 38
I can't seem to get jpc-rr working. Yes, I'm running 64 bit Windows 7, but I'm not sure that's actually the problem.
DarkKobold wrote:
1. Download and install Java Dev Kit 6. Available here: http://java.sun.com/javase/downloads/widget/jdk6.jsp 2. Download the original jpc, available here http://javapc.sourceforge.net/jpcsource.zip
Ok.
3. only unzip these files .\resource\bios\bios.bin .\resource\bios\vgabios.bin and .\resource\images\floppy.img, put them in your jpcc\library folder
What jpcc folder? I was only told to extract those two files. Do you mean 'create a folder in C:\, name it jpcc, then create a library subfolder'?
4. Open a command prompt. Start > Run > cmd 5. Type: path = "C:\Program Files\Java\jdk1.6.0_19\bin" 6. ???? Profit! 7. Switch to your jpc directory, i.e. Type: cd C:\jpcrr
Uh, what? I thought the folder was named jpcc, not jpcrr? Running start-jpcrr.bat fails because of the "java -jar" thing, and running jpc-rr-r10.4.jar gives me an error message saying "Disk library missing. No library specified (-library foo)" I tried running the program without the 'java -jar' switches, but it ended up doing nothing when I ran it.
TAS: to beat a game faster than Sonic can blink.
sgrunt
He/Him
Emulator Coder, Former player
Joined: 10/28/2007
Posts: 1360
Location: The dark horror in the back of your mind
The instructions there are slightly obsolete - they assume that you're building JPC-RR from source rather than using the prebuilt version. (The BIOS images are already present in said version.) At least a handful of other people running Windows 7 have reported that removing "java -jar" from the command line in start-jpcrr.bat yields success. What do you mean by 'doing nothing'?
Joined: 1/26/2009
Posts: 558
Location: Canada - Québec
@wazkatango: Here an easy step by step to get JPC-RR r10.4 working from the beggining with this movie. First download JPC-rr r10.4, create a new folder and extract it there. Once it's done, download the floppy driver and move it in the disklibrary folder. (I suppose that on next version, someone will add already it...) Then download the game here (freeware), then create a new folder and extract all the game in it. After, you can run start-jpcrr.bat, there should 6 java windows that are going to popup. Focus on the "PC setting windows", select "floppy.img" next to the "fda image" label and press the "Assemble" button. Now take the JPC-RR windows and go to Drives > Import Image. Enter a new name for the game(example: skyroads-floppydisk). Press the "Image file/directory" button, browse up to the the aera where you created the skyroads folder and then you have to select the whole "skyroad folder". Choose "Hard Disk" instead of "Floppy Disk" for the the image type and import. Everything should be set up, so you can finaly download the input file, uncompress and go to Snapshot > Load > Movie, select "skyroads-tasv2.1-Ilari.jrsr", start it in System > Start and enjoy the movie in the VGA Monitor windows. --- That said, I woud like to know how you proceed for encoding with sound... and since there already a lua windows with JPC-rr, it would be nice to have an input display.
sgrunt
He/Him
Emulator Coder, Former player
Joined: 10/28/2007
Posts: 1360
Location: The dark horror in the back of your mind
BadPotato wrote:
That said, I woud like to know how you proceed for encoding with sound... and since there already a lua windows with JPC-rr, it would be nice to have an input display.
Prior to starting playback, pay a visit to System -> Dumping Tools, enter in file names for the appropriate streams (Skyroads uses video, obviously, and the two SoundCard channels - the first is PCM, the second is FM), and press Start next to those. Then start the movie; the files generated will be raw video/audio streams in a format that can be handled with the stream tools (available from the same place you got the binaries), the output of which will be raw video/audio in an output suitable for further processing by the standard encoding process.
Editor
Joined: 3/10/2010
Posts: 899
Location: Sweden
BadPotato wrote:
Once it's done, download the floppy driver and move it in the disklibrary folder.
Bzzt, wrong. It is NOT a driver. It is the operating system.
Joined: 1/26/2009
Posts: 558
Location: Canada - Québec
henke37 wrote:
BadPotato wrote:
Once it's done, download the floppy driver and move it in the disklibrary folder.
Bzzt, wrong. It is NOT a driver. It is the operating system.
Ah! Good point. I just tried to run some linux live-CD and it crash, because there were no FPU module according to the log console. Could you tell us where we can find the list of "string" for all avaible module that can be loaded? If there some missing, where can I download them?
sgrunt wrote:
Then start the movie; the files generated will be raw video/audio streams in a format that can be handled with the stream tools (available from the same place you got the binaries), the output of which will be raw video/audio in an output suitable for further processing by the standard encoding process.
I can see the raw output with frameshow, but I can't figure out how I can capture this into a video format.
Emulator Coder, Skilled player (1113)
Joined: 5/1/2010
Posts: 1217
BadPotato wrote:
I just tried to run some linux live-CD and it crash, because there were no FPU module according to the log console.
That would likely be just one of the problems. I have tried to get Linux to boot and failed. I guess the CPU emulator just isn't good enough for that.
BadPotato wrote:
Could you tell us where we can find the list of "string" for all avaible module that can be loaded? If there some missing, where can I download them?
I'm aware of following modules (all come with JPC-RR r10.x):
    org.jpc.modules.BasicFPU (FPU, has emulation issues) org.jpc.modules.FMCard (Adlib Gold) org.jpc.modules.SoundCard (SB16) org.jpc.modules.Joystick (Joystick port)
If you want multiple use comma (,) between module names.
BadPotato wrote:
I can see the raw output with frameshow, but I can't figure out how I can capture this into a video format.
I usually use something like: rawtorgb capture.dump capture.rgb lanczos2 640 400 16666667 This reads capture.dump, outputting raw RGBx data to capture.rgb using lanczos with alpha=2 to resize frames if needed (to 640x400) with frame rate of (as close as possible) 60fps. At least mencoder and ffmpeg can take raw RGBx as input and convert those to other formats (such as raw yuv420p, which in turn can be fed to x264). The usual resolution indeed is 640x400 because of pixel doubling and doublescanning the usual 320x200 resolution. Note that some games (e.g. God of Thunder) might use other resolutions and then one has to figure out what it is and what is the proper resolution. For sounds there is rawtoaudio2 (try 'rawtoaudio2 --help', it shows the options).
Joined: 7/27/2007
Posts: 38
sgrunt wrote:
The instructions there are slightly obsolete - they assume that you're building JPC-RR from source rather than using the prebuilt version. (The BIOS images are already present in said version.)
Yep, I was using the newer pre-assembled version.
At least a handful of other people running Windows 7 have reported that removing "java -jar" from the command line in start-jpcrr.bat yields success. What do you mean by 'doing nothing'?
I kept trying to remove the 'java -jar' command by running "jpcrr-r10.4.jar" with just the -library disklibrary -autoexec assemble.bat switches, instead of doing the obvious and physically editing the start-jpcrr.bat file. So yeah, I got it working, thanks.
TAS: to beat a game faster than Sonic can blink.
Joined: 1/3/2006
Posts: 334
Ive got several problems using this emulator. Frame advance doesnt seem to do anything, also the hotkeys wont work. Most of the time I end up with a frozen screen, unable to do anything.
Editor
Joined: 3/10/2010
Posts: 899
Location: Sweden
All complaints goes to Ilari.