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

« back to all changes in this revision

Viewing changes to src/plus4/ted.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:
33
33
#include <string.h>
34
34
 
35
35
#include "alarm.h"
36
 
#include "archdep.h"
37
36
#include "clkguard.h"
38
37
#include "dma.h"
39
38
#include "lib.h"
62
61
#include "ted.h"
63
62
#include "tedtypes.h"
64
63
#include "types.h"
65
 
#include "util.h"
66
64
#include "vsync.h"
67
65
#include "videoarch.h"
68
66
#include "video.h"
275
273
static int init_raster(void)
276
274
{
277
275
    raster_t *raster;
278
 
    char *title;
279
276
 
280
277
    raster = &ted.raster;
281
278
    video_color_set_canvas(raster->canvas);
295
292
        log_error(ted.log, "Cannot load palette.");
296
293
        return -1;
297
294
    }
298
 
    title = util_concat("VICE: ", machine_name, " emulator", NULL);
299
 
    raster_set_title(raster, title);
300
 
    lib_free(title);
 
295
 
 
296
    raster_set_title(raster, machine_name);
301
297
 
302
298
    if (raster_realize(raster) < 0)
303
299
        return -1;
456
452
    BYTE *bitmap_base;            /* Pointer to bitmap memory.  */
457
453
    BYTE *color_base;             /* Pointer to color memory.  */
458
454
    int tmp;
459
 
    unsigned int romsel;
 
455
    unsigned int video_romsel;
 
456
    unsigned int cpu_romsel;
460
457
 
461
 
    romsel = ted.regs[0x12] & 4;
 
458
    video_romsel = ted.regs[0x12] & 4;
 
459
    cpu_romsel = (ted.regs[0x13] & 1) << 2;
462
460
 
463
461
    screen_addr = ((ted.regs[0x14] & 0xf8) << 8) | 0x400;
464
 
    screen_base = mem_get_tedmem_base((screen_addr >> 14) | romsel)
 
462
    screen_base = mem_get_tedmem_base((screen_addr >> 14) | cpu_romsel)
465
463
                  + (screen_addr & 0x3fff);
466
464
 
467
465
    TED_DEBUG_REGISTER(("\tVideo memory at $%04X", screen_addr));
468
466
 
469
467
    bitmap_addr = (ted.regs[0x12] & 0x38) << 10;
470
 
    bitmap_base = mem_get_tedmem_base((bitmap_addr >> 14) | romsel)
 
468
    bitmap_base = mem_get_tedmem_base((bitmap_addr >> 14) | video_romsel)
471
469
                  + (bitmap_addr & 0x3fff);
472
470
 
473
471
    TED_DEBUG_REGISTER(("\tBitmap memory at $%04X", bitmap_addr));
474
472
 
475
 
    char_addr = (ted.regs[0x13] & 0xfc) << 8;
476
 
    char_base = mem_get_tedmem_base((char_addr >> 14) | romsel)
 
473
    char_addr = (ted.regs[0x13] & (((ted.regs[0x06] & 0x40) | (ted.regs[0x07] & 0x90)) ? 0xf8 : 0xfc)) << 8;
 
474
    char_base = mem_get_tedmem_base((char_addr >> 14) | video_romsel)
477
475
                + (char_addr & 0x3fff);
478
476
 
479
477
    TED_DEBUG_REGISTER(("\tUser-defined character set at $%04X", char_addr));
480
478
 
481
479
    color_addr = ((ted.regs[0x14] & 0xf8) << 8);
482
 
    color_base = mem_get_tedmem_base((color_addr >> 14) | romsel)
 
480
    color_base = mem_get_tedmem_base((color_addr >> 14) | cpu_romsel)
483
481
                 + (color_addr & 0x3fff);
484
482
 
485
483
    TED_DEBUG_REGISTER(("\tColor memory at $%04X", color_addr));