diff --git a/.github/workflows/ci-docker.yml b/.github/workflows/ci-docker.yml index ef955c806..66946cf91 100644 --- a/.github/workflows/ci-docker.yml +++ b/.github/workflows/ci-docker.yml @@ -5,7 +5,7 @@ jobs: docker: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 with: submodules: true - name: Build the Docker image diff --git a/.github/workflows/ci-workflow.yml b/.github/workflows/ci-workflow.yml index e2fd55ddd..24dccbdb5 100644 --- a/.github/workflows/ci-workflow.yml +++ b/.github/workflows/ci-workflow.yml @@ -21,22 +21,22 @@ jobs: fxcg: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 with: submodules: 'recursive' - name: Install dependencies run: | sudo apt-get update - sudo apt-get install curl git python3 build-essential cmake pkg-config -y + sudo apt-get install build-essential cmake libfreetype-dev -y - name: Get latest gint commit hash run: | - LATEST_COMMIT_HASH=$(curl --silent https://gitea.planet-casio.com/api/v1/repos/Lephenixnoir/gint/branches/master | jq -r .commit.id) + LATEST_COMMIT_HASH=$(curl --silent https://git.planet-casio.com/api/v1/repos/Lephenixnoir/gint/branches/master | jq -r .commit.id) echo "Latest commit hash is: $LATEST_COMMIT_HASH" echo "LATEST_COMMIT_HASH=$LATEST_COMMIT_HASH" >> $GITHUB_OUTPUT id: get-latest-commit-hash - name: Cache gint/fxsdk installation id: cache-gint - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: | ~/.local/*/* @@ -45,7 +45,7 @@ jobs: - name: Install gint/fxsdk if: steps.cache-gint.outputs.cache-hit != 'true' env: - URL: "https://gitea.planet-casio.com/Lephenixnoir/GiteaPC/archive/master.tar.gz" + URL: "https://git.planet-casio.com/Lephenixnoir/GiteaPC/archive/master.tar.gz" run: | export PATH="~/.local/bin:$PATH" cd "$(mktemp -d)" @@ -72,7 +72,7 @@ jobs: path: 'output/release/simulator/fxcg/epsilon.g3a' destination: 'upsilon-binfiles.appspot.com/dev/simulator/' parent: false - - uses: actions/upload-artifact@master + - uses: actions/upload-artifact@v4 with: name: epsilon.g3a path: output/release/simulator/fxcg/epsilon.g3a @@ -81,7 +81,7 @@ jobs: runs-on: ubuntu-latest container: devkitpro/devkitarm:latest steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v4 with: submodules: true - run: sudo apt-get update @@ -94,20 +94,28 @@ jobs: - 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 + - uses: actions/upload-artifact@v4 with: name: epsilon-3ds.3dsx path: output/release/simulator/3ds/epsilon.3dsx - - uses: actions/upload-artifact@master + - uses: actions/upload-artifact@v4 with: name: epsilon-3ds.cia path: output/release/simulator/3ds/epsilon.cia android: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 with: submodules: 'recursive' + - run: | + sudo apt-get update + sudo apt-get install imagemagick libfreetype-dev libpng-dev + - name: Set up JDK 21 + uses: actions/setup-java@v4 + with: + java-version: '21' + distribution: 'temurin' - run: wget -nv https://dl.google.com/android/repository/android-ndk-r21e-linux-x86_64.zip - run: unzip -q android-ndk-r21e-linux-x86_64.zip - run: make -j2 PLATFORM=simulator TARGET=android NDK_PATH=./android-ndk-r21e @@ -123,69 +131,88 @@ jobs: path: 'output/release/simulator/android/epsilon.apk' destination: 'upsilon-binfiles.appspot.com/dev/simulator/' parent: false - - uses: actions/upload-artifact@master + - uses: actions/upload-artifact@v4 with: name: epsilon-android.apk path: output/release/simulator/android/epsilon.apk n0100: - runs-on: ubuntu-latest + runs-on: ubuntu-24.04-arm steps: - - run: sudo apt-get install build-essential imagemagick libfreetype6-dev libjpeg-dev libpng-dev pkg-config - - uses: numworks/setup-arm-toolchain@2020-q2 - - uses: actions/checkout@v2 + - run: | + sudo apt-get update + sudo apt-get install build-essential imagemagick libfreetype6-dev libjpeg-dev libpng-dev pkg-config gcc-arm-none-eabi binutils-arm-none-eabi + - uses: actions/checkout@v4 with: submodules: 'recursive' - run: mkdir final-output - run: make -j2 MODEL=n0100 EPSILON_I18N=en output/release/device/n0100/epsilon.onboarding.two_binaries - - run: mv output/release/device/n0100/epsilon.onboarding.internal.bin final-output/epsilon.onboarding.internal.en.bin + - run: make -j2 MODEL=n0100 EPSILON_I18N=en output/release/device/n0100/epsilon.onboarding.two_binaries + - run: mv output/release/device/n0100/epsilon.onboarding.internal.bin final-output/epsilon.onboarding.en.internal.bin - run: rm output/release/device/n0100/apps/i18n.o output/release/device/n0100/apps/i18n.cpp + # We need to duplicate make to work around i18n generator race condition in Makefile leading to inconsistent incremental rebuilds - run: make -j2 MODEL=n0100 EPSILON_I18N=fr output/release/device/n0100/epsilon.onboarding.two_binaries - - run: mv output/release/device/n0100/epsilon.onboarding.internal.bin final-output/epsilon.onboarding.internal.fr.bin + - run: make -j2 MODEL=n0100 EPSILON_I18N=fr output/release/device/n0100/epsilon.onboarding.two_binaries + - run: mv output/release/device/n0100/epsilon.onboarding.internal.bin final-output/epsilon.onboarding.fr.internal.bin - run: rm output/release/device/n0100/apps/i18n.o output/release/device/n0100/apps/i18n.cpp - run: make -j2 MODEL=n0100 EPSILON_I18N=nl output/release/device/n0100/epsilon.onboarding.two_binaries - - run: mv output/release/device/n0100/epsilon.onboarding.internal.bin final-output/epsilon.onboarding.internal.nl.bin + - run: make -j2 MODEL=n0100 EPSILON_I18N=nl output/release/device/n0100/epsilon.onboarding.two_binaries + - run: mv output/release/device/n0100/epsilon.onboarding.internal.bin final-output/epsilon.onboarding.nl.internal.bin - run: rm output/release/device/n0100/apps/i18n.o output/release/device/n0100/apps/i18n.cpp - run: make -j2 MODEL=n0100 EPSILON_I18N=pt output/release/device/n0100/epsilon.onboarding.two_binaries - - run: mv output/release/device/n0100/epsilon.onboarding.internal.bin final-output/epsilon.onboarding.internal.pt.bin + - run: make -j2 MODEL=n0100 EPSILON_I18N=pt output/release/device/n0100/epsilon.onboarding.two_binaries + - run: mv output/release/device/n0100/epsilon.onboarding.internal.bin final-output/epsilon.onboarding.pt.internal.bin - run: rm output/release/device/n0100/apps/i18n.o output/release/device/n0100/apps/i18n.cpp - run: make -j2 MODEL=n0100 EPSILON_I18N=it output/release/device/n0100/epsilon.onboarding.two_binaries - - run: mv output/release/device/n0100/epsilon.onboarding.internal.bin final-output/epsilon.onboarding.internal.it.bin + - run: make -j2 MODEL=n0100 EPSILON_I18N=it output/release/device/n0100/epsilon.onboarding.two_binaries + - run: mv output/release/device/n0100/epsilon.onboarding.internal.bin final-output/epsilon.onboarding.it.internal.bin - run: rm output/release/device/n0100/apps/i18n.o output/release/device/n0100/apps/i18n.cpp - run: make -j2 MODEL=n0100 EPSILON_I18N=de output/release/device/n0100/epsilon.onboarding.two_binaries - - run: mv output/release/device/n0100/epsilon.onboarding.internal.bin final-output/epsilon.onboarding.internal.de.bin + - run: make -j2 MODEL=n0100 EPSILON_I18N=de output/release/device/n0100/epsilon.onboarding.two_binaries + - run: mv output/release/device/n0100/epsilon.onboarding.internal.bin final-output/epsilon.onboarding.de.internal.bin - run: rm output/release/device/n0100/apps/i18n.o output/release/device/n0100/apps/i18n.cpp - run: make -j2 MODEL=n0100 EPSILON_I18N=es output/release/device/n0100/epsilon.onboarding.two_binaries - - run: mv output/release/device/n0100/epsilon.onboarding.internal.bin final-output/epsilon.onboarding.internal.es.bin + - run: make -j2 MODEL=n0100 EPSILON_I18N=es output/release/device/n0100/epsilon.onboarding.two_binaries + - run: mv output/release/device/n0100/epsilon.onboarding.internal.bin final-output/epsilon.onboarding.es.internal.bin - run: rm output/release/device/n0100/apps/i18n.o output/release/device/n0100/apps/i18n.cpp - run: make -j2 MODEL=n0100 EPSILON_I18N=hu output/release/device/n0100/epsilon.onboarding.two_binaries - - run: mv output/release/device/n0100/epsilon.onboarding.internal.bin final-output/epsilon.onboarding.internal.hu.bin + - run: make -j2 MODEL=n0100 EPSILON_I18N=hu output/release/device/n0100/epsilon.onboarding.two_binaries + - run: mv output/release/device/n0100/epsilon.onboarding.internal.bin final-output/epsilon.onboarding.hu.internal.bin - run: rm output/release/device/n0100/apps/i18n.o output/release/device/n0100/apps/i18n.cpp - run: make -j2 MODEL=n0100 output/release/device/n0100/flasher.light.bin - run: mv output/release/device/n0100/flasher.light.bin final-output/flasher.light.bin + - run: make -j2 MODEL=n0100 output/release/device/n0100/flasher.verbose.bin + - run: mv output/release/device/n0100/flasher.verbose.bin final-output/flasher.verbose.bin - run: find final-output/ -type f -exec bash -c "shasum -a 256 -b {} > {}.sha256" \; - run: tar cvfz binpack-n0100.tgz final-output/* - - id: 'auth' - if: ${{ github.event_name == 'push' && github.ref_name == 'upsilon-dev' && github.repository == 'UpsilonNumworks/Upsilon'}} - uses: 'google-github-actions/auth@v0' - with: - credentials_json: '${{secrets.GOOGLE_CREDENTIALS}}' - - id: 'upload-directory' - if: ${{ github.event_name == 'push' && github.ref_name == 'upsilon-dev' && github.repository == 'UpsilonNumworks/Upsilon'}} - uses: 'google-github-actions/upload-cloud-storage@v0' - with: - path: 'final-output/' - destination: 'upsilon-binfiles.appspot.com/dev/n100/' - parent: false - - uses: actions/upload-artifact@master + - uses: actions/upload-artifact@v4 with: name: epsilon-binpack-n0100.tgz path: binpack-n0100.tgz + - uses: actions/checkout@v5 + with: + repository: Yaya-Cout/Upsilon-binfiles + ref: 'main' + token: ${{ secrets.PAT_UPSILON_BINFILES }} + path: 'binfiles' + # TODO: Handle git conflicts using rebase + - name: Upload binary files to website + if: ${{ github.event_name == 'push' && github.ref_name == 'upsilon-dev' && github.repository == 'UpsilonNumworks/Upsilon'}} + run: | + cp -r final-output/* binfiles/binaries/dev/n100 + cd binfiles + git add -A + git config --global user.email "ci@github.com" + git config --global user.name "GitHub Upsilon CI" + git pull + git commit -m "Update from CI" + git push n0110: - runs-on: ubuntu-latest + runs-on: ubuntu-24.04-arm steps: - - run: sudo apt-get install build-essential imagemagick libfreetype6-dev libjpeg-dev libpng-dev pkg-config - - uses: numworks/setup-arm-toolchain@2020-q2 - - uses: actions/checkout@v2 + - run: | + sudo apt-get update + sudo apt-get install build-essential imagemagick libfreetype6-dev libjpeg-dev libpng-dev pkg-config gcc-arm-none-eabi binutils-arm-none-eabi + - uses: actions/checkout@v4 with: submodules: 'recursive' - run: make -j2 MODEL=n0110 epsilon.dfu @@ -194,33 +221,43 @@ jobs: - run: make -j2 MODEL=n0110 epsilon.onboarding.beta.dfu - run: make -j2 MODEL=n0110 flasher.light.dfu - run: make -j2 MODEL=n0110 flasher.verbose.dfu - # We don't need bench as it is used only in factory - # - run: make -j2 bench.ram.dfu - # - run: make -j2 bench.flash.dfu + - run: make -j2 MODEL=n0110 flasher.verbose.bin + - run: make -j2 MODEL=n0110 bench.ram.dfu + # - run: make -j2 MODEL=n0110 bench.flash.dfu - run: make -j2 MODEL=n0110 binpack - run: cp output/release/device/n0110/binpack-n0110-`git rev-parse HEAD | head -c 7`.tgz output/release/device/n0110/binpack-n0110.tgz - - id: 'auth' - if: ${{ github.event_name == 'push' && github.ref_name == 'upsilon-dev' && github.repository == 'UpsilonNumworks/Upsilon' }} - uses: 'google-github-actions/auth@v0' - with: - credentials_json: '${{secrets.GOOGLE_CREDENTIALS}}' - - id: 'upload-directory' - if: ${{ github.event_name == 'push' && github.ref_name == 'upsilon-dev' && github.repository == 'UpsilonNumworks/Upsilon' }} - uses: 'google-github-actions/upload-cloud-storage@v0' - with: - path: 'output/release/device/n0110/binpack/' - destination: 'upsilon-binfiles.appspot.com/dev/n110/' - parent: false - - uses: actions/upload-artifact@master + - run: cp output/release/device/n0110/flasher.verbose.bin output/release/device/n0110/binpack/ + - run: cd output/release/device/n0110 && for binary in *.bin; do shasum -a 256 -b binpack/${binary} > binpack/${binary}.sha256;done + - run: cp output/release/device/n0110/binpack-n0110-`git rev-parse HEAD | head -c 7`.tgz output/release/device/n0110/binpack/binpack.tgz + - uses: actions/upload-artifact@v4 with: name: epsilon-binpack-n0110.tgz path: output/release/device/n0110/binpack-n0110.tgz + - uses: actions/checkout@v5 + with: + repository: Yaya-Cout/Upsilon-binfiles + ref: 'main' + token: ${{ secrets.PAT_UPSILON_BINFILES }} + path: 'binfiles' + # TODO: Handle git conflicts using rebase + - name: Upload binary files to website + if: ${{ github.event_name == 'push' && github.ref_name == 'upsilon-dev' && github.repository == 'UpsilonNumworks/Upsilon'}} + run: | + cp -r output/release/device/n0110/binpack/* binfiles/binaries/dev/n110 + cd binfiles + git add -A + git config --global user.email "ci@github.com" + git config --global user.name "GitHub Upsilon CI" + git pull + git commit -m "Update from CI" + git push bootloader: - runs-on: ubuntu-latest + runs-on: ubuntu-24.04-arm steps: - - run: sudo apt-get install build-essential imagemagick libfreetype6-dev libjpeg-dev libpng-dev pkg-config - - uses: numworks/setup-arm-toolchain@2022-08 - - uses: actions/checkout@v2 + - run: | + sudo apt-get update + sudo apt-get install build-essential imagemagick libfreetype6-dev libjpeg-dev libpng-dev pkg-config gcc-arm-none-eabi binutils-arm-none-eabi + - uses: actions/checkout@v5 with: submodules: 'recursive' - run: make -j2 MODEL=n0110 bootloader @@ -237,22 +274,28 @@ jobs: - run: cp output/release/device/n0110/bootloader.bin output/release/device/bootloader/ - run: cd output/release/device/bootloader && for binary in *.bin; do shasum -a 256 -b binpack/${binary} > binpack/${binary}.sha256;done - run: cd output/release/device/bootloader && tar cvfz binpack-bootloader.tgz binpack/* - - id: 'auth' - if: ${{ github.event_name == 'push' && github.ref_name == 'upsilon-dev' && github.repository == 'UpsilonNumworks/Upsilon' }} - uses: 'google-github-actions/auth@v0' - with: - credentials_json: '${{secrets.GOOGLE_CREDENTIALS}}' - - id: 'upload-directory' - if: ${{ github.event_name == 'push' && github.ref_name == 'upsilon-dev' && github.repository == 'UpsilonNumworks/Upsilon' }} - uses: 'google-github-actions/upload-cloud-storage@v0' - with: - path: 'output/release/device/bootloader/binpack/' - destination: 'upsilon-binfiles.appspot.com/dev/n110/' - parent: false - - uses: actions/upload-artifact@master + - uses: actions/upload-artifact@v4 with: name: epsilon-binpack-bootloader.tgz path: output/release/device/bootloader/binpack-bootloader.tgz + - uses: actions/checkout@v5 + with: + repository: Yaya-Cout/Upsilon-binfiles + ref: 'main' + token: ${{ secrets.PAT_UPSILON_BINFILES }} + path: 'binfiles' + # TODO: Handle git conflicts using rebase + - name: Upload binary files to website + if: ${{ github.event_name == 'push' && github.ref_name == 'upsilon-dev' && github.repository == 'UpsilonNumworks/Upsilon'}} + run: | + cp -r output/release/device/bootloader/binpack/* binfiles/binaries/dev/n110 + cd binfiles + git add -A + git config --global user.email "ci@github.com" + git config --global user.name "GitHub Upsilon CI" + git pull + git commit -m "Update from CI" + git push windows: runs-on: windows-latest defaults: @@ -260,7 +303,7 @@ jobs: shell: msys2 {0} steps: - uses: msys2/setup-msys2@v2 - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 with: submodules: 'recursive' - run: pacman -S --noconfirm mingw-w64-x86_64-gcc mingw-w64-x86_64-freetype mingw-w64-x86_64-pkg-config make mingw-w64-x86_64-python3 mingw-w64-x86_64-libjpeg-turbo mingw-w64-x86_64-libpng @@ -279,7 +322,7 @@ jobs: path: 'output/release/simulator/windows/epsilon.exe' destination: 'upsilon-binfiles.appspot.com/dev/simulator/' parent: false - - uses: actions/upload-artifact@master + - uses: actions/upload-artifact@v4 with: name: epsilon-windows.exe path: output/release/simulator/windows/epsilon.exe @@ -289,9 +332,13 @@ jobs: - uses: numworks/setup-emscripten@master with: sdk: latest - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 with: submodules: 'recursive' + # Install the Linux toolchin to avoid dependancies issues, but maybe only libpng is needed + - run: | + sudo apt-get update + sudo apt-get install build-essential imagemagick libfreetype6-dev libjpeg-dev libpng-dev pkg-config libxtst-dev - run: make -j2 PLATFORM=simulator TARGET=web - run: make -j2 PLATFORM=simulator TARGET=web test.js - run: node output/release/simulator/web/test.js --headless @@ -307,15 +354,17 @@ jobs: path: 'output/release/simulator/web/epsilon.js' destination: 'upsilon-binfiles.appspot.com/dev/simulator/' parent: false - - uses: actions/upload-artifact@master + - uses: actions/upload-artifact@v4 with: name: epsilon-web.zip path: output/release/simulator/web/epsilon.zip linux: runs-on: ubuntu-latest steps: - - run: sudo apt-get install build-essential imagemagick libfreetype6-dev libjpeg-dev libpng-dev pkg-config - - uses: actions/checkout@v2 + - run: | + sudo apt-get update + sudo apt-get install build-essential imagemagick libfreetype6-dev libjpeg-dev libpng-dev pkg-config libxtst-dev + - uses: actions/checkout@v4 with: submodules: 'recursive' - run: make -j2 PLATFORM=simulator @@ -333,7 +382,7 @@ jobs: path: 'output/release/simulator/linux/epsilon.bin' destination: 'upsilon-binfiles.appspot.com/dev/simulator/' parent: false - - uses: actions/upload-artifact@master + - uses: actions/upload-artifact@v4 with: name: epsilon-linux.bin path: output/release/simulator/linux/epsilon.bin @@ -341,14 +390,15 @@ jobs: if: github.event.inputs.triggerMacos == 'yes' || github.event.inputs.triggerMacos == '' runs-on: macOS-latest steps: + - run: brew install python-setuptools - run: brew install numworks/tap/epsilon-sdk - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 with: submodules: 'recursive' - run: make -j2 PLATFORM=simulator - run: make -j2 PLATFORM=simulator ARCH=x86_64 test.bin - run: output/release/simulator/macos/x86_64/test.bin --headless - - uses: actions/upload-artifact@master + - uses: actions/upload-artifact@v4 with: name: epsilon-macos.zip path: output/release/simulator/macos/epsilon.app @@ -356,13 +406,14 @@ jobs: if: github.event.inputs.triggerIos == 'yes' || github.event.inputs.triggerIos == '' runs-on: macOS-latest steps: + - run: brew install python-setuptools - run: brew install numworks/tap/epsilon-sdk - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 with: submodules: 'recursive' - run: make -j2 PLATFORM=simulator TARGET=ios EPSILON_TELEMETRY=0 - run: make -j2 PLATFORM=simulator TARGET=ios EPSILON_TELEMETRY=0 APPLE_PLATFORM=ios-simulator - - uses: actions/upload-artifact@master + - uses: actions/upload-artifact@v4 with: name: epsilon-ios.ipa path: output/release/simulator/ios/epsilon.ipa diff --git a/.github/workflows/metric-workflow.yml b/.github/workflows/metric-workflow.yml index d7ec925fc..06692943f 100644 --- a/.github/workflows/metric-workflow.yml +++ b/.github/workflows/metric-workflow.yml @@ -10,7 +10,7 @@ jobs: - name: Install ARM toolchain uses: numworks/setup-arm-toolchain@2020-q2 - name: Checkout PR base - uses: actions/checkout@v2 + uses: actions/checkout@v4 with: submodules: recursive ref: ${{ github.event.pull_request.base.sha }} @@ -18,7 +18,7 @@ jobs: - name: Build base run: make -j2 -C base MODEL=n0110 epsilon.elf - name: Checkout PR head - uses: actions/checkout@v2 + uses: actions/checkout@v4 with: submodules: recursive ref: ${{ github.event.pull_request.head.sha }} @@ -27,12 +27,12 @@ jobs: run: make -j2 -C head MODEL=n0110 epsilon.elf - name: Retrieve binary size analysis id: binary_size - run: echo "::set-output name=table::$(python3 head/build/metrics/binary_size.py base/output/release/device/n0110/epsilon.elf head/output/release/device/n0110/epsilon.elf --labels Base Head --sections .text .rodata .bss .data --custom 'Total (RAM)' .data .bss --custom 'Total (ROM)' .text .rodata .data --escape)" + run: echo "table=$(python3 head/build/metrics/binary_size.py base/output/release/device/n0110/epsilon.elf head/output/release/device/n0110/epsilon.elf --labels Base Head --sections .text .rodata .bss .data --custom 'Total (RAM)' .data .bss --custom 'Total (ROM)' .text .rodata .data --escape)" >> $GITHUB_OUTPUT - name: Add comment - uses: actions/github-script@v3.0.0 + uses: actions/github-script@v7 with: script: | - await github.issues.createComment({ + await github.rest.issues.createComment({ owner: context.repo.owner, repo: context.repo.repo, issue_number: context.payload.pull_request.number, diff --git a/README.fr.md b/README.fr.md index 5a734af7a..c9c80e628 100644 --- a/README.fr.md +++ b/README.fr.md @@ -7,19 +7,19 @@ Discord

-> Don't understand french ? speak english ? here's the [english README](./README.md) ! +> Don't understand French ? Speak English ? here's the [english README](./README.md) ! ## À propos -Upsilon est un fork d'Omega, un fork d'Epsilon, l'OS de Numworks tournant sur les calculatrices du même nom, qui apporte beaucoup de fonctionnalités en plus, mais qui fut archivé et fermé pour des raisons légales après un changement de politique de Numworks. Upsilon est fait pour ceux qui aimeraient voir un futur pour les OS créées par les utilisateurs pour Numworks, même après l'arrèt du projet initial. +Upsilon est un fork d'Omega, un fork d'Epsilon, l'OS de NumWorks tournant sur les calculatrices du même nom, qui apporte beaucoup de fonctionnalités en plus, mais qui fut archivé et fermé pour des raisons légales après un changement de politique de NumWorks. Upsilon est fait pour ceux qui aimeraient voir un futur pour les OS créés par les utilisateurs pour NumWorks, même après l'arrêt du projet initial. ### Quelques fonctionnalités supplémentaires -- Un module python kandinsky amélioré +- Un module Python Kandinsky amélioré - Un support pour fonds d'écrans personnalisés - Des applications externes - Un thème Upsilon -- La surcharge des opérateurs en python +- La surcharge des opérateurs en Python - Un tableau périodique légèrement amélioré - L'utilisation possible du signe "=" dans les calculs - *Ainsi que tout ce qui a été ajouté sur Omega, et bien plus...* [Changelogs complets d'Omega](https://github.com/Omega-Numworks/Omega/wiki/Changelog) | [Fonctionnalités principales d'Omega & captures d'écran](https://github.com/Omega-Numworks/Omega/wiki/Main-features). @@ -29,12 +29,12 @@ Upsilon est un fork d'Omega, un fork d'Epsilon, l'OS de Numworks tournant sur le ### Site web Rendez-vous sur le [site d'Upsilon](https://getupsilon.web.app/) à la section "Installer". -Si votre calculatrice est reconnue, qu'elle contient une version d'Epsilon inférieure à 16 et que votre navigateur accepte WebUSB, la page vous proposera d'installer Upsilon. +Si votre calculatrice est reconnue, qu'elle contient une version d'Epsilon inférieure à 16 et que votre navigateur accepte WebUSB, la page vous proposera d'installer Upsilon. Ne débranchez votre calculatrice qu'une fois l'installation terminée. ### Manuelle - *Vous pouvez vous référer à ce [site internet](https://www.numworks.com/resources/engineering/software/build/)pour la première étape si vous avez des erreurs* + *Vous pouvez vous référer à ce [site internet](https://www.numworks.com/resources/engineering/software/build/) pour la première étape si vous avez des erreurs* ### 1. Installation du SDK @@ -52,13 +52,13 @@ Ne débranchez votre calculatrice qu'une fois l'installation terminée.
-Il suffit juste d'installer les dépendances en tapant ces commandes dans un Terminal en mode super-utilisateur. +Il suffit juste d'installer les dépendances en tapant ces commandes dans un terminal en mode super-utilisateur. ```bash apt-get install build-essential git imagemagick libx11-dev libxext-dev libfreetype6-dev libpng-dev libjpeg-dev pkg-config gcc-arm-none-eabi binutils-arm-none-eabi ``` -C'est fait! Vous pouvez aller à l'étape 2. +C'est fait ! Vous pouvez aller à l'étape 2.
@@ -70,7 +70,7 @@ C'est fait! Vous pouvez aller à l'étape 2.
-Installez toutes les dépendances grâce à cette commande: +Installez toutes les dépendances grâce à cette commande : ```bash dnf install make automake gcc gcc-c++ kernel-devel git ImageMagick libX11-devel libXext-devel freetype-devel libpng-devel libjpeg-devel pkg-config arm-none-eabi-gcc-cs arm-none-eabi-gcc-cs-c++ @@ -86,7 +86,7 @@ dnf install make automake gcc gcc-c++ kernel-devel git ImageMagick libX11-devel
-Installez toutes les dépendances grâce à cette commande: +Installez toutes les dépendances grâce à cette commande : ```bash nix-env -p gcc libpng libjpeg xorg.libX11 pkg-config freetype xorg.libXext python3 imagemagick python310Packages.lz4 python310Packages.pypng python310Packages.pypng gcc-arm-embedded ``` @@ -103,7 +103,7 @@ nix-env -p gcc libpng libjpeg xorg.libX11 pkg-config freetype xorg.libXext pytho
-Il est recommandé d'utiliser [Homebrew](https://brew.sh/). Une fois intsallé, utilisez: +Il est recommandé d'utiliser [Homebrew](https://brew.sh/). Une fois installé, utilisez : ```bash brew install numworks/tap/epsilon-sdk @@ -129,16 +129,16 @@ Vous pouvez aller à l'étape 2.
-Avec Msys2/Mingw (Supportés par Numwoks bien qu'il y ait beaucoup de bugs) +Avec Msys2/Mingw (Supportés par NumWorks bien qu'il y ait beaucoup de bugs) -L'environnement de compilation [Msys2](https://www.msys2.org/) est recommandé par Numworks pour obtenir la plupart des outils requis facilement. C'est ici que vous allez copier-colletoutes lecommandes de ce tutoriel. Une fois installé, copier-coller ces deux commandes dans le terminal: +L'environnement de compilation [Msys2](https://www.msys2.org/) est recommandé par NumWorks pour obtenir la plupart des outils requis facilement. C'est ici que vous allez copier-coller toutes les commandes de ce tutoriel. Une fois installé, copiez-collez ces deux commandes dans le terminal: ```bash pacman -S mingw-w64-x86_64-gcc mingw-w64-x86_64-freetype mingw-w64-x86_64-pkg-config mingw-w64-x86_64-libusb git make python echo "export PATH=/mingw64/bin:$PATH" >> .bashrc ``` -Ensuite, vous devrez installer [GCC toolchain for ARM](https://developer.arm.com/tools-and-software/open-source-software/developer-tools/gnu-toolchain/gnu-rm/downloads). Quand il vouest demandde choisir u dossier d'installation, choisissez `C:\msys64\home\User\gcc-arm\`. Il vous faudra ensuite ajouter ce dossier à votre $PATH. Tapez juste: +Ensuite, vous devrez installer [GCC toolchain for ARM](https://developer.arm.com/tools-and-software/open-source-software/developer-tools/gnu-toolchain/gnu-rm/downloads). Quand il vous est demandé de choisir un dossier d'installation, choisissez `C:\msys64\home\User\gcc-arm\`. Il vous faudra ensuite ajouter ce dossier à votre $PATH. Tapez juste: ```bash echo "export PATH=$PATH:$HOME/gcc-arm/bin" >> .bashrc @@ -154,11 +154,11 @@ Redémarrez votre terminal et vous pouvez aller à l'étape 2! WSL est un système qui virtualise un environnement GNU/Linux dans Windows. -Votre version de windows doit être >= 1903. +Votre version de Windows doit être >= 1903. #### Installation de WSL -1. Apuyez simulatanément sur les touches "windows" et "x" puis cliquez sur "Powershell administrateur". Entrez ensuite ceci dans la nouvelle fenêtre: +1. Apuyez simultanément sur les touches "Windows" et "X" puis cliquez sur "PowerShell Administrateur". Entrez ensuite ceci dans la nouvelle fenêtre: ```powershell dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart @@ -176,45 +176,47 @@ Cette commande permet d'autoriser le démarrage des machines signées par Micros 3. Téléchargez [ce fichier](https://wslstorestorage.blob.core.windows.net/wslblob/wsl_update_x64.msi) et suivez les instructions d'installation. -4. Ouvrez votre fenêtre powershell comme avant et tapez: +4. Ouvrez votre fenêtre PowerShell comme avant et tapez: ```powershell wsl --set-default-version 2 ``` -5. téléchargez [Ubuntu](https://www.microsoft.com/store/apps/9n6svws3rx71) depuis le Microsoft store. Vous pouvez aussi installer [Debian](https://www.microsoft.com/store/productI9MSVKQC78PK6). +5. Téléchargez [Ubuntu](https://www.microsoft.com/store/apps/9n6svws3rx71) depuis le Microsoft store. Vous pouvez aussi installer [Debian](https://www.microsoft.com/store/productI9MSVKQC78PK6) à la place. WSL est maintenant installé. 6. Installez maintenant la version pour ARM de GCC. + ```bash +sudo apt-get update sudo apt-get install build-essential git imagemagick libx11-dev libxext-dev libfreetype6-dev libpng-dev libjpeg-dev pkg-config gcc-arm-none-eabi binutils-arm-none-eabi ``` ### Installation d'usbipd pour connecter la calculatrice à WSL (facultatif) -Pour connecter la calculatrice, il faut installer cet [outil](https://github.com/dorssel/usbipd-win/releases/download/v1.3.0/usbipd-win_1.3.0.msi). Il permet de connecter des périphériques par internet. Suivez les instructions pour installer. +Pour connecter la calculatrice, il faut installer cet [outil](hthttps://github.com/dorssel/usbipd-win/releases/download/v5.0.0/usbipd-win_5.0.0_x64.msi). Il permet de connecter des périphériques par Internet. Suivez les instructions pour l'installer. #### Ubuntu -1. Dans un terminal WSL Ubuntu, tapez: +1. Dans un terminal WSL Ubuntu, tapez : ```bash -sudo apt install linux-tools-5.4.0-77-generic hwdata +sudo apt install linux-tools-generic hwdata ``` -2. Editez /etc/sudoers pour que l'on puisse utiliser la commande usbip. Sur Ubutu, cele est fait de cette manière: + #### Debian -1.Si vous utiliser Debian, utilisez cette commande: +1.Si vous utilisez Debian, lancez cette commande: ```bash sudo apt install usbip hwdata usbutils @@ -222,18 +224,19 @@ sudo apt install usbip hwdata usbutils ### Pour connecter la calculatrice à WSL -1. Ouvrez encore un powershell en mode administrateur et tapez: +1. Ouvrez à nouveau un PowerShell en mode administrateur et tapez : ```powershell - usbipd wsl list +usbipd list ``` -Ceci va lister les périphériques USB connectés à l'ordinateur. Reagrdez le BUSID de votre "Numworks Calculator". +Ceci va lister les périphériques USB connectés à l'ordinateur. Regardez le BUSID de votre "Numworks Calculator". -2. Maintenant, lancez cette commande en remplçant par celui de votre caculatrice: +2. Maintenant, lancez cette commande en remplaçant par celui de votre calculatrice : ```powershell -usbipd wsl attach --busid +usbipd bind --busid +usbipd attach --wsl --busid ``` Le mot de passe de votre machine WSL vous sera demandé. @@ -248,7 +251,7 @@ Vous pouvez aller à l'étape 2. ### 2. Récupérer le code source -Le code source est disponible dans une repository git. Récupérez-le de cette manière: +Le code source est disponible dans une repository git. Récupérez-le de cette manière : ```bash git clone --recursive https://github.com/UpsilonNumworks/Upsilon.git @@ -287,7 +290,7 @@ soit: make MODEL=n0100 OMEGA_USERNAME="" binpack -j4 ``` -pour compiler les binpacks que vous pouvez distribuer et flasher depuis le [Ti-planet's webDFU](https://ti-planet.github.io/webdfu_numworks/n0100/). +pour compiler les binpacks que vous pouvez distribuer et flasher depuis le [WebDFU de TI-Planet](https://ti-planet.github.io/webdfu_numworks/n0100/).
@@ -295,7 +298,7 @@ pour compiler les binpacks que vous pouvez distribuer et flasher depuis le [Ti-p Model n0110 -Le bootloader vous permet d'installer firmware dans des "slots" séparés. Dans ce cas les applications externes ne pourront pas utiliser toute la mémoire mais la moitié. Si un seul slot est utilisé, le bootloader permettra d'utiliser toute la mémoire. Sans bootloader, les apps external peuvent utiliser toute la mémoire. +Le bootloader vous permet d'installer 2 firmwares dans des "slots" séparés. Dans ce cas les applications externes ne pourront pas utiliser toute la mémoire mais la moitié. Si un seul slot est utilisé, le bootloader permettra d'utiliser toute la mémoire. Sans bootloader, les apps externes peuvent utiliser toute la mémoire.
Bootloader @@ -324,7 +327,7 @@ soit: make OMEGA_USERNAME="{Votre nom, max 15 caractères}" binpack -j4 ``` -pour compiler les binpacks que vous pouvez distribuer et flasher depuis le [Ti-planet's webDFU](https://ti-planet.github.io/webdfu_numworks/n0100/). Vous les trouverez dans `output/release/device/bootloader/`. +pour compiler les binpacks que vous pouvez distribuer et flasher depuis le [WebDFU de TI-Planet](https://ti-planet.github.io/webdfu_numworks/n0100/). Vous les trouverez dans `output/release/device/bootloader/`.
@@ -353,7 +356,7 @@ soit: make MODEL=n0110 OMEGA_USERNAME="{Votre nom, max 15 caractères}" binpack -j4 ``` -pour compiler les binpacks que vous pouvez distribuer et flasher depuis le [Ti-planet's webDFU](https://ti-planet.github.io/webdfu_numworks/n0100/). Vous les trouverez dans `output/release/device/n0110/`. +pour compiler les binpacks que vous pouvez distribuer et flasher depuis le [WebDFU de TI-Planet](https://ti-planet.github.io/webdfu_numworks/n0100/). Vous les trouverez dans `output/release/device/n0110/`. @@ -424,7 +427,7 @@ git checkout --recursive upsilon-dev make PLATFORM=simulator TARGET=3ds -j ``` -Vous pouvez ensuite mettre epsilon.3dsx sur une carte SDpour le lancer depuis le HBC ou utilisez 3dslink pour le lancer via le réseau: +Vous pouvez ensuite mettre epsilon.3dsx sur une carte SD pour le lancer depuis le HBC ou utilisez 3dslink pour le lancer via le réseau: ```bash 3dslink output/release/simulator/3ds/epsilon.3dsx -a <3DS' IP ADDRESS> @@ -434,19 +437,19 @@ Vous pouvez ensuite mettre epsilon.3dsx sur une carte SDpour le lancer depuis le
-Important: n'oubliez pas l'argument `--recursive` Parce qu'Upsilon dépend de submodules. +Important: n'oubliez pas l'argument `--recursive` parce qu'Upsilon dépend de submodules. Aussi, vous pouvez changer le nombre de processus de compilation en parallèles en changeant le nombre après l'argument `-j`. -N'oubliez pas de mettre votre nom à la place `{Votre nom, maximum 15 caractères}`.Si vous n'en voulez pas, enlevez l'argument `OMEGA_USERNAME`. +N'oubliez pas de mettre votre nom à la place `{Votre nom, maximum 15 caractères}`. Si vous n'en voulez pas, enlevez l'argument `OMEGA_USERNAME`. -Si vous avez besoin d'aide, n'hésitez pas à rejoindre notre serveur discord : +Si vous avez besoin d'aide, n'hésitez pas à rejoindre notre serveur Discord :

Omega Banner Discord

--- ## Liens utiles -- [Upsilon external (pour installer des applications supplémentaires et des fonds d'écran)](https://upsilonnumworks.github.io/Upsilon-External/) -- [Documentation d'ulab](https://micropython-ulab.readthedocs.io/en/latest/) +- [Upsilon-External (pour installer des applications supplémentaires et des fonds d'écran)](https://upsilonnumworks.github.io/Upsilon-External/) +- [Documentation d'Ulab](https://micropython-ulab.readthedocs.io/en/latest/) ## Contribution @@ -467,18 +470,18 @@ Les anciens projets d'Omega, avant sa fermeture, qui ont été utilisés pour ce ## À propos d'Epsilon -Upsilon est un fork d'Omega, visant a continuer le projet des OS utilisateurs pour Numworks +Upsilon est un fork d'Omega, visant a continuer le projet des OS utilisateurs pour NumWorks. -Omega est un fork d'Epsilon, un système d'exploitation performant pour calculatrices graphiques. Il inclut huit applications pour les mathématiques de lycée et d'études supérieurs +Omega est un fork d'Epsilon, un système d'exploitation performant pour calculatrices graphiques. Il inclut huit applications pour les mathématiques de lycée et d'études supérieures. Vous pouvez essayer Epsilon depuis votre navigateur sur le [simulateur en ligne](https://www.numworks.com/simulator/). ## Licence NumWorks est une marque déposée de NumWorks SAS, 24 Rue Godot de Mauroy, 75009 Paris, France. -Nintendo est Nintendo 3DS sont des marques déposées de Nintendo of America Inc, 4600 150th Ave NE, Redmond, WA 98052, Etats-Unis. +Nintendo et Nintendo 3DS sont des marques déposées de Nintendo of America Inc, 4600 150th Ave NE, Redmond, WA 98052, Etats-Unis. NumWorks SAS et Nintendo of America Inc ne sont en aucun cas associés avec ce projet. -- NumWorks Epsilon est disponible sous [Lisense CC BY-NC-SA](https://creativecommons.org/licenses/by-nc-sa/4.0/legalcode). -- Omega est disponible sous [Lisense CC BY-NC-SA](https://creativecommons.org/licenses/by-nc-sa/4.0/legalcode). -- Upsilon est disponible sous [Lisense CC BY-NC-SA](https://creativecommons.org/licenses/by-nc-sa/4.0/legalcode). +- NumWorks Epsilon est disponible sous [licence CC BY-NC-SA](https://creativecommons.org/licenses/by-nc-sa/4.0/legalcode.fr). +- Omega est disponible sous [licence CC BY-NC-SA](https://creativecommons.org/licenses/by-nc-sa/4.0/legalcode.fr). +- Upsilon est disponible sous [licence CC BY-NC-SA](https://creativecommons.org/licenses/by-nc-sa/4.0/legalcode.fr). diff --git a/README.md b/README.md index c182483f5..74be9a622 100644 --- a/README.md +++ b/README.md @@ -7,11 +7,11 @@ Discord

-> Vous ne comprenez pas l'anglais ? Vous êtes francophone ? Regardez le [*LISEZ-MOI* français](./README.fr.md) ! +> 🇫🇷 Vous ne comprenez pas l'anglais ? Vous êtes francophone ? Regardez le [*LISEZ-MOI* français](./README.fr.md) ! 🇫🇷 ## About -Upsilon is a fork of Omega, an user-made OS that runs on the Numworks calculator, which brings many features to it, but was discontinued because of a policy change from Numworks. Upsilon is for the people who want to see a future for user-made OSes for Numworks, even after the closure and archiving of Omega. +Upsilon is a fork of Omega, an user-made OS that runs on the NumWorks calculator, which brings many features to it, but was discontinued because of a policy change from NumWorks. Upsilon is for the people who want to see a future for user-made OSes for NumWorks, even after the closure and archiving of Omega. ### Some new features @@ -131,16 +131,16 @@ And there you can go to step 2!
-With Msys2/Mingw (officialized by numworks but with a lot of bugs) +With Msys2/Mingw (officialized by NumWorks but with a lot of bugs) -[Msys2](https://www.msys2.org/) environment is recommended by Numworks to get most of the required tools on Windows easily. It's where you'll paste all the commands of this tutorial. Once it'sinstalled, paste these commands into the Msys2 terminal. +[Msys2](https://www.msys2.org/) environment is recommended by NumWorks to get most of the required tools on Windows easily. It's where you'll paste all the commands of this tutorial. Once it's installed, paste these commands into the Msys2 terminal. ```bash pacman -S mingw-w64-x86_64-gcc mingw-w64-x86_64-freetype mingw-w64-x86_64-pkg-config mingw-w64-x86_64-libusb git make python echo "export PATH=/mingw64/bin:$PATH" >> .bashrc ``` -Next, you'll need to install the [GCC toolchain for ARM](https://developer.arm.com/tools-and-software/open-source-software/developer-tools/gnu-toolchain/gnu-rm/downloads). When prompted for aninstall location, choose `C:\msys64\home\User\gcc-arm\`. You'll then need to add this folder to your $PATH. Just enter: +Next, you'll need to install the [GCC toolchain for ARM](https://developer.arm.com/tools-and-software/open-source-software/developer-tools/gnu-toolchain/gnu-rm/downloads). When prompted for an install location, choose `C:\msys64\home\User\gcc-arm\`. You'll then need to add this folder to your $PATH. Just enter: ```bash echo "export PATH=$PATH:$HOME/gcc-arm/bin" >> .bashrc @@ -154,11 +154,11 @@ Just restart terminal and you can go to step 2! With WSL 2 -You need a windows version >= 1903. +You need a Windows version >= 1903. #### WSL Installation -1. Use simultaneously win + X keys and then click on "admin powershell". +1. Use simultaneously Win + X keys and then click on "admin powershell". ```powershell dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart @@ -181,35 +181,47 @@ This one allows virtual machines developed by Microsoft. ```powershell wsl --set-default-version 2 ``` + 5. Download [Ubuntu](https://www.microsoft.com/store/apps/9n6svws3rx71) from Microsoft store. WSL is now installed. 6. Then Install GCC cross compiler for ARM. In your Ubuntu teminal, run: + + ```bash -apt-get install build-essential git imagemagick libx11-dev libxext-dev libfreetype6-dev libpng-dev libjpeg-dev pkg-config gcc-arm-none-eabi binutils-arm-none-eabi +sudo apt-get update +sudo apt-get install build-essential git imagemagick libx11-dev libxext-dev libfreetype6-dev libpng-dev libjpeg-dev pkg-config gcc-arm-none-eabi binutils-arm-none-eabi ``` ### Usbipd installation to connect your calculator -If you want to connect to the calculator, you have to connect to install this [tool](https://github.com/dorssel/usbipd-win/releases/download/v1.3.0/usbipd-win_1.3.0.msi). This will allow you toconnect WSL to the calculator through internet. Follow the on screen information to install. + +If you want to connect to the calculator, you have to connect to install this +[tool](https://github.com/dorssel/usbipd-win/releases/download/v5.0.0/usbipd-win_5.0.0_x64.msi). +This will allow you to connect WSL to the calculator through internet. Follow +the on screen information to install. + #### Ubuntu + 1. In a WSL Ubuntu command prompt, type: + ```bash -sudo apt install linux-tools-5.4.0-77-generic hwdata +sudo apt install linux-tools-generic hwdata ``` -2. Edit /etc/sudoers so that root can find the usbip command. On Ubuntu, run this command. + #### Debian -1. If you use debian for your WSL distro, use this command instead: +1. If you use Debian for your WSL distro, use this command instead: ```bash sudo apt install usbip hwdata usbutils @@ -219,20 +231,22 @@ And that's all for installation and set up. ### To connect your calculator -1. Open an Admin powershell and type: +1. Open an admin PowerShell and type: ```powershell - usbipd wsl list +usbipd list ``` -This will list your usb devices connected. Look at the BUSID column and remember the one for your calculator (it should be called "Numworks Calculator"). -2. Now run this command replacing `` by your calculator's usb port id: +This will list your USB devices connected. Look at the BUSID column and remember the one for your calculator (it should be called "Numworks Calculator"). +2. Now run this command replacing `` by your calculator's USB port id: ```powershell -usbipd wsl attach --busid +usbipd bind --busid +usbipd attach --wsl --busid + ``` -It will ask you to type your wsl's password and will connect your calculator to WSL. +It will ask you to type your WSL's password and will connect your calculator to WSL. You can now go to step 2! @@ -264,7 +278,7 @@ git checkout upsilon-dev ```bash make MODEL=n0100 clean -make MODEL=n0100 EPSILON_I18N=en OMEGA_USERNAME="{Your name, max 15 characters}" -j(nproc) +make MODEL=n0100 EPSILON_I18N=en OMEGA_USERNAME="{Your name, max 15 characters}" -j$(nproc) ``` Now, run either: @@ -280,10 +294,10 @@ to directly flash the calculator after pressing simultaneously `reset` and `6` b or: ```bash -make MODEL=n0100 OMEGA_USERNAME="" binpack -j(nproc) +make MODEL=n0100 OMEGA_USERNAME="" binpack -j$(nproc) ``` -to make binpack which you can flash to the calculator from [Ti-planet's webDFU](https://ti-planet.github.io/webdfu_numworks/n0100/). Binpacks are a great way to share a custom build of Upsilonto friends. +to make binpack which you can flash to the calculator from [TI-Planet's WebDFU](https://ti-planet.github.io/webdfu_numworks/n0100/). Binpacks are a great way to share a custom build of Upsilon to friends.
@@ -291,7 +305,7 @@ to make binpack which you can flash to the calculator from [Ti-planet's webDFU]( Model n0110 -The bootloader allows you to install 2 firmware in separated "slots". If so, external apps won't have all the space but half. Bootloader will allow use of all of the memory if only one slot is flashed. In legacy mode, external apps use all the space available. +The bootloader allows you to install 2 firmwares in separated "slots". If so, external apps won't have all the space but half. Bootloader will allow use of all of the memory if only one slot is flashed. In legacy mode, external apps use all the space available.
Bootloader @@ -301,7 +315,7 @@ Then, build with: ```bash make clean -make OMEGA_USERNAME="{Your name, max 15 characters}" -j(nproc) +make OMEGA_USERNAME="{Your name, max 15 characters}" -j$(nproc) ``` Now, run either: @@ -317,10 +331,10 @@ to directly flash the calculator into the current slot, or thought bootloader's or: ```bash -make OMEGA_USERNAME="" binpack -j(nproc) +make OMEGA_USERNAME="" binpack -j$(nproc) ``` -to make binpack which you can flash to the calculator from [Ti-planet's webDFU](https://ti-planet.github.io/webdfu_numworks/n0110/). You'll find them at `output/release/device/bootloader/`. Binpacks are a great way to share a custom build of Upsilon to friends. +to make binpack which you can flash to the calculator from [TI-Planet's webDFU](https://ti-planet.github.io/webdfu_numworks/n0110/). You'll find them at `output/release/device/bootloader/`. Binpacks are a great way to share a custom build of Upsilon to friends.
@@ -330,7 +344,7 @@ to make binpack which you can flash to the calculator from [Ti-planet's webDFU]( ```bash make MODEL=n0110 clean -make MODEL=n0110 OMEGA_USERNAME="{Your name, max 15 characters}" -j(nproc) +make MODEL=n0110 OMEGA_USERNAME="{Your name, max 15 characters}" -j$(nproc) ``` Now, run either: @@ -346,10 +360,10 @@ to directly flash the calculator after pressing simultaneously `reset` and `6` b or: ```bash -make MODEL=n0110 OMEGA_USERNAME="" binpack -j(nproc) +make MODEL=n0110 OMEGA_USERNAME="" binpack -j$(nproc) ``` -to make binpack which you can flash to the calculator from [Ti-planet's webDFU](https://ti-planet.github.io/webdfu_numworks/n0110/). You'll find them at `output/release/device/bootloader/`. Binpacks are a great way to share a custom build of Upsilon to friends. +to make binpack which you can flash to the calculator from [Ti-Planet's WebDFU](https://ti-planet.github.io/webdfu_numworks/n0110/). You'll find them at `output/release/device/bootloader/`. Binpacks are a great way to share a custom build of Upsilon to friends. @@ -417,7 +431,7 @@ You need devkitPro and devkitARM installed and in your path (instructions [here] git clone --recursive https://github.com/UpsilonNumworks/Upsilon.git cd Upsilon git checkout upsilon-dev -make PLATFORM=simulator TARGET=3ds -j(nproc) +make PLATFORM=simulator TARGET=3ds -j$(nproc) ``` You can then put epsilon.3dsx on a SD card to run it from the HBC or use 3dslink to launch it over the network: @@ -432,7 +446,7 @@ You can then put epsilon.3dsx on a SD card to run it from the HBC or use 3dslink
Casio fx-CG-series Port - + First, install gint and fxsdk along with a cross compiler for the calculator. There are instructions for this (in French, but Google Translate works well enough) [here](https://www.planet-casio.com/Fr/forums/topic16614-last-giteapc-installer-et-mettre-a-jour-automatiquement-des-projets-gitea.html). Next: diff --git a/apps/code/catalog.de.i18n b/apps/code/catalog.de.i18n index b5a22857c..1cac8628f 100644 --- a/apps/code/catalog.de.i18n +++ b/apps/code/catalog.de.i18n @@ -262,3 +262,4 @@ PythonFileReadable = "Kann Datei gelesen werden?" PythonFileWritable = "Kann Datei geschrieben werden?" PythonImportUtils = "Importieren von ulab.utils" PythonUtilsFunction = "Funktionspräfix des utils-Moduls" +PythonTurtleBgcolor = "Ändern Sie die Hintergrundfarbe" diff --git a/apps/code/catalog.en.i18n b/apps/code/catalog.en.i18n index dd3936409..00bc6311e 100644 --- a/apps/code/catalog.en.i18n +++ b/apps/code/catalog.en.i18n @@ -262,3 +262,4 @@ PythonFileReadable = "Tells if read can be used on a file" PythonFileWritable = "Tells if write can be used on a file" PythonImportUtils = "Importing ulab.utils" PythonUtilsFunction = "utils module function prefix" +PythonTurtleBgcolor = "Change the background color" diff --git a/apps/code/catalog.es.i18n b/apps/code/catalog.es.i18n index 62d5bf2c9..80145d28b 100644 --- a/apps/code/catalog.es.i18n +++ b/apps/code/catalog.es.i18n @@ -262,3 +262,4 @@ PythonFileReadable = "Tells if read can be used on a file" PythonFileWritable = "Tells if write can be used on a file" PythonImportUtils = "Importando ulab.utils" PythonUtilsFunction = "prefijo de función del módulo utils" +PythonTurtleBgcolor = "Cambiar el color de fondo" diff --git a/apps/code/catalog.fr.i18n b/apps/code/catalog.fr.i18n index 3185c5ce5..29d2620bd 100644 --- a/apps/code/catalog.fr.i18n +++ b/apps/code/catalog.fr.i18n @@ -212,6 +212,7 @@ PythonTurtleBackward = "Recule de x pixels" PythonTurtleCircle = "Cercle de rayon r pixels" PythonTurtleColor = "Modifie la couleur du tracé" PythonTurtleColorMode = "Met le mode de couleur à 1.0 ou 255" +PythonTurtleBgcolor = "Modifie la couleur du fond" PythonTurtleForward = "Avance de x pixels" PythonTurtleFunction = "Préfixe fonction du module turtle" PythonTurtleGoto = "Va au point de coordonnées (x,y)" diff --git a/apps/code/catalog.hu.i18n b/apps/code/catalog.hu.i18n index 7dd162659..e13a97886 100644 --- a/apps/code/catalog.hu.i18n +++ b/apps/code/catalog.hu.i18n @@ -262,3 +262,4 @@ PythonKeyAns = "ANS kulcs" PythonKeyExe = "EXE kulcs" PythonImportUtils = "Az ulab.utils importálása" PythonUtilsFunction = "utils modul függvény előtagja" +PythonTurtleBgcolor = "Módosítsa a háttérszínt" diff --git a/apps/code/catalog.it.i18n b/apps/code/catalog.it.i18n index d839de541..db2f8bbed 100644 --- a/apps/code/catalog.it.i18n +++ b/apps/code/catalog.it.i18n @@ -262,3 +262,4 @@ PythonFileReadable = "Dice se si può leggere sul file" PythonFileWritable = "Dice se si può scrivere sul file" PythonImportUtils = "Importazione di ulab.utils" PythonUtilsFunction = "Prefisso funzione del modulo utils" +PythonTurtleBgcolor = "Cambia il colore dello sfondo" diff --git a/apps/code/catalog.nl.i18n b/apps/code/catalog.nl.i18n index 4ba8d9906..91fe3b6b3 100644 --- a/apps/code/catalog.nl.i18n +++ b/apps/code/catalog.nl.i18n @@ -263,3 +263,4 @@ PythonFileReadable = "Tells if read can be used on a file" PythonFileWritable = "Tells if write can be used on a file" PythonImportUtils = "Ulab.utils importeren" PythonUtilsFunction = "utils module functie prefix" +PythonTurtleBgcolor = "Verander de achtergrondkleur" diff --git a/apps/code/catalog.pt.i18n b/apps/code/catalog.pt.i18n index bc740acdf..aef378835 100644 --- a/apps/code/catalog.pt.i18n +++ b/apps/code/catalog.pt.i18n @@ -262,3 +262,4 @@ PythonFileReadable = "Tells if read can be used on a file" PythonFileWritable = "Tells if write can be used on a file" PythonImportUtils = "Importando ulab.utils" PythonUtilsFunction = "prefixo de função do módulo utils" +PythonTurtleBgcolor = "Alterar a cor de fundo" diff --git a/apps/code/catalog.universal.i18n b/apps/code/catalog.universal.i18n index 09d292f7c..d1878d9de 100644 --- a/apps/code/catalog.universal.i18n +++ b/apps/code/catalog.universal.i18n @@ -404,6 +404,7 @@ PythonTurtleCommandBackward = "backward(x)" PythonTurtleCommandCircle = "circle(r)" PythonTurtleCommandColor = "color('c')" PythonTurtleCommandColorMode = "colormode(x)" +PythonTurtleCommandBgcolor = "bgcolor('c')" PythonTurtleCommandForward = "forward(x)" PythonTurtleCommandGoto = "goto(x,y)" PythonTurtleCommandHeading = "heading()" diff --git a/apps/code/console_line_cell.cpp b/apps/code/console_line_cell.cpp index 3cad12787..e445b280d 100644 --- a/apps/code/console_line_cell.cpp +++ b/apps/code/console_line_cell.cpp @@ -19,7 +19,7 @@ void ConsoleLineCell::ScrollableConsoleLineView::ConsoleLineView::setLine(Consol void ConsoleLineCell::ScrollableConsoleLineView::ConsoleLineView::drawRect(KDContext * ctx, KDRect rect) const { ctx->fillRect(bounds(), Palette::CodeBackground); - ctx->drawString(m_line->text(), KDPointZero, GlobalPreferences::sharedGlobalPreferences()->font(), textColor(m_line), isHighlighted()? Palette::Select : Palette::BackgroundApps); + ctx->drawString(m_line->text(), KDPointZero, GlobalPreferences::sharedGlobalPreferences()->font(), textColor(m_line), isHighlighted()? Palette::Select : Palette::CodeBackground); } KDSize ConsoleLineCell::ScrollableConsoleLineView::ConsoleLineView::minimalSizeForOptimalDisplay() const { diff --git a/apps/code/python_toolbox.cpp b/apps/code/python_toolbox.cpp index f8a749022..9affd7a6f 100644 --- a/apps/code/python_toolbox.cpp +++ b/apps/code/python_toolbox.cpp @@ -338,6 +338,7 @@ const ToolboxMessageTree TurtleModuleChildren[] = { ToolboxMessageTree::Leaf(I18n::Message::PythonTurtleCommandHideturtle, I18n::Message::PythonTurtleHideturtle, false), ToolboxMessageTree::Leaf(I18n::Message::PythonTurtleCommandColor, I18n::Message::PythonTurtleColor), ToolboxMessageTree::Leaf(I18n::Message::PythonTurtleCommandColorMode, I18n::Message::PythonTurtleColorMode), + ToolboxMessageTree::Leaf(I18n::Message::PythonTurtleCommandBgcolor, I18n::Message::PythonTurtleBgcolor), ToolboxMessageTree::Leaf(I18n::Message::PythonCommandColorBlue, I18n::Message::PythonColorBlue, false), ToolboxMessageTree::Leaf(I18n::Message::PythonCommandColorRed, I18n::Message::PythonColorRed, false), ToolboxMessageTree::Leaf(I18n::Message::PythonCommandColorGreen, I18n::Message::PythonColorGreen, false), @@ -542,6 +543,7 @@ const ToolboxMessageTree catalogChildren[] = { ToolboxMessageTree::Leaf(I18n::Message::PythonCommandCmathFunction, I18n::Message::PythonCmathFunction, false, I18n::Message::PythonCommandCmathFunctionWithoutArg), ToolboxMessageTree::Leaf(I18n::Message::PythonCommandColor, I18n::Message::PythonColor), ToolboxMessageTree::Leaf(I18n::Message::PythonTurtleCommandColorMode, I18n::Message::PythonTurtleColorMode), + ToolboxMessageTree::Leaf(I18n::Message::PythonTurtleCommandBgcolor, I18n::Message::PythonTurtleBgcolor), ToolboxMessageTree::Leaf(I18n::Message::PythonCommandComplex, I18n::Message::PythonComplex), ToolboxMessageTree::Leaf(I18n::Message::PythonCommandCopySign, I18n::Message::PythonCopySign), ToolboxMessageTree::Leaf(I18n::Message::PythonCommandCos, I18n::Message::PythonCos), diff --git a/apps/external/extapp_api.h b/apps/external/extapp_api.h index 9a98e5526..af90b68e2 100644 --- a/apps/external/extapp_api.h +++ b/apps/external/extapp_api.h @@ -27,7 +27,7 @@ #define SCANCODE_OK ((uint64_t)1 << 4) #define SCANCODE_Back ((uint64_t)1 << 5) #define SCANCODE_Home ((uint64_t)1 << 6) -#define SCANCODE_OnOff (((uint64_t)1 << 7) || ((uint64_t)1 << 8)) +#define SCANCODE_OnOff (((uint64_t)1 << 7) | ((uint64_t)1 << 8)) #define SCANCODE_Shift ((uint64_t)1 << 12) #define SCANCODE_Alpha ((uint64_t)1 << 13) #define SCANCODE_XNT ((uint64_t)1 << 14) diff --git a/apps/global_preferences.h b/apps/global_preferences.h index 3077b93fe..9ab267a8c 100644 --- a/apps/global_preferences.h +++ b/apps/global_preferences.h @@ -36,6 +36,8 @@ public: void setAutocomplete(bool autocomple) { m_autoComplete = autocomple; } bool syntaxhighlighting() const { return m_syntaxhighlighting; } void setSyntaxhighlighting(bool syntaxhighlight) { m_syntaxhighlighting = syntaxhighlight; } + bool clearShift() const { return m_clearshift; } + void setClearShift(bool clearalphashift) { m_clearshift = clearalphashift; } int brightnessLevel() const { return m_brightnessLevel; } void setBrightnessLevel(int brightnessLevel); const KDFont * font() const { return m_font; } @@ -63,6 +65,7 @@ private: m_dfuUnlocked(false), m_autoComplete(true), m_syntaxhighlighting(true), + m_clearshift(true), m_brightnessLevel(Ion::Backlight::MaxBrightness), m_idleBeforeSuspendSeconds(55), m_idleBeforeDimmingSeconds(45), @@ -80,6 +83,7 @@ private: bool m_dfuUnlocked; bool m_autoComplete; bool m_syntaxhighlighting; + bool m_clearshift; int m_brightnessLevel; int m_idleBeforeSuspendSeconds; int m_idleBeforeDimmingSeconds; diff --git a/apps/math_toolbox.cpp b/apps/math_toolbox.cpp index 6548cea2e..f6b9c0e01 100644 --- a/apps/math_toolbox.cpp +++ b/apps/math_toolbox.cpp @@ -117,6 +117,7 @@ constexpr ToolboxMessageTree unitDistanceMeterPico = ToolboxMessageTree::Leaf(I1 constexpr ToolboxMessageTree unitDistanceMeterNano = ToolboxMessageTree::Leaf(I18n::Message::UnitDistanceMeterNanoSymbol, I18n::Message::UnitDistanceMeterNano); constexpr ToolboxMessageTree unitDistanceMeterMicro = ToolboxMessageTree::Leaf(I18n::Message::UnitDistanceMeterMicroSymbol, I18n::Message::UnitDistanceMeterMicro); constexpr ToolboxMessageTree unitDistanceMeterMilli = ToolboxMessageTree::Leaf(I18n::Message::UnitDistanceMeterMilliSymbol, I18n::Message::UnitDistanceMeterMilli); +constexpr ToolboxMessageTree unitDistanceMeterCenti = ToolboxMessageTree::Leaf(I18n::Message::UnitDistanceMeterCentiSymbol, I18n::Message::UnitDistanceMeterCenti); constexpr ToolboxMessageTree unitDistanceMeter = ToolboxMessageTree::Leaf(I18n::Message::UnitDistanceMeterSymbol, I18n::Message::UnitDistanceMeter); constexpr ToolboxMessageTree unitDistanceMeterKilo = ToolboxMessageTree::Leaf(I18n::Message::UnitDistanceMeterKiloSymbol, I18n::Message::UnitDistanceMeterKilo); constexpr ToolboxMessageTree unitDistanceAstronomicalUnit = ToolboxMessageTree::Leaf(I18n::Message::UnitDistanceAstronomicalUnitSymbol, I18n::Message::UnitDistanceAstronomicalUnit); @@ -127,7 +128,7 @@ constexpr ToolboxMessageTree unitDistanceFoot = ToolboxMessageTree::Leaf(I18n::M constexpr ToolboxMessageTree unitDistanceYard = ToolboxMessageTree::Leaf(I18n::Message::UnitDistanceYardSymbol, I18n::Message::UnitDistanceYard); constexpr ToolboxMessageTree unitDistanceMile = ToolboxMessageTree::Leaf(I18n::Message::UnitDistanceMileSymbol, I18n::Message::UnitDistanceMile); -const ToolboxMessageTree * unitDistanceMeterChildren[] = {&unitDistanceMeterPico, &unitDistanceMeterNano, &unitDistanceMeterMicro, &unitDistanceMeterMilli, &unitDistanceMeter, &unitDistanceMeterKilo}; +const ToolboxMessageTree * unitDistanceMeterChildren[] = {&unitDistanceMeterPico, &unitDistanceMeterNano, &unitDistanceMeterMicro, &unitDistanceMeterMilli, &unitDistanceMeterCenti, &unitDistanceMeter, &unitDistanceMeterKilo}; const ToolboxMessageTree unitDistanceMeterNode = ToolboxMessageTree::Node(I18n::Message::UnitMetricMenu, unitDistanceMeterChildren); const ToolboxMessageTree * unitDistanceChildrenForImperialToolbox[] = { &unitDistanceInch, @@ -305,11 +306,13 @@ const ToolboxMessageTree unitInductanceChildren[] = { const ToolboxMessageTree unitSurfaceChildrenForMetricToolbox[] = { ToolboxMessageTree::Leaf(I18n::Message::UnitSurfaceHectarSymbol, I18n::Message::UnitSurfaceHectar), + ToolboxMessageTree::Leaf(I18n::Message::UnitSurfaceMeterSquareSymbol, I18n::Message::UnitSurfaceMeterSquare), ToolboxMessageTree::Leaf(I18n::Message::UnitSurfaceAcreSymbol, I18n::Message::UnitSurfaceAcre) }; const ToolboxMessageTree unitSurfaceChildrenForImperialToolbox[] = { ToolboxMessageTree::Leaf(I18n::Message::UnitSurfaceAcreSymbol, I18n::Message::UnitSurfaceAcre), - ToolboxMessageTree::Leaf(I18n::Message::UnitSurfaceHectarSymbol, I18n::Message::UnitSurfaceHectar) + ToolboxMessageTree::Leaf(I18n::Message::UnitSurfaceHectarSymbol, I18n::Message::UnitSurfaceHectar), + ToolboxMessageTree::Leaf(I18n::Message::UnitSurfaceMeterSquareSymbol, I18n::Message::UnitSurfaceMeterSquare), }; const ToolboxMessageTree unitSurfaceFork[] = { ToolboxMessageTree::Node(I18n::Message::UnitSurfaceMenu, unitSurfaceChildrenForMetricToolbox), diff --git a/apps/settings/base.de.i18n b/apps/settings/base.de.i18n index 8f8cd5898..52552d351 100644 --- a/apps/settings/base.de.i18n +++ b/apps/settings/base.de.i18n @@ -81,3 +81,4 @@ ExtAppWriteExplanation1 = "Standardmäßig externe Anwendungen" ExtAppWriteExplanation2 = "kann nicht in den Speicher schreiben" ExtAppWriteExplanation3 = "Flash (dauerhaft) Ihres Rechners." ExtAppEnabled = "Aufstecken" +ClearShift = "Tastenkombination shift + clear" diff --git a/apps/settings/base.en.i18n b/apps/settings/base.en.i18n index 56f152054..4395c0ae2 100644 --- a/apps/settings/base.en.i18n +++ b/apps/settings/base.en.i18n @@ -81,3 +81,4 @@ ExtAppWriteExplanation1 = "By default, external applications" ExtAppWriteExplanation2 = "cannot write to memory" ExtAppWriteExplanation3 = "flash (persistent) of your calculator." ExtAppEnabled = "Pin up" +ClearShift = "Shift + clear shortcut" diff --git a/apps/settings/base.es.i18n b/apps/settings/base.es.i18n index 42ce777f2..d70e8bdd5 100644 --- a/apps/settings/base.es.i18n +++ b/apps/settings/base.es.i18n @@ -81,3 +81,4 @@ ExtAppWriteExplanation1 = "Por defecto, las aplicaciones externas" ExtAppWriteExplanation2 = "no se puede escribir en la memoria" ExtAppWriteExplanation3 = "flash (persistente) de su calculadora." ExtAppEnabled = "Fijar" +ClearShift = "Atajo de shift + clear" diff --git a/apps/settings/base.fr.i18n b/apps/settings/base.fr.i18n index 676e64687..85817ffe5 100644 --- a/apps/settings/base.fr.i18n +++ b/apps/settings/base.fr.i18n @@ -72,6 +72,7 @@ Time = "Heure" RTCWarning1 = "Activer l'horloge décharge la batterie plus" RTCWarning2 = "vite quand la calculatrice est éteinte." SyntaxHighlighting = "Coloration syntaxique" +ClearShift = "Raccourci shift + clear" Normal = "Normale" IdleTimeBeforeDimming = "Assombrir après (s)" IdleTimeBeforeSuspend = "Éteindre après (s)" diff --git a/apps/settings/base.hu.i18n b/apps/settings/base.hu.i18n index a46e8cdda..1874de1c8 100644 --- a/apps/settings/base.hu.i18n +++ b/apps/settings/base.hu.i18n @@ -81,3 +81,4 @@ ExtAppWriteExplanation1 = "Alapértelmezés szerint külső alkalmazások" ExtAppWriteExplanation2 = "nem tud a memóriába írni" ExtAppWriteExplanation3 = "villog (tartósan) a számológép." ExtAppEnabled = "Feltűz" +ClearShift = "Gyorsbillentyű shift + clear" diff --git a/apps/settings/base.it.i18n b/apps/settings/base.it.i18n index 76b709085..850bed789 100644 --- a/apps/settings/base.it.i18n +++ b/apps/settings/base.it.i18n @@ -81,3 +81,4 @@ ExtAppWriteExplanation1 = "Per impostazione predefinita, le app esterne" ExtAppWriteExplanation2 = "non possono scrivere in memoria flash" ExtAppWriteExplanation3 = "(persistente) della calcolatrice." ExtAppEnabled = "Affiggere" +ClearShift = "Scorciatoia shift + clear" diff --git a/apps/settings/base.nl.i18n b/apps/settings/base.nl.i18n index f26e546c4..24b20a6a9 100644 --- a/apps/settings/base.nl.i18n +++ b/apps/settings/base.nl.i18n @@ -81,3 +81,4 @@ ExtAppWriteExplanation1 = "Standaard zijn externe toepassingen" ExtAppWriteExplanation2 = "kan niet naar het geheugen schrijven" ExtAppWriteExplanation3 = "flash (aanhoudend) van uw rekenmachine." ExtAppEnabled = "Vastpinnen" +ClearShift = "Sneltoets shift + clear" diff --git a/apps/settings/base.pt.i18n b/apps/settings/base.pt.i18n index 950bc9927..8a9d83c9f 100644 --- a/apps/settings/base.pt.i18n +++ b/apps/settings/base.pt.i18n @@ -81,3 +81,4 @@ ExtAppWriteExplanation1 = "Por padrão, aplicativos externos" ExtAppWriteExplanation2 = "não pode gravar na memória" ExtAppWriteExplanation3 = "flash (persistente) de sua calculadora." ExtAppEnabled = "Pôster" +ClearShift = "Shift de shift + clear" diff --git a/apps/settings/main_controller.cpp b/apps/settings/main_controller.cpp index 7e71771f9..f797520fb 100644 --- a/apps/settings/main_controller.cpp +++ b/apps/settings/main_controller.cpp @@ -24,7 +24,7 @@ constexpr SettingsMessageTree s_contributorsChildren[18] = {SettingsMessageTree( // Code Settings #ifdef HAS_CODE -constexpr SettingsMessageTree s_codeChildren[3] = {SettingsMessageTree(I18n::Message::FontSizes, s_modelFontChildren), SettingsMessageTree(I18n::Message::Autocomplete), SettingsMessageTree(I18n::Message::SyntaxHighlighting)}; +constexpr SettingsMessageTree s_codeChildren[4] = {SettingsMessageTree(I18n::Message::FontSizes, s_modelFontChildren), SettingsMessageTree(I18n::Message::Autocomplete), SettingsMessageTree(I18n::Message::SyntaxHighlighting), SettingsMessageTree(I18n::Message::ClearShift)}; #endif constexpr SettingsMessageTree s_modelFontChildren[2] = {SettingsMessageTree(I18n::Message::LargeFont), SettingsMessageTree(I18n::Message::SmallFont)}; diff --git a/apps/settings/main_controller.h b/apps/settings/main_controller.h index e78aff9a2..3e1c5ba82 100644 --- a/apps/settings/main_controller.h +++ b/apps/settings/main_controller.h @@ -25,7 +25,7 @@ extern const Shared::SettingsMessageTree s_symbolChildren[4]; extern const Shared::SettingsMessageTree s_symbolFunctionChildren[3]; extern const Shared::SettingsMessageTree s_modelMathOptionsChildren[6]; extern const Shared::SettingsMessageTree s_modelFontChildren[2]; -extern const Shared::SettingsMessageTree s_codeChildren[3]; +extern const Shared::SettingsMessageTree s_codeChildren[4]; extern const Shared::SettingsMessageTree s_modelDateTimeChildren[3]; extern const Shared::SettingsMessageTree s_accessibilityChildren[6]; extern const Shared::SettingsMessageTree s_contributorsChildren[18]; diff --git a/apps/settings/main_controller_prompt_beta.cpp b/apps/settings/main_controller_prompt_beta.cpp index 0f48e7940..6b1825ddd 100644 --- a/apps/settings/main_controller_prompt_beta.cpp +++ b/apps/settings/main_controller_prompt_beta.cpp @@ -1,7 +1,8 @@ -#include "main_controller.h" -#include "../exam_mode_configuration.h" #include +#include "../exam_mode_configuration.h" +#include "main_controller.h" + using namespace Shared; namespace Settings { diff --git a/apps/settings/main_controller_prompt_none.cpp b/apps/settings/main_controller_prompt_none.cpp index 46511e360..1911c2af4 100644 --- a/apps/settings/main_controller_prompt_none.cpp +++ b/apps/settings/main_controller_prompt_none.cpp @@ -17,7 +17,6 @@ constexpr SettingsMessageTree s_modelMenu[] = #ifdef HAS_CODE SettingsMessageTree(I18n::Message::CodeApp, s_codeChildren), #endif - //SettingsMessageTree(I18n::Message::UsbSetting, s_usbProtectionChildren), SettingsMessageTree(I18n::Message::ExternalApps, s_externalChildren), SettingsMessageTree(I18n::Message::Accessibility, s_accessibilityChildren), SettingsMessageTree(I18n::Message::About, s_modelAboutChildren)}; diff --git a/apps/settings/main_controller_prompt_update.cpp b/apps/settings/main_controller_prompt_update.cpp index 2deed3c3e..c5104c8d4 100644 --- a/apps/settings/main_controller_prompt_update.cpp +++ b/apps/settings/main_controller_prompt_update.cpp @@ -1,11 +1,12 @@ -#include "main_controller.h" -#include "../exam_mode_configuration.h" #include -namespace Settings { +#include "../exam_mode_configuration.h" +#include "main_controller.h" using namespace Shared; +namespace Settings { + constexpr SettingsMessageTree s_modelMenu[] = {SettingsMessageTree(I18n::Message::MathOptions, s_modelMathOptionsChildren), SettingsMessageTree(I18n::Message::BrightnessSettings, s_brightnessChildren), @@ -17,8 +18,8 @@ constexpr SettingsMessageTree s_modelMenu[] = SettingsMessageTree(I18n::Message::CodeApp, s_codeChildren), #endif SettingsMessageTree(I18n::Message::UpdatePopUp), - SettingsMessageTree(I18n::Message::Accessibility, s_accessibilityChildren), SettingsMessageTree(I18n::Message::ExternalApps, s_externalChildren), + SettingsMessageTree(I18n::Message::Accessibility, s_accessibilityChildren), SettingsMessageTree(I18n::Message::About, s_modelAboutChildren)}; constexpr SettingsMessageTree s_model = SettingsMessageTree(I18n::Message::SettingsApp, s_modelMenu); diff --git a/apps/settings/sub_menu/code_options_controller.cpp b/apps/settings/sub_menu/code_options_controller.cpp index ae7d5bbc2..d2d2c0a3b 100644 --- a/apps/settings/sub_menu/code_options_controller.cpp +++ b/apps/settings/sub_menu/code_options_controller.cpp @@ -13,6 +13,7 @@ CodeOptionsController::CodeOptionsController(Responder * parentResponder) : m_chevronCellFontSize.setMessageFont(KDFont::LargeFont); m_switchCellAutoCompletion.setMessageFont(KDFont::LargeFont); m_switchCellSyntaxHighlighting.setMessageFont(KDFont::LargeFont); + m_switchCellClearShift.setMessageFont(KDFont::LargeFont); } bool CodeOptionsController::handleEvent(Ion::Events::Event event) { @@ -26,6 +27,10 @@ bool CodeOptionsController::handleEvent(Ion::Events::Event event) { GlobalPreferences::sharedGlobalPreferences()->setSyntaxhighlighting(!GlobalPreferences::sharedGlobalPreferences()->syntaxhighlighting()); m_selectableTableView.reloadCellAtLocation(m_selectableTableView.selectedColumn(), m_selectableTableView.selectedRow()); break; + case 3: + GlobalPreferences::sharedGlobalPreferences()->setClearShift(!GlobalPreferences::sharedGlobalPreferences()->clearShift()); + m_selectableTableView.reloadCellAtLocation(m_selectableTableView.selectedColumn(), m_selectableTableView.selectedRow()); + break; default: GenericSubController * subController = nullptr; subController = &m_preferencesController; @@ -48,8 +53,10 @@ HighlightCell * CodeOptionsController::reusableCell(int index, int type) { } else if (index == 1) { return &m_switchCellAutoCompletion; + } else if (index == 2) { + return &m_switchCellSyntaxHighlighting; } - return &m_switchCellSyntaxHighlighting; + return &m_switchCellClearShift; } int CodeOptionsController::reusableCellCount(int type) { @@ -79,6 +86,11 @@ void CodeOptionsController::willDisplayCellForIndex(HighlightCell * cell, int in SwitchView * mySwitch = (SwitchView *)mySwitchCell->accessoryView(); mySwitch->setState(GlobalPreferences::sharedGlobalPreferences()->syntaxhighlighting()); } + else if (thisLabel == I18n::Message::ClearShift) { + MessageTableCellWithSwitch * mySwitchCell = (MessageTableCellWithSwitch *)cell; + SwitchView * mySwitch = (SwitchView *)mySwitchCell->accessoryView(); + mySwitch->setState(GlobalPreferences::sharedGlobalPreferences()->clearShift()); + } #endif } diff --git a/apps/settings/sub_menu/code_options_controller.h b/apps/settings/sub_menu/code_options_controller.h index 5f9b6acea..1a14c75f0 100644 --- a/apps/settings/sub_menu/code_options_controller.h +++ b/apps/settings/sub_menu/code_options_controller.h @@ -14,11 +14,12 @@ public: int reusableCellCount(int type) override; void willDisplayCellForIndex(HighlightCell * cell, int index) override; private: - constexpr static int k_totalNumberOfCell = 4; + constexpr static int k_totalNumberOfCell = 5; PreferencesController m_preferencesController; MessageTableCellWithChevronAndMessage m_chevronCellFontSize; MessageTableCellWithSwitch m_switchCellAutoCompletion; MessageTableCellWithSwitch m_switchCellSyntaxHighlighting; + MessageTableCellWithSwitch m_switchCellClearShift; }; } diff --git a/apps/shared.universal.i18n b/apps/shared.universal.i18n index f38ad6085..fae01628d 100644 --- a/apps/shared.universal.i18n +++ b/apps/shared.universal.i18n @@ -10,6 +10,7 @@ UnitTimeMonthSymbol = "_month" UnitTimeYearSymbol = "_year" UnitDistanceMeterKiloSymbol = "_km" UnitDistanceMeterSymbol = "_m" +UnitDistanceMeterCentiSymbol = "_cm" UnitDistanceMeterMilliSymbol = "_mm" UnitDistanceMeterMicroSymbol = "_μm" UnitDistanceMeterNanoSymbol = "_nm" @@ -82,6 +83,7 @@ UnitConductanceSiemensMilliSymbol = "_mS" UnitMagneticFieldTeslaSymbol = "_T" UnitInductanceHenrySymbol = "_H" UnitSurfaceAcreSymbol = "_acre" +UnitSurfaceMeterSquareSymbol = "_m^2" UnitSurfaceHectarSymbol = "_ha" UnitVolumeLiterSymbol = "_L" UnitVolumeLiterDeciSymbol = "_dL" diff --git a/apps/toolbox.de.i18n b/apps/toolbox.de.i18n index 2582f6d1b..8a36f5f55 100644 --- a/apps/toolbox.de.i18n +++ b/apps/toolbox.de.i18n @@ -13,17 +13,18 @@ UnitTimeYear = "Jahr" UnitDistanceMenu = "Entfernung" UnitDistanceMeterKilo = "Kilometer" UnitDistanceMeter = "Meter" +UnitDistanceMeterCenti = "Zentimeter" UnitDistanceMeterMilli = "Millimeter" UnitDistanceMeterMicro = "Micrometer" UnitDistanceMeterNano = "Nanometer" UnitDistanceMeterPico = "Pikometer" +UnitDistanceInch = "Zoll" +UnitDistanceFoot = "Fuß" +UnitDistanceYard = "Yard" +UnitDistanceMile = "Meile" UnitDistanceAstronomicalUnit = "Astronomische Einheit" UnitDistanceLightYear = "Lichtjahr" UnitDistanceParsec = "Parsec" -UnitDistanceMile = "Meile" -UnitDistanceYard = "Yard" -UnitDistanceFoot = "Fuß" -UnitDistanceInch = "Zoll" UnitMassMenu = "Masse" UnitMassGramKilo = "Kilogramm" UnitMassGram = "Gramm" @@ -77,13 +78,14 @@ InductanceMenu = "Elektrische Induktivität" UnitSurfaceMenu = "Fläche" UnitSurfaceAcre = "Morgen" UnitSurfaceHectar = "Hektar" +UnitSurfaceMeterSquare = "Quadratmeter" UnitVolumeMenu = "Volumen" UnitVolumeLiter = "Liter" UnitVolumeLiterDeci = "Deziliter" UnitVolumeLiterCenti = "Centiliter" UnitVolumeLiterMilli = "Milliliter" UnitVolumeTeaspoon = "Teelöffel" -UnitVolumeTablespoon= "Esslöffel" +UnitVolumeTablespoon = "Esslöffel" UnitVolumeFluidOunce = "Flüssigunze" UnitVolumeCup = "Tasse" UnitVolumePint = "Pint" @@ -409,21 +411,16 @@ NumberElementUbn = "120 - Unbinilium (Ubn)" AlphaElementUbn = "Ubn - Unbinilium (120)" Speed = "Geschwindigkeit" SpeedOfSound = "Schallgeschwindigkeit" -SpeedOfLightTag = "Lichtgeschwindigkeit" SpeedOfSound0Tag = "Meeresspiegel, 20 ° C" SpeedOfSoundWaterTag = "In Wasser" SpeedOfSoundSteelTag = "In Stahl" SpeedOfSoundGlassTag = "In Glas" -EscapeVelocity = "Fluchtgeschwindigkeit" -EscapeVelocityFromEarth = "Von der Erde" -EscapeVelocityFromMoon = "Vom Mond" -EscapeVelocityFromSun = "Von der Sonne" +SpeedOfLightTag = "Lichtgeschwindigkeit" Thermodynamics = "Thermodynamik" BoltzmannTag = "Boltzmann Konstante" AvogadroTag = "Avogadro-Konstante" GasTag = "Gaskonstante" Electromagnetism = "Elektromagnetismus" -CoulombTag = "Coulomb-Konstante" ConductivityConstants = "Leitfähigkeitskonstanten" Electricity = "Elektrizität" ResistivityConstants = "Konstanten der Widerstandsfähigkeit" @@ -445,6 +442,11 @@ Water = "Wasser" Air = "Luft" Glass = "Glas" Wood = "Holz" +CoulombTag = "Coulomb-Konstante" +EscapeVelocity = "Fluchtgeschwindigkeit" +EscapeVelocityFromEarth = "Von der Erde" +EscapeVelocityFromMoon = "Vom Mond" +EscapeVelocityFromSun = "Von der Sonne" Vacuum_permittivityTag = "Vakuum-Durchlässigkeit" Vacuum_permeabilityTag = "Vakuumdurchlässigkeit" PlanckTag = "Planck - Konstante" diff --git a/apps/toolbox.en.i18n b/apps/toolbox.en.i18n index e6781e868..81e385b21 100644 --- a/apps/toolbox.en.i18n +++ b/apps/toolbox.en.i18n @@ -13,6 +13,7 @@ UnitTimeYear = "Year" UnitDistanceMenu = "Distance" UnitDistanceMeterKilo = "Kilometer" UnitDistanceMeter = "Meter" +UnitDistanceMeterCenti = "Centimeter" UnitDistanceMeterMilli = "Millimeter" UnitDistanceMeterMicro = "Micrometer" UnitDistanceMeterNano = "Nanometer" @@ -77,13 +78,14 @@ InductanceMenu = "Electrical inductance" UnitSurfaceMenu = "Area" UnitSurfaceAcre = "Acre" UnitSurfaceHectar = "Hectare" +UnitSurfaceMeterSquare = "Square meter" UnitVolumeMenu = "Volume" UnitVolumeLiter = "Liter" UnitVolumeLiterDeci = "Deciliter" UnitVolumeLiterCenti = "Centiliter" UnitVolumeLiterMilli = "Milliliter" UnitVolumeTeaspoon = "Teaspoon" -UnitVolumeTablespoon= "Tablespoon" +UnitVolumeTablespoon = "Tablespoon" UnitVolumeFluidOunce = "Fluid Ounce" UnitVolumeCup = "Cup" UnitVolumePint = "Pint" @@ -99,7 +101,6 @@ Calculation = "Calculation" ComplexNumber = "Complex numbers" Combinatorics = "Combinatorics" Arithmetic = "Arithmetic" -MatricesAndVectors = "Matrices and vectors" Matrices = "Matrix" NewMatrix = "New matrix" Identity = "Identity matrix of size n" @@ -414,17 +415,12 @@ SpeedOfSound0Tag = "Sea level, 20°C" SpeedOfSoundWaterTag = "In water" SpeedOfSoundSteelTag = "In steel" SpeedOfSoundGlassTag = "In glass" -EscapeVelocity = "Escape Velocity" -EscapeVelocityFromEarth = "Of Earth" -EscapeVelocityFromMoon = "Of Moon" -EscapeVelocityFromSun = "Of Sun" SpeedOfLightTag = "Speed of light" Thermodynamics = "Thermodynamics" BoltzmannTag = "Boltzmann Constant" AvogadroTag = "Avogadro Constant" GasTag = "Gas Constant" Electromagnetism = "Electromagnetism" -CoulombTag = "Coulomb Constant" ConductivityConstants = "Conductivity constants" Electricity = "Electricity" ResistivityConstants = "Resistivity Constants" @@ -446,6 +442,11 @@ Water = "Water" Air = "Air" Glass = "Glass" Wood = "Wood" +CoulombTag = "Coulomb Constant" +EscapeVelocity = "Escape Velocity" +EscapeVelocityFromEarth = "Of Earth" +EscapeVelocityFromMoon = "Of Moon" +EscapeVelocityFromSun = "Of Sun" Vacuum_permittivityTag = "Vacuum permittivity" Vacuum_permeabilityTag = "Vacuum permeability" PlanckTag = "Planck Constant" @@ -511,4 +512,5 @@ HartreeConstantTag = "Hartree Constant" MagneticFluxQuantumTag = "Magnetic Flux Quantum" ConductanceQuantumTag = "Conductance Quantum" CirculationQuantumTag = "Circulation Quantum" -Factorial = "Factorial" \ No newline at end of file +MatricesAndVectors = "Matrices and vectors" +Factorial = "Factorial" diff --git a/apps/toolbox.es.i18n b/apps/toolbox.es.i18n index ddb8dcf1c..f6883c96b 100644 --- a/apps/toolbox.es.i18n +++ b/apps/toolbox.es.i18n @@ -13,17 +13,18 @@ UnitTimeYear = "Year" UnitDistanceMenu = "Distance" UnitDistanceMeterKilo = "Kilometer" UnitDistanceMeter = "Meter" +UnitDistanceMeterCenti = "Centímetro" UnitDistanceMeterMilli = "Millimeter" UnitDistanceMeterMicro = "Micrometer" UnitDistanceMeterNano = "Nanometer" UnitDistanceMeterPico = "Picometer" +UnitDistanceInch = "Pulgada" +UnitDistanceFoot = "Pie" +UnitDistanceYard = "Yardas" +UnitDistanceMile = "Milla" UnitDistanceAstronomicalUnit = "Astronomical unit" UnitDistanceLightYear = "Light year" UnitDistanceParsec = "Parsec" -UnitDistanceMile = "Milla" -UnitDistanceYard = "Yardas" -UnitDistanceFoot = "Pie" -UnitDistanceInch = "Pulgada" UnitMassMenu = "Mass" UnitMassGramKilo = "Kilogram" UnitMassGram = "Gram" @@ -77,13 +78,14 @@ InductanceMenu = "Electrical inductance" UnitSurfaceMenu = "Area" UnitSurfaceAcre = "Acre" UnitSurfaceHectar = "Hectare" +UnitSurfaceMeterSquare = "Metro cuadrado" UnitVolumeMenu = "Volume" UnitVolumeLiter = "Liter" UnitVolumeLiterDeci = "Deciliter" UnitVolumeLiterCenti = "Centiliter" UnitVolumeLiterMilli = "Milliliter" UnitVolumeTeaspoon = "Cucharadita" -UnitVolumeTablespoon= "Cucharada" +UnitVolumeTablespoon = "Cucharada" UnitVolumeFluidOunce = "Onza líquida" UnitVolumeCup = "Taza" UnitVolumePint = "Pinta" @@ -408,22 +410,17 @@ AlphaElementUue = "Uue - Ununennio (119)" NumberElementUbn = "120 - Unbinilio (Ubn)" AlphaElementUbn = "Ubn - Unbinilio (120)" Speed = "Velocidad" -SpeedOfLightTag = "Velocidad de la luz" SpeedOfSound = "La velocidad del sonido" -Thermodynamics = "Termodinámica" SpeedOfSound0Tag = "Nivel del mar, 20 ° C" SpeedOfSoundWaterTag = "En el agua" SpeedOfSoundSteelTag = "En acero" SpeedOfSoundGlassTag = "En vidrio" -EscapeVelocity = "Velocidad de escape" -EscapeVelocityFromEarth = "De La Tierra" -EscapeVelocityFromMoon = "De la Luna" -EscapeVelocityFromSun = "De el Sol" +SpeedOfLightTag = "Velocidad de la luz" +Thermodynamics = "Termodinámica" BoltzmannTag = "Constante Boltzmann" AvogadroTag = "Constante de Avogadro" GasTag = "Constante de gas" Electromagnetism = "Electromagnetismo" -CoulombTag = "Constante de Coulomb" ConductivityConstants = "Constantes de conductividad" Electricity = "Electricidad" ResistivityConstants = "Constantes de resistividad" @@ -445,6 +442,11 @@ Water = "Agua" Air = "Aire" Glass = "Vidrio" Wood = "Madera" +CoulombTag = "Constante de Coulomb" +EscapeVelocity = "Velocidad de escape" +EscapeVelocityFromEarth = "De La Tierra" +EscapeVelocityFromMoon = "De la Luna" +EscapeVelocityFromSun = "De el Sol" Vacuum_permittivityTag = "Permisividad de vacío" Vacuum_permeabilityTag = "Permeabilidad al vacío" PlanckTag = "Constante de Planck" diff --git a/apps/toolbox.fr.i18n b/apps/toolbox.fr.i18n index ac0f40b36..2ab7f5424 100644 --- a/apps/toolbox.fr.i18n +++ b/apps/toolbox.fr.i18n @@ -13,21 +13,18 @@ UnitTimeYear = "Année" UnitDistanceMenu = "Distance" UnitDistanceMeterKilo = "Kilomètre" UnitDistanceMeter = "Mètre" +UnitDistanceMeterCenti = "Centimètre" UnitDistanceMeterMilli = "Millimètre" UnitDistanceMeterMicro = "Micromètre" UnitDistanceMeterNano = "Nanomètre" UnitDistanceMeterPico = "Picomètre" -UnitDistanceInch = "Inch" -UnitDistanceFoot = "Foot" +UnitDistanceInch = "Pouce" +UnitDistanceFoot = "Pied" UnitDistanceYard = "Yard" UnitDistanceMile = "Mile" UnitDistanceAstronomicalUnit = "Unité astronomique" UnitDistanceLightYear = "Année-lumière" UnitDistanceParsec = "Parsec" -UnitDistanceMile = "Mile" -UnitDistanceYard = "Yard" -UnitDistanceFoot = "Pied" -UnitDistanceInch = "Pouce" UnitMassMenu = "Masse" UnitMassGramKilo = "Kilogramme" UnitMassGram = "Gramme" @@ -81,13 +78,14 @@ InductanceMenu = "Inductance" UnitSurfaceMenu = "Superficie" UnitSurfaceAcre = "Acre" UnitSurfaceHectar = "Hectare" +UnitSurfaceMeterSquare = "Mètre carré" UnitVolumeMenu = "Volume" UnitVolumeLiter = "Litre" UnitVolumeLiterDeci = "Décilitre" UnitVolumeLiterCenti = "Centilitre" UnitVolumeLiterMilli = "Millilitre" UnitVolumeTeaspoon = "Cuillère à café" -UnitVolumeTablespoon= "Cuillère à soupe" +UnitVolumeTablespoon = "Cuillère à soupe" UnitVolumeFluidOunce = "Once fluide" UnitVolumeCup = "Tasse" UnitVolumePint = "Pinte" diff --git a/apps/toolbox.hu.i18n b/apps/toolbox.hu.i18n index 76fe34d08..95b4c178c 100644 --- a/apps/toolbox.hu.i18n +++ b/apps/toolbox.hu.i18n @@ -13,6 +13,7 @@ UnitTimeYear = "Év" UnitDistanceMenu = "Távolság" UnitDistanceMeterKilo = "Kilométer" UnitDistanceMeter = "Méter" +UnitDistanceMeterCenti = "Centiméter" UnitDistanceMeterMilli = "Milliméter" UnitDistanceMeterMicro = "Mikrométer" UnitDistanceMeterNano = "Nanométer" @@ -24,16 +25,16 @@ UnitDistanceMile = "Mérföld" UnitDistanceAstronomicalUnit = "Csillagászati egység" UnitDistanceLightYear = "Fény év" UnitDistanceParsec = "Parsec" -UnitMassShortTon = "Rövid tonna" -UnitMassLongTon = "Hosszú tonna" -UnitMassPound = "Font" -UnitMassOunce = "Uncia" UnitMassMenu = "Tömeg" UnitMassGramKilo = "Kilogramm" UnitMassGram = "Gramm" UnitMassGramMilli = "Milligramm" UnitMassGramMicro = "Mikrogramm" UnitMassTonne = "Tonna" +UnitMassOunce = "Uncia" +UnitMassPound = "Font" +UnitMassShortTon = "Rövid tonna" +UnitMassLongTon = "Hosszú tonna" UnitCurrentMenu = "Áram" UnitCurrentAmpere = "Amper" UnitCurrentAmpereMilli = "Milliamper" @@ -77,6 +78,7 @@ InductanceMenu = "Elektromos induktivitás" UnitSurfaceMenu = "Terület" UnitSurfaceAcre = "Acre" UnitSurfaceHectar = "Hektár" +UnitSurfaceMeterSquare = "Négyzetméter" UnitVolumeMenu = "Kötet" UnitVolumeLiter = "Liter" UnitVolumeLiterDeci = "Deciliter" @@ -155,11 +157,11 @@ RandomInteger = "Véletlen egész szám [a, b] -ben" PrimeFactorDecomposition = "Egész szám tényezö" NormCDF = "P (X isBooting()) { // Bus error is normal if we are booting, it's triggered when we lock OPTCR - asm("mov lr, r12"); - asm("bx lr"); + return; } Bootloader::Recovery::crash_handler("BusFault"); } @@ -65,7 +63,7 @@ bool Boot::isKernelPatched(const Slot & s) { return *(uint32_t *)(origin_isr + sizeof(uint32_t) * 7) == ((uint32_t)&_fake_isr_function_start) + 1; } -__attribute((section(".fake_isr_function"))) __attribute__((used)) void Boot::flash_interrupt() { +__attribute__((section(".fake_isr_function"))) __attribute__((used)) void Boot::flash_interrupt() { // a simple function Ion::Device::Flash::ClearInternalFlashErrors(); asm("bx lr"); @@ -87,14 +85,14 @@ void Boot::patchKernel(const Slot & s) { // data[origin_isr + sizeof(uint32_t) * 5 + 1] = ptr[1]; // data[origin_isr + sizeof(uint32_t) * 5 + 2] = ptr[2]; // data[origin_isr + sizeof(uint32_t) * 5 + 3] = ptr[3]; - + data[origin_isr + sizeof(uint32_t) * 7] = ptr[0]; // UsageFault data[origin_isr + sizeof(uint32_t) * 7 + 1] = ptr[1]; data[origin_isr + sizeof(uint32_t) * 7 + 2] = ptr[2]; data[origin_isr + sizeof(uint32_t) * 7 + 3] = ptr[3]; // data[origin_isr + sizeof(uint32_t) * 4] = ptr[0];//hardfault - // data[origin_isr + sizeof(uint32_t) * 4 + 1] = ptr[1]; + // data[origin_isr + sizeof(uint32_t) * 4 + 1] = ptr[1]; // data[origin_isr + sizeof(uint32_t) * 4 + 2] = ptr[2]; // data[origin_isr + sizeof(uint32_t) * 4 + 3] = ptr[3]; @@ -105,9 +103,9 @@ void Boot::patchKernel(const Slot & s) { void Boot::bootSlot(Bootloader::Slot s) { config()->setSlot(&s); if (!s.userlandHeader()->isOmega() && !s.userlandHeader()->isUpsilon()) { - // We are trying to boot epsilon, so we check the version and show an advertisement if needed + // We are trying to boot epsilon, so we check the version and show a warning if needed const char * version = s.userlandHeader()->version(); - const char * min = "21.3.1"; + const char * min = "24.4.1"; int versionSum = Utility::versionSum(version, strlen(version)); int minimalVersionTrigger = Utility::versionSum(min, strlen(min)); if (versionSum >= minimalVersionTrigger) { diff --git a/bootloader/boot.h b/bootloader/boot.h index 300fb762c..c771e5678 100644 --- a/bootloader/boot.h +++ b/bootloader/boot.h @@ -47,7 +47,7 @@ public: static void bootSlot(Bootloader::Slot slot); static void bootSelectedSlot(); __attribute__ ((noreturn)) static void jumpToInternalBootloader(); - __attribute((section(".fake_isr_function"))) __attribute__((used)) static void flash_interrupt(); + __attribute__ ((section(".fake_isr_function"))) __attribute__((used)) static void flash_interrupt(); static void bootloader(); static void lockInternal(); diff --git a/bootloader/interface/menus/upsilon_recovery.cpp b/bootloader/interface/menus/upsilon_recovery.cpp new file mode 100644 index 000000000..0529bd307 --- /dev/null +++ b/bootloader/interface/menus/upsilon_recovery.cpp @@ -0,0 +1,48 @@ +#include "upsilon_recovery.h" +#include +#include +#include +#include +#include + +extern "C" void jump_to_firmware(const uint32_t* stackPtr, const void(*startPtr)(void)); + +Bootloader::UpsilonRecoveryMenu::UpsilonRecoveryMenu() : Menu(KDColorBlack, KDColorWhite, Messages::upsilonRecoveryTitle, Messages::mainTitle) { + setup(); +} + +void Bootloader::UpsilonRecoveryMenu::setup() { + m_defaultColumns[0] = Column(Messages::upsilonRecoveryMessage1, k_small_font, 0, true); + m_defaultColumns[1] = Column(Messages::upsilonRecoveryMessage2, k_small_font, 0, true); + m_defaultColumns[2] = Column(Messages::upsilonRecoveryMessage3, k_small_font, 0, true); + m_defaultColumns[3] = Column(Messages::upsilonRecoveryMessage4, k_small_font, 0, true); + m_defaultColumns[4] = Column(Messages::upsilonRecoveryMessage5, k_small_font, 0, true); + + m_columns[0] = ColumnBinder(&m_defaultColumns[0]); + m_columns[1] = ColumnBinder(&m_defaultColumns[1]); + m_columns[2] = ColumnBinder(&m_defaultColumns[2]); + m_columns[3] = ColumnBinder(&m_defaultColumns[3]); + m_columns[4] = ColumnBinder(&m_defaultColumns[4]); +} + +void Bootloader::UpsilonRecoveryMenu::postOpen() { + // We override the open method + for (;;) { + uint64_t scan = Ion::Keyboard::scan(); + if (scan == Ion::Keyboard::State(Ion::Keyboard::Key::Back)) { + while (Ion::Keyboard::scan() == Ion::Keyboard::State(Ion::Keyboard::Key::Back)); + forceExit(); + return; + } else if (scan == Ion::Keyboard::State(Ion::Keyboard::Key::OnOff)) { + Ion::Power::suspend(); + return; + } else if (scan == Ion::Keyboard::State(Ion::Keyboard::Key::OK)) { + Slot slot = Slot::Upsilon(); + Ion::Device::Board::bootloaderMPU(); + // Deinitialize the backlight to prevent bugs when the firmware boots + Ion::Backlight::shutdown(); + jump_to_firmware(slot.kernelHeader()->stackPointer(), slot.userlandHeader()->upsilonRecoveryBootFunction()); + for(;;); + } + } +} diff --git a/bootloader/interface/menus/upsilon_recovery.h b/bootloader/interface/menus/upsilon_recovery.h new file mode 100644 index 000000000..90793b6c7 --- /dev/null +++ b/bootloader/interface/menus/upsilon_recovery.h @@ -0,0 +1,15 @@ +#ifndef _BOOTLOADER_INTERFACE_MENUS_UPSILON_RECOVERY_H_ +#define _BOOTLOADER_INTERFACE_MENUS_UPSILON_RECOVERY_H_ + +#include + +namespace Bootloader { + class UpsilonRecoveryMenu : public Menu { + public: + UpsilonRecoveryMenu(); + void setup() override; + void postOpen() override; + }; +} + +#endif diff --git a/bootloader/interface/static/interface.cpp b/bootloader/interface/static/interface.cpp index c0e95db73..18160d1ab 100644 --- a/bootloader/interface/static/interface.cpp +++ b/bootloader/interface/static/interface.cpp @@ -69,7 +69,12 @@ void Interface::drawLoading() { for (uint8_t i = 0; i < strlen(Messages::mainTitle); i++) { char tmp[2] = {Messages::mainTitle[i], '\0'}; ctx->drawString(tmp, KDPoint(initPos + i * (fontSize.width()), ImageStore::Computer->height() + 25 + 10), KDFont::LargeFont, KDColorBlack, KDColorWhite); - Ion::Timing::msleep(50); + + int t = 50; + Ion::Events::Event e = Ion::Events::getEvent(&t); + if (e.isKeyboardEvent()){ + return; + } } Ion::Timing::msleep(500); } diff --git a/bootloader/interface/static/messages.h b/bootloader/interface/static/messages.h index d405846c0..2088e8220 100644 --- a/bootloader/interface/static/messages.h +++ b/bootloader/interface/static/messages.h @@ -53,12 +53,21 @@ public: constexpr static const char * recoveryMessage4 = "Press Back to continue."; constexpr static const char * recoveryMessage5 = "(you will not be able to recover your data !)"; + // Upsilon Recovery menu + constexpr static const char * upsilonRecoveryTitle = "Upsilon Recovery"; + + constexpr static const char * upsilonRecoveryMessage1 = "The bootloader has detected a crash."; + constexpr static const char * upsilonRecoveryMessage2 = "Because you also have an Upsilon slot,"; + constexpr static const char * upsilonRecoveryMessage3 = "you can recover your data by booting"; + constexpr static const char * upsilonRecoveryMessage4 = "the Upsilon slot."; + constexpr static const char * upsilonRecoveryMessage5 = "Press OK to continue, BACK to cancel"; + // Warning menu constexpr static const char * epsilonWarningTitle = "Epsilon Slot"; constexpr static const char * epsilonWarningMessage1 = "!! WARNING !! "; - constexpr static const char * epsilonWarningMessage2 = "This version of Epsilon"; - constexpr static const char * epsilonWarningMessage3 = "can lock the calculator."; + constexpr static const char * epsilonWarningMessage2 = "This version of Epsilon can lock the"; + constexpr static const char * epsilonWarningMessage3 = "calculator or be incompatible."; constexpr static const char * epsilonWarningMessage4 = "Proceed the boot ?"; constexpr static const char * epsilonWarningMessage5 = "EXE - Yes"; constexpr static const char * epsilonWarningMessage6 = "BACK - No"; @@ -72,11 +81,11 @@ public: constexpr static const char * aboutMessage4 = "and select the OS"; constexpr static const char * aboutMessage5 = "to boot."; - constexpr static const char * bootloaderVersion = "Version 1.0.8 - FREED0M.21.3"; + constexpr static const char * bootloaderVersion = "Version 1.1.2 - RECOVER.24.4"; //USB NAMES - constexpr static const char * usbUpsilonBootloader = "Upsilon Bootloader"; - constexpr static const char * usbUpsilonRecovery = "Upsilon Recovery"; + constexpr static const char * usbUpsilonBootloader = "NumWorks Calculator"; + constexpr static const char * usbUpsilonRecovery = "NumWorks Calculator"; constexpr static const char * usbBootloaderUpdate = "Bootloader Update"; }; diff --git a/bootloader/recovery.cpp b/bootloader/recovery.cpp index 8c849f781..1e6174bb1 100644 --- a/bootloader/recovery.cpp +++ b/bootloader/recovery.cpp @@ -1,6 +1,7 @@ #include #include #include +#include #include #include #include @@ -10,6 +11,7 @@ #include #include #include +#include constexpr static uint32_t MagicStorage = 0xEE0BDDBA; @@ -76,7 +78,15 @@ void Bootloader::Recovery::recoverData() { Ion::Display::pushRectUniform(KDRect(0,0,320,240), KDColorWhite); Ion::Backlight::init(); - USBData udata = USBData::Recovery((uint32_t)getSlotConcerned().getStorageAddress(), (uint32_t)getSlotConcerned().getStorageSize()); + CrashedSlot slot = getSlotConcerned(); + + if (Slot::hasUpsilon() && Slot::Upsilon().userlandHeader()->hasUpsilonExtras()) { + Ion::Device::BootloaderSharedData::sharedBootloaderData()->setRecovery((uint32_t)slot.getStorageAddress(), slot.getStorageSize()); + UpsilonRecoveryMenu reco = UpsilonRecoveryMenu(); + reco.open(); + } + + USBData udata = USBData::Recovery((uint32_t)slot.getStorageAddress(), (uint32_t)slot.getStorageSize()); SlotRecoveryMenu menu = SlotRecoveryMenu(&udata); menu.open(); diff --git a/bootloader/slots/slot.cpp b/bootloader/slots/slot.cpp index 2a3cebee2..5175aa45f 100644 --- a/bootloader/slots/slot.cpp +++ b/bootloader/slots/slot.cpp @@ -3,6 +3,8 @@ #include #include #include +#include +#include extern "C" void jump_to_firmware(const uint32_t* stackPtr, const void(*startPtr)(void)); @@ -20,6 +22,15 @@ const Slot Slot::Khi() { return Slot(0x90180000); } +const bool Slot::hasUpsilon() { + return (isFullyValid(A()) && A().userlandHeader()->isUpsilon()) || (isFullyValid(B()) && B().userlandHeader()->isUpsilon()); +} + +const Slot Slot::Upsilon() { + assert(hasUpsilon()); + return (isFullyValid(A()) && A().userlandHeader()->isUpsilon()) ? A() : B(); +} + const KernelHeader* Slot::kernelHeader() const { return m_kernelHeader; } diff --git a/bootloader/slots/slot.h b/bootloader/slots/slot.h index 1d0046605..a0ce406ae 100644 --- a/bootloader/slots/slot.h +++ b/bootloader/slots/slot.h @@ -25,6 +25,8 @@ public: static const Slot A(); static const Slot B(); static const Slot Khi(); + static const bool hasUpsilon(); + static const Slot Upsilon(); static bool isFullyValid(const Slot& slot) { return slot.kernelHeader()->isValid() && slot.userlandHeader()->isValid(); diff --git a/bootloader/slots/slot_exam_mode.cpp b/bootloader/slots/slot_exam_mode.cpp index e532828af..70a776fd4 100644 --- a/bootloader/slots/slot_exam_mode.cpp +++ b/bootloader/slots/slot_exam_mode.cpp @@ -50,11 +50,16 @@ uint8_t SlotsExamMode::FetchSlotExamMode(const char * version, const char * Slot start = getSlotAStartExamAddress(0); end = getSlotAEndExamAddress(0); } - // Else get new addresses - else { + // Else versions before 22 + else if ((version[0] == '2' && version[1] < '2') || (version[0] == '1')) { start = getSlotAStartExamAddress(1); end = getSlotAEndExamAddress(1); } + // Else Epsilon 22 + + else { + start = getSlotAStartExamAddress(2); + end = getSlotAEndExamAddress(2); + } } else if (Slot == "B") { // If version under 16 get old @@ -62,11 +67,16 @@ uint8_t SlotsExamMode::FetchSlotExamMode(const char * version, const char * Slot start = getSlotBStartExamAddress(0); end = getSlotBEndExamAddress(0); } - // Else get new - else { + // Else versions before 22 + else if ((version[0] == '2' && version[1] < '2') || (version[0] == '1')) { start = getSlotBStartExamAddress(1); end = getSlotBEndExamAddress(1); } + // Else Epsilon 22 + + else { + start = getSlotBStartExamAddress(2); + end = getSlotBEndExamAddress(2); + } } else if (Slot == "Khi") { // We directly get the address of the Khi exam mode without checking the // version, because on Khi, version is KhiCAS version, not the OS version @@ -167,42 +177,68 @@ uint8_t SlotsExamMode::examFetch19(uint32_t start, uint32_t end) { } } } + return 0; } uint32_t SlotsExamMode::getSlotAStartExamAddress(int ExamVersion) { if (ExamVersion == 0) { - return SlotAExamModeBufferStartOldVersions; + return SlotAExamModeBufferStartBefore16; } - else { - return SlotAExamModeBufferStartNewVersions; + if (ExamVersion == 1) { + return SlotAExamModeBufferStartEpsilon16; } + if (ExamVersion == 2) { + return SlotAExamModeBufferStartEpsilon22; + } + assert(false); + // Should not happen + return SlotAExamModeBufferStartEpsilon22; } uint32_t SlotsExamMode::getSlotAEndExamAddress(int ExamVersion) { if (ExamVersion == 0) { - return SlotAExamModeBufferEndOldVersions; + return SlotAExamModeBufferEndBefore16; } - else { - return SlotAExamModeBufferEndNewVersions;; + if (ExamVersion == 1) { + return SlotAExamModeBufferEndEpsilon16; } + if (ExamVersion == 2) { + return SlotAExamModeBufferEndEpsilon22; + } + assert(false); + // Should not happen + return SlotAExamModeBufferEndEpsilon22; + } uint32_t SlotsExamMode::getSlotBStartExamAddress(int ExamVersion) { if (ExamVersion == 0) { - return SlotBExamModeBufferStartOldVersions; + return SlotBExamModeBufferStartBeforeEpsilon16; } - else { - return SlotBExamModeBufferStartNewVersions; + if (ExamVersion == 1) { + return SlotBExamModeBufferStartEpsilon16; } + if (ExamVersion == 2) { + return SlotBExamModeBufferStartEpsilon22; + } + assert(false); + // Should not happen + return SlotBExamModeBufferStartEpsilon22; } uint32_t SlotsExamMode::getSlotBEndExamAddress(int ExamVersion) { if (ExamVersion == 0) { - return SlotBExamModeBufferEndOldVersions; + return SlotBExamModeBufferEndBeforeEpsilon16; } - else { - return SlotBExamModeBufferEndNewVersions; + if (ExamVersion == 1) { + return SlotBExamModeBufferEndEpsilon16; } + if (ExamVersion == 2) { + return SlotBExamModeBufferEndEpsilon22; + } + assert(false); + // Should not happen + return SlotBExamModeBufferEndEpsilon22; } uint32_t SlotsExamMode::getSlotKhiStartExamAddress() { diff --git a/bootloader/slots/slot_exam_mode.h b/bootloader/slots/slot_exam_mode.h index 3c19ac7a9..d0f7473d5 100644 --- a/bootloader/slots/slot_exam_mode.h +++ b/bootloader/slots/slot_exam_mode.h @@ -8,17 +8,23 @@ extern "C" { namespace Bootloader { namespace ExamMode { -static const uint32_t SlotAExamModeBufferStartOldVersions = 0x90001000; -static const uint32_t SlotAExamModeBufferEndOldVersions = 0x90003000; +static const uint32_t SlotAExamModeBufferStartBefore16 = 0x90001000; +static const uint32_t SlotAExamModeBufferEndBefore16 = 0x90003000; -static const uint32_t SlotAExamModeBufferStartNewVersions = 0x903f0000; -static const uint32_t SlotAExamModeBufferEndNewVersions = 0x90400000; +static const uint32_t SlotAExamModeBufferStartEpsilon16 = 0x903f0000; +static const uint32_t SlotAExamModeBufferEndEpsilon16 = 0x90400000; -static const uint32_t SlotBExamModeBufferStartOldVersions = 0x90401000; -static const uint32_t SlotBExamModeBufferEndOldVersions = 0x90403000; +static const uint32_t SlotAExamModeBufferStartEpsilon22 = 0x903f0400; +static const uint32_t SlotAExamModeBufferEndEpsilon22 = 0x90400000; -static const uint32_t SlotBExamModeBufferStartNewVersions = 0x907f0000; -static const uint32_t SlotBExamModeBufferEndNewVersions = 0x90800000; +static const uint32_t SlotBExamModeBufferStartBeforeEpsilon16 = 0x90401000; +static const uint32_t SlotBExamModeBufferEndBeforeEpsilon16 = 0x90403000; + +static const uint32_t SlotBExamModeBufferStartEpsilon16 = 0x907f0000; +static const uint32_t SlotBExamModeBufferEndEpsilon16 = 0x90800000; + +static const uint32_t SlotBExamModeBufferStartEpsilon22 = 0x907f0400; +static const uint32_t SlotBExamModeBufferEndEpsilon22 = 0x90800000; static const uint32_t SlotKhiExamModeBufferStart = 0x90181000; static const uint32_t SlotKhiExamModeBufferEnd = 0x90183000; diff --git a/bootloader/slots/userland_header.cpp b/bootloader/slots/userland_header.cpp index a3e57afec..80769e02a 100644 --- a/bootloader/slots/userland_header.cpp +++ b/bootloader/slots/userland_header.cpp @@ -40,4 +40,16 @@ const size_t UserlandHeader::storageSize() const { return m_storageSizeRAM; } +const bool UserlandHeader::hasUpsilonExtras() const { + return m_upsilonExtraMagicHeader == UpsilonExtraMagic && m_upsilonExtraMagicFooter == UpsilonExtraMagic; +} + +const uint32_t UserlandHeader::getExtraVersion() const { + return m_extraVersion; +} + +const void (*UserlandHeader::upsilonRecoveryBootFunction() const)() { + return m_recoveryAddress; +} + } diff --git a/bootloader/slots/userland_header.h b/bootloader/slots/userland_header.h index 382e409b0..85fa64d3b 100644 --- a/bootloader/slots/userland_header.h +++ b/bootloader/slots/userland_header.h @@ -17,12 +17,17 @@ public: const char * upsilonVersion() const; const void * storageAddress() const; const size_t storageSize() const; + const bool hasUpsilonExtras() const; + const void (*upsilonRecoveryBootFunction() const)(); + const uint32_t getExtraVersion() const; + private: UserlandHeader(); constexpr static uint32_t Magic = 0xDEC0EDFE; constexpr static uint32_t OmegaMagic = 0xEFBEADDE; constexpr static uint32_t UpsilonMagic = 0x55707369; + constexpr static uint32_t UpsilonExtraMagic = 0xaa7073ff; uint32_t m_header; const char m_expectedEpsilonVersion[8]; void * m_storageAddressRAM; @@ -42,6 +47,10 @@ private: const char m_UpsilonVersion[16]; uint32_t m_osType; uint32_t m_upsilonMagicFooter; + uint32_t m_upsilonExtraMagicHeader; + const void (*m_recoveryAddress)(); + uint32_t m_extraVersion; + uint32_t m_upsilonExtraMagicFooter; }; extern const UserlandHeader* s_userlandHeaderA; diff --git a/bootloader/trampoline.cpp b/bootloader/trampoline.cpp index 876db0496..56cf2d5e9 100644 --- a/bootloader/trampoline.cpp +++ b/bootloader/trampoline.cpp @@ -10,6 +10,8 @@ namespace Bootloader { void __attribute__((noinline)) suspend() { Ion::Device::Power::internalFlashSuspend(true); + // Restore slotInfo magic header (broken on Epsilon, IDK why) + *(uint8_t *)0x20000000 = 0xBA; } void* Trampolines[TRAMPOLINES_COUNT] diff --git a/build/config.mak b/build/config.mak index cf91239fe..9245ebbe5 100644 --- a/build/config.mak +++ b/build/config.mak @@ -6,7 +6,7 @@ DEBUG ?= 0 HOME_DISPLAY_EXTERNALS ?= 1 EPSILON_VERSION ?= 15.5.0 OMEGA_VERSION ?= 2.0.2 -UPSILON_VERSION ?= 1.0.1-dev +UPSILON_VERSION ?= 1.1.2 # OMEGA_USERNAME ?= N/A OMEGA_STATE ?= dev EPSILON_APPS ?= calculation graph rpn code statistics probability solver atomic sequence regression reader settings external diff --git a/build/device/dfu.py b/build/device/dfu.py index 7245632ad..36df3a029 100644 --- a/build/device/dfu.py +++ b/build/device/dfu.py @@ -79,7 +79,7 @@ __DFU_INTERFACE = 0 # Python 3 deprecated getargspec in favour of getfullargspec, but # Python 2 doesn't have the latter, so detect which one to use import inspect -getargspec = getattr(inspect, 'getfullargspec', inspect.getargspec) +getargspec = getattr(inspect, 'getfullargspec', inspect.getfullargspec) if 'length' in getargspec(usb.util.get_string).args: # PyUSB 1.0.0.b1 has the length argument diff --git a/build/platform.simulator.macos.mak b/build/platform.simulator.macos.mak index dcfeac04b..927d80636 100644 --- a/build/platform.simulator.macos.mak +++ b/build/platform.simulator.macos.mak @@ -5,7 +5,9 @@ APPLE_PLATFORM = macos APPLE_PLATFORM_MIN_VERSION = 10.10 EPSILON_TELEMETRY ?= 0 -ARCHS = x86_64 +# Build universal binary for both x86_64 and ARM64 by default +# Can be overridden with ARCHS=arm64 or ARCHS=x86_64 for single architecture builds +ARCHS ?= x86_64 arm64 ifdef ARCH BUILD_DIR := $(BUILD_DIR)/$(ARCH) diff --git a/build/toolchain.emscripten.mak b/build/toolchain.emscripten.mak index 34aa5715d..551ddbc19 100644 --- a/build/toolchain.emscripten.mak +++ b/build/toolchain.emscripten.mak @@ -26,7 +26,7 @@ EMFLAGS += -Wno-unused-command-line-argument # Configure LDFLAGS EMSCRIPTEN_MODULARIZE ?= 1 -LDFLAGS += -s MODULARIZE=$(EMSCRIPTEN_MODULARIZE) -s 'EXPORT_NAME="Epsilon"' --memory-init-file 0 +LDFLAGS += -s MODULARIZE=$(EMSCRIPTEN_MODULARIZE) -s 'EXPORT_NAME="Epsilon"' SFLAGS += $(EMFLAGS) LDFLAGS += $(EMFLAGS) -Oz -s EXPORTED_RUNTIME_METHODS='["UTF8ToString"]' -s EXPORTED_FUNCTIONS='["_main", "_IonSimulatorKeyboardKeyDown", "_IonSimulatorKeyboardKeyUp", "_IonSimulatorEventsPushEvent", "_IonSoftwareVersion", "_IonPatchLevel", "_IonDisplayForceRefresh"]' diff --git a/escher/src/text_area.cpp b/escher/src/text_area.cpp index 5427ed5b6..c1fd83b39 100644 --- a/escher/src/text_area.cpp +++ b/escher/src/text_area.cpp @@ -4,6 +4,7 @@ #include #include #include +#include <../../apps/global_preferences.h> #include #include @@ -249,11 +250,13 @@ bool TextArea::handleEvent(Ion::Events::Event event) { contentView()->resetSelection(); contentView()->moveCursorGeo(0, event == Ion::Events::Up ? -step : step); } else if (event == Ion::Events::Clear) { - if (!contentView()->selectionIsEmpty()) { - deleteSelection(); - return true; - } else if (!contentView()->removeEndOfLine()) { - contentView()->removeStartOfLine(); + if (GlobalPreferences::sharedGlobalPreferences()->clearShift()) { + if (!contentView()->selectionIsEmpty()) { + deleteSelection(); + return true; + } else if (!contentView()->removeEndOfLine()) { + contentView()->removeStartOfLine(); + } } } else if (event == Ion::Events::Paste) { return handleEventWithText(Clipboard::sharedClipboard()->storedText()); diff --git a/ion/include/ion/internal_storage.h b/ion/include/ion/internal_storage.h index 026ae5dc0..29371b320 100644 --- a/ion/include/ion/internal_storage.h +++ b/ion/include/ion/internal_storage.h @@ -25,7 +25,7 @@ public: #ifdef _FXCG constexpr static size_t k_storageSize = 65500; #else - constexpr static size_t k_storageSize = 60000; + constexpr static size_t k_storageSize = 59992; #endif static_assert(UINT16_MAX >= k_storageSize, "record_size_t not big enough"); diff --git a/ion/src/device/bootloader/Makefile b/ion/src/device/bootloader/Makefile index c5d7208f7..93a6f6536 100644 --- a/ion/src/device/bootloader/Makefile +++ b/ion/src/device/bootloader/Makefile @@ -3,6 +3,7 @@ ion_device_src += $(addprefix ion/src/device/bootloader/drivers/, \ board.cpp \ cache.cpp \ external_flash_tramp.cpp \ + storage.cpp \ led.cpp \ power.cpp \ reset.cpp \ diff --git a/ion/src/device/bootloader/boot/rt0.cpp b/ion/src/device/bootloader/boot/rt0.cpp index a631356bb..1e12db275 100644 --- a/ion/src/device/bootloader/boot/rt0.cpp +++ b/ion/src/device/bootloader/boot/rt0.cpp @@ -1,11 +1,15 @@ #include #include #include +#include +#include +#include #include #include #include #include #include +#include typedef void (*cxx_constructor)(); @@ -14,6 +18,8 @@ extern "C" { extern char _data_section_start_ram; extern char _data_section_end_ram; extern char _bss_section_start_ram; + extern char _static_storage_start; + extern char _static_storage_end; extern char _bss_section_end_ram; extern cxx_constructor _init_array_start; extern cxx_constructor _init_array_end; @@ -129,6 +135,43 @@ void __attribute__((noinline)) start() { abort(); } +void __attribute__((noinline)) __attribute__((section(".recovery_boot"))) __attribute__((used)) recovery_start() { + // Here we are in the recovery boot. + Ion::Device::Board::initFPU(); + + bool is_recoverying = Ion::Device::BootloaderSharedData::sharedBootloaderData()->storageAddress() != 0; + + if (is_recoverying) { + uint32_t address = Ion::Device::BootloaderSharedData::sharedBootloaderData()->storageAddress(); + uint32_t size = Ion::Device::BootloaderSharedData::sharedBootloaderData()->storageSize(); + + memcpy(&_static_storage_start, (void*)address, size); + + size_t dataSectionLength = (&_data_section_end_ram - &_data_section_start_ram); + memcpy(&_data_section_start_ram, &_data_section_start_flash, dataSectionLength); + + size_t bssSectionLength = (&_bss_section_end_ram - &_static_storage_end); + memset(&_static_storage_end, 0, bssSectionLength); + } else { + size_t dataSectionLength = (&_data_section_end_ram - &_data_section_start_ram); + memcpy(&_data_section_start_ram, &_data_section_start_flash, dataSectionLength); + size_t bssSectionLength = (&_bss_section_end_ram - &_bss_section_start_ram); + memset(&_bss_section_start_ram, 0, bssSectionLength); + } + + if (&_init_array_start != &_init_array_end) { + abort(); + } + size_t isrSectionLength = (&_isr_vector_table_end_ram - &_isr_vector_table_start_ram); + memcpy(&_isr_vector_table_start_ram, &_isr_vector_table_start_flash, isrSectionLength); + + Ion::Device::Board::init(); + + jump_to_external_flash(); + + abort(); +} + void __attribute__((interrupt, noinline)) isr_systick() { auto t = Ion::Device::Timing::MillisElapsed; t++; diff --git a/ion/src/device/bootloader/bootloader_common.ld b/ion/src/device/bootloader/bootloader_common.ld index e8f0c9bbc..5f2db3750 100644 --- a/ion/src/device/bootloader/bootloader_common.ld +++ b/ion/src/device/bootloader/bootloader_common.ld @@ -1,3 +1,4 @@ +BOOTLOADER_SHARED_OFFSET = 0x3d0; SECTIONS { .signed_payload_prefix ORIGIN(FLASH) : { @@ -34,7 +35,14 @@ SECTIONS { _isr_vector_table_end_ram = .; } >SRAM - .exam_mode_buffer ORIGIN(FLASH) + SIZEOF(.signed_payload_prefix) + SIZEOF(.kernel_header) + SIZEOF(.isr_vector_table) : { + .bootloader_shared ORIGIN(SRAM) + BOOTLOADER_SHARED_OFFSET : AT(ORIGIN(FLASH) + SIZEOF(.signed_payload_prefix) + SIZEOF(.kernel_header) + SIZEOF(.isr_vector_table) + SIZEOF(.slot_info)) { + _bootloader_shared_start = .; + KEEP(*(.bootloader_shared)) + KEEP(*(.bootloader_shared.*)) + _bootloader_shared_end = .; + } >SRAM + + .exam_mode_buffer ORIGIN(FLASH) + SIZEOF(.signed_payload_prefix) + SIZEOF(.kernel_header) + SIZEOF(.isr_vector_table) + SIZEOF(.bootloader_shared) + SIZEOF(.slot_info) : { . = ALIGN(4K); _exam_mode_buffer_start = .; KEEP(*(.exam_mode_buffer)) @@ -49,6 +57,13 @@ SECTIONS { KEEP(*(.userland_header)); } > FLASH + .recovery_boot : { + . = ALIGN(4); + _recovery_boot_start = .; + KEEP(*(.recovery_boot)); + _recovery_boot_end = .; + } >FLASH + .text : { . = ALIGN(4); *(.text) @@ -97,6 +112,9 @@ SECTIONS { * need pointers to the beginning and end of this section. */ . = ALIGN(4); _bss_section_start_ram = .; + _static_storage_start = .; + KEEP (*(.static_storage)) + _static_storage_end = .; *(.bss) *(.bss.*) /* The compiler may choose to allocate uninitialized global variables as diff --git a/ion/src/device/bootloader/drivers/storage.cpp b/ion/src/device/bootloader/drivers/storage.cpp new file mode 100644 index 000000000..f04b0793d --- /dev/null +++ b/ion/src/device/bootloader/drivers/storage.cpp @@ -0,0 +1,10 @@ +#include + +namespace Ion { + +// TODO: Check if the storage is initialized at runtime and not at compile time: +// As far as I can see, it break build for N0110 legacy internal storage and +// N0100 due to lack of storage, so it's probably wasting space. +uint32_t __attribute__((section(".static_storage"))) staticStorageArea[sizeof(Storage)/sizeof(uint32_t)] = {0}; + +} diff --git a/ion/src/device/bootloader/internal_flash.ld b/ion/src/device/bootloader/internal_flash.ld index 6a2555c35..2f5cf3189 100644 --- a/ion/src/device/bootloader/internal_flash.ld +++ b/ion/src/device/bootloader/internal_flash.ld @@ -8,6 +8,7 @@ MEMORY { STACK_SIZE = 32K; TRAMPOLINES_OFFSET = 0xE000; CUSTOM_TRAMPOLINES_OFFSET = 64K - 64; +BOOTLOADER_SHARED_OFFSET = 0x3d0; SECTIONS { .isr_vector_table ORIGIN(INTERNAL_FLASH) : { @@ -31,7 +32,16 @@ SECTIONS { KEEP(*(.header)) } >INTERNAL_FLASH - .rodata : { + .bootloader_shared ORIGIN(SRAM) + BOOTLOADER_SHARED_OFFSET : AT(ORIGIN(INTERNAL_FLASH) + SIZEOF(.isr_vector_table) + SIZEOF(.header)) { + . = ORIGIN(SRAM) + BOOTLOADER_SHARED_OFFSET; + _bootloader_shared_start = .; + KEEP(*(.bootloader_shared)) + KEEP(*(.bootloader_shared.*)) + _bootloader_shared_end = .; + } >SRAM + + .rodata ORIGIN(INTERNAL_FLASH) + SIZEOF(.isr_vector_table) + SIZEOF(.header) + SIZEOF(.bootloader_shared) : { + . = ALIGN(4); *(.rodata) *(.rodata.*) diff --git a/ion/src/device/bootloader/platform_info.cpp b/ion/src/device/bootloader/platform_info.cpp index 3b08c1860..8ca190a0d 100644 --- a/ion/src/device/bootloader/platform_info.cpp +++ b/ion/src/device/bootloader/platform_info.cpp @@ -17,10 +17,15 @@ #error This file expects UPSILON_VERSION to be defined #endif +extern "C" { + extern void recovery_start(); +} namespace Ion { extern char staticStorageArea[]; } constexpr void * storageAddress = &(Ion::staticStorageArea); +typedef void (*recoveryStartPointerType)(); +constexpr recoveryStartPointerType recoveryStartPointer = &(recovery_start); class KernelHeader { public: @@ -72,7 +77,16 @@ public: m_upsilonMagicHeader(UpsilonMagic), m_UpsilonVersion{UPSILON_VERSION}, m_osType(OSType), - m_upsilonMagicFooter(UpsilonMagic) { } + m_upsilonMagicFooter(UpsilonMagic), + m_upsilonExtraMagicHeader(UpsilonExtraMagic), + // We need to be careful with the pointer to the recovery entrypoint as GCC + // will simply generate a blank userland header if it wasn't able to + // generate it. This code used to work on GCC 12, but is broken since GCC 13 + // probably due to the cast preventing LD to just copy the address: + // m_recoveryAddress((uint32_t)recovery_start + 1), + m_recoveryAddress(recoveryStartPointer), + m_extraVersion(1), + m_upsilonExtraMagicFooter(UpsilonExtraMagic) { } const char * omegaVersion() const { assert(m_storageAddressRAM != nullptr); @@ -109,6 +123,7 @@ private: constexpr static uint32_t OmegaMagic = 0xEFBEADDE; constexpr static uint32_t UpsilonMagic = 0x55707369; constexpr static uint32_t OSType = 0x79827178; + constexpr static uint32_t UpsilonExtraMagic = 0xaa7073ff; uint32_t m_header; const char m_expectedEpsilonVersion[8]; void * m_storageAddressRAM; @@ -128,6 +143,10 @@ private: const char m_UpsilonVersion[16]; uint32_t m_osType; uint32_t m_upsilonMagicFooter; + uint32_t m_upsilonExtraMagicHeader; + recoveryStartPointerType m_recoveryAddress; + uint32_t m_extraVersion; + uint32_t m_upsilonExtraMagicFooter; }; const UserlandHeader __attribute__((section(".userland_header"), used)) k_userlandHeader; diff --git a/ion/src/device/n0110/flash.ld b/ion/src/device/n0110/flash.ld index eb5578ac6..e00ce31e1 100644 --- a/ion/src/device/n0110/flash.ld +++ b/ion/src/device/n0110/flash.ld @@ -71,6 +71,7 @@ SECTIONS { *(.text.__assert) *(.text.memcpy) *(.text.memset) + *(.text.__udivmoddi4) /* *(.text.strlen) *(.text.strncmp) diff --git a/ion/src/device/shared/boot/isr.h b/ion/src/device/shared/boot/isr.h index ca5becb13..474522699 100644 --- a/ion/src/device/shared/boot/isr.h +++ b/ion/src/device/shared/boot/isr.h @@ -8,6 +8,7 @@ extern "C" { void start(); void abort(); void isr_systick(); +void recovery_start(); #ifdef __cplusplus } diff --git a/ion/src/device/shared/drivers/Makefile b/ion/src/device/shared/drivers/Makefile index 2db043c5f..0ec24eca3 100644 --- a/ion/src/device/shared/drivers/Makefile +++ b/ion/src/device/shared/drivers/Makefile @@ -26,4 +26,5 @@ ion_device_src += $(addprefix ion/src/device/shared/drivers/, \ timing.cpp \ usb.cpp \ wakeup.cpp \ + bldata.cpp \ ) diff --git a/ion/src/device/shared/drivers/bldata.cpp b/ion/src/device/shared/drivers/bldata.cpp new file mode 100644 index 000000000..f329224bf --- /dev/null +++ b/ion/src/device/shared/drivers/bldata.cpp @@ -0,0 +1,23 @@ +#include "bldata.h" +#include +#include + +namespace Ion { + uint32_t staticSharedData[sizeof(Ion::Device::BootloaderSharedData)/sizeof(uint32_t)] __attribute__((section(".bootloader_shared"))) __attribute__((used)) = {0}; + + Device::BootloaderSharedData * Device::BootloaderSharedData::sharedBootloaderData() { + static BootloaderSharedData * sharedData = new (staticSharedData) BootloaderSharedData(); + return sharedData; + } + + Device::BootloaderSharedData::BootloaderSharedData() { + // FIXME: Find why calculator is crashing when footer is defined + // if (m_header != Magic || m_footer != Magic) { + if (m_header != Magic) { + m_header = Magic; + m_storageAddress = 0; + m_storageSize = 0; + // m_footer = Magic; + } + } +} diff --git a/ion/src/device/shared/drivers/bldata.h b/ion/src/device/shared/drivers/bldata.h new file mode 100644 index 000000000..97d563144 --- /dev/null +++ b/ion/src/device/shared/drivers/bldata.h @@ -0,0 +1,24 @@ +#include + +namespace Ion +{ +namespace Device +{ + class BootloaderSharedData { + public: + constexpr static uint32_t Magic = 0x626C6461; + static BootloaderSharedData * sharedBootloaderData(); + + BootloaderSharedData(); + + void setRecovery(uint32_t address, uint32_t size) { m_storageAddress = address; m_storageSize = size; } + uint32_t storageAddress() const { return m_storageAddress; } + uint32_t storageSize() const { return m_storageSize; } + private: + uint32_t m_header; + uint32_t m_storageAddress; + uint32_t m_storageSize; + // uint32_t m_footer; + }; +} +} diff --git a/ion/src/device/shared/ram.ld b/ion/src/device/shared/ram.ld index ef027f3e0..0c57f5089 100644 --- a/ion/src/device/shared/ram.ld +++ b/ion/src/device/shared/ram.ld @@ -23,10 +23,10 @@ MEMORY { * overwritten (for instance, vtables that live in the .rodata section). */ /* The image is quite large too! - * So we put the stack to 18K so there's still space + * So we put the stack to 17K so there's still space * for our image, if not LD will throw an error. */ -STACK_SIZE = 18K; +STACK_SIZE = 17K; SECTIONS { .isr_vector_table ORIGIN(RAM_BUFFER) : { diff --git a/ion/src/device/shared/regs/syscfg.h b/ion/src/device/shared/regs/syscfg.h index e044a65f6..7423b88f4 100644 --- a/ion/src/device/shared/regs/syscfg.h +++ b/ion/src/device/shared/regs/syscfg.h @@ -2,7 +2,7 @@ #define REGS_SYSCFG_H #include "register.h" -#include +// #include #include "gpio.h" #define REGS_SYSCFG_CONFIG_F412 1 diff --git a/ion/src/device/shared/usb/calculator.h b/ion/src/device/shared/usb/calculator.h index 97c5f1281..e411aac04 100644 --- a/ion/src/device/shared/usb/calculator.h +++ b/ion/src/device/shared/usb/calculator.h @@ -63,7 +63,7 @@ public: * switching to DFU mode. It does not apply to the calculator.*/ 2048, // wTransferSize: Maximum number of bytes that the device can accept per control-write transaction 0x0100),// bcdDFUVersion - m_interfaceDescriptor( + m_interfaceDescriptor1( 0, // bInterfaceNumber k_dfuInterfaceAlternateSetting, // bAlternateSetting 0, // bNumEndpoints: Other than endpoint 0 @@ -71,9 +71,20 @@ public: 1, // bInterfaceSubClass: DFU 2, // bInterfaceProtocol: DFU Mode (not DFU Runtime, which would be 1) 4, // iInterface: Index of the Interface string, see m_descriptor + &m_interfaceDescriptor2), + m_interfaceDescriptor2( + 0, // bInterfaceNumber + k_dfuInterfaceAlternateSetting + 1, // bAlternateSetting + 0, // bNumEndpoints: Other than endpoint 0 + 0xFE, // bInterfaceClass: DFU (https://www.usb.org/defined-class-codes) + 1, // bInterfaceSubClass: DFU + 2, // bInterfaceProtocol: DFU Mode (not DFU Runtime, which would be 1) + // TODO: Use real descriptor, not required for now as the descriptor isn't + // used anywhere in DFU firmware, but is only present so NumWorks website work. + 4, // iInterface: Index of the Interface string, see m_descriptor &m_dfuFunctionalDescriptor), m_configurationDescriptor( - 9 + 9 + 9, // wTotalLength: configuration descriptor + interface descriptor + dfu functional descriptor lengths + 9 + 9 + 9 + 9, // wTotalLength: configuration descriptor + interface descriptor 1 + interface descriptor 2 + dfu functional descriptor lengths2 1, // bNumInterfaces k_bConfigurationValue, // bConfigurationValue 0, // iConfiguration: No string descriptor for the configuration @@ -83,7 +94,7 @@ public: * Bit 5: Remote Wakeup (allows the device to wake up the host when the host is in suspend) * Bit 4..0: Reserved, set to 0 */ 0x32, // bMaxPower: half of the Maximum Power Consumption - &m_interfaceDescriptor), + &m_interfaceDescriptor1), m_webUSBPlatformDescriptor( k_webUSBVendorCode, k_webUSBLandingPageIndex), @@ -99,6 +110,9 @@ public: //m_interfaceStringDescriptor("@SRAM/0x20000000/01*256Ke"), /* Switch to this descriptor to use dfu-util to write in the SRAM. * FIXME Should be an alternate Interface. */ + // Epsilon 25.6.0 descriptors for example + // @SRAM/0x20000000/01*252Ke + // @Flash/0x90030000/61*064Kg,64*064Kg m_microsoftOSStringDescriptor(k_microsoftOSVendorCode), m_workshopURLDescriptor(URLDescriptor::Scheme::HTTPS, "getupsilon.web.app"), m_extendedCompatIdDescriptor("WINUSB"), @@ -141,7 +155,8 @@ private: // Descriptors DeviceDescriptor m_deviceDescriptor; DFUFunctionalDescriptor m_dfuFunctionalDescriptor; - InterfaceDescriptor m_interfaceDescriptor; + InterfaceDescriptor m_interfaceDescriptor1; + InterfaceDescriptor m_interfaceDescriptor2; ConfigurationDescriptor m_configurationDescriptor; WebUSBPlatformDescriptor m_webUSBPlatformDescriptor; BOSDescriptor m_bosDescriptor; diff --git a/ion/src/shared/events_keyboard.cpp b/ion/src/shared/events_keyboard.cpp index 6d281c482..3fe943fd2 100644 --- a/ion/src/shared/events_keyboard.cpp +++ b/ion/src/shared/events_keyboard.cpp @@ -51,10 +51,6 @@ void resetLongRepetition() { ComputeAndSetRepetitionFactor(sEventRepetitionCount); } -static Keyboard::Key keyFromState(Keyboard::State state) { - return static_cast(63 - __builtin_clzll(state)); -} - static inline Event innerGetEvent(int * timeout) { assert(*timeout > delayBeforeRepeat); assert(*timeout > delayBetweenRepeat); @@ -96,7 +92,7 @@ static inline Event innerGetEvent(int * timeout) { } bool lock = isLockActive(); - + if ( key == Keyboard::Key::Left || key == Keyboard::Key::Right || key == Keyboard::Key::Up @@ -108,7 +104,7 @@ static inline Event innerGetEvent(int * timeout) { // shift = false; } } - + Event event(key, shift, alpha, lock); sLastEventShift = shift; sLastEventAlpha = alpha; diff --git a/ion/src/shared/internal_storage.cpp b/ion/src/shared/internal_storage.cpp index 5fc4a90d1..82373da6f 100644 --- a/ion/src/shared/internal_storage.cpp +++ b/ion/src/shared/internal_storage.cpp @@ -336,18 +336,14 @@ void InternalStorage::destroyRecordsWithExtension(const char * extension) { } } -InternalStorage::InternalStorage() : - m_magicHeader(Magic), - m_buffer(), - m_magicFooter(Magic), - m_delegate(nullptr), - m_lastRecordRetrieved(nullptr), - m_lastRecordRetrievedPointer(nullptr) -{ +InternalStorage::InternalStorage() { + m_magicHeader = Magic; + m_magicFooter = Magic; + m_delegate = nullptr; + m_lastRecordRetrieved = nullptr; + m_lastRecordRetrievedPointer = nullptr; assert(m_magicHeader == Magic); assert(m_magicFooter == Magic); - // Set the size of the first record to 0 - overrideSizeAtPosition(m_buffer, 0); } // PRIVATE diff --git a/ion/src/shared/storage.cpp b/ion/src/shared/storage.cpp index 50a8a4c70..ebc2dc8d2 100644 --- a/ion/src/shared/storage.cpp +++ b/ion/src/shared/storage.cpp @@ -6,7 +6,9 @@ namespace Ion { -uint32_t staticStorageArea[sizeof(Storage)/sizeof(uint32_t)] = {0}; +// Declaration for N0110 with bootloader is in ion/src/device/bootloader/drivers/storage.cpp +// to fix LD build +__attribute__((weak)) uint32_t staticStorageArea[sizeof(Storage)/sizeof(uint32_t)] = {0}; Storage * Storage::sharedStorage() { static Storage * storage = new (staticStorageArea) Storage(); diff --git a/ion/src/simulator/android/Makefile b/ion/src/simulator/android/Makefile index 0af9abb97..154280005 100644 --- a/ion/src/simulator/android/Makefile +++ b/ion/src/simulator/android/Makefile @@ -30,9 +30,13 @@ ifndef ARCH $(BUILD_DIR)/app/res/mipmap/ic_launcher.png: ion/src/simulator/assets/logo.svg | $$(@D)/. $(call rule_label,CONVERT) - $(Q) convert -background "#b1403b" $< $@ + $(Q) convert -background "#5c83ab" $< $@ $(BUILD_DIR)/app/res/mipmap-v26/ic_launcher_foreground.png: ion/src/simulator/assets/logo.svg | $$(@D)/. + $(call rule_label,CONVERT) + $(Q) convert -background none $< -resize 694x694 -gravity center -background none -extent 1024x1024 $@ + +$(BUILD_DIR)/app/res/mipmap-v26/ic_launcher_monochrome.png: ion/src/simulator/assets/logo_monochrome.svg | $$(@D)/. $(call rule_label,CONVERT) $(Q) convert -background none $< -resize 1024x1024 -gravity center -background none -extent 1024x1024 $@ @@ -58,13 +62,13 @@ $(foreach ARCH,$(ARCHS),$(eval $(call rule_for_arch_jni_lib,$(ARCH)))) apk_deps = $(foreach ARCH,$(ARCHS),$(call path_for_arch_jni_lib,$(ARCH))) apk_deps += $(subst ion/src/simulator/android/src/res,$(BUILD_DIR)/app/res,$(wildcard ion/src/simulator/android/src/res/*/*)) -apk_deps += $(addprefix $(BUILD_DIR)/app/res/,mipmap/ic_launcher.png mipmap-v26/ic_launcher_foreground.png) +apk_deps += $(addprefix $(BUILD_DIR)/app/res/,mipmap/ic_launcher.png mipmap-v26/ic_launcher_foreground.png mipmap-v26/ic_launcher_monochrome.png) .PRECIOUS: $(apk_deps) $(BUILD_DIR)/%.apk: $(apk_deps) $(call rule_label,GRADLE) - $(Q) ANDROID_HOME=$(ANDROID_HOME) EPSILON_VERSION=$(EPSILON_VERSION) OMEGA_VERSION=$(OMEGA_VERSION) BUILD_DIR=$(BUILD_DIR) EPSILON_VARIANT=$* ion/src/simulator/android/gradlew -b ion/src/simulator/android/build.gradle assembleRelease + $(Q) ANDROID_HOME=$(ANDROID_HOME) UPSILON_VERSION=$(UPSILON_VERSION) BUILD_DIR=$(BUILD_DIR) EPSILON_VARIANT=$* ion/src/simulator/android/gradlew -p ion/src/simulator/android assembleRelease --warning-mode all $(Q) cp $(BUILD_DIR)/app/outputs/apk/release/android-release*.apk $@ endif diff --git a/ion/src/simulator/android/build.gradle b/ion/src/simulator/android/build.gradle index c2e36530e..d432f5c76 100644 --- a/ion/src/simulator/android/build.gradle +++ b/ion/src/simulator/android/build.gradle @@ -12,18 +12,17 @@ def fileIfPath(path) { buildscript { repositories { - jcenter() + mavenCentral() google() } dependencies { - classpath 'com.android.tools.build:gradle:3.2.0' - classpath 'com.google.gms:google-services:4.2.0' + classpath 'com.android.tools.build:gradle:8.8.1' } } allprojects { repositories { - jcenter() + mavenCentral() google() } buildDir = BUILD_DIR @@ -32,14 +31,15 @@ allprojects { apply plugin: 'com.android.application' android { - compileSdkVersion 29 + namespace = "io.github.upsilon.simulator" + compileSdkVersion 35 defaultConfig { - applicationId "io.github.omega.simulator" - minSdkVersion 16 - targetSdkVersion 29 - def (major, minor, patch) = System.getenv('OMEGA_VERSION').toLowerCase().tokenize('.').collect{it.toInteger()} - versionCode major*1000000 + minor*10000 + patch * 100 - versionName System.getenv('OMEGA_VERSION') + applicationId "io.github.upsilon.simulator" + minSdkVersion 21 + targetSdkVersion 33 + def d=new Date() + versionCode Instant.now().getEpochSecond().toInteger() + versionName LocalDate.now().format("yyyyMMdd")+'-'+System.getenv('UPSILON_VERSION') } signingConfigs { environment { @@ -54,9 +54,9 @@ android { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt') if (projectVariable('SIGNING_STORE_FILE')) { - signingConfig signingConfigs.environment + signingConfig = signingConfigs.environment } else { - signingConfig signingConfigs.debug + signingConfig = signingConfigs.debug } } } @@ -70,13 +70,15 @@ android { } } lintOptions { - abortOnError false - checkReleaseBuilds false + abortOnError = false + checkReleaseBuilds = false } } dependencies { implementation fileTree(include: ['*.jar'], dir: 'libs') - implementation "androidx.appcompat:appcompat:1.0.2" - implementation "com.google.android.gms:play-services-analytics:16.0.7" + implementation "androidx.appcompat:appcompat:1.7.0" + implementation(platform("org.jetbrains.kotlin:kotlin-bom:2.1.10")) } + +java{toolchain{languageVersion=JavaLanguageVersion.of(21)}} diff --git a/ion/src/simulator/android/gradle/wrapper/gradle-wrapper.properties b/ion/src/simulator/android/gradle/wrapper/gradle-wrapper.properties index 44e7c4d1d..58abf278a 100644 --- a/ion/src/simulator/android/gradle/wrapper/gradle-wrapper.properties +++ b/ion/src/simulator/android/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-5.2.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.12.1-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists + diff --git a/ion/src/simulator/android/src/AndroidManifest.xml b/ion/src/simulator/android/src/AndroidManifest.xml index 061134649..45e5a672b 100644 --- a/ion/src/simulator/android/src/AndroidManifest.xml +++ b/ion/src/simulator/android/src/AndroidManifest.xml @@ -1,16 +1,15 @@ - + - - + + - diff --git a/ion/src/simulator/android/src/cpp/haptics_enabled.cpp b/ion/src/simulator/android/src/cpp/haptics_enabled.cpp index 52a8b5480..3dacea1c5 100644 --- a/ion/src/simulator/android/src/cpp/haptics_enabled.cpp +++ b/ion/src/simulator/android/src/cpp/haptics_enabled.cpp @@ -10,7 +10,7 @@ namespace Haptics { bool isEnabled() { JNIEnv * env = static_cast(SDL_AndroidGetJNIEnv()); jobject activity = static_cast(SDL_AndroidGetActivity()); - jclass j_class = env->FindClass("io/github/omega/simulator/OmegaActivity"); + jclass j_class = env->FindClass("io/github/upsilon/simulator/UpsilonActivity"); jmethodID j_methodId = env->GetMethodID(j_class,"hapticFeedbackIsEnabled", "()Z"); assert(j_methodId != 0); bool result = (env->CallBooleanMethod(activity, j_methodId) != JNI_FALSE); diff --git a/ion/src/simulator/android/src/cpp/platform_images.cpp b/ion/src/simulator/android/src/cpp/platform_images.cpp index 86ed18060..5a5535bec 100644 --- a/ion/src/simulator/android/src/cpp/platform_images.cpp +++ b/ion/src/simulator/android/src/cpp/platform_images.cpp @@ -12,7 +12,7 @@ SDL_Texture * loadImage(SDL_Renderer * renderer, const char * identifier) { JNIEnv * env = static_cast(SDL_AndroidGetJNIEnv()); jobject activity = static_cast(SDL_AndroidGetActivity()); - jclass j_class = env->FindClass("io/github/omega/simulator/OmegaActivity"); + jclass j_class = env->FindClass("io/github/upsilon/simulator/UpsilonActivity"); jmethodID j_methodId = env->GetMethodID( j_class, "retrieveBitmapAsset", diff --git a/ion/src/simulator/android/src/cpp/platform_language.cpp b/ion/src/simulator/android/src/cpp/platform_language.cpp index 7aa29c2ee..6d1b3ed1f 100644 --- a/ion/src/simulator/android/src/cpp/platform_language.cpp +++ b/ion/src/simulator/android/src/cpp/platform_language.cpp @@ -12,7 +12,7 @@ const char * languageCode() { JNIEnv * env = static_cast(SDL_AndroidGetJNIEnv()); jobject activity = static_cast(SDL_AndroidGetActivity()); - jclass j_class = env->FindClass("io/github/omega/simulator/OmegaActivity"); + jclass j_class = env->FindClass("io/github/upsilon/simulator/UpsilonActivity"); jmethodID j_methodId = env->GetMethodID( j_class, "retrieveLanguage", diff --git a/ion/src/simulator/android/src/java/io/github/omega/simulator/OmegaActivity.java b/ion/src/simulator/android/src/java/io/github/upsilon/simulator/UpsilonActivity.java similarity index 88% rename from ion/src/simulator/android/src/java/io/github/omega/simulator/OmegaActivity.java rename to ion/src/simulator/android/src/java/io/github/upsilon/simulator/UpsilonActivity.java index 317847f3a..7b1a9c53b 100644 --- a/ion/src/simulator/android/src/java/io/github/omega/simulator/OmegaActivity.java +++ b/ion/src/simulator/android/src/java/io/github/upsilon/simulator/UpsilonActivity.java @@ -1,4 +1,4 @@ -package io.github.omega.simulator; +package io.github.upsilon.simulator; import java.util.Locale; @@ -11,14 +11,10 @@ import android.os.Bundle; import android.provider.Settings; import android.util.Log; -import com.google.android.gms.analytics.GoogleAnalytics; -import com.google.android.gms.analytics.Tracker; -import com.google.android.gms.analytics.HitBuilders; - import org.libsdl.app.SDLActivity; import org.libsdl.app.SDL; -public class OmegaActivity extends SDLActivity { +public class UpsilonActivity extends SDLActivity { protected String[] getLibraries() { return new String[] { "epsilon" diff --git a/ion/src/simulator/android/src/res/mipmap-v26/ic_launcher.xml b/ion/src/simulator/android/src/res/mipmap-v26/ic_launcher.xml index 166130012..8b5c4f9f6 100644 --- a/ion/src/simulator/android/src/res/mipmap-v26/ic_launcher.xml +++ b/ion/src/simulator/android/src/res/mipmap-v26/ic_launcher.xml @@ -1,5 +1,6 @@ - + + diff --git a/ion/src/simulator/android/src/res/values/colors.xml b/ion/src/simulator/android/src/res/values/colors.xml deleted file mode 100644 index e59207b60..000000000 --- a/ion/src/simulator/android/src/res/values/colors.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - #C03535 - #F7F7F7 - diff --git a/ion/src/simulator/android/src/res/values/styles.xml b/ion/src/simulator/android/src/res/values/resources.xml similarity index 77% rename from ion/src/simulator/android/src/res/values/styles.xml rename to ion/src/simulator/android/src/res/values/resources.xml index b787ddffb..d5a665be2 100644 --- a/ion/src/simulator/android/src/res/values/styles.xml +++ b/ion/src/simulator/android/src/res/values/resources.xml @@ -1,8 +1,10 @@ + Upsilon + #5c83ab