Installing and Running DOSBox on PS Vita (PSP Emulator) on TN-V8 Exploit

I missed DOS games. And luckily PS Vita has an emulator ported from DOSBox allowing you run DOS game on the go.

There are many builds of DOSBox for PSP available, with the immediate search showing the following versions (DD/MM/YY)


03/08/08, 26/07/08, 07/06/08, 25/06/08, 02/01/08, 29/01/08, 26/11/07



However, I noticed that not all builds will work on the PSP emulator in PS Vita exploited using TN-V.

Perhaps I should rephrase, all the builds will run fine without selecting core=dynamic options. Unfortunately, this option is essential and a MUST to run the game smoothly while other options such as simple and normal is not enough. From my testing thus far, the only build that work fine with core=dynamic option is a build from 26/11/07.

Enough with the introduction, let's get started to install DOSBox on your PSP.


First, grab a build of DOSBox from a list here and install it on your PSP. I highly recommend to download the build from 26/11/07 here.

* Follow my previous tutorial on how to install homebrew on PSP here if you do not know how to do so.

Next, launch DOSBox and make sure you do not encounter any error such as 'bus error', 'inst error', or 'data error'. As mentioned, these error will only occur if you select core=dynamic options in other builds except 2007 ones here.

Error image

A successful launch will look similar to the screenshot below:
Success image

You may have noticed now that there is no on-screen keyboard to enter any input. So what is the way to do that? Well, the most common way is to create a dosbox.conf file and insert the commands that you want to input in the [autoexec] section.

Following shows a fresh standard dosbox.conf:

* The bolded text is the most commonly tweak settings.

[sdl]
# fullscreen -- Start dosbox directly in fullscreen.
# fulldouble -- Use double buffering in fullscreen.
# fullresolution -- What resolution to use for fullscreen: original or fixed size (e.g. 1024x768).
# windowresolution -- Scale the window to this size IF the output device supports hardware scaling.
# output -- What to use for output: surface,overlay,opengl,openglnb,ddraw.
# autolock -- Mouse will automatically lock, if you click on the screen.
# sensitiviy -- Mouse sensitivity.
# waitonerror -- Wait before closing the console if dosbox has an error.
# priority -- Priority levels for dosbox: lowest,lower,normal,higher,highest,pause (when not focussed).
#   Second entry behind the comma is for when dosbox is not focused/minimized.
# mapperfile -- File used to load/save the key/event mappings from.
# usescancodes -- Avoid usage of symkeys, might not work on all operating systems.

fullscreen=true
fulldouble=false
fullresolution=original
windowresolution=original
output=surface
autolock=true
sensitivity=35
waitonerror=true
INPUTMAP up up 
INPUTMAP right right 
INPUTMAP down down 
INPUTMAP left left 
INPUTMAP triangle d 
INPUTMAP square lshift
INPUTMAP cross lctrl
INPUTMAP circle laltpriority=higher,normal
mapperfile=mapper.txt
usescancodes=true
keyhint=true

[dosbox]
# language -- Select another language file.
# memsize -- Amount of memory dosbox has in megabytes.
# machine -- The type of machine tries to emulate:hercules,cga,tandy,pcjr,vga.
# captures -- Directory where things like wave,midi,screenshot get captured.

language=
machine=vga
captures=capture
memsize=10

[render]
# frameskip -- How many frames dosbox skips before drawing one.
# aspect -- Do aspect correction, if your output method doesn't support scaling this can slow things down!.
# scaler -- Scaler used to enlarge/enhance low resolution modes.
# Supported are none,normal2x,normal3x,advmame2x,advmame3x,hq2x,hq3x,
# 2xsai,super2xsai,supereagle,advinterp2x,advinterp3x,
# tv2x,tv3x,rgb2x,rgb3x,scan2x,scan3x.

frameskip=0
aspect=false
scaler=normal2x

[cpu]
# core -- CPU Core used in emulation: normal,simple,dynamic,auto.
#    auto switches from normal to dynamic if appropriate.
# cycles -- Amount of instructions dosbox tries to emulate each millisecond.
# Setting this value too high results in sound dropouts and lags.
# You can also let DOSBox guess the correct value by setting it to max.
# The default setting (auto) switches to max if appropriate.
# cycleup   -- Amount of cycles to increase/decrease with keycombo.
# cycledown    Setting it lower than 100 will be a percentage.

core=dynamic
cycles=sync
cycleup=2500
cycledown=400
autocycle=true
mincycles=600
maxcycles=3000

[mixer]
# nosound -- Enable silent mode, sound is still emulated though.
# rate -- Mixer sample rate, setting any devices higher than this will
#    probably lower their sound quality.
# blocksize -- Mixer block size, larger blocks might help sound stuttering
#    but sound will also be more lagged.
# prebuffer -- How many milliseconds of data to keep on top of the blocksize.

nosound=false
rate=22050
blocksize=2048
prebuffer=10

[midi]
# mpu401 -- Type of MPU-401 to emulate: none, uart or intelligent.
# device -- Device that will receive the MIDI data from MPU-401.
# This can be default,alsa,oss,win32,coreaudio,none.
# config -- Special configuration options for the device. In Windows put
# the id of the device you want to use. See README for details.

mpu401=intelligent
device=default
config=

[sblaster]
# sbtype -- Type of sblaster to emulate:none,sb1,sb2,sbpro1,sbpro2,sb16.
# sbbase,irq,dma,hdma -- The IO/IRQ/DMA/High DMA address of the soundblaster.
# mixer -- Allow the soundblaster mixer to modify the dosbox mixer.
# oplmode -- Type of OPL emulation: auto,cms,opl2,dualopl2,opl3.
#  On auto the mode is determined by sblaster type.
#  All OPL modes are 'Adlib', except for CMS.
# oplrate -- Sample rate of OPL music emulation.

sbtype=sb16
sbbase=220
irq=7
dma=1
hdma=5
mixer=true
oplmode=auto
oplrate=22050

[gus]
# gus -- Enable the Gravis Ultrasound emulation.
# gusbase,irq1,irq2,dma1,dma2 -- The IO/IRQ/DMA addresses of the 
#  Gravis Ultrasound. (Same IRQ's and DMA's are OK.)
# gusrate -- Sample rate of Ultrasound emulation.
# ultradir -- Path to Ultrasound directory.  In this directory
#   there should be a MIDI directory that contains
#   the patch files for GUS playback.  Patch sets used
#   with Timidity should work fine.

gus=true
gusrate=22050
gusbase=240
irq1=5
irq2=5
dma1=3
dma2=3
ultradir=C:\ULTRASND

[speaker]
# pcspeaker -- Enable PC-Speaker emulation.
# pcrate -- Sample rate of the PC-Speaker sound generation.
# tandy -- Enable Tandy Sound System emulation (off,on,auto).
# For auto Tandysound emulation is present only if machine is set to tandy.
# tandyrate -- Sample rate of the Tandy 3-Voice generation.
# disney -- Enable Disney Sound Source emulation.

pcspeaker=true
pcrate=22050
tandy=auto
tandyrate=22050
disney=true

[joystick]
# joysticktype -- Type of joystick to emulate: auto (default), none,
#  2axis (supports two joysticks), 4axis,
#  fcs (Thrustmaster), ch (CH Flightstick).
#  none disables joystick emulation.
#  auto chooses emulation depending on real joystick(s).
# timed -- enable timed intervals for axis. (false is old style behaviour).
# autofire -- continuously fires as long as you keep the button pressed.
# swap34 -- swap the 3rd and the 4th axis. can be useful for certain joysticks.
# buttonwrap -- enable button wrapping at the number of emulated buttons.

joysticktype=2axis
timed=false
autofire=false
swap34=false
buttonwrap=true

[serial]
# serial1-4 -- set type of device connected to com port.
#    Can be disabled, dummy, modem, nullmodem, directserial.
#    Additional parameters must be in the same line in the form of
#    parameter:value. Parameter for all types is irq.
#    for directserial: realport (required), rxdelay (optional).
#    for modem: listenport (optional).
#    for nullmodem: server, rxdelay, txdelay, telnet, usedtr,
#    transparent, port, inhsocket (all optional).
#    Example: serial1=modem listenport:5000

serial1=dummy
serial2=dummy
serial3=disabled
serial4=disabled

[dos]
# xms -- Enable XMS support.
# ems -- Enable EMS support.
# umb -- Enable UMB support.
# keyboardlayout -- Language code of the keyboard layout (or none).

xms=true
ems=true
umb=true
keyboardlayout=none

[ipx]
# ipx -- Enable ipx over UDP/IP emulation.

ipx=false

[autoexec]
# Lines in this section will be run at startup.
SYSOPT clock 333

This config file is used to tweak the DOSBox emulator environment such as CPU type, CPU speed, memory, sound. Fortunately, the default settings works fine without the need for any modification.

There are several important things to note:
- You CANNOT allocate more than 10MB of memory. Anything larger than that will cause a permanent blank screen when launching DOSBox. Fortunately the CPU speed matters most compared to the memory size.

- You can only use the core=dynamic option with the 2007 build. Having this option set with other build will result in exception error such as 'bus error', 'inst error', or 'data error', like the figure below:
- DOSBox on PS Vita do not have any on-screen virtual keyboard. The most convenience way is map the button input from PS Vita to the keyboard in DOSBox using the INPUTMAP.

- Any command that you typed in [autoexec] section will be executed when launching DOSBox. Usually commands like mount and INPUTMAPPER are put here.

Following show a series of commands that I want DOSBox to execute upon launch. Assuming that I had MARIO.EXE placed in ms0:/dosbox/. In particular, it will mount my ms0:/dosbox as the C: drive. Go to C: drive. And then execute MARIO.EXE game.

[autoexec]
mount c ms0:/dosbox
c:
mario.exe

As you joyfully bashing the buttons, you will find that none of the buttons that you pressed works. The reason is simple, we haven't map our buttons to the keyboard in DOSBox yet! To do this, we are going to use the INPUTMAP command placed in [autoexec] section.


Mapping the Inputs (PS Vita Buttons <-> DOSBox Keyboard)

The command syntax to map button using INPUTMAP is as follows
INPUTMAP <PS Vita Button> <Keyboard Button>

In particular, the command INPUTMAP square lshift will map the Square button of your PS Vita to the keyboard button Left Shift in DOSBox.


[autoexec]

INPUTMAP up up 
INPUTMAP right right 
INPUTMAP down down 
INPUTMAP left left 
INPUTMAP triangle d 
INPUTMAP square lshift
INPUTMAP cross lctrl
INPUTMAP circle lalt


mount c ms0:/dosbox
c:
mario.exe



Now launching DOSBox again and the input still does not work. This is a very fatal common mistake that people made. Don't mistaken me. The mapping is correct. However, we didn't really 'tell' the game to use the mapping.

The correct way to do is to execute the game using the INPUTMAP EXEC command rather than launching the game directly.

[autoexec]

INPUTMAP up up 
INPUTMAP right right 
INPUTMAP down down 
INPUTMAP left left 
INPUTMAP triangle d 
INPUTMAP square lshift
INPUTMAP cross lctrl
INPUTMAP circle lalt


mount c ms0:/dosbox
c:
INPUTMAP EXEC mario.exe


Now you may noticed that every time I want to change the game I have to modify the dosbox.conf files, which is practically inconvenient and unaccessible when you are on the go without any computer nearby. Luckily people had thought of it and created a program called DosBox Navigator. This program is essentially a file browser allowing you to browse and open any files within its root folder.

To start, grab a copy of DosBox Navigator here and extract the contents somewhere on your PS Vita memory stick. For convenience I simply put it on ms0:/dosbox/doscore

The executable for DosNavigator is DN.COM. So we will have to modify our dosbox.conf accordingly.
[autoexec]
mount c ms0:/dosbox/doscore
c:
dn.com

This will launch DosNavigator every time we launch the DosBox application.

Creating Different Input Key Profile for Each Game

Now another question arise, we will have to create a different input profile for different games since not every game will use the same key binding. For instance, some game will require additional key such as WSAD for movement instead of the arrow key.

The solution to this is to create a .bat file (batch file) for each game. For example, I will have a .bat file for Mario and another one for Prince of Persia. These .bat file shall contain all the commands for INPUTMAP and mount point for launching the game.

mario.bat - For running Mario
@ECHO ON
INPUTMAP up up
INPUTMAP right right
INPUTMAP down down
INPUTMAP left left
INPUTMAP triangle d
INPUTMAP square lshift
INPUTMAP cross lctrl
INPUTMAP circle lalt
mount c ms0:/dosbox/game/mario
c:
INPUTMAP exec mario.exe


prince.bat - For running Prince of Persia 1
@ECHO ON
INPUTMAP up up
INPUTMAP right right
INPUTMAP down down
INPUTMAP left left
INPUTMAP triangle down
INPUTMAP square lshift
INPUTMAP cross up
INPUTMAP circle circle
INPUTMAP start enter
INPUTMAP select esc
mount c ms0:/dosbox/game/pop1
c:
INPUTMAP exec prince

Using DosNavigator, I can then simply open these .bat file and they should launch the game for me using the right input map as defined in the .bat file.

FAQ

Q: Can I run legacy windows such as Windows 95 on DOSBox for PSP?
A: I had tried but encounter 'Out of Memory' error since I couldn't allocate more than 10 MB in any of the DOSBox for PSP build that I tried.

Q: Can I allocate more than 10MB of memory for DOSBox?
A: No. Allocating any memory greater than that will result in a permanent blank screen on DOSBox. Don't worry though 10MB is enough to run most of the DOS games. The only thing matter is the CPU speed, which the 333MHz on PSP is capable to handle.




2 comments

SEJA INTELIGENTE E SEJA RICO EM MENOS DO QUE 3DAYS .... Tudo depende de quão rápido você
Pode ser obter o novo cartão de ATM em branco PROGRAMADO que é capaz de piratear
Em qualquer caixa eletrônico, em qualquer lugar do mundo. Eu conheci esse BLANK
ATM CARD quando eu estava procurando emprego on-line há cerca de um mês ...
Realmente mudou minha vida para sempre e agora posso dizer que sou rico e nunca posso
Seja pobre de novo. O mínimo de dinheiro que recebo em um mês com isso é sobre
$ 50,000. (Cinquenta mil dólares) Todos os dias eu estou acumulando dinheiro em meu
conta. Embora seja ilegal, não há risco de ser pego, porque tem
Foi programado de tal forma que não é rastreável, também possui uma
Técnica que torna impossível para os CCTVs detectá-lo ... Para detalhes
Sobre como obter o seu hoje, envie um email para os hackers: blankatm@outlook.com
. Diga também a seu amado uma vez e comece a viver grande. Isso é simples
Testemunho de como minha vida mudou para sempre ... Amo-te a todos ... o endereço de e-mail
Novamente é: blankatm@outlook.com
Ligar ou enviar texto: +15164003007

Reply

http://psp.brewology.com/downloads/download.php?id=7239 Hi,as you links are all dead, this is the only mirror i could find for the working dosbox version.

I just wanted to share it with you

Reply

Post a Comment

If you found this article or post helpful to you, feel free to enter your comments below ;)