From 1fa7066477bdfe85e7d1a216c2bee6f941b3f365 Mon Sep 17 00:00:00 2001 From: dualshock-tools Date: Sun, 13 Jul 2025 10:51:27 +0200 Subject: [PATCH] DS4: fix random range-calib fail. Add more DS5 colors --- core.js | 18 ++++++++++++++++-- index.html | 2 +- lang/ar_ar.json | 6 ++++++ lang/bg_bg.json | 6 ++++++ lang/cz_cz.json | 6 ++++++ lang/de_de.json | 6 ++++++ lang/es_es.json | 6 ++++++ lang/fr_fr.json | 6 ++++++ lang/hu_hu.json | 6 ++++++ lang/it_it.json | 6 ++++++ lang/jp_jp.json | 6 ++++++ lang/ko_kr.json | 6 ++++++ lang/nl_nl.json | 6 ++++++ lang/pl_pl.json | 8 +++++++- lang/pt_br.json | 6 ++++++ lang/pt_pt.json | 6 ++++++ lang/rs_rs.json | 6 ++++++ lang/ru_ru.json | 8 +++++++- lang/tr_tr.json | 6 ++++++ lang/ua_ua.json | 8 +++++++- lang/zh_cn.json | 6 ++++++ lang/zh_tw.json | 6 ++++++ 22 files changed, 140 insertions(+), 6 deletions(-) diff --git a/core.js b/core.js index 37786a6..3ce385c 100644 --- a/core.js +++ b/core.js @@ -236,6 +236,7 @@ async function ds4_calibrate_range_begin() { try { // Begin await device.sendFeatureReport(0x90, alloc_req(0x90, [1,1,2])) + await new Promise(r => setTimeout(r, 200)); // Assert data = await device.receiveFeatureReport(0x91) @@ -261,6 +262,7 @@ async function ds4_calibrate_range_end() { try { // Write await device.sendFeatureReport(0x90, alloc_req(0x90, [2,1,2])) + await new Promise(r => setTimeout(r, 200)); data = await device.receiveFeatureReport(0x91) data2 = await device.receiveFeatureReport(0x92) @@ -289,6 +291,7 @@ async function ds4_calibrate_sticks_begin() { try { // Begin await device.sendFeatureReport(0x90, alloc_req(0x90, [1,1,1])) + await new Promise(r => setTimeout(r, 200)); // Assert data = await device.receiveFeatureReport(0x91); @@ -316,6 +319,7 @@ async function ds4_calibrate_sticks_sample() { try { // Sample await device.sendFeatureReport(0x90, alloc_req(0x90, [3,1,1])) + await new Promise(r => setTimeout(r, 200)); // Assert data = await device.receiveFeatureReport(0x91); @@ -342,6 +346,7 @@ async function ds4_calibrate_sticks_end() { try { // Write await device.sendFeatureReport(0x90, alloc_req(0x90, [2,1,1])) + await new Promise(r => setTimeout(r, 200)); data = await device.receiveFeatureReport(0x91); data2 = await device.receiveFeatureReport(0x92); @@ -371,6 +376,7 @@ async function ds4_calibrate_sticks() { // Begin await device.sendFeatureReport(0x90, alloc_req(0x90, [1,1,1])) + await new Promise(r => setTimeout(r, 200)); // Assert let data = await device.receiveFeatureReport(0x91); @@ -384,11 +390,12 @@ async function ds4_calibrate_sticks() { } set_progress(10); - await new Promise(r => setTimeout(r, 100)); + await new Promise(r => setTimeout(r, 200)); for(var i=0;i<3;i++) { // Sample await device.sendFeatureReport(0x90, alloc_req(0x90, [3,1,1])) + await new Promise(r => setTimeout(r, 200)); // Assert let data = await device.receiveFeatureReport(0x91); @@ -407,6 +414,7 @@ async function ds4_calibrate_sticks() { // Write await device.sendFeatureReport(0x90, alloc_req(0x90, [2,1,1])) + await new Promise(r => setTimeout(r, 200)); if(data.getUint32(0, false) != 0x91010101 || data2.getUint32(0, false) != 0x920101FF) { let d1 = dec2hex32(data.getUint32(0, false)); let d2 = dec2hex32(data2.getUint32(0, false)); @@ -559,9 +567,15 @@ function ds5_color(x) { '07' : l('Volcanic Red'), '08' : l('Sterling Silver'), '09' : l('Cobalt Blue'), + '10' : l('Chroma Teal'), + '11' : l('Chroma Indigo'), + '12' : l('Chroma Pearl'), '30' : l('30th Anniversary'), 'Z1' : l('God of War Ragnarok'), - 'Z3' : l('Astro Bot') + 'Z2' : l('Spider-Man 2'), + 'Z3' : l('Astro Bot'), + 'Z4' : l('Fortnite'), + 'Z6' : l('The Last of Us') }; const colorCode = x.slice(4, 6); diff --git a/index.html b/index.html index e41f6ed..dd8810d 100644 --- a/index.html +++ b/index.html @@ -830,7 +830,7 @@ dl.row dd { font-family: monospace; }