Skip to content

Commit

Permalink
Update cores
Browse files Browse the repository at this point in the history
  • Loading branch information
giongto35 committed Aug 3, 2019
1 parent ad82e22 commit 0539e89
Show file tree
Hide file tree
Showing 13 changed files with 15 additions and 14 deletions.
1 change: 1 addition & 0 deletions Dockerfile
Expand Up @@ -5,6 +5,7 @@ RUN apt-get update
RUN apt-get install pkg-config libvpx-dev libopus-dev libopusfile-dev -y RUN apt-get install pkg-config libvpx-dev libopus-dev libopusfile-dev -y


RUN mkdir -p /cloud-game RUN mkdir -p /cloud-game
VOLUME /home/thanh/Desktop/Code/cloud-game/games:/cloud-game/games
COPY . /cloud-game/ COPY . /cloud-game/
WORKDIR /cloud-game WORKDIR /cloud-game


Expand Down
2 changes: 1 addition & 1 deletion README.md
@@ -1,5 +1,5 @@
# Web-based Cloud Gaming Service # Web-based Cloud Gaming Service
- [http://cloud.webgame2d.com](http://cloud.webgame2d.com) - [http://cloudretro.io](http://cloudretro.io)


- [**Game Instruction**](document/instruction/) - [**Game Instruction**](document/instruction/)
For the best gaming experience, please select the closest region to you. For the best gaming experience, please select the closest region to you.
Expand Down
Binary file removed klog
Binary file not shown.
Binary file removed libretro/core/testdata/Polar Rescue (USA).vec
Binary file not shown.
Binary file removed libretro/core/testdata/Polar Rescue (USA).zip
Binary file not shown.
Binary file removed libretro/core/testdata/vecx_libretro.dll
Binary file not shown.
Binary file removed libretro/core/testdata/vecx_libretro.dylib
Binary file not shown.
Binary file removed libretro/core/testdata/vecx_libretro.so
Binary file not shown.
12 changes: 9 additions & 3 deletions libretro/nanoarch/naemulator.go
Expand Up @@ -66,8 +66,12 @@ var NAEmulator *naEmulator


// TODO: Load from config // TODO: Load from config
var emulatorCorePath = map[string]string{ var emulatorCorePath = map[string]string{
"gba": "libretro/cores/mgba_libretro.so", "gba": "libretro/cores/mgba_libretro.so",
"pcsx": "libretro/cores/pcsx_rearmed_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) // NAEmulator implements CloudEmulator interface based on NanoArch(golang RetroArch)
Expand All @@ -94,9 +98,11 @@ func (na *naEmulator) listenInput() {
// we decode the bitmap and send to channel // we decode the bitmap and send to channel
for inpBitmap := range NAEmulator.inputChannel { for inpBitmap := range NAEmulator.inputChannel {
for k := 0; k < len(na.keys); k++ { for k := 0; k < len(na.keys); k++ {
key := bindRetroKeys[k]
if (inpBitmap & 1) == 1 { if (inpBitmap & 1) == 1 {
key := bindRetroKeys[k]
na.keys[key] = true na.keys[key] = true
} else {
na.keys[key] = false
} }
inpBitmap >>= 1 inpBitmap >>= 1
} }
Expand Down
4 changes: 0 additions & 4 deletions libretro/nanoarch/nanoarch.go
Expand Up @@ -187,10 +187,6 @@ func coreInputPoll() {
for i := range NAEmulator.keys { for i := range NAEmulator.keys {
joy[i] = NAEmulator.keys[i] joy[i] = NAEmulator.keys[i]
} }

for i := range NAEmulator.keys {
NAEmulator.keys[i] = false
}
} }


//export coreInputState //export coreInputState
Expand Down
5 changes: 0 additions & 5 deletions overlord/handlers.go
Expand Up @@ -61,11 +61,6 @@ func (o *Server) GetWeb(w http.ResponseWriter, r *http.Request) {
log.Fatal(err) log.Fatal(err)
} }


//bs, err := ioutil.ReadFile(indexFN)
//if err != nil {
//log.Fatal(err)
//}
//w.Write(bs)
tmpl.Execute(w, data) tmpl.Execute(w, data)
} }


Expand Down
2 changes: 1 addition & 1 deletion run_local_docker.sh
Expand Up @@ -3,4 +3,4 @@ docker build . -t cloud-game-local
docker stop cloud-game-local docker stop cloud-game-local
docker rm cloud-game-local docker rm cloud-game-local
# Overlord and worker should be run separately. Local is for demo purpose # 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"
3 changes: 3 additions & 0 deletions worker/room/room.go
Expand Up @@ -123,6 +123,9 @@ func getEmulator(gameName string, roomID string, imageChannel chan<- *image.RGBA
case "bin": case "bin":
nanoarch.Init("pcsx", roomID, imageChannel, audioChannel, inputChannel) nanoarch.Init("pcsx", roomID, imageChannel, audioChannel, inputChannel)
return nanoarch.NAEmulator return nanoarch.NAEmulator
case "zip":
nanoarch.Init("mame", roomID, imageChannel, audioChannel, inputChannel)
return nanoarch.NAEmulator
} }


return nil return nil
Expand Down

0 comments on commit 0539e89

Please sign in to comment.