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

« back to all changes in this revision

Viewing changes to src/video/video-resources.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:
35
35
#include "video-color.h"
36
36
#include "video.h"
37
37
#include "videoarch.h"
 
38
#include "viewport.h"
38
39
#include "util.h"
39
40
 
40
41
 
41
42
video_resources_t video_resources =
42
43
{
43
 
    1000, 1100, 1100, 880, 500,
 
44
    1000, 1100, 1100, 880, 0,
44
45
    0, 0, 0
45
46
};
46
47
 
62
63
    video_chip_cap_t *video_chip_cap;
63
64
    int double_scan_enabled;
64
65
    int double_size_enabled;
 
66
    int hwscale_enabled;
65
67
    int scale2x_enabled;
66
68
    int fullscreen_enabled;
67
69
    char *fullscreen_device;
87
89
    video_chip_cap_t *video_chip_cap;
88
90
    cap_render_t *cap_render;
89
91
    video_canvas_t *canvas;
 
92
    int old_doublesizex, old_doublesizey;
90
93
 
91
94
    video_resource_chip = (video_resource_chip_t *)param;
92
95
    video_chip_cap = video_resource_chip->video_chip_cap;
99
102
 
100
103
    canvas->videoconfig->rendermode = cap_render->rmode;
101
104
 
 
105
    old_doublesizex = canvas->videoconfig->doublesizex;
 
106
    old_doublesizey = canvas->videoconfig->doublesizey;
 
107
 
102
108
    if (cap_render->sizex > 1
103
109
        && (video_chip_cap->dsize_limit_width == 0
104
 
        || canvas->draw_buffer->canvas_width
105
 
        <= video_chip_cap->dsize_limit_width))
 
110
        || (canvas->draw_buffer->canvas_width > 0
 
111
        && canvas->draw_buffer->canvas_width
 
112
        <= video_chip_cap->dsize_limit_width)))
106
113
        canvas->videoconfig->doublesizex = 1;
107
114
    else
108
115
        canvas->videoconfig->doublesizex = 0;
109
116
 
110
117
    if (cap_render->sizey > 1
111
118
        && (video_chip_cap->dsize_limit_height == 0
112
 
        || canvas->draw_buffer->canvas_height
113
 
        <= video_chip_cap->dsize_limit_height))
 
119
        || (canvas->draw_buffer->canvas_height > 0
 
120
        && canvas->draw_buffer->canvas_height
 
121
        <= video_chip_cap->dsize_limit_height)))
114
122
        canvas->videoconfig->doublesizey = 1;
115
123
    else
116
124
        canvas->videoconfig->doublesizey = 0;
125
133
            canvas->videoconfig->rendermode = VIDEO_RENDER_RGB_1X1;
126
134
    }
127
135
 
128
 
    if (video_resource_chip->double_size_enabled != (int)v
 
136
    if ((video_resource_chip->double_size_enabled != (int)v
 
137
        || old_doublesizex != canvas->videoconfig->doublesizex
 
138
        || old_doublesizey != canvas->videoconfig->doublesizey)
129
139
        && canvas->initialized
130
140
        && canvas->viewport->update_canvas > 0) {
131
141
        video_viewport_resize(canvas);
175
185
    { NULL }
176
186
};
177
187
 
 
188
static int set_hwscale_enabled(resource_value_t v, void *param)
 
189
{
 
190
    video_resource_chip_t *video_resource_chip;
 
191
    video_canvas_t *canvas;
 
192
 
 
193
    video_resource_chip = (video_resource_chip_t *)param;
 
194
    canvas = *(video_resource_chip->canvas);
 
195
 
 
196
    video_resource_chip->hwscale_enabled = (int)v;
 
197
    canvas->videoconfig->hwscale = (int)v;
 
198
 
 
199
    if (canvas->initialized) {
 
200
        video_viewport_resize(canvas);
 
201
        video_color_update_palette(canvas);
 
202
    }
 
203
 
 
204
    video_resources_update_ui(video_resource_chip);
 
205
 
 
206
    return 0;
 
207
}
 
208
 
 
209
static const char *vname_chip_hwscale[] = { "HwScale", NULL };
 
210
 
 
211
static resource_t resources_chip_hwscale[] =
 
212
{
 
213
    { NULL, RES_INTEGER, (resource_value_t)0, NULL,
 
214
      set_hwscale_enabled, NULL },
 
215
    { NULL }
 
216
};
 
217
 
178
218
static int set_scale2x_enabled(resource_value_t v, void *param)
179
219
{
180
220
    video_resource_chip_t *video_resource_chip;
395
435
        lib_free((char *)(resources_chip_scan[0].name));
396
436
    }
397
437
 
 
438
    if (video_chip_cap->hwscale_allowed != 0) {
 
439
        resources_chip_hwscale[0].name
 
440
            = util_concat(chipname, vname_chip_hwscale[0], NULL);
 
441
        resources_chip_hwscale[0].value_ptr
 
442
            = (resource_value_t *)&(resource_chip->hwscale_enabled);
 
443
        resources_chip_hwscale[0].param = (void *)resource_chip;
 
444
        if (resources_register(resources_chip_hwscale) < 0)
 
445
            return -1;
 
446
 
 
447
        lib_free((char *)(resources_chip_hwscale[0].name));
 
448
    }
 
449
 
398
450
    if (video_chip_cap->scale2x_allowed != 0) {
399
451
        resources_chip_scale2x[0].name
400
452
            = util_concat(chipname, vname_chip_scale2x[0], NULL);