aboutsummaryrefslogtreecommitdiff
path: root/morphos
diff options
context:
space:
mode:
Diffstat (limited to 'morphos')
-rw-r--r--morphos/morphos.cpp35
-rw-r--r--morphos/morphos.h15
2 files changed, 32 insertions, 18 deletions
diff --git a/morphos/morphos.cpp b/morphos/morphos.cpp
index 10b8fbda12..8c2ffe5f57 100644
--- a/morphos/morphos.cpp
+++ b/morphos/morphos.cpp
@@ -288,9 +288,9 @@ uint32 OSystem_MorphOS::property(int param, uint32 value)
return 0;
}
-void cd_play( Scumm *s, int track, int num_loops, int start_frame, int length )
+void OSystem_MorphOS::play_cdrom( int track, int num_loops, int start_frame, int length )
{
-/* if( CDrive && start_frame >= 0 )
+ if( CDrive && start_frame >= 0 )
{
struct CDS_TrackInfo ti;
@@ -309,42 +309,41 @@ void cd_play( Scumm *s, int track, int num_loops, int start_frame, int length )
cd_stop_time = 0;
CDDA_GetTrackInfo( CDrive, track, 0, &ti );
- cd_end_time = GetTicks() + ti.ti_TrackLength.tm_Format.tm_Frame * 1000 / 75;
- }*/
+ cd_end_time = get_msecs() + ti.ti_TrackLength.tm_Format.tm_Frame * 1000 / 75;
+ }
}
// Schedule the music to be stopped after 1/10 sec, unless another
// track is started in the meantime.
-void cd_stop()
+void OSystem_MorphOS::stop_cdrom()
{
-/* cd_stop_time = GetTicks() + 100;
- cd_num_loops = 0;*/
+ cd_stop_time = get_msecs() + 100;
+ cd_num_loops = 0;
}
-int cd_is_running()
+bool OSystem_MorphOS::poll_cdrom()
{
-/* ULONG status;
+ ULONG status;
if( CDrive == NULL )
- return 0;
+ return false;
CDDA_GetAttr( CDDA_Status, CDrive, &status );
- return (cd_num_loops != 0 && (GetTicks() < cd_end_time || status != CDDA_Status_Ready));*/
- return FALSE;
+ return (cd_num_loops != 0 && (get_msecs() < cd_end_time || status != CDDA_Status_Ready));
}
-void cd_music_loop()
+void OSystem_MorphOS::update_cdrom()
{
-/* if( CDrive )
+ if( CDrive )
{
- if( cd_stop_time != 0 && GetTicks() >= cd_stop_time )
+ if( cd_stop_time != 0 && get_msecs() >= cd_stop_time )
{
CDDA_Stop( CDrive );
cd_num_loops = 0;
cd_stop_time = 0;
return;
}
- if( cd_num_loops == 0 || GetTicks() < cd_end_time )
+ if( cd_num_loops == 0 || get_msecs() < cd_end_time )
return;
ULONG status;
@@ -368,9 +367,9 @@ void cd_music_loop()
CDDA_Play( CDrive, PlayTags );
CDDA_GetTrackInfo( CDrive, cd_track, 0, &ti );
- cd_end_time = GetTicks() + ti.ti_TrackLength.tm_Format.tm_Frame * 1000 / 75;
+ cd_end_time = get_msecs() + ti.ti_TrackLength.tm_Format.tm_Frame * 1000 / 75;
}
- }*/
+ }
}
void OSystem_MorphOS::quit()
diff --git a/morphos/morphos.h b/morphos/morphos.h
index c720a990ae..b6259dd326 100644
--- a/morphos/morphos.h
+++ b/morphos/morphos.h
@@ -77,6 +77,19 @@ class OSystem_MorphOS : public OSystem
virtual uint32 property(int param, uint32 value);
+ // Poll cdrom status
+ // Returns true if cd audio is playing
+ virtual bool poll_cdrom();
+
+ // Play cdrom audio track
+ virtual void play_cdrom(int track, int num_loops, int start_frame, int length);
+
+ // Stop cdrom audio track
+ virtual void stop_cdrom();
+
+ // Update cdrom audio status
+ virtual void update_cdrom();
+
// Quit
virtual void quit();
@@ -149,6 +162,8 @@ class OSystem_MorphOS : public OSystem
/* CD-ROM related attributes */
CDRIVEPTR CDrive;
ULONG CDDATrackOffset;
+ int cd_track, cd_num_loops, cd_start_frame, cd_end_frame;
+ uint32 cd_end_time, cd_stop_time, cd_next_second;
/* Scaling-related attributes */
SCALERTYPE ScummScaler;