Skip to content

Commit

Permalink
Removes linux Launcher.c folder and renames raspbian/ to linux/ (#30)
Browse files Browse the repository at this point in the history
  • Loading branch information
acmlira authored May 18, 2020
1 parent 877c8d2 commit aadf783
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 191 deletions.
2 changes: 1 addition & 1 deletion TotalCrossVM/builders/gcc-linux-arm/launcher/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ endif
$(info $$buld dir is [${BLDDIR}])

ifndef SRCDIR
SRCDIR = /src/launchers/raspbian
SRCDIR = /src/launchers/linux
endif

INCDIR = $(SRCDIR)/../../util
Expand Down
2 changes: 1 addition & 1 deletion TotalCrossVM/builders/gcc-posix/launcher/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ endif
$(info $$buld dir is [${BLDDIR}])

ifndef SRCDIR
SRCDIR = /src/launchers/raspbian
SRCDIR = /src/launchers/linux
endif

INCDIR = $(SRCDIR)/../../util
Expand Down
59 changes: 2 additions & 57 deletions TotalCrossVM/src/launchers/linux/Launcher.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
//
// SPDX-License-Identifier: LGPL-2.1-only



#if HAVE_CONFIG_H
#include "config.h"
#endif
Expand Down Expand Up @@ -38,58 +36,33 @@ static int executeProgram(char* cmdline)
printf("%s\n", dlerror());
tcvm = tryOpen("../libtcvm"); // load in parent folder
}

if (!tcvm) {
printf("%s\n", dlerror());
tcvm = tryOpen("/usr/lib/totalcross/libtcvm"); // load in most common absolute path
}

if (!tcvm) {
printf("%s\n", dlerror());
return 10000;
}

fExecuteProgram = (ExecuteProgramProc)dlsym(tcvm, TEXT("executeProgram"));

if (!fExecuteProgram)
return 10001;

ret = fExecuteProgram(cmdline); // call the function now

dlclose(tcvm); // free the library
return ret;
}

#if 0
#include <directfb.h>
#include <stdio.h>

static IDirectFB *dfb = NULL;
static IDirectFBSurface *primary = NULL;
static int screen_width = 0;
static int screen_height = 0;

#define DFBCHECK(x...) \
{ \
DFBResult err = x; \
\
if (err != DFB_OK) \
{ \
fprintf( stderr, "%s <%d>:\n\t", __FILE__, __LINE__ ); \
DirectFBErrorFatal( #x, err ); \
} \
}
#endif

int main(int argc, const char *argv[])
{
char cmdline[512];
xmemzero(cmdline,sizeof(cmdline));

if (argv)
{
xstrcpy(cmdline, argv[0]);
xstrcat(cmdline, ".tcz");
}

if (argc > 1 || args[0] != '1') // if there's a commandline passed by the system or one passed by the user
{
xstrcat(cmdline, " /cmd ");
Expand All @@ -103,33 +76,5 @@ int main(int argc, const char *argv[])
xstrcat(cmdline, *p++);
}
}

#if 0
DFBSurfaceDescription dsc;
DFBCHECK (DirectFBInit (&argc, &argv));
DFBCHECK (DirectFBCreate (&dfb));
DFBCHECK (dfb->SetCooperativeLevel (dfb, DFSCL_FULLSCREEN));
dsc.flags = DSDESC_CAPS;
dsc.caps = DSCAPS_PRIMARY | DSCAPS_FLIPPING;

IDirectFBDisplayLayer *layer;
DFBCHECK(dfb->GetDisplayLayer(dfb, DLID_PRIMARY, &layer));
layer->EnableCursor(layer, 1);
//DFBCHECK(layer->SetRotation(layer, 180));

DFBCHECK (dfb->CreateSurface( dfb, &dsc, &primary ));
DFBCHECK (primary->GetSize (primary, &screen_width, &screen_height));
DFBCHECK (primary->FillRectangle (primary, 0, 0, screen_width, screen_height));
DFBCHECK (primary->SetColor (primary, 0x80, 0x80, 0xff, 0xff));
DFBCHECK (primary->DrawLine (primary,
0, screen_height / 2,
screen_width - 1, screen_height / 2));
DFBCHECK (primary->Flip (primary, NULL, 0));
Sleep(5);
primary->Release( primary );
dfb->Release( dfb );
exit(0);
#endif

return executeProgram(cmdline); // in tcvm\startup.c
}
132 changes: 0 additions & 132 deletions TotalCrossVM/src/launchers/raspbian/Launcher.c

This file was deleted.

0 comments on commit aadf783

Please sign in to comment.