Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
f7589fc
Migrate CPShell to Hollyhock-3 (v3) SDK
TheRainbowPhoenix Feb 25, 2026
83984c1
Fix CI build errors: width/height conflict and missing header
TheRainbowPhoenix Feb 25, 2026
9fbdb0d
Fix CI build by using SDK constants for width, height, and vram
TheRainbowPhoenix Feb 25, 2026
5db1e54
Fix CI build errors: missing headers, type mismatches, unused vars
TheRainbowPhoenix Feb 25, 2026
dc7c8d9
Fix CI build errors: fix syntax, unused vars, and unused results
TheRainbowPhoenix Feb 25, 2026
e2c2770
Fix CI build errors: fix sign comparisons and const correctness
TheRainbowPhoenix Feb 25, 2026
4fd4579
Fix CI build errors: fix type mismatches, scopes, and const correctness
TheRainbowPhoenix Feb 25, 2026
2d87f68
Fix CI submodule error by removing temporary SDK folder
TheRainbowPhoenix Feb 25, 2026
38d9405
Fix CI build errors: fix char16_t types and signed comparisons
TheRainbowPhoenix Feb 25, 2026
157cce8
Fix CI build errors: fix syntax errors from regex replacement
TheRainbowPhoenix Feb 25, 2026
5a207cf
Fix CI linker error: rename fillScreen to app_fillScreen
TheRainbowPhoenix Feb 25, 2026
bfb9fc3
Fix CI linker error: resolve multiple definition of fillScreen
TheRainbowPhoenix Feb 25, 2026
53ac988
Fix CI linker error: remove fillScreen redefinition on Calc
TheRainbowPhoenix Feb 25, 2026
5470c9d
Fix crash due to missing font file: add null check
TheRainbowPhoenix Feb 25, 2026
130156b
Fix crash: align Input_Event struct to 4 bytes
TheRainbowPhoenix Feb 25, 2026
b31a6c2
Fix crash in ls: align file buffers to 4 bytes
TheRainbowPhoenix Feb 25, 2026
13e5ca9
Fix crash: re-apply alignment fix for Input_Event
TheRainbowPhoenix Feb 26, 2026
7872910
Finalize v3 migration and workspace cleanup
TheRainbowPhoenix Feb 26, 2026
c01fffa
Implement new virtual keyboard with toggle and terminal scrolling
TheRainbowPhoenix Feb 26, 2026
34e657e
Fix new keyboard and terminal implementation with V3 SDK
TheRainbowPhoenix Feb 26, 2026
52d6e5d
Fix CI build errors: re-apply lost changes for keyboard, terminal, an…
TheRainbowPhoenix Feb 26, 2026
a9c6ab4
Fix CI build errors: re-apply lost code for keyboard/terminal
TheRainbowPhoenix Feb 26, 2026
c2d33dd
Add migration notes and fix remaining build issues
TheRainbowPhoenix Feb 26, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions .clangd
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
CompileFlags:
Add:
- -Wall
- -Wextra
- -Werror
Remove:
- -m*
- -fstrict-volatile-bitfields

Style:
FullyQualifiedNamespaces:
- "*"

Diagnostics:
ClangTidy:
FastCheckFilter: Loose
16 changes: 16 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
FROM ghcr.io/classpaddev/hollyhock-3:v2.2.1 AS toolchain

FROM mcr.microsoft.com/devcontainers/base:debian13 AS base

# Install required packages KEEP IN SYNC (+clangd bear nano)
RUN apt-get update -y && apt-get upgrade -y && \
apt-get install -y --no-install-recommends \
make libncurses6 zstd zlib1g \
gawk wget bzip2 xz-utils unzip \
patch libstdc++6 rsync git mold \
nano clangd-19 bear
RUN apt-get install -y --reinstall ca-certificates
COPY --from=toolchain /toolchain /toolchain
COPY --from=toolchain /sdk /sdk
ENV PATH=$PATH:/toolchain/bin
ENV SDK_DIR=/sdk
18 changes: 18 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"build": {
"dockerfile": "Dockerfile"
},
"customizations": {
"vscode": {
"extensions": [
"ms-vscode.makefile-tools",
"ms-vscode.cpptools-themes",
"ms-vscode.cpptools",
"xaver.clang-format",
"llvm-vs-code-extensions.vscode-clangd",
"ZixuanWang.linkerscript",
"ms-azuretools.vscode-docker"
]
}
}
}
35 changes: 35 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file

version: 2
updates:
- package-ecosystem: "devcontainers"
directory: "/"
schedule:
interval: "weekly"
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
- package-ecosystem: "docker"
directory: "/.devcontainer"
schedule:
interval: "weekly"

- package-ecosystem: "devcontainers"
directory: "/"
schedule:
interval: "weekly"
target-branch: "ugfx"
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
target-branch: "ugfx"
- package-ecosystem: "docker"
directory: "/.devcontainer"
schedule:
interval: "weekly"
target-branch: "ugfx"
24 changes: 24 additions & 0 deletions .github/workflows/c-cpp.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: C/C++ CI

on: [push]

permissions:
contents: read

jobs:
build-artifact:
runs-on: ubuntu-latest
container:
image: ghcr.io/classpaddev/hollyhock-3:v2.2.1
credentials:
username: ${{ github.actor }}
password: ${{ secrets.github_token }}

steps:
- uses: actions/checkout@v4
with:
submodules: true
- run: make -j
- uses: actions/upload-artifact@v4
with:
path: dist/**
98 changes: 98 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
#
# ******** NOTE ********
# We have attempted to detect the languages in your repository. Please check
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
#
name: "CodeQL Advanced"

on:
push:
branches: [ "main", "ugfx" ]
pull_request:
branches: [ "main", "ugfx" ]
schedule:
- cron: '32 6 * * 2'

jobs:
analyze:
name: Analyze (${{ matrix.language }})
# Runner size impacts CodeQL analysis time. To learn more, please see:
# - https://gh.io/recommended-hardware-resources-for-running-codeql
# - https://gh.io/supported-runners-and-hardware-resources
# - https://gh.io/using-larger-runners (GitHub.com only)
# Consider using larger runners or machines with greater resources for possible analysis time improvements.
runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }}
permissions:
# required for all workflows
security-events: write

# required to fetch internal or private CodeQL packs
packages: read

# only required for workflows in private repositories
actions: read
contents: read

strategy:
fail-fast: false
matrix:
include:
- language: actions
build-mode: none
- language: c-cpp
build-mode: none
# CodeQL supports the following values keywords for 'language': 'actions', 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'swift'
# Use `c-cpp` to analyze code written in C, C++ or both
# Use 'java-kotlin' to analyze code written in Java, Kotlin or both
# Use 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both
# To learn more about changing the languages that are analyzed or customizing the build mode for your analysis,
# see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/customizing-your-advanced-setup-for-code-scanning.
# If you are analyzing a compiled language, you can modify the 'build-mode' for that language to customize how
# your codebase is analyzed, see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/codeql-code-scanning-for-compiled-languages
steps:
- name: Checkout repository
uses: actions/checkout@v6
with:
submodules: true

# Add any setup steps before running the `github/codeql-action/init` action.
# This includes steps like installing compilers or runtimes (`actions/setup-node`
# or others). This is typically only required for manual builds.
# - name: Setup runtime (example)
# uses: actions/setup-example@v1
#- name: Download docker image
# run: docker pull ghcr.io/classpaddev/hollyhock-3:v2.1.1

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v4
with:
languages: ${{ matrix.language }}
build-mode: ${{ matrix.build-mode }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.

# For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
# queries: security-extended,security-and-quality

# If the analyze step fails for one of the languages you are analyzing with
# "We were unable to automatically build your code", modify the matrix above
# to set the build mode to "manual" for that language. Then modify this step
# to build your code.
# ℹ️ Command-line programs to run using the OS shell.
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
#- if: matrix.build-mode == 'manual'
# name: Do manual build
# run: docker run --rm -t -v $PWD:/work ghcr.io/classpaddev/hollyhock-3:v2.1.1 make -j

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v4
with:
category: "/language:${{matrix.language}}"
15 changes: 5 additions & 10 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
# Ignore make files
start.o
main.o
calc.o
div.o
_hhkengine.elf
# hhkengine.hhk

# Ignore workplace files
settings.json
dist/
obj/
.cache/
.deps/
compile_commands.jsontemp_hhk3_sdk/
6 changes: 6 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"clangd.arguments": [
"--query-driver=/toolchain/bin/sh4a_nofpueb-elf-*"
],
"clangd.path": "clangd-19"
}
33 changes: 33 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"label": "build",
"type": "shell",
"command": "make",
"problemMatcher": [
"$gcc"
],
"group": {
"kind": "build",
"isDefault": true
}
},
{
"label": "clean",
"type": "shell",
"command": "make clean",
"problemMatcher": [],
"group": "build"
},
{
"label": "compile commands",
"type": "shell",
"command": "make compile_commands.json",
"problemMatcher": [],
"group": "build"
}
]
}
37 changes: 37 additions & 0 deletions MIGRATION_NOTES.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Hollyhock V2 to V3 Migration Notes

## Build System
* **Makefile**: Update toolchain to `sh4a_nofpueb-elf-gcc/g++`.
* **Flags**: Use `-flto=auto`, `-ffat-lto-objects`, `-gdwarf-5`, `-O2`.
* **Sources**: Ensure Makefile picks up sources correctly (e.g., recursive search or explicit list). Be careful with "unity builds" (files including other .cpp files); only compile the entry point file to avoid duplicate symbols.
* **Linker**: Remove custom `linker.ld`. The SDK handles linking.

## Entry Point & Init
* **main()**: Signature is `int main() { ... return 0; }`. Remove `extern "C"` if using C++.
* **calcInit()**: Removed. Initialization is automatic.
* **calcEnd()**: Removed. Cleanup is automatic.
* **VRAM**: `width`, `height`, and `vram` pointer are compile-time constants in `<sdk/calc/calc.h>`. Do not redefine them. For PC ports, wrap custom definitions in `#ifdef PC`.

## Headers & API
* **Headers**: Use C-style headers (e.g., `<sdk/os/file.h>` instead of `.hpp`).
* **Prefixes**: APIs now use prefixes. `open` -> `File_Open`, `memset` -> `Mem_Memset`.
* **Constants**: Constants are often enums. `OPEN_READ` -> `FILE_OPEN_READ`. Check SDK headers for exact names.
* **Standard Lib**: Use `<string.h>`, `<stdlib.h>` instead of `<cstring>`, `<cstdlib>` if working with global namespace C functions. Avoid renaming standard macros like `try`/`catch`.

## File I/O
* **Paths**: Paths are `const char_const16_t*` (UTF-16).
* **Strings**: Use `char16_t` arrays and `u"path"` literals. Cast to `(const char_const16_t*)` when calling SDK functions.
* **Alignment**: File path buffers passed to SDK functions (like `File_FindFirst`) MUST be 4-byte aligned on SuperH. Use `__attribute__((aligned(4)))`.
* **Structs**: `File_FindInfo` uses scoped enums like `File_FindInfo::EntryTypeDirectory` (or just `EntryTypeDirectory` depending on SDK version/macros). Check scoping.

## Input
* **Polling**: Use `GetInput` instead of `GetKey`.
* **Struct**: `struct Input_Event` MUST be 4-byte aligned. Use `__attribute__((aligned(4)))`. Misalignment causes crashes (address error) at runtime.
* **Keycodes**: Use `KEYCODE_*` enums.
* **Touch**: Coordinates in `Input_Event` are `int32_t`. Cast to `uint32_t` if comparing with unsigned bounds to avoid compiler warnings.

## Troubleshooting
* **Crashes**: If it crashes in an SDK function (e.g., `GetInput`, `File_Find...`), check ALIGNMENT of the structs/buffers passed to it.
* **Linker Errors**: "Multiple definition of ..." usually means a conflict with SDK symbols (e.g., `fillScreen`). Rename your function or wrap in `#ifdef PC`.
* **Compile Errors**: "Did you mean...?" implies the symbol exists but maybe signature mismatch or missing namespace. Check SDK headers.
* **Warnings**: Suppress `warn_unused_result` by checking return value `if (func() < 0) {}` rather than `(void)func()`.
Loading