mirror of
https://github.com/dingusdev/dingusppc.git
synced 2025-02-09 08:30:39 +00:00
pdmonboard: use new refresh task control.
This commit is contained in:
parent
7b2e1d90e6
commit
9b81891467
@ -21,7 +21,6 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|||||||
|
|
||||||
/** @file PDM on-board video emulation. */
|
/** @file PDM on-board video emulation. */
|
||||||
|
|
||||||
#include <core/timermanager.h>
|
|
||||||
#include <cpu/ppc/ppcmmu.h>
|
#include <cpu/ppc/ppcmmu.h>
|
||||||
#include <devices/memctrl/hmc.h>
|
#include <devices/memctrl/hmc.h>
|
||||||
#include <devices/video/pdmonboard.h>
|
#include <devices/video/pdmonboard.h>
|
||||||
@ -210,20 +209,13 @@ void PdmOnboardVideo::enable_video_internal()
|
|||||||
|
|
||||||
this->set_depth_internal(new_width);
|
this->set_depth_internal(new_width);
|
||||||
|
|
||||||
if (this->refresh_task_id) {
|
this->stop_refresh_task();
|
||||||
TimerManager::get_instance()->cancel_timer(this->refresh_task_id);
|
|
||||||
}
|
|
||||||
|
|
||||||
// set up video refresh timer
|
// set up video refresh timer
|
||||||
double refresh_rate_hz = (double)(this->pixel_clock) / (new_width + hori_blank) / (new_height + vert_blank);
|
this->refresh_rate = (double)(this->pixel_clock) / (new_width + hori_blank) /
|
||||||
LOG_F(INFO, "PDM-Video: refresh rate set to %f Hz", refresh_rate_hz);
|
(new_height + vert_blank);
|
||||||
uint64_t refresh_interval = static_cast<uint64_t>(1.0f / refresh_rate_hz * NS_PER_SEC + 0.5);
|
LOG_F(INFO, "PDM-Video: refresh rate set to %f Hz", this->refresh_rate);
|
||||||
this->refresh_task_id = TimerManager::get_instance()->add_cyclic_timer(
|
this->start_refresh_task();
|
||||||
refresh_interval,
|
|
||||||
[this]() {
|
|
||||||
this->update_screen();
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
LOG_F(9, "PDM-Video: video enabled");
|
LOG_F(9, "PDM-Video: video enabled");
|
||||||
this->crtc_on = true;
|
this->crtc_on = true;
|
||||||
@ -240,7 +232,7 @@ void PdmOnboardVideo::disable_video_internal()
|
|||||||
|
|
||||||
/** Ariel II has a weird 1bpp mode where a white pixel is mapped to
|
/** Ariel II has a weird 1bpp mode where a white pixel is mapped to
|
||||||
CLUT entry #127 (%01111111) and a black pixel to #255 (%11111111).
|
CLUT entry #127 (%01111111) and a black pixel to #255 (%11111111).
|
||||||
It requres a non-standard conversion routine implementend below.
|
It requres a non-standard conversion routine implemented below.
|
||||||
*/
|
*/
|
||||||
void PdmOnboardVideo::convert_frame_1bpp(uint8_t *dst_buf, int dst_pitch)
|
void PdmOnboardVideo::convert_frame_1bpp(uint8_t *dst_buf, int dst_pitch)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user