6 Commits

Author SHA1 Message Date
Gericom
d76d46ea73 Added support for Pico Loader API v2. This makes it possible to return to Pico Launcher from homebrew. 2026-01-10 17:08:06 +01:00
Gericom
e4c2fafa74 Updated to latest blocksds (Fixes #14) 2026-01-04 11:00:33 +01:00
Gericom
e2a8a540e9 Merge pull request #12 from lifehackerhansol/workflow-release
workflow: add release pipeline
2025-12-04 13:41:05 +01:00
lifehackerhansol
17d8e3b4f8 workflow: add release pipeline
- Minor change in push pipeline to remove spaces from artifact name
- Create release pipeline with the same steps that will upload a zipped
  package to every published release automatically
2025-12-03 21:09:03 -08:00
Gericom
9863dbf631 Merge pull request #10 from lifehackerhansol/workflow-remove-dotnet-env
workflow: remove unnecessary dotnet environment variables
2025-11-29 14:41:52 +01:00
lifehackerhansol
c77bf774d4 workflow: remove unnecessary dotnet environment variables
- This is not needed in pico-launcher.
2025-11-29 04:43:35 -08:00
7 changed files with 83 additions and 9 deletions

View File

@@ -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
View 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

View File

@@ -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);

View File

@@ -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())
{

View File

@@ -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);

View File

@@ -3,4 +3,5 @@
pload_params_t* pload_getLoadParams();
void pload_setBootDrive(PicoLoaderBootDrive bootDrive);
void pload_setLauncherPath(const char* launcherPath);
void pload_start();

View File

@@ -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;