Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1500 add physical cd drive support #1609

Merged
merged 31 commits into from
Jan 23, 2025
Merged
Changes from 1 commit
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
f33887f
feat: Add physical CD drive support in the GUI
midwan Nov 13, 2024
1feb58c
refactor: fix cdrom device names
midwan Nov 13, 2024
72507c2
refactor: remove unnecessary type change
midwan Nov 13, 2024
1aa52e6
refactor: store rootdir for CD devices in Amiberry
midwan Nov 13, 2024
d6fab36
feat: auto-detect and list physical cd drives in dropdowns
midwan Nov 14, 2024
a438cc3
refactor: added cdfs automount cd drives option in GUI
midwan Nov 14, 2024
e17794c
refactor: remove cd lists from dropdowns
midwan Nov 14, 2024
d365ada
refactor: minor optimizations in amiberry_filesys
midwan Nov 14, 2024
317d312
fixed build
midwan Nov 14, 2024
9ff49ba
feat: added blkdev_ioctl
midwan Nov 15, 2024
9a41642
Squashed commit of the following:
midwan Nov 16, 2024
56dc56a
Disable this for macOS for now
midwan Nov 16, 2024
9be4a72
better separation for macOS
midwan Nov 16, 2024
79ee7e5
Add device options in dropdowns.
midwan Nov 16, 2024
e420a8a
refactor sys_cddev_open
midwan Nov 16, 2024
22d02f0
refactor: improve IOCTL device detection
midwan Nov 16, 2024
317c385
silence some log entries that are making too much noise
midwan Nov 16, 2024
f286499
refactor: fetch geometry
midwan Nov 16, 2024
24190ae
refactor: remove no-op functions
midwan Nov 16, 2024
24e4725
refactor: close and re-open file handle when opening
midwan Nov 16, 2024
fe82bb1
Squashed commit of the following:
midwan Nov 23, 2024
261719b
Merge branch 'master' into 1500-add-physical-cd-drive-support
midwan Nov 25, 2024
618d72f
Merge branch 'master' into 1500-add-physical-cd-drive-support
midwan Nov 25, 2024
cc3d3a7
refactor: revert vbi changes #1515
midwan Nov 24, 2024
c2eeb04
Merge branch 'master' into 1500-add-physical-cd-drive-support
midwan Dec 5, 2024
1785c5e
Merge branch 'master' into 1500-add-physical-cd-drive-support
midwan Jan 6, 2025
1ce4f76
Fixes after merge
midwan Jan 6, 2025
8fd2ff4
refactor: use const in more places
midwan Jan 6, 2025
6e988f2
Merge branch 'master' into 1500-add-physical-cd-drive-support
midwan Jan 23, 2025
c0db52f
refactor: cdda_play should be int
midwan Jan 23, 2025
d6421ca
refactor: bring back PanelHDD changes after merge
midwan Jan 23, 2025
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
Prev Previous commit
Next Next commit
Squashed commit of the following:
commit 75572f4
Author: Dimitris Panokostas <[email protected]>
Date:   Sat Nov 23 10:59:04 2024 +0100

    bugfix: ensure CPack also has correct capitalization (fixes #1514)

commit 2e70acc
Author: Dimitris Panokostas <[email protected]>
Date:   Sat Nov 23 10:45:29 2024 +0100

    bugfix: Linux builds should have PROJECT_NAME in lower case

    Looks like the CMAKE_SYSTEM_NAME variable is only valid AFTER the project is set.
    We need a capitalized name for macOS builds, but lowercase for linux ones.

commit a1591ee
Author: Dimitris Panokostas <[email protected]>
Date:   Fri Nov 22 20:55:07 2024 +0100

    chore: only write config options if they are enabled

    - Manual Crop
    - Drawbridge

    These options would be written to the config always, even if not enabled

commit 249a132
Author: Dimitris Panokostas <[email protected]>
Date:   Fri Nov 22 20:48:03 2024 +0100

    chore: bump options version to 7.0.0

commit 85044a8
Author: Dimitris Panokostas <[email protected]>
Date:   Fri Nov 22 18:57:06 2024 +0100

    enhancement: add ".vbi" in global ROM extensions also #1507

commit 63fee15
Author: Dimitris Panokostas <[email protected]>
Date:   Fri Nov 22 18:54:22 2024 +0100

    fix typo

    It's not vdi, but vbi

commit 2c1e921
Author: Dimitris Panokostas <[email protected]>
Date:   Fri Nov 22 18:52:07 2024 +0100

    bugfix: allow .vdi selection in Expansions ROMs #1507

    These types of files are VGA rom files, but they were filtered out based on the filename extensions

commit 1718e2c
Author: Dimitris Panokostas <[email protected]>
Date:   Fri Nov 22 18:38:44 2024 +0100

    bugfix: #1507 Expansions GUI CPU board fixes

    When selecting a CPU board from the dropdown, the sub-options did not get enables as expected

commit f7f09bf
Author: Dimitris Panokostas <[email protected]>
Date:   Fri Nov 22 08:39:49 2024 +0100

    Update README.md

    Remove obsolete info about bypassing security on MacOS installation

commit 9d0c218
Author: Dimitris Panokostas <[email protected]>
Date:   Fri Nov 22 00:46:20 2024 +0100

    ci: added missing team ID

commit a197c86
Author: Dimitris Panokostas <[email protected]>
Date:   Fri Nov 22 00:36:07 2024 +0100

    ci: added notary service steps

commit 10fe364
Author: Dimitris Panokostas <[email protected]>
Date:   Fri Nov 22 00:04:40 2024 +0100

    ci: fix macOS signing

commit 97a7021
Author: Dimitris Panokostas <[email protected]>
Date:   Thu Nov 21 23:53:19 2024 +0100

    ci: fix capitalization for MacOS App bundle

commit 0fe6e54
Author: Dimitris Panokostas <[email protected]>
Date:   Thu Nov 21 23:53:00 2024 +0100

    ci: Add Apple certificate signing to dylibs and app bundle

commit 0344272
Author: Dimitris Panokostas <[email protected]>
Date:   Thu Nov 21 20:29:38 2024 +0100

    ci: Added missing create keychain step

commit 935fcda
Author: Dimitris Panokostas <[email protected]>
Date:   Thu Nov 21 20:09:34 2024 +0100

    ci: add apple signing certificate setup in workflow

commit d9804b3
Author: Dimitris Panokostas <[email protected]>
Date:   Sat Nov 16 10:48:46 2024 +0100

    Update README.md (#1511)
midwan committed Nov 23, 2024

Verified

This commit was signed with the committer’s verified signature. The key has expired.
midwan Dimitris Panokostas
commit fe82bb139e75af557ef1c8192ace1fe2a6fd72ea
108 changes: 104 additions & 4 deletions .github/workflows/c-cpp.yml
Original file line number Diff line number Diff line change
@@ -24,16 +24,66 @@ jobs:
brew update
brew install sdl2 mpg123 sdl2_ttf sdl2_image flac libmpeg2 libserialport portmidi enet dylibbundler

- name: make for macOS X64
- name: Install the Apple certificate
env:
APPLE_DEVID_CERT_BASE64: ${{ secrets.APPLE_DEVID_CERT_BASE64 }}
APPLE_DEVID_CERT_P12_PASSWORD: ${{ secrets.APPLE_DEVID_CERT_P12_PASSWORD }}
APPLE_KEYCHAIN_PASSWORD: ${{ secrets.APPLE_KEYCHAIN_PASSWORD }}
run: |
# create variables
CERTIFICATE_PATH=$RUNNER_TEMP/apple_devid_cert.p12
KEYCHAIN_PATH=$RUNNER_TEMP/app-signing.keychain-db

# import certificate from secret
echo -n "$APPLE_DEVID_CERT_BASE64" | base64 --decode -o $CERTIFICATE_PATH

# create keychain
security create-keychain -p $APPLE_KEYCHAIN_PASSWORD $KEYCHAIN_PATH
security set-keychain-settings -lut 21600 $KEYCHAIN_PATH
security unlock-keychain -p $APPLE_KEYCHAIN_PASSWORD $KEYCHAIN_PATH

# import certificate to keychain
security import $CERTIFICATE_PATH -P $APPLE_DEVID_CERT_P12_PASSWORD -A -t cert -f pkcs12 -k $KEYCHAIN_PATH
security set-key-partition-list -S apple-tool:,apple: -s -k $APPLE_KEYCHAIN_PASSWORD $KEYCHAIN_PATH
security list-keychains -d user -s $KEYCHAIN_PATH

- name: Build for macOS X64
run: |
cmake -B build && cmake --build build -j4

- name: Codesign the dylibs
run: |
for file in build/Amiberry.app/Contents/Frameworks/*.dylib; do
if [ -f "$file" ]; then
codesign -s "Developer ID Application: Dimitris Panokostas (5GQP72592A)" -f -o runtime,hard $file
fi
done

- name: Codesign the app
run: |
codesign -s "Developer ID Application: Dimitris Panokostas (5GQP72592A)" -f -o runtime,hard build/Amiberry.app

- name: Create a zip to send to the notary service
run: |
zip -r Amiberry-${{ github.sha }}-macOS-x86_64.zip build/Amiberry.app

- name: Send the file to be notarized by Apple
run: |
xcrun notarytool submit Amiberry-${{ github.sha }}-macOS-x86_64.zip --wait --apple-id "[email protected]" --password ${{ secrets.APPLE_NOTARY_APP_PASSWORD }} --team-id ${{ secrets.APPLE_TEAM_ID }}

- name: Staple the notary receipt to the application bundle
run: |
xcrun stapler staple build/Amiberry.app

- name: Create DMG package
run: |
cpack -G DragNDrop --config build/CPackConfig.cmake

- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: amiberry-macOS-64bit-intel
path: amiberry-*.dmg
path: Amiberry-*.dmg

build-macOS-Apple-Silicon:
runs-on: macos-latest
@@ -47,16 +97,66 @@ jobs:
brew upgrade
brew install sdl2 mpg123 sdl2_ttf sdl2_image flac libmpeg2 libserialport portmidi enet dylibbundler

- name: make for macOS Apple Silicon
- name: Install the Apple certificate
env:
APPLE_DEVID_CERT_BASE64: ${{ secrets.APPLE_DEVID_CERT_BASE64 }}
APPLE_DEVID_CERT_P12_PASSWORD: ${{ secrets.APPLE_DEVID_CERT_P12_PASSWORD }}
APPLE_KEYCHAIN_PASSWORD: ${{ secrets.APPLE_KEYCHAIN_PASSWORD }}
run: |
# create variables
CERTIFICATE_PATH=$RUNNER_TEMP/apple_devid_cert.p12
KEYCHAIN_PATH=$RUNNER_TEMP/app-signing.keychain-db

# import certificate from secret
echo -n "$APPLE_DEVID_CERT_BASE64" | base64 --decode -o $CERTIFICATE_PATH

# create keychain
security create-keychain -p $APPLE_KEYCHAIN_PASSWORD $KEYCHAIN_PATH
security set-keychain-settings -lut 21600 $KEYCHAIN_PATH
security unlock-keychain -p $APPLE_KEYCHAIN_PASSWORD $KEYCHAIN_PATH

# import certificate to keychain
security import $CERTIFICATE_PATH -P $APPLE_DEVID_CERT_P12_PASSWORD -A -t cert -f pkcs12 -k $KEYCHAIN_PATH
security set-key-partition-list -S apple-tool:,apple: -s -k $APPLE_KEYCHAIN_PASSWORD $KEYCHAIN_PATH
security list-keychains -d user -s $KEYCHAIN_PATH

- name: Build for macOS Apple Silicon
run: |
cmake -B build && cmake --build build -j4

- name: Codesign the dylibs
run: |
for file in build/Amiberry.app/Contents/Frameworks/*.dylib; do
if [ -f "$file" ]; then
codesign -s "Developer ID Application: Dimitris Panokostas (5GQP72592A)" -f -o runtime,hard $file
fi
done

- name: Codesign the app
run: |
codesign -s "Developer ID Application: Dimitris Panokostas (5GQP72592A)" -f -o runtime,hard build/Amiberry.app

- name: Create a zip to send to the notary service
run: |
zip -r Amiberry-${{ github.sha }}-macOS-Apple-Silicon.zip build/Amiberry.app

- name: Send the file to be notarized by Apple
run: |
xcrun notarytool submit Amiberry-${{ github.sha }}-macOS-Apple-Silicon.zip --wait --apple-id "[email protected]" --password ${{ secrets.APPLE_NOTARY_APP_PASSWORD }} --team-id ${{ secrets.APPLE_TEAM_ID }}

- name: Staple the notary receipt to the application bundle
run: |
xcrun stapler staple build/Amiberry.app

- name: Create DMG package
run: |
cpack -G DragNDrop --config build/CPackConfig.cmake

- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: amiberry-macOS-64bit-apple-silicon
path: amiberry-*.dmg
path: Amiberry-*.dmg

build-ubuntu-24-amd64:
runs-on: ubuntu-24.04
12 changes: 5 additions & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -21,18 +21,16 @@ set(VERSION_PATCH "0")

set(VERSION "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}")

if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
set(PROJECT_NAME "Amiberry")
else ()
set(PROJECT_NAME "amiberry")
endif ()

project(${PROJECT_NAME}
project(amiberry
VERSION ${VERSION}
LANGUAGES C CXX
DESCRIPTION "Optimized Amiga emulator for various platforms"
HOMEPAGE_URL "https://amiberry.com"
)
if (CMAKE_SYSTEM_NAME STREQUAL "Darwin")
set(PROJECT_NAME "Amiberry")
set(CMAKE_PROJECT_NAME "Amiberry")
endif ()
set(PROJECT_COMPANY_NAME "BlitterStudio")
set(PROJECT_COMPANY_NAMESPACE "com.blitterstudio") # Reverse domain name notation

4 changes: 2 additions & 2 deletions cmake/SourceFiles.cmake
Original file line number Diff line number Diff line change
@@ -392,8 +392,8 @@ set_target_properties(${PROJECT_NAME} PROPERTIES
MACOSX_BUNDLE_EXECUTABLE_NAME "Amiberry"
MACOSX_BUNDLE_INFO_STRING "${PROJECT_NAME} ${PROJECT_VERSION}"
MACOSX_BUNDLE_ICON_FILE "data/icon"
MACOSX_BUNDLE_GUI_IDENTIFIER "com.blitterstudio.amiberry"
XCODE_ATTRIBUTE_PRODUCT_BUNDLE_IDENTIFIER "com.blitterstudio.amiberry"
MACOSX_BUNDLE_GUI_IDENTIFIER "com.blitterstudio.Amiberry"
XCODE_ATTRIBUTE_PRODUCT_BUNDLE_IDENTIFIER "com.blitterstudio.Amiberry"
MACOSX_BUNDLE_LONG_VERSION_STRING ${PROJECT_VERSION}
MACOSX_BUNDLE_BUNDLE_NAME "Amiberry"
MACOSX_BUNDLE_SHORT_VERSION_STRING ${PROJECT_VERSION}
2 changes: 0 additions & 2 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -43,8 +43,6 @@ If you're on Arch Linux you'll find Amiberry on the [AUR](https://aur.archlinux.

Amiberry is available as a DMG package for macOS. You can download the latest version from the [Releases](https://github.com/BlitterStudio/amiberry/releases) area.

After installing it in your Applications folder, you'll need to open a console and run `xattr -rd com.apple.quarantine Amiberry.app`, to whitelist it and allow it to run. Alternatively, macOS might ask you about allowing it to run, and you'll have to manually do that (the exact steps differ from one macOS version to another).

### Distro package management

Some distros (like RetroPie, DietPi, Pimiga and others) already include Amiberry either pre-installed, or through their package management systems. Please follow the methods provided in those distros for a smoother experience, and refer to their owners for support during this process.
6 changes: 3 additions & 3 deletions src/include/options.h
Original file line number Diff line number Diff line change
@@ -18,9 +18,9 @@
#include "traps.h"
#include "guisan/color.hpp"

#define UAEMAJOR 6
#define UAEMINOR 3
#define UAESUBREV 5
#define UAEMAJOR 7
#define UAEMINOR 0
#define UAESUBREV 0

#define MAX_AMIGADISPLAYS 1

29 changes: 19 additions & 10 deletions src/osdep/amiberry.cpp
Original file line number Diff line number Diff line change
@@ -2505,10 +2505,16 @@ void target_save_options(struct zfile* f, struct uae_prefs* p)

cfgfile_target_dwrite(f, _T("gfx_horizontal_offset"), _T("%d"), p->gfx_horizontal_offset);
cfgfile_target_dwrite(f, _T("gfx_vertical_offset"), _T("%d"), p->gfx_vertical_offset);
cfgfile_target_dwrite_bool(f, _T("gfx_auto_crop"), p->gfx_auto_crop);
cfgfile_target_dwrite_bool(f, _T("gfx_manual_crop"), p->gfx_manual_crop);
cfgfile_target_dwrite(f, _T("gfx_manual_crop_width"), _T("%d"), p->gfx_manual_crop_width);
cfgfile_target_dwrite(f, _T("gfx_manual_crop_height"), _T("%d"), p->gfx_manual_crop_height);
if (p->gfx_auto_crop)
{
cfgfile_target_dwrite_bool(f, _T("gfx_auto_crop"), p->gfx_auto_crop);
}
else if (p->gfx_manual_crop)
{
cfgfile_target_dwrite_bool(f, _T("gfx_manual_crop"), p->gfx_manual_crop);
cfgfile_target_dwrite(f, _T("gfx_manual_crop_width"), _T("%d"), p->gfx_manual_crop_width);
cfgfile_target_dwrite(f, _T("gfx_manual_crop_height"), _T("%d"), p->gfx_manual_crop_height);
}
cfgfile_target_dwrite(f, _T("gfx_correct_aspect"), _T("%d"), p->gfx_correct_aspect);
cfgfile_target_dwrite(f, _T("kbd_led_num"), _T("%d"), p->kbd_led_num);
cfgfile_target_dwrite(f, _T("kbd_led_scr"), _T("%d"), p->kbd_led_scr);
@@ -2521,12 +2527,15 @@ void target_save_options(struct zfile* f, struct uae_prefs* p)
cfgfile_target_dwrite_str(f, _T("fullscreen_toggle"), p->fullscreen_toggle);
cfgfile_target_dwrite_str(f, _T("minimize"), p->minimize);

cfgfile_target_dwrite(f, _T("drawbridge_driver"), _T("%d"), p->drawbridge_driver);
cfgfile_target_dwrite_bool(f, _T("drawbridge_serial_autodetect"), p->drawbridge_serial_auto);
cfgfile_target_write_str(f, _T("drawbridge_serial_port"), p->drawbridge_serial_port);
cfgfile_target_dwrite_bool(f, _T("drawbridge_smartspeed"), p->drawbridge_smartspeed);
cfgfile_target_dwrite_bool(f, _T("drawbridge_autocache"), p->drawbridge_autocache);
cfgfile_target_dwrite_bool(f, _T("drawbridge_connected_drive_b"), p->drawbridge_connected_drive_b);
if (p->drawbridge_driver > 0)
{
cfgfile_target_dwrite(f, _T("drawbridge_driver"), _T("%d"), p->drawbridge_driver);
cfgfile_target_dwrite_bool(f, _T("drawbridge_serial_autodetect"), p->drawbridge_serial_auto);
cfgfile_target_write_str(f, _T("drawbridge_serial_port"), p->drawbridge_serial_port);
cfgfile_target_dwrite_bool(f, _T("drawbridge_smartspeed"), p->drawbridge_smartspeed);
cfgfile_target_dwrite_bool(f, _T("drawbridge_autocache"), p->drawbridge_autocache);
cfgfile_target_dwrite_bool(f, _T("drawbridge_connected_drive_b"), p->drawbridge_connected_drive_b);
}

cfgfile_target_dwrite_bool(f, _T("alt_tab_release"), p->alt_tab_release);
cfgfile_target_dwrite(f, _T("sound_pullmode"), _T("%d"), p->sound_pullmode);
2 changes: 1 addition & 1 deletion src/osdep/amiberry_gui.cpp
Original file line number Diff line number Diff line change
@@ -380,7 +380,7 @@ static int isromext(const std::string& path, bool deepscan)
return 0;
const std::string ext = path.substr(ext_pos + 1);

static const std::vector<std::string> extensions = { "rom", "bin", "adf", "key", "a500", "a1200", "a4000", "cdtv", "cd32" };
static const std::vector<std::string> extensions = { "rom", "bin", "vbi", "adf", "key", "a500", "a1200", "a4000", "cdtv", "cd32" };
if (std::find(extensions.begin(), extensions.end(), ext) != extensions.end())
return 1;

6 changes: 4 additions & 2 deletions src/osdep/gui/PanelExpansions.cpp
Original file line number Diff line number Diff line change
@@ -891,7 +891,7 @@ class ExpansionsActionListener : public gcn::ActionListener

if (source == btnScsiRomChooser)
{
const char* filter[] = { ".rom", ".bin", "\0" };
const char* filter[] = { ".rom", ".bin", ".vbi", "\0" };
std::string full_path = SelectFile("Select ROM", get_rom_path(), filter);
if (!full_path.empty())
{
@@ -908,7 +908,7 @@ class ExpansionsActionListener : public gcn::ActionListener
}
else if (source == btnCpuBoardRomChooser)
{
const char* filter[] = { ".rom", ".bin", "\0" };
const char* filter[] = { ".rom", ".bin", ".vbi", "\0" };
std::string full_path = SelectFile("Select ROM", get_rom_path(), filter);
if (!full_path.empty())
{
@@ -1022,6 +1022,7 @@ class ExpansionsActionListener : public gcn::ActionListener
}
cpuboard_set_cpu(&changed_prefs);
setcpuboardmemsize();
enable_for_expansion2dlg();
values_to_expansion2dlg();
}
}
@@ -1041,6 +1042,7 @@ class ExpansionsActionListener : public gcn::ActionListener
}
cpuboard_set_cpu(&changed_prefs);
setcpuboardmemsize();
enable_for_expansion2dlg();
values_to_expansion2dlg();
}
}