From 2c153b3db0c3c56cad9663441b077eb132edb08f Mon Sep 17 00:00:00 2001 From: FellippeHeitor Date: Wed, 16 Aug 2017 00:11:31 -0300 Subject: [PATCH] Adds _BLINK {ON|OFF} to disable blinking in SCREEN 0 for colors 16-31. Thanks to _vince for finding the right spots where blinking was set. Or flashing, you choose the naming. --- internal/c/libqb.cpp | 17 ++++++++++++++--- internal/c/qbx.cpp | 1 + source/subs_functions/subs_functions.bas | 9 +++++++++ 3 files changed, 24 insertions(+), 3 deletions(-) diff --git a/internal/c/libqb.cpp b/internal/c/libqb.cpp index 6de5e755a..9e8a391c8 100644 --- a/internal/c/libqb.cpp +++ b/internal/c/libqb.cpp @@ -14238,6 +14238,13 @@ int32 H3C8_palette_register_index=0; int32 H3C9_next=0; int32 H3C9_read_next=0; +int32 H3C0_blink_enable = 1; + +void sub__blink(int32 onoff){ + if (onoff==1) H3C0_blink_enable=1; else H3C0_blink_enable=0; +} + + void sub_out(int32 port,int32 data){ if (new_error) return; unsupported_port_accessed=0; @@ -31827,9 +31834,13 @@ QB64_GAMEPAD_INIT(); if (f==(16+1)) {cp2=&charset8x16[chr][0][0]; z2=1;} } c=col&0xF;//foreground col - c2=(col>>4)&7;//background col - c3=col>>7;//flashing? - if (c3&&show_flashing) c=c2; + if (H3C0_blink_enable) { + c2=(col>>4)&7;//background col + c3=col>>7;//flashing? + } else { + c2=(col>>4);//background col + } + if (c3&&show_flashing && H3C0_blink_enable) c=c2; i2=paldata[c]; i3=paldata[c2]; lp=display_surface_offset+qbg_y_offset+y2*x_monitor+x2; diff --git a/internal/c/qbx.cpp b/internal/c/qbx.cpp index 76fa0801d..a32fbd18c 100644 --- a/internal/c/qbx.cpp +++ b/internal/c/qbx.cpp @@ -199,6 +199,7 @@ extern int32 func__screenhide(); extern void sub__console(int32); extern int32 func__console(); extern void sub__controlchr(int32); +extern void sub__blink(int32); extern int32 func__fileexists(qbs*); extern int32 func__direxists(qbs*); extern int32 func_stick(int32 i,int32 axis_group,int32 passed); diff --git a/source/subs_functions/subs_functions.bas b/source/subs_functions/subs_functions.bas index 868da030e..e5a7c4dab 100644 --- a/source/subs_functions/subs_functions.bas +++ b/source/subs_functions/subs_functions.bas @@ -293,6 +293,15 @@ id.arg = MKL$(LONGTYPE - ISPOINTER) id.specialformat = "{ON|OFF}" regid +clearid +id.n = "_BLINK" +id.subfunc = 2 +id.callname = "sub__blink" +id.args = 1 +id.arg = MKL$(LONGTYPE - ISPOINTER) +id.specialformat = "{ON|OFF}" +regid + clearid id.n = "_FILEEXISTS" id.subfunc = 1