Previous 15994 Revisions Next

r9295 Friday 1st October, 2010 at 16:54:03 UTC by Tim Lindner
[COCO] Fixed interrupts to allow disk reading/writing to work again. [tim lindner]
[docs]messnew.txt
[src/mess/devices]cococart.c

src/mess/devices/cococart.c
r9294r9295
1818#define CARTSLOT_TAG         "cart"
1919#define LOG_LINE            0
2020
21/* TIMER_POOL: Must be power of two */
22#define TIMER_POOL         2
2123
2224/***************************************************************************
2325    TYPE DEFINITIONS
r9294r9295
2628typedef struct _coco_cartridge_line coco_cartridge_line;
2729struct _coco_cartridge_line
2830{
29   emu_timer               *timer;
30   UINT32                  delay;   /* in clock cycles */
31   emu_timer               *timer[TIMER_POOL];
32   int                  timer_index;
33   int                  delay;
3134   cococart_line_value         value;
3235   int                     line;
3336   int                     q_count;
r9294r9295
8487   running_device *cartslot;
8588   coco_cartridge_t *cococart = get_token(device);
8689   const cococart_config *config = (const cococart_config *) downcast<const legacy_device_config_base &>(device->baseconfig()).inline_config();
87
90   int i;
91   
8892   /* initialize */
8993   memset(cococart, 0, sizeof(*cococart));
9094
r9294r9295
103107   }
104108
105109   /* finish setup */
106   cococart->cart_line.timer      = timer_alloc(device->machine, cart_timer_callback, (void *) device);
107   cococart->cart_line.delay      = 0;
108   cococart->cart_line.callback   = config->cart_callback;
109   cococart->nmi_line.timer      = timer_alloc(device->machine, nmi_timer_callback, (void *) device);
110   cococart->nmi_line.delay      = 0;
111   cococart->nmi_line.callback      = config->nmi_callback;
112   cococart->halt_line.timer      = timer_alloc(device->machine, halt_timer_callback, (void *) device);
113   cococart->halt_line.delay      = 7;
114   cococart->halt_line.callback   = config->halt_callback;
110
111   for( i=0; i<TIMER_POOL; i++ )
112   {
113      cococart->cart_line.timer[i]      = timer_alloc(device->machine, cart_timer_callback, (void *) device);
114      cococart->nmi_line.timer[i]       = timer_alloc(device->machine, nmi_timer_callback, (void *) device);
115      cococart->halt_line.timer[i]      = timer_alloc(device->machine, halt_timer_callback, (void *) device);
116   }
117   
118   cococart->cart_line.timer_index     = 0;
119   cococart->cart_line.delay            = 0;
120   cococart->cart_line.callback        = config->cart_callback;
121
122   cococart->nmi_line.timer_index      = 0;
123   /* 12 allowed one more instruction to finished after the line is pulled */
124   cococart->nmi_line.delay            = 12;
125   cococart->nmi_line.callback         = config->nmi_callback;
126
127   cococart->halt_line.timer_index     = 0;
128   /* 6 allowed one more instruction to finished after the line is pulled */
129   cococart->halt_line.delay            = 6;
130   cococart->halt_line.callback        = config->halt_callback;
115131}
116132
117133
r9294r9295
181197      line->value = value;
182198
183199      if (LOG_LINE)
184         logerror("[%s]: set_line(): %s <= %s", cpuexec_describe_context(device->machine), line_name, line_value_string(value));
200         logerror("[%s]: set_line(): %s <= %s\n", cpuexec_describe_context(device->machine), line_name, line_value_string(value));
185201
186202      /* engage in a bit of gymnastics for this odious 'Q' value */
187203      switch(line->value)
r9294r9295
249265
250266static void set_line_timer(running_device *device, coco_cartridge_line *line, cococart_line_value value)
251267{
252   /* calculate delay; it isn't clear why we have to do this every single time */
268   /* calculate delay; delay dependant on cycles per second */
253269   attotime delay = (line->delay != 0)
254270      ? device->machine->firstcpu->cycles_to_attotime(line->delay)
255271      : attotime_zero;
256272
257   timer_adjust_oneshot(line->timer, delay, (int) value);
273   timer_adjust_oneshot(line->timer[line->timer_index], delay, (int) value);
274   line->timer_index = (line->timer_index + 1) % TIMER_POOL;
258275}
259276
260277
docs/messnew.txt
r9294r9295
5656
5757- [HECTOR] Added initial support for DISK II unit [JJ Stacino]
5858
59- [COCO] Fixed delays in when propagating interrupts signals from the floppy
60  disk controller to the CPU. Added a small pool of timers to allow
61  overlapping interrupt signals. [tim lindner]
62
63
5964Imgtool Changes:
6065----------------
61(none)
6266
67- Fixed WIMGTOOL to properly support file systems that use directory seperators
68  other than the backslash. [tim lindner]
6369
6470
71
6572Source Changes:
6673----------------
6774- The core is based on MAME 0.139u3.  This incorporates all features of the

Previous 15994 Revisions Next


© 1998-2018 The MESS Team