mirror of
https://github.com/xdsopl/robot36.git
synced 2026-01-27 09:54:15 +01:00
added PD50, PD90, PD120, PD160, PD240 and PD290
This commit is contained in:
parent
ab76867c00
commit
e42cad9ddf
|
|
@ -37,8 +37,8 @@ public class Decoder {
|
|||
private final int channelConfig = AudioFormat.CHANNEL_IN_MONO;
|
||||
private final int audioFormat = AudioFormat.ENCODING_PCM_16BIT;
|
||||
private final int sampleRate = 44100;
|
||||
private final int maxHeight = freeRunReserve(496);
|
||||
private final int maxWidth = 640;
|
||||
private final int maxHeight = freeRunReserve(616);
|
||||
private final int maxWidth = 800;
|
||||
private final short[] audioBuffer;
|
||||
private final int[] pixelBuffer;
|
||||
private final int[] spectrumBuffer;
|
||||
|
|
@ -72,7 +72,13 @@ public class Decoder {
|
|||
private final int mode_scottie2 = 6;
|
||||
private final int mode_scottieDX = 7;
|
||||
private final int mode_wrasseSC2_180 = 8;
|
||||
private final int mode_pd180 = 9;
|
||||
private final int mode_pd50 = 9;
|
||||
private final int mode_pd90 = 10;
|
||||
private final int mode_pd120 = 11;
|
||||
private final int mode_pd160 = 12;
|
||||
private final int mode_pd180 = 13;
|
||||
private final int mode_pd240 = 14;
|
||||
private final int mode_pd290 = 15;
|
||||
|
||||
private final Thread thread = new Thread() {
|
||||
@Override
|
||||
|
|
@ -168,7 +174,13 @@ public class Decoder {
|
|||
void scottie2_mode() { rsDecoder.invoke_scottie2_mode(); }
|
||||
void scottieDX_mode() { rsDecoder.invoke_scottieDX_mode(); }
|
||||
void wrasseSC2_180_mode() { rsDecoder.invoke_wrasseSC2_180_mode(); }
|
||||
void pd50_mode() { rsDecoder.invoke_pd50_mode(); }
|
||||
void pd90_mode() { rsDecoder.invoke_pd90_mode(); }
|
||||
void pd120_mode() { rsDecoder.invoke_pd120_mode(); }
|
||||
void pd160_mode() { rsDecoder.invoke_pd160_mode(); }
|
||||
void pd180_mode() { rsDecoder.invoke_pd180_mode(); }
|
||||
void pd240_mode() { rsDecoder.invoke_pd240_mode(); }
|
||||
void pd290_mode() { rsDecoder.invoke_pd290_mode(); }
|
||||
|
||||
int freeRunReserve(int height) { return (height * 3) / 2; }
|
||||
void increaseUpdateRate() { updateRate = Math.min(4, updateRate + 1); }
|
||||
|
|
@ -214,10 +226,34 @@ public class Decoder {
|
|||
image.setImageResolution(320, freeRunReserve(256));
|
||||
updateTitle(R.string.action_wrasseSC2_180_mode);
|
||||
break;
|
||||
case mode_pd50:
|
||||
image.setImageResolution(320, freeRunReserve(256));
|
||||
updateTitle(R.string.action_pd50_mode);
|
||||
break;
|
||||
case mode_pd90:
|
||||
image.setImageResolution(320, freeRunReserve(256));
|
||||
updateTitle(R.string.action_pd90_mode);
|
||||
break;
|
||||
case mode_pd120:
|
||||
image.setImageResolution(640, freeRunReserve(496));
|
||||
updateTitle(R.string.action_pd120_mode);
|
||||
break;
|
||||
case mode_pd160:
|
||||
image.setImageResolution(512, freeRunReserve(400));
|
||||
updateTitle(R.string.action_pd160_mode);
|
||||
break;
|
||||
case mode_pd180:
|
||||
image.setImageResolution(640, freeRunReserve(496));
|
||||
updateTitle(R.string.action_pd180_mode);
|
||||
break;
|
||||
case mode_pd240:
|
||||
image.setImageResolution(640, freeRunReserve(496));
|
||||
updateTitle(R.string.action_pd240_mode);
|
||||
break;
|
||||
case mode_pd290:
|
||||
image.setImageResolution(800, freeRunReserve(616));
|
||||
updateTitle(R.string.action_pd290_mode);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -240,9 +240,27 @@ public class MainActivity extends Activity {
|
|||
case R.id.action_wrasseSC2_180_mode:
|
||||
decoder.wrasseSC2_180_mode();
|
||||
return true;
|
||||
case R.id.action_pd50_mode:
|
||||
decoder.pd50_mode();
|
||||
return true;
|
||||
case R.id.action_pd90_mode:
|
||||
decoder.pd90_mode();
|
||||
return true;
|
||||
case R.id.action_pd120_mode:
|
||||
decoder.pd120_mode();
|
||||
return true;
|
||||
case R.id.action_pd160_mode:
|
||||
decoder.pd160_mode();
|
||||
return true;
|
||||
case R.id.action_pd180_mode:
|
||||
decoder.pd180_mode();
|
||||
return true;
|
||||
case R.id.action_pd240_mode:
|
||||
decoder.pd240_mode();
|
||||
return true;
|
||||
case R.id.action_pd290_mode:
|
||||
decoder.pd290_mode();
|
||||
return true;
|
||||
}
|
||||
return super.onOptionsItemSelected(item);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,40 +20,42 @@
|
|||
android:icon="@android:drawable/ic_menu_close_clear_cancel"
|
||||
android:showAsAction="ifRoom" />
|
||||
|
||||
<item android:id="@+id/action_softer_image" android:title="@string/action_softer_image"
|
||||
android:orderInCategory="100" android:showAsAction="never" />
|
||||
<item android:id="@+id/action_sharper_image" android:title="@string/action_sharper_image"
|
||||
android:orderInCategory="100" android:showAsAction="never" />
|
||||
<item android:id="@+id/action_toggle_scaling" android:title="@string/action_toggle_scaling"
|
||||
android:orderInCategory="100" android:showAsAction="never" />
|
||||
<item android:id="@+id/action_toggle_debug" android:title="@string/action_toggle_debug"
|
||||
android:orderInCategory="100" android:showAsAction="never" />
|
||||
<item android:id="@+id/action_toggle_auto" android:title="@string/action_toggle_auto"
|
||||
android:orderInCategory="100" android:showAsAction="never" />
|
||||
<item android:id="@+id/action_toggle_analyzer" android:title="@string/action_toggle_analyzer"
|
||||
android:orderInCategory="100" android:showAsAction="never" />
|
||||
<item android:id="@+id/action_increase_update_rate" android:title="@string/action_increase_update_rate"
|
||||
android:orderInCategory="100" android:showAsAction="never" />
|
||||
<item android:id="@+id/action_decrease_update_rate" android:title="@string/action_decrease_update_rate"
|
||||
android:orderInCategory="100" android:showAsAction="never" />
|
||||
<item android:id="@+id/action_raw_mode" android:title="@string/action_raw_mode"
|
||||
android:orderInCategory="100" android:showAsAction="never" />
|
||||
<item android:id="@+id/action_robot36_mode" android:title="@string/action_robot36_mode"
|
||||
android:orderInCategory="100" android:showAsAction="never" />
|
||||
<item android:id="@+id/action_robot72_mode" android:title="@string/action_robot72_mode"
|
||||
android:orderInCategory="100" android:showAsAction="never" />
|
||||
<item android:id="@+id/action_pd180_mode" android:title="@string/action_pd180_mode"
|
||||
android:orderInCategory="100" android:showAsAction="never" />
|
||||
<item android:id="@+id/action_martin1_mode" android:title="@string/action_martin1_mode"
|
||||
android:orderInCategory="100" android:showAsAction="never" />
|
||||
<item android:id="@+id/action_martin2_mode" android:title="@string/action_martin2_mode"
|
||||
android:orderInCategory="100" android:showAsAction="never" />
|
||||
<item android:id="@+id/action_scottie1_mode" android:title="@string/action_scottie1_mode"
|
||||
android:orderInCategory="100" android:showAsAction="never" />
|
||||
<item android:id="@+id/action_scottie2_mode" android:title="@string/action_scottie2_mode"
|
||||
android:orderInCategory="100" android:showAsAction="never" />
|
||||
<item android:id="@+id/action_scottieDX_mode" android:title="@string/action_scottieDX_mode"
|
||||
android:orderInCategory="100" android:showAsAction="never" />
|
||||
<item android:id="@+id/action_wrasseSC2_180_mode" android:title="@string/action_wrasseSC2_180_mode"
|
||||
android:orderInCategory="100" android:showAsAction="never" />
|
||||
<item android:id="@+id/action_softer_image" android:title="@string/action_softer_image" />
|
||||
<item android:id="@+id/action_sharper_image" android:title="@string/action_sharper_image" />
|
||||
|
||||
<item android:id="@+id/action_toggle_scaling" android:title="@string/action_toggle_scaling" />
|
||||
<item android:id="@+id/action_toggle_debug" android:title="@string/action_toggle_debug" />
|
||||
<item android:id="@+id/action_toggle_auto" android:title="@string/action_toggle_auto" />
|
||||
<item android:id="@+id/action_toggle_analyzer" android:title="@string/action_toggle_analyzer" />
|
||||
|
||||
<item android:id="@+id/action_increase_update_rate" android:title="@string/action_increase_update_rate" />
|
||||
<item android:id="@+id/action_decrease_update_rate" android:title="@string/action_decrease_update_rate" />
|
||||
|
||||
<item android:id="@+id/action_raw_mode" android:title="@string/action_raw_mode" />
|
||||
|
||||
<item android:title="@string/robot_modes"><menu>
|
||||
<item android:id="@+id/action_robot36_mode" android:title="@string/action_robot36_mode" />
|
||||
<item android:id="@+id/action_robot72_mode" android:title="@string/action_robot72_mode" />
|
||||
</menu></item>
|
||||
<item android:title="@string/pd_modes"><menu>
|
||||
<item android:id="@+id/action_pd50_mode" android:title="@string/action_pd50_mode" />
|
||||
<item android:id="@+id/action_pd90_mode" android:title="@string/action_pd90_mode" />
|
||||
<item android:id="@+id/action_pd120_mode" android:title="@string/action_pd120_mode" />
|
||||
<item android:id="@+id/action_pd160_mode" android:title="@string/action_pd160_mode" />
|
||||
<item android:id="@+id/action_pd180_mode" android:title="@string/action_pd180_mode" />
|
||||
<item android:id="@+id/action_pd240_mode" android:title="@string/action_pd240_mode" />
|
||||
<item android:id="@+id/action_pd290_mode" android:title="@string/action_pd290_mode" />
|
||||
</menu></item>
|
||||
<item android:title="@string/martin_modes"><menu>
|
||||
<item android:id="@+id/action_martin1_mode" android:title="@string/action_martin1_mode" />
|
||||
<item android:id="@+id/action_martin2_mode" android:title="@string/action_martin2_mode" />
|
||||
</menu></item>
|
||||
<item android:title="@string/scottie_modes"><menu>
|
||||
<item android:id="@+id/action_scottie1_mode" android:title="@string/action_scottie1_mode" />
|
||||
<item android:id="@+id/action_scottie2_mode" android:title="@string/action_scottie2_mode" />
|
||||
<item android:id="@+id/action_scottieDX_mode" android:title="@string/action_scottieDX_mode" />
|
||||
</menu></item>
|
||||
<item android:title="@string/wrasse_modes"><menu>
|
||||
<item android:id="@+id/action_wrasseSC2_180_mode" android:title="@string/action_wrasseSC2_180_mode" />
|
||||
</menu></item>
|
||||
</menu>
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
|
||||
<string name="app_name">Robot36</string>
|
||||
<string name="decoder_running">"Dekodierer läuft</string>
|
||||
<string name="action_save_image">Bild speichern</string>
|
||||
|
|
@ -13,7 +12,13 @@
|
|||
<string name="action_raw_mode">Roh Modus</string>
|
||||
<string name="action_robot36_mode">Robot36 Modus</string>
|
||||
<string name="action_robot72_mode">Robot72 Modus</string>
|
||||
<string name="action_pd50_mode">PD50 Modus</string>
|
||||
<string name="action_pd90_mode">PD90 Modus</string>
|
||||
<string name="action_pd120_mode">PD120 Modus</string>
|
||||
<string name="action_pd160_mode">PD160 Modus</string>
|
||||
<string name="action_pd180_mode">PD180 Modus</string>
|
||||
<string name="action_pd240_mode">PD240 Modus</string>
|
||||
<string name="action_pd290_mode">PD290 Modus</string>
|
||||
<string name="action_martin1_mode">Martin1 Modus</string>
|
||||
<string name="action_martin2_mode">Martin2 Modus</string>
|
||||
<string name="action_scottie1_mode">Scottie1 Modus</string>
|
||||
|
|
@ -28,5 +33,9 @@
|
|||
<string name="spectrogram_view">Spektrogramm Ansicht</string>
|
||||
<string name="meter_view">Aussteuerungsmesser Ansicht</string>
|
||||
<string name="action_share">Teilen</string>
|
||||
|
||||
<string name="robot_modes">Robot Modi</string>
|
||||
<string name="pd_modes">PD Modi</string>
|
||||
<string name="martin_modes">Martin Modi</string>
|
||||
<string name="scottie_modes">Scottie Modi</string>
|
||||
<string name="wrasse_modes">Wrasse Modi</string>
|
||||
</resources>
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
|
||||
<string name="app_name">Robot36</string>
|
||||
<string name="decoder_running">"decoder is running</string>
|
||||
<string name="action_save_image">Save Image</string>
|
||||
|
|
@ -13,7 +12,13 @@
|
|||
<string name="action_raw_mode">Raw Mode</string>
|
||||
<string name="action_robot36_mode">Robot36 Mode</string>
|
||||
<string name="action_robot72_mode">Robot72 Mode</string>
|
||||
<string name="action_pd50_mode">PD50 Mode</string>
|
||||
<string name="action_pd90_mode">PD90 Mode</string>
|
||||
<string name="action_pd120_mode">PD120 Mode</string>
|
||||
<string name="action_pd160_mode">PD160 Mode</string>
|
||||
<string name="action_pd180_mode">PD180 Mode</string>
|
||||
<string name="action_pd240_mode">PD240 Mode</string>
|
||||
<string name="action_pd290_mode">PD290 Mode</string>
|
||||
<string name="action_martin1_mode">Martin1 Mode</string>
|
||||
<string name="action_martin2_mode">Martin2 Mode</string>
|
||||
<string name="action_scottie1_mode">Scottie1 Mode</string>
|
||||
|
|
@ -28,5 +33,9 @@
|
|||
<string name="spectrogram_view">Spectrogram View</string>
|
||||
<string name="meter_view">VU Meter View</string>
|
||||
<string name="action_share">Share</string>
|
||||
|
||||
<string name="robot_modes">Robot Modes</string>
|
||||
<string name="pd_modes">PD Modes</string>
|
||||
<string name="martin_modes">Martin Modes</string>
|
||||
<string name="scottie_modes">Scottie Modes</string>
|
||||
<string name="wrasse_modes">Wrasse Modes</string>
|
||||
</resources>
|
||||
|
|
|
|||
|
|
@ -111,8 +111,20 @@ static int calibration_detector(float dat_value, int cnt_quantized)
|
|||
return mode_scottieDX;
|
||||
case 0xb7:
|
||||
return mode_wrasseSC2_180;
|
||||
case 0xdd:
|
||||
return mode_pd50;
|
||||
case 0x63:
|
||||
return mode_pd90;
|
||||
case 0x5f:
|
||||
return mode_pd120;
|
||||
case 0xe2:
|
||||
return mode_pd160;
|
||||
case 0x60:
|
||||
return mode_pd180;
|
||||
case 0xe1:
|
||||
return mode_pd240;
|
||||
case 0xde:
|
||||
return mode_pd290;
|
||||
default:
|
||||
return -1;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -33,7 +33,13 @@ static const int mode_scottie1 = 5;
|
|||
static const int mode_scottie2 = 6;
|
||||
static const int mode_scottieDX = 7;
|
||||
static const int mode_wrasseSC2_180 = 8;
|
||||
static const int mode_pd180 = 9;
|
||||
static const int mode_pd50 = 9;
|
||||
static const int mode_pd90 = 10;
|
||||
static const int mode_pd120 = 11;
|
||||
static const int mode_pd160 = 12;
|
||||
static const int mode_pd180 = 13;
|
||||
static const int mode_pd240 = 14;
|
||||
static const int mode_pd290 = 15;
|
||||
|
||||
static const float sync_buildup_ms = 1.1f;
|
||||
static const float scanline_tolerance = 0.05f;
|
||||
|
|
|
|||
|
|
@ -56,7 +56,13 @@ void initialize(float rate, int length, int iw, int ih, int sw, int sh, int sgw,
|
|||
scottie2_scanline_length = round((scottie2_scanline_ms * sample_rate) / 1000.0f);
|
||||
scottieDX_scanline_length = round((scottieDX_scanline_ms * sample_rate) / 1000.0f);
|
||||
wrasseSC2_180_scanline_length = round((wrasseSC2_180_scanline_ms * sample_rate) / 1000.0f);
|
||||
pd50_scanline_length = round((pd50_scanline_ms * sample_rate) / 1000.0f);
|
||||
pd90_scanline_length = round((pd90_scanline_ms * sample_rate) / 1000.0f);
|
||||
pd120_scanline_length = round((pd120_scanline_ms * sample_rate) / 1000.0f);
|
||||
pd160_scanline_length = round((pd160_scanline_ms * sample_rate) / 1000.0f);
|
||||
pd180_scanline_length = round((pd180_scanline_ms * sample_rate) / 1000.0f);
|
||||
pd240_scanline_length = round((pd240_scanline_ms * sample_rate) / 1000.0f);
|
||||
pd290_scanline_length = round((pd290_scanline_ms * sample_rate) / 1000.0f);
|
||||
|
||||
const float pairwise_minimum_of_scanline_time_distances = 0.0079825f;
|
||||
maximum_absolute_deviaton = 0.5f * pairwise_minimum_of_scanline_time_distances * sample_rate;
|
||||
|
|
|
|||
|
|
@ -21,18 +21,10 @@ limitations under the License.
|
|||
#include "state.rsh"
|
||||
#include "exports.rsh"
|
||||
|
||||
static int freerun_reserve(int height)
|
||||
{
|
||||
return (height * 3) / 2;
|
||||
}
|
||||
void toggle_auto()
|
||||
{
|
||||
automatic_mode_detection ^= 1;
|
||||
}
|
||||
void toggle_debug()
|
||||
{
|
||||
debug_mode ^= 1;
|
||||
}
|
||||
static int freerun_reserve(int height) { return (height * 3) / 2; }
|
||||
void toggle_auto() { automatic_mode_detection ^= 1; }
|
||||
void toggle_debug() { debug_mode ^= 1; }
|
||||
|
||||
void raw_mode()
|
||||
{
|
||||
blur_power = -1;
|
||||
|
|
@ -46,6 +38,7 @@ void raw_mode()
|
|||
maximum_length = buffer_length;
|
||||
scanline_length = maximum_length;
|
||||
}
|
||||
|
||||
void robot36_mode()
|
||||
{
|
||||
blur_power = 2;
|
||||
|
|
@ -79,9 +72,10 @@ void robot36_mode()
|
|||
u_end = v_end = round((uv_end_ms * sample_rate) / 1000.0f);
|
||||
|
||||
scanline_length = robot36_scanline_length;
|
||||
minimum_length = ((1.0f - scanline_tolerance) * robot36_scanline_ms * sample_rate) / 1000.0f;
|
||||
maximum_length = ((1.0f + scanline_tolerance) * robot36_scanline_ms * sample_rate) / 1000.0f;
|
||||
minimum_length = (1.0f - scanline_tolerance) * robot36_scanline_length;
|
||||
maximum_length = (1.0f + scanline_tolerance) * robot36_scanline_length;
|
||||
}
|
||||
|
||||
void robot72_mode()
|
||||
{
|
||||
blur_power = 3;
|
||||
|
|
@ -123,21 +117,21 @@ void robot72_mode()
|
|||
u_end = round((u_end_ms * sample_rate) / 1000.0f);
|
||||
|
||||
scanline_length = robot72_scanline_length;
|
||||
minimum_length = ((1.0f - scanline_tolerance) * robot72_scanline_ms * sample_rate) / 1000.0f;
|
||||
maximum_length = ((1.0f + scanline_tolerance) * robot72_scanline_ms * sample_rate) / 1000.0f;
|
||||
minimum_length = (1.0f - scanline_tolerance) * robot72_scanline_length;
|
||||
maximum_length = (1.0f + scanline_tolerance) * robot72_scanline_length;
|
||||
}
|
||||
void pd180_mode()
|
||||
|
||||
static void pd_mode(int mode, int scanline, int blur, float yuv_scan_ms, int width, int height)
|
||||
{
|
||||
blur_power = 3;
|
||||
*current_mode = mode_pd180;
|
||||
blur_power = blur;
|
||||
*current_mode = mode;
|
||||
current_decoder = decoder_pd;
|
||||
bitmap_width = 640;
|
||||
bitmap_height = 496;
|
||||
bitmap_width = width;
|
||||
bitmap_height = height;
|
||||
freerun_height = freerun_reserve(bitmap_height);
|
||||
const float tolerance = 0.8f;
|
||||
const float sync_ms = 20.0f;
|
||||
const float porch_ms = 2.08f;
|
||||
const float yuv_scan_ms = 183.04f;
|
||||
sync_length = tolerance * (sync_ms * sample_rate) / 1000.0f;
|
||||
|
||||
float y_even_begin_ms = porch_ms;
|
||||
|
|
@ -158,14 +152,22 @@ void pd180_mode()
|
|||
y_odd_begin = round((y_odd_begin_ms * sample_rate) / 1000.0f);
|
||||
y_odd_end = round((y_odd_end_ms * sample_rate) / 1000.0f);
|
||||
|
||||
scanline_length = pd180_scanline_length;
|
||||
minimum_length = ((1.0f - scanline_tolerance) * pd180_scanline_ms * sample_rate) / 1000.0f;
|
||||
maximum_length = ((1.0f + scanline_tolerance) * pd180_scanline_ms * sample_rate) / 1000.0f;
|
||||
scanline_length = scanline;
|
||||
minimum_length = (1.0f - scanline_tolerance) * scanline;
|
||||
maximum_length = (1.0f + scanline_tolerance) * scanline;
|
||||
}
|
||||
void martin1_mode()
|
||||
void pd50_mode() { pd_mode(mode_pd50, pd50_scanline_length, 3, 91.52f, 320, 256); }
|
||||
void pd90_mode() { pd_mode(mode_pd90, pd90_scanline_length, 4, 170.24f, 320, 256); }
|
||||
void pd120_mode() { pd_mode(mode_pd120, pd120_scanline_length, 3, 121.6f, 640, 496); }
|
||||
void pd160_mode() { pd_mode(mode_pd160, pd160_scanline_length, 4, 195.584f, 512, 400); }
|
||||
void pd180_mode() { pd_mode(mode_pd180, pd180_scanline_length, 3, 183.04f, 640, 496); }
|
||||
void pd240_mode() { pd_mode(mode_pd240, pd240_scanline_length, 4, 244.48f, 640, 496); }
|
||||
void pd290_mode() { pd_mode(mode_pd290, pd290_scanline_length, 3, 228.8f, 800, 616); }
|
||||
|
||||
static void martin_mode(int mode, int scanline, int blur, float rgb_scan_ms)
|
||||
{
|
||||
blur_power = 3;
|
||||
*current_mode = mode_martin1;
|
||||
blur_power = blur;
|
||||
*current_mode = mode;
|
||||
current_decoder = decoder_rgb;
|
||||
bitmap_width = 320;
|
||||
bitmap_height = 256;
|
||||
|
|
@ -173,7 +175,6 @@ void martin1_mode()
|
|||
const float tolerance = 0.5f;
|
||||
const float sync_ms = 4.862f;
|
||||
const float sync_porch_ms = 0.572f;
|
||||
const float rgb_scan_ms = 146.432f;
|
||||
const float seperator_ms = 0.572f;
|
||||
seperator_length = round((seperator_ms * sample_rate) / 1000.0f);
|
||||
sync_length = tolerance * (sync_ms * sample_rate) / 1000.0f;
|
||||
|
|
@ -192,48 +193,17 @@ void martin1_mode()
|
|||
b_end = round((b_end_ms * sample_rate) / 1000.0f);
|
||||
b_begin = round((b_begin_ms * sample_rate) / 1000.0f);
|
||||
|
||||
scanline_length = martin1_scanline_length;
|
||||
minimum_length = ((1.0f - scanline_tolerance) * martin1_scanline_ms * sample_rate) / 1000.0f;
|
||||
maximum_length = ((1.0f + scanline_tolerance) * martin1_scanline_ms * sample_rate) / 1000.0f;
|
||||
scanline_length = scanline;
|
||||
minimum_length = (1.0f - scanline_tolerance) * scanline;
|
||||
maximum_length = (1.0f + scanline_tolerance) * scanline;
|
||||
}
|
||||
void martin2_mode()
|
||||
void martin1_mode() { martin_mode(mode_martin1, martin1_scanline_length, 3, 146.432f); }
|
||||
void martin2_mode() { martin_mode(mode_martin2, martin2_scanline_length, 2, 73.216f); }
|
||||
|
||||
static void scottie_mode(int mode, int scanline, int blur, float rgb_scan_ms)
|
||||
{
|
||||
blur_power = 2;
|
||||
*current_mode = mode_martin2;
|
||||
current_decoder = decoder_rgb;
|
||||
bitmap_width = 320;
|
||||
bitmap_height = 256;
|
||||
freerun_height = freerun_reserve(bitmap_height);
|
||||
const float tolerance = 0.5f;
|
||||
const float sync_ms = 4.862f;
|
||||
const float sync_porch_ms = 0.572f;
|
||||
const float rgb_scan_ms = 73.216f;
|
||||
const float seperator_ms = 0.572f;
|
||||
seperator_length = round((seperator_ms * sample_rate) / 1000.0f);
|
||||
sync_length = tolerance * (sync_ms * sample_rate) / 1000.0f;
|
||||
|
||||
float g_begin_ms = sync_porch_ms;
|
||||
float g_end_ms = g_begin_ms + rgb_scan_ms;
|
||||
float b_begin_ms = g_end_ms + seperator_ms;
|
||||
float b_end_ms = b_begin_ms + rgb_scan_ms;
|
||||
float r_begin_ms = b_end_ms + seperator_ms;
|
||||
float r_end_ms = r_begin_ms + rgb_scan_ms;
|
||||
|
||||
r_begin = round((r_begin_ms * sample_rate) / 1000.0f);
|
||||
r_end = round((r_end_ms * sample_rate) / 1000.0f);
|
||||
g_end = round((g_end_ms * sample_rate) / 1000.0f);
|
||||
g_begin = round((g_begin_ms * sample_rate) / 1000.0f);
|
||||
b_end = round((b_end_ms * sample_rate) / 1000.0f);
|
||||
b_begin = round((b_begin_ms * sample_rate) / 1000.0f);
|
||||
|
||||
scanline_length = martin2_scanline_length;
|
||||
minimum_length = ((1.0f - scanline_tolerance) * martin2_scanline_ms * sample_rate) / 1000.0f;
|
||||
maximum_length = ((1.0f + scanline_tolerance) * martin2_scanline_ms * sample_rate) / 1000.0f;
|
||||
}
|
||||
void scottie1_mode()
|
||||
{
|
||||
blur_power = 3;
|
||||
*current_mode = mode_scottie1;
|
||||
blur_power = blur;
|
||||
*current_mode = mode;
|
||||
current_decoder = decoder_scottie;
|
||||
bitmap_width = 320;
|
||||
bitmap_height = 256;
|
||||
|
|
@ -241,7 +211,6 @@ void scottie1_mode()
|
|||
const float tolerance = 0.8f;
|
||||
const float sync_ms = 9.0f;
|
||||
const float sync_porch_ms = 1.5f;
|
||||
const float rgb_scan_ms = 138.240f;
|
||||
const float seperator_ms = 1.5f;
|
||||
seperator_length = round((seperator_ms * sample_rate) / 1000.0f);
|
||||
sync_length = tolerance * (sync_ms * sample_rate) / 1000.0f;
|
||||
|
|
@ -260,78 +229,14 @@ void scottie1_mode()
|
|||
b_end = round((b_end_ms * sample_rate) / 1000.0f);
|
||||
b_begin = round((b_begin_ms * sample_rate) / 1000.0f);
|
||||
|
||||
scanline_length = scottie1_scanline_length;
|
||||
minimum_length = ((1.0f - scanline_tolerance) * scottie1_scanline_ms * sample_rate) / 1000.0f;
|
||||
maximum_length = ((1.0f + scanline_tolerance) * scottie1_scanline_ms * sample_rate) / 1000.0f;
|
||||
scanline_length = scanline;
|
||||
minimum_length = (1.0f - scanline_tolerance) * scanline;
|
||||
maximum_length = (1.0f + scanline_tolerance) * scanline;
|
||||
}
|
||||
void scottie2_mode()
|
||||
{
|
||||
blur_power = 2;
|
||||
*current_mode = mode_scottie2;
|
||||
current_decoder = decoder_scottie;
|
||||
bitmap_width = 320;
|
||||
bitmap_height = 256;
|
||||
freerun_height = freerun_reserve(bitmap_height);
|
||||
const float tolerance = 0.8f;
|
||||
const float sync_ms = 9.0f;
|
||||
const float sync_porch_ms = 1.5f;
|
||||
const float rgb_scan_ms = 88.064f;
|
||||
const float seperator_ms = 1.5f;
|
||||
seperator_length = round((seperator_ms * sample_rate) / 1000.0f);
|
||||
sync_length = tolerance * (sync_ms * sample_rate) / 1000.0f;
|
||||
void scottie1_mode() { scottie_mode(mode_scottie1, scottie1_scanline_length, 3, 138.240f); }
|
||||
void scottie2_mode() { scottie_mode(mode_scottie2, scottie2_scanline_length, 2, 88.064f); }
|
||||
void scottieDX_mode() { scottie_mode(mode_scottieDX, scottieDX_scanline_length, 5, 345.6f); }
|
||||
|
||||
float r_begin_ms = sync_porch_ms;
|
||||
float r_end_ms = r_begin_ms + rgb_scan_ms;
|
||||
float b_end_ms = - sync_ms;
|
||||
float b_begin_ms = b_end_ms - rgb_scan_ms;
|
||||
float g_end_ms = b_begin_ms - seperator_ms;
|
||||
float g_begin_ms = g_end_ms - rgb_scan_ms;
|
||||
|
||||
r_begin = round((r_begin_ms * sample_rate) / 1000.0f);
|
||||
r_end = round((r_end_ms * sample_rate) / 1000.0f);
|
||||
g_end = round((g_end_ms * sample_rate) / 1000.0f);
|
||||
g_begin = round((g_begin_ms * sample_rate) / 1000.0f);
|
||||
b_end = round((b_end_ms * sample_rate) / 1000.0f);
|
||||
b_begin = round((b_begin_ms * sample_rate) / 1000.0f);
|
||||
|
||||
scanline_length = scottie2_scanline_length;
|
||||
minimum_length = ((1.0f - scanline_tolerance) * scottie2_scanline_ms * sample_rate) / 1000.0f;
|
||||
maximum_length = ((1.0f + scanline_tolerance) * scottie2_scanline_ms * sample_rate) / 1000.0f;
|
||||
}
|
||||
void scottieDX_mode()
|
||||
{
|
||||
blur_power = 5;
|
||||
*current_mode = mode_scottieDX;
|
||||
current_decoder = decoder_scottie;
|
||||
bitmap_width = 320;
|
||||
bitmap_height = 256;
|
||||
freerun_height = freerun_reserve(bitmap_height);
|
||||
const float tolerance = 0.8f;
|
||||
const float sync_ms = 9.0f;
|
||||
const float sync_porch_ms = 1.5f;
|
||||
const float rgb_scan_ms = 345.6f;
|
||||
const float seperator_ms = 1.5f;
|
||||
seperator_length = round((seperator_ms * sample_rate) / 1000.0f);
|
||||
sync_length = tolerance * (sync_ms * sample_rate) / 1000.0f;
|
||||
|
||||
float r_begin_ms = sync_porch_ms;
|
||||
float r_end_ms = r_begin_ms + rgb_scan_ms;
|
||||
float b_end_ms = - sync_ms;
|
||||
float b_begin_ms = b_end_ms - rgb_scan_ms;
|
||||
float g_end_ms = b_begin_ms - seperator_ms;
|
||||
float g_begin_ms = g_end_ms - rgb_scan_ms;
|
||||
|
||||
r_begin = round((r_begin_ms * sample_rate) / 1000.0f);
|
||||
r_end = round((r_end_ms * sample_rate) / 1000.0f);
|
||||
g_end = round((g_end_ms * sample_rate) / 1000.0f);
|
||||
g_begin = round((g_begin_ms * sample_rate) / 1000.0f);
|
||||
b_end = round((b_end_ms * sample_rate) / 1000.0f);
|
||||
b_begin = round((b_begin_ms * sample_rate) / 1000.0f);
|
||||
|
||||
scanline_length = scottieDX_scanline_length;
|
||||
minimum_length = ((1.0f - scanline_tolerance) * scottieDX_scanline_ms * sample_rate) / 1000.0f;
|
||||
maximum_length = ((1.0f + scanline_tolerance) * scottieDX_scanline_ms * sample_rate) / 1000.0f;
|
||||
}
|
||||
void wrasseSC2_180_mode()
|
||||
{
|
||||
blur_power = 4;
|
||||
|
|
@ -361,8 +266,8 @@ void wrasseSC2_180_mode()
|
|||
b_begin = round((b_begin_ms * sample_rate) / 1000.0f);
|
||||
|
||||
scanline_length = wrasseSC2_180_scanline_length;
|
||||
minimum_length = ((1.0f - scanline_tolerance) * wrasseSC2_180_scanline_ms * sample_rate) / 1000.0f;
|
||||
maximum_length = ((1.0f + scanline_tolerance) * wrasseSC2_180_scanline_ms * sample_rate) / 1000.0f;
|
||||
minimum_length = (1.0f - scanline_tolerance) * wrasseSC2_180_scanline_length;
|
||||
maximum_length = (1.0f + scanline_tolerance) * wrasseSC2_180_scanline_length;
|
||||
}
|
||||
|
||||
static void switch_mode(int new_mode)
|
||||
|
|
@ -394,9 +299,27 @@ static void switch_mode(int new_mode)
|
|||
case mode_wrasseSC2_180:
|
||||
wrasseSC2_180_mode();
|
||||
break;
|
||||
case mode_pd50:
|
||||
pd50_mode();
|
||||
break;
|
||||
case mode_pd90:
|
||||
pd90_mode();
|
||||
break;
|
||||
case mode_pd120:
|
||||
pd120_mode();
|
||||
break;
|
||||
case mode_pd160:
|
||||
pd160_mode();
|
||||
break;
|
||||
case mode_pd180:
|
||||
pd180_mode();
|
||||
break;
|
||||
case mode_pd240:
|
||||
pd240_mode();
|
||||
break;
|
||||
case mode_pd290:
|
||||
pd290_mode();
|
||||
break;
|
||||
default:
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -53,7 +53,13 @@ static int scanline_estimator(int sync_level)
|
|||
int scottie2_adev = abs(mean - scottie2_scanline_length);
|
||||
int scottieDX_adev = abs(mean - scottieDX_scanline_length);
|
||||
int wrasseSC2_180_adev = abs(mean - wrasseSC2_180_scanline_length);
|
||||
int pd50_adev = abs(mean - pd50_scanline_length);
|
||||
int pd90_adev = abs(mean - pd90_scanline_length);
|
||||
int pd120_adev = abs(mean - pd120_scanline_length);
|
||||
int pd160_adev = abs(mean - pd160_scanline_length);
|
||||
int pd180_adev = abs(mean - pd180_scanline_length);
|
||||
int pd240_adev = abs(mean - pd240_scanline_length);
|
||||
int pd290_adev = abs(mean - pd290_scanline_length);
|
||||
|
||||
int min_adev = min(
|
||||
min(
|
||||
|
|
@ -65,7 +71,16 @@ static int scanline_estimator(int sync_level)
|
|||
min(scottieDX_adev, wrasseSC2_180_adev)
|
||||
)
|
||||
),
|
||||
pd180_adev
|
||||
min(
|
||||
min(
|
||||
min(pd50_adev, pd90_adev),
|
||||
min(pd120_adev, pd160_adev)
|
||||
),
|
||||
min(
|
||||
min(pd180_adev, pd240_adev),
|
||||
pd290_adev
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
if (min_adev > maximum_absolute_deviaton)
|
||||
|
|
@ -86,8 +101,20 @@ static int scanline_estimator(int sync_level)
|
|||
return mode_scottieDX;
|
||||
else if (min_adev == wrasseSC2_180_adev)
|
||||
return mode_wrasseSC2_180;
|
||||
else if (min_adev == pd50_adev)
|
||||
return mode_pd50;
|
||||
else if (min_adev == pd90_adev)
|
||||
return mode_pd90;
|
||||
else if (min_adev == pd120_adev)
|
||||
return mode_pd120;
|
||||
else if (min_adev == pd160_adev)
|
||||
return mode_pd160;
|
||||
else if (min_adev == pd180_adev)
|
||||
return mode_pd180;
|
||||
else if (min_adev == pd240_adev)
|
||||
return mode_pd240;
|
||||
else if (min_adev == pd290_adev)
|
||||
return mode_pd290;
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -55,6 +55,12 @@ static int scottie1_scanline_length;
|
|||
static int scottie2_scanline_length;
|
||||
static int scottieDX_scanline_length;
|
||||
static int wrasseSC2_180_scanline_length;
|
||||
static int pd50_scanline_length;
|
||||
static int pd90_scanline_length;
|
||||
static int pd120_scanline_length;
|
||||
static int pd160_scanline_length;
|
||||
static int pd180_scanline_length;
|
||||
static int pd240_scanline_length;
|
||||
static int pd290_scanline_length;
|
||||
|
||||
#endif
|
||||
Loading…
Reference in a new issue