mirror of
https://github.com/trudnai/Steve2.git
synced 2025-01-17 10:30:35 +00:00
Disk Sound Effect enable button
This commit is contained in:
parent
3ef337771b
commit
6f78b92344
@ -1394,13 +1394,13 @@
|
|||||||
</customSpacing>
|
</customSpacing>
|
||||||
</stackView>
|
</stackView>
|
||||||
<stackView distribution="fill" orientation="vertical" alignment="leading" horizontalStackHuggingPriority="249.99998474121094" verticalStackHuggingPriority="249.99998474121094" detachesHiddenViews="YES" translatesAutoresizingMaskIntoConstraints="NO" id="lVP-FP-u6x" userLabel="CPU Speed Selection">
|
<stackView distribution="fill" orientation="vertical" alignment="leading" horizontalStackHuggingPriority="249.99998474121094" verticalStackHuggingPriority="249.99998474121094" detachesHiddenViews="YES" translatesAutoresizingMaskIntoConstraints="NO" id="lVP-FP-u6x" userLabel="CPU Speed Selection">
|
||||||
<rect key="frame" x="8" y="8" width="104" height="301"/>
|
<rect key="frame" x="8" y="8" width="104" height="323"/>
|
||||||
<subviews>
|
<subviews>
|
||||||
<box verticalHuggingPriority="750" boxType="separator" translatesAutoresizingMaskIntoConstraints="NO" id="7yw-J0-Fmj">
|
<box verticalHuggingPriority="750" boxType="separator" translatesAutoresizingMaskIntoConstraints="NO" id="7yw-J0-Fmj">
|
||||||
<rect key="frame" x="0.0" y="298" width="96" height="5"/>
|
<rect key="frame" x="0.0" y="320" width="96" height="5"/>
|
||||||
</box>
|
</box>
|
||||||
<button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="e2E-di-h3i">
|
<button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="e2E-di-h3i">
|
||||||
<rect key="frame" x="-2" y="276" width="83" height="18"/>
|
<rect key="frame" x="-2" y="298" width="83" height="18"/>
|
||||||
<buttonCell key="cell" type="check" title="KeybStick" bezelStyle="regularSquare" imagePosition="left" state="on" inset="2" id="UW9-Bt-pMv">
|
<buttonCell key="cell" type="check" title="KeybStick" bezelStyle="regularSquare" imagePosition="left" state="on" inset="2" id="UW9-Bt-pMv">
|
||||||
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
|
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
|
||||||
<font key="font" metaFont="system"/>
|
<font key="font" metaFont="system"/>
|
||||||
@ -1410,7 +1410,7 @@
|
|||||||
</connections>
|
</connections>
|
||||||
</button>
|
</button>
|
||||||
<button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="Wa3-TC-XUI">
|
<button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="Wa3-TC-XUI">
|
||||||
<rect key="frame" x="-2" y="254" width="79" height="18"/>
|
<rect key="frame" x="-2" y="276" width="79" height="18"/>
|
||||||
<buttonCell key="cell" type="check" title="MouStick" bezelStyle="regularSquare" imagePosition="left" inset="2" id="BGz-fX-MyG">
|
<buttonCell key="cell" type="check" title="MouStick" bezelStyle="regularSquare" imagePosition="left" inset="2" id="BGz-fX-MyG">
|
||||||
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
|
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
|
||||||
<font key="font" metaFont="system"/>
|
<font key="font" metaFont="system"/>
|
||||||
@ -1420,7 +1420,7 @@
|
|||||||
</connections>
|
</connections>
|
||||||
</button>
|
</button>
|
||||||
<button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="xrz-jA-1Fh">
|
<button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="xrz-jA-1Fh">
|
||||||
<rect key="frame" x="-2" y="232" width="63" height="18"/>
|
<rect key="frame" x="-2" y="254" width="63" height="18"/>
|
||||||
<buttonCell key="cell" type="check" title="Mouse" bezelStyle="regularSquare" imagePosition="left" state="on" inset="2" id="1RG-zY-mD2">
|
<buttonCell key="cell" type="check" title="Mouse" bezelStyle="regularSquare" imagePosition="left" state="on" inset="2" id="1RG-zY-mD2">
|
||||||
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
|
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
|
||||||
<font key="font" metaFont="system"/>
|
<font key="font" metaFont="system"/>
|
||||||
@ -1430,10 +1430,10 @@
|
|||||||
</connections>
|
</connections>
|
||||||
</button>
|
</button>
|
||||||
<box verticalHuggingPriority="750" boxType="separator" translatesAutoresizingMaskIntoConstraints="NO" id="rIK-Xk-n9g">
|
<box verticalHuggingPriority="750" boxType="separator" translatesAutoresizingMaskIntoConstraints="NO" id="rIK-Xk-n9g">
|
||||||
<rect key="frame" x="0.0" y="223" width="96" height="5"/>
|
<rect key="frame" x="0.0" y="245" width="96" height="5"/>
|
||||||
</box>
|
</box>
|
||||||
<button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="ccb-cj-gLu">
|
<button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="ccb-cj-gLu">
|
||||||
<rect key="frame" x="-2" y="201" width="87" height="18"/>
|
<rect key="frame" x="-2" y="223" width="87" height="18"/>
|
||||||
<buttonCell key="cell" type="check" title="Quick Disk" bezelStyle="regularSquare" imagePosition="left" state="on" inset="2" id="6QV-uF-Gh7">
|
<buttonCell key="cell" type="check" title="Quick Disk" bezelStyle="regularSquare" imagePosition="left" state="on" inset="2" id="6QV-uF-Gh7">
|
||||||
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
|
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
|
||||||
<font key="font" metaFont="system"/>
|
<font key="font" metaFont="system"/>
|
||||||
@ -1442,11 +1442,21 @@
|
|||||||
<action selector="QuickDisk:" target="XfG-lQ-9wD" id="tt5-2M-B2Y"/>
|
<action selector="QuickDisk:" target="XfG-lQ-9wD" id="tt5-2M-B2Y"/>
|
||||||
</connections>
|
</connections>
|
||||||
</button>
|
</button>
|
||||||
|
<button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="9nQ-Yf-2xf">
|
||||||
|
<rect key="frame" x="-2" y="201" width="91" height="18"/>
|
||||||
|
<buttonCell key="cell" type="check" title="Disk Sound" bezelStyle="regularSquare" imagePosition="left" state="on" inset="2" id="AJi-1B-qeg">
|
||||||
|
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
|
||||||
|
<font key="font" metaFont="system"/>
|
||||||
|
</buttonCell>
|
||||||
|
<connections>
|
||||||
|
<action selector="DiskSound:" target="XfG-lQ-9wD" id="iPC-sW-ZFh"/>
|
||||||
|
</connections>
|
||||||
|
</button>
|
||||||
<box verticalHuggingPriority="750" boxType="separator" translatesAutoresizingMaskIntoConstraints="NO" id="wih-Y6-2Bz">
|
<box verticalHuggingPriority="750" boxType="separator" translatesAutoresizingMaskIntoConstraints="NO" id="wih-Y6-2Bz">
|
||||||
<rect key="frame" x="0.0" y="192" width="96" height="5"/>
|
<rect key="frame" x="0.0" y="192" width="96" height="5"/>
|
||||||
</box>
|
</box>
|
||||||
<splitView hidden="YES" dividerStyle="thin" vertical="YES" translatesAutoresizingMaskIntoConstraints="NO" id="Ge3-qD-JO6">
|
<splitView hidden="YES" dividerStyle="thin" vertical="YES" translatesAutoresizingMaskIntoConstraints="NO" id="Ge3-qD-JO6">
|
||||||
<rect key="frame" x="0.0" y="278" width="104" height="23"/>
|
<rect key="frame" x="0.0" y="300" width="104" height="23"/>
|
||||||
<subviews>
|
<subviews>
|
||||||
<textField verticalHuggingPriority="750" fixedFrame="YES" id="SNE-lV-JXn" userLabel="SoundGap">
|
<textField verticalHuggingPriority="750" fixedFrame="YES" id="SNE-lV-JXn" userLabel="SoundGap">
|
||||||
<rect key="frame" x="0.0" y="0.0" width="90" height="23"/>
|
<rect key="frame" x="0.0" y="0.0" width="90" height="23"/>
|
||||||
@ -1578,6 +1588,7 @@
|
|||||||
<integer value="1000"/>
|
<integer value="1000"/>
|
||||||
<integer value="1000"/>
|
<integer value="1000"/>
|
||||||
<integer value="1000"/>
|
<integer value="1000"/>
|
||||||
|
<integer value="1000"/>
|
||||||
</visibilityPriorities>
|
</visibilityPriorities>
|
||||||
<customSpacing>
|
<customSpacing>
|
||||||
<real value="3.4028234663852886e+38"/>
|
<real value="3.4028234663852886e+38"/>
|
||||||
@ -1596,6 +1607,7 @@
|
|||||||
<real value="3.4028234663852886e+38"/>
|
<real value="3.4028234663852886e+38"/>
|
||||||
<real value="3.4028234663852886e+38"/>
|
<real value="3.4028234663852886e+38"/>
|
||||||
<real value="3.4028234663852886e+38"/>
|
<real value="3.4028234663852886e+38"/>
|
||||||
|
<real value="3.4028234663852886e+38"/>
|
||||||
</customSpacing>
|
</customSpacing>
|
||||||
</stackView>
|
</stackView>
|
||||||
</subviews>
|
</subviews>
|
||||||
|
@ -891,15 +891,22 @@ class ViewController: NSViewController {
|
|||||||
|
|
||||||
@IBAction func QuickDisk(_ sender: NSButton) {
|
@IBAction func QuickDisk(_ sender: NSButton) {
|
||||||
if sender.state == .on {
|
if sender.state == .on {
|
||||||
// diskAccelerator_speed = Int32( 25 * M / Double(fps) )
|
|
||||||
diskAccelerator_enabled = 1;
|
diskAccelerator_enabled = 1;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// diskAccelerator_speed = 0
|
|
||||||
diskAccelerator_enabled = 0;
|
diskAccelerator_enabled = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@IBAction func DiskSound(_ sender: NSButton) {
|
||||||
|
if sender.state == .on {
|
||||||
|
disk_sfx_enabled = 1;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
disk_sfx_enabled = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@objc func openDiskImage() {
|
@objc func openDiskImage() {
|
||||||
let openPanel = NSOpenPanel()
|
let openPanel = NSOpenPanel()
|
||||||
|
@ -225,6 +225,8 @@ void spkr_init() {
|
|||||||
// Dealloc OpenAL
|
// Dealloc OpenAL
|
||||||
void spkr_exit() {
|
void spkr_exit() {
|
||||||
if ( spkr_src[0] ) {
|
if ( spkr_src[0] ) {
|
||||||
|
alSourceStop( spkr_src[0] );
|
||||||
|
|
||||||
ALCdevice *dev = NULL;
|
ALCdevice *dev = NULL;
|
||||||
ALCcontext *ctx = NULL;
|
ALCcontext *ctx = NULL;
|
||||||
ctx = alcGetCurrentContext();
|
ctx = alcGetCurrentContext();
|
||||||
@ -238,6 +240,8 @@ void spkr_exit() {
|
|||||||
|
|
||||||
memset(spkr_src, 0, sizeof(spkr_src));
|
memset(spkr_src, 0, sizeof(spkr_src));
|
||||||
memset(spkr_buffers, 0, sizeof(spkr_buffers));
|
memset(spkr_buffers, 0, sizeof(spkr_buffers));
|
||||||
|
spkr_disk_motor_buf = 0;
|
||||||
|
spkr_disk_arm_buf = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -486,20 +490,20 @@ void spkr_stop_sfx( ALuint src ) {
|
|||||||
|
|
||||||
|
|
||||||
void spkr_play_disk_motor() {
|
void spkr_play_disk_motor() {
|
||||||
if ( clk_6502_per_frm <= iicplus_MHz_6502 / fps ) {
|
if ( ( disk_sfx_enabled ) && ( clk_6502_per_frm <= iicplus_MHz_6502 / fps ) ) {
|
||||||
spkr_play_sfx( spkr_src[1], diskmotor_sfx, diskmotor_sfx_len );
|
spkr_play_sfx( spkr_src[1], diskmotor_sfx, diskmotor_sfx_len );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void spkr_stop_disk_motor( int time ) {
|
void spkr_stop_disk_motor( int time ) {
|
||||||
if ( clk_6502_per_frm <= iicplus_MHz_6502 / fps ) {
|
if ( ( disk_sfx_enabled ) && ( clk_6502_per_frm <= iicplus_MHz_6502 / fps ) ) {
|
||||||
spkr_play_disk_motor_time = time;
|
spkr_play_disk_motor_time = time;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void spkr_play_disk_arm() {
|
void spkr_play_disk_arm() {
|
||||||
if ( clk_6502_per_frm <= iicplus_MHz_6502 / fps ) {
|
if ( ( disk_sfx_enabled ) && ( clk_6502_per_frm <= iicplus_MHz_6502 / fps ) ) {
|
||||||
if ( spkr_play_disk_ioerr_time == 0 ) {
|
if ( spkr_play_disk_ioerr_time == 0 ) {
|
||||||
spkr_play_sfx( spkr_src[2], diskarm_sfx, diskarm_sfx_len );
|
spkr_play_sfx( spkr_src[2], diskarm_sfx, diskarm_sfx_len );
|
||||||
spkr_play_disk_arm_time = 2;
|
spkr_play_disk_arm_time = 2;
|
||||||
@ -509,8 +513,8 @@ void spkr_play_disk_arm() {
|
|||||||
|
|
||||||
|
|
||||||
void spkr_play_disk_ioerr() {
|
void spkr_play_disk_ioerr() {
|
||||||
if ( clk_6502_per_frm <= iicplus_MHz_6502 / fps ) {
|
if ( ( disk_sfx_enabled ) && ( clk_6502_per_frm <= iicplus_MHz_6502 / fps ) ) {
|
||||||
spkr_playqueue_sfx( spkr_src[3], diskioerr_sfx, diskioerr_sfx_len - 512);
|
spkr_playqueue_sfx( spkr_src[3], diskioerr_sfx, diskioerr_sfx_len);
|
||||||
spkr_play_disk_ioerr_time = 4;
|
spkr_play_disk_ioerr_time = 4;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -526,7 +530,7 @@ void update_disk_sfx( unsigned * time, ALuint src ) {
|
|||||||
|
|
||||||
void spkr_update_disk_sfx() {
|
void spkr_update_disk_sfx() {
|
||||||
// is user speeds up the machine, disk sfx needs to be stopped
|
// is user speeds up the machine, disk sfx needs to be stopped
|
||||||
if ( clk_6502_per_frm > iicplus_MHz_6502 / fps ) {
|
if ( ( ! disk_sfx_enabled ) || ( clk_6502_per_frm > iicplus_MHz_6502 / fps ) ) {
|
||||||
if ( spkr_play_disk_motor_time ) {
|
if ( spkr_play_disk_motor_time ) {
|
||||||
spkr_play_disk_motor_time = 1; // rest will be taken care below
|
spkr_play_disk_motor_time = 1; // rest will be taken care below
|
||||||
}
|
}
|
||||||
|
@ -22,6 +22,7 @@ const int diskAccelerator_frames = 2;
|
|||||||
int diskAccelerator_count = 0;
|
int diskAccelerator_count = 0;
|
||||||
int diskAccelerator_speed = 25 * M / fps; // if less than actual CPU speed means no acceleration
|
int diskAccelerator_speed = 25 * M / fps; // if less than actual CPU speed means no acceleration
|
||||||
int diskAccelerator_enabled = 1;
|
int diskAccelerator_enabled = 1;
|
||||||
|
int disk_sfx_enabled = 1;
|
||||||
|
|
||||||
// motor position from the magnet state
|
// motor position from the magnet state
|
||||||
// -1 means invalid, not supported
|
// -1 means invalid, not supported
|
||||||
|
@ -57,6 +57,7 @@ extern const int diskAccelerator_frames; // number of frames disk acceleratio
|
|||||||
extern int diskAccelerator_count; // counter for the disk acceleration frames
|
extern int diskAccelerator_count; // counter for the disk acceleration frames
|
||||||
extern int diskAccelerator_speed; // if less than the actual CPU speed, no acceleration
|
extern int diskAccelerator_speed; // if less than the actual CPU speed, no acceleration
|
||||||
extern int diskAccelerator_enabled;
|
extern int diskAccelerator_enabled;
|
||||||
|
extern int disk_sfx_enabled;
|
||||||
|
|
||||||
extern void disk_phase(void);
|
extern void disk_phase(void);
|
||||||
extern void disk_phase_on( uint8_t currentMagnet );
|
extern void disk_phase_on( uint8_t currentMagnet );
|
||||||
|
Loading…
x
Reference in New Issue
Block a user