Permalink
Browse files

Update

Update to latest revision.

Apparently we fixed saving (unload event placed on wrong DOM object).
  • Loading branch information...
jsemu
jsemu committed Jun 26, 2015
1 parent d6d1ea2 commit 9f18eafa1a2b975212fdc8639a2ea3e06a989d67
Showing with 17,833 additions and 16,369 deletions.
  1. +0 −152 IodineGBA/IodineGBA/GameBoyAdvanceJoyPadCore.js
  2. +0 −195 IodineGBA/IodineGBA/graphics/GameBoyAdvanceAffineBGRendererCore.js
  3. +0 −943 IodineGBA/IodineGBA/graphics/GameBoyAdvanceGraphicsRendererCore.js
  4. +0 −39 IodineGBA/IodineGBA/graphics/GameBoyAdvanceMode0RendererCore.js
  5. +0 −38 IodineGBA/IodineGBA/graphics/GameBoyAdvanceMode1RendererCore.js
  6. +0 −37 IodineGBA/IodineGBA/graphics/GameBoyAdvanceMode2RendererCore.js
  7. +0 −40 IodineGBA/IodineGBA/graphics/GameBoyAdvanceModeFrameBufferRendererCore.js
  8. +0 −100 IodineGBA/IodineGBA/graphics/GameBoyAdvanceWindowRendererCore.js
  9. +652 −659 IodineGBA/{IodineGBA/GameBoyAdvanceCPUCore.js → core/CPU.js}
  10. +75 −30 IodineGBA/{IodineGBA/CPU/ARMInstructionSetCore.js → core/CPU/ARM.js}
  11. +7 −14 IodineGBA/{IodineGBA/CPU/ARMCPSRAttributeTable.js → core/CPU/CPSR.js}
  12. +1,492 −1,473 IodineGBA/{IodineGBA/CPU/THUMBInstructionSetCore.js → core/CPU/THUMB.js}
  13. +277 −284 IodineGBA/{IodineGBA/GameBoyAdvanceCartridgeCore.js → core/Cartridge.js}
  14. +97 −104 IodineGBA/{IodineGBA/GameBoyAdvanceDMACore.js → core/DMA.js}
  15. +412 −412 IodineGBA/{IodineGBA/GameBoyAdvanceEmulatorCore.js → core/Emulator.js}
  16. +303 −311 IodineGBA/{IodineGBA/GameBoyAdvanceGraphicsCore.js → core/Graphics.js}
  17. +179 −186 IodineGBA/{IodineGBA/GameBoyAdvanceIRQCore.js → core/IRQ.js}
  18. +83 −0 IodineGBA/core/JoyPad.js
  19. +5,291 −5,558 IodineGBA/{IodineGBA/GameBoyAdvanceMemoryCore.js → core/Memory.js}
  20. +417 −422 IodineGBA/{IodineGBA/GameBoyAdvanceIOCore.js → core/RunLoop.js}
  21. +7 −14 IodineGBA/{IodineGBA/GameBoyAdvanceSavesCore.js → core/Saves.js}
  22. +436 −443 IodineGBA/{IodineGBA/GameBoyAdvanceSerialCore.js → core/Serial.js}
  23. +847 −827 IodineGBA/{IodineGBA/GameBoyAdvanceSoundCore.js → core/Sound.js}
  24. +845 −852 IodineGBA/{IodineGBA/GameBoyAdvanceTimerCore.js → core/Timer.js}
  25. +459 −466 IodineGBA/{IodineGBA/GameBoyAdvanceWaitCore.js → core/Wait.js}
  26. +7 −14 IodineGBA/{IodineGBA/cartridge/GameBoyAdvanceEEPROMChipCore.js → core/cartridge/EEPROM.js}
  27. +7 −14 IodineGBA/{IodineGBA/cartridge/GameBoyAdvanceFLASHChipCore.js → core/cartridge/FLASH.js}
  28. +7 −14 IodineGBA/{IodineGBA/cartridge/GameBoyAdvanceSRAMChipCore.js → core/cartridge/SRAM.js}
  29. +7 −14 ...eGBA/{IodineGBA/cartridge/GameBoyAdvanceSaveDeterminerCore.js → core/cartridge/SaveDeterminer.js}
  30. +230 −0 IodineGBA/core/graphics/AffineBG.js
  31. +166 −171 ...IodineGBA/graphics/GameBoyAdvanceBG2FrameBufferRendererCore.js → core/graphics/BG2FrameBuffer.js}
  32. +101 −100 IodineGBA/{IodineGBA/graphics/GameBoyAdvanceBGMatrixRendererCore.js → core/graphics/BGMatrix.js}
  33. +424 −418 IodineGBA/{IodineGBA/graphics/GameBoyAdvanceBGTEXTRendererCore.js → core/graphics/BGTEXT.js}
  34. +368 −353 ...BA/{IodineGBA/graphics/GameBoyAdvanceColorEffectsRendererCore.js → core/graphics/ColorEffects.js}
  35. +33 −32 IodineGBA/{IodineGBA/graphics/GameBoyAdvanceCompositorCore.js → core/graphics/Compositor.js}
  36. +68 −68 IodineGBA/{IodineGBA/graphics/GameBoyAdvanceMosaicRendererCore.js → core/graphics/Mosaic.js}
  37. +709 −676 IodineGBA/{IodineGBA/graphics/GameBoyAdvanceOBJRendererCore.js → core/graphics/OBJ.js}
  38. +166 −144 IodineGBA/{IodineGBA/graphics/GameBoyAdvanceOBJWindowRendererCore.js → core/graphics/OBJWindow.js}
  39. +1,490 −0 IodineGBA/core/graphics/Renderer.js
  40. +1,227 −0 IodineGBA/core/graphics/RendererProxy.js
  41. +133 −0 IodineGBA/core/graphics/Window.js
  42. +11 −18 IodineGBA/{IodineGBA/memory/GameBoyAdvanceDMA0Core.js → core/memory/DMA0.js}
  43. +11 −18 IodineGBA/{IodineGBA/memory/GameBoyAdvanceDMA1Core.js → core/memory/DMA1.js}
  44. +11 −18 IodineGBA/{IodineGBA/memory/GameBoyAdvanceDMA2Core.js → core/memory/DMA2.js}
  45. +12 −19 IodineGBA/{IodineGBA/memory/GameBoyAdvanceDMA3Core.js → core/memory/DMA3.js}
  46. +21 −28 IodineGBA/{IodineGBA/sound/GameBoyAdvanceChannel1Synth.js → core/sound/Channel1.js}
  47. +9 −16 IodineGBA/{IodineGBA/sound/GameBoyAdvanceChannel2Synth.js → core/sound/Channel2.js}
  48. +8 −15 IodineGBA/{IodineGBA/sound/GameBoyAdvanceChannel3Synth.js → core/sound/Channel3.js}
  49. +9 −16 IodineGBA/{IodineGBA/sound/GameBoyAdvanceChannel4Synth.js → core/sound/Channel4.js}
  50. +62 −69 IodineGBA/{IodineGBA/sound/GameBoyAdvanceFIFOCore.js → core/sound/FIFO.js}
  51. +101 −108 IodineGBA/includes/TypedArrayShim.js
  52. +42 −45 launcher.html
  53. +66 −71 user_scripts/IodineGBAAudioGlueCode.js
  54. +214 −214 user_scripts/IodineGBACoreGlueCode.js
  55. +7 −14 user_scripts/IodineGBAGraphicsGlueCode.js
  56. +49 −54 user_scripts/IodineGBAJoyPadGlueCode.js
  57. +7 −14 user_scripts/IodineGBAROMLoadGlueCode.js
  58. +7 −14 user_scripts/IodineGBASavesGlueCode.js
  59. +53 −0 user_scripts/XAudioJS/README.md
  60. +86 −0 user_scripts/XAudioJS/XAudioJS.as
  61. +25 −1 user_scripts/XAudioJS/XAudioServer.js
@@ -1,152 +0,0 @@
-"use strict";
-/*
- * This file is part of IodineGBA
- *
- * Copyright (C) 2012-2015 Grant Galitz
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * version 2 as published by the Free Software Foundation.
- * The full license is available at http://www.gnu.org/licenses/gpl.html
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- */
-function GameBoyAdvanceJoyPad(IOCore) {
- this.IOCore = IOCore;
-}
-GameBoyAdvanceJoyPad.prototype.initialize = function () {
- this.keyInput = 0x3FF;
- this.keyInterrupt = 0;
-}
-GameBoyAdvanceJoyPad.prototype.keyPress = function (keyPressed) {
- switch (keyPressed.toUpperCase()) {
- case "A":
- this.keyInput &= ~0x1;
- break;
- case "B":
- this.keyInput &= ~0x2;
- break;
- case "SELECT":
- this.keyInput &= ~0x4;
- break;
- case "START":
- this.keyInput &= ~0x8;
- break;
- case "RIGHT":
- this.keyInput &= ~0x10;
- break;
- case "LEFT":
- this.keyInput &= ~0x20;
- break;
- case "UP":
- this.keyInput &= ~0x40;
- break;
- case "DOWN":
- this.keyInput &= ~0x80;
- break;
- case "R":
- this.keyInput &= ~0x100;
- break;
- case "L":
- this.keyInput &= ~0x200;
- break;
- default:
- return;
- }
- this.checkForMatch();
-}
-GameBoyAdvanceJoyPad.prototype.keyRelease = function (keyReleased) {
- switch (keyReleased.toUpperCase()) {
- case "A":
- this.keyInput |= 0x1;
- break;
- case "B":
- this.keyInput |= 0x2;
- break;
- case "SELECT":
- this.keyInput |= 0x4;
- break;
- case "START":
- this.keyInput |= 0x8;
- break;
- case "RIGHT":
- this.keyInput |= 0x10;
- break;
- case "LEFT":
- this.keyInput |= 0x20;
- break;
- case "UP":
- this.keyInput |= 0x40;
- break;
- case "DOWN":
- this.keyInput |= 0x80;
- break;
- case "R":
- this.keyInput |= 0x100;
- break;
- case "L":
- this.keyInput |= 0x200;
- break;
- default:
- return;
- }
- this.checkForMatch();
-}
-GameBoyAdvanceJoyPad.prototype.checkForMatch = function () {
- if ((this.keyInterrupt & 0x8000) == 0x8000) {
- if (((~this.keyInput) & this.keyInterrupt & 0x3FF) == (this.keyInterrupt & 0x3FF)) {
- this.IOCore.deflagStop();
- this.checkForIRQ();
- }
- }
- else if (((~this.keyInput) & this.keyInterrupt & 0x3FF) != 0) {
- this.IOCore.deflagStop();
- this.checkForIRQ();
- }
-}
-GameBoyAdvanceJoyPad.prototype.checkForIRQ = function () {
- if ((this.keyInterrupt & 0x4000) == 0x4000) {
- this.IOCore.irq.requestIRQ(0x1000);
- }
-}
-GameBoyAdvanceJoyPad.prototype.readKeyStatus8_0 = function () {
- return this.keyInput & 0xFF;
-}
-GameBoyAdvanceJoyPad.prototype.readKeyStatus8_1 = function () {
- return (this.keyInput >> 8) | 0;
-}
-GameBoyAdvanceJoyPad.prototype.readKeyStatus16 = function () {
- return this.keyInput | 0;
-}
-GameBoyAdvanceJoyPad.prototype.writeKeyControl8_0 = function (data) {
- data = data | 0;
- this.keyInterrupt = this.keyInterrupt & 0xC300;
- data = data & 0xFF;
- this.keyInterrupt = this.keyInterrupt | data;
-}
-GameBoyAdvanceJoyPad.prototype.writeKeyControl8_1 = function (data) {
- data = data | 0;
- this.keyInterrupt = this.keyInterrupt & 0xFF;
- data = data & 0xC3;
- this.keyInterrupt = this.keyInterrupt | (data << 8);
-}
-GameBoyAdvanceJoyPad.prototype.writeKeyControl16 = function (data) {
- data = data | 0;
- this.keyInterrupt = data & 0xC3FF;
-}
-GameBoyAdvanceJoyPad.prototype.readKeyControl8_0 = function () {
- return this.keyInterrupt & 0xFF;
-}
-GameBoyAdvanceJoyPad.prototype.readKeyControl8_1 = function () {
- return (this.keyInterrupt >> 8) | 0;
-}
-GameBoyAdvanceJoyPad.prototype.readKeyControl16 = function () {
- return this.keyInterrupt | 0;
-}
-GameBoyAdvanceJoyPad.prototype.readKeyStatusControl32 = function () {
- return this.keyInput | (this.keyInterrupt << 16);
-}
@@ -1,195 +0,0 @@
-"use strict";
-/*
- * This file is part of IodineGBA
- *
- * Copyright (C) 2012-2014 Grant Galitz
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * version 2 as published by the Free Software Foundation.
- * The full license is available at http://www.gnu.org/licenses/gpl.html
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- */
-function GameBoyAdvanceAffineBGRenderer(gfx, BGLayer) {
- this.gfx = gfx;
- this.BGLayer = BGLayer;
- this.initialize();
-}
-GameBoyAdvanceAffineBGRenderer.prototype.initialize = function () {
- this.scratchBuffer = getInt32Array(240);
- this.BGdx = 0x100;
- this.BGdmx = 0;
- this.BGdy = 0;
- this.BGdmy = 0x100;
- this.actualBGdx = 0x100;
- this.actualBGdmx = 0;
- this.actualBGdy = 0;
- this.actualBGdmy = 0x100;
- this.BGReferenceX = 0;
- this.BGReferenceY = 0;
- this.actualBGReferenceX = 0;
- this.actualBGReferenceY = 0;
- this.pb = 0;
- this.pd = 0;
- this.priorityPreprocess();
- this.offsetReferenceCounters();
-}
-if (typeof Math.imul == "function") {
- //Math.imul found, insert the optimized path in:
- GameBoyAdvanceAffineBGRenderer.prototype.renderScanLine = function (line, BGObject) {
- line = line | 0;
- var x = this.pb | 0;
- var y = this.pd | 0;
- if (this.gfx.BGMosaic[this.BGLayer & 3]) {
- //Correct line number for mosaic:
- var mosaicY = this.gfx.mosaicRenderer.getMosaicYOffset(line | 0) | 0;
- x = ((x | 0) - Math.imul(this.actualBGdmx | 0, mosaicY | 0)) | 0;
- y = ((y | 0) - Math.imul(this.actualBGdmy | 0, mosaicY | 0)) | 0;
- }
- for (var position = 0; (position | 0) < 240; position = ((position | 0) + 1) | 0, x = ((x | 0) + (this.actualBGdx | 0)) | 0, y = ((y | 0) + (this.actualBGdy | 0)) | 0) {
- //Fetch pixel:
- this.scratchBuffer[position | 0] = this.priorityFlag | BGObject.fetchPixel(x >> 8, y >> 8);
- }
- if (this.gfx.BGMosaic[this.BGLayer & 3]) {
- //Pixelize the line horizontally:
- this.gfx.mosaicRenderer.renderMosaicHorizontal(this.scratchBuffer);
- }
- return this.scratchBuffer;
- }
- GameBoyAdvanceAffineBGRenderer.prototype.offsetReferenceCounters = function () {
- var end = this.gfx.lastUnrenderedLine | 0;
- this.pb = Math.imul(((this.pb | 0) + (this.actualBGdmx | 0)) | 0, end | 0) | 0;
- this.pd = Math.imul(((this.pd | 0) + (this.actualBGdmy | 0)) | 0, end | 0) | 0;
- }
-}
-else {
- //Math.imul not found, use the compatibility method:
- GameBoyAdvanceAffineBGRenderer.prototype.renderScanLine = function (line, BGObject) {
- var x = this.pb;
- var y = this.pd;
- if (this.gfx.BGMosaic[this.BGLayer & 3]) {
- //Correct line number for mosaic:
- var mosaicY = this.gfx.mosaicRenderer.getMosaicYOffset(line | 0);
- x -= this.actualBGdmx * mosaicY;
- y -= this.actualBGdmy * mosaicY;
- }
- for (var position = 0; position < 240; ++position, x += this.actualBGdx, y += this.actualBGdy) {
- //Fetch pixel:
- this.scratchBuffer[position] = this.priorityFlag | BGObject.fetchPixel(x >> 8, y >> 8);
- }
- if (this.gfx.BGMosaic[this.BGLayer & 3]) {
- //Pixelize the line horizontally:
- this.gfx.mosaicRenderer.renderMosaicHorizontal(this.scratchBuffer);
- }
- return this.scratchBuffer;
- }
- GameBoyAdvanceAffineBGRenderer.prototype.offsetReferenceCounters = function () {
- var end = this.gfx.lastUnrenderedLine | 0;
- this.pb = (((this.pb | 0) + (this.actualBGdmx | 0)) * (end | 0)) | 0;
- this.pd = (((this.pd | 0) + (this.actualBGdmy | 0)) * (end | 0)) | 0;
- }
-}
-GameBoyAdvanceAffineBGRenderer.prototype.incrementReferenceCounters = function () {
- this.pb = ((this.pb | 0) + (this.actualBGdmx | 0)) | 0;
- this.pd = ((this.pd | 0) + (this.actualBGdmy | 0)) | 0;
-}
-GameBoyAdvanceAffineBGRenderer.prototype.resetReferenceCounters = function () {
- this.pb = this.actualBGReferenceX | 0;
- this.pd = this.actualBGReferenceY | 0;
-}
-GameBoyAdvanceAffineBGRenderer.prototype.priorityPreprocess = function () {
- this.priorityFlag = (this.gfx.BGPriority[this.BGLayer] << 23) | (1 << (this.BGLayer + 0x10));
-}
-GameBoyAdvanceAffineBGRenderer.prototype.writeBGPA0 = function (data) {
- data = data | 0;
- this.BGdx = (this.BGdx & 0xFF00) | data;
- this.actualBGdx = (this.BGdx << 16) >> 16;
-}
-GameBoyAdvanceAffineBGRenderer.prototype.writeBGPA1 = function (data) {
- data = data | 0;
- this.BGdx = (data << 8) | (this.BGdx & 0xFF);
- this.actualBGdx = (this.BGdx << 16) >> 16;
-}
-GameBoyAdvanceAffineBGRenderer.prototype.writeBGPB0 = function (data) {
- data = data | 0;
- this.BGdmx = (this.BGdmx & 0xFF00) | data;
- this.actualBGdmx = (this.BGdmx << 16) >> 16;
-}
-GameBoyAdvanceAffineBGRenderer.prototype.writeBGPB1 = function (data) {
- data = data | 0;
- this.BGdmx = (data << 8) | (this.BGdmx & 0xFF);
- this.actualBGdmx = (this.BGdmx << 16) >> 16;
-}
-GameBoyAdvanceAffineBGRenderer.prototype.writeBGPC0 = function (data) {
- data = data | 0;
- this.BGdy = (this.BGdy & 0xFF00) | data;
- this.actualBGdy = (this.BGdy << 16) >> 16;
-}
-GameBoyAdvanceAffineBGRenderer.prototype.writeBGPC1 = function (data) {
- data = data | 0;
- this.BGdy = (data << 8) | (this.BGdy & 0xFF);
- this.actualBGdy = (this.BGdy << 16) >> 16;
-}
-GameBoyAdvanceAffineBGRenderer.prototype.writeBGPD0 = function (data) {
- data = data | 0;
- this.BGdmy = (this.BGdmy & 0xFF00) | data;
- this.actualBGdmy = (this.BGdmy << 16) >> 16;
-}
-GameBoyAdvanceAffineBGRenderer.prototype.writeBGPD1 = function (data) {
- data = data | 0;
- this.BGdmy = (data << 8) | (this.BGdmy & 0xFF);
- this.actualBGdmy = (this.BGdmy << 16) >> 16;
-}
-GameBoyAdvanceAffineBGRenderer.prototype.writeBGX_L0 = function (data) {
- data = data | 0;
- this.BGReferenceX = (this.BGReferenceX & 0xFFFFF00) | data;
- this.actualBGReferenceX = (this.BGReferenceX << 4) >> 4;
- //Writing to the x reference doesn't reset the counters during draw!
-}
-GameBoyAdvanceAffineBGRenderer.prototype.writeBGX_L1 = function (data) {
- data = data | 0;
- this.BGReferenceX = (data << 8) | (this.BGReferenceX & 0xFFF00FF);
- this.actualBGReferenceX = (this.BGReferenceX << 4) >> 4;
- //Writing to the x reference doesn't reset the counters during draw!
-}
-GameBoyAdvanceAffineBGRenderer.prototype.writeBGX_H0 = function (data) {
- data = data | 0;
- this.BGReferenceX = (data << 16) | (this.BGReferenceX & 0xF00FFFF);
- this.actualBGReferenceX = (this.BGReferenceX << 4) >> 4;
- //Writing to the x reference doesn't reset the counters during draw!
-}
-GameBoyAdvanceAffineBGRenderer.prototype.writeBGX_H1 = function (data) {
- data = data | 0;
- this.BGReferenceX = ((data & 0xF) << 24) | (this.BGReferenceX & 0xFFFFFF);
- this.actualBGReferenceX = (this.BGReferenceX << 4) >> 4;
- //Writing to the x reference doesn't reset the counters during draw!
-}
-GameBoyAdvanceAffineBGRenderer.prototype.writeBGY_L0 = function (data) {
- data = data | 0;
- this.BGReferenceY = (this.BGReferenceY & 0xFFFFF00) | data;
- this.actualBGReferenceY = (this.BGReferenceY << 4) >> 4;
- this.resetReferenceCounters();
-}
-GameBoyAdvanceAffineBGRenderer.prototype.writeBGY_L1 = function (data) {
- data = data | 0;
- this.BGReferenceY = (data << 8) | (this.BGReferenceY & 0xFFF00FF);
- this.actualBGReferenceY = (this.BGReferenceY << 4) >> 4;
- this.resetReferenceCounters();
-}
-GameBoyAdvanceAffineBGRenderer.prototype.writeBGY_H0 = function (data) {
- data = data | 0;
- this.BGReferenceY = (data << 16) | (this.BGReferenceY & 0xF00FFFF);
- this.actualBGReferenceY = (this.BGReferenceY << 4) >> 4;
- this.resetReferenceCounters();
-}
-GameBoyAdvanceAffineBGRenderer.prototype.writeBGY_H1 = function (data) {
- data = data | 0;
- this.BGReferenceY = ((data & 0xF) << 24) | (this.BGReferenceY & 0xFFFFFF);
- this.actualBGReferenceY = (this.BGReferenceY << 4) >> 4;
- this.resetReferenceCounters();
-}
Oops, something went wrong.

0 comments on commit 9f18eaf

Please sign in to comment.