Mercurial > sdl-ios-xcode
annotate src/cdrom/macos/SDL_syscdrom_c.h @ 641:df178851293b
Date: 28 Jun 2003 22:42:52 +0100
From: Alan Swanson
Subject: Re: [SDL] New XFree 4.3 Video Mode Patch
I have a wee amendment that moves the qsort in set_best_resolution
to only occur after failing to find an exact match only. This would
make absolutely sure we get a user set mode.
While I've never had any problems for my normal resolutions (1280x1024,
1024x768, 800x600 & 640,480) while closely examining the output from
qsort I've noticed it doesn't seem to sort the modes fully. These is
one definite wrong at 1152x768 and a few that just look wrong to me.
From a program (attached) I made to examine this more easily. X has
sorted its mode list using the same method as ours (plus frequency),
and our user modes get inserted without any other movement.
On the patch I've made I've also changed cmpmodes to sort on vertical
resolution and then horizontal. Ie vertical is now most significant
bit.
author | Sam Lantinga <slouken@libsdl.org> |
---|---|
date | Sat, 28 Jun 2003 21:52:26 +0000 |
parents | f6ffac90895c |
children | b8d311d90021 |
rev | line source |
---|---|
0 | 1 /* |
2 SDL - Simple DirectMedia Layer | |
297
f6ffac90895c
Updated copyright information for 2002
Sam Lantinga <slouken@libsdl.org>
parents:
252
diff
changeset
|
3 Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002 Sam Lantinga |
0 | 4 |
5 This library is free software; you can redistribute it and/or | |
6 modify it under the terms of the GNU Library General Public | |
7 License as published by the Free Software Foundation; either | |
8 version 2 of the License, or (at your option) any later version. | |
9 | |
10 This library is distributed in the hope that it will be useful, | |
11 but WITHOUT ANY WARRANTY; without even the implied warranty of | |
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
13 Library General Public License for more details. | |
14 | |
15 You should have received a copy of the GNU Library General Public | |
16 License along with this library; if not, write to the Free | |
17 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
18 | |
19 Sam Lantinga | |
252
e8157fcb3114
Updated the source with the correct e-mail address
Sam Lantinga <slouken@libsdl.org>
parents:
0
diff
changeset
|
20 slouken@libsdl.org |
0 | 21 */ |
22 | |
23 /* This is the MacOS specific header for the SDL CD-ROM API | |
24 Contributed by Matt Slot | |
25 */ | |
26 | |
27 /* AppleCD Control calls */ | |
28 #define kVerifyTheDisc 5 /* Returns noErr if there is disc inserted */ | |
29 #define kEjectTheDisc 7 /* Eject disc from drive */ | |
30 #define kUserEject 80 /* Enable/disable the CD-ROM eject button */ | |
31 #define kReadTOC 100 /* Extract various TOC information from the disc */ | |
32 #define kReadQ 101 /* Extract Q subcode info for the current track */ | |
33 #define kAudioTrackSearch 103 /* Start playback from the indicated position */ | |
34 #define kAudioPlay 104 /* Start playback from the indicated position */ | |
35 #define kAudioPause 105 /* Pause/continue the playback */ | |
36 #define kAudioStop 106 /* Stop playback at the indicated position */ | |
37 #define kAudioStatus 107 /* Return audio play status */ | |
38 #define kAudioControl 109 /* Set the output volume for the audio channels */ | |
39 #define kReadAudioVolume 112 /* Get the output volume for the audio channels */ | |
40 #define kSetTrackList 122 /* Set the track program for the audio CD to play */ | |
41 #define kGetTrackList 123 /* Get the track program the audio CD is playing */ | |
42 #define kGetTrackIndex 124 /* Get the track index the audio CD is playing */ | |
43 #define kSetPlayMode 125 /* Set the audio tracks play mode */ | |
44 #define kGetPlayMode 126 /* Get the audio tracks play mode */ | |
45 | |
46 /* AppleCD Status calls */ | |
47 #define kGetDriveType 96 /* Get the type of the physical CD-ROM drive */ | |
48 #define kWhoIsThere 97 /* Get a bitmap of SCSI IDs the driver controls */ | |
49 #define kGetBlockSize 98 /* Get current block size of the CD-ROM drive */ | |
50 | |
51 /* AppleCD other constants */ | |
52 #define kBlockPosition 0 /* Position at the specified logical block number */ | |
53 #define kAbsMSFPosition 1 /* Position at the specified Min/Sec/Frame (in BCD) */ | |
54 #define kTrackPosition 2 /* Position at the specified track number (in BCD) */ | |
55 #define kIndexPosition 3 /* Position at the nth track in program (in BCD) */ | |
56 | |
57 #define kMutedPlayMode 0 /* Play the audio track with no output */ | |
58 #define kStereoPlayMode 9 /* Play the audio track in normal stereo */ | |
59 | |
60 #define kControlFieldMask 0x0D /* Bits 3,2,0 in the nibble */ | |
61 #define kDataTrackMask 0x04 /* Indicates Data Track */ | |
62 | |
63 #define kGetTrackRange 1 /* Query TOC for track numbers */ | |
64 #define kGetLeadOutArea 2 /* Query TOC for "Lead Out" end of audio data */ | |
65 #define kGetTrackEntries 3 /* Query TOC for track starts and data types */ | |
66 | |
67 #define kStatusPlaying 0 /* Audio Play operation in progress */ | |
68 #define kStatusPaused 1 /* CD-ROM device in Hold Track ("Pause") state */ | |
69 #define kStatusMuted 2 /* MUTING-ON operation in progress */ | |
70 #define kStatusDone 3 /* Audio Play completed */ | |
71 #define kStatusError 4 /* Error occurred during audio play operation */ | |
72 #define kStatusStopped 5 /* Audio play operation not requested */ | |
73 | |
74 #define kPlayModeSequential 0 /* Play tracks in order */ | |
75 #define kPlayModeShuffled 1 /* Play tracks randomly */ | |
76 #define kPlayModeProgrammed 2 /* Use custom playlist */ | |
77 | |
78 /* AppleCD Gestalt selectors */ | |
79 #define kGestaltAudioCDSelector 'aucd' | |
80 #define kDriverVersion52 0x00000520 | |
81 #define kDriverVersion51 0x00000510 | |
82 #define kDriverVersion50 0x00000500 | |
83 | |
84 /* Drive type constants */ | |
85 #define kDriveAppleCD_SC 1 | |
86 #define kDriveAppleCD_SCPlus_or_150 2 | |
87 #define kDriveAppleCD_300_or_300Plus 3 | |
88 | |
89 /* Misc constants */ | |
90 #define kFirstSCSIDevice -33 | |
91 #define kLastSCSIDevice -40 | |
92 | |
93 #if PRAGMA_STRUCT_ALIGN | |
94 #pragma options align=mac68k | |
95 #endif | |
96 | |
97 /* AppleCD driver parameter block */ | |
98 typedef struct CDCntrlParam { | |
99 QElemPtr qLink; | |
100 short qType; | |
101 short ioTrap; | |
102 Ptr ioCmdAddr; | |
103 IOCompletionUPP ioCompletion; | |
104 OSErr ioResult; | |
105 StringPtr ioNamePtr; | |
106 short ioVRefNum; | |
107 short ioCRefNum; | |
108 short csCode; | |
109 | |
110 union { | |
111 long longs[6]; | |
112 short words[11]; | |
113 unsigned char bytes[22]; | |
114 struct { | |
115 unsigned char status; | |
116 unsigned char play; | |
117 unsigned char control; | |
118 unsigned char minute; | |
119 unsigned char second; | |
120 unsigned char frame; | |
121 } cd; | |
122 } csParam; | |
123 | |
124 } CDCntrlParam, *CDCntrlParamPtr; | |
125 | |
126 typedef union CDTrackData { | |
127 long value; /* Treat as a longword value */ | |
128 struct { | |
129 unsigned char reserved : 4; /* Unused by AppleCD driver */ | |
130 unsigned char control : 4; /* Track flags (data track?) */ | |
131 unsigned char min; /* Start of track (BCD) */ | |
132 unsigned char sec; /* Start of track (BCD) */ | |
133 unsigned char frame; /* Start of track (BCD) */ | |
134 } entry; /* Broken into fields */ | |
135 } CDTrackData, *CDTrackPtr; | |
136 | |
137 #if PRAGMA_STRUCT_ALIGN | |
138 #pragma options align=reset | |
139 #endif |