Skip to content

Commit

Permalink
First RG35xx version
Browse files Browse the repository at this point in the history
  • Loading branch information
acmeplus committed May 30, 2023
1 parent c0ad535 commit 9f3f64e
Show file tree
Hide file tree
Showing 8 changed files with 648 additions and 22 deletions.
67 changes: 67 additions & 0 deletions src/simplemenu-beta/Makefile.rg35xx
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
# Software Name
TARGET = simplemenu

CROSS_COMPILE = /opt/cdata/rg35xx/batocera.linux/buildroot/output/host/bin/arm-buildroot-linux-gnueabihf-

#Flags
MM_NOQUIT = 1 # Controls if we show Quit option in Session menu on Miyoo Mini. In that device there is no optional startup script. The closest is /mnt/SDCARD/.tmp_update/updater but we can't count on it because it is used by most distributions, so we control the quit menu manually by mean of this flag.
NOLOADING = 1 # Controls whether the 'LOADING...' message is displayed at the bottom right of the screen during some slow processes.

# Compiler
CC = $(CROSS_COMPILE)gcc
LINKER = $(CROSS_COMPILE)gcc
CFLAGS = -DTARGET_RG35XX -O3 -DUSE_GZIP -Ofast -fdata-sections -ffunction-sections -fPIC -flto -Wall -Wextra -std=gnu99
ifeq ($(MM_NOQUIT), 1)
CFLAGS += -DMM_NOQUIT
endif
ifeq ($(NOLOADING), 1)
CFLAGS += -DNOLOADING
endif

LIBS += -lSDL -lasound -lSDL_image -lSDL_ttf -L../../../libini/ -lini -lz -lpthread -lm

# You can use Ofast too but it can be more prone to bugs, careful.
CFLAGS += -g3 -I.
LDFLAGS = -Wl,--start-group $(LIBS) -Wl,--end-group -Wl,--as-needed -Wl,--gc-sections -flto

DEBUG=NO

#ifeq ($(DEBUG), NO)
# CFLAGS += -DDEBUG -g3
#else
# LDFLAGS += -s -lm
#endif

SRCDIR = src/logic
OBJDIR = src/obj
BINDIR = output
SOURCES := $(wildcard $(SRCDIR)/*.c)
SOURCES := $(filter-out src/logic/control_rfw.c, $(SOURCES))
SOURCES := $(filter-out src/logic/control_bittboy.c, $(SOURCES))
SOURCES := $(filter-out src/logic/control_od.c, $(SOURCES))
SOURCES := $(filter-out src/logic/system_logic_rfw.c, $(SOURCES))
SOURCES := $(filter-out src/logic/system_logic_bittboy.c, $(SOURCES))
SOURCES := $(filter-out src/logic/system_logic_od.c, $(SOURCES))
SOURCES := $(filter-out src/logic/system_logic_mmiyoo.c, $(SOURCES))

OBJECTS := $(SOURCES:$(SRCDIR)/%.c=$(OBJDIR)/%.o)

rm = rm -f

$(BINDIR)/$(TARGET): $(OBJECTS)
@$(LINKER) $(OBJECTS) $(LDFLAGS) -o $@
@echo "Linking complete!"

$(OBJECTS): $(OBJDIR)/%.o : $(SRCDIR)/%.c
@$(CC) $(CFLAGS) -c $< -o $@
@echo "Compiled "$<" successfully!"

.PHONY: clean
clean:
@$(rm) $(OBJECTS)
@echo "Cleanup complete!"

.PHONY: remove
remove: clean
@$(rm) $(BINDIR)/$(TARGET)
@echo "Executable removed!"
6 changes: 3 additions & 3 deletions src/simplemenu-beta/src/logic/control.c
Original file line number Diff line number Diff line change
Expand Up @@ -976,12 +976,12 @@ void performSystemSettingsChoosingAction() {
}
} else if (chosenSetting==BRIGHTNESS_OPTION) {
if (keys[BTN_LEFT]) {
if (brightnessValue>1) {
brightnessValue-=1;
if (brightnessValue>50) {
brightnessValue-=50;
}
} else {
if (brightnessValue<maxBrightnessValue) {
brightnessValue+=1;
brightnessValue+=50;
}
}
setBrightness(brightnessValue);
Expand Down
Loading

0 comments on commit 9f3f64e

Please sign in to comment.