Previous 15994 Revisions Next

r1084 Saturday 6th October, 2007 at 21:30:39 UTC by Firewave
1. Removed obsolete global var mess_path

2. Removed unused dummy read handler

3. Removed unnecessary cast

4. Replaced bool with BOOL

5. Replaced normalize_string() with xml_normalize_string()
[src/mess]infomess.c mess.c mess.h uimess.c
[src/mess/machine]pcf8593.c

src/mess/uimess.c
r1083r1084
128128            char *base_filename_noextension;
129129
130130            base_filename = image_basename(img);
131            base_filename_noextension = strip_extension((char *) base_filename);
131            base_filename_noextension = strip_extension(base_filename);
132132
133133            /* display device type and filename */
134134            dst += sprintf(dst,"%s: %s\n", image_typename_id(img), base_filename);
src/mess/mess.c
r1083r1084
2121#include "messopts.h"
2222
2323/* Globals */
24const char *mess_path;
25
2624UINT32 mess_ram_size;
2725UINT8 *mess_ram;
2826UINT8 mess_ram_default_value = 0xCD;
r1083r1084
132130   const char *image_name;
133131   mess_image *image;
134132
135   /* convienient place to call this */
136   {
137      char buf[260];
138      osd_getcurdir(buf, ARRAY_LENGTH(buf));
139      mess_path = auto_strdup(buf);
140   }
141
142133   /* initialize natural keyboard support */
143134   inputx_init();
144135
r1083r1084
263254
264255***************************************************************************/
265256
266READ8_HANDLER( return8_00 )   { return 0x00; }
267257READ8_HANDLER( return8_FE )   { return 0xFE; }
268258READ8_HANDLER( return8_FF )   { return 0xFF; }
269259READ16_HANDLER( return16_FFFF ) { return 0xFFFF; }
src/mess/mess.h
r1083r1084
3232
3333/**************************************************************************/
3434
35#ifndef bool
36#define bool int
37#endif
38
3935/* Win32 defines this for vararg functions */
4036#ifndef DECL_SPEC
4137#define DECL_SPEC
r1083r1084
112108/* --------------------------------------------------------------------------------------------- */
113109
114110/* dummy read handlers */
115READ8_HANDLER(return8_00);
116111READ8_HANDLER(return8_FE);
117112READ8_HANDLER(return8_FF);
118113READ16_HANDLER(return16_FFFF);
119114
120/* gets the path to the MESS executable */
121extern const char *mess_path;
122
123115#endif
src/mess/infomess.c
r1083r1084
1212#include "sound/samples.h"
1313#include "info.h"
1414#include "hash.h"
15#include "xmlfile.h"
1516
1617/*************************************
1718 *
r1083r1084
1920 *
2021 *************************************/
2122
22/* Print a free format string */
23static const char *normalize_string(const char* s)
24{
25   static char buffer[1024];
26   char *d = &buffer[0];
2723
28   if (s)
29   {
30      while (*s)
31      {
32         switch (*s)
33         {
34            case '\"' : d += sprintf(d, """); break;
35            case '&'  : d += sprintf(d, "&"); break;
36            case '<'  : d += sprintf(d, "&lt;"); break;
37            case '>'  : d += sprintf(d, "&gt;"); break;
38            default:
39               if (*s>=' ' && *s<='~')
40                  *d++ = *s;
41               else
42                  d += sprintf(d, "&#%d;", (unsigned)(unsigned char)*s);
43         }
44         ++s;
45      }
46   }
47   *d++ = 0;
48   return buffer;
49}
50
51
52
5324void print_game_device(FILE* out, const game_driver* game)
5425{
5526   const struct IODevice* devices;
r1083r1084
6334      for (devindex = 0; devices[devindex].type < IO_COUNT; devindex++)
6435      {
6536         /* print out device type */
66         fprintf(out, "\t\t<device type=\"%s\"", normalize_string(device_typename(devices[devindex].type)));
37         fprintf(out, "\t\t<device type=\"%s\"", xml_normalize_string(device_typename(devices[devindex].type)));
6738
6839         /* does this device have a tag? */
6940         if (devices[devindex].tag)
70            fprintf(out, " tag=\"%s\"", normalize_string(devices[devindex].tag));
41            fprintf(out, " tag=\"%s\"", xml_normalize_string(devices[devindex].tag));
7142
7243         /* is this device mandatory? */
7344         if (devices[devindex].must_be_loaded)
r1083r1084
8253            shortname = device_briefinstancename(&devices[devindex].devclass, id);
8354
8455            fprintf(out, "\t\t\t<instance");
85            fprintf(out, " name=\"%s\"", normalize_string(name));
86            fprintf(out, " briefname=\"%s\"", normalize_string(shortname));
56            fprintf(out, " name=\"%s\"", xml_normalize_string(name));
57            fprintf(out, " briefname=\"%s\"", xml_normalize_string(shortname));
8758            fprintf(out, "/>\n");
8859         }
8960
r1083r1084
9364            while (*ext)
9465            {
9566               fprintf(out, "\t\t\t<extension");
96               fprintf(out, " name=\"%s\"", normalize_string(ext));
67               fprintf(out, " name=\"%s\"", xml_normalize_string(ext));
9768               fprintf(out, "/>\n");
9869               ext += strlen(ext) + 1;
9970            }
src/mess/machine/pcf8593.c
r1083r1084
4141   UINT8 *data;
4242   UINT32 size;
4343   int pin_scl, pin_sda, inp;
44   bool active;
44   BOOL active;
4545   int bits;
4646   UINT8 data_recv_index, data_recv[50];
4747   UINT8 mode, pos;

Previous 15994 Revisions Next


© 1998-2018 The MESS Team