Fix 3DS simulator (#243)

* [CI] Fix 3DS try 1

* [CI] Fix 3DS try 2

* [CI] Fix 3DS try 3

* [CI] Fix 3DS try 4

* [CI] Fix 3DS try 5

* [CI] Fix 3DS try 6

* [CI] Fix 3DS try 7

* [CI] Fix 3DS try 8

* [CI] Fix 3DS try 9

* [CI] Fix 3DS try 10

* [CI] Fix 3DS try 11

* [CI] Fix 3DS try 12

* [CI] Fix 3DS try 13

* [CI] Fix 3DS try 14

* [CI] Fix 3DS try 15

* [CI] Fix 3DS try 16

* [CI] Fix 3DS try 17

* [CI] Fix 3DS try 18

* [CI] Fix 3DS try 19

* [CI] Make other simulators than 3DS working

* [CI] Fix 3DS without breaking others simulators try 1

* Apply suggestions from code review

* Improve SDL assert

* Fix SDL assert

* Fix SDL assert 2

* [CI] Enable iOS, macOS and 3DS tests by default

* [CI] Change epsilon-sdk tap url

* Revert "[CI] Change epsilon-sdk tap url"

This reverts commit 9516607aba.
This commit is contained in:
Yaya-Cout
2023-04-13 16:24:38 +02:00
committed by GitHub
parent 0916996121
commit aadcd37f31
7 changed files with 39 additions and 19 deletions

View File

@@ -8,30 +8,32 @@ on:
triggerIos: triggerIos:
description: 'Run iOS tests' description: 'Run iOS tests'
required: true required: true
default: 'no' default: 'yes'
triggerMacos: triggerMacos:
description: 'Run macOS tests' description: 'Run macOS tests'
required: true required: true
default: 'no' default: 'yes'
trigger3DS: trigger3DS:
description: 'Run 3DS tests' description: 'Run 3DS tests'
required: true required: true
default: 'no' default: 'yes'
jobs: jobs:
nintendo_3ds: nintendo_3ds:
if: github.event.inputs.trigger3DS == 'yes' if: github.event.inputs.trigger3DS == 'yes' || github.event.inputs.trigger3DS == ''
runs-on: ubuntu-latest runs-on: ubuntu-latest
container: devkitpro/devkitarm:latest
steps: steps:
- run: wget https://github.com/devkitPro/pacman/releases/download/v1.0.2/devkitpro-pacman.amd64.deb -O /tmp/devkitpro-pacman.deb
- run: yes | sudo dpkg -i /tmp/devkitpro-pacman.deb
- run: yes | sudo dkp-pacman -Syu --needed devkitARM 3dstools libctru
- run: echo ::set-env name=DEVKITPRO::/opt/devkitpro
- run: echo ::set-env name=DEVKITARM::/opt/devkitpro/devkitARM
- run: echo ::set-env name=PATH::$DEVKITPRO/tools/bin:$DEVKITARM/bin:$PATH
- uses: actions/checkout@v1 - uses: actions/checkout@v1
with: with:
submodules: true submodules: true
- run: sudo apt-get update
- run: sudo apt-get install build-essential imagemagick libfreetype6-dev libjpeg-dev libpng-dev pkg-config -y
- run: yes | sudo dkp-pacman -S --needed devkitARM 3dstools libctru
- run: wget https://github.com/3DSGuy/Project_CTR/releases/download/makerom-v0.18.3/makerom-v0.18.3-ubuntu_x86_64.zip
- run: unzip makerom-v0.18.3-ubuntu_x86_64.zip
- run: rm makerom-v0.18.3-ubuntu_x86_64.zip
- run: chmod +x ./makerom
- run: echo "PATH=.:$PATH" >> $GITHUB_ENV
- run: make -j2 PLATFORM=simulator TARGET=3ds - run: make -j2 PLATFORM=simulator TARGET=3ds
- run: make -j2 PLATFORM=simulator TARGET=3ds epsilon.cia - run: make -j2 PLATFORM=simulator TARGET=3ds epsilon.cia
- uses: actions/upload-artifact@master - uses: actions/upload-artifact@master
@@ -278,7 +280,7 @@ jobs:
name: epsilon-linux.bin name: epsilon-linux.bin
path: output/release/simulator/linux/epsilon.bin path: output/release/simulator/linux/epsilon.bin
macos: macos:
if: github.event.inputs.triggerMacos == 'yes' if: github.event.inputs.triggerMacos == 'yes' || github.event.inputs.triggerMacos == ''
runs-on: macOS-latest runs-on: macOS-latest
steps: steps:
- run: brew install numworks/tap/epsilon-sdk - run: brew install numworks/tap/epsilon-sdk
@@ -293,7 +295,7 @@ jobs:
name: epsilon-macos.zip name: epsilon-macos.zip
path: output/release/simulator/macos/epsilon.app path: output/release/simulator/macos/epsilon.app
ios: ios:
if: github.event.inputs.triggerIos == 'yes' if: github.event.inputs.triggerIos == 'yes' || github.event.inputs.triggerIos == ''
runs-on: macOS-latest runs-on: macOS-latest
steps: steps:
- run: brew install numworks/tap/epsilon-sdk - run: brew install numworks/tap/epsilon-sdk

View File

@@ -1,5 +1,7 @@
TOOLCHAIN = devkitarm TOOLCHAIN = devkitarm
EXE = elf EXE = elf
EPSILON_TELEMETRY ?= 0
HANDY_TARGETS_EXTENSIONS = 3dsx cia HANDY_TARGETS_EXTENSIONS = 3dsx cia

View File

@@ -1,7 +1,7 @@
%.smdh: ion/src/simulator/3ds/assets/logo.png %.smdh: ion/src/simulator/3ds/assets/logo.png
$(Q) echo "SMDH $(notdir $@)" $(Q) echo "SMDH $(notdir $@)"
$(Q) smdhtool --create "Epsilon" "A Numworks in your 3DS!" "Numworks" $< $@ $(Q) smdhtool --create "Upsilon" "A Numworks in your 3DS!" "Numworks" $< $@
$(BUILD_DIR)/%.3dsx: $(BUILD_DIR)/%.elf $(BUILD_DIR)/%.smdh $(BUILD_DIR)/%.3dsx: $(BUILD_DIR)/%.elf $(BUILD_DIR)/%.smdh
$(Q) echo "3DSX $(notdir $@)" $(Q) echo "3DSX $(notdir $@)"

View File

@@ -31,7 +31,7 @@ LIBDIRS := $(DEVKITPRO)/libctru
INCLUDE = $(foreach dir,$(LIBDIRS),-I$(dir)/include) \ INCLUDE = $(foreach dir,$(LIBDIRS),-I$(dir)/include) \
-I$(CURDIR)/$(BUILD) -I$(CURDIR)/$(BUILD)
CFLAGS += $(INCLUDE) -DARM11 -D_3DS CFLAGS += $(INCLUDE) -DARM11 -D_3DS -D__3DS__
CXXFLAGS = $(CFLAGS) -fno-rtti -fno-exceptions -std=gnu++11 CXXFLAGS = $(CFLAGS) -fno-rtti -fno-exceptions -std=gnu++11

View File

@@ -19,22 +19,29 @@ ion_src += $(addprefix ion/src/simulator/3ds/, \
ion_src += ion/src/shared/collect_registers.cpp ion_src += ion/src/shared/collect_registers.cpp
sdl_simu_needs_to_be_removed += $(addprefix ion/src/simulator/shared/, \ sdl_simu_needs_to_be_removed += $(addprefix ion/src/shared/, \
dummy/display.cpp \ dummy/display.cpp \
dummy/led.cpp \ dummy/led.cpp \
dummy/usb.cpp \ dummy/usb.cpp \
dummy/battery.cpp \ dummy/battery.cpp \
dummy/store_script.cpp \
)
sdl_simu_needs_to_be_removed += $(addprefix ion/src/simulator/shared/, \
clipboard.cpp \ clipboard.cpp \
display.cpp:-headless \ display.cpp:-headless \
events_keyboard.cpp:-headless \ events_keyboard.cpp:-headless \
events.cpp \ events.cpp \
events_platform.cpp \
framebuffer_base.cpp \ framebuffer_base.cpp \
framebuffer.cpp \
keyboard_sdl.cpp:-headless \ keyboard_sdl.cpp:-headless \
keyboard.cpp \
main_sdl.cpp:-headless \ main_sdl.cpp:-headless \
main.cpp \
layout.cpp:-headless \ layout.cpp:-headless \
dummy/store_script.cpp \ timing.cpp \
) )
# Remove the dummy display (re-implemented) and the SDL simulator stuff. # Remove the dummy display (re-implemented) and the SDL simulator stuff.
ion_src := $(filter-out $(sdl_simu_needs_to_be_removed),$(ion_src)) ion_src := $(filter-out $(sdl_simu_needs_to_be_removed),$(ion_src))

View File

@@ -19,6 +19,10 @@ void Ion::Timing::msleep(uint32_t ms) {
svcSleepThread((s64) ms * 1000); svcSleepThread((s64) ms * 1000);
} }
uint64_t Ion::Timing::millis() {
return svcGetSystemTick() / (1000 * 1000);
}
int main(int argc, char * argv[]) { int main(int argc, char * argv[]) {
Ion::Simulator::Main::init(); Ion::Simulator::Main::init();

View File

@@ -309,8 +309,13 @@ typedef uint64_t Uint64;
#endif #endif
#endif /* SDL_DISABLE_ANALYZE_MACROS */ #endif /* SDL_DISABLE_ANALYZE_MACROS */
#ifndef __3DS__
#define SDL_COMPILE_TIME_ASSERT(name, x) \ #define SDL_COMPILE_TIME_ASSERT(name, x) \
typedef int SDL_compile_time_assert_ ## name[(x) * 2 - 1] typedef int SDL_dummy_ ## name[(x) * 2 - 1]
#else
#define SDL_COMPILE_TIME_ASSERT(name, x) \
typedef int SDL_dummy_ ## name[0]
#endif
/** \cond */ /** \cond */
#ifndef DOXYGEN_SHOULD_IGNORE_THIS #ifndef DOXYGEN_SHOULD_IGNORE_THIS
SDL_COMPILE_TIME_ASSERT(uint8, sizeof(Uint8) == 1); SDL_COMPILE_TIME_ASSERT(uint8, sizeof(Uint8) == 1);