trunk/src/mame/video/jackal.c
| r20829 | r20830 | |
| 40 | 40 | } |
| 41 | 41 | |
| 42 | 42 | |
| 43 | | static void set_pens( running_machine &machine ) |
| 43 | void jackal_state::set_pens( ) |
| 44 | 44 | { |
| 45 | | jackal_state *state = machine.driver_data<jackal_state>(); |
| 46 | 45 | int i; |
| 47 | 46 | |
| 48 | 47 | for (i = 0; i < 0x400; i += 2) |
| 49 | 48 | { |
| 50 | | UINT16 data = state->m_paletteram[i] | (state->m_paletteram[i | 1] << 8); |
| 49 | UINT16 data = m_paletteram[i] | (m_paletteram[i | 1] << 8); |
| 51 | 50 | |
| 52 | 51 | rgb_t color = MAKE_RGB(pal5bit(data >> 0), pal5bit(data >> 5), pal5bit(data >> 10)); |
| 53 | 52 | |
| 54 | | colortable_palette_set_color(machine.colortable, i >> 1, color); |
| 53 | colortable_palette_set_color(machine().colortable, i >> 1, color); |
| 55 | 54 | } |
| 56 | 55 | } |
| 57 | 56 | |
| 58 | 57 | |
| 59 | | void jackal_mark_tile_dirty( running_machine &machine, int offset ) |
| 58 | void jackal_state::jackal_mark_tile_dirty( int offset ) |
| 60 | 59 | { |
| 61 | | jackal_state *state = machine.driver_data<jackal_state>(); |
| 62 | | state->m_bg_tilemap->mark_tile_dirty(offset); |
| 60 | m_bg_tilemap->mark_tile_dirty(offset); |
| 63 | 61 | } |
| 64 | 62 | |
| 65 | 63 | TILE_GET_INFO_MEMBER(jackal_state::get_bg_tile_info) |
| r20829 | r20830 | |
| 79 | 77 | m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(jackal_state::get_bg_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32); |
| 80 | 78 | } |
| 81 | 79 | |
| 82 | | static void draw_background( running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect ) |
| 80 | void jackal_state::draw_background( bitmap_ind16 &bitmap, const rectangle &cliprect ) |
| 83 | 81 | { |
| 84 | | jackal_state *state = machine.driver_data<jackal_state>(); |
| 85 | | UINT8 *RAM = state->memregion("master")->base(); |
| 82 | UINT8 *RAM = memregion("master")->base(); |
| 86 | 83 | int i; |
| 87 | 84 | |
| 88 | | state->m_scrollram = &RAM[0x0020]; |
| 85 | m_scrollram = &RAM[0x0020]; |
| 89 | 86 | |
| 90 | | state->m_bg_tilemap->set_scroll_rows(1); |
| 91 | | state->m_bg_tilemap->set_scroll_cols(1); |
| 87 | m_bg_tilemap->set_scroll_rows(1); |
| 88 | m_bg_tilemap->set_scroll_cols(1); |
| 92 | 89 | |
| 93 | | state->m_bg_tilemap->set_scrolly(0, state->m_videoctrl[0]); |
| 94 | | state->m_bg_tilemap->set_scrollx(0, state->m_videoctrl[1]); |
| 90 | m_bg_tilemap->set_scrolly(0, m_videoctrl[0]); |
| 91 | m_bg_tilemap->set_scrollx(0, m_videoctrl[1]); |
| 95 | 92 | |
| 96 | | if (state->m_videoctrl[2] & 0x02) |
| 93 | if (m_videoctrl[2] & 0x02) |
| 97 | 94 | { |
| 98 | | if (state->m_videoctrl[2] & 0x08) |
| 95 | if (m_videoctrl[2] & 0x08) |
| 99 | 96 | { |
| 100 | | state->m_bg_tilemap->set_scroll_rows(32); |
| 97 | m_bg_tilemap->set_scroll_rows(32); |
| 101 | 98 | |
| 102 | 99 | for (i = 0; i < 32; i++) |
| 103 | | state->m_bg_tilemap->set_scrollx(i, state->m_scrollram[i]); |
| 100 | m_bg_tilemap->set_scrollx(i, m_scrollram[i]); |
| 104 | 101 | } |
| 105 | 102 | |
| 106 | | if (state->m_videoctrl[2] & 0x04) |
| 103 | if (m_videoctrl[2] & 0x04) |
| 107 | 104 | { |
| 108 | | state->m_bg_tilemap->set_scroll_cols(32); |
| 105 | m_bg_tilemap->set_scroll_cols(32); |
| 109 | 106 | |
| 110 | 107 | for (i = 0; i < 32; i++) |
| 111 | | state->m_bg_tilemap->set_scrolly(i, state->m_scrollram[i]); |
| 108 | m_bg_tilemap->set_scrolly(i, m_scrollram[i]); |
| 112 | 109 | } |
| 113 | 110 | } |
| 114 | 111 | |
| 115 | | state->m_bg_tilemap->draw(bitmap, cliprect, 0, 0); |
| 112 | m_bg_tilemap->draw(bitmap, cliprect, 0, 0); |
| 116 | 113 | } |
| 117 | 114 | |
| 118 | | #define DRAW_SPRITE(bank, code, sx, sy) drawgfx_transpen(bitmap, cliprect, machine.gfx[bank], code, color, flipx, flipy, sx, sy, 0); |
| 115 | #define DRAW_SPRITE(bank, code, sx, sy) drawgfx_transpen(bitmap, cliprect, machine().gfx[bank], code, color, flipx, flipy, sx, sy, 0); |
| 119 | 116 | |
| 120 | | static void draw_sprites_region( running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect, const UINT8 *sram, int length, int bank ) |
| 117 | void jackal_state::draw_sprites_region( bitmap_ind16 &bitmap, const rectangle &cliprect, const UINT8 *sram, int length, int bank ) |
| 121 | 118 | { |
| 122 | | jackal_state *state = machine.driver_data<jackal_state>(); |
| 123 | 119 | int offs; |
| 124 | 120 | |
| 125 | 121 | for (offs = 0; offs < length; offs += 5) |
| r20829 | r20830 | |
| 138 | 134 | if (sy > 0xf0) |
| 139 | 135 | sy = sy - 256; |
| 140 | 136 | |
| 141 | | if (state->flip_screen()) |
| 137 | if (flip_screen()) |
| 142 | 138 | { |
| 143 | 139 | sx = 240 - sx; |
| 144 | 140 | sy = 240 - sy; |
| r20829 | r20830 | |
| 151 | 147 | int spritenum = sn1 * 4 + ((sn2 & (8 + 4)) >> 2) + ((sn2 & (2 + 1)) << 10); |
| 152 | 148 | int mod = -8; |
| 153 | 149 | |
| 154 | | if (state->flip_screen()) |
| 150 | if (flip_screen()) |
| 155 | 151 | { |
| 156 | 152 | sx += 8; |
| 157 | 153 | sy -= 8; |
| r20829 | r20830 | |
| 160 | 156 | |
| 161 | 157 | if ((attr & 0x0C) == 0x0C) |
| 162 | 158 | { |
| 163 | | if (state->flip_screen()) sy += 16; |
| 159 | if (flip_screen()) sy += 16; |
| 164 | 160 | DRAW_SPRITE(bank + 1, spritenum, sx, sy) |
| 165 | 161 | } |
| 166 | 162 | |
| r20829 | r20830 | |
| 183 | 179 | |
| 184 | 180 | if (attr & 0x10) |
| 185 | 181 | { |
| 186 | | if (state->flip_screen()) |
| 182 | if (flip_screen()) |
| 187 | 183 | { |
| 188 | 184 | sx -= 16; |
| 189 | 185 | sy -= 16; |
| r20829 | r20830 | |
| 202 | 198 | } |
| 203 | 199 | } |
| 204 | 200 | |
| 205 | | static void draw_sprites( running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect ) |
| 201 | void jackal_state::draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect ) |
| 206 | 202 | { |
| 207 | | jackal_state *state = machine.driver_data<jackal_state>(); |
| 208 | | UINT8 *RAM = state->memregion("master")->base(); |
| 203 | UINT8 *RAM = memregion("master")->base(); |
| 209 | 204 | UINT8 *sr, *ss; |
| 210 | 205 | |
| 211 | | if (state->m_videoctrl[0x03] & 0x08) |
| 206 | if (m_videoctrl[0x03] & 0x08) |
| 212 | 207 | { |
| 213 | 208 | sr = &RAM[0x03800]; // Sprite 2 |
| 214 | 209 | ss = &RAM[0x13800]; // Additional Sprite 2 |
| r20829 | r20830 | |
| 219 | 214 | ss = &RAM[0x13000]; // Additional Sprite 1 |
| 220 | 215 | } |
| 221 | 216 | |
| 222 | | draw_sprites_region(machine, bitmap, cliprect, ss, 0x0f5, 3); |
| 223 | | draw_sprites_region(machine, bitmap, cliprect, sr, 0x500, 1); |
| 217 | draw_sprites_region(bitmap, cliprect, ss, 0x0f5, 3); |
| 218 | draw_sprites_region(bitmap, cliprect, sr, 0x500, 1); |
| 224 | 219 | } |
| 225 | 220 | |
| 226 | 221 | UINT32 jackal_state::screen_update_jackal(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) |
| 227 | 222 | { |
| 228 | | set_pens(machine()); |
| 229 | | draw_background(machine(), bitmap, cliprect); |
| 230 | | draw_sprites(machine(), bitmap, cliprect); |
| 223 | set_pens(); |
| 224 | draw_background(bitmap, cliprect); |
| 225 | draw_sprites(bitmap, cliprect); |
| 231 | 226 | return 0; |
| 232 | 227 | } |
trunk/src/mame/video/jack.c
| r20829 | r20830 | |
| 67 | 67 | |
| 68 | 68 | /**************************************************************************/ |
| 69 | 69 | |
| 70 | | static void jack_draw_sprites( running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect ) |
| 70 | void jack_state::jack_draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect ) |
| 71 | 71 | { |
| 72 | | jack_state *state = machine.driver_data<jack_state>(); |
| 73 | | UINT8 *spriteram = state->m_spriteram; |
| 72 | UINT8 *spriteram = m_spriteram; |
| 74 | 73 | int offs; |
| 75 | 74 | |
| 76 | | for (offs = state->m_spriteram.bytes() - 4; offs >= 0; offs -= 4) |
| 75 | for (offs = m_spriteram.bytes() - 4; offs >= 0; offs -= 4) |
| 77 | 76 | { |
| 78 | 77 | int sy = spriteram[offs]; |
| 79 | 78 | int sx = spriteram[offs + 1]; |
| r20829 | r20830 | |
| 82 | 81 | int flipx = (spriteram[offs + 3] & 0x80) >> 7; |
| 83 | 82 | int flipy = (spriteram[offs + 3] & 0x40) >> 6; |
| 84 | 83 | |
| 85 | | if (state->flip_screen()) |
| 84 | if (flip_screen()) |
| 86 | 85 | { |
| 87 | 86 | sx = 248 - sx; |
| 88 | 87 | sy = 248 - sy; |
| r20829 | r20830 | |
| 90 | 89 | flipy = !flipy; |
| 91 | 90 | } |
| 92 | 91 | |
| 93 | | drawgfx_transpen(bitmap,cliprect,machine.gfx[0], |
| 92 | drawgfx_transpen(bitmap,cliprect,machine().gfx[0], |
| 94 | 93 | code, |
| 95 | 94 | color, |
| 96 | 95 | flipx,flipy, |
| r20829 | r20830 | |
| 101 | 100 | UINT32 jack_state::screen_update_jack(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) |
| 102 | 101 | { |
| 103 | 102 | m_bg_tilemap->draw(bitmap, cliprect, 0, 0); |
| 104 | | jack_draw_sprites(machine(), bitmap, cliprect); |
| 103 | jack_draw_sprites(bitmap, cliprect); |
| 105 | 104 | return 0; |
| 106 | 105 | } |
| 107 | 106 | |
| r20829 | r20830 | |
| 188 | 187 | |
| 189 | 188 | /**************************************************************************/ |
| 190 | 189 | |
| 191 | | static void joinem_draw_sprites( running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect ) |
| 190 | void jack_state::joinem_draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect ) |
| 192 | 191 | { |
| 193 | | jack_state *state = machine.driver_data<jack_state>(); |
| 194 | | UINT8 *spriteram = state->m_spriteram; |
| 192 | UINT8 *spriteram = m_spriteram; |
| 195 | 193 | int offs; |
| 196 | 194 | |
| 197 | | for (offs = state->m_spriteram.bytes() - 4; offs >= 0; offs -= 4) |
| 195 | for (offs = m_spriteram.bytes() - 4; offs >= 0; offs -= 4) |
| 198 | 196 | { |
| 199 | 197 | int sy = spriteram[offs]; |
| 200 | 198 | int sx = spriteram[offs + 1]; |
| 201 | 199 | int code = spriteram[offs + 2] | ((spriteram[offs + 3] & 0x03) << 8); |
| 202 | | int color = (spriteram[offs + 3] & 0x38) >> 3 | state->m_joinem_palette_bank; |
| 200 | int color = (spriteram[offs + 3] & 0x38) >> 3 | m_joinem_palette_bank; |
| 203 | 201 | int flipx = (spriteram[offs + 3] & 0x80) >> 7; |
| 204 | 202 | int flipy = (spriteram[offs + 3] & 0x40) >> 6; |
| 205 | 203 | |
| 206 | | if (state->flip_screen()) |
| 204 | if (flip_screen()) |
| 207 | 205 | { |
| 208 | 206 | sx = 248 - sx; |
| 209 | 207 | sy = 248 - sy; |
| r20829 | r20830 | |
| 211 | 209 | flipy = !flipy; |
| 212 | 210 | } |
| 213 | 211 | |
| 214 | | drawgfx_transpen(bitmap,cliprect,machine.gfx[0], |
| 212 | drawgfx_transpen(bitmap,cliprect,machine().gfx[0], |
| 215 | 213 | code, |
| 216 | 214 | color, |
| 217 | 215 | flipx,flipy, |
| r20829 | r20830 | |
| 222 | 220 | UINT32 jack_state::screen_update_joinem(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) |
| 223 | 221 | { |
| 224 | 222 | m_bg_tilemap->draw(bitmap, cliprect, 0, 0); |
| 225 | | joinem_draw_sprites(machine(), bitmap, cliprect); |
| 223 | joinem_draw_sprites(bitmap, cliprect); |
| 226 | 224 | return 0; |
| 227 | 225 | } |
trunk/src/mame/video/jailbrek.c
| r20829 | r20830 | |
| 62 | 62 | m_bg_tilemap->set_scrolldx(0, 396 - 256); |
| 63 | 63 | } |
| 64 | 64 | |
| 65 | | static void draw_sprites( running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect ) |
| 65 | void jailbrek_state::draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect ) |
| 66 | 66 | { |
| 67 | | jailbrek_state *state = machine.driver_data<jailbrek_state>(); |
| 68 | | UINT8 *spriteram = state->m_spriteram; |
| 67 | UINT8 *spriteram = m_spriteram; |
| 69 | 68 | int i; |
| 70 | 69 | |
| 71 | | for (i = 0; i < state->m_spriteram.bytes(); i += 4) |
| 70 | for (i = 0; i < m_spriteram.bytes(); i += 4) |
| 72 | 71 | { |
| 73 | 72 | int attr = spriteram[i + 1]; // attributes = ?tyxcccc |
| 74 | 73 | int code = spriteram[i] + ((attr & 0x40) << 2); |
| r20829 | r20830 | |
| 78 | 77 | int sx = spriteram[i + 2] - ((attr & 0x80) << 1); |
| 79 | 78 | int sy = spriteram[i + 3]; |
| 80 | 79 | |
| 81 | | if (state->flip_screen()) |
| 80 | if (flip_screen()) |
| 82 | 81 | { |
| 83 | 82 | sx = 240 - sx; |
| 84 | 83 | sy = 240 - sy; |
| r20829 | r20830 | |
| 86 | 85 | flipy = !flipy; |
| 87 | 86 | } |
| 88 | 87 | |
| 89 | | drawgfx_transmask(bitmap, cliprect, machine.gfx[1], code, color, flipx, flipy, |
| 88 | drawgfx_transmask(bitmap, cliprect, machine().gfx[1], code, color, flipx, flipy, |
| 90 | 89 | sx, sy, |
| 91 | | colortable_get_transpen_mask(machine.colortable, machine.gfx[1], color, 0)); |
| 90 | colortable_get_transpen_mask(machine().colortable, machine().gfx[1], color, 0)); |
| 92 | 91 | } |
| 93 | 92 | } |
| 94 | 93 | |
| r20829 | r20830 | |
| 118 | 117 | } |
| 119 | 118 | |
| 120 | 119 | m_bg_tilemap->draw(bitmap, cliprect, 0, 0); |
| 121 | | draw_sprites(machine(), bitmap, cliprect); |
| 120 | draw_sprites(bitmap, cliprect); |
| 122 | 121 | return 0; |
| 123 | 122 | } |
trunk/src/mame/video/jedi.c
| r20829 | r20830 | |
| 63 | 63 | * |
| 64 | 64 | *************************************/ |
| 65 | 65 | |
| 66 | | static void get_pens(jedi_state *state, pen_t *pens) |
| 66 | void jedi_state::get_pens(pen_t *pens) |
| 67 | 67 | { |
| 68 | 68 | offs_t offs; |
| 69 | 69 | |
| r20829 | r20830 | |
| 71 | 71 | { |
| 72 | 72 | int r, g, b, bits, intensity; |
| 73 | 73 | |
| 74 | | UINT16 color = state->m_paletteram[offs] | (state->m_paletteram[offs | 0x400] << 8); |
| 74 | UINT16 color = m_paletteram[offs] | (m_paletteram[offs | 0x400] << 8); |
| 75 | 75 | |
| 76 | 76 | intensity = (color >> 9) & 7; |
| 77 | 77 | bits = (color >> 6) & 7; |
| r20829 | r20830 | |
| 86 | 86 | } |
| 87 | 87 | |
| 88 | 88 | |
| 89 | | static void do_pen_lookup(jedi_state *state, bitmap_rgb32 &bitmap, const rectangle &cliprect) |
| 89 | void jedi_state::do_pen_lookup(bitmap_rgb32 &bitmap, const rectangle &cliprect) |
| 90 | 90 | { |
| 91 | 91 | int y, x; |
| 92 | 92 | pen_t pens[NUM_PENS]; |
| 93 | 93 | |
| 94 | | get_pens(state, pens); |
| 94 | get_pens(pens); |
| 95 | 95 | |
| 96 | 96 | for (y = cliprect.min_y; y <= cliprect.max_y; y++) |
| 97 | 97 | for(x = cliprect.min_x; x <= cliprect.max_x; x++) |
| r20829 | r20830 | |
| 126 | 126 | * |
| 127 | 127 | *************************************/ |
| 128 | 128 | |
| 129 | | static void draw_background_and_text(running_machine &machine, jedi_state *state, bitmap_rgb32 &bitmap, const rectangle &cliprect) |
| 129 | void jedi_state::draw_background_and_text(bitmap_rgb32 &bitmap, const rectangle &cliprect) |
| 130 | 130 | { |
| 131 | 131 | int y; |
| 132 | 132 | int background_line_buffer[0x200]; /* RAM chip at 2A */ |
| 133 | 133 | |
| 134 | | UINT8 *tx_gfx = machine.root_device().memregion("gfx1")->base(); |
| 135 | | UINT8 *bg_gfx = machine.root_device().memregion("gfx2")->base(); |
| 136 | | UINT8 *prom1 = &machine.root_device().memregion("proms")->base()[0x0000 | ((*state->m_smoothing_table & 0x03) << 8)]; |
| 137 | | UINT8 *prom2 = &machine.root_device().memregion("proms")->base()[0x0800 | ((*state->m_smoothing_table & 0x03) << 8)]; |
| 138 | | int vscroll = state->m_vscroll; |
| 139 | | int hscroll = state->m_hscroll; |
| 140 | | int tx_bank = *state->m_foreground_bank; |
| 141 | | UINT8 *tx_ram = state->m_foregroundram; |
| 142 | | UINT8 *bg_ram = state->m_backgroundram; |
| 134 | UINT8 *tx_gfx = machine().root_device().memregion("gfx1")->base(); |
| 135 | UINT8 *bg_gfx = machine().root_device().memregion("gfx2")->base(); |
| 136 | UINT8 *prom1 = &machine().root_device().memregion("proms")->base()[0x0000 | ((*m_smoothing_table & 0x03) << 8)]; |
| 137 | UINT8 *prom2 = &machine().root_device().memregion("proms")->base()[0x0800 | ((*m_smoothing_table & 0x03) << 8)]; |
| 138 | int vscroll = m_vscroll; |
| 139 | int hscroll = m_hscroll; |
| 140 | int tx_bank = *m_foreground_bank; |
| 141 | UINT8 *tx_ram = m_foregroundram; |
| 142 | UINT8 *bg_ram = m_backgroundram; |
| 143 | 143 | |
| 144 | 144 | memset(background_line_buffer, 0, 0x200 * sizeof(int)); |
| 145 | 145 | |
| r20829 | r20830 | |
| 226 | 226 | * |
| 227 | 227 | *************************************/ |
| 228 | 228 | |
| 229 | | static void draw_sprites(running_machine &machine, jedi_state *state, bitmap_rgb32 &bitmap, const rectangle &cliprect) |
| 229 | void jedi_state::draw_sprites(bitmap_rgb32 &bitmap, const rectangle &cliprect) |
| 230 | 230 | { |
| 231 | 231 | offs_t offs; |
| 232 | | UINT8 *spriteram = state->m_spriteram; |
| 233 | | UINT8 *gfx3 = machine.root_device().memregion("gfx3")->base(); |
| 232 | UINT8 *spriteram = m_spriteram; |
| 233 | UINT8 *gfx3 = machine().root_device().memregion("gfx3")->base(); |
| 234 | 234 | |
| 235 | 235 | for (offs = 0x00; offs < 0x30; offs++) |
| 236 | 236 | { |
| r20829 | r20830 | |
| 330 | 330 | { |
| 331 | 331 | /* draw the background/text layers, followed by the sprites |
| 332 | 332 | - it needs to be done in this order*/ |
| 333 | | draw_background_and_text(machine(), this, bitmap, cliprect); |
| 334 | | draw_sprites(machine(), this, bitmap, cliprect); |
| 335 | | do_pen_lookup(this, bitmap, cliprect); |
| 333 | draw_background_and_text(bitmap, cliprect); |
| 334 | draw_sprites(bitmap, cliprect); |
| 335 | do_pen_lookup(bitmap, cliprect); |
| 336 | 336 | } |
| 337 | 337 | |
| 338 | 338 | return 0; |
trunk/src/mame/drivers/jaguar.c
| r20829 | r20830 | |
| 434 | 434 | * |
| 435 | 435 | ********************************************************************/ |
| 436 | 436 | /* |
| 437 | | static emu_file *jaguar_nvram_fopen( running_machine &machine, UINT32 openflags) |
| 437 | emu_file jaguar_state::*jaguar_nvram_fopen( UINT32 openflags) |
| 438 | 438 | { |
| 439 | | device_image_interface *image = dynamic_cast<device_image_interface *>(machine.device("cart")); |
| 439 | device_image_interface *image = dynamic_cast<device_image_interface *>(machine().device("cart")); |
| 440 | 440 | file_error filerr; |
| 441 | 441 | emu_file *file; |
| 442 | 442 | if (image->exists()) |
| 443 | 443 | { |
| 444 | | astring fname(machine.system().name, PATH_SEPARATOR, image->basename_noext(), ".nv"); |
| 444 | astring fname(machine().system().name, PATH_SEPARATOR, image->basename_noext(), ".nv"); |
| 445 | 445 | filerr = mame_fopen( SEARCHPATH_NVRAM, fname, openflags, &file); |
| 446 | 446 | return (filerr == FILERR_NONE) ? file : NULL; |
| 447 | 447 | } |
| r20829 | r20830 | |
| 449 | 449 | return NULL; |
| 450 | 450 | } |
| 451 | 451 | |
| 452 | | static void jaguar_nvram_load(running_machine &machine) |
| 452 | void jaguar_state::jaguar_nvram_load() |
| 453 | 453 | { |
| 454 | 454 | emu_file *nvram_file = NULL; |
| 455 | 455 | device_t *device; |
| 456 | 456 | |
| 457 | | for (device = machine.m_devicelist.first(); device != NULL; device = device->next()) |
| 457 | for (device = machine().m_devicelist.first(); device != NULL; device = device->next()) |
| 458 | 458 | { |
| 459 | 459 | device_nvram_func nvram = (device_nvram_func)device->get_config_fct(DEVINFO_FCT_NVRAM); |
| 460 | 460 | if (nvram != NULL) |
| r20829 | r20830 | |
| 469 | 469 | } |
| 470 | 470 | |
| 471 | 471 | |
| 472 | | static void jaguar_nvram_save(running_machine &machine) |
| 472 | void jaguar_state::jaguar_nvram_save() |
| 473 | 473 | { |
| 474 | 474 | emu_file *nvram_file = NULL; |
| 475 | 475 | device_t *device; |
| 476 | 476 | |
| 477 | | for (device = machine.m_devicelist.first(); device != NULL; device = device->next()) |
| 477 | for (device = machine().m_devicelist.first(); device != NULL; device = device->next()) |
| 478 | 478 | { |
| 479 | 479 | device_nvram_func nvram = (device_nvram_func)device->get_config_fct(DEVINFO_FCT_NVRAM); |
| 480 | 480 | if (nvram != NULL) |