Browse Source

stuff

master
mortie 3 years ago
parent
commit
48877b6643
8 changed files with 245 additions and 197 deletions
  1. 1
    0
      .gitignore
  2. 213
    0
      emuconf/vba/vba.cfg
  3. 0
    191
      emuconf/vbam/vbam.conf
  4. 1
    2
      js/emulate.js
  5. 7
    0
      run.sh
  6. 22
    0
      scripts/esc-button.py
  7. 1
    2
      scripts/keymap.sh
  8. 0
    2
      server.js

+ 1
- 0
.gitignore View File

@@ -1,2 +1,3 @@
udev/udev-monitor
node_modules
*.swp

+ 213
- 0
emuconf/vba/vba.cfg View File

@@ -0,0 +1,213 @@
# All numeric values are in hexadecimal
# Use TAB or EQUAL sign to separate name from value

#
# Key configuration (all numbers are in hexadecimal!)
#
# Keys values are in the format YXXX where Y is the device number. 0 means
# keyborad and XXX is the SDL define for the desired key (read SDL_keysym.h).
#
# If Y is greater than 0, it means joystick number Y-1 and it uses the
# following format for XXX:
#
# - if XXX < 20, XXX is the axis number multiplied by 2. An even number means
# movement to the negative side (on the X axis, it means left). An odd
# number means movement to the positive side (on the X axis, it mean
# right). For the Y axis, negative means up and positive means down.
# X axis is usally axis number 0 and Y is axis number 1.
# - if 20 >= XXX > 30, then XXX is the HAT number multiplied by 4 plus the
# direction: 0 for up, 1 for down, 2 for right and 3 for left. Example:
# 0021 is HAT 0 down, 0026 is HAT 1 right.
# - if 80 >= XXX > 100, XXX is the joystick button number (XXX-080).
#
# Default key configuration is (value in parenthesis):
#
# Left Left Arrow (0114)
# Right Right Arrow (0113)
# Up Up Arrow (0111)
# Down Down Arrow (0112)
# A Z (007a)
# B X (0078)
# L A (0061)
# R S (0073)
# Start ENTER (000d)
# Select BACKSPACE (0008)
# Speed up SPACE (0020)
# Capture F12 (0125)
#
Joy0_Left=0114
Joy0_Right=0113
Joy0_Up=0111
Joy0_Down=0112
Joy0_A=0061
Joy0_B=0062
Joy0_L=006c
Joy0_R=0072
Joy0_Start=000d
Joy0_Select=0008
Joy0_Speed=0078
Joy0_Capture=0125

# Motion support keys. Same format as above
#
# Default keys are (value in parenthesis):
#
# Left Numeric Pad 4 (0104)
# Right Numeric Pad 6 (0106)
# Up Numeric Pad 8 (0108)
# Down Numeric Pad 2 (0102)
#
Motion_Left=0104
Motion_Right=0106
Motion_Up=0108
Motion_Down=0102

# Frame skip setting. Allowed values are from 0 to 5 only.
frameSkip=0

# Gameboy Frame skip setting. Allowed values are from 0 to 5 only.
gbFrameSkip=0

# Video setting. 0=1x, 1=2x, 2=3x, 3=4x.
video=2

# Use fullscreen mode. 0=false, any other value means true
fullScreen=1

# Disables MMX support
disableMMX=1

# Use bios file. 0=false, any other value means true
useBios=0

# Bios file full path and name (ZIP not supported)
biosFile=none

# Filter to use. 0=no filter, 1=TV Mode, 2=2xSaI, 3=Super 2xSaI, 4=Super Eagle
# 5=Pixelate, 6=Motion Blur, 7=AdvanceMAME Scale2x, 8=Simple 2x,
# 9=Bilinear, A=Bilinear Plus, B=hq2x, C=lq2x
filter=0

# Disable status messages. 0=false, any other value means true
disableStatus=1

# Enable Gameboy border. 0=false, any other value means true
borderOn=0

# Gameboy emulator type. 0=automatic, 1=CGB/GBC, 2=SGB, 3=GB, 4=GBA, 5=SGB2
emulatorType=0

# Enable washed colors. 0=false, any other value means true
colorOption=0

# Directories. Not setting one them makes the file go the rom directory.

# Save state directory
#saveDir=

# Screen shot Capture directory
#captureDir=

# Battery directory
#batteryDir=

# Screen capture format
# 0=PNG, anything else for BMP
captureFormat=0

# Sound quality
# 1=44 Khz, 2=22Khz, 4=11Khz
soundQuality=2

# Sound Echo
# 0=false, anything else for true
soundEcho=0

# Sound Low pass filter
# 0=false, anything else for true
soundLowPass=0

# Sound reverse stereo
# 0=false, anything else for true
soundReverse=0

# Remove GBA intros (not supported anymore)
# 0=false, anything else for true
# removeIntros=0

# Save Type
# 0=automatic, 1=EEPROM, 2=SRAM, 3=Flash, 4=EEPROM+Sensor, 5=NONE
saveType=0

# Flash size
# 0=64K Flash, 1=128K Flash

flashSize=0

# Sound volume
# 0=1x, 1=2x, 2=3x, 3=4x
soundVolume=0

# Interframe blending
# 0=none, 1=motion blur, 2=smart
ifbType=0

# Show emulation speed
# 0=none, 1=percentage, 2=detailed
showSpeed=0

# Show speed in transparent mode
# 0=normal, anything else for transparent
showSpeedTransparent=0

# Enable/Disable auto frameskip
# 0=disable, anything else to enable
autoFrameSkip=0

# Sets the desired throttle
# 0=disable, 5...1000 valid throttle speeds
throttle=0

# Pauses the emulator when the window is inactive
# 0=disable, anything else to enable
pauseWhenInactive=0

# Enables AGBPrint support
# 0=disable, anything else to enable
agbPrint=0

# Enables GBA RTC support
# 0=disable, anything else to enable
rtcEnabled=0

# Sound OFF flag
# 0=sound on, anything else turns off sound
soundOff=0

# Sound Enable
# Controls which channels are enabled: (add values)
# 1 - Channel 1
# 2 - Channel 2
# 4 - Channel 3
# 8 - Channel 4
# 100 - DirectSound A
# 200 - DirectSound B
# 30f=all enabled, 0=mute all
soundEnable=30f

# Controls automatic SGB border
# 0=disable, anything else enables automatic SGB border display
borderAutomatic=0

# Skip bios code
# 0=disable, anything else skips BIOS code
skipBios=0

# The interval between the rewind saves
# Minimum of 0 seconds to disable rewind support,
# Maximum of 60 minutes. Value in seconds (hexadecimal numbers)
rewindTimer=0

# Enable enhanced save type detection
# 0=disable, anything else to enable (no longer used)
#enhancedDetection=1

+ 0
- 191
emuconf/vbam/vbam.conf View File

@@ -1,191 +0,0 @@
[Display]
Bilinear=1
Filter=none
FilterPlugin=
IFB=none
KeepOnTop=0
MaxThreads=4
RenderMethod=simple
Scale=3
Stretch=1
[GB]
BiosFile=
GBCBiosFile=
GBCROMDir=
PrintAutoPage=1
PrintScreenCap=0
ROMDir=
Palette0=7FFF,56B5,318C,0000,7FFF,56B5,318C,0000
Palette1=7FFF,56B5,318C,0000,7FFF,56B5,318C,0000
Palette2=7FFF,56B5,318C,0000,7FFF,56B5,318C,0000
[GBA]
BiosFile=
LinkAuto=0
LinkFast=0
LinkHost=
LinkProto=0
LinkTimeout=1
LinkType=0
ROMDir=
[General]
AutoLoadLastState=0
BatteryDir=
FreezeRecent=0
OnlineUpdates=daily
RecordingDir=
RewindInterval=0
ScreenshotDir=
StateDir=
StatusBar=0
[Joypad]
AutofireThrottle=1
Default=1
[Joypad/1]
Up=Up
Down=Down
Left=Left
Right=Right
A=X
B=Z
L=A
R=S
Select=
Start=Enter
MotionUp=
MotionDown=
MotionLeft=
MotionRight=
MotionIn=
MotionOut=
AutoA=W
AutoB=Q
Speed=Space
Capture=F11
GS=
[Joypad/2]
Up=
Down=
Left=
Right=
A=
B=
L=
R=
Select=
Start=
MotionUp=
MotionDown=
MotionLeft=
MotionRight=
MotionIn=
MotionOut=
AutoA=
AutoB=
Speed=
Capture=
GS=
[Joypad/3]
Up=
Down=
Left=
Right=
A=
B=
L=
R=
Select=
Start=
MotionUp=
MotionDown=
MotionLeft=
MotionRight=
MotionIn=
MotionOut=
AutoA=
AutoB=
Speed=
Capture=
GS=
[Joypad/4]
Up=
Down=
Left=
Right=
A=
B=
L=
R=
Select=
Start=
MotionUp=
MotionDown=
MotionLeft=
MotionRight=
MotionIn=
MotionOut=
AutoA=
AutoB=
Speed=
Capture=
GS=
[Sound]
AudioAPI=sdl
Buffers=5
Enable=783
GBAFiltering=50
GBAInterpolation=1
GBDeclicking=1
GBEcho=20
GBEnableEffects=0
GBStereo=15
GBSurround=0
Quality=44
Volume=100
[preferences]
LinkNumPlayers=2
agbPrint=0
autoFrameSkip=0
autoPatch=1
autoSaveCheatList=1
borderAutomatic=0
borderOn=0
captureFormat=0
cheatsEnabled=0
disableStatus=0
emulatorType=1
flashSize=0
frameSkip=0
fsColorDepth=32
fsFrequency=60
fsHeight=600
fsWidth=800
fullScreen=1
gbPaletteOption=0
gbPrinter=0
gdbBreakOnLoad=0
gdbPort=55555
maxScale=0
pauseWhenInactive=1
rtcEnabled=0
saveType=0
showSpeed=0
showSpeedTransparent=1
skipBios=0
skipSaveGameBattery=0
skipSaveGameCheats=0
throttle=100
useBiosGB=0
useBiosGBA=0
useBiosGBC=0
vsync=0
[Recent]
file1=roms/1986 - Pokemon Emerald (U)(TrashMan).gba
file2=/home/martin/Downloads/1986 - Pokemon Emerald (U)(TrashMan).gba
file3=
file4=
file5=
file6=
file7=
file8=
file9=
file10=

+ 1
- 2
js/emulate.js View File

@@ -15,8 +15,7 @@ async function cpconf(from, to) {
}

async function run_visualboy(path, saves) {
await cpconf("vbam", ".vbam");
await shell.safe("vbam", "-F", path);
await shell.safe("vba", "--config", "emuconf/vba/vba.cfg", path);
}

async function run_desmume(path, saves) {

+ 7
- 0
run.sh View File

@@ -0,0 +1,7 @@
#!/bin/sh

cd $(dirname "$0")
chromium-browser --kiosk --app="file://$(pwd)/web/index.html" &
./scripts/esc-button.py &
./scripts/keymap.sh &
node server.js

+ 22
- 0
scripts/esc-button.py View File

@@ -0,0 +1,22 @@
#!/usr/bin/env python

from RPi import GPIO
import time
from subprocess import call

GPIO.setmode(GPIO.BCM)
GPIO.setup(3, GPIO.IN)

pressed = False

while True:
current = not GPIO.input(3)

if current and not pressed:
call(["xdotool", "keydown", "Escape"])
pressed = True
elif not current and pressed:
call(["xdotool", "keyup", "Escape"])
pressed = False

time.sleep(0.1)

+ 1
- 2
scripts/keymap.sh View File

@@ -1,6 +1,5 @@
#!/bin/sh

mkdir -p ~/.qjoypad ~/.qjoypad3
cp "$(dirname $0)/snes.lyt" ~/.qjoypad/snes.lyt
mkdir -p ~/.qjoypad3
cp "$(dirname $0)/snes.lyt" ~/.qjoypad3/snes.lyt
qjoypad snes

+ 0
- 2
server.js View File

@@ -32,8 +32,6 @@ function updateGames() {
}
}

shell.safe("./scripts/keymap.sh");

var driveMounted = false;
async function onblock(evt) {
if (evt.DEVTYPE !== "partition")

Loading…
Cancel
Save