Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion Builder/Android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ android {
minSdk 19
targetSdk 35
versionCode 4
versionName "1.75"
versionName "1.77"
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
externalNativeBuild {
ndkBuild {
Expand Down
2 changes: 1 addition & 1 deletion Builder/Android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
android:versionCode="4"
android:versionName="1.75"
android:versionName="1.77"
android:installLocation="auto">

<!-- OpenGL ES 2.0 -->
Expand Down
4 changes: 2 additions & 2 deletions Builder/Windows/XM8.rc
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,12 @@ BEGIN
BEGIN
VALUE "CompanyName", "\0"
VALUE "FileDescription", "PC-8801MA EMULATOR XM8\0"
VALUE "FileVersion", "1.7.5.0\0"
VALUE "FileVersion", "1.7.7.0\0"
VALUE "InternalName", "XM8.exe"
VALUE "LegalCopyright", "Copyright (C) 2015-2018 �o�h�D"
VALUE "OriginalFilename", "XM8.exe"
VALUE "ProductName", "XM8"
VALUE "ProductVersion", "1.7.5.0\0"
VALUE "ProductVersion", "1.7.7.0\0"
END
END
BLOCK "VarFileInfo"
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ http://retropc.net/pi/xm8/index.html

| CPU | 最小OSバージョン | 実行ファイル |
| ------------- | ------------------- | ------------------------------------------------------------ |
| x86_64 | macOS 10.13 High Sierra | [x86_64版](https://github.com/bubio/xm8mac/releases/download/1.7.6/XM8_macOS_Universal.dmg) |
| Apple Silicon | macOS 11 Big Sur | [Apple Silicon版](https://github.com/bubio/xm8mac/releases/download/1.7.6/XM8_macOS_Universal.dmg) |
| x86_64 | macOS 10.13 High Sierra | [x86_64版](https://github.com/bubio/xm8mac/releases/download/1.7.7/XM8_macOS_Universal.dmg) |
| Apple Silicon | macOS 11 Big Sur | [Apple Silicon版](https://github.com/bubio/xm8mac/releases/download/1.7.7/XM8_macOS_Universal.dmg) |

<br />

Expand Down
26 changes: 18 additions & 8 deletions Source/ePC-8801MA/vm/event.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@
#ifdef SDL
#define SINGLE_EXEC_TIMEOUT 10000
// exit single exec mode (us)
#define SINGLE_EXEC_TIMEOUT_8MHZ 20000
// 8MHz mode needs wider window for stable FDC timing
#define SINGLE_EXEC_SLICE 4
// max clocks per single-exec step
#define SINGLE_EXEC_SLICE_8MHZ 20
// 8MHz mode needs larger slice for CPU to keep up
#endif // SDL

void EVENT::initialize()
Expand Down Expand Up @@ -145,8 +151,9 @@ void EVENT::drive()
{
#ifdef SDL
if (single_exec == true) {
// if passed 10ms, disable single_exec
if (passed_usec(single_exec_clock) > SINGLE_EXEC_TIMEOUT) {
// if passed timeout, disable single_exec
int timeout = (config.cpu_type == 0) ? SINGLE_EXEC_TIMEOUT_8MHZ : SINGLE_EXEC_TIMEOUT;
if (passed_usec(single_exec_clock) > timeout) {
single_exec = false;
}
}
Expand Down Expand Up @@ -244,8 +251,9 @@ void EVENT::drive()
if (main_cpu_exec > 0) {
// single execution ?
if (single_exec == true) {
if (main_cpu_exec > 4) {
main_cpu_exec = 4;
int slice = (config.cpu_type == 0) ? SINGLE_EXEC_SLICE_8MHZ : SINGLE_EXEC_SLICE;
if (main_cpu_exec > slice) {
main_cpu_exec = slice;
}
}
cpu_done = d_cpu[0].device->run(main_cpu_exec);
Expand All @@ -263,8 +271,9 @@ void EVENT::drive()
if (cpu_remain > 0) {
sub_cpu_exec = cpu_remain;
if (single_exec == true) {
if (sub_cpu_exec > 4) {
sub_cpu_exec = 4;
int slice = (config.cpu_type == 0) ? SINGLE_EXEC_SLICE_8MHZ : SINGLE_EXEC_SLICE;
if (sub_cpu_exec > slice) {
sub_cpu_exec = slice;
}
}

Expand All @@ -277,8 +286,9 @@ void EVENT::drive()
if (cpu_remain > 2) {
sub_cpu_exec = cpu_remain / 2;
if (single_exec == true) {
if (sub_cpu_exec > 4) {
sub_cpu_exec = 4;
int slice = (config.cpu_type == 0) ? SINGLE_EXEC_SLICE_8MHZ : SINGLE_EXEC_SLICE;
if (sub_cpu_exec > slice) {
sub_cpu_exec = slice;
}
}

Expand Down
20 changes: 15 additions & 5 deletions Source/ePC-8801MA/vm/upd765a.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,9 @@ void UPD765A::write_signal(int id, uint32 data, uint32 mask)
} else if(id == SIG_UPD765A_TC) {
#ifdef SDL
// phase==PHASE_EXEC support (for Xanadu Scenario II)
if(phase == PHASE_READ || phase == PHASE_WRITE || phase == PHASE_SCAN || (phase == PHASE_RESULT && count == 7) || (phase == PHASE_EXEC)) {
// but disable for 8MHz mode where it destabilizes Wizardry boot
bool tc_accept_exec = (config.cpu_type != 0);
if(phase == PHASE_READ || phase == PHASE_WRITE || phase == PHASE_SCAN || (phase == PHASE_RESULT && count == 7) || (tc_accept_exec && phase == PHASE_EXEC)) {
#else
if(phase == PHASE_READ || phase == PHASE_WRITE || phase == PHASE_SCAN || (phase == PHASE_RESULT && count == 7)) {
#endif // SDL
Expand Down Expand Up @@ -518,7 +520,7 @@ void UPD765A::set_drq(bool val)
if((command & 0x1f) != 0x0d) {
#ifdef SDL
// for customized event manager + 2HD disk
register_event(this, EVENT_LOST, 30000, false, &lost_id);
register_event(this, EVENT_LOST, 15000, false, &lost_id);
#else
register_event(this, EVENT_LOST, disk[hdu & DRIVE_MASK]->get_usec_per_bytes(1), false, &lost_id);
#endif // SDL
Expand Down Expand Up @@ -684,8 +686,8 @@ void UPD765A::cmd_recalib()

void UPD765A::seek(int drv, int trk)
{
// get distance
int seektime = 32 - 2 * step_rate_time;
// get distance (step rate is in msec units, convert to usec)
int seektime = (32 - 2 * step_rate_time) * 1000; // msec -> usec
if(disk[drv]->drive_type == DRIVE_TYPE_2HD) {
seektime /= 2;
}
Expand Down Expand Up @@ -1466,7 +1468,15 @@ double UPD765A::get_usec_to_exec_phase()
int drv = hdu & DRIVE_MASK;
int trk = fdc[drv].track;
int side = (hdu >> 2) & 1;


#ifdef SDL
// Use constant exec-phase delay for SDL mode.
// The SDL event system's position tracking is not precise enough
// for rotational-position-based timing, which causes timing-sensitive
// titles (e.g. Wizardry) to fail during boot.
return 100;
#endif

// XXX: this is a standard image and skew may be incorrect
if(disk[drv]->is_standard_image) {
return 100;
Expand Down
88 changes: 88 additions & 0 deletions scripts/update_version.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
#
# Update version number across all build systems.
#
# Usage: .\scripts\update_version.ps1 <major> <minor> <patch>
# Example: .\scripts\update_version.ps1 1 7 8
#

param(
[Parameter(Mandatory)][int]$Major,
[Parameter(Mandatory)][int]$Minor,
[Parameter(Mandatory)][int]$Patch
)

Set-StrictMode -Version Latest
$ErrorActionPreference = 'Stop'

if ($Major -lt 0 -or $Major -gt 9 -or $Minor -lt 0 -or $Minor -gt 9 -or $Patch -lt 0 -or $Patch -gt 9) {
Write-Error "major, minor, patch must each be a single digit (0-9)"
exit 1
}

$RootDir = Split-Path -Parent (Split-Path -Parent $MyInvocation.MyCommand.Path)

$VerDot = "$Major.$Minor.$Patch"
$VerBCD = '0x{0:X2}{1:X}{2:X}' -f $Major, $Minor, $Patch
$VerAndroid = "$Major.$Minor$Patch"

Write-Host "Updating version to $VerDot (BCD: $VerBCD, Android: $VerAndroid)"

# Helper: read file, replace, write back (preserving encoding)
function Replace-InFile {
param([string]$Path, [string]$Pattern, [string]$Replacement)
$content = [System.IO.File]::ReadAllText($Path)
$newContent = [regex]::Replace($content, $Pattern, $Replacement)
if ($content -eq $newContent) {
Write-Warning "No match for pattern in $Path"
}
[System.IO.File]::WriteAllText($Path, $newContent)
}

# 1. CMakeLists.txt
Replace-InFile "$RootDir\CMakeLists.txt" `
'(?m)^(set\(PROJECT_VERSION )\d+\.\d+\.\d+\)' `
"`${1}$VerDot)"

# 2. Source/UI/app.cpp
Replace-InFile "$RootDir\Source\UI\app.cpp" `
'(?m)^(#define APP_VER\s+)0x[0-9A-Fa-f]+' `
"`${1}$VerBCD"

# 3. Builder/Windows/XM8.rc — numeric versions
Replace-InFile "$RootDir\Builder\Windows\XM8.rc" `
'(?m)^(FILEVERSION\s+)\d+,\d+,\d+,\d+' `
"`${1}$Major,$Minor,$Patch,0"
Replace-InFile "$RootDir\Builder\Windows\XM8.rc" `
'(?m)^(PRODUCTVERSION\s+)\d+,\d+,\d+,\d+' `
"`${1}$Major,$Minor,$Patch,0"

# 3b. XM8.rc — string versions
Replace-InFile "$RootDir\Builder\Windows\XM8.rc" `
'(VALUE "FileVersion",\s+")\d+\.\d+\.\d+\.\d+' `
"`${1}$VerDot.0"
Replace-InFile "$RootDir\Builder\Windows\XM8.rc" `
'(VALUE "ProductVersion",\s+")\d+\.\d+\.\d+\.\d+' `
"`${1}$VerDot.0"

# 4. build.gradle
Replace-InFile "$RootDir\Builder\Android\app\build.gradle" `
'(versionName ")\d+\.\d+"' `
"`${1}$VerAndroid`""

# 5. AndroidManifest.xml
Replace-InFile "$RootDir\Builder\Android\app\src\main\AndroidManifest.xml" `
'(android:versionName=")\d+\.\d+"' `
"`${1}$VerAndroid`""

# 6. README.md
Replace-InFile "$RootDir\README.md" `
'(releases/download/)\d+\.\d+\.\d+/' `
"`${1}$VerDot/"

Write-Host "Done. Updated files:"
Write-Host " CMakeLists.txt"
Write-Host " Source\UI\app.cpp"
Write-Host " Builder\Windows\XM8.rc"
Write-Host " Builder\Android\app\build.gradle"
Write-Host " Builder\Android\app\src\main\AndroidManifest.xml"
Write-Host " README.md"
77 changes: 77 additions & 0 deletions scripts/update_version.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
#!/usr/bin/env bash
#
# Update version number across all build systems.
#
# Usage: ./scripts/update_version.sh <major> <minor> <patch>
# Example: ./scripts/update_version.sh 1 7 8
#

set -euo pipefail

if [ $# -ne 3 ]; then
echo "Usage: $0 <major> <minor> <patch>"
echo "Example: $0 1 7 8"
exit 1
fi

MAJOR=$1
MINOR=$2
PATCH=$3

# Validate: single digits only (BCD constraint)
if ! [[ "$MAJOR" =~ ^[0-9]$ && "$MINOR" =~ ^[0-9]$ && "$PATCH" =~ ^[0-9]$ ]]; then
echo "Error: major, minor, patch must each be a single digit (0-9)"
exit 1
fi

SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
ROOT_DIR="$(cd "$SCRIPT_DIR/.." && pwd)"

VER_DOT="${MAJOR}.${MINOR}.${PATCH}"
VER_BCD=$(printf "0x%02X%X%X" "$MAJOR" "$MINOR" "$PATCH")
VER_ANDROID="${MAJOR}.${MINOR}${PATCH}"

echo "Updating version to ${VER_DOT} (BCD: ${VER_BCD}, Android: ${VER_ANDROID})"

# 1. CMakeLists.txt — set(PROJECT_VERSION X.Y.Z)
sed -i.bak -E "s/^(set\(PROJECT_VERSION )[0-9]+\.[0-9]+\.[0-9]+\)/\1${VER_DOT})/" \
"$ROOT_DIR/CMakeLists.txt"

# 2. Source/UI/app.cpp — #define APP_VER 0xXYZ
sed -i.bak -E "s/^(#define APP_VER[[:space:]]+)0x[0-9A-Fa-f]+/\1${VER_BCD}/" \
"$ROOT_DIR/Source/UI/app.cpp"

# 3. Builder/Windows/XM8.rc — FILEVERSION / PRODUCTVERSION (numeric)
sed -i.bak -E "s/^(FILEVERSION[[:space:]]+)[0-9]+,[0-9]+,[0-9]+,[0-9]+/\1${MAJOR},${MINOR},${PATCH},0/" \
"$ROOT_DIR/Builder/Windows/XM8.rc"
sed -i.bak -E "s/^(PRODUCTVERSION[[:space:]]+)[0-9]+,[0-9]+,[0-9]+,[0-9]+/\1${MAJOR},${MINOR},${PATCH},0/" \
"$ROOT_DIR/Builder/Windows/XM8.rc"

# 3b. XM8.rc — FileVersion / ProductVersion (string)
sed -i.bak -E "s/(VALUE \"FileVersion\",[[:space:]]+\")[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+/\1${VER_DOT}.0/" \
"$ROOT_DIR/Builder/Windows/XM8.rc"
sed -i.bak -E "s/(VALUE \"ProductVersion\",[[:space:]]+\")[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+/\1${VER_DOT}.0/" \
"$ROOT_DIR/Builder/Windows/XM8.rc"

# 4. Builder/Android/app/build.gradle — versionName
sed -i.bak -E "s/(versionName \")[0-9]+\.[0-9]+\"/\1${VER_ANDROID}\"/" \
"$ROOT_DIR/Builder/Android/app/build.gradle"

# 5. Builder/Android/app/src/main/AndroidManifest.xml — android:versionName
sed -i.bak -E "s/(android:versionName=\")[0-9]+\.[0-9]+\"/\1${VER_ANDROID}\"/" \
"$ROOT_DIR/Builder/Android/app/src/main/AndroidManifest.xml"

# 6. README.md — download URL version
sed -i.bak -E "s|(releases/download/)[0-9]+\.[0-9]+\.[0-9]+/|\1${VER_DOT}/|g" \
"$ROOT_DIR/README.md"

# Clean up .bak files
find "$ROOT_DIR" -name "*.bak" -newer "$0" -delete 2>/dev/null || true

echo "Done. Updated files:"
echo " CMakeLists.txt"
echo " Source/UI/app.cpp"
echo " Builder/Windows/XM8.rc"
echo " Builder/Android/app/build.gradle"
echo " Builder/Android/app/src/main/AndroidManifest.xml"
echo " README.md"
Loading