From 04cf9c515fc192f9dcec53122159f192c666a083 Mon Sep 17 00:00:00 2001 From: Roland Heyder Date: Tue, 1 Oct 2024 20:24:52 +0200 Subject: [PATCH 1/7] Prepare bootstrap compiler - manual tweaks to adapt the compiler to the new mouse function conventions --- internal/source/main.txt | 232 +++++++++------------------------------ 1 file changed, 50 insertions(+), 182 deletions(-) diff --git a/internal/source/main.txt b/internal/source/main.txt index 97ad73d82..b8ac851b5 100644 --- a/internal/source/main.txt +++ b/internal/source/main.txt @@ -86536,17 +86536,9 @@ do{ *(int32*)(((char*)__UDT_ID)+(2381))=*__LONG_LONGTYPE-*__LONG_ISPOINTER; if(!qbevent)break;evnt(21130,1739,"subs_functions.bas");}while(r); do{ -*(int16*)(((char*)__UDT_ID)+(809))= 1 ; +*(int16*)(((char*)__UDT_ID)+(809))= 0 ; if(!qbevent)break;evnt(21130,1740,"subs_functions.bas");}while(r); do{ -qbs_set(qbs_new_fixed((((uint8*)__UDT_ID)+(813)),400,1),l2string(*__LONG_LONGTYPE-*__LONG_ISPOINTER)); -qbs_cleanup(qbs_tmp_base,0); -if(!qbevent)break;evnt(21130,1741,"subs_functions.bas");}while(r); -do{ -qbs_set(qbs_new_fixed((((uint8*)__UDT_ID)+(1613)),256,1),qbs_new_txt_len("[?]",3)); -qbs_cleanup(qbs_tmp_base,0); -if(!qbevent)break;evnt(21130,1742,"subs_functions.bas");}while(r); -do{ qbs_set(*((qbs**)((char*)(__UDT_ID)+(2861))),qbs_new_txt_len("_MOUSEINPUT",11)); qbs_cleanup(qbs_tmp_base,0); if(!qbevent)break;evnt(21130,1743,"subs_functions.bas");}while(r); @@ -86571,17 +86563,9 @@ do{ *(int32*)(((char*)__UDT_ID)+(2381))=*__LONG_SINGLETYPE-*__LONG_ISPOINTER; if(!qbevent)break;evnt(21130,1750,"subs_functions.bas");}while(r); do{ -*(int16*)(((char*)__UDT_ID)+(809))= 1 ; +*(int16*)(((char*)__UDT_ID)+(809))= 0 ; if(!qbevent)break;evnt(21130,1751,"subs_functions.bas");}while(r); do{ -qbs_set(qbs_new_fixed((((uint8*)__UDT_ID)+(813)),400,1),l2string(*__LONG_LONGTYPE-*__LONG_ISPOINTER)); -qbs_cleanup(qbs_tmp_base,0); -if(!qbevent)break;evnt(21130,1752,"subs_functions.bas");}while(r); -do{ -qbs_set(qbs_new_fixed((((uint8*)__UDT_ID)+(1613)),256,1),qbs_new_txt_len("[?]",3)); -qbs_cleanup(qbs_tmp_base,0); -if(!qbevent)break;evnt(21130,1753,"subs_functions.bas");}while(r); -do{ qbs_set(*((qbs**)((char*)(__UDT_ID)+(2861))),qbs_new_txt_len("_MOUSEX",7)); qbs_cleanup(qbs_tmp_base,0); if(!qbevent)break;evnt(21130,1754,"subs_functions.bas");}while(r); @@ -86606,17 +86590,9 @@ do{ *(int32*)(((char*)__UDT_ID)+(2381))=*__LONG_SINGLETYPE-*__LONG_ISPOINTER; if(!qbevent)break;evnt(21130,1761,"subs_functions.bas");}while(r); do{ -*(int16*)(((char*)__UDT_ID)+(809))= 1 ; +*(int16*)(((char*)__UDT_ID)+(809))= 0 ; if(!qbevent)break;evnt(21130,1762,"subs_functions.bas");}while(r); do{ -qbs_set(qbs_new_fixed((((uint8*)__UDT_ID)+(813)),400,1),l2string(*__LONG_LONGTYPE-*__LONG_ISPOINTER)); -qbs_cleanup(qbs_tmp_base,0); -if(!qbevent)break;evnt(21130,1763,"subs_functions.bas");}while(r); -do{ -qbs_set(qbs_new_fixed((((uint8*)__UDT_ID)+(1613)),256,1),qbs_new_txt_len("[?]",3)); -qbs_cleanup(qbs_tmp_base,0); -if(!qbevent)break;evnt(21130,1764,"subs_functions.bas");}while(r); -do{ qbs_set(*((qbs**)((char*)(__UDT_ID)+(2861))),qbs_new_txt_len("_MOUSEY",7)); qbs_cleanup(qbs_tmp_base,0); if(!qbevent)break;evnt(21130,1765,"subs_functions.bas");}while(r); @@ -86641,17 +86617,9 @@ do{ *(int32*)(((char*)__UDT_ID)+(2381))=*__LONG_SINGLETYPE-*__LONG_ISPOINTER; if(!qbevent)break;evnt(21130,1772,"subs_functions.bas");}while(r); do{ -*(int16*)(((char*)__UDT_ID)+(809))= 1 ; +*(int16*)(((char*)__UDT_ID)+(809))= 0 ; if(!qbevent)break;evnt(21130,1773,"subs_functions.bas");}while(r); do{ -qbs_set(qbs_new_fixed((((uint8*)__UDT_ID)+(813)),400,1),l2string(*__LONG_LONGTYPE-*__LONG_ISPOINTER)); -qbs_cleanup(qbs_tmp_base,0); -if(!qbevent)break;evnt(21130,1774,"subs_functions.bas");}while(r); -do{ -qbs_set(qbs_new_fixed((((uint8*)__UDT_ID)+(1613)),256,1),qbs_new_txt_len("[?]",3)); -qbs_cleanup(qbs_tmp_base,0); -if(!qbevent)break;evnt(21130,1775,"subs_functions.bas");}while(r); -do{ qbs_set(*((qbs**)((char*)(__UDT_ID)+(2861))),qbs_new_txt_len("_MOUSEMOVEMENTX",15)); qbs_cleanup(qbs_tmp_base,0); if(!qbevent)break;evnt(21130,1776,"subs_functions.bas");}while(r); @@ -86676,17 +86644,9 @@ do{ *(int32*)(((char*)__UDT_ID)+(2381))=*__LONG_SINGLETYPE-*__LONG_ISPOINTER; if(!qbevent)break;evnt(21130,1783,"subs_functions.bas");}while(r); do{ -*(int16*)(((char*)__UDT_ID)+(809))= 1 ; +*(int16*)(((char*)__UDT_ID)+(809))= 0 ; if(!qbevent)break;evnt(21130,1784,"subs_functions.bas");}while(r); do{ -qbs_set(qbs_new_fixed((((uint8*)__UDT_ID)+(813)),400,1),l2string(*__LONG_LONGTYPE-*__LONG_ISPOINTER)); -qbs_cleanup(qbs_tmp_base,0); -if(!qbevent)break;evnt(21130,1785,"subs_functions.bas");}while(r); -do{ -qbs_set(qbs_new_fixed((((uint8*)__UDT_ID)+(1613)),256,1),qbs_new_txt_len("[?]",3)); -qbs_cleanup(qbs_tmp_base,0); -if(!qbevent)break;evnt(21130,1786,"subs_functions.bas");}while(r); -do{ qbs_set(*((qbs**)((char*)(__UDT_ID)+(2861))),qbs_new_txt_len("_MOUSEMOVEMENTY",15)); qbs_cleanup(qbs_tmp_base,0); if(!qbevent)break;evnt(21130,1787,"subs_functions.bas");}while(r); @@ -86708,20 +86668,16 @@ qbs_set(qbs_new_fixed((((uint8*)__UDT_ID)+(550)),256,1),qbs_new_txt_len("func__m qbs_cleanup(qbs_tmp_base,0); if(!qbevent)break;evnt(21130,1793,"subs_functions.bas");}while(r); do{ -*(int16*)(((char*)__UDT_ID)+(809))= 2 ; +*(int16*)(((char*)__UDT_ID)+(809))= 1 ; if(!qbevent)break;evnt(21130,1794,"subs_functions.bas");}while(r); do{ -qbs_set(qbs_new_fixed((((uint8*)__UDT_ID)+(813)),400,1),qbs_add(l2string(*__LONG_LONGTYPE-*__LONG_ISPOINTER),l2string(*__LONG_LONGTYPE-*__LONG_ISPOINTER))); +qbs_set(qbs_new_fixed((((uint8*)__UDT_ID)+(813)),400,1),l2string(*__LONG_LONGTYPE-*__LONG_ISPOINTER)); qbs_cleanup(qbs_tmp_base,0); if(!qbevent)break;evnt(21130,1795,"subs_functions.bas");}while(r); do{ *(int32*)(((char*)__UDT_ID)+(2381))=*__LONG_LONGTYPE-*__LONG_ISPOINTER; if(!qbevent)break;evnt(21130,1796,"subs_functions.bas");}while(r); do{ -qbs_set(qbs_new_fixed((((uint8*)__UDT_ID)+(1613)),256,1),qbs_new_txt_len("?[,?]",5)); -qbs_cleanup(qbs_tmp_base,0); -if(!qbevent)break;evnt(21130,1797,"subs_functions.bas");}while(r); -do{ qbs_set(*((qbs**)((char*)(__UDT_ID)+(2861))),qbs_new_txt_len("_MOUSEBUTTON(buttonNumber)",26)); qbs_cleanup(qbs_tmp_base,0); if(!qbevent)break;evnt(21130,1798,"subs_functions.bas");}while(r); @@ -86746,17 +86702,9 @@ do{ *(int32*)(((char*)__UDT_ID)+(2381))=*__LONG_LONGTYPE-*__LONG_ISPOINTER; if(!qbevent)break;evnt(21130,1805,"subs_functions.bas");}while(r); do{ -*(int16*)(((char*)__UDT_ID)+(809))= 1 ; +*(int16*)(((char*)__UDT_ID)+(809))= 0 ; if(!qbevent)break;evnt(21130,1806,"subs_functions.bas");}while(r); do{ -qbs_set(qbs_new_fixed((((uint8*)__UDT_ID)+(813)),400,1),l2string(*__LONG_LONGTYPE-*__LONG_ISPOINTER)); -qbs_cleanup(qbs_tmp_base,0); -if(!qbevent)break;evnt(21130,1807,"subs_functions.bas");}while(r); -do{ -qbs_set(qbs_new_fixed((((uint8*)__UDT_ID)+(1613)),256,1),qbs_new_txt_len("[?]",3)); -qbs_cleanup(qbs_tmp_base,0); -if(!qbevent)break;evnt(21130,1808,"subs_functions.bas");}while(r); -do{ qbs_set(*((qbs**)((char*)(__UDT_ID)+(2861))),qbs_new_txt_len("_MOUSEWHEEL",11)); qbs_cleanup(qbs_tmp_base,0); if(!qbevent)break;evnt(21130,1809,"subs_functions.bas");}while(r); @@ -86765,86 +86713,6 @@ SUB_REGID(); if(!qbevent)break;evnt(21130,1810,"subs_functions.bas");}while(r); do{ SUB_CLEARID(); -if(!qbevent)break;evnt(21130,1813,"subs_functions.bas");}while(r); -do{ -qbs_set(qbs_new_fixed((((uint8*)__UDT_ID)+(0)),256,1),qbs_new_txt_len("_MousePipeOpen",14)); -qbs_cleanup(qbs_tmp_base,0); -if(!qbevent)break;evnt(21130,1814,"subs_functions.bas");}while(r); -do{ -*(int16*)(((char*)__UDT_ID)+(544))= 1 ; -if(!qbevent)break;evnt(21130,1815,"subs_functions.bas");}while(r); -do{ -qbs_set(qbs_new_fixed((((uint8*)__UDT_ID)+(550)),256,1),qbs_new_txt_len("func__mousepipeopen",19)); -qbs_cleanup(qbs_tmp_base,0); -if(!qbevent)break;evnt(21130,1816,"subs_functions.bas");}while(r); -do{ -*(int32*)(((char*)__UDT_ID)+(2381))=*__LONG_LONGTYPE-*__LONG_ISPOINTER; -if(!qbevent)break;evnt(21130,1817,"subs_functions.bas");}while(r); -do{ -qbs_set(*((qbs**)((char*)(__UDT_ID)+(2861))),qbs_new_txt_len("_MOUSEPIPEOPEN",14)); -qbs_cleanup(qbs_tmp_base,0); -if(!qbevent)break;evnt(21130,1818,"subs_functions.bas");}while(r); -do{ -SUB_REGID(); -if(!qbevent)break;evnt(21130,1819,"subs_functions.bas");}while(r); -do{ -SUB_CLEARID(); -if(!qbevent)break;evnt(21130,1821,"subs_functions.bas");}while(r); -do{ -qbs_set(qbs_new_fixed((((uint8*)__UDT_ID)+(0)),256,1),qbs_new_txt_len("_MouseInputPipe",15)); -qbs_cleanup(qbs_tmp_base,0); -if(!qbevent)break;evnt(21130,1822,"subs_functions.bas");}while(r); -do{ -*(int16*)(((char*)__UDT_ID)+(544))= 2 ; -if(!qbevent)break;evnt(21130,1823,"subs_functions.bas");}while(r); -do{ -qbs_set(qbs_new_fixed((((uint8*)__UDT_ID)+(550)),256,1),qbs_new_txt_len("sub__mouseinputpipe",19)); -qbs_cleanup(qbs_tmp_base,0); -if(!qbevent)break;evnt(21130,1824,"subs_functions.bas");}while(r); -do{ -*(int16*)(((char*)__UDT_ID)+(809))= 1 ; -if(!qbevent)break;evnt(21130,1825,"subs_functions.bas");}while(r); -do{ -qbs_set(qbs_new_fixed((((uint8*)__UDT_ID)+(813)),400,1),l2string(*__LONG_LONGTYPE-*__LONG_ISPOINTER)); -qbs_cleanup(qbs_tmp_base,0); -if(!qbevent)break;evnt(21130,1826,"subs_functions.bas");}while(r); -do{ -qbs_set(*((qbs**)((char*)(__UDT_ID)+(2861))),qbs_new_txt_len("_MOUSEINPUTPIPE(context)",24)); -qbs_cleanup(qbs_tmp_base,0); -if(!qbevent)break;evnt(21130,1827,"subs_functions.bas");}while(r); -do{ -SUB_REGID(); -if(!qbevent)break;evnt(21130,1828,"subs_functions.bas");}while(r); -do{ -SUB_CLEARID(); -if(!qbevent)break;evnt(21130,1830,"subs_functions.bas");}while(r); -do{ -qbs_set(qbs_new_fixed((((uint8*)__UDT_ID)+(0)),256,1),qbs_new_txt_len("_MousePipeClose",15)); -qbs_cleanup(qbs_tmp_base,0); -if(!qbevent)break;evnt(21130,1831,"subs_functions.bas");}while(r); -do{ -*(int16*)(((char*)__UDT_ID)+(544))= 2 ; -if(!qbevent)break;evnt(21130,1832,"subs_functions.bas");}while(r); -do{ -qbs_set(qbs_new_fixed((((uint8*)__UDT_ID)+(550)),256,1),qbs_new_txt_len("sub__mousepipeclose",19)); -qbs_cleanup(qbs_tmp_base,0); -if(!qbevent)break;evnt(21130,1833,"subs_functions.bas");}while(r); -do{ -*(int16*)(((char*)__UDT_ID)+(809))= 1 ; -if(!qbevent)break;evnt(21130,1834,"subs_functions.bas");}while(r); -do{ -qbs_set(qbs_new_fixed((((uint8*)__UDT_ID)+(813)),400,1),l2string(*__LONG_LONGTYPE-*__LONG_ISPOINTER)); -qbs_cleanup(qbs_tmp_base,0); -if(!qbevent)break;evnt(21130,1835,"subs_functions.bas");}while(r); -do{ -qbs_set(*((qbs**)((char*)(__UDT_ID)+(2861))),qbs_new_txt_len("_MOUSEPIPECLOSE(context)",24)); -qbs_cleanup(qbs_tmp_base,0); -if(!qbevent)break;evnt(21130,1836,"subs_functions.bas");}while(r); -do{ -SUB_REGID(); -if(!qbevent)break;evnt(21130,1837,"subs_functions.bas");}while(r); -do{ -SUB_CLEARID(); if(!qbevent)break;evnt(21130,1839,"subs_functions.bas");}while(r); do{ qbs_set(qbs_new_fixed((((uint8*)__UDT_ID)+(0)),256,1),qbs_new_txt_len("FreeFile",8)); @@ -145376,13 +145244,13 @@ qbs_cleanup(qbs_tmp_base,0); if(!qbevent)break;evnt(23689,5341,"ide_methods.bas");}while(r); } S_43038:; -while((func__mouseinput(NULL,0))||is_error_pending()){ +while((func__mouseinput())||is_error_pending()){ if(qbevent){evnt(23689,5343,"ide_methods.bas");if(r)goto S_43038;} ww_continue_4854:; } ww_exit_4854:; S_43040:; -if ((func__mousebutton( 1 ,NULL,0)|func__mousebutton( 2 ,NULL,0))||is_error_pending()){ +if ((func__mousebutton( 1 )|func__mousebutton( 2 ))||is_error_pending()){ if(qbevent){evnt(23689,5344,"ide_methods.bas");if(r)goto S_43040;} do{ goto LABEL_BYPASSCTRLK; @@ -145414,13 +145282,13 @@ qbs_cleanup(qbs_tmp_base,0); if(!qbevent)break;evnt(23689,5351,"ide_methods.bas");}while(r); } S_43051:; -while((func__mouseinput(NULL,0))||is_error_pending()){ +while((func__mouseinput())||is_error_pending()){ if(qbevent){evnt(23689,5353,"ide_methods.bas");if(r)goto S_43051;} ww_continue_4856:; } ww_exit_4856:; S_43053:; -if ((func__mousebutton( 1 ,NULL,0)|func__mousebutton( 2 ,NULL,0))||is_error_pending()){ +if ((func__mousebutton( 1 )|func__mousebutton( 2 ))||is_error_pending()){ if(qbevent){evnt(23689,5354,"ide_methods.bas");if(r)goto S_43053;} do{ goto LABEL_BYPASSCTRLK; @@ -150479,7 +150347,7 @@ SUB_SETSTATUSMESSAGE(&(pass5012= 2 ),qbs_add(qbs_add(qbs_new_txt_len("Cannot rec qbs_cleanup(qbs_tmp_base,0); if(!qbevent)break;evnt(23689,6822,"ide_methods.bas");}while(r); S_44677:; -while((func__mouseinput(NULL,0))||is_error_pending()){ +while((func__mouseinput())||is_error_pending()){ if(qbevent){evnt(23689,6823,"ide_methods.bas");if(r)goto S_44677;} ww_continue_5014:; } @@ -150533,7 +150401,7 @@ do{ sub__keyclear(NULL,0); if(!qbevent)break;evnt(23689,6842,"ide_methods.bas");}while(r); S_44697:; -while((func__mouseinput(NULL,0))||is_error_pending()){ +while((func__mouseinput())||is_error_pending()){ if(qbevent){evnt(23689,6843,"ide_methods.bas");if(r)goto S_44697;} ww_continue_5022:; } @@ -150592,7 +150460,7 @@ do{ sub__keyclear(NULL,0); if(!qbevent)break;evnt(23689,6864,"ide_methods.bas");}while(r); S_44717:; -while((func__mouseinput(NULL,0))||is_error_pending()){ +while((func__mouseinput())||is_error_pending()){ if(qbevent){evnt(23689,6865,"ide_methods.bas");if(r)goto S_44717;} ww_continue_5033:; } @@ -150663,7 +150531,7 @@ do{ sub_close(*__LONG_DEBUGCLIENT,1); if(!qbevent)break;evnt(23689,6885,"ide_methods.bas");}while(r); S_44737:; -while((func__mouseinput(NULL,0))||is_error_pending()){ +while((func__mouseinput())||is_error_pending()){ if(qbevent){evnt(23689,6886,"ide_methods.bas");if(r)goto S_44737;} ww_continue_5043:; } @@ -150904,13 +150772,13 @@ do{ *_SUB_DEBUGMODE_LONG_BKPPANELFIRSTVISIBLE=*(int16*)(((char*)_SUB_DEBUGMODE_UDT_VWATCHPANEL)+(8)); if(!qbevent)break;evnt(23689,6951,"ide_methods.bas");}while(r); S_44799:; -while((func__mouseinput(NULL,0))||is_error_pending()){ +while((func__mouseinput())||is_error_pending()){ if(qbevent){evnt(23689,6952,"ide_methods.bas");if(r)goto S_44799;} do{ -*__LONG_MX=qbr(func__mousex(NULL,0)); +*__LONG_MX=qbr(func__mousex()); if(!qbevent)break;evnt(23689,6953,"ide_methods.bas");}while(r); do{ -*__LONG_MY=qbr(func__mousey(NULL,0)); +*__LONG_MY=qbr(func__mousey()); if(!qbevent)break;evnt(23689,6954,"ide_methods.bas");}while(r); do{ *(int16*)(((char*)_SUB_DEBUGMODE_UDT_VWATCHPANEL)+(20))=*__LONG_MX; @@ -150922,7 +150790,7 @@ S_44804:; if ((qbs_cleanup(qbs_tmp_base,(-(__STRING_VARIABLEWATCHLIST->len> 0 ))&(((-(*__LONG_MX>=*(int16*)(((char*)_SUB_DEBUGMODE_UDT_VWATCHPANEL)+(0))))&(-(*__LONG_MX<=(*(int16*)(((char*)_SUB_DEBUGMODE_UDT_VWATCHPANEL)+(0))+*(int16*)(((char*)_SUB_DEBUGMODE_UDT_VWATCHPANEL)+(4)))))))&(((-(*__LONG_MY>=*(int16*)(((char*)_SUB_DEBUGMODE_UDT_VWATCHPANEL)+(2))))&(-(*__LONG_MY<=(*(int16*)(((char*)_SUB_DEBUGMODE_UDT_VWATCHPANEL)+(2))+*(int16*)(((char*)_SUB_DEBUGMODE_UDT_VWATCHPANEL)+(6)))))))))||is_error_pending()){ if(qbevent){evnt(23689,6959,"ide_methods.bas");if(r)goto S_44804;} do{ -*(int16*)(((char*)_SUB_DEBUGMODE_UDT_VWATCHPANEL)+(8))=*(int16*)(((char*)_SUB_DEBUGMODE_UDT_VWATCHPANEL)+(8))+(func__mousewheel(NULL,0)* 3 ); +*(int16*)(((char*)_SUB_DEBUGMODE_UDT_VWATCHPANEL)+(8))=*(int16*)(((char*)_SUB_DEBUGMODE_UDT_VWATCHPANEL)+(8))+(func__mousewheel()* 3 ); if(!qbevent)break;evnt(23689,6960,"ide_methods.bas");}while(r); S_44806:; if ((-(*(int16*)(((char*)_SUB_DEBUGMODE_UDT_VWATCHPANEL)+(8))< 1 ))||is_error_pending()){ @@ -150940,7 +150808,7 @@ if(!qbevent)break;evnt(23689,6963,"ide_methods.bas");}while(r); } }else{ do{ -*__LONG_IDECY=*__LONG_IDECY+(func__mousewheel(NULL,0)* 3 ); +*__LONG_IDECY=*__LONG_IDECY+(func__mousewheel()* 3 ); if(!qbevent)break;evnt(23689,6966,"ide_methods.bas");}while(r); } ww_continue_5057:; @@ -150974,10 +150842,10 @@ RETURN_68:; if(!qbevent)break;evnt(23689,6976,"ide_methods.bas");}while(r); } do{ -*__LONG_MB=func__mousebutton( 1 ,NULL,0); +*__LONG_MB=func__mousebutton( 1 ); if(!qbevent)break;evnt(23689,6979,"ide_methods.bas");}while(r); do{ -*__LONG_MB2=func__mousebutton( 2 ,NULL,0); +*__LONG_MB2=func__mousebutton( 2 ); if(!qbevent)break;evnt(23689,6980,"ide_methods.bas");}while(r); S_44828:; if ((*__LONG_MB2)||is_error_pending()){ @@ -151724,7 +151592,7 @@ do{ qbg_screen(NULL,NULL, 3 , 0 ,NULL,12); if(!qbevent)break;evnt(23689,7223,"ide_methods.bas");}while(r); S_45065:; -while((func__mouseinput(NULL,0))||is_error_pending()){ +while((func__mouseinput())||is_error_pending()){ if(qbevent){evnt(23689,7224,"ide_methods.bas");if(r)goto S_45065;} ww_continue_5095:; } @@ -152525,7 +152393,7 @@ SUB_SETSTATUSMESSAGE(&(pass5106= 1 ),qbs_new_txt_len("Debug session aborted.",22 qbs_cleanup(qbs_tmp_base,0); if(!qbevent)break;evnt(23689,7418,"ide_methods.bas");}while(r); S_45328:; -while((func__mouseinput(NULL,0))||is_error_pending()){ +while((func__mouseinput())||is_error_pending()){ if(qbevent){evnt(23689,7419,"ide_methods.bas");if(r)goto S_45328;} ww_continue_5108:; } @@ -152580,7 +152448,7 @@ goto LABEL_UPDATEDISPLAY; RETURN_97:; if(!qbevent)break;evnt(23689,7428,"ide_methods.bas");}while(r); S_45343:; -while((func__mouseinput(NULL,0))||is_error_pending()){ +while((func__mouseinput())||is_error_pending()){ if(qbevent){evnt(23689,7429,"ide_methods.bas");if(r)goto S_45343;} ww_continue_5109:; } @@ -152671,7 +152539,7 @@ do{ qbg_screen(NULL,NULL, 3 , 0 ,NULL,12); if(!qbevent)break;evnt(23689,7450,"ide_methods.bas");}while(r); S_45371:; -while((func__mouseinput(NULL,0))||is_error_pending()){ +while((func__mouseinput())||is_error_pending()){ if(qbevent){evnt(23689,7451,"ide_methods.bas");if(r)goto S_45371;} ww_continue_5111:; } @@ -153176,7 +153044,7 @@ do{ qbg_screen(NULL,NULL, 3 , 0 ,NULL,12); if(!qbevent)break;evnt(23689,7596,"ide_methods.bas");}while(r); S_45513:; -while((func__mouseinput(NULL,0))||is_error_pending()){ +while((func__mouseinput())||is_error_pending()){ if(qbevent){evnt(23689,7597,"ide_methods.bas");if(r)goto S_45513;} ww_continue_5142:; } @@ -153388,7 +153256,7 @@ do{ qbg_screen(NULL,NULL, 3 , 0 ,NULL,12); if(!qbevent)break;evnt(23689,7661,"ide_methods.bas");}while(r); S_45573:; -while((func__mouseinput(NULL,0))||is_error_pending()){ +while((func__mouseinput())||is_error_pending()){ if(qbevent){evnt(23689,7662,"ide_methods.bas");if(r)goto S_45573;} ww_continue_5162:; } @@ -153416,7 +153284,7 @@ do{ qbg_screen(NULL,NULL, 3 , 0 ,NULL,12); if(!qbevent)break;evnt(23689,7667,"ide_methods.bas");}while(r); S_45581:; -while((func__mouseinput(NULL,0))||is_error_pending()){ +while((func__mouseinput())||is_error_pending()){ if(qbevent){evnt(23689,7668,"ide_methods.bas");if(r)goto S_45581;} ww_continue_5163:; } @@ -153450,7 +153318,7 @@ do{ qbg_screen(NULL,NULL, 3 , 0 ,NULL,12); if(!qbevent)break;evnt(23689,7676,"ide_methods.bas");}while(r); S_45592:; -while((func__mouseinput(NULL,0))||is_error_pending()){ +while((func__mouseinput())||is_error_pending()){ if(qbevent){evnt(23689,7677,"ide_methods.bas");if(r)goto S_45592;} ww_continue_5164:; } @@ -153965,7 +153833,7 @@ goto LABEL_UPDATEDISPLAY; RETURN_124:; if(!qbevent)break;evnt(23689,7813,"ide_methods.bas");}while(r); S_45717:; -while((func__mouseinput(NULL,0))||is_error_pending()){ +while((func__mouseinput())||is_error_pending()){ if(qbevent){evnt(23689,7814,"ide_methods.bas");if(r)goto S_45717;} ww_continue_5198:; } @@ -154025,7 +153893,7 @@ do{ qbg_screen(NULL,NULL, 3 , 0 ,NULL,12); if(!qbevent)break;evnt(23689,7831,"ide_methods.bas");}while(r); S_45737:; -while((func__mouseinput(NULL,0))||is_error_pending()){ +while((func__mouseinput())||is_error_pending()){ if(qbevent){evnt(23689,7832,"ide_methods.bas");if(r)goto S_45737;} ww_continue_5205:; } @@ -154080,7 +153948,7 @@ do{ qbg_screen(NULL,NULL, 3 , 0 ,NULL,12); if(!qbevent)break;evnt(23689,7846,"ide_methods.bas");}while(r); S_45753:; -while((func__mouseinput(NULL,0))||is_error_pending()){ +while((func__mouseinput())||is_error_pending()){ if(qbevent){evnt(23689,7847,"ide_methods.bas");if(r)goto S_45753;} ww_continue_5210:; } @@ -154123,7 +153991,7 @@ do{ qbg_screen(NULL,NULL, 3 , 0 ,NULL,12); if(!qbevent)break;evnt(23689,7858,"ide_methods.bas");}while(r); S_45766:; -while((func__mouseinput(NULL,0))||is_error_pending()){ +while((func__mouseinput())||is_error_pending()){ if(qbevent){evnt(23689,7859,"ide_methods.bas");if(r)goto S_45766;} ww_continue_5211:; } @@ -154293,7 +154161,7 @@ do{ qbg_screen(NULL,NULL, 3 , 0 ,NULL,12); if(!qbevent)break;evnt(23689,7910,"ide_methods.bas");}while(r); S_45817:; -while((func__mouseinput(NULL,0))||is_error_pending()){ +while((func__mouseinput())||is_error_pending()){ if(qbevent){evnt(23689,7911,"ide_methods.bas");if(r)goto S_45817;} ww_continue_5221:; } @@ -154756,7 +154624,7 @@ qbs_cleanup(qbs_tmp_base,0); if(!qbevent)break;evnt(23689,8017,"ide_methods.bas");}while(r); } S_45939:; -while((func__mouseinput(NULL,0))||is_error_pending()){ +while((func__mouseinput())||is_error_pending()){ if(qbevent){evnt(23689,8019,"ide_methods.bas");if(r)goto S_45939;} ww_continue_5247:; } @@ -154945,7 +154813,7 @@ dl_continue_5056:; }while(1); dl_exit_5056:; S_45994:; -while((func__mouseinput(NULL,0))||is_error_pending()){ +while((func__mouseinput())||is_error_pending()){ if(qbevent){evnt(23689,8078,"ide_methods.bas");if(r)goto S_45994;} ww_continue_5262:; } @@ -154977,7 +154845,7 @@ SUB_SETSTATUSMESSAGE(&(pass5266= 2 ),qbs_new_txt_len("Disconnected.",13),&(pass5 qbs_cleanup(qbs_tmp_base,0); if(!qbevent)break;evnt(23689,8087,"ide_methods.bas");}while(r); S_46003:; -while((func__mouseinput(NULL,0))||is_error_pending()){ +while((func__mouseinput())||is_error_pending()){ if(qbevent){evnt(23689,8088,"ide_methods.bas");if(r)goto S_46003;} ww_continue_5268:; } @@ -155071,7 +154939,7 @@ SUB_SETSTATUSMESSAGE(&(pass5276= 2 ),qbs_new_txt_len("Disconnected.",13),&(pass5 qbs_cleanup(qbs_tmp_base,0); if(!qbevent)break;evnt(23689,8116,"ide_methods.bas");}while(r); S_46034:; -while((func__mouseinput(NULL,0))||is_error_pending()){ +while((func__mouseinput())||is_error_pending()){ if(qbevent){evnt(23689,8117,"ide_methods.bas");if(r)goto S_46034;} ww_continue_5278:; } @@ -191439,7 +191307,7 @@ if(!qbevent)break;evnt(23689,17968,"ide_methods.bas");}while(r); } } S_56501:; -while((func__mouseinput(NULL,0))||is_error_pending()){ +while((func__mouseinput())||is_error_pending()){ if(qbevent){evnt(23689,17970,"ide_methods.bas");if(r)goto S_56501;} do{ *__LONG_ICHANGED= 1 ; @@ -191448,27 +191316,27 @@ S_56503:; if ((*__BYTE_MOUSEBUTTONSWAPPED)||is_error_pending()){ if(qbevent){evnt(23689,17972,"ide_methods.bas");if(r)goto S_56503;} do{ -*__LONG_MB=func__mousebutton( 2 ,NULL,0); +*__LONG_MB=func__mousebutton( 2 ); if(!qbevent)break;evnt(23689,17973,"ide_methods.bas");}while(r); do{ -*__LONG_MB2=func__mousebutton( 1 ,NULL,0); +*__LONG_MB2=func__mousebutton( 1 ); if(!qbevent)break;evnt(23689,17973,"ide_methods.bas");}while(r); }else{ do{ -*__LONG_MB=func__mousebutton( 1 ,NULL,0); +*__LONG_MB=func__mousebutton( 1 ); if(!qbevent)break;evnt(23689,17975,"ide_methods.bas");}while(r); do{ -*__LONG_MB2=func__mousebutton( 2 ,NULL,0); +*__LONG_MB2=func__mousebutton( 2 ); if(!qbevent)break;evnt(23689,17975,"ide_methods.bas");}while(r); } do{ -*__LONG_MWHEEL=*__LONG_MWHEEL+func__mousewheel(NULL,0); +*__LONG_MWHEEL=*__LONG_MWHEEL+func__mousewheel(); if(!qbevent)break;evnt(23689,17977,"ide_methods.bas");}while(r); do{ -*__LONG_MX=qbr(func__mousex(NULL,0)); +*__LONG_MX=qbr(func__mousex()); if(!qbevent)break;evnt(23689,17978,"ide_methods.bas");}while(r); do{ -*__LONG_MY=qbr(func__mousey(NULL,0)); +*__LONG_MY=qbr(func__mousey()); if(!qbevent)break;evnt(23689,17978,"ide_methods.bas");}while(r); S_56513:; if (((-(*__LONG_MB!= 0 ))&(-(*__LONG_MOB== 0 )))||is_error_pending()){ @@ -191548,10 +191416,10 @@ do{ *__LONG_MRELEASE= 0 ; if(!qbevent)break;evnt(23689,17991,"ide_methods.bas");}while(r); S_56535:; -while((func__mousebutton( 1 ,NULL,0)|func__mousebutton( 2 ,NULL,0))||is_error_pending()){ +while((func__mousebutton( 1 )|func__mousebutton( 2 ))||is_error_pending()){ if(qbevent){evnt(23689,17992,"ide_methods.bas");if(r)goto S_56535;} do{ -*_SUB_CLEARMOUSE_LONG_I=func__mouseinput(NULL,0); +*_SUB_CLEARMOUSE_LONG_I=func__mouseinput(); if(!qbevent)break;evnt(23689,17993,"ide_methods.bas");}while(r); dl_continue_6423:; } From 0e4b646e4dbc2080a8225959f24e0b737df5c3af Mon Sep 17 00:00:00 2001 From: Roland Heyder Date: Tue, 1 Oct 2024 20:41:31 +0200 Subject: [PATCH 2/7] Remove _MOUSEPIP.E... functions - simple removal of all occurrences --- internal/c/libqb.cpp | 76 ------------------- internal/c/qbx.cpp | 4 - source/subs_functions/subs_functions.bas | 26 ------- .../syntax_highlighter_list.bas | 2 +- 4 files changed, 1 insertion(+), 107 deletions(-) diff --git a/internal/c/libqb.cpp b/internal/c/libqb.cpp index ef98ad2e7..f2d868c41 100644 --- a/internal/c/libqb.cpp +++ b/internal/c/libqb.cpp @@ -18903,82 +18903,6 @@ float func__mousey(int32 context, int32 passed) { return y; } -int32 func__mousepipeopen() { - // creates a new mouse pipe, routing all mouse input into it before any preceding pipes receive access to the data - - // create new queue - int32 context = list_add(mouse_message_queue_handles); - mouse_message_queue_struct *queue = (mouse_message_queue_struct *)list_get(mouse_message_queue_handles, context); - queue->lastIndex = 65535; - queue->queue = (mouse_message *)calloc(1, sizeof(mouse_message) * (queue->lastIndex + 1)); - - // link new queue to child queue - int32 child_context = mouse_message_queue_first; - mouse_message_queue_struct *child_queue = (mouse_message_queue_struct *)list_get(mouse_message_queue_handles, child_context); - queue->child = child_context; - child_queue->parent = context; - - // set new queue and primary queue - mouse_message_queue_first = context; - - return context; -} - -void sub__mouseinputpipe(int32 context) { - // pushes the current _MOUSEINPUT event to the lower pipe, effectively sharing the input with the lower pipe - - mouse_message_queue_struct *queue = (mouse_message_queue_struct *)list_get(mouse_message_queue_handles, context); - if (queue == NULL) { - error(258); - return; - } - - if (context == mouse_message_queue_default) { - error(5); - return; - } // cannot pipe input from the default queue - - int32 child_context = queue->child; - mouse_message_queue_struct *child_queue = (mouse_message_queue_struct *)list_get(mouse_message_queue_handles, child_context); - - // create new event in child queue - int32 i = child_queue->last + 1; - if (i > child_queue->lastIndex) - i = 0; - if (i == child_queue->current) { - int32 nextIndex = child_queue->last + 1; - if (nextIndex > child_queue->lastIndex) - nextIndex = 0; - child_queue->current = nextIndex; - } - - int32 i2 = queue->current; - - // copy event to child queue - child_queue->queue[i].x = queue->queue[i2].x; - child_queue->queue[i].y = queue->queue[i2].y; - child_queue->queue[i].movementx = queue->queue[i2].movementx; - child_queue->queue[i].movementy = queue->queue[i2].movementy; - child_queue->queue[i].buttons = queue->queue[i2].buttons; - child_queue->last = i; -} - -void sub__mousepipeclose(int32 context) { - // closes an existing pipe and reverts the new route the pipe created - - mouse_message_queue_struct *queue = (mouse_message_queue_struct *)list_get(mouse_message_queue_handles, context); - if (queue == NULL) { - error(258); - return; - } - if (context == mouse_message_queue_default) { - error(5); - return; - } // cannot delete default queue - - // todo! -} - int32 func__mouseinput(int32 context, int32 passed) { int32 handle; handle = mouse_message_queue_default; diff --git a/internal/c/qbx.cpp b/internal/c/qbx.cpp index 06566a03c..8c09b081a 100755 --- a/internal/c/qbx.cpp +++ b/internal/c/qbx.cpp @@ -385,10 +385,6 @@ extern int32 func__mouseinput(int32 context, int32 passed); extern int32 func__mousebutton(int32 i, int32 context, int32 passed); extern int32 func__mousewheel(int32 context, int32 passed); -extern int32 func__mousepipeopen(); -extern void sub__mouseinputpipe(int32 context); -extern void sub__mousepipeclose(int32 context); - extern void call_absolute(int32 args, uint16 offset); extern int32 func__newimage(int32 x, int32 y, int32 bpp, int32 passed); extern int32 func__copyimage(int32 i, int32 mode, int32 passed); diff --git a/source/subs_functions/subs_functions.bas b/source/subs_functions/subs_functions.bas index 72757a540..105168a70 100644 --- a/source/subs_functions/subs_functions.bas +++ b/source/subs_functions/subs_functions.bas @@ -1810,32 +1810,6 @@ id.hr_syntax = "_MOUSEWHEEL" regid -clearid -id.n = "_MousePipeOpen" -id.subfunc = 1 -id.callname = "func__mousepipeopen" -id.ret = LONGTYPE - ISPOINTER -id.hr_syntax = "_MOUSEPIPEOPEN" -regid - -clearid -id.n = "_MouseInputPipe" -id.subfunc = 2 -id.callname = "sub__mouseinputpipe" -id.args = 1 -id.arg = MKL$(LONGTYPE - ISPOINTER) -id.hr_syntax = "_MOUSEINPUTPIPE(context)" -regid - -clearid -id.n = "_MousePipeClose" -id.subfunc = 2 -id.callname = "sub__mousepipeclose" -id.args = 1 -id.arg = MKL$(LONGTYPE - ISPOINTER) -id.hr_syntax = "_MOUSEPIPECLOSE(context)" -regid - clearid id.n = "FreeFile" id.subfunc = 1 diff --git a/source/subs_functions/syntax_highlighter_list.bas b/source/subs_functions/syntax_highlighter_list.bas index f68db94d3..bbd380731 100644 --- a/source/subs_functions/syntax_highlighter_list.bas +++ b/source/subs_functions/syntax_highlighter_list.bas @@ -80,7 +80,7 @@ listOfKeywords$ = listOfKeywords$ +_ ' [M] - Keywords alphabetical (1st line = QB64, 2nd line = QB4.5, 3rd line = OpenGL) listOfKeywords$ = listOfKeywords$ +_ -"_MAPTRIANGLE@_MAPUNICODE@_MD5$@_MEM@_MEMCOPY@_MEMELEMENT@_MEMEXISTS@_MEMFILL@_MEMFREE@_MEMGET@_MEMIMAGE@_MEMNEW@_MEMPUT@_MEMSOUND@_MESSAGEBOX@_MIDDLE@_MIDISOUNDBANK@_MK$@_MOUSEBUTTON@_MOUSEHIDE@_MOUSEINPUT@_MOUSEMOVE@_MOUSEMOVEMENTX@_MOUSEMOVEMENTY@_MOUSEPIPEOPEN@_MOUSESHOW@_MOUSEWHEEL@_MOUSEX@_MOUSEY@" +_ +"_MAPTRIANGLE@_MAPUNICODE@_MD5$@_MEM@_MEMCOPY@_MEMELEMENT@_MEMEXISTS@_MEMFILL@_MEMFREE@_MEMGET@_MEMIMAGE@_MEMNEW@_MEMPUT@_MEMSOUND@_MESSAGEBOX@_MIDDLE@_MIDISOUNDBANK@_MK$@_MOUSEBUTTON@_MOUSEHIDE@_MOUSEINPUT@_MOUSEMOVE@_MOUSEMOVEMENTX@_MOUSEMOVEMENTY@_MOUSESHOW@_MOUSEWHEEL@_MOUSEX@_MOUSEY@" +_ "MID$@MKD$@MKDIR@MKDMBF$@MKI$@MKL$@MKS$@MKSMBF$@MOD@" +_ "_GLMAP1D@_GLMAP1F@_GLMAP2D@_GLMAP2F@_GLMAPGRID1D@_GLMAPGRID1F@_GLMAPGRID2D@_GLMAPGRID2F@_GLMATERIALF@_GLMATERIALFV@_GLMATERIALI@_GLMATERIALIV@_GLMATRIXMODE@_GLMULTMATRIXD@_GLMULTMATRIXF@" From 45656c0f7616726c8a623e73f90ae4dc0076babf Mon Sep 17 00:00:00 2001 From: Roland Heyder Date: Tue, 1 Oct 2024 20:51:47 +0200 Subject: [PATCH 3/7] Remove context argument - remove the optional context argument from all remaining mouse functions --- internal/c/libqb.cpp | 32 +++++++----------------- internal/c/qbx.cpp | 14 +++++------ source/subs_functions/subs_functions.bas | 30 ++++++---------------- 3 files changed, 24 insertions(+), 52 deletions(-) diff --git a/internal/c/libqb.cpp b/internal/c/libqb.cpp index f2d868c41..61248ab99 100644 --- a/internal/c/libqb.cpp +++ b/internal/c/libqb.cpp @@ -18712,11 +18712,9 @@ void sub__mouseshow(qbs *style, int32 passed) { #endif } -float func__mousemovementx(int32 context, int32 passed) { +float func__mousemovementx() { int32 handle; handle = mouse_message_queue_default; - if (passed) - handle = context; mouse_message_queue_struct *queue = (mouse_message_queue_struct *)list_get(mouse_message_queue_handles, handle); if (queue == NULL) { error(258); @@ -18724,11 +18722,9 @@ float func__mousemovementx(int32 context, int32 passed) { } return queue->queue[queue->current].movementx; } -float func__mousemovementy(int32 context, int32 passed) { +float func__mousemovementy() { int32 handle; handle = mouse_message_queue_default; - if (passed) - handle = context; mouse_message_queue_struct *queue = (mouse_message_queue_struct *)list_get(mouse_message_queue_handles, handle); if (queue == NULL) { error(258); @@ -18797,7 +18793,7 @@ void sub__mousemove(float x, float y) { #endif } -float func__mousex(int32 context, int32 passed) { +float func__mousex() { static int32 x, x2; static float f; @@ -18811,8 +18807,6 @@ float func__mousex(int32 context, int32 passed) { #endif handle = mouse_message_queue_default; - if (passed) - handle = context; mouse_message_queue_struct *queue = (mouse_message_queue_struct *)list_get(mouse_message_queue_handles, handle); if (queue == NULL) { error(258); @@ -18850,7 +18844,7 @@ float func__mousex(int32 context, int32 passed) { return x; } -float func__mousey(int32 context, int32 passed) { +float func__mousey() { static int32 y, y2; static float f; @@ -18864,8 +18858,6 @@ float func__mousey(int32 context, int32 passed) { #endif handle = mouse_message_queue_default; - if (passed) - handle = context; mouse_message_queue_struct *queue = (mouse_message_queue_struct *)list_get(mouse_message_queue_handles, handle); if (queue == NULL) { error(258); @@ -18903,11 +18895,9 @@ float func__mousey(int32 context, int32 passed) { return y; } -int32 func__mouseinput(int32 context, int32 passed) { +int32 func__mouseinput() { int32 handle; handle = mouse_message_queue_default; - if (passed) - handle = context; mouse_message_queue_struct *queue = (mouse_message_queue_struct *)list_get(mouse_message_queue_handles, handle); if (queue == NULL) { error(258); @@ -18922,7 +18912,7 @@ int32 func__mouseinput(int32 context, int32 passed) { return -1; } -int32 func__mousebutton(int32 i, int32 context, int32 passed) { +int32 func__mousebutton(int32 i) { if (i < 1) { error(5); return 0; @@ -18954,8 +18944,6 @@ int32 func__mousebutton(int32 i, int32 context, int32 passed) { } int32 handle; handle = mouse_message_queue_default; - if (passed) - handle = context; mouse_message_queue_struct *queue = (mouse_message_queue_struct *)list_get(mouse_message_queue_handles, handle); if (queue == NULL) { error(258); @@ -18966,7 +18954,7 @@ int32 func__mousebutton(int32 i, int32 context, int32 passed) { return 0; } -int32 func__mousewheel(int32 context, int32 passed) { +int32 func__mousewheel() { static uint32 x; int32 handle; @@ -18981,8 +18969,6 @@ int32 func__mousewheel(int32 context, int32 passed) { #endif handle = mouse_message_queue_default; - if (passed) - handle = context; mouse_message_queue_struct *queue = (mouse_message_queue_struct *)list_get(mouse_message_queue_handles, handle); if (queue == NULL) { error(258); @@ -19057,8 +19043,8 @@ void call_int(int32 i) { current_mouse_message_backup = queue->current; queue->current = queue->last; - mx = func__mousex(0, 0); - my = func__mousey(0, 0); + mx = func__mousex(); + my = func__mousey(); // restore "current" message index queue->current = current_mouse_message_backup; diff --git a/internal/c/qbx.cpp b/internal/c/qbx.cpp index 8c09b081a..9f32e183c 100755 --- a/internal/c/qbx.cpp +++ b/internal/c/qbx.cpp @@ -186,8 +186,8 @@ extern int32 func__keydown(int32 x); extern int32 func__keyhit(); extern int32 func_lpos(int32); extern void sub__printimage(int32 i); -extern float func__mousemovementx(int32 context, int32 passed); -extern float func__mousemovementy(int32 context, int32 passed); +extern float func__mousemovementx(); +extern float func__mousemovementy(); extern void sub__screenprint(qbs *txt); extern void sub__screenclick(int32 x, int32 y, int32 button, int32 passed); extern int32 func__screenimage(int32 x1, int32 y1, int32 x2, int32 y2, @@ -379,11 +379,11 @@ extern int32 func__statusCode(int32 handle); extern int32 func_freefile(); extern void sub__mousehide(); extern void sub__mouseshow(qbs *style, int32 passed); -extern float func__mousex(int32 context, int32 passed); -extern float func__mousey(int32 context, int32 passed); -extern int32 func__mouseinput(int32 context, int32 passed); -extern int32 func__mousebutton(int32 i, int32 context, int32 passed); -extern int32 func__mousewheel(int32 context, int32 passed); +extern float func__mousex(); +extern float func__mousey(); +extern int32 func__mouseinput(); +extern int32 func__mousebutton(int32 i); +extern int32 func__mousewheel(); extern void call_absolute(int32 args, uint16 offset); extern int32 func__newimage(int32 x, int32 y, int32 bpp, int32 passed); diff --git a/source/subs_functions/subs_functions.bas b/source/subs_functions/subs_functions.bas index 105168a70..873970d4c 100644 --- a/source/subs_functions/subs_functions.bas +++ b/source/subs_functions/subs_functions.bas @@ -1737,9 +1737,7 @@ id.n = "_MouseInput" id.subfunc = 1 id.callname = "func__mouseinput" id.ret = LONGTYPE - ISPOINTER -id.args = 1 -id.arg = MKL$(LONGTYPE - ISPOINTER) -id.specialformat = "[?]" +id.args = 0 id.hr_syntax = "_MOUSEINPUT" regid @@ -1748,9 +1746,7 @@ id.n = "_MouseX" id.subfunc = 1 id.callname = "func__mousex" id.ret = SINGLETYPE - ISPOINTER -id.args = 1 -id.arg = MKL$(LONGTYPE - ISPOINTER) -id.specialformat = "[?]" +id.args = 0 id.hr_syntax = "_MOUSEX" regid @@ -1759,9 +1755,7 @@ id.n = "_MouseY" id.subfunc = 1 id.callname = "func__mousey" id.ret = SINGLETYPE - ISPOINTER -id.args = 1 -id.arg = MKL$(LONGTYPE - ISPOINTER) -id.specialformat = "[?]" +id.args = 0 id.hr_syntax = "_MOUSEY" regid @@ -1770,9 +1764,7 @@ id.n = "_MouseMovementX" id.subfunc = 1 id.callname = "func__mousemovementx" id.ret = SINGLETYPE - ISPOINTER -id.args = 1 -id.arg = MKL$(LONGTYPE - ISPOINTER) -id.specialformat = "[?]" +id.args = 0 id.hr_syntax = "_MOUSEMOVEMENTX" regid @@ -1781,9 +1773,7 @@ id.n = "_MouseMovementY" id.subfunc = 1 id.callname = "func__mousemovementy" id.ret = SINGLETYPE - ISPOINTER -id.args = 1 -id.arg = MKL$(LONGTYPE - ISPOINTER) -id.specialformat = "[?]" +id.args = 0 id.hr_syntax = "_MOUSEMOVEMENTY" regid @@ -1791,10 +1781,9 @@ clearid id.n = "_MouseButton" id.subfunc = 1 id.callname = "func__mousebutton" -id.args = 2 -id.arg = MKL$(LONGTYPE - ISPOINTER)+MKL$(LONGTYPE - ISPOINTER) +id.args = 1 +id.arg = MKL$(LONGTYPE - ISPOINTER) id.ret = LONGTYPE - ISPOINTER -id.specialformat = "?[,?]" id.hr_syntax = "_MOUSEBUTTON(buttonNumber)" regid @@ -1803,13 +1792,10 @@ id.n = "_MouseWheel" id.subfunc = 1 id.callname = "func__mousewheel" id.ret = LONGTYPE - ISPOINTER -id.args = 1 -id.arg = MKL$(LONGTYPE - ISPOINTER) -id.specialformat = "[?]" +id.args = 0 id.hr_syntax = "_MOUSEWHEEL" regid - clearid id.n = "FreeFile" id.subfunc = 1 From 0024e65cf86b3b6ffb4dbfe23aca65a041c6c945 Mon Sep 17 00:00:00 2001 From: Roland Heyder Date: Tue, 1 Oct 2024 20:57:56 +0200 Subject: [PATCH 4/7] Mouse queue refactoring - rework the former mouse queue list to use a single queue instead - invalid handle errors may not happen anymore (removed) --- internal/c/libqb.cpp | 103 ++++++++----------------------------------- 1 file changed, 18 insertions(+), 85 deletions(-) diff --git a/internal/c/libqb.cpp b/internal/c/libqb.cpp index 61248ab99..fce4c69bf 100644 --- a/internal/c/libqb.cpp +++ b/internal/c/libqb.cpp @@ -5630,26 +5630,15 @@ struct mouse_message { int16 movementy; }; -/* - mouse_message mouse_messages[65536];//a circular buffer of mouse messages - int32 last_mouse_message=0; - int32 current_mouse_message=0; -*/ - -// Mouse message queue system -//-------------------------- +// Mouse message queue +//-------------------- struct mouse_message_queue_struct { mouse_message *queue; int32 lastIndex; int32 current; - int32 first; int32 last; - int32 child; - int32 parent; }; -list *mouse_message_queue_handles = NULL; -int32 mouse_message_queue_first; // the first queue to populate from input source -int32 mouse_message_queue_default; // the default queue (for int33h and default _MOUSEINPUT operations) +static mouse_message_queue_struct mouse_message_queue = {NULL, 0, 0, 0}; // x86 Virtual CMEM emulation // Note: x86 CPU emulation is still experimental and is not available in QB64 yet. @@ -18713,23 +18702,11 @@ void sub__mouseshow(qbs *style, int32 passed) { } float func__mousemovementx() { - int32 handle; - handle = mouse_message_queue_default; - mouse_message_queue_struct *queue = (mouse_message_queue_struct *)list_get(mouse_message_queue_handles, handle); - if (queue == NULL) { - error(258); - return 0; - } + mouse_message_queue_struct *queue = &mouse_message_queue; return queue->queue[queue->current].movementx; } float func__mousemovementy() { - int32 handle; - handle = mouse_message_queue_default; - mouse_message_queue_struct *queue = (mouse_message_queue_struct *)list_get(mouse_message_queue_handles, handle); - if (queue == NULL) { - error(258); - return 0; - } + mouse_message_queue_struct *queue = &mouse_message_queue; return queue->queue[queue->current].movementy; } @@ -18798,20 +18775,13 @@ float func__mousex() { static int32 x, x2; static float f; - int32 handle; - #ifdef QB64_WINDOWS if (read_page->console) { return consolemousex; } #endif - handle = mouse_message_queue_default; - mouse_message_queue_struct *queue = (mouse_message_queue_struct *)list_get(mouse_message_queue_handles, handle); - if (queue == NULL) { - error(258); - return 0; - } + mouse_message_queue_struct *queue = &mouse_message_queue; x = queue->queue[queue->current].x; // calculate pixel offset of mouse within SCREEN using environment variables @@ -18849,20 +18819,13 @@ float func__mousey() { static int32 y, y2; static float f; - int32 handle; - #ifdef QB64_WINDOWS if (read_page->console) { return consolemousey; } #endif - handle = mouse_message_queue_default; - mouse_message_queue_struct *queue = (mouse_message_queue_struct *)list_get(mouse_message_queue_handles, handle); - if (queue == NULL) { - error(258); - return 0; - } + mouse_message_queue_struct *queue = &mouse_message_queue; y = queue->queue[queue->current].y; // calculate pixel offset of mouse within SCREEN using environment variables @@ -18896,13 +18859,7 @@ float func__mousey() { } int32 func__mouseinput() { - int32 handle; - handle = mouse_message_queue_default; - mouse_message_queue_struct *queue = (mouse_message_queue_struct *)list_get(mouse_message_queue_handles, handle); - if (queue == NULL) { - error(258); - return 0; - } + mouse_message_queue_struct *queue = &mouse_message_queue; if (queue->current == queue->last) return 0; int32 newIndex = queue->current + 1; @@ -18942,13 +18899,7 @@ int32 func__mousebutton(int32 i) { if (i == 3) i = 2; } - int32 handle; - handle = mouse_message_queue_default; - mouse_message_queue_struct *queue = (mouse_message_queue_struct *)list_get(mouse_message_queue_handles, handle); - if (queue == NULL) { - error(258); - return 0; - } + mouse_message_queue_struct *queue = &mouse_message_queue; if (queue->queue[queue->current].buttons & (1 << (i - 1))) return -1; return 0; @@ -18956,7 +18907,6 @@ int32 func__mousebutton(int32 i) { int32 func__mousewheel() { static uint32 x; - int32 handle; #ifdef QB64_WINDOWS if (read_page->console) { @@ -18968,12 +18918,7 @@ int32 func__mousewheel() { } #endif - handle = mouse_message_queue_default; - mouse_message_queue_struct *queue = (mouse_message_queue_struct *)list_get(mouse_message_queue_handles, handle); - if (queue == NULL) { - error(258); - return 0; - } + mouse_message_queue_struct *queue = &mouse_message_queue; x = queue->queue[queue->current].buttons; if ((x & (8 + 16)) == (8 + 16)) return 0; // cancelled out change @@ -19026,9 +18971,7 @@ void call_int(int32 i) { // return the current mouse status // buttons - int32 handle; - handle = mouse_message_queue_default; - mouse_message_queue_struct *queue = (mouse_message_queue_struct *)list_get(mouse_message_queue_handles, handle); + mouse_message_queue_struct *queue = &mouse_message_queue; // buttons cpu.bx = queue->queue[queue->last].buttons & 1; @@ -28898,9 +28841,7 @@ void GLUT_DISPLAY_REQUEST() { void GLUT_MouseButton_Up(int button, int x, int y) { # ifdef QB64_GLUT int32 i; - int32 handle; - handle = mouse_message_queue_first; - mouse_message_queue_struct *queue = (mouse_message_queue_struct *)list_get(mouse_message_queue_handles, handle); + mouse_message_queue_struct *queue = &mouse_message_queue; i = queue->last + 1; if (i > queue->lastIndex) @@ -28940,9 +28881,7 @@ void GLUT_MouseButton_Down(int button, int x, int y) { # ifdef QB64_GLUT int32 i; - int32 handle; - handle = mouse_message_queue_first; - mouse_message_queue_struct *queue = (mouse_message_queue_struct *)list_get(mouse_message_queue_handles, handle); + mouse_message_queue_struct *queue = &mouse_message_queue; i = queue->last + 1; if (i > queue->lastIndex) @@ -29010,14 +28949,12 @@ void GLUT_MOUSE_FUNC(int glut_button, int state, int x, int y) { void GLUT_MOTION_FUNC(int x, int y) { int32 i, last_i; - int32 handle; int32 xrel, yrel; // This is used to save the last mouse position which is then paired with the mouse wheel event on macOS macMouseUpdatePosition(x, y); - handle = mouse_message_queue_first; - mouse_message_queue_struct *queue = (mouse_message_queue_struct *)list_get(mouse_message_queue_handles, handle); + mouse_message_queue_struct *queue = &mouse_message_queue; // message #1 last_i = queue->last; @@ -29382,7 +29319,6 @@ int main(int argc, char *argv[]) { } // setup lists - mouse_message_queue_handles = list_new(sizeof(mouse_message_queue_struct)); special_handles = list_new(sizeof(special_handle_struct)); stream_handles = list_new(sizeof(stream_struct)); connection_handles = list_new(sizeof(connection_struct)); @@ -29391,11 +29327,9 @@ int main(int argc, char *argv[]) { hardware_graphics_command_handles = list_new(sizeof(hardware_graphics_command_struct)); // setup default mouse message queue - mouse_message_queue_first = list_add(mouse_message_queue_handles); - mouse_message_queue_default = mouse_message_queue_first; - mouse_message_queue_struct *this_mouse_message_queue = (mouse_message_queue_struct *)list_get(mouse_message_queue_handles, mouse_message_queue_default); - this_mouse_message_queue->lastIndex = 65535; - this_mouse_message_queue->queue = (mouse_message *)calloc(1, sizeof(mouse_message) * (this_mouse_message_queue->lastIndex + 1)); + mouse_message_queue_struct *queue = &mouse_message_queue; + queue->lastIndex = 65535; + queue->queue = (mouse_message *)calloc(1, sizeof(mouse_message) * (queue->lastIndex + 1)); snd_init(); @@ -31841,8 +31775,7 @@ extern "C" void qb64_os_event_linux(XEvent *event, Display *display, int *qb64_o #endif void qb64_custom_event_relative_mouse_movement(int deltaX, int deltaY) { - int32_t handle = mouse_message_queue_first; - mouse_message_queue_struct *queue = (mouse_message_queue_struct *)list_get(mouse_message_queue_handles, handle); + mouse_message_queue_struct *queue = &mouse_message_queue; // message #1 int32_t i = queue->last + 1; if (i > queue->lastIndex) From 182f729df51e22073754ba3196d6274270322524 Mon Sep 17 00:00:00 2001 From: Roland Heyder Date: Wed, 2 Oct 2024 10:43:31 +0200 Subject: [PATCH 5/7] Unused variables removed - some global variables, which are not referenced anywhere (remains from SDL age?) --- internal/c/libqb.cpp | 9 --------- 1 file changed, 9 deletions(-) diff --git a/internal/c/libqb.cpp b/internal/c/libqb.cpp index fce4c69bf..efdd6d621 100644 --- a/internal/c/libqb.cpp +++ b/internal/c/libqb.cpp @@ -3536,20 +3536,11 @@ uint32 pal[256]; extern qbs *nothingstring; -static uint32 sdl_shiftstate = 0; - -static uint32 sdl_scroll_lock = 0; -static uint32 sdl_insert = 0; -static uint32 sdl_scroll_lock_prepared = 1; -static uint32 sdl_insert_prepared = 1; - int32 sub_screen_height_in_characters = -1; //-1=undefined int32 sub_screen_width_in_characters = -1; //-1=undefined int32 sub_screen_font = -1; //-1=undefined int32 sub_screen_keep_page0 = 0; -int32 key_repeat_on = 0; - uint32 palette_256[256]; uint32 palette_64[64]; From ff960c520e20b95c6265aca8eb8a4e17217d2c3b Mon Sep 17 00:00:00 2001 From: Roland Heyder Date: Wed, 2 Oct 2024 10:48:31 +0200 Subject: [PATCH 6/7] Implement _MOUSEHIDDEN function - as per the feature request by Terry here https://qb64phoenix.com/forum/showthread.php?tid=3089 --- internal/c/libqb.cpp | 11 ++++++++--- internal/c/qbx.cpp | 1 + source/subs_functions/subs_functions.bas | 9 +++++++++ source/subs_functions/syntax_highlighter_list.bas | 2 +- 4 files changed, 19 insertions(+), 4 deletions(-) diff --git a/internal/c/libqb.cpp b/internal/c/libqb.cpp index efdd6d621..70c6f0d26 100644 --- a/internal/c/libqb.cpp +++ b/internal/c/libqb.cpp @@ -5611,7 +5611,7 @@ uint32 frame = 0; extern uint8 cmem[1114099]; // 16*65535+65535+3 (enough for highest referencable dword in conv memory) -int32 mouse_hideshow_called = 0; +static int32 mouse_hiddden = 0; struct mouse_message { int16 x; @@ -18618,6 +18618,7 @@ void sub__mousehide() { libqb_glut_set_cursor(GLUT_CURSOR_NONE); # endif #endif + mouse_hiddden = -1; } #ifdef QB64_GLUT @@ -18630,7 +18631,7 @@ void sub__mouseshow(qbs *style, int32 passed) { if (is_error_pending()) return; -#ifdef QB64_GLUT +# ifdef QB64_GLUT OPTIONAL_GLUT(); static qbs *str = NULL; @@ -18688,8 +18689,12 @@ void sub__mouseshow(qbs *style, int32 passed) { cursor_valid: libqb_glut_set_cursor(mouse_cursor_style); +# endif + mouse_hiddden = 0; +} -#endif +int32_t func__mousehidden() { + return mouse_hiddden; } float func__mousemovementx() { diff --git a/internal/c/qbx.cpp b/internal/c/qbx.cpp index 9f32e183c..3fc2538e2 100755 --- a/internal/c/qbx.cpp +++ b/internal/c/qbx.cpp @@ -379,6 +379,7 @@ extern int32 func__statusCode(int32 handle); extern int32 func_freefile(); extern void sub__mousehide(); extern void sub__mouseshow(qbs *style, int32 passed); +extern int32 func__mousehidden(); extern float func__mousex(); extern float func__mousey(); extern int32 func__mouseinput(); diff --git a/source/subs_functions/subs_functions.bas b/source/subs_functions/subs_functions.bas index 873970d4c..723a62fb3 100644 --- a/source/subs_functions/subs_functions.bas +++ b/source/subs_functions/subs_functions.bas @@ -1732,6 +1732,15 @@ id.callname = "sub__mousehide" id.hr_syntax = "_MOUSEHIDE" regid +clearid +id.n = "_MouseHidden" +id.subfunc = 1 +id.callname = "func__mousehidden" +id.ret = LONGTYPE - ISPOINTER +id.args = 0 +id.hr_syntax = "_MOUSEHIDDEN" +regid + clearid id.n = "_MouseInput" id.subfunc = 1 diff --git a/source/subs_functions/syntax_highlighter_list.bas b/source/subs_functions/syntax_highlighter_list.bas index bbd380731..dc2e203f7 100644 --- a/source/subs_functions/syntax_highlighter_list.bas +++ b/source/subs_functions/syntax_highlighter_list.bas @@ -80,7 +80,7 @@ listOfKeywords$ = listOfKeywords$ +_ ' [M] - Keywords alphabetical (1st line = QB64, 2nd line = QB4.5, 3rd line = OpenGL) listOfKeywords$ = listOfKeywords$ +_ -"_MAPTRIANGLE@_MAPUNICODE@_MD5$@_MEM@_MEMCOPY@_MEMELEMENT@_MEMEXISTS@_MEMFILL@_MEMFREE@_MEMGET@_MEMIMAGE@_MEMNEW@_MEMPUT@_MEMSOUND@_MESSAGEBOX@_MIDDLE@_MIDISOUNDBANK@_MK$@_MOUSEBUTTON@_MOUSEHIDE@_MOUSEINPUT@_MOUSEMOVE@_MOUSEMOVEMENTX@_MOUSEMOVEMENTY@_MOUSESHOW@_MOUSEWHEEL@_MOUSEX@_MOUSEY@" +_ +"_MAPTRIANGLE@_MAPUNICODE@_MD5$@_MEM@_MEMCOPY@_MEMELEMENT@_MEMEXISTS@_MEMFILL@_MEMFREE@_MEMGET@_MEMIMAGE@_MEMNEW@_MEMPUT@_MEMSOUND@_MESSAGEBOX@_MIDDLE@_MIDISOUNDBANK@_MK$@_MOUSEBUTTON@_MOUSEHIDDEN@_MOUSEHIDE@_MOUSEINPUT@_MOUSEMOVE@_MOUSEMOVEMENTX@_MOUSEMOVEMENTY@_MOUSESHOW@_MOUSEWHEEL@_MOUSEX@_MOUSEY@" +_ "MID$@MKD$@MKDIR@MKDMBF$@MKI$@MKL$@MKS$@MKSMBF$@MOD@" +_ "_GLMAP1D@_GLMAP1F@_GLMAP2D@_GLMAP2F@_GLMAPGRID1D@_GLMAPGRID1F@_GLMAPGRID2D@_GLMAPGRID2F@_GLMATERIALF@_GLMATERIALFV@_GLMATERIALI@_GLMATERIALIV@_GLMATRIXMODE@_GLMULTMATRIXD@_GLMULTMATRIXF@" From d757b86ce398d7731beb815162dfb9b0dc2d206d Mon Sep 17 00:00:00 2001 From: Roland Heyder Date: Wed, 2 Oct 2024 15:22:21 +0200 Subject: [PATCH 7/7] Update README.md --- README.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/README.md b/README.md index eca4ec713..9a1267b0b 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ ![QB64-PE](source/peLogo.png) -QB64 is a modern extended BASIC+OpenGL language that retains QB4.5/QBasic compatibility and compiles native binaries for Windows (Vista and up), Linux and macOS. +QB64 is a modern extended BASIC+OpenGL language that retains QB4.5/QBasic compatibility and compiles native binaries for Windows (7 and up), Linux and macOS (Catalina and up). The Phoenix Edition is one of the new offshoots created when the old project related pages (QB64Team/www.qb64.org) went offline, but it's still the same programming language. For the whole story visit our new [Forum](https://qb64phoenix.com/forum/showthread.php?tid=259). @@ -62,8 +62,6 @@ More about QB64-PE at our wiki: https://qb64phoenix.com/qb64wiki We have a community forum at: https://qb64phoenix.com/forum -We don't currently tweet. Sorry. - Find us on Discord: https://discord.gg/D2M7hepTSx Join us on Reddit: https://www.reddit.com/r/QB64pe/