Fixed some code to allow building with modern MSYS. Also turning off 32-bit builds for now as they dont work.

This commit is contained in:
Michael J. Manley
2025-05-20 17:17:25 -07:00
parent 5ba8eba1b4
commit 8adcc25ed9
15 changed files with 18 additions and 247 deletions

View File

@@ -1,178 +0,0 @@
name: PCem Release Build
on:
workflow_dispatch:
branches: [ dev ]
inputs:
logLevel:
description: 'PCem Version Number'
required: true
default: 'v18'
jobs:
build:
strategy:
fail-fast: false
matrix:
include:
- name: Ubuntu 64bit (gcc)
os: ubuntu-latest
args: -DCMAKE_BUILD_TYPE=Release -DPCEM_VERSION_STRING="${{ github.event.inputs.version }}"
artifacts_name: PCem-${{ github.event.inputs.version }}-Ubuntu-${{ github.run_number }}
artifacts_path: PCem-${{ github.event.inputs.version }}-Linux64.tar.bz2
installdeps: >-
libsdl2-dev
libopenal-dev
libwxgtk3.0-gtk3-dev
libpcap-dev
cmake
ninja-build
- name: Windows 32bits (MSYS2)
os: windows-latest
compiler: MINGW32
args: -DCMAKE_BUILD_TYPE=Release -DPCEM_VERSION_STRING="${{ github.event.inputs.version }}"
artifacts_name: PCem-${{ github.event.inputs.version }}-Windows-MINGW32-${{ github.run_number }}
artifacts_path: PCem-${{ github.event.inputs.version }}-Windows32.zip
installdeps: >-
base-devel
zip
unzip
mingw-w64-i686-ntldd-git
mingw-w64-i686-toolchain
mingw-w64-i686-SDL2
mingw-w64-i686-openal
mingw-w64-i686-wxWidgets
mingw-w64-i686-cmake
mingw-w64-i686-libpcap
mingw-w64-i686-ninja
- name: Windows 64bits (MSYS2)
os: windows-latest
compiler: MINGW64
args: -DCMAKE_BUILD_TYPE=Release -DPCEM_VERSION_STRING="${{ github.event.inputs.version }}"
artifacts_name: PCem-${{ github.event.inputs.version }}-Windows-MINGW64-${{ github.run_number }}
artifacts_path: PCem-${{ github.event.inputs.version }}-Windows64.zip
installdeps: >-
base-devel
zip
unzip
mingw-w64-x86_64-ntldd-git
mingw-w64-x86_64-toolchain
mingw-w64-x86_64-SDL2
mingw-w64-x86_64-openal
mingw-w64-x86_64-wxWidgets
mingw-w64-x86_64-cmake
mingw-w64-x86_64-libpcap
mingw-w64-x86_64-ninja
runs-on: ${{ matrix.os }}
name: ${{ matrix.name }}
steps:
- name: "Check out repository"
uses: actions/checkout@v4.1.1
with:
path: temp
fetch-depth: 0
- name: Setup MSYS2 (Windows)
if: runner.os == 'Windows'
# You may pin to the exact commit or the version.
# uses: msys2/setup-msys2@a43b8403533fffe0c157dd8498f021ddec66bff7
uses: msys2/setup-msys2@v2
with:
# Variant of the environment to set by default: MSYS, MINGW32, MINGW64, UCRT64 or CLANG64
msystem: ${{ matrix.compiler }}
# Retrieve and extract base installation from upstream GitHub Releases
release: false # optional, default is true
# Update MSYS2 installation through pacman
update: false
# Install packages after installation through pacman
install: ${{ matrix.installdeps }}
- name: Setup ubuntu dependencies
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install ${{ matrix.installdeps }}
# Copy all the sources to the dist folder, before we start generating intermediate files.
- name: prepare-package (Windows)
if: runner.os == 'Windows'
shell: msys2 {0}
run: |
mkdir dist
mkdir dist/src
cp -R ./temp/* dist/src
rm -Rf ./dist/src/.git
- name: configure (Windows)
if: runner.os == 'Windows'
shell: msys2 {0}
run: |
export INSTALL_PREFIX=$(pwd)/dist
mkdir temp/build
cd temp/build
cmake -G "Ninja" -DMSYS=TRUE -DCMAKE_INSTALL_PREFIX=$INSTALL_PREFIX ${{ matrix.args }} ..
- name: ninja (Windows)
if: runner.os == 'Windows'
shell: msys2 {0}
run: |
cd temp/build
ninja
- name: package (Windows)
if: runner.os == 'Windows'
shell: msys2 {0}
run: |
export INSTALL_PREFIX=$(pwd)/dist
export ARTIFACTSDIR=$(pwd)/artifacts
mkdir -p $ARTIFACTSDIR
cd temp/build
ninja install
cd $INSTALL_PREFIX
ntldd -R "bin/pcem.exe" | sed -e 's/^[[:blank:]]*//g' | cut -d ' ' -f 3 | grep -E -i '(mingw|clang)(32|64)' | sed -e 's|\\|/|g' | xargs cp --target-directory="bin"
zip -r -9 ${{ matrix.artifacts_path }} *
cp ${{ matrix.artifacts_path }} $ARTIFACTSDIR
- name: prepare-package (Linux)
if: runner.os == 'Linux'
run: |
mkdir dist
mkdir dist/src
cp -R ./temp/* dist/src
rm -Rf ./dist/src/.git
- name: configure (Linux)
if: runner.os == 'Linux'
run: |
mkdir temp/build
cd temp/build
cmake -G "Ninja" ${{ matrix.args }} ..
- name: ninja (Linux)
if: runner.os == 'Linux'
run: |
cd temp/build
ninja
- name: package (Linux)
if: runner.os == 'Linux'
run: |
export DESTDIR=$(pwd)/dist
export ARTIFACTSDIR=$(pwd)/artifacts
mkdir -p $ARTIFACTSDIR
cd temp/build
ninja install
cd $DESTDIR
tar -cjf ${{ matrix.artifacts_path }} *
cp ${{ matrix.artifacts_path }} $ARTIFACTSDIR
- name: "Upload GitHub Actions artifacts"
uses: actions/upload-artifact@v4.3.1
with:
name: ${{ matrix.artifacts_name }}
path: ./artifacts
- name: Upload to NasuTek MinIO S3
uses: shallwefootball/s3-upload-action@master
id: S3
with:
aws_key_id: ${{secrets.nte_cdn_s3_key_id}}
aws_secret_access_key: ${{secrets.nte_cdn_s3_secret_access_key}}
aws_bucket: pcem-dev-builds
source_dir: ./artifacts
destination_dir: ''
endpoint: https://cdn.ntgecdn.com:443

View File

@@ -20,27 +20,10 @@ jobs:
installdeps: >-
libsdl2-dev
libopenal-dev
libwxgtk3.0-gtk3-dev
libwxgtk3.2-dev
libpcap-dev
cmake
ninja-build
- name: Windows 32bits (MSYS2)
os: windows-latest
compiler: MINGW32
args: -DUSE_EXPERIMENTAL=ON -DUSE_EXPERIMENTAL_PRINTER=OFF -DUSE_EXPERIMENTAL_PGC=ON -DUSE_NETWORKING=ON -DUSE_PCAP_NETWORKING=OFF -DCMAKE_BUILD_TYPE=Debug -DPCEM_VERSION_STRING="vNext build ${GITHUB_SHA::8}"
artifacts_name: PCem-Debug-vNext-Windows-MINGW32-${{ github.run_number }}
artifacts_path: PCem-Debug-vNext-Windows-MINGW32-${{ github.run_number }}-${{ github.sha }}.zip
installdeps: >-
base-devel
zip
unzip
mingw-w64-i686-ntldd-git
mingw-w64-i686-toolchain
mingw-w64-i686-SDL2
mingw-w64-i686-openal
mingw-w64-i686-wxwidgets3.2-msw
mingw-w64-i686-cmake
mingw-w64-i686-ninja
- name: Windows 64bits (MSYS2)
os: windows-latest
compiler: MINGW64

View File

@@ -20,27 +20,10 @@ jobs:
installdeps: >-
libsdl2-dev
libopenal-dev
libwxgtk3.0-gtk3-dev
libwxgtk3.2-dev
libpcap-dev
cmake
ninja-build
- name: Windows 32bits (MSYS2)
os: windows-latest
compiler: MINGW32
args: -DUSE_EXPERIMENTAL=ON -DUSE_EXPERIMENTAL_PRINTER=OFF -DUSE_EXPERIMENTAL_PGC=ON -DUSE_NETWORKING=ON -DUSE_PCAP_NETWORKING=OFF -DCMAKE_BUILD_TYPE=Release -DPCEM_VERSION_STRING="vNext build ${GITHUB_SHA::8}"
artifacts_name: PCem-vNext-Windows-MINGW32-${{ github.run_number }}
artifacts_path: PCem-vNext-Windows-MINGW32-${{ github.run_number }}-${{ github.sha }}.zip
installdeps: >-
base-devel
zip
unzip
mingw-w64-i686-ntldd-git
mingw-w64-i686-toolchain
mingw-w64-i686-SDL2
mingw-w64-i686-openal
mingw-w64-i686-wxwidgets3.2-msw
mingw-w64-i686-cmake
mingw-w64-i686-ninja
- name: Windows 64bits (MSYS2)
os: windows-latest
compiler: MINGW64

View File

@@ -20,27 +20,10 @@ jobs:
installdeps: >-
libsdl2-dev
libopenal-dev
libwxgtk3.0-gtk3-dev
libwxgtk3.2-dev
libpcap-dev
cmake
ninja-build
- name: Windows 32bits (MSYS2)
os: windows-latest
compiler: MINGW32
args: -DUSE_EXPERIMENTAL=ON -DUSE_EXPERIMENTAL_PRINTER=OFF -DUSE_EXPERIMENTAL_PGC=ON -DUSE_NETWORKING=ON -DUSE_PCAP_NETWORKING=OFF -DCMAKE_BUILD_TYPE=RelWithDebInfo -DPCEM_RELDEB_AS_RELEASE=OFF -DPCEM_VERSION_STRING="vNext build ${GITHUB_SHA::8}"
artifacts_name: PCem-RelWithDebInfo-vNext-Windows-MINGW32-${{ github.run_number }}
artifacts_path: PCem-RelWithDebInfo-vNext-Windows-MINGW32-${{ github.run_number }}-${{ github.sha }}.zip
installdeps: >-
base-devel
zip
unzip
mingw-w64-i686-ntldd-git
mingw-w64-i686-toolchain
mingw-w64-i686-SDL2
mingw-w64-i686-openal
mingw-w64-i686-wxwidgets3.2-msw
mingw-w64-i686-cmake
mingw-w64-i686-ninja
- name: Windows 64bits (MSYS2)
os: windows-latest
compiler: MINGW64

View File

@@ -184,7 +184,7 @@ void disc_reset() {
curdrive = 0;
disc_period = 32;
timer_add(&disc_poll_timer, disc_poll, NULL, 0);
timer_add(&disc_poll_timer, (void *)disc_poll, NULL, 0);
for (drive = 0; drive < 2; drive++) {
if (loaders[driveloaders[drive]].close)

View File

@@ -1240,7 +1240,7 @@ void fdc_indexpulse() {
}
void fdc_init() {
timer_add(&fdc.timer, fdc_callback, NULL, 0);
timer_add(&fdc.timer, (void *)fdc_callback, NULL, 0);
fdc.dskchg_activelow = 0;
fdc.enable_3f1 = 1;

View File

@@ -1174,8 +1174,8 @@ static void *ide_init() {
ide_pri_enable();
ide_sec_enable();
timer_add(&ide_timer[0], ide_callback_pri, NULL, 0);
timer_add(&ide_timer[1], ide_callback_sec, NULL, 0);
timer_add(&ide_timer[0], (void *)ide_callback_pri, NULL, 0);
timer_add(&ide_timer[1], (void *)ide_callback_sec, NULL, 0);
return (void *)-1;
}

View File

@@ -159,5 +159,5 @@ void keyboard_amstrad_init() {
keyboard_send = keyboard_amstrad_adddata;
keyboard_poll = keyboard_amstrad_poll;
timer_add(&keyboard_amstrad.send_delay_timer, keyboard_amstrad_poll, NULL, 1);
timer_add(&keyboard_amstrad.send_delay_timer, (void *)keyboard_amstrad_poll, NULL, 1);
}

View File

@@ -844,7 +844,7 @@ void keyboard_at_init() {
keyboard_set_scancode_set(SCANCODE_SET_2);
keyboard_at.scancode_set = SCANCODE_SET_2;
timer_add(&keyboard_at.send_delay_timer, keyboard_at_poll, NULL, 1);
timer_add(&keyboard_at.send_delay_timer, (void *)keyboard_at_poll, NULL, 1);
}
void keyboard_at_set_mouse(void (*mouse_write)(uint8_t val, void *p), void *p) {

View File

@@ -314,5 +314,5 @@ void keyboard_olim24_init() {
keyboard_send = keyboard_olim24_adddata;
keyboard_poll = keyboard_olim24_poll;
timer_add(&keyboard_olim24.send_delay_timer, keyboard_olim24_poll, NULL, 1);
timer_add(&keyboard_olim24.send_delay_timer, (void *)keyboard_olim24_poll, NULL, 1);
}

View File

@@ -195,5 +195,5 @@ void keyboard_pcjr_init() {
keyboard_send = keyboard_pcjr_adddata;
keyboard_poll = keyboard_pcjr_poll;
timer_add(&keyboard_pcjr.send_delay_timer, keyboard_pcjr_poll, NULL, 1);
timer_add(&keyboard_pcjr.send_delay_timer, (void *)keyboard_pcjr_poll, NULL, 1);
}

View File

@@ -238,7 +238,7 @@ void keyboard_xt_init() {
keyboard_xt.tandy = 0;
keyboard_xt.pb2_turbo = (romset == ROM_GENXT || romset == ROM_DTKXT || romset == ROM_AMIXT || romset == ROM_PXXT) ? 1 : 0;
timer_add(&keyboard_xt.send_delay_timer, keyboard_xt_poll, NULL, 1);
timer_add(&keyboard_xt.send_delay_timer, (void *)keyboard_xt_poll, NULL, 1);
}
void keyboard_tandy_init() {
@@ -249,5 +249,5 @@ void keyboard_tandy_init() {
keyboard_poll = keyboard_xt_poll;
keyboard_xt.tandy = (romset != ROM_TANDY) ? 1 : 0;
timer_add(&keyboard_xt.send_delay_timer, keyboard_xt_poll, NULL, 1);
timer_add(&keyboard_xt.send_delay_timer, (void *)keyboard_xt_poll, NULL, 1);
}

View File

@@ -280,7 +280,7 @@ void initpc(int argc, char *argv[]) {
img_init();
#ifdef USE_NETWORKING
vlan_reset(); // NETWORK
network_card_init(network_card_current);
network_card_init();
#endif
// loadfont();
@@ -375,7 +375,7 @@ void resetpchard() {
#ifdef USE_NETWORKING
vlan_reset(); // NETWORK
network_card_init(network_card_current);
network_card_init();
#endif
sound_card_init();

View File

@@ -690,7 +690,7 @@ static void *scsi_53c400_init(char *bios_fn) {
static void *scsi_lcs6821n_init() { return scsi_53c400_init("Longshine LCS-6821N - BIOS version 1.04.bin"); }
static void *scsi_rt1000b_init() { return scsi_53c400_init("Rancho_RT1000_RTBios_version_8.10R.bin"); }
static void *scsi_t130b_init(char *bios_fn) {
static void *scsi_t130b_init() {
lcs6821n_t *scsi = malloc(sizeof(lcs6821n_t));
memset(scsi, 0, sizeof(lcs6821n_t));

View File

@@ -2117,7 +2117,7 @@ static void aha1542c_eeprom_save(aha154x_t *scsi) {
static uint16_t port_sw_mapping[8] = {0x330, 0x334, 0x230, 0x234, 0x130, 0x134, -1, -1};
static void *scsi_aha1542c_init(char *bios_fn) {
static void *scsi_aha1542c_init() {
aha154x_t *scsi = malloc(sizeof(aha154x_t));
uint32_t addr;
int c;
@@ -2160,7 +2160,7 @@ static void *scsi_aha1542c_init(char *bios_fn) {
return scsi;
}
static void *scsi_bt545s_init(char *bios_fn) {
static void *scsi_bt545s_init() {
aha154x_t *scsi = malloc(sizeof(aha154x_t));
uint32_t addr;
memset(scsi, 0, sizeof(aha154x_t));