Skip to content

Commit 12c7bf1

Browse files
committed
build on push/workflow_dispatch and centering
1 parent f21add3 commit 12c7bf1

File tree

3 files changed

+22
-7
lines changed

3 files changed

+22
-7
lines changed

.github/workflows/build.yml

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,12 @@ name: Build
22

33
on:
44
push:
5-
branches:
6-
- main
5+
tags: '*'
76
workflow_dispatch:
7+
inputs:
8+
tag:
9+
type: string
10+
description: 'Tag Name to be created'
811

912
jobs:
1013
build:
@@ -25,4 +28,9 @@ jobs:
2528
zip -r build.zip build
2629
2730
- name: Publish
28-
run: gh release create "$(date +'%Y%m%d')" -t "$(git rev-parse HEAD | cut -c -7)" -n "Automatic build of $(git rev-parse HEAD)." ./build.zip
31+
run: |
32+
if [ -n "${{ inputs.tag }}" ]; then
33+
gh release create "${{ inputs.tag }}" -t "${{ inputs.tag }}" -n "Automatic build of $(git rev-parse HEAD)." ./build.zip
34+
else
35+
gh release create "${GITHUB_REF/refs\/*s\//}" -t "${GITHUB_REF/refs\/*s\//}" -n "Automatic build of $(git rev-parse HEAD)." ./build.zip
36+
fi

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
![](image.jpg)
44

5-
This repository is a skeleton for developing homebrews (addons) for CASIO EX-word DATAPLUS 5/6/7 with automatic GitHub Actions build on pushes to the `main` branch. `src/main.c` in this repository shows `Hello, world!` in white text on black background, and exits on Power or Back key press. You can install your app to your EX-word device in the same way as [Gnuboy EX](https://brain.fandom.com/ja/wiki/Gnuboy_EX) by using [libexword](https://brain.fandom.com/ja/wiki/Libexword) tool. For local setup, install [DevkitSH4](https://brain.fandom.com/ja/wiki/DevkitSH4) compiler and invoke `make` to build in `build/ja/` and `build/cn/`.
5+
This repository is a skeleton for developing homebrews (addons) for CASIO EX-word DATAPLUS 5/6/7 with GitHub Actions build on tag push and manual dispatch. `src/main.c` in this repository shows `Hello, world!` in white text on black background, and exits on Power or Back key press. You can install your app to your EX-word device in the same way as [Gnuboy EX](https://brain.fandom.com/ja/wiki/Gnuboy_EX) by using [libexword](https://brain.fandom.com/ja/wiki/Libexword) tool. For local setup, install [devkitSH4](https://brain.fandom.com/ja/wiki/devkitSH4) compiler and invoke `make` to build in `build/ja/` and `build/cn/`. devkitSH4 automatically downloads [libdataplus](https://github.com/brijohn/libdataplus) during the installation process.
66

77
- `html/`: Metadata HTML templates to be read by the EX-word system (must be in CRLF)
88
- `src/`: C source files
@@ -16,7 +16,7 @@ This repository is inspired by [yukkuri-Dev/EXtend-Word](https://github.com/yukk
1616

1717
---
1818

19-
このリポジトリは CASIO 製電子辞書 EX-word の DATAPLUS 5/6/7 で動作するプログラム(追加コンテンツ)を開発するためのテンプレートで、`main` branch への push 時に自動で GitHub Actions ビルドも走ります。同梱の `src/main.c` は、黒背景に白文字で `Hello, world!` と表示し、電源ボタンか戻るボタンで終了するものです。[libexword](https://brain.fandom.com/ja/wiki/Libexword) ツールを使えば [Gnuboy EX](https://brain.fandom.com/ja/wiki/Gnuboy_EX) と同様の方法で EX-word にインストールできます。ローカル環境では、[DevkitSH4](https://brain.fandom.com/ja/wiki/DevkitSH4) コンパイラを導入して `make` すると `build/ja/``build/cn/` 以下にビルドされます。
19+
このリポジトリは CASIO 製電子辞書 EX-word の DATAPLUS 5/6/7 で動作するプログラム(追加コンテンツ)を開発するためのテンプレートで、tag の push や手動発行で GitHub Actions ビルドも走ります。同梱の `src/main.c` は、黒背景に白文字で `Hello, world!` と表示し、電源ボタンか戻るボタンで終了するものです。[libexword](https://brain.fandom.com/ja/wiki/Libexword) ツールを使えば [Gnuboy EX](https://brain.fandom.com/ja/wiki/Gnuboy_EX) と同様の方法で EX-word にインストールできます。ローカル環境では、[devkitSH4](https://brain.fandom.com/ja/wiki/devkitSH4) コンパイラを導入して `make` すると `build/ja/``build/cn/` 以下にビルドされます。devkitSH4 のインストール時に [libdataplus](https://github.com/brijohn/libdataplus) も同時にインストールされます
2020

2121
- `html/`: EX-word システムが使用するメタデータを記載した HTML テンプレート(CRLF 必須)
2222
- `src/`: C ソースファイル

src/main.c

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,18 @@
55
#include <graphics/lcdc.h>
66
#include <sh4a/input/keypad.h>
77

8+
#define SCREEN_WIDTH 528
9+
#define SCREEN_HEIGHT 320
10+
811
int main(void) {
12+
struct font *fnt = get_font();
13+
914
set_pen(create_rgb16(0, 0, 0));
10-
draw_rect(0, 0, 528, 320);
15+
draw_rect(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT);
1116
set_pen(create_rgb16(255, 255, 255));
12-
render_text(0, 0, "Hello, world!");
17+
render_text((SCREEN_WIDTH - (sizeof "Hello, world!" - 1) * fnt->width) / 2, SCREEN_HEIGHT / 2 - fnt->height * 2, "Hello, world!");
18+
set_pen(create_rgb16(0, 255, 0));
19+
render_text((SCREEN_WIDTH - (sizeof "Press POWER or BACK key to exit." - 1) * fnt->width) / 2, SCREEN_HEIGHT / 2, "Press POWER or BACK key to exit.");
1320
lcdc_copy_vram();
1421

1522
while (1) {

0 commit comments

Comments
 (0)