mirror of
https://github.com/Metabolix/HackBGRT.git
synced 2025-12-06 17:15:42 -08:00
Add ARM (32-bit) target (without shim, though)
Remove some integer divisions because they emit function calls.
This commit is contained in:
8
Makefile
8
Makefile
@@ -14,7 +14,7 @@ CFLAGS += '-DGIT_DESCRIBE_W=L"$(GIT_DESCRIBE)"' '-DGIT_DESCRIBE="$(GIT_DESCRIBE)
|
||||
ZIPDIR = HackBGRT-$(GIT_DESCRIBE:v%=%)
|
||||
ZIP = $(ZIPDIR).zip
|
||||
|
||||
EFI_ARCH_LIST = x64 ia32 aa64
|
||||
EFI_ARCH_LIST = x64 ia32 aa64 arm
|
||||
|
||||
.PHONY: all efi efi-signed setup zip clean
|
||||
|
||||
@@ -74,5 +74,11 @@ efi/bootaa64.efi: $(FILES_C)
|
||||
@mkdir -p build
|
||||
$(CC) $(CFLAGS) $(LDFLAGS) $^ -o $@
|
||||
|
||||
efi/bootarm.efi: CLANG_TARGET = armv6-pc-windows-msvc
|
||||
efi/bootarm.efi: GNUEFI_ARCH = arm
|
||||
efi/bootarm.efi: $(FILES_C)
|
||||
@mkdir -p build
|
||||
$(CC) $(CFLAGS) $(LDFLAGS) $^ -o $@
|
||||
|
||||
clean:
|
||||
rm -rf setup.exe efi efi-signed
|
||||
|
||||
@@ -70,8 +70,8 @@ BOOLEAN ReadConfigFile(struct HackBGRT_config* config, EFI_FILE_HANDLE root_dir,
|
||||
|
||||
static void SetBMPWithRandom(struct HackBGRT_config* config, int weight, enum HackBGRT_action action, int x, int y, int o, const CHAR16* path) {
|
||||
config->image_weight_sum += weight;
|
||||
UINT32 random = Random();
|
||||
UINT32 limit = 0xfffffffful / config->image_weight_sum * weight;
|
||||
UINT32 random = (((UINT64) Random() & 0xffffffff) * config->image_weight_sum) >> 32;
|
||||
UINT32 limit = ((UINT64) 0xffffffff * weight) >> 32;
|
||||
Log(config->debug, L"HackBGRT: n=%d, action=%d, x=%d, y=%d, o=%d, path=%s, random = %x, limit = %x\n", weight, action, x, y, o, path, random, limit);
|
||||
if (!config->image_weight_sum || random <= limit) {
|
||||
config->action = action;
|
||||
|
||||
Reference in New Issue
Block a user