Skip to content

Commit

Permalink
Starting problem fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
pik33 committed Nov 7, 2017
1 parent 9e7e9ba commit a924b34
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 36 deletions.
4 changes: 3 additions & 1 deletion Project1.pas
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
blitter,
// timezone;
retro, simpleaudio, scripttest, xmp, mwindows, calculatorunit, icons, sysinfo,
playerunit, captureunit, mandelbrot, notepad, c64;
playerunit, captureunit, mandelbrot, notepad, c64,vc4;


label p101, p102 ,p999, p998, p997;
Expand Down Expand Up @@ -259,6 +259,7 @@ procedure copyfile2(src,dest:string);
RenameFile(drive+'kernel7_l.img',drive+'kernel7.img');
// CopyFile2(drive+'\ultibo\Raspbian.u',drive+'kernel7.img');
// stopmachine;
bcmhostdeinit;
systemrestart(0);
end;
end;
Expand All @@ -277,6 +278,7 @@ procedure copyfile2(src,dest:string);

until {(mousek=3) or }(key=key_escape) ;
pauseaudio(1);
bcmhostdeinit;
if sfh>0 then fileclose(sfh);
setcurrentdir(workdir);
stopmachine;
Expand Down
Binary file modified kernel7.img
Binary file not shown.
69 changes: 34 additions & 35 deletions retromalina.pas
Original file line number Diff line number Diff line change
Expand Up @@ -876,7 +876,7 @@ procedure initmachine(mode:integer);
// mouse_update: DISPMANX_UPDATE_HANDLE_T;

begin
bcmhostinit;

for i:=base to base+$FFFFF do poke(i,0); // clean all system area
repeat fb:=FramebufferDevicegetdefault until fb<>nil;
// get native resolution
Expand Down Expand Up @@ -920,36 +920,6 @@ procedure initmachine(mode:integer);
// init pallette, font and mouse cursor

systemfont:=st4font;

bcmhostinit;
display := vc_dispmanx_display_open(0); // todo: detect lcd

// init mouse cursor as dispmanx element

mouse_alpha.flags:=0; // opaciy from pixels
mouse_alpha.opacity:=0; //opaque
mouse_alpha.mask:=0;
mousetype:=VC_IMAGE_ARGB8888;
mousedata:=mysz;
for i:=0 to 1023 do if mousedata[i]<>0 then mousedata[i]:=mousedata[i] or $FF000000;
image:=@mousedata;
mouse_resource:=vc_dispmanx_resource_create(mousetype, 32, 32, @dummy );
vc_dispmanx_rect_set(@mouse_dst_rect, 0, 0, 32, 32);
vc_dispmanx_resource_write_data(mouse_resource,mousetype,128,image,@mouse_dst_rect);
mouse_update:=vc_dispmanx_update_start(10);
vc_dispmanx_rect_set( @mouse_src_rect, 0, 0, 32 shl 16, 32 shl 16 );
vc_dispmanx_rect_set( @mouse_dst_rect, xres div 2, yres div 2, 32,32);
mouse_element:=vc_dispmanx_element_add(mouse_update,
display,
256, // mouse cursor is on top of all the rest
@mouse_dst_rect,
mouse_resource,
@mouse_src_rect,
DISPMANX_PROTECTION_NONE,
@mouse_alpha,
nil, // clamp
0 );
vc_dispmanx_update_submit_sync(mouse_update);
{
// init the layer for windows decorations
Expand Down Expand Up @@ -1058,11 +1028,7 @@ procedure initmachine(mode:integer);
mousex:=xres div 2;
mousey:=yres div 2;
mousewheel:=128;
amouse:=tmouse.create(true);
amouse.start;

akeyboard:=tkeyboard.create(true);
akeyboard.start;

background:=TWindow.create(xres,yres,'');
dispmanbackground:=TDispmanwindow.create(xres,yres,'');
Expand All @@ -1075,8 +1041,41 @@ procedure initmachine(mode:integer);
windows:=twindows.create(true);
windows.start;

bcmhostinit;
display := vc_dispmanx_display_open(0); // todo: detect lcd

// init mouse cursor as dispmanx element

mouse_alpha.flags:=0; // opaciy from pixels
mouse_alpha.opacity:=0; //opaque
mouse_alpha.mask:=0;
mousetype:=VC_IMAGE_ARGB8888;
mousedata:=mysz;
for i:=0 to 1023 do if mousedata[i]<>0 then mousedata[i]:=mousedata[i] or $FF000000;
image:=@mousedata;
mouse_resource:=vc_dispmanx_resource_create(mousetype, 32, 32, @dummy );
vc_dispmanx_rect_set(@mouse_dst_rect, 0, 0, 32, 32);
vc_dispmanx_resource_write_data(mouse_resource,mousetype,128,image,@mouse_dst_rect);
mouse_update:=vc_dispmanx_update_start(10);
vc_dispmanx_rect_set( @mouse_src_rect, 0, 0, 32 shl 16, 32 shl 16 );
vc_dispmanx_rect_set( @mouse_dst_rect, xres div 2, yres div 2, 32,32);
mouse_element:=vc_dispmanx_element_add(mouse_update,
display,
256, // mouse cursor is on top of all the rest
@mouse_dst_rect,
mouse_resource,
@mouse_src_rect,
DISPMANX_PROTECTION_NONE,
@mouse_alpha,
nil, // clamp
0 );
vc_dispmanx_update_submit_sync(mouse_update);

amouse:=tmouse.create(true);
amouse.start;

akeyboard:=tkeyboard.create(true);
akeyboard.start;
// start audio, mouse, kbd and file buffer threads

//desired.callback:=@AudioCallback;
Expand Down

0 comments on commit a924b34

Please sign in to comment.