mirror of
https://github.com/LNH-team/pico-launcher.git
synced 2026-06-02 09:06:54 +02:00
Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d76d46ea73 | ||
|
|
e4c2fafa74 | ||
|
|
e2a8a540e9 | ||
|
|
17d8e3b4f8 | ||
|
|
9863dbf631 | ||
|
|
c77bf774d4 |
8
.github/workflows/nightly.yml
vendored
8
.github/workflows/nightly.yml
vendored
@@ -14,12 +14,8 @@ on:
|
||||
jobs:
|
||||
pico_launcher:
|
||||
runs-on: ubuntu-latest
|
||||
container: skylyrac/blocksds:slim-v1.13.1
|
||||
container: skylyrac/blocksds:slim-v1.16.0
|
||||
name: Build Pico Launcher
|
||||
env:
|
||||
DOTNET_CLI_TELEMETRY_OPTOUT: 1
|
||||
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
|
||||
DOTNET_SYSTEM_GLOBALIZATION_INVARIANT: 1
|
||||
steps:
|
||||
- name: Checkout repo
|
||||
uses: actions/checkout@v4
|
||||
@@ -34,4 +30,4 @@ jobs:
|
||||
path: |
|
||||
_pico/
|
||||
LAUNCHER.nds
|
||||
name: Pico Launcher
|
||||
name: Pico_Launcher
|
||||
|
||||
39
.github/workflows/release.yml
vendored
Normal file
39
.github/workflows/release.yml
vendored
Normal file
@@ -0,0 +1,39 @@
|
||||
name: Build Pico Launcher release
|
||||
|
||||
on:
|
||||
release:
|
||||
types: [published]
|
||||
|
||||
jobs:
|
||||
pico_launcher:
|
||||
runs-on: ubuntu-latest
|
||||
container: skylyrac/blocksds:slim-v1.16.0
|
||||
name: Build Pico Launcher
|
||||
steps:
|
||||
- name: Checkout repo
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
submodules: true
|
||||
- name: Install zip
|
||||
run:
|
||||
apt-get update && apt-get -y install zip
|
||||
- name: Run build script
|
||||
run: |
|
||||
make
|
||||
- name: Publish build to GH Actions
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
path: |
|
||||
_pico/
|
||||
LAUNCHER.nds
|
||||
name: Pico_Launcher
|
||||
- name: Package for release
|
||||
run: |
|
||||
mkdir Pico_Launcher
|
||||
cp -r _pico/ LAUNCHER.nds Pico_Launcher
|
||||
cd Pico_Launcher && zip -r $PWD.zip *
|
||||
- name: Release
|
||||
uses: softprops/action-gh-release@v2
|
||||
with:
|
||||
files: |
|
||||
Pico_Launcher.zip
|
||||
@@ -60,6 +60,16 @@ extern "C" void* memalign(size_t alignment, size_t size)
|
||||
return result;
|
||||
}
|
||||
|
||||
extern "C" void* calloc(size_t num, size_t size)
|
||||
{
|
||||
void* result = malloc(num * size);
|
||||
if (result)
|
||||
{
|
||||
memset(result, 0, num * size);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
void* operator new(std::size_t blocksize)
|
||||
{
|
||||
return malloc(blocksize);
|
||||
|
||||
@@ -167,6 +167,11 @@ int main(int argc, char* argv[])
|
||||
|
||||
rtc_init();
|
||||
|
||||
if (argc >= 1)
|
||||
{
|
||||
pload_setLauncherPath(argv[0]);
|
||||
}
|
||||
|
||||
memset(&gFatFs, 0, sizeof(gFatFs));
|
||||
if (dldi_init())
|
||||
{
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
#include <libtwl/ipc/ipcFifoSystem.h>
|
||||
#include "ipcChannels.h"
|
||||
#include "fat/File.h"
|
||||
#include "core/StringUtil.h"
|
||||
#include "picoLoaderBootstrap.h"
|
||||
|
||||
#define PICO_LOADER_9_PATH "/_pico/picoLoader9.bin"
|
||||
@@ -18,6 +19,7 @@
|
||||
typedef void (*pico_loader_9_func_t)(void);
|
||||
|
||||
static pload_params_t sLoadParams;
|
||||
static char sLauncherPath[256] alignas(32);
|
||||
static PicoLoaderBootDrive sBootDrive;
|
||||
|
||||
pload_params_t* pload_getLoadParams()
|
||||
@@ -30,6 +32,11 @@ void pload_setBootDrive(PicoLoaderBootDrive bootDrive)
|
||||
sBootDrive = bootDrive;
|
||||
}
|
||||
|
||||
void pload_setLauncherPath(const char* launcherPath)
|
||||
{
|
||||
StringUtil::Copy(sLauncherPath, launcherPath, sizeof(sLauncherPath));
|
||||
}
|
||||
|
||||
void pload_start()
|
||||
{
|
||||
mem_setVramAMapping(MEM_VRAM_AB_LCDC);
|
||||
@@ -78,8 +85,13 @@ void pload_start()
|
||||
DC_InvalidateAll();
|
||||
IC_InvalidateAll();
|
||||
|
||||
((pload_header7_t*)0x06840000)->bootDrive = sBootDrive;
|
||||
dma_ntrCopy16(3, &sLoadParams, &((pload_header7_t*)0x06840000)->loadParams, sizeof(pload_params_t));
|
||||
auto header = (pload_header7_t*)0x06840000;
|
||||
header->bootDrive = sBootDrive;
|
||||
dma_ntrCopy16(3, &sLoadParams, &header->loadParams, sizeof(pload_params_t));
|
||||
if (header->apiVersion >= 2)
|
||||
{
|
||||
dma_ntrCopy16(3, &sLauncherPath, &header->v2.launcherPath, sizeof(header->v2.launcherPath));
|
||||
}
|
||||
mem_setVramCMapping(MEM_VRAM_C_ARM7_00000);
|
||||
mem_setVramDMapping(MEM_VRAM_D_ARM7_20000);
|
||||
ipc_sendFifoMessage(IPC_CHANNEL_LOADER, 1);
|
||||
|
||||
@@ -3,4 +3,5 @@
|
||||
|
||||
pload_params_t* pload_getLoadParams();
|
||||
void pload_setBootDrive(PicoLoaderBootDrive bootDrive);
|
||||
void pload_setLauncherPath(const char* launcherPath);
|
||||
void pload_start();
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
/// @brief The Pico Loader API version supported by this header file.
|
||||
#define PICO_LOADER_API_VERSION 1
|
||||
#define PICO_LOADER_API_VERSION 2
|
||||
|
||||
/// @brief Enum to specify the drive to boot from.
|
||||
typedef enum
|
||||
@@ -35,6 +35,14 @@ typedef struct
|
||||
char arguments[256];
|
||||
} pload_params_t;
|
||||
|
||||
/// @brief Struct representing the API version 2 part of the header of picoLoader7.bin.
|
||||
typedef struct
|
||||
{
|
||||
/// @brief The path of the rom to return to when exiting an application.
|
||||
/// When this path is not set, no bootstub will be patched into homebrew applications.
|
||||
char launcherPath[256];
|
||||
} pload_header7_v2_t;
|
||||
|
||||
/// @brief Struct representing the header of picoLoader7.bin.
|
||||
typedef struct
|
||||
{
|
||||
@@ -52,4 +60,7 @@ typedef struct
|
||||
|
||||
/// @brief The load params, see \see pload_params_t.
|
||||
pload_params_t loadParams;
|
||||
|
||||
/// @brief The API version 2 part of the header. Only access this when \see apiVersion >= 2.
|
||||
pload_header7_v2_t v2;
|
||||
} pload_header7_t;
|
||||
|
||||
Reference in New Issue
Block a user