@@ -876,7 +876,7 @@ procedure initmachine(mode:integer);
876876 // mouse_update: DISPMANX_UPDATE_HANDLE_T;
877877
878878begin
879- bcmhostinit;
879+
880880for i:=base to base+$FFFFF do poke(i,0 ); // clean all system area
881881repeat fb:=FramebufferDevicegetdefault until fb<>nil ;
882882// get native resolution
@@ -920,36 +920,6 @@ procedure initmachine(mode:integer);
920920// init pallette, font and mouse cursor
921921
922922systemfont:=st4font;
923-
924- bcmhostinit;
925- display := vc_dispmanx_display_open(0 ); // todo: detect lcd
926-
927- // init mouse cursor as dispmanx element
928-
929- mouse_alpha.flags:=0 ; // opaciy from pixels
930- mouse_alpha.opacity:=0 ; // opaque
931- mouse_alpha.mask:=0 ;
932- mousetype:=VC_IMAGE_ARGB8888;
933- mousedata:=mysz;
934- for i:=0 to 1023 do if mousedata[i]<>0 then mousedata[i]:=mousedata[i] or $FF000000;
935- image:=@mousedata;
936- mouse_resource:=vc_dispmanx_resource_create(mousetype, 32 , 32 , @dummy );
937- vc_dispmanx_rect_set(@mouse_dst_rect, 0 , 0 , 32 , 32 );
938- vc_dispmanx_resource_write_data(mouse_resource,mousetype,128 ,image,@mouse_dst_rect);
939- mouse_update:=vc_dispmanx_update_start(10 );
940- vc_dispmanx_rect_set( @mouse_src_rect, 0 , 0 , 32 shl 16 , 32 shl 16 );
941- vc_dispmanx_rect_set( @mouse_dst_rect, xres div 2 , yres div 2 , 32 ,32 );
942- mouse_element:=vc_dispmanx_element_add(mouse_update,
943- display,
944- 256 , // mouse cursor is on top of all the rest
945- @mouse_dst_rect,
946- mouse_resource,
947- @mouse_src_rect,
948- DISPMANX_PROTECTION_NONE,
949- @mouse_alpha,
950- nil , // clamp
951- 0 );
952- vc_dispmanx_update_submit_sync(mouse_update);
953923 {
954924
955925// init the layer for windows decorations
@@ -1058,11 +1028,7 @@ procedure initmachine(mode:integer);
10581028mousex:=xres div 2 ;
10591029mousey:=yres div 2 ;
10601030mousewheel:=128 ;
1061- amouse:=tmouse.create(true);
1062- amouse.start;
10631031
1064- akeyboard:=tkeyboard.create(true);
1065- akeyboard.start;
10661032
10671033background:=TWindow.create(xres,yres,' ' );
10681034dispmanbackground:=TDispmanwindow.create(xres,yres,' ' );
@@ -1075,8 +1041,41 @@ procedure initmachine(mode:integer);
10751041windows:=twindows.create(true);
10761042windows.start;
10771043
1044+ bcmhostinit;
1045+ display := vc_dispmanx_display_open(0 ); // todo: detect lcd
1046+
1047+ // init mouse cursor as dispmanx element
1048+
1049+ mouse_alpha.flags:=0 ; // opaciy from pixels
1050+ mouse_alpha.opacity:=0 ; // opaque
1051+ mouse_alpha.mask:=0 ;
1052+ mousetype:=VC_IMAGE_ARGB8888;
1053+ mousedata:=mysz;
1054+ for i:=0 to 1023 do if mousedata[i]<>0 then mousedata[i]:=mousedata[i] or $FF000000;
1055+ image:=@mousedata;
1056+ mouse_resource:=vc_dispmanx_resource_create(mousetype, 32 , 32 , @dummy );
1057+ vc_dispmanx_rect_set(@mouse_dst_rect, 0 , 0 , 32 , 32 );
1058+ vc_dispmanx_resource_write_data(mouse_resource,mousetype,128 ,image,@mouse_dst_rect);
1059+ mouse_update:=vc_dispmanx_update_start(10 );
1060+ vc_dispmanx_rect_set( @mouse_src_rect, 0 , 0 , 32 shl 16 , 32 shl 16 );
1061+ vc_dispmanx_rect_set( @mouse_dst_rect, xres div 2 , yres div 2 , 32 ,32 );
1062+ mouse_element:=vc_dispmanx_element_add(mouse_update,
1063+ display,
1064+ 256 , // mouse cursor is on top of all the rest
1065+ @mouse_dst_rect,
1066+ mouse_resource,
1067+ @mouse_src_rect,
1068+ DISPMANX_PROTECTION_NONE,
1069+ @mouse_alpha,
1070+ nil , // clamp
1071+ 0 );
1072+ vc_dispmanx_update_submit_sync(mouse_update);
10781073
1074+ amouse:=tmouse.create(true);
1075+ amouse.start;
10791076
1077+ akeyboard:=tkeyboard.create(true);
1078+ akeyboard.start;
10801079// start audio, mouse, kbd and file buffer threads
10811080
10821081// desired.callback:=@AudioCallback;
0 commit comments