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

« back to all changes in this revision

Viewing changes to src/conddebug.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:
37
37
* Register  -> 'A' | 'X' | 'Y' | 'P'
38
38
* Flag      -> 'N' | 'C' | 'Z' | 'I' | 'B' | 'V'
39
39
* PC Bank   -> 'K'
 
40
* Data Bank   -> 'T'
40
41
*/
41
42
 
42
 
#include <stdio.h>
43
 
#include <stdlib.h>
44
 
#include <string.h>
45
 
#include <assert.h>
46
 
#include <ctype.h>
47
 
 
 
43
#include "types.h"
48
44
#include "conddebug.h"
49
 
#include "types.h"
50
45
#include "utils/memory.h"
51
46
 
 
47
#include <cstdio>
 
48
#include <cstdlib>
 
49
#include <cstring>
 
50
#include <cassert>
 
51
#include <cctype>
 
52
 
 
53
// hack: this address is used by 'T' condition
 
54
uint16 addressOfTheLastAccessedData = 0;
52
55
// Next non-whitespace character in string
53
56
char next;
54
57
 
137
140
        return c == 'A' || c == 'X' || c == 'Y' || c == 'P';
138
141
}
139
142
 
140
 
// Determines if a character is for bank
141
 
int isBank(char c)
 
143
// Determines if a character is for PC bank
 
144
int isPCBank(char c)
142
145
{
143
146
        return c == 'K';
144
147
}
145
148
 
 
149
// Determines if a character is for Data bank
 
150
int isDataBank(char c)
 
151
{
 
152
        return c == 'T';
 
153
}
 
154
 
146
155
// Reads a hexadecimal number from str
147
156
int getNumber(unsigned int* number, const char** str)
148
157
{
229
238
 
230
239
                return c;
231
240
        }
232
 
        else if (isBank(next)) /* PC Bank */
233
 
        {
234
 
                if (c->type1 == TYPE_NO)
235
 
                {
236
 
                        c->type1 = TYPE_BANK;
237
 
                        c->value1 = next;
238
 
                }
239
 
                else
240
 
                {
241
 
                        c->type2 = TYPE_BANK;
 
241
        else if (isPCBank(next)) /* PC Bank */
 
242
        {
 
243
                if (c->type1 == TYPE_NO)
 
244
                {
 
245
                        c->type1 = TYPE_PC_BANK;
 
246
                        c->value1 = next;
 
247
                }
 
248
                else
 
249
                {
 
250
                        c->type2 = TYPE_PC_BANK;
 
251
                        c->value2 = next;
 
252
                }
 
253
 
 
254
                scan(str);
 
255
 
 
256
                return c;
 
257
        }
 
258
        else if (isDataBank(next)) /* Data Bank */
 
259
        {
 
260
                if (c->type1 == TYPE_NO)
 
261
                {
 
262
                        c->type1 = TYPE_DATA_BANK;
 
263
                        c->value1 = next;
 
264
                }
 
265
                else
 
266
                {
 
267
                        c->type2 = TYPE_DATA_BANK;
242
268
                        c->value2 = next;
243
269
                }
244
270