Previous 199869 Revisions Next

r20069 Saturday 5th January, 2013 at 03:22:24 UTC by David Haywood
let's attempt something a bit different here, and be brave, use it for everything (nw)
[src/mame/drivers]blueprnt.c
[src/mame/includes]blueprnt.h
[src/mame/video]blueprnt.c

trunk/src/mame/includes/blueprnt.h
r20068r20069
3939   DECLARE_WRITE8_MEMBER(blueprnt_flipscreen_w);
4040   DECLARE_WRITE8_MEMBER(dipsw_w);
4141   TILE_GET_INFO_MEMBER(get_bg_tile_info);
42   TILE_GET_INFO_MEMBER(get_bg_tile_info_grasspin);
4342   virtual void machine_start();
4443   virtual void machine_reset();
4544   DECLARE_VIDEO_START(blueprnt);
46   DECLARE_VIDEO_START(grasspin);
4745   virtual void palette_init();
4846   UINT32 screen_update_blueprnt(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
4947};
trunk/src/mame/video/blueprnt.c
r20068r20069
5656{
5757   m_colorram[offset] = data;
5858   m_bg_tilemap->mark_tile_dirty(offset);
59
60   offset-=32;
61   offset &=0x3ff;
62   m_bg_tilemap->mark_tile_dirty(offset);
63
64   offset+=64;
65   offset &=0x3ff;
66   m_bg_tilemap->mark_tile_dirty(offset);
67
68
5969}
6070
6171WRITE8_MEMBER(blueprnt_state::blueprnt_flipscreen_w)
r20068r20069
6979   }
7080}
7181
82
83
7284TILE_GET_INFO_MEMBER(blueprnt_state::get_bg_tile_info)
7385{
7486   int attr = m_colorram[tile_index];
75   int code = m_videoram[tile_index] + 256 * m_gfx_bank;
76   int color = attr & 0x7f;
87   int bank;
7788
78   tileinfo.category = (attr & 0x80) ? 1 : 0;
89   // It looks like the upper bank attribute bit (at least) comes from the previous tile read.
90   // Obviously if the screen is flipped the previous tile the hardware would read is different
91   // to the previous tile when it's not flipped hence the if (flip_screen()) logic
92   //
93   // note, one line still ends up darkened in the cocktail mode of grasspin, but on the real
94   // hardware there was no observable brightness difference between any part of the screen so
95   // I'm not convinced the brightness implementation is correct anyway, it might simply be
96   // tied to the use of upper / lower tiles or priority instead?
97   if (flip_screen())
98   {
99      bank = m_colorram[(tile_index+32)&0x3ff] & 0x40;
100   }
101   else
102   {
103      bank = m_colorram[(tile_index-32)&0x3ff] & 0x40;
104   }
79105
80   SET_TILE_INFO_MEMBER(0, code, color, 0);
81}
82
83// really not sure about this but Grasspin doesn't write the tilebank
84// or flipscreen after startup...  this certainly doesn't work for 'Saturn'
85TILE_GET_INFO_MEMBER(blueprnt_state::get_bg_tile_info_grasspin)
86{
87   int attr = m_colorram[tile_index];
88106   int code = m_videoram[tile_index];
89107   int color = attr & 0x7f;
90108
91109   tileinfo.category = (attr & 0x80) ? 1 : 0;
92   if ((attr & 0x40)) code += 0x100;
110   if (bank) code += m_gfx_bank * 0x100;
93111
94112   SET_TILE_INFO_MEMBER(0, code, color, 0);
95113}
r20068r20069
105123   save_item(NAME(m_gfx_bank));
106124}
107125
108VIDEO_START_MEMBER(blueprnt_state,grasspin)
109{
110   m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(blueprnt_state::get_bg_tile_info_grasspin),this), TILEMAP_SCAN_COLS_FLIP_X, 8, 8, 32, 32);
111   m_bg_tilemap->set_transparent_pen(0);
112   m_bg_tilemap->set_scroll_cols(32);
113126
114   save_item(NAME(m_gfx_bank));
115}
116
117
118127static void draw_sprites( running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect )
119128{
120129   blueprnt_state *state = machine.driver_data<blueprnt_state>();
trunk/src/mame/drivers/blueprnt.c
r20068r20069
405405   /* basic machine hardware */
406406   MCFG_CPU_MODIFY("maincpu")
407407   MCFG_CPU_PROGRAM_MAP(grasspin_map)
408
409   /* video hardware */
410   MCFG_VIDEO_START_OVERRIDE(blueprnt_state, grasspin)
411408MACHINE_CONFIG_END
412409
413410/*************************************

Previous 199869 Revisions Next


© 1997-2024 The MAME Team