trunk/src/mame/includes/blueprnt.h
| r20068 | r20069 | |
| 39 | 39 | DECLARE_WRITE8_MEMBER(blueprnt_flipscreen_w); |
| 40 | 40 | DECLARE_WRITE8_MEMBER(dipsw_w); |
| 41 | 41 | TILE_GET_INFO_MEMBER(get_bg_tile_info); |
| 42 | | TILE_GET_INFO_MEMBER(get_bg_tile_info_grasspin); |
| 43 | 42 | virtual void machine_start(); |
| 44 | 43 | virtual void machine_reset(); |
| 45 | 44 | DECLARE_VIDEO_START(blueprnt); |
| 46 | | DECLARE_VIDEO_START(grasspin); |
| 47 | 45 | virtual void palette_init(); |
| 48 | 46 | UINT32 screen_update_blueprnt(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
| 49 | 47 | }; |
trunk/src/mame/video/blueprnt.c
| r20068 | r20069 | |
| 56 | 56 | { |
| 57 | 57 | m_colorram[offset] = data; |
| 58 | 58 | 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 | |
| 59 | 69 | } |
| 60 | 70 | |
| 61 | 71 | WRITE8_MEMBER(blueprnt_state::blueprnt_flipscreen_w) |
| r20068 | r20069 | |
| 69 | 79 | } |
| 70 | 80 | } |
| 71 | 81 | |
| 82 | |
| 83 | |
| 72 | 84 | TILE_GET_INFO_MEMBER(blueprnt_state::get_bg_tile_info) |
| 73 | 85 | { |
| 74 | 86 | 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; |
| 77 | 88 | |
| 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 | } |
| 79 | 105 | |
| 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' |
| 85 | | TILE_GET_INFO_MEMBER(blueprnt_state::get_bg_tile_info_grasspin) |
| 86 | | { |
| 87 | | int attr = m_colorram[tile_index]; |
| 88 | 106 | int code = m_videoram[tile_index]; |
| 89 | 107 | int color = attr & 0x7f; |
| 90 | 108 | |
| 91 | 109 | tileinfo.category = (attr & 0x80) ? 1 : 0; |
| 92 | | if ((attr & 0x40)) code += 0x100; |
| 110 | if (bank) code += m_gfx_bank * 0x100; |
| 93 | 111 | |
| 94 | 112 | SET_TILE_INFO_MEMBER(0, code, color, 0); |
| 95 | 113 | } |
| r20068 | r20069 | |
| 105 | 123 | save_item(NAME(m_gfx_bank)); |
| 106 | 124 | } |
| 107 | 125 | |
| 108 | | VIDEO_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); |
| 113 | 126 | |
| 114 | | save_item(NAME(m_gfx_bank)); |
| 115 | | } |
| 116 | | |
| 117 | | |
| 118 | 127 | static void draw_sprites( running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect ) |
| 119 | 128 | { |
| 120 | 129 | blueprnt_state *state = machine.driver_data<blueprnt_state>(); |