Skip to content

Commit 09d6928

Browse files
authored
Merge branch 'main' into fix/all-is-default
2 parents b5514be + 454114a commit 09d6928

File tree

20 files changed

+210
-33
lines changed

20 files changed

+210
-33
lines changed

.github/workflows/ci.yml

Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
name: CI
2+
3+
on:
4+
pull_request:
5+
branches: [ main ]
6+
push:
7+
tags:
8+
- "v*"
9+
workflow_dispatch: # allows manual run too
10+
11+
jobs:
12+
build:
13+
runs-on: ubuntu-latest
14+
container:
15+
image: fozztexx/defoogi:1.4.2
16+
17+
outputs:
18+
files: ${{ steps.list_zips.outputs.files }}
19+
20+
steps:
21+
- uses: actions/checkout@v4
22+
23+
- name: Build release files
24+
run: make release
25+
26+
- name: List zip files
27+
id: list_zips
28+
shell: bash
29+
run: |
30+
echo 'files=["'"$(( cd dist ; echo *.zip ) | sed -e 's/ /","/g')"'"]' >> $GITHUB_OUTPUT
31+
32+
- name: Upload dist folder for next job
33+
uses: actions/upload-artifact@v4
34+
with:
35+
name: dist
36+
path: dist/
37+
38+
upload:
39+
needs: build
40+
runs-on: ubuntu-latest
41+
if: github.event_name == 'pull_request'
42+
strategy:
43+
matrix:
44+
file: ${{ fromJson(needs.build.outputs.files) }}
45+
steps:
46+
- uses: actions/checkout@v4
47+
48+
- name: Download dist folder
49+
uses: actions/download-artifact@v4
50+
with:
51+
name: dist
52+
path: dist
53+
54+
- name: Upload individual artifact
55+
uses: actions/upload-artifact@v4
56+
with:
57+
name: ${{ matrix.file }}
58+
path: dist/${{ matrix.file }}
59+
60+
tagged-release:
61+
needs: build
62+
runs-on: ubuntu-latest
63+
if: startsWith(github.ref, 'refs/tags/')
64+
steps:
65+
- uses: actions/checkout@v4
66+
67+
# Download the dist folder from the build job
68+
- name: Download build artifacts
69+
uses: actions/download-artifact@v4
70+
with:
71+
name: dist
72+
path: dist
73+
74+
# Generate random release name
75+
- name: Generate random release name
76+
id: random_name
77+
run: |
78+
RANDOM_NAME=$(docker run --rm fnichol/names)
79+
echo "name=$RANDOM_NAME" >> $GITHUB_OUTPUT
80+
echo "Generated release name: $RANDOM_NAME"
81+
82+
# Create GitHub Release for the tag
83+
- name: Create GitHub Release
84+
id: create_release
85+
uses: actions/create-release@v1
86+
with:
87+
tag_name: ${{ github.ref_name }}
88+
release_name: ${{ steps.random_name.outputs.name }} (${{ github.ref_name }})
89+
draft: false
90+
prerelease: false
91+
env:
92+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
93+
94+
# Upload each zip as a release asset
95+
- name: Upload release assets
96+
run: |
97+
for zip in dist/*.zip; do
98+
echo "Uploading $zip..."
99+
gh release upload ${{ github.ref_name }} "$zip"
100+
done
101+
env:
102+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Changelog.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,21 @@
22

33
## [Unreleased]
44

5+
## [4.7.9] - 2025-09-23
6+
7+
- [coco] CoCo: Fix fuji_set_directory_position (#41) [Rich Stephens]
8+
- [release] Add random name generator to releases (#39) [Mark Fisher]
9+
10+
## [4.7.8] - 2025-09-23
11+
12+
- [release] Added github workflow to create PR artifacts and release on tag [FoxxTexx]
13+
- [msdos] Fix MS-DOS compiling. (#36) [FozzTexx]
14+
- [coco] Fixes to coco wifi functions, and to fujinet-fuji.h (#33) [Rich Stephens]
15+
- [adam] Add fn_network support for Adam, merge with Thom's changes (#32) [geoffdaddy]
16+
- [msdos] implement network. (#31) [Thomas Cherryhomes]
17+
- [adam] Implement fuji adam (#30) [Thomas Cherryhomes]
18+
19+
520
## [4.7.7] - 2025-06-18
621

722
- [atari] Fix return codes from clock_get_time, clock_get_time_tz

Makefile

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,10 @@
33
# Set the TARGETS and PROGRAM values as required.
44
# See makefiles/build.mk for details on directory structure for src files and how to add custom extensions to the build.
55

6-
TARGETS = adam atari c64 apple2 apple2enh apple2gs coco
7-
# TARGETS = pmd85
8-
# TARGETS = msdos
6+
TARGETS = adam apple2 apple2enh atari c64 coco
7+
TARGETS += msdos
8+
# TARGETS += apple2gs
9+
# TARGETS += pmd85
910
PROGRAM := fujinet.lib
1011

1112
SUB_TASKS := clean disk test release unit-test

adam/src/include/fujinet-network-adam.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ extern DCB *network_dcb[MAX_NETWORK_DEVICES];
4646
* @param devicespec The Device Specification "N:..."
4747
* @return AdamNet unit number.
4848
*/
49-
uint8_t network_unit_adamnet(char *devicespec);
49+
uint8_t network_unit_adamnet(const char *devicespec);
5050

5151
/**
5252
* @brief Return proper unit # for adamnet.
@@ -55,6 +55,6 @@ uint8_t network_unit_adamnet(char *devicespec);
5555
* @param len Length of the buffer
5656
* @return Fujinet error code.
5757
*/
58-
int16_t network_read_adam(char* devicespec, uint8_t *buf, uint16_t len);
58+
int16_t network_read_adam(const char* devicespec, uint8_t *buf, uint16_t len);
5959

6060
#endif /* FUJINET_NETWORK_ADAM_H */

coco/src/bus/bus_ready.c

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,24 @@
1111
#include <dw.h>
1212
#include <fujinet-fuji-coco.h>
1313

14+
15+
#define DWWRT_VEC_DRG 0xD941
16+
#define DWREAD_VEC_DRG 0xD93F
17+
#define DWWRT_VEC_COCO 0xFA00
18+
#define DWREAD_VEC_COCO 0xF9FE
19+
20+
static gbDWInited = false;
21+
// default to coco read/write if not inited.
22+
dwvec dwreadvec = DWREAD_VEC_COCO;
23+
dwvec dwwritevec = DWWRT_VEC_COCO;
24+
25+
// detection logic for dragon stolen from: https://exileinparadise.com/tandy_color_computer:keyscn2
26+
//
27+
const uint16_t* RESET = 0xFFFE; // Address of MPU Reset Vector
28+
const uint16_t VECCOCO = 0xA027; // CoCo 1/2 reset vector value
29+
const uint16_t VECDRGN = 0xB3B4; // Dragon32/64 reset vector value
30+
const uint16_t VECCOCO3 = 0x8C1B; // CoCo3 reset vector value
31+
1432
void bus_ready(void)
1533
{
1634
struct _readycmd
@@ -19,6 +37,16 @@ void bus_ready(void)
1937
uint8_t command;
2038
} rc;
2139

40+
if (!gbDWInited)
41+
{
42+
if (*RESET==VECDRGN)
43+
{
44+
dwreadvec = DWREAD_VEC_DRG;
45+
dwwritevec = DWWRT_VEC_DRG;
46+
}
47+
gbDWInited = true;
48+
}
49+
2250
uint8_t z=0, r;
2351

2452
rc.opcode = OP_FUJI;

coco/src/bus/dwread.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
*/
77

88
#include <cmoc.h>
9-
10-
typedef unsigned char byte;
9+
#include <coco.h>
10+
#include "dw.h"
1111

1212
byte dwread(byte *s, int l)
1313
{
@@ -16,7 +16,7 @@ byte dwread(byte *s, int l)
1616
pshs x,y
1717
ldx :s
1818
ldy :l
19-
jsr [0xD93F]
19+
jsr [dwreadvec]
2020
puls y,x
2121
tfr cc,b
2222
lsrb

coco/src/bus/dwwrite.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77

88
#include <cmoc.h>
99
#include <coco.h>
10+
#include "dw.h"
11+
1012

1113
byte dwwrite(byte *s, int l)
1214
{
@@ -15,7 +17,7 @@ byte dwwrite(byte *s, int l)
1517
pshs x,y
1618
ldx :s
1719
ldy :l
18-
jsr [0xD941]
20+
jsr [dwwritevec]
1921
tfr cc,d
2022
puls y,x
2123
}

coco/src/fn_fuji/fuji_get_wifi_enabled.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,11 @@ bool fuji_get_wifi_enabled()
2323
if (fuji_get_error())
2424
return false;
2525

26-
return fuji_get_response((uint8_t *)&enabled, sizeof(bool));
26+
if (fuji_get_response((uint8_t *)&enabled, sizeof(bool)) == BUS_ERROR)
27+
{
28+
// Set enabled = false on error
29+
enabled = false;
30+
}
31+
32+
return enabled;
2733
}

coco/src/fn_fuji/fuji_set_directory_position.c

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,22 @@
66

77
bool fuji_set_directory_position(uint16_t pos)
88
{
9-
/* TODO, implement */
10-
return false;
11-
}
9+
struct _sdp
10+
{
11+
uint8_t opcode;
12+
uint8_t cmd;
13+
uint16_t pos;
14+
} sdp;
15+
16+
sdp.opcode = OP_FUJI;
17+
sdp.cmd = FUJICMD_SET_DIRECTORY_POSITION;
18+
sdp.pos = pos;
19+
20+
bus_ready();
21+
22+
dwwrite((uint8_t *)&sdp, sizeof(sdp));
23+
if (fuji_get_error())
24+
return false;
25+
26+
return true;
27+
}

coco/src/fn_fuji/fuji_set_ssid.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,17 @@ bool fuji_set_ssid(NetConfig *nc)
1010
{
1111
uint8_t opcode;
1212
uint8_t cmd;
13+
char ssid[SSID_MAXLEN];
14+
char password[MAX_PASSWORD_LEN];
1315
} ss;
1416

1517
ss.opcode = OP_FUJI;
1618
ss.cmd = FUJICMD_SET_SSID;
19+
memcpy(ss.ssid, nc->ssid, SSID_MAXLEN);
20+
memcpy(ss.password, nc->password, MAX_PASSWORD_LEN);
1721

1822
bus_ready();
1923
dwwrite((uint8_t *)&ss, sizeof(ss));
20-
dwwrite((uint8_t *)&nc, sizeof(NetConfig));
2124

2225
return !fuji_get_error();
2326
}

0 commit comments

Comments
 (0)