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

« back to all changes in this revision

Viewing changes to src/vic20/vic.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:
49
49
#include "screenshot.h"
50
50
#include "snapshot.h"
51
51
#include "types.h"
52
 
#include "util.h"
53
52
#include "vic-cmdline-options.h"
54
53
#include "vic-draw.h"
55
54
#include "vic-mem.h"
59
58
#include "vic.h"
60
59
#include "vic20.h"
61
60
#include "vic20mem.h"
 
61
#include "vic20memrom.h"
 
62
#include "videoarch.h"
 
63
#include "viewport.h"
62
64
#include "vsync.h"
63
 
#include "videoarch.h"
64
65
 
65
66
 
66
67
vic_t vic;
141
142
    static int possible_mem_offset;
142
143
    int blank_this_line;
143
144
 
 
145
    /* remember if this line stays blank */
 
146
    blank_this_line = vic.raster.blank_this_line;
 
147
 
144
148
    /* check if first visible line is reached */
145
 
    if (vic.area == 0 && vic.raster.current_line >= vic.raster.display_ystart)
 
149
    if (vic.area == 0 && !blank_this_line
 
150
        && vic.raster.current_line >= vic.raster.display_ystart)
 
151
    {
146
152
        vic.area = 1;
147
 
 
148
 
    /* remember if this line stays blank */
149
 
    blank_this_line = vic.raster.blank_this_line;
150
 
    if (blank_this_line)
151
 
        vic.raster.display_ystop++;
 
153
    }
152
154
 
153
155
    /* check if row step is pending */
154
156
    if (vic.row_increase_line == (unsigned int)vic.raster.ycounter
187
189
                                   * VIC_PIXEL_WIDTH);
188
190
 
189
191
    /* increment ycounter and set offset for memptr */
190
 
    if (vic.area == 1 && !blank_this_line) {
 
192
    if (vic.area == 1) {
191
193
        vic.raster.ycounter++;
192
194
 
193
195
        if (vic.row_offset != 0
194
196
            || (unsigned int)vic.raster.ycounter == vic.row_increase_line) {
195
 
            /* this only happens if char_height changes between 8 and 16
196
 
               within line 7 */
197
197
            pending_mem_offset = 
198
198
                (vic.row_offset > 0 ? vic.row_offset : possible_mem_offset);
199
199
            vic.row_offset = 0;
 
200
 
 
201
            if (blank_this_line) {
 
202
                possible_mem_offset = 0;
 
203
            }
200
204
        }
201
205
 
202
206
        if (vic.raster.current_line >= vic.raster.display_ystop)
262
266
static int init_raster(void)
263
267
{
264
268
    raster_t *raster;
265
 
    char *title;
266
269
 
267
270
    raster = &vic.raster;
268
271
    video_color_set_canvas(raster->canvas);
282
285
 
283
286
    vic_color_update_palette(raster->canvas);
284
287
 
285
 
    title = util_concat("VICE: ", machine_name, " emulator", NULL);
286
 
    raster_set_title(raster, title);
287
 
    lib_free(title);
 
288
    raster_set_title(raster, machine_name);
288
289
 
289
290
    if (raster_realize(raster) < 0)
290
291
        return -1;
325
326
 
326
327
    vic.color_ptr = mem_ram;
327
328
    vic.screen_ptr = mem_ram;
328
 
    vic.chargen_ptr = mem_chargen_rom + 0x400;
 
329
    vic.chargen_ptr = vic20memrom_chargen_rom + 0x400;
329
330
 
330
331
    /* FIXME: Where do these values come from? */
331
332
    vic.light_pen.triggered = 0;
399
400
    char_addr += (tmp & 0x7) * 0x400;
400
401
 
401
402
    if (char_addr >= 0x8000 && char_addr < 0x9000) {
402
 
        new_chargen_ptr = mem_chargen_rom + 0x400 + (char_addr & 0xfff);
 
403
        new_chargen_ptr = vic20memrom_chargen_rom + 0x400 + (char_addr & 0xfff);
403
404
        VIC_DEBUG_REGISTER(("Character memory at $%04X "
404
405
                           "(character ROM + $%04X).",
405
406
                           char_addr,
406
407
                           char_addr & 0xfff));
407
408
    } else {
408
409
        if (char_addr == 0x1c00)
409
 
            new_chargen_ptr = mem_chargen_rom;    /* handle wraparound */
 
410
            new_chargen_ptr = vic20memrom_chargen_rom; /* handle wraparound */
410
411
        else
411
412
            new_chargen_ptr = mem_ram + char_addr;
412
413
        VIC_DEBUG_REGISTER (("Character memory at $%04X.", char_addr));