Previous 199869 Revisions Next

r24078 Friday 5th July, 2013 at 00:45:14 UTC by smf
Fixes for building MAME with Visual Studio 2013 preview [smf]
[src/emu]rendfont.c
[src/emu/cpu/mc68hc11]mc68hc11.c
[src/emu/cpu/rsp]rspdrc.c
[src/emu/cpu/tms32031]32031ops.c
[src/emu/debug]debugcmd.c
[src/emu/machine]msm6242.c pit8253.c
[src/lib/formats]ap2_dsk.c ap_dsk35.c coco_dsk.c coupedsk.c d64_dsk.c d64_dsk.h d88_dsk.c dfi_dsk.c dsk_dsk.c esq16_dsk.c esq16_dsk.h esq8_dsk.c g64_dsk.c imd_dsk.c ipf_dsk.c oric_dsk.c pc98fdi_dsk.c st_dsk.c st_dsk.h td0_dsk.c thom_dsk.c upd765_dsk.c wd177x_dsk.c
[src/lib/softfloat]softfloat-macros
[src/mame/drivers]beathead.c
[src/mame/machine]harddriv.c
[src/mame/video]tank8.c tia.c tia.h
[src/osd/windows]ledutil.c winprefix.h
[src/tools]chdman.c

trunk/src/osd/windows/winprefix.h
r24077r24078
4444#ifdef _MSC_VER
4545#include <assert.h>
4646#include <malloc.h>
47#if _MSC_VER < 1800
4748#define alloca _alloca
4849#define round(x) floor((x) + 0.5)
50#endif
4951#if _MSC_VER < 1500
5052#define vsnprintf _vsnprintf
5153#endif
trunk/src/osd/windows/ledutil.c
r24077r24078
104104// LED methods
105105#define LED_METHOD_PS2                      0
106106#define LED_METHOD_USB                      1
107#define LED_METHOD_WIN9X                    2
108107
109108// window parameters
110109#define WINDOW_CLASS                        TEXT("LEDSample")
r24077r24078
508507
509508static void output_startup(const char *commandline)
510509{
511   OSVERSIONINFO osinfo = { sizeof(OSVERSIONINFO) };
512
513510   // default to PS/2, override if USB is specified as a parameter
514511   ledmethod = LED_METHOD_PS2;
515512   if (commandline != NULL && strcmp(commandline, "-usb") == 0)
516513      ledmethod = LED_METHOD_USB;
517514
518   // force Win9x method if we're on Win 9x
519   GetVersionEx(&osinfo);
520   if (osinfo.dwPlatformId == VER_PLATFORM_WIN32_WINDOWS)
521      ledmethod = LED_METHOD_WIN9X;
522
523515   // output the method
524516   switch (ledmethod)
525517   {
r24077r24078
530522      case LED_METHOD_USB:
531523         DEBUG_PRINTF(("Using USB method\n"));
532524         break;
533
534      case LED_METHOD_WIN9X:
535         DEBUG_PRINTF(("Using Win9x method\n"));
536         break;
537525   }
538526}
539527
r24077r24078
653641
654642   switch (ledmethod)
655643   {
656      case LED_METHOD_WIN9X:
657644      case LED_METHOD_USB:
658645      {
659646         BYTE key_states[256];
r24077r24078
704691
705692   switch (ledmethod)
706693   {
707      case LED_METHOD_WIN9X:
708      {
709         // thanks to Lee Taylor for the original version of this code
710         BYTE key_states[256];
711
712         // get the current state
713         GetKeyboardState(&key_states[0]);
714
715         // mask states and set new states
716         key_states[VK_NUMLOCK] = (key_states[VK_NUMLOCK] & ~1) | ((state >> 0) & 1);
717         key_states[VK_CAPITAL] = (key_states[VK_CAPITAL] & ~1) | ((state >> 1) & 1);
718         key_states[VK_SCROLL] = (key_states[VK_SCROLL] & ~1) | ((state >> 2) & 1);
719
720         SetKeyboardState(&key_states[0]);
721         break;
722      }
723
724694      case LED_METHOD_USB:
725695      {
726696         static const BYTE vk[3] = { VK_NUMLOCK, VK_CAPITAL, VK_SCROLL };
trunk/src/lib/formats/oric_dsk.c
r24077r24078
5252
5353   floppy_image_read(floppy, header, 0, mfm_disk_header_size);
5454   if ( memcmp( header, MFM_ID, 8 ) ==0) {
55      int heads  = pick_integer_le(header, 8, 4);
56      int tracks = pick_integer_le(header, 12, 4);
55      UINT32 heads  = pick_integer_le(header, 8, 4);
56      UINT32 tracks = pick_integer_le(header, 12, 4);
5757
5858      if (floppy_image_size(floppy)==((tracks*heads*TRACK_SIZE_MFM)+mfm_disk_header_size)) {
5959         *vote = 100;
trunk/src/lib/formats/upd765_dsk.c
r24077r24078
4949
5050int upd765_format::find_size(io_generic *io, UINT32 form_factor)
5151{
52   int size = io_generic_size(io);
52   UINT64 size = io_generic_size(io);
5353   for(int i=0; formats[i].form_factor; i++) {
5454      const format &f = formats[i];
5555      if(form_factor != floppy_image::FF_UNKNOWN && form_factor != f.form_factor)
5656         continue;
5757
58      if(size == compute_track_size(f) * f.track_count * f.head_count)
58      if(size == (UINT64) compute_track_size(f) * f.track_count * f.head_count)
5959         return i;
6060   }
6161   return -1;
trunk/src/lib/formats/d64_dsk.c
r24077r24078
113113
114114int d64_format::find_size(io_generic *io, UINT32 form_factor)
115115{
116   int size = io_generic_size(io);
116   UINT64 size = io_generic_size(io);
117117   for(int i=0; formats[i].sector_count; i++) {
118118      const format &f = formats[i];
119      if(size == f.sector_count*f.sector_base_size)
119      if(size == (UINT32) f.sector_count*f.sector_base_size)
120120         return i;
121      if(size == (f.sector_count*f.sector_base_size) + f.sector_count)
121      if(size == (UINT32) (f.sector_count*f.sector_base_size) + f.sector_count)
122122         return i;
123123   }
124124   return -1;
r24077r24078
218218      return false;
219219
220220   const format &f = formats[type];
221   int size = io_generic_size(io);
221   UINT64 size = io_generic_size(io);
222222   UINT8 *img;
223223
224   if(size == f.sector_count*f.sector_base_size) {
224   if(size == (UINT32)f.sector_count*f.sector_base_size) {
225225      img = global_alloc_array(UINT8, size + f.sector_count);
226226      memset(&img[size], ERROR_00, f.sector_count);
227227   }
trunk/src/lib/formats/g64_dsk.c
r24077r24078
8484
8585bool g64_format::load(io_generic *io, UINT32 form_factor, floppy_image *image)
8686{
87   int size = io_generic_size(io);
87   UINT64 size = io_generic_size(io);
8888   UINT8 *img = global_alloc_array(UINT8, size);
8989   io_generic_read(io, img, 0, size);
9090
trunk/src/lib/formats/d64_dsk.h
r24077r24078
1717      UINT32 form_factor;      // See floppy_image for possible values
1818      UINT32 variant;          // See floppy_image for possible values
1919
20      int sector_count;
21      int track_count;
22      int head_count;
23      int sector_base_size;
24      int gap_1;
25      int gap_2;
20      UINT16 sector_count;
21      UINT8 track_count;
22      UINT8 head_count;
23      UINT16 sector_base_size;
24      UINT8 gap_1;
25      UINT8 gap_2;
2626   };
2727
2828   d64_format();
trunk/src/lib/formats/pc98fdi_dsk.c
r24077r24078
6363
6464int pc98fdi_format::identify(io_generic *io, UINT32 form_factor)
6565{
66   int size = io_generic_size(io);
66   UINT64 size = io_generic_size(io);
6767   UINT8 h[32];
6868
6969   io_generic_read(io, h, 0, 32);
70   int hsize = LITTLE_ENDIANIZE_INT32(*(UINT32 *)(h+0x8));
71   int psize = LITTLE_ENDIANIZE_INT32(*(UINT32 *)(h+0xc));
72   int ssize = LITTLE_ENDIANIZE_INT32(*(UINT32 *)(h+0x10));
73   int scnt  = LITTLE_ENDIANIZE_INT32(*(UINT32 *)(h+0x14));
74   int sides = LITTLE_ENDIANIZE_INT32(*(UINT32 *)(h+0x18));
75   int ntrk  = LITTLE_ENDIANIZE_INT32(*(UINT32 *)(h+0x1c));
70   UINT32 hsize = LITTLE_ENDIANIZE_INT32(*(UINT32 *) (h + 0x8));
71   UINT32 psize = LITTLE_ENDIANIZE_INT32(*(UINT32 *) (h + 0xc));
72   UINT32 ssize = LITTLE_ENDIANIZE_INT32(*(UINT32 *) (h + 0x10));
73   UINT32 scnt = LITTLE_ENDIANIZE_INT32(*(UINT32 *) (h + 0x14));
74   UINT32 sides = LITTLE_ENDIANIZE_INT32(*(UINT32 *) (h + 0x18));
75   UINT32 ntrk = LITTLE_ENDIANIZE_INT32(*(UINT32 *) (h + 0x1c));
7676   if(size == hsize + psize && psize == ssize*scnt*sides*ntrk)
7777      return 100;
7878
r24077r24078
8585
8686   io_generic_read(io, h, 0, 32);
8787
88   int hsize         = LITTLE_ENDIANIZE_INT32(*(UINT32 *)(h+0x8));
89   int sector_size   = LITTLE_ENDIANIZE_INT32(*(UINT32 *)(h+0x10));
90   int sector_count  = LITTLE_ENDIANIZE_INT32(*(UINT32 *)(h+0x14));
91   int head_count    = LITTLE_ENDIANIZE_INT32(*(UINT32 *)(h+0x18));
92   int track_count   = LITTLE_ENDIANIZE_INT32(*(UINT32 *)(h+0x1c));
88   UINT32 hsize         = LITTLE_ENDIANIZE_INT32(*(UINT32 *)(h+0x8));
89   UINT32 sector_size   = LITTLE_ENDIANIZE_INT32(*(UINT32 *)(h+0x10));
90   UINT32 sector_count  = LITTLE_ENDIANIZE_INT32(*(UINT32 *)(h+0x14));
91   UINT32 head_count    = LITTLE_ENDIANIZE_INT32(*(UINT32 *)(h+0x18));
92   UINT32 track_count   = LITTLE_ENDIANIZE_INT32(*(UINT32 *)(h+0x1c));
9393
9494   int cell_count = form_factor == floppy_image::FF_35 ? 200000 : 166666;
9595
trunk/src/lib/formats/dsk_dsk.c
r24077r24078
343343   UINT8 header[0x100];
344344   bool extendformat = FALSE;
345345
346   int image_size = io_generic_size(io);
346   UINT64 image_size = io_generic_size(io);
347347
348348   io_generic_read(io, &header, 0, sizeof(header));
349349   if ( memcmp( header, EXT_FORMAT_HEADER, 16 ) ==0) {
trunk/src/lib/formats/coco_dsk.c
r24077r24078
487487static int coco_vdk_decode_header(floppy_image_legacy *floppy, struct basicdsk_geometry *geometry)
488488{
489489   UINT8 header[12];
490   int heads, tracks, sectors, sector_length, offset;
490   UINT8 heads, tracks, sectors;
491   UINT16 sector_length, offset;
491492   UINT64 size;
492493
493494   size = floppy_image_size(floppy);
r24077r24078
508509   sectors = 18;
509510   sector_length = 0x100;
510511
511   offset = ((int) header[3]) * 0x100 + header[2];
512   offset = header[3] * 0x100 + header[2];
512513
513   if (size != (heads * tracks * sectors * sector_length + offset))
514   if (size != ((UINT32) heads * tracks * sectors * sector_length + offset))
514515      return -1;
515516
516517   if (geometry)
trunk/src/lib/formats/esq16_dsk.c
r24077r24078
6868   return true;
6969}
7070
71void esqimg_format::find_size(io_generic *io, int &track_count, int &head_count, int &sector_count)
71void esqimg_format::find_size(io_generic *io, UINT8 &track_count, UINT8 &head_count, UINT8 &sector_count)
7272{
73   int size = io_generic_size(io);
73   UINT64 size = io_generic_size(io);
7474   track_count = 80;
7575   head_count = 2;
7676   sector_count = 10;
7777
78   if (size == 512*track_count*head_count*sector_count)
78   UINT32 expected_size = 512 * track_count*head_count*sector_count;
79   if (size == expected_size)
7980   {
8081      return;
8182   }
r24077r24078
8586
8687int esqimg_format::identify(io_generic *io, UINT32 form_factor)
8788{
88   int track_count, head_count, sector_count;
89   UINT8 track_count, head_count, sector_count;
8990   find_size(io, track_count, head_count, sector_count);
9091
9192   if(track_count)
r24077r24078
9596
9697bool esqimg_format::load(io_generic *io, UINT32 form_factor, floppy_image *image)
9798{
98   int track_count, head_count, sector_count;
99   UINT8 track_count, head_count, sector_count;
99100   find_size(io, track_count, head_count, sector_count);
100101
101102   UINT8 sectdata[10*512];
trunk/src/lib/formats/dfi_dsk.c
r24077r24078
9696
9797bool dfi_format::load(io_generic *io, UINT32 form_factor, floppy_image *image)
9898{
99   int size = io_generic_size(io);
100   int pos = 4;
99   UINT64 size = io_generic_size(io);
100   UINT64 pos = 4;
101101   UINT8 *data = 0;
102102   int data_size = 0; // size of currently allocated array for a track
103103   int onerev_time = 0; // time for one revolution, used to guess clock and rpm for DFE2 files
trunk/src/lib/formats/esq16_dsk.h
r24077r24078
3030   static const desc_e esq_10_desc[];
3131
3232private:
33   void find_size(io_generic *io, int &track_count, int &head_count, int &sector_count);
33   void find_size(io_generic *io, UINT8 &track_count, UINT8 &head_count, UINT8 &sector_count);
3434};
3535
3636extern const floppy_format_type FLOPPY_ESQIMG_FORMAT;
trunk/src/lib/formats/ap_dsk35.c
r24077r24078
12591259int dc42_format::identify(io_generic *io, UINT32 form_factor)
12601260{
12611261   UINT8 h[0x54];
1262   int size = io_generic_size(io);
1262   UINT64 size = io_generic_size(io);
12631263   if(size < 0x54)
12641264      return 0;
12651265
12661266   io_generic_read(io, h, 0, 0x54);
1267   int dsize = (h[0x40] << 24) | (h[0x41] << 16) | (h[0x42] << 8) | h[0x43];
1268   int tsize = (h[0x44] << 24) | (h[0x45] << 16) | (h[0x46] << 8) | h[0x47];
1267   UINT32 dsize = (h[0x40] << 24) | (h[0x41] << 16) | (h[0x42] << 8) | h[0x43];
1268   UINT32 tsize = (h[0x44] << 24) | (h[0x45] << 16) | (h[0x46] << 8) | h[0x47];
12691269
12701270   return dsize > 0 && tsize >= 0 && size == 0x54+tsize+dsize && h[0] < 64 && h[0x52] == 1 && h[0x53] == 0 ? 100 : 0;
12711271}
trunk/src/lib/formats/esq8_dsk.c
r24077r24078
7272
7373void esq8img_format::find_size(io_generic *io, int &track_count, int &head_count, int &sector_count)
7474{
75   int size = io_generic_size(io);
75   UINT64 size = io_generic_size(io);
7676   track_count = 80;
7777   head_count = 1;
7878   sector_count = 6;
trunk/src/lib/formats/st_dsk.c
r24077r24078
6666   return true;
6767}
6868
69void st_format::find_size(io_generic *io, int &track_count, int &head_count, int &sector_count)
69void st_format::find_size(io_generic *io, UINT8 &track_count, UINT8 &head_count, UINT8 &sector_count)
7070{
71   int size = io_generic_size(io);
71   UINT64 size = io_generic_size(io);
7272   for(track_count=80; track_count <= 82; track_count++)
7373      for(head_count=1; head_count <= 2; head_count++)
7474         for(sector_count=9; sector_count <= 11; sector_count++)
75            if(size == 512*track_count*head_count*sector_count)
75            if(size == (UINT32)512*track_count*head_count*sector_count)
7676               return;
7777   track_count = head_count = sector_count = 0;
7878}
7979
8080int st_format::identify(io_generic *io, UINT32 form_factor)
8181{
82   int track_count, head_count, sector_count;
82   UINT8 track_count, head_count, sector_count;
8383   find_size(io, track_count, head_count, sector_count);
8484
8585   if(track_count)
r24077r24078
8989
9090bool st_format::load(io_generic *io, UINT32 form_factor, floppy_image *image)
9191{
92   int track_count, head_count, sector_count;
92   UINT8 track_count, head_count, sector_count;
9393   find_size(io, track_count, head_count, sector_count);
9494
9595   UINT8 sectdata[11*512];
trunk/src/lib/formats/st_dsk.h
r24077r24078
2626   virtual bool supports_save() const;
2727
2828private:
29   void find_size(io_generic *io, int &track_count, int &head_count, int &sector_count);
29   void find_size(io_generic *io, UINT8 &track_count, UINT8 &head_count, UINT8 &sector_count);
3030};
3131
3232class msa_format : public floppy_image_format_t
trunk/src/lib/formats/thom_dsk.c
r24077r24078
251251{
252252   struct FloppyCallbacks *callbacks;
253253   struct sap_dsk_tag *tag;
254   int i,j;
254   int j;
255255   UINT8 fmt;
256256   tag = (struct sap_dsk_tag *) floppy_create_tag(floppy, sizeof(struct sap_dsk_tag));
257257   if (!tag)
r24077r24078
263263
264264      /* start with an empty offset table */
265265      tag->tracks = 0;
266      for ( i = 0; i < 80; i++ )
266      for ( int i = 0; i < 80; i++ )
267267            for ( j = 0; j < 16; j++ )
268268                  tag->sector_pos[i][j] = 0;
269269
270270      /* count tracks & fill sector offset table */
271   for ( i = 0x42; i+4 < floppy_image_size(floppy); i += tag->sector_size + 6 ) // CRC 2 bytes + 4 bytes sector header
271   for ( UINT64 i = 0x42; i+4 < floppy_image_size(floppy); i += tag->sector_size + 6 ) // CRC 2 bytes + 4 bytes sector header
272272   {
273273            UINT8 sector, track;
274274      floppy_image_read(floppy, &track, i+2, 1);
trunk/src/lib/formats/coupedsk.c
r24077r24078
6363
6464int mgt_format::identify(io_generic *io, UINT32 form_factor)
6565{
66   int size = io_generic_size(io);
66   UINT64 size = io_generic_size(io);
6767
6868   if(/*size == 737280 || */ size == 819200)
6969      return 50;
r24077r24078
7373
7474bool mgt_format::load(io_generic *io, UINT32 form_factor, floppy_image *image)
7575{
76   int size = io_generic_size(io);
76   UINT64 size = io_generic_size(io);
7777   int sector_count = size == 737280 ? 9 : 10;
7878
7979   UINT8 sectdata[10*512];
trunk/src/lib/formats/ap2_dsk.c
r24077r24078
576576
577577int a2_16sect_format::identify(io_generic *io, UINT32 form_factor)
578578{
579      int size = io_generic_size(io);
580      int expected_size = 35 * 16 * 256;
579      UINT64 size = io_generic_size(io);
580      UINT32 expected_size = 35 * 16 * 256;
581581      return size == expected_size;
582582}
583583
r24077r24078
935935
936936int a2_rwts18_format::identify(io_generic *io, UINT32 form_factor)
937937{
938      int size = io_generic_size(io);
939      int expected_size = 35 * 16 * 256;
938      UINT64 size = io_generic_size(io);
939      UINT32 expected_size = 35 * 16 * 256;
940940      return size == expected_size;
941941}
942942
trunk/src/lib/formats/td0_dsk.c
r24077r24078
318318
319319int td0dsk_t::data_read(UINT8 *buf, UINT16 size)
320320{
321   if (floppy_file_offset + size > io_generic_size(floppy_file) ) {
322      size = io_generic_size(floppy_file) - floppy_file_offset;
321   UINT64 image_size = io_generic_size(floppy_file);
322   if (size > image_size - floppy_file_offset) {
323      size = image_size - floppy_file_offset;
323324   }
324325   io_generic_read(floppy_file,buf,floppy_file_offset,size);
325326   floppy_file_offset += size;
trunk/src/lib/formats/wd177x_dsk.c
r24077r24078
4949
5050int wd177x_format::find_size(io_generic *io, UINT32 form_factor)
5151{
52   int size = io_generic_size(io);
52   UINT64 size = io_generic_size(io);
5353   for(int i=0; formats[i].form_factor; i++) {
5454      const format &f = formats[i];
5555      if(form_factor != floppy_image::FF_UNKNOWN && form_factor != f.form_factor)
5656         continue;
5757
58      if(size == compute_track_size(f) * f.track_count * f.head_count)
58      if(size == (UINT64)compute_track_size(f) * f.track_count * f.head_count)
5959         return i;
6060   }
6161   return -1;
trunk/src/lib/formats/imd_dsk.c
r24077r24078
364364
365365bool imd_format::load(io_generic *io, UINT32 form_factor, floppy_image *image)
366366{
367   int size = io_generic_size(io);
367   UINT64 size = io_generic_size(io);
368368   UINT8 *img = global_alloc_array(UINT8, size);
369369   io_generic_read(io, img, 0, size);
370370
371   int pos;
371   UINT64 pos;
372372   for(pos=0; pos < size && img[pos] != 0x1a; pos++);
373373   pos++;
374374
trunk/src/lib/formats/ipf_dsk.c
r24077r24078
4141
4242bool ipf_format::load(io_generic *io, UINT32 form_factor, floppy_image *image)
4343{
44   UINT32 size = io_generic_size(io);
44   UINT64 size = io_generic_size(io);
4545   UINT8 *data = global_alloc_array(UINT8, size);
4646   io_generic_read(io, data, 0, size);
4747   bool res = parse(data, size, image);
trunk/src/lib/formats/d88_dsk.c
r24077r24078
444444
445445int d88_format::identify(io_generic *io, UINT32 form_factor)
446446{
447   int size = io_generic_size(io);
447   UINT64 size = io_generic_size(io);
448448   UINT8 h[32];
449449
450450   io_generic_read(io, h, 0, 32);
trunk/src/lib/softfloat/softfloat-macros
r24077r24078
368368 )
369369{
370370    bits64 z0, z1, z2;
371    int8 carry0, carry1;
371    uint8 carry0, carry1;
372372
373373    z2 = a2 + b2;
374374    carry1 = ( z2 < a2 );
r24077r24078
424424 )
425425{
426426    bits64 z0, z1, z2;
427    int8 borrow0, borrow1;
427    uint8 borrow0, borrow1;
428428
429429    z2 = a2 - b2;
430430    borrow1 = ( a2 < b2 );
trunk/src/emu/debug/debugcmd.c
r24077r24078
20612061         return;
20622062
20632063      cheat_map *newmap = auto_alloc_array(machine, cheat_map, cheat.length + real_length);
2064      for (int item = 0; item < cheat.length; item++)
2064      for (UINT64 item = 0; item < cheat.length; item++)
20652065         newmap[item] = cheat.cheatmap[item];
20662066      auto_free(machine, cheat.cheatmap);
20672067      cheat.cheatmap = newmap;
r24077r24078
23732373   int cur_data_size;
23742374   int data_count = 0;
23752375   int found = 0;
2376   UINT64 i, j;
2376   int j;
23772377
23782378   /* validate parameters */
23792379   if (!debug_command_parameter_number(machine, param[0], &offset))
r24077r24078
23912391      cur_data_size = 1;
23922392
23932393   /* parse the data parameters */
2394   for (i = 2; i < params; i++)
2394   for (int i = 2; i < params; i++)
23952395   {
23962396      const char *pdata = param[i];
23972397
r24077r24078
24262426   }
24272427
24282428   /* now search */
2429   for (i = offset; i <= endoffset; i += data_size[0])
2429   for (UINT64 i = offset; i <= endoffset; i += data_size[0])
24302430   {
24312431      int suboffset = 0;
24322432      int match = 1;
r24077r24078
24692469   int minbytes, maxbytes, byteswidth;
24702470   address_space *space;
24712471   FILE *f = NULL;
2472   int i, j;
2472   int j;
24732473
24742474   /* validate parameters */
24752475   if (!debug_command_parameter_number(machine, param[1], &offset))
r24077r24078
25012501   }
25022502
25032503   /* now write the data out */
2504   for (i = 0; i < length; )
2504   for (UINT64 i = 0; i < length; )
25052505   {
25062506      int pcbyte = space->address_to_byte(offset + i) & space->bytemask();
25072507      char output[512], disasm[200];
r24077r24078
26772677
26782678   /* loop over lines */
26792679   int maxbytes = debug->max_opcode_bytes();
2680   for (int index = 0; index < count; index++)
2680   for (int index = 0; index < (int) count; index++)
26812681   {
26822682      offs_t pc = debug->history_pc(-index);
26832683
trunk/src/emu/cpu/tms32031/32031ops.c
r24077r24078
8484#define OR_V_ADD(a,b,r)     do { UINT32 temp = ((((a) ^ (r)) & ((b) ^ (r))) >> 30) & VFLAG; IREG(TMR_ST) |= temp | (temp << 4); } while (0)
8585#define OR_C_SUB(a,b,r)     do { IREG(TMR_ST) |= ((UINT32)(b) > (UINT32)(a)); } while (0)
8686#define OR_C_ADD(a,b,r)     do { IREG(TMR_ST) |= ((UINT32)(a) > (UINT32)(r)); } while (0)
87#define OR_C_SBB(a,b,c)     do { INT64 temp = (UINT32)(a) - (UINT32)(b) - (UINT32)(c); IREG(TMR_ST) |= (temp < 0); } while (0)
88#define OR_C_ADC(a,b,c)     do { UINT64 temp = (UINT32)(a) + (UINT32)(b) + (UINT32)(c); IREG(TMR_ST) |= (temp > 0xffffffffUL); } while (0)
87#define OR_C_SBB(a,b,c)     do { INT64 temp = (INT64)(a) - (UINT32)(b) - (UINT32)(c); IREG(TMR_ST) |= (temp < 0); } while (0)
88#define OR_C_ADC(a,b,c)     do { UINT64 temp = (UINT64)(a) + (UINT32)(b) + (UINT32)(c); IREG(TMR_ST) |= (temp > 0xffffffff); } while (0)
8989
9090#define OVM()               (IREG(TMR_ST) & OVMFLAG)
9191
trunk/src/emu/cpu/mc68hc11/mc68hc11.c
r24077r24078
550550   {
551551      int divider = div_tab[cpustate->pr & 3];
552552      UINT64 cur_time = cpustate->device->total_cycles();
553      UINT64 add = (cur_time - cpustate->frc_base) / divider;
553      UINT32 add = (cur_time - cpustate->frc_base) / divider;
554554
555555      if (add > 0)
556556      {
557         int i;
558
559         for(i=0;i<add;i++)
557         for(UINT32 i=0;i<add;i++)
560558         {
561559            cpustate->tcnt++;
562560            if(cpustate->tcnt == cpustate->toc1)
trunk/src/emu/cpu/rsp/rspdrc.c
r24077r24078
24482448      {
24492449         if (ACCUM_H(i) != 0)
24502450         {
2451            vres[i] = 0xffff;
2451            vres[i] = (INT16)0xffff;
24522452         }
24532453         else
24542454         {
24552455            if ((INT16)ACCUM_M(i) < 0)
24562456            {
2457               vres[i] = 0xffff;
2457               vres[i] = (INT16)0xffff;
24582458            }
24592459            else
24602460            {
trunk/src/emu/machine/pit8253.c
r24077r24078
226226void pit8253_device::decrease_counter_value(pit8253_timer *timer, UINT64 cycles)
227227{
228228   UINT16 value;
229   int units, tens, hundreds, thousands;
229   UINT8 units, tens, hundreds, thousands;
230230
231231   if (CTRL_BCD(timer->control) == 0)
232232   {
trunk/src/emu/machine/msm6242.c
r24077r24078
251251      return;
252252
253253   // ticks
254   if ((m_tick % 200) != ((delta + m_tick) % 0x200))
254   if ((m_tick % 200) != (int)((delta + m_tick) % 0x200))
255255      irq(IRQ_64THSECOND);
256256   delta = bump(RTC_TICKS, delta, 0, 0x8000);
257257   if (delta == 0)
trunk/src/emu/rendfont.c
r24077r24078
605605   m_height = (header[8] << 8) | header[9];
606606   m_scale = 1.0f / (float)m_height;
607607   m_yoffs = (INT16)((header[10] << 8) | header[11]);
608   int numchars = (header[12] << 24) | (header[13] << 16) | (header[14] << 8) | header[15];
608   UINT32 numchars = (header[12] << 24) | (header[13] << 16) | (header[14] << 8) | header[15];
609609   if (filesize - CACHED_HEADER_SIZE < numchars * CACHED_CHAR_SIZE)
610610      return false;
611611
trunk/src/mame/video/tia.c
r24077r24078
835835{
836836   if (data & 0x80)
837837   {
838      paddle_cycles = machine().firstcpu->total_cycles();
838      paddle_start = machine().firstcpu->total_cycles();
839839   }
840840   if ( ! ( VBLANK & 0x40 ) ) {
841841      INPT4 = 0x80;
r24077r24078
15881588
15891589READ8_MEMBER( tia_video_device::INPT_r )
15901590{
1591   UINT64 elapsed = machine().firstcpu->total_cycles() - paddle_cycles;
1592   int input = TIA_INPUT_PORT_ALWAYS_ON;
1591   UINT64 elapsed = machine().firstcpu->total_cycles() - paddle_start;
1592   UINT16 input = TIA_INPUT_PORT_ALWAYS_ON;
15931593   if ( !m_read_input_port_func.isnull() )
15941594   {
15951595      input = m_read_input_port_func(offset & 3, 0xFFFF);
r24077r24078
16001600   if ( input == TIA_INPUT_PORT_ALWAYS_OFF )
16011601      return 0x00;
16021602
1603   return elapsed > 76 * input ? 0x80 : 0x00;
1603   UINT16 paddle_cycles = input * 76;
1604   return elapsed > paddle_cycles ? 0x80 : 0x00;
16041605}
16051606
16061607
trunk/src/mame/video/tia.h
r24077r24078
117117   struct player_gfx p1gfx;
118118
119119   UINT64 frame_cycles;
120   UINT64 paddle_cycles;
120   UINT64 paddle_start;
121121
122122   int horzP0;
123123   int horzP1;
trunk/src/mame/video/tank8.c
r24077r24078
215215         const UINT16* p2 = &m_helper2.pix16(y);
216216         const UINT16* p3 = &m_helper3.pix16(y);
217217
218         if (y % 2 != machine().primary_screen->frame_number() % 2)
218         if ((machine().primary_screen->frame_number() ^ y) & 1)
219219            continue; /* video display is interlaced */
220220
221221         for (x = visarea.min_x; x <= visarea.max_x; x++)
trunk/src/mame/drivers/beathead.c
r24077r24078
475475
476476READ32_MEMBER( beathead_state::speedup_r )
477477{
478   int result = *m_speedup_data;
478   UINT32 result = *m_speedup_data;
479479   if ((space.device().safe_pcbase() & 0xfffff) == 0x006f0 && result == space.device().state().state_int(ASAP_R3))
480480      space.device().execute().spin_until_interrupt();
481481   return result;
trunk/src/mame/machine/harddriv.c
r24077r24078
19851985READ16_HANDLER( rdgsp_speedup1_r )
19861986{
19871987   harddriv_state *state = space.machine().driver_data<harddriv_state>();
1988   int result = state->m_gsp_speedup_addr[0][offset];
1988   UINT16 result = state->m_gsp_speedup_addr[0][offset];
19891989
19901990   /* if this address is equal to $f000, spin until something gets written */
19911991   if (&space.device() == state->m_gsp && space.device().safe_pc() == state->m_gsp_speedup_pc &&
1992      (result & 0xff) < space.device().state().state_int(TMS34010_A1))
1992      (UINT8)result < space.device().state().state_int(TMS34010_A1))
19931993   {
19941994      state->m_gsp_speedup_count[0]++;
19951995      space.device().execute().spin_until_interrupt();
trunk/src/tools/chdman.c
r24077r24078
400400   virtual UINT32 read_data(void *_dest, UINT64 offset, UINT32 length)
401401   {
402402      UINT8 *dest = reinterpret_cast<UINT8 *>(_dest);
403      int interlace_factor = m_info.interlaced ? 2 : 1;
403      UINT8 interlace_factor = m_info.interlaced ? 2 : 1;
404404      UINT32 length_remaining = length;
405405
406406      // iterate over frames
r24077r24078
14971497      progress(false, "Verifying, %.1f%% complete... \r", 100.0 * double(offset) / double(input_chd.logical_bytes()));
14981498
14991499      // determine how much to read
1500      UINT32 bytes_to_read = MIN(buffer.count(), input_chd.logical_bytes() - offset);
1500      UINT32 bytes_to_read = MIN((UINT32)buffer.count(), input_chd.logical_bytes() - offset);
15011501      chd_error err = input_chd.read_bytes(offset, buffer, bytes_to_read);
15021502      if (err != CHDERR_NONE)
15031503         report_error(1, "Error reading CHD file (%s): %s", params.find(OPTION_INPUT)->cstr(), chd_file::error_string(err));
r24077r24078
22132213         progress(false, "Extracting, %.1f%% complete... \r", 100.0 * double(offset - input_start) / double(input_end - input_start));
22142214
22152215         // determine how much to read
2216         UINT32 bytes_to_read = MIN(buffer.count(), input_end - offset);
2216         UINT32 bytes_to_read = MIN((UINT32)buffer.count(), input_end - offset);
22172217         chd_error err = input_chd.read_bytes(offset, buffer, bytes_to_read);
22182218         if (err != CHDERR_NONE)
22192219            report_error(1, "Error reading CHD file (%s): %s", params.find(OPTION_INPUT)->cstr(), chd_file::error_string(err));
r24077r24078
24752475         report_error(1, "Improperly formatted A/V metadata found");
24762476      fps_times_1million = fps * 1000000 + fpsfrac;
24772477   }
2478   int interlace_factor = interlaced ? 2 : 1;
2478   UINT8 interlace_factor = interlaced ? 2 : 1;
24792479
24802480   // determine key parameters and validate
24812481   max_samples_per_frame = (UINT64(rate) * 1000000 + fps_times_1million - 1) / fps_times_1million;
r24077r24078
25432543
25442544      // iterate over frames
25452545      bitmap_yuy16 fullbitmap(width, height * interlace_factor);
2546      for (int framenum = input_start; framenum < input_end; framenum++)
2546      for (UINT64 framenum = input_start; framenum < input_end; framenum++)
25472547      {
2548         progress(framenum == 0, "Extracting, %.1f%% complete...  \r", 100.0 * double(framenum - input_start) / double(input_end - input_start));
2548         progress(framenum == input_start, "Extracting, %.1f%% complete...  \r", 100.0 * double(framenum - input_start) / double(input_end - input_start));
25492549
25502550         // set up the fake bitmap for this frame
25512551         avconfig.video.wrap(&fullbitmap.pix(framenum % interlace_factor), fullbitmap.width(), fullbitmap.height() / interlace_factor, fullbitmap.rowpixels() * interlace_factor);
r24077r24078
25652565         }
25662566
25672567         // write video
2568         if (framenum % interlace_factor == interlace_factor - 1)
2568         if ((framenum + 1) % interlace_factor == 0)
25692569         {
25702570            avi_error avierr = avi_append_video_frame(output_file, fullbitmap);
25712571            if (avierr != AVIERR_NONE)

Previous 199869 Revisions Next


© 1997-2024 The MAME Team