Overclocking Dosbox & A Bug


christo930

Well-Known Member
Joined
Jan 4, 2004
Messages
1,095
Location
Pennsylvania, USA
I am tryiing to get commander Keen working at a fast speed and I've made enough progress that overclocking to 240 should do the trick (assuming it's running at 200 by default.
This is my keen4.gpe file

#! /bin/sh
/mnt/sd/dosbox/cpu_speed.gpe --daemon --cpuclk 240
DIRROOT=/mnt/sd/dosbox
DIRGAME=${DIRROOT}/keen4
cd ${DIRGAME}
${DIRROOT}/dosbox -conf ${DIRGAME}/dosbox.conf
cd /usr/gp2x
exec /usr/gp2x/gp2xmenu

I put the program cpu_speed in the dosbox directory but the above line is not doing anything because I've set it to speeds that always lock up my machine (anything over 240) and it had no effect. I tried just putting it in there without the --daemon --cpuclk 240 and it runs and then goes back to the gp2x menu system. Is there any way to overclock with dosbox?

There also seems to be a bug with speaker sound. I get no sound at all in keen4 and I only get sound in duke sometimes. I think (with Duke) that it has something to do with witch buttons you push before starting a game. But with keen, there is no sound at all. Here is my config file.

[sdl]
# fulldouble -- Use double buffering.
# output -- Can only be Surface for the gp2x.
# sensitivity -- Mouse sensitivity.
# mapperfile -- File used to load/save the key/event mappings from.

fulldouble=false
output=surface
sensitivity=100
mapperfile=mapper.txt

fontcolor_front=3
fontcolor_back=0
fontcolor_frontsel=1
fontcolor_backsel=5

[dosbox]
# machine -- The type of machine tries to emulate:hercules,cga,tandy,pcjr,vga.
# memsize -- Amount of memory dosbox has in megabytes.

machine=vga
memsize=1

[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.
# If forced is appended (like scaler=hq2x forced), the scaler will be used
# even if the result might not be desired.

frameskip=1
aspect=false
scaler=none

[cpu]
# core -- CPU Core used in emulation: simple,normal,full.
# Try simple first as this is the fastest, then normal and last full
# cycles -- Amount of instructions dosbox tries to emulate each millisecond.
# Too low and the game will crash randomly / not start up
# Too high and expect slowness
# Just right and you will get a nice speed boost
# 600-1200 ish seems to be about the sweet spot for the things I've tested. (older games)
# cycleup -- Amount of cycles to increase/decrease with keycombo.
# cycledown Setting it lower than 100 will be a percentage.

core=dynamic
cycles=450

[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=11025
blocksize=512
prebuffer=10

[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=none
sbbase=220
irq=7
dma=1
hdma=5
mixer=true
oplmode=auto
oplrate=11025

[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=false
gusrate=11025
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=11025
tandy=auto
tandyrate=11025
disney=true

[joystick]
# joysticktype -- needs to be none, or else expect no input.

joysticktype=none

[dos]
# xms -- Enable XMS support.
# ems -- Enable EMS support.
# umb -- Enable UMB support (false,true,max).

xms=false
ems=false
umb=true

[autoexec]
# lines of code to boot the dos program go here
mount C "/mnt/sd/dosbox/keen4"
c:
keen4e.EXE
exit


Any help would be greatly appreciated. I'd love to get some of the old dos games working, especially keen.
Keen4cga is working a little faster but has a lot of screen tearing during scrolling.

EDIT: I managed to overclock it using gp2xmenu. Keen4 is working at reasonable speed. HURRAY! Now if the sound would work consistently and I could figure out the right way to make a mapper file, I'd be in heaven. Is there another way to accomplish the overclocking as well?

Chris
 
christo930 said:
.
EDIT: I managed to overclock it using gp2xmenu. Keen4 is working at reasonable speed. HURRAY! Now if the sound would work consistently and I could figure out the right way to make a mapper file, I'd be in heaven. Is there another way to accomplish the overclocking as well?

Chris
I have keen4 working on my gp2x running at 250. I use gmenu, its just the easiest way i think. I have not had any issues with the sound. I am using PC speaker sound and judging from your conf you are too.

I run it at 800 cycles and at least 4 meg of ram. I think I might have frameskip at 2. I dont have my mapper at the moment but I can post it later tonight.
 
Last edited by a moderator:
Pickle said:
christo930 said:
.
EDIT: I managed to overclock it using gp2xmenu. Keen4 is working at reasonable speed. HURRAY! Now if the sound would work consistently and I could figure out the right way to make a mapper file, I'd be in heaven. Is there another way to accomplish the overclocking as well?

Chris
I have keen4 working on my gp2x running at 250. I use gmenu, its just the easiest way i think. I have not had any issues with the sound. I am using PC speaker sound and judging from your conf you are too.

I run it at 800 cycles and at least 4 meg of ram. I think I might have frameskip at 2. I dont have my mapper at the moment but I can post it later tonight.


Does emulating additional ram make it slower? I know for a fact that keen works without trouble on a real 286 with one meg of ram because that is how I used to do it. It can't use EMS and that would most likely slow it down anyway and I don't think it can use XMS ether which would probably slow it down switching from real mode to protected mode and back and Keen is definately a real mode game. That's why I choose 1mb. Only a protected mode game can access memory above the HMA (which dos normally resides in anyway). I think there is some software that doesn't run in straight protected mode but switches back and forth witch really slows things down, but keen isn't one of them. I think the sound problem has something to do with the mapper file, beause if I touch any key besides the upper right key, then there is no sound in the game (I can hit other buttons once the game starts).

Chris
 
Last edited by a moderator:
christo930 said:
Pickle said:
christo930 said:
.
EDIT: I managed to overclock it using gp2xmenu. Keen4 is working at reasonable speed. HURRAY! Now if the sound would work consistently and I could figure out the right way to make a mapper file, I'd be in heaven. Is there another way to accomplish the overclocking as well?

Chris
I have keen4 working on my gp2x running at 250. I use gmenu, its just the easiest way i think. I have not had any issues with the sound. I am using PC speaker sound and judging from your conf you are too.

I run it at 800 cycles and at least 4 meg of ram. I think I might have frameskip at 2. I dont have my mapper at the moment but I can post it later tonight.


Does emulating additional ram make it slower? I know for a fact that keen works without trouble on a real 286 with one meg of ram because that is how I used to do it. It can't use EMS and that would most likely slow it down anyway and I don't think it can use XMS ether which would probably slow it down switching from real mode to protected mode and back and Keen is definately a real mode game. That's why I choose 1mb. Only a protected mode game can access memory above the HMA (which dos normally resides in anyway). I think there is some software that doesn't run in straight protected mode but switches back and forth witch really slows things down, but keen isn't one of them. I think the sound problem has something to do with the mapper file, beause if I touch any key besides the upper right key, then there is no sound in the game (I can hit other buttons once the game starts).

Chris
Here are my keys, i will have to play with the memory myself.

Update: I tried 1 mb and didnt see any difference in speed, I had 8 mb previously.
CODE

key_up "key 256"
key_left "key 257"
key_left "key 258"
key_left "key 259"
key_down "key 260"
key_right "key 261"
key_right "key 262"
key_right "key 263"
key_F1 "key 264"
key_1 "key 265"
key_esc "key 266"
key_enter "key 267"
key_lalt "key 268"
key_n "key 269"
key_lctrl "key 270"
key_y "key 271"
key_space "key 272"
key_s "key 273"
key_r "key 274"
 
Last edited by a moderator:
Back
Top