diff --git a/CHANGELOG.md b/CHANGELOG.md index c710434..a30ea91 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ +# 1.0.6 + +## All + + * Better version of my 1.0.5 video fix. # 1.0.5 ## All diff --git a/package.json b/package.json index 493cdda..5bab90f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "6502.ts", - "version": "1.0.5", + "version": "1.0.6", "description": "A 6502 emulator written in typescript", "author": "cnspeckn@googlemail.com", "license": "MIT", diff --git a/src/web/driver/video/NtscProcessor.ts b/src/web/driver/video/NtscProcessor.ts index e1fb4a0..609766a 100644 --- a/src/web/driver/video/NtscProcessor.ts +++ b/src/web/driver/video/NtscProcessor.ts @@ -91,7 +91,7 @@ class NtscProcessor implements Processor { render(texture: WebGLTexture): void { this._pass(texture, this._targetPass1, this._programPass1, 960); - this._pass(this._targetPass1, this._targetPass2, this._programPass2, 960); + this._pass(this._targetPass1, this._targetPass2, this._programPass2, 480); } getWidth(): number { @@ -131,7 +131,7 @@ class NtscProcessor implements Processor { gl.TEXTURE_2D, 0, gl.RGBA, - 960, + texture === this._targetPass2 ? 480 : 960, height, 0, gl.RGBA, diff --git a/src/web/driver/video/shader.ts b/src/web/driver/video/shader.ts index d6a1654..c297e3f 100644 --- a/src/web/driver/video/shader.ts +++ b/src/web/driver/video/shader.ts @@ -51,7 +51,7 @@ export namespace vsh { export const enum attribute { vertexPosition = 'a_VertexPosition', - textureCoordinate = 'a_TextureCoordinate' + textureCoordinate = 'a_TextureCoordinate', } } } @@ -71,7 +71,7 @@ export namespace fsh { `; export const enum uniform { - textureUnit = 'u_Sampler0' + textureUnit = 'u_Sampler0', } } @@ -93,7 +93,7 @@ export namespace fsh { export const enum uniform { textureUnit = 'u_Sampler0', - gamma = 'u_Gamma' + gamma = 'u_Gamma', } } @@ -130,7 +130,7 @@ export namespace fsh { export const enum uniform { level = 'u_PhosphorLevel', textureUnitNew = 'u_Sampler_NewImage', - textureUnitPrevious = 'u_Sampler_PreviousImage' + textureUnitPrevious = 'u_Sampler_PreviousImage', } } @@ -216,7 +216,7 @@ export namespace fsh { export const enum uniform { textureUnit = 'u_Sampler0', artifacting = 'u_Artifacting', - fringing = 'u_Fringing' + fringing = 'u_Fringing', } } @@ -246,7 +246,7 @@ export namespace fsh { 0.084016453, 0.1355635, 0.175261268, - 0.190176552 + 0.190176552, ]; const chromaFilter = [ @@ -274,7 +274,7 @@ export namespace fsh { 0.068803602, 0.074356193, 0.077856564, - 0.079052396 + 0.079052396, ]; function maybeUnpack(capabilities: Capabilities, expr: string): string { @@ -321,7 +321,7 @@ export namespace fsh { } vec3 fetch_offset(int offset) { - float x = v_TextureCoordinate.x + float(offset) / 960.0; + float x = (floor(v_TextureCoordinate.x * 960.0) + 0.5 + float(offset)) / 960.0; return step(0.0, x) * step(-1.0, -x) * ${maybeUnpack(capabilities, 'texture2D(u_Sampler0, vec2(x, v_TextureCoordinate.y))')}; @@ -351,7 +351,7 @@ export namespace fsh { `; export const enum uniform { - textureUnit = 'u_Sampler0' + textureUnit = 'u_Sampler0', } } @@ -376,7 +376,7 @@ export namespace fsh { export const enum uniform { textureUnit = 'u_Sampler0', level = 'u_Level', - height = 'u_Height' + height = 'u_Height', } } }