Skip to content

Commit 1172100

Browse files
committed
initial commit
0 parents  commit 1172100

13 files changed

Lines changed: 805 additions & 0 deletions

File tree

.gitattributes

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
* text=auto
2+
.gitignore text eol=lf

.github/CODEOWNERS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
* @coignard
2+
/.github/ @coignard

.github/FUNDING.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
github: coignard
2+
ko_fi: coignard

.github/workflows/ci.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
permissions:
10+
contents: read
11+
12+
jobs:
13+
test:
14+
name: Test
15+
runs-on: ${{ matrix.os }}
16+
strategy:
17+
fail-fast: false
18+
matrix:
19+
include:
20+
- os: ubuntu-latest
21+
fasmg_bin: ./fasmg/core/fasmg.x64
22+
- os: windows-latest
23+
fasmg_bin: ./fasmg/core/fasmg.exe
24+
- os: macos-latest
25+
fasmg_bin: ./fasmg/core/source/macos/x64/fasmg
26+
27+
steps:
28+
- name: Checkout repository
29+
uses: actions/checkout@v4
30+
with:
31+
submodules: recursive
32+
33+
- name: Make fasmg executable
34+
if: runner.os != 'Windows'
35+
run: chmod +x ${{ matrix.fasmg_bin }}
36+
37+
- name: Assemble examples
38+
shell: bash
39+
env:
40+
INCLUDE: ${{ github.workspace }}/fasmg/packages
41+
run: |
42+
for file in examples/*.asm; do
43+
echo "Assembling $file"
44+
${{ matrix.fasmg_bin }} "$file"
45+
done

.github/workflows/mirror.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: Mirror to Codeberg
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
permissions:
9+
contents: read
10+
11+
jobs:
12+
mirror:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v6
16+
with:
17+
fetch-depth: 0
18+
- uses: yesolutions/mirror-action@master
19+
with:
20+
REMOTE: 'https://codeberg.org/coignard/apogee-sdk.git'
21+
GIT_USERNAME: coignard
22+
GIT_PASSWORD: ${{ secrets.CODEBERG_TOKEN }}

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
.DS_Store
2+
*.rka

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule "fasmg"]
2+
path = fasmg
3+
url = https://github.com/coignard/fasmg

LICENSE

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
Copyright (c) 2026 René Coignard
2+
3+
This software is provided 'as-is', without any express or implied
4+
warranty. In no event will the authors be held liable for any damages
5+
arising from the use of this software.
6+
7+
Permission is granted to anyone to use this software for any purpose,
8+
including commercial applications, and to alter it and redistribute it
9+
freely, subject to the following restrictions:
10+
11+
1. The origin of this software must not be misrepresented; you must not
12+
claim that you wrote the original software. If you use this software
13+
in a product, an acknowledgment in the product documentation would be
14+
appreciated but is not required.
15+
2. Altered source versions must be plainly marked as such, and must not be
16+
misrepresented as being the original software.
17+
3. This notice may not be removed or altered from any source distribution.

examples/hello.asm

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
2+
; Hello World for Apogee BK-01
3+
4+
include '../source/kr580vm80a.inc'
5+
include '../source/apogee.inc'
6+
7+
format rka
8+
9+
LXI h, msg_hello
10+
CALL MON_MSG_OUT
11+
12+
LXI h, msg_any_key
13+
CALL MON_MSG_OUT
14+
15+
CALL MON_CHAR_IN_WAIT
16+
JMP MON_START
17+
18+
msg_hello:
19+
dba 0Dh, 0Ah, 'Привет, мир!', 0Dh, 0Ah, 0
20+
21+
msg_any_key:
22+
dba 0Dh, 0Ah, 'Нажмите любую клавишу...', 0Dh, 0Ah, 0

examples/midi.asm

Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
2+
; MIDI test for Apogee BK-01 emulator with MIDI support via PPI
3+
4+
include '../source/kr580vm80a.inc'
5+
include '../source/apogee.inc'
6+
7+
format rka
8+
9+
MIDI_CMD_NOTE_ON := 90h
10+
MIDI_CMD_NOTE_OFF := 80h
11+
MIDI_VELOCITY_MAX := 7Fh
12+
MIDI_VELOCITY_MIN := 00h
13+
14+
NOTE_C3 := 3Ch
15+
NOTE_C4_PLUS := 49h
16+
17+
KEY_NOT_PRESSED := 0FFh
18+
19+
MIDI_STROBE_OFF := 0
20+
MIDI_STROBE_ON := MIDI_CTRL_STROBE
21+
22+
macro out_mem_port addr, val
23+
MVI A, val
24+
STA addr
25+
end macro
26+
27+
macro print args&
28+
local skip, text_data
29+
JMP skip
30+
text_data:
31+
dba args, 0
32+
skip:
33+
LXI H, text_data
34+
CALL MON_MSG_OUT
35+
end macro
36+
37+
macro exit_to_monitor_if_key_pressed
38+
CALL MON_CHAR_IN_NOWAIT
39+
CPI KEY_NOT_PRESSED
40+
JNZ MON_START
41+
end macro
42+
43+
macro transmit_midi_sequence args&
44+
iterate arg, args
45+
if arg relativeto 0
46+
MVI A, arg
47+
else
48+
MOV A, arg
49+
end if
50+
CALL send_midi_byte
51+
end iterate
52+
end macro
53+
54+
macro midi_note_on note_reg
55+
transmit_midi_sequence MIDI_CMD_NOTE_ON, note_reg, MIDI_VELOCITY_MAX
56+
end macro
57+
58+
macro midi_note_off note_reg
59+
transmit_midi_sequence MIDI_CMD_NOTE_OFF, note_reg, MIDI_VELOCITY_MIN
60+
end macro
61+
62+
macro next_note register, limit, loop_label
63+
INR register
64+
MOV A, register
65+
CPI limit
66+
JNZ loop_label
67+
end macro
68+
69+
out_mem_port VV55_USR_CWR, 80h
70+
71+
print 0Dh, 0Ah, 'Проверка MIDI', 0Dh, 0Ah
72+
print 0Dh, 0Ah, 'Для возврата в Монитор удерживайте любую клавишу...', 0Dh, 0Ah
73+
74+
play_octave_loop:
75+
MVI D, NOTE_C3
76+
77+
play_note_loop:
78+
midi_note_on D
79+
CALL delay
80+
midi_note_off D
81+
82+
exit_to_monitor_if_key_pressed
83+
84+
next_note D, NOTE_C4_PLUS, play_note_loop
85+
JMP play_octave_loop
86+
87+
send_midi_byte:
88+
STA MIDI_PORT_DATA
89+
out_mem_port MIDI_PORT_CTRL, MIDI_STROBE_OFF
90+
out_mem_port MIDI_PORT_CTRL, MIDI_STROBE_ON
91+
out_mem_port MIDI_PORT_CTRL, MIDI_STROBE_OFF
92+
RET
93+
94+
delay:
95+
LXI B, 4000h
96+
.wait:
97+
DCX B
98+
MOV A, B
99+
ORA C
100+
JNZ .wait
101+
RET

0 commit comments

Comments
 (0)