Logs the current application version on each start

This commit is contained in:
Maschell 2023-07-22 11:08:06 +02:00
parent 1e64ee9bf1
commit 2d4d5c64e5
4 changed files with 20 additions and 0 deletions

View File

@ -18,6 +18,13 @@ jobs:
needs: clang-format
steps:
- uses: actions/checkout@v3
- name: create version.h
run: |
git_hash=$(git rev-parse --short "$GITHUB_SHA")
cat <<EOF > ./source/version.h
#pragma once
#define MOUDLE_VERSION_EXTRA " (nightly-$git_hash)"
EOF
- name: build binary
run: |
docker build . -t builder

View File

@ -26,6 +26,13 @@ jobs:
needs: clang-format
steps:
- uses: actions/checkout@v3
- name: create version.h
run: |
git_hash=$(git rev-parse --short "${{ github.event.pull_request.head.sha }}")
cat <<EOF > ./source/version.h
#pragma once
#define MODULE_VERSION_EXTRA " (nightly-$git_hash)"
EOF
- name: build binary
run: |
docker build . -t builder

View File

@ -1,5 +1,6 @@
#include "kernel.h"
#include "logger.h"
#include "version.h"
#include <coreinit/cache.h>
#include <coreinit/ios.h>
#include <kernel/kernel.h>
@ -10,6 +11,8 @@ WUMS_MODULE_EXPORT_NAME("homebrew_usbseriallogging");
WUMS_MODULE_SKIP_INIT_FINI();
WUMS_DEPENDS_ON(homebrew_kernel);
#define MODULE_VERSION "v0.1"
extern "C" void SC_0x51();
WUMS_INITIALIZE() {
@ -46,6 +49,7 @@ WUMS_INITIALIZE() {
#define IopShell_CreateThread ((void (*)(void))(0x101C400 + 0x19504))
WUMS_APPLICATION_STARTS() {
OSReport("Running USBSerialLoggingModule " MODULE_VERSION MODULE_VERSION_EXTRA "\n");
initLogging();
DEBUG_FUNCTION_LINE("Register IopShell_UserCallback");
IopShell_RegisterCallback(IopShell_UserCallback, 0x100978f8, 0x10097900, 0x10097c40);

2
source/version.h Normal file
View File

@ -0,0 +1,2 @@
#pragma once
#define MODULE_VERSION_EXTRA ""