~ubuntu-branches/ubuntu/vivid/fceux/vivid

« back to all changes in this revision

Viewing changes to src/fds.cpp

  • Committer: Package Import Robot
  • Author(s): Joe Nahmias
  • Date: 2014-03-02 19:22:04 UTC
  • mfrom: (1.1.1)
  • Revision ID: package-import@ubuntu.com-20140302192204-9f0aehi5stfnhn7d
Tags: 2.2.2+dfsg0-1
* Imported Upstream version 2.2.2
  + remove patches merged upstream; refresh remaining
  + remove windows compiled help files and non-free Visual C files
* Use C++11 standard static assertion functionality
* fix upstream installation of support files
* New patch 0004-ignore-missing-windows-help-CHM-file.patch
* update d/copyright for new, renamed, deleted files
* d/control: bump std-ver to 3.9.5, no changes needed

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
19
19
 */
20
20
 
21
 
#include <stdio.h>
22
 
#include <stdlib.h>
23
 
#include <string.h>
24
 
 
25
21
#include "types.h"
26
22
#include "x6502.h"
27
23
#include "fceu.h"
37
33
#include "driver.h"
38
34
#include "movie.h"
39
35
 
 
36
#include <cstdio>
 
37
#include <cstdlib>
 
38
#include <cstring>
 
39
 
40
40
//      TODO:  Add code to put a delay in between the time a disk is inserted
41
41
//      and the when it can be successfully read/written to.  This should
42
42
//      prevent writes to wrong places OR add code to prevent disk ejects
143
143
        SelectDisk = 0;
144
144
}
145
145
 
146
 
void FCEU_FDSInsert(void) {
147
 
        if (FCEUI_EmulationPaused()) EmulationPaused |= 2;
 
146
void FCEU_FDSInsert(void)
 
147
{
 
148
        if (TotalSides == 0)
 
149
        {
 
150
                FCEU_DispMessage("Not FDS; can't eject disk.", 0);
 
151
                return;
 
152
        }
 
153
 
 
154
        if (FCEUI_EmulationPaused())
 
155
                EmulationPaused |= EMULATIONPAUSED_FA;
148
156
 
149
157
        if (FCEUMOV_Mode(MOVIEMODE_RECORD))
150
158
                FCEUMOV_AddCommand(FCEUNPCMD_FDSINSERT);
151
159
 
152
 
        if (TotalSides == 0) {
153
 
                FCEU_DispMessage("Not FDS; can't eject disk.", 0);
154
 
                return;
155
 
        }
156
 
        if (InDisk == 255) {
 
160
        if (InDisk == 255)
 
161
        {
157
162
                FCEU_DispMessage("Disk %d Side %s Inserted", 0, SelectDisk >> 1, (SelectDisk & 1) ? "B" : "A");
158
163
                InDisk = SelectDisk;
159
 
        } else {
 
164
        } else
 
165
        {
160
166
                FCEU_DispMessage("Disk %d Side %s Ejected", 0, SelectDisk >> 1, (SelectDisk & 1) ? "B" : "A");
161
167
                InDisk = 255;
162
168
        }
167
173
InDisk=255;
168
174
}
169
175
*/
170
 
void FCEU_FDSSelect(void) {
171
 
        if (FCEUI_EmulationPaused()) EmulationPaused |= 2;
172
 
 
173
 
        if (FCEUMOV_Mode(MOVIEMODE_RECORD))
174
 
                FCEUMOV_AddCommand(FCEUNPCMD_FDSSELECT);
175
 
 
176
 
        if (TotalSides == 0) {
 
176
void FCEU_FDSSelect(void)
 
177
{
 
178
        if (TotalSides == 0)
 
179
        {
177
180
                FCEU_DispMessage("Not FDS; can't select disk.", 0);
178
181
                return;
179
182
        }
180
 
        if (InDisk != 255) {
 
183
        if (InDisk != 255)
 
184
        {
181
185
                FCEU_DispMessage("Eject disk before selecting.", 0);
182
186
                return;
183
187
        }
 
188
 
 
189
        if (FCEUI_EmulationPaused())
 
190
                EmulationPaused |= EMULATIONPAUSED_FA;
 
191
 
 
192
        if (FCEUMOV_Mode(MOVIEMODE_RECORD))
 
193
                FCEUMOV_AddCommand(FCEUNPCMD_FDSSELECT);
 
194
 
184
195
        SelectDisk = ((SelectDisk + 1) % TotalSides) & 3;
185
196
        FCEU_DispMessage("Disk %d Side %c Selected", 0, SelectDisk >> 1, (SelectDisk & 1) ? 'B' : 'A');
186
197
}