mirror of
https://github.com/trudnai/Steve2.git
synced 2025-02-15 04:33:47 +00:00
Disk Door Open / Close
This commit is contained in:
parent
283f5ac7b9
commit
b6df485d4d
@ -1191,6 +1191,24 @@ class ViewController: NSViewController {
|
||||
}
|
||||
}
|
||||
|
||||
// Disk Loaded
|
||||
if ( frameCounter % DEF_DRV_LED_DIV == 0 ) {
|
||||
if woz_is_loaded() > 0 {
|
||||
if disk1_closed.isHidden {
|
||||
DispatchQueue.main.sync {
|
||||
disk1_closed.isHidden = false
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
if !disk1_closed.isHidden {
|
||||
DispatchQueue.main.sync {
|
||||
disk1_closed.isHidden = true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
switch cpuState {
|
||||
case cpuState_running:
|
||||
clkCounter += Double(m6502.clkfrm)
|
||||
|
@ -489,7 +489,7 @@ void woz_write( uint8_t data ) {
|
||||
}
|
||||
|
||||
|
||||
void woz_free_buffer() {
|
||||
void woz_free_buffer(void) {
|
||||
if ( woz_file_buffer ) {
|
||||
free(woz_file_buffer);
|
||||
woz_file_buffer = NULL;
|
||||
@ -505,7 +505,7 @@ int woz_parseBuffer() {
|
||||
woz_flags.disk_modified = 0;
|
||||
woz_flags.disk_write_protected = 0;
|
||||
woz_flags.image_file_readonly = 0;
|
||||
woz_flags.image_loaded = 1;
|
||||
woz_flags.image_loaded = 0;
|
||||
|
||||
woz_header = (woz_header_t*)woz_file_buffer;
|
||||
|
||||
@ -578,6 +578,8 @@ int woz_parseBuffer() {
|
||||
// DO NOT COMMIT THIS! ONLY FOR DEBUG!!!
|
||||
// woz_loadTrack(0x11);
|
||||
|
||||
woz_flags.image_loaded = 1;
|
||||
|
||||
return WOZ_ERR_OK;
|
||||
}
|
||||
|
||||
@ -641,6 +643,11 @@ void woz_eject() {
|
||||
}
|
||||
|
||||
|
||||
uint8_t woz_is_loaded(void) {
|
||||
return woz_flags.image_loaded;
|
||||
}
|
||||
|
||||
|
||||
int woz_saveFile( const char * filename ) {
|
||||
|
||||
if ( filename == NULL ) {
|
||||
|
@ -209,5 +209,7 @@ extern int woz_parseBuffer(void);
|
||||
extern int woz_loadFile( const char * filename );
|
||||
extern int woz_saveFile( const char * filename );
|
||||
extern void woz_eject(void);
|
||||
extern uint8_t woz_is_loaded(void);
|
||||
|
||||
|
||||
#endif /* woz_h */
|
||||
|
Loading…
x
Reference in New Issue
Block a user