Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also .

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also .
Choose a Base Repository
taisel/IodineGBA
2005wind/IodineGBA
544/IodineGBA
9on/IodineGBA
AllenWooooo/IodineGBA
Amazingcup/IodineGBA
AntonyChurch/IodineGBA
ArozePhantom/IodineGBA
Beagon/IodineGBA
Cealor/IodineGBA
CodeNinjaResearch/IodineGBA
Coderoversially/IodineGBA
DabanC/IodineGBA
Daniel-Griffiths/IodineGBA
Enthri/IodineGBA
EuphoricPenguin/IodineGBA
FBuenoD/IodineGBA
GDXN/IodineGBA
Ga3u/IodineGBA
GavinHwa/IodineGBA
Gigabait/IodineGBA
GodOfKnockers/IodineGBA
Gokoucjp/IodineGBA
HS1008/IodineGBA
HansHoogerwerf/IodineGBA
HungryAnt/IodineGBA
JeffZhang02747/IodineGBA
Jia731/IodineGBA
KevenYoung/IodineGBA
Lawkapala/IodineGBA
LyuGGang/IodineGBA
MadballNeek/IodineGBA
MoodyKSA/IodineGBA
MustangSVT/IodineGBA
MyComputableRomance/IodineGBA
NAscriland/IodineGBA
NerdTaco/IodineGBA
Onimishra/IodineGBA
Patrique/IodineGBA
PiMiner/IodineGBA
PlayBoyMan/IodineGBA
PokeMaster843/IodineGBA
SUSaiyan/IodineGBA
ScreensPull/IodineGBA
SinSiXX/IodineGBA
SirPyros/IodineGBA
SourceBackups/IodineGBA
SupinfoGameDev/IodineGBA
TheMuffinGroup/IodineGBA
UFBin/IodineGBA
UnblockedEvrything/IodineGBAss
Veldmuus/IodineGBA
Weej1/IodineGBA
Woodu/IodineGBA
Z73/IodineGBA
aidanharris/IodineGBA
akan/IodineGBA
anycall/IodineGBA
awesomesnorlax123/IodineGBA
ayunami2000/IodineGBA
beartung/IodineGBA
bitnetwork/IodineGBA
boxu2104/IodineGBA
buliaoyin/IodineGBA
byerancy/IodineGBA
carriercomm/IodineGBA
chrisbrasington/IodineGBA
cinco/IodineGBA
ckosmic/IodineGBA
codeKonami/IodineGBA
dasjack/IodineGBA
dbledayr/IodineGBA
durtin/IodineGBA
earthbound2/game
exaphaser/IodineGBA
faquino/IodineGBA
genghanqiang/IodineGBA
gitblazer/IodineGBA
gzzhanghao/IodineGBA
hattoriheiji/IodineGBA
hetaay3000/IodineGBA
himacro/IodineGBA
hohhen/IodineGBA
hollowsxd/IodineGBA
houcy/IodineGBA
hybomyth/IodineGBA
iBaozi/IodineGBA
itachi1706/IodineGBA
jacobzipper/IodineGBA
jaspal29/IodineGBA
jbmorley/IodineGBA
john0909/IodineGBA
johncant/IodineGBA
josejamilena/IodineGBA
jparral/IodineGBA
junior-2016/IodineGBA
karliky/IodineGBA
kevinchau321/IodineGBA
kingp02/IodineGBA
klarkc/IodineGBA
linktlh/IodineGBA
longbai/IodineGBA
lukw00/IodineGBA
mastahype/IodineGBA
matheus013/IodineGBA
matthewdlin/IodineGBA
mercuriallee/IodineGBA
mukundr99daboss/IodineGBA
neverwell/IodineGBA
nora55974/IodineGBA
nuet/IodineGBA
nullice/IodineGBA
nullmeme/IodineGBA
oVexlz/IodineGBA
oldway520/IodineGBA
pejonic/IodineGBA
pengqin/IodineGBA
pharazone/IodineGBA
plirof/IodineGBA
pohotu3/IodineGBA
ppmmaiwo/IodineGBA
qunwang6/IodineGBA
raceli/IodineGBA
roachhd/IodineGBA
rockyjvec/IodineGBA
rub8n/IodineGBA
ryanlapeyre/IodineGBA
shadowxh/gba
shaunstanislaus/IodineGBA
shingenko/IodineGBA
shitfSign/IodineGBA
shouhei/IodineGBA
softcup/IodineGBA
soyleung/IodineGBA
studywithyou/IodineGBA
takutok/IodineGBA
tanerdamaner/IodineGBA
the-cc-dev/IodineGBA
transparentmask/IodineGBA
tsantos013/IodineGBA
universeroc/IodineGBA
watsonlu/IodineGBA
windf/IodineGBA
wladi0097/SwitchGBA
wrgbh446/IodineGBA
wxtry/IodineGBA
xj-coder/IodineGBA
yangshihit/IodineGBA
yantian001/IodineGBA
yhrC/IodineGBA
yingnansong/IodineGBA
yiyuezhuo/IodineGBA
zackteng/IodineGBA
zanhsieh/IodineGBA
zhaohuaw/IodineGBA
Nothing to show
Choose a base branch
Nothing to show
Choose a Head Repository
taisel/IodineGBA
2005wind/IodineGBA
544/IodineGBA
9on/IodineGBA
AllenWooooo/IodineGBA
Amazingcup/IodineGBA
AntonyChurch/IodineGBA
ArozePhantom/IodineGBA
Beagon/IodineGBA
Cealor/IodineGBA
CodeNinjaResearch/IodineGBA
Coderoversially/IodineGBA
DabanC/IodineGBA
Daniel-Griffiths/IodineGBA
Enthri/IodineGBA
EuphoricPenguin/IodineGBA
FBuenoD/IodineGBA
GDXN/IodineGBA
Ga3u/IodineGBA
GavinHwa/IodineGBA
Gigabait/IodineGBA
GodOfKnockers/IodineGBA
Gokoucjp/IodineGBA
HS1008/IodineGBA
HansHoogerwerf/IodineGBA
HungryAnt/IodineGBA
JeffZhang02747/IodineGBA
Jia731/IodineGBA
KevenYoung/IodineGBA
Lawkapala/IodineGBA
LyuGGang/IodineGBA
MadballNeek/IodineGBA
MoodyKSA/IodineGBA
MustangSVT/IodineGBA
MyComputableRomance/IodineGBA
NAscriland/IodineGBA
NerdTaco/IodineGBA
Onimishra/IodineGBA
Patrique/IodineGBA
PiMiner/IodineGBA
PlayBoyMan/IodineGBA
PokeMaster843/IodineGBA
SUSaiyan/IodineGBA
ScreensPull/IodineGBA
SinSiXX/IodineGBA
SirPyros/IodineGBA
SourceBackups/IodineGBA
SupinfoGameDev/IodineGBA
TheMuffinGroup/IodineGBA
UFBin/IodineGBA
UnblockedEvrything/IodineGBAss
Veldmuus/IodineGBA
Weej1/IodineGBA
Woodu/IodineGBA
Z73/IodineGBA
aidanharris/IodineGBA
akan/IodineGBA
anycall/IodineGBA
awesomesnorlax123/IodineGBA
ayunami2000/IodineGBA
beartung/IodineGBA
bitnetwork/IodineGBA
boxu2104/IodineGBA
buliaoyin/IodineGBA
byerancy/IodineGBA
carriercomm/IodineGBA
chrisbrasington/IodineGBA
cinco/IodineGBA
ckosmic/IodineGBA
codeKonami/IodineGBA
dasjack/IodineGBA
dbledayr/IodineGBA
durtin/IodineGBA
earthbound2/game
exaphaser/IodineGBA
faquino/IodineGBA
genghanqiang/IodineGBA
gitblazer/IodineGBA
gzzhanghao/IodineGBA
hattoriheiji/IodineGBA
hetaay3000/IodineGBA
himacro/IodineGBA
hohhen/IodineGBA
hollowsxd/IodineGBA
houcy/IodineGBA
hybomyth/IodineGBA
iBaozi/IodineGBA
itachi1706/IodineGBA
jacobzipper/IodineGBA
jaspal29/IodineGBA
jbmorley/IodineGBA
john0909/IodineGBA
johncant/IodineGBA
josejamilena/IodineGBA
jparral/IodineGBA
junior-2016/IodineGBA
karliky/IodineGBA
kevinchau321/IodineGBA
kingp02/IodineGBA
klarkc/IodineGBA
linktlh/IodineGBA
longbai/IodineGBA
lukw00/IodineGBA
mastahype/IodineGBA
matheus013/IodineGBA
matthewdlin/IodineGBA
mercuriallee/IodineGBA
mukundr99daboss/IodineGBA
neverwell/IodineGBA
nora55974/IodineGBA
nuet/IodineGBA
nullice/IodineGBA
nullmeme/IodineGBA
oVexlz/IodineGBA
oldway520/IodineGBA
pejonic/IodineGBA
pengqin/IodineGBA
pharazone/IodineGBA
plirof/IodineGBA
pohotu3/IodineGBA
ppmmaiwo/IodineGBA
qunwang6/IodineGBA
raceli/IodineGBA
roachhd/IodineGBA
rockyjvec/IodineGBA
rub8n/IodineGBA
ryanlapeyre/IodineGBA
shadowxh/gba
shaunstanislaus/IodineGBA
shingenko/IodineGBA
shitfSign/IodineGBA
shouhei/IodineGBA
softcup/IodineGBA
soyleung/IodineGBA
studywithyou/IodineGBA
takutok/IodineGBA
tanerdamaner/IodineGBA
the-cc-dev/IodineGBA
transparentmask/IodineGBA
tsantos013/IodineGBA
universeroc/IodineGBA
watsonlu/IodineGBA
windf/IodineGBA
wladi0097/SwitchGBA
wrgbh446/IodineGBA
wxtry/IodineGBA
xj-coder/IodineGBA
yangshihit/IodineGBA
yantian001/IodineGBA
yhrC/IodineGBA
yingnansong/IodineGBA
yiyuezhuo/IodineGBA
zackteng/IodineGBA
zanhsieh/IodineGBA
zhaohuaw/IodineGBA
Nothing to show
Choose a head branch
Nothing to show
Checking mergeability… Don’t worry, you can still create the pull request.
  • 4 commits
  • 4 files changed
  • 0 commit comments
  • 1 contributor
Commits on Oct 26, 2017
Commits on Oct 27, 2017
Commits on Oct 30, 2017
Showing with 71 additions and 1 deletion.
  1. +1 −1 .gitmodules
  2. +68 −0 gamepad.js
  3. BIN gba_bios.tar.xz
  4. +2 −0 index.html
View
@@ -1,3 +1,3 @@
[submodule "user_scripts/XAudioJS"]
path = user_scripts/XAudioJS
- url = https://github.com/taisel/XAudioJS.git
+ url = https://github.com/mercuriallee/XAudioJS.git
View
@@ -0,0 +1,68 @@
+const Gamepad2keyboard = {'1':88, '2':90, '3':16, '4':65, '5':83, '9':13, '10':80, '14':38, '15':40, '16':37, '17':39};
+const Arrows = [16, 17, 14, 15];
+var Frame_Num = 60;
+function remapGamePad(states={axis_i:-1,buttons:[]}) {
+ let gp = window.navigator.getGamepads()[0];
+ if(gp) {
+ for(let i=0; i<gp.buttons.length; i++) {
+ if(gp.buttons[i].pressed) {
+ if(!states['buttons'][i]) gamepadKeyDown(i);
+ states['buttons'][i] = true;
+ } else {
+ if(states['buttons'][i]) gamepadKeyUp(i);
+ states['buttons'][i] = false;
+ }
+ }
+ //arrow_index: [left, right, up, down];
+ let axes = [gp.axes[0],gp.axes[1]];
+ let [arrow_index, arrow_value] = axes.reduce((i_m,e,i)=>Math.abs(i_m[1])<Math.abs(e)?[i,e]:i_m,[-1,0]);
+ if(arrow_value > 0 ) {
+ arrow_index = 2*arrow_index+1;
+ } else {
+ arrow_index = 2*arrow_index;
+ }
+ if(Math.abs(arrow_value) < 0.5) {
+ if(states.axis_i !== -1) {
+ gamepadKeyUp(Arrows[states.axis_i]);
+ states.axis_i = -1;
+ }
+ }
+ else if(states.axis_i !== arrow_index) {
+ gamepadKeyUp(Arrows[states.axis_i]);
+ gamepadKeyDown(Arrows[arrow_index]);
+ states.axis_i = arrow_index;
+ }
+ }
+ setTimeout(function(){remapGamePad(states)}, 1000/Frame_Num);
+}
+
+function gamepadKeyDown(num) {
+ if (typeof num !== 'number') return;
+ console.log('Key '+num+' Down.')
+ if(Gamepad2keyboard[num]) {
+ simulateKeyPress(Gamepad2keyboard[num], 'keydown');
+ }
+}
+function gamepadKeyUp(num) {
+ if (typeof num !== 'number') return;
+ console.log('Key '+num+' Up.')
+ if(Gamepad2keyboard[num]) {
+ simulateKeyPress(Gamepad2keyboard[num], 'keyup');
+ }
+}
+
+function simulateKeyPress(keycode,state) {
+ let e = new Event(state);
+ //e.key=keychar; // just enter the char you want to send
+ e.keyCode=keycode;
+ e.which=e.keyCode;
+ e.altKey=false;
+ e.ctrlKey=false;
+ e.shiftKey=false;
+ e.metaKey=false;
+ e.bubbles=true;
+ document.dispatchEvent(e);
+}
+
+remapGamePad();
+
View
Binary file not shown.
View
@@ -65,6 +65,8 @@
<script src="user_scripts/XAudioJS/swfobject.js"></script>
<script src="user_scripts/XAudioJS/resampler.js"></script>
<script src="user_scripts/XAudioJS/XAudioServer.js"></script>
+
+ <script src="./gamepad.js"></script>
<link rel="stylesheet" href="user_css/main.css">
</head>
<body>

No commit comments for this range