diff --git a/.github/workflows/ci-workflow.yml b/.github/workflows/ci-workflow.yml index fe8ec12b4..d4e42c2a0 100644 --- a/.github/workflows/ci-workflow.yml +++ b/.github/workflows/ci-workflow.yml @@ -8,30 +8,32 @@ on: triggerIos: description: 'Run iOS tests' required: true - default: 'no' + default: 'yes' triggerMacos: description: 'Run macOS tests' required: true - default: 'no' + default: 'yes' trigger3DS: description: 'Run 3DS tests' required: true - default: 'no' + default: 'yes' jobs: nintendo_3ds: - if: github.event.inputs.trigger3DS == 'yes' + if: github.event.inputs.trigger3DS == 'yes' || github.event.inputs.trigger3DS == '' runs-on: ubuntu-latest + container: devkitpro/devkitarm:latest 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 with: 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 epsilon.cia - uses: actions/upload-artifact@master @@ -278,7 +280,7 @@ jobs: name: epsilon-linux.bin path: output/release/simulator/linux/epsilon.bin macos: - if: github.event.inputs.triggerMacos == 'yes' + if: github.event.inputs.triggerMacos == 'yes' || github.event.inputs.triggerMacos == '' runs-on: macOS-latest steps: - run: brew install numworks/tap/epsilon-sdk @@ -293,7 +295,7 @@ jobs: name: epsilon-macos.zip path: output/release/simulator/macos/epsilon.app ios: - if: github.event.inputs.triggerIos == 'yes' + if: github.event.inputs.triggerIos == 'yes' || github.event.inputs.triggerIos == '' runs-on: macOS-latest steps: - run: brew install numworks/tap/epsilon-sdk diff --git a/build/platform.simulator.3ds.mak b/build/platform.simulator.3ds.mak index d829e5e0a..dc35a659d 100644 --- a/build/platform.simulator.3ds.mak +++ b/build/platform.simulator.3ds.mak @@ -1,5 +1,7 @@ TOOLCHAIN = devkitarm EXE = elf +EPSILON_TELEMETRY ?= 0 + HANDY_TARGETS_EXTENSIONS = 3dsx cia diff --git a/build/targets.simulator.3ds.mak b/build/targets.simulator.3ds.mak index d06cf52ad..23cbe0a3a 100644 --- a/build/targets.simulator.3ds.mak +++ b/build/targets.simulator.3ds.mak @@ -1,7 +1,7 @@ %.smdh: ion/src/simulator/3ds/assets/logo.png $(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 $(Q) echo "3DSX $(notdir $@)" diff --git a/build/toolchain.devkitarm.mak b/build/toolchain.devkitarm.mak index 52fd7de75..ce7b31e84 100644 --- a/build/toolchain.devkitarm.mak +++ b/build/toolchain.devkitarm.mak @@ -31,7 +31,7 @@ LIBDIRS := $(DEVKITPRO)/libctru INCLUDE = $(foreach dir,$(LIBDIRS),-I$(dir)/include) \ -I$(CURDIR)/$(BUILD) -CFLAGS += $(INCLUDE) -DARM11 -D_3DS +CFLAGS += $(INCLUDE) -DARM11 -D_3DS -D__3DS__ CXXFLAGS = $(CFLAGS) -fno-rtti -fno-exceptions -std=gnu++11 diff --git a/ion/src/simulator/3ds/Makefile b/ion/src/simulator/3ds/Makefile index a7de79edd..5ca58d891 100644 --- a/ion/src/simulator/3ds/Makefile +++ b/ion/src/simulator/3ds/Makefile @@ -19,22 +19,29 @@ ion_src += $(addprefix ion/src/simulator/3ds/, \ 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/led.cpp \ dummy/usb.cpp \ dummy/battery.cpp \ + dummy/store_script.cpp \ +) + +sdl_simu_needs_to_be_removed += $(addprefix ion/src/simulator/shared/, \ clipboard.cpp \ display.cpp:-headless \ events_keyboard.cpp:-headless \ events.cpp \ + events_platform.cpp \ framebuffer_base.cpp \ + framebuffer.cpp \ keyboard_sdl.cpp:-headless \ + keyboard.cpp \ main_sdl.cpp:-headless \ + main.cpp \ layout.cpp:-headless \ - dummy/store_script.cpp \ + timing.cpp \ ) # Remove the dummy display (re-implemented) and the SDL simulator stuff. ion_src := $(filter-out $(sdl_simu_needs_to_be_removed),$(ion_src)) - diff --git a/ion/src/simulator/3ds/main.cpp b/ion/src/simulator/3ds/main.cpp index c0b38e9c4..d95a248c8 100644 --- a/ion/src/simulator/3ds/main.cpp +++ b/ion/src/simulator/3ds/main.cpp @@ -19,6 +19,10 @@ void Ion::Timing::msleep(uint32_t ms) { svcSleepThread((s64) ms * 1000); } +uint64_t Ion::Timing::millis() { + return svcGetSystemTick() / (1000 * 1000); +} + int main(int argc, char * argv[]) { Ion::Simulator::Main::init(); diff --git a/ion/src/simulator/external/sdl/include/SDL_stdinc.h b/ion/src/simulator/external/sdl/include/SDL_stdinc.h index a95700af2..8845cd771 100644 --- a/ion/src/simulator/external/sdl/include/SDL_stdinc.h +++ b/ion/src/simulator/external/sdl/include/SDL_stdinc.h @@ -309,8 +309,13 @@ typedef uint64_t Uint64; #endif #endif /* SDL_DISABLE_ANALYZE_MACROS */ +#ifndef __3DS__ #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 */ #ifndef DOXYGEN_SHOULD_IGNORE_THIS SDL_COMPILE_TIME_ASSERT(uint8, sizeof(Uint8) == 1);