Official hakchi2 - NES Mini very simple pimp tool

  • Thread starter Thread starter Cluster
  • Start date Start date
  • Views Views 4,395,818
  • Replies Replies 18,558
  • Likes Likes 138
Any shader experts in the house?

Pulled these out of canoe - completely ignorant about shaders, so can anyone a) understand why there are five different ones, and b) how to convert the CRT shader code to one that Retroarch can handle? (My objective is basically to make Retroarch as indistinguishable as possible from canoe, rather like was done for the NESCE.)

#version 100
precision mediump float;

varying vec2 vTexCoord;
varying vec2 vScanline;

uniform sampler2D uTexture;

void main()
{
vec4 col = texture2D(uTexture, vTexCoord);
gl_FragColor = (vScanline.x + vScanline.y * col) * col;
}

-----

#version 100
precision mediump float;

attribute vec2 aPos;
attribute vec2 aTexCoord;
attribute vec2 aScanline;

varying vec2 vTexCoord;
varying vec2 vScanline;

void main()
{
gl_Position = vec4(aPos, 0.0, 1.0);
vTexCoord = aTexCoord;
vScanline = aScanline;
}

-----

#version 100
precision lowp float;

//---------- Definitions

#define M_PI 3.1415926535897932384626433832795

#define input_width 256.0
#define input_height 224.0

#define screen_width 1280.0
#define screen_height 720.0


//---------- Parameters

varying vec2 vTexCoord;

uniform sampler2D sampler_input;

uniform int applyTint;

uniform float hue;
uniform float saturation;

uniform int applyLuminosity;
uniform float luminosity;


//---------- Conversion methods

vec3 rgb2yuv(vec3 c)
{
vec3 o;

o.x = 0.299 * c.r + 0.587 * c.g + 0.114 * c.b;
o.y = 0.492 * (c.b - o.x);
o.z = 0.877 * (c.r - o.x);

return o;
}

vec3 yuv2rgb(vec3 c)
{
vec3 o;

o.r = c.x + 1.14 * c.z;
o.g = c.x - 0.395 * c.y - 0.581 * c.z;
o.b = c.x + 2.032 * c.y;

return o;
}


//---------- Shader

void main()
{
gl_FragColor = texture2D(sampler_input, vTexCoord);

vec3 yuv;

yuv.x = gl_FragColor.x;
yuv.y = 2.0 * (gl_FragColor.y - 0.5);
yuv.z = 2.0 * (gl_FragColor.z - 0.5);

if (applyTint > 0)
{
float chue = cos(hue);
float shue = sin(hue);

vec3 yuv_shifted;
yuv_shifted.x = yuv.x;
yuv_shifted.y = saturation * (yuv.y * chue + yuv.z * shue);
yuv_shifted.z = saturation * (yuv.z * chue - yuv.y * shue);

gl_FragColor.rgb = yuv2rgb(mix(yuv, yuv_shifted, gl_FragColor.a));
}
else
{
gl_FragColor.rgb = yuv2rgb(yuv);
}

if (applyLuminosity > 0)
{
gl_FragColor = mix(1.0, luminosity, gl_FragColor.a) * gl_FragColor;
}
}

-----

#version 100
precision lowp float;


//---------- Parameters

varying vec2 vTexCoord;

uniform sampler2D uTexture;
uniform vec4 uColor;
uniform vec2 uDstSize;
uniform vec2 uSrcSize;
uniform vec2 uInvSrcSize;

//---------- Shader

void main()
{
vec2 k = uInvSrcSize*floor(uSrcSize*vTexCoord + 0.5);
vec2 texCoord = k + uInvSrcSize*clamp(uDstSize*(vTexCoord - k), -0.5, 0.5);

gl_FragColor = uColor * texture2D(uTexture, texCoord);
}

-----

#version 100
precision lowp float;


//---------- Parameters

varying vec2 vTexCoord;

uniform sampler2D uTexture;
uniform vec4 uColor;

//---------- Shader

void main()
{
gl_FragColor = uColor * texture2D(uTexture, vTexCoord);
}

-----

#version 100
precision mediump float;

attribute vec2 aPos;
attribute vec2 aTexCoord;

varying vec2 vTexCoord;

void main()
{
gl_Position = vec4(aPos, 0.0, 1.0);
vTexCoord = aTexCoord;
}​
 
okay so im a bit frustrated, got 2.20 hakchi setup, dumped my kernel, dropped games into hakchi folder, everything is showing up in hakchi, loaded games onto the snes mini, they show up with boxart but when i boot them up nothing seems to happen, no error, it just goes back to the menu with all the games. any suggestions?

You may have to re-convert your games with the recent version. I learned that the hard way.
 
okay so im a bit frustrated, got 2.20 hakchi setup, dumped my kernel, dropped games into hakchi folder, everything is showing up in hakchi, loaded games onto the snes mini, they show up with boxart but when i boot them up nothing seems to happen, no error, it just goes back to the menu with all the games. any suggestions?
Did you flash the custom kernel?
 
  • Like
Reactions: youngtune27
how do i re-convert them?

--------------------- MERGED ---------------------------

yes i did flash the custom kernel, and idk how to quote and the like yet so sorry if i make this confusing XD
 
when you add games should the original one's box be checked or not. Should it ever be checked when adding or syncing games? How do you edit the one or two player settings for each game? Can you do it after they are installed? Do you do it before/while you're installing? How do you delete selective games once they are loaded? Great work, great tool, love it!
 
Just used the new Hackchi to add 68 SNES roms. Games seem to work fine . One issue.. When I turn the power button to off I get a C8 error. I then have to turn SNES mini back on then off right away and it goes into it's normal shut down. Anyone else? Any way to fix it? I saved my original kernal so if I have to flash it back to stock that isnt an issue.

thanks!
 
First, just wanted to say thanks to cluster, madmonkey and everyone that has helped with hakchi.

I loaded 50 games without folders and all is good. There's only one tiny issue when scrolling through the games only like 32 thumbnails show up below the cover art. I believe someone mentioned this before but not sure. Anyone else confirm this?

If someone knows, is it safe to have 50 games on the main menu without folders if I'm planning to use many save states. Wondering if that would cause an error down the line.
 
So, me in my infinite wisdom didn't manually back up the kernel. Does this program automatically do that? Or an I SOL should I need it later?

You..really should back that up as soon as possible. You may have to uninstall or something. If you brick, you're screwed without that stock kernel.
 
You..really should back that up as soon as possible. You may have to uninstall or something. If you brick, you're screwed without that stock kernel.

Totally forgot to add this, but I already modified the system. Stock is gone. Oh noes. C'est la vie.
 
Totally forgot to add this, but I already modified the system. Stock is gone. Oh noes. C'est la vie.

Just don't brick it, that's all I can say. Unless you can find a similar kernel floating on the internet...IDK.

Depending on the version you used, a backup should be easily found.
 
Last edited by the_randomizer,
I currently have Hakchi v2.16c installed on my computer and used it to add 1,000+ roms to my NES Classic...so to upgrade to the new version, would I lose all of my games and saves and have to start all over re-uploading all of those roms to my NES Classic and re-downloading all of the artwork for them?
 
Last edited by Johnny Proctor,
Is it not unique to the specific console? Just the hardware?

The version of the firmware.

Telnet in, execute 'cat /etc/issue', and tell me what the output is (by PM, because I don't follow this thread in real-time). I'll help you out.

@Cluster - would it be possible to dynamically add the underlying firmware version to the About HTML you output from the console menu? It'd help a lot of folks who aren't comfortable with telnet/ftp...as far as I know, it isn't found anywhere else within the Nintendo UI.
 
Last edited by rhester72,

Site & Scene News

Popular threads in this forum