~ubuntu-branches/ubuntu/maverick/vice/maverick

« back to all changes in this revision

Viewing changes to src/vicii/vicii-snapshot.c

  • Committer: Bazaar Package Importer
  • Author(s): Zed Pobre
  • Date: 2005-02-01 11:30:26 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20050201113026-3eyakzsmmheclvjg
Tags: 1.16-1
* New upstream version
* Fixes crash on 64-bit architectures (closes: #287640)
* x128 working again (closes: #286767)
* Works fine with /dev/dsp in use (not in the main changelog, but tested
  on my local machine as working).  Presumably, this also takes care of
  the issue with dsp being held.  I'm not sure if this is because I'm
  testing it on a 2.6 kernel now -- if you are still having problems
  with /dev/dsp, please reopen the bugs. (closes: #152952, #207942)
* Don't kill Makefile.in on clean

Show diffs side-by-side

added added

removed removed

Lines of Context:
340
340
    }
341
341
 
342
342
    /* FIXME: Recalculate alarms and derived values.  */
343
 
 
 
343
#if 1
 
344
    {
 
345
        /* 
 
346
            We cannot use vicii_irq_set_raster_line as this would delay
 
347
            an alarm on line 0 for one frame
 
348
        */
 
349
        unsigned int line = vicii.regs[0x12] | ((vicii.regs[0x11] & 0x80) << 1);
 
350
 
 
351
        if (line < (unsigned int)vicii.screen_height) {
 
352
            vicii.raster_irq_clk = (VICII_LINE_START_CLK(maincpu_clk)
 
353
                                    + VICII_RASTER_IRQ_DELAY - INTERRUPT_DELAY
 
354
                                    + (vicii.cycles_per_line * line));
 
355
 
 
356
            /* Raster interrupts on line 0 are delayed by 1 cycle.  */
 
357
            if (line == 0)
 
358
                vicii.raster_irq_clk++;
 
359
 
 
360
            alarm_set(vicii.raster_irq_alarm, vicii.raster_irq_clk);
 
361
        } else {
 
362
            vicii.raster_irq_clk = CLOCK_MAX;
 
363
            alarm_unset(vicii.raster_irq_alarm);
 
364
        }
 
365
        vicii.raster_irq_line = line;
 
366
    }
 
367
 
 
368
#else
344
369
    vicii_irq_set_raster_line(vicii.regs[0x12]
345
370
                              | ((vicii.regs[0x11] & 0x80) << 1));
 
371
#endif
346
372
 
347
373
    /* compatibility with older versions */
348
374
    vicii.ram_base_phi2 = vicii.ram_base_phi1;
379
405
    }
380
406
 
381
407
    vicii.sprite_fetch_msk = vicii.raster.sprite_status->new_dma_msk;
382
 
    vicii.sprite_fetch_clk = (VICII_LINE_START_CLK(maincpu_clk)
383
 
                             + vicii.sprite_fetch_cycle);
 
408
    vicii.sprite_fetch_clk = VICII_LINE_START_CLK(maincpu_clk)
 
409
                             + vicii.sprite_fetch_cycle
 
410
                             - vicii.cycles_per_line;
 
411
 
 
412
    /* calculate the sprite_fetch_idx */
 
413
    {
 
414
        const vicii_sprites_fetch_t *sf;
 
415
 
 
416
        sf = vicii_sprites_fetch_table[vicii.sprite_fetch_msk];
 
417
        i = 0;
 
418
        while (sf[i].cycle >= 0 
 
419
            && sf[i].cycle + vicii.sprite_fetch_cycle <= vicii.cycles_per_line)
 
420
        {
 
421
            i++;
 
422
        }
 
423
        vicii.sprite_fetch_idx = i;
 
424
    }
384
425
 
385
426
    vicii.raster.xsmooth = vicii.regs[0x16] & 0x7;
386
427
    vicii.raster.ysmooth = vicii.regs[0x11] & 0x7;