Previous 199869 Revisions Next

r40606 Sunday 6th September, 2015 at 14:49:11 UTC by David Haywood
Merge pull request #305 from mamesick/patch-1

Fix for MAMETESTERS bug #4701
[src/emu/machine]at_keybc.c
[src/mame/drivers]goldstar.c suna8.c
[src/mame/includes]suna8.h
[src/mame/video]suna8.c
[src/mess/drivers]apple2.c apple2e.c

trunk/src/emu/machine/at_keybc.c
r249117r249118
2828static INPUT_PORTS_START( at_keybc )
2929   PORT_START("DSW")
3030   PORT_BIT(     0xbf, 0xbf, IPT_UNUSED )
31   PORT_DIPNAME( 0x40, 0x40, "Display switch")
31   PORT_DIPNAME( 0x40, 0x00, "Display switch")
3232   PORT_DIPSETTING(    0x40, "Monochrome adapter" )
3333   PORT_DIPSETTING(    0x00, "Color/Graphics adapter" )
3434INPUT_PORTS_END
trunk/src/mame/drivers/goldstar.c
r249117r249118
17311731   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
17321732   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_GAMBLE_HIGH ) PORT_NAME("Big")
17331733   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_GAMBLE_D_UP )
1734   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_GAMBLE_TAKE )
1735   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_GAMBLE_BET )
1736   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_GAMBLE_LOW ) PORT_NAME("Small / Info")
1737   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START1 ) PORT_NAME("Start")
1734   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_SLOT_STOP1 ) PORT_NAME("Stop 1 / Take")
1735   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_SLOT_STOP2 ) PORT_NAME("Stop 2 / Bet" )
1736   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_SLOT_STOP3 ) PORT_NAME("Stop 3 / Small / Info")
1737   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START1 ) PORT_NAME("Start / Stop All")
17381738
17391739   PORT_INCLUDE( cmv4_coins )
17401740
r249117r249118
17951795   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )  PORT_DIPLOCATION("DSW5:6")  /* normally Display Of Doll At All Fr. Bonus, but no whores in this set */
17961796   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
17971797   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1798   /* DSW5-7 listed as unused */
1798   PORT_DIPNAME( 0x40, 0x40, "Skill Stop" )        PORT_DIPLOCATION("DSW5:7")  /* OK */
1799   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
1800   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
17991801   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )  PORT_DIPLOCATION("DSW5:8")  /* normally Test Mode For Disp. Of Doll, but no whores in this set */
18001802   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
18011803   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
trunk/src/mame/drivers/suna8.c
r249117r249118
2727
2828- hardhea2: in test mode press P1&P2 button 2 to see a picture of each level
2929- Rough Ranger default dipswitch settings are based on the settings listed in
30  the Sharp Image licensed Rough Ranger manaul / NOTICE sheet dated 8-5-88
31- starfigh video: http://youtu.be/SIwV7wjvnHM -> missing starfield effect!
30  the Sharp Image licensed Rough Ranger manual / NOTICE sheet dated 8-5-88
31- rranger  video: http://www.nicovideo.jp/watch/sm15788808 (not perfect: fireball masking, lev. 5; masking/missing legs, lev. 10)
32- hardhead video: https://youtu.be/zamQvXr9_xs
33- starfigh video: http://youtu.be/SIwV7wjvnHM (missing starfield effect!)
3234- brickzn  video: http://youtu.be/yfU1C7A3iZI (recorded from v6.0, Joystick version)
3335
3436***************************************************************************/
r249117r249118
18851887   MCFG_PALETTE_FORMAT(RRRRGGGGBBBBxxxx)
18861888   MCFG_PALETTE_ENDIANNESS(ENDIANNESS_BIG)
18871889
1888   MCFG_VIDEO_START_OVERRIDE(suna8_state,suna8_textdim12)
1890   MCFG_VIDEO_START_OVERRIDE(suna8_state,suna8_text)
18891891
18901892   /* sound hardware */
18911893   MCFG_SPEAKER_STANDARD_MONO("mono")
r249117r249118
19391941   MCFG_PALETTE_FORMAT(RRRRGGGGBBBBxxxx)
19401942   MCFG_PALETTE_ENDIANNESS(ENDIANNESS_BIG)
19411943
1942   MCFG_VIDEO_START_OVERRIDE(suna8_state,suna8_textdim8)
1944   MCFG_VIDEO_START_OVERRIDE(suna8_state,suna8_text)
19431945
19441946   /* sound hardware */
19451947   MCFG_SPEAKER_STANDARD_MONO("mono")
r249117r249118
29212923   m_bank1->configure_entries(0, 16, memregion("maincpu")->base() + 0x10000, 0x4000);
29222924}
29232925
2924GAME( 1988, sranger,   0,        rranger,  rranger,  suna8_state, suna8,     ROT0,  "SunA",                       "Super Ranger (v2.0)",                0 )
2925GAME( 1988, rranger,   sranger,  rranger,  rranger,  suna8_state, suna8,     ROT0,  "SunA (Sharp Image license)", "Rough Ranger (v2.0)",                0 )
2926GAME( 1988, rrangerb,  sranger,  rranger,  rranger,  suna8_state, suna8,     ROT0,  "bootleg",                    "Rough Ranger (v2.0, bootleg)",       0 )
2927GAME( 1988, srangero,  sranger,  rranger,  rranger,  suna8_state, suna8,     ROT0,  "SunA",                       "Super Ranger (older)",               0 )
2928GAME( 1988, srangern,  sranger,  rranger,  rranger,  suna8_state, suna8,     ROT0,  "SunA (NOVA license)",        "Super Ranger (older, NOVA license)", 0 )
2929GAME( 1988, srangerw,  sranger,  rranger,  rranger,  suna8_state, suna8,     ROT0,  "SunA (WDK license)",         "Super Ranger (older, WDK license)",  0 )
2930GAME( 1988, srangerb,  sranger,  rranger,  rranger,  suna8_state, suna8,     ROT0,  "bootleg (NYWA)",             "Super Ranger (older, bootleg)",      0 )
2926GAME( 1988, sranger,   0,        rranger,  rranger,  suna8_state, suna8,     ROT0,  "SunA",                       "Super Ranger (v2.0)",                MACHINE_IMPERFECT_GRAPHICS )
2927GAME( 1988, rranger,   sranger,  rranger,  rranger,  suna8_state, suna8,     ROT0,  "SunA (Sharp Image license)", "Rough Ranger (v2.0)",                MACHINE_IMPERFECT_GRAPHICS )
2928GAME( 1988, rrangerb,  sranger,  rranger,  rranger,  suna8_state, suna8,     ROT0,  "bootleg",                    "Rough Ranger (v2.0, bootleg)",       MACHINE_IMPERFECT_GRAPHICS )
2929GAME( 1988, srangero,  sranger,  rranger,  rranger,  suna8_state, suna8,     ROT0,  "SunA",                       "Super Ranger (older)",               MACHINE_IMPERFECT_GRAPHICS )
2930GAME( 1988, srangern,  sranger,  rranger,  rranger,  suna8_state, suna8,     ROT0,  "SunA (NOVA license)",        "Super Ranger (older, NOVA license)", MACHINE_IMPERFECT_GRAPHICS )
2931GAME( 1988, srangerw,  sranger,  rranger,  rranger,  suna8_state, suna8,     ROT0,  "SunA (WDK license)",         "Super Ranger (older, WDK license)",  MACHINE_IMPERFECT_GRAPHICS )
2932GAME( 1988, srangerb,  sranger,  rranger,  rranger,  suna8_state, suna8,     ROT0,  "bootleg (NYWA)",             "Super Ranger (older, bootleg)",      MACHINE_IMPERFECT_GRAPHICS )
29312933
29322934GAME( 1988, hardhead,  0,        hardhead, hardhead, suna8_state, hardhead,  ROT0,  "SunA",                       "Hard Head",                   0 )
29332935GAME( 1988, hardheadb, hardhead, hardhead, hardhead, suna8_state, hardhedb,  ROT0,  "bootleg",                    "Hard Head (bootleg)",         0 )
trunk/src/mame/includes/suna8.h
r249117r249118
6464   }   m_gfxbank_type;
6565   UINT8 m_gfxbank;
6666
67   int m_text_dim; // vertical size of the text layer (0 = no text layer)
67   bool m_has_text; // has text sprites (older games)
6868
6969   // samples
7070   INT16 *m_samplebuf;
r249117r249118
148148   DECLARE_DRIVER_INIT(hardhead);
149149   DECLARE_DRIVER_INIT(suna8);
150150
151   void suna8_vh_start_common(int text_dim, GFXBANK_TYPE_T gfxbank_type);
152   DECLARE_VIDEO_START(suna8_textdim8);
153   DECLARE_VIDEO_START(suna8_textdim12);
151   void suna8_vh_start_common(bool has_text, GFXBANK_TYPE_T gfxbank_type);
152   DECLARE_VIDEO_START(suna8_text);
154153   DECLARE_VIDEO_START(suna8_sparkman);
155154   DECLARE_VIDEO_START(suna8_brickzn);
156155   DECLARE_VIDEO_START(suna8_starfigh);
r249117r249118
168167   void play_sample(int index);
169168   SAMPLES_START_CB_MEMBER(sh_start);
170169
171   void draw_normal_sprites(bitmap_ind16 &bitmap,const rectangle &cliprect, int which);
172   void draw_text_sprites(bitmap_ind16 &bitmap,const rectangle &cliprect);
170   void draw_sprites     (screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int start, int end, int which);
171   void draw_text_sprites(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int start, int end, int ypos, bool write_mask);
173172   UINT8 *brickzn_decrypt();
174173};
trunk/src/mame/video/suna8.c
r249117r249118
1717    sent to the screen. Each sprite uses 4 bytes, held within the last
1818    page of tiles.
1919
20    * Note: later games use a more complex format than the following,
21            which is yet to be completely understood.
22
23                            [ Sprites Format ]
24
25    Offset:         Bits:               Value:
26
27        0.b                             Y (Bottom up)
28
29        1.b         7--- ----           Sprite Size (1 = 2x32 tiles; 0 = 2x2)
30
31                    2x2 Sprites:
32                    -65- ----           Tiles Row (height = 8 tiles)
33                    ---4 ----           Page
34
35                    2x32 Sprites:
36                    -6-- ----           Ignore X (Multisprite)
37                    --54 ----           Page
38
39                    ---- 3210           Tiles Column (width = 2 tiles)
40
41        2.b                             X
42
43        3.b         7--- ----
44                    -6-- ----           X (Sign Bit)
45                    --54 3---
46                    ---- -210           Tiles Bank
47
48
49                        [ Sprite's Tiles Format ]
50
51
52    Offset:         Bits:                   Value:
53
54        0.b                             Code (Low Bits)
55
56        1.b         7--- ----           Flip Y
57                    -6-- ----           Flip X
58                    --54 32--           Color
59                    ---- --10           Code (High Bits)
60
61
62
6320    Set TILEMAPS to 1 to debug.
6421    Press Z (you see the "tilemaps" in RAM) or
6522    Press X (you see the "tilemaps" in ROM) then
r249117r249118
7229
7330#include "emu.h"
7431#include "includes/suna8.h"
32#include "drawgfxm.h"
7533
7634/***************************************************************************
7735    For Debug: there's no tilemap, just sprites.
r249117r249118
180138
181139
182140
183void suna8_state::suna8_vh_start_common(int text_dim, GFXBANK_TYPE_T gfxbank_type)
141void suna8_state::suna8_vh_start_common(bool has_text, GFXBANK_TYPE_T gfxbank_type)
184142{
185   m_text_dim      =   text_dim;
143   m_has_text      =   has_text;
186144   m_spritebank    =   0;
187145   m_gfxbank       =   0;
188146   m_gfxbank_type  =   gfxbank_type;
189147   m_palettebank   =   0;
190148
191   if (!m_text_dim)
149   if (!m_has_text)
192150   {
193151      m_banked_paletteram.allocate(0x200 * 2);
194152
r249117r249118
199157#if TILEMAPS
200158   m_bg_tilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(suna8_state::get_tile_info),this), TILEMAP_SCAN_COLS,
201159
202                        8, 8, 0x20*(m_text_dim ? 4 : 16), 0x20);
160                        8, 8, 0x20*(m_has_text ? 4 : 16), 0x20);
203161
204162   m_bg_tilemap->set_transparent_pen(15);
205163#endif
206164}
207165
208VIDEO_START_MEMBER(suna8_state,suna8_textdim8)          { suna8_vh_start_common(  8, GFXBANK_TYPE_SPARKMAN); }
209VIDEO_START_MEMBER(suna8_state,suna8_textdim12)         { suna8_vh_start_common( 12, GFXBANK_TYPE_SPARKMAN); }
210VIDEO_START_MEMBER(suna8_state,suna8_sparkman)          { suna8_vh_start_common(  0, GFXBANK_TYPE_SPARKMAN); }
211VIDEO_START_MEMBER(suna8_state,suna8_brickzn)           { suna8_vh_start_common(  0, GFXBANK_TYPE_BRICKZN);  }
212VIDEO_START_MEMBER(suna8_state,suna8_starfigh)          { suna8_vh_start_common(  0, GFXBANK_TYPE_STARFIGH); }
166VIDEO_START_MEMBER(suna8_state,suna8_text)              { suna8_vh_start_common( true,  GFXBANK_TYPE_SPARKMAN); }
167VIDEO_START_MEMBER(suna8_state,suna8_sparkman)          { suna8_vh_start_common( false, GFXBANK_TYPE_SPARKMAN); }
168VIDEO_START_MEMBER(suna8_state,suna8_brickzn)           { suna8_vh_start_common( false, GFXBANK_TYPE_BRICKZN);  }
169VIDEO_START_MEMBER(suna8_state,suna8_starfigh)          { suna8_vh_start_common( false, GFXBANK_TYPE_STARFIGH); }
213170
214171/***************************************************************************
215172
r249117r249118
219176
220177***************************************************************************/
221178
222void suna8_state::draw_normal_sprites(bitmap_ind16 &bitmap,const rectangle &cliprect, int which)
179#define PIXEL_OP_REBASE_TRANSPEN_PRIORITY_MASK(DEST, PRIORITY, SOURCE)              \
180do                                                                                  \
181{                                                                                   \
182   UINT32 srcdata = (SOURCE);                                                      \
183   if (srcdata != trans_pen)                                                       \
184   {                                                                               \
185      if ((PRIORITY) == 0)                                                        \
186         (DEST) = color + srcdata;                                               \
187   }                                                                               \
188}                                                                                   \
189while (0)
190
191class mygfx_element : public gfx_element
223192{
193public:
194   void prio_mask_transpen(bitmap_ind16 &dest, const rectangle &cliprect,
195         UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty,
196         bitmap_ind8 &priority, UINT32 trans_pen)
197   {
198      color = colorbase() + granularity() * (color % colors());
199      code %= elements();
200      DRAWGFX_CORE(UINT16, PIXEL_OP_REBASE_TRANSPEN_PRIORITY_MASK, UINT8);
201   }
202};
203
204/***************************************************************************
205
206                          [ Sprites Format ]
207
208    * Note: later games use a more complex format than the following
209
210    Offset:         Bits:               Value:
211
212        0.b                             Y (Bottom up)
213
214        1.b         7--- ----           Sprite Size (1 = 2x32 tiles; 0 = 2x2)
215
216                    2x2 Sprites:
217                    -65- ----           Tiles Row (height = 8 tiles)
218                    ---4 ----           Page
219
220                    2x32 Sprites:
221                    -6-- ----           Ignore X (Multisprite)
222                    --54 ----           Page
223
224                    ---- 3210           Tiles Column (width = 2 tiles)
225
226        2.b                             X
227
228        3.b         7--- ----           Text Sprite
229                    -6-- ----           X (Sign Bit) <- Also Set For Text Sprites
230                    --54 3210           Tiles Bank ($400 tiles each)
231
232
233                        [ Sprite's Tiles Format ]
234
235
236    Offset:         Bits:                   Value:
237
238        0.b                             Code (Low Bits)
239
240        1.b         7--- ----           Flip Y
241                    -6-- ----           Flip X
242                    --54 32--           Color
243                    ---- --10           Code (High Bits)
244
245***************************************************************************/
246
247void suna8_state::draw_sprites(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int start, int end, int which)
248{
224249   UINT8 *spriteram = m_spriteram + which * 0x2000 * 2;
225250
226   int i;
227251   int mx = 0; // multisprite x counter
228252
229253   int max_x = m_screen->width() - 8;
230254   int max_y = m_screen->height() - 8;
231255
232   for (i = 0x1d00; i < 0x2000; i += 4)
256   if (m_has_text)
257      screen.priority().fill(0, cliprect);
258
259   for (int i = start; i < end; i += 4)
233260   {
234261      int srcpg, srcx,srcy, dimx,dimy, tx, ty;
235262      int gfxbank, colorbank = 0, flipx,flipy, multisprite;
r249117r249118
239266      int x       =   spriteram[i + 2];
240267      int bank    =   spriteram[i + 3];
241268
242      if (m_text_dim)
269      bool read_mask = false;
270
271      if (m_has_text)
243272      {
244273         // Older, simpler hardware: hardhead, rranger
274
275         // rranger (20:18):
276         //   fireball (fe00: 19 00 28 07) not masked by text (fd48: e0 00 00 c0, fd4c: 10 00 00 c0), fire (fdb0: 30 00 00 c0, fdb4: 20 00 00 c0)
277         //   fireball (fe00: 20 00 ba 07) is masked!? But only by fire?
278         // rranger (33:04, 35:17):
279         //   generally no masking by fire, but there are missing legs on some enemies.
280         //   Could be a sprite limit hit, as there are many sprites on that line, and it's affected by the horizontal (dead) player
281         read_mask = true;
282
283         if ((bank & 0xc0) == 0xc0)
284         {
285            // hardhead: fd88/8c/90 -> f994..f9c0
286            // rranger:  fd48/4c    -> f980..f9ac
287            //           fdb0/b4    -> f9c0..f9fc
288            //           note: fireballs in level 5 (fe20/40) should go above flames and score (text sprites)
289            int text_list  = (i - start) & 0x20;
290            int text_start = text_list ? 0x19c0 : 0x1980;
291            bool write_mask = (text_list == 0);   // hack?
292            draw_text_sprites(screen, bitmap, cliprect, text_start, text_start + 0x80, y, write_mask);
293            continue;
294         }
295
245296         flipx = 0;
246297         flipy = 0;
247298         gfxbank = bank & 0x3f;
r249117r249118
263314      }
264315      else
265316      {
266         // Newer, more complex hardware: brickzn, hardhea2, sparkman?, starfigh
317         // Newer, more complex hardware: brickzn, hardhea2, sparkman, starfigh
267318         switch( code & 0xc0 )
268319         {
269320         case 0xc0:
r249117r249118
282333            gfxbank = bank & 0x1f;
283334            srcpg = (code >> 4) & 3;
284335            break;
285// hardhea2: fire code=52/54 bank=a4; player code=02/04/06 bank=08; arrow:code=16 bank=27
286336         case 0x40:
337            // hardhea2: fire code=52/54 bank=a4; player code=02/04/06 bank=08; arrow:code=16 bank=27
287338            dimx = 4;                   dimy = 4;
288339            srcx  = (code & 0xe) * 2;
289340            flipx = code & 0x01;
r249117r249118
347398      x = x - ((bank & 0x40) ? 0x100 : 0);
348399      y = (0x100 - y - dimy*8 ) & 0xff;
349400
350      /* Multi Sprite */
401      // Multi Sprite
351402      if ( multisprite )  {   mx += dimx*8;   x = mx; }
352403      else                    mx = x;
353404
r249117r249118
379430               sy = max_y - sy;    tile_flipy = !tile_flipy;
380431            }
381432
382            m_gfxdecode->gfx(which)->transpen(bitmap,cliprect,
383                     tile + (attr & 0x3)*0x100 + gfxbank,
384                     (((attr >> 2) & 0xf) ^ colorbank) + 0x10 * m_palettebank,    // player2 in hardhea2 and sparkman
385                     tile_flipx, tile_flipy,
386                     sx, sy, 0xf);
433            int code  = tile + (attr & 0x3)*0x100 + gfxbank;
434            int color = (((attr >> 2) & 0xf) ^ colorbank) + 0x10 * m_palettebank;    // player2 in hardhea2 and sparkman
435
436            if (read_mask)
437               ((mygfx_element*)(m_gfxdecode->gfx(which)))->prio_mask_transpen(bitmap, cliprect,
438                        code, color, tile_flipx, tile_flipy, sx, sy, screen.priority(), 0xf);
439            else
440               m_gfxdecode->gfx(which)->transpen(bitmap, cliprect,
441                        code, color, tile_flipx, tile_flipy, sx, sy, 0xf);
387442         }
388443      }
389
390444   }
391445}
392446
393void suna8_state::draw_text_sprites(bitmap_ind16 &bitmap,const rectangle &cliprect)
447/***************************************************************************
448
449                          [ Text Sprites Format ]
450
451    Offset:         Bits:               Value:
452
453        0.b                             Tiles Y (height = 2 tiles)
454
455        1.b         7--- ----           0 = Skip Sprite
456                    -6-- ----
457                    --54 ----           Page
458                    ---- 3210           Tiles Column (width = 2 tiles)
459
460        2.b                             X
461
462        3.b         7--- ----         0 = Last Sprite
463                    -6-- ----           X (Sign Bit)
464                    --54 3210           Tiles Bank ($400 tiles each)
465
466    Each text sprite is 2x2 tiles
467
468***************************************************************************/
469
470void suna8_state::draw_text_sprites(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int start, int end, int ypos, bool write_mask)
394471{
395472   UINT8 *spriteram = m_spriteram;
396   int i;
397473
398474   int max_x = m_screen->width() - 8;
399475   int max_y = m_screen->height() - 8;
400476
401   for (i = 0x1900; i < 0x19ff; i += 4)
477   bool last = false;
478   for (int i = start; i < end && !last; i += 4)
402479   {
403480      int srcpg, srcx,srcy, dimx,dimy, tx, ty;
404481
r249117r249118
408485      int bank    =   spriteram[i + 3];
409486
410487      if (~code & 0x80)   continue;
488      last = !(bank & 0x80);
411489
412      dimx = 2;                   dimy = m_text_dim;
413      srcx  = (code & 0xf) * 2;   srcy = (y & 0xf0) / 8;
490      dimx = 2;                   dimy = 2;
491      srcx  = (code & 0xf) * 2;   srcy = ((y & 0xf8) - (ypos & 0xf8) - 0x10) / 8;
414492      srcpg = (code >> 4) & 3;
415493
416494      x = x - ((bank & 0x40) ? 0x100 : 0);
417      y = 0;
418495
419496      bank    =   (bank & 0x3f) * 0x400;
420497
r249117r249118
422499      {
423500         for (tx = 0; tx < dimx; tx ++)
424501         {
425            int real_ty =   (ty < (dimy/2)) ? ty : (ty + 0x20 - dimy);
426
427502            int addr    =   (srcpg * 0x20 * 0x20) +
428503                        ((srcx + tx) & 0x1f) * 0x20 +
429                        ((srcy + real_ty) & 0x1f);
504                        ((srcy + ty) & 0x1f);
430505
431506            int tile    =   spriteram[addr*2 + 0];
432507            int attr    =   spriteram[addr*2 + 1];
r249117r249118
435510            int flipy   =   attr & 0x80;
436511
437512            int sx      =    x + tx * 8;
438            int sy      =   (y + real_ty * 8) & 0xff;
513            int sy      =   (0xf0 - ypos + ty * 8) & 0xff;
439514
440515            if (flip_screen())
441516            {
r249117r249118
443518               sy = max_y - sy;    flipy = !flipy;
444519            }
445520
446            m_gfxdecode->gfx(0)->transpen(bitmap,cliprect,
521            m_gfxdecode->gfx(0)->transpen(bitmap, cliprect,
447522                     tile + (attr & 0x3)*0x100 + bank,
448523                     (attr >> 2) & 0xf,
449524                     flipx, flipy,
450                     sx, sy, 0xf);
525                     sx, sy, 0xf );
451526         }
452527      }
528   }
453529
530   if (write_mask)
531   {
532      // Fill the text sprites row with high priority for masking
533      int sy = (0xf0 - ypos) & 0xff;
534      if (flip_screen())
535         sy = max_y - sy - 8;
536      rectangle text_clip(cliprect.min_x, cliprect.max_x, sy, sy + 0x10 - 1);
537      text_clip &= cliprect;
538      screen.priority().fill(1, text_clip);
454539   }
455540}
456541
r249117r249118
464549
465550UINT32 suna8_state::screen_update_suna8(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
466551{
467   /* see hardhead, hardhea2 test mode (press button 2 for both players) */
552   // see hardhead, hardhea2 test mode (press button 2 for both players)
468553   bitmap.fill(0xff, cliprect);
469554
470555#ifdef MAME_DEBUG
r249117r249118
481566      if (machine().input().code_pressed_once(KEYCODE_S)) { m_trombank++; machine().tilemap().mark_all_dirty();   }
482567
483568      m_trombank  &=  0xf;
484      m_page      &=  m_text_dim ? 3 : (m_gfxdecode->gfx(1) ? 15 : 7);
569      m_page      &=  m_has_text ? 3 : (m_gfxdecode->gfx(1) ? 15 : 7);
485570      m_tiles     %=  max_tiles;
486571      if (m_tiles < 0) m_tiles += max_tiles;
487572
r249117r249118
493578                  m_rombank, m_palettebank, m_spritebank,
494579                  m_page, m_tiles, m_trombank);
495580#endif
581      return 0;
496582   }
497   else
498583#endif
499584#endif
500   {
501      // Normal sprites
502      draw_normal_sprites(bitmap,cliprect, 0);
503585
504      // More normal sprites (second sprite "chip" in sparkman)
505      if (m_gfxdecode->gfx(1))
506         draw_normal_sprites(bitmap,cliprect, 1);
586   // Sprites
587   draw_sprites(screen, bitmap, cliprect, 0x1d00, 0x2000, 0);
507588
508      // Text sprites (earlier games only)
509      if (m_text_dim)
510         draw_text_sprites(bitmap,cliprect);
511   }
589   // More sprites (second sprite "chip" in sparkman)
590   if (m_gfxdecode->gfx(1))
591      draw_sprites(screen, bitmap, cliprect, 0x1d00, 0x2000, 1);
592
512593   return 0;
513594}
trunk/src/mess/drivers/apple2.c
r249117r249118
12661266   MCFG_DEVICE_ADD(A2_VIDEO_TAG, APPLE2_VIDEO, XTAL_14_31818MHz)
12671267
12681268   MCFG_SCREEN_ADD("screen", RASTER)
1269   MCFG_SCREEN_REFRESH_RATE(60)
1270   MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)) /* not accurate */
1271   MCFG_SCREEN_SIZE(280*2, 262)
1272   MCFG_SCREEN_VISIBLE_AREA(0, (280*2)-1,0,192-1)
1269   MCFG_SCREEN_RAW_PARAMS(1021800*14, (65*7)*2, 0, (40*7)*2, 262, 0, 192)
12731270   MCFG_SCREEN_UPDATE_DRIVER(napple2_state, screen_update)
12741271   MCFG_SCREEN_PALETTE("palette")
12751272
trunk/src/mess/drivers/apple2e.c
r249117r249118
30373037   MCFG_DEVICE_ADD(A2_VIDEO_TAG, APPLE2_VIDEO, XTAL_14_31818MHz)
30383038
30393039   MCFG_SCREEN_ADD("screen", RASTER)
3040   MCFG_SCREEN_REFRESH_RATE(60)
3041   MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)) /* not accurate */
3042   MCFG_SCREEN_SIZE(280*2, 262)
3043   MCFG_SCREEN_VISIBLE_AREA(0, (280*2)-1,0,192-1)
3040   MCFG_SCREEN_RAW_PARAMS(1021800*14, (65*7)*2, 0, (40*7)*2, 262, 0, 192)
30443041   MCFG_SCREEN_UPDATE_DRIVER(apple2e_state, screen_update)
30453042   MCFG_SCREEN_PALETTE("palette")
30463043


Previous 199869 Revisions Next


© 1997-2024 The MAME Team