build.mak: Fix oversight with PSP_LARGE_MEMORY condition tree, clean changes

`MEMSIZE` would not be set as expected if `PSP_FW_VERSION` was set to `1` above firmware 3.90 and the warning was sent to the console. This is addressed.

I've also made the `MEMSIZE` field a make var (`EXPAND_MEMORY`) that gets set on/off in the tree and just gets used by `SFO` flags at the end of it, instead of setting them in multiple spaces.
This commit is contained in:
Ian
2023-04-18 11:16:53 -04:00
committed by GitHub
parent e87d3fa804
commit f7da81f22b

View File

@@ -38,23 +38,25 @@ ifeq ($(PSP_FW_VERSION),)
PSP_FW_VERSION=150
endif
EXPAND_MEMORY = 0
# CFW versions after M33 3.90 guard against expanding the
# user memory partition on PSP-1000, making MEMSIZE obsolete.
# It is now an opt-out policy with PSP_LARGE_MEMORY=0
ifeq ($(shell test $(PSP_FW_VERSION) -gt 390; echo $$?),0)
EXPAND_MEMORY = 1
ifeq ($(PSP_LARGE_MEMORY),1)
$(warning "PSP_LARGE_MEMORY" flag is not necessary targeting firmware versions above 3.90)
else ifeq ($(PSP_LARGE_MEMORY),0)
SFOFLAGS := -d MEMSIZE=0 $(SFOFLAGS)
else
SFOFLAGS := -d MEMSIZE=1 $(SFOFLAGS)
endif
EXPAND_MEMORY = 0
endif # PSP_LARGE_MEMORY
else
ifeq ($(PSP_LARGE_MEMORY),1)
SFOFLAGS := -d MEMSIZE=1 $(SFOFLAGS)
endif
endif
EXPAND_MEMORY = 1
endif # PSP_LARGE_MEMORY
endif # PSP_FW_VERSION
SFOFLAGS := -d MEMSIZE=$(EXPAND_MEMORY) $(SFOFLAGS)
CFLAGS += -D_PSP_FW_VERSION=$(PSP_FW_VERSION)
CXXFLAGS += -D_PSP_FW_VERSION=$(PSP_FW_VERSION)