mirror of
https://github.com/dingusdev/dingusppc.git
synced 2025-01-13 03:30:31 +00:00
videoctrl: Add VBL callback.
Allows overriding the method used to post interrupts.
This commit is contained in:
parent
cf9237f7d6
commit
5c460c9f3b
@ -84,8 +84,7 @@ void VideoCtrlBase::start_refresh_task() {
|
||||
refresh_interval,
|
||||
[this]() {
|
||||
// assert VBL interrupt
|
||||
if (this->int_ctrl)
|
||||
this->int_ctrl->ack_int(this->irq_id, 1);
|
||||
this->vbl_cb(1);
|
||||
this->update_screen();
|
||||
}
|
||||
);
|
||||
@ -97,8 +96,7 @@ void VideoCtrlBase::start_refresh_task() {
|
||||
refresh_interval + vbl_duration,
|
||||
[this]() {
|
||||
// deassert VBL interrupt
|
||||
if (this->int_ctrl)
|
||||
this->int_ctrl->ack_int(this->irq_id, 0);
|
||||
this->vbl_cb(0);
|
||||
}
|
||||
);
|
||||
}
|
||||
|
@ -24,12 +24,12 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
#ifndef VIDEO_CTRL_H
|
||||
#define VIDEO_CTRL_H
|
||||
|
||||
#include <devices/common/hwinterrupt.h>
|
||||
#include <devices/video/display.h>
|
||||
|
||||
#include <cinttypes>
|
||||
#include <functional>
|
||||
|
||||
class InterruptCtrl;
|
||||
class WindowEvent;
|
||||
|
||||
class VideoCtrlBase {
|
||||
@ -96,6 +96,10 @@ protected:
|
||||
// interrupt suff
|
||||
InterruptCtrl* int_ctrl = nullptr;
|
||||
uint32_t irq_id = 0;
|
||||
std::function<void(uint8_t irq_line_state)> vbl_cb = [this](uint8_t irq_line_state) {
|
||||
if (this->int_ctrl)
|
||||
this->int_ctrl->ack_int(this->irq_id, irq_line_state);
|
||||
};
|
||||
|
||||
std::function<void(uint8_t *dst_buf, int dst_pitch)> convert_fb_cb;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user