update dosbox docs for shim

This commit is contained in:
Andrew Pamment 2018-05-14 08:58:15 +10:00
parent e42f274c9b
commit a4a8651b3c
2 changed files with 26 additions and 18 deletions

1
.gitignore vendored
View File

@ -82,3 +82,4 @@ utils/reset_pass/reset_pass
.vscode
last10v2.dat
utils/filecenter/filecenter
utils/dosbox_shim/shim

View File

@ -38,47 +38,54 @@ These commands will compile and install DosBox into /usr/local/bin.
## Create Configuration File
Next you will need to create a config file which enables the serial port for socket inheritance, and also mounts drives so that DosBox can access both your doors and your BBS drop files.
Next you will need to create a config file which enables the serial port, and also mounts drives so that DosBox can access both your doors and your BBS drop files.
An example setup is here: [dosbox.conf](https://gist.github.com/apamment/98e42db83c452105b3e21a8bc062c5c3)
An example setup is here: [dosbox.conf](https://gist.github.com/apamment/2e5b00eda2f304f2bc7d298a0487bd9b)
In this example, drive C: is the location where my doors are stored, dropfiles will be copied to the door directory.
Be sure to change the port for each door. In this example the port is 9999.
## Create Shell Script to Invoke DosBox
The shell script you need will vary from system to system, but basically, you want to:
* ensure no one else is using the door before you start it
* Copy the dropfile to the door directory
* make DosBox not use an X11 window,
* ensure that the dropfiles have DOS line endings
* launch DosBox with the command to start the batch file in the next section.
Here is an example script I use for Freshwater Fishing:
#!/bin/bash
export SDL_VIDEODRIVER="dummy"
NODE=$1
SOCKET=$2
NODE=$2
PORT=$1
trap '' 2
if [ ! -e /home/pi/MagickaBBS/doors/ffs.inuse ]; then
touch /home/pi/MagickaBBS/doors/ffs.inuse
cp /home/pi/MagickaBBS/node${NODE}/door.sys /home/pi/MagickaBBS/doors/ffs/
/usr/local/bin/dosbox -socket $SOCKET -c "C:\ffs\ffs.bat ${NODE}" -conf /home/pi/MagickaBBS/doors/dosbox.conf
rm /home/pi/MagickaBBS/doors/ffs.inuse
fi
cp /home/pi/MagickaBBS/node${NODE}/door.sys /home/pi/MagickaBBS/doors/ffs/
/usr/local/bin/dosbox -c "C:\ffs\ffs.bat ${NODE}" -conf /home/pi/MagickaBBS/doors/dosbox-ffs.conf
trap 2
This will just dump the user back to the BBS if the door is in use. You could get fancy and use the 'inuse' door I created which will display an in-use message and then quit ([INUSE Door](https://github.com/apamment/inuse)), but that is outside the scope of this document.
You will also need to make the bash script executable:
chmod +x ffs.sh
## Create Shell Script to Invoke the DosBox Shim
#!/bin/bash
if [ ! -e /home/pi/MagickaBBS/doors/ffs.inuse ]; then
touch /home/pi/MagickaBBS/doors/ffs.inuse
/home/pi/MagickaBBS/utils/dosbox_shim/shim 9999 $NODE /home/andrew/MagickaBBS/doors/ffs.sh
rm /home/pi/MagickaBBS/doors/ffs.inuse
fi
This will just dump the user back to the BBS if the door is in use. You could get fancy and use the 'inuse' door I created which will display an in-use message and then quit ([INUSE Door](https://github.com/apamment/inuse)), but that is outside the scope of this document.
Again be sure to change the port to match the dosbox config for this door.
## Create Batch File to Start Door
Please note, you will need to setup your doors using DosBox in the normal fashion, either you set them up on a machine where you have a monitor attached and transfer the files over, or you run DosBox directly from your PI with either remote X11 or a local monitor.
@ -101,13 +108,13 @@ This loads BNU, then launches the door with the drop file.
## Setup BBS
Finally, you will want to setup your BBS to call the script you made in Step 6. You also need to pass the node number and socket handle.
Finally, you will want to setup your BBS to call the dosbox shim script.
In doors.ini, something like
[Freshwater Fishing]
command = /home/pi/MagickaBBS/doors/ffs.sh
stdio = false
command = /home/pi/MagickaBBS/doors/ffs-shim.sh
stdio = true
codepage = CP437
Then, add a command to your doors menu: