~ubuntu-branches/ubuntu/lucid/sdlmame/lucid

« back to all changes in this revision

Viewing changes to src/emu/cpu/m68000/m68kmake.c

  • Committer: Bazaar Package Importer
  • Author(s): Cesare Falco
  • Date: 2009-11-03 17:10:15 UTC
  • mfrom: (1.1.5 upstream)
  • Revision ID: james.westby@ubuntu.com-20091103171015-6hop4ory5lxnumpn
Tags: 0.135-0ubuntu1
* New upstream release - Closes (LP: #403212)
* debian/watch: unstable releases are no longer detected
* mame.ini: added the cheat subdirectories to cheatpath so zipped
  cheatfiles will be searched too
* renamed crsshair subdirectory to crosshair to reflect upstream change
* mame.ini: renamed references to crosshair subdirectory (see above)

Show diffs side-by-side

added added

removed removed

Lines of Context:
3
3
/* ======================================================================== */
4
4
/*
5
5
 *                                  MUSASHI
6
 
 *                                Version 3.32
 
6
 *                                Version 4.10
7
7
 *
8
8
 * A portable Motorola M680x0 processor emulation engine.
9
9
 * Copyright Karl Stenerud.  All rights reserved.
16
16
 * (Karl Stenerud).
17
17
 *
18
18
 * The latest version of this code can be obtained at:
19
 
 * http://kstenerud.cjb.net
 
19
 * http://kstenerud.cjb.net or http://mamedev.org/
20
20
 */
21
21
 
22
22
/*
23
23
 * Modified For OpenVMS By:  Robert Alan Byer
24
24
 *                           byer@mail.ourservers.net
 
25
 *
 
26
 * 68030 and PMMU by R. Belmont
 
27
 * 68040 and FPU by Ville Linde
25
28
 */
26
29
 
27
30
 
52
55
 */
53
56
 
54
57
 
55
 
static const char g_version[] = "3.32";
 
58
static const char g_version[] = "4.10";
56
59
 
57
60
/* ======================================================================== */
58
61
/* =============================== INCLUDES =============================== */
132
135
        CPU_TYPE_000 = 0,
133
136
        CPU_TYPE_010,
134
137
        CPU_TYPE_020,
 
138
        CPU_TYPE_030,
135
139
        CPU_TYPE_040,
136
140
        NUM_CPUS
137
141
};
182
186
        char ea_allowed[EA_ALLOWED_LENGTH];   /* Effective addressing modes allowed */
183
187
        char cpu_mode[NUM_CPUS];              /* User or supervisor mode */
184
188
        char cpus[NUM_CPUS+1];                /* Allowed CPUs */
185
 
        unsigned char cycles[NUM_CPUS];       /* cycles for 000, 010, 020 */
 
189
        unsigned char cycles[NUM_CPUS];       /* cycles for 000, 010, 020, 030, 040 */
186
190
} opcode_struct;
187
191
 
188
192
 
248
252
/* ======================================================================== */
249
253
 
250
254
/* Name of the input file */
251
 
static char g_input_filename[M68K_MAX_PATH] = FILENAME_INPUT;
 
255
static char g_input_filename[M68K_MAX_PATH];
252
256
 
253
257
/* File handles */
254
258
static FILE* g_input_file = NULL;
313
317
};
314
318
 
315
319
/* Extra cycles required for certain EA modes */
316
 
/* TODO: correct timings for 040 */
 
320
/* TODO: correct timings for 030, 040 */
317
321
static const int g_ea_cycle_table[13][NUM_CPUS][3] =
318
 
{/*       000           010           020           040  */
319
 
        {{ 0,  0,  0}, { 0,  0,  0}, { 0,  0,  0}, { 0,  0,  0}}, /* EA_MODE_NONE */
320
 
        {{ 0,  4,  8}, { 0,  4,  8}, { 0,  4,  4}, { 0,  4,  4}}, /* EA_MODE_AI   */
321
 
        {{ 0,  4,  8}, { 0,  4,  8}, { 0,  4,  4}, { 0,  4,  4}}, /* EA_MODE_PI   */
322
 
        {{ 0,  4,  8}, { 0,  4,  8}, { 0,  4,  4}, { 0,  4,  4}}, /* EA_MODE_PI7  */
323
 
        {{ 0,  6, 10}, { 0,  6, 10}, { 0,  5,  5}, { 0,  5,  5}}, /* EA_MODE_PD   */
324
 
        {{ 0,  6, 10}, { 0,  6, 10}, { 0,  5,  5}, { 0,  5,  5}}, /* EA_MODE_PD7  */
325
 
        {{ 0,  8, 12}, { 0,  8, 12}, { 0,  5,  5}, { 0,  5,  5}}, /* EA_MODE_DI   */
326
 
        {{ 0, 10, 14}, { 0, 10, 14}, { 0,  7,  7}, { 0,  7,  7}}, /* EA_MODE_IX   */
327
 
        {{ 0,  8, 12}, { 0,  8, 12}, { 0,  4,  4}, { 0,  4,  4}}, /* EA_MODE_AW   */
328
 
        {{ 0, 12, 16}, { 0, 12, 16}, { 0,  4,  4}, { 0,  4,  4}}, /* EA_MODE_AL   */
329
 
        {{ 0,  8, 12}, { 0,  8, 12}, { 0,  5,  5}, { 0,  5,  5}}, /* EA_MODE_PCDI */
330
 
        {{ 0, 10, 14}, { 0, 10, 14}, { 0,  7,  7}, { 0,  7,  7}}, /* EA_MODE_PCIX */
331
 
        {{ 0,  4,  8}, { 0,  4,  8}, { 0,  2,  4}, { 0,  2,  4}}, /* EA_MODE_I    */
 
322
{/*       000           010           020           030           040  */
 
323
        {{ 0,  0,  0}, { 0,  0,  0}, { 0,  0,  0}, { 0,  0,  0}, { 0,  0,  0}}, /* EA_MODE_NONE */
 
324
        {{ 0,  4,  8}, { 0,  4,  8}, { 0,  4,  4}, { 0,  4,  4}, { 0,  4,  4}}, /* EA_MODE_AI   */
 
325
        {{ 0,  4,  8}, { 0,  4,  8}, { 0,  4,  4}, { 0,  4,  4}, { 0,  4,  4}}, /* EA_MODE_PI   */
 
326
        {{ 0,  4,  8}, { 0,  4,  8}, { 0,  4,  4}, { 0,  4,  4}, { 0,  4,  4}}, /* EA_MODE_PI7  */
 
327
        {{ 0,  6, 10}, { 0,  6, 10}, { 0,  5,  5}, { 0,  5,  5}, { 0,  5,  5}}, /* EA_MODE_PD   */
 
328
        {{ 0,  6, 10}, { 0,  6, 10}, { 0,  5,  5}, { 0,  5,  5}, { 0,  5,  5}}, /* EA_MODE_PD7  */
 
329
        {{ 0,  8, 12}, { 0,  8, 12}, { 0,  5,  5}, { 0,  5,  5}, { 0,  5,  5}}, /* EA_MODE_DI   */
 
330
        {{ 0, 10, 14}, { 0, 10, 14}, { 0,  7,  7}, { 0,  7,  7}, { 0,  7,  7}}, /* EA_MODE_IX   */
 
331
        {{ 0,  8, 12}, { 0,  8, 12}, { 0,  4,  4}, { 0,  4,  4}, { 0,  4,  4}}, /* EA_MODE_AW   */
 
332
        {{ 0, 12, 16}, { 0, 12, 16}, { 0,  4,  4}, { 0,  4,  4}, { 0,  4,  4}}, /* EA_MODE_AL   */
 
333
        {{ 0,  8, 12}, { 0,  8, 12}, { 0,  5,  5}, { 0,  5,  5}, { 0,  5,  5}}, /* EA_MODE_PCDI */
 
334
        {{ 0, 10, 14}, { 0, 10, 14}, { 0,  7,  7}, { 0,  7,  7}, { 0,  7,  7}}, /* EA_MODE_PCIX */
 
335
        {{ 0,  4,  8}, { 0,  4,  8}, { 0,  2,  4}, { 0,  2,  4}, { 0,  2,  4}}, /* EA_MODE_I    */
332
336
};
333
337
 
334
338
/* Extra cycles for JMP instruction (000, 010) */
1073
1077
        /* Find the start of the table */
1074
1078
        while(strcmp(buff, ID_TABLE_START) != 0)
1075
1079
                if(fgetline(buff, MAX_LINE_LENGTH, g_input_file) < 0)
1076
 
                        error_exit("Premature EOF while reading table");
 
1080
                        error_exit("(table_start) Premature EOF while reading table");
1077
1081
 
1078
1082
        /* Process the entire table */
1079
1083
        for(op = g_opcode_input_table;;op++)
1080
1084
        {
1081
1085
                if(fgetline(buff, MAX_LINE_LENGTH, g_input_file) < 0)
1082
 
                        error_exit("Premature EOF while reading table");
 
1086
                        error_exit("(inline) Premature EOF while reading table");
1083
1087
                if(strlen(buff) == 0)
1084
1088
                        continue;
1085
1089
                /* We finish when we find an input separator */
1237
1241
        int table_body_read = 0;
1238
1242
        int ophandler_body_read = 0;
1239
1243
 
1240
 
        printf("\n\tMusashi v%s 68000, 68008, 68010, 68EC020, 68020, 68040 emulator\n", g_version);
 
1244
        printf("\n\tMusashi v%s 68000, 68008, 68010, 68EC020, 68020, 68EC030, 68030, 68EC040, 68040 emulator\n", g_version);
1241
1245
        printf("\tCopyright Karl Stenerud\n\n");
1242
1246
 
1243
1247
        /* Check if output path and source for the input file are given */
1244
 
    if(argc > 1)
 
1248
        if(argc > 1)
1245
1249
        {
1246
1250
                char *ptr;
1247
1251
                strcpy(output_path, argv[1]);
1250
1254
                        *ptr = '/';
1251
1255
 
1252
1256
#if !(defined(__DECC) && defined(VMS))
1253
 
        if(output_path[strlen(output_path)-1] != '/')
 
1257
                if(output_path[strlen(output_path)-1] != '/')
1254
1258
                        strcat(output_path, "/");
1255
1259
#endif
1256
 
 
1257
 
                if(argc > 2)
1258
 
                        strcpy(g_input_filename, argv[2]);
1259
1260
        }
1260
1261
 
 
1262
        strcpy(g_input_filename, (argc > 2) ? argv[2] : FILENAME_INPUT);
1261
1263
 
1262
1264
#if defined(__DECC) && defined(VMS)
1263
1265