Previous 199869 Revisions Next

r20830 Friday 8th February, 2013 at 13:21:46 UTC by Miodrag Milanović
Modernization of drivers part 9 (no whatsnew)
[src/mame/drivers]jack.c jackal.c jaguar.c jpmimpct.c
[src/mame/includes]jack.h jackal.h jaguar.h jailbrek.h jedi.h jpmimpct.h
[src/mame/video]jack.c jackal.c jailbrek.c jedi.c

trunk/src/mame/video/jackal.c
r20829r20830
4040}
4141
4242
43static void set_pens( running_machine &machine )
43void jackal_state::set_pens(  )
4444{
45   jackal_state *state = machine.driver_data<jackal_state>();
4645   int i;
4746
4847   for (i = 0; i < 0x400; i += 2)
4948   {
50      UINT16 data = state->m_paletteram[i] | (state->m_paletteram[i | 1] << 8);
49      UINT16 data = m_paletteram[i] | (m_paletteram[i | 1] << 8);
5150
5251      rgb_t color = MAKE_RGB(pal5bit(data >> 0), pal5bit(data >> 5), pal5bit(data >> 10));
5352
54      colortable_palette_set_color(machine.colortable, i >> 1, color);
53      colortable_palette_set_color(machine().colortable, i >> 1, color);
5554   }
5655}
5756
5857
59void jackal_mark_tile_dirty( running_machine &machine, int offset )
58void jackal_state::jackal_mark_tile_dirty( int offset )
6059{
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);
6361}
6462
6563TILE_GET_INFO_MEMBER(jackal_state::get_bg_tile_info)
r20829r20830
7977   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);
8078}
8179
82static void draw_background( running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect )
80void jackal_state::draw_background( bitmap_ind16 &bitmap, const rectangle &cliprect )
8381{
84   jackal_state *state = machine.driver_data<jackal_state>();
85   UINT8 *RAM = state->memregion("master")->base();
82   UINT8 *RAM = memregion("master")->base();
8683   int i;
8784
88   state->m_scrollram = &RAM[0x0020];
85   m_scrollram = &RAM[0x0020];
8986
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);
9289
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]);
9592
96   if (state->m_videoctrl[2] & 0x02)
93   if (m_videoctrl[2] & 0x02)
9794   {
98      if (state->m_videoctrl[2] & 0x08)
95      if (m_videoctrl[2] & 0x08)
9996      {
100         state->m_bg_tilemap->set_scroll_rows(32);
97         m_bg_tilemap->set_scroll_rows(32);
10198
10299         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]);
104101      }
105102
106      if (state->m_videoctrl[2] & 0x04)
103      if (m_videoctrl[2] & 0x04)
107104      {
108         state->m_bg_tilemap->set_scroll_cols(32);
105         m_bg_tilemap->set_scroll_cols(32);
109106
110107         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]);
112109      }
113110   }
114111
115   state->m_bg_tilemap->draw(bitmap, cliprect, 0, 0);
112   m_bg_tilemap->draw(bitmap, cliprect, 0, 0);
116113}
117114
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);
119116
120static void draw_sprites_region( running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect, const UINT8 *sram, int length, int bank )
117void jackal_state::draw_sprites_region( bitmap_ind16 &bitmap, const rectangle &cliprect, const UINT8 *sram, int length, int bank )
121118{
122   jackal_state *state = machine.driver_data<jackal_state>();
123119   int offs;
124120
125121   for (offs = 0; offs < length; offs += 5)
r20829r20830
138134      if (sy > 0xf0)
139135         sy = sy - 256;
140136
141      if (state->flip_screen())
137      if (flip_screen())
142138      {
143139         sx = 240 - sx;
144140         sy = 240 - sy;
r20829r20830
151147         int spritenum = sn1 * 4 + ((sn2 & (8 + 4)) >> 2) + ((sn2 & (2 + 1)) << 10);
152148         int mod = -8;
153149
154         if (state->flip_screen())
150         if (flip_screen())
155151         {
156152            sx += 8;
157153            sy -= 8;
r20829r20830
160156
161157         if ((attr & 0x0C) == 0x0C)
162158         {
163            if (state->flip_screen()) sy += 16;
159            if (flip_screen()) sy += 16;
164160            DRAW_SPRITE(bank + 1, spritenum, sx, sy)
165161         }
166162
r20829r20830
183179
184180         if (attr & 0x10)
185181         {
186            if (state->flip_screen())
182            if (flip_screen())
187183            {
188184               sx -= 16;
189185               sy -= 16;
r20829r20830
202198   }
203199}
204200
205static void draw_sprites( running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect )
201void jackal_state::draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect )
206202{
207   jackal_state *state = machine.driver_data<jackal_state>();
208   UINT8 *RAM = state->memregion("master")->base();
203   UINT8 *RAM = memregion("master")->base();
209204   UINT8 *sr, *ss;
210205
211   if (state->m_videoctrl[0x03] & 0x08)
206   if (m_videoctrl[0x03] & 0x08)
212207   {
213208      sr = &RAM[0x03800]; // Sprite 2
214209      ss = &RAM[0x13800]; // Additional Sprite 2
r20829r20830
219214      ss = &RAM[0x13000]; // Additional Sprite 1
220215   }
221216
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);
224219}
225220
226221UINT32 jackal_state::screen_update_jackal(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
227222{
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);
231226   return 0;
232227}
trunk/src/mame/video/jack.c
r20829r20830
6767
6868/**************************************************************************/
6969
70static void jack_draw_sprites( running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect )
70void jack_state::jack_draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect )
7171{
72   jack_state *state = machine.driver_data<jack_state>();
73   UINT8 *spriteram = state->m_spriteram;
72   UINT8 *spriteram = m_spriteram;
7473   int offs;
7574
76   for (offs = state->m_spriteram.bytes() - 4; offs >= 0; offs -= 4)
75   for (offs = m_spriteram.bytes() - 4; offs >= 0; offs -= 4)
7776   {
7877      int sy = spriteram[offs];
7978      int sx = spriteram[offs + 1];
r20829r20830
8281      int flipx = (spriteram[offs + 3] & 0x80) >> 7;
8382      int flipy = (spriteram[offs + 3] & 0x40) >> 6;
8483
85      if (state->flip_screen())
84      if (flip_screen())
8685      {
8786         sx = 248 - sx;
8887         sy = 248 - sy;
r20829r20830
9089         flipy = !flipy;
9190      }
9291
93      drawgfx_transpen(bitmap,cliprect,machine.gfx[0],
92      drawgfx_transpen(bitmap,cliprect,machine().gfx[0],
9493            code,
9594            color,
9695            flipx,flipy,
r20829r20830
101100UINT32 jack_state::screen_update_jack(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
102101{
103102   m_bg_tilemap->draw(bitmap, cliprect, 0, 0);
104   jack_draw_sprites(machine(), bitmap, cliprect);
103   jack_draw_sprites(bitmap, cliprect);
105104   return 0;
106105}
107106
r20829r20830
188187
189188/**************************************************************************/
190189
191static void joinem_draw_sprites( running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect )
190void jack_state::joinem_draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect )
192191{
193   jack_state *state = machine.driver_data<jack_state>();
194   UINT8 *spriteram = state->m_spriteram;
192   UINT8 *spriteram = m_spriteram;
195193   int offs;
196194
197   for (offs = state->m_spriteram.bytes() - 4; offs >= 0; offs -= 4)
195   for (offs = m_spriteram.bytes() - 4; offs >= 0; offs -= 4)
198196   {
199197      int sy = spriteram[offs];
200198      int sx = spriteram[offs + 1];
201199      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;
203201      int flipx = (spriteram[offs + 3] & 0x80) >> 7;
204202      int flipy = (spriteram[offs + 3] & 0x40) >> 6;
205203
206      if (state->flip_screen())
204      if (flip_screen())
207205      {
208206         sx = 248 - sx;
209207         sy = 248 - sy;
r20829r20830
211209         flipy = !flipy;
212210      }
213211
214      drawgfx_transpen(bitmap,cliprect,machine.gfx[0],
212      drawgfx_transpen(bitmap,cliprect,machine().gfx[0],
215213            code,
216214            color,
217215            flipx,flipy,
r20829r20830
222220UINT32 jack_state::screen_update_joinem(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
223221{
224222   m_bg_tilemap->draw(bitmap, cliprect, 0, 0);
225   joinem_draw_sprites(machine(), bitmap, cliprect);
223   joinem_draw_sprites(bitmap, cliprect);
226224   return 0;
227225}
trunk/src/mame/video/jailbrek.c
r20829r20830
6262   m_bg_tilemap->set_scrolldx(0, 396 - 256);
6363}
6464
65static void draw_sprites( running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect )
65void jailbrek_state::draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect )
6666{
67   jailbrek_state *state = machine.driver_data<jailbrek_state>();
68   UINT8 *spriteram = state->m_spriteram;
67   UINT8 *spriteram = m_spriteram;
6968   int i;
7069
71   for (i = 0; i < state->m_spriteram.bytes(); i += 4)
70   for (i = 0; i < m_spriteram.bytes(); i += 4)
7271   {
7372      int attr = spriteram[i + 1];    // attributes = ?tyxcccc
7473      int code = spriteram[i] + ((attr & 0x40) << 2);
r20829r20830
7877      int sx = spriteram[i + 2] - ((attr & 0x80) << 1);
7978      int sy = spriteram[i + 3];
8079
81      if (state->flip_screen())
80      if (flip_screen())
8281      {
8382         sx = 240 - sx;
8483         sy = 240 - sy;
r20829r20830
8685         flipy = !flipy;
8786      }
8887
89      drawgfx_transmask(bitmap, cliprect, machine.gfx[1], code, color, flipx, flipy,
88      drawgfx_transmask(bitmap, cliprect, machine().gfx[1], code, color, flipx, flipy,
9089         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));
9291   }
9392}
9493
r20829r20830
118117   }
119118
120119   m_bg_tilemap->draw(bitmap, cliprect, 0, 0);
121   draw_sprites(machine(), bitmap, cliprect);
120   draw_sprites(bitmap, cliprect);
122121   return 0;
123122}
trunk/src/mame/video/jedi.c
r20829r20830
6363 *
6464 *************************************/
6565
66static void get_pens(jedi_state *state, pen_t *pens)
66void jedi_state::get_pens(pen_t *pens)
6767{
6868   offs_t offs;
6969
r20829r20830
7171   {
7272      int r, g, b, bits, intensity;
7373
74      UINT16 color = state->m_paletteram[offs] | (state->m_paletteram[offs | 0x400] << 8);
74      UINT16 color = m_paletteram[offs] | (m_paletteram[offs | 0x400] << 8);
7575
7676      intensity = (color >> 9) & 7;
7777      bits = (color >> 6) & 7;
r20829r20830
8686}
8787
8888
89static void do_pen_lookup(jedi_state *state, bitmap_rgb32 &bitmap, const rectangle &cliprect)
89void jedi_state::do_pen_lookup(bitmap_rgb32 &bitmap, const rectangle &cliprect)
9090{
9191   int y, x;
9292   pen_t pens[NUM_PENS];
9393
94   get_pens(state, pens);
94   get_pens(pens);
9595
9696   for (y = cliprect.min_y; y <= cliprect.max_y; y++)
9797      for(x = cliprect.min_x; x <= cliprect.max_x; x++)
r20829r20830
126126 *
127127 *************************************/
128128
129static void draw_background_and_text(running_machine &machine, jedi_state *state, bitmap_rgb32 &bitmap, const rectangle &cliprect)
129void jedi_state::draw_background_and_text(bitmap_rgb32 &bitmap, const rectangle &cliprect)
130130{
131131   int y;
132132   int background_line_buffer[0x200];  /* RAM chip at 2A */
133133
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;
143143
144144   memset(background_line_buffer, 0, 0x200 * sizeof(int));
145145
r20829r20830
226226 *
227227 *************************************/
228228
229static void draw_sprites(running_machine &machine, jedi_state *state, bitmap_rgb32 &bitmap, const rectangle &cliprect)
229void jedi_state::draw_sprites(bitmap_rgb32 &bitmap, const rectangle &cliprect)
230230{
231231   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();
234234
235235   for (offs = 0x00; offs < 0x30; offs++)
236236   {
r20829r20830
330330   {
331331      /* draw the background/text layers, followed by the sprites
332332         - 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);
336336   }
337337
338338   return 0;
trunk/src/mame/includes/jackal.h
r20829r20830
4444   virtual void palette_init();
4545   UINT32 screen_update_jackal(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
4646   INTERRUPT_GEN_MEMBER(jackal_interrupt);
47   void set_pens(  );
48   void jackal_mark_tile_dirty( int offset );
49   void draw_background( bitmap_ind16 &bitmap, const rectangle &cliprect );
50   void draw_sprites_region( bitmap_ind16 &bitmap, const rectangle &cliprect, const UINT8 *sram, int length, int bank );
51   void draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect );
4752};
4853
4954/*----------- defined in video/jackal.c -----------*/
trunk/src/mame/includes/jedi.h
r20829r20830
7878   DECLARE_VIDEO_START(jedi);
7979   UINT32 screen_update_jedi(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
8080   TIMER_CALLBACK_MEMBER(generate_interrupt);
81   void get_pens(pen_t *pens);
82   void do_pen_lookup(bitmap_rgb32 &bitmap, const rectangle &cliprect);
83   void draw_background_and_text(bitmap_rgb32 &bitmap, const rectangle &cliprect);
84   void draw_sprites(bitmap_rgb32 &bitmap, const rectangle &cliprect);
8185};
8286
8387/*----------- defined in audio/jedi.c -----------*/
trunk/src/mame/includes/jaguar.h
r20829r20830
311311   void blitter_01800001_xxxxxx_xxxxxx(UINT32 command, UINT32 a1flags, UINT32 a2flags);
312312   void blitter_x1800x01_xxxxxx_xxxxxx(UINT32 command, UINT32 a1flags, UINT32 a2flags);
313313
314   emu_file *jaguar_nvram_fopen( UINT32 openflags);
315   void jaguar_nvram_load();
316   void jaguar_nvram_save();
314317};
trunk/src/mame/includes/jpmimpct.h
r20829r20830
110110   DECLARE_MACHINE_START(impctawp);
111111   DECLARE_MACHINE_RESET(impctawp);
112112   TIMER_DEVICE_CALLBACK_MEMBER(duart_1_timer_event);
113   void update_irqs();
113114};
114115
115116
trunk/src/mame/includes/jack.h
r20829r20830
7272   virtual void video_start();
7373
7474   INTERRUPT_GEN_MEMBER(joinem_vblank_irq);
75   void jack_draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect );
76   void joinem_draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect );
77   void treahunt_decode(  );
7578};
trunk/src/mame/includes/jailbrek.h
r20829r20830
4545   UINT32 screen_update_jailbrek(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
4646   INTERRUPT_GEN_MEMBER(jb_interrupt);
4747   INTERRUPT_GEN_MEMBER(jb_interrupt_nmi);
48   void draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect );
4849};
trunk/src/mame/drivers/jack.c
r20829r20830
14401440}
14411441
14421442
1443static void treahunt_decode( running_machine &machine )
1443void jack_state::treahunt_decode(  )
14441444{
14451445   int A;
1446   address_space &space = machine.device("maincpu")->memory().space(AS_PROGRAM);
1447   UINT8 *rom = machine.root_device().memregion("maincpu")->base();
1448   UINT8 *decrypt = auto_alloc_array(machine, UINT8, 0x4000);
1446   address_space &space = machine().device("maincpu")->memory().space(AS_PROGRAM);
1447   UINT8 *rom = machine().root_device().memregion("maincpu")->base();
1448   UINT8 *decrypt = auto_alloc_array(machine(), UINT8, 0x4000);
14491449   int data;
14501450
14511451   space.set_decrypted_region(0x0000, 0x3fff, decrypt);
r20829r20830
14881488DRIVER_INIT_MEMBER(jack_state,treahunt)
14891489{
14901490   m_timer_rate = 256;
1491   treahunt_decode(machine());
1491   treahunt_decode();
14921492}
14931493
14941494
trunk/src/mame/drivers/jpmimpct.c
r20829r20830
129129 *
130130 *************************************/
131131
132static void update_irqs(running_machine &machine)
132void jpmimpct_state::update_irqs()
133133{
134   jpmimpct_state *state = machine.driver_data<jpmimpct_state>();
135   machine.device("maincpu")->execute().set_input_line(2, state->m_tms_irq ? ASSERT_LINE : CLEAR_LINE);
136   machine.device("maincpu")->execute().set_input_line(5, state->m_duart_1_irq ? ASSERT_LINE : CLEAR_LINE);
134   machine().device("maincpu")->execute().set_input_line(2, m_tms_irq ? ASSERT_LINE : CLEAR_LINE);
135   machine().device("maincpu")->execute().set_input_line(5, m_duart_1_irq ? ASSERT_LINE : CLEAR_LINE);
137136}
138137
139138
r20829r20830
220219   m_duart_1.ISR |= 0x08;
221220
222221   m_duart_1_irq = 1;
223   update_irqs(machine());
222   update_irqs();
224223}
225224
226225READ16_MEMBER(jpmimpct_state::duart_1_r)
r20829r20830
279278      case 0xf:
280279      {
281280         m_duart_1_irq = 0;
282         update_irqs(machine());
281         update_irqs();
283282         duart_1.ISR |= ~0x8;
284283         break;
285284      }
r20829r20830
844843{
845844   jpmimpct_state *drvstate = device->machine().driver_data<jpmimpct_state>();
846845   drvstate->m_tms_irq = state;
847   update_irqs(device->machine());
846   drvstate->update_irqs();
848847}
849848
850849static const tms34010_config tms_config =
trunk/src/mame/drivers/jackal.c
r20829r20830
137137WRITE8_MEMBER(jackal_state::jackal_voram_w)
138138{
139139   if ((offset & 0xf800) == 0)
140      jackal_mark_tile_dirty(machine(), offset & 0x3ff);
140      jackal_mark_tile_dirty(offset & 0x3ff);
141141
142142   m_rambank[0x2000 + offset] = data;
143143}
trunk/src/mame/drivers/jaguar.c
r20829r20830
434434*
435435********************************************************************/
436436/*
437static emu_file *jaguar_nvram_fopen( running_machine &machine, UINT32 openflags)
437emu_file jaguar_state::*jaguar_nvram_fopen( UINT32 openflags)
438438{
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"));
440440    file_error filerr;
441441    emu_file *file;
442442    if (image->exists())
443443    {
444        astring fname(machine.system().name, PATH_SEPARATOR, image->basename_noext(), ".nv");
444        astring fname(machine().system().name, PATH_SEPARATOR, image->basename_noext(), ".nv");
445445        filerr = mame_fopen( SEARCHPATH_NVRAM, fname, openflags, &file);
446446        return (filerr == FILERR_NONE) ? file : NULL;
447447    }
r20829r20830
449449        return NULL;
450450}
451451
452static void jaguar_nvram_load(running_machine &machine)
452void jaguar_state::jaguar_nvram_load()
453453{
454454    emu_file *nvram_file = NULL;
455455    device_t *device;
456456
457    for (device = machine.m_devicelist.first(); device != NULL; device = device->next())
457    for (device = machine().m_devicelist.first(); device != NULL; device = device->next())
458458    {
459459        device_nvram_func nvram = (device_nvram_func)device->get_config_fct(DEVINFO_FCT_NVRAM);
460460        if (nvram != NULL)
r20829r20830
469469}
470470
471471
472static void jaguar_nvram_save(running_machine &machine)
472void jaguar_state::jaguar_nvram_save()
473473{
474474    emu_file *nvram_file = NULL;
475475    device_t *device;
476476
477    for (device = machine.m_devicelist.first(); device != NULL; device = device->next())
477    for (device = machine().m_devicelist.first(); device != NULL; device = device->next())
478478    {
479479        device_nvram_func nvram = (device_nvram_func)device->get_config_fct(DEVINFO_FCT_NVRAM);
480480        if (nvram != NULL)

Previous 199869 Revisions Next


© 1997-2024 The MAME Team