Previous 15994 Revisions Next

r1982 Thursday 13th March, 2008 at 12:10:18 UTC by Dirk Best
More Machine -> machine updates [Anonymous]
[src/mess]device.h mesvalid.c mslegacy.c
[src/mess/audio]gb.c
[src/mess/drivers]amstrad.c apexc.c apf.c atarist.c avigo.c einstein.c exelv.c nc.c pcw.c pcw16.c ql.c saturn.c snes.c tm990189.c x68k.c z88.c
[src/mess/includes]apf.h
[src/mess/machine]applefdc.c
[src/mess/osd/windows]menu.c menu.h
[src/mess/video]apf.c
[src/osd/windows]window.c window.h

src/osd/windows/window.c
r1981r1982
4141
4242#ifdef MESS
4343#include "menu.h"
44#include "deprecat.h"
4445#endif /* MESS */
4546
4647extern int drawnone_init(win_draw_callbacks *callbacks);
r1981r1982
11841185
11851186   // create the window menu if needed
11861187#if HAS_WINDOW_MENU
1187   if (win_create_menu(&menu))
1188   if (win_create_menu(Machine, &menu))
11881189      return 1;
11891190#endif
11901191
src/osd/windows/window.h
r1981r1982
126126void winwindow_ui_exec_on_main_thread(void (*func)(void *), void *param);
127127void winwindow_dispatch_message(MSG *message);
128128
129#if HAS_WINDOW_MENU
130int win_create_menu(HMENU *menus);
131#endif
132129
133130
134
135131//============================================================
136132//  win_has_menu
137133//============================================================
src/mess/mslegacy.c
r1981r1982
88*********************************************************************/
99
1010#include "driver.h"
11#include "deprecat.h"
1211#include "mslegacy.h"
1312
1413
src/mess/audio/gb.c
r1981r1982
314314         snd_4.count = 0;
315315         snd_4.env_value = snd_regs[NR42] >> 4;
316316         snd_4.env_count = 0;
317         snd_4.signal = mame_rand(Machine);
317         snd_4.signal = mame_rand(machine);
318318         snd_4.ply_value = 0x7fff;
319319         snd_regs[NR52] |= 0x8;
320320      }
src/mess/includes/apf.h
r1981r1982
1616
1717/*----------- defined in drivers/apf.c -----------*/
1818
19void apf_update_ints(void);
19void apf_update_ints(running_machine *machine);
2020
2121/*----------- defined in machine/apf.c -----------*/
2222
src/mess/video/apf.c
r1981r1982
33******************************************************************************/
44
55#include "driver.h"
6#include "deprecat.h"
67#include "video/m6847.h"
78#include "includes/apf.h"
89
r1981r1982
3738      apf_ints |= 0x10;
3839   else
3940      apf_ints &= ~0x10;
40   apf_update_ints();
41   apf_update_ints(Machine);
4142}
4243
4344
src/mess/device.h
r1981r1982
283283const struct IODevice *device_find_tag(const struct IODevice *devices, const char *tag);
284284int device_count_tag(const struct IODevice *devices, const char *tag);
285285
286/* device lookup; both of these function assume only one of each type of device */
286/* deprecated: device lookup; both of these function assume only one of each type of device */
287287const struct IODevice *device_find(const struct IODevice *devices, iodevice_t type);
288288int device_count(iodevice_t type);
289289
src/mess/mesvalid.c
r1981r1982
286286   iodevice_t devtype;
287287   const char *name;
288288   input_port_entry *inputports = NULL;
289   extern int device_valididtychecks(void);
290289
291290   /* make sure that all of the UI_* strings are set for all devices */
292291   for (devtype = 0; devtype < IO_COUNT; devtype++)
src/mess/osd/windows/menu.c
r1981r1982
123123//   customize_input
124124//============================================================
125125
126static void customize_input(HWND wnd, const char *title, artwork_cust_type cust_type, int player, int inputclass, const char *section)
126static void customize_input(running_machine *machine, HWND wnd, const char *title, artwork_cust_type cust_type, int player, int inputclass, const char *section)
127127{
128128   dialog_box *dlg;
129129   input_port_entry *in;
r1981r1982
157157      win_dialog_add_separator(dlg);
158158   }
159159
160   in = Machine->input_ports;
160   in = machine->input_ports;
161161   while(in->type != IPT_END)
162162   {
163163      this_inputclass = input_classify_port(in);
r1981r1982
234234//   customize_joystick
235235//============================================================
236236
237static void customize_joystick(HWND wnd, int joystick_num)
237static void customize_joystick(running_machine *machine, HWND wnd, int joystick_num)
238238{
239   customize_input(wnd, "Joysticks/Controllers", ARTWORK_CUSTTYPE_JOYSTICK, joystick_num, INPUT_CLASS_CONTROLLER, NULL);
239   customize_input(machine, wnd, "Joysticks/Controllers", ARTWORK_CUSTTYPE_JOYSTICK, joystick_num, INPUT_CLASS_CONTROLLER, NULL);
240240}
241241
242242
r1981r1982
245245//   customize_keyboard
246246//============================================================
247247
248static void customize_keyboard(HWND wnd)
248static void customize_keyboard(running_machine *machine, HWND wnd)
249249{
250   customize_input(wnd, "Emulated Keyboard", ARTWORK_CUSTTYPE_KEYBOARD, 0, INPUT_CLASS_KEYBOARD, NULL);
250   customize_input(machine, wnd, "Emulated Keyboard", ARTWORK_CUSTTYPE_KEYBOARD, 0, INPUT_CLASS_KEYBOARD, NULL);
251251}
252252
253253
r1981r1982
256256//   customize_miscinput
257257//============================================================
258258
259static void customize_miscinput(HWND wnd)
259static void customize_miscinput(running_machine *machine, HWND wnd)
260260{
261   customize_input(wnd, "Miscellaneous Input", ARTWORK_CUSTTYPE_MISC, 0, INPUT_CLASS_MISC, NULL);
261   customize_input(machine, wnd, "Miscellaneous Input", ARTWORK_CUSTTYPE_MISC, 0, INPUT_CLASS_MISC, NULL);
262262}
263263
264264
r1981r1982
267267//   customize_categorizedinput
268268//============================================================
269269
270static void customize_categorizedinput(HWND wnd, const char *section, int category)
270static void customize_categorizedinput(running_machine *machine, HWND wnd, const char *section, int category)
271271{
272272   assert(category > 0);
273   customize_input(wnd, "Input", ARTWORK_CUSTTYPE_JOYSTICK, category, INPUT_CLASS_CATEGORIZED, section);
273   customize_input(machine, wnd, "Input", ARTWORK_CUSTTYPE_JOYSTICK, category, INPUT_CLASS_CATEGORIZED, section);
274274}
275275
276276
r1981r1982
291291//   customize_switches
292292//============================================================
293293
294static void customize_switches(HWND wnd, int title_string_num, UINT32 ipt_name, UINT32 ipt_setting)
294static void customize_switches(running_machine *machine, HWND wnd, int title_string_num, UINT32 ipt_name, UINT32 ipt_setting)
295295{
296296   dialog_box *dlg;
297297   input_port_entry *in;
r1981r1982
302302   if (!dlg)
303303      goto done;
304304
305   for (in = Machine->input_ports; in->type != IPT_END; in++)
305   for (in = machine->input_ports; in->type != IPT_END; in++)
306306   {
307307      type = in->type;
308308
r1981r1982
345345//   customize_dipswitches
346346//============================================================
347347
348static void customize_dipswitches(HWND wnd)
348static void customize_dipswitches(running_machine *machine, HWND wnd)
349349{
350   customize_switches(wnd, UI_dipswitches, IPT_DIPSWITCH_NAME, IPT_DIPSWITCH_SETTING);
350   customize_switches(machine, wnd, UI_dipswitches, IPT_DIPSWITCH_NAME, IPT_DIPSWITCH_SETTING);
351351}
352352
353353
r1981r1982
356356//   customize_configuration
357357//============================================================
358358
359static void customize_configuration(HWND wnd)
359static void customize_configuration(running_machine *machine, HWND wnd)
360360{
361   customize_switches(wnd, UI_configuration, IPT_CONFIG_NAME, IPT_CONFIG_SETTING);
361   customize_switches(machine, wnd, UI_configuration, IPT_CONFIG_NAME, IPT_CONFIG_SETTING);
362362}
363363
364364
r1981r1982
395395
396396
397397
398static void customize_analogcontrols(HWND wnd)
398static void customize_analogcontrols(running_machine *machine, HWND wnd)
399399{
400400   dialog_box *dlg;
401401   input_port_entry *in;
r1981r1982
407407   if (!dlg)
408408      goto done;
409409
410   in = Machine->input_ports;
410   in = machine->input_ports;
411411
412412   while (in->type != IPT_END)
413413   {
r1981r1982
10911091//   setup_joystick_menu
10921092//============================================================
10931093
1094static void setup_joystick_menu(HMENU menu_bar)
1094static void setup_joystick_menu(running_machine *machine, HMENU menu_bar)
10951095{
10961096   int joystick_count = 0;
10971097   HMENU joystick_menu;
r1981r1982
11021102   char buf[256];
11031103   int child_count = 0;
11041104
1105   in = Machine->input_ports;
1105   in = machine->input_ports;
11061106   use_input_categories = 0;
11071107   while(in->type != IPT_END)
11081108   {
r1981r1982
11211121   if (use_input_categories)
11221122   {
11231123      // using input categories
1124      for (i = 0; Machine->input_ports[i].type != IPT_END; i++)
1124      for (i = 0; machine->input_ports[i].type != IPT_END; i++)
11251125      {
1126         in = &Machine->input_ports[i];
1126         in = &machine->input_ports[i];
11271127         if ((in->type) == IPT_CATEGORY_NAME)
11281128         {
11291129            submenu = CreateMenu();
r1981r1982
11311131               return;
11321132
11331133            // append all of the category settings
1134            for (j = i + 1; (Machine->input_ports[j].type) == IPT_CATEGORY_SETTING; j++)
1134            for (j = i + 1; (machine->input_ports[j].type) == IPT_CATEGORY_SETTING; j++)
11351135            {
1136               in_setting = &Machine->input_ports[j];
1136               in_setting = &machine->input_ports[j];
11371137               append_menu_utf8(submenu, MF_STRING, ID_INPUT_0 + j, in_setting->name);
11381138            }
11391139
r1981r1982
12031203//   prepare_menus
12041204//============================================================
12051205
1206static void prepare_menus(HWND wnd)
1206static void prepare_menus(running_machine *machine, HWND wnd)
12071207{
12081208   int i;
12091209   const struct IODevice *dev;
r1981r1982
12361236
12371237   if (!joystick_menu_setup)
12381238   {
1239      setup_joystick_menu(menu_bar);
1239      setup_joystick_menu(machine, menu_bar);
12401240      joystick_menu_setup = 1;
12411241   }
12421242
r1981r1982
12521252   has_misc      = input_has_input_class(INPUT_CLASS_MISC);
12531253
12541254   has_analog = 0;
1255   for (in = Machine->input_ports; in->type != IPT_END; in++)
1255   for (in = machine->input_ports; in->type != IPT_END; in++)
12561256   {
12571257      if (port_type_is_analog(in->type))
12581258      {
r1981r1982
13051305   // if we are using categorized input, we need to properly checkmark the categories
13061306   if (use_input_categories)
13071307   {
1308      for (i = 0; Machine->input_ports[i].type != IPT_END; i++)
1308      for (i = 0; machine->input_ports[i].type != IPT_END; i++)
13091309      {
1310         in = &Machine->input_ports[i];
1310         in = &machine->input_ports[i];
13111311         switch(in->type) {
13121312         case IPT_CATEGORY_NAME:
13131313            in_cat_value = in->default_value;
r1981r1982
13451345   remove_menu_items(device_menu);
13461346
13471347   // then set up the actual devices
1348   for (dev = Machine->devices; dev->type < IO_COUNT; dev++)
1348   for (dev = machine->devices; dev->type < IO_COUNT; dev++)
13491349   {
13501350      for (i = 0; i < dev->count; i++)
13511351      {
r1981r1982
15861586//   help_about_thissystem
15871587//============================================================
15881588
1589static void help_about_thissystem(HWND wnd)
1589static void help_about_thissystem(running_machine *machine, HWND wnd)
15901590{
15911591   char buf[256];
1592   snprintf(buf, sizeof(buf) / sizeof(buf[0]), "mess.chm::/sysinfo/%s.htm", Machine->gamedrv->name);
1592   snprintf(buf, sizeof(buf) / sizeof(buf[0]), "mess.chm::/sysinfo/%s.htm", machine->gamedrv->name);
15931593   help_display(wnd, buf);
15941594}
15951595
r1981r1982
16451645//   invoke_command
16461646//============================================================
16471647
1648static int invoke_command(HWND wnd, UINT command)
1648static int invoke_command(running_machine *machine, HWND wnd, UINT command)
16491649{
16501650   int handled = 1;
16511651   int dev_command, i;
r1981r1982
16641664   switch(command)
16651665   {
16661666      case ID_FILE_LOADSTATE:
1667         state_load(wnd, Machine);
1667         state_load(wnd, machine);
16681668         break;
16691669
16701670      case ID_FILE_SAVESTATE:
1671         state_save(Machine);
1671         state_save(machine);
16721672         break;
16731673
16741674      case ID_FILE_SAVESTATE_AS:
1675         state_save_as(wnd, Machine);
1675         state_save_as(wnd, machine);
16761676         break;
16771677
16781678      case ID_FILE_SAVESCREENSHOT:
1679         video_save_active_screen_snapshots(Machine);
1679         video_save_active_screen_snapshots(machine);
16801680         break;
16811681
16821682      case ID_FILE_EXIT:
1683         mame_schedule_exit(Machine);
1683         mame_schedule_exit(machine);
16841684         break;
16851685
16861686      case ID_EDIT_PASTE:
r1981r1982
16961696         break;
16971697
16981698      case ID_KEYBOARD_CUSTOMIZE:
1699         customize_keyboard(wnd);
1699         customize_keyboard(machine, wnd);
17001700         break;
17011701
17021702      case ID_VIDEO_ROTATE_0:
r1981r1982
17161716         break;
17171717
17181718      case ID_OPTIONS_PAUSE:
1719         pause(Machine);
1719         pause(machine);
17201720         break;
17211721
17221722      case ID_OPTIONS_HARDRESET:
1723         mame_schedule_hard_reset(Machine);
1723         mame_schedule_hard_reset(machine);
17241724         break;
17251725
17261726      case ID_OPTIONS_SOFTRESET:
1727         mame_schedule_soft_reset(Machine);
1727         mame_schedule_soft_reset(machine);
17281728         break;
17291729
17301730#if HAS_PROFILER
r1981r1982
17401740#endif // HAS_DEBUGGER
17411741
17421742      case ID_OPTIONS_CONFIGURATION:
1743         customize_configuration(wnd);
1743         customize_configuration(machine, wnd);
17441744         break;
17451745
17461746      case ID_OPTIONS_DIPSWITCHES:
1747         customize_dipswitches(wnd);
1747         customize_dipswitches(machine, wnd);
17481748         break;
17491749
17501750      case ID_OPTIONS_MISCINPUT:
1751         customize_miscinput(wnd);
1751         customize_miscinput(machine, wnd);
17521752         break;
17531753
17541754      case ID_OPTIONS_ANALOGCONTROLS:
1755         customize_analogcontrols(wnd);
1755         customize_analogcontrols(machine, wnd);
17561756         break;
17571757
17581758#if HAS_TOGGLEFULLSCREEN
r1981r1982
17881788         break;
17891789
17901790      case ID_HELP_ABOUTSYSTEM:
1791         help_about_thissystem(wnd);
1791         help_about_thissystem(machine, wnd);
17921792         break;
17931793
17941794      case ID_THROTTLE_50:
r1981r1982
18191819         // quickly come up with a port count, so we can upper bound commands
18201820         // near ID_INPUT_0
18211821         port_count = 0;
1822         while(Machine->input_ports[port_count].type != IPT_END)
1822         while(machine->input_ports[port_count].type != IPT_END)
18231823            port_count++;
18241824
18251825         if ((command >= ID_FRAMESKIP_0) && (command < ID_FRAMESKIP_0 + frameskip_level_count()))
r1981r1982
18361836         else if ((command >= ID_JOYSTICK_0) && (command < ID_JOYSTICK_0 + MAX_JOYSTICKS))
18371837         {
18381838            // customize joystick
1839            customize_joystick(wnd, command - ID_JOYSTICK_0);
1839            customize_joystick(machine, wnd, command - ID_JOYSTICK_0);
18401840         }
18411841         else if ((command >= ID_VIDEO_VIEW_0) && (command < ID_VIDEO_VIEW_0 + 1000))
18421842         {
r1981r1982
18461846         else if ((command >= ID_INPUT_0) && (command < ID_INPUT_0 + port_count))
18471847         {
18481848            // customize categorized input
1849            in = &Machine->input_ports[command - ID_INPUT_0];
1849            in = &machine->input_ports[command - ID_INPUT_0];
18501850            switch(in->type) {
18511851            case IPT_CATEGORY_NAME:
18521852               // customize the input type
r1981r1982
18601860                     section = in[i].name;
18611861                  }
18621862               }
1863               customize_categorizedinput(wnd, section, category);
1863               customize_categorizedinput(machine, wnd, section, category);
18641864               break;
18651865
18661866            case IPT_CATEGORY_SETTING:
r1981r1982
19231923//   win_setup_menus
19241924//============================================================
19251925
1926int win_setup_menus(HMODULE module, HMENU menu_bar)
1926int win_setup_menus(running_machine *machine, HMODULE module, HMENU menu_bar)
19271927{
19281928   HMENU frameskip_menu;
19291929   char buf[256];
r1981r1982
19581958   DeleteMenu(menu_bar, ID_OPTIONS_PROFILER, MF_BYCOMMAND);
19591959#endif
19601960
1961   if (!HAS_DEBUGGER || !Machine->debug_mode)
1961   if (!HAS_DEBUGGER || !machine->debug_mode)
19621962      DeleteMenu(menu_bar, ID_OPTIONS_DEBUGGER, MF_BYCOMMAND);
19631963
19641964#if !HAS_TOGGLEFULLSCREEN
r1981r1982
19801980   }
19811981
19821982   // set the help menu to refer to this machine
1983   snprintf(buf, sizeof(buf) / sizeof(buf[0]), "About %s (%s)...", Machine->gamedrv->description, Machine->gamedrv->name);
1983   snprintf(buf, sizeof(buf) / sizeof(buf[0]), "About %s (%s)...", machine->gamedrv->description, machine->gamedrv->name);
19841984   set_menu_text(menu_bar, ID_HELP_ABOUTSYSTEM, buf);
19851985   return 0;
19861986}
r1981r1982
20152015//   win_create_menu
20162016//============================================================
20172017
2018#ifndef UNDER_CE
2019int win_create_menu(HMENU *menus)
2018#ifdef HAS_WINDOW_MENU
2019int win_create_menu(running_machine *machine, HMENU *menus)
20202020{
20212021   HMENU menu_bar = NULL;
20222022   HMODULE module;
r1981r1982
20312031      if (!menu_bar)
20322032         goto error;
20332033
2034      if (win_setup_menus(module, menu_bar))
2034      if (win_setup_menus(machine, module, menu_bar))
20352035         goto error;
20362036   }
20372037
r1981r1982
20432043      DestroyMenu(menu_bar);
20442044   return 1;
20452045}
2046#endif /* UNDER_CE */
2046#endif /* HAS_WINDOW_MENU */
20472047
20482048
20492049
r1981r1982
21232123   switch(message)
21242124   {
21252125      case WM_INITMENU:
2126         prepare_menus(wnd);
2126         prepare_menus(Machine, wnd);
21272127         break;
21282128
21292129      case WM_CHAR:
r1981r1982
21322132         break;
21332133
21342134      case WM_COMMAND:
2135         if (invoke_command(wnd, wparam))
2135         if (invoke_command(Machine, wnd, wparam))
21362136            break;
21372137         /* fall through */
21382138
src/mess/osd/windows/menu.h
r1981r1982
1515//   PROTOTYPES
1616//============================================================
1717
18int win_setup_menus(HMODULE module, HMENU menu_bar);
18int win_setup_menus(running_machine *machine, HMODULE module, HMENU menu_bar);
1919LRESULT CALLBACK win_mess_window_proc(HWND wnd, UINT message, WPARAM wparam, LPARAM lparam);
2020void win_toggle_menubar(void);
21#ifdef HAS_WINDOW_MENU
22int win_create_menu(running_machine *machine, HMENU *menus);
23#endif
2124
2225
23
2426#endif /* MENU_H */
src/mess/machine/applefdc.c
r1981r1982
3636*********************************************************************/
3737
3838#include "applefdc.h"
39#include "deprecat.h"
4039
4140
4241/* logging */
src/mess/drivers/nc.c
r1981r1982
295295static int nc_irq_latch_mask;
296296static int nc_sound_channel_periods[2];
297297
298static void nc_update_interrupts(void)
298static void nc_update_interrupts(running_machine *machine)
299299{
300300   nc_irq_status &= ~nc_irq_latch_mask;
301301   nc_irq_status |= nc_irq_latch;
r1981r1982
307307   {
308308      logerror("int set %02x\n",nc_irq_status & nc_irq_mask);
309309      /* set int */
310      cpunum_set_input_line(Machine, 0, 0, HOLD_LINE);
310      cpunum_set_input_line(machine, 0, 0, HOLD_LINE);
311311   }
312312   else
313313   {
314314      /* clear int */
315      cpunum_set_input_line(Machine, 0, 0, CLEAR_LINE);
315      cpunum_set_input_line(machine, 0, 0, CLEAR_LINE);
316316   }
317317}
318318
r1981r1982
324324        nc_irq_status |= (1<<3);
325325
326326        /* update ints */
327        nc_update_interrupts();
327        nc_update_interrupts(machine);
328328
329329        /* don't trigger again, but don't free it */
330330        timer_reset(nc_keyboard_timer, attotime_never);
r1981r1982
483483   mame_fwrite(file, mess_ram, mess_ram_size);
484484}
485485
486static void nc_common_open_stream_for_reading(void)
486static void nc_common_open_stream_for_reading(running_machine *machine)
487487{
488488   char filename[MAX_DRIVER_NAME_CHARS + 5];
489489
490   sprintf(filename,"%s.nv", Machine->gamedrv->name);
490   sprintf(filename,"%s.nv", machine->gamedrv->name);
491491
492492   mame_fopen(SEARCHPATH_MEMCARD, filename, OPEN_FLAG_READ, &file);
493493}
494494
495static void nc_common_open_stream_for_writing(void)
495static void nc_common_open_stream_for_writing(running_machine *machine)
496496{
497497    char filename[MAX_DRIVER_NAME_CHARS + 5];
498498
499    sprintf(filename,"%s.nv", Machine->gamedrv->name);
499    sprintf(filename,"%s.nv", machine->gamedrv->name);
500500
501501   mame_fopen(SEARCHPATH_MEMCARD, filename, OPEN_FLAG_WRITE, &file);
502502}
r1981r1982
540540            case NC_TYPE_200:
541541            {
542542               nc_irq_status |=(1<<4);
543               nc_update_interrupts();
543               nc_update_interrupts(machine);
544544            }
545545            break;
546546         }
r1981r1982
559559
560560static TIMER_CALLBACK(nc_serial_timer_callback);
561561
562static void nc_common_init_machine(void)
562static void nc_common_init_machine(running_machine *machine)
563563{
564564   /* setup reset state */
565565   nc_display_memory_start = 0;
r1981r1982
588588    nc_poweroff_control = 1;
589589
590590    nc_refresh_memory_config();
591   nc_update_interrupts();
591   nc_update_interrupts(machine);
592592
593593   /* keyboard timer */
594594   nc_keyboard_timer = timer_alloc(nc_keyboard_timer_callback, NULL);
r1981r1982
633633   /* writing mask clears ints that are to be masked? */
634634   nc_irq_mask = data;
635635
636   nc_update_interrupts();
636   nc_update_interrupts(machine);
637637}
638638
639639static WRITE8_HANDLER(nc_irq_status_w)
r1981r1982
650650         /* set timer to occur again */
651651         timer_reset(nc_keyboard_timer, ATTOTIME_IN_MSEC(10));
652652
653         nc_update_interrupts();
653         nc_update_interrupts(machine);
654654      }
655655   }
656656
r1981r1982
670670#endif
671671        nc_irq_status &=~data;
672672
673        nc_update_interrupts();
673        nc_update_interrupts(machine);
674674}
675675
676static READ8_HANDLER(nc_irq_status_r)
676static READ8_HANDLER(nc_irq_status_r)
677677{
678678        return ~((nc_irq_status & (~nc_irq_latch_mask)) | nc_irq_latch);
679679}
680680
681681
682static READ8_HANDLER(nc_key_data_in_r)
682static READ8_HANDLER(nc_key_data_in_r)
683683{
684684   if (offset==9)
685685   {
r1981r1982
689689      /* set timer to occur again */
690690      timer_reset(nc_keyboard_timer, ATTOTIME_IN_MSEC(10));
691691
692      nc_update_interrupts();
692      nc_update_interrupts(machine);
693693   }
694694   return readinputport(offset);
695695}
r1981r1982
855855//  {
856856//      /* clear latched irq's */
857857//      nc_irq_latch &= ~3;
858//      nc_update_interrupts();
858//      nc_update_interrupts(machine);
859859//  }
860860}
861861
r1981r1982
895895      }
896896   }
897897
898   nc_update_interrupts();
898   nc_update_interrupts(Machine);
899899}
900900
901901static void nc100_rxrdy_callback(int state)
r1981r1982
911911      }
912912   }
913913
914   nc_update_interrupts();
914   nc_update_interrupts(Machine);
915915}
916916
917917
r1981r1982
939939      }
940940   }
941941   /* trigger an int if the irq is set */
942   nc_update_interrupts();
942   nc_update_interrupts(Machine);
943943}
944944
945945static const CENTRONICS_CONFIG nc100_cent_config[1]={
r1981r1982
958958
959959    nc_membank_card_ram_mask = 0x03f;
960960
961    nc_common_init_machine();
961    nc_common_init_machine(machine);
962962
963963   tc8521_init(&nc100_tc8521_interface);
964964
r1981r1982
968968   /* assumption: select is tied low */
969969   centronics_write_handshake(0, CENTRONICS_SELECT | CENTRONICS_NO_RESET, CENTRONICS_SELECT| CENTRONICS_NO_RESET);
970970
971   nc_common_open_stream_for_reading();
971   nc_common_open_stream_for_reading(machine);
972972   tc8521_load_stream(file);
973973
974974   nc_common_restore_memory_from_stream();
r1981r1982
981981
982982static void nc100_machine_stop(running_machine *machine)
983983{
984   nc_common_open_stream_for_writing();
984   nc_common_open_stream_for_writing(machine);
985985   tc8521_save_stream(file);
986986   nc_common_store_memory_to_stream();
987987   nc_common_close_stream();
r1981r1982
12051205
12061206        nc_membank_card_ram_mask = 0x03f;
12071207
1208        nc_common_init_machine();
1208        nc_common_init_machine(Machine);
12091209}
12101210#endif
12111211
r1981r1982
12391239      }
12401240   }
12411241   /* trigger an int if the irq is set */
1242   nc_update_interrupts();
1242   nc_update_interrupts(Machine);
12431243}
12441244
12451245static const CENTRONICS_CONFIG nc200_cent_config[1]={
r1981r1982
12551255together with a or to generate a single interrupt */
12561256static UINT8 nc200_uart_interrupt_irq;
12571257
1258static void nc200_refresh_uart_interrupt(void)
1258static void nc200_refresh_uart_interrupt(running_machine *machine)
12591259{
12601260   nc_irq_latch &=~(1<<2);
12611261
r1981r1982
12671267         nc_irq_latch |= (1<<2);
12681268      }
12691269   }
1270   nc_update_interrupts();
1270   nc_update_interrupts(machine);
12711271}
12721272
12731273static void nc200_txrdy_callback(int state)
r1981r1982
12791279//      nc200_uart_interrupt_irq |=(1<<0);
12801280//  }
12811281//
1282//  nc200_refresh_uart_interrupt();
1282//  nc200_refresh_uart_interrupt(Machine);
12831283}
12841284
12851285static void nc200_rxrdy_callback(int state)
r1981r1982
12911291      nc200_uart_interrupt_irq |=(1<<1);
12921292   }
12931293
1294   nc200_refresh_uart_interrupt();
1294   nc200_refresh_uart_interrupt(Machine);
12951295}
12961296
12971297static const struct msm8251_interface nc200_uart_interface=
r1981r1982
13191319            nc_irq_status |=(1<<5);
13201320    }
13211321
1322    nc_update_interrupts();
1322    nc_update_interrupts(Machine);
13231323}
13241324
13251325static const struct nec765_interface nc200_nec765_interface=
r1981r1982
13341334   LOG_DEBUG(("nc200 index pulse\n"));
13351335//  nc_irq_status |= (1<<4);
13361336
1337//  nc_update_interrupts();
1337//  nc_update_interrupts(Machine);
13381338}
13391339#endif
13401340
r1981r1982
13471347
13481348    nc_membank_card_ram_mask = 0x03f;
13491349
1350    nc_common_init_machine();
1350    nc_common_init_machine(machine);
13511351
13521352    nec765_init(&nc200_nec765_interface, NEC765A);
13531353    /* double sided, 80 track drive */
r1981r1982
13631363   /* assumption: select is tied low */
13641364   centronics_write_handshake(0, CENTRONICS_SELECT | CENTRONICS_NO_RESET, CENTRONICS_SELECT| CENTRONICS_NO_RESET);
13651365
1366   nc_common_open_stream_for_reading();
1366   nc_common_open_stream_for_reading(machine);
13671367   if (file)
13681368   {
13691369      mc146818_load_stream(file);
r1981r1982
13791379
13801380static void nc200_machine_stop(running_machine *machine)
13811381{
1382   nc_common_open_stream_for_writing();
1382   nc_common_open_stream_for_writing(machine);
13831383   if (file)
13841384   {
13851385      mc146818_save_stream(file);
r1981r1982
14781478   {
14791479      nc200_uart_interrupt_irq &=~3;
14801480
1481      nc200_refresh_uart_interrupt();
1481      nc200_refresh_uart_interrupt(machine);
14821482   }
14831483
14841484   /* bit 5 is used in disk interface */
src/mess/drivers/z88.c
r1981r1982
1313
1414 ******************************************************************************/
1515#include "driver.h"
16#include "deprecat.h"
1716#include "includes/z88.h"
1817#include "sound/speaker.h"
1918
r1981r1982
3130}
3231
3332
34static void z88_interrupt_refresh(void)
33static void z88_interrupt_refresh(running_machine *machine)
3534{
3635   /* ints enabled? */
3736   if ((blink.ints & INT_GINT)!=0)
r1981r1982
4544         )
4645      {
4746         logerror("set int\n");
48         cpunum_set_input_line(Machine, 0, 0, HOLD_LINE);
47         cpunum_set_input_line(machine, 0, 0, HOLD_LINE);
4948         return;
5049      }
5150   }
5251
5352   logerror("clear int\n");
54   cpunum_set_input_line(Machine, 0, 0, CLEAR_LINE);
53   cpunum_set_input_line(machine, 0, 0, CLEAR_LINE);
5554}
5655
5756static void z88_update_rtc_interrupt(void)
r1981r1982
102101
103102         cpu_trigger(machine, Z88_SNOOZE_TRIGGER);
104103
105         z88_interrupt_refresh();
104         z88_interrupt_refresh(machine);
106105      }
107106   }
108107
r1981r1982
169168      z88_update_rtc_interrupt();
170169
171170      /* refresh */
172      z88_interrupt_refresh();
171      z88_interrupt_refresh(machine);
173172   }
174173}
175174
r1981r1982
406405
407406         /* refresh ints */
408407         z88_update_rtc_interrupt();
409         z88_interrupt_refresh();
408         z88_interrupt_refresh(machine);
410409      }
411410      return;
412411
r1981r1982
420419
421420         /* refresh ints */
422421         z88_update_rtc_interrupt();
423         z88_interrupt_refresh();
422         z88_interrupt_refresh(machine);
424423      }
425424      return;
426425
r1981r1982
472471
473472         blink.ints = data;
474473         z88_update_rtc_interrupt();
475         z88_interrupt_refresh();
474         z88_interrupt_refresh(machine);
476475      }
477476      return;
478477
r1981r1982
486485
487486         blink.ints &= ~blink.ack;
488487         z88_update_rtc_interrupt();
489         z88_interrupt_refresh();
488         z88_interrupt_refresh(machine);
490489      }
491490      return;
492491
src/mess/drivers/pcw16.c
r1981r1982
128128static int pcw16_system_status;
129129
130130// debugging - write ram as seen by cpu
131static void pcw16_refresh_ints(void)
131static void pcw16_refresh_ints(running_machine *machine)
132132{
133133   /* any bits set excluding vsync */
134134   if ((pcw16_system_status & (~0x04))!=0)
135135   {
136      cpunum_set_input_line(Machine, 0, 0, HOLD_LINE);
136      cpunum_set_input_line(machine, 0, 0, HOLD_LINE);
137137   }
138138   else
139139   {
140      cpunum_set_input_line(Machine, 0, 0, CLEAR_LINE);
140      cpunum_set_input_line(machine, 0, 0, CLEAR_LINE);
141141   }
142142}
143143
r1981r1982
154154
155155   if (pcw16_interrupt_counter!=0)
156156   {
157      pcw16_refresh_ints();
157      pcw16_refresh_ints(machine);
158158   }
159159}
160160
r1981r1982
551551static int pcw16_keyboard_state = 0;
552552static int pcw16_keyboard_previous_state=0;
553553static void pcw16_keyboard_reset(void);
554static void pcw16_keyboard_int(int);
554static void pcw16_keyboard_int(running_machine *, int);
555555
556static void pcw16_keyboard_init(void)
556static void pcw16_keyboard_init(running_machine *machine)
557557{
558558   int i;
559559   int b;
r1981r1982
580580
581581
582582   /* clear int */
583   pcw16_keyboard_int(0);
583   pcw16_keyboard_int(machine, 0);
584584   /* reset state */
585585   pcw16_keyboard_state = 0;
586586   /* reset ready for transmit */
r1981r1982
611611   pcw16_keyboard_refresh_outputs();
612612}
613613
614static void pcw16_keyboard_int(int state)
614static void pcw16_keyboard_int(running_machine *machine, int state)
615615{
616616   pcw16_system_status &= ~(1<<1);
617617
r1981r1982
620620      pcw16_system_status |= (1<<1);
621621   }
622622
623   pcw16_refresh_ints();
623   pcw16_refresh_ints(machine);
624624}
625625
626626static void pcw16_keyboard_reset(void)
r1981r1982
635635   //logerror("keyboard data shift r: %02x\n", pcw16_keyboard_data_shift);
636636   pcw16_keyboard_state &= ~(PCW16_KEYBOARD_BUSY_STATUS);
637637
638   pcw16_keyboard_int(0);
638   pcw16_keyboard_int(machine, 0);
639639   /* reset for reception */
640640   pcw16_keyboard_reset();
641641
r1981r1982
659659#endif
660660
661661/* signal a code has been received */
662static void   pcw16_keyboard_signal_byte_received(int data)
662static void   pcw16_keyboard_signal_byte_received(running_machine *machine, int data)
663663{
664
665664   /* clear clock */
666665   pcw16_keyboard_set_clock_state(0);
667666
r1981r1982
684683   if ((pcw16_keyboard_parity_table[data])==0)
685684      pcw16_keyboard_state |= PCW16_KEYBOARD_PARITY_MASK;
686685
687   pcw16_keyboard_int(1);
686   pcw16_keyboard_int(machine, 1);
688687}
689688
690689
r1981r1982
757756            /* set clock low - no furthur transmissions */
758757            pcw16_keyboard_set_clock_state(0);
759758            /* set int */
760            pcw16_keyboard_int(1);
759            pcw16_keyboard_int(machine, 1);
761760         }
762761      }
763762
r1981r1982
770769      {
771770         if ((pcw16_system_status & (1<<1))!=0)
772771         {
773            pcw16_keyboard_int(0);
772            pcw16_keyboard_int(machine, 0);
774773         }
775774      }
776775   }
r1981r1982
795794//              pcw16_dump_cpu_ram();
796795//          }
797796
798         pcw16_keyboard_signal_byte_received(data);
797         pcw16_keyboard_signal_byte_received(machine, data);
799798      }
800799   }
801800}
r1981r1982
991990
992991static int previous_fdc_int_state;
993992
994static void pcw16_trigger_fdc_int(void)
993static void pcw16_trigger_fdc_int(running_machine *machine)
995994{
996995   int state;
997996
r1981r1982
10141013            {
10151014               /* I'll pulse it because if I used hold-line I'm not sure
10161015                    it would clear - to be checked */
1017               cpunum_set_input_line(Machine, 0, INPUT_LINE_NMI, PULSE_LINE);
1016               cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, PULSE_LINE);
10181017            }
10191018         }
10201019      }
r1981r1982
10231022      /* attach fdc to int */
10241023      case 1:
10251024      {
1026         pcw16_refresh_ints();
1025         pcw16_refresh_ints(machine);
10271026      }
10281027      break;
10291028
r1981r1982
10351034   previous_fdc_int_state = state;
10361035}
10371036
1038static READ8_HANDLER(pcw16_system_status_r)
1037static READ8_HANDLER(pcw16_system_status_r)
10391038{
10401039//  logerror("system status r: \n");
10411040
10421041   return pcw16_system_status | (readinputport(0) & 0x04);
10431042}
10441043
1045static READ8_HANDLER(pcw16_timer_interrupt_counter_r)
1044static READ8_HANDLER(pcw16_timer_interrupt_counter_r)
10461045{
10471046   int data;
10481047
r1981r1982
10521051   /* clear display int */
10531052   pcw16_system_status &= ~(1<<0);
10541053
1055   pcw16_refresh_ints();
1054   pcw16_refresh_ints(machine);
10561055
10571056   return data;
10581057}
r1981r1982
12021201      pcw16_system_status |= (1<<6);
12031202   }
12041203
1205   pcw16_trigger_fdc_int();
1204   pcw16_trigger_fdc_int(Machine);
12061205}
12071206
12081207static const struct pc_fdc_interface pcw16_fdc_interface=
r1981r1982
12221221      pcw16_system_status |= (1<<irq[nr]);
12231222   }
12241223
1225   pcw16_refresh_ints();
1224   pcw16_refresh_ints(Machine);
12261225}
12271226
12281227static void pcw16_com_refresh_connected(int serial_port_id)
r1981r1982
13031302ADDRESS_MAP_END
13041303
13051304
1306static void pcw16_reset(void)
1305static void pcw16_reset(running_machine *machine)
13071306{
13081307   /* initialise defaults */
13091308   pcw16_fdc_int_code = 2;
r1981r1982
13241323   rtc_control = 1;
13251324   rtc_256ths_seconds = 0;
13261325
1327   pcw16_keyboard_init();
1326   pcw16_keyboard_init(machine);
13281327   uart8250_reset(0);
13291328   uart8250_reset(1);
13301329}
r1981r1982
13721371   at_keyboard_init(AT_KEYBOARD_TYPE_AT);
13731372   at_keyboard_set_scan_code_set(3);
13741373
1375   pcw16_reset();
1374   pcw16_reset(machine);
13761375
13771376   beep_set_state(0,0);
13781377   beep_set_frequency(0,3750);
src/mess/drivers/tm990189.c
r1981r1982
7979static int LED_display_window_width;
8080static int LED_display_window_height;
8181
82static void hold_load(void);
82static void hold_load(running_machine *machine);
8383
8484static void usr9901_interrupt_callback(int intreq, int ic);
8585static void sys9901_interrupt_callback(int intreq, int ic);
r1981r1982
192192{
193193   displayena_timer = timer_alloc(NULL, NULL);
194194
195   hold_load();
195   hold_load(machine);
196196
197197   tms9901_init(0, &usr9901reset_param);
198198   tms9901_init(1, &sys9901reset_param);
r1981r1982
224224   joy2x_timer = timer_alloc(NULL, NULL);
225225   joy2y_timer = timer_alloc(NULL, NULL);
226226
227   hold_load();
227   hold_load(machine);
228228
229229   tms9901_init(0, &usr9901reset_param);
230230   tms9901_init(1, &sys9901reset_param);
r1981r1982
348348    Interrupt handlers
349349*/
350350
351static void field_interrupts(void)
351static void field_interrupts(running_machine *machine)
352352{
353353   if (load_state)
354      cpunum_set_input_line_and_vector(Machine, 0, 0, ASSERT_LINE, 2);
354      cpunum_set_input_line_and_vector(machine, 0, 0, ASSERT_LINE, 2);
355355   else
356      cpunum_set_input_line_and_vector(Machine, 0, 0, ASSERT_LINE, ic_state);
356      cpunum_set_input_line_and_vector(machine, 0, 0, ASSERT_LINE, ic_state);
357357}
358358
359359/*
r1981r1982
363363static TIMER_CALLBACK(clear_load)
364364{
365365   load_state = FALSE;
366   field_interrupts();
366   field_interrupts(machine);
367367}
368368
369static void hold_load(void)
369static void hold_load(running_machine *machine)
370370{
371371   load_state = TRUE;
372   field_interrupts();
372   field_interrupts(machine);
373373   timer_set(ATTOTIME_IN_MSEC(100), NULL, 0, clear_load);
374374}
375375
r1981r1982
382382   ic_state = ic & 7;
383383
384384   if (!load_state)
385      field_interrupts();
385      field_interrupts(Machine);
386386}
387387
388388static void usr9901_led_w(int offset, int data)
r1981r1982
563563      break;
564564
565565   case 7: /* LREX: trigger LOAD */
566      hold_load();
566      hold_load(machine);
567567      break;
568568   }
569569}
src/mess/drivers/apexc.c
r1981r1982
88
99#include "driver.h"
1010#include "cpu/apexc/apexc.h"
11#include "deprecat.h"
1211
1312
14
1513static void apexc_teletyper_init(void);
16static void apexc_teletyper_putchar(int character);
14static void apexc_teletyper_putchar(running_machine *machine, int character);
1715
1816
1917static MACHINE_START(apexc)
r1981r1982
209207   if (apexc_tapes[1].fd)
210208      image_fwrite(apexc_tapes[1].fd, & data5, 1);
211209
212   apexc_teletyper_putchar(data & 0x1f);   /* display on screen */
210   apexc_teletyper_putchar(machine, data & 0x1f);   /* display on screen */
213211}
214212
215213/*
r1981r1982
494492}
495493
496494/* draw a small 8*8 LED (well, there were no LEDs at the time, so let's call this a lamp ;-) ) */
497static void apexc_draw_led(bitmap_t *bitmap, int x, int y, int state)
495static void apexc_draw_led(running_machine *machine, bitmap_t *bitmap, int x, int y, int state)
498496{
499497   int xx, yy;
500498
501499   for (yy=1; yy<7; yy++)
502500      for (xx=1; xx<7; xx++)
503         *BITMAP_ADDR16(bitmap, y+yy, x+xx) = Machine->pens[state ? 2 : 3];
501         *BITMAP_ADDR16(bitmap, y+yy, x+xx) = machine->pens[state ? 2 : 3];
504502}
505503
506504/* write a single char on screen */
507static void apexc_draw_char(bitmap_t *bitmap, char character, int x, int y, int color)
505static void apexc_draw_char(running_machine *machine, bitmap_t *bitmap, char character, int x, int y, int color)
508506{
509   drawgfx(bitmap, Machine->gfx[0], character-32, color, 0, 0,
510            x+1, y, &Machine->screen[0].visarea, TRANSPARENCY_PEN, 0);
507   drawgfx(bitmap, machine->gfx[0], character-32, color, 0, 0,
508            x+1, y, &machine->screen[0].visarea, TRANSPARENCY_PEN, 0);
511509}
512510
513511/* write a string on screen */
514static void apexc_draw_string(bitmap_t *bitmap, const char *buf, int x, int y, int color)
512static void apexc_draw_string(running_machine *machine, bitmap_t *bitmap, const char *buf, int x, int y, int color)
515513{
516514   while (* buf)
517515   {
518      apexc_draw_char(bitmap, *buf, x, y, color);
516      apexc_draw_char(machine, bitmap, *buf, x, y, color);
519517
520518      x += 8;
521519      buf++;
r1981r1982
532530   /*if (full_refresh)*/
533531   {
534532      fillbitmap(bitmap, machine->pens[0], &/*machine->visible_area*/panel_window);
535      apexc_draw_string(bitmap, "power", 8, 0, 0);
536      apexc_draw_string(bitmap, "running", 8, 8, 0);
537      apexc_draw_string(bitmap, "data :", 0, 24, 0);
533      apexc_draw_string(machine, bitmap, "power", 8, 0, 0);
534      apexc_draw_string(machine, bitmap, "running", 8, 8, 0);
535      apexc_draw_string(machine, bitmap, "data :", 0, 24, 0);
538536   }
539537
540538   copybitmap(bitmap, apexc_bitmap, 0, 0, 0, 0, &teletyper_window);
541539
542540
543   apexc_draw_led(bitmap, 0, 0, 1);
541   apexc_draw_led(machine, bitmap, 0, 0, 1);
544542
545   apexc_draw_led(bitmap, 0, 8, cpunum_get_reg(0, APEXC_STATE));
543   apexc_draw_led(machine, bitmap, 0, 8, cpunum_get_reg(0, APEXC_STATE));
546544
547545   for (i=0; i<32; i++)
548546   {
549      apexc_draw_led(bitmap, i*8, 32, (panel_data_reg << i) & 0x80000000UL);
547      apexc_draw_led(machine, bitmap, i*8, 32, (panel_data_reg << i) & 0x80000000UL);
550548      the_char = '0' + ((i + 1) % 10);
551      apexc_draw_char(bitmap, the_char, i*8, 40, 0);
549      apexc_draw_char(machine, bitmap, the_char, i*8, 40, 0);
552550      if (((i + 1) % 10) == 0)
553551      {
554552         the_char = '0' + ((i + 1) / 10);
555         apexc_draw_char(bitmap, the_char, i*8, 48, 0);
553         apexc_draw_char(machine, bitmap, the_char, i*8, 48, 0);
556554      }
557555   }
558556   return 0;
r1981r1982
567565   pos = 0;
568566}
569567
570static void apexc_teletyper_linefeed(void)
568static void apexc_teletyper_linefeed(running_machine *machine)
571569{
572570   UINT8 buf[teletyper_window_width];
573571   int y;
r1981r1982
575573   for (y=teletyper_window_offset_y; y<teletyper_window_offset_y+teletyper_window_height-teletyper_scroll_step; y++)
576574   {
577575      extract_scanline8(apexc_bitmap, teletyper_window_offset_x, y+teletyper_scroll_step, teletyper_window_width, buf);
578      draw_scanline8(apexc_bitmap, teletyper_window_offset_x, y, teletyper_window_width, buf, Machine->pens, -1);
576      draw_scanline8(apexc_bitmap, teletyper_window_offset_x, y, teletyper_window_width, buf, machine->pens, -1);
579577   }
580578
581   fillbitmap(apexc_bitmap, Machine->pens[0], &teletyper_scroll_clear_window);
579   fillbitmap(apexc_bitmap, machine->pens[0], &teletyper_scroll_clear_window);
582580}
583581
584static void apexc_teletyper_putchar(int character)
582static void apexc_teletyper_putchar(running_machine *machine, int character)
585583{
586584   static const char ascii_table[2][32] =
587585   {
r1981r1982
615613   {
616614   case 19:
617615      /* Line Space */
618      apexc_teletyper_linefeed();
616      apexc_teletyper_linefeed(machine);
619617      break;
620618
621619   case 24:
r1981r1982
638636
639637      if (pos >= 32)
640638      {   /* if past right border, wrap around */
641         apexc_teletyper_linefeed();   /* next line */
639         apexc_teletyper_linefeed(machine);   /* next line */
642640         pos = 0;               /* return to start of line */
643641      }
644642
645643      /* print character */
646644      buffer[0] = ascii_table[letters][character];   /* lookup ASCII equivalent in table */
647645      buffer[1] = '\0';                        /* terminate string */
648      apexc_draw_string(apexc_bitmap, buffer, 8*pos, 176, 0);   /* print char */
646      apexc_draw_string(machine, apexc_bitmap, buffer, 8*pos, 176, 0);   /* print char */
649647      pos++;                                 /* step carriage forward */
650648
651649      break;
src/mess/drivers/x68k.c
r1981r1982
13761376   }
13771377}
13781378
1379static void x68k_dma_irq(int channel)
1379static void x68k_dma_irq(running_machine *machine, int channel)
13801380{
13811381   current_vector[3] = hd63450_get_vector(channel);
13821382   current_irq_line = 3;
13831383   logerror("DMA#%i: DMA End (vector 0x%02x)\n",channel,current_vector[3]);
1384   cpunum_set_input_line_and_vector(Machine, 0,3,ASSERT_LINE,current_vector[3]);
1384   cpunum_set_input_line_and_vector(machine, 0,3,ASSERT_LINE,current_vector[3]);
13851385}
13861386
13871387static void x68k_dma_end(int channel,int irq)
13881388{
13891389   if(irq != 0)
13901390   {
1391      x68k_dma_irq(channel);
1391      x68k_dma_irq(Machine, channel);
13921392   }
13931393}
13941394
src/mess/drivers/atarist.c
r1981r1982
8787   int irq;
8888} fdc;
8989
90static void atarist_fdc_dma_transfer(void)
90static void atarist_fdc_dma_transfer(running_machine *machine)
9191{
92   running_machine *machine = Machine;
9392   UINT8 *RAM = memory_region(REGION_CPU1);
9493
9594   if ((fdc.mode & ATARIST_FLOPPY_MODE_DMA_DISABLE) == 0)
r1981r1982
139138
140139   case WD17XX_DRQ_SET:
141140      fdc.status |= ATARIST_FLOPPY_STATUS_FDC_DATA_REQUEST;
142      atarist_fdc_dma_transfer();
141      atarist_fdc_dma_transfer(machine);
143142      break;
144143
145144   case WD17XX_DRQ_CLR:
r1981r1982
488487
489488static emu_timer *dmasound_timer;
490489
491static void atariste_dmasound_set_state(int level)
490static void atariste_dmasound_set_state(running_machine *machine, int level)
492491{
493   atarist_state *state = Machine->driver_data;
492   atarist_state *state = machine->driver_data;
494493
495494   dmasound.active = level;
496495   mc68901_tai_w(state->mfp, level);
r1981r1982
520519
521520         if (dmasound.cntr == dmasound.endlatch)
522521         {
523            atariste_dmasound_set_state(0);
522            atariste_dmasound_set_state(machine, 0);
524523            break;
525524         }
526525      }
r1981r1982
544543   {
545544      if ((dmasound.ctrl & 0x03) == 0x03)
546545      {
547         atariste_dmasound_set_state(1);
546         atariste_dmasound_set_state(machine, 1);
548547      }
549548      else
550549      {
r1981r1982
616615   {
617616      if (!dmasound.active)
618617      {
619         atariste_dmasound_set_state(1);
618         atariste_dmasound_set_state(machine, 1);
620619         timer_adjust_periodic(dmasound_timer, attotime_zero, 0, ATTOTIME_IN_HZ(DMASOUND_RATE[dmasound.mode & 0x03]));
621620      }
622621   }
623622   else
624623   {
625      atariste_dmasound_set_state(0);
624      atariste_dmasound_set_state(machine, 0);
626625      timer_enable(dmasound_timer, 0);
627626   }
628627}
src/mess/drivers/pcw.c
r1981r1982
141141};
142142
143143/* determines if int line is held or cleared */
144static void pcw_interrupt_handle(void)
144static void pcw_interrupt_handle(running_machine *machine)
145145{
146146   if (
147147      (pcw_interrupt_counter!=0) ||
148148      ((fdc_interrupt_code==1) && ((pcw_system_status & (1<<5))!=0))
149149      )
150150   {
151      cpunum_set_input_line(Machine, 0, 0,HOLD_LINE);
151      cpunum_set_input_line(machine, 0, 0,HOLD_LINE);
152152   }
153153   else
154154   {
155      cpunum_set_input_line(Machine, 0, 0,CLEAR_LINE);
155      cpunum_set_input_line(machine, 0, 0,CLEAR_LINE);
156156   }
157157}
158158
r1981r1982
163163{
164164   pcw_update_interrupt_counter();
165165
166   pcw_interrupt_handle();
166   pcw_interrupt_handle(machine);
167167}
168168
169169static int previous_fdc_int_state;
170170
171171/* set/clear fdc interrupt */
172static void   pcw_trigger_fdc_int(void)
172static void   pcw_trigger_fdc_int(running_machine *machine)
173173{
174174   int state;
175175
r1981r1982
192192            {
193193               /* I'll pulse it because if I used hold-line I'm not sure
194194                    it would clear - to be checked */
195               cpunum_set_input_line(Machine, 0, INPUT_LINE_NMI, PULSE_LINE);
195               cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, PULSE_LINE);
196196            }
197197         }
198198      }
r1981r1982
201201      /* attach fdc to int */
202202      case 1:
203203      {
204
205         pcw_interrupt_handle();
204         pcw_interrupt_handle(machine);
206205      }
207206      break;
208207
r1981r1982
225224      pcw_system_status |= (1<<5);
226225   }
227226
228   pcw_trigger_fdc_int();
227   pcw_trigger_fdc_int(Machine);
229228}
230229
231230
r1981r1982
372371   return pcw_interrupt_counter | (readinputport(16) & (0x040 | 0x010)) | pcw_system_status;
373372}
374373
375static READ8_HANDLER(pcw_interrupt_counter_r)
374static READ8_HANDLER(pcw_interrupt_counter_r)
376375{
377376   int data;
378377
r1981r1982
383382   /* clear int counter */
384383   pcw_interrupt_counter = 0;
385384   /* update interrupt */
386   pcw_interrupt_handle();
385   pcw_interrupt_handle(machine);
387386   /* return data */
388387   return data;
389388}
r1981r1982
459458         {
460459            /* yes */
461460
462            pcw_interrupt_handle();
461            pcw_interrupt_handle(machine);
463462         }
464463
465         pcw_trigger_fdc_int();
464         pcw_trigger_fdc_int(machine);
466465      }
467466      break;
468467
r1981r1982
485484         }
486485
487486         /* re-issue interrupt */
488         pcw_interrupt_handle();
487         pcw_interrupt_handle(machine);
489488      }
490489      break;
491490
r1981r1982
507506
508507         }
509508
510         pcw_interrupt_handle();
509         pcw_interrupt_handle(machine);
511510      }
512511      break;
513512
src/mess/drivers/apf.c
r1981r1982
143143
144144unsigned char apf_ints;
145145
146void apf_update_ints(void)
146void apf_update_ints(running_machine *machine)
147147{
148   cpunum_set_input_line(Machine, 0, 0, apf_ints ? HOLD_LINE : CLEAR_LINE);
148   cpunum_set_input_line(machine, 0, 0, apf_ints ? HOLD_LINE : CLEAR_LINE);
149149}
150150
151151static void   apf_m1000_irq_a_func(int state)
r1981r1982
159159      apf_ints&=~1;
160160   }
161161
162   apf_update_ints();
162   apf_update_ints(Machine);
163163}
164164
165165
r1981r1982
176176      apf_ints&=~2;
177177   }
178178
179   apf_update_ints();
179   apf_update_ints(Machine);
180180
181181}
182182
r1981r1982
284284      apf_ints&=~4;
285285   }
286286
287   apf_update_ints();
287   apf_update_ints(Machine);
288288
289289}
290290
r1981r1982
299299      apf_ints&=~8;
300300   }
301301
302   apf_update_ints();
302   apf_update_ints(Machine);
303303
304304}
305305
src/mess/drivers/snes.c
r1981r1982
285285      "UNKNOWN"
286286   };
287287
288   new_memory_region(Machine, REGION_CPU1, 0x1000000,0);
288   new_memory_region(machine, REGION_CPU1, 0x1000000,0);
289289
290290   snes_ram = memory_region( REGION_CPU1 );
291291   memset( snes_ram, 0, 0x1000000 );
src/mess/drivers/saturn.c
r1981r1982
233233           scu_size_1,      /* lv 1*/
234234           scu_size_2;      /* lv 2*/
235235
236static void dma_direct_lv0(void);   /*DMA level 0 direct transfer function*/
237static void dma_direct_lv1(void);   /*DMA level 1 direct transfer function*/
238static void dma_direct_lv2(void);   /*DMA level 2 direct transfer function*/
239static void dma_indirect_lv0(void); /*DMA level 0 indirect transfer function*/
240static void dma_indirect_lv1(void); /*DMA level 1 indirect transfer function*/
241static void dma_indirect_lv2(void); /*DMA level 2 indirect transfer function*/
236static void dma_direct_lv0(running_machine *machine);   /*DMA level 0 direct transfer function*/
237static void dma_direct_lv1(running_machine *machine);   /*DMA level 1 direct transfer function*/
238static void dma_direct_lv2(running_machine *machine);   /*DMA level 2 direct transfer function*/
239static void dma_indirect_lv0(running_machine *machine); /*DMA level 0 indirect transfer function*/
240static void dma_indirect_lv1(running_machine *machine); /*DMA level 1 indirect transfer function*/
241static void dma_indirect_lv2(running_machine *machine); /*DMA level 2 indirect transfer function*/
242242
243243
244244static int minit_boost,sinit_boost;
r1981r1982
246246
247247static int scanline;
248248
249
249#if 0
250250/*A-Bus IRQ checks,where they could be located these?*/
251251#define ABUSIRQ(_irq_,_vector_,_mask_) \
252252   if(!(stv_scu[40] & _mask_)) { cpunum_set_input_line_and_vector(Machine, 0, _irq_, HOLD_LINE , _vector_); }
253#if 0
253
254254if(stv_scu[42] & 1)//IRQ ACK
255255{
256256   ABUSIRQ(7,0x50,0x00010000);
r1981r1982
516516   return return_data;
517517}
518518
519static void stv_SMPC_w8 (int offset, UINT8 data)
519static void stv_SMPC_w8 (running_machine *machine, int offset, UINT8 data)
520520{
521521   mame_system_time systime;
522522   UINT8 last;
523523
524524   /* get the current date/time from the core */
525   mame_get_current_datetime(Machine, &systime);
525   mame_get_current_datetime(machine, &systime);
526526
527527//  if (LOG_SMPC) logerror ("8-bit SMPC Write to Offset %02x (reg %d) with Data %02x (prev %02x)\n", offset, offset>>1, data, smpc_ram[offset]);
528528
r1981r1982
538538         intback_stage = 2;
539539      }
540540      smpc_intbackhelper();
541      cpunum_set_input_line_and_vector(Machine, 0, 8, HOLD_LINE , 0x47);
541      cpunum_set_input_line_and_vector(machine, 0, 8, HOLD_LINE , 0x47);
542542   }
543543
544544   if ((offset == 1) && (data & 0x40))
r1981r1982
582582         if(!(stv_scu[40] & 0x0100)) /*Pad irq*/
583583         {
584584            if(LOG_SMPC) logerror ("Interrupt: PAD irq at scanline %04x, Vector 0x48 Level 0x08\n",scanline);
585            cpunum_set_input_line_and_vector(Machine, 0, 8, HOLD_LINE , 0x48);
585            cpunum_set_input_line_and_vector(machine, 0, 8, HOLD_LINE , 0x48);
586586         }
587587   }
588588
r1981r1982
599599            if(LOG_SMPC) logerror ("SMPC: Slave ON\n");
600600            smpc_ram[0x5f]=0x02;
601601            stv_enable_slave_sh2 = 1;
602            cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, CLEAR_LINE);
602            cpunum_set_input_line(machine, 1, INPUT_LINE_RESET, CLEAR_LINE);
603603            break;
604604         case 0x03:
605605            if(LOG_SMPC) logerror ("SMPC: Slave OFF\n");
606606            smpc_ram[0x5f]=0x03;
607607            stv_enable_slave_sh2 = 0;
608            cpu_trigger(Machine, 1000);
609            cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, ASSERT_LINE);
608            cpu_trigger(machine, 1000);
609            cpunum_set_input_line(machine, 1, INPUT_LINE_RESET, ASSERT_LINE);
610610            break;
611611         case 0x06:
612612            if(LOG_SMPC) logerror ("SMPC: Sound ON\n");
613613            /* wrong? */
614614            smpc_ram[0x5f]=0x06;
615            cpunum_set_input_line(Machine, 2, INPUT_LINE_RESET, CLEAR_LINE);
615            cpunum_set_input_line(machine, 2, INPUT_LINE_RESET, CLEAR_LINE);
616616            en_68k = 1;
617617            break;
618618         case 0x07:
619619            if(LOG_SMPC) logerror ("SMPC: Sound OFF\n");
620            cpunum_set_input_line(Machine, 2, INPUT_LINE_RESET, ASSERT_LINE);
620            cpunum_set_input_line(machine, 2, INPUT_LINE_RESET, ASSERT_LINE);
621621            en_68k = 0;
622622            smpc_ram[0x5f]=0x07;
623623            break;
r1981r1982
627627         case 0x0d:
628628            if(LOG_SMPC) logerror ("SMPC: System Reset\n");
629629            smpc_ram[0x5f]=0x0d;
630            cpunum_set_input_line(Machine, 0, INPUT_LINE_RESET, PULSE_LINE);
630            cpunum_set_input_line(machine, 0, INPUT_LINE_RESET, PULSE_LINE);
631631            system_reset();
632632            break;
633633         case 0x0e:
634634            if(LOG_SMPC) logerror ("SMPC: Change Clock to 352\n");
635635            smpc_ram[0x5f]=0x0e;
636            cpunum_set_clock(Machine, 0, MASTER_CLOCK_352/2);
637            cpunum_set_clock(Machine, 1, MASTER_CLOCK_352/2);
638            cpunum_set_clock(Machine, 2, MASTER_CLOCK_352/5);
639            cpunum_set_input_line(Machine, 0, INPUT_LINE_NMI, PULSE_LINE); // ff said this causes nmi, should we set a timer then nmi?
636            cpunum_set_clock(machine, 0, MASTER_CLOCK_352/2);
637            cpunum_set_clock(machine, 1, MASTER_CLOCK_352/2);
638            cpunum_set_clock(machine, 2, MASTER_CLOCK_352/5);
639            cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, PULSE_LINE); // ff said this causes nmi, should we set a timer then nmi?
640640            break;
641641         case 0x0f:
642642            if(LOG_SMPC) logerror ("SMPC: Change Clock to 320\n");
643643            smpc_ram[0x5f]=0x0f;
644            cpunum_set_clock(Machine, 0, MASTER_CLOCK_320/2);
645            cpunum_set_clock(Machine, 1, MASTER_CLOCK_320/2);
646            cpunum_set_clock(Machine, 2, MASTER_CLOCK_320/5);
647            cpunum_set_input_line(Machine, 0, INPUT_LINE_NMI, PULSE_LINE); // ff said this causes nmi, should we set a timer then nmi?
644            cpunum_set_clock(machine, 0, MASTER_CLOCK_320/2);
645            cpunum_set_clock(machine, 1, MASTER_CLOCK_320/2);
646            cpunum_set_clock(machine, 2, MASTER_CLOCK_320/5);
647            cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, PULSE_LINE); // ff said this causes nmi, should we set a timer then nmi?
648648            break;
649649         /*"Interrupt Back"*/
650650         case 0x10:
r1981r1982
696696            {
697697//                  if(LOG_SMPC) logerror ("Interrupt: System Manager (SMPC) at scanline %04x, Vector 0x47 Level 0x08\n",scanline);
698698               smpc_intbackhelper();
699               cpunum_set_input_line_and_vector(Machine, 0, 8, HOLD_LINE , 0x47);
699               cpunum_set_input_line_and_vector(machine, 0, 8, HOLD_LINE , 0x47);
700700            }
701701         break;
702702         /* RTC write*/
r1981r1982
725725            if(LOG_SMPC) logerror ("SMPC: NMI request\n");
726726            smpc_ram[0x5f]=0x18;
727727            /*NMI is unconditionally requested?*/
728            cpunum_set_input_line(Machine, 0, INPUT_LINE_NMI, PULSE_LINE);
728            cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, PULSE_LINE);
729729            break;
730730         case 0x19:
731731            if(LOG_SMPC) logerror ("SMPC: NMI Enable\n");
r1981r1982
783783
784784   offset += byte;
785785
786   stv_SMPC_w8(offset,writedata);
786   stv_SMPC_w8(machine, offset,writedata);
787787}
788788
789789
r1981r1982
10991099*/
11001100      if(stv_scu[4] & 1 && ((stv_scu[5] & 7) == 7) && stv_scu[4] & 0x100)
11011101      {
1102         if(DIRECT_MODE(0)) { dma_direct_lv0(); }
1103         else            { dma_indirect_lv0(); }
1102         if(DIRECT_MODE(0)) { dma_direct_lv0(machine); }
1103         else            { dma_indirect_lv0(machine); }
11041104
11051105         stv_scu[4]^=1;//disable starting bit.
11061106
r1981r1982
11601160      case 12:
11611161      if(stv_scu[12] & 1 && ((stv_scu[13] & 7) == 7) && stv_scu[12] & 0x100)
11621162      {
1163         if(DIRECT_MODE(1)) { dma_direct_lv1(); }
1164         else            { dma_indirect_lv1(); }
1163         if(DIRECT_MODE(1)) { dma_direct_lv1(machine); }
1164         else            { dma_indirect_lv1(machine); }
11651165
11661166         stv_scu[12]^=1;
11671167
r1981r1982
12101210      case 20:
12111211      if(stv_scu[20] & 1 && ((stv_scu[21] & 7) == 7) && stv_scu[20] & 0x100)
12121212      {
1213         if(DIRECT_MODE(2)) { dma_direct_lv2(); }
1214         else            { dma_indirect_lv2(); }
1213         if(DIRECT_MODE(2)) { dma_direct_lv2(machine); }
1214         else            { dma_indirect_lv2(machine); }
12151215
12161216         stv_scu[20]^=1;
12171217
r1981r1982
12991299   }
13001300}
13011301
1302static void dma_direct_lv0()
1302static void dma_direct_lv0(running_machine *machine)
13031303{
13041304   static UINT32 tmp_src,tmp_dst,tmp_size;
13051305   if(LOG_SCU) logerror("DMA lv 0 transfer START\n"
r1981r1982
13971397
13981398   if(LOG_SCU) logerror("DMA transfer END\n");
13991399   if(!(stv_scu[40] & 0x800))/*Lv 0 DMA end irq*/
1400      cpunum_set_input_line_and_vector(Machine, 0, 5, HOLD_LINE , 0x4b);
1400      cpunum_set_input_line_and_vector(machine, 0, 5, HOLD_LINE , 0x4b);
14011401
14021402   if(scu_add_tmp & 0x80000000)
14031403   {
r1981r1982
14091409   D0MV_0;
14101410}
14111411
1412static void dma_direct_lv1()
1412static void dma_direct_lv1(running_machine *machine)
14131413{
14141414   static UINT32 tmp_src,tmp_dst,tmp_size;
14151415   if(LOG_SCU) logerror("DMA lv 1 transfer START\n"
r1981r1982
15001500
15011501   if(LOG_SCU) logerror("DMA transfer END\n");
15021502   if(!(stv_scu[40] & 0x400))/*Lv 1 DMA end irq*/
1503      cpunum_set_input_line_and_vector(Machine, 0, 6, HOLD_LINE , 0x4a);
1503      cpunum_set_input_line_and_vector(machine, 0, 6, HOLD_LINE , 0x4a);
15041504
15051505   if(scu_add_tmp & 0x80000000)
15061506   {
r1981r1982
15121512   D1MV_0;
15131513}
15141514
1515static void dma_direct_lv2()
1515static void dma_direct_lv2(running_machine *machine)
15161516{
15171517   static UINT32 tmp_src,tmp_dst,tmp_size;
15181518   if(LOG_SCU) logerror("DMA lv 2 transfer START\n"
r1981r1982
16031603
16041604   if(LOG_SCU) logerror("DMA transfer END\n");
16051605   if(!(stv_scu[40] & 0x200))/*Lv 2 DMA end irq*/
1606      cpunum_set_input_line_and_vector(Machine, 0, 6, HOLD_LINE , 0x49);
1606      cpunum_set_input_line_and_vector(machine, 0, 6, HOLD_LINE , 0x49);
16071607
16081608   if(scu_add_tmp & 0x80000000)
16091609   {
r1981r1982
16151615   D2MV_0;
16161616}
16171617
1618static void dma_indirect_lv0()
1618static void dma_indirect_lv0(running_machine *machine)
16191619{
16201620   /*Helper to get out of the cycle*/
16211621   UINT8 job_done = 0;
r1981r1982
16811681   }while(job_done == 0);
16821682
16831683   if(!(stv_scu[40] & 0x800))/*Lv 0 DMA end irq*/
1684      cpunum_set_input_line_and_vector(Machine, 0, 5, HOLD_LINE , 0x4b);
1684      cpunum_set_input_line_and_vector(machine, 0, 5, HOLD_LINE , 0x4b);
16851685
16861686   D0MV_0;
16871687}
16881688
1689static void dma_indirect_lv1()
1689static void dma_indirect_lv1(running_machine *machine)
16901690{
16911691   /*Helper to get out of the cycle*/
16921692   UINT8 job_done = 0;
r1981r1982
17531753   }while(job_done == 0);
17541754
17551755   if(!(stv_scu[40] & 0x400))/*Lv 1 DMA end irq*/
1756      cpunum_set_input_line_and_vector(Machine, 0, 6, HOLD_LINE , 0x4a);
1756      cpunum_set_input_line_and_vector(machine, 0, 6, HOLD_LINE , 0x4a);
17571757
17581758   D1MV_0;
17591759}
17601760
1761static void dma_indirect_lv2()
1761static void dma_indirect_lv2(running_machine *machine)
17621762{
17631763   /*Helper to get out of the cycle*/
17641764   UINT8 job_done = 0;
r1981r1982
18241824   }while(job_done == 0);
18251825
18261826   if(!(stv_scu[40] & 0x200))/*Lv 2 DMA end irq*/
1827      cpunum_set_input_line_and_vector(Machine, 0, 6, HOLD_LINE , 0x49);
1827      cpunum_set_input_line_and_vector(machine, 0, 6, HOLD_LINE , 0x49);
18281828
18291829   D2MV_0;
18301830}
r1981r1982
20572057   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_BUTTON8 ) PORT_NAME("P2 R") PORT_PLAYER(2)   // R
20582058INPUT_PORTS_END
20592059
2060static void saturn_init_driver(int rgn)
2060static void saturn_init_driver(running_machine *machine, int rgn)
20612061{
20622062   mame_system_time systime;
20632063
20642064   saturn_region = rgn;
20652065
20662066   /* get the current date/time from the core */
2067   mame_get_current_datetime(Machine, &systime);
2067   mame_get_current_datetime(machine, &systime);
20682068
20692069   /* amount of time to boost interleave for on MINIT / SINIT, needed for communication to work */
20702070   minit_boost = 400;
r1981r1982
20912091#ifdef UNUSED_FUNCTION
20922092DRIVER_INIT( saturn )
20932093{
2094   saturn_init_driver(0);
2094   saturn_init_driver(machine, 0);
20952095}
20962096#endif
20972097
20982098static DRIVER_INIT( saturnus )
20992099{
2100   saturn_init_driver(4);
2100   saturn_init_driver(machine, 4);
21012101}
21022102
21032103static DRIVER_INIT( saturneu )
21042104{
2105   saturn_init_driver(12);
2105   saturn_init_driver(machine, 12);
21062106}
21072107
21082108static DRIVER_INIT( saturnjp )
21092109{
2110   saturn_init_driver(1);
2110   saturn_init_driver(machine, 1);
21112111}
21122112
21132113
src/mess/drivers/ql.c
r1981r1982
11#include "driver.h"
2#include "deprecat.h"
32#include "cpu/i8039/i8039.h"
43#include "cpu/m68000/m68000.h"
54#include "devices/cartslot.h"
r1981r1982
105104
106105static UINT8 *mdv_image;
107106
108static void zx8302_interrupt(UINT8 line)
107static void zx8302_interrupt(running_machine *machine, UINT8 line)
109108{
110109   zx8302.irq |= line;
111   cpunum_set_input_line(Machine, 0, MC68000_IRQ_2, HOLD_LINE);
110   cpunum_set_input_line(machine, 0, MC68000_IRQ_2, HOLD_LINE);
112111}
113112
114113static void zx8302_txd(int level)
r1981r1982
160159      zx8302_txd(1);
161160      zx8302.tx_bits = ZX8302_TXD_START;
162161      zx8302.status &= ~ZX8302_STATUS_TX_BUFFER_FULL;
163      zx8302_interrupt(ZX8302_INT_TRANSMIT);
162      zx8302_interrupt(machine, ZX8302_INT_TRANSMIT);
164163      break;
165164   }
166165}
r1981r1982
179178{
180179   if (zx8302.mdv_motor)
181180   {
182      zx8302_interrupt(ZX8302_INT_GAP);
181      zx8302_interrupt(machine, ZX8302_INT_GAP);
183182   }
184183}
185184
r1981r1982
380379
381380static INTERRUPT_GEN( zx8302_int )
382381{
383   zx8302_interrupt(ZX8302_INT_FRAME);
382   zx8302_interrupt(machine, ZX8302_INT_FRAME);
384383}
385384
386385/* Intelligent Peripheral Controller (IPC) */
src/mess/drivers/einstein.c
r1981r1982
349349   einstein_keyboard_data = data;
350350}
351351
352static void einstein_update_interrupts(void)
352static void einstein_update_interrupts(running_machine *machine)
353353{
354354   /* NPW 21-Jul-2005 - Not sure how to update this for MAME 0.98u2 */
355355/*
356356    if (einstein_int & einstein_int_mask & EINSTEIN_KEY_INT)
357        cpunum_set_input_line(Machine, 0, Z80_INT_REQ, PULSE_LINE);
357        cpunum_set_input_line(machine, 0, Z80_INT_REQ, PULSE_LINE);
358358    else
359        cpunum_set_input_line(Machine, 0, Z80_INT_IEO, PULSE_LINE);
359        cpunum_set_input_line(machine, 0, Z80_INT_IEO, PULSE_LINE);
360360
361361    if (einstein_int & einstein_int_mask & EINSTEIN_ADC_INT)
362        cpunum_set_input_line(Machine, 0, Z80_INT_REQ, PULSE_LINE);
362        cpunum_set_input_line(machine, 0, Z80_INT_REQ, PULSE_LINE);
363363    else
364        cpunum_set_input_line(Machine, 0, Z80_INT_IEO, PULSE_LINE);
364        cpunum_set_input_line(machine, 0, Z80_INT_IEO, PULSE_LINE);
365365
366366    if (einstein_int & einstein_int_mask & EINSTEIN_FIRE_INT)
367        cpunum_set_input_line(Machine, 0, Z80_INT_REQ, PULSE_LINE);
367        cpunum_set_input_line(machine, 0, Z80_INT_REQ, PULSE_LINE);
368368    else
369        cpunum_set_input_line(Machine, 0, Z80_INT_IEO, PULSE_LINE);
369        cpunum_set_input_line(machine, 0, Z80_INT_IEO, PULSE_LINE);
370370*/
371371}
372372
r1981r1982
395395      einstein_int &= ~EINSTEIN_KEY_INT;
396396   }
397397
398   einstein_update_interrupts();
398   einstein_update_interrupts(machine);
399399}
400400
401401
r1981r1982
459459{
460460   einstein_int_mask &= ~EINSTEIN_KEY_INT;
461461
462   einstein_update_interrupts();
462   einstein_update_interrupts(Machine);
463463}
464464
465465
r1981r1982
468468{
469469   einstein_int_mask &= ~EINSTEIN_ADC_INT;
470470
471   einstein_update_interrupts();
471   einstein_update_interrupts(Machine);
472472}
473473
474474#ifdef UNUSED_FUNCTION
r1981r1982
477477{
478478   einstein_int_mask &= ~EINSTEIN_FIRE_INT;
479479
480   einstein_update_interrupts();
480   einstein_update_interrupts(Machine);
481481}
482482#endif
483483
r1981r1982
845845   einstein_page_rom();
846846}
847847
848static READ8_HANDLER(einstein_key_int_r)
848static READ8_HANDLER(einstein_key_int_r)
849849{
850850   int centronics_handshake;
851851   int data;
r1981r1982
853853   /* clear key int. a read of this I/O port will do this or a reset */
854854   einstein_int &= ~EINSTEIN_KEY_INT;
855855
856   einstein_update_interrupts();
856   einstein_update_interrupts(machine);
857857
858858   centronics_write_handshake(0, CENTRONICS_SELECT | CENTRONICS_NO_RESET, CENTRONICS_SELECT| CENTRONICS_NO_RESET);
859859   centronics_handshake = centronics_read_handshake(0);
r1981r1982
916916      einstein_int_mask |= EINSTEIN_KEY_INT;
917917   }
918918
919   einstein_update_interrupts();
919   einstein_update_interrupts(machine);
920920}
921921
922922static WRITE8_HANDLER(einstein_adc_int_w)
r1981r1982
936936      einstein_int_mask |= EINSTEIN_ADC_INT;
937937   }
938938
939   einstein_update_interrupts();
939   einstein_update_interrupts(machine);
940940}
941941
942942static WRITE8_HANDLER(einstein_fire_int_w)
r1981r1982
957957      einstein_int_mask |= EINSTEIN_FIRE_INT;
958958   }
959959
960   einstein_update_interrupts();
960   einstein_update_interrupts(machine);
961961}
962962
963963
src/mess/drivers/exelv.c
r1981r1982
178178static int io_ack;
179179static int mailbox_out;
180180
181static void io_iterate(void);
181static void io_iterate(running_machine *machine);
182182
183183static void io_reset(void)
184184{
r1981r1982
195195   io_reset();
196196}
197197
198static void io_iterate(void)
198static void io_iterate(running_machine *machine)
199199{
200200   if (/*io_hsk &&*/ (mailbox_out == 0) && (! io_command_ack))
201201   {
r1981r1982
205205         break;
206206      case IOS_INIT:
207207         mailbox_out = 0x08;
208         cpunum_set_input_line(Machine, 0, TMS7000_IRQ1_LINE, PULSE_LINE);
208         cpunum_set_input_line(machine, 0, TMS7000_IRQ1_LINE, PULSE_LINE);
209209         io_state = IOS_NOP;
210210         break;
211211      case IOS_RESET:
r1981r1982
221221         break;
222222      case IOS_CHARDEF1:
223223         mailbox_out = 0x07;
224         cpunum_set_input_line(Machine, 0, TMS7000_IRQ1_LINE, PULSE_LINE);
224         cpunum_set_input_line(machine, 0, TMS7000_IRQ1_LINE, PULSE_LINE);
225225         io_state = IOS_CHARDEF2;
226226         break;
227227      case IOS_CHARDEF2:
228228         mailbox_out = 0x04;
229         cpunum_set_input_line(Machine, 0, TMS7000_IRQ1_LINE, PULSE_LINE);
229         cpunum_set_input_line(machine, 0, TMS7000_IRQ1_LINE, PULSE_LINE);
230230         io_state = IOS_CHARDEF3;
231231         break;
232232      case IOS_CHARDEF3:
233233         mailbox_out = 0xF5;
234         cpunum_set_input_line(Machine, 0, TMS7000_IRQ1_LINE, PULSE_LINE);
234         cpunum_set_input_line(machine, 0, TMS7000_IRQ1_LINE, PULSE_LINE);
235235         io_state = IOS_CHARDEF4;
236236         io_counter = 0;
237237         break;
r1981r1982
370370               0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
371371            };
372372            mailbox_out = fontdata[io_counter+9-2*(io_counter%10)] >> 2;
373            cpunum_set_input_line(Machine, 0, TMS7000_IRQ1_LINE, PULSE_LINE);
373            cpunum_set_input_line(machine, 0, TMS7000_IRQ1_LINE, PULSE_LINE);
374374            io_counter++;
375375            if (io_counter == 127*10)
376376               io_state = IOS_NOP;
r1981r1982
380380   }
381381}
382382
383static void set_io_hsk(int state)
383static void set_io_hsk(running_machine *machine, int state)
384384{
385385   if (state != io_hsk)
386386   {
r1981r1982
388388      if (io_command_ack)
389389      {
390390         if (io_hsk)
391            cpunum_set_input_line(Machine, 0, TMS7000_IRQ1_LINE, PULSE_LINE);
391            cpunum_set_input_line(machine, 0, TMS7000_IRQ1_LINE, PULSE_LINE);
392392         else
393393         {
394394            io_command_ack = 0;
395            io_iterate();
395            io_iterate(machine);
396396         }
397397      }
398398   }
r1981r1982
415415   mailbox_out = 0x00;
416416
417417   /* see if there are other messages to post */
418   io_iterate();
418   io_iterate(machine);
419419
420420   return reply;
421421}
r1981r1982
478478
479479static WRITE8_HANDLER(exelv_portb_w)
480480{
481   set_io_hsk((data & 0x1) != 0);
481   set_io_hsk(machine, (data & 0x1) != 0);
482482   set_io_ack((data & 0x2) != 0);
483483}
484484
src/mess/drivers/amstrad.c
r1981r1982
210210static void multiface_rethink_memory(void);
211211static WRITE8_HANDLER(multiface_io_write);
212212static void multiface_init(void);
213static void multiface_stop(void);
213static void multiface_stop(running_machine *machine);
214214static int multiface_hardware_enabled(void);
215215static void multiface_reset(void);
216216/* ---------------------------------------
r1981r1982
16131613}
16141614
16151615/* simulate the stop button has been pressed */
1616void   multiface_stop(void)
1616void multiface_stop(running_machine *machine)
16171617{
16181618   /* multiface hardware enabled? */
16191619      if (!multiface_hardware_enabled())
r1981r1982
16371637      multiface_rethink_memory();
16381638
16391639      /* pulse the nmi line */
1640      cpunum_set_input_line(Machine, 0, INPUT_LINE_NMI, PULSE_LINE);
1640      cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, PULSE_LINE);
16411641
16421642      /* initialise 0065 override to monitor calls to 0065 */
16431643      memory_set_opbase_handler(0,amstrad_multiface_opbaseoverride);
r1981r1982
17991799/* called when cpu acknowledges int */
18001800/* reset top bit of interrupt line counter */
18011801/* this ensures that the next interrupt is no closer than 32 lines */
1802static int    amstrad_cpu_acknowledge_int(int cpu)
1802static int amstrad_cpu_acknowledge_int(int cpu)
18031803{
18041804   // DMA interrupts can be automatically cleared if bit 0 of &6805 is set to 0
18051805   if(amstrad_plus_asic_enabled != 0 && amstrad_plus_irq_cause != 0x06 && amstrad_plus_dma_clear & 0x01)
r1981r1982
18281828{
18291829   if (readinputportbytag_safe("multiface", 0) & 0x02)
18301830   {
1831      multiface_stop();
1831      multiface_stop(machine);
18321832   }
18331833}
18341834/* sets up for a machine reset
src/mess/drivers/avigo.c
r1981r1982
152152}
153153#endif
154154
155static void avigo_refresh_ints(void)
155static void avigo_refresh_ints(running_machine *machine)
156156{
157157   if (avigo_irq!=0)
158      cpunum_set_input_line(Machine, 0, 0, HOLD_LINE);
158      cpunum_set_input_line(machine, 0, 0, HOLD_LINE);
159159   else
160      cpunum_set_input_line(Machine, 0, 0, CLEAR_LINE);
160      cpunum_set_input_line(machine, 0, 0, CLEAR_LINE);
161161}
162162
163163
r1981r1982
266266   memcpy(previous_input_port_data, current_input_port_data, sizeof(int)*4);
267267
268268   /* refresh status of interrupts */
269   avigo_refresh_ints();
269   avigo_refresh_ints(machine);
270270}
271271
272272/* does not do anything yet */
r1981r1982
280280      avigo_irq |= (1<<5);
281281   }
282282
283   avigo_refresh_ints();
283   avigo_refresh_ints(Machine);
284284//#endif
285285}
286286
r1981r1982
369369      avigo_irq |= (1<<3);
370370   }
371371
372   avigo_refresh_ints();
372   avigo_refresh_ints(Machine);
373373}
374374
375375
r1981r1982
515515{
516516   avigo_irq &= ~data;
517517
518   avigo_refresh_ints();
518   avigo_refresh_ints(machine);
519519}
520520
521521static  READ8_HANDLER(avigo_rom_bank_l_r)

Previous 15994 Revisions Next


© 1998-2018 The MESS Team