~ubuntu-branches/ubuntu/karmic/xmame/karmic

« back to all changes in this revision

Viewing changes to src/vidhrdw/cloak.c

  • Committer: Bazaar Package Importer
  • Author(s): Bruno Barrera C.
  • Date: 2007-02-16 10:06:54 UTC
  • mfrom: (2.1.5 edgy)
  • Revision ID: james.westby@ubuntu.com-20070216100654-iztas2cl47k5j039
Tags: 0.106-2
* Added Italian debconf templates translation. (closes: #382672)
* Added German debconf templates translation. (closes: #396610)
* Added Japanese debconf templates translation. (closes: #400011)
* Added Portuguese debconf templates translation. (closes: #409960)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/***************************************************************************
2
2
 
3
 
        Atari Cloak & Dagger hardware
 
3
    Atari Cloak & Dagger hardware
4
4
 
5
5
***************************************************************************/
6
6
 
7
7
#include "driver.h"
8
 
#include "vidhrdw/generic.h"
9
8
#include "cloak.h"
10
9
 
11
 
static struct mame_bitmap *tmpbitmap2;
 
10
static mame_bitmap *tmpbitmap2;
12
11
static UINT8 x,y,bmap;
13
12
static UINT8 *tmpvideoram,*tmpvideoram2;
14
13
 
15
 
static struct tilemap *bg_tilemap;
 
14
static tilemap *bg_tilemap;
16
15
 
17
16
/***************************************************************************
18
17
 
30
29
  These are the exact resistor values from the schematics:
31
30
 
32
31
  bit 8 -- diode |< -- pullup 1 kohm -- 2.2 kohm resistor -- pulldown 100 pf -- RED
33
 
                -- diode |< -- pullup 1 kohm -- 4.7 kohm resistor -- pulldown 100 pf -- RED
34
 
                -- diode |< -- pullup 1 kohm -- 10  kohm resistor -- pulldown 100 pf -- RED
35
 
                -- diode |< -- pullup 1 kohm -- 2.2 kohm resistor -- pulldown 100 pf -- GREEN
36
 
                -- diode |< -- pullup 1 kohm -- 4.7 kohm resistor -- pulldown 100 pf -- GREEN
37
 
                -- diode |< -- pullup 1 kohm -- 10  kohm resistor -- pulldown 100 pf -- GREEN
38
 
                -- diode |< -- pullup 1 kohm -- 2.2 kohm resistor -- pulldown 100 pf -- BLUE
39
 
                -- diode |< -- pullup 1 kohm -- 4.7 kohm resistor -- pulldown 100 pf -- BLUE
 
32
        -- diode |< -- pullup 1 kohm -- 4.7 kohm resistor -- pulldown 100 pf -- RED
 
33
        -- diode |< -- pullup 1 kohm -- 10  kohm resistor -- pulldown 100 pf -- RED
 
34
        -- diode |< -- pullup 1 kohm -- 2.2 kohm resistor -- pulldown 100 pf -- GREEN
 
35
        -- diode |< -- pullup 1 kohm -- 4.7 kohm resistor -- pulldown 100 pf -- GREEN
 
36
        -- diode |< -- pullup 1 kohm -- 10  kohm resistor -- pulldown 100 pf -- GREEN
 
37
        -- diode |< -- pullup 1 kohm -- 2.2 kohm resistor -- pulldown 100 pf -- BLUE
 
38
        -- diode |< -- pullup 1 kohm -- 4.7 kohm resistor -- pulldown 100 pf -- BLUE
40
39
  bit 0 -- diode |< -- pullup 1 kohm -- 10  kohm resistor -- pulldown 100 pf -- BLUE
41
40
 
42
41
***************************************************************************/
168
167
        SET_TILE_INFO(0, code, 0, 0)
169
168
}
170
169
 
 
170
static void refresh_bitmaps(void)
 
171
{
 
172
        int lx,ly;
 
173
 
 
174
        for (ly = 0; ly < 256; ly++)
 
175
        {
 
176
                for (lx = 0; lx < 256; lx++)
 
177
                {
 
178
                        plot_pixel(tmpbitmap,  (lx-6)&0xff, ly, Machine->pens[16 + tmpvideoram[ly*256+lx]]);
 
179
                        plot_pixel(tmpbitmap2, (lx-6)&0xff, ly, Machine->pens[16 + tmpvideoram2[ly*256+lx]]);
 
180
                }
 
181
        }
 
182
}
 
183
 
171
184
VIDEO_START( cloak )
172
185
{
173
186
        bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows,
182
195
        if ((tmpbitmap2 = auto_bitmap_alloc(Machine->drv->screen_width,Machine->drv->screen_height)) == 0)
183
196
                return 1;
184
197
 
185
 
        if ((tmpvideoram = auto_malloc(256*256)) == 0)
186
 
                return 1;
 
198
        tmpvideoram = auto_malloc(256*256);
 
199
        tmpvideoram2 = auto_malloc(256*256);
187
200
 
188
 
        if ((tmpvideoram2 = auto_malloc(256*256)) == 0)
189
 
                return 1;
 
201
        state_save_register_global(x);
 
202
        state_save_register_global(y);
 
203
        state_save_register_global(bmap);
 
204
        state_save_register_global_pointer(tmpvideoram, 256*256);
 
205
        state_save_register_global_pointer(tmpvideoram2, 256*256);
 
206
        state_save_register_func_postload(refresh_bitmaps);
190
207
 
191
208
        return 0;
192
209
}
193
210
 
194
 
#if 0
195
 
static void refresh_bitmaps(void)
196
 
{
197
 
        int lx,ly;
198
 
 
199
 
        for (ly = 0; ly < 256; ly++)
200
 
        {
201
 
                for (lx = 0; lx < 256; lx++)
202
 
                {
203
 
                        plot_pixel(tmpbitmap,  (lx-6)&0xff, ly, Machine->pens[16 + tmpvideoram[ly*256+lx]]);
204
 
                        plot_pixel(tmpbitmap2, (lx-6)&0xff, ly, Machine->pens[16 + tmpvideoram2[ly*256+lx]]);
205
 
                }
206
 
        }
207
 
}
208
 
#endif
209
 
 
210
 
static void cloak_draw_sprites( struct mame_bitmap *bitmap, const struct rectangle *cliprect )
 
211
static void cloak_draw_sprites( mame_bitmap *bitmap, const rectangle *cliprect )
211
212
{
212
213
        int offs;
213
214