Skip to content

Commit

Permalink
Cleanups and minor changes
Browse files Browse the repository at this point in the history
- White Apple logo didn't show when
RevoBoot/i386/config/EFI/Macmodel[nn].h was used
  • Loading branch information
Piker-Alpha committed Oct 13, 2014
1 parent 3b10fc2 commit 716168d
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 20 deletions.
9 changes: 5 additions & 4 deletions i386/boot2/boot.c
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,6 @@
#include "sl.h"
#include "libsa.h"

#include "cpu/proc_reg.h"

// DHP: Dump all global junk a.s.a.p.

long gBootMode = kBootModeQuiet; // no longer defaults to 0 aka kBootModeNormal
Expand Down Expand Up @@ -237,12 +235,15 @@ void boot(int biosdev)
showBootLogo(bootRecoveryHD);
#endif

#if (LOAD_MODEL_SPECIFIC_EFI_DATA == 0)
#if (LOAD_MODEL_SPECIFIC_EFI_DATA == 0 && BLACKMODE == 0)
/*
* We can only make this call here when static EFI is included from:
* RevoBoot/i386/config/EFI/[MacModelNN.h] Not when the data is read from:
* /Extra/EFI/ because then RevoBoot/i386/libsaio/platform.c makes the call.
*/
*
* We can also <em>not</em> call it here if BLACKMODE is enabled, because
* then it fails to load: /usr/standalone/i386/EfiLoginUI/appleLogo.efires
*/
initPartitionChain();
#endif

Expand Down
17 changes: 7 additions & 10 deletions i386/boot2/bootlogo.c
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,6 @@ void drawDataRectangle(unsigned short x, unsigned short y, unsigned short width,

#include "picopng.h"


//==============================================================================

void showBootLogo(bool aBootRecoveryHDFlag)
Expand Down Expand Up @@ -149,8 +148,10 @@ void showBootLogo(bool aBootRecoveryHDFlag)
setBackgroundColor(backGroundColor);

void *imageLoadBuffer = (void *)kLoadAddr;

sprintf(filename, "%s%s", (aBootRecoveryHDFlag) ? "/com.apple.Boot.P" : "", "/usr/standalone/i386/EfiLoginUI/appleLogo.efires");
//
// Rock, Paper, Scissors?
//
sprintf(filename, "%s", (aBootRecoveryHDFlag) ? "/com.apple.Boot.P" : "", "/usr/standalone/i386/EfiLoginUI/appleLogo.efires");

int EFIResourceFile = open(filename, 0);

Expand Down Expand Up @@ -188,18 +189,14 @@ void showBootLogo(bool aBootRecoveryHDFlag)
uint8_t *bootImage = malloc((info->width * 4) * info->height);
memcpy(bootImage, info->image->data, ((info->width * 4) * info->height));

#if DEBUG
setVideoMode(GRAPHICS_MODE);
#endif
uint16_t x = (VIDEO(width) - MIN(info->width, VIDEO(width)) ) / 2;
uint16_t y = (VIDEO(height) - MIN(info->height, VIDEO(height)) ) / 2;

blendImage(x, y, info->width, info->height, bootImage);
png_alloc_free_all();

free(bootImage);
#if INTEL_VGA_REG_DUMP
setVideoMode(VGA_TEXT_MODE);
#endif
// extern void vga(void);
// vga();

return;
}
Expand Down
2 changes: 1 addition & 1 deletion i386/libsa/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ INC = -I. -I$(SYMROOT) -I$(UTILDIR) -I$(LIBSAIODIR)

VPATH = $(OBJROOT):$(SYMROOT)

SA_OBJS = prf.o printf.o zalloc.o string.o strtol.o setjmp.o crc32.o
SA_OBJS = prf.o printf.o zalloc.o string.o strtol.o crc32.o

LIBS = libsa.a

Expand Down
2 changes: 1 addition & 1 deletion i386/libsaio/platform.c
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ void initPlatform(int biosDevice, bool bootRecoveryHD)

initKernelBootConfig();

#if (LOAD_MODEL_SPECIFIC_EFI_DATA)
#if (LOAD_MODEL_SPECIFIC_EFI_DATA || BLACKMODE)
/*
* We need to call this much earlier in the boot process when static EFI data
* is read from: /Extra/EFI[MacModelNN.bin]. Otherwise LoadFile (load.c) fails.
Expand Down
8 changes: 4 additions & 4 deletions r
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,17 @@ if [[ "$1" =~ [iMac|Mac] ]];
#
# Use specified MacModelNN from argument.
#
make MODEL=$1 > out.log
make MODEL=$1
else
#
# Check RevoBoot/MODEL for default model.
#
if [[ -f MODEL ]];
if [ -f MODEL ];
then
#
# Get MacModelNN from MODEL (assuming it to be correct).
#
make MODEL=`cat MODEL` > out.log
make MODEL=`cat MODEL`
else
#
# No default model found. Create MODEL file for future use.
Expand All @@ -26,7 +26,7 @@ if [[ "$1" =~ [iMac|Mac] ]];
#
# Use Macmini62 as our default (matches settings-template.h)
#
make MODEL=Macmini62 > out.log
make MODEL=Macmini62
fi;
fi

0 comments on commit 716168d

Please sign in to comment.