Update gameboy

This commit is contained in:
giongto35 2019-04-09 00:05:43 +08:00
parent 5564945e61
commit b7fbbe7299
4 changed files with 3 additions and 4 deletions

View file

@ -318,7 +318,6 @@ func faninInput(inputChannel chan int, webRTC *webrtc.WebRTC, playerIndex int) {
// encode frame
if webRTC.IsConnected() {
input := <-webRTC.InputChannel
fmt.Println("received", input)
// the first 10 bits belong to player 1
// the next 10 belongs to player 2 ...
// We standardize and put it to inputChannel (20 bytes)

0
static/index.html Normal file
View file

View file

@ -78,9 +78,9 @@ KEY_MAP = {
67: "start", // c
86: "select", // v
81: "quit" // q
81: "quit", // q
83: "save", // s
76: "load", // l
76: "load" // l
}
/*

View file

@ -108,7 +108,7 @@ function sendInput() {
// prepare key
if (stateUnchange || unchangePacket > 0) {
st = "";
KEY_BIT.reverse().forEach(elem => {
KEY_BIT.slice().reverse().forEach(elem => {
st += keyState[elem] ? 1 : 0;
});
ss = parseInt(st, 2);