Skip to content

Commit a924b34

Browse files
committed
Starting problem fixed
1 parent 9e7e9ba commit a924b34

File tree

3 files changed

+37
-36
lines changed

3 files changed

+37
-36
lines changed

Project1.pas

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
blitter,
3434
// timezone;
3535
retro, simpleaudio, scripttest, xmp, mwindows, calculatorunit, icons, sysinfo,
36-
playerunit, captureunit, mandelbrot, notepad, c64;
36+
playerunit, captureunit, mandelbrot, notepad, c64,vc4;
3737

3838

3939
label p101, p102 ,p999, p998, p997;
@@ -259,6 +259,7 @@ procedure copyfile2(src,dest:string);
259259
RenameFile(drive+'kernel7_l.img',drive+'kernel7.img');
260260
// CopyFile2(drive+'\ultibo\Raspbian.u',drive+'kernel7.img');
261261
// stopmachine;
262+
bcmhostdeinit;
262263
systemrestart(0);
263264
end;
264265
end;
@@ -277,6 +278,7 @@ procedure copyfile2(src,dest:string);
277278

278279
until {(mousek=3) or }(key=key_escape) ;
279280
pauseaudio(1);
281+
bcmhostdeinit;
280282
if sfh>0 then fileclose(sfh);
281283
setcurrentdir(workdir);
282284
stopmachine;

kernel7.img

0 Bytes
Binary file not shown.

retromalina.pas

Lines changed: 34 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -876,7 +876,7 @@ procedure initmachine(mode:integer);
876876
// mouse_update: DISPMANX_UPDATE_HANDLE_T;
877877

878878
begin
879-
bcmhostinit;
879+
880880
for i:=base to base+$FFFFF do poke(i,0); // clean all system area
881881
repeat 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

922922
systemfont:=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);
10581028
mousex:=xres div 2;
10591029
mousey:=yres div 2;
10601030
mousewheel:=128;
1061-
amouse:=tmouse.create(true);
1062-
amouse.start;
10631031

1064-
akeyboard:=tkeyboard.create(true);
1065-
akeyboard.start;
10661032

10671033
background:=TWindow.create(xres,yres,'');
10681034
dispmanbackground:=TDispmanwindow.create(xres,yres,'');
@@ -1075,8 +1041,41 @@ procedure initmachine(mode:integer);
10751041
windows:=twindows.create(true);
10761042
windows.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

Comments
 (0)