Previous 199869 Revisions Next

r34752 Friday 30th January, 2015 at 22:32:22 UTC by Couriersud
Fixed SDL1.2 (osx, linux, windows). (nw)
[src/emu/cpu/amis2000]amis2000.c amis2000.h amis2000op.inc
[src/mame/drivers]comebaby.c
[src/osd/sdl]video.c video.h

trunk/src/emu/cpu/amis2000/amis2000.c
r243263r243264
55  American Microsystems, Inc.(AMI) S2000-family 4-bit MCU cores, introduced late 1970s
66 
77  TODO:
8  - unemulated opcodes (need more testing material)
9  - support external program map
10  - add 50/60hz timer
8  - x
119  - add S2200/S2400
1210
1311*/
r243263r243264
149147   m_e = 0;
150148   m_i = 0;
151149   m_k = 0;
152   m_d = 0;
153   m_a = 0;
154150
155151   // register for savestates
156152   save_item(NAME(m_callstack));
r243263r243264
168164   save_item(NAME(m_e));
169165   save_item(NAME(m_i));
170166   save_item(NAME(m_k));
171   save_item(NAME(m_d));
172   save_item(NAME(m_a));
173167
174168   // register state for debugger
175169   state_add(S2000_PC,     "PC",     m_pc    ).formatstr("%04X");
r243263r243264
196190   m_pc = 0;
197191   m_skip = false;
198192   m_op = 0;
199   
200   // clear i/o
201   m_i = 0;
202   m_k = 0;
203   m_d = 0; m_write_d(0, 0, 0xff);
204   m_a = 0; m_write_a(0, 0, 0xffff);
205193}
206194
207195
trunk/src/emu/cpu/amis2000/amis2000.h
r243263r243264
9191   UINT8 m_e;                  // 4-bit generic register
9292   UINT8 m_i;                  // 4-bit i-pins latch
9393   UINT8 m_k;                  // 4-bit k-pins latch
94   UINT8 m_d;                  // 8-bit d-pins latch
95   UINT16 m_a;                 // 13-bit a-pins latch (master strobe latch)
9694
9795   devcb_read8 m_read_k;
9896   devcb_read8 m_read_i;
trunk/src/emu/cpu/amis2000/amis2000op.inc
r243263r243264
187187void amis2000_device::op_disb()
188188{
189189   // DISB: set D-latch to ACC and RAM directly
190   m_d = m_acc | ram_r() << 4;
191   m_write_d(0, m_d, 0xff);
192   // TODO: exit from floating mode on D-pins
190   op_illegal();
193191}
194192
195193void amis2000_device::op_disn()
196194{
197   // DISN: set D-latch to ACC+carry via on-die segment decoder
198   static const UINT8 lut_segment_decoder[0x10] =
199   {
200      // 0-F digits in bit order [DP]abcdefg
201      0x7e, 0x30, 0x6d, 0x79, 0x33, 0x5b, 0x5f, 0x70, 0x7f, 0x7b, 0x77, 0x1f, 0x4e, 0x3d, 0x4f, 0x47
202   };
203   m_d = lut_segment_decoder[m_acc] | (m_carry ? 0x80 : 0x00);
204   m_write_d(0, m_d, 0xff);
205   // TODO: exit from floating mode on D-pins
195   // DISN: set D-latch to ACC+carry via segment decoder
196   op_illegal();
206197}
207198
208199void amis2000_device::op_mvs()
209200{
210201   // MVS: output master strobe latch to A-pins
211   m_write_a(0, m_a, 0xffff);
212   // TODO: enter floating mode on D-pins
202   op_illegal();
213203}
214204
215205void amis2000_device::op_psh()
216206{
217207   // PSH: preset high(BL) master strobe latch
218   switch (m_bl)
219   {
220      case 0xd:
221         // set multiplex operation
222         // ?
223         break;
224
225      case 0xe:
226         // exit from floating mode on D-pins
227         // ?
228         break;
229
230      case 0xf:
231         // set all latch bits high
232         m_a = 0x1fff;
233         break;
234
235      default:
236         // set selected latch bit high
237         m_a |= (1 << m_bl);
238         break;
239   }
208   op_illegal();
240209}
241210
242211void amis2000_device::op_psl()
243212{
244213   // PSL: preset low(BL) master strobe latch
245   switch (m_bl)
246   {
247      case 0xd:
248         // set static operation
249         // ?
250         break;
251
252      case 0xe:
253         // enter floating mode on D-pins
254         // ?
255         break;
256
257      case 0xf:
258         // set all latch bits low
259         m_a = 0;
260         break;
261
262      default:
263         // set selected latch bit low
264         m_a &= ~(1 << m_bl);
265         break;
266   }
214   op_illegal();
267215}
268216
269217void amis2000_device::op_eur()
trunk/src/mame/drivers/comebaby.c
r243263r243264
22  (c) 2000 ExPotato Co. Ltd (Excellent Potato)
33
44TODO:
5Can't be emulated without proper motherboard BIOS
5can't be emulated without proper mb bios
66
7  There also appears to be a sequel which may be running on the same hardware, which might not have been released.
7  There also appears to be a sequel which may be running on the same hardware
88  Come On Baby - Ballympic Heroes!  (c) 2001
9 
10  Other games in this series include:
11  Come On Baby 2 (c) 2002
12  Come On Baby Jr (c) 2003 (which seems to be otherwise identical to Come On Baby but in a smaller cabinet)
13  Come On Baby 2 Jr (c) 2003 (which seems to be otherwise identical to Come On Baby 2 but in a smaller cabinet)
14  These may or may not be on identical hardware.
159
1610  This is a Korean PC based board running Windows.  The game runs fully from
1711  the hard disk making these things rather fragile and prone to damage.
r243263r243264
2014  just a skeleton placeholder for the CHD dump of the hard disk.
2115
2216  The donor PC looks like a standard Windows98 setup.
23  The only exceptions we see are that there's a game logo.sys/logo.bmp in the
17  The only exceptions I see are that there's a game logo.sys/logo.bmp in the
2418  root directory to hide the Windows98 startup screen, and a shortcut to
2519  the game in the startup programs.
2620  Also of interest, Windows98 was installed from a setup folder on the HD.
trunk/src/osd/sdl/video.c
r243263r243264
156156   #if defined(SDLMAME_WIN32)  // Win32 version
157157   MONITORINFOEX info;
158158   info.cbSize = sizeof(info);
159   GetMonitorInfo((HMONITOR)monitor->handle, (LPMONITORINFO)&info);
160   monitor->m_dimensions.x = monitor->m_dimensions.y = 0;
161   monitor->m_center_width = monitor->m_dimensions.w = info.rcMonitor.right - info.rcMonitor.left;
162   monitor->m_center_height = monitor->m_dimensions.h = info.rcMonitor.bottom - info.rcMonitor.top;
159   GetMonitorInfo((HMONITOR)m_handle, (LPMONITORINFO)&info);
160   m_dimensions.x = m_dimensions.y = 0;
161   m_center_width = m_dimensions.w = info.rcMonitor.right - info.rcMonitor.left;
162   m_center_height = m_dimensions.h = info.rcMonitor.bottom - info.rcMonitor.top;
163163   char *temp = utf8_from_wstring(info.szDevice);
164   strcpy(monitor->monitor_device, temp);
164   strcpy(m_monitor_device, temp);
165165   osd_free(temp);
166166   #elif defined(SDLMAME_MACOSX)   // Mac OS X Core Imaging version
167167   CGDirectDisplayID primary;
r243263r243264
171171   primary = CGMainDisplayID();
172172   dbounds = CGDisplayBounds(primary);
173173
174   monitor->center_width = monitor->monitor_width = dbounds.size.width - dbounds.origin.x;
175   monitor->center_height = monitor->monitor_height = dbounds.size.height - dbounds.origin.y;
176   strcpy(monitor->monitor_device, "Mac OS X display");
174   m_dimensions.x = m_dimensions.y = 0;
175   m_center_width = m_dimensions.w = dbounds.size.width - dbounds.origin.x;
176   m_center_height = m_dimensions.h = dbounds.size.height - dbounds.origin.y;
177   strcpy(m_monitor_device, "Mac OS X display");
177178   #elif defined(SDLMAME_X11) || defined(SDLMAME_NO_X11)       // X11 version
178179   {
179180      #if defined(SDLMAME_X11)
r243263r243264
185186      if ( SDL_GetWMInfo(&info) && (info.subsystem == SDL_SYSWM_X11) )
186187      {
187188         screen = DefaultScreen(info.info.x11.display);
188         SDL_VideoDriverName(monitor->monitor_device, sizeof(monitor->monitor_device)-1);
189         monitor->monitor_width = DisplayWidth(info.info.x11.display, screen);
190         monitor->monitor_height = DisplayHeight(info.info.x11.display, screen);
189         SDL_VideoDriverName(m_monitor_device, sizeof(m_monitor_device)-1);
190         m_dimensions.x = m_dimensions.y = 0;
191         m_dimensions.w = DisplayWidth(info.info.x11.display, screen);
192         m_dimensions.h = DisplayHeight(info.info.x11.display, screen);
191193
192194         if ((XineramaIsActive(info.info.x11.display)) && video_config.restrictonemonitor)
193195         {
r243263r243264
196198
197199               xineinfo = XineramaQueryScreens(info.info.x11.display, &numscreens);
198200
199            monitor->center_width = xineinfo[0].width;
200            monitor->center_height = xineinfo[0].height;
201            m_center_width = xineinfo[0].width;
202            m_center_height = xineinfo[0].height;
201203
202204            XFree(xineinfo);
203205         }
204206         else
205207         {
206            monitor->center_width = monitor->monitor_width;
207            monitor->center_height = monitor->monitor_height;
208            m_center_width = m_dimensions.w;
209            m_center_height = m_dimensions.h;
208210         }
209211      }
210212      else
r243263r243264
213215         static int first_call=0;
214216         static int cw = 0, ch = 0;
215217
216         SDL_VideoDriverName(monitor->monitor_device, sizeof(monitor->monitor_device)-1);
218         SDL_VideoDriverName(m_monitor_device, sizeof(m_monitor_device)-1);
217219         if (first_call==0)
218220         {
219221            const char *dimstr = osd_getenv(SDLENV_DESKTOPDIM);
r243263r243264
233235               }
234236               if ((cw==0) || (ch==0))
235237               {
236                  osd_printf_warning("WARNING: SDL_GetVideoInfo() for driver <%s> is broken.\n", monitor->monitor_device);
238                  osd_printf_warning("WARNING: SDL_GetVideoInfo() for driver <%s> is broken.\n", m_monitor_device);
237239                  osd_printf_warning("         You should set SDLMAME_DESKTOPDIM to your desktop size.\n");
238240                  osd_printf_warning("            e.g. export SDLMAME_DESKTOPDIM=800x600\n");
239241                  osd_printf_warning("         Assuming 1024x768 now!\n");
r243263r243264
242244               }
243245            }
244246         }
245         monitor->monitor_width = cw;
246         monitor->monitor_height = ch;
247         monitor->center_width = cw;
248         monitor->center_height = ch;
247         m_dimensions.w = cw;
248         m_dimensions.h = ch;
249         m_center_width = cw;
250         m_center_height = ch;
249251      }
250252   }
251253   #elif defined(SDLMAME_OS2)      // OS2 version
252   monitor->center_width = monitor->monitor_width = WinQuerySysValue( HWND_DESKTOP, SV_CXSCREEN );
253   monitor->center_height = monitor->monitor_height = WinQuerySysValue( HWND_DESKTOP, SV_CYSCREEN );
254   strcpy(monitor->monitor_device, "OS/2 display");
254   m_dimensions.x = m_dimensions.y = 0;
255   m_center_width = m_dimensions.w = WinQuerySysValue( HWND_DESKTOP, SV_CXSCREEN );
256   m_center_height = m_dimensions.h = WinQuerySysValue( HWND_DESKTOP, SV_CYSCREEN );
257   strcpy(m_monitor_device, "OS/2 display");
255258   #else
256259   #error Unknown SDLMAME_xx OS type!
257260   #endif
r243263r243264
260263      static int info_shown=0;
261264      if (!info_shown)
262265      {
263         osd_printf_verbose("SDL Device Driver     : %s\n", monitor->monitor_device);
264         osd_printf_verbose("SDL Monitor Dimensions: %d x %d\n", monitor->monitor_width, monitor->monitor_height);
266         osd_printf_verbose("SDL Device Driver     : %s\n", m_monitor_device);
267         osd_printf_verbose("SDL Monitor Dimensions: %d x %d\n", m_dimensions.w, m_dimensions.h);
265268         info_shown = 1;
266269      }
267270   }
r243263r243264
323326//============================================================
324327
325328#if !defined(SDLMAME_WIN32) && !(SDLMAME_SDL2)
326static void add_primary_monitor(void *data)
329void sdl_monitor_info::add_primary_monitor(void *data)
327330{
328331   sdl_monitor_info ***tailptr = (sdl_monitor_info ***)data;
329332   sdl_monitor_info *monitor;
r243263r243264
332335   monitor = global_alloc_clear(sdl_monitor_info);
333336
334337   // copy in the data
335   monitor->handle = 1;
338   monitor->m_handle = 1;
336339
337   sdlvideo_monitor_refresh(monitor);
340   monitor->refresh();
338341
339342   // guess the aspect ratio assuming square pixels
340   monitor->aspect = (float)(monitor->monitor_width) / (float)(monitor->monitor_height);
343   monitor->m_aspect = (float)(monitor->m_dimensions.w) / (float)(monitor->m_dimensions.h);
341344
342345   // save the primary monitor handle
343346   primary_monitor = monitor;
344347
345348   // hook us into the list
346349   **tailptr = monitor;
347   *tailptr = &monitor->next;
350   *tailptr = &monitor->m_next;
348351}
349352#endif
350353
r243263r243264
367370   assert(result);
368371   (void)result; // to silence gcc 4.6
369372
370   // allocate a new monitor info
371   monitor = global_alloc_clear(sdl_monitor_info);
373   // guess the aspect ratio assuming square pixels
374   float aspect = (float)(info.rcMonitor.right - info.rcMonitor.left) / (float)(info.rcMonitor.bottom - info.rcMonitor.top);
372375
373   // copy in the data
374
375#ifdef PTR64
376   monitor->handle = (UINT64)handle;
377#else
378   monitor->handle = (UINT32)handle;
379#endif
380   monitor->monitor_width = info.rcMonitor.right - info.rcMonitor.left;
381   monitor->monitor_height = info.rcMonitor.bottom - info.rcMonitor.top;
382   monitor->center_width = monitor->monitor_width;
383   monitor->center_height = monitor->monitor_height;
376   // allocate a new monitor info
384377   char *temp = utf8_from_wstring(info.szDevice);
385   strcpy(monitor->monitor_device, temp);
378   // copy in the data
379   monitor = global_alloc(sdl_monitor_info((UINT64) handle, temp, aspect));
386380   osd_free(temp);
387381
388   // guess the aspect ratio assuming square pixels
389   monitor->aspect = (float)(info.rcMonitor.right - info.rcMonitor.left) / (float)(info.rcMonitor.bottom - info.rcMonitor.top);
390
391382   // save the primary monitor handle
392383   if (info.dwFlags & MONITORINFOF_PRIMARY)
393      primary_monitor = monitor;
384      sdl_monitor_info::primary_monitor = monitor;
394385
395386   // hook us into the list
396387   **tailptr = monitor;
397   *tailptr = &monitor->next;
388   *tailptr = &monitor->m_next;
398389
399390   // enumerate all the available monitors so to list their names in verbose mode
400391   return TRUE;
r243263r243264
449440
450441         // hook us into the list
451442         *tailptr = monitor;
452         tailptr = &monitor->next;
443         tailptr = &monitor->m_next;
453444      }
454445   }
455446   osd_printf_verbose("Leave init_monitors\n");
r243263r243264
466457   while (sdl_monitor_info::list != NULL)
467458   {
468459      sdl_monitor_info *temp = sdl_monitor_info::list;
469      sdl_monitor_info::list = temp->next;
460      sdl_monitor_info::list = temp->next();
470461      global_free(temp);
471462   }
472463}
r243263r243264
498489   // look for a match in the name first
499490   if (scrname != NULL)
500491   {
501      for (monitor = sdl_monitor_info::list; monitor != NULL; monitor = monitor->next)
492      for (monitor = sdl_monitor_info::list; monitor != NULL; monitor = monitor->next())
502493      {
503494         moncount++;
504495         if (strcmp(scrname, monitor->device()) == 0)
r243263r243264
508499
509500   // didn't find it; alternate monitors until we hit the jackpot
510501   index %= moncount;
511   for (monitor = sdl_monitor_info::list; monitor != NULL; monitor = monitor->next)
502   for (monitor = sdl_monitor_info::list; monitor != NULL; monitor = monitor->next())
512503      if (index-- == 0)
513504         goto finishit;
514505
r243263r243264
523514   return monitor;
524515}
525516#else
526static sdl_monitor_info *pick_monitor(sdl_options &options, int index)
517sdl_monitor_info *sdl_monitor_info::pick_monitor(sdl_options &options, int index)
527518{
528519   sdl_monitor_info *monitor;
529520   float aspect;
r243263r243264
536527
537528   if (aspect != 0)
538529   {
539      monitor->aspect = aspect;
530      monitor->m_aspect = aspect;
540531   }
541532   return monitor;
542533}
trunk/src/osd/sdl/video.h
r243263r243264
5858   int                 height;
5959};
6060
61// FIXME: This is sort of ugly ... and should be a real interface only
6162class sdl_monitor_info
6263{
6364public:
64   sdl_monitor_info  * next;                   // pointer to next monitor in list
6565
66   sdl_monitor_info()
67   : m_next(NULL), m_handle(0), m_aspect(0.0f),
68     m_center_width(0), m_center_height(0)
69     {}
70   sdl_monitor_info(const UINT64 handle, const char *monitor_device, float aspect)
71   : m_next(NULL), m_handle(handle), m_aspect(aspect),
72     m_center_width(0), m_center_height(0)
73   {
74      strncpy(m_monitor_device, monitor_device, 64);
75      refresh();
76   }
77
6678   const UINT64 handle() { return m_handle; }
6779   const SDL_Rect &position_size() { refresh(); return m_dimensions; }
6880
6981   const char *device() { return m_monitor_device; }
7082
7183   float aspect();
84
7285   int   center_width() { refresh(); return m_center_width; }
7386   int center_height() { refresh(); return m_center_height; }
7487
r243263r243264
7891   static void   init();
7992   static void exit();
8093   static sdl_monitor_info *pick_monitor(sdl_options &options, int index);
94#if !defined(SDLMAME_WIN32) && !(SDLMAME_SDL2)
95   static void add_primary_monitor(void *data);
96#endif
8197
98   sdl_monitor_info     * next() { return m_next; }   // pointer to next monitor in list
99
100   // STATIC
101   static sdl_monitor_info *primary_monitor;
102   static sdl_monitor_info *list;
103
104   // FIXME: shouldn't be here - see windows enumeration callback
105   sdl_monitor_info     * m_next;                   // pointer to next monitor in list
82106private:
83107   void refresh();
84108
r243263r243264
89113   int                 m_center_width;           // width of first physical screen for centering
90114   int                 m_center_height;          // height of first physical screen for centering
91115
92   // STATIC
93   static sdl_monitor_info *primary_monitor;
94   static sdl_monitor_info *list;
95116
96117};
97118


Previous 199869 Revisions Next


© 1997-2024 The MAME Team