Skip to content

Commit

Permalink
vga-nextgen
Browse files Browse the repository at this point in the history
  • Loading branch information
xrip committed Feb 16, 2024
1 parent 24c5113 commit 5bdffe0
Show file tree
Hide file tree
Showing 3 changed files with 164 additions and 165 deletions.
10 changes: 4 additions & 6 deletions drivers/hdmi/hdmi.c
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ static void __scratch_y("hdmi_driver") dma_handler_HDMI() {

uint8_t* activ_buf = (uint8_t *)dma_lines[inx_buf_dma & 1];

if (line < 480) {
if (graphics_buffer && line < 480 ) {
//область изображения
uint8_t* output_buffer = activ_buf + 72; //для выравнивания синхры;

Expand Down Expand Up @@ -539,7 +539,7 @@ static inline bool hdmi_init() {
return true;
};
//выбор видеорежима
void graphics_set_mode(enum graphics_mode_t mode) {
inline void graphics_set_mode(enum graphics_mode_t mode) {
graphics_mode = mode;
clrScr(0);
};
Expand Down Expand Up @@ -614,8 +614,6 @@ void graphics_set_textbuffer(uint8_t* buffer) {


void clrScr(const uint8_t color) {
uint16_t* t_buf = (uint16_t *)text_buffer;
int size = TEXTMODE_COLS * TEXTMODE_ROWS;

while (size--) *t_buf++ = color << 4 | ' ';
if (text_buffer)
memset(text_buffer, color, TEXTMODE_COLS * TEXTMODE_ROWS * 2);
}
7 changes: 3 additions & 4 deletions drivers/tv/tv.c
Original file line number Diff line number Diff line change
Expand Up @@ -480,6 +480,7 @@ static void __scratch_x("tv_main_loop") main_video_loopTV() {
}
}
else*/
if (graphics_buffer.data)
switch (graphics_mode) {
default:
case GRAPHICSMODE_DEFAULT: {
Expand Down Expand Up @@ -883,10 +884,8 @@ void graphics_init() {
}

void clrScr(const uint8_t color) {
uint16_t* t_buf = (uint16_t *)text_buffer;
int size = TEXTMODE_COLS * TEXTMODE_ROWS;

while (size--) *t_buf++ = color << 4 | ' ';
if (text_buffer)
memset(text_buffer, color, TEXTMODE_COLS * TEXTMODE_ROWS * 2);
}


Expand Down
Loading

0 comments on commit 5bdffe0

Please sign in to comment.