Skip to content

Commit

Permalink
Added some default PAL modelines.
Browse files Browse the repository at this point in the history
Adjusted audio capture to not impact blit timing and disable properly when audio is off.
Ticked the version number for next pending release.
  • Loading branch information
iequalshane committed Mar 1, 2024
1 parent dd96931 commit c2559ac
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 9 deletions.
2 changes: 1 addition & 1 deletion FrontEnd/MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:MiSTerCast"
mc:Ignorable="d"
Title="MiSTerCast 1.00" Height="600" Width="580"
Title="MiSTerCast 1.01" Height="600" Width="580"
Activated="Window_Activated"
Closing="MainWindow_Closing"
Closed="Window_Closed">
Expand Down
11 changes: 9 additions & 2 deletions FrontEnd/modelines.dat
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,15 @@
; Original modelines were found here https://www.geocities.ws/podernixie/htpc/modes-en.html

;Name Pclock HDis HStr HEnd HTot VDsp VStr VEnd VTot Int
[256x240 NTSC (60Hz)] 4.905 256 264 287 312 240 241 244 262 0
;NTSC
[256x240 NTSC (60Hz)] 4.905 256 264 287 312 240 241 244 262 0
[320x240 NTSC (60Hz)] 6.700 320 336 367 426 240 244 247 262 0
[320x480i NTSC (60Hz)] 6.700 320 336 367 426 480 488 493 525 1
[640x480i NTSC (60Hz)] 12.336 640 662 720 784 480 488 494 525 1
[720x480i NTSC (60Hz)] 13.846 720 744 809 880 480 488 494 525 1
[720x480i NTSC (60Hz)] 13.846 720 744 809 880 480 488 494 525 1
;PAL
[256x240 PAL (50Hz)] 5.320 256 269 294 341 240 270 273 312 0
[320x240 PAL (50Hz)] 6.660 320 336 367 426 240 270 273 312 0
[320x480i PAL (50Hz)] 6.660 320 336 367 426 480 540 545 625 1
[640x480i PAL (50Hz)] 13.320 640 672 734 852 480 540 545 625 1
[720x576i PAL (50Hz)] 13.875 720 741 806 888 576 581 586 625 1
7 changes: 7 additions & 0 deletions Library/MiSTerCastLib/MiSTerCastLib.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,17 @@ void capture_screen()
std::atomic_bool casting_screen = false;
void cast_screen()
{
if (!SetThreadPriority(GetCurrentThread(), THREAD_PRIORITY_HIGHEST))
{
LogMessage("Setting cast screen thread priority failed: " + std::to_string(GetLastError()), true);
}

if (source_config.audio)
{
LogMessage("Audio capture starting.");
StartAudioCapture();
}

LogMessage("Casting to MiSTer starting.");
casting_screen = true;
{
Expand All @@ -53,6 +59,7 @@ void cast_screen()
}
casting_screen = false;
LogMessage("Casting to MiSTer stopped.");

if (source_config.audio)
{
StopAudioCapture();
Expand Down
13 changes: 7 additions & 6 deletions Library/MiSTerCastLib/renderer_nogpu.h
Original file line number Diff line number Diff line change
Expand Up @@ -388,15 +388,16 @@ int renderer_nogpu::draw(const int update)
return 0;
}

// Grab audio right before blit starts
TickAudioCapture();

// Blit now
nogpu_blit(m_frame, m_width, m_height);

// Send audio
if (AudioWritePos > 0)
add_audio_to_recording(audioBuffer, AudioWritePos);
// Capture and send audio
if (source_config.audio)
{
TickAudioCapture();
if (AudioWritePos > 0)
add_audio_to_recording(audioBuffer, AudioWritePos);
}

time_blit = CurrentTicks();

Expand Down

0 comments on commit c2559ac

Please sign in to comment.