Make review changes

This commit is contained in:
Rangi42
2024-06-20 18:15:07 -04:00
parent 9588cf44aa
commit 77b7f861f3
4 changed files with 30 additions and 26 deletions

View File

@@ -896,7 +896,7 @@ ENDC
ld e, c ld e, c
ld l, $0D ld l, $0D
ld a, [CgbFlag] ld a, [CGBFlag]
bit 7, a bit 7, a
call z, EmulateDMG call z, EmulateDMG
bit 7, a bit 7, a

View File

@@ -120,9 +120,9 @@ Start:
; Set registers to match the original DMG boot ; Set registers to match the original DMG boot
IF DEF(MGB) IF DEF(MGB)
ld hl, (BOOTUP_A_MGB << 8) | $B0 lb hl, BOOTUP_A_MGB, %10110000
ELSE ELSE
ld hl, (BOOTUP_A_DMG << 8) | $B0 lb hl, BOOTUP_A_DMG, %10110000
ENDC ENDC
push hl push hl
pop af pop af

View File

@@ -25,12 +25,12 @@ ENDM
header_section NintendoLogoEnd, $0134 header_section NintendoLogoEnd, $0134
header_section Title, $0134 header_section Title, $0134
header_section ManufacturerCode, $013F header_section ManufacturerCode, $013F
header_section CgbFlag, $0143 header_section CGBFlag, $0143
header_section NewLicenseeCode, $0144 header_section NewLicenseeCode, $0144
header_section SgbFlag, $0146 header_section SGBFlag, $0146
header_section CartridgeType, $0147 header_section CartridgeType, $0147
header_section RomSize, $0148 header_section ROMSize, $0148
header_section RamSize, $0149 header_section RAMSize, $0149
header_section DestinationCode, $014A header_section DestinationCode, $014A
header_section OldLicenseeCode, $014B header_section OldLicenseeCode, $014B
header_section MaskRomVersion, $014C header_section MaskRomVersion, $014C

View File

@@ -151,6 +151,10 @@ RGBASM := $(RGBDS)rgbasm
RGBLINK := $(RGBDS)rgblink RGBLINK := $(RGBDS)rgblink
RGBGFX := $(RGBDS)rgbgfx RGBGFX := $(RGBDS)rgbgfx
# RGBASM 0.7+ deprecate and remove `-h`
RGBASM_FLAGS = $(if $(filter $(shell echo 'println __RGBDS_MAJOR__ || (!__RGBDS_MAJOR__ && __RGBDS_MINOR__ > 6)' | $(RGBASM) -), $$0), -h,) --include $(OBJ)/BootROMs/ --include BootROMs/
# RGBGFX 0.6+ replace `-h` with `-Z`, and need `-c embedded`
RGBGFX_FLAGS = $(if $(filter $(shell echo 'println __RGBDS_MAJOR__ || (!__RGBDS_MAJOR__ && __RGBDS_MINOR__ > 5)' | $(RGBASM) -), $$0), -h -u, -Z -u -c embedded)
# Set compilation and linkage flags based on target, platform and configuration # Set compilation and linkage flags based on target, platform and configuration
@@ -387,7 +391,7 @@ endif
$(OBJ)/SDL/%.dep: SDL/% $(OBJ)/SDL/%.dep: SDL/%
-@$(MKDIR) -p $(dir $@) -@$(MKDIR) -p $(dir $@)
$(CC) $(CFLAGS) $(SDL_CFLAGS) $(GL_CFLAGS) -MT $(OBJ)/$^.o -M $^ -c -o $@ $(CC) $(CFLAGS) $(SDL_CFLAGS) $(GL_CFLAGS) -MT $(OBJ)/$^.o -M $^ -c -o $@
$(OBJ)/OpenDialog/%.dep: OpenDialog/% $(OBJ)/OpenDialog/%.dep: OpenDialog/%
-@$(MKDIR) -p $(dir $@) -@$(MKDIR) -p $(dir $@)
$(CC) $(CFLAGS) $(SDL_CFLAGS) $(GL_CFLAGS) -MT $(OBJ)/$^.o -M $^ -c -o $@ $(CC) $(CFLAGS) $(SDL_CFLAGS) $(GL_CFLAGS) -MT $(OBJ)/$^.o -M $^ -c -o $@
@@ -414,16 +418,16 @@ $(OBJ)/OpenDialog/%.c.o: OpenDialog/%.c
$(OBJ)/%.c.o: %.c $(OBJ)/%.c.o: %.c
-@$(MKDIR) -p $(dir $@) -@$(MKDIR) -p $(dir $@)
$(CC) $(CFLAGS) $(FRONTEND_CFLAGS) $(FAT_FLAGS) -c $< -o $@ $(CC) $(CFLAGS) $(FRONTEND_CFLAGS) $(FAT_FLAGS) -c $< -o $@
# HexFiend requires more flags # HexFiend requires more flags
$(OBJ)/HexFiend/%.m.o: HexFiend/%.m $(OBJ)/HexFiend/%.m.o: HexFiend/%.m
-@$(MKDIR) -p $(dir $@) -@$(MKDIR) -p $(dir $@)
$(CC) $(CFLAGS) $(FRONTEND_CFLAGS) $(FAT_FLAGS) $(OCFLAGS) -c $< -o $@ -fno-objc-arc -include HexFiend/HexFiend_2_Framework_Prefix.pch $(CC) $(CFLAGS) $(FRONTEND_CFLAGS) $(FAT_FLAGS) $(OCFLAGS) -c $< -o $@ -fno-objc-arc -include HexFiend/HexFiend_2_Framework_Prefix.pch
$(OBJ)/%.m.o: %.m $(OBJ)/%.m.o: %.m
-@$(MKDIR) -p $(dir $@) -@$(MKDIR) -p $(dir $@)
$(CC) $(CFLAGS) $(FRONTEND_CFLAGS) $(FAT_FLAGS) $(OCFLAGS) -c $< -o $@ $(CC) $(CFLAGS) $(FRONTEND_CFLAGS) $(FAT_FLAGS) $(OCFLAGS) -c $< -o $@
# iOS Port # iOS Port
$(BIN)/SameBoy-iOS.app: $(BIN)/SameBoy-iOS.app/SameBoy \ $(BIN)/SameBoy-iOS.app: $(BIN)/SameBoy-iOS.app/SameBoy \
@@ -495,7 +499,7 @@ endif
$(BIN)/SameBoy.app/Contents/Resources/%.nib: Cocoa/%.xib $(BIN)/SameBoy.app/Contents/Resources/%.nib: Cocoa/%.xib
ibtool --target-device mac --minimum-deployment-target 10.9 --compile $@ $^ 2>&1 | cat - ibtool --target-device mac --minimum-deployment-target 10.9 --compile $@ $^ 2>&1 | cat -
$(BIN)/SameBoy-iOS.app/%.storyboardc: iOS/%.storyboard $(BIN)/SameBoy-iOS.app/%.storyboardc: iOS/%.storyboard
ibtool --target-device iphone --target-device ipad --minimum-deployment-target $(IOS_MIN) --compile $@ $^ 2>&1 | cat - ibtool --target-device iphone --target-device ipad --minimum-deployment-target $(IOS_MIN) --compile $@ $^ 2>&1 | cat -
@@ -526,7 +530,7 @@ endif
$(BIN)/SameBoy.qlgenerator/Contents/Resources/cgb_boot_fast.bin: $(BIN)/BootROMs/cgb_boot_fast.bin $(BIN)/SameBoy.qlgenerator/Contents/Resources/cgb_boot_fast.bin: $(BIN)/BootROMs/cgb_boot_fast.bin
-@$(MKDIR) -p $(dir $@) -@$(MKDIR) -p $(dir $@)
cp -f $^ $@ cp -f $^ $@
# SDL Port # SDL Port
# Unix versions build only one binary # Unix versions build only one binary
@@ -611,7 +615,7 @@ $(BIN)/SDL/background.bmp: SDL/background.bmp
$(BIN)/SDL/Shaders: Shaders $(BIN)/SDL/Shaders: Shaders
-@$(MKDIR) -p $@ -@$(MKDIR) -p $@
cp -rf Shaders/*.fsh $@ cp -rf Shaders/*.fsh $@
$(BIN)/SDL/Palettes: Misc/Palettes $(BIN)/SDL/Palettes: Misc/Palettes
-@$(MKDIR) -p $@ -@$(MKDIR) -p $@
cp -rf Misc/Palettes/*.sbp $@ cp -rf Misc/Palettes/*.sbp $@
@@ -620,12 +624,12 @@ $(BIN)/SDL/Palettes: Misc/Palettes
$(OBJ)/%.2bpp: %.png $(OBJ)/%.2bpp: %.png
-@$(MKDIR) -p $(dir $@) -@$(MKDIR) -p $(dir $@)
$(RGBGFX) $(if $(filter $(shell echo 'println __RGBDS_MAJOR__ || (!__RGBDS_MAJOR__ && __RGBDS_MINOR__ > 5)' | $(RGBASM) -), $$0), -h -u, -Z -u -c embedded) -o $@ $< $(RGBGFX) $(RGBGFX_FLAGS) -o $@ $<
$(OBJ)/BootROMs/SameBoyLogo.pb12: $(OBJ)/BootROMs/SameBoyLogo.2bpp $(PB12_COMPRESS) $(OBJ)/BootROMs/SameBoyLogo.pb12: $(OBJ)/BootROMs/SameBoyLogo.2bpp $(PB12_COMPRESS)
-@$(MKDIR) -p $(dir $@) -@$(MKDIR) -p $(dir $@)
"$(realpath $(PB12_COMPRESS))" < $< > $@ "$(realpath $(PB12_COMPRESS))" < $< > $@
$(PB12_COMPRESS): BootROMs/pb12.c $(PB12_COMPRESS): BootROMs/pb12.c
-@$(MKDIR) -p $(dir $@) -@$(MKDIR) -p $(dir $@)
$(NATIVE_CC) -std=c99 -Wall -Werror $< -o $@ $(NATIVE_CC) -std=c99 -Wall -Werror $< -o $@
@@ -637,7 +641,7 @@ $(BIN)/BootROMs/sgb2_boot.bin: BootROMs/sgb_boot.asm
$(BIN)/BootROMs/%.bin: BootROMs/%.asm $(OBJ)/BootROMs/SameBoyLogo.pb12 $(BIN)/BootROMs/%.bin: BootROMs/%.asm $(OBJ)/BootROMs/SameBoyLogo.pb12
-@$(MKDIR) -p $(dir $@) -@$(MKDIR) -p $(dir $@)
$(RGBASM) $(if $(filter $(shell echo 'println __RGBDS_MAJOR__ || (!__RGBDS_MAJOR__ && __RGBDS_MINOR__ > 6)' | $(RGBASM) -), $$0), -h,) --include $(OBJ)/BootROMs/ --include BootROMs/ -o $@.tmp $< $(RGBASM) $(RGBASM_FLAGS) -o $@.tmp $<
$(RGBLINK) -x -o $@ $@.tmp $(RGBLINK) -x -o $@ $@.tmp
@rm $@.tmp @rm $@.tmp
@@ -690,7 +694,7 @@ endif
ios: ios:
@$(MAKE) _ios @$(MAKE) _ios
$(BIN)/SameBoy-iOS.ipa: ios iOS/sideload.entitlements $(BIN)/SameBoy-iOS.ipa: ios iOS/sideload.entitlements
$(MKDIR) -p $(OBJ)/Payload $(MKDIR) -p $(OBJ)/Payload
cp -rf $(BIN)/SameBoy-iOS.app $(OBJ)/Payload/SameBoy-iOS.app cp -rf $(BIN)/SameBoy-iOS.app $(OBJ)/Payload/SameBoy-iOS.app
@@ -698,11 +702,11 @@ $(BIN)/SameBoy-iOS.ipa: ios iOS/sideload.entitlements
(cd $(OBJ) && zip -q $(abspath $@) -r Payload) (cd $(OBJ) && zip -q $(abspath $@) -r Payload)
rm -rf $(OBJ)/Payload rm -rf $(OBJ)/Payload
$(BIN)/SameBoy-iOS.deb: $(OBJ)/debian-binary $(OBJ)/control.tar.gz $(OBJ)/data.tar.gz $(BIN)/SameBoy-iOS.deb: $(OBJ)/debian-binary $(OBJ)/control.tar.gz $(OBJ)/data.tar.gz
-@$(MKDIR) -p $(dir $@) -@$(MKDIR) -p $(dir $@)
(cd $(OBJ) && ar cr $(abspath $@) $(notdir $^)) (cd $(OBJ) && ar cr $(abspath $@) $(notdir $^))
$(OBJ)/data.tar.gz: ios iOS/jailbreak.entitlements iOS/installer.entitlements $(OBJ)/data.tar.gz: ios iOS/jailbreak.entitlements iOS/installer.entitlements
$(MKDIR) -p $(OBJ)/private/var/containers/ $(MKDIR) -p $(OBJ)/private/var/containers/
cp -rf $(BIN)/SameBoy-iOS.app $(OBJ)/private/var/containers/SameBoy-iOS.app cp -rf $(BIN)/SameBoy-iOS.app $(OBJ)/private/var/containers/SameBoy-iOS.app
@@ -711,7 +715,7 @@ $(OBJ)/data.tar.gz: ios iOS/jailbreak.entitlements iOS/installer.entitlements
codesign -fs - --entitlements iOS/jailbreak.entitlements $(OBJ)/private/var/containers/SameBoy-iOS.app codesign -fs - --entitlements iOS/jailbreak.entitlements $(OBJ)/private/var/containers/SameBoy-iOS.app
(cd $(OBJ) && tar -czf $(abspath $@) --format ustar --uid 501 --gid 501 --numeric-owner ./private) (cd $(OBJ) && tar -czf $(abspath $@) --format ustar --uid 501 --gid 501 --numeric-owner ./private)
rm -rf $(OBJ)/private/ rm -rf $(OBJ)/private/
$(OBJ)/control.tar.gz: iOS/deb-postinst iOS/deb-prerm iOS/deb-control $(OBJ)/control.tar.gz: iOS/deb-postinst iOS/deb-prerm iOS/deb-control
-@$(MKDIR) -p $(dir $@) -@$(MKDIR) -p $(dir $@)
sed "s/@VERSION/$(VERSION)/" < iOS/deb-control > $(OBJ)/control sed "s/@VERSION/$(VERSION)/" < iOS/deb-control > $(OBJ)/control
@@ -719,11 +723,11 @@ $(OBJ)/control.tar.gz: iOS/deb-postinst iOS/deb-prerm iOS/deb-control
ln iOS/deb-prerm $(OBJ)/prerm ln iOS/deb-prerm $(OBJ)/prerm
(cd $(OBJ) && tar -czf $(abspath $@) --format ustar --uid 501 --gid 501 --numeric-owner ./control ./postinst ./prerm) (cd $(OBJ) && tar -czf $(abspath $@) --format ustar --uid 501 --gid 501 --numeric-owner ./control ./postinst ./prerm)
rm $(OBJ)/control $(OBJ)/postinst $(OBJ)/prerm rm $(OBJ)/control $(OBJ)/postinst $(OBJ)/prerm
$(OBJ)/debian-binary: $(OBJ)/debian-binary:
-@$(MKDIR) -p $(dir $@) -@$(MKDIR) -p $(dir $@)
echo 2.0 > $@ echo 2.0 > $@
$(LIBDIR)/libsameboy.o: $(CORE_OBJECTS) $(LIBDIR)/libsameboy.o: $(CORE_OBJECTS)
-@$(MKDIR) -p $(dir $@) -@$(MKDIR) -p $(dir $@)
@# This is a somewhat simple hack to force Clang and GCC to build a native object file out of one or many LTO objects @# This is a somewhat simple hack to force Clang and GCC to build a native object file out of one or many LTO objects
@@ -731,12 +735,12 @@ $(LIBDIR)/libsameboy.o: $(CORE_OBJECTS)
@# And this is a somewhat complicated hack to invoke the correct LTO-enabled LD command in a mostly cross-platform nature @# And this is a somewhat complicated hack to invoke the correct LTO-enabled LD command in a mostly cross-platform nature
$(CC) $(FAT_FLAGS) $(CFLAGS) $(LIBFLAGS) $^ $(OBJ)/lto_hack.o -o $@ $(CC) $(FAT_FLAGS) $(CFLAGS) $(LIBFLAGS) $^ $(OBJ)/lto_hack.o -o $@
-@rm $(OBJ)/lto_hack.o -@rm $(OBJ)/lto_hack.o
$(LIBDIR)/libsameboy.a: $(LIBDIR)/libsameboy.o $(LIBDIR)/libsameboy.a: $(LIBDIR)/libsameboy.o
-@$(MKDIR) -p $(dir $@) -@$(MKDIR) -p $(dir $@)
-@rm -f $@ -@rm -f $@
ar -crs $@ $^ ar -crs $@ $^
$(INC)/%.h: Core/%.h $(INC)/%.h: Core/%.h
-@$(MKDIR) -p $(dir $@) -@$(MKDIR) -p $(dir $@)
-@# CPPP doesn't like multibyte characters, so we replace the single quote character before processing so it doesn't complain -@# CPPP doesn't like multibyte characters, so we replace the single quote character before processing so it doesn't complain
@@ -745,7 +749,7 @@ $(INC)/%.h: Core/%.h
lib-unsupported: lib-unsupported:
@echo Due to limitations of lld-link, compiling SameBoy as a library on Windows is not supported. @echo Due to limitations of lld-link, compiling SameBoy as a library on Windows is not supported.
@false @false
# Clean # Clean
clean: clean:
rm -rf build rm -rf build