diff --git a/Dockerfile b/Dockerfile index 4c1e545d..d6063cb5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,6 +5,7 @@ RUN apt-get update RUN apt-get install pkg-config libvpx-dev libopus-dev libopusfile-dev -y RUN mkdir -p /cloud-game +VOLUME /home/thanh/Desktop/Code/cloud-game/games:/cloud-game/games COPY . /cloud-game/ WORKDIR /cloud-game diff --git a/README.md b/README.md index 60ee1424..a0e493a6 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ # Web-based Cloud Gaming Service -- [http://cloud.webgame2d.com](http://cloud.webgame2d.com) +- [http://cloudretro.io](http://cloudretro.io) - [**Game Instruction**](document/instruction/) For the best gaming experience, please select the closest region to you. diff --git a/klog b/klog deleted file mode 100755 index 91016404..00000000 Binary files a/klog and /dev/null differ diff --git a/libretro/core/testdata/Polar Rescue (USA).vec b/libretro/core/testdata/Polar Rescue (USA).vec deleted file mode 100755 index 9dae3e42..00000000 Binary files a/libretro/core/testdata/Polar Rescue (USA).vec and /dev/null differ diff --git a/libretro/core/testdata/Polar Rescue (USA).zip b/libretro/core/testdata/Polar Rescue (USA).zip deleted file mode 100644 index f7f970df..00000000 Binary files a/libretro/core/testdata/Polar Rescue (USA).zip and /dev/null differ diff --git a/libretro/core/testdata/vecx_libretro.dll b/libretro/core/testdata/vecx_libretro.dll deleted file mode 100755 index f07a39fc..00000000 Binary files a/libretro/core/testdata/vecx_libretro.dll and /dev/null differ diff --git a/libretro/core/testdata/vecx_libretro.dylib b/libretro/core/testdata/vecx_libretro.dylib deleted file mode 100755 index b58f5350..00000000 Binary files a/libretro/core/testdata/vecx_libretro.dylib and /dev/null differ diff --git a/libretro/core/testdata/vecx_libretro.so b/libretro/core/testdata/vecx_libretro.so deleted file mode 100755 index 5f0b84eb..00000000 Binary files a/libretro/core/testdata/vecx_libretro.so and /dev/null differ diff --git a/libretro/nanoarch/naemulator.go b/libretro/nanoarch/naemulator.go index d5fa408c..aac900d4 100644 --- a/libretro/nanoarch/naemulator.go +++ b/libretro/nanoarch/naemulator.go @@ -66,8 +66,12 @@ var NAEmulator *naEmulator // TODO: Load from config var emulatorCorePath = map[string]string{ - "gba": "libretro/cores/mgba_libretro.so", - "pcsx": "libretro/cores/pcsx_rearmed_libretro.so", + "gba": "libretro/cores/mgba_libretro.so", + //"pcsx": "libretro/cores/mednafen_psx_libretro.so", + //"pcsx": "libretro/cores/mednafen_psx_hw_libretro.so", + "pcsx": "libretro/cores/pcsx_rearmed_libretro.so", + "arcade": "libretro/cores/fbalpha2012_neogeo_libretro.so", + "mame": "libretro/cores/mame2016_libretro.so", } // NAEmulator implements CloudEmulator interface based on NanoArch(golang RetroArch) @@ -94,9 +98,11 @@ func (na *naEmulator) listenInput() { // we decode the bitmap and send to channel for inpBitmap := range NAEmulator.inputChannel { for k := 0; k < len(na.keys); k++ { + key := bindRetroKeys[k] if (inpBitmap & 1) == 1 { - key := bindRetroKeys[k] na.keys[key] = true + } else { + na.keys[key] = false } inpBitmap >>= 1 } diff --git a/libretro/nanoarch/nanoarch.go b/libretro/nanoarch/nanoarch.go index 1c95e7ca..ea075e2f 100644 --- a/libretro/nanoarch/nanoarch.go +++ b/libretro/nanoarch/nanoarch.go @@ -187,10 +187,6 @@ func coreInputPoll() { for i := range NAEmulator.keys { joy[i] = NAEmulator.keys[i] } - - for i := range NAEmulator.keys { - NAEmulator.keys[i] = false - } } //export coreInputState diff --git a/overlord/handlers.go b/overlord/handlers.go index be1a7dbc..12542a0e 100644 --- a/overlord/handlers.go +++ b/overlord/handlers.go @@ -61,11 +61,6 @@ func (o *Server) GetWeb(w http.ResponseWriter, r *http.Request) { log.Fatal(err) } - //bs, err := ioutil.ReadFile(indexFN) - //if err != nil { - //log.Fatal(err) - //} - //w.Write(bs) tmpl.Execute(w, data) } diff --git a/run_local_docker.sh b/run_local_docker.sh index 999da164..d2629538 100755 --- a/run_local_docker.sh +++ b/run_local_docker.sh @@ -3,4 +3,4 @@ docker build . -t cloud-game-local docker stop cloud-game-local docker rm cloud-game-local # Overlord and worker should be run separately. Local is for demo purpose -docker run --privileged -d --name cloud-game-local -p 8000:8000 -p 9000:9000 cloud-game-local bash -c "cmd -overlordhost ws://localhost:8000/wso & cmd -overlordhost overlord" +docker run --privileged -v $PWD/games:/cloud-game/games -d --name cloud-game-local -p 8000:8000 -p 9000:9000 cloud-game-local bash -c "cmd -overlordhost ws://localhost:8000/wso & cmd -overlordhost overlord" diff --git a/worker/room/room.go b/worker/room/room.go index 48b07a17..634adb59 100644 --- a/worker/room/room.go +++ b/worker/room/room.go @@ -123,6 +123,9 @@ func getEmulator(gameName string, roomID string, imageChannel chan<- *image.RGBA case "bin": nanoarch.Init("pcsx", roomID, imageChannel, audioChannel, inputChannel) return nanoarch.NAEmulator + case "zip": + nanoarch.Init("mame", roomID, imageChannel, audioChannel, inputChannel) + return nanoarch.NAEmulator } return nil