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

« back to all changes in this revision

Viewing changes to src/emu/machine/intelfsh.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:
38
38
        int size;
39
39
        int bits;
40
40
        int status;
 
41
        int erase_sector;
41
42
        INT32 flash_mode;
42
43
        INT32 flash_master_lock;
43
44
        int device_id;
122
123
                c->maker_id = 0xb0;
123
124
                c->device_id = 0xd0;
124
125
                break;
 
126
        case FLASH_SHARP_UNK128MBIT:
 
127
                c->bits = 16;
 
128
                c->size = 0x800000;
 
129
                c->maker_id = 0xb0;
 
130
                c->device_id = 0xb0;
 
131
                break;
 
132
        case FLASH_MACRONIX_29L001MC:
 
133
                c->bits = 8;
 
134
                c->size = 0x20000;
 
135
                c->maker_id = 0xc2;
 
136
                c->device_id = 0x51;
 
137
                break;
125
138
        }
126
139
        if( data == NULL )
127
140
        {
208
221
                }
209
222
                break;
210
223
        case FM_ERASEAMD4:
211
 
                c->status ^= ( 1 << 6 ) | ( 1 << 2 );
212
 
                data = c->status;
 
224
                // reads outside of the erasing sector return normal data
 
225
                if ((address < c->erase_sector) || (address >= c->erase_sector+(64*1024)))
 
226
                {
 
227
                        switch( c->bits )
 
228
                        {
 
229
                        case 8:
 
230
                                {
 
231
                                        UINT8 *flash_memory = (UINT8 *)c->flash_memory;
 
232
                                        data = flash_memory[ address ];
 
233
                                }
 
234
                                break;
 
235
                        case 16:
 
236
                                {
 
237
                                        UINT16 *flash_memory = (UINT16 *)c->flash_memory;
 
238
                                        data = flash_memory[ address ];
 
239
                                }
 
240
                                break;
 
241
                        }
 
242
                }
 
243
                else
 
244
                {
 
245
                        c->status ^= ( 1 << 6 ) | ( 1 << 2 );
 
246
                        data = c->status;
 
247
                }
213
248
                break;
214
249
        }
215
250
 
348
383
                                {
349
384
                                        UINT8 *flash_memory = (UINT8 *)c->flash_memory;
350
385
                                        memset( &flash_memory[ address & ~0xffff ], 0xff, 64 * 1024 );
 
386
                                        c->erase_sector = address & ~0xffff;
351
387
                                }
352
388
                                break;
353
389
                        case 16:
354
390
                                {
355
391
                                        UINT16 *flash_memory = (UINT16 *)c->flash_memory;
356
392
                                        memset( &flash_memory[ address & ~0x7fff ], 0xff, 64 * 1024 );
 
393
                                        c->erase_sector = address & ~0x7fff;
357
394
                                }
358
395
                                break;
359
396
                        }