html
head
- outputMode = "release"
- ARGV.each do|a|
- if a == "debug.html"
- outputMode = "debug.html"
- if outputMode != "debug.html"
javascript:
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-31090418-4']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
javascript:
function showDropdownList() {
document.getElementById("myDropdown").classList.toggle("show");
}
// Close the dropdown if the user clicks outside of it
window.onclick = function(event) {
if (!event.target.matches('.dropbtn')) {
var dropdowns = document.getElementsByClassName("dropdown-content");
var i;
for (i = 0; i < dropdowns.length; i++) {
var openDropdown = dropdowns[i];
if (openDropdown.classList.contains('show')) {
openDropdown.classList.remove('show');
}
}
}
}
// gradient backround from https://codepen.io/quasimondo/pen/lDdrF
javascript:
var colors;
var step = 0;
//color table indices for:
// current color left
// next color left
// current color right
// next color right
var colorIndices = [0,1,2,3];
//transition speed
var gradientSpeed = 0.01;
function updateGradient()
{
if ( $===undefined ) return;
var c0_0 = colors[colorIndices[0]];
var c0_1 = colors[colorIndices[1]];
var c1_0 = colors[colorIndices[2]];
var c1_1 = colors[colorIndices[3]];
var istep = 1 - step;
var r1 = Math.round(istep * c0_0[0] + step * c0_1[0]);
var g1 = Math.round(istep * c0_0[1] + step * c0_1[1]);
var b1 = Math.round(istep * c0_0[2] + step * c0_1[2]);
var color1 = "rgb("+r1+","+g1+","+b1+")";
var r2 = Math.round(istep * c1_0[0] + step * c1_1[0]);
var g2 = Math.round(istep * c1_0[1] + step * c1_1[1]);
var b2 = Math.round(istep * c1_0[2] + step * c1_1[2]);
var color2 = "rgb("+r2+","+g2+","+b2+")";
$('#gradient').css({
background: "-webkit-gradient(linear, left top, right top, from("+color1+"), to("+color2+"))"}).css({
background: "-moz-linear-gradient(left, "+color1+" 0%, "+color2+" 100%)"});
step += gradientSpeed;
if ( step >= 1 )
{
step %= 1;
colorIndices[0] = colorIndices[1];
colorIndices[2] = colorIndices[3];
//pick two new target color indices
//do not pick the same as the current one
colorIndices[1] = ( colorIndices[1] + Math.floor( 1 + Math.random() * (colors.length - 1))) % colors.length;
colorIndices[3] = ( colorIndices[3] + Math.floor( 1 + Math.random() * (colors.length - 1))) % colors.length;
}
}
var gradientBackgroundInterval = null;
function stopGradientBackground() {
clearInterval(gradientBackgroundInterval);
gradientBackgroundInterval = null;
}
function startGradientBackground() {
if (gradientBackgroundInterval == null) {
colors = new Array(
[Math.random()*192,Math.random()*192,Math.random()*192],
[Math.random()*192,Math.random()*192,Math.random()*192],
[Math.random()*192,Math.random()*192,Math.random()*192],
[Math.random()*192,Math.random()*192,Math.random()*192],
[Math.random()*192,Math.random()*192,Math.random()*192],
[Math.random()*192,Math.random()*192,Math.random()*192]);
gradientBackgroundInterval = setInterval(updateGradient,30);
}
}
link href="css/style.css" rel="stylesheet" type="text/css"
title 1964 and 1964js Home page
meta content="1964js - N64 emulator in JavaScript" property="og:title"
meta content="game" property="og:type"
meta content="http://www.1964js.com" property="og:url"
meta content="https://fbcdn-profile-a.akamaihd.net/hprofile-ak-snc4/373029_274941852620356_1206208449_n.jpg" property="og:image"
meta content="1964js" property="og:site_name"
meta content="1397141558" property="fb:admins"
body alink="#ff0000" bgcolor="#000000" link="#D8D8D8" onLoad="start1964({wireframe:true})" onunload="i1964js.stopEmulatorAndCleanup()" text="#ffffff" vlink="#D8D8D8"
- outputMode = "release"
- ARGV.each do|a|
- if a == "debug.html"
- outputMode = "debug.html"
- if outputMode != "debug.html"
#fb-root
javascript:
window.fbAsyncInit = function() {
FB.init({
appId : '518018268224773', // App ID
channelUrl : '//www.1964js.com/channel.html', // Channel File
status : true, // check login status
cookie : true, // enable cookies to allow the server to access the session
xfbml : true // parse XFBML
});
};
(function(d){
var js, id = 'facebook-jssdk', ref = d.getElementsByTagName('script')[0];
if (d.getElementById(id)) {return;}
js = d.createElement('script'); js.id = id; js.async = true;
js.src = "//connect.facebook.net/en_US/all.js";
ref.parentNode.insertBefore(js, ref);
}(document));
(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/en_US/all.js#xfbml=1&appId=518018268224773";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));
p
script#vertex-shader type="x-shader/x-vertex"
| attribute vec4 aVertexPosition;
attribute vec4 aVertexColor;
attribute vec2 aTextureCoord;
uniform mat4 uMVMatrix;
uniform mat4 uPMatrix;
varying lowp vec4 vColor;
varying vec2 vTextureCoord;
void main(void) {
gl_Position = uPMatrix * uMVMatrix * aVertexPosition;
vColor = aVertexColor;
vTextureCoord = aTextureCoord;
}
script#fragment-shader type="x-shader/x-fragment"
| precision mediump float;
varying lowp vec4 vColor;
varying mediump vec2 vTextureCoord;
uniform sampler2D uSampler;
uniform int cycleType;
//uniform int otherModeL, otherModeH;
uniform int uCombineA0, uCombineB0, uCombineC0, uCombineD0;
uniform int uCombineA0a, uCombineB0a, uCombineC0a, uCombineD0a;
uniform int uCombineA1, uCombineB1, uCombineC1, uCombineD1;
uniform int uCombineA1a, uCombineB1a, uCombineC1a, uCombineD1a;
uniform int uAlphaTestEnabled;
uniform vec4 uPrimColor, uFillColor, uEnvColor, uBlendColor;
vec4 green = vec4(0.0, 1.0, 0.0, 1.0);
vec4 a0, b0, c0, d0;
vec4 a1, b1, c1, d1;
vec4 tex2d;
int combined=0;
int tex0=1;
int tex1=2;
int prim=3;
int shade=4;
int env=5;
void main(void)
{
if (cycleType == 3)
{
gl_FragColor = uFillColor;
}
else if (cycleType == 2)
{
gl_FragColor = texture2D(uSampler, vec2(vTextureCoord.st));
}
else
{
tex2d = texture2D(uSampler, vec2(vTextureCoord.st));
a0 = b0 = c0 = d0 = vec4(1.0, 1.0, 1.0, 0.0);
if (uCombineA0 == tex0)
a0.rgb = tex2d.rgb;
if (uCombineA0a == tex0)
a0.a = tex2d.a;
if (uCombineB0 == tex0)
b0.rgb = tex2d.rgb;
if (uCombineB0a == tex0)
b0.a = tex2d.a;
if (uCombineC0 == tex0)
c0.rgb = tex2d.rgb;
if (uCombineC0a == tex0)
c0.a = tex2d.a;
if (uCombineD0 == tex0)
d0.rgb = tex2d.rgb;
if (uCombineD0a == tex0)
d0.a = tex2d.a;
if (uCombineA0 == tex1)
a0.rgb = tex2d.rgb;
if (uCombineA0a == tex1)
a0.a = tex2d.a;
if (uCombineB0 == tex1)
b0.rgb = tex2d.rgb;
if (uCombineB0a == tex1)
b0.a = tex2d.a;
if (uCombineC0 == tex1)
c0.rgb = tex2d.rgb;
if (uCombineC0a == tex1)
c0.a = tex2d.a;
if (uCombineD0 == tex1)
d0.rgb = tex2d.rgb;
if (uCombineD0a == tex1)
d0.a = tex2d.a;
if (uCombineA0 == prim)
a0.rgb = uPrimColor.rgb;
if (uCombineA0a == prim)
a0.a = uPrimColor.a;
if (uCombineB0 == prim)
b0.rgb = uPrimColor.rgb;
if (uCombineB0a == prim)
b0.a = uPrimColor.a;
if (uCombineC0 == prim)
c0.rgb = uPrimColor.rgb;
if (uCombineC0a == prim)
c0.a = uPrimColor.a;
if (uCombineD0 == prim)
d0.rgb = uPrimColor.rgb;
if (uCombineD0a == prim)
d0.a = uPrimColor.a;
if (uCombineA0 == shade)
a0.rgb = vColor.rgb;
if (uCombineA0a == shade)
a0.a = vColor.a;
if (uCombineB0 == shade)
b0.rgb = vColor.rgb;
if (uCombineB0a == shade)
b0.a = vColor.a;
if (uCombineC0 == shade)
c0.rgb = vColor.rgb;
if (uCombineC0a == shade)
c0.a = vColor.a;
if (uCombineD0 == shade)
d0.rgb = vColor.rgb;
if (uCombineD0a == shade)
d0.a = vColor.a;
if (uCombineA0 == env)
a0.rgb = uEnvColor.rgb;
if (uCombineA0a == env)
a0.a = uEnvColor.a;
if (uCombineB0 == env)
b0.rgb = uEnvColor.rgb;
if (uCombineB0a == env)
b0.a = uEnvColor.a;
if (uCombineC0 == env)
c0.rgb = uEnvColor.rgb;
if (uCombineC0a == env)
c0.a = uEnvColor.a;
if (uCombineD0 == env)
d0.rgb = uEnvColor.rgb;
if (uCombineD0a == env)
d0.a = uEnvColor.a;
// alpha combiner
if (uCombineC0a == 8)
c0.a = tex2d.a;
if (uCombineC0a == 9)
c0.a = tex2d.a;
if (uCombineC0a == 10)
c0.a = uPrimColor.a;
if (uCombineC0a == 11)
c0.a = vColor.a;
if (uCombineC0a == 12)
c0.a = uEnvColor.a;
// convert k4
//if (uCombineB0 == 7)
// b0.rgb = uPrimColor.rgb;
//if (uCombineB0a == 7)
// b0.a = uPrimColor.a;
// convert k5
//if (uCombineC0 == 15)
// c0.rgb = uPrimColor.rgb;
//if (uCombineC0a == 15)
// c0.a = uPrimColor.a;
if (uCombineA0 == 6)
a0.rgb = vec3(1.0, 1.0, 1.0);
if (uCombineA0a == 6)
a0.a = 1.0;
if (uCombineD0 == 6)
d0.rgb = vec3(1.0, 1.0, 1.0);
if (uCombineD0a == 6)
d0.a = 1.0;
if (uCombineD0 == 7)
d0.rgb = vec3(0.0, 0.0, 0.0);
if (uCombineD0a == 7)
d0.a = 0.0;
if (uCombineA0 >= 8 && uCombineA0 <= 15)
a0.rgb = vec3(0.0, 0.0, 0.0);
if (uCombineA0a >= 8 && uCombineA0a <= 15)
a0.a = 0.0;
if (uCombineB0 >= 8 && uCombineB0 <= 15)
b0.rgb = vec3(0.0, 0.0, 0.0);
if (uCombineB0a >= 8 && uCombineB0a <= 15)
b0.a = 0.0;
if (uCombineC0 >= 16 && uCombineC0 <= 31)
c0.rgb = vec3(0.0, 0.0, 0.0);
if (uCombineC0a >= 16 && uCombineC0a <= 31)
c0.a = 0.0;
//vec4 combined = (a0-b0) * c0 + d0;
gl_FragColor = (a0-b0) * c0 + d0;
// if (uAlphaTestEnabled == 1 && gl_FragColor.a < uBlendColor.a)
// discard;
if (cycleType == 1) //2-cycle
{
a1 = b1 = c1 = d1 = vec4(1.0, 1.0, 1.0, 0.0);
if (uCombineA1 == combined)
a1.rgb = gl_FragColor.rgb;
if (uCombineA1a == combined)
a1.a = gl_FragColor.a;
if (uCombineB1 == combined)
b1.rgb = gl_FragColor.rgb;
if (uCombineB1a == combined)
b1.a = gl_FragColor.a;
if (uCombineC1 == combined)
c1.rgb = gl_FragColor.rgb;
if (uCombineC1a == combined)
c1.a = gl_FragColor.a;
if (uCombineD1 == combined)
d1.rgb = gl_FragColor.rgb;
if (uCombineD1a == combined)
d1.a = gl_FragColor.a;
if (uCombineA1 == tex0)
a1.rgb = tex2d.rgb;
if (uCombineA1a == tex0)
a1.a = tex2d.a;
if (uCombineB1 == tex0)
b1.rgb = tex2d.rgb;
if (uCombineB1a == tex0)
b1.a = tex2d.a;
if (uCombineC1 == tex0)
c1.rgb = tex2d.rgb;
if (uCombineC1a == tex0)
c1.a = tex2d.a;
if (uCombineD1 == tex0)
d1.rgb = tex2d.rgb;
if (uCombineD1a == tex0)
d1.a = tex2d.a;
if (uCombineA1 == tex1)
a1.rgb = tex2d.rgb;
if (uCombineA1a == tex1)
a1.a = tex2d.a;
if (uCombineB1 == tex1)
b1.rgb = tex2d.rgb;
if (uCombineB1a == tex1)
b1.a = tex2d.a;
if (uCombineC1 == tex1)
c1.rgb = tex2d.rgb;
if (uCombineC1a == tex1)
c1.a = tex2d.a;
if (uCombineD1 == tex1)
d1.rgb = tex2d.rgb;
if (uCombineD1a == tex1)
d1.a = tex2d.a;
if (uCombineA1 == prim)
a1.rgb = uPrimColor.rgb;
if (uCombineA1a == prim)
a1.a = uPrimColor.a;
if (uCombineB1 == prim)
b1.rgb = uPrimColor.rgb;
if (uCombineB1a == prim)
b1.a = uPrimColor.a;
if (uCombineC1 == prim)
c1.rgb = uPrimColor.rgb;
if (uCombineC1a == prim)
c1.a = uPrimColor.a;
if (uCombineD1 == prim)
d1.rgb = uPrimColor.rgb;
if (uCombineD1a == prim)
d1.a = uPrimColor.a;
if (uCombineA1 == shade)
a1.rgb = vColor.rgb;
if (uCombineA1a == shade)
a1.a = vColor.a;
if (uCombineB1 == shade)
b1.rgb = vColor.rgb;
if (uCombineB1a == shade)
b1.a = vColor.a;
if (uCombineC1 == shade)
c1.rgb = vColor.rgb;
if (uCombineC1a == shade)
c1.a = vColor.a;
if (uCombineD1 == shade)
d1.rgb = vColor.rgb;
if (uCombineD1a == shade)
d1.a = vColor.a;
if (uCombineA1 == env)
a1.rgb = uEnvColor.rgb;
if (uCombineA1a == env)
a1.a = uEnvColor.a;
if (uCombineB1 == env)
b1.rgb = uEnvColor.rgb;
if (uCombineB1a == env)
b1.a = uEnvColor.a;
if (uCombineC1 == env)
c1.rgb = uEnvColor.rgb;
if (uCombineC1a == env)
c1.a = uEnvColor.a;
if (uCombineD1 == env)
d1.rgb = uEnvColor.rgb;
if (uCombineD1a == env)
d1.a = uEnvColor.a;
// alpha combiner
if (uCombineC1a == 7)
c1.a = gl_FragColor.a;
if (uCombineC1a == 8)
c1.a = tex2d.a;
if (uCombineC1a == 9)
c1.a = tex2d.a;
if (uCombineC1a == 10)
c1.a = uPrimColor.a;
if (uCombineC1a == 11)
c1.a = vColor.a;
if (uCombineC1a == 12)
c1.a = uEnvColor.a;
// convert k4
//if (uCombineB1 == 7)
// b1.rgb = uPrimColor.rgb;
//if (uCombineB1a == 7)
// b1.a = uPrimColor.a;
// convert k5
//if (uCombineC1 == 15)
// c1.rgb = uPrimColor.rgb;
//if (uCombineC1a == 15)
// c1.a = uPrimColor.a;
if (uCombineA1 == 6)
a1.rgb = vec3(1.0, 1.0, 1.0);
if (uCombineA1a == 6)
a1.a = 1.0;
if (uCombineD1 == 6)
d1.rgb = vec3(1.0, 1.0, 1.0);
if (uCombineD1a == 6)
d1.a = 1.0;
if (uCombineD1 == 7)
d1.rgb = vec3(0.0, 0.0, 0.0);
if (uCombineD1a == 7)
d1.a = 0.0;
if (uCombineA1 >= 8 && uCombineA1 <= 15)
a1.rgb = vec3(0.0, 0.0, 0.0);
if (uCombineA1a >= 8 && uCombineA1a <= 15)
a1.a = 0.0;
if (uCombineB1 >= 8 && uCombineB1 <= 15)
b1.rgb = vec3(0.0, 0.0, 0.0);
if (uCombineB1a >= 8 && uCombineB1a <= 15)
b1.a = 0.0;
if (uCombineC1 >= 16 && uCombineC1 <= 31)
c1.rgb = vec3(0.0, 0.0, 0.0);
if (uCombineC1a >= 16 && uCombineC1a <= 31)
c1.a = 0.0;
gl_FragColor = (a1-b1) * c1 + d1;
// gl_FragColor.a = 0.5;
// if (uAlphaTestEnabled == 1 && gl_FragColor.a < uBlendColor.a)
// discard;
}
}
}
//div style="position: absolute; left: -600 px; top: -600 px"
canvas#Canvas height="240" width="320"
canvas#Canvas3D height="1024" width="1024"
#user_panel
#gradient
span.header
a href="http://1964emu.emulation64.com" Get 1964 for Windows
|
a href="http://1964js.com/blog/index.html" Blog
|
a href="http://www.github.com/schibo/1964js" Code
|
a href="http://hulkholden.github.com/n64js/" Try n64js too!
p style="font-size: 130%;"
| 1964js
span style="font-size: 10px; font-size: 40%;"
- version1964 = ENV['version1964']
| v#{version1964}
p
div
.dropdown
button.dropbtn onclick="showDropdownList()" Demos
#myDropdown.dropdown-content
a href="?rom=roms/unofficial/rotate.zip" Rotate
a href="?rom=roms/unofficial/chrome.zip" Chrome
a href="?rom=roms/unofficial/dextrose.zip" Dextrose
a href="?rom=roms/unofficial/n64stars.zip" N64 Stars
a href="?rom=roms/unofficial/liner.zip" Liner
a href="?rom=roms/unofficial/hardcode.zip" Hard Coded
a href="?rom=roms/unofficial/sp_crap.zip" Absolute Crap
div
br /
center
.dropbtn style="position: relative; overflow: hidden; direction: ltr;background-color: #4CAF50; width:10vw; font-size: 1.5vw"
div style="display: block; text-align: center"
| Load ROM
input.file#files name="file" type="file"
//| *.v64; *.n64; *.z64
span style="font-size: 10px; font-size: 50%"
br /
| Supports Super Mario 64
br /
p style="margin-top: 2%;"
input#stretch type="checkbox" stretch
|
input#speedlimit type="checkbox" checked="true" onclick="i1964js.onSpeedLimitChanged()" speed limit
- if outputMode == "debug.html"
|
input#wireframe type="checkbox" wireframe
|
input#repeatDList type="checkbox" repeat DList
p
a style="font-align:left;" href="https://www.google.com/chrome/" Best with Chrome
/ .footer
/ - useFacebookLike = false
/ - if useFacebookLike == true
/ .fb-like data-colorscheme="dark" data-send="false" data-show-faces="false" data-width="300"
script src='https://cdnjs.cloudflare.com/ajax/libs/jquery/2.0.2/jquery.min.js'
- outputMode = "release"
- ARGV.each do|a|
- if a == "debug.html"
- outputMode = "debug.html"
- if outputMode != "debug.html"
script src='lib/1964js-#{version1964}.min.js'
- else
script src='obj/constants.js'
script src='lib/bitjs/io.js'
script src='lib/bitjs/archive.js'
script src='lib/BigInt-modded-forES6.js'
script src='lib/closure/goog/base.js'
script src='obj/1964.js'
script src='obj/helpers.js'
script src='obj/opcodeMap.js'
script src='obj/boot.js'
script src='lib/closure/goog/math/long.js'
script src='obj/pif.js'
script src='obj/pif_le.js'
script src='obj/keyboard.js'
script src='obj/memory.js'
script src='obj/memory_le.js'
script src='obj/gen.js'
script src='obj/audio.js'
script src='obj/dma.js'
script src='obj/dma_le.js'
script src='obj/interrupts.js'
script src='lib/glMatrix-0.9.5.min.js'
script src='lib/mainLoop.js'
script src='lib/webgl-utils.js'
script src='obj/renderer.js'
script src='obj/renderer_le.js'
script src='obj/videoHLE.js'
script src='obj/gfxHelpers.js'
script src='obj/gfxHelpers_le.js'
script src='obj/ui.js'
script src='obj/webGL.js'