Previous 15994 Revisions Next

r14900 Thursday 12th April, 2012 at 06:06:24 UTC by Miodrag Milanović
Sync with MAME r15963 (no whatsnew)
[src/emu]addrmap.h device.c device.h diexec.h memory.c
[src/mame/drivers]1945kiii.c 5clown.c ace.c acefruit.c acommand.c albazc.c albazg.c aristmk4.c astinvad.c astrocorp.c atarisy4.c avt.c backfire.c beaminv.c berzerk.c bestleag.c bingor.c blackt96.c blitz.c blitz68k.c bmcbowl.c bnstars.c boxer.c buster.c cabaret.c calorie.c cardline.c carrera.c caswin.c cb2001.c cball.c cesclass.c chanbara.c chinsan.c clayshoo.c cmmb.c cntsteer.c coinmstr.c coinmvga.c coolridr.c crystal.c cshooter.c cultures.c cybertnk.c cyclemb.c d9final.c dacholer.c dai3wksi.c dblewing.c ddayjlc.c ddealer.c dec8.c deco_ld.c deshoros.c destroyr.c diverboy.c dlair.c dmndrby.c dominob.c dorachan.c dotrikun.c dreamwld.c drtomy.c dynadice.c egghunt.c embargo.c enigma2.c esh.c ettrivia.c f-32.c feversoc.c firebeat.c firefox.c flyball.c fortecar.c funkball.c gal3.c galaxi.c gamecstl.c go2000.c goldngam.c goldnpkr.c goldstar.c good.c gpworld.c gstream.c gticlub.c halleys.c highvdeo.c hitpoker.c hornet.c hotblock.c hotstuff.c hvyunit.c igs009.c igs011.c igs017.c igs_m027.c igspoker.c imolagp.c intrscti.c istellar.c jackie.c jackpool.c jaguar.c jalmah.c jokrwild.c jollyjgr.c jongkyo.c jubilee.c kingdrby.c kinst.c koftball.c koikoi.c konamim2.c laserbas.c lgp.c liberatr.c limenko.c littlerb.c looping.c ltcasino.c luckgrln.c m14.c m63.c m79amb.c magic10.c magicard.c magicfly.c magictg.c marinedt.c mastboy.c mayumi.c mazerbla.c mediagx.c meijinsn.c merit.c mgolf.c midas.c mil4000.c miniboy7.c minivadr.c mirage.c mirax.c missile.c mlanding.c mogura.c mpoker.c murogem.c murogmbl.c mwarr.c namcos23.c neoprint.c nightgal.c nmg5.c nsmpoker.c nwk-tr.c nyny.c olibochu.c onetwo.c othello.c panicr.c pasha2.c peplus.c photon2.c pinkiri8.c pipeline.c pkscram.c poker72.c poo.c popobear.c ppmast93.c progolf.c pturn.c pzletime.c quizpun2.c quizshow.c r2dtank.c r2dx_v33.c rabbit.c rbmk.c re900.c rgum.c rmhaihai.c rotaryf.c royalmah.c safarir.c sbowling.c sbrkout.c seattle.c segald.c sfbonus.c shougi.c sigmab98.c skeetsht.c skimaxx.c skyarmy.c skylncr.c sliver.c slotcarn.c spaceg.c splus.c spoker.c spool99.c srmp6.c ssfindo.c sshot.c sstrangr.c statriv2.c sub.c subsino.c subsino2.c summit.c supdrapo.c superdq.c superwng.c suprgolf.c tapatune.c tattack.c tehkanwc.c tgtpanic.c tickee.c timetrv.c tmaster.c tmmjprd.c tmspoker.c toaplan2.c tomcat.c toratora.c trvmadns.c ttchamp.c tugboat.c twins.c ultrsprt.c umipoker.c unkhorse.c vamphalf.c vcombat.c vegas.c vroulet.c wallc.c warpsped.c wink.c witch.c wldarrow.c xtheball.c xxmissio.c zr107.c
[src/mame/includes]toaplan2.h
[src/mame/video]toaplan2.c
[src/mess/drivers]lynx.c psion.c

src/mame/includes/toaplan2.h
r14899r14900
4545   size_t m_tx_vram_size;
4646   size_t m_tx_offs_vram_size;
4747   size_t m_tx_scroll_vram_size;
48   size_t m_paletteram_size;
4948   size_t m_mainram_overlap_size;
5049
5150   bitmap_ind8 m_custom_priority_bitmap;
src/mame/video/toaplan2.c
r14899r14900
260260
261261   memcpy(dest, m_txvideoram16, m_tx_vram_size);
262262   dest += (m_tx_vram_size/2);
263   memcpy(dest, m_generic_paletteram_16, m_paletteram_size);
264   dest += (m_paletteram_size/2);
263   memcpy(dest, m_generic_paletteram_16, m_generic_paletteram_16.bytes());
264   dest += (m_generic_paletteram_16.bytes()/2);
265265   memcpy(dest, m_txvideoram16_offs, m_tx_offs_vram_size);
266266   dest += (m_tx_offs_vram_size/2);
267267   memcpy(dest, m_txscrollram16, m_tx_scroll_vram_size);
src/mame/drivers/mgolf.c
r14899r14900
3939static TILE_GET_INFO( get_tile_info )
4040{
4141   mgolf_state *state = machine.driver_data<mgolf_state>();
42   UINT8 code = state->m_video_ram.target()[tile_index];
42   UINT8 code = state->m_video_ram[tile_index];
4343
4444   SET_TILE_INFO(0, code, code >> 7, 0);
4545}
r14899r14900
4747
4848WRITE8_MEMBER(mgolf_state::mgolf_vram_w)
4949{
50   m_video_ram.target()[offset] = data;
50   m_video_ram[offset] = data;
5151   m_bg_tilemap->mark_tile_dirty(offset);
5252}
5353
r14899r14900
7171   for (i = 0; i < 2; i++)
7272   {
7373      drawgfx_transpen(bitmap, cliprect, screen.machine().gfx[1],
74         state->m_video_ram.target()[0x399 + 4 * i],
74         state->m_video_ram[0x399 + 4 * i],
7575         i,
7676         0, 0,
77         state->m_video_ram.target()[0x390 + 2 * i] - 7,
78         state->m_video_ram.target()[0x398 + 4 * i] - 16, 0);
77         state->m_video_ram[0x390 + 2 * i] - 7,
78         state->m_video_ram[0x398 + 4 * i] - 16, 0);
7979
8080      drawgfx_transpen(bitmap, cliprect, screen.machine().gfx[1],
81         state->m_video_ram.target()[0x39b + 4 * i],
81         state->m_video_ram[0x39b + 4 * i],
8282         i,
8383         0, 0,
84         state->m_video_ram.target()[0x390 + 2 * i] - 15,
85         state->m_video_ram.target()[0x39a + 4 * i] - 16, 0);
84         state->m_video_ram[0x390 + 2 * i] - 15,
85         state->m_video_ram[0x39a + 4 * i] - 16, 0);
8686   }
8787   return 0;
8888}
r14899r14900
137137
138138READ8_MEMBER(mgolf_state::mgolf_wram_r)
139139{
140   return m_video_ram.target()[0x380 + offset];
140   return m_video_ram[0x380 + offset];
141141}
142142
143143
r14899r14900
179179
180180WRITE8_MEMBER(mgolf_state::mgolf_wram_w)
181181{
182   m_video_ram.target()[0x380 + offset] = data;
182   m_video_ram[0x380 + offset] = data;
183183}
184184
185185
src/mame/drivers/pasha2.c
r14899r14900
138138{
139139   int color;
140140
141   COMBINE_DATA(&m_paletteram.target()[offset]);
141   COMBINE_DATA(&m_paletteram[offset]);
142142
143143   offset &= 0xff;
144144
145   color = (m_paletteram.target()[offset] >> 8) | (m_paletteram.target()[offset + 0x100] & 0xff00);
145   color = (m_paletteram[offset] >> 8) | (m_paletteram[offset + 0x100] & 0xff00);
146146   palette_set_color_rgb(machine(), offset * 2 + 0, pal5bit(color), pal5bit(color >> 5), pal5bit(color >> 10));
147147
148   color = (m_paletteram.target()[offset] & 0xff) | ((m_paletteram.target()[offset + 0x100] & 0xff) << 8);
148   color = (m_paletteram[offset] & 0xff) | ((m_paletteram[offset + 0x100] & 0xff) << 8);
149149   palette_set_color_rgb(machine(), offset * 2 + 1, pal5bit(color), pal5bit(color >> 5), pal5bit(color >> 10));
150150}
151151
r14899r14900
468468   if(cpu_get_pc(&space.device()) == 0x8302)
469469      device_spin_until_interrupt(&space.device());
470470
471   return m_wram.target()[(0x95744 / 2) + offset];
471   return m_wram[(0x95744 / 2) + offset];
472472}
473473
474474static DRIVER_INIT( pasha2 )
src/mame/drivers/coinmstr.c
r14899r14900
5757
5858WRITE8_MEMBER(coinmstr_state::quizmstr_bg_w)
5959{
60   UINT8 *videoram = m_videoram.target();
60   UINT8 *videoram = m_videoram;
6161   videoram[offset] = data;
6262
6363   if(offset >= 0x0240)
r14899r14900
100100
101101WRITE8_MEMBER(coinmstr_state::quizmstr_attr1_w)
102102{
103   m_attr_ram1.target()[offset] = data;
103   m_attr_ram1[offset] = data;
104104
105105   if(offset >= 0x0240)
106106   {
107107      // the later games also use attr3 for something..
108      UINT32   paldata = (m_attr_ram1.target()[offset] & 0x7f) | ((m_attr_ram2.target()[offset] & 0x7f) << 7);
108      UINT32   paldata = (m_attr_ram1[offset] & 0x7f) | ((m_attr_ram2[offset] & 0x7f) << 7);
109109      m_bg_tilemap->mark_tile_dirty(offset - 0x0240);
110110
111111      coinmstr_set_pal(machine(), paldata, offset - 0x240);
r14899r14900
115115
116116WRITE8_MEMBER(coinmstr_state::quizmstr_attr2_w)
117117{
118   m_attr_ram2.target()[offset] = data;
118   m_attr_ram2[offset] = data;
119119
120120   if(offset >= 0x0240)
121121   {
122122      // the later games also use attr3 for something..
123      UINT32   paldata = (m_attr_ram1.target()[offset] & 0x7f) | ((m_attr_ram2.target()[offset] & 0x7f) << 7);
123      UINT32   paldata = (m_attr_ram1[offset] & 0x7f) | ((m_attr_ram2[offset] & 0x7f) << 7);
124124      m_bg_tilemap->mark_tile_dirty(offset - 0x0240);
125125
126126      coinmstr_set_pal(machine(), paldata, offset - 0x240);
r14899r14900
130130
131131WRITE8_MEMBER(coinmstr_state::quizmstr_attr3_w)
132132{
133   m_attr_ram3.target()[offset] = data;
133   m_attr_ram3[offset] = data;
134134
135135   if(offset >= 0x0240)
136136      m_bg_tilemap->mark_tile_dirty(offset - 0x0240);
r14899r14900
901901static TILE_GET_INFO( get_bg_tile_info )
902902{
903903   coinmstr_state *state = machine.driver_data<coinmstr_state>();
904   UINT8 *videoram = state->m_videoram.target();
904   UINT8 *videoram = state->m_videoram;
905905   int tile = videoram[tile_index + 0x0240];
906906   int color = tile_index;
907907
908   tile |= (state->m_attr_ram1.target()[tile_index + 0x0240] & 0x80) << 1;
909   tile |= (state->m_attr_ram2.target()[tile_index + 0x0240] & 0x80) << 2;
908   tile |= (state->m_attr_ram1[tile_index + 0x0240] & 0x80) << 1;
909   tile |= (state->m_attr_ram2[tile_index + 0x0240] & 0x80) << 2;
910910
911   tile |= (state->m_attr_ram3.target()[tile_index + 0x0240] & 0x03) << (6+4);
911   tile |= (state->m_attr_ram3[tile_index + 0x0240] & 0x03) << (6+4);
912912
913913   SET_TILE_INFO(0, tile, color, 0);
914914}
src/mame/drivers/magicard.c
r14899r14900
174174      : driver_device(mconfig, type, tag) ,
175175      m_magicram(*this, "magicram"),
176176      m_pcab_vregs(*this, "pcab_vregs"),
177      m_scc68070_ext_irqc_regs(*this, "scc68070_ext_irqc_regs"),
178      m_scc68070_iic_regs(*this, "scc68070_iic_regs"),
179      m_scc68070_uart_regs(*this, "scc68070_uart_regs"),
180      m_scc68070_timer_regs(*this, "scc68070_timer_regs"),
181      m_scc68070_int_irqc_regs(*this, "scc68070_int_irqc_regs"),
182      m_scc68070_dma_ch1_regs(*this, "scc68070_dma_ch1_regs"),
183      m_scc68070_dma_ch2_regs(*this, "scc68070_dma_ch2_regs"),
184      m_scc68070_mmu_regs(*this, "scc68070_mmu_regs"){ }
177      m_scc68070_ext_irqc_regs(*this, "scc_xirqc_regs"),
178      m_scc68070_iic_regs(*this, "scc_iic_regs"),
179      m_scc68070_uart_regs(*this, "scc_uart_regs"),
180      m_scc68070_timer_regs(*this, "scc_timer_regs"),
181      m_scc68070_int_irqc_regs(*this, "scc_iirqc_regs"),
182      m_scc68070_dma_ch1_regs(*this, "scc_dma1_regs"),
183      m_scc68070_dma_ch2_regs(*this, "scc_dma2_regs"),
184      m_scc68070_mmu_regs(*this, "scc_mmu_regs"){ }
185185
186186   required_shared_ptr<UINT16> m_magicram;
187187   required_shared_ptr<UINT16> m_pcab_vregs;
r14899r14900
248248*/
249249
250250/*63 at post test,6d all the time.*/
251#define SCC_CSR_VREG    (state->m_pcab_vregs.target()[0x00/2] & 0xffff)
251#define SCC_CSR_VREG    (state->m_pcab_vregs[0x00/2] & 0xffff)
252252#define SCC_CG_VREG      ((SCC_CSR_VREG & 0x10)>>4)
253253
254254/*
r14899r14900
274274    w ........ ....aaaa  VSR:H = video start address (MSB's)
275275*/
276276
277#define SCC_DCR_VREG    (state->m_pcab_vregs.target()[0x02/2] & 0xffff)
277#define SCC_DCR_VREG    (state->m_pcab_vregs[0x02/2] & 0xffff)
278278#define SCC_DE_VREG      ((SCC_DCR_VREG & 0x8000)>>15)
279279#define SCC_FG_VREG      ((SCC_DCR_VREG & 0x0080)>>7)
280280#define SCC_VSR_VREG_H  ((SCC_DCR_VREG & 0xf)>>0)
r14899r14900
284284    w aaaaaaaa aaaaaaaa  VSR:L = video start address (LSB's)
285285*/
286286
287#define SCC_VSR_VREG_L  (state->m_pcab_vregs.target()[0x04/2] & 0xffff)
287#define SCC_VSR_VREG_L  (state->m_pcab_vregs[0x04/2] & 0xffff)
288288#define SCC_VSR_VREG    ((SCC_VSR_VREG_H)<<16) | (SCC_VSR_VREG_L)
289289
290290/*
r14899r14900
303303    w ........ xxxx....  not used
304304    w ........ ....aaaa  "data" (dunno the purpose...)
305305*/
306#define SCC_DCR2_VREG  (state->m_pcab_vregs.target()[0x08/2] & 0xffff)
306#define SCC_DCR2_VREG  (state->m_pcab_vregs[0x08/2] & 0xffff)
307307
308308/*
309309(Note: not present on the original vreg listing)
r14899r14900
3243241ffff0  a = source register a
325325    w nnnnnnnn nnnnnnnn  source
326326*/
327#define SCC_SRCA_VREG  (state->m_pcab_vregs.target()[0x10/2] & 0xffff)
327#define SCC_SRCA_VREG  (state->m_pcab_vregs[0x10/2] & 0xffff)
328328
329329/*
3303301ffff2  b = destination register b
331331   rw nnnnnnnn nnnnnnnn  destination
332332*/
333333
334#define SCC_DSTB_VREG  (state->m_pcab_vregs.target()[0x12/2] & 0xffff)
334#define SCC_DSTB_VREG  (state->m_pcab_vregs[0x12/2] & 0xffff)
335335
336336/*
3373371ffff4  pcr = pixac command register
r14899r14900
378378    w ........ .......0
379379*/
380380
381#define SCC_PCR_VREG  (state->m_pcab_vregs.target()[0x14/2] & 0xffff)
381#define SCC_PCR_VREG  (state->m_pcab_vregs[0x14/2] & 0xffff)
382382
383383/*
3843841ffff6  mask = mask register
r14899r14900
430430         {
431431            UINT32 color;
432432
433            color = ((state->m_magicram.target()[count]) & 0x000f)>>0;
433            color = ((state->m_magicram[count]) & 0x000f)>>0;
434434
435435            if(cliprect.contains((x*4)+3, y))
436436               bitmap.pix32(y, (x*4)+3) = screen.machine().pens[color];
437437
438            color = ((state->m_magicram.target()[count]) & 0x00f0)>>4;
438            color = ((state->m_magicram[count]) & 0x00f0)>>4;
439439
440440            if(cliprect.contains((x*4)+2, y))
441441               bitmap.pix32(y, (x*4)+2) = screen.machine().pens[color];
442442
443            color = ((state->m_magicram.target()[count]) & 0x0f00)>>8;
443            color = ((state->m_magicram[count]) & 0x0f00)>>8;
444444
445445            if(cliprect.contains((x*4)+1, y))
446446               bitmap.pix32(y, (x*4)+1) = screen.machine().pens[color];
447447
448            color = ((state->m_magicram.target()[count]) & 0xf000)>>12;
448            color = ((state->m_magicram[count]) & 0xf000)>>12;
449449
450450            if(cliprect.contains((x*4)+0, y))
451451               bitmap.pix32(y, (x*4)+0) = screen.machine().pens[color];
r14899r14900
462462         {
463463            UINT32 color;
464464
465            color = ((state->m_magicram.target()[count]) & 0x00ff)>>0;
465            color = ((state->m_magicram[count]) & 0x00ff)>>0;
466466
467467            if(cliprect.contains((x*2)+1, y))
468468               bitmap.pix32(y, (x*2)+1) = screen.machine().pens[color];
469469
470            color = ((state->m_magicram.target()[count]) & 0xff00)>>8;
470            color = ((state->m_magicram[count]) & 0xff00)>>8;
471471
472472            if(cliprect.contains((x*2)+0, y))
473473               bitmap.pix32(y, (x*2)+0) = screen.machine().pens[color];
r14899r14900
534534   //printf("[%04x]\n",offset*2);
535535
536536
537   return m_pcab_vregs.target()[offset];
537   return m_pcab_vregs[offset];
538538}
539539
540540WRITE16_MEMBER(magicard_state::philips_66470_w)
541541{
542   COMBINE_DATA(&m_pcab_vregs.target()[offset]);
542   COMBINE_DATA(&m_pcab_vregs[offset]);
543543
544544//  if(offset == 0x10/2)
545545//  {
546      //printf("%04x %04x %04x\n",data,m_pcab_vregs.target()[0x12/2],m_pcab_vregs.target()[0x14/2]);
547      //m_pcab_vregs.target()[0x12/2] = m_pcab_vregs.target()[0x10/2];
546      //printf("%04x %04x %04x\n",data,m_pcab_vregs[0x12/2],m_pcab_vregs[0x14/2]);
547      //m_pcab_vregs[0x12/2] = m_pcab_vregs[0x10/2];
548548//  }
549549}
550550
r14899r14900
552552
553553READ16_MEMBER(magicard_state::scc68070_ext_irqc_r)
554554{
555   return m_scc68070_ext_irqc_regs.target()[offset];
555   return m_scc68070_ext_irqc_regs[offset];
556556}
557557
558558WRITE16_MEMBER(magicard_state::scc68070_ext_irqc_w)
559559{
560   m_scc68070_ext_irqc_regs.target()[offset] = data;
560   m_scc68070_ext_irqc_regs[offset] = data;
561561}
562562
563563READ16_MEMBER(magicard_state::scc68070_iic_r)
r14899r14900
566566
567567   switch(offset)
568568   {
569      case 0x04/2: return m_scc68070_iic_regs.target()[offset] & 0xef; //iic status register, bit 4 = pending irq
569      case 0x04/2: return m_scc68070_iic_regs[offset] & 0xef; //iic status register, bit 4 = pending irq
570570   }
571571
572   return m_scc68070_iic_regs.target()[offset];
572   return m_scc68070_iic_regs[offset];
573573}
574574
575575WRITE16_MEMBER(magicard_state::scc68070_iic_w)
576576{
577   m_scc68070_iic_regs.target()[offset] = data;
577   m_scc68070_iic_regs[offset] = data;
578578}
579579
580580READ16_MEMBER(magicard_state::scc68070_uart_r)
r14899r14900
586586      case 0x02/2: return machine().rand(); //uart mode register
587587   }
588588
589   return m_scc68070_uart_regs.target()[offset];
589   return m_scc68070_uart_regs[offset];
590590}
591591
592592WRITE16_MEMBER(magicard_state::scc68070_uart_w)
593593{
594   m_scc68070_uart_regs.target()[offset] = data;
594   m_scc68070_uart_regs[offset] = data;
595595}
596596
597597READ16_MEMBER(magicard_state::scc68070_timer_r)
598598{
599   return m_scc68070_timer_regs.target()[offset];
599   return m_scc68070_timer_regs[offset];
600600}
601601
602602WRITE16_MEMBER(magicard_state::scc68070_timer_w)
603603{
604   m_scc68070_timer_regs.target()[offset] = data;
604   m_scc68070_timer_regs[offset] = data;
605605}
606606
607607READ16_MEMBER(magicard_state::scc68070_int_irqc_r)
608608{
609   return m_scc68070_int_irqc_regs.target()[offset];
609   return m_scc68070_int_irqc_regs[offset];
610610}
611611
612612WRITE16_MEMBER(magicard_state::scc68070_int_irqc_w)
613613{
614   m_scc68070_int_irqc_regs.target()[offset] = data;
614   m_scc68070_int_irqc_regs[offset] = data;
615615}
616616
617617READ16_MEMBER(magicard_state::scc68070_dma_ch1_r)
618618{
619   return m_scc68070_dma_ch1_regs.target()[offset];
619   return m_scc68070_dma_ch1_regs[offset];
620620}
621621
622622WRITE16_MEMBER(magicard_state::scc68070_dma_ch1_w)
623623{
624   m_scc68070_dma_ch1_regs.target()[offset] = data;
624   m_scc68070_dma_ch1_regs[offset] = data;
625625}
626626
627627READ16_MEMBER(magicard_state::scc68070_dma_ch2_r)
628628{
629   return m_scc68070_dma_ch2_regs.target()[offset];
629   return m_scc68070_dma_ch2_regs[offset];
630630}
631631
632632WRITE16_MEMBER(magicard_state::scc68070_dma_ch2_w)
633633{
634   m_scc68070_dma_ch2_regs.target()[offset] = data;
634   m_scc68070_dma_ch2_regs[offset] = data;
635635}
636636
637637READ16_MEMBER(magicard_state::scc68070_mmu_r)
638638{
639   return m_scc68070_mmu_regs.target()[offset];
639   return m_scc68070_mmu_regs[offset];
640640}
641641
642642WRITE16_MEMBER(magicard_state::scc68070_mmu_w)
643643{
644   m_scc68070_mmu_regs.target()[offset] = data;
644   m_scc68070_mmu_regs[offset] = data;
645645
646646   switch(offset)
647647   {
r14899r14900
671671   AM_RANGE(0x001ffd80, 0x001ffd81) AM_MIRROR(0x7fe00000) AM_WRITENOP //?
672672   AM_RANGE(0x001fff80, 0x001fffbf) AM_MIRROR(0x7fe00000) AM_RAM //DRAM I/O, not accessed by this game, CD buffer?
673673   AM_RANGE(0x001fffe0, 0x001fffff) AM_MIRROR(0x7fe00000) AM_READWRITE(philips_66470_r,philips_66470_w) AM_SHARE("pcab_vregs") //video registers
674   AM_RANGE(0x80001000, 0x8000100f) AM_READWRITE(scc68070_ext_irqc_r,scc68070_ext_irqc_w) AM_SHARE("scc68070_ext_irqc_regs") //lir
675   AM_RANGE(0x80002000, 0x8000200f) AM_READWRITE(scc68070_iic_r,scc68070_iic_w) AM_SHARE("scc68070_iic_regs") //i2c
676   AM_RANGE(0x80002010, 0x8000201f) AM_READWRITE(scc68070_uart_r,scc68070_uart_w) AM_SHARE("scc68070_uart_regs")
677   AM_RANGE(0x80002020, 0x8000202f) AM_READWRITE(scc68070_timer_r,scc68070_timer_w) AM_SHARE("scc68070_timer_regs")
678   AM_RANGE(0x80002040, 0x8000204f) AM_READWRITE(scc68070_int_irqc_r,scc68070_int_irqc_w) AM_SHARE("scc68070_int_irqc_regs")
679   AM_RANGE(0x80004000, 0x8000403f) AM_READWRITE(scc68070_dma_ch1_r,scc68070_dma_ch1_w) AM_SHARE("scc68070_dma_ch1_regs")
680   AM_RANGE(0x80004040, 0x8000407f) AM_READWRITE(scc68070_dma_ch2_r,scc68070_dma_ch2_w) AM_SHARE("scc68070_dma_ch2_regs")
681   AM_RANGE(0x80008000, 0x8000807f) AM_READWRITE(scc68070_mmu_r,scc68070_mmu_w) AM_SHARE("scc68070_mmu_regs")
674   AM_RANGE(0x80001000, 0x8000100f) AM_READWRITE(scc68070_ext_irqc_r,scc68070_ext_irqc_w) AM_SHARE("scc_xirqc_regs") //lir
675   AM_RANGE(0x80002000, 0x8000200f) AM_READWRITE(scc68070_iic_r,scc68070_iic_w) AM_SHARE("scc_iic_regs") //i2c
676   AM_RANGE(0x80002010, 0x8000201f) AM_READWRITE(scc68070_uart_r,scc68070_uart_w) AM_SHARE("scc_uart_regs")
677   AM_RANGE(0x80002020, 0x8000202f) AM_READWRITE(scc68070_timer_r,scc68070_timer_w) AM_SHARE("scc_timer_regs")
678   AM_RANGE(0x80002040, 0x8000204f) AM_READWRITE(scc68070_int_irqc_r,scc68070_int_irqc_w) AM_SHARE("scc_iirqc_regs")
679   AM_RANGE(0x80004000, 0x8000403f) AM_READWRITE(scc68070_dma_ch1_r,scc68070_dma_ch1_w) AM_SHARE("scc_dma1_regs")
680   AM_RANGE(0x80004040, 0x8000407f) AM_READWRITE(scc68070_dma_ch2_r,scc68070_dma_ch2_w) AM_SHARE("scc_dma2_regs")
681   AM_RANGE(0x80008000, 0x8000807f) AM_READWRITE(scc68070_mmu_r,scc68070_mmu_w) AM_SHARE("scc_mmu_regs")
682682ADDRESS_MAP_END
683683
684684
r14899r14900
694694{
695695   magicard_state *state = machine.driver_data<magicard_state>();
696696   UINT16 *src    = (UINT16*)machine.region("maincpu" )->base();
697   UINT16 *dst    = state->m_magicram.target();
697   UINT16 *dst    = state->m_magicram;
698698   memcpy (dst, src, 0x80000);
699699   machine.device("maincpu")->reset();
700700}
src/mame/drivers/murogem.c
r14899r14900
213213   {
214214      for(xx=0;xx<32;xx++)
215215      {
216         int tileno = state->m_videoram.target()[count]&0x3f;
217         int attr = state->m_videoram.target()[count+0x400]&0x0f;
216         int tileno = state->m_videoram[count]&0x3f;
217         int attr = state->m_videoram[count+0x400]&0x0f;
218218
219219         drawgfx_transpen(bitmap,cliprect,screen.machine().gfx[0],tileno,attr,0,0,xx*8,yy*8,0);
220220
src/mame/drivers/cntsteer.c
r14899r14900
112112static TILE_GET_INFO( get_bg_tile_info )
113113{
114114   cntsteer_state *state = machine.driver_data<cntsteer_state>();
115   int code = state->m_videoram2.target()[tile_index];
115   int code = state->m_videoram2[tile_index];
116116
117117   SET_TILE_INFO(2, code + state->m_bg_bank, state->m_bg_color_bank, 0);
118118}
r14899r14900
120120static TILE_GET_INFO( get_fg_tile_info )
121121{
122122   cntsteer_state *state = machine.driver_data<cntsteer_state>();
123   int code = state->m_videoram.target()[tile_index];
124   int attr = state->m_colorram.target()[tile_index];
123   int code = state->m_videoram[tile_index];
124   int attr = state->m_colorram[tile_index];
125125
126126   code |= (attr & 0x01) << 8;
127127
r14899r14900
172172   {
173173      int multi, fx, fy, sx, sy, code, color;
174174
175      if ((state->m_spriteram.target()[offs + 1] & 1) == 1)
175      if ((state->m_spriteram[offs + 1] & 1) == 1)
176176         continue;
177177
178      code = state->m_spriteram.target()[offs + 3] + ((state->m_spriteram.target()[offs + 1] & 0xc0) << 2);
179      sx = (state->m_spriteram.target()[offs + 2]);
180      sy = 0xf0 - state->m_spriteram.target()[offs];
181      color = 0x10 + ((state->m_spriteram.target()[offs + 1] & 0x20) >> 4) + ((state->m_spriteram.target()[offs + 1] & 0x8)>>3);
178      code = state->m_spriteram[offs + 3] + ((state->m_spriteram[offs + 1] & 0xc0) << 2);
179      sx = (state->m_spriteram[offs + 2]);
180      sy = 0xf0 - state->m_spriteram[offs];
181      color = 0x10 + ((state->m_spriteram[offs + 1] & 0x20) >> 4) + ((state->m_spriteram[offs + 1] & 0x8)>>3);
182182
183      fx = !(state->m_spriteram.target()[offs + 1] & 0x04);
184      fy = (state->m_spriteram.target()[offs + 1] & 0x02);
183      fx = !(state->m_spriteram[offs + 1] & 0x04);
184      fy = (state->m_spriteram[offs + 1] & 0x02);
185185
186      multi = state->m_spriteram.target()[offs + 1] & 0x10;
186      multi = state->m_spriteram[offs + 1] & 0x10;
187187
188188      if (state->m_flipscreen)
189189      {
r14899r14900
230230   {
231231      int multi, fx, fy, sx, sy, code, color;
232232
233      if ((state->m_spriteram.target()[offs + 0] & 1) == 0)
233      if ((state->m_spriteram[offs + 0] & 1) == 0)
234234         continue;
235235
236      code = state->m_spriteram.target()[offs + 1] + ((state->m_spriteram.target()[offs + 0x80] & 0x03) << 8);
237      sx = 0x100 - state->m_spriteram.target()[offs + 3];
238      sy = 0x100 - state->m_spriteram.target()[offs + 2];
239      color = 0x10 + ((state->m_spriteram.target()[offs + 0x80] & 0x70) >> 4);
236      code = state->m_spriteram[offs + 1] + ((state->m_spriteram[offs + 0x80] & 0x03) << 8);
237      sx = 0x100 - state->m_spriteram[offs + 3];
238      sy = 0x100 - state->m_spriteram[offs + 2];
239      color = 0x10 + ((state->m_spriteram[offs + 0x80] & 0x70) >> 4);
240240
241      fx = (state->m_spriteram.target()[offs + 0] & 0x04);
242      fy = (state->m_spriteram.target()[offs + 0] & 0x02);
241      fx = (state->m_spriteram[offs + 0] & 0x04);
242      fy = (state->m_spriteram[offs + 0] & 0x02);
243243
244      multi = state->m_spriteram.target()[offs + 0] & 0x10;
244      multi = state->m_spriteram[offs + 0] & 0x10;
245245
246246      if (state->m_flipscreen)
247247      {
r14899r14900
433433
434434WRITE8_MEMBER(cntsteer_state::cntsteer_foreground_vram_w)
435435{
436   m_videoram.target()[offset] = data;
436   m_videoram[offset] = data;
437437   m_fg_tilemap->mark_tile_dirty(offset);
438438}
439439
440440WRITE8_MEMBER(cntsteer_state::cntsteer_foreground_attr_w)
441441{
442   m_colorram.target()[offset] = data;
442   m_colorram[offset] = data;
443443   m_fg_tilemap->mark_tile_dirty(offset);
444444}
445445
446446WRITE8_MEMBER(cntsteer_state::cntsteer_background_w)
447447{
448   m_videoram2.target()[offset] = data;
448   m_videoram2[offset] = data;
449449   m_bg_tilemap->mark_tile_dirty(offset);
450450}
451451
r14899r14900
566566
567567static ADDRESS_MAP_START( cntsteer_cpu2_map, AS_PROGRAM, 8, cntsteer_state )
568568   AM_RANGE(0x0000, 0x0fff) AM_RAM AM_SHARE("share1")
569   AM_RANGE(0x1000, 0x1fff) AM_RAM_WRITE(cntsteer_background_w) AM_SHARE("videoram2") AM_SHARE("share3")
570   AM_RANGE(0x2000, 0x2fff) AM_RAM_WRITE(cntsteer_background_w) AM_SHARE("share3")
569   AM_RANGE(0x1000, 0x1fff) AM_RAM_WRITE(cntsteer_background_w) AM_SHARE("videoram2")
570   AM_RANGE(0x2000, 0x2fff) AM_RAM_WRITE(cntsteer_background_w) AM_SHARE("videoram2")
571571   AM_RANGE(0x3000, 0x3000) AM_READ_PORT("DSW0")
572572   AM_RANGE(0x3001, 0x3001) AM_READ(cntsteer_adx_r)
573573   AM_RANGE(0x3002, 0x3002) AM_READ_PORT("P1")
src/mame/drivers/skeetsht.c
r14899r14900
7070{
7171   skeetsht_state *state = screen.machine().driver_data<skeetsht_state>();
7272   const rgb_t *const pens = tlc34076_get_pens(screen.machine().device("tlc34076"));
73   UINT16 *vram = &state->m_tms_vram.target()[(params->rowaddr << 8) & 0x3ff00];
73   UINT16 *vram = &state->m_tms_vram[(params->rowaddr << 8) & 0x3ff00];
7474   UINT32 *dest = &bitmap.pix32(scanline);
7575   int coladdr = params->coladdr;
7676   int x;
src/mame/drivers/dblewing.c
r14899r14900
104104   UINT16 flip = deco16ic_pf_control_r(state->m_deco_tilegen1, 0, 0xffff);
105105
106106   state->flip_screen_set(BIT(flip, 7));
107   deco16ic_pf_update(state->m_deco_tilegen1, state->m_pf1_rowscroll, state->m_pf2_rowscroll.target());
107   deco16ic_pf_update(state->m_deco_tilegen1, state->m_pf1_rowscroll, state->m_pf2_rowscroll);
108108
109109   bitmap.fill(0, cliprect); /* not Confirmed */
110110   screen.machine().priority_bitmap.fill(0);
src/mame/drivers/shougi.c
r14899r14900
186186      //if (flipscreen[0]) sx = 31 - sx;
187187      //if (flipscreen[1]) sy = 31 - sy;
188188
189      data1 = state->m_videoram.target()[offs];            /* color */
190      data2 = state->m_videoram.target()[0x4000 + offs];   /* pixel data */
189      data1 = state->m_videoram[offs];            /* color */
190      data2 = state->m_videoram[0x4000 + offs];   /* pixel data */
191191
192192      for (x=0; x<4; x++) /*4 pixels per byte (2 bitplanes in 2 nibbles: 1st=bits 7-4, 2nd=bits 3-0)*/
193193      {
src/mame/drivers/hornet.c
r14899r14900
327327{
328328public:
329329   hornet_state(const machine_config &mconfig, device_type type, const char *tag)
330      : driver_device(mconfig, type, tag) { }
330      : driver_device(mconfig, type, tag),
331        m_workram(*this, "workram"),
332        m_sharc_dataram0(*this, "share_dataram0"),
333        m_sharc_dataram1(*this, "share_dataram1") { }
331334
332335   UINT8 m_led_reg0;
333336   UINT8 m_led_reg1;
334   UINT32 *m_workram;
335   UINT32 *m_sharc_dataram[2];
337   required_shared_ptr<UINT32> m_workram;
338   required_shared_ptr<UINT32> m_sharc_dataram0;
339   required_shared_ptr<UINT32> m_sharc_dataram1;
336340   UINT8 *m_jvs_sdata;
337341   UINT32 m_jvs_sdata_ptr;
338342   emu_timer *m_sound_irq_timer;
r14899r14900
622626/*****************************************************************************/
623627
624628static ADDRESS_MAP_START( hornet_map, AS_PROGRAM, 32, hornet_state )
625   AM_RANGE(0x00000000, 0x003fffff) AM_RAM AM_BASE(m_workram)      /* Work RAM */
629   AM_RANGE(0x00000000, 0x003fffff) AM_RAM AM_SHARE("workram")      /* Work RAM */
626630   AM_RANGE(0x74000000, 0x740000ff) AM_READWRITE(hornet_k037122_reg_r, hornet_k037122_reg_w)
627631   AM_RANGE(0x74020000, 0x7403ffff) AM_READWRITE(hornet_k037122_sram_r, hornet_k037122_sram_w)
628632   AM_RANGE(0x74040000, 0x7407ffff) AM_READWRITE(hornet_k037122_char_r, hornet_k037122_char_w)
r14899r14900
699703
700704READ32_MEMBER(hornet_state::dsp_dataram0_r)
701705{
702   return m_sharc_dataram[0][offset] & 0xffff;
706   return m_sharc_dataram0[offset] & 0xffff;
703707}
704708
705709WRITE32_MEMBER(hornet_state::dsp_dataram0_w)
706710{
707   m_sharc_dataram[0][offset] = data;
711   m_sharc_dataram0[offset] = data;
708712}
709713
710714READ32_MEMBER(hornet_state::dsp_dataram1_r)
711715{
712   return m_sharc_dataram[1][offset] & 0xffff;
716   return m_sharc_dataram1[offset] & 0xffff;
713717}
714718
715719WRITE32_MEMBER(hornet_state::dsp_dataram1_w)
716720{
717   m_sharc_dataram[1][offset] = data;
721   m_sharc_dataram1[offset] = data;
718722}
719723
720724static ADDRESS_MAP_START( sharc0_map, AS_DATA, 32, hornet_state )
721725   AM_RANGE(0x0400000, 0x041ffff) AM_READWRITE_LEGACY(cgboard_0_shared_sharc_r, cgboard_0_shared_sharc_w)
722   AM_RANGE(0x0500000, 0x05fffff) AM_READWRITE(dsp_dataram0_r, dsp_dataram0_w) AM_BASE(m_sharc_dataram[0])
726   AM_RANGE(0x0500000, 0x05fffff) AM_READWRITE(dsp_dataram0_r, dsp_dataram0_w) AM_SHARE("sharc_dataram0")
723727   AM_RANGE(0x1400000, 0x14fffff) AM_RAM
724728   AM_RANGE(0x2400000, 0x27fffff) AM_DEVREADWRITE_LEGACY("voodoo0", voodoo_r, voodoo_w)
725729   AM_RANGE(0x3400000, 0x34000ff) AM_READWRITE_LEGACY(cgboard_0_comm_sharc_r, cgboard_0_comm_sharc_w)
r14899r14900
729733
730734static ADDRESS_MAP_START( sharc1_map, AS_DATA, 32, hornet_state )
731735   AM_RANGE(0x0400000, 0x041ffff) AM_READWRITE_LEGACY(cgboard_1_shared_sharc_r, cgboard_1_shared_sharc_w)
732   AM_RANGE(0x0500000, 0x05fffff) AM_READWRITE(dsp_dataram1_r, dsp_dataram1_w) AM_BASE(m_sharc_dataram[1])
736   AM_RANGE(0x0500000, 0x05fffff) AM_READWRITE(dsp_dataram1_r, dsp_dataram1_w) AM_SHARE("sharc_dataram1")
733737   AM_RANGE(0x1400000, 0x14fffff) AM_RAM
734738   AM_RANGE(0x2400000, 0x27fffff) AM_DEVREADWRITE_LEGACY("voodoo1", voodoo_r, voodoo_w)
735739   AM_RANGE(0x3400000, 0x34000ff) AM_READWRITE_LEGACY(cgboard_1_comm_sharc_r, cgboard_1_comm_sharc_w)
src/mame/drivers/hotstuff.c
r14899r14900
4646
4747      for (p=0;p<0x10;p++)
4848      {
49         row_palette_data[p] = state->m_bitmapram.target()[count+p];
49         row_palette_data[p] = state->m_bitmapram[count+p];
5050
5151         row_palette_data_as_rgb32_pen_data[p] = MAKE_RGB( (row_palette_data[p] & 0x0f00)>>4, (row_palette_data[p] & 0x00f0)>>0, (row_palette_data[p] & 0x000f)<<4  );
5252
r14899r14900
5555      for(x = 0; x < xxx; x++)
5656      {
5757         {
58            bitmap.pix32(y, x) = row_palette_data_as_rgb32_pen_data[(state->m_bitmapram.target()[count] &0xf000)>>12];
58            bitmap.pix32(y, x) = row_palette_data_as_rgb32_pen_data[(state->m_bitmapram[count] &0xf000)>>12];
5959            x++;
60            bitmap.pix32(y, x) = row_palette_data_as_rgb32_pen_data[(state->m_bitmapram.target()[count] &0x0f00)>>8];
60            bitmap.pix32(y, x) = row_palette_data_as_rgb32_pen_data[(state->m_bitmapram[count] &0x0f00)>>8];
6161            x++;
62            bitmap.pix32(y, x) = row_palette_data_as_rgb32_pen_data[(state->m_bitmapram.target()[count] &0x00f0)>>4];
62            bitmap.pix32(y, x) = row_palette_data_as_rgb32_pen_data[(state->m_bitmapram[count] &0x00f0)>>4];
6363            x++;
64            bitmap.pix32(y, x) = row_palette_data_as_rgb32_pen_data[(state->m_bitmapram.target()[count] &0x000f)>>0];
64            bitmap.pix32(y, x) = row_palette_data_as_rgb32_pen_data[(state->m_bitmapram[count] &0x000f)>>0];
6565         }
6666
6767         count++;
src/mame/drivers/mediagx.c
r14899r14900
277277
278278   if (state->m_disp_ctrl_reg[DC_OUTPUT_CFG] & 0x1)      // 8-bit mode
279279   {
280      UINT8 *framebuf = (UINT8*)&state->m_vram.target()[state->m_disp_ctrl_reg[DC_FB_ST_OFFSET]/4];
280      UINT8 *framebuf = (UINT8*)&state->m_vram[state->m_disp_ctrl_reg[DC_FB_ST_OFFSET]/4];
281281      UINT8 *pal = state->m_pal;
282282
283283      for (j=0; j < state->m_frame_height; j++)
r14899r14900
297297   }
298298   else         // 16-bit
299299   {
300      UINT16 *framebuf = (UINT16*)&state->m_vram.target()[state->m_disp_ctrl_reg[DC_FB_ST_OFFSET]/4];
300      UINT16 *framebuf = (UINT16*)&state->m_vram[state->m_disp_ctrl_reg[DC_FB_ST_OFFSET]/4];
301301
302302      // RGB 5-6-5 mode
303303      if ((state->m_disp_ctrl_reg[DC_OUTPUT_CFG] & 0x2) == 0)
r14899r14900
343343   mediagx_state *state = machine.driver_data<mediagx_state>();
344344   int i, j;
345345   const gfx_element *gfx = machine.gfx[0];
346   UINT32 *cga = state->m_cga_ram.target();
346   UINT32 *cga = state->m_cga_ram;
347347   int index = 0;
348348
349349   for (j=0; j < 25; j++)
r14899r14900
12431243      state->m_speedup_hits[idx]++;
12441244      device_spin_until_interrupt(&space->device());
12451245   }
1246   return state->m_main_ram.target()[state->m_speedup_table[idx].offset/4];
1246   return state->m_main_ram[state->m_speedup_table[idx].offset/4];
12471247}
12481248
12491249static READ32_HANDLER( speedup0_r ) { return generic_speedup(space, 0); }
src/mame/drivers/summit.c
r14899r14900
5050   {
5151      for (x=0;x<32;x++)
5252      {
53         int tile = (state->m_vram.target()[count] | ((state->m_attr.target()[count]&1)<<8) );
53         int tile = (state->m_vram[count] | ((state->m_attr[count]&1)<<8) );
5454         drawgfx_opaque(bitmap,cliprect,gfx,tile,0,0,0,x*8,y*8);
5555
5656         count++;
src/mame/drivers/skimaxx.c
r14899r14900
8383// Set up blit parameters
8484WRITE32_MEMBER(skimaxx_state::skimaxx_blitter_w)
8585{
86   UINT32 newdata = COMBINE_DATA( &m_blitter_regs.target()[offset] );
86   UINT32 newdata = COMBINE_DATA( &m_blitter_regs[offset] );
8787
8888   switch (offset)
8989   {
r14899r14900
167167static void skimaxx_to_shiftreg(address_space *space, UINT32 address, UINT16 *shiftreg)
168168{
169169   skimaxx_state *state = space->machine().driver_data<skimaxx_state>();
170   memcpy(shiftreg, &state->m_fg_buffer.target()[TOWORD(address)], 512 * sizeof(UINT16));
170   memcpy(shiftreg, &state->m_fg_buffer[TOWORD(address)], 512 * sizeof(UINT16));
171171}
172172
173173static void skimaxx_from_shiftreg(address_space *space, UINT32 address, UINT16 *shiftreg)
174174{
175175   skimaxx_state *state = space->machine().driver_data<skimaxx_state>();
176   memcpy(&state->m_fg_buffer.target()[TOWORD(address)], shiftreg, 512 * sizeof(UINT16));
176   memcpy(&state->m_fg_buffer[TOWORD(address)], shiftreg, 512 * sizeof(UINT16));
177177}
178178
179179
r14899r14900
191191   if (params->rowaddr >= 0x220)
192192   {
193193      UINT32 rowaddr = (params->rowaddr - 0x220);
194      UINT16 *fg = &state->m_fg_buffer.target()[rowaddr << 8];
194      UINT16 *fg = &state->m_fg_buffer[rowaddr << 8];
195195      UINT32 *bg = &state->m_bg_buffer_front[rowaddr/2 * 1024/2];
196196      UINT16 *dest = &bitmap.pix16(scanline);
197197      //int coladdr = params->coladdr;
src/mame/drivers/mwarr.c
r14899r14900
103103WRITE16_MEMBER(mwarr_state::bg_videoram_w)
104104{
105105
106   COMBINE_DATA(&m_bg_videoram.target()[offset]);
106   COMBINE_DATA(&m_bg_videoram[offset]);
107107   m_bg_tilemap->mark_tile_dirty(offset);
108108}
109109
110110WRITE16_MEMBER(mwarr_state::mlow_videoram_w)
111111{
112112
113   COMBINE_DATA(&m_mlow_videoram.target()[offset]);
113   COMBINE_DATA(&m_mlow_videoram[offset]);
114114   m_mlow_tilemap->mark_tile_dirty(offset);
115115}
116116
117117WRITE16_MEMBER(mwarr_state::mhigh_videoram_w)
118118{
119119
120   COMBINE_DATA(&m_mhigh_videoram.target()[offset]);
120   COMBINE_DATA(&m_mhigh_videoram[offset]);
121121   m_mhigh_tilemap->mark_tile_dirty(offset);
122122}
123123
124124WRITE16_MEMBER(mwarr_state::tx_videoram_w)
125125{
126126
127   COMBINE_DATA(&m_tx_videoram.target()[offset]);
127   COMBINE_DATA(&m_tx_videoram[offset]);
128128   m_tx_tilemap->mark_tile_dirty(offset);
129129}
130130
r14899r14900
157157         /* refresh sprites on screen */
158158         for (i = 0; i < 0x800; i++)
159159         {
160            m_sprites_buffer[i] = m_spriteram.target()[i];
160            m_sprites_buffer[i] = m_spriteram[i];
161161         }
162162         break;
163163
r14899r14900
175175   int i;
176176   double brightness;
177177
178   COMBINE_DATA(&m_mwarr_ram.target()[0x14 / 2]);
178   COMBINE_DATA(&m_mwarr_ram[0x14 / 2]);
179179
180180   brightness = (double)(data & 0xff);
181181   for (i = 0; i < 0x800; i++)
r14899r14900
352352static TILE_GET_INFO( get_bg_tile_info )
353353{
354354   mwarr_state *state = machine.driver_data<mwarr_state>();
355   int tileno = state->m_bg_videoram.target()[tile_index] & 0x1fff;
356   int colour = (state->m_bg_videoram.target()[tile_index] & 0xe000) >> 13;
355   int tileno = state->m_bg_videoram[tile_index] & 0x1fff;
356   int colour = (state->m_bg_videoram[tile_index] & 0xe000) >> 13;
357357
358358   SET_TILE_INFO(4, tileno, colour, 0);
359359}
r14899r14900
361361static TILE_GET_INFO( get_mlow_tile_info )
362362{
363363   mwarr_state *state = machine.driver_data<mwarr_state>();
364   int tileno = state->m_mlow_videoram.target()[tile_index] & 0x1fff;
365   int colour = (state->m_mlow_videoram.target()[tile_index] & 0xe000) >> 13;
364   int tileno = state->m_mlow_videoram[tile_index] & 0x1fff;
365   int colour = (state->m_mlow_videoram[tile_index] & 0xe000) >> 13;
366366
367367   SET_TILE_INFO(3, tileno, colour, 0);
368368}
r14899r14900
370370static TILE_GET_INFO( get_mhigh_tile_info )
371371{
372372   mwarr_state *state = machine.driver_data<mwarr_state>();
373   int tileno = state->m_mhigh_videoram.target()[tile_index] & 0x1fff;
374   int colour = (state->m_mhigh_videoram.target()[tile_index] & 0xe000) >> 13;
373   int tileno = state->m_mhigh_videoram[tile_index] & 0x1fff;
374   int colour = (state->m_mhigh_videoram[tile_index] & 0xe000) >> 13;
375375
376376   SET_TILE_INFO(2, tileno, colour, 0);
377377}
r14899r14900
379379static TILE_GET_INFO( get_tx_tile_info )
380380{
381381   mwarr_state *state = machine.driver_data<mwarr_state>();
382   int tileno = state->m_tx_videoram.target()[tile_index] & 0x1fff;
383   int colour = (state->m_tx_videoram.target()[tile_index] & 0xe000) >> 13;
382   int tileno = state->m_tx_videoram[tile_index] & 0x1fff;
383   int colour = (state->m_tx_videoram[tile_index] & 0xe000) >> 13;
384384
385385   SET_TILE_INFO(1, tileno, colour, 0);
386386}
r14899r14900
483483
484484   screen.machine().priority_bitmap.fill(0, cliprect);
485485
486   if (BIT(state->m_vidattrram.target()[6], 0))
486   if (BIT(state->m_vidattrram[6], 0))
487487   {
488488      for (i = 0; i < 256; i++)
489         state->m_bg_tilemap->set_scrollx(i, state->m_bg_scrollram.target()[i] + 20);
489         state->m_bg_tilemap->set_scrollx(i, state->m_bg_scrollram[i] + 20);
490490   }
491491   else
492492   {
493493      for (i = 0; i < 256; i++)
494         state->m_bg_tilemap->set_scrollx(i, state->m_bg_scrollram.target()[0] + 19);
494         state->m_bg_tilemap->set_scrollx(i, state->m_bg_scrollram[0] + 19);
495495   }
496496
497   if (BIT(state->m_vidattrram.target()[6], 2))
497   if (BIT(state->m_vidattrram[6], 2))
498498   {
499499      for (i = 0; i < 256; i++)
500         state->m_mlow_tilemap->set_scrollx(i, state->m_mlow_scrollram.target()[i] + 19);
500         state->m_mlow_tilemap->set_scrollx(i, state->m_mlow_scrollram[i] + 19);
501501   }
502502   else
503503   {
504504      for (i = 0; i < 256; i++)
505         state->m_mlow_tilemap->set_scrollx(i, state->m_mlow_scrollram.target()[0] + 19);
505         state->m_mlow_tilemap->set_scrollx(i, state->m_mlow_scrollram[0] + 19);
506506   }
507507
508   if (BIT(state->m_vidattrram.target()[6], 4))
508   if (BIT(state->m_vidattrram[6], 4))
509509   {
510510      for (i = 0; i < 256; i++)
511         state->m_mhigh_tilemap->set_scrollx(i, state->m_mhigh_scrollram.target()[i] + 19);
511         state->m_mhigh_tilemap->set_scrollx(i, state->m_mhigh_scrollram[i] + 19);
512512   }
513513   else
514514   {
515515      for (i = 0; i < 256; i++)
516         state->m_mhigh_tilemap->set_scrollx(i, state->m_mhigh_scrollram.target()[0] + 19);
516         state->m_mhigh_tilemap->set_scrollx(i, state->m_mhigh_scrollram[0] + 19);
517517   }
518518
519   state->m_bg_tilemap->set_scrolly(0, state->m_vidattrram.target()[1] + 1);
520   state->m_mlow_tilemap->set_scrolly(0, state->m_vidattrram.target()[2] + 1);
521   state->m_mhigh_tilemap->set_scrolly(0, state->m_vidattrram.target()[3] + 1);
519   state->m_bg_tilemap->set_scrolly(0, state->m_vidattrram[1] + 1);
520   state->m_mlow_tilemap->set_scrolly(0, state->m_vidattrram[2] + 1);
521   state->m_mhigh_tilemap->set_scrolly(0, state->m_vidattrram[3] + 1);
522522
523   state->m_tx_tilemap->set_scrollx(0, state->m_vidattrram.target()[0] + 16);
524   state->m_tx_tilemap->set_scrolly(0, state->m_vidattrram.target()[4] + 1);
523   state->m_tx_tilemap->set_scrollx(0, state->m_vidattrram[0] + 16);
524   state->m_tx_tilemap->set_scrolly(0, state->m_vidattrram[4] + 1);
525525
526526   state->m_bg_tilemap->draw(bitmap, cliprect, 0, 0x01);
527527   state->m_mlow_tilemap->draw(bitmap, cliprect, 0, 0x02);
src/mame/drivers/vroulet.c
r14899r14900
8585
8686WRITE8_MEMBER(vroulet_state::vroulet_videoram_w)
8787{
88   m_videoram.target()[offset] = data;
88   m_videoram[offset] = data;
8989   m_bg_tilemap->mark_tile_dirty(offset);
9090}
9191
9292WRITE8_MEMBER(vroulet_state::vroulet_colorram_w)
9393{
94   m_colorram.target()[offset] = data;
94   m_colorram[offset] = data;
9595   m_bg_tilemap->mark_tile_dirty(offset);
9696}
9797
9898static TILE_GET_INFO( get_bg_tile_info )
9999{
100100   vroulet_state *state = machine.driver_data<vroulet_state>();
101   int attr = state->m_colorram.target()[tile_index];
102   int code = state->m_videoram.target()[tile_index] + ((attr & 0xc0) << 2);
101   int attr = state->m_colorram[tile_index];
102   int code = state->m_videoram[tile_index] + ((attr & 0xc0) << 2);
103103   int color = attr & 0x1f;
104104
105105   SET_TILE_INFO(0, code, color, 0);
r14899r14900
117117   vroulet_state *state = screen.machine().driver_data<vroulet_state>();
118118   state->m_bg_tilemap->draw(bitmap, cliprect, 0, 0);
119119   drawgfx_transpen(bitmap, cliprect, screen.machine().gfx[0], 0x320, 1, 0, 0,
120      state->m_ball.target()[1], state->m_ball.target()[0] - 12, 0);
120      state->m_ball[1], state->m_ball[0] - 12, 0);
121121   return 0;
122122}
123123
src/mame/drivers/coinmvga.c
r14899r14900
258258   {
259259      for (x=0;x<128;x++)
260260      {
261         int tile = state->m_vram.target()[count];
261         int tile = state->m_vram[count];
262262         //int colour = tile>>12;
263263         drawgfx_opaque(bitmap,cliprect,gfx,tile,0,0,0,x*8,y*8);
264264
src/mame/drivers/twins.c
r14899r14900
142142   }
143143
144144   count=0;
145   UINT8 *videoram = reinterpret_cast<UINT8 *>(state->m_videoram.target());
145146   for (y=0;y<yyy;y++)
146147   {
147148      for(x=0;x<xxx;x++)
148149      {
149         bitmap.pix16(y, x) = ((UINT8 *)state->m_videoram.target())[BYTE_XOR_LE(count)];
150         bitmap.pix16(y, x) = videoram[BYTE_XOR_LE(count)];
150151         count++;
151152      }
152153   }
r14899r14900
241242   }
242243
243244   count=0;
245   UINT8 *videoram = reinterpret_cast<UINT8 *>(state->m_videoram.target());
244246   for (y=0;y<yyy;y++)
245247   {
246248      for(x=0;x<xxx;x++)
247249      {
248         bitmap.pix16(y, x) = ((UINT8 *)state->m_videoram.target())[BYTE_XOR_LE(count)];
250         bitmap.pix16(y, x) = videoram[BYTE_XOR_LE(count)];
249251         count++;
250252      }
251253   }
src/mame/drivers/cultures.c
r14899r14900
7373static TILE_GET_INFO( get_bg0_tile_info )
7474{
7575   cultures_state *state = machine.driver_data<cultures_state>();
76   int code = state->m_bg0_videoram.target()[tile_index * 2] + (state->m_bg0_videoram.target()[tile_index * 2 + 1] << 8);
76   int code = state->m_bg0_videoram[tile_index * 2] + (state->m_bg0_videoram[tile_index * 2 + 1] << 8);
7777   SET_TILE_INFO(0, code, code >> 12, 0);
7878}
7979
r14899r14900
102102   int attr;
103103
104104   // tilemaps attributes
105   attr = (state->m_bg0_regs_x.target()[3] & 1 ? TILEMAP_FLIPX : 0) | (state->m_bg0_regs_y.target()[3] & 1 ? TILEMAP_FLIPY : 0);
105   attr = (state->m_bg0_regs_x[3] & 1 ? TILEMAP_FLIPX : 0) | (state->m_bg0_regs_y[3] & 1 ? TILEMAP_FLIPY : 0);
106106   state->m_bg0_tilemap->set_flip(attr);
107107
108   attr = (state->m_bg1_regs_x.target()[3] & 1 ? TILEMAP_FLIPX : 0) | (state->m_bg1_regs_y.target()[3] & 1 ? TILEMAP_FLIPY : 0);
108   attr = (state->m_bg1_regs_x[3] & 1 ? TILEMAP_FLIPX : 0) | (state->m_bg1_regs_y[3] & 1 ? TILEMAP_FLIPY : 0);
109109   state->m_bg1_tilemap->set_flip(attr);
110110
111   attr = (state->m_bg2_regs_x.target()[3] & 1 ? TILEMAP_FLIPX : 0) | (state->m_bg2_regs_y.target()[3] & 1 ? TILEMAP_FLIPY : 0);
111   attr = (state->m_bg2_regs_x[3] & 1 ? TILEMAP_FLIPX : 0) | (state->m_bg2_regs_y[3] & 1 ? TILEMAP_FLIPY : 0);
112112   state->m_bg2_tilemap->set_flip(attr);
113113
114114   // tilemaps scrolls
115   state->m_bg0_tilemap->set_scrollx(0, (state->m_bg0_regs_x.target()[2] << 8) + state->m_bg0_regs_x.target()[0]);
116   state->m_bg1_tilemap->set_scrollx(0, (state->m_bg1_regs_x.target()[2] << 8) + state->m_bg1_regs_x.target()[0]);
117   state->m_bg2_tilemap->set_scrollx(0, (state->m_bg2_regs_x.target()[2] << 8) + state->m_bg2_regs_x.target()[0]);
118   state->m_bg0_tilemap->set_scrolly(0, (state->m_bg0_regs_y.target()[2] << 8) + state->m_bg0_regs_y.target()[0]);
119   state->m_bg1_tilemap->set_scrolly(0, (state->m_bg1_regs_y.target()[2] << 8) + state->m_bg1_regs_y.target()[0]);
120   state->m_bg2_tilemap->set_scrolly(0, (state->m_bg2_regs_y.target()[2] << 8) + state->m_bg2_regs_y.target()[0]);
115   state->m_bg0_tilemap->set_scrollx(0, (state->m_bg0_regs_x[2] << 8) + state->m_bg0_regs_x[0]);
116   state->m_bg1_tilemap->set_scrollx(0, (state->m_bg1_regs_x[2] << 8) + state->m_bg1_regs_x[0]);
117   state->m_bg2_tilemap->set_scrollx(0, (state->m_bg2_regs_x[2] << 8) + state->m_bg2_regs_x[0]);
118   state->m_bg0_tilemap->set_scrolly(0, (state->m_bg0_regs_y[2] << 8) + state->m_bg0_regs_y[0]);
119   state->m_bg1_tilemap->set_scrolly(0, (state->m_bg1_regs_y[2] << 8) + state->m_bg1_regs_y[0]);
120   state->m_bg2_tilemap->set_scrolly(0, (state->m_bg2_regs_y[2] << 8) + state->m_bg2_regs_y[0]);
121121
122122   state->m_bg2_tilemap->draw(bitmap, cliprect, 0, 0);
123123   state->m_bg0_tilemap->draw(bitmap, cliprect, 0, 0);
r14899r14900
149149   }
150150   else
151151   {
152      m_bg0_videoram.target()[offset] = data;
152      m_bg0_videoram[offset] = data;
153153      m_bg0_tilemap->mark_tile_dirty(offset >> 1);
154154   }
155155}
src/mame/drivers/5clown.c
r14899r14900
488488
489489WRITE8_MEMBER(_5clown_state::fclown_videoram_w)
490490{
491   m_videoram.target()[offset] = data;
491   m_videoram[offset] = data;
492492   m_bg_tilemap->mark_tile_dirty(offset);
493493}
494494
495495WRITE8_MEMBER(_5clown_state::fclown_colorram_w)
496496{
497   m_colorram.target()[offset] = data;
497   m_colorram[offset] = data;
498498   m_bg_tilemap->mark_tile_dirty(offset);
499499}
500500
r14899r14900
512512    x--- ----   Extra color for 7's.
513513*/
514514
515   int attr = state->m_colorram.target()[tile_index];
516   int code = ((attr & 0x01) << 8) | ((attr & 0x40) << 2) | state->m_videoram.target()[tile_index];   /* bit 8 for extended char set */
515   int attr = state->m_colorram[tile_index];
516   int code = ((attr & 0x01) << 8) | ((attr & 0x40) << 2) | state->m_videoram[tile_index];   /* bit 8 for extended char set */
517517   int bank = (attr & 0x02) >> 1;                                       /* bit 1 switch the gfx banks */
518518   int color = (attr & 0x3c) >> 2 | ((attr & 0x80) >> 3);                     /* bits 2-3-4-5-7 for color */
519519
src/mame/drivers/tgtpanic.c
r14899r14900
4646
4747   for (offs = 0; offs < 0x2000; ++offs)
4848   {
49      UINT8 val = state->m_ram.target()[offs];
49      UINT8 val = state->m_ram[offs];
5050
5151      y = (offs & 0x7f) << 1;
5252      x = (offs >> 7) << 2;
src/mame/drivers/superdq.c
r14899r14900
5151static TILE_GET_INFO( get_tile_info )
5252{
5353   superdq_state *state = machine.driver_data<superdq_state>();
54   int tile = state->m_videoram.target()[tile_index];
54   int tile = state->m_videoram[tile_index];
5555
5656   SET_TILE_INFO(0, tile, state->m_color_bank, 0);
5757}
r14899r14900
147147WRITE8_MEMBER(superdq_state::superdq_videoram_w)
148148{
149149
150   m_videoram.target()[offset] = data;
150   m_videoram[offset] = data;
151151   m_tilemap->mark_tile_dirty(offset);
152152}
153153
src/mame/drivers/bestleag.c
r14899r14900
5454static TILE_GET_INFO( get_tx_tile_info )
5555{
5656   bestleag_state *state = machine.driver_data<bestleag_state>();
57   int code = state->m_txram.target()[tile_index];
57   int code = state->m_txram[tile_index];
5858
5959   SET_TILE_INFO(
6060         0,
r14899r14900
6666static TILE_GET_INFO( get_bg_tile_info )
6767{
6868   bestleag_state *state = machine.driver_data<bestleag_state>();
69   int code = state->m_bgram.target()[tile_index];
69   int code = state->m_bgram[tile_index];
7070
7171   SET_TILE_INFO(
7272         1,
r14899r14900
7878static TILE_GET_INFO( get_fg_tile_info )
7979{
8080   bestleag_state *state = machine.driver_data<bestleag_state>();
81   int code = state->m_fgram.target()[tile_index];
81   int code = state->m_fgram[tile_index];
8282
8383   SET_TILE_INFO(
8484         1,
r14899r14900
117117static void draw_sprites(running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect)
118118{
119119   bestleag_state *state = machine.driver_data<bestleag_state>();
120   UINT16 *spriteram16 = state->m_spriteram.target();
120   UINT16 *spriteram16 = state->m_spriteram;
121121
122122   /*
123123
r14899r14900
140140         return;
141141
142142      /* it can change sprites color mask like the original set */
143      if(state->m_vregs.target()[0x00/2] & 0x1000)
143      if(state->m_vregs[0x00/2] & 0x1000)
144144         color &= 7;
145145
146146      drawgfx_transpen(bitmap,cliprect,machine.gfx[2],
r14899r14900
173173static SCREEN_UPDATE_IND16(bestleag)
174174{
175175   bestleag_state *state = screen.machine().driver_data<bestleag_state>();
176   state->m_bg_tilemap->set_scrollx(0,(state->m_vregs.target()[0x00/2] & 0xfff) + (state->m_vregs.target()[0x08/2] & 0x7) - 3);
177   state->m_bg_tilemap->set_scrolly(0,state->m_vregs.target()[0x02/2]);
178   state->m_tx_tilemap->set_scrollx(0,state->m_vregs.target()[0x04/2]);
179   state->m_tx_tilemap->set_scrolly(0,state->m_vregs.target()[0x06/2]);
180   state->m_fg_tilemap->set_scrollx(0,state->m_vregs.target()[0x08/2] & 0xfff8);
181   state->m_fg_tilemap->set_scrolly(0,state->m_vregs.target()[0x0a/2]);
176   state->m_bg_tilemap->set_scrollx(0,(state->m_vregs[0x00/2] & 0xfff) + (state->m_vregs[0x08/2] & 0x7) - 3);
177   state->m_bg_tilemap->set_scrolly(0,state->m_vregs[0x02/2]);
178   state->m_tx_tilemap->set_scrollx(0,state->m_vregs[0x04/2]);
179   state->m_tx_tilemap->set_scrolly(0,state->m_vregs[0x06/2]);
180   state->m_fg_tilemap->set_scrollx(0,state->m_vregs[0x08/2] & 0xfff8);
181   state->m_fg_tilemap->set_scrolly(0,state->m_vregs[0x0a/2]);
182182
183183   state->m_bg_tilemap->draw(bitmap, cliprect, 0,0);
184184   state->m_fg_tilemap->draw(bitmap, cliprect, 0,0);
r14899r14900
190190static SCREEN_UPDATE_IND16(bestleaw)
191191{
192192   bestleag_state *state = screen.machine().driver_data<bestleag_state>();
193   state->m_bg_tilemap->set_scrollx(0,state->m_vregs.target()[0x08/2]);
194   state->m_bg_tilemap->set_scrolly(0,state->m_vregs.target()[0x0a/2]);
195   state->m_tx_tilemap->set_scrollx(0,state->m_vregs.target()[0x00/2]);
196   state->m_tx_tilemap->set_scrolly(0,state->m_vregs.target()[0x02/2]);
197   state->m_fg_tilemap->set_scrollx(0,state->m_vregs.target()[0x04/2]);
198   state->m_fg_tilemap->set_scrolly(0,state->m_vregs.target()[0x06/2]);
193   state->m_bg_tilemap->set_scrollx(0,state->m_vregs[0x08/2]);
194   state->m_bg_tilemap->set_scrolly(0,state->m_vregs[0x0a/2]);
195   state->m_tx_tilemap->set_scrollx(0,state->m_vregs[0x00/2]);
196   state->m_tx_tilemap->set_scrolly(0,state->m_vregs[0x02/2]);
197   state->m_fg_tilemap->set_scrollx(0,state->m_vregs[0x04/2]);
198   state->m_fg_tilemap->set_scrolly(0,state->m_vregs[0x06/2]);
199199
200200   state->m_bg_tilemap->draw(bitmap, cliprect, 0,0);
201201   state->m_fg_tilemap->draw(bitmap, cliprect, 0,0);
r14899r14900
206206
207207WRITE16_MEMBER(bestleag_state::bestleag_txram_w)
208208{
209   m_txram.target()[offset] = data;
209   m_txram[offset] = data;
210210   m_tx_tilemap->mark_tile_dirty(offset);
211211}
212212
213213WRITE16_MEMBER(bestleag_state::bestleag_bgram_w)
214214{
215   m_bgram.target()[offset] = data;
215   m_bgram[offset] = data;
216216   m_bg_tilemap->mark_tile_dirty(offset);
217217}
218218
219219WRITE16_MEMBER(bestleag_state::bestleag_fgram_w)
220220{
221   m_fgram.target()[offset] = data;
221   m_fgram[offset] = data;
222222   m_fg_tilemap->mark_tile_dirty(offset);
223223}
224224
src/mame/drivers/tomcat.c
r14899r14900
255255
256256READ16_MEMBER(tomcat_state::tomcat_shared_ram_r)
257257{
258   return m_shared_ram.target()[offset];
258   return m_shared_ram[offset];
259259}
260260
261261WRITE16_MEMBER(tomcat_state::tomcat_shared_ram_w)
262262{
263   COMBINE_DATA(&m_shared_ram.target()[offset]);
263   COMBINE_DATA(&m_shared_ram[offset]);
264264}
265265
266266READ8_MEMBER(tomcat_state::tomcat_nvram_r)
r14899r14900
358358static MACHINE_START(tomcat)
359359{
360360   tomcat_state *state = machine.driver_data<tomcat_state>();
361   ((UINT16*)state->m_shared_ram.target())[0x0000] = 0xf600;
362   ((UINT16*)state->m_shared_ram.target())[0x0001] = 0x0000;
363   ((UINT16*)state->m_shared_ram.target())[0x0002] = 0xf600;
364   ((UINT16*)state->m_shared_ram.target())[0x0003] = 0x0000;
361   ((UINT16*)state->m_shared_ram)[0x0000] = 0xf600;
362   ((UINT16*)state->m_shared_ram)[0x0001] = 0x0000;
363   ((UINT16*)state->m_shared_ram)[0x0002] = 0xf600;
364   ((UINT16*)state->m_shared_ram)[0x0003] = 0x0000;
365365
366366   machine.device<nvram_device>("nvram")->set_base(state->m_nvram, 0x800);
367367
src/mame/drivers/xtheball.c
r14899r14900
4242static void xtheball_scanline_update(screen_device &screen, bitmap_rgb32 &bitmap, int scanline, const tms34010_display_params *params)
4343{
4444   xtheball_state *state = screen.machine().driver_data<xtheball_state>();
45   UINT16 *srcbg = &state->m_vram_bg.target()[(params->rowaddr << 8) & 0xff00];
45   UINT16 *srcbg = &state->m_vram_bg[(params->rowaddr << 8) & 0xff00];
4646   UINT32 *dest = &bitmap.pix32(scanline);
4747   const rgb_t *pens = tlc34076_get_pens(screen.machine().device("tlc34076"));
4848   int coladdr = params->coladdr;
r14899r14900
5252   if (!state->m_bitvals[0x13])
5353   {
5454      /* mode 0: foreground is the same as background */
55      UINT16 *srcfg = &state->m_vram_fg.target()[(params->rowaddr << 8) & 0xff00];
55      UINT16 *srcfg = &state->m_vram_fg[(params->rowaddr << 8) & 0xff00];
5656
5757      for (x = params->heblnk; x < params->hsblnk; x += 2, coladdr++)
5858      {
r14899r14900
6767   {
6868      /* mode 1: foreground is half background resolution in */
6969      /* X and supports two pages */
70      UINT16 *srcfg = &state->m_vram_fg.target()[(params->rowaddr << 7) & 0xff00];
70      UINT16 *srcfg = &state->m_vram_fg[(params->rowaddr << 7) & 0xff00];
7171
7272      for (x = params->heblnk; x < params->hsblnk; x += 2, coladdr++)
7373      {
r14899r14900
9393{
9494   xtheball_state *state = space->machine().driver_data<xtheball_state>();
9595   if (address >= 0x01000000 && address <= 0x010fffff)
96      memcpy(shiftreg, &state->m_vram_bg.target()[TOWORD(address & 0xff000)], TOBYTE(0x1000));
96      memcpy(shiftreg, &state->m_vram_bg[TOWORD(address & 0xff000)], TOBYTE(0x1000));
9797   else if (address >= 0x02000000 && address <= 0x020fffff)
98      memcpy(shiftreg, &state->m_vram_fg.target()[TOWORD(address & 0xff000)], TOBYTE(0x1000));
98      memcpy(shiftreg, &state->m_vram_fg[TOWORD(address & 0xff000)], TOBYTE(0x1000));
9999   else
100100      logerror("%s:xtheball_to_shiftreg(%08X)\n", space->machine().describe_context(), address);
101101}
r14899r14900
105105{
106106   xtheball_state *state = space->machine().driver_data<xtheball_state>();
107107   if (address >= 0x01000000 && address <= 0x010fffff)
108      memcpy(&state->m_vram_bg.target()[TOWORD(address & 0xff000)], shiftreg, TOBYTE(0x1000));
108      memcpy(&state->m_vram_bg[TOWORD(address & 0xff000)], shiftreg, TOBYTE(0x1000));
109109   else if (address >= 0x02000000 && address <= 0x020fffff)
110      memcpy(&state->m_vram_fg.target()[TOWORD(address & 0xff000)], shiftreg, TOBYTE(0x1000));
110      memcpy(&state->m_vram_fg[TOWORD(address & 0xff000)], shiftreg, TOBYTE(0x1000));
111111   else
112112      logerror("%s:xtheball_from_shiftreg(%08X)\n", space->machine().describe_context(), address);
113113}
src/mame/drivers/cesclass.c
r14899r14900
7575            {
7676               UINT8 color;
7777
78               color = (((m_vram.target()[x+y*16+0x400])>>(15-xi)) & 1);
79               color |= (((m_vram.target()[x+y*16])>>(15-xi)) & 1)<<1;
78               color = (((m_vram[x+y*16+0x400])>>(15-xi)) & 1);
79               color |= (((m_vram[x+y*16])>>(15-xi)) & 1)<<1;
8080
8181               if((x*16+xi)<256 && ((y)+0)<256)
8282                  bitmap.pix32(y, x*16+xi) = machine().pens[color];
src/mame/drivers/cybertnk.c
r14899r14900
201201static TILE_GET_INFO( get_tx_tile_info )
202202{
203203   cybertnk_state *state = machine.driver_data<cybertnk_state>();
204   int code = state->m_tx_vram.target()[tile_index];
204   int code = state->m_tx_vram[tile_index];
205205   SET_TILE_INFO(
206206         0,
207207         code & 0x1fff,
r14899r14900
238238
239239      for (i=0;i<0x1000/4;i+=4)
240240      {
241         UINT16 param1 = state->m_roadram.target()[i+2];
242         UINT16 param2 = state->m_roadram.target()[i+0];
241         UINT16 param1 = state->m_roadram[i+2];
242         UINT16 param2 = state->m_roadram[i+0];
243243
244244         drawgfx_transpen(bitmap,cliprect,gfx,param1,0x23,0,0,-param2+screen_shift,i/4,0);
245245
r14899r14900
259259      {
260260         for (x=0;x<128;x++)
261261         {
262            UINT16 tile = state->m_bg_vram.target()[count] & 0x1fff;
263            UINT16 color = (state->m_fg_vram.target()[count] & 0xe000) >> 13;
262            UINT16 tile = state->m_bg_vram[count] & 0x1fff;
263            UINT16 color = (state->m_fg_vram[count] & 0xe000) >> 13;
264264
265265            drawgfx_transpen(bitmap,cliprect,gfx,tile,color+0x194,0,0,(x*8)+screen_shift,(y*8),0);
266266
r14899r14900
280280      {
281281         for (x=0;x<128;x++)
282282         {
283            UINT16 tile = state->m_fg_vram.target()[count] & 0x1fff;
284            UINT16 color = (state->m_fg_vram.target()[count] & 0xe000) >> 13;
283            UINT16 tile = state->m_fg_vram[count] & 0x1fff;
284            UINT16 color = (state->m_fg_vram[count] & 0xe000) >> 13;
285285
286286            drawgfx_transpen(bitmap,cliprect,gfx,tile,color+0x1c0,0,0,(x*8)+screen_shift,(y*8),0);
287287
r14899r14900
301301
302302      for(offs=0;offs<0x1000/2;offs+=8)
303303      {
304         z = (state->m_spr_ram.target()[offs+(0x6/2)] & 0xffff);
305         if(z == 0xffff || state->m_spr_ram.target()[offs+(0x0/2)] == 0x0000) //TODO: check the correct bit
304         z = (state->m_spr_ram[offs+(0x6/2)] & 0xffff);
305         if(z == 0xffff || state->m_spr_ram[offs+(0x0/2)] == 0x0000) //TODO: check the correct bit
306306            continue;
307         x = (state->m_spr_ram.target()[offs+(0xa/2)] & 0x3ff);
308         y = (state->m_spr_ram.target()[offs+(0x4/2)] & 0xff);
309         if(state->m_spr_ram.target()[offs+(0x4/2)] & 0x100)
307         x = (state->m_spr_ram[offs+(0xa/2)] & 0x3ff);
308         y = (state->m_spr_ram[offs+(0x4/2)] & 0xff);
309         if(state->m_spr_ram[offs+(0x4/2)] & 0x100)
310310            y = 0x100 - y;
311         spr_offs = (((state->m_spr_ram.target()[offs+(0x0/2)] & 7) << 16) | (state->m_spr_ram.target()[offs+(0x2/2)])) << 2;
312         xsize = ((state->m_spr_ram.target()[offs+(0xc/2)] & 0x000f)+1) << 3;
313         ysize = (state->m_spr_ram.target()[offs+(0x8/2)] & 0x00ff)+1;
314         fx = (state->m_spr_ram.target()[offs+(0xa/2)] & 0x8000) >> 15;
315         zoom = (state->m_spr_ram.target()[offs+(0xc/2)] & 0xff00) >> 8;
311         spr_offs = (((state->m_spr_ram[offs+(0x0/2)] & 7) << 16) | (state->m_spr_ram[offs+(0x2/2)])) << 2;
312         xsize = ((state->m_spr_ram[offs+(0xc/2)] & 0x000f)+1) << 3;
313         ysize = (state->m_spr_ram[offs+(0x8/2)] & 0x00ff)+1;
314         fx = (state->m_spr_ram[offs+(0xa/2)] & 0x8000) >> 15;
315         zoom = (state->m_spr_ram[offs+(0xc/2)] & 0xff00) >> 8;
316316
317         col_bank = (state->m_spr_ram.target()[offs+(0x0/2)] & 0xff00) >> 8;
317         col_bank = (state->m_spr_ram[offs+(0x0/2)] & 0xff00) >> 8;
318318
319319         xf = 0;
320320         yf = 0;
r14899r14900
522522
523523WRITE16_MEMBER(cybertnk_state::tx_vram_w)
524524{
525   COMBINE_DATA(&m_tx_vram.target()[offset]);
525   COMBINE_DATA(&m_tx_vram[offset]);
526526   m_tx_tilemap->mark_tile_dirty(offset);
527527}
528528
r14899r14900
537537      // 0x001100D5 is controller data
538538      // 0x00110004 low is controller data ready
539539      case 4/2:
540         switch( (m_io_ram.target()[6/2]) & 0xff )
540         switch( (m_io_ram[6/2]) & 0xff )
541541         {
542542            case 0:
543               m_io_ram.target()[0xd4/2] = input_port_read(machine(), "TRAVERSE");
543               m_io_ram[0xd4/2] = input_port_read(machine(), "TRAVERSE");
544544               break;
545545
546546            case 0x20:
547               m_io_ram.target()[0xd4/2] = input_port_read(machine(), "ELEVATE");
547               m_io_ram[0xd4/2] = input_port_read(machine(), "ELEVATE");
548548               break;
549549
550550            case 0x40:
551               m_io_ram.target()[0xd4/2] = input_port_read(machine(), "ACCEL");
551               m_io_ram[0xd4/2] = input_port_read(machine(), "ACCEL");
552552               break;
553553
554554            case 0x42:
r14899r14900
556556               // controller return value is stored in $42(a6)
557557               // but I don't see it referenced again.
558558               //popmessage("unknown controller device 0x42");
559               m_io_ram.target()[0xd4/2] = 0;
559               m_io_ram[0xd4/2] = 0;
560560               break;
561561
562562            case 0x60:
563               m_io_ram.target()[0xd4/2] = input_port_read(machine(), "HANDLE");
563               m_io_ram[0xd4/2] = input_port_read(machine(), "HANDLE");
564564               break;
565565
566566            //default:
r14899r14900
578578         return input_port_read(machine(), "DSW2");
579579
580580      case 0xd4/2:
581         return m_io_ram.target()[offset]; // controller data
581         return m_io_ram[offset]; // controller data
582582
583583      default:
584584      {
585585         //popmessage("unknown io read 0x%08x", offset);
586         return m_io_ram.target()[offset];
586         return m_io_ram[offset];
587587      }
588588   }
589589}
590590
591591WRITE16_MEMBER(cybertnk_state::io_w)
592592{
593   COMBINE_DATA(&m_io_ram.target()[offset]);
593   COMBINE_DATA(&m_io_ram[offset]);
594594
595595   switch( offset )
596596   {
r14899r14900
651651      case 0x80/2:
652652      case 0x82/2:
653653      case 0x84/2:
654         popmessage("%02x %02x %02x %02x %02x %02x %02x",m_io_ram.target()[0x40/2],m_io_ram.target()[0x42/2],m_io_ram.target()[0x44/2],m_io_ram.target()[0x46/2],m_io_ram.target()[0x48/2],m_io_ram.target()[0x4a/2],m_io_ram.target()[0x4c/2]);
654         popmessage("%02x %02x %02x %02x %02x %02x %02x",m_io_ram[0x40/2],m_io_ram[0x42/2],m_io_ram[0x44/2],m_io_ram[0x46/2],m_io_ram[0x48/2],m_io_ram[0x4a/2],m_io_ram[0x4c/2]);
655655         break;
656656
657657      default:
r14899r14900
662662
663663READ8_MEMBER(cybertnk_state::soundport_r)
664664{
665   return m_io_ram.target()[0] & 0xff;
665   return m_io_ram[0] & 0xff;
666666}
667667
668668static ADDRESS_MAP_START( master_mem, AS_PROGRAM, 16, cybertnk_state )
src/mame/drivers/pipeline.c
r14899r14900
100100static TILE_GET_INFO( get_tile_info )
101101{
102102   pipeline_state *state = machine.driver_data<pipeline_state>();
103   int code = state->m_vram2.target()[tile_index]+state->m_vram2.target()[tile_index+0x800]*256;
103   int code = state->m_vram2[tile_index]+state->m_vram2[tile_index+0x800]*256;
104104   SET_TILE_INFO(
105105      0,
106106      code,
r14899r14900
111111static TILE_GET_INFO( get_tile_info2 )
112112{
113113   pipeline_state *state = machine.driver_data<pipeline_state>();
114   int code =state->m_vram1.target()[tile_index]+((state->m_vram1.target()[tile_index+0x800]>>4))*256;
115   int color=((state->m_vram1.target()[tile_index+0x800])&0xf);
114   int code =state->m_vram1[tile_index]+((state->m_vram1[tile_index+0x800]>>4))*256;
115   int color=((state->m_vram1[tile_index+0x800])&0xf);
116116   SET_TILE_INFO
117117   (
118118      1,
r14899r14900
151151   if(!(m_vidctrl&1))
152152   {
153153      m_tilemap1->mark_tile_dirty(offset&0x7ff);
154      m_vram2.target()[offset]=data;
154      m_vram2[offset]=data;
155155   }
156156   else
157157   {
r14899r14900
167167WRITE8_MEMBER(pipeline_state::vram1_w)
168168{
169169   m_tilemap2->mark_tile_dirty(offset&0x7ff);
170   m_vram1.target()[offset]=data;
170   m_vram1[offset]=data;
171171}
172172
173173static READ8_DEVICE_HANDLER(protection_r)
src/mame/drivers/pinkiri8.c
r14899r14900
4040public:
4141   pinkiri8_state(const machine_config &mconfig, device_type type, const char *tag)
4242      : driver_device(mconfig, type, tag) ,
43      m_janshi_back_vram(*this, "janshi_back_vram"),
44      m_janshi_vram1(*this, "janshi_vram1"),
45      m_janshi_unk1(*this, "janshi_unk1"),
46      m_janshi_widthflags(*this, "janshi_widthflags"),
47      m_janshi_unk2(*this, "janshi_unk2"),
48      m_janshi_vram2(*this, "janshi_vram2"),
49      m_janshi_crtc_regs(*this, "janshi_crtc_regs"){ }
43      m_janshi_back_vram(*this, "back_vram"),
44      m_janshi_vram1(*this, "vram1"),
45      m_janshi_unk1(*this, "unk1"),
46      m_janshi_widthflags(*this, "widthflags"),
47      m_janshi_unk2(*this, "unk2"),
48      m_janshi_vram2(*this, "vram2"),
49      m_janshi_crtc_regs(*this, "crtc_regs"){ }
5050
5151   required_shared_ptr<UINT8> m_janshi_back_vram;
5252   required_shared_ptr<UINT8> m_janshi_vram1;
r14899r14900
7575
7676static ADDRESS_MAP_START( janshi_vdp_map8, AS_0, 8, pinkiri8_state )
7777
78   AM_RANGE(0xfc0000, 0xfc1fff) AM_RAM AM_SHARE("janshi_back_vram") // bg tilemap?
79   AM_RANGE(0xfc2000, 0xfc2fff) AM_RAM AM_SHARE("janshi_vram1") // xpos, colour, tile number etc.
78   AM_RANGE(0xfc0000, 0xfc1fff) AM_RAM AM_SHARE("back_vram") // bg tilemap?
79   AM_RANGE(0xfc2000, 0xfc2fff) AM_RAM AM_SHARE("vram1") // xpos, colour, tile number etc.
8080
81   AM_RANGE(0xfc3700, 0xfc377f) AM_RAM AM_SHARE("janshi_unk1") // ?? height related?
82   AM_RANGE(0xfc3780, 0xfc37bf) AM_RAM AM_SHARE("janshi_widthflags")
83   AM_RANGE(0xfc37c0, 0xfc37ff) AM_RAM AM_SHARE("janshi_unk2") // 2x increasing tables 00 10 20 30 etc.
81   AM_RANGE(0xfc3700, 0xfc377f) AM_RAM AM_SHARE("unk1") // ?? height related?
82   AM_RANGE(0xfc3780, 0xfc37bf) AM_RAM AM_SHARE("widthflags")
83   AM_RANGE(0xfc37c0, 0xfc37ff) AM_RAM AM_SHARE("unk2") // 2x increasing tables 00 10 20 30 etc.
8484
85   AM_RANGE(0xfc3800, 0xfc3fff) AM_RAM AM_SHARE("janshi_vram2") // y pos + unknown
85   AM_RANGE(0xfc3800, 0xfc3fff) AM_RAM AM_SHARE("vram2") // y pos + unknown
8686
8787   AM_RANGE(0xff0000, 0xff07ff) AM_RAM_WRITE(paletteram_xBBBBBGGGGGRRRRR_byte_split_lo_w) AM_SHARE("paletteram")
8888   AM_RANGE(0xff2000, 0xff27ff) AM_RAM_WRITE(paletteram_xBBBBBGGGGGRRRRR_byte_split_hi_w) AM_SHARE("paletteram2")
8989
90   AM_RANGE(0xff6000, 0xff601f) AM_RAM AM_SHARE("janshi_crtc_regs")
90   AM_RANGE(0xff6000, 0xff601f) AM_RAM AM_SHARE("crtc_regs")
9191ADDRESS_MAP_END
9292
9393
r14899r14900
205205      for (i=0x00;i<0x40;i+=2)
206206      {
207207
208         printf("%02x, ", state->m_janshi_widthflags.target()[i+1]);
208         printf("%02x, ", state->m_janshi_widthflags[i+1]);
209209
210210         count2++;
211211
r14899r14900
223223
224224
225225
226   //popmessage("%02x",state->m_janshi_crtc_regs.target()[0x0a]);
227   col_bank = (state->m_janshi_crtc_regs.target()[0x0a] & 0x40) >> 6;
226   //popmessage("%02x",state->m_janshi_crtc_regs[0x0a]);
227   col_bank = (state->m_janshi_crtc_regs[0x0a] & 0x40) >> 6;
228228
229229   bitmap.fill(get_black_pen(screen.machine()), cliprect);
230230
r14899r14900
238238      {
239239         for(x=0;x<32;x++)
240240         {
241            tile = state->m_janshi_back_vram.target()[count+1]<<8 | state->m_janshi_back_vram.target()[count+0];
242            attr = state->m_janshi_back_vram.target()[count+2] ^ 0xf0;
241            tile = state->m_janshi_back_vram[count+1]<<8 | state->m_janshi_back_vram[count+0];
242            attr = state->m_janshi_back_vram[count+2] ^ 0xf0;
243243            col = (attr >> 4) | 0x10;
244244
245245            drawgfx_transpen(bitmap,cliprect,gfx,tile,col,0,0,x*16,y*8,0);
r14899r14900
275275
276276          */
277277
278         spr_offs = ((state->m_janshi_vram1.target()[(i*4)+0] & 0xff) | (state->m_janshi_vram1.target()[(i*4)+1]<<8)) & 0xffff;
279         col = (state->m_janshi_vram1.target()[(i*4)+2] & 0xf8) >> 3;
280         x =   state->m_janshi_vram1.target()[(i*4)+3];
278         spr_offs = ((state->m_janshi_vram1[(i*4)+0] & 0xff) | (state->m_janshi_vram1[(i*4)+1]<<8)) & 0xffff;
279         col = (state->m_janshi_vram1[(i*4)+2] & 0xf8) >> 3;
280         x =   state->m_janshi_vram1[(i*4)+3];
281281
282282         x &= 0xff;
283283         x *= 2;
284284
285//          unk2 = state->m_janshi_vram2.target()[(i*2)+1];
286         y = (state->m_janshi_vram2.target()[(i*2)+0]);
285//          unk2 = state->m_janshi_vram2[(i*2)+1];
286         y = (state->m_janshi_vram2[(i*2)+0]);
287287
288288         y = 0x100-y;
289289
r14899r14900
296296
297297
298298         // these bits seem to somehow determine the sprite height / widths for the sprite ram region?
299         int bit = state->m_janshi_widthflags.target()[(i/0x20)*2 + 1];
299         int bit = state->m_janshi_widthflags[(i/0x20)*2 + 1];
300300
301301         if (bit)
302302         {
src/mame/drivers/chanbara.c
r14899r14900
103103WRITE8_MEMBER(chanbara_state::chanbara_videoram_w)
104104{
105105
106   m_videoram.target()[offset] = data;
106   m_videoram[offset] = data;
107107   m_bg_tilemap->mark_tile_dirty(offset);
108108}
109109
110110WRITE8_MEMBER(chanbara_state::chanbara_colorram_w)
111111{
112112
113   m_colorram.target()[offset] = data;
113   m_colorram[offset] = data;
114114   m_bg_tilemap->mark_tile_dirty(offset);
115115}
116116
117117WRITE8_MEMBER(chanbara_state::chanbara_videoram2_w)
118118{
119119
120   m_videoram2.target()[offset] = data;
120   m_videoram2[offset] = data;
121121   m_bg2_tilemap->mark_tile_dirty(offset);
122122}
123123
124124WRITE8_MEMBER(chanbara_state::chanbara_colorram2_w)
125125{
126126
127   m_colorram2.target()[offset] = data;
127   m_colorram2[offset] = data;
128128   m_bg2_tilemap->mark_tile_dirty(offset);
129129}
130130
r14899r14900
132132static TILE_GET_INFO( get_bg_tile_info )
133133{
134134   chanbara_state *state = machine.driver_data<chanbara_state>();
135   int code = state->m_videoram.target()[tile_index] + ((state->m_colorram.target()[tile_index] & 1) << 8);
136   int color = (state->m_colorram.target()[tile_index] >> 1) & 0x1f;
135   int code = state->m_videoram[tile_index] + ((state->m_colorram[tile_index] & 1) << 8);
136   int color = (state->m_colorram[tile_index] >> 1) & 0x1f;
137137
138138   SET_TILE_INFO(0, code, color, 0);
139139}
r14899r14900
141141static TILE_GET_INFO( get_bg2_tile_info )
142142{
143143   chanbara_state *state = machine.driver_data<chanbara_state>();
144   int code = state->m_videoram2.target()[tile_index];
145   int color = (state->m_colorram2.target()[tile_index] >> 1) & 0x1f;
144   int code = state->m_videoram2[tile_index];
145   int color = (state->m_colorram2[tile_index] >> 1) & 0x1f;
146146
147147   SET_TILE_INFO(2, code, color, 0);
148148}
r14899r14900
162162
163163   for (offs = 0; offs < 0x80; offs += 4)
164164   {
165      if (state->m_spriteram.target()[offs + 0x80] & 0x80)
165      if (state->m_spriteram[offs + 0x80] & 0x80)
166166      {
167         int attr = state->m_spriteram.target()[offs + 0];
168         int code = state->m_spriteram.target()[offs + 1];
169         int color = state->m_spriteram.target()[offs + 0x80] & 0x1f;
167         int attr = state->m_spriteram[offs + 0];
168         int code = state->m_spriteram[offs + 1];
169         int color = state->m_spriteram[offs + 0x80] & 0x1f;
170170         int flipx = 0;
171171         int flipy = attr & 2;
172         int sx = 240 - state->m_spriteram.target()[offs + 3];
173         int sy = 232 - state->m_spriteram.target()[offs + 2];
172         int sx = 240 - state->m_spriteram[offs + 3];
173         int sy = 232 - state->m_spriteram[offs + 2];
174174
175175         sy+=16;
176176
177         if (state->m_spriteram.target()[offs + 0x80] & 0x10) code += 0x200;
178         if (state->m_spriteram.target()[offs + 0x80] & 0x20) code += 0x400;
179         if (state->m_spriteram.target()[offs + 0x80] & 0x40) code += 0x100;
177         if (state->m_spriteram[offs + 0x80] & 0x10) code += 0x200;
178         if (state->m_spriteram[offs + 0x80] & 0x20) code += 0x400;
179         if (state->m_spriteram[offs + 0x80] & 0x40) code += 0x100;
180180
181181         if (attr & 0x10)
182182         {
src/mame/drivers/m14.c
r14899r14900
109109{
110110   m14_state *state = machine.driver_data<m14_state>();
111111
112   int code = state->m_video_ram.target()[tile_index];
113   int color = state->m_color_ram.target()[tile_index] & 0x0f;
112   int code = state->m_video_ram[tile_index];
113   int color = state->m_color_ram[tile_index] & 0x0f;
114114
115115   /* colorram & 0xf0 used but unknown purpose*/
116116
r14899r14900
140140WRITE8_MEMBER(m14_state::m14_vram_w)
141141{
142142
143   m_video_ram.target()[offset] = data;
143   m_video_ram[offset] = data;
144144   m_m14_tilemap->mark_tile_dirty(offset);
145145}
146146
147147WRITE8_MEMBER(m14_state::m14_cram_w)
148148{
149149
150   m_color_ram.target()[offset] = data;
150   m_color_ram[offset] = data;
151151   m_m14_tilemap->mark_tile_dirty(offset);
152152}
153153
src/mame/drivers/photon2.c
r14899r14900
133133    unsigned char *attr, *scr;
134134//  int full_refresh = 1;
135135
136    scr=state->m_spectrum_video_ram.target();
136    scr=state->m_spectrum_video_ram;
137137
138138   bitmap.fill(state->m_spectrum_port_fe & 0x07, cliprect);
139139
src/mame/drivers/highvdeo.c
r14899r14900
141141      {
142142         UINT32 color;
143143
144         color = ((state->m_blit_ram.target()[count]) & 0x00ff)>>0;
144         color = ((state->m_blit_ram[count]) & 0x00ff)>>0;
145145
146146         if(cliprect.contains((x*2)+0, y))
147147            bitmap.pix32(y, (x*2)+0) = screen.machine().pens[color];
148148
149         color = ((state->m_blit_ram.target()[count]) & 0xff00)>>8;
149         color = ((state->m_blit_ram[count]) & 0xff00)>>8;
150150
151151         if(cliprect.contains((x*2)+1, y))
152152            bitmap.pix32(y, (x*2)+1) = screen.machine().pens[color];
r14899r14900
175175         UINT32 g;
176176         UINT32 r;
177177
178         color = (state->m_blit_ram.target()[count]) & 0xffff;
178         color = (state->m_blit_ram[count]) & 0xffff;
179179
180180         b = (color & 0x001f) << 3;
181181         g = (color & 0x07e0) >> 3;
src/mame/drivers/nsmpoker.c
r14899r14900
8989
9090WRITE8_MEMBER(nsmpoker_state::nsmpoker_videoram_w)
9191{
92   m_videoram.target()[offset] = data;
92   m_videoram[offset] = data;
9393   m_bg_tilemap->mark_tile_dirty(offset);
9494}
9595
9696
9797WRITE8_MEMBER(nsmpoker_state::nsmpoker_colorram_w)
9898{
99   m_colorram.target()[offset] = data;
99   m_colorram[offset] = data;
100100   m_bg_tilemap->mark_tile_dirty(offset);
101101}
102102
r14899r14900
110110    ---- ----   color code.
111111    ---- ----   seems unused.
112112*/
113//  int attr = state->m_colorram.target()[tile_index];
114   int code = state->m_videoram.target()[tile_index];
113//  int attr = state->m_colorram[tile_index];
114   int code = state->m_videoram[tile_index];
115115//  int bank = (attr & 0x08) >> 3;
116116//  int color = (attr & 0x03);
117117
src/mame/drivers/othello.c
r14899r14900
104104
105105   for(cx = 0; cx < x_count; ++cx)
106106   {
107      data_address = ((state->m_videoram.target()[ma + cx] + state->m_tile_bank) << 4) | ra;
107      data_address = ((state->m_videoram[ma + cx] + state->m_tile_bank) << 4) | ra;
108108      tmp = gfx[data_address] | (gfx[data_address + 0x2000] << 8) | (gfx[data_address + 0x4000] << 16);
109109
110110      for(x = 0; x < TILE_WIDTH; ++x)
src/mame/drivers/f-32.c
r14899r14900
4444
4545      if ((x < 0xa0) && (y < 0xe0))
4646      {
47         bitmap.pix16(y, (x * 2) + 0) = (state->m_videoram.target()[offs] >> 16) & 0x7fff;
48         bitmap.pix16(y, (x * 2) + 1) = (state->m_videoram.target()[offs] >>  0) & 0x7fff;
47         bitmap.pix16(y, (x * 2) + 0) = (state->m_videoram[offs] >> 16) & 0x7fff;
48         bitmap.pix16(y, (x * 2) + 1) = (state->m_videoram[offs] >>  0) & 0x7fff;
4949      }
5050   }
5151
src/mame/drivers/sshot.c
r14899r14900
183183{
184184   supershot_state *state = machine.driver_data<supershot_state>();
185185
186   UINT8 code = state->m_videoram.target()[tile_index];
186   UINT8 code = state->m_videoram[tile_index];
187187   SET_TILE_INFO(0, code, 0, 0);
188188}
189189
r14899r14900
203203WRITE8_MEMBER(supershot_state::supershot_vidram_w)
204204{
205205
206   m_videoram.target()[offset] = data;
206   m_videoram[offset] = data;
207207   m_tilemap->mark_tile_dirty(offset);
208208}
209209
src/mame/drivers/gstream.c
r14899r14900
211211
212212WRITE32_MEMBER(gstream_state::gstream_palette_w)
213213{
214   COMBINE_DATA(&m_paletteram.target()[offset]);
214   COMBINE_DATA(&m_paletteram[offset]);
215215
216   palette_set_color_rgb(machine(), offset * 2, pal5bit(m_paletteram.target()[offset] >> (0 + 16)),
217                           pal5bit(m_paletteram.target()[offset] >> (6 + 16)),
218                           pal5bit(m_paletteram.target()[offset] >> (11 + 16)));
216   palette_set_color_rgb(machine(), offset * 2, pal5bit(m_paletteram[offset] >> (0 + 16)),
217                           pal5bit(m_paletteram[offset] >> (6 + 16)),
218                           pal5bit(m_paletteram[offset] >> (11 + 16)));
219219
220220
221   palette_set_color_rgb(machine(),offset * 2 + 1,pal5bit(m_paletteram.target()[offset] >> (0)),
222                           pal5bit(m_paletteram.target()[offset] >> (6)),
223                           pal5bit(m_paletteram.target()[offset] >> (11)));
221   palette_set_color_rgb(machine(),offset * 2 + 1,pal5bit(m_paletteram[offset] >> (0)),
222                           pal5bit(m_paletteram[offset] >> (6)),
223                           pal5bit(m_paletteram[offset] >> (11)));
224224}
225225
226226WRITE32_MEMBER(gstream_state::gstream_vram_w)
227227{
228   COMBINE_DATA(&m_vram.target()[offset]);
228   COMBINE_DATA(&m_vram[offset]);
229229
230230   if (ACCESSING_BITS_24_31)
231231   {
r14899r14900
447447static TILE_GET_INFO( get_gs1_tile_info )
448448{
449449   gstream_state *state = machine.driver_data<gstream_state>();
450   int tileno = (state->m_vram.target()[tile_index + 0x000 / 4] & 0x0fff0000) >> 16;
451   int palette = (state->m_vram.target()[tile_index + 0x000 / 4] & 0xc0000000) >> 30;
450   int tileno = (state->m_vram[tile_index + 0x000 / 4] & 0x0fff0000) >> 16;
451   int palette = (state->m_vram[tile_index + 0x000 / 4] & 0xc0000000) >> 30;
452452   SET_TILE_INFO(0, tileno, palette + 0x10, 0);
453453}
454454
455455static TILE_GET_INFO( get_gs2_tile_info )
456456{
457457   gstream_state *state = machine.driver_data<gstream_state>();
458   int tileno = (state->m_vram.target()[tile_index + 0x400 / 4] & 0x0fff0000) >> 16;
459   int palette = (state->m_vram.target()[tile_index + 0x400 / 4] & 0xc0000000) >> 30;
458   int tileno = (state->m_vram[tile_index + 0x400 / 4] & 0x0fff0000) >> 16;
459   int palette = (state->m_vram[tile_index + 0x400 / 4] & 0xc0000000) >> 30;
460460   SET_TILE_INFO(0, tileno + 0x1000, palette + 0x14, 0);
461461}
462462
r14899r14900
464464static TILE_GET_INFO( get_gs3_tile_info )
465465{
466466   gstream_state *state = machine.driver_data<gstream_state>();
467   int tileno = (state->m_vram.target()[tile_index + 0x800 / 4] & 0x0fff0000) >> 16;
468   int palette = (state->m_vram.target()[tile_index + 0x800 / 4] & 0xc0000000) >> 30;
467   int tileno = (state->m_vram[tile_index + 0x800 / 4] & 0x0fff0000) >> 16;
468   int palette = (state->m_vram[tile_index + 0x800 / 4] & 0xc0000000) >> 30;
469469   SET_TILE_INFO(0, tileno + 0x2000, palette + 0x18, 0);
470470}
471471
r14899r14900
518518   for (i = 0x0000 / 4; i < 0x4000 / 4; i += 4)
519519   {
520520      /* Upper bits are used by the tilemaps */
521      int code = state->m_vram.target()[i + 0] & 0xffff;
522      int x = state->m_vram.target()[i + 1] & 0xffff;
523      int y = state->m_vram.target()[i + 2] & 0xffff;
524      int col = state->m_vram.target()[i + 3] & 0x1f;
521      int code = state->m_vram[i + 0] & 0xffff;
522      int x = state->m_vram[i + 1] & 0xffff;
523      int y = state->m_vram[i + 2] & 0xffff;
524      int col = state->m_vram[i + 3] & 0x1f;
525525
526526      /* co-ordinates are signed */
527527      if (x & 0x8000) x -= 0x10000;
r14899r14900
642642      m_maincpu->eat_cycles(50);
643643   }
644644
645   return m_workram.target()[0xd1ee0 / 4];
645   return m_workram[0xd1ee0 / 4];
646646}
647647
648648static DRIVER_INIT( gstream )
src/mame/drivers/igs017.c
r14899r14900
156156static TILE_GET_INFO( get_fg_tile_info )
157157{
158158   igs017_state *state = machine.driver_data<igs017_state>();
159   int code = state->m_fg_videoram.target()[tile_index*4+0] + (state->m_fg_videoram.target()[tile_index*4+1] << 8);
160   int attr = state->m_fg_videoram.target()[tile_index*4+2] + (state->m_fg_videoram.target()[tile_index*4+3] << 8);
159   int code = state->m_fg_videoram[tile_index*4+0] + (state->m_fg_videoram[tile_index*4+1] << 8);
160   int attr = state->m_fg_videoram[tile_index*4+2] + (state->m_fg_videoram[tile_index*4+3] << 8);
161161   SET_TILE_INFO(0, code, COLOR(attr), TILE_FLIPXY( attr >> 5 ));
162162}
163163static TILE_GET_INFO( get_bg_tile_info )
164164{
165165   igs017_state *state = machine.driver_data<igs017_state>();
166   int code = state->m_bg_videoram.target()[tile_index*4+0] + (state->m_bg_videoram.target()[tile_index*4+1] << 8);
167   int attr = state->m_bg_videoram.target()[tile_index*4+2] + (state->m_bg_videoram.target()[tile_index*4+3] << 8);
166   int code = state->m_bg_videoram[tile_index*4+0] + (state->m_bg_videoram[tile_index*4+1] << 8);
167   int attr = state->m_bg_videoram[tile_index*4+2] + (state->m_bg_videoram[tile_index*4+3] << 8);
168168   SET_TILE_INFO(0, code, COLOR(attr)+8, TILE_FLIPXY( attr >> 5 ));
169169}
170170
171171WRITE8_MEMBER(igs017_state::fg_w)
172172{
173   m_fg_videoram.target()[offset] = data;
173   m_fg_videoram[offset] = data;
174174   m_fg_tilemap->mark_tile_dirty(offset/4);
175175}
176176
177177WRITE8_MEMBER(igs017_state::bg_w)
178178{
179   m_bg_videoram.target()[offset] = data;
179   m_bg_videoram[offset] = data;
180180   m_bg_tilemap->mark_tile_dirty(offset/4);
181181}
182182
r14899r14900
184184
185185READ16_MEMBER(igs017_state::fg_lsb_r)
186186{
187   return m_fg_videoram.target()[offset];
187   return m_fg_videoram[offset];
188188}
189189WRITE16_MEMBER(igs017_state::fg_lsb_w)
190190{
r14899r14900
194194
195195READ16_MEMBER(igs017_state::bg_lsb_r)
196196{
197   return m_bg_videoram.target()[offset];
197   return m_bg_videoram[offset];
198198}
199199WRITE16_MEMBER(igs017_state::bg_lsb_w)
200200{
r14899r14900
204204
205205READ16_MEMBER(igs017_state::spriteram_lsb_r)
206206{
207   return m_spriteram.target()[offset];
207   return m_spriteram[offset];
208208}
209209WRITE16_MEMBER(igs017_state::spriteram_lsb_w)
210210{
211211   if (ACCESSING_BITS_0_7)
212      m_spriteram.target()[offset] = data;
212      m_spriteram[offset] = data;
213213}
214214
215215
r14899r14900
306306static void draw_sprites(running_machine &machine, bitmap_ind16 &bitmap,const rectangle &cliprect)
307307{
308308   igs017_state *state = machine.driver_data<igs017_state>();
309   UINT8 *s   =   state->m_spriteram.target();
309   UINT8 *s   =   state->m_spriteram;
310310   UINT8 *end   =   state->m_spriteram + 0x800;
311311
312312   for ( ; s < end; s += 8 )
src/mame/drivers/avt.c
r14899r14900
468468
469469WRITE8_MEMBER( avt_state::avt_videoram_w )
470470{
471   m_videoram.target()[offset] = data;
471   m_videoram[offset] = data;
472472   m_bg_tilemap->mark_tile_dirty(offset);
473473}
474474
475475
476476WRITE8_MEMBER( avt_state::avt_colorram_w )
477477{
478   m_colorram.target()[offset] = data;
478   m_colorram[offset] = data;
479479   m_bg_tilemap->mark_tile_dirty(offset);
480480}
481481
r14899r14900
488488    xxxx ----   color code.
489489    ---- xxxx   seems unused.
490490*/
491   int attr = state->m_colorram.target()[tile_index];
492   int code = state->m_videoram.target()[tile_index] | ((attr & 1) << 8);
491   int attr = state->m_colorram[tile_index];
492   int code = state->m_videoram[tile_index] | ((attr & 1) << 8);
493493   int color = (attr & 0xf0)>>4;
494494
495495   SET_TILE_INFO( 0, code, color, 0);
r14899r14900
516516   {
517517      for(x=0;x<mc6845_h_display;x++)
518518      {
519         UINT16 tile = state->m_videoram.target()[count] | ((state->m_colorram.target()[count] & 1) << 8);
520         UINT8 color = (state->m_colorram.target()[count] & 0xf0) >> 4;
519         UINT16 tile = state->m_videoram[count] | ((state->m_colorram[count] & 1) << 8);
520         UINT8 color = (state->m_colorram[count] & 0xf0) >> 4;
521521
522522         drawgfx_opaque(bitmap,cliprect,gfx,tile,color,0,0,x*8,(y*8));
523523
src/mame/drivers/tehkanwc.c
r14899r14900
219219   AM_RANGE(0xc800, 0xcfff) AM_RAM AM_SHARE("share1")
220220   AM_RANGE(0xd000, 0xd3ff) AM_RAM_WRITE(tehkanwc_videoram_w) AM_SHARE("share2") AM_BASE(m_videoram)
221221   AM_RANGE(0xd400, 0xd7ff) AM_RAM_WRITE(tehkanwc_colorram_w) AM_SHARE("share3") AM_BASE(m_colorram)
222   AM_RANGE(0xd800, 0xddff) AM_RAM_WRITE(paletteram_xxxxBBBBGGGGRRRR_byte_be_w) AM_SHARE("share4") AM_SHARE("paletteram")
222   AM_RANGE(0xd800, 0xddff) AM_RAM_WRITE(paletteram_xxxxBBBBGGGGRRRR_byte_be_w) AM_SHARE("paletteram")
223223   AM_RANGE(0xde00, 0xdfff) AM_RAM AM_SHARE("share5") /* unused part of the palette RAM, I think? Gridiron uses it */
224224   AM_RANGE(0xe000, 0xe7ff) AM_RAM_WRITE(tehkanwc_videoram2_w) AM_SHARE("share6") AM_BASE(m_videoram2)
225225   AM_RANGE(0xe800, 0xebff) AM_RAM AM_SHARE("share7") AM_BASE_SIZE(m_spriteram, m_spriteram_size) /* sprites */
r14899r14900
245245   AM_RANGE(0xc800, 0xcfff) AM_RAM AM_SHARE("share1")
246246   AM_RANGE(0xd000, 0xd3ff) AM_RAM_WRITE(tehkanwc_videoram_w) AM_SHARE("share2")
247247   AM_RANGE(0xd400, 0xd7ff) AM_RAM_WRITE(tehkanwc_colorram_w) AM_SHARE("share3")
248   AM_RANGE(0xd800, 0xddff) AM_RAM_WRITE(paletteram_xxxxBBBBGGGGRRRR_byte_be_w) AM_SHARE("share4") AM_SHARE("paletteram")
248   AM_RANGE(0xd800, 0xddff) AM_RAM_WRITE(paletteram_xxxxBBBBGGGGRRRR_byte_be_w) AM_SHARE("paletteram")
249249   AM_RANGE(0xde00, 0xdfff) AM_RAM AM_SHARE("share5") /* unused part of the palette RAM, I think? Gridiron uses it */
250250   AM_RANGE(0xe000, 0xe7ff) AM_RAM_WRITE(tehkanwc_videoram2_w) AM_SHARE("share6")
251251   AM_RANGE(0xe800, 0xebff) AM_RAM AM_SHARE("share7") /* sprites */
src/mame/drivers/liberatr.c
r14899r14900
389389   /* basic machine hardware */
390390   MCFG_CPU_ADD("maincpu", M6502, MASTER_CLOCK/16) /* 1.25Mhz divided from 20Mhz master clock */
391391   MCFG_CPU_PROGRAM_MAP(liberatr_map)
392   MCFG_CPU_PERIODIC_INT(irq0_line_hold,4*60)
392   MCFG_DEVICE_PERIODIC_INT_DRIVER(driver_device,irq0_line_hold,4*60)
393393
394394   MCFG_ER2055_ADD("earom")
395395   
src/mame/drivers/dynadice.c
r14899r14900
6363
6464WRITE8_MEMBER(dynadice_state::dynadice_videoram_w)
6565{
66   m_videoram.target()[offset] = data;
66   m_videoram[offset] = data;
6767   m_bg_tilemap->mark_tile_dirty(offset);
6868   m_top_tilemap->mark_all_dirty();
6969}
r14899r14900
193193static TILE_GET_INFO( get_tile_info )
194194{
195195   dynadice_state *state = machine.driver_data<dynadice_state>();
196   int code = state->m_videoram.target()[tile_index];
196   int code = state->m_videoram[tile_index];
197197   SET_TILE_INFO(1, code, 0, 0);
198198}
199199
src/mame/drivers/kinst.c
r14899r14900
176176   mips3drc_set_options(machine.device("maincpu"), MIPS3DRC_FASTEST_OPTIONS);
177177
178178   /* configure fast RAM regions for DRC */
179   mips3drc_add_fastram(machine.device("maincpu"), 0x08000000, 0x087fffff, FALSE, state->m_rambase2.target());
180   mips3drc_add_fastram(machine.device("maincpu"), 0x00000000, 0x0007ffff, FALSE, state->m_rambase.target());
181   mips3drc_add_fastram(machine.device("maincpu"), 0x1fc00000, 0x1fc7ffff, TRUE,  state->m_rombase.target());
179   mips3drc_add_fastram(machine.device("maincpu"), 0x08000000, 0x087fffff, FALSE, state->m_rambase2);
180   mips3drc_add_fastram(machine.device("maincpu"), 0x00000000, 0x0007ffff, FALSE, state->m_rambase);
181   mips3drc_add_fastram(machine.device("maincpu"), 0x1fc00000, 0x1fc7ffff, TRUE,  state->m_rombase);
182182}
183183
184184
r14899r14900
225225   }
226226
227227   /* set a safe base location for video */
228   state->m_video_base = &state->m_rambase.target()[0x30000/4];
228   state->m_video_base = &state->m_rambase[0x30000/4];
229229}
230230
231231
r14899r14900
333333
334334   /* apply shuffling */
335335   offset = m_control_map[offset / 2];
336   result = m_control.target()[offset];
336   result = m_control[offset];
337337
338338   switch (offset)
339339   {
r14899r14900
367367
368368   /* apply shuffling */
369369   offset = m_control_map[offset / 2];
370   olddata = m_control.target()[offset];
371   COMBINE_DATA(&m_control.target()[offset]);
370   olddata = m_control[offset];
371   COMBINE_DATA(&m_control[offset]);
372372
373373   switch (offset)
374374   {
375375      case 0:      /* $80 - VRAM buffer control */
376376         if (data & 4)
377            m_video_base = &m_rambase.target()[0x58000/4];
377            m_video_base = &m_rambase[0x58000/4];
378378         else
379            m_video_base = &m_rambase.target()[0x30000/4];
379            m_video_base = &m_rambase[0x30000/4];
380380         break;
381381
382382      case 1:      /* $88 - sound reset */
r14899r14900
384384         break;
385385
386386      case 2:      /* $90 - sound control */
387         if (!(olddata & 0x02) && (m_control.target()[offset] & 0x02))
388            dcs_data_w(machine(), m_control.target()[3]);
387         if (!(olddata & 0x02) && (m_control[offset] & 0x02))
388            dcs_data_w(machine(), m_control[3]);
389389         break;
390390
391391      case 3:      /* $98 - sound data */
src/mame/drivers/sub.c
r14899r14900
149149   {
150150      for (x=0;x<32;x++)
151151      {
152         UINT16 tile = state->m_vid.target()[count];
152         UINT16 tile = state->m_vid[count];
153153         UINT8 col;
154         UINT8 y_offs = state->m_scrolly.target()[x];
154         UINT8 y_offs = state->m_scrolly[x];
155155
156         tile += (state->m_attr.target()[count]&0xe0)<<3;
157         col = (state->m_attr.target()[count]&0x1f);
156         tile += (state->m_attr[count]&0xe0)<<3;
157         col = (state->m_attr[count]&0x1f);
158158
159159         drawgfx_opaque(bitmap,cliprect,gfx,tile,col+0x40,0,0,x*8,(y*8)-y_offs);
160160         drawgfx_opaque(bitmap,cliprect,gfx,tile,col+0x40,0,0,x*8,(y*8)-y_offs+256);
r14899r14900
175175    1 --cc cccc color
176176    */
177177   {
178      UINT8 *spriteram = state->m_spriteram.target();
179      UINT8 *spriteram_2 = state->m_spriteram2.target();
178      UINT8 *spriteram = state->m_spriteram;
179      UINT8 *spriteram_2 = state->m_spriteram2;
180180      UINT8 x,y,spr_offs,i,col,fx,fy;
181181
182182      for(i=0;i<0x40;i+=2)
r14899r14900
200200   {
201201      for (x=0;x<32;x++)
202202      {
203         UINT16 tile = state->m_vid.target()[count];
203         UINT16 tile = state->m_vid[count];
204204         UINT8 col;
205         UINT8 y_offs = state->m_scrolly.target()[x];
205         UINT8 y_offs = state->m_scrolly[x];
206206
207         tile += (state->m_attr.target()[count]&0xe0)<<3;
208         col = (state->m_attr.target()[count]&0x1f);
207         tile += (state->m_attr[count]&0xe0)<<3;
208         col = (state->m_attr[count]&0x1f);
209209
210210         if(x >= 28)
211211         {
src/mame/drivers/mpoker.c
r14899r14900
215215   {
216216      for (x=0;x<32;x++)
217217      {
218         UINT16 dat = state->m_video.target()[count];
219         UINT16 col = state->m_video.target()[count+0x400] & 0x7f;
218         UINT16 dat = state->m_video[count];
219         UINT16 col = state->m_video[count+0x400] & 0x7f;
220220         drawgfx_opaque(bitmap,cliprect,gfx,dat,col,0,0,x*16,y*16);
221221         count++;
222222      }
src/mame/drivers/skyarmy.c
r14899r14900
6565static TILE_GET_INFO( get_skyarmy_tile_info )
6666{
6767   skyarmy_state *state = machine.driver_data<skyarmy_state>();
68   int code = state->m_videoram.target()[tile_index];
69   int attr = BITSWAP8(state->m_colorram.target()[tile_index], 7, 6, 5, 4, 3, 0, 1, 2) & 7;
68   int code = state->m_videoram[tile_index];
69   int attr = BITSWAP8(state->m_colorram[tile_index], 7, 6, 5, 4, 3, 0, 1, 2) & 7;
7070
7171   SET_TILE_INFO( 0, code, attr, 0);
7272}
r14899r14900
7474WRITE8_MEMBER(skyarmy_state::skyarmy_videoram_w)
7575{
7676
77   m_videoram.target()[offset] = data;
77   m_videoram[offset] = data;
7878   m_tilemap->mark_tile_dirty(offset);
7979}
8080
8181WRITE8_MEMBER(skyarmy_state::skyarmy_colorram_w)
8282{
8383
84   m_colorram.target()[offset] = data;
84   m_colorram[offset] = data;
8585   m_tilemap->mark_tile_dirty(offset);
8686}
8787
r14899r14900
125125static SCREEN_UPDATE_IND16( skyarmy )
126126{
127127   skyarmy_state *state = screen.machine().driver_data<skyarmy_state>();
128   UINT8 *spriteram = state->m_spriteram.target();
128   UINT8 *spriteram = state->m_spriteram;
129129   int sx, sy, flipx, flipy, offs,pal;
130130   int i;
131131
132132   for(i=0;i<0x20;i++)
133      state->m_tilemap->set_scrolly(i,state->m_scrollram.target()[i]);
133      state->m_tilemap->set_scrolly(i,state->m_scrollram[i]);
134134
135135   state->m_tilemap->draw(bitmap, cliprect, 0,0);
136136
src/mame/drivers/suprgolf.c
r14899r14900
6060static TILE_GET_INFO( get_tile_info )
6161{
6262   suprgolf_state *state = machine.driver_data<suprgolf_state>();
63   int code = state->m_videoram.target()[tile_index*2]+256*(state->m_videoram.target()[tile_index*2+1]);
64   int color = state->m_videoram.target()[tile_index*2+0x800] & 0x7f;
63   int code = state->m_videoram[tile_index*2]+256*(state->m_videoram[tile_index*2+1]);
64   int color = state->m_videoram[tile_index*2+0x800] & 0x7f;
6565
6666   SET_TILE_INFO(
6767      0,
r14899r14900
134134   if (m_palette_switch)
135135      return m_paletteram[offset];
136136   else
137      return m_videoram.target()[offset];
137      return m_videoram[offset];
138138}
139139
140140WRITE8_MEMBER(suprgolf_state::suprgolf_videoram_w)
r14899r14900
155155   }
156156   else
157157   {
158      m_videoram.target()[offset] = data;
158      m_videoram[offset] = data;
159159      m_tilemap->mark_tile_dirty((offset & 0x7fe) >> 1);
160160   }
161161}
src/mame/drivers/toaplan2.c
r14899r14900
13361336   AM_RANGE(0x000000, 0x1fffff) AM_ROM
13371337   // actually 200000 - 20ffff is probably all main RAM, and the text and palette RAM are written via DMA
13381338   AM_RANGE(0x200000, 0x201fff) AM_RAM_WRITE(toaplan2_txvideoram16_w) AM_BASE_SIZE(m_txvideoram16, m_tx_vram_size)
1339   AM_RANGE(0x202000, 0x202fff) AM_RAM_WRITE(paletteram_xBBBBBGGGGGRRRRR_word_w) AM_SHARE("paletteram") AM_SIZE(m_paletteram_size)
1339   AM_RANGE(0x202000, 0x202fff) AM_RAM_WRITE(paletteram_xBBBBBGGGGGRRRRR_word_w) AM_SHARE("paletteram")
13401340   AM_RANGE(0x203000, 0x2031ff) AM_RAM_WRITE(toaplan2_txvideoram16_offs_w) AM_BASE_SIZE(m_txvideoram16_offs, m_tx_offs_vram_size)
13411341   AM_RANGE(0x203200, 0x2033ff) AM_RAM_WRITE(toaplan2_txscrollram16_w) AM_BASE_SIZE(m_txscrollram16, m_tx_scroll_vram_size)
13421342   AM_RANGE(0x203400, 0x207fff) AM_RAM AM_BASE_SIZE(m_mainram16, m_mainram_overlap_size)
r14899r14900
13661366   AM_RANGE(0x000000, 0x1fffff) AM_ROM
13671367   // actually 200000 - 20ffff is probably all main RAM, and the text and palette RAM are written via DMA
13681368   AM_RANGE(0x200000, 0x201fff) AM_RAM_WRITE(toaplan2_txvideoram16_w) AM_BASE_SIZE(m_txvideoram16, m_tx_vram_size)
1369   AM_RANGE(0x202000, 0x202fff) AM_RAM_WRITE(paletteram_xBBBBBGGGGGRRRRR_word_w) AM_SHARE("paletteram") AM_SIZE(m_paletteram_size)
1369   AM_RANGE(0x202000, 0x202fff) AM_RAM_WRITE(paletteram_xBBBBBGGGGGRRRRR_word_w) AM_SHARE("paletteram")
13701370   AM_RANGE(0x203000, 0x2031ff) AM_RAM_WRITE(toaplan2_txvideoram16_offs_w) AM_BASE_SIZE(m_txvideoram16_offs, m_tx_offs_vram_size)
13711371   AM_RANGE(0x203200, 0x2033ff) AM_RAM_WRITE(toaplan2_txscrollram16_w) AM_BASE_SIZE(m_txscrollram16, m_tx_scroll_vram_size)
13721372   AM_RANGE(0x203400, 0x207fff) AM_RAM AM_BASE_SIZE(m_mainram16, m_mainram_overlap_size)
src/mame/drivers/dmndrby.c
r14899r14900
6363      : driver_device(mconfig, type, tag) ,
6464      m_scroll_ram(*this, "scroll_ram"),
6565      m_sprite_ram(*this, "sprite_ram"),
66      m_dderby_vidchars(*this, "dderby_vidchars"),
67      m_dderby_vidattribs(*this, "dderby_vidattribs"){ }
66      m_dderby_vidchars(*this, "vidchars"),
67      m_dderby_vidattribs(*this, "vidattribs"){ }
6868
6969   required_shared_ptr<UINT8> m_scroll_ram;
7070   required_shared_ptr<UINT8> m_sprite_ram;
r14899r14900
134134   AM_RANGE(0xca03, 0xca03) AM_WRITENOP//(timer_irq_w) //???
135135   AM_RANGE(0xcc00, 0xcc05) AM_RAM AM_SHARE("scroll_ram")
136136   AM_RANGE(0xce08, 0xce1f) AM_RAM AM_SHARE("sprite_ram") // horse sprites
137   AM_RANGE(0xd000, 0xd3ff) AM_RAM AM_SHARE("dderby_vidchars") // char ram
138   AM_RANGE(0xd400, 0xd7ff) AM_RAM AM_SHARE("dderby_vidattribs") // colours/ attrib ram
137   AM_RANGE(0xd000, 0xd3ff) AM_RAM AM_SHARE("vidchars") // char ram
138   AM_RANGE(0xd400, 0xd7ff) AM_RAM AM_SHARE("vidattribs") // colours/ attrib ram
139139ADDRESS_MAP_END
140140
141141static ADDRESS_MAP_START( dderby_sound_map, AS_PROGRAM, 8, dmndrby_state )
r14899r14900
362362can we draw it with the tilemap? maybe not, the layout is a litle strange
363363
364364*/
365//  base = state->m_scroll_ram.target()[0];
365//  base = state->m_scroll_ram[0];
366366
367   off=0x1900-(state->m_bg*0x100)+(state->m_scroll_ram.target()[1])*0x100;
368   scrolly = 0xff-(state->m_scroll_ram.target()[0]);
369   if(state->m_scroll_ram.target()[1]==0xff) off=0x1800;
367   off=0x1900-(state->m_bg*0x100)+(state->m_scroll_ram[1])*0x100;
368   scrolly = 0xff-(state->m_scroll_ram[0]);
369   if(state->m_scroll_ram[1]==0xff) off=0x1800;
370370   for(x=0;x<16;x++) {
371371      for(y=0;y<16;y++) {
372372         int chr = state->m_racetrack_tilemap_rom[off];
r14899r14900
398398      int a=0;
399399      int b=0;
400400      int base = count*4;
401      int sprx=state->m_sprite_ram.target()[base+3];
402      int spry=state->m_sprite_ram.target()[base+2];
403      //state->m_sprite_ram.target()[base+1];
404      int col = (state->m_sprite_ram.target()[base+1]&0x1f);
405      int anim = (state->m_sprite_ram.target()[base]&0x3)*0x40; // animation frame - probably wrong but seems right
406      int horse = (state->m_sprite_ram.target()[base+1]&0x7)*8+7;  // horse label from 1 - 6
401      int sprx=state->m_sprite_ram[base+3];
402      int spry=state->m_sprite_ram[base+2];
403      //state->m_sprite_ram[base+1];
404      int col = (state->m_sprite_ram[base+1]&0x1f);
405      int anim = (state->m_sprite_ram[base]&0x3)*0x40; // animation frame - probably wrong but seems right
406      int horse = (state->m_sprite_ram[base+1]&0x7)*8+7;  // horse label from 1 - 6
407407
408408      for (a=0;a<8 ;a++)
409409      {
r14899r14900
426426      for(x=0;x<32;x++)
427427      {
428428         int tileno,bank,color;
429         tileno=state->m_dderby_vidchars.target()[count];
430         bank=(state->m_dderby_vidattribs.target()[count]&0x20)>>5;
429         tileno=state->m_dderby_vidchars[count];
430         bank=(state->m_dderby_vidattribs[count]&0x20)>>5;
431431         tileno|=(bank<<8);
432         color=((state->m_dderby_vidattribs.target()[count])&0x1f);
432         color=((state->m_dderby_vidattribs[count])&0x1f);
433433
434434         drawgfx_transpen(bitmap,cliprect,gfx,tileno,color,0,0,x*8,y*8,(tileno == 0x38) ? 0 : -1);
435435
src/mame/drivers/cmmb.c
r14899r14900
7171static SCREEN_UPDATE_IND16( cmmb )
7272{
7373   cmmb_state *state = screen.machine().driver_data<cmmb_state>();
74   UINT8 *videoram = state->m_videoram.target();
74   UINT8 *videoram = state->m_videoram;
7575   const gfx_element *gfx = screen.machine().gfx[0];
7676   int count = 0x00000;
7777
src/mame/drivers/boxer.c
r14899r14900
130130
131131      int i, j;
132132
133      int x = 196 - state->m_sprite_ram.target()[0 + 2 * n];
134      int y = 192 - state->m_sprite_ram.target()[1 + 2 * n];
133      int x = 196 - state->m_sprite_ram[0 + 2 * n];
134      int y = 192 - state->m_sprite_ram[1 + 2 * n];
135135
136      int l = state->m_sprite_ram.target()[4 + 2 * n] & 15;
137      int r = state->m_sprite_ram.target()[5 + 2 * n] & 15;
136      int l = state->m_sprite_ram[4 + 2 * n] & 15;
137      int r = state->m_sprite_ram[5 + 2 * n] & 15;
138138
139139      for (i = 0; i < 8; i++)
140140      {
r14899r14900
178178   {
179179      for (j = 0; j < 32; j++)
180180      {
181         UINT8 code = state->m_tile_ram.target()[32 * i + j];
181         UINT8 code = state->m_tile_ram[32 * i + j];
182182
183183         drawgfx_transpen(bitmap, cliprect,
184184            screen.machine().gfx[2],
src/mame/drivers/magicfly.c
r14899r14900
443443
444444WRITE8_MEMBER(magicfly_state::magicfly_videoram_w)
445445{
446   m_videoram.target()[offset] = data;
446   m_videoram[offset] = data;
447447   m_bg_tilemap->mark_tile_dirty(offset);
448448}
449449
450450WRITE8_MEMBER(magicfly_state::magicfly_colorram_w)
451451{
452   m_colorram.target()[offset] = data;
452   m_colorram[offset] = data;
453453   m_bg_tilemap->mark_tile_dirty(offset);
454454}
455455
r14899r14900
465465    x--- ----   Mirrored from bit 3. The code check this one to boot the game.
466466
467467*/
468   int attr = state->m_colorram.target()[tile_index];
469   int code = state->m_videoram.target()[tile_index];
468   int attr = state->m_colorram[tile_index];
469   int code = state->m_videoram[tile_index];
470470   int bank = (attr & 0x10) >> 4;   /* bit 4 switch the gfx banks */
471471   int color = attr & 0x07;         /* bits 0-2 for color */
472472
473473    /* Seems that bit 7 is mirrored from bit 3 to have a normal boot */
474474    /* Boot only check the first color RAM offset */
475475
476   state->m_colorram.target()[0] = state->m_colorram.target()[0] | ((state->m_colorram.target()[0] & 0x08) << 4);   /* only for 1st offset */
477   //state->m_colorram.target()[tile_index] = attr | ((attr & 0x08) << 4);         /* for the whole color RAM */
476   state->m_colorram[0] = state->m_colorram[0] | ((state->m_colorram[0] & 0x08) << 4);   /* only for 1st offset */
477   //state->m_colorram[tile_index] = attr | ((attr & 0x08) << 4);         /* for the whole color RAM */
478478
479479   SET_TILE_INFO(bank, code, color, 0);
480480}
r14899r14900
497497    x--- ----   Mirrored from bit 2. The code check this one to boot the game.
498498
499499*/
500   int attr = state->m_colorram.target()[tile_index];
501   int code = state->m_videoram.target()[tile_index];
500   int attr = state->m_colorram[tile_index];
501   int code = state->m_videoram[tile_index];
502502   int bank = (attr & 0x10) >> 4;    /* bit 4 switch the gfx banks */
503503   int color = attr & 0x07;          /* bits 0-2 for color */
504504
505505    /* Seems that bit 7 is mirrored from bit 2 to have a normal boot */
506506    /* Boot only check the first color RAM offset */
507507
508   state->m_colorram.target()[0] = state->m_colorram.target()[0] | ((state->m_colorram.target()[0] & 0x04) << 5);   /* only for 1st offset */
509   //state->m_colorram.target()[tile_index] = attr | ((attr & 0x04) << 5);         /* for the whole color RAM */
508   state->m_colorram[0] = state->m_colorram[0] | ((state->m_colorram[0] & 0x04) << 5);   /* only for 1st offset */
509   //state->m_colorram[tile_index] = attr | ((attr & 0x04) << 5);         /* for the whole color RAM */
510510
511511   SET_TILE_INFO(bank, code, color, 0);
512512}
src/mame/drivers/gal3.c
r14899r14900
139139   gal3_state(const machine_config &mconfig, device_type type, const char *tag)
140140      : driver_device(mconfig, type, tag) ,
141141      m_nvmem(*this, "nvmem"),
142      m_rsoSharedRAM(*this, "rsoSharedRAM"){ }
142      m_rso_shared_ram(*this, "rso_shared_ram"){ }
143143
144144   UINT32 *m_mpSharedRAM0;
145145   //UINT32 *m_mpSharedRAM1;
146146   required_shared_ptr<UINT32> m_nvmem;
147147   UINT16 m_namcos21_video_enable;
148   required_shared_ptr<UINT16> m_rsoSharedRAM;
148   required_shared_ptr<UINT16> m_rso_shared_ram;
149149   UINT32 m_led_mst;
150150   UINT32 m_led_slv;
151151   DECLARE_READ32_MEMBER(led_mst_r);
r14899r14900
256256   {
257257      for( i=0; i<state->m_nvmem.bytes()/4; i++ )
258258      {
259         UINT32 dword = state->m_nvmem.target()[i];
259         UINT32 dword = state->m_nvmem[i];
260260         data[0] = dword>>24;
261261         data[1] = (dword&0x00ff0000)>>16;
262262         data[2] = (dword&0x0000ff00)>>8;
r14899r14900
271271         for( i=0; i<state->m_nvmem.bytes()/4; i++ )
272272         {
273273            file->read( data, 4 );
274            state->m_nvmem.target()[i] = (data[0]<<24)|(data[1]<<16)|(data[2]<<8)|data[3];
274            state->m_nvmem[i] = (data[0]<<24)|(data[1]<<16)|(data[2]<<8)|data[3];
275275         }
276276      }
277277      else
r14899r14900
343343    Check @$009a==1 to start DEMO
344344    HACK*/
345345   offset *= 2;
346   return (m_rsoSharedRAM.target()[offset]<<16)|m_rsoSharedRAM.target()[offset+1];
346   return (m_rso_shared_ram[offset]<<16)|m_rso_shared_ram[offset+1];
347347}
348348
349349WRITE32_MEMBER(gal3_state::rso_w)
350350{
351351   UINT32 v;
352352   offset *= 2;
353   v = (m_rsoSharedRAM.target()[offset]<<16)|m_rsoSharedRAM.target()[offset+1];
353   v = (m_rso_shared_ram[offset]<<16)|m_rso_shared_ram[offset+1];
354354   COMBINE_DATA( &v );
355   m_rsoSharedRAM.target()[offset+0] = v>>16;
356   m_rsoSharedRAM.target()[offset+1] = v&0xffff;
355   m_rso_shared_ram[offset+0] = v>>16;
356   m_rso_shared_ram[offset+1] = v&0xffff;
357357}
358358
359359
r14899r14900
436436   AM_RANGE(0x2c3800, 0x2c3801) AM_RAM //?
437437   AM_RANGE(0x2c4000, 0x2c4001) AM_RAM //?
438438
439   AM_RANGE(0x300000, 0x300fff) AM_RAM AM_SHARE("rsoSharedRAM")   //shared RAM
439   AM_RANGE(0x300000, 0x300fff) AM_RAM AM_SHARE("rso_shared_ram")   //shared RAM
440440
441441   AM_RANGE(0x400000, 0x400017) AM_RAM //MC68681?
442442   AM_RANGE(0x480000, 0x480017) AM_RAM //?
src/mame/drivers/nightgal.c
r14899r14900
379379READ8_MEMBER(nightgal_state::royalqn_comm_r)
380380{
381381
382   return (m_comms_ram.target()[offset] & 0x80) | (0x7f); //bits 6-0 are undefined, presumably open bus
382   return (m_comms_ram[offset] & 0x80) | (0x7f); //bits 6-0 are undefined, presumably open bus
383383}
384384
385385WRITE8_MEMBER(nightgal_state::royalqn_comm_w)
386386{
387387
388   m_comms_ram.target()[offset] = data & 0x80;
388   m_comms_ram[offset] = data & 0x80;
389389}
390390
391391#ifdef UNUSED_CODE
src/mame/drivers/rgum.c
r14899r14900
5050   {
5151      for(x=0;x<66;x++)
5252      {
53         int tile = state->m_vram.target()[count] | ((state->m_cram.target()[count] & 0xf) <<8);
53         int tile = state->m_vram[count] | ((state->m_cram[count] & 0xf) <<8);
5454
5555         drawgfx_opaque(bitmap,cliprect,gfx,tile,0,0,0,x*8,y*8);
5656
src/mame/drivers/jongkyo.c
r14899r14900
9090
9191
9292
93         data1 = state->m_videoram.target()[0x4000 + x / 4 + y * 64];
94         data2 = state->m_videoram.target()[x / 4 + y * 64];
93         data1 = state->m_videoram[0x4000 + x / 4 + y * 64];
94         data2 = state->m_videoram[x / 4 + y * 64];
9595
9696         for (b = 0; b < 4; ++b)
9797         {
src/mame/drivers/littlerb.c
r14899r14900
112112
113113WRITE16_MEMBER(littlerb_state::region4_w)
114114{
115   COMBINE_DATA(&m_region4.target()[offset]);
115   COMBINE_DATA(&m_region4[offset]);
116116}
117117
118118READ16_MEMBER(littlerb_state::buffer_status_r)
r14899r14900
472472   littlerb_state *state = screen.machine().driver_data<littlerb_state>();
473473   int x,y,offs;
474474   int xsize,ysize;
475   UINT16* spriteregion = &state->m_region4.target()[0x400];
475   UINT16* spriteregion = &state->m_region4[0x400];
476476   bitmap.fill(get_black_pen(screen.machine()), cliprect);
477477   //printf("frame\n");
478478   /* the spriteram format is something like this .. */
src/mame/drivers/namcos23.c
r14899r14900
14541454
14551455WRITE32_MEMBER(namcos23_state::namcos23_textram_w)
14561456{
1457   COMBINE_DATA( &m_textram.target()[offset] );
1457   COMBINE_DATA( &m_textram[offset] );
14581458   m_bgtilemap->mark_tile_dirty(offset*2);
14591459   m_bgtilemap->mark_tile_dirty((offset*2)+1);
14601460}
14611461
14621462WRITE32_MEMBER(namcos23_state::s23_txtchar_w)
14631463{
1464   COMBINE_DATA(&m_charram.target()[offset]);
1464   COMBINE_DATA(&m_charram[offset]);
14651465   gfx_element_mark_dirty(machine().gfx[0], offset/32);
14661466}
14671467
r14899r14900
18621862
18631863READ32_MEMBER(namcos23_state::gorgon_sharedram_r)
18641864{
1865   return m_shared_ram.target()[offset];
1865   return m_shared_ram[offset];
18661866}
18671867
18681868WRITE32_MEMBER(namcos23_state::gorgon_sharedram_w)
18691869{
1870   COMBINE_DATA(&m_shared_ram.target()[offset]);
1870   COMBINE_DATA(&m_shared_ram[offset]);
18711871
18721872   // hack for final furlong
18731873   if ((offset == 0x6000/4) && (data == 0) && (mem_mask == 0xff000000))
r14899r14900
23972397static VIDEO_START( ss23 )
23982398{
23992399   namcos23_state *state = machine.driver_data<namcos23_state>();
2400   gfx_element_set_source(machine.gfx[0], (UINT8 *)state->m_charram.target());
2400   gfx_element_set_source(machine.gfx[0], reinterpret_cast<UINT8 *>(state->m_charram.target()));
24012401   state->m_bgtilemap = tilemap_create(machine, TextTilemapGetInfo, tilemap_scan_rows, 16, 16, 64, 64);
24022402   state->m_bgtilemap->set_transparent_pen(0xf);
24032403
r14899r14900
25182518
25192519READ32_MEMBER(namcos23_state::sh2_shared_r)
25202520{
2521   return m_gmen_sh2_shared.target()[offset];
2521   return m_gmen_sh2_shared[offset];
25222522}
25232523
25242524WRITE32_MEMBER(namcos23_state::sh2_shared_w)
25252525{
2526   COMBINE_DATA(&m_gmen_sh2_shared.target()[offset]);
2526   COMBINE_DATA(&m_gmen_sh2_shared[offset]);
25272527}
25282528
25292529static ADDRESS_MAP_START( gmen_mips_map, AS_PROGRAM, 32, namcos23_state )
r14899r14900
25462546
25472547WRITE16_MEMBER(namcos23_state::sharedram_sub_w)
25482548{
2549   UINT16 *shared16 = (UINT16 *)m_shared_ram.target();
2549   UINT16 *shared16 = reinterpret_cast<UINT16 *>(m_shared_ram.target());
25502550
25512551   // fake that an I/O board is connected for games w/o a dump or that aren't properly communicating with it yet
25522552   if (!m_has_jvsio)
r14899r14900
25622562
25632563READ16_MEMBER(namcos23_state::sharedram_sub_r)
25642564{
2565   UINT16 *shared16 = (UINT16 *)m_shared_ram.target();
2565   UINT16 *shared16 = reinterpret_cast<UINT16 *>(m_shared_ram.target());
25662566
25672567   return shared16[BYTE_XOR_BE(offset)];
25682568}
src/mame/drivers/jaguar.c
r14899r14900
918918READ32_MEMBER(cojag_state::eeprom_data_r)
919919{
920920   if (cojag_is_r3000)
921      return m_nvram.target()[offset] | 0xffffff00;
921      return m_nvram[offset] | 0xffffff00;
922922   else
923      return m_nvram.target()[offset] | 0x00ffffff;
923      return m_nvram[offset] | 0x00ffffff;
924924}
925925
926926
r14899r14900
935935//  if (m_eeprom_enable)
936936   {
937937      if (cojag_is_r3000)
938         m_nvram.target()[offset] = data & 0x000000ff;
938         m_nvram[offset] = data & 0x000000ff;
939939      else
940         m_nvram.target()[offset] = data & 0xff000000;
940         m_nvram[offset] = data & 0xff000000;
941941   }
942942//  else
943943//      logerror("%08X:error writing to disabled EEPROM\n", cpu_get_previouspc(&space.device()));
r14899r14900
24052405   cojag_common_init(machine, 0x0c0, 0x09e);
24062406
24072407   /* patch the protection */
2408   state->m_rom_base.target()[0x220/4] = 0x03e00008;
2408   state->m_rom_base[0x220/4] = 0x03e00008;
24092409
24102410#if ENABLE_SPEEDUP_HACKS
24112411   /* install speedup for main CPU */
r14899r14900
24222422   cojag_common_init(machine, 0x0c0, 0x09e);
24232423
24242424   /* patch the protection */
2425   state->m_rom_base.target()[0x418/4] = 0x4e754e75;
2425   state->m_rom_base[0x418/4] = 0x4e754e75;
24262426
24272427#if ENABLE_SPEEDUP_HACKS
24282428   /* install speedup for main CPU */
r14899r14900
24382438   cojag_common_init(machine, 0x0c0, 0x09e);
24392439
24402440   /* patch the protection */
2441   state->m_rom_base.target()[0x220/4] = 0x03e00008;
2441   state->m_rom_base[0x220/4] = 0x03e00008;
24422442
24432443#if ENABLE_SPEEDUP_HACKS
24442444   /* install speedup for main CPU */
src/mame/drivers/onetwo.c
r14899r14900
8585static TILE_GET_INFO( get_fg_tile_info )
8686{
8787   onetwo_state *state = machine.driver_data<onetwo_state>();
88   int code = (state->m_fgram.target()[tile_index * 2 + 1] << 8) | state->m_fgram.target()[tile_index * 2];
89   int color = (state->m_fgram.target()[tile_index * 2 + 1] & 0x80) >> 7;
88   int code = (state->m_fgram[tile_index * 2 + 1] << 8) | state->m_fgram[tile_index * 2];
89   int color = (state->m_fgram[tile_index * 2 + 1] & 0x80) >> 7;
9090
9191   code &= 0x7fff;
9292
r14899r14900
114114
115115WRITE8_MEMBER(onetwo_state::onetwo_fgram_w)
116116{
117   m_fgram.target()[offset] = data;
117   m_fgram[offset] = data;
118118   m_fg_tilemap->mark_tile_dirty(offset / 2);
119119}
120120
r14899r14900
141141   onetwo_state *state = machine.driver_data<onetwo_state>();
142142   int r, g, b;
143143
144   r = state->m_paletteram.target()[offset] & 0x1f;
145   g = state->m_paletteram2.target()[offset] & 0x1f;
146   b = ((state->m_paletteram.target()[offset] & 0x60) >> 2) | ((state->m_paletteram2.target()[offset] & 0xe0) >> 5);
144   r = state->m_paletteram[offset] & 0x1f;
145   g = state->m_paletteram2[offset] & 0x1f;
146   b = ((state->m_paletteram[offset] & 0x60) >> 2) | ((state->m_paletteram2[offset] & 0xe0) >> 5);
147147   palette_set_color_rgb(machine, offset, pal5bit(r), pal5bit(g), pal5bit(b));
148148}
149149
150150WRITE8_MEMBER(onetwo_state::palette1_w)
151151{
152   m_paletteram.target()[offset] = data;
152   m_paletteram[offset] = data;
153153   set_color(machine(), offset);
154154}
155155
156156WRITE8_MEMBER(onetwo_state::palette2_w)
157157{
158   m_paletteram2.target()[offset] = data;
158   m_paletteram2[offset] = data;
159159   set_color(machine(), offset);
160160}
161161
src/mame/drivers/vamphalf.c
r14899r14900
529529         // 16bit version
530530         if(state->m_tiles != NULL)
531531         {
532            if(state->m_tiles.target()[offs] & 0x0100) continue;
532            if(state->m_tiles[offs] & 0x0100) continue;
533533
534            code  = state->m_tiles.target()[offs+1];
535            color = (state->m_tiles.target()[offs+2] >> state->m_palshift) & 0x7f;
534            code  = state->m_tiles[offs+1];
535            color = (state->m_tiles[offs+2] >> state->m_palshift) & 0x7f;
536536
537537            // boonggab
538538            if(state->m_has_extra_gfx)
539539            {
540               code  |= ((state->m_tiles.target()[offs+2] & 0x100) << 8);
540               code  |= ((state->m_tiles[offs+2] & 0x100) << 8);
541541            }
542542
543            x = state->m_tiles.target()[offs+3] & 0x01ff;
544            y = 256 - (state->m_tiles.target()[offs] & 0x00ff);
543            x = state->m_tiles[offs+3] & 0x01ff;
544            y = 256 - (state->m_tiles[offs] & 0x00ff);
545545
546            fx = state->m_tiles.target()[offs] & 0x8000;
547            fy = state->m_tiles.target()[offs] & 0x4000;
546            fx = state->m_tiles[offs] & 0x8000;
547            fy = state->m_tiles[offs] & 0x4000;
548548         }
549549         // 32bit version
550550         else
551551         {
552552            offs /= 2;
553553
554            if(state->m_tiles32.target()[offs] & 0x01000000) continue;
554            if(state->m_tiles32[offs] & 0x01000000) continue;
555555
556            code  = state->m_tiles32.target()[offs] & 0xffff;
557            color = ((state->m_tiles32.target()[offs+1] >> state->m_palshift) & 0x7f0000) >> 16;
556            code  = state->m_tiles32[offs] & 0xffff;
557            color = ((state->m_tiles32[offs+1] >> state->m_palshift) & 0x7f0000) >> 16;
558558
559            x = state->m_tiles32.target()[offs+1] & 0x01ff;
560            y = 256 - ((state->m_tiles32.target()[offs] & 0x00ff0000) >> 16);
559            x = state->m_tiles32[offs+1] & 0x01ff;
560            y = 256 - ((state->m_tiles32[offs] & 0x00ff0000) >> 16);
561561
562            fx = state->m_tiles32.target()[offs] & 0x80000000;
563            fy = state->m_tiles32.target()[offs] & 0x40000000;
562            fx = state->m_tiles32[offs] & 0x80000000;
563            fy = state->m_tiles32[offs] & 0x40000000;
564564         }
565565
566566         if(state->m_flipscreen)
r14899r14900
607607         offs = (block + cnt) / 2;
608608         {
609609            offs /= 2;
610            code  = (state->m_tiles32.target()[offs] & 0xffff) | ((state->m_tiles32.target()[offs] & 0x3000000) >> 8);
611            color = ((state->m_tiles32.target()[offs+1] >> state->m_palshift) & 0x7f0000) >> 16;
610            code  = (state->m_tiles32[offs] & 0xffff) | ((state->m_tiles32[offs] & 0x3000000) >> 8);
611            color = ((state->m_tiles32[offs+1] >> state->m_palshift) & 0x7f0000) >> 16;
612612
613            x = state->m_tiles32.target()[offs+1] & 0x01ff;
614            y = 256 - ((state->m_tiles32.target()[offs] & 0x00ff0000) >> 16);
613            x = state->m_tiles32[offs+1] & 0x01ff;
614            y = 256 - ((state->m_tiles32[offs] & 0x00ff0000) >> 16);
615615
616            fx = state->m_tiles32.target()[offs] & 0x4000000;
617            fy = 0; // not used ? or it's state->m_tiles32.target()[offs] & 0x8000000?
616            fx = state->m_tiles32[offs] & 0x4000000;
617            fy = 0; // not used ? or it's state->m_tiles32[offs] & 0x8000000?
618618         }
619619
620620         if(state->m_flipscreen)
r14899r14900
20882088         device_eat_cycles(&space.device(), 50);
20892089   }
20902090
2091   return m_wram.target()[(0x4a840/2)+offset];
2091   return m_wram[(0x4a840/2)+offset];
20922092}
20932093
20942094READ16_MEMBER(vamphalf_state::vamphafk_speedup_r)
r14899r14900
21012101         device_eat_cycles(&space.device(), 50);
21022102   }
21032103
2104   return m_wram.target()[(0x4a6d0/2)+offset];
2104   return m_wram[(0x4a6d0/2)+offset];
21052105}
21062106
21072107READ16_MEMBER(vamphalf_state::misncrft_speedup_r)
r14899r14900
21142114         device_eat_cycles(&space.device(), 50);
21152115   }
21162116
2117   return m_wram.target()[(0x72eb4/2)+offset];
2117   return m_wram[(0x72eb4/2)+offset];
21182118}
21192119
21202120READ16_MEMBER(vamphalf_state::coolmini_speedup_r)
r14899r14900
21272127         device_eat_cycles(&space.device(), 50);
21282128   }
21292129
2130   return m_wram.target()[(0xd2e80/2)+offset];
2130   return m_wram[(0xd2e80/2)+offset];
21312131}
21322132
21332133READ16_MEMBER(vamphalf_state::suplup_speedup_r)
r14899r14900
21402140         device_eat_cycles(&space.device(), 50);
21412141   }
21422142
2143   return m_wram.target()[(0x11605c/2)+offset];
2143   return m_wram[(0x11605c/2)+offset];
21442144}
21452145
21462146READ16_MEMBER(vamphalf_state::luplup_speedup_r)
r14899r14900
21532153         device_eat_cycles(&space.device(), 50);
21542154   }
21552155
2156   return m_wram.target()[(0x115e84/2)+offset];
2156   return m_wram[(0x115e84/2)+offset];
21572157}
21582158
21592159READ16_MEMBER(vamphalf_state::luplup29_speedup_r)
r14899r14900
21662166         device_eat_cycles(&space.device(), 50);
21672167   }
21682168
2169   return m_wram.target()[(0x113f08/2)+offset];
2169   return m_wram[(0x113f08/2)+offset];
21702170}
21712171
21722172READ16_MEMBER(vamphalf_state::puzlbang_speedup_r)
r14899r14900
21792179         device_eat_cycles(&space.device(), 50);
21802180   }
21812181
2182   return m_wram.target()[(0x113ecc/2)+offset];
2182   return m_wram[(0x113ecc/2)+offset];
21832183}
21842184
21852185READ32_MEMBER(vamphalf_state::wyvernwg_speedup_r)
r14899r14900
21942194         device_eat_cycles(&space.device(), 50);
21952195   }
21962196
2197   return m_wram32.target()[0x00b56fc/4];
2197   return m_wram32[0x00b56fc/4];
21982198}
21992199
22002200READ32_MEMBER(vamphalf_state::wyvernwga_speedup_r)
r14899r14900
22092209         device_eat_cycles(&space.device(), 50);
22102210   }
22112211
2212   return m_wram32.target()[0x00b74f8/4];
2212   return m_wram32[0x00b74f8/4];
22132213}
22142214
22152215
r14899r14900
22242224         device_eat_cycles(&space.device(), 50);
22252225   }
22262226
2227   return m_wram32.target()[0x005e874/4];
2227   return m_wram32[0x005e874/4];
22282228}
22292229
22302230READ32_MEMBER(vamphalf_state::mrkicker_speedup_r)
r14899r14900
22382238         device_eat_cycles(&space.device(), 50);
22392239   }
22402240
2241   return m_wram32.target()[0x00701a4/4];
2241   return m_wram32[0x00701a4/4];
22422242}
22432243
22442244
r14899r14900
22522252         device_eat_cycles(&space.device(), 50);
22532253   }
22542254
2255   return m_wram.target()[(0xcde70/2)+offset];
2255   return m_wram[(0xcde70/2)+offset];
22562256}
22572257
22582258READ32_MEMBER(vamphalf_state::aoh_speedup_r)
r14899r14900
22672267   }
22682268
22692269
2270   return m_wram32.target()[0x28a09c/4];
2270   return m_wram32[0x28a09c/4];
22712271}
22722272
22732273READ16_MEMBER(vamphalf_state::jmpbreak_speedup_r)
r14899r14900
22802280         device_eat_cycles(&space.device(), 50);
22812281   }
22822282
2283   return m_wram.target()[(0x00906fc / 2)+offset];
2283   return m_wram[(0x00906fc / 2)+offset];
22842284}
22852285
22862286READ16_MEMBER(vamphalf_state::mrdig_speedup_r)
r14899r14900
22932293         device_eat_cycles(&space.device(), 50);
22942294   }
22952295
2296   return m_wram.target()[(0x00a99c / 2)+offset];
2296   return m_wram[(0x00a99c / 2)+offset];
22972297}
22982298
22992299READ16_MEMBER(vamphalf_state::dtfamily_speedup_r)
r14899r14900
23042304   if (pc == 0x12fa6)
23052305      device_spin_until_interrupt(&space.device());
23062306
2307   return m_wram.target()[0xcc2a8 / 2];
2307   return m_wram[0xcc2a8 / 2];
23082308
23092309}
23102310
r14899r14900
23142314   if (cpu_get_pc(&space.device()) == 0x130c2)
23152315      device_spin_until_interrupt(&space.device());
23162316
2317   return m_wram.target()[0x780d8 / 2];
2317   return m_wram[0x780d8 / 2];
23182318
23192319}
23202320
r14899r14900
23262326         device_spin_until_interrupt(&space.device());
23272327   }
23282328
2329   return m_wram.target()[(0xf1b7c / 2)+offset];
2329   return m_wram[(0xf1b7c / 2)+offset];
23302330}
23312331
23322332static DRIVER_INIT( vamphalf )
src/mame/drivers/mayumi.c
r14899r14900
4747static TILE_GET_INFO( get_tile_info )
4848{
4949   mayumi_state *state = machine.driver_data<mayumi_state>();
50   int code = state->m_videoram.target()[tile_index] + (state->m_videoram.target()[tile_index + 0x800] & 0x1f) * 0x100;
51   int col = (state->m_videoram.target()[tile_index + 0x1000] >> 3) & 0x1f;
50   int code = state->m_videoram[tile_index] + (state->m_videoram[tile_index + 0x800] & 0x1f) * 0x100;
51   int col = (state->m_videoram[tile_index + 0x1000] >> 3) & 0x1f;
5252
5353   SET_TILE_INFO(0, code, col, 0);
5454}
r14899r14900
6161
6262WRITE8_MEMBER(mayumi_state::mayumi_videoram_w)
6363{
64   m_videoram.target()[offset] = data;
64   m_videoram[offset] = data;
6565   m_tilemap->mark_tile_dirty(offset & 0x7ff);
6666}
6767
src/mame/drivers/bnstars.c
r14899r14900
9898{
9999public:
100100   bnstars_state(const machine_config &mconfig, device_type type, const char *tag)
101      : driver_device(mconfig, type, tag) { }
101      : driver_device(mconfig, type, tag),
102        m_ms32_tx0_ram(*this, "tx0_ram"),
103        m_ms32_tx1_ram(*this, "tx1_ram"),
104        m_ms32_bg0_ram(*this, "bg0_ram"),
105        m_ms32_bg1_ram(*this, "bg1_ram"),
106        m_ms32_roz0_ram(*this, "roz0_ram"),
107        m_ms32_roz1_ram(*this, "roz1_ram"),
108        m_ms32_pal_ram(*this, "pal_ram"),
109        m_ms32_roz_ctrl(*this, "roz_ctrl"),
110        m_ms32_spram(*this, "spram"),
111        m_ms32_tx0_scroll(*this, "tx0_scroll"),
112        m_ms32_bg0_scroll(*this, "bg0_scroll"),
113        m_ms32_tx1_scroll(*this, "tx1_scroll"),
114        m_ms32_bg1_scroll(*this, "bg1_scroll") { }
102115
103116   tilemap_t *m_ms32_tx_tilemap[2];
104117   tilemap_t *m_ms32_bg_tilemap[2];
105118   tilemap_t *m_ms32_roz_tilemap[2];
106   UINT32 *m_ms32_tx0_ram;
107   UINT32 *m_ms32_tx1_ram;
108   UINT32 *m_ms32_bg0_ram;
109   UINT32 *m_ms32_bg1_ram;
110   UINT32 *m_ms32_roz0_ram;
111   UINT32 *m_ms32_roz1_ram;
112   UINT32 *m_ms32_pal_ram[2];
113   UINT32 *m_ms32_roz_ctrl[2];
114   UINT32 *m_ms32_spram;
115   UINT32 *m_ms32_tx0_scroll;
116   UINT32 *m_ms32_bg0_scroll;
117   UINT32 *m_ms32_tx1_scroll;
118   UINT32 *m_ms32_bg1_scroll;
119   required_shared_ptr<UINT32> m_ms32_tx0_ram;
120   required_shared_ptr<UINT32> m_ms32_tx1_ram;
121   required_shared_ptr<UINT32> m_ms32_bg0_ram;
122   required_shared_ptr<UINT32> m_ms32_bg1_ram;
123   required_shared_ptr<UINT32> m_ms32_roz0_ram;
124   required_shared_ptr<UINT32> m_ms32_roz1_ram;
125   required_shared_ptr_array<UINT32, 2> m_ms32_pal_ram;
126   required_shared_ptr_array<UINT32, 2> m_ms32_roz_ctrl;
127   required_shared_ptr<UINT32> m_ms32_spram;
128   required_shared_ptr<UINT32> m_ms32_tx0_scroll;
129   required_shared_ptr<UINT32> m_ms32_bg0_scroll;
130   required_shared_ptr<UINT32> m_ms32_tx1_scroll;
131   required_shared_ptr<UINT32> m_ms32_bg1_scroll;
119132   UINT32 m_bnstars1_mahjong_select;
120133   int m_ms32_reverse_sprite_order;
121134   int m_flipscreen;
r14899r14900
12761289   AM_RANGE(0xfce00058, 0xfce0005b) AM_WRITENOP
12771290   AM_RANGE(0xfce0005c, 0xfce0005f) AM_WRITENOP
12781291
1279   AM_RANGE(0xfce00400, 0xfce0045f) AM_WRITEONLY AM_BASE(m_ms32_roz_ctrl[0])
1280   AM_RANGE(0xfce00700, 0xfce0075f) AM_WRITEONLY AM_BASE(m_ms32_roz_ctrl[1]) // guess
1281   AM_RANGE(0xfce00a00, 0xfce00a17) AM_WRITEONLY AM_BASE(m_ms32_tx0_scroll)
1282   AM_RANGE(0xfce00a20, 0xfce00a37) AM_WRITEONLY AM_BASE(m_ms32_bg0_scroll)
1283   AM_RANGE(0xfce00c00, 0xfce00c17) AM_WRITEONLY AM_BASE(m_ms32_tx1_scroll)
1284   AM_RANGE(0xfce00c20, 0xfce00c37) AM_WRITEONLY AM_BASE(m_ms32_bg1_scroll)
1292   AM_RANGE(0xfce00400, 0xfce0045f) AM_WRITEONLY AM_SHARE("roz_ctrl.0")
1293   AM_RANGE(0xfce00700, 0xfce0075f) AM_WRITEONLY AM_SHARE("roz_ctrl.1") // guess
1294   AM_RANGE(0xfce00a00, 0xfce00a17) AM_WRITEONLY AM_SHARE("tx0_scroll")
1295   AM_RANGE(0xfce00a20, 0xfce00a37) AM_WRITEONLY AM_SHARE("bg0_scroll")
1296   AM_RANGE(0xfce00c00, 0xfce00c17) AM_WRITEONLY AM_SHARE("tx1_scroll")
1297   AM_RANGE(0xfce00c20, 0xfce00c37) AM_WRITEONLY AM_SHARE("bg1_scroll")
12851298
12861299   AM_RANGE(0xfce00e00, 0xfce00e03) AM_WRITE(bnstars1_mahjong_select_w) // ?
12871300
12881301   /* wrote together */
12891302   AM_RANGE(0xfd040000, 0xfd047fff) AM_RAM // priority ram
12901303   AM_RANGE(0xfd080000, 0xfd087fff) AM_RAM
1291   AM_RANGE(0xfd200000, 0xfd237fff) AM_RAM_WRITE(ms32_pal1_ram_w) AM_BASE(m_ms32_pal_ram[1])
1292   AM_RANGE(0xfd400000, 0xfd437fff) AM_RAM_WRITE(ms32_pal0_ram_w) AM_BASE(m_ms32_pal_ram[0])
1293   AM_RANGE(0xfe000000, 0xfe01ffff) AM_RAM_WRITE(ms32_roz1_ram_w) AM_BASE(m_ms32_roz1_ram)
1294   AM_RANGE(0xfe400000, 0xfe41ffff) AM_RAM_WRITE(ms32_roz0_ram_w) AM_BASE(m_ms32_roz0_ram)
1295   AM_RANGE(0xfe800000, 0xfe83ffff) AM_RAM_WRITE(ms32_spramx_w) AM_BASE(m_ms32_spram)
1296   AM_RANGE(0xfea00000, 0xfea07fff) AM_RAM_WRITE(ms32_tx1_ram_w) AM_BASE(m_ms32_tx1_ram)
1297   AM_RANGE(0xfea08000, 0xfea0ffff) AM_RAM_WRITE(ms32_bg1_ram_w) AM_BASE(m_ms32_bg1_ram)
1298   AM_RANGE(0xfec00000, 0xfec07fff) AM_RAM_WRITE(ms32_tx0_ram_w) AM_BASE(m_ms32_tx0_ram)
1299   AM_RANGE(0xfec08000, 0xfec0ffff) AM_RAM_WRITE(ms32_bg0_ram_w) AM_BASE(m_ms32_bg0_ram)
1304   AM_RANGE(0xfd200000, 0xfd237fff) AM_RAM_WRITE(ms32_pal1_ram_w) AM_SHARE("pal_ram.1")
1305   AM_RANGE(0xfd400000, 0xfd437fff) AM_RAM_WRITE(ms32_pal0_ram_w) AM_SHARE("pal_ram.0")
1306   AM_RANGE(0xfe000000, 0xfe01ffff) AM_RAM_WRITE(ms32_roz1_ram_w) AM_SHARE("roz1_ram")
1307   AM_RANGE(0xfe400000, 0xfe41ffff) AM_RAM_WRITE(ms32_roz0_ram_w) AM_SHARE("roz0_ram")
1308   AM_RANGE(0xfe800000, 0xfe83ffff) AM_RAM_WRITE(ms32_spramx_w) AM_SHARE("spram")
1309   AM_RANGE(0xfea00000, 0xfea07fff) AM_RAM_WRITE(ms32_tx1_ram_w) AM_SHARE("tx1_ram")
1310   AM_RANGE(0xfea08000, 0xfea0ffff) AM_RAM_WRITE(ms32_bg1_ram_w) AM_SHARE("bg1_ram")
1311   AM_RANGE(0xfec00000, 0xfec07fff) AM_RAM_WRITE(ms32_tx0_ram_w) AM_SHARE("tx0_ram")
1312   AM_RANGE(0xfec08000, 0xfec0ffff) AM_RAM_WRITE(ms32_bg0_ram_w) AM_SHARE("bg0_ram")
13001313
13011314   AM_RANGE(0xfee00000, 0xfee1ffff) AM_RAM
13021315   AM_RANGE(0xffe00000, 0xffffffff) AM_ROMBANK("bank1")
src/mame/drivers/dai3wksi.c
r14899r14900
4949public:
5050   dai3wksi_state(const machine_config &mconfig, device_type type, const char *tag)
5151      : driver_device(mconfig, type, tag) ,
52      m_dai3wksi_videoram(*this, "dai3wksi_videoram"){ }
52      m_dai3wksi_videoram(*this, "videoram"){ }
5353
5454   /* video */
5555   required_shared_ptr<UINT8> m_dai3wksi_videoram;
r14899r14900
140140
141141      UINT8 x = offs << 2;
142142      UINT8 y = offs >> 6;
143      UINT8 data = state->m_dai3wksi_videoram.target()[offs];
143      UINT8 data = state->m_dai3wksi_videoram[offs];
144144      UINT8 color;
145145      int value = (x >> 2) + ((y >> 5) << 6) + 64 * 8 * (state->m_dai3wksi_redterop ? 1 : 0);
146146
r14899r14900
509509   AM_RANGE(0x3000, 0x3000) AM_WRITE(dai3wksi_audio_1_w)
510510   AM_RANGE(0x3400, 0x3400) AM_WRITE(dai3wksi_audio_2_w)
511511   AM_RANGE(0x3800, 0x3800) AM_WRITE(dai3wksi_audio_3_w)
512   AM_RANGE(0x8000, 0xbfff) AM_RAM AM_SHARE("dai3wksi_videoram")
512   AM_RANGE(0x8000, 0xbfff) AM_RAM AM_SHARE("videoram")
513513ADDRESS_MAP_END
514514
515515
src/mame/drivers/diverboy.c
r14899r14900
7777static void draw_sprites( running_machine& machine, bitmap_ind16 &bitmap, const rectangle &cliprect )
7878{
7979   diverboy_state *state = machine.driver_data<diverboy_state>();
80   UINT16 *source = state->m_spriteram.target();
80   UINT16 *source = state->m_spriteram;
8181   UINT16 *finish = source + (state->m_spriteram.bytes() / 2);
8282
8383   while (source < finish)
src/mame/drivers/firefox.c
r14899r14900
190190static TILE_GET_INFO( bgtile_get_info )
191191{
192192   firefox_state *state = machine.driver_data<firefox_state>();
193   SET_TILE_INFO(0, state->m_tileram.target()[tile_index], 0, 0);
193   SET_TILE_INFO(0, state->m_tileram[tile_index], 0, 0);
194194}
195195
196196
197197WRITE8_MEMBER(firefox_state::tileram_w)
198198{
199   m_tileram.target()[offset] = data;
199   m_tileram[offset] = data;
200200   m_bgtiles->mark_tile_dirty(offset);
201201}
202202
r14899r14900
265265
266266WRITE8_MEMBER(firefox_state::tile_palette_w)
267267{
268   m_tile_palette.target()[ offset ] = data;
268   m_tile_palette[ offset ] = data;
269269   set_rgba( machine(), 0, offset & 0xff, m_tile_palette );
270270}
271271
272272WRITE8_MEMBER(firefox_state::sprite_palette_w)
273273{
274   m_sprite_palette.target()[ offset ] = data;
274   m_sprite_palette[ offset ] = data;
275275   set_rgba( machine(), 256, offset & 0xff, m_sprite_palette );
276276}
277277
src/mame/drivers/caswin.c
r14899r14900
7272static TILE_GET_INFO( get_sc0_tile_info )
7373{
7474   caswin_state *state = machine.driver_data<caswin_state>();
75   int tile = (state->m_sc0_vram.target()[tile_index] | ((state->m_sc0_attr.target()[tile_index] & 0x70)<<4)) & 0x7ff;
76   int colour = state->m_sc0_attr.target()[tile_index] & 0xf;
75   int tile = (state->m_sc0_vram[tile_index] | ((state->m_sc0_attr[tile_index] & 0x70)<<4)) & 0x7ff;
76   int colour = state->m_sc0_attr[tile_index] & 0xf;
7777
7878   SET_TILE_INFO(
7979         0,
r14899r14900
9797
9898WRITE8_MEMBER(caswin_state::sc0_vram_w)
9999{
100   m_sc0_vram.target()[offset] = data;
100   m_sc0_vram[offset] = data;
101101   m_sc0_tilemap->mark_tile_dirty(offset);
102102}
103103
104104WRITE8_MEMBER(caswin_state::sc0_attr_w)
105105{
106   m_sc0_attr.target()[offset] = data;
106   m_sc0_attr[offset] = data;
107107   m_sc0_tilemap->mark_tile_dirty(offset);
108108}
109109
src/mame/drivers/hitpoker.c
r14899r14900
129129{
130130//  UINT8 *ROM = machine().region("maincpu")->base();
131131
132//  if(m_sys_regs.target()[0x00] & 0x10)
132//  if(m_sys_regs[0x00] & 0x10)
133133   m_videoram[offset] = data;
134134}
135135
r14899r14900
221221      return (m_pic_data & 0x7f) | (m_pic_data & 0x40 ? 0x80 : 0x00);
222222   }
223223
224   return m_sys_regs.target()[offset];
224   return m_sys_regs[offset];
225225}
226226
227227WRITE8_MEMBER(hitpoker_state::hitpoker_pic_w)
r14899r14900
229229   if(offset == 0)
230230      m_pic_data = (data & 0xff);// | (data & 0x40) ? 0x80 : 0x00;
231231//  logerror("%02x W\n",data);
232   m_sys_regs.target()[offset] = data;
232   m_sys_regs[offset] = data;
233233}
234234
235235#if 0
src/mame/drivers/m79amb.c
r14899r14900
8282
8383WRITE8_MEMBER(m79amb_state::ramtek_videoram_w)
8484{
85   m_videoram.target()[offset] = data & ~*m_mask.target();
85   m_videoram[offset] = data & ~*m_mask;
8686}
8787
8888static SCREEN_UPDATE_RGB32( ramtek )
r14899r14900
9494   {
9595      int i;
9696
97      UINT8 data = state->m_videoram.target()[offs];
97      UINT8 data = state->m_videoram[offs];
9898      int y = offs >> 5;
9999      int x = (offs & 0x1f) << 3;
100100
src/mame/drivers/koftball.c
r14899r14900
6767static TILE_GET_INFO( get_t1_tile_info )
6868{
6969   koftball_state *state = machine.driver_data<koftball_state>();
70   int data = state->m_bmc_1_videoram.target()[tile_index];
70   int data = state->m_bmc_1_videoram[tile_index];
7171   SET_TILE_INFO(
7272         0,
7373         data,
r14899r14900
7878static TILE_GET_INFO( get_t2_tile_info )
7979{
8080   koftball_state *state = machine.driver_data<koftball_state>();
81   int data = state->m_bmc_2_videoram.target()[tile_index];
81   int data = state->m_bmc_2_videoram[tile_index];
8282   SET_TILE_INFO(
8383         0,
8484         data,
r14899r14900
147147
148148WRITE16_MEMBER(koftball_state::bmc_1_videoram_w)
149149{
150   COMBINE_DATA(&m_bmc_1_videoram.target()[offset]);
150   COMBINE_DATA(&m_bmc_1_videoram[offset]);
151151   m_tilemap_1->mark_tile_dirty(offset);
152152}
153153
154154WRITE16_MEMBER(koftball_state::bmc_2_videoram_w)
155155{
156   COMBINE_DATA(&m_bmc_2_videoram.target()[offset]);
156   COMBINE_DATA(&m_bmc_2_videoram[offset]);
157157   m_tilemap_2->mark_tile_dirty(offset);
158158}
159159
r14899r14900
315315      int offset=0;
316316      while(nvram[offset]!=0xffff)
317317      {
318         state->m_main_ram.target()[offset]=nvram[offset];
318         state->m_main_ram[offset]=nvram[offset];
319319         ++offset;
320320      }
321321   }
src/mame/drivers/atarisy4.c
r14899r14900
170170
171171   for (y = cliprect.min_y; y <= cliprect.max_y; ++y)
172172   {
173      UINT16 *src = &state->m_screen_ram.target()[(offset + (4096 * y)) / 2];
173      UINT16 *src = &state->m_screen_ram[(offset + (4096 * y)) / 2];
174174      UINT32 *dest = &bitmap.pix32(y, cliprect.min_x);
175175      int x;
176176
r14899r14900
225225         {
226226            if (x >= 0 && x <= 511)
227227            {
228               UINT16 pix = state->m_screen_ram.target()[xy_to_screen_addr(x,y) >> 1];
228               UINT16 pix = state->m_screen_ram[xy_to_screen_addr(x,y) >> 1];
229229
230230               if (x & 1)
231231                  pix = (pix & (0x00ff)) | gpu.idr << 8;
232232               else
233233                  pix = (pix & (0xff00)) | gpu.idr;
234234
235               state->m_screen_ram.target()[xy_to_screen_addr(x,y) >> 1] = pix;
235               state->m_screen_ram[xy_to_screen_addr(x,y) >> 1] = pix;
236236            }
237237            ++x;
238238         }
r14899r14900
271271   clip.set(0, 511, 0, 511);
272272
273273   extra->color = color;
274   extra->screen_ram = state->m_screen_ram.target();
274   extra->screen_ram = state->m_screen_ram;
275275
276276   v1.x = gpu.points[0].x;
277277   v1.y = gpu.points[0].y;
r14899r14900
373373
374374         for (i = 0; i < gpu.gr[3]; ++i)
375375         {
376            UINT16 val = state->m_screen_ram.target()[offset >> 1];
376            UINT16 val = state->m_screen_ram[offset >> 1];
377377            val >>= (~offset & 1) << 3;
378378
379379            if (gpu.gr[4] & 0x10)
src/mame/drivers/missile.c
r14899r14900
494494   if (address < 0x4000)
495495   {
496496      missile_state *state = direct.space().machine().driver_data<missile_state>();
497      direct.explicit_configure(0x0000 | offset, 0x3fff | offset, 0x3fff, state->m_videoram.target());
497      direct.explicit_configure(0x0000 | offset, 0x3fff | offset, 0x3fff, state->m_videoram);
498498      return ~0;
499499   }
500500
r14899r14900
595595static void write_vram(address_space *space, offs_t address, UINT8 data)
596596{
597597   missile_state *state = space->machine().driver_data<missile_state>();
598   UINT8 *videoram = state->m_videoram.target();
598   UINT8 *videoram = state->m_videoram;
599599   static const UINT8 data_lookup[4] = { 0x00, 0x0f, 0xf0, 0xff };
600600   offs_t vramaddr;
601601   UINT8 vramdata;
r14899r14900
627627static UINT8 read_vram(address_space *space, offs_t address)
628628{
629629   missile_state *state = space->machine().driver_data<missile_state>();
630   UINT8 *videoram = state->m_videoram.target();
630   UINT8 *videoram = state->m_videoram;
631631   offs_t vramaddr;
632632   UINT8 vramdata;
633633   UINT8 vrammask;
r14899r14900
671671static SCREEN_UPDATE_IND16( missile )
672672{
673673   missile_state *state = screen.machine().driver_data<missile_state>();
674   UINT8 *videoram = state->m_videoram.target();
674   UINT8 *videoram = state->m_videoram;
675675   int x, y;
676676
677677   /* draw the bitmap to the screen, looping over Y */
r14899r14900
713713
714714WRITE8_MEMBER(missile_state::missile_w)
715715{
716   UINT8 *videoram = m_videoram.target();
716   UINT8 *videoram = m_videoram;
717717   /* if we're in MADSEL mode, write to video RAM */
718718   if (get_madsel(&space))
719719   {
r14899r14900
770770
771771READ8_MEMBER(missile_state::missile_r)
772772{
773   UINT8 *videoram = m_videoram.target();
773   UINT8 *videoram = m_videoram;
774774   UINT8 result = 0xff;
775775
776776   /* if we're in MADSEL mode, read from video RAM */
src/mame/drivers/go2000.c
r14899r14900
183183   {
184184      for (y = 0; y < 32; y++)
185185      {
186         int tile = state->m_videoram.target()[count];
187         int attr = state->m_videoram2.target()[count];
186         int tile = state->m_videoram[count];
187         int attr = state->m_videoram2[count];
188188         drawgfx_opaque(bitmap, cliprect, screen.machine().gfx[0], tile, attr, 0, 0, x * 8, y * 8);
189189         count++;
190190      }
r14899r14900
195195   {
196196      for (y = 0; y < 32; y++)
197197      {
198         int tile = state->m_videoram.target()[count];
199         int attr = state->m_videoram2.target()[count];
198         int tile = state->m_videoram[count];
199         int attr = state->m_videoram2[count];
200200         drawgfx_transpen(bitmap, cliprect, screen.machine().gfx[0], tile, attr, 0, 0, x * 8, y * 8, 0xf);
201201         count++;
202202      }
r14899r14900
217217      int dx, dy;
218218      int flipx, y0;
219219
220      int y = state->m_videoram.target()[offs + 0 + 0x00000 / 2];
221      int x = state->m_videoram.target()[offs + 1 + 0x00000 / 2];
222      int dim = state->m_videoram2.target()[offs + 0 + 0x00000 / 2];
220      int y = state->m_videoram[offs + 0 + 0x00000 / 2];
221      int x = state->m_videoram[offs + 1 + 0x00000 / 2];
222      int dim = state->m_videoram2[offs + 0 + 0x00000 / 2];
223223
224224      int bank   =   (x >> 12) & 0xf;
225225
r14899r14900
268268         for (dx = 0; dx < dimx * 8; dx += 8)
269269         {
270270            int addr = (srcpg * 0x20 * 0x20) + ((srcx + tile_x) & 0x1f) * 0x20 + ((srcy + tile_y) & 0x1f);
271            int tile = state->m_videoram.target()[addr + 0x00000 / 2];
272            int attr = state->m_videoram2.target()[addr + 0x00000 / 2];
271            int tile = state->m_videoram[addr + 0x00000 / 2];
272            int attr = state->m_videoram2[addr + 0x00000 / 2];
273273
274274            int sx = x + dx;
275275            int sy = (y + dy) & 0xff;
src/mame/drivers/deshoros.c
r14899r14900
8484      case 0x03: return input_port_read(machine(), "KEY0" );
8585      case 0x04: return input_port_read(machine(), "KEY1" );
8686      case 0x05: return input_port_read(machine(), "SYSTEM" );
87      case 0x0a: return m_io_ram.target()[offset]; //"buzzer" 0 read
88      case 0x0b: return m_io_ram.target()[offset]; //"buzzer" 1 read
87      case 0x0a: return m_io_ram[offset]; //"buzzer" 0 read
88      case 0x0b: return m_io_ram[offset]; //"buzzer" 1 read
8989   }
9090//  printf("R -> [%02x]\n",offset);
9191
92   return m_io_ram.target()[offset];
92   return m_io_ram[offset];
9393}
9494
9595WRITE8_MEMBER(deshoros_state::io_w)
r14899r14900
9898   {
9999      case 0x00: /*Printer data*/                  return;
100100      case 0x02: update_led_array(data);              return;
101      case 0x05: coin_lockout_w(machine(), 0,m_io_ram.target()[offset] & 1);return;
101      case 0x05: coin_lockout_w(machine(), 0,m_io_ram[offset] & 1);return;
102102      case 0x06: /*Printer IRQ enable*/             return;
103103//      case 0x0a: "buzzer" 0 write
104104//      case 0x0b: "buzzer" 1 write
105105      case 0x0c: answer_bankswitch(machine(),data&0x03); return; //data & 0x10 enabled too,dunno if it is worth to shift the data...
106106   }
107   m_io_ram.target()[offset] = data;
107   m_io_ram[offset] = data;
108108//  printf("%02x -> [%02x]\n",data,offset);
109109}
110110
src/mame/drivers/igs_m027.c
r14899r14900
6363/* CGLayer */
6464WRITE32_MEMBER(igs_m027_state::igs_cg_videoram_w)
6565{
66   COMBINE_DATA(&m_igs_cg_videoram.target()[offset]);
66   COMBINE_DATA(&m_igs_cg_videoram[offset]);
6767   //if(data!=0)
68   logerror("PC(%08X) CG @%x = %x!\n",cpu_get_pc(&space.device()),offset ,m_igs_cg_videoram.target()[offset]);
68   logerror("PC(%08X) CG @%x = %x!\n",cpu_get_pc(&space.device()),offset ,m_igs_cg_videoram[offset]);
6969
7070
7171
r14899r14900
106106/* TX Layer */
107107WRITE32_MEMBER(igs_m027_state::igs_tx_videoram_w)
108108{
109   COMBINE_DATA(&m_igs_tx_videoram.target()[offset]);
109   COMBINE_DATA(&m_igs_tx_videoram[offset]);
110110   m_igs_tx_tilemap->mark_tile_dirty(offset);
111111   //if(data!=0)
112   //logerror( "TX VIDEO RAM OFFSET %x ,data %x!\n",offset ,m_igs_tx_videoram.target()[offset]);
112   //logerror( "TX VIDEO RAM OFFSET %x ,data %x!\n",offset ,m_igs_tx_videoram[offset]);
113113}
114114
115115static TILE_GET_INFO( get_tx_tilemap_tile_info )
r14899r14900
117117   igs_m027_state *state = machine.driver_data<igs_m027_state>();
118118   //ppppppppNNNNNNNN
119119   int tileno,colour;
120   tileno = state->m_igs_tx_videoram.target()[tile_index] & 0xffff;
121   colour = (state->m_igs_tx_videoram.target()[tile_index]>>0x10) & 0xffff;
120   tileno = state->m_igs_tx_videoram[tile_index] & 0xffff;
121   colour = (state->m_igs_tx_videoram[tile_index]>>0x10) & 0xffff;
122122
123123   SET_TILE_INFO(0,tileno,colour,0);
124124}
r14899r14900
126126/* BG Layer */
127127WRITE32_MEMBER(igs_m027_state::igs_bg_videoram_w)
128128{
129   COMBINE_DATA(&m_igs_bg_videoram.target()[offset]);
129   COMBINE_DATA(&m_igs_bg_videoram[offset]);
130130   m_igs_bg_tilemap->mark_tile_dirty(offset);
131131   //if(data!=0)
132   logerror("BG VIDEO RAM OFFSET %x ,data %x!\n",offset ,m_igs_bg_videoram.target()[offset]);
132   logerror("BG VIDEO RAM OFFSET %x ,data %x!\n",offset ,m_igs_bg_videoram[offset]);
133133}
134134
135135static TILE_GET_INFO( get_bg_tilemap_tile_info )
r14899r14900
137137   igs_m027_state *state = machine.driver_data<igs_m027_state>();
138138   //ppppppppNNNNNNNN
139139   int tileno,colour;
140   tileno = state->m_igs_bg_videoram.target()[tile_index] & 0xffff;
141   colour = (state->m_igs_bg_videoram.target()[tile_index]>>0x10) & 0xffff;
140   tileno = state->m_igs_bg_videoram[tile_index] & 0xffff;
141   colour = (state->m_igs_bg_videoram[tile_index]>>0x10) & 0xffff;
142142
143143   SET_TILE_INFO(0,tileno,colour,0);
144144}
r14899r14900
147147/* Palette Layer */
148148WRITE32_MEMBER(igs_m027_state::igs_palette32_w)
149149{
150   m_generic_paletteram_16.set_target((UINT16 *)m_igs_palette32.target(), 0x800);
151   COMBINE_DATA(&m_igs_palette32.target()[offset]);
150   m_generic_paletteram_16.set_target(reinterpret_cast<UINT16 *>(m_igs_palette32.target()), 0x800);
151   COMBINE_DATA(&m_igs_palette32[offset]);
152152   //paletteram_xGGGGGRRRRRBBBBB_word_w(offset*2,m_generic_paletteram_16[offset*2],0);
153153   //paletteram_xGGGGGRRRRRBBBBB_word_w(offset*2+1,m_generic_paletteram_16[offset*2+1],0);
154154   //if(data!=0)
155   //fprintf(stdout,"PALETTE RAM OFFSET %x ,data %x!\n",offset ,m_igs_palette32.target()[offset]);
155   //fprintf(stdout,"PALETTE RAM OFFSET %x ,data %x!\n",offset ,m_igs_palette32[offset]);
156156}
157157
158158
src/mame/drivers/subsino2.c
r14899r14900
832832
833833READ8_MEMBER(subsino2_state::am188em_regs_r)
834834{
835   return m_am188em_regs.target()[offset];
835   return m_am188em_regs[offset];
836836}
837837
838838WRITE8_MEMBER(subsino2_state::am188em_regs_w)
839839{
840   m_am188em_regs.target()[offset] = data;
840   m_am188em_regs[offset] = data;
841841}
842842
843843static MACHINE_RESET( am188em )
844844{
845845   subsino2_state *state = machine.driver_data<subsino2_state>();
846846   // start with masked interrupts
847   state->m_am188em_regs.target()[AM188EM_IMASK+0] = 0xfd;
848   state->m_am188em_regs.target()[AM188EM_IMASK+1] = 0x07;
849   state->m_am188em_regs.target()[AM188EM_I0CON+0] = 0x0f;
850   state->m_am188em_regs.target()[AM188EM_I0CON+1] = 0x00;
847   state->m_am188em_regs[AM188EM_IMASK+0] = 0xfd;
848   state->m_am188em_regs[AM188EM_IMASK+1] = 0x07;
849   state->m_am188em_regs[AM188EM_I0CON+0] = 0x0f;
850   state->m_am188em_regs[AM188EM_I0CON+1] = 0x00;
851851}
852852
853853static INTERRUPT_GEN( am188em_int0_irq )
854854{
855855   subsino2_state *state = device->machine().driver_data<subsino2_state>();
856   if ( ((state->m_am188em_regs.target()[AM188EM_IMASK+0] & 0x10) == 0) ||   // IMASK.I0 mask
857       ((state->m_am188em_regs.target()[AM188EM_I0CON+0] & 0x08) == 0) )   // I0CON.MSK mask
856   if ( ((state->m_am188em_regs[AM188EM_IMASK+0] & 0x10) == 0) ||   // IMASK.I0 mask
857       ((state->m_am188em_regs[AM188EM_I0CON+0] & 0x08) == 0) )   // I0CON.MSK mask
858858      device_set_input_line_and_vector(device, 0, HOLD_LINE, 0x0c);   // INT0 (background scrolling in xplan)
859859}
860860
861861static TIMER_DEVICE_CALLBACK( am188em_timer2_irq )
862862{
863863   subsino2_state *state = timer.machine().driver_data<subsino2_state>();
864   if ((state->m_am188em_regs.target()[AM188EM_IMASK+0] & 0x01) == 0)   // TMR mask
864   if ((state->m_am188em_regs[AM188EM_IMASK+0] & 0x01) == 0)   // TMR mask
865865      cputag_set_input_line_and_vector(timer.machine(), "maincpu", 0, HOLD_LINE, 0x4c/4);
866866}
867867
r14899r14900
925925
926926WRITE16_MEMBER(subsino2_state::bishjan_outputs_w)
927927{
928   m_outputs16.target()[offset] = data;
928   m_outputs16[offset] = data;
929929
930930   switch (offset)
931931   {
r14899r14900
939939         break;
940940   }
941941
942//  popmessage("0: %04x", m_outputs16.target()[0]);
942//  popmessage("0: %04x", m_outputs16[0]);
943943}
944944
945945
r14899r14900
997997
998998WRITE8_MEMBER(subsino2_state::expcard_outputs_w)
999999{
1000   m_outputs.target()[offset] = data;
1000   m_outputs[offset] = data;
10011001
10021002   switch (offset)
10031003   {
r14899r14900
10241024         break;
10251025   }
10261026
1027//  popmessage("0: %02x - 1: %02x - 2: %02x - 3: %02x", m_outputs.target()[0], m_outputs.target()[1], m_outputs.target()[2], m_outputs.target()[3]);
1027//  popmessage("0: %02x - 1: %02x - 2: %02x - 3: %02x", m_outputs[0], m_outputs[1], m_outputs[2], m_outputs[3]);
10281028}
10291029
10301030/***************************************************************************
r14899r14900
10331033
10341034WRITE8_MEMBER(subsino2_state::mtrain_outputs_w)
10351035{
1036   m_outputs.target()[offset] = data;
1036   m_outputs[offset] = data;
10371037
10381038   switch (offset)
10391039   {
r14899r14900
10591059         break;
10601060   }
10611061
1062//  popmessage("0: %02x - 1: %02x - 2: %02x - 3: %02x", m_outputs.target()[0], m_outputs.target()[1], m_outputs.target()[2], m_outputs.target()[3]);
1062//  popmessage("0: %02x - 1: %02x - 2: %02x - 3: %02x", m_outputs[0], m_outputs[1], m_outputs[2], m_outputs[3]);
10631063}
10641064
10651065WRITE8_MEMBER(subsino2_state::mtrain_videoram_w)
r14899r14900
11631163
11641164WRITE8_MEMBER(subsino2_state::saklove_outputs_w)
11651165{
1166   m_outputs.target()[offset] = data;
1166   m_outputs[offset] = data;
11671167
11681168   switch (offset)
11691169   {
r14899r14900
11831183         break;
11841184   }
11851185
1186//  popmessage("0: %02x - 1: %02x - 2: %02x - 3: %02x", m_outputs.target()[0], m_outputs.target()[1], m_outputs.target()[2], m_outputs.target()[3]);
1186//  popmessage("0: %02x - 1: %02x - 2: %02x - 3: %02x", m_outputs[0], m_outputs[1], m_outputs[2], m_outputs[3]);
11871187}
11881188
11891189static ADDRESS_MAP_START( saklove_map, AS_PROGRAM, 8, subsino2_state )
r14899r14900
12451245
12461246WRITE8_MEMBER(subsino2_state::xplan_outputs_w)
12471247{
1248   m_outputs.target()[offset] = data;
1248   m_outputs[offset] = data;
12491249
12501250   switch (offset)
12511251   {
r14899r14900
12731273         break;
12741274   }
12751275
1276//  popmessage("0: %02x - 1: %02x - 2: %02x - 3: %02x", m_outputs.target()[0], m_outputs.target()[1], m_outputs.target()[2], m_outputs.target()[3]);
1276//  popmessage("0: %02x - 1: %02x - 2: %02x - 3: %02x", m_outputs[0], m_outputs[1], m_outputs[2], m_outputs[3]);
12771277}
12781278
12791279static ADDRESS_MAP_START( xplan_map, AS_PROGRAM, 8, subsino2_state )
r14899r14900
13471347
13481348WRITE8_MEMBER(subsino2_state::xtrain_outputs_w)
13491349{
1350   m_outputs.target()[offset] = data;
1350   m_outputs[offset] = data;
13511351
13521352   switch (offset)
13531353   {
r14899r14900
13761376         break;
13771377   }
13781378
1379//  popmessage("0: %02x - 1: %02x - 2: %02x - 3: %02x", m_outputs.target()[0], m_outputs.target()[1], m_outputs.target()[2], m_outputs.target()[3]);
1379//  popmessage("0: %02x - 1: %02x - 2: %02x - 3: %02x", m_outputs[0], m_outputs[1], m_outputs[2], m_outputs[3]);
13801380}
13811381
13821382static ADDRESS_MAP_START( expcard_io, AS_IO, 8, subsino2_state )
src/mame/drivers/buster.c
r14899r14900
4141   {
4242      for (x=0;x<32;x++)
4343      {
44         int tile = (state->m_vram.target()[count+1])|(state->m_vram.target()[count]<<8);
44         int tile = (state->m_vram[count+1])|(state->m_vram[count]<<8);
4545         //int colour = tile>>12;
4646         drawgfx_opaque(bitmap,cliprect,gfx,tile,0,0,0,x*8,y*4);
4747
src/mame/drivers/m63.c
r14899r14900
236236WRITE8_MEMBER(m63_state::m63_videoram_w)
237237{
238238
239   m_videoram.target()[offset] = data;
239   m_videoram[offset] = data;
240240   m_bg_tilemap->mark_tile_dirty(offset);
241241}
242242
243243WRITE8_MEMBER(m63_state::m63_colorram_w)
244244{
245245
246   m_colorram.target()[offset] = data;
246   m_colorram[offset] = data;
247247   m_bg_tilemap->mark_tile_dirty(offset);
248248}
249249
250250WRITE8_MEMBER(m63_state::m63_videoram2_w)
251251{
252252
253   m_videoram2.target()[offset] = data;
253   m_videoram2[offset] = data;
254254   m_fg_tilemap->mark_tile_dirty(offset);
255255}
256256
r14899r14900
285285{
286286   m63_state *state = machine.driver_data<m63_state>();
287287
288   int attr = state->m_colorram.target()[tile_index];
289   int code = state->m_videoram.target()[tile_index] | ((attr & 0x30) << 4);
288   int attr = state->m_colorram[tile_index];
289   int code = state->m_videoram[tile_index] | ((attr & 0x30) << 4);
290290   int color = (attr & 0x0f) + (state->m_pal_bank << 4);
291291
292292   SET_TILE_INFO(1, code, color, 0);
r14899r14900
296296{
297297   m63_state *state = machine.driver_data<m63_state>();
298298
299   int code = state->m_videoram2.target()[tile_index];
299   int code = state->m_videoram2[tile_index];
300300
301301   SET_TILE_INFO(0, code, 0, state->m_fg_flag);
302302}
r14899r14900
319319
320320   for (offs = 0; offs < state->m_spriteram.bytes(); offs += 4)
321321   {
322      int code = state->m_spriteram.target()[offs + 1] | ((state->m_spriteram.target()[offs + 2] & 0x10) << 4);
323      int color = (state->m_spriteram.target()[offs + 2] & 0x0f) + (state->m_pal_bank << 4);
324      int flipx = state->m_spriteram.target()[offs + 2] & 0x20;
322      int code = state->m_spriteram[offs + 1] | ((state->m_spriteram[offs + 2] & 0x10) << 4);
323      int color = (state->m_spriteram[offs + 2] & 0x0f) + (state->m_pal_bank << 4);
324      int flipx = state->m_spriteram[offs + 2] & 0x20;
325325      int flipy = 0;
326      int sx = state->m_spriteram.target()[offs + 3];
327      int sy = state->m_sy_offset - state->m_spriteram.target()[offs];
326      int sx = state->m_spriteram[offs + 3];
327      int sy = state->m_sy_offset - state->m_spriteram[offs];
328328
329329      if (state->flip_screen())
330330      {
r14899r14900
360360   int col;
361361
362362   for (col = 0; col < 32; col++)
363      state->m_bg_tilemap->set_scrolly(col, state->m_scrollram.target()[col * 8]);
363      state->m_bg_tilemap->set_scrolly(col, state->m_scrollram[col * 8]);
364364
365365   state->m_bg_tilemap->draw(bitmap, cliprect, 0, 0);
366366   draw_sprites(screen.machine(), bitmap, cliprect);
src/mame/drivers/toratora.c
r14899r14900
7979
8080      UINT8 y = offs >> 5;
8181      UINT8 x = offs << 3;
82      UINT8 data = state->m_videoram.target()[offs];
82      UINT8 data = state->m_videoram[offs];
8383
8484      for (i = 0; i < 8; i++)
8585      {
r14899r14900
9292
9393      /* the video system clears as it writes out the pixels */
9494      if (state->m_clear_tv)
95         state->m_videoram.target()[offs] = 0;
95         state->m_videoram[offs] = 0;
9696   }
9797
9898   state->m_clear_tv = 0;
src/mame/drivers/r2dtank.c
r14899r14900
353353      if (state->m_flipscreen)
354354         offs = offs ^ 0x1fff;
355355
356      data = state->m_videoram.target()[offs];
357      fore_color = (state->m_colorram.target()[offs] >> 5) & 0x07;
356      data = state->m_videoram[offs];
357      fore_color = (state->m_colorram[offs] >> 5) & 0x07;
358358
359359      for (i = 0; i < 8; i++)
360360      {
src/mame/drivers/mastboy.c
r14899r14900
493493
494494   for (i=0;i<0x200;i+=2)
495495   {
496      int coldat = state->m_colram.target()[i+1] |  (state->m_colram.target()[i+0]<<8);
496      int coldat = state->m_colram[i+1] |  (state->m_colram[i+0]<<8);
497497
498498      palette_set_color_rgb(screen.machine(),i/2,pal4bit(coldat>>8),pal4bit(coldat>>12),pal4bit(coldat>>4));
499499   }
r14899r14900
503503      for (x=0;x<32;x++)
504504      {
505505         /* bytes 0 and 3 seem to be unused for rendering , they appear to contain data the game uses internally */
506         int tileno = (state->m_tileram.target()[count+1]|(state->m_tileram.target()[count+2]<<8))&0xfff;
507         int attr = (state->m_tileram.target()[count+2]&0xf0)>>4;
506         int tileno = (state->m_tileram[count+1]|(state->m_tileram[count+2]<<8))&0xfff;
507         int attr = (state->m_tileram[count+2]&0xf0)>>4;
508508         gfx_element *gfx;
509509
510510         if (tileno&0x800)
r14899r14900
606606
607607READ8_MEMBER(mastboy_state::mastboy_backupram_r)
608608{
609   return m_nvram.target()[offset];
609   return m_nvram[offset];
610610}
611611
612612WRITE8_MEMBER(mastboy_state::mastboy_backupram_w)
613613{
614614//  if (m_backupram_enabled)
615615//  {
616      m_nvram.target()[offset] = data;
616      m_nvram[offset] = data;
617617//  }
618618//  else
619619//  {
src/mame/drivers/rmhaihai.c
r14899r14900
6060
6161WRITE8_MEMBER(rmhaihai_state::rmhaihai_videoram_w)
6262{
63   m_videoram.target()[offset] = data;
63   m_videoram[offset] = data;
6464   m_bg_tilemap->mark_tile_dirty(offset);
6565}
6666
6767WRITE8_MEMBER(rmhaihai_state::rmhaihai_colorram_w)
6868{
69   m_colorram.target()[offset] = data;
69   m_colorram[offset] = data;
7070   m_bg_tilemap->mark_tile_dirty(offset);
7171}
7272
7373static TILE_GET_INFO( get_bg_tile_info )
7474{
7575   rmhaihai_state *state = machine.driver_data<rmhaihai_state>();
76   int attr = state->m_colorram.target()[tile_index];
77   int code = state->m_videoram.target()[tile_index] + (state->m_gfxbank << 12) + ((attr & 0x07) << 8) + ((attr & 0x80) << 4);
76   int attr = state->m_colorram[tile_index];
77   int code = state->m_videoram[tile_index] + (state->m_gfxbank << 12) + ((attr & 0x07) << 8) + ((attr & 0x80) << 4);
7878   int color = (state->m_gfxbank << 5) + (attr >> 3);
7979
8080   SET_TILE_INFO(0, code, color, 0);
src/mame/drivers/albazc.c
r14899r14900
6565
6666   for (i = 511; i >= 0; i--)
6767   {
68      int code = state->m_spriteram1.target()[i] | (state->m_spriteram2.target()[i] << 8);
69      int color = (state->m_spriteram2.target()[i + 0x200] & 0xf8) >> 3;
68      int code = state->m_spriteram1[i] | (state->m_spriteram2[i] << 8);
69      int color = (state->m_spriteram2[i + 0x200] & 0xf8) >> 3;
7070      int flipx = 0;
7171      int flipy = 0;
72      int sx = state->m_spriteram1.target()[i + 0x200] | ((state->m_spriteram2.target()[i + 0x200] & 0x07) << 8);
73      int sy = 242 - state->m_spriteram3.target()[i];
72      int sx = state->m_spriteram1[i + 0x200] | ((state->m_spriteram2[i + 0x200] & 0x07) << 8);
73      int sy = 242 - state->m_spriteram3[i];
7474
7575      if (state->m_flip_bit)
7676      {
src/mame/drivers/midas.c
r14899r14900
235235   {
236236      case 1:
237237      {
238         UINT16 addr = m_gfxregs.target()[0];
238         UINT16 addr = m_gfxregs[0];
239239         m_gfxram[addr] = data;
240         m_gfxregs.target()[0] += m_gfxregs.target()[2];
240         m_gfxregs[0] += m_gfxregs[2];
241241
242242         if ( addr >= 0x7000 && addr <= 0x7fff )   m_tmap->mark_tile_dirty(addr - 0x7000);
243243
src/mame/drivers/aristmk4.c
r14899r14900
362362   {
363363      for (x=38;x--;)
364364      {
365      color = ((state->m_mkiv_vram.target()[count]) & 0xe0) >> 5;
366         tile = (state->m_mkiv_vram.target()[count+1]|state->m_mkiv_vram.target()[count]<<8) & 0x3ff;
367         bgtile = (state->m_mkiv_vram.target()[count+1]|state->m_mkiv_vram.target()[count]<<8) & 0xff; // first 256 tiles
365      color = ((state->m_mkiv_vram[count]) & 0xe0) >> 5;
366         tile = (state->m_mkiv_vram[count+1]|state->m_mkiv_vram[count]<<8) & 0x3ff;
367         bgtile = (state->m_mkiv_vram[count+1]|state->m_mkiv_vram[count]<<8) & 0xff; // first 256 tiles
368368         uBackgroundColour(screen.machine());   // read sw7
369369         gfx_element_decode(gfx, bgtile);   // force the machine to update only the first 256 tiles.
370370                        // as we only update the background, not the entire display.
371         flipx = ((state->m_mkiv_vram.target()[count]) & 0x04);
372         flipy = ((state->m_mkiv_vram.target()[count]) & 0x08);
371         flipx = ((state->m_mkiv_vram[count]) & 0x04);
372         flipy = ((state->m_mkiv_vram[count]) & 0x08);
373373         drawgfx_opaque(bitmap,cliprect,gfx,tile,color,flipx,flipy,(38-x-1)<<3,(27-y-1)<<3);
374374         count+=2;
375375      }
src/mame/drivers/galaxi.c
r14899r14900
9696static TILE_GET_INFO( get_bg1_tile_info )
9797{
9898   galaxi_state *state = machine.driver_data<galaxi_state>();
99   UINT16 code = state->m_bg1_ram.target()[tile_index];
99   UINT16 code = state->m_bg1_ram[tile_index];
100100   SET_TILE_INFO(0, code, 0x10 + (code >> 12), 0);
101101}
102102
103103static TILE_GET_INFO( get_bg2_tile_info )
104104{
105105   galaxi_state *state = machine.driver_data<galaxi_state>();
106   UINT16 code = state->m_bg2_ram.target()[tile_index];
106   UINT16 code = state->m_bg2_ram[tile_index];
107107   SET_TILE_INFO(0, code, 0x10 + (code >> 12), 0);
108108}
109109
110110static TILE_GET_INFO( get_bg3_tile_info )
111111{
112112   galaxi_state *state = machine.driver_data<galaxi_state>();
113   UINT16 code = state->m_bg3_ram.target()[tile_index];
113   UINT16 code = state->m_bg3_ram[tile_index];
114114   SET_TILE_INFO(0, code, (code >> 12), 0);
115115}
116116
117117static TILE_GET_INFO( get_bg4_tile_info )
118118{
119119   galaxi_state *state = machine.driver_data<galaxi_state>();
120   UINT16 code = state->m_bg4_ram.target()[tile_index];
120   UINT16 code = state->m_bg4_ram[tile_index];
121121   SET_TILE_INFO(0, code, (code >> 12), 0);
122122}
123123
124124static TILE_GET_INFO( get_fg_tile_info )
125125{
126126   galaxi_state *state = machine.driver_data<galaxi_state>();
127   UINT16 code = state->m_fg_ram.target()[tile_index];
127   UINT16 code = state->m_fg_ram[tile_index];
128128   SET_TILE_INFO(1, code, 0x20 + (code >> 12), 0);
129129}
130130
131131WRITE16_MEMBER(galaxi_state::galaxi_bg1_w)
132132{
133   COMBINE_DATA(&m_bg1_ram.target()[offset]);
133   COMBINE_DATA(&m_bg1_ram[offset]);
134134   m_bg1_tmap->mark_tile_dirty(offset);
135135}
136136
137137WRITE16_MEMBER(galaxi_state::galaxi_bg2_w)
138138{
139   COMBINE_DATA(&m_bg2_ram.target()[offset]);
139   COMBINE_DATA(&m_bg2_ram[offset]);
140140   m_bg2_tmap->mark_tile_dirty(offset);
141141}
142142
143143WRITE16_MEMBER(galaxi_state::galaxi_bg3_w)
144144{
145   COMBINE_DATA(&m_bg3_ram.target()[offset]);
145   COMBINE_DATA(&m_bg3_ram[offset]);
146146   m_bg3_tmap->mark_tile_dirty(offset);
147147}
148148
149149WRITE16_MEMBER(galaxi_state::galaxi_bg4_w)
150150{
151   COMBINE_DATA(&m_bg4_ram.target()[offset]);
151   COMBINE_DATA(&m_bg4_ram[offset]);
152152   m_bg4_tmap->mark_tile_dirty(offset);
153153}
154154
155155WRITE16_MEMBER(galaxi_state::galaxi_fg_w)
156156{
157   COMBINE_DATA(&m_fg_ram.target()[offset]);
157   COMBINE_DATA(&m_fg_ram[offset]);
158158   m_fg_tmap->mark_tile_dirty(offset);
159159}
160160
src/mame/drivers/murogmbl.c
r14899r14900
103103   {
104104      for (x = 0; x < 32; x++)
105105      {
106         int tile = state->m_video.target()[count];
106         int tile = state->m_video[count];
107107         drawgfx_opaque(bitmap, cliprect, gfx, tile, 0, 0, 0, x * 8, y * 8);
108108
109109         count++;
src/mame/drivers/cabaret.c
r14899r14900
6363
6464WRITE8_MEMBER(cabaret_state::bg_scroll_w)
6565{
66   m_bg_scroll.target()[offset] = data;
66   m_bg_scroll[offset] = data;
6767   m_bg_tilemap->set_scrolly(offset,data);
6868}
6969
7070WRITE8_MEMBER(cabaret_state::bg_tile_w)
7171{
72   m_bg_tile_ram.target()[offset] = data;
72   m_bg_tile_ram[offset] = data;
7373   m_bg_tilemap->mark_tile_dirty(offset);
7474}
7575
7676static TILE_GET_INFO( get_bg_tile_info )
7777{
7878   cabaret_state *state = machine.driver_data<cabaret_state>();
79   int code = state->m_bg_tile_ram.target()[tile_index];
79   int code = state->m_bg_tile_ram[tile_index];
8080   SET_TILE_INFO(1, code & 0xff, 0, 0);
8181}
8282
8383static TILE_GET_INFO( get_fg_tile_info )
8484{
8585   cabaret_state *state = machine.driver_data<cabaret_state>();
86   int code = state->m_fg_tile_ram.target()[tile_index] | (state->m_fg_color_ram.target()[tile_index] << 8);
86   int code = state->m_fg_tile_ram[tile_index] | (state->m_fg_color_ram[tile_index] << 8);
8787   int tile = code & 0x1fff;
8888   SET_TILE_INFO(0, code, tile != 0x1fff ? ((code >> 12) & 0xe) + 1 : 0, 0);
8989}
9090
9191WRITE8_MEMBER(cabaret_state::fg_tile_w)
9292{
93   m_fg_tile_ram.target()[offset] = data;
93   m_fg_tile_ram[offset] = data;
9494   m_fg_tilemap->mark_tile_dirty(offset);
9595}
9696
9797WRITE8_MEMBER(cabaret_state::fg_color_w)
9898{
99   m_fg_color_ram.target()[offset] = data;
99   m_fg_color_ram[offset] = data;
100100   m_fg_tilemap->mark_tile_dirty(offset);
101101}
102102
src/mame/drivers/olibochu.c
r14899r14900
124124
125125WRITE8_MEMBER(olibochu_state::olibochu_videoram_w)
126126{
127   m_videoram.target()[offset] = data;
127   m_videoram[offset] = data;
128128   m_bg_tilemap->mark_tile_dirty(offset);
129129}
130130
131131WRITE8_MEMBER(olibochu_state::olibochu_colorram_w)
132132{
133   m_colorram.target()[offset] = data;
133   m_colorram[offset] = data;
134134   m_bg_tilemap->mark_tile_dirty(offset);
135135}
136136
r14899r14900
148148static TILE_GET_INFO( get_bg_tile_info )
149149{
150150   olibochu_state *state = machine.driver_data<olibochu_state>();
151   int attr = state->m_colorram.target()[tile_index];
152   int code = state->m_videoram.target()[tile_index] + ((attr & 0x20) << 3);
151   int attr = state->m_colorram[tile_index];
152   int code = state->m_videoram[tile_index] + ((attr & 0x20) << 3);
153153   int color = (attr & 0x1f) + 0x20;
154154   int flags = ((attr & 0x40) ? TILE_FLIPX : 0) | ((attr & 0x80) ? TILE_FLIPY : 0);
155155
r14899r14900
165165static void draw_sprites( running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect )
166166{
167167   olibochu_state *state = machine.driver_data<olibochu_state>();
168   UINT8 *spriteram = state->m_spriteram.target();
169   UINT8 *spriteram_2 = state->m_spriteram2.target();
168   UINT8 *spriteram = state->m_spriteram;
169   UINT8 *spriteram_2 = state->m_spriteram2;
170170   int offs;
171171
172172   /* 16x16 sprites */
src/mame/drivers/tugboat.c
r14899r14900
8787
8888WRITE8_MEMBER(tugboat_state::tugboat_score_w)
8989{
90      if (offset>=0x8) m_ram.target()[0x291d + 32*offset + 32*(1-8)] = data ^ 0x0f;
91      if (offset<0x8 ) m_ram.target()[0x291d + 32*offset + 32*9] = data ^ 0x0f;
90      if (offset>=0x8) m_ram[0x291d + 32*offset + 32*(1-8)] = data ^ 0x0f;
91      if (offset<0x8 ) m_ram[0x291d + 32*offset + 32*9] = data ^ 0x0f;
9292}
9393
9494static void draw_tilemap(running_machine &machine, bitmap_ind16 &bitmap,const rectangle &cliprect,
r14899r14900
101101   {
102102      for (x = 0;x < 32;x++)
103103      {
104         int code = (state->m_ram.target()[addr + 0x400] << 8) | state->m_ram.target()[addr];
104         int code = (state->m_ram[addr + 0x400] << 8) | state->m_ram[addr];
105105         int color = (code & 0x3c00) >> 10;
106106         int rgn;
107107
src/mame/drivers/kingdrby.c
r14899r14900
124124static TILE_GET_INFO( get_sc0_tile_info )
125125{
126126   kingdrby_state *state = machine.driver_data<kingdrby_state>();
127   int tile = state->m_vram.target()[tile_index] | state->m_attr.target()[tile_index]<<8;
128   int color = (state->m_attr.target()[tile_index] & 0x06)>>1;
127   int tile = state->m_vram[tile_index] | state->m_attr[tile_index]<<8;
128   int color = (state->m_attr[tile_index] & 0x06)>>1;
129129
130130   tile&=0x1ff;
131131
r14899r14900
139139static TILE_GET_INFO( get_sc1_tile_info )
140140{
141141   kingdrby_state *state = machine.driver_data<kingdrby_state>();
142   int tile = state->m_vram.target()[tile_index] | state->m_attr.target()[tile_index]<<8;
143   int color = (state->m_attr.target()[tile_index] & 0x06)>>1;
142   int tile = state->m_vram[tile_index] | state->m_attr[tile_index]<<8;
143   int color = (state->m_attr[tile_index] & 0x06)>>1;
144144
145145   tile&=0x1ff;
146146   //original 0xc
r14899r14900
153153         color|0x40,
154154         0);
155155
156   tileinfo.category = (state->m_attr.target()[tile_index] & 0x08)>>3;
156   tileinfo.category = (state->m_attr[tile_index] & 0x08)>>3;
157157}
158158
159159static VIDEO_START(kingdrby)
r14899r14900
175175static void draw_sprites(running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect)
176176{
177177   kingdrby_state *state = machine.driver_data<kingdrby_state>();
178   UINT8 *spriteram = state->m_spriteram.target();
178   UINT8 *spriteram = state->m_spriteram;
179179   int count = 0;
180180
181181   /*sprites not fully understood.*/
r14899r14900
222222   kingdrby_state *state = screen.machine().driver_data<kingdrby_state>();
223223   const rectangle &visarea = screen.visible_area();
224224   rectangle clip;
225   state->m_sc0_tilemap->set_scrollx(0, state->m_vram.target()[0x342]);
226   state->m_sc0_tilemap->set_scrolly(0, state->m_vram.target()[0x341]);
227   state->m_sc1_tilemap->set_scrollx(0, state->m_vram.target()[0x342]);
228   state->m_sc1_tilemap->set_scrolly(0, state->m_vram.target()[0x341]);
225   state->m_sc0_tilemap->set_scrollx(0, state->m_vram[0x342]);
226   state->m_sc0_tilemap->set_scrolly(0, state->m_vram[0x341]);
227   state->m_sc1_tilemap->set_scrollx(0, state->m_vram[0x342]);
228   state->m_sc1_tilemap->set_scrolly(0, state->m_vram[0x341]);
229229   state->m_sc0w_tilemap->set_scrolly(0, 32);
230230
231231   /* maybe it needs two window tilemaps? (one at the top, the other at the bottom)*/
r14899r14900
242242
243243WRITE8_MEMBER(kingdrby_state::sc0_vram_w)
244244{
245   m_vram.target()[offset] = data;
245   m_vram[offset] = data;
246246   m_sc0_tilemap->mark_tile_dirty(offset);
247247   m_sc0w_tilemap->mark_tile_dirty(offset);
248248   m_sc1_tilemap->mark_tile_dirty(offset);
r14899r14900
250250
251251WRITE8_MEMBER(kingdrby_state::sc0_attr_w)
252252{
253   m_attr.target()[offset] = data;
253   m_attr[offset] = data;
254254   m_sc0_tilemap->mark_tile_dirty(offset);
255255   m_sc0w_tilemap->mark_tile_dirty(offset);
256256   m_sc1_tilemap->mark_tile_dirty(offset);
src/mame/drivers/r2dx_v33.c
r14899r14900
9898static void draw_sprites(running_machine &machine, bitmap_ind16 &bitmap,const rectangle &cliprect,int pri)
9999{
100100   r2dx_v33_state *state = machine.driver_data<r2dx_v33_state>();
101   UINT16 *spriteram16 = state->m_spriteram.target();
101   UINT16 *spriteram16 = state->m_spriteram;
102102   int offs,fx,fy,x,y,color,sprite;
103103//  int cur_pri;
104104   int dx,dy,ax,ay;
src/mame/drivers/embargo.c
r14899r14900
4747
4848      UINT8 x = offs << 3;
4949      UINT8 y = offs >> 5;
50      UINT8 data = state->m_videoram.target()[offs];
50      UINT8 data = state->m_videoram[offs];
5151
5252      for (i = 0; i < 8; i++)
5353      {
src/mame/drivers/warpsped.c
r14899r14900
112112{
113113   warpspeed_state *state = machine.driver_data<warpspeed_state>();
114114
115   UINT8 code = state->m_videoram.target()[tile_index] & 0x3f;
115   UINT8 code = state->m_videoram[tile_index] & 0x3f;
116116   SET_TILE_INFO(0, code, 0, 0);
117117}
118118
r14899r14900
129129WRITE8_MEMBER(warpspeed_state::warpspeed_vidram_w)
130130{
131131
132   m_videoram.target()[offset] = data;
132   m_videoram[offset] = data;
133133   m_text_tilemap->mark_tile_dirty(offset);
134134}
135135
src/mame/drivers/spaceg.c
r14899r14900
226226
227227WRITE8_MEMBER(spaceg_state::zvideoram_w)
228228{
229   int col = m_colorram.target()[0x400];
229   int col = m_colorram[0x400];
230230   int xoff = *m_io9400 >> 5 & 7;
231231   UINT16 offset2 = (offset + 0x100) & 0x1fff;
232232   UINT16 sdata = data << (8 - xoff);
233   UINT16 vram_data = m_videoram.target()[offset] << 8 | (m_videoram.target()[offset2]);
233   UINT16 vram_data = m_videoram[offset] << 8 | (m_videoram[offset2]);
234234
235235   if (col > 0x0f) popmessage("color > 0x0f = %2d", col);
236236   col &= 0x0f;
237237
238   switch (*m_io9401.target())
238   switch (*m_io9401)
239239   {
240240      // draw
241241      case 0:
r14899r14900
245245         vram_data |= sdata;
246246
247247         // update colorram
248         if (sdata&0xff00) m_colorram.target()[offset] = col;
249         if (sdata&0x00ff) m_colorram.target()[offset2] = col;
248         if (sdata&0xff00) m_colorram[offset] = col;
249         if (sdata&0x00ff) m_colorram[offset2] = col;
250250         break;
251251
252252      // erase
r14899r14900
260260         return;
261261   }
262262
263   m_videoram.target()[offset]=vram_data>>8;
264   m_videoram.target()[offset2]=vram_data&0xff;
263   m_videoram[offset]=vram_data>>8;
264   m_videoram[offset2]=vram_data&0xff;
265265}
266266
267267
r14899r14900
271271
272272   if (offset < 0x400)
273273   {
274      rgbcolor = (m_colorram.target()[offset] << 1) | ((offset &0x100) >> 8);
274      rgbcolor = (m_colorram[offset] << 1) | ((offset &0x100) >> 8);
275275
276276      if ((offset >= 0x200) && (offset < 0x220)) /* 0xa200- 0xa21f */
277277      {
r14899r14900
292292   if (*m_io9401 != 0x40)
293293      logerror("colorram read in mode: 9401 = %02x (offset = %04x)\n", *m_io9401, offset);
294294
295   return m_colorram.target()[offset];
295   return m_colorram[offset];
296296}
297297
298298
r14899r14900
304304   for (offs = 0; offs < 0x2000; offs++)
305305   {
306306      int i;
307      UINT8 data = state->m_videoram.target()[offs];
307      UINT8 data = state->m_videoram[offs];
308308      int y = offs & 0xff;
309309      int x = (offs >> 8) << 3;
310310
311311      for (i = 0; i < 8; i++)
312312      {
313         bitmap.pix16(y, x) = (data & 0x80) ? state->m_colorram.target()[offs] : 0;
313         bitmap.pix16(y, x) = (data & 0x80) ? state->m_colorram[offs] : 0;
314314
315315         x++;
316316         data <<= 1;
src/mame/drivers/looping.c
r14899r14900
192192static TILE_GET_INFO( get_tile_info )
193193{
194194   looping_state *state = machine.driver_data<looping_state>();
195   int tile_number = state->m_videoram.target()[tile_index];
196   int color = state->m_colorram.target()[(tile_index & 0x1f) * 2 + 1] & 0x07;
195   int tile_number = state->m_videoram[tile_index];
196   int color = state->m_colorram[(tile_index & 0x1f) * 2 + 1] & 0x07;
197197   SET_TILE_INFO(0, tile_number, color, 0);
198198}
199199
r14899r14900
231231
232232WRITE8_MEMBER(looping_state::looping_videoram_w)
233233{
234   m_videoram.target()[offset] = data;
234   m_videoram[offset] = data;
235235   m_bg_tilemap->mark_tile_dirty(offset);
236236}
237237
r14899r14900
240240{
241241   int i;
242242
243   m_colorram.target()[offset] = data;
243   m_colorram[offset] = data;
244244
245245   /* odd bytes are column color attribute */
246246   if (offset & 1)
r14899r14900
269269   const UINT8 *source;
270270   looping_state *state = machine.driver_data<looping_state>();
271271
272   for (source = state->m_spriteram.target(); source < state->m_spriteram + 0x40; source += 4)
272   for (source = state->m_spriteram; source < state->m_spriteram + 0x40; source += 4)
273273   {
274274      int sx = source[3];
275275      int sy = 240 - source[0];
src/mame/drivers/1945kiii.c
r14899r14900
7979
8080WRITE16_MEMBER(k3_state::k3_bgram_w)
8181{
82   COMBINE_DATA(&m_bgram.target()[offset]);
82   COMBINE_DATA(&m_bgram[offset]);
8383   m_bg_tilemap->mark_tile_dirty(offset);
8484}
8585
8686static TILE_GET_INFO( get_k3_bg_tile_info )
8787{
8888   k3_state *state = machine.driver_data<k3_state>();
89   int tileno = state->m_bgram.target()[tile_index];
89   int tileno = state->m_bgram[tile_index];
9090   SET_TILE_INFO(1, tileno, 0, 0);
9191}
9292
r14899r14900
100100{
101101   k3_state *state = machine.driver_data<k3_state>();
102102   const gfx_element *gfx = machine.gfx[0];
103   UINT16 *source = state->m_spriteram_1.target();
104   UINT16 *source2 = state->m_spriteram_2.target();
103   UINT16 *source = state->m_spriteram_1;
104   UINT16 *source2 = state->m_spriteram_2;
105105   UINT16 *finish = source + 0x1000 / 2;
106106
107107   while (source < finish)
src/mame/drivers/astinvad.c
r14899r14900
126126
127127WRITE8_MEMBER(astinvad_state::spaceint_videoram_w)
128128{
129   m_videoram.target()[offset] = data;
129   m_videoram[offset] = data;
130130   m_colorram[offset] = m_color_latch;
131131}
132132
r14899r14900
167167      for (x = cliprect.min_x & ~7; x <= cliprect.max_x; x += 8)
168168      {
169169         UINT8 color = color_prom[((y & 0xf8) << 2) | (x >> 3)] >> (state->m_screen_flip ? 0 : 4);
170         UINT8 data = state->m_videoram.target()[(((y ^ state->m_screen_flip) + yoffs) << 5) | ((x ^ state->m_screen_flip) >> 3)];
170         UINT8 data = state->m_videoram[(((y ^ state->m_screen_flip) + yoffs) << 5) | ((x ^ state->m_screen_flip) >> 3)];
171171         plot_byte(screen.machine(), bitmap, y, x, data, state->m_screen_red ? 1 : color);
172172      }
173173
r14899r14900
183183
184184   for (offs = 0; offs < state->m_videoram.bytes(); offs++)
185185   {
186      UINT8 data = state->m_videoram.target()[offs];
186      UINT8 data = state->m_videoram[offs];
187187      UINT8 color = state->m_colorram[offs];
188188
189189      UINT8 y = ~offs;
src/mame/drivers/esh.c
r14899r14900
3535      : driver_device(mconfig, type, tag),
3636        m_laserdisc(*this, "laserdisc") ,
3737      m_tile_ram(*this, "tile_ram"),
38      m_tile_control_ram(*this, "tile_control_ram"){ }
38      m_tile_control_ram(*this, "tile_ctrl_ram"){ }
3939
4040   required_device<pioneer_ldv1000_device> m_laserdisc;
4141   required_shared_ptr<UINT8> m_tile_ram;
r14899r14900
6969      {
7070         int current_screen_character = (chary*32) + charx;
7171
72         int palIndex  = (state->m_tile_control_ram.target()[current_screen_character] & 0x0f);
73         int tileOffs  = (state->m_tile_control_ram.target()[current_screen_character] & 0x10) >> 4;
74         //int blinkLine = (state->m_tile_control_ram.target()[current_screen_character] & 0x40) >> 6;
75         //int blinkChar = (state->m_tile_control_ram.target()[current_screen_character] & 0x80) >> 7;
72         int palIndex  = (state->m_tile_control_ram[current_screen_character] & 0x0f);
73         int tileOffs  = (state->m_tile_control_ram[current_screen_character] & 0x10) >> 4;
74         //int blinkLine = (state->m_tile_control_ram[current_screen_character] & 0x40) >> 6;
75         //int blinkChar = (state->m_tile_control_ram[current_screen_character] & 0x80) >> 7;
7676
7777         drawgfx_transpen(bitmap, cliprect, screen.machine().gfx[0],
78               state->m_tile_ram.target()[current_screen_character] + (0x100 * tileOffs),
78               state->m_tile_ram[current_screen_character] + (0x100 * tileOffs),
7979               palIndex,
8080               0, 0, charx*8, chary*8, 0);
8181      }
r14899r14900
160160   AM_RANGE(0x0000,0x3fff) AM_ROM
161161   AM_RANGE(0xe000,0xe7ff) AM_RAM AM_SHARE("nvram")
162162   AM_RANGE(0xf000,0xf3ff) AM_RAM AM_SHARE("tile_ram")
163   AM_RANGE(0xf400,0xf7ff) AM_RAM AM_SHARE("tile_control_ram")
163   AM_RANGE(0xf400,0xf7ff) AM_RAM AM_SHARE("tile_ctrl_ram")
164164ADDRESS_MAP_END
165165
166166
src/mame/drivers/halleys.c
r14899r14900
10271027
10281028   if (i==0 || i==4) return(1);
10291029
1030   return(m_blitter_ram.target()[offset]);
1030   return(m_blitter_ram[offset]);
10311031}
10321032
10331033
r14899r14900
10421042{
10431043   int i = offset & 0xf;
10441044
1045   m_blitter_ram.target()[offset] = data;
1045   m_blitter_ram[offset] = data;
10461046
10471047   if (i==0) blit(offset);
10481048
r14899r14900
10931093      return(0);
10941094   }
10951095
1096   return(m_io_ram.target()[0x66]);
1096   return(m_io_ram[0x66]);
10971097}
10981098
10991099
r14899r14900
14961496   copy_fixed_xp (bitmap, state->m_render_layer[0]);
14971497
14981498   // HALF-HACK: apply RGB filter when the following conditions are met
1499   i = state->m_io_ram.target()[0xa0];
1500   j = state->m_io_ram.target()[0xa1];
1501   if (state->m_io_ram.target()[0x2b] && (i>0xc6 && i<0xfe) && (j==0xc0 || j==0xed)) filter_bitmap(screen.machine(), bitmap, i);
1499   i = state->m_io_ram[0xa0];
1500   j = state->m_io_ram[0xa1];
1501   if (state->m_io_ram[0x2b] && (i>0xc6 && i<0xfe) && (j==0xc0 || j==0xed)) filter_bitmap(screen.machine(), bitmap, i);
15021502   return 0;
15031503}
15041504
r14899r14900
15061506static SCREEN_UPDATE_IND16( benberob )
15071507{
15081508   halleys_state *state = screen.machine().driver_data<halleys_state>();
1509   if (state->m_io_ram.target()[0xa0] & 0x80)
1509   if (state->m_io_ram[0xa0] & 0x80)
15101510      copy_scroll_op(bitmap, state->m_render_layer[2], *state->m_scrollx1, *state->m_scrolly1);
15111511   else
15121512      bitmap.fill(state->m_bgcolor, cliprect);
r14899r14900
15261526
15271527READ8_MEMBER(halleys_state::debug_r)
15281528{
1529   return(m_io_ram.target()[offset]);
1529   return(m_io_ram[offset]);
15301530}
15311531
15321532#endif
r14899r14900
15981598
15991599WRITE8_MEMBER(halleys_state::firq_ack_w)
16001600{
1601   m_io_ram.target()[0x9c] = data;
1601   m_io_ram[0x9c] = data;
16021602
16031603   if (m_firq_level) m_firq_level--;
16041604   cputag_set_input_line(machine(), "maincpu", M6809_FIRQ_LINE, CLEAR_LINE);
r14899r14900
16151615WRITE8_MEMBER(halleys_state::soundcommand_w)
16161616{
16171617
1618   m_io_ram.target()[0x8a] = data;
1618   m_io_ram[0x8a] = data;
16191619   soundlatch_byte_w(space,offset,data);
16201620   cputag_set_input_line(machine(), "audiocpu", INPUT_LINE_NMI, PULSE_LINE);
16211621}
r14899r14900
19371937   state->m_bgcolor         = get_black_pen(machine);
19381938   state->m_fftail = state->m_ffhead = state->m_ffcount = 0;
19391939
1940   memset(state->m_io_ram.target(), 0xff, state->m_io_ram.bytes());
1940   memset(state->m_io_ram, 0xff, state->m_io_ram.bytes());
19411941   memset(state->m_render_layer[0], 0, SCREEN_BYTESIZE * MAX_LAYERS);
19421942}
19431943
src/mame/drivers/statriv2.c
r14899r14900
112112static TILE_GET_INFO( horizontal_tile_info )
113113{
114114   statriv2_state *state = machine.driver_data<statriv2_state>();
115   UINT8 *videoram = state->m_videoram.target();
115   UINT8 *videoram = state->m_videoram;
116116   int code = videoram[0x400+tile_index];
117117   int attr = videoram[tile_index] & 0x3f;
118118
r14899r14900
122122static TILE_GET_INFO( vertical_tile_info )
123123{
124124   statriv2_state *state = machine.driver_data<statriv2_state>();
125   UINT8 *videoram = state->m_videoram.target();
125   UINT8 *videoram = state->m_videoram;
126126   int code = videoram[0x400+tile_index];
127127   int attr = videoram[tile_index] & 0x3f;
128128
r14899r14900
170170
171171WRITE8_MEMBER(statriv2_state::statriv2_videoram_w)
172172{
173   UINT8 *videoram = m_videoram.target();
173   UINT8 *videoram = m_videoram;
174174   videoram[offset] = data;
175175   m_tilemap->mark_tile_dirty(offset & 0x3ff);
176176}
r14899r14900
229229   UINT32 address;
230230
231231   if (m_question_offset_high == 0xff)
232      m_question_offset.target()[m_question_offset_low]++;
232      m_question_offset[m_question_offset_low]++;
233233
234   address = m_question_offset.target()[m_question_offset_low];
235   address |= m_question_offset.target()[m_question_offset_mid] << 8;
234   address = m_question_offset[m_question_offset_low];
235   address |= m_question_offset[m_question_offset_mid] << 8;
236236   if (m_question_offset_high != 0xff)
237      address |= m_question_offset.target()[m_question_offset_high] << 16;
237      address |= m_question_offset[m_question_offset_high] << 16;
238238
239239   return (address < qromsize) ? qrom[address] : 0xff;
240240}
src/mame/drivers/carrera.c
r14899r14900
256256   {
257257      for (x=0;x<64;x++)
258258      {
259         int tile = state->m_tileram.target()[count&0x7ff] | state->m_tileram.target()[(count&0x7ff)+0x800]<<8;
259         int tile = state->m_tileram[count&0x7ff] | state->m_tileram[(count&0x7ff)+0x800]<<8;
260260
261261         drawgfx_opaque(bitmap,cliprect,screen.machine().gfx[0],tile,0,0,0,x*8,y*8);
262262         count++;
src/mame/drivers/d9final.c
r14899r14900
4949static TILE_GET_INFO( get_sc0_tile_info )
5050{
5151   d9final_state *state = machine.driver_data<d9final_state>();
52   int tile = ((state->m_hi_vram.target()[tile_index] & 0x3f)<<8) | state->m_lo_vram.target()[tile_index];
53   int color = state->m_cram.target()[tile_index] & 0x3f;
52   int tile = ((state->m_hi_vram[tile_index] & 0x3f)<<8) | state->m_lo_vram[tile_index];
53   int color = state->m_cram[tile_index] & 0x3f;
5454
5555   SET_TILE_INFO(
5656         0,
r14899r14900
7474
7575WRITE8_MEMBER(d9final_state::sc0_lovram)
7676{
77   m_lo_vram.target()[offset] = data;
77   m_lo_vram[offset] = data;
7878   m_sc0_tilemap->mark_tile_dirty(offset);
7979}
8080
8181WRITE8_MEMBER(d9final_state::sc0_hivram)
8282{
83   m_hi_vram.target()[offset] = data;
83   m_hi_vram[offset] = data;
8484   m_sc0_tilemap->mark_tile_dirty(offset);
8585}
8686
8787WRITE8_MEMBER(d9final_state::sc0_cram)
8888{
89   m_cram.target()[offset] = data;
89   m_cram[offset] = data;
9090   m_sc0_tilemap->mark_tile_dirty(offset);
9191}
9292
src/mame/drivers/ttchamp.c
r14899r14900
8787//  }
8888
8989   count=0;
90   UINT8 *videoram = reinterpret_cast<UINT8 *>(state->m_peno_vram.target());
9091   for (y=0;y<yyy;y++)
9192   {
9293      for(x=0;x<xxx;x++)
9394      {
94         /*if(hotblock_port0&0x40)*/bitmap.pix16(y, x) = ((UINT8 *)state->m_peno_vram.target())[BYTE_XOR_LE(count)]+0x300;
95         /*if(hotblock_port0&0x40)*/bitmap.pix16(y, x) = videoram[BYTE_XOR_LE(count)]+0x300;
9596            count++;
9697        }
9798    }
src/mame/drivers/acommand.c
r14899r14900
101101static TILE_GET_INFO( ac_get_bg_tile_info )
102102{
103103   acommand_state *state = machine.driver_data<acommand_state>();
104   int code = state->m_ac_bgvram.target()[tile_index];
104   int code = state->m_ac_bgvram[tile_index];
105105   SET_TILE_INFO(
106106         1,
107107         code & 0xfff,
r14899r14900
112112static TILE_GET_INFO( ac_get_tx_tile_info )
113113{
114114   acommand_state *state = machine.driver_data<acommand_state>();
115   int code = state->m_ac_txvram.target()[tile_index];
115   int code = state->m_ac_txvram[tile_index];
116116   SET_TILE_INFO(
117117         0,
118118         code & 0xfff,
r14899r14900
123123static void draw_sprites(running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect, int priority, int pri_mask)
124124{
125125   acommand_state *state = machine.driver_data<acommand_state>();
126   UINT16 *spriteram16 = state->m_spriteram.target();
126   UINT16 *spriteram16 = state->m_spriteram;
127127   int offs;
128128
129129   for (offs = 0;offs < state->m_spriteram.bytes()/2;offs += 8)
r14899r14900
269269
270270WRITE16_MEMBER(acommand_state::ac_bgvram_w)
271271{
272   COMBINE_DATA(&m_ac_bgvram.target()[offset]);
272   COMBINE_DATA(&m_ac_bgvram[offset]);
273273   m_bg_tilemap->mark_tile_dirty(offset);
274274}
275275
276276WRITE16_MEMBER(acommand_state::ac_txvram_w)
277277{
278   COMBINE_DATA(&m_ac_txvram.target()[offset]);
278   COMBINE_DATA(&m_ac_txvram[offset]);
279279   m_tx_tilemap->mark_tile_dirty(offset);
280280}
281281
r14899r14900
345345            */
346346        //22dc8
347347      {
348         m_ufo_sw1 = m_ac_devram.target()[offset] & 3;
349         if(m_ac_devram.target()[offset] & 0x10)
348         m_ufo_sw1 = m_ac_devram[offset] & 3;
349         if(m_ac_devram[offset] & 0x10)
350350            m_ufo_sw1|= 0x10;
351         if(m_ac_devram.target()[offset] & 0x40)
351         if(m_ac_devram[offset] & 0x40)
352352            m_ufo_sw1|= 0x20;
353         if(m_ac_devram.target()[offset] & 0x100)
353         if(m_ac_devram[offset] & 0x100)
354354            m_ufo_sw1|=0x100;
355         if(m_ac_devram.target()[offset] & 0x400)
355         if(m_ac_devram[offset] & 0x400)
356356            m_ufo_sw1|=0x200;
357         if(m_ac_devram.target()[offset] & 0x1000)
357         if(m_ac_devram[offset] & 0x1000)
358358            m_ufo_sw1|=0x1000;
359         if(m_ac_devram.target()[offset] & 0x4000)
359         if(m_ac_devram[offset] & 0x4000)
360360            m_ufo_sw1|=0x2000;
361//          if(m_ac_devram.target()[0x0048/2] & 0x0001)
361//          if(m_ac_devram[0x0048/2] & 0x0001)
362362//              m_ufo_sw1|=0x0040;
363//          if(m_ac_devram.target()[0x0048/2] & 0x0004)
363//          if(m_ac_devram[0x0048/2] & 0x0004)
364364//              m_ufo_sw1|=0x0400;
365//          if(m_ac_devram.target()[0x0048/2] & 0x0100)
365//          if(m_ac_devram[0x0048/2] & 0x0100)
366366//              m_ufo_sw1|=0x4000;
367367         return m_ufo_sw1;
368368      }
r14899r14900
375375            */
376376      {
377377         m_ufo_sw2 = 0;
378         if(m_ac_devram.target()[offset] & 0x01)
378         if(m_ac_devram[offset] & 0x01)
379379            m_ufo_sw2|= 1;
380         if(m_ac_devram.target()[offset] & 0x04)
380         if(m_ac_devram[offset] & 0x04)
381381            m_ufo_sw2|= 2;
382         if(m_ac_devram.target()[offset] & 0x10)
382         if(m_ac_devram[offset] & 0x10)
383383            m_ufo_sw2|=0x10;
384         if(m_ac_devram.target()[offset] & 0x40)
384         if(m_ac_devram[offset] & 0x40)
385385            m_ufo_sw2|=0x20;
386386         return m_ufo_sw2;
387387      }
388388      case 0x0048/2:
389         return m_ac_devram.target()[offset];
389         return m_ac_devram[offset];
390390      case 0x005c/2:
391391         /*
392392                xxxx xxxx ---- ---- DIPSW4
r14899r14900
394394            */
395395         return input_port_read(machine(), "IN1");
396396   }
397   return m_ac_devram.target()[offset];
397   return m_ac_devram[offset];
398398}
399399
400400WRITE16_MEMBER(acommand_state::ac_devices_w)
401401{
402   COMBINE_DATA(&m_ac_devram.target()[offset]);
402   COMBINE_DATA(&m_ac_devram[offset]);
403403   switch(offset)
404404   {
405405      case 0x00/2:
r14899r14900
437437      case 0x48/2:
438438         break;
439439      case 0x50/2:
440         m_led0 = m_ac_devram.target()[offset];
440         m_led0 = m_ac_devram[offset];
441441         //popmessage("%04x",m_led0);
442442         break;
443443      case 0x54/2:
444         m_led1 = m_ac_devram.target()[offset];
444         m_led1 = m_ac_devram[offset];
445445         //popmessage("%04x",m_led0);
446446         break;
447447   }
src/mame/drivers/goldnpkr.c
r14899r14900
980980
981981WRITE8_MEMBER(goldnpkr_state::goldnpkr_videoram_w)
982982{
983   m_videoram.target()[offset] = data;
983   m_videoram[offset] = data;
984984   m_bg_tilemap->mark_tile_dirty(offset);
985985}
986986
987987WRITE8_MEMBER(goldnpkr_state::goldnpkr_colorram_w)
988988{
989   m_colorram.target()[offset] = data;
989   m_colorram[offset] = data;
990990   m_bg_tilemap->mark_tile_dirty(offset);
991991}
992992
r14899r14900
10011001    xx-- ----   unused.
10021002*/
10031003
1004   int attr = state->m_colorram.target()[tile_index];
1005   int code = ((attr & 1) << 8) | state->m_videoram.target()[tile_index];
1004   int attr = state->m_colorram[tile_index];
1005   int code = ((attr & 1) << 8) | state->m_videoram[tile_index];
10061006   int bank = (attr & 0x02) >> 1;   /* bit 1 switch the gfx banks */
10071007   int color = (attr & 0x3c) >> 2;   /* bits 2-3-4-5 for color */
10081008
r14899r14900
10201020    xx-- --xx   tiles bank.
10211021*/
10221022
1023   int attr = state->m_colorram.target()[tile_index];
1024   int code = ((attr & 1) << 8) | state->m_videoram.target()[tile_index];
1023   int attr = state->m_colorram[tile_index];
1024   int code = ((attr & 1) << 8) | state->m_videoram[tile_index];
10251025   int bank = (attr & 0x03) + ((attr & 0xc0) >> 4);   /* bits 0, 1, 6 & 7 switch the gfx banks */
10261026   int color = (attr & 0x3c) >> 2;   /* bits 2-3-4-5 for color */
10271027
src/mame/drivers/ppmast93.c
r14899r14900
159159
160160WRITE8_MEMBER(ppmast93_state::ppmast93_fgram_w)
161161{
162   m_fgram.target()[offset] = data;
162   m_fgram[offset] = data;
163163   m_fg_tilemap->mark_tile_dirty(offset/2);
164164}
165165
166166WRITE8_MEMBER(ppmast93_state::ppmast93_bgram_w)
167167{
168   m_bgram.target()[offset] = data;
168   m_bgram[offset] = data;
169169   m_bg_tilemap->mark_tile_dirty(offset/2);
170170}
171171
r14899r14900
184184static ADDRESS_MAP_START( ppmast93_cpu1_map, AS_PROGRAM, 8, ppmast93_state )
185185   AM_RANGE(0x0000, 0x7fff) AM_ROM AM_WRITENOP AM_REGION("maincpu", 0x10000)
186186   AM_RANGE(0x8000, 0xbfff) AM_ROMBANK("bank1")
187   AM_RANGE(0xd000, 0xd7ff) AM_RAM_WRITE(ppmast93_bgram_w) AM_SHARE("bgram") AM_SHARE("share1")
187   AM_RANGE(0xd000, 0xd7ff) AM_RAM_WRITE(ppmast93_bgram_w) AM_SHARE("bgram")
188188   AM_RANGE(0xd800, 0xdfff) AM_WRITENOP
189   AM_RANGE(0xf000, 0xf7ff) AM_RAM_WRITE(ppmast93_fgram_w) AM_SHARE("fgram") AM_SHARE("share2")
189   AM_RANGE(0xf000, 0xf7ff) AM_RAM_WRITE(ppmast93_fgram_w) AM_SHARE("fgram")
190190   AM_RANGE(0xf800, 0xffff) AM_RAM
191191ADDRESS_MAP_END
192192
r14899r14900
325325static TILE_GET_INFO( get_ppmast93_bg_tile_info )
326326{
327327   ppmast93_state *state = machine.driver_data<ppmast93_state>();
328   int code = (state->m_bgram.target()[tile_index*2+1] << 8) | state->m_bgram.target()[tile_index*2];
328   int code = (state->m_bgram[tile_index*2+1] << 8) | state->m_bgram[tile_index*2];
329329   SET_TILE_INFO(
330330         0,
331331         code & 0x0fff,
r14899r14900
336336static TILE_GET_INFO( get_ppmast93_fg_tile_info )
337337{
338338   ppmast93_state *state = machine.driver_data<ppmast93_state>();
339   int code = (state->m_fgram.target()[tile_index*2+1] << 8) | state->m_fgram.target()[tile_index*2];
339   int code = (state->m_fgram[tile_index*2+1] << 8) | state->m_fgram[tile_index*2];
340340   SET_TILE_INFO(
341341         0,
342342         (code & 0x0fff)+0x1000,
src/mame/drivers/xxmissio.c
r14899r14900
101101   AM_RANGE(0xc800, 0xcfff) AM_SHARE("share2") AM_READWRITE(xxmissio_bgram_r, xxmissio_bgram_w) AM_BASE(m_bgram)
102102   AM_RANGE(0xd000, 0xd7ff) AM_SHARE("share3") AM_RAM AM_BASE(m_spriteram)
103103
104   AM_RANGE(0xd800, 0xdaff) AM_SHARE("share4") AM_RAM_WRITE(xxmissio_paletteram_w) AM_SHARE("paletteram")
104   AM_RANGE(0xd800, 0xdaff) AM_SHARE("paletteram") AM_RAM_WRITE(xxmissio_paletteram_w)
105105
106106   AM_RANGE(0xe000, 0xefff) AM_SHARE("share5") AM_RAM
107107   AM_RANGE(0xf000, 0xffff) AM_SHARE("share6") AM_RAM
r14899r14900
126126   AM_RANGE(0xc800, 0xcfff) AM_SHARE("share2") AM_READWRITE(xxmissio_bgram_r, xxmissio_bgram_w)
127127   AM_RANGE(0xd000, 0xd7ff) AM_SHARE("share3") AM_RAM
128128
129   AM_RANGE(0xd800, 0xdaff) AM_SHARE("share4") AM_RAM_WRITE(xxmissio_paletteram_w)
129   AM_RANGE(0xd800, 0xdaff) AM_SHARE("paletteram") AM_RAM_WRITE(xxmissio_paletteram_w)
130130
131131   AM_RANGE(0xe000, 0xefff) AM_SHARE("share6") AM_RAM
132132   AM_RANGE(0xf000, 0xffff) AM_SHARE("share5") AM_RAM
src/mame/drivers/segald.c
r14899r14900
3030   segald_state(const machine_config &mconfig, device_type type, const char *tag)
3131      : driver_device(mconfig, type, tag),
3232        m_laserdisc(*this, "laserdisc") ,
33      m_obj_RAM(*this, "obj_RAM"),
34      m_out_RAM(*this, "out_RAM"),
35      m_color_RAM(*this, "color_RAM"),
36      m_fix_RAM(*this, "fix_RAM"){ }
33      m_obj_ram(*this, "obj_ram"),
34      m_out_ram(*this, "out_ram"),
35      m_color_ram(*this, "color_ram"),
36      m_fix_ram(*this, "fix_ram"){ }
3737
3838   UINT8 m_nmi_enable;
3939
4040   required_device<pioneer_ldv1000_device> m_laserdisc;
41   required_shared_ptr<UINT8> m_obj_RAM;
42   required_shared_ptr<UINT8> m_out_RAM;
43   required_shared_ptr<UINT8> m_color_RAM;
44   required_shared_ptr<UINT8> m_fix_RAM;
41   required_shared_ptr<UINT8> m_obj_ram;
42   required_shared_ptr<UINT8> m_out_ram;
43   required_shared_ptr<UINT8> m_color_ram;
44   required_shared_ptr<UINT8> m_fix_ram;
4545
4646   UINT8 m_ldv1000_input_latch;
4747   UINT8 m_ldv1000_output_latch;
r14899r14900
6969      for (characterY = 0; characterY < 32; characterY++)
7070      {
7171         int current_screen_character = (characterY*32) + characterX;
72         drawgfx_transpen(bitmap, cliprect, machine.gfx[0], state->m_fix_RAM.target()[current_screen_character],
72         drawgfx_transpen(bitmap, cliprect, machine.gfx[0], state->m_fix_ram[current_screen_character],
7373               1, 0, 0, characterX*8, characterY*8, 0);
7474      }
7575   }
r14899r14900
9595   for (spr_number = 0; spr_number < 32; spr_number++)
9696   {
9797      spr_base = 0x10 * spr_number;
98      sy = state->m_obj_RAM.target()[spr_base + SPR_Y_TOP];
99      sx = state->m_obj_RAM.target()[spr_base + SPR_X_LO];
98      sy = state->m_obj_ram[spr_base + SPR_Y_TOP];
99      sx = state->m_obj_ram[spr_base + SPR_X_LO];
100100
101101      if (sx != 0 || sy != 0)
102102         logerror("Hey!  A sprite's not at 0,0 : %d %d", sx, sy);
r14899r14900
132132READ8_MEMBER(segald_state::astron_OUT_read)
133133{
134134
135   logerror("OUT read   (0x%04x) @ 0x%04x [0x%x]\n", m_out_RAM.target()[offset], offset, cpu_get_pc(&space.device()));
136   return m_out_RAM.target()[offset];
135   logerror("OUT read   (0x%04x) @ 0x%04x [0x%x]\n", m_out_ram[offset], offset, cpu_get_pc(&space.device()));
136   return m_out_ram[offset];
137137}
138138
139139READ8_MEMBER(segald_state::astron_OBJ_read)
140140{
141141
142   logerror("OBJ read   (0x%04x) @ 0x%04x [0x%x]\n", m_obj_RAM.target()[offset], offset, cpu_get_pc(&space.device()));
143   return m_obj_RAM.target()[offset];
142   logerror("OBJ read   (0x%04x) @ 0x%04x [0x%x]\n", m_obj_ram[offset], offset, cpu_get_pc(&space.device()));
143   return m_obj_ram[offset];
144144}
145145
146146READ8_MEMBER(segald_state::astron_COLOR_read)
147147{
148148
149   logerror("COLOR read   (0x%04x) @ 0x%04x [0x%x]\n", m_color_RAM.target()[offset], offset, cpu_get_pc(&space.device()));
150   return m_color_RAM.target()[offset];
149   logerror("COLOR read   (0x%04x) @ 0x%04x [0x%x]\n", m_color_ram[offset], offset, cpu_get_pc(&space.device()));
150   return m_color_ram[offset];
151151}
152152
153153
r14899r14900
197197         break;
198198   }
199199
200   m_out_RAM.target()[offset] = data;
200   m_out_ram[offset] = data;
201201}
202202
203203WRITE8_MEMBER(segald_state::astron_OBJ_write)
204204{
205205
206   m_obj_RAM.target()[offset] = data;
206   m_obj_ram[offset] = data;
207207   logerror("OBJ write : 0x%04x @ 0x%04x [0x%x]\n", data, offset, cpu_get_pc(&space.device()));
208208}
209209
r14899r14900
214214   const UINT8 palIndex = offset >> 1;
215215
216216   /* Combine */
217   m_color_RAM.target()[offset] = data;
217   m_color_ram[offset] = data;
218218
219219   /* Easy access */
220   highBits = m_color_RAM.target()[(palIndex<<1)+1] & 0x0f;
221   lowBits  = m_color_RAM.target()[(palIndex<<1)];
220   highBits = m_color_ram[(palIndex<<1)+1] & 0x0f;
221   lowBits  = m_color_ram[(palIndex<<1)];
222222
223223   /* 4-bit RGB */
224224   r = (lowBits  & 0x0f);
r14899r14900
233233WRITE8_MEMBER(segald_state::astron_FIX_write)
234234{
235235
236   m_fix_RAM.target()[offset] = data;
236   m_fix_ram[offset] = data;
237237   /* logerror("FIX write : 0x%04x @ 0x%04x [0x%x]\n", data, offset, cpu_get_pc(&space.device())); */
238238}
239239
r14899r14900
251251   AM_RANGE(0x0000, 0x7fff) AM_ROM
252252   AM_RANGE(0x8000, 0xbfff) AM_ROMBANK("bank1")
253253
254   AM_RANGE(0xc000, 0xc7ff) AM_READWRITE(astron_OBJ_read, astron_OBJ_write) AM_SHARE("obj_RAM")   /* OBJ according to the schematics (sprite) */
254   AM_RANGE(0xc000, 0xc7ff) AM_READWRITE(astron_OBJ_read, astron_OBJ_write) AM_SHARE("obj_ram")   /* OBJ according to the schematics (sprite) */
255255   AM_RANGE(0xc800, 0xcfff) AM_READWRITE(astron_DISC_read, astron_DISC_write)               /* DISC interface according to schematics */
256256   AM_RANGE(0xd000, 0xd000) AM_READ_PORT("DSWA")                        /* SW bank 2 (DIPs) */
257257   AM_RANGE(0xd001, 0xd001) AM_READ_PORT("DSWB")                        /* SW bank 3 (DIPs) */
258258   AM_RANGE(0xd002, 0xd002) AM_READ_PORT("IN0")                        /* SW bank 0 (IO) */
259259   AM_RANGE(0xd003, 0xd003) AM_READ_PORT("IN1")                        /* SW bank 1 (IO) */
260   AM_RANGE(0xd800, 0xd803) AM_READWRITE(astron_OUT_read, astron_OUT_write) AM_SHARE("out_RAM")   /* OUT according to schematics (output port) */
261   AM_RANGE(0xe000, 0xe1ff) AM_READWRITE(astron_COLOR_read, astron_COLOR_write) AM_SHARE("color_RAM") /* COLOR according to the schematics */
262   AM_RANGE(0xf000, 0xf7ff) AM_WRITE(astron_FIX_write) AM_SHARE("fix_RAM")                  /* FIX according to schematics (characters) */
260   AM_RANGE(0xd800, 0xd803) AM_READWRITE(astron_OUT_read, astron_OUT_write) AM_SHARE("out_ram")   /* OUT according to schematics (output port) */
261   AM_RANGE(0xe000, 0xe1ff) AM_READWRITE(astron_COLOR_read, astron_COLOR_write) AM_SHARE("color_ram") /* COLOR according to the schematics */
262   AM_RANGE(0xf000, 0xf7ff) AM_WRITE(astron_FIX_write) AM_SHARE("fix_ram")                  /* FIX according to schematics (characters) */
263263   AM_RANGE(0xf800, 0xffff) AM_RAM                                                /* RAM according to schematics */
264264ADDRESS_MAP_END
265265
src/mame/drivers/tickee.c
r14899r14900
113113   state->m_setup_gun_timer->adjust(machine.primary_screen->time_until_pos(0));
114114
115115   /* only do work if the palette is flashed */
116   if (state->m_control.target())
117      if (!state->m_control.target()[2])
116   if (state->m_control)
117      if (!state->m_control[2])
118118         return;
119119
120120   /* generate interrupts for player 1's gun */
r14899r14900
155155static void scanline_update(screen_device &screen, bitmap_rgb32 &bitmap, int scanline, const tms34010_display_params *params)
156156{
157157   tickee_state *state = screen.machine().driver_data<tickee_state>();
158   UINT16 *src = &state->m_vram.target()[(params->rowaddr << 8) & 0x3ff00];
158   UINT16 *src = &state->m_vram[(params->rowaddr << 8) & 0x3ff00];
159159   UINT32 *dest = &bitmap.pix32(scanline);
160160   const rgb_t *pens = tlc34076_get_pens(screen.machine().device("tlc34076"));
161161   int coladdr = params->coladdr << 1;
162162   int x;
163163
164164   /* blank palette: fill with pen 255 */
165   if (state->m_control.target()[2])
165   if (state->m_control[2])
166166   {
167167      for (x = params->heblnk; x < params->hsblnk; x++)
168168         dest[x] = pens[0xff];
r14899r14900
181181static void rapidfir_scanline_update(screen_device &screen, bitmap_rgb32 &bitmap, int scanline, const tms34010_display_params *params)
182182{
183183   tickee_state *state = screen.machine().driver_data<tickee_state>();
184   UINT16 *src = &state->m_vram.target()[(params->rowaddr << 8) & 0x3ff00];
184   UINT16 *src = &state->m_vram[(params->rowaddr << 8) & 0x3ff00];
185185   UINT32 *dest = &bitmap.pix32(scanline);
186186   const rgb_t *pens = tlc34076_get_pens(screen.machine().device("tlc34076"));
187187   int coladdr = params->coladdr << 1;
r14899r14900
240240{
241241   if (!(data & 0xff00)) mem_mask &= 0x00ff;
242242   if (!(data & 0x00ff)) mem_mask &= 0xff00;
243   COMBINE_DATA(&m_vram.target()[offset]);
243   COMBINE_DATA(&m_vram[offset]);
244244}
245245
246246
247247READ16_MEMBER(tickee_state::rapidfir_transparent_r)
248248{
249   return m_vram.target()[offset];
249   return m_vram[offset];
250250}
251251
252252
r14899r14900
254254{
255255   tickee_state *state = space->machine().driver_data<tickee_state>();
256256   if (address < 0x800000)
257      memcpy(shiftreg, &state->m_vram.target()[TOWORD(address)], TOBYTE(0x2000));
257      memcpy(shiftreg, &state->m_vram[TOWORD(address)], TOBYTE(0x2000));
258258}
259259
260260
r14899r14900
262262{
263263   tickee_state *state = space->machine().driver_data<tickee_state>();
264264   if (address < 0x800000)
265      memcpy(&state->m_vram.target()[TOWORD(address)], shiftreg, TOBYTE(0x2000));
265      memcpy(&state->m_vram[TOWORD(address)], shiftreg, TOBYTE(0x2000));
266266}
267267
268268
r14899r14900
275275
276276WRITE16_MEMBER(tickee_state::tickee_control_w)
277277{
278   UINT16 olddata = m_control.target()[offset];
278   UINT16 olddata = m_control[offset];
279279
280280   /* offsets:
281281
r14899r14900
284284        6 = lamps? (changing all the time)
285285    */
286286
287   COMBINE_DATA(&m_control.target()[offset]);
287   COMBINE_DATA(&m_control[offset]);
288288
289289   if (offset == 3)
290290   {
r14899r14900
292292      machine().device<ticket_dispenser_device>("ticket2")->write(space, 0, (data & 4) << 5);
293293   }
294294
295   if (olddata != m_control.target()[offset])
296      logerror("%08X:tickee_control_w(%d) = %04X (was %04X)\n", cpu_get_pc(&space.device()), offset, m_control.target()[offset], olddata);
295   if (olddata != m_control[offset])
296      logerror("%08X:tickee_control_w(%d) = %04X (was %04X)\n", cpu_get_pc(&space.device()), offset, m_control[offset], olddata);
297297}
298298
299299
src/mame/drivers/destroyr.c
r14899r14900
6161   /* draw major objects */
6262   for (i = 0; i < 16; i++)
6363   {
64      int attr = state->m_major_obj_ram.target()[2 * i + 0] ^ 0xff;
65      int horz = state->m_major_obj_ram.target()[2 * i + 1];
64      int attr = state->m_major_obj_ram[2 * i + 0] ^ 0xff;
65      int horz = state->m_major_obj_ram[2 * i + 1];
6666
6767      int num = attr & 3;
6868      int scan = attr & 4;
r14899r14900
8787   {
8888      for (j = 0; j < 32; j++)
8989      {
90         int num = state->m_alpha_num_ram.target()[32 * i + j];
90         int num = state->m_alpha_num_ram[32 * i + j];
9191
9292         drawgfx_transpen(bitmap, cliprect, screen.machine().gfx[0], num, 0, 0, 0, 8 * j, 8 * i, 0);
9393      }
r14899r14900
9696   /* draw minor objects */
9797   for (i = 0; i < 2; i++)
9898   {
99      int num = i << 4 | (state->m_minor_obj_ram.target()[i + 0] & 0xf);
100      int horz = 256 - state->m_minor_obj_ram.target()[i + 2];
101      int vert = 256 - state->m_minor_obj_ram.target()[i + 4];
99      int num = i << 4 | (state->m_minor_obj_ram[i + 0] & 0xf);
100      int horz = 256 - state->m_minor_obj_ram[i + 2];
101      int vert = 256 - state->m_minor_obj_ram[i + 4];
102102
103103      drawgfx_transpen(bitmap, cliprect, screen.machine().gfx[1], num, 0, 0, 0, horz, vert, 0);
104104   }
src/mame/drivers/feversoc.c
r14899r14900
8989static SCREEN_UPDATE_IND16( feversoc )
9090{
9191   feversoc_state *state = screen.machine().driver_data<feversoc_state>();
92   UINT32 *spriteram32 = state->m_spriteram.target();
92   UINT32 *spriteram32 = state->m_spriteram;
9393   int offs,spr_offs,colour,sx,sy,h,w,dx,dy;
9494
9595   bitmap.fill(screen.machine().pens[0], cliprect); //black pen
src/mame/drivers/vcombat.c
r14899r14900
9595public:
9696   vcombat_state(const machine_config &mconfig, device_type type, const char *tag)
9797      : driver_device(mconfig, type, tag) ,
98      m_vid_0_shared_RAM(*this, "vid_0_shared_RAM"),
99      m_vid_1_shared_RAM(*this, "vid_1_shared_RAM"),
100      m_framebuffer_ctrl(*this, "framebuffer_ctrl"){ }
98      m_vid_0_shared_ram(*this, "vid_0_ram"),
99      m_vid_1_shared_ram(*this, "vid_1_ram"),
100      m_framebuffer_ctrl(*this, "fb_control"){ }
101101
102102   UINT16* m_m68k_framebuffer[2];
103103   UINT16* m_i860_framebuffer[2][2];
104   required_shared_ptr<UINT16> m_vid_0_shared_RAM;
105   required_shared_ptr<UINT16> m_vid_1_shared_RAM;
104   required_shared_ptr<UINT16> m_vid_0_shared_ram;
105   required_shared_ptr<UINT16> m_vid_1_shared_ram;
106106   required_shared_ptr<UINT16> m_framebuffer_ctrl;
107107   int m_crtc_select;
108108   DECLARE_WRITE16_MEMBER(main_video_write);
r14899r14900
332332   AM_RANGE(0x200000, 0x20ffff) AM_RAM
333333   AM_RANGE(0x300000, 0x30ffff) AM_WRITE(main_video_write)
334334
335   AM_RANGE(0x400000, 0x43ffff) AM_RAM AM_SHARE("vid_0_shared_RAM") AM_SHARE("share2")   /* First i860 shared RAM */
335   AM_RANGE(0x400000, 0x43ffff) AM_RAM AM_SHARE("vid_0_ram")   /* First i860 shared RAM */
336336   AM_RANGE(0x440000, 0x440003) AM_RAM AM_SHARE("share6")      /* M0->P0 i860 #1 com 1 */
337337   AM_RANGE(0x480000, 0x480003) AM_RAM AM_SHARE("share7")      /* M0<-P0 i860 #1 com 2 */
338338   AM_RANGE(0x4c0000, 0x4c0003) AM_WRITE(wiggle_i860p0_pins_w)   /* i860 #1 stop/start/reset */
339339
340   AM_RANGE(0x500000, 0x53ffff) AM_RAM AM_SHARE("vid_1_shared_RAM") AM_SHARE("share3")   /* Second i860 shared RAM */
340   AM_RANGE(0x500000, 0x53ffff) AM_RAM AM_SHARE("vid_1_ram")   /* Second i860 shared RAM */
341341   AM_RANGE(0x540000, 0x540003) AM_RAM AM_SHARE("share8")      /* M0->P1 i860 #2 com 1 */
342342   AM_RANGE(0x580000, 0x580003) AM_RAM AM_SHARE("share9")      /* M0<-P1 i860 #2 com 2 */
343343   AM_RANGE(0x5c0000, 0x5c0003) AM_WRITE(wiggle_i860p1_pins_w)   /* i860 #2 stop/start/reset */
r14899r14900
348348   AM_RANGE(0x60001c, 0x60001d) AM_NOP
349349
350350   AM_RANGE(0x60000c, 0x60000d) AM_WRITE(crtc_w)
351   AM_RANGE(0x600010, 0x600011) AM_RAM AM_SHARE("framebuffer_ctrl")
351   AM_RANGE(0x600010, 0x600011) AM_RAM AM_SHARE("fb_control")
352352   AM_RANGE(0x700000, 0x7007ff) AM_RAM AM_SHARE("nvram")
353353   AM_RANGE(0x701000, 0x701001) AM_READ(main_irqiack_r)
354354   AM_RANGE(0x702000, 0x702001) AM_READ(control_3_r)
r14899r14900
368368   AM_RANGE(0x40000000, 0x401fffff) AM_ROM AM_REGION("gfx", 0)
369369   AM_RANGE(0x80000000, 0x80000007) AM_RAM AM_SHARE("share7")      /* M0->P0 com 2 (0x480000 in 68k-land) */
370370   AM_RANGE(0xc0000000, 0xc0000fff) AM_NOP                 /* Dummy D$ flush page. */
371   AM_RANGE(0xfffc0000, 0xffffffff) AM_RAM AM_SHARE("share2")         /* Shared RAM with main */
371   AM_RANGE(0xfffc0000, 0xffffffff) AM_RAM AM_SHARE("vid_0_ram")         /* Shared RAM with main */
372372ADDRESS_MAP_END
373373
374374
r14899r14900
379379   AM_RANGE(0x40000000, 0x401fffff) AM_ROM AM_REGION("gfx", 0)
380380   AM_RANGE(0x80000000, 0x80000007) AM_RAM AM_SHARE("share9")         /* M0<-P1 com 2      (0x580000 in 68k-land) */
381381   AM_RANGE(0xc0000000, 0xc0000fff) AM_NOP                 /* Dummy D$ flush page. */
382   AM_RANGE(0xfffc0000, 0xffffffff) AM_RAM AM_SHARE("share3")         /* Shared RAM with main */
382   AM_RANGE(0xfffc0000, 0xffffffff) AM_RAM AM_SHARE("vid_1_ram")         /* Shared RAM with main */
383383ADDRESS_MAP_END
384384
385385
r14899r14900
418418   vcombat_state *state = machine.driver_data<vcombat_state>();
419419   if (address >= 0xfffc0000 && address <= 0xffffffff)
420420   {
421      direct.explicit_configure(0xfffc0000, 0xffffffff, 0x3ffff, state->m_vid_0_shared_RAM.target());
421      direct.explicit_configure(0xfffc0000, 0xffffffff, 0x3ffff, state->m_vid_0_shared_ram);
422422      return ~0;
423423   }
424424   return address;
r14899r14900
429429   vcombat_state *state = machine.driver_data<vcombat_state>();
430430   if (address >= 0xfffc0000 && address <= 0xffffffff)
431431   {
432      direct.explicit_configure(0xfffc0000, 0xffffffff, 0x3ffff, state->m_vid_1_shared_RAM.target());
432      direct.explicit_configure(0xfffc0000, 0xffffffff, 0x3ffff, state->m_vid_1_shared_ram);
433433      return ~0;
434434   }
435435   return address;
src/mame/drivers/pkscram.c
r14899r14900
2222public:
2323   pkscram_state(const machine_config &mconfig, device_type type, const char *tag)
2424      : driver_device(mconfig, type, tag) ,
25      m_pkscramble_fgtilemap_ram(*this, "pkscramble_fgtilemap_ram"),
26      m_pkscramble_mdtilemap_ram(*this, "pkscramble_mdtilemap_ram"),
27      m_pkscramble_bgtilemap_ram(*this, "pkscramble_bgtilemap_ram"){ }
25      m_pkscramble_fgtilemap_ram(*this, "fgtilemap_ram"),
26      m_pkscramble_mdtilemap_ram(*this, "mdtilemap_ram"),
27      m_pkscramble_bgtilemap_ram(*this, "bgtilemap_ram"){ }
2828
2929   UINT16 m_out;
3030   UINT8 m_interrupt_line_active;
r14899r14900
4646
4747WRITE16_MEMBER(pkscram_state::pkscramble_fgtilemap_w)
4848{
49   COMBINE_DATA(&m_pkscramble_fgtilemap_ram.target()[offset]);
49   COMBINE_DATA(&m_pkscramble_fgtilemap_ram[offset]);
5050   m_fg_tilemap->mark_tile_dirty(offset >> 1);
5151}
5252
5353WRITE16_MEMBER(pkscram_state::pkscramble_mdtilemap_w)
5454{
55   COMBINE_DATA(&m_pkscramble_mdtilemap_ram.target()[offset]);
55   COMBINE_DATA(&m_pkscramble_mdtilemap_ram[offset]);
5656   m_md_tilemap->mark_tile_dirty(offset >> 1);
5757}
5858
5959WRITE16_MEMBER(pkscram_state::pkscramble_bgtilemap_w)
6060{
61   COMBINE_DATA(&m_pkscramble_bgtilemap_ram.target()[offset]);
61   COMBINE_DATA(&m_pkscramble_bgtilemap_ram[offset]);
6262   m_bg_tilemap->mark_tile_dirty(offset >> 1);
6363}
6464
r14899r14900
102102   AM_RANGE(0x000000, 0x01ffff) AM_ROM
103103   AM_RANGE(0x040000, 0x0400ff) AM_RAM AM_SHARE("nvram")
104104   AM_RANGE(0x041000, 0x043fff) AM_RAM // main ram
105   AM_RANGE(0x044000, 0x044fff) AM_RAM_WRITE(pkscramble_fgtilemap_w) AM_SHARE("pkscramble_fgtilemap_ram") // fg tilemap
106   AM_RANGE(0x045000, 0x045fff) AM_RAM_WRITE(pkscramble_mdtilemap_w) AM_SHARE("pkscramble_mdtilemap_ram") // md tilemap (just a copy of fg?)
107   AM_RANGE(0x046000, 0x046fff) AM_RAM_WRITE(pkscramble_bgtilemap_w) AM_SHARE("pkscramble_bgtilemap_ram") // bg tilemap
105   AM_RANGE(0x044000, 0x044fff) AM_RAM_WRITE(pkscramble_fgtilemap_w) AM_SHARE("fgtilemap_ram") // fg tilemap
106   AM_RANGE(0x045000, 0x045fff) AM_RAM_WRITE(pkscramble_mdtilemap_w) AM_SHARE("mdtilemap_ram") // md tilemap (just a copy of fg?)
107   AM_RANGE(0x046000, 0x046fff) AM_RAM_WRITE(pkscramble_bgtilemap_w) AM_SHARE("bgtilemap_ram") // bg tilemap
108108   AM_RANGE(0x047000, 0x047fff) AM_RAM // unused
109109   AM_RANGE(0x048000, 0x048fff) AM_RAM_WRITE(paletteram_xRRRRRGGGGGBBBBB_word_w) AM_SHARE("paletteram")
110110   AM_RANGE(0x049000, 0x049001) AM_READ_PORT("DSW")
r14899r14900
187187static TILE_GET_INFO( get_bg_tile_info )
188188{
189189   pkscram_state *state = machine.driver_data<pkscram_state>();
190   int tile  = state->m_pkscramble_bgtilemap_ram.target()[tile_index*2];
191   int color = state->m_pkscramble_bgtilemap_ram.target()[tile_index*2 + 1] & 0x7f;
190   int tile  = state->m_pkscramble_bgtilemap_ram[tile_index*2];
191   int color = state->m_pkscramble_bgtilemap_ram[tile_index*2 + 1] & 0x7f;
192192
193193   SET_TILE_INFO(0,tile,color,0);
194194}
r14899r14900
196196static TILE_GET_INFO( get_md_tile_info )
197197{
198198   pkscram_state *state = machine.driver_data<pkscram_state>();
199   int tile  = state->m_pkscramble_mdtilemap_ram.target()[tile_index*2];
200   int color = state->m_pkscramble_mdtilemap_ram.target()[tile_index*2 + 1] & 0x7f;
199   int tile  = state->m_pkscramble_mdtilemap_ram[tile_index*2];
200   int color = state->m_pkscramble_mdtilemap_ram[tile_index*2 + 1] & 0x7f;
201201
202202   SET_TILE_INFO(0,tile,color,0);
203203}
r14899r14900
205205static TILE_GET_INFO( get_fg_tile_info )
206206{
207207   pkscram_state *state = machine.driver_data<pkscram_state>();
208   int tile  = state->m_pkscramble_fgtilemap_ram.target()[tile_index*2];
209   int color = state->m_pkscramble_fgtilemap_ram.target()[tile_index*2 + 1] & 0x7f;
208   int tile  = state->m_pkscramble_fgtilemap_ram[tile_index*2];
209   int color = state->m_pkscramble_fgtilemap_ram[tile_index*2 + 1] & 0x7f;
210210
211211   SET_TILE_INFO(0,tile,color,0);
212212}
src/mame/drivers/fortecar.c
r14899r14900
354354      {
355355         int tile,color,bpp;
356356
357         tile = (state->m_vram.target()[(count*4)+1] | (state->m_vram.target()[(count*4)+2]<<8)) & 0xfff;
358         color = state->m_vram.target()[(count*4)+3] & 0x1f;
359         bpp = (state->m_vram.target()[(count*4)+3] & 0x20) >> 5;
357         tile = (state->m_vram[(count*4)+1] | (state->m_vram[(count*4)+2]<<8)) & 0xfff;
358         color = state->m_vram[(count*4)+3] & 0x1f;
359         bpp = (state->m_vram[(count*4)+3] & 0x20) >> 5;
360360
361361         if(bpp)
362362            color&=0x3;
r14899r14900
673673
674674   /* apparently there's a random fill in there (checked thru trojan TODO: extract proper algorythm) */
675675   for(i=0;i<state->m_vram.bytes();i++)
676      state->m_vram.target()[i] = machine.rand();
676      state->m_vram[i] = machine.rand();
677677}
678678
679679
src/mame/drivers/superwng.c
r14899r14900
7272static TILE_GET_INFO( get_bg_tile_info )
7373{
7474   superwng_state *state = machine.driver_data<superwng_state>();
75   int code = state->m_videoram_bg.target()[tile_index];
76   int attr = state->m_colorram_bg.target()[tile_index];
75   int code = state->m_videoram_bg[tile_index];
76   int attr = state->m_colorram_bg[tile_index];
7777
7878   code= (code&0x7f) | ((attr&0x40)<<1) | ((code&0x80)<<1);
7979   code|=state->m_tile_bank?0x200:0;
r14899r14900
8787static TILE_GET_INFO( get_fg_tile_info )
8888{
8989   superwng_state *state = machine.driver_data<superwng_state>();
90   int code = state->m_videoram_fg.target()[tile_index];
91   int attr = state->m_colorram_fg.target()[tile_index];
90   int code = state->m_videoram_fg[tile_index];
91   int attr = state->m_colorram_fg[tile_index];
9292
9393   code= (code&0x7f) | ((attr&0x40)<<1) | ((code&0x80)<<1);
9494
r14899r14900
143143
144144      for(int i=0x3e; i>=0; i-=2)
145145      {
146         int code=(state->m_videoram_bg.target()[i]>>2)+0x40;
147         int sx=256-state->m_videoram_bg.target()[i+1]-8;
148         int sy = state->m_colorram_bg.target()[i]+8;
149         int attr = state->m_colorram_bg.target()[i+1];
146         int code=(state->m_videoram_bg[i]>>2)+0x40;
147         int sx=256-state->m_videoram_bg[i+1]-8;
148         int sy = state->m_colorram_bg[i]+8;
149         int attr = state->m_colorram_bg[i+1];
150150
151151         if (flip)
152152         {
r14899r14900
154154            sx-=8;
155155         }
156156
157         if(state->m_videoram_bg.target()[i+1] | state->m_colorram_bg.target()[i])
157         if(state->m_videoram_bg[i+1] | state->m_colorram_bg[i])
158158         {
159159
160160            drawgfx_transpen(bitmap, cliprect,screen.machine().gfx[1],
r14899r14900
246246
247247WRITE8_MEMBER(superwng_state::superwng_bg_vram_w)
248248{
249   m_videoram_bg.target()[offset] = data;
249   m_videoram_bg[offset] = data;
250250   m_bg_tilemap->mark_tile_dirty(offset);
251251}
252252
253253WRITE8_MEMBER(superwng_state::superwng_bg_cram_w)
254254{
255   m_colorram_bg.target()[offset] = data;
255   m_colorram_bg[offset] = data;
256256   m_bg_tilemap->mark_tile_dirty(offset);
257257}
258258
259259WRITE8_MEMBER(superwng_state::superwng_fg_vram_w)
260260{
261   m_videoram_fg.target()[offset] = data;
261   m_videoram_fg[offset] = data;
262262   m_fg_tilemap->mark_tile_dirty(offset);
263263}
264264
265265WRITE8_MEMBER(superwng_state::superwng_fg_cram_w)
266266{
267   m_colorram_fg.target()[offset] = data;
267   m_colorram_fg[offset] = data;
268268   m_fg_tilemap->mark_tile_dirty(offset);
269269}
270270
src/mame/drivers/cyclemb.c
r14899r14900
143143   {
144144      for (x=0;x<64;x++)
145145      {
146         int attr = state->m_cram.target()[count];
147         int tile = (state->m_vram.target()[count]) | ((attr & 3)<<8);
146         int attr = state->m_cram[count];
147         int tile = (state->m_vram[count]) | ((attr & 3)<<8);
148148         int color = ((attr & 0xf8) >> 3) ^ 0x1f;
149149         int odd_line = y & 1 ? 0x40 : 0x00;
150150//          int sx_offs = flip_screen ? 512 : 0
151         int scrollx = ((state->m_vram.target()[(y/2)+odd_line]) + (state->m_cram.target()[(y/2)+odd_line]<<8) + 48) & 0x1ff;
151         int scrollx = ((state->m_vram[(y/2)+odd_line]) + (state->m_cram[(y/2)+odd_line]<<8) + 48) & 0x1ff;
152152
153153         if(flip_screen)
154154         {
r14899r14900
193193
194194      for(i=0;i<0x40;i+=2)
195195      {
196         y = 0xf1 - state->m_obj2_ram.target()[i];
197         x = state->m_obj2_ram.target()[i+1] - 56;
198         spr_offs = (state->m_obj1_ram.target()[i+0]);
199         col = (state->m_obj1_ram.target()[i+1] & 0x3f);
200         region = ((state->m_obj3_ram.target()[i] & 0x10) >> 4) + 1;
196         y = 0xf1 - state->m_obj2_ram[i];
197         x = state->m_obj2_ram[i+1] - 56;
198         spr_offs = (state->m_obj1_ram[i+0]);
199         col = (state->m_obj1_ram[i+1] & 0x3f);
200         region = ((state->m_obj3_ram[i] & 0x10) >> 4) + 1;
201201         if(region == 2)
202202         {
203203            spr_offs >>= 2;
204            spr_offs += ((state->m_obj3_ram.target()[i+0] & 3) << 5);
204            spr_offs += ((state->m_obj3_ram[i+0] & 3) << 5);
205205            y-=16;
206206         }
207207
208         if(state->m_obj3_ram.target()[i+1] & 1)
208         if(state->m_obj3_ram[i+1] & 1)
209209            x+=256;
210         //if(state->m_obj3_ram.target()[i+1] & 2)
210         //if(state->m_obj3_ram[i+1] & 2)
211211//              x-=256;
212         fx = (state->m_obj3_ram.target()[i+0] & 4) >> 2;
213         fy = (state->m_obj3_ram.target()[i+0] & 8) >> 3;
212         fx = (state->m_obj3_ram[i+0] & 4) >> 2;
213         fy = (state->m_obj3_ram[i+0] & 8) >> 3;
214214
215215         if(flip_screen)
216216         {
src/mame/drivers/bingor.c
r14899r14900
475475      {
476476         UINT32 color;
477477
478         color = (state->m_blit_ram.target()[count] & 0xf000)>>12;
478         color = (state->m_blit_ram[count] & 0xf000)>>12;
479479
480480         if(cliprect.contains(x+3, y))
481481            bitmap.pix32(y, x+3) = screen.machine().pens[color];
482482
483         color = (state->m_blit_ram.target()[count] & 0x0f00)>>8;
483         color = (state->m_blit_ram[count] & 0x0f00)>>8;
484484
485485         if(cliprect.contains(x+2, y))
486486            bitmap.pix32(y, x+2) = screen.machine().pens[color];
487487
488         color = (state->m_blit_ram.target()[count] & 0x00f0)>>4;
488         color = (state->m_blit_ram[count] & 0x00f0)>>4;
489489
490490         if(cliprect.contains(x+1, y))
491491            bitmap.pix32(y, x+1) = screen.machine().pens[color];
492492
493         color = (state->m_blit_ram.target()[count] & 0x000f)>>0;
493         color = (state->m_blit_ram[count] & 0x000f)>>0;
494494
495495         if(cliprect.contains(x+0, y))
496496            bitmap.pix32(y, x+0) = screen.machine().pens[color];
src/mame/drivers/beaminv.c
r14899r14900
179179
180180      UINT8 y = offs;
181181      UINT8 x = offs >> 8 << 3;
182      UINT8 data = state->m_videoram.target()[offs];
182      UINT8 data = state->m_videoram[offs];
183183
184184      for (i = 0; i < 8; i++)
185185      {
src/mame/drivers/rbmk.c
r14899r14900
504504   {
505505      for (x=0;x<64;x++)
506506      {
507         int tile = state->m_gms_vidram2.target()[count+0x600];
507         int tile = state->m_gms_vidram2[count+0x600];
508508         drawgfx_opaque(bitmap,cliprect,screen.machine().gfx[0],(tile&0xfff)+((state->m_tilebank&0x10)>>4)*0x1000,tile>>12,0,0,x*8,y*32);
509509         count++;
510510      }
r14899r14900
516516   {
517517      for (x=0;x<64;x++)
518518      {
519         int tile = state->m_gms_vidram.target()[count];
519         int tile = state->m_gms_vidram[count];
520520         drawgfx_transpen(bitmap,cliprect,screen.machine().gfx[1],(tile&0xfff)+((state->m_tilebank>>1)&3)*0x1000,tile>>12,0,0,x*8,y*8,0);
521521         count++;
522522      }
src/mame/drivers/trvmadns.c
r14899r14900
160160
161161WRITE8_MEMBER(trvmadns_state::trvmadns_gfxram_w)
162162{
163   m_gfxram.target()[offset] = data;
163   m_gfxram[offset] = data;
164164   gfx_element_mark_dirty(machine().gfx[0], offset/16);
165165}
166166
r14899r14900
208208
209209   }
210210
211   m_tileram.target()[offset] = data;
211   m_tileram[offset] = data;
212212   m_bg_tilemap->mark_tile_dirty(offset >> 1);
213213}
214214
r14899r14900
264264   trvmadns_state *state = machine.driver_data<trvmadns_state>();
265265   int tile,attr,color,flag;
266266
267   attr = state->m_tileram.target()[tile_index*2 + 0];
268   tile = state->m_tileram.target()[tile_index*2 + 1] + ((attr & 0x01) << 8);
267   attr = state->m_tileram[tile_index*2 + 0];
268   tile = state->m_tileram[tile_index*2 + 1] + ((attr & 0x01) << 8);
269269   color = (attr & 0x18) >> 3;
270270   flag = TILE_FLIPXY((attr & 0x06) >> 1);
271271
r14899r14900
287287
288288//  fg_tilemap->set_transparent_pen(1);
289289
290   gfx_element_set_source(machine.gfx[0], state->m_gfxram.target());
290   gfx_element_set_source(machine.gfx[0], state->m_gfxram);
291291}
292292
293293static SCREEN_UPDATE_IND16( trvmadns )
r14899r14900
304304   {
305305      for (x=0;x<32;x++)
306306      {
307         int attr = state->m_tileram.target()[count*2+0];
308         int tile = state->m_tileram.target()[count*2+1] | ((attr & 0x01) << 8);
307         int attr = state->m_tileram[count*2+0];
308         int tile = state->m_tileram[count*2+1] | ((attr & 0x01) << 8);
309309         int color = (attr & 0x18) >> 3;
310310         int flipx = attr & 4;
311311         int flipy = attr & 2;
r14899r14900
322322   {
323323      for (x=0;x<32;x++)
324324      {
325         int attr = state->m_tileram.target()[count*2+0];
326         int tile = state->m_tileram.target()[count*2+1] | ((attr & 0x01) << 8);
325         int attr = state->m_tileram[count*2+0];
326         int tile = state->m_tileram[count*2+1] | ((attr & 0x01) << 8);
327327         int color = (attr & 0x18) >> 3;
328328         int flipx = attr & 4;
329329         int flipy = attr & 2;
src/mame/drivers/albazg.c
r14899r14900
7474static TILE_GET_INFO( y_get_bg_tile_info )
7575{
7676   albazg_state *state = machine.driver_data<albazg_state>();
77   int code = state->m_videoram.target()[tile_index];
78   int color = state->m_colorram.target()[tile_index];
77   int code = state->m_videoram[tile_index];
78   int color = state->m_colorram[tile_index];
7979
8080   SET_TILE_INFO(
8181         0,
r14899r14900
118118
119119WRITE8_MEMBER(albazg_state::yumefuda_vram_w)
120120{
121   m_videoram.target()[offset] = data;
121   m_videoram[offset] = data;
122122   m_bg_tilemap->mark_tile_dirty(offset);
123123}
124124
125125WRITE8_MEMBER(albazg_state::yumefuda_cram_w)
126126{
127   m_colorram.target()[offset] = data;
127   m_colorram[offset] = data;
128128   m_bg_tilemap->mark_tile_dirty(offset);
129129}
130130
r14899r14900
132132READ8_MEMBER(albazg_state::custom_ram_r)
133133{
134134//  logerror("Custom RAM read at %02x PC = %x\n", offset + 0xaf80, cpu_get_pc(&space.device()));
135   return m_cus_ram.target()[offset];// ^ 0x55;
135   return m_cus_ram[offset];// ^ 0x55;
136136}
137137
138138WRITE8_MEMBER(albazg_state::custom_ram_w)
139139{
140140//  logerror("Custom RAM write at %02x : %02x PC = %x\n", offset + 0xaf80, data, cpu_get_pc(&space.device()));
141141   if(m_prot_lock)
142      m_cus_ram.target()[offset] = data;
142      m_cus_ram[offset] = data;
143143}
144144
145145/*this might be used as NVRAM commands btw*/
src/mame/drivers/sstrangr.c
r14899r14900
4545
4646      UINT8 x = offs << 3;
4747      int y = offs >> 5;
48      UINT8 data = state->m_ram.target()[offs];
48      UINT8 data = state->m_ram[offs];
4949
5050      for (i = 0; i < 8; i++)
5151      {
r14899r14900
103103
104104      offs_t color_address = (offs >> 9 << 5) | (offs & 0x1f);
105105
106      UINT8 data = state->m_ram.target()[offs];
106      UINT8 data = state->m_ram[offs];
107107      UINT8 fore_color = color_map_base[color_address] & 0x07;
108108
109109      for (i = 0; i < 8; i++)
src/mame/drivers/backfire.c
r14899r14900
119119   screen.machine().priority_bitmap.fill(0);
120120   bitmap.fill(0x100, cliprect);
121121
122   if (state->m_left_priority.target()[0] == 0)
122   if (state->m_left_priority[0] == 0)
123123   {
124124      deco16ic_tilemap_1_draw(state->m_deco_tilegen2, bitmap, cliprect, 0, 1);
125125      deco16ic_tilemap_1_draw(state->m_deco_tilegen1, bitmap, cliprect, 0, 2);
126126      screen.machine().device<decospr_device>("spritegen")->draw_sprites(bitmap, cliprect, state->m_spriteram_1, 0x800);
127127   }
128   else if (state->m_left_priority.target()[0] == 2)
128   else if (state->m_left_priority[0] == 2)
129129   {
130130      deco16ic_tilemap_1_draw(state->m_deco_tilegen1, bitmap, cliprect, 0, 2);
131131      deco16ic_tilemap_1_draw(state->m_deco_tilegen2, bitmap, cliprect, 0, 4);
132132      screen.machine().device<decospr_device>("spritegen")->draw_sprites(bitmap, cliprect, state->m_spriteram_1, 0x800);
133133   }
134134   else
135      popmessage( "unknown left priority %08x", state->m_left_priority.target()[0]);
135      popmessage( "unknown left priority %08x", state->m_left_priority[0]);
136136
137137   return 0;
138138}
r14899r14900
152152   screen.machine().priority_bitmap.fill(0);
153153   bitmap.fill(0x500, cliprect);
154154
155   if (state->m_right_priority.target()[0] == 0)
155   if (state->m_right_priority[0] == 0)
156156   {
157157      deco16ic_tilemap_2_draw(state->m_deco_tilegen2, bitmap, cliprect, 0, 1);
158158      deco16ic_tilemap_2_draw(state->m_deco_tilegen1, bitmap, cliprect, 0, 2);
159159      screen.machine().device<decospr_device>("spritegen2")->draw_sprites(bitmap, cliprect, state->m_spriteram_2, 0x800);
160160   }
161   else if (state->m_right_priority.target()[0] == 2)
161   else if (state->m_right_priority[0] == 2)
162162   {
163163      deco16ic_tilemap_2_draw(state->m_deco_tilegen1, bitmap, cliprect, 0, 2);
164164      deco16ic_tilemap_2_draw(state->m_deco_tilegen2, bitmap, cliprect, 0, 4);
165165      screen.machine().device<decospr_device>("spritegen2")->draw_sprites(bitmap, cliprect, state->m_spriteram_2, 0x800);
166166   }
167167   else
168      popmessage( "unknown right priority %08x", state->m_right_priority.target()[0]);
168      popmessage( "unknown right priority %08x", state->m_right_priority[0]);
169169
170170   return 0;
171171}
r14899r14900
699699   if (cpu_get_pc(&space.device() )== 0xce44)  device_spin_until_time(&space.device(), attotime::from_usec(400)); // backfire
700700   if (cpu_get_pc(&space.device()) == 0xcee4)  device_spin_until_time(&space.device(), attotime::from_usec(400)); // backfirea
701701
702   return m_mainram.target()[0x18/4];
702   return m_mainram[0x18/4];
703703}
704704
705705
src/mame/drivers/astrocorp.c
r14899r14900
101101static void draw_sprites( running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect )
102102{
103103   astrocorp_state *state = machine.driver_data<astrocorp_state>();
104   UINT16 *source = state->m_spriteram.target();
105   UINT16 *finish = state->m_spriteram.target() + state->m_spriteram.bytes() / 2;
104   UINT16 *source = state->m_spriteram;
105   UINT16 *finish = state->m_spriteram + state->m_spriteram.bytes() / 2;
106106
107107   for ( ; source < finish; source += 8 / 2 )
108108   {
r14899r14900
279279// 5-6-5 Palette: BBBBB-GGGGGG-RRRRR
280280WRITE16_MEMBER(astrocorp_state::astrocorp_palette_w)
281281{
282   COMBINE_DATA(&m_paletteram.target()[offset]);
282   COMBINE_DATA(&m_paletteram[offset]);
283283   palette_set_color_rgb(machine(), offset,
284      pal5bit((m_paletteram.target()[offset] >>  0) & 0x1f),
285      pal6bit((m_paletteram.target()[offset] >>  5) & 0x3f),
286      pal5bit((m_paletteram.target()[offset] >> 11) & 0x1f)
284      pal5bit((m_paletteram[offset] >>  0) & 0x1f),
285      pal6bit((m_paletteram[offset] >>  5) & 0x3f),
286      pal5bit((m_paletteram[offset] >> 11) & 0x1f)
287287   );
288288}
289289
src/mame/drivers/ltcasino.c
r14899r14900
4141   ltcasino_state *state = machine.driver_data<ltcasino_state>();
4242   int tileno, colour;
4343
44   tileno = state->m_tile_num_ram.target()[tile_index];
45   colour = state->m_tile_atr_ram.target()[tile_index];
44   tileno = state->m_tile_num_ram[tile_index];
45   colour = state->m_tile_atr_ram[tile_index];
4646
4747   tileno += (colour & 0x80) << 1;
4848
r14899r14900
5858
5959WRITE8_MEMBER(ltcasino_state::ltcasino_tile_num_w)
6060{
61   m_tile_num_ram.target()[offset] = data;
61   m_tile_num_ram[offset] = data;
6262   m_tilemap->mark_tile_dirty(offset);
6363}
6464
6565WRITE8_MEMBER(ltcasino_state::ltcasino_tile_atr_w)
6666{
67   m_tile_atr_ram.target()[offset] = data;
67   m_tile_atr_ram[offset] = data;
6868   m_tilemap->mark_tile_dirty(offset);
6969}
7070
src/mame/drivers/meijinsn.c
r14899r14900
107107   static const UINT8 coinage1[2][2] = {{1,1}, {1,2}};
108108   static const UINT8 coinage2[2][2] = {{1,5}, {2,1}};
109109
110   int source = m_shared_ram.target()[offset];
110   int source = m_shared_ram[offset];
111111
112112   switch (offset)
113113   {
114114      case 0: /* Dipswitch 2 */
115         m_shared_ram.target()[0] = (source & 0xff00) | input_port_read(machine(), "DSW");
115         m_shared_ram[0] = (source & 0xff00) | input_port_read(machine(), "DSW");
116116         return 0;
117117
118118      case 0x22: /* Coin value */
119         m_shared_ram.target()[0x22] = (source & 0xff00) | (m_credits & 0x00ff);
119         m_shared_ram[0x22] = (source & 0xff00) | (m_credits & 0x00ff);
120120         return 0;
121121
122122      case 0x29: /* Query microcontroller for coin insert */
r14899r14900
128128
129129         if ((input_port_read(machine(), "COINS") & 0x1) == 0 && !m_mcu_latch)
130130         {
131            m_shared_ram.target()[0x29] = (source & 0xff00) | 0x22;   // coinA
132            m_shared_ram.target()[0x22] = (source & 0xff00) | 0x00;
131            m_shared_ram[0x29] = (source & 0xff00) | 0x22;   // coinA
132            m_shared_ram[0x22] = (source & 0xff00) | 0x00;
133133            m_mcu_latch = 1;
134134
135135            m_coinvalue = (~input_port_read(machine(), "DSW")>>3) & 1;
r14899r14900
145145         }
146146         else if ((input_port_read(machine(), "COINS") & 0x2) == 0 && !m_mcu_latch)
147147         {
148            m_shared_ram.target()[0x29] = (source & 0xff00) | 0x22;   // coinA
149            m_shared_ram.target()[0x22] = (source & 0xff00) | 0x00;
148            m_shared_ram[0x29] = (source & 0xff00) | 0x22;   // coinA
149            m_shared_ram[0x22] = (source & 0xff00) | 0x00;
150150            m_mcu_latch = 1;
151151
152152            m_coinvalue = (~input_port_read(machine(), "DSW") >> 3) & 1;
r14899r14900
162162         }
163163         else
164164         {
165            m_shared_ram.target()[0x29] = (source & 0xff00) | 0x22;
165            m_shared_ram[0x29] = (source & 0xff00) | 0x22;
166166         }
167167         return 0;
168168   }
r14899r14900
297297      sx = offs >> 8;
298298      sy = offs & 0xff;
299299
300      data1 = state->m_videoram.target()[offs] >> 8;
301      data2 = state->m_videoram.target()[offs] & 0xff;
300      data1 = state->m_videoram[offs] >> 8;
301      data2 = state->m_videoram[offs] & 0xff;
302302
303303      for (x = 0; x < 4; x++)
304304      {
src/mame/drivers/coolridr.c
r14899r14900
271271      m_soundcpu(*this,"soundcpu"),
272272      m_h1_vram(*this, "h1_vram"),
273273      m_h1_charram(*this, "h1_charram"),
274      m_framebuffer_vram(*this, "framebuffer_vram"),
274      m_framebuffer_vram(*this, "fb_vram"),
275275      m_txt_vram(*this, "txt_vram"),
276276      m_sysh1_txt_blit(*this, "sysh1_txt_blit"),
277277      m_sysh1_workram_h(*this, "sysh1_workrah"),
r14899r14900
375375      {
376376         int tile;
377377
378         tile = (state->m_h1_vram.target()[count] & 0x0fff0000) >> 16;
378         tile = (state->m_h1_vram[count] & 0x0fff0000) >> 16;
379379         drawgfx_opaque(bitmap,cliprect,gfx,tile,state->m_color,0,0,(x+0)*16,y*16);
380380
381         tile = (state->m_h1_vram.target()[count] & 0x00000fff) >> 0;
381         tile = (state->m_h1_vram[count] & 0x00000fff) >> 0;
382382         drawgfx_opaque(bitmap,cliprect,gfx,tile,state->m_color,0,0,(x+1)*16,y*16);
383383
384384         count++;
r14899r14900
404404
405405         m_vblank^=1;
406406
407         return (m_h1_unk.target()[offset] & 0xfdffffff) | (m_vblank<<25);
407         return (m_h1_unk[offset] & 0xfdffffff) | (m_vblank<<25);
408408      }
409409      case 0x14/4:
410         return m_h1_unk.target()[offset];
410         return m_h1_unk[offset];
411411      //case 0x20/4:
412412   }
413413
414   return 0xffffffff;//m_h1_unk.target()[offset];
414   return 0xffffffff;//m_h1_unk[offset];
415415}
416416
417417WRITE32_MEMBER(coolridr_state::sysh1_unk_w)
418418{
419   COMBINE_DATA(&m_h1_unk.target()[offset]);
419   COMBINE_DATA(&m_h1_unk[offset]);
420420}
421421
422422/* According to Guru, this is actually the same I/O chip of Sega Model 2 HW */
r14899r14900
438438WRITE32_MEMBER(coolridr_state::sysh1_txt_blit_w)
439439{
440440
441   COMBINE_DATA(&m_sysh1_txt_blit.target()[offset]);
441   COMBINE_DATA(&m_sysh1_txt_blit[offset]);
442442
443443   switch(offset)
444444   {
r14899r14900
600600   end_dma_mark = 0;
601601
602602   do{
603      src = (state->m_framebuffer_vram.target()[(0+dma_index)/4] & 0x0fffffff);
604      dst = (state->m_framebuffer_vram.target()[(4+dma_index)/4]);
605      size = state->m_framebuffer_vram.target()[(8+dma_index)/4];
606      type = (state->m_framebuffer_vram.target()[(0+dma_index)/4] & 0xf0000000) >> 28;
603      src = (state->m_framebuffer_vram[(0+dma_index)/4] & 0x0fffffff);
604      dst = (state->m_framebuffer_vram[(4+dma_index)/4]);
605      size = state->m_framebuffer_vram[(8+dma_index)/4];
606      type = (state->m_framebuffer_vram[(0+dma_index)/4] & 0xf0000000) >> 28;
607607
608608      #if 0
609609      if(type == 0xc || type == 0xd || type == 0xe)
r14899r14900
669669
670670WRITE32_MEMBER(coolridr_state::sysh1_dma_w)
671671{
672   COMBINE_DATA(&m_framebuffer_vram.target()[offset]);
672   COMBINE_DATA(&m_framebuffer_vram[offset]);
673673
674674   if(offset*4 == 0x000)
675675   {
676      if((m_framebuffer_vram.target()[offset] & 0xff00000) == 0xfe00000)
677         sysh1_dma_transfer(&space, m_framebuffer_vram.target()[offset] & 0xffff);
676      if((m_framebuffer_vram[offset] & 0xff00000) == 0xfe00000)
677         sysh1_dma_transfer(&space, m_framebuffer_vram[offset] & 0xffff);
678678   }
679679}
680680
681681WRITE32_MEMBER(coolridr_state::sysh1_char_w)
682682{
683   COMBINE_DATA(&m_h1_charram.target()[offset]);
683   COMBINE_DATA(&m_h1_charram[offset]);
684684
685685   {
686686      UINT8 *gfx = machine().region("ram_gfx")->base();
687687
688      gfx[offset*4+0] = (m_h1_charram.target()[offset] & 0xff000000) >> 24;
689      gfx[offset*4+1] = (m_h1_charram.target()[offset] & 0x00ff0000) >> 16;
690      gfx[offset*4+2] = (m_h1_charram.target()[offset] & 0x0000ff00) >> 8;
691      gfx[offset*4+3] = (m_h1_charram.target()[offset] & 0x000000ff) >> 0;
688      gfx[offset*4+0] = (m_h1_charram[offset] & 0xff000000) >> 24;
689      gfx[offset*4+1] = (m_h1_charram[offset] & 0x00ff0000) >> 16;
690      gfx[offset*4+2] = (m_h1_charram[offset] & 0x0000ff00) >> 8;
691      gfx[offset*4+3] = (m_h1_charram[offset] & 0x000000ff) >> 0;
692692
693693      gfx_element_mark_dirty(machine().gfx[2], offset/64); //*4/256
694694   }
r14899r14900
701701   AM_RANGE(0x03000000, 0x030fffff) AM_RAM AM_SHARE("h1_vram")//bg vram
702702   AM_RANGE(0x03c00000, 0x03c0ffff) AM_RAM_WRITE(sysh1_pal_w) AM_SHARE("paletteram")
703703   AM_RANGE(0x03d00000, 0x03dfffff) AM_RAM_WRITE(sysh1_char_w) AM_SHARE("h1_charram") //FIXME: half size
704   AM_RANGE(0x03e00000, 0x03efffff) AM_RAM_WRITE(sysh1_dma_w) AM_SHARE("framebuffer_vram") //FIXME: not all of it
704   AM_RANGE(0x03e00000, 0x03efffff) AM_RAM_WRITE(sysh1_dma_w) AM_SHARE("fb_vram") //FIXME: not all of it
705705
706706   AM_RANGE(0x03f00000, 0x03f0ffff) AM_RAM AM_SHARE("share3") /*Communication area RAM*/
707707   AM_RANGE(0x03f40000, 0x03f4ffff) AM_RAM AM_SHARE("txt_vram")//text tilemap + "lineram"
r14899r14900
12351235   if(pc == 0x6012374 || pc == 0x6012392)
12361236      return 0;
12371237
1238   return m_sysh1_workram_h.target()[0xd88a4/4];
1238   return m_sysh1_workram_h[0xd88a4/4];
12391239}
12401240#endif
12411241
r14899r14900
12461246   if(pc == 0x6002cba || pc == 0x6002d42)
12471247      return 0;
12481248
1249   return m_sysh1_workram_h.target()[0xd8894/4];
1249   return m_sysh1_workram_h[0xd8894/4];
12501250}
12511251
12521252static DRIVER_INIT( coolridr )
src/mame/drivers/blitz.c
r14899r14900
317317
318318WRITE8_MEMBER(blitz_state::megadpkr_videoram_w)
319319{
320   m_videoram.target()[offset] = data;
320   m_videoram[offset] = data;
321321   m_bg_tilemap->mark_tile_dirty(offset);
322322}
323323
324324WRITE8_MEMBER(blitz_state::megadpkr_colorram_w)
325325{
326   m_colorram.target()[offset] = data;
326   m_colorram[offset] = data;
327327   m_bg_tilemap->mark_tile_dirty(offset);
328328}
329329
r14899r14900
339339    xx-- ----   unused.
340340*/
341341
342   int attr = state->m_colorram.target()[tile_index];
343   int code = ((attr & 1) << 8) | state->m_videoram.target()[tile_index];
342   int attr = state->m_colorram[tile_index];
343   int code = ((attr & 1) << 8) | state->m_videoram[tile_index];
344344   int bank = (attr & 0x02) >> 1;   /* bit 1 switch the gfx banks */
345345   int color = (attr & 0x3c) >> 2;   /* bits 2-3-4-5 for color */
346346
src/mame/drivers/intrscti.c
r14899r14900
8282      for (x=0;x<32;x++)
8383      {
8484         int dat;
85         dat = state->m_ram.target()[count];
85         dat = state->m_ram[count];
8686         drawgfx_transpen(bitmap,cliprect,screen.machine().gfx[0],dat/*+0x100*/,0,0,0,x*8,y*8,0);
8787         count++;
8888      }
src/mame/drivers/sfbonus.c
r14899r14900
808808   UINT8* selectbase = &state->m_videoram[0x600];
809809   UINT8* bg_scroll = &state->m_videoram[0x000];
810810   UINT8* reels_rowscroll = &state->m_videoram[0x400];
811   int globalyscrollreels = (state->m_vregs.target()[6] | state->m_vregs.target()[7]<<8);
812   int globalxscrollreels = (state->m_vregs.target()[4] | state->m_vregs.target()[5]<<8);
811   int globalyscrollreels = (state->m_vregs[6] | state->m_vregs[7]<<8);
812   int globalxscrollreels = (state->m_vregs[4] | state->m_vregs[5]<<8);
813813   globalyscrollreels += 8;
814814   globalxscrollreels += 8;
815815
r14899r14900
938938{
939939   sfbonus_state *state = screen.machine().driver_data<sfbonus_state>();
940940
941   int globalyscroll = (state->m_vregs.target()[2] | state->m_vregs.target()[3]<<8);
942   int globalxscroll = (state->m_vregs.target()[0] | state->m_vregs.target()[1]<<8);
941   int globalyscroll = (state->m_vregs[2] | state->m_vregs[3]<<8);
942   int globalxscroll = (state->m_vregs[0] | state->m_vregs[1]<<8);
943943   UINT8* front_rowscroll = &state->m_videoram[0x200];
944944   ioport_constructor ipt;
945945   int i;
r14899r14900
997997   }
998998#if 0
999999    popmessage("%02x %02x %02x %02x %02x %02x %02x %02x -- %02x -- %02x %02x -- %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x",
1000    state->m_3800_regs.target()[0],
1001    state->m_3800_regs.target()[1],
1002    state->m_3800_regs.target()[2],
1003    state->m_3800_regs.target()[3],
1004    state->m_3800_regs.target()[4],
1005    state->m_3800_regs.target()[5],
1006    state->m_3800_regs.target()[6],
1007    state->m_3800_regs.target()[7],
1008    state->m_3000_regs.target()[0],
1009    state->m_2801_regs.target()[0],
1010    state->m_2c01_regs.target()[0],
1011    state->m_vregs.target()[8],
1012    state->m_vregs.target()[0],
1013    state->m_vregs.target()[10],
1014    state->m_vregs.target()[11],
1015    state->m_vregs.target()[12],
1016    state->m_vregs.target()[13],
1017    state->m_vregs.target()[14],
1018    state->m_vregs.target()[15],
1019    state->m_vregs.target()[16],
1020    state->m_vregs.target()[17],
1021    state->m_vregs.target()[18],
1022    state->m_vregs.target()[19],
1023    state->m_vregs.target()[20],
1024    state->m_vregs.target()[21],
1025    state->m_vregs.target()[22],
1026    state->m_vregs.target()[23],
1027    state->m_vregs.target()[24],
1028    state->m_vregs.target()[25],
1029    state->m_vregs.target()[26],
1030    state->m_vregs.target()[27],
1031    state->m_vregs.target()[28],
1032    state->m_vregs.target()[29],
1033    state->m_vregs.target()[30],
1034    state->m_vregs.target()[31]
1000    state->m_3800_regs[0],
1001    state->m_3800_regs[1],
1002    state->m_3800_regs[2],
1003    state->m_3800_regs[3],
1004    state->m_3800_regs[4],
1005    state->m_3800_regs[5],
1006    state->m_3800_regs[6],
1007    state->m_3800_regs[7],
1008    state->m_3000_regs[0],
1009    state->m_2801_regs[0],
1010    state->m_2c01_regs[0],
1011    state->m_vregs[8],
1012    state->m_vregs[0],
1013    state->m_vregs[10],
1014    state->m_vregs[11],
1015    state->m_vregs[12],
1016    state->m_vregs[13],
1017    state->m_vregs[14],
1018    state->m_vregs[15],
1019    state->m_vregs[16],
1020    state->m_vregs[17],
1021    state->m_vregs[18],
1022    state->m_vregs[19],
1023    state->m_vregs[20],
1024    state->m_vregs[21],
1025    state->m_vregs[22],
1026    state->m_vregs[23],
1027    state->m_vregs[24],
1028    state->m_vregs[25],
1029    state->m_vregs[26],
1030    state->m_vregs[27],
1031    state->m_vregs[28],
1032    state->m_vregs[29],
1033    state->m_vregs[30],
1034    state->m_vregs[31]
10351035    );
10361036
10371037    popmessage("-- %02x %02x %02x %02x %02x %02x %02x %02x",
1038    state->m_1800_regs.target()[0],
1039    state->m_1800_regs.target()[1],
1040    state->m_1800_regs.target()[2],
1041    state->m_1800_regs.target()[3],
1042    state->m_1800_regs.target()[4],
1043    state->m_1800_regs.target()[5],
1044    state->m_1800_regs.target()[6],
1045    state->m_1800_regs.target()[7]);
1038    state->m_1800_regs[0],
1039    state->m_1800_regs[1],
1040    state->m_1800_regs[2],
1041    state->m_1800_regs[3],
1042    state->m_1800_regs[4],
1043    state->m_1800_regs[5],
1044    state->m_1800_regs[6],
1045    state->m_1800_regs[7]);
10461046#endif
10471047
10481048   ipt = screen.machine().system().ipt;
r14899r14900
10501050      || (ipt == INPUT_PORTS_NAME(amcoe2_poker)))
10511051   {
10521052      // based on pirpok2
1053      output_set_lamp_value(0, (state->m_1800_regs.target()[6] & 0x1) >> 0);
1054      output_set_lamp_value(1, (state->m_1800_regs.target()[6] & 0x4) >> 2);
1055      output_set_lamp_value(2, (state->m_1800_regs.target()[5] & 0x4) >> 2);
1056      output_set_lamp_value(3, (state->m_1800_regs.target()[5] & 0x1) >> 0);
1057      output_set_lamp_value(4, (state->m_1800_regs.target()[4] & 0x4) >> 2);
1058      output_set_lamp_value(5, (state->m_1800_regs.target()[4] & 0x1) >> 0);
1053      output_set_lamp_value(0, (state->m_1800_regs[6] & 0x1) >> 0);
1054      output_set_lamp_value(1, (state->m_1800_regs[6] & 0x4) >> 2);
1055      output_set_lamp_value(2, (state->m_1800_regs[5] & 0x4) >> 2);
1056      output_set_lamp_value(3, (state->m_1800_regs[5] & 0x1) >> 0);
1057      output_set_lamp_value(4, (state->m_1800_regs[4] & 0x4) >> 2);
1058      output_set_lamp_value(5, (state->m_1800_regs[4] & 0x1) >> 0);
10591059   }
10601060   else if ((ipt == INPUT_PORTS_NAME(amcoe1_reels3)) || (ipt == INPUT_PORTS_NAME(amcoe1_reels4))
10611061      || (ipt == INPUT_PORTS_NAME(amcoe1_poker)))
10621062   {
1063      output_set_lamp_value(0, (state->m_1800_regs.target()[0] & 0x2) >> 1);
1064      output_set_lamp_value(1, (state->m_1800_regs.target()[4] & 0x2) >> 1);
1065      output_set_lamp_value(2, (state->m_1800_regs.target()[3] & 0x2) >> 1);
1066      output_set_lamp_value(3, (state->m_1800_regs.target()[6] & 0x4) >> 2);
1067      output_set_lamp_value(4, (state->m_1800_regs.target()[4] & 0x4) >> 2);
1068      output_set_lamp_value(5, (state->m_1800_regs.target()[3] & 0x4) >> 2);
1063      output_set_lamp_value(0, (state->m_1800_regs[0] & 0x2) >> 1);
1064      output_set_lamp_value(1, (state->m_1800_regs[4] & 0x2) >> 1);
1065      output_set_lamp_value(2, (state->m_1800_regs[3] & 0x2) >> 1);
1066      output_set_lamp_value(3, (state->m_1800_regs[6] & 0x4) >> 2);
1067      output_set_lamp_value(4, (state->m_1800_regs[4] & 0x4) >> 2);
1068      output_set_lamp_value(5, (state->m_1800_regs[3] & 0x4) >> 2);
10691069   }
10701070
10711071   return 0;
r14899r14900
11191119// lamps and coin counters
11201120WRITE8_MEMBER(sfbonus_state::sfbonus_1800_w)
11211121{
1122   m_1800_regs.target()[offset] = data;
1122   m_1800_regs[offset] = data;
11231123}
11241124
11251125WRITE8_MEMBER(sfbonus_state::sfbonus_3800_w)
11261126{
1127   m_3800_regs.target()[offset] = data;
1127   m_3800_regs[offset] = data;
11281128}
11291129
11301130WRITE8_MEMBER(sfbonus_state::sfbonus_3000_w)
11311131{
1132   m_3000_regs.target()[offset] = data;
1132   m_3000_regs[offset] = data;
11331133}
11341134
11351135WRITE8_MEMBER(sfbonus_state::sfbonus_2801_w)
11361136{
1137   m_2801_regs.target()[offset] = data;
1137   m_2801_regs[offset] = data;
11381138}
11391139
11401140WRITE8_MEMBER(sfbonus_state::sfbonus_2c01_w)
11411141{
1142   m_2c01_regs.target()[offset] = data;
1142   m_2c01_regs[offset] = data;
11431143}
11441144
11451145
src/mame/drivers/crystal.c
r14899r14900
135135      m_vidregs(*this, "vidregs"),
136136      m_textureram(*this, "textureram"),
137137      m_frameram(*this, "frameram"),
138      m_ResetPatch(*this, "ResetPatch"){ }
138      m_reset_patch(*this, "reset_patch"){ }
139139
140140   /* memory pointers */
141141   required_shared_ptr<UINT32> m_sysregs;
r14899r14900
143143   required_shared_ptr<UINT32> m_vidregs;
144144   required_shared_ptr<UINT32> m_textureram;
145145   required_shared_ptr<UINT32> m_frameram;
146   required_shared_ptr<UINT32> m_ResetPatch;
146   required_shared_ptr<UINT32> m_reset_patch;
147147//  UINT32 *  m_nvram;    // currently this uses generic nvram handling
148148
149149#ifdef IDLE_LOOP_SPEEDUP
r14899r14900
508508   AM_RANGE(0x05000000, 0x05000003) AM_READWRITE(FlashCmd_r, FlashCmd_w)
509509   AM_RANGE(0x05000000, 0x05ffffff) AM_ROMBANK("bank1")
510510
511   AM_RANGE(0x44414F4C, 0x44414F7F) AM_RAM AM_SHARE("ResetPatch")
511   AM_RANGE(0x44414F4C, 0x44414F7F) AM_RAM AM_SHARE("reset_patch")
512512
513513ADDRESS_MAP_END
514514
r14899r14900
549549      0xdef4d4fa
550550   };
551551
552   memcpy(state->m_ResetPatch, Patch, sizeof(Patch));
552   memcpy(state->m_reset_patch, Patch, sizeof(Patch));
553553#else
554554   static const UINT8 Patch[] =
555555   {
r14899r14900
558558      0x20,0x3A,0xD0,0xA1,0xFA,0xD4,0xF4,0xDE
559559   };
560560
561   memcpy(state->m_ResetPatch, Patch, sizeof(Patch));
561   memcpy(state->m_reset_patch, Patch, sizeof(Patch));
562562#endif
563563}
564564
r14899r14900
626626      state->m_Timer[i]->adjust(attotime::never);
627627   }
628628
629   vr0_snd_set_areas(machine.device("vrender"), state->m_textureram, state->m_frameram.target());
629   vr0_snd_set_areas(machine.device("vrender"), state->m_textureram, state->m_frameram);
630630#ifdef IDLE_LOOP_SPEEDUP
631631   state->m_FlipCntRead = 0;
632632#endif
r14899r14900
672672   }
673673
674674   Visible  = (UINT16*) Front;
675   DrawDest = (UINT16 *) state->m_frameram.target();
675   // ERROR: This cast is NOT endian-safe without the use of BYTE/WORD/DWORD_XOR_* macros!
676   DrawDest = reinterpret_cast<UINT16 *>(state->m_frameram.target());
676677
677678
678679   if (GetVidReg(space, 0x8c) & 0x80)
r14899r14900
689690   tail = GetVidReg(space, 0x80);
690691   while ((head & 0x7ff) != (tail & 0x7ff))
691692   {
692      DoFlip = vrender0_ProcessPacket(state->m_vr0video, 0x03800000 + head * 64, DrawDest, (UINT8*)state->m_textureram.target());
693      // ERROR: This cast is NOT endian-safe without the use of BYTE/WORD/DWORD_XOR_* macros!
694      DoFlip = vrender0_ProcessPacket(state->m_vr0video, 0x03800000 + head * 64, DrawDest, reinterpret_cast<UINT8*>(state->m_textureram.target()));
693695      head++;
694696      head &= 0x7ff;
695697      if (DoFlip)
src/mame/drivers/chinsan.c
r14899r14900
9999      for (x = 0; x < 64; x++)
100100      {
101101         int tileno, colour;
102         tileno = state->m_video.target()[count] | (state->m_video.target()[count + 0x800] << 8);
103         colour = state->m_video.target()[count + 0x1000] >> 3;
102         tileno = state->m_video[count] | (state->m_video[count + 0x800] << 8);
103         colour = state->m_video[count + 0x1000] >> 3;
104104         drawgfx_opaque(bitmap,cliprect,screen.machine().gfx[0],tileno,colour,0,0,x*8,y*8);
105105         count++;
106106      }
src/mame/drivers/cshooter.c
r14899r14900
119119static TILE_GET_INFO( get_cstx_tile_info )
120120{
121121   cshooter_state *state = machine.driver_data<cshooter_state>();
122   int code = (state->m_txram.target()[tile_index*2]);
123   int attr = (state->m_txram.target()[tile_index*2+1]);
122   int code = (state->m_txram[tile_index*2]);
123   int attr = (state->m_txram[tile_index*2+1]);
124124   int rg;
125125   rg=0;
126126   if (attr & 0x20) rg = 1;
r14899r14900
135135
136136WRITE8_MEMBER(cshooter_state::cshooter_txram_w)
137137{
138   m_txram.target()[offset] = data;
138   m_txram[offset] = data;
139139   m_txtilemap->mark_tile_dirty(offset/2);
140140}
141141
r14899r14900
154154
155155   //sprites
156156   {
157      UINT8 *spriteram = state->m_spriteram.target();
157      UINT8 *spriteram = state->m_spriteram;
158158      int i;
159159      for(i=0;i<state->m_spriteram.bytes();i+=4)
160160      {
src/mame/drivers/ultrsprt.c
r14899r14900
4444   ultrsprt_state *state = screen.machine().driver_data<ultrsprt_state>();
4545   int i, j;
4646
47   UINT8 *ram = (UINT8 *)state->m_vram.target();
47   UINT8 *ram = reinterpret_cast<UINT8 *>(state->m_vram.target());
4848
4949   for (j=0; j < 400; j++)
5050   {
r14899r14900
107107   ppcdrc_set_options(machine.device("maincpu"), PPCDRC_COMPATIBLE_OPTIONS);
108108
109109   /* configure fast RAM regions for DRC */
110   ppcdrc_add_fastram(machine.device("maincpu"), 0x80000000, 0x8007ffff, FALSE, state->m_vram.target());
111   ppcdrc_add_fastram(machine.device("maincpu"), 0xff000000, 0xff01ffff, FALSE, state->m_workram.target());
110   ppcdrc_add_fastram(machine.device("maincpu"), 0x80000000, 0x8007ffff, FALSE, state->m_vram);
111   ppcdrc_add_fastram(machine.device("maincpu"), 0xff000000, 0xff01ffff, FALSE, state->m_workram);
112112}
113113
114114
src/mame/drivers/spool99.c
r14899r14900
9999public:
100100   spool99_state(const machine_config &mconfig, device_type type, const char *tag)
101101      : driver_device(mconfig, type, tag) ,
102      m_main(*this, "main"),
102      m_main(*this, "mainram"),
103103      m_vram(*this, "vram"),
104104      m_cram(*this, "cram"){ }
105105
r14899r14900
116116static TILE_GET_INFO( get_spool99_tile_info )
117117{
118118   spool99_state *state = machine.driver_data<spool99_state>();
119   int code = ((state->m_vram.target()[tile_index*2+1]<<8) | (state->m_vram.target()[tile_index*2+0]));
120   int color = state->m_cram.target()[tile_index*2+0];
119   int code = ((state->m_vram[tile_index*2+1]<<8) | (state->m_vram[tile_index*2+0]));
120   int color = state->m_cram[tile_index*2+0];
121121
122122   SET_TILE_INFO(
123123         0,
r14899r14900
144144WRITE8_MEMBER(spool99_state::spool99_vram_w)
145145{
146146
147   m_vram.target()[offset] = data;
147   m_vram[offset] = data;
148148   m_sc0_tilemap->mark_tile_dirty(offset/2);
149149}
150150
151151WRITE8_MEMBER(spool99_state::spool99_cram_w)
152152{
153153
154   m_cram.target()[offset] = data;
154   m_cram[offset] = data;
155155   m_sc0_tilemap->mark_tile_dirty(offset/2);
156156}
157157
r14899r14900
212212}
213213
214214static ADDRESS_MAP_START( spool99_map, AS_PROGRAM, 8, spool99_state )
215   AM_RANGE(0x0000, 0x00ff) AM_RAM AM_SHARE("main")
215   AM_RANGE(0x0000, 0x00ff) AM_RAM AM_SHARE("mainram")
216216   AM_RANGE(0x0100, 0xaeff) AM_ROM AM_REGION("maincpu", 0x100) AM_WRITENOP
217217   AM_RANGE(0xaf00, 0xafff) AM_READ(spool99_io_r)
218218   AM_RANGE(0xafed, 0xafed) AM_DEVWRITE_LEGACY("eeprom", eeprom_resetline_w )
r14899r14900
258258}
259259
260260static ADDRESS_MAP_START( vcarn_map, AS_PROGRAM, 8, spool99_state )
261   AM_RANGE(0x0000, 0x00ff) AM_RAM AM_SHARE("main")
261   AM_RANGE(0x0000, 0x00ff) AM_RAM AM_SHARE("mainram")
262262   AM_RANGE(0x0100, 0xa6ff) AM_ROM AM_REGION("maincpu", 0x100) AM_WRITENOP
263263   AM_RANGE(0xa700, 0xa7ff) AM_READ(vcarn_io_r)
264264   AM_RANGE(0xa745, 0xa745) AM_DEVWRITE_LEGACY("eeprom", eeprom_resetline_w )
src/mame/drivers/lgp.c
r14899r14900
7676      : driver_device(mconfig, type, tag),
7777        m_laserdisc(*this, "laserdisc") ,
7878      m_tile_ram(*this, "tile_ram"),
79      m_tile_control_ram(*this, "tile_control_ram"){ }
79      m_tile_control_ram(*this, "tile_ctrl_ram"){ }
8080
8181   required_device<pioneer_ldv1000_device> m_laserdisc;
8282   required_shared_ptr<UINT8> m_tile_ram;
r14899r14900
114114         /* Somewhere there's a flag that offsets the tilemap by 0x100*x */
115115         /* Palette is likely set somewhere as well (tile_control_ram?) */
116116         drawgfx_transpen(bitmap, cliprect, screen.machine().gfx[0],
117               state->m_tile_ram.target()[current_screen_character],
117               state->m_tile_ram[current_screen_character],
118118               0,
119119               0, 0, charx*8, chary*8, 0);
120120      }
r14899r14900
144144static ADDRESS_MAP_START( main_program_map, AS_PROGRAM, 8, lgp_state )
145145   AM_RANGE(0x0000,0x7fff) AM_ROM
146146   AM_RANGE(0xe000,0xe3ff) AM_RAM AM_SHARE("tile_ram")
147   AM_RANGE(0xe400,0xe7ff) AM_RAM AM_SHARE("tile_control_ram")
147   AM_RANGE(0xe400,0xe7ff) AM_RAM AM_SHARE("tile_ctrl_ram")
148148
149149//  AM_RANGE(0xef00,0xef00) AM_READ_PORT("IN_TEST")
150150   AM_RANGE(0xef80,0xef80) AM_READWRITE(ldp_read,ldp_write)
src/mame/drivers/timetrv.c
r14899r14900
5353static SCREEN_UPDATE_IND16( timetrv )
5454{
5555   timetrv_state *state = screen.machine().driver_data<timetrv_state>();
56   popmessage("%s%s",state->m_led_vram_lo.target(),state->m_led_vram_hi.target());
56   popmessage("%s%s",reinterpret_cast<char *>(state->m_led_vram_lo.target()),reinterpret_cast<char *>(state->m_led_vram_hi.target()));
5757   return 0;
5858}
5959
src/mame/drivers/tmmjprd.c
r14899r14900
3939{
4040public:
4141   tmmjprd_state(const machine_config &mconfig, device_type type, const char *tag)
42      : driver_device(mconfig, type, tag) { }
42      : driver_device(mconfig, type, tag),
43        m_tilemap_regs(*this, "tilemap_regs"),
44        m_spriteregs(*this, "spriteregs"),
45        m_spriteram(*this, "spriteram") { }
4346
44   UINT32 *m_tilemap_regs[4];
45   UINT32 *m_spriteregs;
47   required_shared_ptr_array<UINT32, 4> m_tilemap_regs;
48   required_shared_ptr<UINT32> m_spriteregs;
4649   UINT32 *m_tilemap_ram[4];
47   UINT32 *m_spriteram;
50   required_shared_ptr<UINT32> m_spriteram;
4851   UINT8 m_mux_data;
4952   UINT8 m_system_in;
5053   double m_old_brt1;
r14899r14900
672675   AM_RANGE(0x200984, 0x200987) AM_READ(randomtmmjprds) // sound chip status?
673676   /* check these are used .. */
674677//  AM_RANGE(0x200010, 0x200013) AM_WRITEONLY AM_BASE_LEGACY(&tmmjprd_viewregs0 )
675   AM_RANGE(0x200100, 0x200117) AM_WRITEONLY AM_BASE(m_tilemap_regs[0] ) // tilemap regs1
676   AM_RANGE(0x200120, 0x200137) AM_WRITEONLY AM_BASE(m_tilemap_regs[1] ) // tilemap regs2
677   AM_RANGE(0x200140, 0x200157) AM_WRITEONLY AM_BASE(m_tilemap_regs[2] ) // tilemap regs3
678   AM_RANGE(0x200160, 0x200177) AM_WRITEONLY AM_BASE(m_tilemap_regs[3] ) // tilemap regs4
679   AM_RANGE(0x200200, 0x20021b) AM_WRITEONLY AM_BASE(m_spriteregs ) // sprregs?
678   AM_RANGE(0x200100, 0x200117) AM_WRITEONLY AM_SHARE("tilemap_regs.0" ) // tilemap regs1
679   AM_RANGE(0x200120, 0x200137) AM_WRITEONLY AM_SHARE("tilemap_regs.1" ) // tilemap regs2
680   AM_RANGE(0x200140, 0x200157) AM_WRITEONLY AM_SHARE("tilemap_regs.2" ) // tilemap regs3
681   AM_RANGE(0x200160, 0x200177) AM_WRITEONLY AM_SHARE("tilemap_regs.3" ) // tilemap regs4
682   AM_RANGE(0x200200, 0x20021b) AM_WRITEONLY AM_SHARE("spriteregs" ) // sprregs?
680683//  AM_RANGE(0x200300, 0x200303) AM_WRITE_LEGACY(tmmjprd_rombank_w) // used during rom testing, rombank/area select + something else?
681684   AM_RANGE(0x20040c, 0x20040f) AM_WRITE(tmmjprd_brt_1_w)
682685    AM_RANGE(0x200410, 0x200413) AM_WRITE(tmmjprd_brt_2_w)
r14899r14900
692695   AM_RANGE(0x288000, 0x28bfff) AM_READWRITE(tmmjprd_tilemap2_r,tmmjprd_tilemap2_w)
693696   AM_RANGE(0x28c000, 0x28ffff) AM_READWRITE(tmmjprd_tilemap3_r,tmmjprd_tilemap3_w)
694697   /* ?? is palette ram shared with sprites in this case or just a different map */
695   AM_RANGE(0x290000, 0x29bfff) AM_RAM AM_BASE(m_spriteram)
698   AM_RANGE(0x290000, 0x29bfff) AM_RAM AM_SHARE("spriteram")
696699   AM_RANGE(0x29c000, 0x29ffff) AM_RAM_WRITE(tmmjprd_paletteram_dword_w) AM_SHARE("paletteram")
697700
698701   AM_RANGE(0x400000, 0x400003) AM_READ(tmmjprd_mux_r) AM_DEVWRITE_LEGACY("eeprom", tmmjprd_eeprom_write)
src/mame/drivers/witch.c
r14899r14900
239239static TILE_GET_INFO( get_gfx0b_tile_info )
240240{
241241   witch_state *state = machine.driver_data<witch_state>();
242   int code  = state->m_gfx0_vram.target()[tile_index];
243   int color = state->m_gfx0_cram.target()[tile_index];
242   int code  = state->m_gfx0_vram[tile_index];
243   int color = state->m_gfx0_cram[tile_index];
244244
245245   code=code | ((color & 0xe0) << 3);
246246
r14899r14900
259259static TILE_GET_INFO( get_gfx0a_tile_info )
260260{
261261   witch_state *state = machine.driver_data<witch_state>();
262   int code  = state->m_gfx0_vram.target()[tile_index];
263   int color = state->m_gfx0_cram.target()[tile_index];
262   int code  = state->m_gfx0_vram[tile_index];
263   int color = state->m_gfx0_cram[tile_index];
264264
265265   code=code | ((color & 0xe0) << 3);
266266
r14899r14900
279279static TILE_GET_INFO( get_gfx1_tile_info )
280280{
281281   witch_state *state = machine.driver_data<witch_state>();
282   int code  = state->m_gfx1_vram.target()[tile_index];
283   int color = state->m_gfx1_cram.target()[tile_index];
282   int code  = state->m_gfx1_vram[tile_index];
283   int color = state->m_gfx1_cram[tile_index];
284284
285285   SET_TILE_INFO(
286286         0,
r14899r14900
291291
292292WRITE8_MEMBER(witch_state::gfx0_vram_w)
293293{
294   m_gfx0_vram.target()[offset] = data;
294   m_gfx0_vram[offset] = data;
295295   m_gfx0a_tilemap->mark_tile_dirty(offset);
296296   m_gfx0b_tilemap->mark_tile_dirty(offset);
297297}
298298
299299WRITE8_MEMBER(witch_state::gfx0_cram_w)
300300{
301   m_gfx0_cram.target()[offset] = data;
301   m_gfx0_cram[offset] = data;
302302   m_gfx0a_tilemap->mark_tile_dirty(offset);
303303   m_gfx0b_tilemap->mark_tile_dirty(offset);
304304}
305305READ8_MEMBER(witch_state::gfx0_vram_r)
306306{
307   return m_gfx0_vram.target()[offset];
307   return m_gfx0_vram[offset];
308308}
309309
310310READ8_MEMBER(witch_state::gfx0_cram_r)
311311{
312   return m_gfx0_cram.target()[offset];
312   return m_gfx0_cram[offset];
313313}
314314
315315#define FIX_OFFSET() do { \
r14899r14900
318318WRITE8_MEMBER(witch_state::gfx1_vram_w)
319319{
320320   FIX_OFFSET();
321   m_gfx1_vram.target()[offset] = data;
321   m_gfx1_vram[offset] = data;
322322   m_gfx1_tilemap->mark_tile_dirty(offset);
323323}
324324
325325WRITE8_MEMBER(witch_state::gfx1_cram_w)
326326{
327327   FIX_OFFSET();
328   m_gfx1_cram.target()[offset] = data;
328   m_gfx1_cram[offset] = data;
329329   m_gfx1_tilemap->mark_tile_dirty(offset);
330330}
331331READ8_MEMBER(witch_state::gfx1_vram_r)
332332{
333333   FIX_OFFSET();
334   return m_gfx1_vram.target()[offset];
334   return m_gfx1_vram[offset];
335335}
336336
337337READ8_MEMBER(witch_state::gfx1_cram_r)
338338{
339339   FIX_OFFSET();
340   return m_gfx1_cram.target()[offset];
340   return m_gfx1_cram[offset];
341341}
342342
343343READ8_MEMBER(witch_state::read_a00x)
r14899r14900
724724   for(i=0;i<0x800;i+=0x20) {
725725
726726
727      sx     = state->m_sprite_ram.target()[i+1];
727      sx     = state->m_sprite_ram[i+1];
728728      if(sx!=0xF8) {
729         tileno = (state->m_sprite_ram.target()[i]<<2)  | (( state->m_sprite_ram.target()[i+0x800] & 0x07 ) << 10 );
729         tileno = (state->m_sprite_ram[i]<<2)  | (( state->m_sprite_ram[i+0x800] & 0x07 ) << 10 );
730730
731         sy     = state->m_sprite_ram.target()[i+2];
732         flags  = state->m_sprite_ram.target()[i+3];
731         sy     = state->m_sprite_ram[i+2];
732         flags  = state->m_sprite_ram[i+3];
733733
734734         flipx  = (flags & 0x10 ) ? 1 : 0;
735735         flipy  = (flags & 0x20 ) ? 1 : 0;
src/mame/drivers/luckgrln.c
r14899r14900
149149
150150WRITE8_MEMBER(luckgrln_state::luckgrln_reel1_ram_w)
151151{
152   m_reel1_ram.target()[offset] = data;
152   m_reel1_ram[offset] = data;
153153   m_reel1_tilemap->mark_tile_dirty(offset);
154154}
155155
156156WRITE8_MEMBER(luckgrln_state::luckgrln_reel1_attr_w)
157157{
158   m_reel1_attr.target()[offset] = data;
158   m_reel1_attr[offset] = data;
159159   m_reel1_tilemap->mark_tile_dirty(offset);
160160}
161161
r14899r14900
164164static TILE_GET_INFO( get_luckgrln_reel1_tile_info )
165165{
166166   luckgrln_state *state = machine.driver_data<luckgrln_state>();
167   int code = state->m_reel1_ram.target()[tile_index];
168   int attr = state->m_reel1_attr.target()[tile_index];
167   int code = state->m_reel1_ram[tile_index];
168   int attr = state->m_reel1_attr[tile_index];
169169   int col = (attr & 0x1f);
170170
171171   code |= (attr & 0xe0)<<3;
r14899r14900
181181
182182WRITE8_MEMBER(luckgrln_state::luckgrln_reel2_ram_w)
183183{
184   m_reel2_ram.target()[offset] = data;
184   m_reel2_ram[offset] = data;
185185   m_reel2_tilemap->mark_tile_dirty(offset);
186186}
187187
188188WRITE8_MEMBER(luckgrln_state::luckgrln_reel2_attr_w)
189189{
190   m_reel2_attr.target()[offset] = data;
190   m_reel2_attr[offset] = data;
191191   m_reel2_tilemap->mark_tile_dirty(offset);
192192}
193193
r14899r14900
195195static TILE_GET_INFO( get_luckgrln_reel2_tile_info )
196196{
197197   luckgrln_state *state = machine.driver_data<luckgrln_state>();
198   int code = state->m_reel2_ram.target()[tile_index];
199   int attr = state->m_reel2_attr.target()[tile_index];
198   int code = state->m_reel2_ram[tile_index];
199   int attr = state->m_reel2_attr[tile_index];
200200   int col = (attr & 0x1f);
201201
202202   code |= (attr & 0xe0)<<3;
r14899r14900
211211
212212WRITE8_MEMBER(luckgrln_state::luckgrln_reel3_ram_w)
213213{
214   m_reel3_ram.target()[offset] = data;
214   m_reel3_ram[offset] = data;
215215   m_reel3_tilemap->mark_tile_dirty(offset);
216216}
217217
218218WRITE8_MEMBER(luckgrln_state::luckgrln_reel3_attr_w)
219219{
220   m_reel3_attr.target()[offset] = data;
220   m_reel3_attr[offset] = data;
221221   m_reel3_tilemap->mark_tile_dirty(offset);
222222}
223223
r14899r14900
225225static TILE_GET_INFO( get_luckgrln_reel3_tile_info )
226226{
227227   luckgrln_state *state = machine.driver_data<luckgrln_state>();
228   int code = state->m_reel3_ram.target()[tile_index];
229   int attr = state->m_reel3_attr.target()[tile_index];
228   int code = state->m_reel3_ram[tile_index];
229   int attr = state->m_reel3_attr[tile_index];
230230   int col = (attr & 0x1f);
231231
232232   code |= (attr & 0xe0)<<3;
r14899r14900
240240
241241WRITE8_MEMBER(luckgrln_state::luckgrln_reel4_ram_w)
242242{
243   m_reel4_ram.target()[offset] = data;
243   m_reel4_ram[offset] = data;
244244   m_reel4_tilemap->mark_tile_dirty(offset);
245245}
246246
247247WRITE8_MEMBER(luckgrln_state::luckgrln_reel4_attr_w)
248248{
249   m_reel4_attr.target()[offset] = data;
249   m_reel4_attr[offset] = data;
250250   m_reel4_tilemap->mark_tile_dirty(offset);
251251}
252252
r14899r14900
254254static TILE_GET_INFO( get_luckgrln_reel4_tile_info )
255255{
256256   luckgrln_state *state = machine.driver_data<luckgrln_state>();
257   int code = state->m_reel4_ram.target()[tile_index];
258   int attr = state->m_reel4_attr.target()[tile_index];
257   int code = state->m_reel4_ram[tile_index];
258   int attr = state->m_reel4_attr[tile_index];
259259   int col = (attr & 0x1f);
260260
261261   code |= (attr & 0xe0)<<3;
r14899r14900
300300
301301   for (i= 0;i < 64;i++)
302302   {
303      state->m_reel1_tilemap->set_scrolly(i, state->m_reel1_scroll.target()[i]);
304      state->m_reel2_tilemap->set_scrolly(i, state->m_reel2_scroll.target()[i]);
305      state->m_reel3_tilemap->set_scrolly(i, state->m_reel3_scroll.target()[i]);
306      state->m_reel4_tilemap->set_scrolly(i, state->m_reel4_scroll.target()[i]);
303      state->m_reel1_tilemap->set_scrolly(i, state->m_reel1_scroll[i]);
304      state->m_reel2_tilemap->set_scrolly(i, state->m_reel2_scroll[i]);
305      state->m_reel3_tilemap->set_scrolly(i, state->m_reel3_scroll[i]);
306      state->m_reel4_tilemap->set_scrolly(i, state->m_reel4_scroll[i]);
307307   }
308308
309309
r14899r14900
317317
318318      for (x=0;x<64;x++)
319319      {
320         UINT16 tile = (state->m_luck_vram1.target()[count] & 0xff);
321         UINT16 tile_high = (state->m_luck_vram2.target()[count]);
322         UINT16 tileattr = (state->m_luck_vram3.target()[count]);
320         UINT16 tile = (state->m_luck_vram1[count] & 0xff);
321         UINT16 tile_high = (state->m_luck_vram2[count]);
322         UINT16 tileattr = (state->m_luck_vram3[count]);
323323         UINT8 col = 0;
324324         UINT8 region = 0;
325325         UINT8 bgenable;
src/mame/drivers/sigmab98.c
r14899r14900
213213static void draw_sprites(running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect, int pri_mask)
214214{
215215   sigmab98_state *state = machine.driver_data<sigmab98_state>();
216   UINT8 *end      =   state->m_spriteram.target() - 0x10;
216   UINT8 *end      =   state->m_spriteram - 0x10;
217217   UINT8 *s      =   end + state->m_spriteram.bytes();
218218
219219   for ( ; s != end; s -= 0x10 )
r14899r14900
902902
903903      case 0x65:   // SPRITERAM
904904         if (offset < 0x1000)
905            return m_spriteram.target()[offset];
905            return m_spriteram[offset];
906906
907907      case 0x67:   // PALETTERAM + TABLE? + REGS
908908         if (offset < 0x200)
r14899r14900
923923      case 0x65:   // SPRITERAM
924924         if (offset < 0x1000)
925925         {
926            m_spriteram.target()[offset] = data;
926            m_spriteram[offset] = data;
927927            return;
928928         }
929929         break;
r14899r14900
10741074               break;
10751075
10761076            case 0x6c:   // 3800 IS RAM! (1000 bytes) - SPRITERAM
1077               memory_set_bankptr(machine(), "rombank0", m_spriteram.target());
1078               memory_set_bankptr(machine(), "sprbank0", m_spriteram.target());
1077               memory_set_bankptr(machine(), "rombank0", m_spriteram);
1078               memory_set_bankptr(machine(), "sprbank0", m_spriteram);
10791079//                  memory_set_bankptr(machine(), "sprbank1", m_spriteram + 0x1000*4);    // scratch
10801080               break;
10811081
r14899r14900
11391139         m_rambank = data;
11401140         switch (data)
11411141         {
1142            case 0x52:   memory_set_bankptr(machine(), "palbank", m_nvram.target());                           break;
1142            case 0x52:   memory_set_bankptr(machine(), "palbank", m_nvram);                           break;
11431143            case 0x64:   memory_set_bankptr(machine(), "palbank", m_generic_paletteram_8);   break;
11441144            default:
11451145               logerror("%s: unknown ram bank = %02x, reg2 = %02x\n", machine().describe_context(), data, m_reg2);
r14899r14900
11771177   }
11781178   else if (m_rambank == 0x52)
11791179   {
1180      m_nvram.target()[offset] = data;
1180      m_nvram[offset] = data;
11811181   }
11821182   else
11831183   {
r14899r14900
13781378
13791379      case 0x64:   // SPRITERAM
13801380         if (offset < 0x1000)
1381            return m_spriteram.target()[offset];
1381            return m_spriteram[offset];
13821382         break;
13831383
13841384      case 0x66:   // PALETTERAM + TABLE?
r14899r14900
14031403      case 0x64:   // SPRITERAM
14041404         if (offset < 0x1000)
14051405         {
1406            m_spriteram.target()[offset] = data;
1406            m_spriteram[offset] = data;
14071407            return;
14081408         }
14091409         break;
src/mame/drivers/popobear.c
r14899r14900
104104static void draw_layer(running_machine &machine, bitmap_ind16 &bitmap,const rectangle &cliprect, UINT8 layer_n)
105105{
106106   popobear_state *state = machine.driver_data<popobear_state>();
107   UINT8* vram = (UINT8 *)state->m_vram.target();
108   UINT16* vreg = (UINT16 *)state->m_vregs.target();
107   // ERROR: This cast is NOT endian-safe without the use of BYTE/WORD/DWORD_XOR_* macros!
108   UINT8* vram = reinterpret_cast<UINT8 *>(state->m_vram.target());
109   UINT16* vreg = (UINT16 *)state->m_vregs;
109110   int count;
110111   const UINT8 vreg_base[] = { 0x10/2, 0x14/2 };
111112   int xscroll,yscroll;
112113
113//  count = (state->m_vregs.target()[vreg_base[layer_n]]<<5);
114//  count = (state->m_vregs[vreg_base[layer_n]]<<5);
114115//  count &= 0xfc000;
115116   count = (0xf0000+layer_n*0x4000);
116117   if(layer_n & 2)
r14899r14900
177178static void draw_sprites(running_machine &machine, bitmap_ind16 &bitmap,const rectangle &cliprect)
178179{
179180   popobear_state *state = machine.driver_data<popobear_state>();
180   UINT8* vram = (UINT8 *)state->m_spr.target();
181   // ERROR: This cast is NOT endian-safe without the use of BYTE/WORD/DWORD_XOR_* macros!
182   UINT8* vram = reinterpret_cast<UINT8 *>(state->m_spr.target());
181183   int i;
182184   #if 0
183185   static int bank_test = 1;
r14899r14900
259261
260262   bitmap.fill(0, cliprect);
261263
262   //popmessage("%04x",state->m_vregs.target()[0/2]);
264   //popmessage("%04x",state->m_vregs[0/2]);
263265
264266   draw_layer(screen.machine(),bitmap,cliprect,3);
265267   draw_layer(screen.machine(),bitmap,cliprect,2);
src/mame/drivers/minivadr.c
r14899r14900
4242
4343      UINT8 x = offs << 3;
4444      int y = offs >> 5;
45      UINT8 data = state->m_videoram.target()[offs];
45      UINT8 data = state->m_videoram[offs];
4646
4747      for (i = 0; i < 8; i++)
4848      {
src/mame/drivers/quizshow.c
r14899r14900
8888static TILE_GET_INFO( get_tile_info )
8989{
9090   quizshow_state *state = machine.driver_data<quizshow_state>();
91   UINT8 code = state->m_main_ram.target()[tile_index];
91   UINT8 code = state->m_main_ram[tile_index];
9292
9393   // d6: blink, d7: invert
9494   UINT8 color = (code & (state->m_blink_state | 0x80)) >> 6;
r14899r14900
200200
201201WRITE8_MEMBER(quizshow_state::quizshow_main_ram_w)
202202{
203   m_main_ram.target()[offset]=data;
203   m_main_ram[offset]=data;
204204   m_tilemap->mark_tile_dirty(offset);
205205}
206206
src/mame/drivers/vegas.c
r14899r14900
546546   mips3drc_set_options(machine.device("maincpu"), MIPS3DRC_FASTEST_OPTIONS + MIPS3DRC_STRICT_VERIFY + MIPS3DRC_FLUSH_PC);
547547
548548   /* configure fast RAM regions for DRC */
549   mips3drc_add_fastram(machine.device("maincpu"), 0x00000000, state->m_rambase.bytes() - 1, FALSE, state->m_rambase.target());
550   mips3drc_add_fastram(machine.device("maincpu"), 0x1fc00000, 0x1fc7ffff, TRUE, state->m_rombase.target());
549   mips3drc_add_fastram(machine.device("maincpu"), 0x00000000, state->m_rambase.bytes() - 1, FALSE, state->m_rambase);
550   mips3drc_add_fastram(machine.device("maincpu"), 0x1fc00000, 0x1fc7ffff, TRUE, state->m_rombase);
551551
552552   /* register for save states */
553553   state_save_register_global(machine, state->m_nile_irq_state);
r14899r14900
845845static void update_nile_irqs(running_machine &machine)
846846{
847847   vegas_state *state = machine.driver_data<vegas_state>();
848   UINT32 intctll = state->m_nile_regs.target()[NREG_INTCTRL+0];
849   UINT32 intctlh = state->m_nile_regs.target()[NREG_INTCTRL+1];
848   UINT32 intctll = state->m_nile_regs[NREG_INTCTRL+0];
849   UINT32 intctlh = state->m_nile_regs[NREG_INTCTRL+1];
850850   UINT8 irq[6];
851851   int i;
852852
853853   /* check for UART transmit IRQ enable and synthsize one */
854   if (state->m_nile_regs.target()[NREG_UARTIER] & 2)
854   if (state->m_nile_regs[NREG_UARTIER] & 2)
855855      state->m_nile_irq_state |= 0x0010;
856856   else
857857      state->m_nile_irq_state &= ~0x0010;
858858
859859   irq[0] = irq[1] = irq[2] = irq[3] = irq[4] = irq[5] = 0;
860   state->m_nile_regs.target()[NREG_INTSTAT0+0] = 0;
861   state->m_nile_regs.target()[NREG_INTSTAT0+1] = 0;
862   state->m_nile_regs.target()[NREG_INTSTAT1+0] = 0;
863   state->m_nile_regs.target()[NREG_INTSTAT1+1] = 0;
860   state->m_nile_regs[NREG_INTSTAT0+0] = 0;
861   state->m_nile_regs[NREG_INTSTAT0+1] = 0;
862   state->m_nile_regs[NREG_INTSTAT1+0] = 0;
863   state->m_nile_regs[NREG_INTSTAT1+1] = 0;
864864
865865   /* handle the lower interrupts */
866866   for (i = 0; i < 8; i++)
r14899r14900
871871            if (vector < 6)
872872            {
873873               irq[vector] = 1;
874               state->m_nile_regs.target()[NREG_INTSTAT0 + vector/2] |= 1 << (i + 16*(vector&1));
874               state->m_nile_regs[NREG_INTSTAT0 + vector/2] |= 1 << (i + 16*(vector&1));
875875            }
876876         }
877877
r14899r14900
884884            if (vector < 6)
885885            {
886886               irq[vector] = 1;
887               state->m_nile_regs.target()[NREG_INTSTAT0 + vector/2] |= 1 << (i + 8 + 16*(vector&1));
887               state->m_nile_regs[NREG_INTSTAT0 + vector/2] |= 1 << (i + 8 + 16*(vector&1));
888888            }
889889         }
890890
r14899r14900
911911{
912912   vegas_state *state = machine.driver_data<vegas_state>();
913913   int which = param;
914   UINT32 *regs = &state->m_nile_regs.target()[NREG_T0CTRL + which * 4];
914   UINT32 *regs = &state->m_nile_regs[NREG_T0CTRL + which * 4];
915915   if (LOG_TIMERS) logerror("timer %d fired\n", which);
916916
917917   /* adjust the timer to fire again */
r14899r14900
943943static READ32_HANDLER( nile_r )
944944{
945945   vegas_state *state = space->machine().driver_data<vegas_state>();
946   UINT32 result = state->m_nile_regs.target()[offset];
946   UINT32 result = state->m_nile_regs[offset];
947947   int logit = 1, which;
948948
949949   switch (offset)
r14899r14900
10001000      case NREG_T2CNTR:      /* general purpose timer control (counter) */
10011001      case NREG_T3CNTR:      /* watchdog timer control (counter) */
10021002         which = (offset - NREG_T0CTRL) / 4;
1003         if (state->m_nile_regs.target()[offset - 1] & 1)
1003         if (state->m_nile_regs[offset - 1] & 1)
10041004         {
1005            if (state->m_nile_regs.target()[offset] & 2)
1005            if (state->m_nile_regs[offset] & 2)
10061006               logerror("Unexpected value: timer %d is prescaled\n", which);
1007            result = state->m_nile_regs.target()[offset + 1] = state->m_timer[which]->remaining().as_double() * (double)SYSTEM_CLOCK;
1007            result = state->m_nile_regs[offset + 1] = state->m_timer[which]->remaining().as_double() * (double)SYSTEM_CLOCK;
10081008         }
10091009
10101010         if (LOG_TIMERS) logerror("%08X:NILE READ: timer %d counter(%03X) = %08X\n", cpu_get_pc(&space->device()), which, offset*4, result);
r14899r14900
10121012         break;
10131013
10141014      case NREG_UARTIIR:         /* serial port interrupt ID */
1015         if (state->m_nile_regs.target()[NREG_UARTIER] & 2)
1015         if (state->m_nile_regs[NREG_UARTIER] & 2)
10161016            result = 0x02;         /* transmitter buffer IRQ pending */
10171017         else
10181018            result = 0x01;         /* no IRQ pending */
r14899r14900
10561056static WRITE32_HANDLER( nile_w )
10571057{
10581058   vegas_state *state = space->machine().driver_data<vegas_state>();
1059   UINT32 olddata = state->m_nile_regs.target()[offset];
1059   UINT32 olddata = state->m_nile_regs[offset];
10601060   int logit = 1, which;
10611061
1062   COMBINE_DATA(&state->m_nile_regs.target()[offset]);
1062   COMBINE_DATA(&state->m_nile_regs[offset]);
10631063
10641064   switch (offset)
10651065   {
r14899r14900
10941094      case NREG_INTCLR+1:      /* Interrupt clear */
10951095         if (LOG_NILE) logerror("%08X:NILE WRITE: interrupt clear(%03X) = %08X & %08X\n", cpu_get_pc(&space->device()), offset*4, data, mem_mask);
10961096         logit = 0;
1097         state->m_nile_irq_state &= ~(state->m_nile_regs.target()[offset] & ~0xf00);
1097         state->m_nile_irq_state &= ~(state->m_nile_regs[offset] & ~0xf00);
10981098         update_nile_irqs(space->machine());
10991099         break;
11001100
r14899r14900
11151115         break;
11161116
11171117      case NREG_PCIINIT1+0:   /* PCI master */
1118         if (((olddata & 0xe) == 0xa) != ((state->m_nile_regs.target()[offset] & 0xe) == 0xa))
1118         if (((olddata & 0xe) == 0xa) != ((state->m_nile_regs[offset] & 0xe) == 0xa))
11191119            remap_dynamic_addresses(space->machine());
11201120         logit = 0;
11211121         break;
r14899r14900
11291129         logit = 0;
11301130
11311131         /* timer just enabled? */
1132         if (!(olddata & 1) && (state->m_nile_regs.target()[offset] & 1))
1132         if (!(olddata & 1) && (state->m_nile_regs[offset] & 1))
11331133         {
1134            UINT32 scale = state->m_nile_regs.target()[offset + 1];
1135            if (state->m_nile_regs.target()[offset] & 2)
1134            UINT32 scale = state->m_nile_regs[offset + 1];
1135            if (state->m_nile_regs[offset] & 2)
11361136               logerror("Unexpected value: timer %d is prescaled\n", which);
11371137            if (scale != 0)
11381138               state->m_timer[which]->adjust(TIMER_PERIOD * scale, which);
1139            if (LOG_TIMERS) logerror("Starting timer %d at a rate of %d Hz\n", which, (int)ATTOSECONDS_TO_HZ((TIMER_PERIOD * (state->m_nile_regs.target()[offset + 1] + 1)).attoseconds));
1139            if (LOG_TIMERS) logerror("Starting timer %d at a rate of %d Hz\n", which, (int)ATTOSECONDS_TO_HZ((TIMER_PERIOD * (state->m_nile_regs[offset + 1] + 1)).attoseconds));
11401140         }
11411141
11421142         /* timer disabled? */
1143         else if ((olddata & 1) && !(state->m_nile_regs.target()[offset] & 1))
1143         else if ((olddata & 1) && !(state->m_nile_regs[offset] & 1))
11441144         {
1145            if (state->m_nile_regs.target()[offset] & 2)
1145            if (state->m_nile_regs[offset] & 2)
11461146               logerror("Unexpected value: timer %d is prescaled\n", which);
1147            state->m_nile_regs.target()[offset + 1] = state->m_timer[which]->remaining().as_double() * SYSTEM_CLOCK;
1147            state->m_nile_regs[offset + 1] = state->m_timer[which]->remaining().as_double() * SYSTEM_CLOCK;
11481148            state->m_timer[which]->adjust(attotime::never, which);
11491149         }
11501150         break;
r14899r14900
11571157         if (LOG_TIMERS) logerror("%08X:NILE WRITE: timer %d counter(%03X) = %08X & %08X\n", cpu_get_pc(&space->device()), which, offset*4, data, mem_mask);
11581158         logit = 0;
11591159
1160         if (state->m_nile_regs.target()[offset - 1] & 1)
1160         if (state->m_nile_regs[offset - 1] & 1)
11611161         {
1162            if (state->m_nile_regs.target()[offset - 1] & 2)
1162            if (state->m_nile_regs[offset - 1] & 2)
11631163               logerror("Unexpected value: timer %d is prescaled\n", which);
1164            state->m_timer[which]->adjust(TIMER_PERIOD * state->m_nile_regs.target()[offset], which);
1164            state->m_timer[which]->adjust(TIMER_PERIOD * state->m_nile_regs[offset], which);
11651165         }
11661166         break;
11671167
r14899r14900
15601560   state->m_dynamic_count = 0;
15611561
15621562   /* DCS2 */
1563   base = state->m_nile_regs.target()[NREG_DCS2] & 0x1fffff00;
1563   base = state->m_nile_regs[NREG_DCS2] & 0x1fffff00;
15641564   if (base >= state->m_rambase.bytes())
15651565   {
15661566      add_dynamic_address(state, base + 0x0000, base + 0x0003, sio_irq_clear_r, sio_irq_clear_w);
r14899r14900
15741574   }
15751575
15761576   /* DCS3 */
1577   base = state->m_nile_regs.target()[NREG_DCS3] & 0x1fffff00;
1577   base = state->m_nile_regs[NREG_DCS3] & 0x1fffff00;
15781578   if (base >= state->m_rambase.bytes())
15791579      add_dynamic_address(state, base + 0x0000, base + 0x0003, analog_port_r, analog_port_w);
15801580
15811581   /* DCS4 */
1582   base = state->m_nile_regs.target()[NREG_DCS4] & 0x1fffff00;
1582   base = state->m_nile_regs[NREG_DCS4] & 0x1fffff00;
15831583   if (base >= state->m_rambase.bytes())
15841584      add_dynamic_address(state, base + 0x0000, base + 0x7fff, timekeeper_r, timekeeper_w);
15851585
15861586   /* DCS5 */
1587   base = state->m_nile_regs.target()[NREG_DCS5] & 0x1fffff00;
1587   base = state->m_nile_regs[NREG_DCS5] & 0x1fffff00;
15881588   if (base >= state->m_rambase.bytes())
15891589      add_dynamic_address(state, base + 0x0000, base + 0x0003, sio_r, sio_w);
15901590
15911591   /* DCS6 */
1592   base = state->m_nile_regs.target()[NREG_DCS6] & 0x1fffff00;
1592   base = state->m_nile_regs[NREG_DCS6] & 0x1fffff00;
15931593   if (base >= state->m_rambase.bytes())
15941594   {
15951595      add_dynamic_address(state, base + 0x0000, base + 0x003f, midway_ioasic_packed_r, midway_ioasic_packed_w);
r14899r14900
16041604   }
16051605
16061606   /* DCS7 */
1607   base = state->m_nile_regs.target()[NREG_DCS7] & 0x1fffff00;
1607   base = state->m_nile_regs[NREG_DCS7] & 0x1fffff00;
16081608   if (base >= state->m_rambase.bytes())
16091609   {
16101610      add_dynamic_device_address(state, ethernet, base + 0x1000, base + 0x100f, ethernet_r, ethernet_w);
r14899r14900
16161616   }
16171617
16181618   /* PCI config space */
1619   if ((state->m_nile_regs.target()[NREG_PCIINIT1] & 0xe) == 0xa)
1619   if ((state->m_nile_regs[NREG_PCIINIT1] & 0xe) == 0xa)
16201620   {
1621      base = state->m_nile_regs.target()[NREG_PCIW1] & 0x1fffff00;
1621      base = state->m_nile_regs[NREG_PCIW1] & 0x1fffff00;
16221622      if (base >= state->m_rambase.bytes())
16231623      {
16241624         add_dynamic_address(state, base + (1 << (21 + 4)) + 0x0000, base + (1 << (21 + 4)) + 0x00ff, pci_3dfx_r, pci_3dfx_w);
src/mame/drivers/magictg.c
r14899r14900
242242      word |= adsp_boot[i*3 + 1] << 8;
243243      word |= adsp_boot[i*3 + 2];
244244
245      m_adsp_pram.target()[i] = word;
245      m_adsp_pram[i] = word;
246246   }
247247}
248248
src/mame/drivers/enigma2.c
r14899r14900
242242               and the adder at 16A is activated */
243243         if (state->m_flip_screen)  videoram_address = (~videoram_address + 0x0400) & 0x1fff;
244244
245         video_data = state->m_videoram.target()[videoram_address];
245         video_data = state->m_videoram[videoram_address];
246246
247247         fore_color = color_map_base[color_map_address] & 0x07;
248248         star_color = star_map_base[star_map_address] & 0x07;
r14899r14900
313313               and the adder at 16A is activated */
314314         if (state->m_flip_screen)  videoram_address = (~videoram_address + 0x0400) & 0x1fff;
315315
316         video_data = state->m_videoram.target()[videoram_address];
316         video_data = state->m_videoram[videoram_address];
317317      }
318318
319319      /* plot the current pixel */
src/mame/drivers/igspoker.c
r14899r14900
148148static TILE_GET_INFO( get_bg_tile_info )
149149{
150150   igspoker_state *state = machine.driver_data<igspoker_state>();
151   int code = state->m_bg_tile_ram.target()[tile_index];
151   int code = state->m_bg_tile_ram[tile_index];
152152   SET_TILE_INFO(1 + (tile_index & 3), code, 0, 0);
153153}
154154
155155static TILE_GET_INFO( get_fg_tile_info )
156156{
157157   igspoker_state *state = machine.driver_data<igspoker_state>();
158   int code = state->m_fg_tile_ram.target()[tile_index] | (state->m_fg_color_ram.target()[tile_index] << 8);
158   int code = state->m_fg_tile_ram[tile_index] | (state->m_fg_color_ram[tile_index] << 8);
159159   int tile = code & 0x1fff;
160160   SET_TILE_INFO(0, code, tile != 0x1fff ? ((code >> 12) & 0xe) + 1 : 0, 0);
161161}
162162
163163WRITE8_MEMBER(igspoker_state::bg_tile_w)
164164{
165   m_bg_tile_ram.target()[offset] = data;
165   m_bg_tile_ram[offset] = data;
166166   m_bg_tilemap->mark_tile_dirty(offset);
167167}
168168
169169WRITE8_MEMBER(igspoker_state::fg_tile_w)
170170{
171   m_fg_tile_ram.target()[offset] = data;
171   m_fg_tile_ram[offset] = data;
172172   m_fg_tilemap->mark_tile_dirty(offset);
173173}
174174
175175WRITE8_MEMBER(igspoker_state::fg_color_w)
176176{
177   m_fg_color_ram.target()[offset] = data;
177   m_fg_color_ram[offset] = data;
178178   m_fg_tilemap->mark_tile_dirty(offset);
179179}
180180
src/mame/drivers/koikoi.c
r14899r14900
7878static TILE_GET_INFO( get_tile_info )
7979{
8080   koikoi_state *state = machine.driver_data<koikoi_state>();
81   int code  = state->m_videoram.target()[tile_index] | ((state->m_videoram.target()[tile_index + 0x400] & 0x40) << 2);
82   int color = (state->m_videoram.target()[tile_index + 0x400] & 0x1f);
83   int flip  = (state->m_videoram.target()[tile_index + 0x400] & 0x80) ? (TILEMAP_FLIPX | TILEMAP_FLIPY) : 0;
81   int code  = state->m_videoram[tile_index] | ((state->m_videoram[tile_index + 0x400] & 0x40) << 2);
82   int color = (state->m_videoram[tile_index + 0x400] & 0x1f);
83   int flip  = (state->m_videoram[tile_index + 0x400] & 0x80) ? (TILEMAP_FLIPX | TILEMAP_FLIPY) : 0;
8484
8585   SET_TILE_INFO( 0, code, color, flip);
8686}
r14899r14900
151151
152152WRITE8_MEMBER(koikoi_state::vram_w)
153153{
154   m_videoram.target()[offset] = data;
154   m_videoram[offset] = data;
155155   m_tmap->mark_tile_dirty(offset & 0x3ff);
156156}
157157
src/mame/drivers/mil4000.c
r14899r14900
123123static TILE_GET_INFO( get_sc0_tile_info )
124124{
125125   mil4000_state *state = machine.driver_data<mil4000_state>();
126   UINT32 data = (state->m_sc0_vram.target()[tile_index*2]<<16) | state->m_sc0_vram.target()[tile_index*2+1];
126   UINT32 data = (state->m_sc0_vram[tile_index*2]<<16) | state->m_sc0_vram[tile_index*2+1];
127127   int tile = data >> 14;
128   int color = (state->m_sc0_vram.target()[tile_index*2+1] & 0x1f)+0;
128   int color = (state->m_sc0_vram[tile_index*2+1] & 0x1f)+0;
129129
130130   SET_TILE_INFO(
131131         0,
r14899r14900
137137static TILE_GET_INFO( get_sc1_tile_info )
138138{
139139   mil4000_state *state = machine.driver_data<mil4000_state>();
140   UINT32 data = (state->m_sc1_vram.target()[tile_index*2]<<16) | state->m_sc1_vram.target()[tile_index*2+1];
140   UINT32 data = (state->m_sc1_vram[tile_index*2]<<16) | state->m_sc1_vram[tile_index*2+1];
141141   int tile = data >> 14;
142   int color = (state->m_sc1_vram.target()[tile_index*2+1] & 0x1f)+0x10;
142   int color = (state->m_sc1_vram[tile_index*2+1] & 0x1f)+0x10;
143143
144144   SET_TILE_INFO(
145145         0,
r14899r14900
151151static TILE_GET_INFO( get_sc2_tile_info )
152152{
153153   mil4000_state *state = machine.driver_data<mil4000_state>();
154   UINT32 data = (state->m_sc2_vram.target()[tile_index*2]<<16) | state->m_sc2_vram.target()[tile_index*2+1];
154   UINT32 data = (state->m_sc2_vram[tile_index*2]<<16) | state->m_sc2_vram[tile_index*2+1];
155155   int tile = data >> 14;
156   int color = (state->m_sc2_vram.target()[tile_index*2+1] & 0x1f)+0x20;
156   int color = (state->m_sc2_vram[tile_index*2+1] & 0x1f)+0x20;
157157
158158   SET_TILE_INFO(
159159         0,
r14899r14900
165165static TILE_GET_INFO( get_sc3_tile_info )
166166{
167167   mil4000_state *state = machine.driver_data<mil4000_state>();
168   UINT32 data = (state->m_sc3_vram.target()[tile_index*2]<<16) | state->m_sc3_vram.target()[tile_index*2+1];
168   UINT32 data = (state->m_sc3_vram[tile_index*2]<<16) | state->m_sc3_vram[tile_index*2+1];
169169   int tile = data >> 14;
170   int color = (state->m_sc3_vram.target()[tile_index*2+1] & 0x1f)+0x30;
170   int color = (state->m_sc3_vram[tile_index*2+1] & 0x1f)+0x30;
171171
172172   SET_TILE_INFO(
173173         0,
r14899r14900
223223
224224WRITE16_MEMBER(mil4000_state::sc0_vram_w)
225225{
226   m_sc0_vram.target()[offset] = data;
226   m_sc0_vram[offset] = data;
227227   m_sc0_tilemap->mark_tile_dirty(offset/2);
228228}
229229
230230WRITE16_MEMBER(mil4000_state::sc1_vram_w)
231231{
232   m_sc1_vram.target()[offset] = data;
232   m_sc1_vram[offset] = data;
233233   m_sc1_tilemap->mark_tile_dirty(offset/2);
234234}
235235
236236WRITE16_MEMBER(mil4000_state::sc2_vram_w)
237237{
238   m_sc2_vram.target()[offset] = data;
238   m_sc2_vram[offset] = data;
239239   m_sc2_tilemap->mark_tile_dirty(offset/2);
240240}
241241
242242WRITE16_MEMBER(mil4000_state::sc3_vram_w)
243243{
244   m_sc3_vram.target()[offset] = data;
244   m_sc3_vram[offset] = data;
245245   m_sc3_tilemap->mark_tile_dirty(offset/2);
246246}
247247
src/mame/drivers/gticlub.c
r14899r14900
411411   ppcdrc_set_options(machine.device("maincpu"), PPCDRC_COMPATIBLE_OPTIONS);
412412
413413   /* configure fast RAM regions for DRC */
414   ppcdrc_add_fastram(machine.device("maincpu"), 0x00000000, 0x000fffff, FALSE, state->m_work_ram.target());
414   ppcdrc_add_fastram(machine.device("maincpu"), 0x00000000, 0x000fffff, FALSE, state->m_work_ram);
415415}
416416
417417static ADDRESS_MAP_START( gticlub_map, AS_PROGRAM, 32, gticlub_state )
src/mame/drivers/mazerbla.c
r14899r14900
395395   m_vcu_gfx_param_addr = offset;
396396
397397   /* offset  = 0 is not known */
398   m_xpos      = m_cfb_ram.target()[m_vcu_gfx_param_addr + 1] | (m_cfb_ram.target()[m_vcu_gfx_param_addr + 2]<<8);
399   m_ypos      = m_cfb_ram.target()[m_vcu_gfx_param_addr + 3] | (m_cfb_ram.target()[m_vcu_gfx_param_addr + 4]<<8);
400   m_color1    = m_cfb_ram.target()[m_vcu_gfx_param_addr + 5];
401   m_color2    = m_cfb_ram.target()[m_vcu_gfx_param_addr + 6];
402   m_mode      = m_cfb_ram.target()[m_vcu_gfx_param_addr + 7];
403   m_pix_xsize = m_cfb_ram.target()[m_vcu_gfx_param_addr + 8];
404   m_pix_ysize = m_cfb_ram.target()[m_vcu_gfx_param_addr + 9];
398   m_xpos      = m_cfb_ram[m_vcu_gfx_param_addr + 1] | (m_cfb_ram[m_vcu_gfx_param_addr + 2]<<8);
399   m_ypos      = m_cfb_ram[m_vcu_gfx_param_addr + 3] | (m_cfb_ram[m_vcu_gfx_param_addr + 4]<<8);
400   m_color1    = m_cfb_ram[m_vcu_gfx_param_addr + 5];
401   m_color2    = m_cfb_ram[m_vcu_gfx_param_addr + 6];
402   m_mode      = m_cfb_ram[m_vcu_gfx_param_addr + 7];
403   m_pix_xsize = m_cfb_ram[m_vcu_gfx_param_addr + 8];
404   m_pix_ysize = m_cfb_ram[m_vcu_gfx_param_addr + 9];
405405
406406   m_plane = m_mode & 3;
407407
r14899r14900
428428        logerror("paradr=");
429429        logerror("%3x ", m_vcu_gfx_param_addr );
430430
431        logerror("%02x ", m_cfb_ram.target()[vcu_gfx_param_addr + 0] );
431        logerror("%02x ", m_cfb_ram[vcu_gfx_param_addr + 0] );
432432        logerror("x=%04x ", m_xpos );                 //1,2
433433        logerror("y=%04x ", m_ypos );                 //3,4
434434        logerror("color1=%02x ", m_color1);             //5
r14899r14900
571571        logerror("paladr=");
572572        logerror("%3x ", m_vcu_gfx_param_addr );
573573
574        logerror("%02x ", m_cfb_ram.target()[m_vcu_gfx_param_addr + 0] );
574        logerror("%02x ", m_cfb_ram[m_vcu_gfx_param_addr + 0] );
575575        logerror("x=%04x ", m_xpos );                 //1,2
576576        logerror("y=%04x ", m_ypos );                 //3,4
577577        logerror("color1=%02x ", m_color1);             //5
r14899r14900
587587            logerror("%04x: ", offset + y * 16);
588588            for (x = 0; x < 16; x++)
589589            {
590                logerror("%02x ", m_cfb_ram.target()[offset + x + y * 16]);
590                logerror("%02x ", m_cfb_ram[offset + x + y * 16]);
591591            }
592592            logerror("\n");
593593        }
r14899r14900
664664            {
665665               for (x = 0; x < 16; x++)
666666               {
667                  UINT8 colour = m_cfb_ram.target()[offs + x + y * 16];
667                  UINT8 colour = m_cfb_ram[offs + x + y * 16];
668668
669669                  /* red component */
670670                  bit1 = (colour >> 7) & 0x01;
r14899r14900
699699            {
700700               for (x = 0; x < 16; x++)
701701               {
702                  UINT8 dat = m_cfb_ram.target()[offs + x + y * 16];
702                  UINT8 dat = m_cfb_ram[offs + x + y * 16];
703703                  m_lookup_ram[lookup_offs + x + y * 16] = dat;
704704               }
705705            }
r14899r14900
713713            {
714714               for (x = 0; x < 16; x++)
715715               {
716                  UINT8 dat = m_cfb_ram.target()[offs + x + y * 16];
716                  UINT8 dat = m_cfb_ram[offs + x + y * 16];
717717                  m_lookup_ram[lookup_offs + x + y * 16] = dat;
718718               }
719719            }
r14899r14900
727727            {
728728               for (x = 0; x < 16; x++)
729729               {
730                  UINT8 dat = m_cfb_ram.target()[offs + x + y * 16];
730                  UINT8 dat = m_cfb_ram[offs + x + y * 16];
731731                  m_lookup_ram[lookup_offs + x + y * 16] = dat;
732732               }
733733            }
src/mame/drivers/acefruit.c
r14899r14900
4949   for( col = 0; col < 32; col++ )
5050   {
5151      int tile_index = ( col * 32 ) + row;
52      int color = state->m_colorram.target()[ tile_index ];
52      int color = state->m_colorram[ tile_index ];
5353
5454      switch( color )
5555      {
r14899r14900
104104      for( col = 0; col < 32; col++ )
105105      {
106106         int tile_index = ( col * 32 ) + row;
107         int code = state->m_videoram.target()[ tile_index ];
108         int color = state->m_colorram.target()[ tile_index ];
107         int code = state->m_videoram[ tile_index ];
108         int color = state->m_colorram[ tile_index ];
109109
110110         if( color < 0x4 )
111111         {
r14899r14900
121121
122122            for( x = 0; x < 16; x++ )
123123            {
124               int sprite = ( state->m_spriteram.target()[ ( spriteindex / 64 ) % 6 ] & 0xf ) ^ 0xf;
124               int sprite = ( state->m_spriteram[ ( spriteindex / 64 ) % 6 ] & 0xf ) ^ 0xf;
125125               const UINT8 *gfxdata = gfx_element_get_data(gfx, sprite);
126126
127127               for( y = 0; y < 8; y++ )
r14899r14900
228228
229229WRITE8_MEMBER(acefruit_state::acefruit_colorram_w)
230230{
231   m_colorram.target()[ offset ] = data & 0xf;
231   m_colorram[ offset ] = data & 0xf;
232232}
233233
234234WRITE8_MEMBER(acefruit_state::acefruit_coin_w)
src/mame/drivers/goldstar.c
r14899r14900
405405static ADDRESS_MAP_START(magodds_map, AS_PROGRAM, 8, goldstar_state )
406406   AM_RANGE(0x0000, 0x7fff) AM_ROM
407407   // where does the extra rom data map?? it seems like it should come straight after the existing rom, but it can't if this is a plain z80?
408   AM_RANGE(0x8000, 0x87ff) AM_RAM AM_SHARE("share1") AM_SHARE("nvram")
408   AM_RANGE(0x8000, 0x87ff) AM_RAM AM_SHARE("nvram")
409409   AM_RANGE(0x8800, 0x8fff) AM_RAM_WRITE(goldstar_fg_vidram_w) AM_BASE(m_fg_vidram)
410410   AM_RANGE(0x9000, 0x97ff) AM_RAM_WRITE(goldstar_fg_atrram_w) AM_BASE(m_fg_atrram)
411411   AM_RANGE(0x9800, 0x99ff) AM_RAM_WRITE(goldstar_reel1_ram_w) AM_BASE(m_reel1_ram)
src/mame/drivers/skylncr.c
r14899r14900
110110
111111WRITE8_MEMBER(skylncr_state::skylncr_videoram_w)
112112{
113   m_videoram.target()[offset] = data;
113   m_videoram[offset] = data;
114114   m_tmap->mark_tile_dirty(offset);
115115}
116116
117117WRITE8_MEMBER(skylncr_state::skylncr_colorram_w)
118118{
119   m_colorram.target()[offset] = data;
119   m_colorram[offset] = data;
120120   m_tmap->mark_tile_dirty(offset);
121121}
122122
r14899r14900
124124static TILE_GET_INFO( get_tile_info )
125125{
126126   skylncr_state *state = machine.driver_data<skylncr_state>();
127   UINT16 code = state->m_videoram.target()[ tile_index ] + (state->m_colorram.target()[ tile_index ] << 8);
127   UINT16 code = state->m_videoram[ tile_index ] + (state->m_colorram[ tile_index ] << 8);
128128   SET_TILE_INFO(0, code, 0, TILE_FLIPYX( 0 ));
129129}
130130
131131static TILE_GET_INFO( get_reel_1_tile_info )
132132{
133133   skylncr_state *state = machine.driver_data<skylncr_state>();
134   UINT16 code = state->m_reeltiles_1_ram.target()[ tile_index ] + (state->m_reeltileshigh_1_ram.target()[ tile_index ] << 8);
134   UINT16 code = state->m_reeltiles_1_ram[ tile_index ] + (state->m_reeltileshigh_1_ram[ tile_index ] << 8);
135135   SET_TILE_INFO(1, code, 0, TILE_FLIPYX( 0 ));
136136}
137137
138138static TILE_GET_INFO( get_reel_2_tile_info )
139139{
140140   skylncr_state *state = machine.driver_data<skylncr_state>();
141   UINT16 code = state->m_reeltiles_2_ram.target()[ tile_index ] + (state->m_reeltileshigh_2_ram.target()[ tile_index ] << 8);
141   UINT16 code = state->m_reeltiles_2_ram[ tile_index ] + (state->m_reeltileshigh_2_ram[ tile_index ] << 8);
142142   SET_TILE_INFO(1, code, 0, TILE_FLIPYX( 0 ));
143143}
144144
145145static TILE_GET_INFO( get_reel_3_tile_info )
146146{
147147   skylncr_state *state = machine.driver_data<skylncr_state>();
148   UINT16 code = state->m_reeltiles_3_ram.target()[ tile_index ] + (state->m_reeltileshigh_3_ram.target()[ tile_index ] << 8);
148   UINT16 code = state->m_reeltiles_3_ram[ tile_index ] + (state->m_reeltileshigh_3_ram[ tile_index ] << 8);
149149   SET_TILE_INFO(1, code, 0, TILE_FLIPYX( 0 ));
150150}
151151
152152static TILE_GET_INFO( get_reel_4_tile_info )
153153{
154154   skylncr_state *state = machine.driver_data<skylncr_state>();
155   UINT16 code = state->m_reeltiles_4_ram.target()[ tile_index ] + (state->m_reeltileshigh_4_ram.target()[ tile_index ] << 8);
155   UINT16 code = state->m_reeltiles_4_ram[ tile_index ] + (state->m_reeltileshigh_4_ram[ tile_index ] << 8);
156156   SET_TILE_INFO(1, code, 0, TILE_FLIPYX( 0 ));
157157}
158158
r14899r14900
196196
197197   for (i= 0;i < 64;i++)
198198   {
199      state->m_reel_2_tilemap->set_scrolly(i, state->m_reelscroll2.target()[i]);
200      state->m_reel_3_tilemap->set_scrolly(i, state->m_reelscroll3.target()[i]);
201      state->m_reel_4_tilemap->set_scrolly(i, state->m_reelscroll4.target()[i]);
199      state->m_reel_2_tilemap->set_scrolly(i, state->m_reelscroll2[i]);
200      state->m_reel_3_tilemap->set_scrolly(i, state->m_reelscroll3[i]);
201      state->m_reel_4_tilemap->set_scrolly(i, state->m_reelscroll4[i]);
202202   }
203203
204204   state->m_reel_2_tilemap->draw(bitmap, visible1, 0, 0);
r14899r14900
212212
213213WRITE8_MEMBER(skylncr_state::reeltiles_1_w)
214214{
215   m_reeltiles_1_ram.target()[offset] = data;
215   m_reeltiles_1_ram[offset] = data;
216216   m_reel_1_tilemap->mark_tile_dirty(offset);
217217}
218218
219219WRITE8_MEMBER(skylncr_state::reeltiles_2_w)
220220{
221   m_reeltiles_2_ram.target()[offset] = data;
221   m_reeltiles_2_ram[offset] = data;
222222   m_reel_2_tilemap->mark_tile_dirty(offset);
223223}
224224
225225WRITE8_MEMBER(skylncr_state::reeltiles_3_w)
226226{
227   m_reeltiles_3_ram.target()[offset] = data;
227   m_reeltiles_3_ram[offset] = data;
228228   m_reel_3_tilemap->mark_tile_dirty(offset);
229229}
230230
231231WRITE8_MEMBER(skylncr_state::reeltiles_4_w)
232232{
233   m_reeltiles_4_ram.target()[offset] = data;
233   m_reeltiles_4_ram[offset] = data;
234234   m_reel_4_tilemap->mark_tile_dirty(offset);
235235}
236236
237237WRITE8_MEMBER(skylncr_state::reeltileshigh_1_w)
238238{
239   m_reeltileshigh_1_ram.target()[offset] = data;
239   m_reeltileshigh_1_ram[offset] = data;
240240   m_reel_1_tilemap->mark_tile_dirty(offset);
241241}
242242
243243WRITE8_MEMBER(skylncr_state::reeltileshigh_2_w)
244244{
245   m_reeltileshigh_2_ram.target()[offset] = data;
245   m_reeltileshigh_2_ram[offset] = data;
246246   m_reel_2_tilemap->mark_tile_dirty(offset);
247247}
248248
249249WRITE8_MEMBER(skylncr_state::reeltileshigh_3_w)
250250{
251   m_reeltileshigh_3_ram.target()[offset] = data;
251   m_reeltileshigh_3_ram[offset] = data;
252252   m_reel_3_tilemap->mark_tile_dirty(offset);
253253}
254254
255255WRITE8_MEMBER(skylncr_state::reeltileshigh_4_w)
256256{
257   m_reeltileshigh_4_ram.target()[offset] = data;
257   m_reeltileshigh_4_ram[offset] = data;
258258   m_reel_4_tilemap->mark_tile_dirty(offset);
259259}
260260
r14899r14900
309309
310310WRITE8_MEMBER(skylncr_state::reelscroll1_w)
311311{
312   m_reelscroll1.target()[offset] = data;
312   m_reelscroll1[offset] = data;
313313}
314314
315315WRITE8_MEMBER(skylncr_state::reelscroll2_w)
316316{
317   m_reelscroll2.target()[offset] = data;
317   m_reelscroll2[offset] = data;
318318}
319319
320320WRITE8_MEMBER(skylncr_state::reelscroll3_w)
321321{
322   m_reelscroll3.target()[offset] = data;
322   m_reelscroll3[offset] = data;
323323}
324324
325325WRITE8_MEMBER(skylncr_state::reelscroll4_w)
326326{
327   m_reelscroll4.target()[offset] = data;
327   m_reelscroll4[offset] = data;
328328}
329329
330330
src/mame/drivers/nyny.c
r14899r14900
327327      if (state->m_flipscreen)
328328         offs = offs ^ 0x9fff;
329329
330      data1 = state->m_videoram1.target()[offs];
331      data2 = state->m_videoram2.target()[offs];
332      color1 = state->m_colorram1.target()[offs] & 0x07;
333      color2 = state->m_colorram2.target()[offs] & 0x07;
330      data1 = state->m_videoram1[offs];
331      data2 = state->m_videoram2[offs];
332      color1 = state->m_colorram1[offs] & 0x07;
333      color2 = state->m_colorram2[offs] & 0x07;
334334
335335      for (i = 0; i < 8; i++)
336336      {
src/mame/drivers/limenko.c
r14899r14900
107107
108108WRITE32_MEMBER(limenko_state::bg_videoram_w)
109109{
110   COMBINE_DATA(&m_bg_videoram.target()[offset]);
110   COMBINE_DATA(&m_bg_videoram[offset]);
111111   m_bg_tilemap->mark_tile_dirty(offset);
112112}
113113
114114WRITE32_MEMBER(limenko_state::md_videoram_w)
115115{
116   COMBINE_DATA(&m_md_videoram.target()[offset]);
116   COMBINE_DATA(&m_md_videoram[offset]);
117117   m_md_tilemap->mark_tile_dirty(offset);
118118}
119119
120120WRITE32_MEMBER(limenko_state::fg_videoram_w)
121121{
122   COMBINE_DATA(&m_fg_videoram.target()[offset]);
122   COMBINE_DATA(&m_fg_videoram[offset]);
123123   m_fg_tilemap->mark_tile_dirty(offset);
124124}
125125
r14899r14900
155155   }
156156
157157   // buffer the next number of sprites to draw
158   m_prev_sprites_count = (m_videoreg.target()[0] & 0x1ff0000) >> 16;
158   m_prev_sprites_count = (m_videoreg[0] & 0x1ff0000) >> 16;
159159}
160160
161161/*****************************************************************************************************
r14899r14900
245245static TILE_GET_INFO( get_bg_tile_info )
246246{
247247   limenko_state *state = machine.driver_data<limenko_state>();
248   int tile  = state->m_bg_videoram.target()[tile_index] & 0x7ffff;
249   int color = (state->m_bg_videoram.target()[tile_index]>>28) & 0xf;
248   int tile  = state->m_bg_videoram[tile_index] & 0x7ffff;
249   int color = (state->m_bg_videoram[tile_index]>>28) & 0xf;
250250   SET_TILE_INFO(0,tile,color,0);
251251}
252252
253253static TILE_GET_INFO( get_md_tile_info )
254254{
255255   limenko_state *state = machine.driver_data<limenko_state>();
256   int tile  = state->m_md_videoram.target()[tile_index] & 0x7ffff;
257   int color = (state->m_md_videoram.target()[tile_index]>>28) & 0xf;
256   int tile  = state->m_md_videoram[tile_index] & 0x7ffff;
257   int color = (state->m_md_videoram[tile_index]>>28) & 0xf;
258258   SET_TILE_INFO(0,tile,color,0);
259259}
260260
261261static TILE_GET_INFO( get_fg_tile_info )
262262{
263263   limenko_state *state = machine.driver_data<limenko_state>();
264   int tile  = state->m_fg_videoram.target()[tile_index] & 0x7ffff;
265   int color = (state->m_fg_videoram.target()[tile_index]>>28) & 0xf;
264   int tile  = state->m_fg_videoram[tile_index] & 0x7ffff;
265   int color = (state->m_fg_videoram[tile_index]>>28) & 0xf;
266266   SET_TILE_INFO(0,tile,color,0);
267267}
268268
r14899r14900
465465static SCREEN_UPDATE_IND16( limenko )
466466{
467467   limenko_state *state = screen.machine().driver_data<limenko_state>();
468   // state->m_videoreg.target()[4] ???? It always has this value: 0xffeffff8 (2 signed bytes? values: -17 and -8 ?)
468   // state->m_videoreg[4] ???? It always has this value: 0xffeffff8 (2 signed bytes? values: -17 and -8 ?)
469469
470470   screen.machine().priority_bitmap.fill(0, cliprect);
471471
472   state->m_bg_tilemap->enable(state->m_videoreg.target()[0] & 4);
473   state->m_md_tilemap->enable(state->m_videoreg.target()[0] & 2);
474   state->m_fg_tilemap->enable(state->m_videoreg.target()[0] & 1);
472   state->m_bg_tilemap->enable(state->m_videoreg[0] & 4);
473   state->m_md_tilemap->enable(state->m_videoreg[0] & 2);
474   state->m_fg_tilemap->enable(state->m_videoreg[0] & 1);
475475
476   state->m_bg_tilemap->set_scrolly(0, state->m_videoreg.target()[3] & 0xffff);
477   state->m_md_tilemap->set_scrolly(0, state->m_videoreg.target()[2] & 0xffff);
478   state->m_fg_tilemap->set_scrolly(0, state->m_videoreg.target()[1] & 0xffff);
476   state->m_bg_tilemap->set_scrolly(0, state->m_videoreg[3] & 0xffff);
477   state->m_md_tilemap->set_scrolly(0, state->m_videoreg[2] & 0xffff);
478   state->m_fg_tilemap->set_scrolly(0, state->m_videoreg[1] & 0xffff);
479479
480   state->m_bg_tilemap->set_scrollx(0, (state->m_videoreg.target()[3] & 0xffff0000) >> 16);
481   state->m_md_tilemap->set_scrollx(0, (state->m_videoreg.target()[2] & 0xffff0000) >> 16);
482   state->m_fg_tilemap->set_scrollx(0, (state->m_videoreg.target()[1] & 0xffff0000) >> 16);
480   state->m_bg_tilemap->set_scrollx(0, (state->m_videoreg[3] & 0xffff0000) >> 16);
481   state->m_md_tilemap->set_scrollx(0, (state->m_videoreg[2] & 0xffff0000) >> 16);
482   state->m_fg_tilemap->set_scrollx(0, (state->m_videoreg[1] & 0xffff0000) >> 16);
483483
484484   state->m_bg_tilemap->draw(bitmap, cliprect, 0,0);
485485   state->m_md_tilemap->draw(bitmap, cliprect, 0,0);
486486   state->m_fg_tilemap->draw(bitmap, cliprect, 0,1);
487487
488   if(state->m_videoreg.target()[0] & 8)
488   if(state->m_videoreg[0] & 8)
489489      copy_sprites(screen.machine(), bitmap, state->m_sprites_bitmap, screen.machine().priority_bitmap, cliprect);
490490
491491   return 0;
r14899r14900
10061006      machine().firstcpu->eat_cycles(50);
10071007   }
10081008
1009   return m_mainram.target()[0xe2784/4];
1009   return m_mainram[0xe2784/4];
10101010}
10111011
10121012READ32_MEMBER(limenko_state::legendoh_speedup_r)
r14899r14900
10161016      machine().firstcpu->eat_cycles(50);
10171017   }
10181018
1019   return m_mainram.target()[0x32ab0/4];
1019   return m_mainram[0x32ab0/4];
10201020}
10211021
10221022READ32_MEMBER(limenko_state::sb2003_speedup_r)
r14899r14900
10261026      machine().firstcpu->eat_cycles(50);
10271027   }
10281028
1029   return m_mainram.target()[0x135800/4];
1029   return m_mainram[0x135800/4];
10301030}
10311031
10321032READ32_MEMBER(limenko_state::spotty_speedup_r)
r14899r14900
10361036      machine().firstcpu->eat_cycles(50);
10371037   }
10381038
1039   return m_mainram.target()[0x6626c/4];
1039   return m_mainram[0x6626c/4];
10401040}
10411041
10421042static DRIVER_INIT( dynabomb )
src/mame/drivers/poo.c
r14899r14900
8686   {
8787      for (y=0;y<32;y++)
8888      {
89         int tile = state->m_vram.target()[count+0x000] | ((state->m_vram.target()[count+0x400] & 3) <<8);
90         int color = (state->m_vram.target()[count+0x400] & 0x38) >> 3;
91         int scrolly = (state->m_scrolly.target()[x*4]);
89         int tile = state->m_vram[count+0x000] | ((state->m_vram[count+0x400] & 3) <<8);
90         int color = (state->m_vram[count+0x400] & 0x38) >> 3;
91         int scrolly = (state->m_scrolly[x*4]);
9292
9393         drawgfx_opaque(bitmap,cliprect,gfx,tile,color+state->m_vram_colbank,0,0,x*8,256-(y*8)+scrolly);
9494         drawgfx_opaque(bitmap,cliprect,gfx,tile,color+state->m_vram_colbank,0,0,x*8,0-(y*8)+scrolly);
r14899r14900
102102
103103      for(i=0;i<0x80;i+=4)
104104      {
105         spr_offs = state->m_sprites.target()[i+2] | (state->m_sprites.target()[i+3] & 3) << 8;
106         y = state->m_sprites.target()[i+0]+8;
107         x = state->m_sprites.target()[i+1];
108         col = (state->m_sprites.target()[i+3] & 0xf8) >> 3;
105         spr_offs = state->m_sprites[i+2] | (state->m_sprites[i+3] & 3) << 8;
106         y = state->m_sprites[i+0]+8;
107         x = state->m_sprites[i+1];
108         col = (state->m_sprites[i+3] & 0xf8) >> 3;
109109         fx = 0;
110110         fy = 0;
111111
src/mame/drivers/drtomy.c
r14899r14900
4141static TILE_GET_INFO( get_tile_info_fg )
4242{
4343   drtomy_state *state = machine.driver_data<drtomy_state>();
44   int code  = state->m_videoram_fg.target()[tile_index] & 0xfff;
45   int color = (state->m_videoram_fg.target()[tile_index] & 0xf000) >> 12;
44   int code  = state->m_videoram_fg[tile_index] & 0xfff;
45   int color = (state->m_videoram_fg[tile_index] & 0xf000) >> 12;
4646   SET_TILE_INFO(2, code, color, 0);
4747}
4848
r14899r14900
5050static TILE_GET_INFO( get_tile_info_bg )
5151{
5252   drtomy_state *state = machine.driver_data<drtomy_state>();
53   int code  = state->m_videoram_bg.target()[tile_index] & 0xfff;
54   int color = (state->m_videoram_bg.target()[tile_index] & 0xf000) >> 12;
53   int code  = state->m_videoram_bg[tile_index] & 0xfff;
54   int color = (state->m_videoram_bg[tile_index] & 0xf000) >> 12;
5555   SET_TILE_INFO(1, code, color, 0);
5656}
5757
r14899r14900
8484
8585   for (i = 3; i < 0x1000 / 2; i += 4)
8686   {
87      int sx = state->m_spriteram.target()[i + 2] & 0x01ff;
88      int sy = (240 - (state->m_spriteram.target()[i] & 0x00ff)) & 0x00ff;
89      int number = state->m_spriteram.target()[i + 3];
90      int color = (state->m_spriteram.target()[i + 2] & 0x1e00) >> 9;
91      int attr = (state->m_spriteram.target()[i] & 0xfe00) >> 9;
87      int sx = state->m_spriteram[i + 2] & 0x01ff;
88      int sy = (240 - (state->m_spriteram[i] & 0x00ff)) & 0x00ff;
89      int number = state->m_spriteram[i + 3];
90      int color = (state->m_spriteram[i + 2] & 0x1e00) >> 9;
91      int attr = (state->m_spriteram[i] & 0xfe00) >> 9;
9292
9393      int xflip = attr & 0x20;
9494      int yflip = attr & 0x40;
r14899r14900
140140
141141WRITE16_MEMBER(drtomy_state::drtomy_vram_fg_w)
142142{
143   COMBINE_DATA(&m_videoram_fg.target()[offset]);
143   COMBINE_DATA(&m_videoram_fg[offset]);
144144   m_tilemap_fg->mark_tile_dirty(offset);
145145}
146146
147147WRITE16_MEMBER(drtomy_state::drtomy_vram_bg_w)
148148{
149   COMBINE_DATA(&m_videoram_bg.target()[offset]);
149   COMBINE_DATA(&m_videoram_bg[offset]);
150150   m_tilemap_bg->mark_tile_dirty(offset);
151151}
152152
src/mame/drivers/calorie.c
r14899r14900
129129static TILE_GET_INFO( get_fg_tile_info )
130130{
131131   calorie_state *state = machine.driver_data<calorie_state>();
132   int code  = ((state->m_fg_ram.target()[tile_index + 0x400] & 0x30) << 4) | state->m_fg_ram.target()[tile_index];
133   int color = state->m_fg_ram.target()[tile_index + 0x400] & 0x0f;
132   int code  = ((state->m_fg_ram[tile_index + 0x400] & 0x30) << 4) | state->m_fg_ram[tile_index];
133   int color = state->m_fg_ram[tile_index + 0x400] & 0x0f;
134134
135   SET_TILE_INFO(0, code, color, TILE_FLIPYX((state->m_fg_ram.target()[tile_index + 0x400] & 0xc0) >> 6));
135   SET_TILE_INFO(0, code, color, TILE_FLIPYX((state->m_fg_ram[tile_index + 0x400] & 0xc0) >> 6));
136136}
137137
138138
r14899r14900
166166   {
167167      int xpos, ypos, tileno, color, flipx, flipy;
168168
169      tileno = state->m_sprites.target()[x + 0];
170      color = state->m_sprites.target()[x + 1] & 0x0f;
171      flipx = state->m_sprites.target()[x + 1] & 0x40;
169      tileno = state->m_sprites[x + 0];
170      color = state->m_sprites[x + 1] & 0x0f;
171      flipx = state->m_sprites[x + 1] & 0x40;
172172      flipy = 0;
173      ypos = 0xff - state->m_sprites.target()[x + 2];
174      xpos = state->m_sprites.target()[x + 3];
173      ypos = 0xff - state->m_sprites[x + 2];
174      xpos = state->m_sprites[x + 3];
175175
176176      if (state->flip_screen())
177177      {
178         if (state->m_sprites.target()[x + 1] & 0x10)
178         if (state->m_sprites[x + 1] & 0x10)
179179            ypos = 0xff - ypos + 32;
180180         else
181181            ypos = 0xff - ypos + 16;
r14899r14900
185185         flipy = !flipy;
186186      }
187187
188      if (state->m_sprites.target()[x + 1] & 0x10)
188      if (state->m_sprites[x + 1] & 0x10)
189189      {
190190          /* 32x32 sprites */
191191         drawgfx_transpen(bitmap, cliprect, screen.machine().gfx[3], tileno | 0x40, color, flipx, flipy, xpos, ypos - 31, 0);
r14899r14900
207207
208208WRITE8_MEMBER(calorie_state::fg_ram_w)
209209{
210   m_fg_ram.target()[offset] = data;
210   m_fg_ram[offset] = data;
211211   m_fg_tilemap->mark_tile_dirty(offset & 0x3ff);
212212}
213213
src/mame/drivers/bmcbowl.c
r14899r14900
154154   {
155155      for (x=0;x<280;x+=2)
156156      {
157         pixdat = state->m_vid2.target()[0x8000+z];
157         pixdat = state->m_vid2[0x8000+z];
158158
159159         if(pixdat&0xff)
160160            bitmap.pix16(y, x+1) = (pixdat&0xff);
161161         if(pixdat>>8)
162162            bitmap.pix16(y, x) = (pixdat>>8);
163163
164         pixdat = state->m_vid2.target()[z];
164         pixdat = state->m_vid2[z];
165165
166166         if(pixdat&0xff)
167167            bitmap.pix16(y, x+1) = (pixdat&0xff);
168168         if(pixdat>>8)
169169            bitmap.pix16(y, x) = (pixdat>>8);
170170
171         pixdat = state->m_vid1.target()[0x8000+z];
171         pixdat = state->m_vid1[0x8000+z];
172172
173173         if(pixdat&0xff)
174174            bitmap.pix16(y, x+1) = (pixdat&0xff);
175175         if(pixdat>>8)
176176            bitmap.pix16(y, x) = (pixdat>>8);
177177
178         pixdat = state->m_vid1.target()[z];
178         pixdat = state->m_vid1[z];
179179
180180         if(pixdat&0xff)
181181            bitmap.pix16(y, x+1) = (pixdat&0xff);
r14899r14900
297297{
298298   int i;
299299   for (i=0; i<table_len; i++)
300      state->m_stats_ram.target()[address+2*i]=table[i];
300      state->m_stats_ram[address+2*i]=table[i];
301301}
302302#endif
303303
r14899r14900
312312
313313#ifdef NVRAM_HACK
314314   for (i = 0; i < state->m_stats_ram.bytes(); i++)
315      state->m_stats_ram.target()[i] = 0xff;
315      state->m_stats_ram[i] = 0xff;
316316
317317   init_stats(state,bmc_nv1,ARRAY_LENGTH(bmc_nv1),0);
318318   init_stats(state,bmc_nv2,ARRAY_LENGTH(bmc_nv2),0x3b0);
r14899r14900
323323   else
324324
325325      for (i = 0; i < state->m_stats_ram.bytes(); i++)
326         state->m_stats_ram.target()[i] = 0xff;
326         state->m_stats_ram[i] = 0xff;
327327#endif
328328
329329}
src/mame/drivers/magic10.c
r14899r14900
121121
122122WRITE16_MEMBER(magic10_state::layer0_videoram_w)
123123{
124   COMBINE_DATA(&m_layer0_videoram.target()[offset]);
124   COMBINE_DATA(&m_layer0_videoram[offset]);
125125   m_layer0_tilemap->mark_tile_dirty(offset >> 1);
126126}
127127
128128WRITE16_MEMBER(magic10_state::layer1_videoram_w)
129129{
130   COMBINE_DATA(&m_layer1_videoram.target()[offset]);
130   COMBINE_DATA(&m_layer1_videoram[offset]);
131131   m_layer1_tilemap->mark_tile_dirty(offset >> 1);
132132}
133133
134134WRITE16_MEMBER(magic10_state::layer2_videoram_w)
135135{
136   COMBINE_DATA(&m_layer2_videoram.target()[offset]);
136   COMBINE_DATA(&m_layer2_videoram[offset]);
137137   m_layer2_tilemap->mark_tile_dirty(offset >> 1);
138138}
139139
r14899r14900
150150   SET_TILE_INFO
151151   (
152152      1,
153      state->m_layer0_videoram.target()[tile_index * 2],
154      state->m_layer0_videoram.target()[tile_index * 2 + 1] & 0x0f,
155      TILE_FLIPYX((state->m_layer0_videoram.target()[tile_index * 2 + 1] & 0xc0) >> 6)
153      state->m_layer0_videoram[tile_index * 2],
154      state->m_layer0_videoram[tile_index * 2 + 1] & 0x0f,
155      TILE_FLIPYX((state->m_layer0_videoram[tile_index * 2 + 1] & 0xc0) >> 6)
156156   );
157157}
158158
r14899r14900
162162   SET_TILE_INFO
163163   (
164164      1,
165      state->m_layer1_videoram.target()[tile_index * 2],
166      state->m_layer1_videoram.target()[tile_index * 2 + 1] & 0x0f,
167      TILE_FLIPYX((state->m_layer1_videoram.target()[tile_index * 2 + 1] & 0xc0) >> 6)
165      state->m_layer1_videoram[tile_index * 2],
166      state->m_layer1_videoram[tile_index * 2 + 1] & 0x0f,
167      TILE_FLIPYX((state->m_layer1_videoram[tile_index * 2 + 1] & 0xc0) >> 6)
168168   );
169169}
170170
r14899r14900
174174   SET_TILE_INFO
175175   (
176176      0,
177      state->m_layer2_videoram.target()[tile_index * 2],
178      state->m_layer2_videoram.target()[tile_index * 2 + 1] & 0x0f,
177      state->m_layer2_videoram[tile_index * 2],
178      state->m_layer2_videoram[tile_index * 2 + 1] & 0x0f,
179179      0
180180   );
181181}
r14899r14900
203203    4 and 6 are y/x global register writes.
204204    0 and 2 are y/x writes for the scrolling layer.
205205    */
206   state->m_layer1_tilemap->set_scrolly(0, (state->m_vregs.target()[0/2] - state->m_vregs.target()[4/2])+0);
207   state->m_layer1_tilemap->set_scrollx(0, (state->m_vregs.target()[2/2] - state->m_vregs.target()[6/2])+4);
206   state->m_layer1_tilemap->set_scrolly(0, (state->m_vregs[0/2] - state->m_vregs[4/2])+0);
207   state->m_layer1_tilemap->set_scrollx(0, (state->m_vregs[2/2] - state->m_vregs[6/2])+4);
208208
209209   state->m_layer0_tilemap->draw(bitmap, cliprect, 0, 0);
210210   state->m_layer1_tilemap->draw(bitmap, cliprect, 0, 0);
src/mame/drivers/mogura.c
r14899r14900
6565static TILE_GET_INFO( get_mogura_tile_info )
6666{
6767   mogura_state *state = machine.driver_data<mogura_state>();
68   int code = state->m_tileram.target()[tile_index];
69   int attr = state->m_tileram.target()[tile_index + 0x800];
68   int code = state->m_tileram[tile_index];
69   int attr = state->m_tileram[tile_index + 0x800];
7070
7171   SET_TILE_INFO(
7272         0,
r14899r14900
7979static VIDEO_START( mogura )
8080{
8181   mogura_state *state = machine.driver_data<mogura_state>();
82   gfx_element_set_source(machine.gfx[0], state->m_gfxram.target());
82   gfx_element_set_source(machine.gfx[0], state->m_gfxram);
8383   state->m_tilemap = tilemap_create(machine, get_mogura_tile_info, tilemap_scan_rows, 8, 8, 64, 32);
8484}
8585
r14899r14900
104104
105105WRITE8_MEMBER(mogura_state::mogura_tileram_w)
106106{
107   m_tileram.target()[offset] = data;
107   m_tileram[offset] = data;
108108   m_tilemap->mark_tile_dirty(offset & 0x7ff);
109109}
110110
r14899r14900
117117
118118WRITE8_MEMBER(mogura_state::mogura_gfxram_w)
119119{
120   m_gfxram.target()[offset] = data ;
120   m_gfxram[offset] = data ;
121121
122122   gfx_element_mark_dirty(machine().gfx[0], offset / 16);
123123}
src/mame/drivers/ddealer.c
r14899r14900
121121      m_vregs(*this, "vregs"),
122122      m_left_fg_vram_top(*this, "left_fg_vratop"),
123123      m_right_fg_vram_top(*this, "right_fg_vratop"),
124      m_left_fg_vram_bottom(*this, "left_fg_vrabottom"),
125      m_right_fg_vram_bottom(*this, "right_fg_vrabottom"),
124      m_left_fg_vram_bottom(*this, "left_fg_vrabot"),
125      m_right_fg_vram_bottom(*this, "right_fg_vrabot"),
126126      m_back_vram(*this, "back_vram"),
127127      m_work_ram(*this, "work_ram"),
128128      m_mcu_shared_ram(*this, "mcu_shared_ram"){ }
r14899r14900
163163static TILE_GET_INFO( get_back_tile_info )
164164{
165165   ddealer_state *state = machine.driver_data<ddealer_state>();
166   int code = state->m_back_vram.target()[tile_index];
166   int code = state->m_back_vram[tile_index];
167167   SET_TILE_INFO(
168168         0,
169169         code & 0xfff,
r14899r14900
276276
277277   if (!state->m_flipscreen)
278278   {
279      if (state->m_vregs.target()[0xcc / 2] & 0x80)
279      if (state->m_vregs[0xcc / 2] & 0x80)
280280      {
281         ddealer_draw_video_layer(screen.machine(), &state->m_vregs.target()[0x1e0 / 2], state->m_left_fg_vram_top, state->m_left_fg_vram_bottom, bitmap, cliprect, state->m_flipscreen);
282         ddealer_draw_video_layer(screen.machine(), &state->m_vregs.target()[0xcc / 2], state->m_right_fg_vram_top, state->m_right_fg_vram_bottom, bitmap, cliprect, state->m_flipscreen);
281         ddealer_draw_video_layer(screen.machine(), &state->m_vregs[0x1e0 / 2], state->m_left_fg_vram_top, state->m_left_fg_vram_bottom, bitmap, cliprect, state->m_flipscreen);
282         ddealer_draw_video_layer(screen.machine(), &state->m_vregs[0xcc / 2], state->m_right_fg_vram_top, state->m_right_fg_vram_bottom, bitmap, cliprect, state->m_flipscreen);
283283      }
284284      else
285285      {
286         ddealer_draw_video_layer(screen.machine(), &state->m_vregs.target()[0x1e0 / 2], state->m_left_fg_vram_top, state->m_left_fg_vram_bottom, bitmap, cliprect, state->m_flipscreen);
286         ddealer_draw_video_layer(screen.machine(), &state->m_vregs[0x1e0 / 2], state->m_left_fg_vram_top, state->m_left_fg_vram_bottom, bitmap, cliprect, state->m_flipscreen);
287287      }
288288   }
289289   else
290290   {
291      if (state->m_vregs.target()[0xcc / 2] & 0x80)
291      if (state->m_vregs[0xcc / 2] & 0x80)
292292      {
293         ddealer_draw_video_layer(screen.machine(), &state->m_vregs.target()[0xcc / 2], state->m_left_fg_vram_top, state->m_left_fg_vram_bottom, bitmap, cliprect, state->m_flipscreen);
294         ddealer_draw_video_layer(screen.machine(), &state->m_vregs.target()[0x1e0 / 2], state->m_right_fg_vram_top, state->m_right_fg_vram_bottom, bitmap, cliprect, state->m_flipscreen);
293         ddealer_draw_video_layer(screen.machine(), &state->m_vregs[0xcc / 2], state->m_left_fg_vram_top, state->m_left_fg_vram_bottom, bitmap, cliprect, state->m_flipscreen);
294         ddealer_draw_video_layer(screen.machine(), &state->m_vregs[0x1e0 / 2], state->m_right_fg_vram_top, state->m_right_fg_vram_bottom, bitmap, cliprect, state->m_flipscreen);
295295      }
296296      else
297297      {
298         ddealer_draw_video_layer(screen.machine(), &state->m_vregs.target()[0x1e0 / 2], state->m_left_fg_vram_top, state->m_left_fg_vram_bottom, bitmap, cliprect, state->m_flipscreen);
298         ddealer_draw_video_layer(screen.machine(), &state->m_vregs[0x1e0 / 2], state->m_left_fg_vram_top, state->m_left_fg_vram_bottom, bitmap, cliprect, state->m_flipscreen);
299299      }
300300
301301   }
r14899r14900
314314   if (state->m_coin_input & 0x01)//coin 1
315315   {
316316      if((state->m_input_pressed & 0x01) == 0)
317         state->m_mcu_shared_ram.target()[0x000 / 2]++;
317         state->m_mcu_shared_ram[0x000 / 2]++;
318318      state->m_input_pressed = (state->m_input_pressed & 0xfe) | 1;
319319   }
320320   else
r14899r14900
323323   if (state->m_coin_input & 0x02)//coin 2
324324   {
325325      if ((state->m_input_pressed & 0x02) == 0)
326         state->m_mcu_shared_ram.target()[0x000 / 2]++;
326         state->m_mcu_shared_ram[0x000 / 2]++;
327327      state->m_input_pressed = (state->m_input_pressed & 0xfd) | 2;
328328   }
329329   else
r14899r14900
332332   if (state->m_coin_input & 0x04)//service 1
333333   {
334334      if ((state->m_input_pressed & 0x04) == 0)
335         state->m_mcu_shared_ram.target()[0x000 / 2]++;
335         state->m_mcu_shared_ram[0x000 / 2]++;
336336      state->m_input_pressed = (state->m_input_pressed & 0xfb) | 4;
337337   }
338338   else
r14899r14900
340340
341341   /*0x104/2 is some sort of "start-lock",i.e. used on the girl selection.
342342      Without it,the game "steals" one credit if you press the start button on that.*/
343   if (state->m_mcu_shared_ram.target()[0x000 / 2] > 0 && state->m_work_ram.target()[0x104 / 2] & 1)
343   if (state->m_mcu_shared_ram[0x000 / 2] > 0 && state->m_work_ram[0x104 / 2] & 1)
344344   {
345345      if (state->m_coin_input & 0x08)//start 1
346346      {
347         if ((state->m_input_pressed & 0x08) == 0 && (~(state->m_work_ram.target()[0x100 / 2] & 1)))
348            state->m_mcu_shared_ram.target()[0x000 / 2]--;
347         if ((state->m_input_pressed & 0x08) == 0 && (~(state->m_work_ram[0x100 / 2] & 1)))
348            state->m_mcu_shared_ram[0x000 / 2]--;
349349         state->m_input_pressed = (state->m_input_pressed & 0xf7) | 8;
350350      }
351351      else
r14899r14900
353353
354354      if (state->m_coin_input & 0x10)//start 2
355355      {
356         if((state->m_input_pressed & 0x10) == 0 && (~(state->m_work_ram.target()[0x100 / 2] & 2)))
357            state->m_mcu_shared_ram.target()[0x000 / 2]--;
356         if((state->m_input_pressed & 0x10) == 0 && (~(state->m_work_ram[0x100 / 2] & 2)))
357            state->m_mcu_shared_ram[0x000 / 2]--;
358358         state->m_input_pressed = (state->m_input_pressed & 0xef) | 0x10;
359359      }
360360      else
r14899r14900
362362   }
363363
364364   /*random number generators,controls order of cards*/
365   state->m_mcu_shared_ram.target()[0x10 / 2] = timer.machine().rand() & 0xffff;
366   state->m_mcu_shared_ram.target()[0x12 / 2] = timer.machine().rand() & 0xffff;
367   state->m_mcu_shared_ram.target()[0x14 / 2] = timer.machine().rand() & 0xffff;
368   state->m_mcu_shared_ram.target()[0x16 / 2] = timer.machine().rand() & 0xffff;
365   state->m_mcu_shared_ram[0x10 / 2] = timer.machine().rand() & 0xffff;
366   state->m_mcu_shared_ram[0x12 / 2] = timer.machine().rand() & 0xffff;
367   state->m_mcu_shared_ram[0x14 / 2] = timer.machine().rand() & 0xffff;
368   state->m_mcu_shared_ram[0x16 / 2] = timer.machine().rand() & 0xffff;
369369}
370370
371371
372372
373373WRITE16_MEMBER(ddealer_state::back_vram_w)
374374{
375   COMBINE_DATA(&m_back_vram.target()[offset]);
375   COMBINE_DATA(&m_back_vram[offset]);
376376   m_back_tilemap->mark_tile_dirty(offset);
377377}
378378
379379
380380WRITE16_MEMBER(ddealer_state::ddealer_vregs_w)
381381{
382   COMBINE_DATA(&m_vregs.target()[offset]);
382   COMBINE_DATA(&m_vregs[offset]);
383383}
384384
385385/******************************************************************************************************
r14899r14900
389389******************************************************************************************************/
390390
391391#define PROT_JSR(_offs_,_protvalue_,_pc_) \
392   if(m_mcu_shared_ram.target()[(_offs_)/2] == _protvalue_) \
392   if(m_mcu_shared_ram[(_offs_)/2] == _protvalue_) \
393393   { \
394      m_mcu_shared_ram.target()[(_offs_)/2] = 0xffff;  /*(MCU job done)*/ \
395      m_mcu_shared_ram.target()[(_offs_+2-0x10)/2] = 0x4ef9;/*JMP*/\
396      m_mcu_shared_ram.target()[(_offs_+4-0x10)/2] = 0x0000;/*HI-DWORD*/\
397      m_mcu_shared_ram.target()[(_offs_+6-0x10)/2] = _pc_;  /*LO-DWORD*/\
394      m_mcu_shared_ram[(_offs_)/2] = 0xffff;  /*(MCU job done)*/ \
395      m_mcu_shared_ram[(_offs_+2-0x10)/2] = 0x4ef9;/*JMP*/\
396      m_mcu_shared_ram[(_offs_+4-0x10)/2] = 0x0000;/*HI-DWORD*/\
397      m_mcu_shared_ram[(_offs_+6-0x10)/2] = _pc_;  /*LO-DWORD*/\
398398   } \
399399
400400#define PROT_INPUT(_offs_,_protvalue_,_protinput_,_input_) \
401   if(m_mcu_shared_ram.target()[_offs_] == _protvalue_) \
401   if(m_mcu_shared_ram[_offs_] == _protvalue_) \
402402   {\
403      m_mcu_shared_ram.target()[_protinput_] = ((_input_ & 0xffff0000)>>16);\
404      m_mcu_shared_ram.target()[_protinput_+1] = (_input_ & 0x0000ffff);\
403      m_mcu_shared_ram[_protinput_] = ((_input_ & 0xffff0000)>>16);\
404      m_mcu_shared_ram[_protinput_+1] = (_input_ & 0x0000ffff);\
405405   }
406406
407407WRITE16_MEMBER(ddealer_state::ddealer_mcu_shared_w)
408408{
409   COMBINE_DATA(&m_mcu_shared_ram.target()[offset]);
409   COMBINE_DATA(&m_mcu_shared_ram[offset]);
410410
411411   switch(offset)
412412   {
r14899r14900
438438      case 0x4fe/2: PROT_JSR(0x4fe,0x8018,0x9818); break;
439439      /*Start-up vector,I think that only the first ram address can be written by the main CPU,or it is a whole sequence.*/
440440      case 0x000/2:
441         if (m_mcu_shared_ram.target()[0x000 / 2] == 0x60fe)
441         if (m_mcu_shared_ram[0x000 / 2] == 0x60fe)
442442         {
443            m_mcu_shared_ram.target()[0x000 / 2] = 0x0000;//coin counter
444            m_mcu_shared_ram.target()[0x002 / 2] = 0x0000;//coin counter "decimal point"
445            m_mcu_shared_ram.target()[0x004 / 2] = 0x4ef9;
443            m_mcu_shared_ram[0x000 / 2] = 0x0000;//coin counter
444            m_mcu_shared_ram[0x002 / 2] = 0x0000;//coin counter "decimal point"
445            m_mcu_shared_ram[0x004 / 2] = 0x4ef9;
446446         }
447447         break;
448448      case 0x002/2:
449449      case 0x004/2:
450         if (m_mcu_shared_ram.target()[0x002 / 2] == 0x0000 && m_mcu_shared_ram.target()[0x004 / 2] == 0x0214)
451            m_mcu_shared_ram.target()[0x004 / 2] = 0x4ef9;
450         if (m_mcu_shared_ram[0x002 / 2] == 0x0000 && m_mcu_shared_ram[0x004 / 2] == 0x0214)
451            m_mcu_shared_ram[0x004 / 2] = 0x4ef9;
452452         break;
453453      case 0x008/2:
454         if (m_mcu_shared_ram.target()[0x008 / 2] == 0x000f)
455            m_mcu_shared_ram.target()[0x008 / 2] = 0x0604;
454         if (m_mcu_shared_ram[0x008 / 2] == 0x000f)
455            m_mcu_shared_ram[0x008 / 2] = 0x0604;
456456         break;
457457      case 0x00c/2:
458         if (m_mcu_shared_ram.target()[0x00c / 2] == 0x000f)
459            m_mcu_shared_ram.target()[0x00c / 2] = 0x0000;
458         if (m_mcu_shared_ram[0x00c / 2] == 0x000f)
459            m_mcu_shared_ram[0x00c / 2] = 0x0000;
460460         break;
461461   }
462462}
r14899r14900
474474   /* this might actually be 1 tilemap with some funky rowscroll / columnscroll enabled, I'm not sure */
475475   AM_RANGE(0x090000, 0x090fff) AM_RAM AM_SHARE("left_fg_vratop")
476476   AM_RANGE(0x091000, 0x091fff) AM_RAM AM_SHARE("right_fg_vratop")
477   AM_RANGE(0x092000, 0x092fff) AM_RAM AM_SHARE("left_fg_vrabottom")
478   AM_RANGE(0x093000, 0x093fff) AM_RAM AM_SHARE("right_fg_vrabottom")
477   AM_RANGE(0x092000, 0x092fff) AM_RAM AM_SHARE("left_fg_vrabot")
478   AM_RANGE(0x093000, 0x093fff) AM_RAM AM_SHARE("right_fg_vrabot")
479479   //AM_RANGE(0x094000, 0x094001) AM_NOP // always 0?
480480   AM_RANGE(0x098000, 0x098001) AM_WRITE(ddealer_flipscreen_w)
481481   AM_RANGE(0x09c000, 0x09cfff) AM_RAM_WRITE(back_vram_w) AM_SHARE("back_vram") // bg tilemap
src/mame/drivers/berzerk.c
r14899r14900
363363{
364364   UINT8 alu_output;
365365
366   UINT8 current_video_data = m_videoram.target()[offset];
366   UINT8 current_video_data = m_videoram[offset];
367367
368368   /* shift data towards LSB.  MSB bits are filled by data from last_shift_data.
369369       The shifter consists of 5 74153 devices @ 7A, 8A, 9A, 10A and 11A,
r14899r14900
390390   alu_output = (TTL74181_read(LS181_10C, TTL74181_OUTPUT_F0, 4) << 4) |
391391             (TTL74181_read(LS181_12C, TTL74181_OUTPUT_F0, 4) << 0);
392392
393   m_videoram.target()[offset] = alu_output ^ 0xff;
393   m_videoram[offset] = alu_output ^ 0xff;
394394
395395   /* save data for next time */
396396   m_last_shift_data = data & 0x7f;
r14899r14900
465465   {
466466      int i;
467467
468      UINT8 data = state->m_videoram.target()[offs];
469      UINT8 color = state->m_colorram.target()[((offs >> 2) & 0x07e0) | (offs & 0x001f)];
468      UINT8 data = state->m_videoram[offs];
469      UINT8 color = state->m_colorram[((offs >> 2) & 0x07e0) | (offs & 0x001f)];
470470
471471      UINT8 y = offs >> 5;
472472      UINT8 x = offs << 3;
r14899r14900
598598   AM_RANGE(0x0000, 0x07ff) AM_ROM
599599   AM_RANGE(0x0800, 0x0bff) AM_MIRROR(0x0400) AM_RAM AM_SHARE("nvram")
600600   AM_RANGE(0x1000, 0x3fff) AM_ROM
601   AM_RANGE(0x4000, 0x5fff) AM_RAM AM_SHARE("videoram") AM_SHARE("share1")
602   AM_RANGE(0x6000, 0x7fff) AM_RAM_WRITE(magicram_w) AM_SHARE("share1")
601   AM_RANGE(0x4000, 0x5fff) AM_RAM AM_SHARE("videoram")
602   AM_RANGE(0x6000, 0x7fff) AM_RAM_WRITE(magicram_w) AM_SHARE("videoram")
603603   AM_RANGE(0x8000, 0x87ff) AM_MIRROR(0x3800) AM_RAM AM_SHARE("colorram")
604604   AM_RANGE(0xc000, 0xffff) AM_NOP
605605ADDRESS_MAP_END
r14899r14900
607607
608608static ADDRESS_MAP_START( frenzy_map, AS_PROGRAM, 8, berzerk_state )
609609   AM_RANGE(0x0000, 0x3fff) AM_ROM
610   AM_RANGE(0x4000, 0x5fff) AM_RAM AM_SHARE("videoram") AM_SHARE("share1")
611   AM_RANGE(0x6000, 0x7fff) AM_RAM_WRITE(magicram_w) AM_SHARE("share1")
610   AM_RANGE(0x4000, 0x5fff) AM_RAM AM_SHARE("videoram")
611   AM_RANGE(0x6000, 0x7fff) AM_RAM_WRITE(magicram_w) AM_SHARE("videoram")
612612   AM_RANGE(0x8000, 0x87ff) AM_MIRROR(0x3800) AM_RAM AM_SHARE("colorram")
613613   AM_RANGE(0xc000, 0xcfff) AM_ROM
614614   AM_RANGE(0xf800, 0xfbff) AM_MIRROR(0x0400) AM_RAM AM_SHARE("nvram")
src/mame/drivers/igs009.c
r14899r14900
8080
8181WRITE8_MEMBER(igs009_state::gp98_reel1_ram_w)
8282{
83   m_gp98_reel1_ram.target()[offset] = data;
83   m_gp98_reel1_ram[offset] = data;
8484   m_gp98_reel1_tilemap->mark_tile_dirty(offset);
8585}
8686
8787static TILE_GET_INFO( get_jingbell_reel1_tile_info )
8888{
8989   igs009_state *state = machine.driver_data<igs009_state>();
90   int code = state->m_gp98_reel1_ram.target()[tile_index];
90   int code = state->m_gp98_reel1_ram[tile_index];
9191
9292   SET_TILE_INFO(
9393         0,
r14899r14900
100100static TILE_GET_INFO( get_gp98_reel1_tile_info )
101101{
102102   igs009_state *state = machine.driver_data<igs009_state>();
103   int code = state->m_gp98_reel1_ram.target()[tile_index];
103   int code = state->m_gp98_reel1_ram[tile_index];
104104
105105   SET_TILE_INFO(
106106         0,
r14899r14900
112112
113113WRITE8_MEMBER(igs009_state::gp98_reel2_ram_w)
114114{
115   m_gp98_reel2_ram.target()[offset] = data;
115   m_gp98_reel2_ram[offset] = data;
116116   m_gp98_reel2_tilemap->mark_tile_dirty(offset);
117117}
118118
119119static TILE_GET_INFO( get_jingbell_reel2_tile_info )
120120{
121121   igs009_state *state = machine.driver_data<igs009_state>();
122   int code = state->m_gp98_reel2_ram.target()[tile_index];
122   int code = state->m_gp98_reel2_ram[tile_index];
123123
124124   SET_TILE_INFO(
125125         0,
r14899r14900
131131static TILE_GET_INFO( get_gp98_reel2_tile_info )
132132{
133133   igs009_state *state = machine.driver_data<igs009_state>();
134   int code = state->m_gp98_reel2_ram.target()[tile_index];
134   int code = state->m_gp98_reel2_ram[tile_index];
135135
136136   SET_TILE_INFO(
137137         0,
r14899r14900
144144
145145WRITE8_MEMBER(igs009_state::gp98_reel3_ram_w)
146146{
147   m_gp98_reel3_ram.target()[offset] = data;
147   m_gp98_reel3_ram[offset] = data;
148148   m_gp98_reel3_tilemap->mark_tile_dirty(offset);
149149}
150150
151151static TILE_GET_INFO( get_jingbell_reel3_tile_info )
152152{
153153   igs009_state *state = machine.driver_data<igs009_state>();
154   int code = state->m_gp98_reel3_ram.target()[tile_index];
154   int code = state->m_gp98_reel3_ram[tile_index];
155155
156156   SET_TILE_INFO(
157157         0,
r14899r14900
163163static TILE_GET_INFO( get_gp98_reel3_tile_info )
164164{
165165   igs009_state *state = machine.driver_data<igs009_state>();
166   int code = state->m_gp98_reel3_ram.target()[tile_index];
166   int code = state->m_gp98_reel3_ram[tile_index];
167167
168168   SET_TILE_INFO(
169169         0,
r14899r14900
176176
177177WRITE8_MEMBER(igs009_state::gp98_reel4_ram_w)
178178{
179   m_gp98_reel4_ram.target()[offset] = data;
179   m_gp98_reel4_ram[offset] = data;
180180   m_gp98_reel4_tilemap->mark_tile_dirty(offset);
181181}
182182
183183static TILE_GET_INFO( get_jingbell_reel4_tile_info )
184184{
185185   igs009_state *state = machine.driver_data<igs009_state>();
186   int code = state->m_gp98_reel4_ram.target()[tile_index];
186   int code = state->m_gp98_reel4_ram[tile_index];
187187
188188   SET_TILE_INFO(
189189         0,
r14899r14900
195195static TILE_GET_INFO( get_gp98_reel4_tile_info )
196196{
197197   igs009_state *state = machine.driver_data<igs009_state>();
198   int code = state->m_gp98_reel4_ram.target()[tile_index];
198   int code = state->m_gp98_reel4_ram[tile_index];
199199
200200   SET_TILE_INFO(
201201         0,
r14899r14900
212212
213213WRITE8_MEMBER(igs009_state::bg_scroll_w)
214214{
215   m_bg_scroll.target()[offset] = data;
215   m_bg_scroll[offset] = data;
216216//  bg_tilemap->set_scrolly(offset,data);
217217}
218218
r14899r14900
220220static TILE_GET_INFO( get_fg_tile_info )
221221{
222222   igs009_state *state = machine.driver_data<igs009_state>();
223   int code = state->m_fg_tile_ram.target()[tile_index] | (state->m_fg_color_ram.target()[tile_index] << 8);
223   int code = state->m_fg_tile_ram[tile_index] | (state->m_fg_color_ram[tile_index] << 8);
224224   SET_TILE_INFO(1, code, (4*(code >> 14)+3), 0);
225225}
226226
227227WRITE8_MEMBER(igs009_state::fg_tile_w)
228228{
229   m_fg_tile_ram.target()[offset] = data;
229   m_fg_tile_ram[offset] = data;
230230   m_fg_tilemap->mark_tile_dirty(offset);
231231}
232232
233233WRITE8_MEMBER(igs009_state::fg_color_w)
234234{
235   m_fg_color_ram.target()[offset] = data;
235   m_fg_color_ram[offset] = data;
236236   m_fg_tilemap->mark_tile_dirty(offset);
237237}
238238
r14899r14900
298298
299299      for (i= 0;i < 0x80;i++)
300300      {
301         state->m_gp98_reel1_tilemap->set_scrolly(i, state->m_bg_scroll.target()[i]*2);
302         state->m_gp98_reel2_tilemap->set_scrolly(i, state->m_bg_scroll.target()[i+0x80]*2);
303         state->m_gp98_reel3_tilemap->set_scrolly(i, state->m_bg_scroll.target()[i+0x100]*2);
304         state->m_gp98_reel4_tilemap->set_scrolly(i, state->m_bg_scroll.target()[i+0x180]*2);
301         state->m_gp98_reel1_tilemap->set_scrolly(i, state->m_bg_scroll[i]*2);
302         state->m_gp98_reel2_tilemap->set_scrolly(i, state->m_bg_scroll[i+0x80]*2);
303         state->m_gp98_reel3_tilemap->set_scrolly(i, state->m_bg_scroll[i+0x100]*2);
304         state->m_gp98_reel4_tilemap->set_scrolly(i, state->m_bg_scroll[i+0x180]*2);
305305      }
306306
307307
r14899r14900
310310      for (zz=0;zz<0x80-8;zz++) // -8 because of visible area (2*8 = 16)
311311      {
312312         rectangle clip;
313         int rowenable = state->m_bg_scroll2.target()[zz];
313         int rowenable = state->m_bg_scroll2[zz];
314314
315315         /* draw top of screen */
316316         clip.set(visarea.min_x, visarea.max_x, startclipmin, startclipmin+2);
src/mame/drivers/blitz68k.c
r14899r14900
4343public:
4444   blitz68k_state(const machine_config &mconfig, device_type type, const char *tag)
4545      : driver_device(mconfig, type, tag),
46        m_nvram(*this, "nvram") { }
46        m_nvram(*this, "nvram"),
47        m_leds0(*this, "leds0"),
48        m_leds1(*this, "leds1"),
49        m_leds2(*this, "leds2") { }
4750
4851   optional_shared_ptr<UINT16>   m_nvram;
4952   UINT8 *m_blit_buffer;
r14899r14900
5558   UINT16 *m_blit_dst_ram_hiword;
5659   UINT16 *m_blit_vregs;
5760   UINT16 *m_blit_transpen;
58   UINT16 *m_leds[3];
61   required_shared_ptr<UINT16> m_leds0;
62   required_shared_ptr<UINT16> m_leds1;
63   optional_shared_ptr<UINT16> m_leds2;
5964   DECLARE_WRITE16_MEMBER(blit_copy_w);
6065   DECLARE_READ8_MEMBER(blit_status_r);
6166   DECLARE_WRITE8_MEMBER(blit_x_w);
r14899r14900
505510void blitz68k_state::show_leds123()
506511{
507512#ifdef MAME_DEBUG
508   popmessage("led %02x %02x %02x", m_leds[0][0]>>8, m_leds[1][0]>>8, m_leds[2][0]>>8);
513   popmessage("led %02x %02x %02x", m_leds0[0]>>8, m_leds1[0]>>8, m_leds2[0]>>8);
509514#endif
510515}
511516void blitz68k_state::show_leds12()
512517{
513518#ifdef MAME_DEBUG
514   popmessage("led %02x %02x", m_leds[0][0]>>8, m_leds[1][0]>>8);
519   popmessage("led %02x %02x", m_leds0[0]>>8, m_leds1[0]>>8);
515520#endif
516521}
517522
r14899r14900
793798
794799WRITE16_MEMBER(blitz68k_state::cjffruit_leds1_w)
795800{
796   data = COMBINE_DATA(m_leds[0]);
801   data = COMBINE_DATA(m_leds0);
797802   if (ACCESSING_BITS_8_15)
798803   {
799804      coin_counter_w(machine(), 0, data & 0x0100);   // coin in
r14899r14900
810815
811816WRITE16_MEMBER(blitz68k_state::cjffruit_leds2_w)
812817{
813   data = COMBINE_DATA(m_leds[1]);
818   data = COMBINE_DATA(m_leds1);
814819   if (ACCESSING_BITS_8_15)
815820   {
816821      set_led_status(machine(),  7, data & 0x0100);   // start
r14899r14900
827832
828833WRITE16_MEMBER(blitz68k_state::cjffruit_leds3_w)
829834{
830   data = COMBINE_DATA(m_leds[2]);
835   data = COMBINE_DATA(m_leds2);
831836   if (ACCESSING_BITS_8_15)
832837   {
833838      set_led_status(machine(), 15, data & 0x0100);   // hopper coins?
r14899r14900
902907
903908   AM_RANGE(0x8e0000, 0x8e0001) AM_WRITE(cjffruit_mcu_w )
904909
905   AM_RANGE(0x8f8000, 0x8f8001) AM_WRITE(cjffruit_leds1_w) AM_BASE(m_leds[0])
906   AM_RANGE(0x8fa000, 0x8fa001) AM_WRITE(cjffruit_leds2_w) AM_BASE(m_leds[1])
907   AM_RANGE(0x8fc000, 0x8fc001) AM_WRITE(cjffruit_leds3_w) AM_BASE(m_leds[2])
910   AM_RANGE(0x8f8000, 0x8f8001) AM_WRITE(cjffruit_leds1_w) AM_SHARE("leds0")
911   AM_RANGE(0x8fa000, 0x8fa001) AM_WRITE(cjffruit_leds2_w) AM_SHARE("leds1")
912   AM_RANGE(0x8fc000, 0x8fc001) AM_WRITE(cjffruit_leds3_w) AM_SHARE("leds2")
908913
909914   AM_RANGE(0x8fe000, 0x8fe003) AM_WRITE8(blit_flags_w, 0xffff)   // flipx,y,solid,trans
910915   AM_RANGE(0x8fe004, 0x8fe005) AM_WRITEONLY
r14899r14900
932937
933938WRITE16_MEMBER(blitz68k_state::deucesw2_leds1_w)
934939{
935   data = COMBINE_DATA(m_leds[0]);
940   data = COMBINE_DATA(m_leds0);
936941   if (ACCESSING_BITS_8_15)
937942   {
938943      coin_counter_w(machine(), 0, data & 0x0100);   // coin in
r14899r14900
949954
950955WRITE16_MEMBER(blitz68k_state::deucesw2_leds2_w)
951956{
952   data = COMBINE_DATA(m_leds[1]);
957   data = COMBINE_DATA(m_leds1);
953958   if (ACCESSING_BITS_8_15)
954959   {
955960      set_led_status(machine(),  7, data & 0x0100);   // start
r14899r14900
966971
967972WRITE16_MEMBER(blitz68k_state::deucesw2_leds3_w)
968973{
969   data = COMBINE_DATA(m_leds[2]);
974   data = COMBINE_DATA(m_leds2);
970975   if (ACCESSING_BITS_8_15)
971976   {
972977      set_led_status(machine(), 15, data & 0x0100);   // hopper coins?
r14899r14900
10011006
10021007   AM_RANGE(0x896000, 0x896001) AM_WRITE(deucesw2_mcu_w )
10031008
1004   AM_RANGE(0x898000, 0x898001) AM_WRITE(deucesw2_leds1_w) AM_BASE(m_leds[0])
1005   AM_RANGE(0x89a000, 0x89a001) AM_WRITE(deucesw2_leds2_w) AM_BASE(m_leds[1])
1006   AM_RANGE(0x89c000, 0x89c001) AM_WRITE(deucesw2_leds3_w) AM_BASE(m_leds[2])
1009   AM_RANGE(0x898000, 0x898001) AM_WRITE(deucesw2_leds1_w) AM_SHARE("leds0")
1010   AM_RANGE(0x89a000, 0x89a001) AM_WRITE(deucesw2_leds2_w) AM_SHARE("leds1")
1011   AM_RANGE(0x89c000, 0x89c001) AM_WRITE(deucesw2_leds3_w) AM_SHARE("leds2")
10071012
10081013   AM_RANGE(0x89e000, 0x89e003) AM_WRITE8(blit_flags_w, 0xffff)   // flipx,y,solid,trans
10091014   AM_RANGE(0x89e004, 0x89e005) AM_WRITEONLY
r14899r14900
11221127
11231128WRITE16_MEMBER(blitz68k_state::hermit_leds1_w)
11241129{
1125   data = COMBINE_DATA(m_leds[0]);
1130   data = COMBINE_DATA(m_leds0);
11261131   if (ACCESSING_BITS_8_15)
11271132   {
11281133      coin_counter_w(machine(), 0, data & 0x0100);   // coin in
r14899r14900
11321137
11331138WRITE16_MEMBER(blitz68k_state::hermit_leds2_w)
11341139{
1135   data = COMBINE_DATA(m_leds[1]);
1140   data = COMBINE_DATA(m_leds1);
11361141   if (ACCESSING_BITS_8_15)
11371142   {
11381143      set_led_status(machine(),  7, data & 0x0100);   // button
r14899r14900
11761181   AM_RANGE(0x9d0000, 0x9d0001) AM_READ_PORT("IN2")
11771182   AM_RANGE(0x9d8000, 0x9d8001) AM_READ_PORT("DSW")
11781183
1179   AM_RANGE(0x9e0000, 0x9e0001) AM_WRITE(hermit_leds1_w) AM_BASE(m_leds[0])
1180   AM_RANGE(0x9e8000, 0x9e8001) AM_WRITE(hermit_leds2_w) AM_BASE(m_leds[1])
1184   AM_RANGE(0x9e0000, 0x9e0001) AM_WRITE(hermit_leds1_w) AM_SHARE("leds0")
1185   AM_RANGE(0x9e8000, 0x9e8001) AM_WRITE(hermit_leds2_w) AM_SHARE("leds1")
11811186
11821187   AM_RANGE(0x9f0000, 0x9f0003) AM_WRITE8(blit_flags_w, 0xffff)   // flipx,y,solid,trans
11831188   AM_RANGE(0x9f0004, 0x9f0005) AM_WRITEONLY
src/mame/drivers/tapatune.c
r14899r14900
342342
343343   offs_t offs = (ma*2 + ra*0x40)*4;
344344
345   UINT8 *videoram = reinterpret_cast<UINT8 *>(state->m_videoram.target());
345346   for (x = 0; x < x_count*4; x++)
346347   {
347      UINT8 pix = ((UINT8*)state->m_videoram.target())[BYTE_XOR_BE(offs + x)];
348      UINT8 pix = videoram[BYTE_XOR_BE(offs + x)];
348349      dest[2*x] = pens[((pix >> 4) & 0x0f)];
349350      dest[2*x + 1] = pens[(pix & 0x0f)];
350351   }
src/mame/drivers/dacholer.c
r14899r14900
8888static TILE_GET_INFO( get_bg_tile_info )
8989{
9090   dacholer_state *state = machine.driver_data<dacholer_state>();
91   SET_TILE_INFO(1, state->m_bgvideoram.target()[tile_index] + state->m_bg_bank * 0x100, 0, 0);
91   SET_TILE_INFO(1, state->m_bgvideoram[tile_index] + state->m_bg_bank * 0x100, 0, 0);
9292}
9393
9494static TILE_GET_INFO( get_fg_tile_info )
9595{
9696   dacholer_state *state = machine.driver_data<dacholer_state>();
97   SET_TILE_INFO(0, state->m_fgvideoram.target()[tile_index], 0, 0);
97   SET_TILE_INFO(0, state->m_fgvideoram[tile_index], 0, 0);
9898}
9999
100100static VIDEO_START( dacholer )
r14899r14900
123123
124124   for (offs = 0; offs < state->m_spriteram.bytes(); offs += 4)
125125   {
126      code = state->m_spriteram.target()[offs + 1];
127      attr = state->m_spriteram.target()[offs + 2];
126      code = state->m_spriteram[offs + 1];
127      attr = state->m_spriteram[offs + 2];
128128
129129      flipx = attr & 0x10;
130130      flipy = attr & 0x20;
131131
132      sx = (state->m_spriteram.target()[offs + 3] - 128) + 256 * (attr & 0x01);
133      sy = 255 - state->m_spriteram.target()[offs];
132      sx = (state->m_spriteram[offs + 3] - 128) + 256 * (attr & 0x01);
133      sy = 255 - state->m_spriteram[offs];
134134
135135      if (state->flip_screen())
136136      {
r14899r14900
171171
172172WRITE8_MEMBER(dacholer_state::background_w)
173173{
174   m_bgvideoram.target()[offset] = data;
174   m_bgvideoram[offset] = data;
175175   m_bg_tilemap->mark_tile_dirty(offset);
176176}
177177
178178WRITE8_MEMBER(dacholer_state::foreground_w)
179179{
180   m_fgvideoram.target()[offset] = data;
180   m_fgvideoram[offset] = data;
181181   m_fg_tilemap->mark_tile_dirty(offset);
182182}
183183
src/mame/drivers/cb2001.c
r14899r14900
346346               int tile;
347347               int colour;
348348
349               tile = (state->m_vram_bg.target()[count] & 0x0fff);
350               colour = (state->m_vram_bg.target()[count] & 0xf000)>>12;
349               tile = (state->m_vram_bg[count] & 0x0fff);
350               colour = (state->m_vram_bg[count] & 0xf000)>>12;
351351               tile += state->m_videobank*0x2000;
352352
353353
r14899r14900
365365         {
366366            UINT16 scroll;
367367
368            scroll = state->m_vram_bg.target()[0xa00/2 + i/2];
368            scroll = state->m_vram_bg[0xa00/2 + i/2];
369369            if (i&1)
370370               scroll >>=8;
371371            scroll &=0xff;
372372
373373            state->m_reel2_tilemap->set_scrolly(i, scroll);
374374
375            scroll = state->m_vram_bg.target()[0x800/2 + i/2];
375            scroll = state->m_vram_bg[0x800/2 + i/2];
376376            if (i&1)
377377               scroll >>=8;
378378            scroll &=0xff;
379379
380380            state->m_reel1_tilemap->set_scrolly(i, scroll);
381381
382            scroll = state->m_vram_bg.target()[0xc00/2 + i/2];
382            scroll = state->m_vram_bg[0xc00/2 + i/2];
383383            if (i&1)
384384               scroll >>=8;
385385            scroll &=0xff;
r14899r14900
408408         int tile;
409409         int colour;
410410
411         tile = (state->m_vram_fg.target()[count] & 0x0fff);
412         colour = (state->m_vram_fg.target()[count] & 0xf000)>>12;
411         tile = (state->m_vram_fg[count] & 0x0fff);
412         colour = (state->m_vram_fg[count] & 0xf000)>>12;
413413         tile += state->m_videobank*0x2000;
414414
415415         if (state->m_other2 & 0x4)
r14899r14900
459459static TILE_GET_INFO( get_cb2001_reel1_tile_info )
460460{
461461   cb2001_state *state = machine.driver_data<cb2001_state>();
462   int code = state->m_vram_bg.target()[(0x0000/2) + tile_index/2];
462   int code = state->m_vram_bg[(0x0000/2) + tile_index/2];
463463
464464   if (tile_index&1)
465465      code >>=8;
r14899r14900
478478static TILE_GET_INFO( get_cb2001_reel2_tile_info )
479479{
480480   cb2001_state *state = machine.driver_data<cb2001_state>();
481   int code = state->m_vram_bg.target()[(0x0200/2) + tile_index/2];
481   int code = state->m_vram_bg[(0x0200/2) + tile_index/2];
482482
483483   if (tile_index&1)
484484      code >>=8;
r14899r14900
498498static TILE_GET_INFO( get_cb2001_reel3_tile_info )
499499{
500500   cb2001_state *state = machine.driver_data<cb2001_state>();
501   int code = state->m_vram_bg.target()[(0x0400/2) + tile_index/2];
501   int code = state->m_vram_bg[(0x0400/2) + tile_index/2];
502502   int colour = 0;//(cb2001_out_c&0x7) + 8;
503503
504504   if (tile_index&1)
r14899r14900
528528
529529WRITE16_MEMBER(cb2001_state::cb2001_bg_w)
530530{
531   COMBINE_DATA(&m_vram_bg.target()[offset]);
531   COMBINE_DATA(&m_vram_bg[offset]);
532532
533533   // also used for the reel tilemaps in a different mode
534534/*
src/mame/drivers/wallc.c
r14899r14900
131131
132132WRITE8_MEMBER(wallc_state::wallc_videoram_w)
133133{
134   UINT8 *videoram = m_videoram.target();
134   UINT8 *videoram = m_videoram;
135135   videoram[offset] = data;
136136   m_bg_tilemap->mark_tile_dirty(offset);
137137}
r14899r14900
139139static TILE_GET_INFO( get_bg_tile_info )
140140{
141141   wallc_state *state = machine.driver_data<wallc_state>();
142   UINT8 *videoram = state->m_videoram.target();
142   UINT8 *videoram = state->m_videoram;
143143   SET_TILE_INFO(0, videoram[tile_index] + 0x100, 1, 0);
144144}
145145
src/mame/drivers/marinedt.c
r14899r14900
153153WRITE8_MEMBER(marinedt_state::tx_tileram_w)
154154{
155155
156   m_tx_tileram.target()[offset] = data;
156   m_tx_tileram[offset] = data;
157157   m_tx_tilemap->mark_tile_dirty(offset);
158158}
159159
r14899r14900
479479static TILE_GET_INFO( get_tile_info )
480480{
481481   marinedt_state *state = machine.driver_data<marinedt_state>();
482   int code = state->m_tx_tileram.target()[tile_index];
482   int code = state->m_tx_tileram[tile_index];
483483   int color = 0;
484484   int flags = TILE_FLIPX;
485485
src/mame/drivers/sliver.c
r14899r14900
132132   if (y < 0 || x < 0 || x > 383 || y > 255)
133133      return;
134134
135   b=(state->m_colorram.target()[addr] << 2) | (state->m_colorram.target()[addr] & 0x3);
136   g=(state->m_colorram.target()[addr+0x100] << 2) | (state->m_colorram.target()[addr+0x100] & 3);
137   r=(state->m_colorram.target()[addr+0x200] << 2) | (state->m_colorram.target()[addr+0x200] & 3);
135   b=(state->m_colorram[addr] << 2) | (state->m_colorram[addr] & 0x3);
136   g=(state->m_colorram[addr+0x100] << 2) | (state->m_colorram[addr+0x100] & 3);
137   r=(state->m_colorram[addr+0x200] << 2) | (state->m_colorram[addr+0x200] & 3);
138138
139139   state->m_bitmap_fg.pix32(y, x) = r | (g<<8) | (b<<16);
140140}
src/mame/drivers/subsino.c
r14899r14900
300300
301301WRITE8_MEMBER(subsino_state::subsino_videoram_w)
302302{
303   m_videoram.target()[offset] = data;
303   m_videoram[offset] = data;
304304   m_tmap->mark_tile_dirty(offset);
305305}
306306
307307WRITE8_MEMBER(subsino_state::subsino_colorram_w)
308308{
309   m_colorram.target()[offset] = data;
309   m_colorram[offset] = data;
310310   m_tmap->mark_tile_dirty(offset);
311311}
312312
313313static TILE_GET_INFO( get_tile_info )
314314{
315315   subsino_state *state = machine.driver_data<subsino_state>();
316   UINT16 code = state->m_videoram.target()[ tile_index ] + (state->m_colorram.target()[ tile_index ] << 8);
316   UINT16 code = state->m_videoram[ tile_index ] + (state->m_colorram[ tile_index ] << 8);
317317   UINT16 color = (code >> 8) & 0x0f;
318318   code = ((code & 0xf000) >> 4) + ((code & 0xff) >> 0);
319319   code += state->m_tiles_offset;
r14899r14900
323323static TILE_GET_INFO( get_stisub_tile_info )
324324{
325325   subsino_state *state = machine.driver_data<subsino_state>();
326   UINT16 code = state->m_videoram.target()[ tile_index ] + (state->m_colorram.target()[ tile_index ] << 8);
326   UINT16 code = state->m_videoram[ tile_index ] + (state->m_colorram[ tile_index ] << 8);
327327   code&= 0x3fff;
328328   SET_TILE_INFO(0, code, 0, 0);
329329}
r14899r14900
341341
342342WRITE8_MEMBER(subsino_state::subsino_reel1_ram_w)
343343{
344   m_reel1_ram.target()[offset] = data;
344   m_reel1_ram[offset] = data;
345345   m_reel1_tilemap->mark_tile_dirty(offset);
346346}
347347
348348static TILE_GET_INFO( get_subsino_reel1_tile_info )
349349{
350350   subsino_state *state = machine.driver_data<subsino_state>();
351   int code = state->m_reel1_ram.target()[tile_index];
351   int code = state->m_reel1_ram[tile_index];
352352   int colour = (state->m_out_c&0x7) + 8;
353353
354354   SET_TILE_INFO(
r14899r14900
361361static TILE_GET_INFO( get_stisub_reel1_tile_info )
362362{
363363   subsino_state *state = machine.driver_data<subsino_state>();
364   int code = state->m_reel1_ram.target()[tile_index];
364   int code = state->m_reel1_ram[tile_index];
365365   int attr = state->m_reel1_attr[tile_index];
366366
367367   SET_TILE_INFO(
r14899r14900
374374
375375WRITE8_MEMBER(subsino_state::subsino_reel2_ram_w)
376376{
377   m_reel2_ram.target()[offset] = data;
377   m_reel2_ram[offset] = data;
378378   m_reel2_tilemap->mark_tile_dirty(offset);
379379}
380380
381381static TILE_GET_INFO( get_subsino_reel2_tile_info )
382382{
383383   subsino_state *state = machine.driver_data<subsino_state>();
384   int code = state->m_reel2_ram.target()[tile_index];
384   int code = state->m_reel2_ram[tile_index];
385385   int colour = (state->m_out_c&0x7) + 8;
386386
387387   SET_TILE_INFO(
r14899r14900
394394static TILE_GET_INFO( get_stisub_reel2_tile_info )
395395{
396396   subsino_state *state = machine.driver_data<subsino_state>();
397   int code = state->m_reel2_ram.target()[tile_index];
397   int code = state->m_reel2_ram[tile_index];
398398   int attr = state->m_reel2_attr[tile_index];
399399
400400   SET_TILE_INFO(
r14899r14900
406406
407407WRITE8_MEMBER(subsino_state::subsino_reel3_ram_w)
408408{
409   m_reel3_ram.target()[offset] = data;
409   m_reel3_ram[offset] = data;
410410   m_reel3_tilemap->mark_tile_dirty(offset);
411411}
412412
413413static TILE_GET_INFO( get_subsino_reel3_tile_info )
414414{
415415   subsino_state *state = machine.driver_data<subsino_state>();
416   int code = state->m_reel3_ram.target()[tile_index];
416   int code = state->m_reel3_ram[tile_index];
417417   int colour = (state->m_out_c&0x7) + 8;
418418
419419   SET_TILE_INFO(
r14899r14900
426426static TILE_GET_INFO( get_stisub_reel3_tile_info )
427427{
428428   subsino_state *state = machine.driver_data<subsino_state>();
429   int code = state->m_reel3_ram.target()[tile_index];
429   int code = state->m_reel3_ram[tile_index];
430430   int attr = state->m_reel3_attr[tile_index];
431431
432432   SET_TILE_INFO(
r14899r14900
486486
487487   for (i= 0;i < 64;i++)
488488   {
489      state->m_reel1_tilemap->set_scrolly(i, state->m_reel1_scroll.target()[i]);
490      state->m_reel2_tilemap->set_scrolly(i, state->m_reel2_scroll.target()[i]);
491      state->m_reel3_tilemap->set_scrolly(i, state->m_reel3_scroll.target()[i]);
489      state->m_reel1_tilemap->set_scrolly(i, state->m_reel1_scroll[i]);
490      state->m_reel2_tilemap->set_scrolly(i, state->m_reel2_scroll[i]);
491      state->m_reel3_tilemap->set_scrolly(i, state->m_reel3_scroll[i]);
492492   }
493493
494494   if (state->m_out_c&0x08)
r14899r14900
523523
524524   for (i= 0;i < 64;i++)
525525   {
526      state->m_reel1_tilemap->set_scrolly(i, state->m_reel1_scroll.target()[i]);
527      state->m_reel2_tilemap->set_scrolly(i, state->m_reel2_scroll.target()[i]);
528      state->m_reel3_tilemap->set_scrolly(i, state->m_reel3_scroll.target()[i]);
526      state->m_reel1_tilemap->set_scrolly(i, state->m_reel1_scroll[i]);
527      state->m_reel2_tilemap->set_scrolly(i, state->m_reel2_scroll[i]);
528      state->m_reel3_tilemap->set_scrolly(i, state->m_reel3_scroll[i]);
529529   }
530530
531531   if (state->m_out_c&0x08)
r14899r14900
11071107      }
11081108      else if (offset<0x80)
11091109      {
1110         m_reel2_scroll.target()[offset&0x3f] = data;
1110         m_reel2_scroll[offset&0x3f] = data;
11111111      }
11121112      else if (offset<0xc0)
11131113      {
1114         m_reel1_scroll.target()[offset&0x3f] = data;
1114         m_reel1_scroll[offset&0x3f] = data;
11151115      }
11161116      else
11171117      {
1118         m_reel3_scroll.target()[offset&0x3f] = data;
1118         m_reel3_scroll[offset&0x3f] = data;
11191119      }
11201120   }
11211121}
src/mame/drivers/mlanding.c
r14899r14900
9191
9292   for (y = cliprect.min_y; y <= cliprect.max_y; ++y)
9393   {
94      UINT16 *src = &state->m_g_ram.target()[y * 512/2 + cliprect.min_x];
94      UINT16 *src = &state->m_g_ram[y * 512/2 + cliprect.min_x];
9595      UINT16 *dst = &bitmap.pix16(y, cliprect.min_x);
9696
9797      for (x = cliprect.min_x; x <= cliprect.max_x; x += 2)
r14899r14900
124124
125125      int j, k;
126126
127      UINT16 attr = state->m_dma_ram.target()[offs];
127      UINT16 attr = state->m_dma_ram[offs];
128128
129129      if (attr == 0)
130130         continue;
131131
132      x = state->m_dma_ram.target()[offs + 1];
133      y = state->m_dma_ram.target()[offs + 2];
134      colour = state->m_dma_ram.target()[offs + 3];
132      x = state->m_dma_ram[offs + 1];
133      y = state->m_dma_ram[offs + 2];
134      colour = state->m_dma_ram[offs + 3];
135135
136136      dx = x >> 11;
137137      dy = y >> 11;
r14899r14900
166166               // Draw the 8x8 chunk
167167               for (y1 = 0; y1 < 8; ++y1)
168168               {
169                  UINT16 *src = &state->m_ml_tileram.target()[(code * 2 * 8) + y1*2];
170                  UINT16 *dst = &state->m_g_ram.target()[(y + k*8+y1)*512/2 + (j*8+x)/2];
169                  UINT16 *src = &state->m_ml_tileram[(code * 2 * 8) + y1*2];
170                  UINT16 *dst = &state->m_g_ram[(y + k*8+y1)*512/2 + (j*8+x)/2];
171171
172172                  UINT8 p2 = *src & 0xff;
173173                  UINT8 p1 = *src++ >> 8;
r14899r14900
214214         for(y1 = 0; y1 < dy*8; y1++)
215215         {
216216            int x1;
217            UINT16 *dst = &state->m_g_ram.target()[((y + y1) * 512/2) + x/2];
217            UINT16 *dst = &state->m_g_ram[((y + y1) * 512/2) + x/2];
218218
219219            for(x1 = 0; x1 < dx*8; x1+=2)
220220            {
r14899r14900
228228
229229WRITE16_MEMBER(mlanding_state::ml_tileram_w)
230230{
231   COMBINE_DATA(&m_ml_tileram.target()[offset]);
231   COMBINE_DATA(&m_ml_tileram[offset]);
232232}
233233
234234READ16_MEMBER(mlanding_state::ml_tileram_r)
235235{
236   return m_ml_tileram.target()[offset];
236   return m_ml_tileram[offset];
237237}
238238
239239
r14899r14900
459459
460460READ16_MEMBER(mlanding_state::ml_mecha_ram_r)
461461{
462   return (m_mecha_ram.target()[offset*2]<<8)|m_mecha_ram.target()[offset*2+1];
462   return (m_mecha_ram[offset*2]<<8)|m_mecha_ram[offset*2+1];
463463}
464464
465465WRITE16_MEMBER(mlanding_state::ml_mecha_ram_w)
r14899r14900
476476
477477   AM_RANGE(0x100000, 0x17ffff) AM_RAM AM_SHARE("g_ram")// 512kB G RAM - enough here for double buffered 512x400x8 frame
478478   AM_RANGE(0x180000, 0x1bffff) AM_READWRITE(ml_tileram_r, ml_tileram_w) AM_SHARE("ml_tileram")
479   AM_RANGE(0x1c0000, 0x1c3fff) AM_RAM AM_SHARE("share2") AM_SHARE("dma_ram")
479   AM_RANGE(0x1c0000, 0x1c3fff) AM_RAM AM_SHARE("dma_ram")
480480   AM_RANGE(0x1c4000, 0x1cffff) AM_RAM AM_SHARE("share1")
481481
482482   AM_RANGE(0x1d0000, 0x1d0001) AM_WRITE(ml_sub_reset_w)
r14899r14900
512512   AM_RANGE(0x000000, 0x01ffff) AM_ROM
513513   AM_RANGE(0x040000, 0x043fff) AM_RAM
514514   AM_RANGE(0x050000, 0x0503ff) AM_RAM AM_SHARE("share3")
515   AM_RANGE(0x1c0000, 0x1c3fff) AM_RAM AM_SHARE("share2")
515   AM_RANGE(0x1c0000, 0x1c3fff) AM_RAM AM_SHARE("dma_ram")
516516   AM_RANGE(0x1c4000, 0x1cffff) AM_RAM AM_SHARE("share1")
517517   AM_RANGE(0x200000, 0x203fff) AM_RAM AM_SHARE("ml_dotram")
518518ADDRESS_MAP_END
r14899r14900
549549
550550READ16_MEMBER(mlanding_state::ml_dotram_r)
551551{
552   return m_ml_dotram.target()[offset];
552   return m_ml_dotram[offset];
553553}
554554
555555WRITE16_MEMBER(mlanding_state::ml_dotram_w)
556556{
557   m_ml_dotram.target()[offset] = data;
557   m_ml_dotram[offset] = data;
558558}
559559
560560READ16_MEMBER(mlanding_state::dsp_HOLD_signal_r)
src/mame/drivers/neoprint.c
r14899r14900
7373   const gfx_element *gfx = machine.gfx[0];
7474   INT16 scrollx, scrolly;
7575
76   i = (state->m_npvidregs.target()[((layer*8)+0x06)/2] & 7) * 0x1000/4;
77   scrollx = ((state->m_npvidregs.target()[((layer*8)+0x00)/2] - (0xd8 + layer*4)) & 0x03ff);
78   scrolly = ((state->m_npvidregs.target()[((layer*8)+0x02)/2] - 0xffeb) & 0x03ff);
76   i = (state->m_npvidregs[((layer*8)+0x06)/2] & 7) * 0x1000/4;
77   scrollx = ((state->m_npvidregs[((layer*8)+0x00)/2] - (0xd8 + layer*4)) & 0x03ff);
78   scrolly = ((state->m_npvidregs[((layer*8)+0x02)/2] - 0xffeb) & 0x03ff);
7979
8080   scrollx/=2;
8181   scrolly/=2;
r14899r14900
8484   {
8585      for (x=0;x<32;x++)
8686      {
87         UINT16 dat = state->m_npvidram.target()[i*2] >> data_shift; // a video register?
87         UINT16 dat = state->m_npvidram[i*2] >> data_shift; // a video register?
8888         UINT16 color;
89         if(state->m_npvidram.target()[i*2+1] & 0x0020) // TODO: 8bpp switch?
90            color = ((state->m_npvidram.target()[i*2+1] & 0x8000) << 1) | 0x200 | ((state->m_npvidram.target()[i*2+1] & 0xff00) >> 7);
89         if(state->m_npvidram[i*2+1] & 0x0020) // TODO: 8bpp switch?
90            color = ((state->m_npvidram[i*2+1] & 0x8000) << 1) | 0x200 | ((state->m_npvidram[i*2+1] & 0xff00) >> 7);
9191         else
92            color = ((state->m_npvidram.target()[i*2+1] & 0xff00) >> 8) | ((state->m_npvidram.target()[i*2+1] & 0x0010) << 4);
93         UINT8 fx = (state->m_npvidram.target()[i*2+1] & 0x0040);
94         UINT8 fy = (state->m_npvidram.target()[i*2+1] & 0x0080);
92            color = ((state->m_npvidram[i*2+1] & 0xff00) >> 8) | ((state->m_npvidram[i*2+1] & 0x0010) << 4);
93         UINT8 fx = (state->m_npvidram[i*2+1] & 0x0040);
94         UINT8 fy = (state->m_npvidram[i*2+1] & 0x0080);
9595
9696         drawgfx_transpen(bitmap,cliprect,gfx,dat,color,fx,fy,x*16+scrollx,y*16-scrolly,0);
9797         drawgfx_transpen(bitmap,cliprect,gfx,dat,color,fx,fy,x*16+scrollx-512,y*16-scrolly,0);
src/mame/drivers/seattle.c
r14899r14900
428428      : driver_device(mconfig, type, tag),
429429        m_nvram(*this, "nvram") ,
430430      m_rambase(*this, "rambase"),
431      m_interrupt_enable(*this, "interrupt_enable"),
432      m_interrupt_config(*this, "interrupt_config"),
431      m_interrupt_enable(*this, "int_enable"),
432      m_interrupt_config(*this, "int_config"),
433433      m_asic_reset(*this, "asic_reset"),
434434      m_rombase(*this, "rombase"){ }
435435
r14899r14900
534534   mips3drc_set_options(machine.device("maincpu"), MIPS3DRC_FASTEST_OPTIONS + MIPS3DRC_STRICT_VERIFY);
535535
536536   /* configure fast RAM regions for DRC */
537   mips3drc_add_fastram(machine.device("maincpu"), 0x00000000, 0x007fffff, FALSE, state->m_rambase.target());
538   mips3drc_add_fastram(machine.device("maincpu"), 0x1fc00000, 0x1fc7ffff, TRUE,  state->m_rombase.target());
537   mips3drc_add_fastram(machine.device("maincpu"), 0x00000000, 0x007fffff, FALSE, state->m_rambase);
538   mips3drc_add_fastram(machine.device("maincpu"), 0x1fc00000, 0x1fc7ffff, TRUE,  state->m_rombase);
539539
540540   /* register for save states */
541541   state_save_register_global_array(machine, state->m_galileo.reg);
r14899r14900
677677WRITE32_MEMBER(seattle_state::interrupt_config_w)
678678{
679679   int irq;
680   COMBINE_DATA(m_interrupt_config.target());
680   COMBINE_DATA(m_interrupt_config);
681681
682682   /* VBLANK: clear anything pending on the old IRQ */
683683   if (m_vblank_irq_num != 0)
r14899r14900
719719
720720WRITE32_MEMBER(seattle_state::seattle_interrupt_enable_w)
721721{
722   UINT32 old = *m_interrupt_enable.target();
723   COMBINE_DATA(m_interrupt_enable.target());
724   if (old != *m_interrupt_enable.target())
722   UINT32 old = *m_interrupt_enable;
723   COMBINE_DATA(m_interrupt_enable);
724   if (old != *m_interrupt_enable)
725725   {
726726      if (m_vblank_latch)
727727         update_vblank_irq(machine());
r14899r14900
16281628
16291629READ32_MEMBER(seattle_state::cmos_r)
16301630{
1631   return m_nvram.target()[offset];
1631   return m_nvram[offset];
16321632}
16331633
16341634
r14899r14900
16591659
16601660WRITE32_MEMBER(seattle_state::asic_reset_w)
16611661{
1662   COMBINE_DATA(m_asic_reset.target());
1662   COMBINE_DATA(m_asic_reset);
16631663   if (!(*m_asic_reset & 0x0002))
16641664      midway_ioasic_reset(machine());
16651665}
r14899r14900
17831783   AM_RANGE(0x16100000, 0x1611ffff) AM_READWRITE(cmos_r, cmos_w) AM_SHARE("nvram")
17841784   AM_RANGE(0x17000000, 0x17000003) AM_READWRITE(cmos_protect_r, cmos_protect_w)
17851785   AM_RANGE(0x17100000, 0x17100003) AM_WRITE(seattle_watchdog_w)
1786   AM_RANGE(0x17300000, 0x17300003) AM_RAM_WRITE(seattle_interrupt_enable_w) AM_SHARE("interrupt_enable")
1787   AM_RANGE(0x17400000, 0x17400003) AM_RAM_WRITE(interrupt_config_w) AM_SHARE("interrupt_config")
1786   AM_RANGE(0x17300000, 0x17300003) AM_RAM_WRITE(seattle_interrupt_enable_w) AM_SHARE("int_enable")
1787   AM_RANGE(0x17400000, 0x17400003) AM_RAM_WRITE(interrupt_config_w) AM_SHARE("int_config")
17881788   AM_RANGE(0x17500000, 0x17500003) AM_READ(interrupt_state_r)
17891789   AM_RANGE(0x17600000, 0x17600003) AM_READ(interrupt_state2_r)
17901790   AM_RANGE(0x17700000, 0x17700003) AM_WRITE(vblank_clear_w)
r14899r14900
29372937   init_common(machine, MIDWAY_IOASIC_BLITZ99, 444/* or 528 */, 80, SEATTLE_CONFIG);
29382938
29392939   /* for some reason, the code in the ROM appears buggy; this is a small patch to fix it */
2940   state->m_rombase.target()[0x934/4] += 4;
2940   state->m_rombase[0x934/4] += 4;
29412941
29422942   /* main CPU speedups */
29432943   mips3drc_add_hotspot(machine.device("maincpu"), 0x80135510, 0x3C028024, 250);      /* confirmed */
src/mame/drivers/tmaster.c
r14899r14900
360360
361361   bitmap.fill(get_black_pen(screen.machine()), cliprect);
362362
363   if (layers_ctrl & 1)   copybitmap_trans(bitmap, state->m_bitmap[0][(state->m_regs.target()[0x02/2]>>8)&1], 0,0,0,0, cliprect, 0xff);
364   if (layers_ctrl & 2)   copybitmap_trans(bitmap, state->m_bitmap[1][(state->m_regs.target()[0x02/2]>>9)&1], 0,0,0,0, cliprect, 0xff);
363   if (layers_ctrl & 1)   copybitmap_trans(bitmap, state->m_bitmap[0][(state->m_regs[0x02/2]>>8)&1], 0,0,0,0, cliprect, 0xff);
364   if (layers_ctrl & 2)   copybitmap_trans(bitmap, state->m_bitmap[1][(state->m_regs[0x02/2]>>9)&1], 0,0,0,0, cliprect, 0xff);
365365
366366   return 0;
367367}
r14899r14900
385385
386386   UINT16 pen;
387387
388   buffer   =   (state->m_regs.target()[0x02/2] >> 8) & 3;   // 1 bit per layer, selects the currently displayed buffer
389   sw      =    state->m_regs.target()[0x04/2];
390   sx      =    state->m_regs.target()[0x06/2];
391   sh      =    state->m_regs.target()[0x08/2] + 1;
392   sy      =    state->m_regs.target()[0x0a/2];
388   buffer   =   (state->m_regs[0x02/2] >> 8) & 3;   // 1 bit per layer, selects the currently displayed buffer
389   sw      =    state->m_regs[0x04/2];
390   sx      =    state->m_regs[0x06/2];
391   sh      =    state->m_regs[0x08/2] + 1;
392   sy      =    state->m_regs[0x0a/2];
393393   addr   =   (*state->m_compute_addr)(
394             state->m_regs.target()[0x0c/2],
395             state->m_regs.target()[0x0e/2], state->m_addr);
396   mode   =    state->m_regs.target()[0x10/2];
394             state->m_regs[0x0c/2],
395             state->m_regs[0x0e/2], state->m_addr);
396   mode   =    state->m_regs[0x10/2];
397397
398398   layer   =   (mode >> 7) & 1;   // layer to draw to
399399   buffer   =   ((mode >> 6) & 1) ^ ((buffer >> layer) & 1);   // bit 6 selects whether to use the opposite buffer to that displayed
src/mame/drivers/flyball.c
r14899r14900
7575static TILE_GET_INFO( flyball_get_tile_info )
7676{
7777   flyball_state *state = machine.driver_data<flyball_state>();
78   UINT8 data = state->m_playfield_ram.target()[tile_index];
78   UINT8 data = state->m_playfield_ram[tile_index];
7979   int flags = ((data & 0x40) ? TILE_FLIPX : 0) | ((data & 0x80) ? TILE_FLIPY : 0);
8080   int code = data & 63;
8181
r14899r14900
392392   UINT8* ROM = machine.region("maincpu")->base() + 0x2000;
393393
394394   for (i = 0; i < 0x1000; i++)
395      state->m_rombase.target()[i] = ROM[i ^ 0x1ff];
395      state->m_rombase[i] = ROM[i ^ 0x1ff];
396396
397397   machine.device("maincpu")->reset();
398398
src/mame/drivers/unkhorse.c
r14899r14900
5858   {
5959      for (int x = 0; x < 32; x++)
6060      {
61         UINT8 data = state->m_video_ram.target()[y << 5 | x];
62         UINT8 color = state->m_color_ram.target()[(y << 3 & 0x780) | x] >> 4;
61         UINT8 data = state->m_video_ram[y << 5 | x];
62         UINT8 color = state->m_color_ram[(y << 3 & 0x780) | x] >> 4;
6363 
6464         for (int i = 0; i < 8; i++)
6565            bitmap.pix16(y, x << 3 | i) = (data >> i & 1) ? color : 0;
src/mame/drivers/pturn.c
r14899r14900
128128static TILE_GET_INFO( get_pturn_tile_info )
129129{
130130   pturn_state *state = machine.driver_data<pturn_state>();
131   UINT8 *videoram = state->m_videoram.target();
131   UINT8 *videoram = state->m_videoram;
132132   int tileno;
133133   tileno = videoram[tile_index];
134134
r14899r14900
164164static SCREEN_UPDATE_IND16(pturn)
165165{
166166   pturn_state *state = screen.machine().driver_data<pturn_state>();
167   UINT8 *spriteram = state->m_spriteram.target();
167   UINT8 *spriteram = state->m_spriteram;
168168   int offs;
169169   int sx, sy;
170170   int flipx, flipy;
r14899r14900
219219
220220WRITE8_MEMBER(pturn_state::pturn_videoram_w)
221221{
222   UINT8 *videoram = m_videoram.target();
222   UINT8 *videoram = m_videoram;
223223   videoram[offset]=data;
224224   m_fgmap->mark_tile_dirty(offset);
225225}
src/mame/drivers/jubilee.c
r14899r14900
111111
112112WRITE8_MEMBER(jubilee_state::jubileep_videoram_w)
113113{
114   m_videoram.target()[offset] = data;
114   m_videoram[offset] = data;
115115   m_bg_tilemap->mark_tile_dirty(offset);
116116}
117117
r14899r14900
119119static TILE_GET_INFO( get_bg_tile_info )
120120{
121121   jubilee_state *state = machine.driver_data<jubilee_state>();
122   int code = state->m_videoram.target()[tile_index];
122   int code = state->m_videoram[tile_index];
123123
124124   SET_TILE_INFO( 0, code, 0, 0);
125125}
src/mame/drivers/goldngam.c
r14899r14900
264264
265265   int x, y;
266266
267   UINT8 *tmp = (UINT8 *) state->m_videoram.target();
267   // ERROR: This cast is NOT endian-safe without the use of BYTE/WORD/DWORD_XOR_* macros!
268   UINT8 *tmp = reinterpret_cast<UINT8 *>(state->m_videoram.target());
268269   int index = 0;
269270
270271   for(y = 0; y < 512; ++y)
src/mame/drivers/laserbas.c
r14899r14900
126126READ8_MEMBER(laserbas_state::protram_r)
127127{
128128
129   return m_protram.target()[offset];
129   return m_protram[offset];
130130}
131131
132132WRITE8_MEMBER(laserbas_state::protram_w)
133133{
134134
135   m_protram.target()[offset] = data;
135   m_protram[offset] = data;
136136}
137137
138138static ADDRESS_MAP_START( laserbas_memory, AS_PROGRAM, 8, laserbas_state )
src/mame/drivers/firebeat.c
r14899r14900
17431743   ppcdrc_set_options(machine.device("maincpu"), PPCDRC_COMPATIBLE_OPTIONS);
17441744
17451745   /* configure fast RAM regions for DRC */
1746   ppcdrc_add_fastram(machine.device("maincpu"), 0x00000000, 0x01ffffff, FALSE, state->m_work_ram.target());
1746   ppcdrc_add_fastram(machine.device("maincpu"), 0x00000000, 0x01ffffff, FALSE, state->m_work_ram);
17471747
17481748   state->m_flash[0] = machine.device<fujitsu_29f016a_device>("flash0");
17491749   state->m_flash[1] = machine.device<fujitsu_29f016a_device>("flash1");
src/mame/drivers/clayshoo.c
r14899r14900
193193      int i;
194194      UINT8 x = offs << 3;
195195      UINT8 y = ~(offs >> 5);
196      UINT8 data = state->m_videoram.target()[offs];
196      UINT8 data = state->m_videoram[offs];
197197
198198      for (i = 0; i < 8; i++)
199199      {
src/mame/drivers/tattack.c
r14899r14900
4040static TILE_GET_INFO( get_tile_info )
4141{
4242   tattack_state *state = machine.driver_data<tattack_state>();
43   int code = state->m_videoram.target()[tile_index];
44   int color = state->m_colorram.target()[tile_index];
43   int code = state->m_videoram[tile_index];
44   int color = state->m_colorram[tile_index];
4545
4646   if((color&1 ) || (color>15) )
4747      logerror("COLOR %i\n",color);
src/mame/drivers/deco_ld.c
r14899r14900
133133static SCREEN_UPDATE_IND16( rblaster )
134134{
135135   deco_ld_state *state = screen.machine().driver_data<deco_ld_state>();
136   UINT8 *videoram = state->m_videoram.target();
136   UINT8 *videoram = state->m_videoram;
137137   const gfx_element *gfx = screen.machine().gfx[0];
138138   int count = 0x0000;
139139
src/mame/drivers/progolf.c
r14899r14900
153153WRITE8_MEMBER(progolf_state::progolf_charram_w)
154154{
155155   int i;
156   m_fbram.target()[offset] = data;
156   m_fbram[offset] = data;
157157
158158   if(m_char_pen == 7)
159159   {
src/mame/drivers/jackie.c
r14899r14900
111111static TILE_GET_INFO( get_fg_tile_info )
112112{
113113   jackie_state *state = machine.driver_data<jackie_state>();
114   int code = state->m_fg_tile_ram.target()[tile_index] | (state->m_fg_color_ram.target()[tile_index] << 8);
114   int code = state->m_fg_tile_ram[tile_index] | (state->m_fg_color_ram[tile_index] << 8);
115115   int tile = code & 0x1fff;
116116   SET_TILE_INFO(0, code, tile != 0x1fff ? ((code >> 12) & 0xe) + 1 : 0, 0);
117117}
118118
119119WRITE8_MEMBER(jackie_state::fg_tile_w)
120120{
121   m_fg_tile_ram.target()[offset] = data;
121   m_fg_tile_ram[offset] = data;
122122   m_fg_tilemap->mark_tile_dirty(offset);
123123}
124124
125125WRITE8_MEMBER(jackie_state::fg_color_w)
126126{
127   m_fg_color_ram.target()[offset] = data;
127   m_fg_color_ram[offset] = data;
128128   m_fg_tilemap->mark_tile_dirty(offset);
129129}
130130
r14899r14900
133133
134134WRITE8_MEMBER(jackie_state::bg_scroll_w)
135135{
136   m_bg_scroll.target()[offset] = data;
136   m_bg_scroll[offset] = data;
137137}
138138
139139
140140WRITE8_MEMBER(jackie_state::jackie_reel1_ram_w)
141141{
142   m_reel1_ram.target()[offset] = data;
142   m_reel1_ram[offset] = data;
143143   m_reel1_tilemap->mark_tile_dirty(offset);
144144}
145145
146146static TILE_GET_INFO( get_jackie_reel1_tile_info )
147147{
148148   jackie_state *state = machine.driver_data<jackie_state>();
149   int code = state->m_reel1_ram.target()[tile_index];
149   int code = state->m_reel1_ram[tile_index];
150150   SET_TILE_INFO(1, code, 0, 0);
151151}
152152
r14899r14900
154154
155155WRITE8_MEMBER(jackie_state::jackie_reel2_ram_w)
156156{
157   m_reel2_ram.target()[offset] = data;
157   m_reel2_ram[offset] = data;
158158   m_reel2_tilemap->mark_tile_dirty(offset);
159159}
160160
161161static TILE_GET_INFO( get_jackie_reel2_tile_info )
162162{
163163   jackie_state *state = machine.driver_data<jackie_state>();
164   int code = state->m_reel2_ram.target()[tile_index];
164   int code = state->m_reel2_ram[tile_index];
165165   SET_TILE_INFO(1, code, 0, 0);
166166}
167167
168168
169169WRITE8_MEMBER(jackie_state::jackie_reel3_ram_w)
170170{
171   m_reel3_ram.target()[offset] = data;
171   m_reel3_ram[offset] = data;
172172   m_reel3_tilemap->mark_tile_dirty(offset);
173173}
174174
175175static TILE_GET_INFO( get_jackie_reel3_tile_info )
176176{
177177   jackie_state *state = machine.driver_data<jackie_state>();
178   int code = state->m_reel3_ram.target()[tile_index];
178   int code = state->m_reel3_ram[tile_index];
179179   SET_TILE_INFO(1, code, 0, 0);
180180}
181181
r14899r14900
206206
207207   for (i=0;i < 0x40;i++)
208208   {
209      state->m_reel1_tilemap->set_scrolly(i, state->m_bg_scroll.target()[i+0x000]);
210      state->m_reel2_tilemap->set_scrolly(i, state->m_bg_scroll.target()[i+0x040]);
211      state->m_reel3_tilemap->set_scrolly(i, state->m_bg_scroll.target()[i+0x080]);
209      state->m_reel1_tilemap->set_scrolly(i, state->m_bg_scroll[i+0x000]);
210      state->m_reel2_tilemap->set_scrolly(i, state->m_bg_scroll[i+0x040]);
211      state->m_reel3_tilemap->set_scrolly(i, state->m_bg_scroll[i+0x080]);
212212   }
213213
214214   for (j=0; j < 0x100-1; j++)
215215   {
216216      rectangle clip;
217      int rowenable = state->m_bg_scroll2.target()[j];
217      int rowenable = state->m_bg_scroll2[j];
218218
219219      /* draw top of screen */
220220      clip.set(visarea.min_x, visarea.max_x, startclipmin, startclipmin+1);
src/mame/drivers/blackt96.c
r14899r14900
9090
9191   for (y=0;y<32;y++)
9292   {
93      UINT16 tile = (state->m_tilemapram2.target()[count*2 + (base/2)+1]&0x3fff);
94      UINT16 flipx = (state->m_tilemapram2.target()[count*2 + (base/2)+1]&0x4000);
95      UINT16 colour = (state->m_tilemapram2.target()[count*2 + (base/2)]&0x00ff);
93      UINT16 tile = (state->m_tilemapram2[count*2 + (base/2)+1]&0x3fff);
94      UINT16 flipx = (state->m_tilemapram2[count*2 + (base/2)+1]&0x4000);
95      UINT16 colour = (state->m_tilemapram2[count*2 + (base/2)]&0x00ff);
9696
9797      if (tile&0x2000)
9898      {
r14899r14900
121121      int yy;
122122      int s = 0;
123123
124      xx=  ((state->m_tilemapram2.target()[x+0]&0x001f)<<4) | (state->m_tilemapram2.target()[x+1]&0xf000)>>12;
125      yy = ((state->m_tilemapram2.target()[x+1]&0x1ff));
124      xx=  ((state->m_tilemapram2[x+0]&0x001f)<<4) | (state->m_tilemapram2[x+1]&0xf000)>>12;
125      yy = ((state->m_tilemapram2[x+1]&0x1ff));
126126
127127      if (xx&0x100) xx-=0x200;
128128      yy = 0x1ff-yy;
r14899r14900
156156   {
157157      for (y=0;y<32;y++)
158158      {
159         UINT16 tile = (state->m_tilemapram.target()[count*2]&0x7ff)+0x800; // +0xc00 for korean text
159         UINT16 tile = (state->m_tilemapram[count*2]&0x7ff)+0x800; // +0xc00 for korean text
160160         drawgfx_transpen(bitmap,cliprect,gfx,tile,0,0,0,x*8,-16+y*8,0);
161161         count++;
162162      }
src/mame/drivers/ace.c
r14899r14900
8282static VIDEO_START( ace )
8383{
8484   aceal_state *state = machine.driver_data<aceal_state>();
85   gfx_element_set_source(machine.gfx[1], state->m_characterram.target());
86   gfx_element_set_source(machine.gfx[2], state->m_characterram.target());
87   gfx_element_set_source(machine.gfx[3], state->m_characterram.target());
88   gfx_element_set_source(machine.gfx[4], state->m_scoreram.target());
85   gfx_element_set_source(machine.gfx[1], state->m_characterram);
86   gfx_element_set_source(machine.gfx[2], state->m_characterram);
87   gfx_element_set_source(machine.gfx[3], state->m_characterram);
88   gfx_element_set_source(machine.gfx[4], state->m_scoreram);
8989}
9090
9191static SCREEN_UPDATE_IND16( ace )
r14899r14900
136136
137137WRITE8_MEMBER(aceal_state::ace_characterram_w)
138138{
139   if (m_characterram.target()[offset] != data)
139   if (m_characterram[offset] != data)
140140   {
141141      if (data & ~0x07)
142142      {
143143         logerror("write to %04x data = %02x\n", 0x8000 + offset, data);
144144         popmessage("write to %04x data = %02x\n", 0x8000 + offset, data);
145145      }
146      m_characterram.target()[offset] = data;
146      m_characterram[offset] = data;
147147      gfx_element_mark_dirty(machine().gfx[1], 0);
148148      gfx_element_mark_dirty(machine().gfx[2], 0);
149149      gfx_element_mark_dirty(machine().gfx[3], 0);
r14899r14900
152152
153153WRITE8_MEMBER(aceal_state::ace_scoreram_w)
154154{
155   m_scoreram.target()[offset] = data;
155   m_scoreram[offset] = data;
156156   gfx_element_mark_dirty(machine().gfx[4], offset / 32);
157157}
158158
src/mame/drivers/dreamwld.c
r14899r14900
229229
230230WRITE32_MEMBER(dreamwld_state::dreamwld_bg_videoram_w)
231231{
232   COMBINE_DATA(&m_bg_videoram.target()[offset]);
232   COMBINE_DATA(&m_bg_videoram[offset]);
233233   m_bg_tilemap->mark_tile_dirty(offset * 2);
234234   m_bg_tilemap->mark_tile_dirty(offset * 2 + 1);
235235}
r14899r14900
238238{
239239   dreamwld_state *state = machine.driver_data<dreamwld_state>();
240240   int tileno, colour;
241   tileno = (tile_index & 1) ? (state->m_bg_videoram.target()[tile_index >> 1] & 0xffff) : ((state->m_bg_videoram.target()[tile_index >> 1] >> 16) & 0xffff);
241   tileno = (tile_index & 1) ? (state->m_bg_videoram[tile_index >> 1] & 0xffff) : ((state->m_bg_videoram[tile_index >> 1] >> 16) & 0xffff);
242242   colour = tileno >> 13;
243243   tileno &= 0x1fff;
244244   SET_TILE_INFO(1, tileno + state->m_tilebank[0] * 0x2000, 0x80 + colour, 0);
r14899r14900
247247
248248WRITE32_MEMBER(dreamwld_state::dreamwld_bg2_videoram_w)
249249{
250   COMBINE_DATA(&m_bg2_videoram.target()[offset]);
250   COMBINE_DATA(&m_bg2_videoram[offset]);
251251   m_bg2_tilemap->mark_tile_dirty(offset * 2);
252252   m_bg2_tilemap->mark_tile_dirty(offset * 2 + 1);
253253}
r14899r14900
256256{
257257   dreamwld_state *state = machine.driver_data<dreamwld_state>();
258258   UINT16 tileno, colour;
259   tileno = (tile_index & 1) ? (state->m_bg2_videoram.target()[tile_index >> 1] & 0xffff) : ((state->m_bg2_videoram.target()[tile_index >> 1] >> 16) & 0xffff);
259   tileno = (tile_index & 1) ? (state->m_bg2_videoram[tile_index >> 1] & 0xffff) : ((state->m_bg2_videoram[tile_index >> 1] >> 16) & 0xffff);
260260   colour = tileno >> 13;
261261   tileno &= 0x1fff;
262262   SET_TILE_INFO(1, tileno + state->m_tilebank[1] * 0x2000, 0xc0 + colour, 0);
r14899r14900
304304   tmptilemap0 = state->m_bg_tilemap;
305305   tmptilemap1 = state->m_bg2_tilemap;
306306
307   int layer0_scrolly = state->m_vregs.target()[(0x400 / 4)] + 32;
308   int layer1_scrolly = state->m_vregs.target()[(0x400 / 4) + 2] + 32;
307   int layer0_scrolly = state->m_vregs[(0x400 / 4)] + 32;
308   int layer1_scrolly = state->m_vregs[(0x400 / 4) + 2] + 32;
309309
310   int layer0_scrollx = state->m_vregs.target()[(0x400 / 4) + 1] + 3;
311   int layer1_scrollx = state->m_vregs.target()[(0x400 / 4) + 3] + 5;
312   UINT32 layer0_ctrl = state->m_vregs.target()[0x412 / 4];
313   UINT32 layer1_ctrl = state->m_vregs.target()[0x416 / 4];
310   int layer0_scrollx = state->m_vregs[(0x400 / 4) + 1] + 3;
311   int layer1_scrollx = state->m_vregs[(0x400 / 4) + 3] + 5;
312   UINT32 layer0_ctrl = state->m_vregs[0x412 / 4];
313   UINT32 layer1_ctrl = state->m_vregs[0x416 / 4];
314314
315315   tmptilemap0->set_scrolly(0, layer0_scrolly);
316316   tmptilemap1->set_scrolly(0, layer1_scrolly);
r14899r14900
340340      int x0 = 0, x1 = 0;
341341
342342      /* layer 0 */
343      UINT16 *vregs = reinterpret_cast<UINT16 *>(state->m_vregs.target());
343344      if (layer0_ctrl & 0x0300)
344345      {
345346         if (layer0_ctrl & 0x0200)
346347            /* per-tile rowscroll */
347            x0 = ((UINT16 *)state->m_vregs.target())[BYTE_XOR_BE(0x000/2 + i/16)];
348            x0 = vregs[BYTE_XOR_BE(0x000/2 + i/16)];
348349         else
349350            /* per-line rowscroll */
350            x0 = ((UINT16 *)state->m_vregs.target())[BYTE_XOR_BE(0x000/2 + ((i + layer0_scrolly)&0xff))]; // different handling to psikyo.c? ( + scrolly )
351            x0 = vregs[BYTE_XOR_BE(0x000/2 + ((i + layer0_scrolly)&0xff))]; // different handling to psikyo.c? ( + scrolly )
351352      }
352353
353354
r14899r14900
361362      {
362363         if (layer1_ctrl & 0x0200)
363364            /* per-tile rowscroll */
364            x1 = ((UINT16 *)state->m_vregs.target())[BYTE_XOR_BE(0x200/2 + i/16)];
365            x1 = vregs[BYTE_XOR_BE(0x200/2 + i/16)];
365366         else
366367            /* per-line rowscroll */
367            x1 = ((UINT16 *)state->m_vregs.target())[BYTE_XOR_BE(0x200/2 + ((i + layer1_scrolly)&0xff))];  // different handling to psikyo.c? ( + scrolly )
368            x1 = vregs[BYTE_XOR_BE(0x200/2 + ((i + layer1_scrolly)&0xff))];  // different handling to psikyo.c? ( + scrolly )
368369      }
369370
370371
r14899r14900
374375   }
375376
376377
377   state->m_tilebank[0] = (state->m_vregs.target()[(0x400 / 4) + 4] >> 6) & 1;
378   state->m_tilebank[1] = (state->m_vregs.target()[(0x400 / 4) + 5] >> 6) & 1;
378   state->m_tilebank[0] = (state->m_vregs[(0x400 / 4) + 4] >> 6) & 1;
379   state->m_tilebank[1] = (state->m_vregs[(0x400 / 4) + 5] >> 6) & 1;
379380
380381   if (state->m_tilebank[0] != state->m_tilebankold[0])
381382   {
r14899r14900
445446   UINT16 dat;
446447   int color;
447448
448   COMBINE_DATA(&m_paletteram.target()[offset]);
449   COMBINE_DATA(&m_paletteram[offset]);
449450   color = offset * 2;
450451
451   dat = m_paletteram.target()[offset] & 0x7fff;
452   dat = m_paletteram[offset] & 0x7fff;
452453   palette_set_color_rgb(machine(), color+1, pal5bit(dat >> 10), pal5bit(dat >> 5), pal5bit(dat >> 0));
453454
454   dat = (m_paletteram.target()[offset] >> 16) & 0x7fff;
455   dat = (m_paletteram[offset] >> 16) & 0x7fff;
455456   palette_set_color_rgb(machine(), color, pal5bit(dat >> 10), pal5bit(dat >> 5), pal5bit(dat >> 0));
456457}
457458
src/mame/drivers/panicr.c
r14899r14900
163163static TILE_GET_INFO( get_txttile_info )
164164{
165165   panicr_state *state = machine.driver_data<panicr_state>();
166   UINT8 *videoram = state->m_videoram.target();
166   UINT8 *videoram = state->m_videoram;
167167   int code=videoram[tile_index*4];
168168   int attr=videoram[tile_index*4+2];
169169   int color = attr & 0x07;
r14899r14900
224224static void draw_sprites(running_machine &machine, bitmap_ind16 &bitmap,const rectangle &cliprect )
225225{
226226   panicr_state *state = machine.driver_data<panicr_state>();
227   UINT8 *spriteram = state->m_spriteram.target();
227   UINT8 *spriteram = state->m_spriteram;
228228   int offs,flipx,flipy,x,y,color,sprite;
229229
230230   for (offs = 0; offs<0x1000; offs+=16)
r14899r14900
236236      if (spriteram[offs+1] & 0x40) x -= 0x100;
237237
238238      color = spriteram[offs+1] & 0x0f;
239      sprite = spriteram[offs+0]+(state->m_scrollram.target()[0x0c]<<8);
239      sprite = spriteram[offs+0]+(state->m_scrollram[0x0c]<<8);
240240
241241      drawgfx_transmask(bitmap,cliprect,machine.gfx[2],
242242            sprite,
r14899r14900
250250   panicr_state *state = screen.machine().driver_data<panicr_state>();
251251   bitmap.fill(get_black_pen(screen.machine()), cliprect);
252252   state->m_txttilemap ->mark_all_dirty();
253   state->m_bgtilemap->set_scrollx(0, ((state->m_scrollram.target()[0x02]&0x0f)<<12)+((state->m_scrollram.target()[0x02]&0xf0)<<4)+((state->m_scrollram.target()[0x04]&0x7f)<<1)+((state->m_scrollram.target()[0x04]&0x80)>>7) );
253   state->m_bgtilemap->set_scrollx(0, ((state->m_scrollram[0x02]&0x0f)<<12)+((state->m_scrollram[0x02]&0xf0)<<4)+((state->m_scrollram[0x04]&0x7f)<<1)+((state->m_scrollram[0x04]&0x80)>>7) );
254254   state->m_bgtilemap->draw(bitmap, cliprect, 0,0);
255255   draw_sprites(screen.machine(),bitmap,cliprect);
256256   state->m_txttilemap->draw(bitmap, cliprect, 0,0);
src/mame/drivers/istellar.c
r14899r14900
3232      : driver_device(mconfig, type, tag),
3333        m_laserdisc(*this, "laserdisc") ,
3434      m_tile_ram(*this, "tile_ram"),
35      m_tile_control_ram(*this, "tile_control_ram"),
35      m_tile_control_ram(*this, "tile_ctrl_ram"),
3636      m_sprite_ram(*this, "sprite_ram"){ }
3737
3838   required_device<pioneer_ldv1000_device> m_laserdisc;
r14899r14900
7070   /*
7171    for (charx = 0; charx < 0x400; charx ++)
7272    {
73        printf ("%x ", state->m_sprite_ram.target()[charx]) ;
73        printf ("%x ", state->m_sprite_ram[charx]) ;
7474    }
7575    printf("\n\n\n");
7676    */
r14899r14900
8383         int current_screen_character = (chary*32) + charx;
8484
8585         drawgfx_transpen(bitmap, cliprect, screen.machine().gfx[0],
86               state->m_tile_ram.target()[current_screen_character],
87               (state->m_tile_control_ram.target()[current_screen_character] & 0x0f),
86               state->m_tile_ram[current_screen_character],
87               (state->m_tile_control_ram[current_screen_character] & 0x0f),
8888               0, 0, charx*8, chary*8, 0);
8989      }
9090   }
r14899r14900
174174   AM_RANGE(0x0000,0x9fff) AM_ROM
175175   AM_RANGE(0xa000,0xa7ff) AM_RAM
176176   AM_RANGE(0xa800,0xabff) AM_RAM AM_SHARE("tile_ram")
177   AM_RANGE(0xac00,0xafff) AM_RAM AM_SHARE("tile_control_ram")
177   AM_RANGE(0xac00,0xafff) AM_RAM AM_SHARE("tile_ctrl_ram")
178178   AM_RANGE(0xb000,0xb3ff) AM_RAM AM_SHARE("sprite_ram")
179179ADDRESS_MAP_END
180180
src/mame/drivers/sbowling.c
r14899r14900
9696   int flip = flip_screen();
9797   int x,y,i,v1,v2;
9898
99   m_videoram.target()[offset] = data;
99   m_videoram[offset] = data;
100100
101101   offset &= 0x1fff;
102102
103103   y = offset / 32;
104104   x = (offset % 32) * 8;
105105
106   v1 = m_videoram.target()[offset];
107   v2 = m_videoram.target()[offset+0x2000];
106   v1 = m_videoram[offset];
107   v2 = m_videoram[offset+0x2000];
108108
109109   for (i = 0; i < 8; i++)
110110   {
r14899r14900
189189   {
190190      int offs;
191191      for (offs = 0;offs < 0x4000; offs++)
192         sbw_videoram_w(space, offs, m_videoram.target()[offs]);
192         sbw_videoram_w(space, offs, m_videoram[offs]);
193193   }
194194   m_sbw_system = data;
195195}
src/mame/drivers/good.c
r14899r14900
5959
6060WRITE16_MEMBER(good_state::fg_tilemapram_w)
6161{
62   COMBINE_DATA(&m_fg_tilemapram.target()[offset]);
62   COMBINE_DATA(&m_fg_tilemapram[offset]);
6363   m_fg_tilemap->mark_tile_dirty(offset / 2);
6464}
6565
6666static TILE_GET_INFO( get_fg_tile_info )
6767{
6868   good_state *state = machine.driver_data<good_state>();
69   int tileno = state->m_fg_tilemapram.target()[tile_index * 2];
70   int attr = state->m_fg_tilemapram.target()[tile_index * 2 + 1] & 0xf;
69   int tileno = state->m_fg_tilemapram[tile_index * 2];
70   int attr = state->m_fg_tilemapram[tile_index * 2 + 1] & 0xf;
7171   SET_TILE_INFO(0, tileno, attr, 0);
7272}
7373
7474WRITE16_MEMBER(good_state::bg_tilemapram_w)
7575{
76   COMBINE_DATA(&m_bg_tilemapram.target()[offset]);
76   COMBINE_DATA(&m_bg_tilemapram[offset]);
7777   m_bg_tilemap->mark_tile_dirty(offset / 2);
7878}
7979
8080static TILE_GET_INFO( get_bg_tile_info )
8181{
8282   good_state *state = machine.driver_data<good_state>();
83   int tileno = state->m_bg_tilemapram.target()[tile_index * 2];
84   int attr = state->m_bg_tilemapram.target()[tile_index * 2 + 1] & 0xf;
83   int tileno = state->m_bg_tilemapram[tile_index * 2];
84   int attr = state->m_bg_tilemapram[tile_index * 2 + 1] & 0xf;
8585   SET_TILE_INFO(1, tileno, attr, 0);
8686}
8787
src/mame/drivers/mirage.c
r14899r14900
8989
9090   screen.machine().device<decospr_device>("spritegen")->draw_sprites(bitmap, cliprect, state->m_spriteram->buffer(), 0x400);
9191
92   deco16ic_pf_update(state->m_deco_tilegen1, state->m_pf1_rowscroll, state->m_pf2_rowscroll.target());
92   deco16ic_pf_update(state->m_deco_tilegen1, state->m_pf1_rowscroll, state->m_pf2_rowscroll);
9393
9494   bitmap.fill(256, cliprect); /* not verified */
9595
src/mame/drivers/ettrivia.c
r14899r14900
6161
6262WRITE8_MEMBER(ettrivia_state::ettrivia_fg_w)
6363{
64   m_fg_videoram.target()[offset] = data;
64   m_fg_videoram[offset] = data;
6565   m_fg_tilemap->mark_tile_dirty(offset);
6666}
6767
6868WRITE8_MEMBER(ettrivia_state::ettrivia_bg_w)
6969{
70   m_bg_videoram.target()[offset] = data;
70   m_bg_videoram[offset] = data;
7171   m_bg_tilemap->mark_tile_dirty(offset);
7272}
7373
src/mame/drivers/jalmah.c
r14899r14900
239239static TILE_GET_INFO( get_sc0_tile_info )
240240{
241241   jalmah_state *state = machine.driver_data<jalmah_state>();
242   int code = state->m_sc0_vram.target()[tile_index];
242   int code = state->m_sc0_vram[tile_index];
243243   SET_TILE_INFO(
244244         3,
245245         (code & 0xfff) + ((state->m_sc0bank & 3) << 12),
r14899r14900
250250static TILE_GET_INFO( get_sc1_tile_info )
251251{
252252   jalmah_state *state = machine.driver_data<jalmah_state>();
253   int code = state->m_sc1_vram.target()[tile_index];
253   int code = state->m_sc1_vram[tile_index];
254254   SET_TILE_INFO(
255255         2,
256256         code & 0xfff,
r14899r14900
261261static TILE_GET_INFO( get_sc2_tile_info )
262262{
263263   jalmah_state *state = machine.driver_data<jalmah_state>();
264   int code = state->m_sc2_vram.target()[tile_index];
264   int code = state->m_sc2_vram[tile_index];
265265   SET_TILE_INFO(
266266         1,
267267         code & 0xfff,
r14899r14900
272272static TILE_GET_INFO( get_sc3_tile_info )
273273{
274274   jalmah_state *state = machine.driver_data<jalmah_state>();
275   int code = state->m_sc3_vram.target()[tile_index];
275   int code = state->m_sc3_vram[tile_index];
276276   SET_TILE_INFO(
277277         0,
278278         code & 0xfff,
r14899r14900
502502
503503WRITE16_MEMBER(jalmah_state::sc0_vram_w)
504504{
505   COMBINE_DATA(&m_sc0_vram.target()[offset]);
505   COMBINE_DATA(&m_sc0_vram[offset]);
506506   /*2048x256 tilemap*/
507507   m_sc0_tilemap_0->mark_tile_dirty(offset);
508508   /*1024x512 tilemap*/
r14899r14900
515515
516516WRITE16_MEMBER(jalmah_state::sc3_vram_w)
517517{
518   COMBINE_DATA(&m_sc3_vram.target()[offset]);
518   COMBINE_DATA(&m_sc3_vram[offset]);
519519   /*2048x256 tilemap*/
520520   m_sc3_tilemap_0->mark_tile_dirty(offset);
521521   /*1024x512 tilemap*/
r14899r14900
526526
527527WRITE16_MEMBER(jalmah_state::sc1_vram_w)
528528{
529   COMBINE_DATA(&m_sc1_vram.target()[offset]);
529   COMBINE_DATA(&m_sc1_vram[offset]);
530530   /*2048x256 tilemap*/
531531   m_sc1_tilemap_0->mark_tile_dirty(offset);
532532   /*1024x512 tilemap*/
r14899r14900
539539
540540WRITE16_MEMBER(jalmah_state::sc2_vram_w)
541541{
542   COMBINE_DATA(&m_sc2_vram.target()[offset]);
542   COMBINE_DATA(&m_sc2_vram[offset]);
543543   /*2048x256 tilemap*/
544544   m_sc2_tilemap_0->mark_tile_dirty(offset);
545545   /*1024x512 tilemap*/
r14899r14900
617617
618618WRITE16_MEMBER(jalmah_state::urashima_sc0_vram_w)
619619{
620   COMBINE_DATA(&m_sc0_vram.target()[offset]);
620   COMBINE_DATA(&m_sc0_vram[offset]);
621621   m_sc0_tilemap_0->mark_tile_dirty(offset);
622622}
623623
624624WRITE16_MEMBER(jalmah_state::urashima_sc3_vram_w)
625625{
626   COMBINE_DATA(&m_sc3_vram.target()[offset]);
626   COMBINE_DATA(&m_sc3_vram[offset]);
627627   m_sc3_tilemap_0->mark_tile_dirty(offset);
628628}
629629
r14899r14900
739739static void daireika_mcu_run(running_machine &machine)
740740{
741741   jalmah_state *state = machine.driver_data<jalmah_state>();
742   UINT16 *jm_shared_ram = state->m_jm_shared_ram.target();
742   UINT16 *jm_shared_ram = state->m_jm_shared_ram;
743743
744744   if(((jm_shared_ram[0x550/2] & 0xf00) == 0x700) && ((jm_shared_ram[0x540/2] & 0xf00) != state->m_dma_old))
745745   {
r14899r14900
789789static void mjzoomin_mcu_run(running_machine &machine)
790790{
791791   jalmah_state *state = machine.driver_data<jalmah_state>();
792   UINT16 *jm_shared_ram = state->m_jm_shared_ram.target();
792   UINT16 *jm_shared_ram = state->m_jm_shared_ram;
793793
794794   if(state->m_test_mode)   //service_mode
795795   {
r14899r14900
834834static void urashima_mcu_run(running_machine &machine)
835835{
836836   jalmah_state *state = machine.driver_data<jalmah_state>();
837   UINT16 *jm_shared_ram = state->m_jm_shared_ram.target();
837   UINT16 *jm_shared_ram = state->m_jm_shared_ram;
838838
839839   if(state->m_test_mode)   //service_mode
840840   {
r14899r14900
879879static void second_mcu_run(running_machine &machine)
880880{
881881   jalmah_state *state = machine.driver_data<jalmah_state>();
882   UINT16 *jm_shared_ram = state->m_jm_shared_ram.target();
882   UINT16 *jm_shared_ram = state->m_jm_shared_ram;
883883   if(state->m_test_mode)   //service_mode
884884   {
885885      jm_shared_ram[0x200/2] = input_port_read(machine, "KEY0");
r14899r14900
17591759*/
17601760WRITE16_MEMBER(jalmah_state::urashima_mcu_w)
17611761{
1762   UINT16 *jm_shared_ram = m_jm_shared_ram.target();
1763   UINT16 *jm_mcu_code = m_jm_mcu_code.target();
1762   UINT16 *jm_shared_ram = m_jm_shared_ram;
1763   UINT16 *jm_mcu_code = m_jm_mcu_code;
17641764   if(ACCESSING_BITS_0_7 && data)
17651765   {
17661766      /*******************************************************
r14899r14900
19801980
19811981WRITE16_MEMBER(jalmah_state::daireika_mcu_w)
19821982{
1983   UINT16 *jm_shared_ram = m_jm_shared_ram.target();
1984   UINT16 *jm_mcu_code = m_jm_mcu_code.target();
1983   UINT16 *jm_shared_ram = m_jm_shared_ram;
1984   UINT16 *jm_mcu_code = m_jm_mcu_code;
19851985   UINT16 i;
19861986
19871987   if(ACCESSING_BITS_0_7 && data)
r14899r14900
22562256*/
22572257WRITE16_MEMBER(jalmah_state::mjzoomin_mcu_w)
22582258{
2259   UINT16 *jm_shared_ram = m_jm_shared_ram.target();
2260   UINT16 *jm_mcu_code = m_jm_mcu_code.target();
2259   UINT16 *jm_shared_ram = m_jm_shared_ram;
2260   UINT16 *jm_mcu_code = m_jm_mcu_code;
22612261   if(ACCESSING_BITS_0_7 && data)
22622262   {
22632263      /******************************************************
src/mame/drivers/supdrapo.c
r14899r14900
109109   {
110110      for(x = 0; x < 32; x++)
111111      {
112         int tile = state->m_videoram.target()[count] + state->m_char_bank.target()[count] * 0x100;
112         int tile = state->m_videoram[count] + state->m_char_bank[count] * 0x100;
113113         /* Global Column Coloring, GUESS! */
114         color = state->m_col_line.target()[(x*2) + 1] ? (state->m_col_line.target()[(x*2) + 1] - 1) & 7 : 0;
114         color = state->m_col_line[(x*2) + 1] ? (state->m_col_line[(x*2) + 1] - 1) & 7 : 0;
115115
116116         drawgfx_opaque(bitmap, cliprect, screen.machine().gfx[0], tile,color, 0, 0, x*8, y*8);
117117
r14899r14900
252252
253253static ADDRESS_MAP_START( sdpoker_mem, AS_PROGRAM, 8, supdrapo_state )
254254   AM_RANGE(0x0000, 0x4fff) AM_ROM
255   AM_RANGE(0x5000, 0x50ff) AM_RAM AM_SHARE("share1")
256   AM_RANGE(0x57ff, 0x57ff) AM_RAM AM_SHARE("share1")
257   AM_RANGE(0x5800, 0x58ff) AM_RAM AM_SHARE("share1") AM_SHARE("col_line")
255   AM_RANGE(0x5000, 0x50ff) AM_RAM AM_SHARE("col_line")
256   AM_RANGE(0x57ff, 0x57ff) AM_RAM AM_SHARE("col_line")
257   AM_RANGE(0x5800, 0x58ff) AM_RAM AM_SHARE("col_line")
258258   AM_RANGE(0x6000, 0x67ff) AM_RAM //work ram
259259   AM_RANGE(0x6800, 0x6bff) AM_RAM AM_SHARE("videoram")
260260   AM_RANGE(0x6c00, 0x6fff) AM_RAM AM_SHARE("char_bank")
src/mame/drivers/merit.c
r14899r14900
174174{
175175   int co;
176176
177   co = ((m_ram_attr.target()[offset] & 0x7F) << 3) | (offset & 0x07);
177   co = ((m_ram_attr[offset] & 0x7F) << 3) | (offset & 0x07);
178178   return m_ram_palette[co];
179179}
180180
r14899r14900
185185   machine().primary_screen->update_now();
186186   data &= 0x0f;
187187
188   co = ((m_ram_attr.target()[offset] & 0x7F) << 3) | (offset & 0x07);
188   co = ((m_ram_attr[offset] & 0x7F) << 3) | (offset & 0x07);
189189   m_ram_palette[co] = data;
190190
191191}
r14899r14900
228228   for (cx = 0; cx < x_count; cx++)
229229   {
230230      int i;
231      int attr = state->m_ram_attr.target()[ma & 0x7ff];
231      int attr = state->m_ram_attr[ma & 0x7ff];
232232      int region = (attr & 0x40) >> 6;
233      int addr = ((state->m_ram_video.target()[ma & 0x7ff] | ((attr & 0x80) << 1) | (state->m_extra_video_bank_bit)) << 4) | (ra & 0x0f);
233      int addr = ((state->m_ram_video[ma & 0x7ff] | ((attr & 0x80) << 1) | (state->m_extra_video_bank_bit)) << 4) | (ra & 0x0f);
234234      int colour = (attr & 0x7f) << 3;
235235      UINT8   *data;
236236
r14899r14900
328328   /* other bits unknown */
329329
330330   /*kludge to avoid jumps on ram area in The Couples*/
331   state->m_backup_ram.target()[0x1011] = 0xc9; //ret
331   state->m_backup_ram[0x1011] = 0xc9; //ret
332332}
333333
334334WRITE8_MEMBER(merit_state::casino5_bank_w)
src/mame/drivers/dotrikun.c
r14899r14900
7272   {
7373      for (x = 0; x < 256; x+=16)
7474      {
75         UINT8 data = state->m_dotrikun_bitmap.target()[((x/16)+((y/2)*16))];
75         UINT8 data = state->m_dotrikun_bitmap[((x/16)+((y/2)*16))];
7676
7777         for (i = 0; i < 8; i++)
7878         {
src/mame/drivers/spoker.c
r14899r14900
5757WRITE8_MEMBER(spoker_state::bg_tile_w)
5858{
5959
60   m_bg_tile_ram.target()[offset] = data;
60   m_bg_tile_ram[offset] = data;
6161   m_bg_tilemap->mark_tile_dirty(offset);
6262}
6363
6464static TILE_GET_INFO( get_bg_tile_info )
6565{
6666   spoker_state *state = machine.driver_data<spoker_state>();
67   int code = state->m_bg_tile_ram.target()[tile_index];
67   int code = state->m_bg_tile_ram[tile_index];
6868   SET_TILE_INFO(1 + (tile_index & 3), code & 0xff, 0, 0);
6969}
7070
7171static TILE_GET_INFO( get_fg_tile_info )
7272{
7373   spoker_state *state = machine.driver_data<spoker_state>();
74   int code = state->m_fg_tile_ram.target()[tile_index] | (state->m_fg_color_ram.target()[tile_index] << 8);
74   int code = state->m_fg_tile_ram[tile_index] | (state->m_fg_color_ram[tile_index] << 8);
7575   SET_TILE_INFO(0, code, (4*(code >> 14)+3), 0);
7676}
7777
7878WRITE8_MEMBER(spoker_state::fg_tile_w)
7979{
8080
81   m_fg_tile_ram.target()[offset] = data;
81   m_fg_tile_ram[offset] = data;
8282   m_fg_tilemap->mark_tile_dirty(offset);
8383}
8484
8585WRITE8_MEMBER(spoker_state::fg_color_w)
8686{
8787
88   m_fg_color_ram.target()[offset] = data;
88   m_fg_color_ram[offset] = data;
8989   m_fg_tilemap->mark_tile_dirty(offset);
9090}
9191
src/mame/drivers/zr107.c
r14899r14900
405405   ppcdrc_set_options(machine.device("maincpu"), PPCDRC_COMPATIBLE_OPTIONS);
406406
407407   /* configure fast RAM regions for DRC */
408   ppcdrc_add_fastram(machine.device("maincpu"), 0x00000000, 0x000fffff, FALSE, state->m_workram.target());
408   ppcdrc_add_fastram(machine.device("maincpu"), 0x00000000, 0x000fffff, FALSE, state->m_workram);
409409}
410410
411411static ADDRESS_MAP_START( zr107_map, AS_PROGRAM, 32, zr107_state )
src/mame/drivers/dominob.c
r14899r14900
100100   {
101101      int sx, sy, code;
102102
103      sx = state->m_spriteram.target()[offs];
104      sy = 248 - state->m_spriteram.target()[offs + 1];
103      sx = state->m_spriteram[offs];
104      sy = 248 - state->m_spriteram[offs + 1];
105105      if (state->flip_screen_x()) sx = 248 - sx;
106106      if (state->flip_screen_y()) sy = 248 - sy;
107107
108      code = state->m_spriteram.target()[offs + 3] + ((state->m_spriteram.target()[offs + 2] & 0x03) << 8)  ;
108      code = state->m_spriteram[offs + 3] + ((state->m_spriteram[offs + 2] & 0x03) << 8)  ;
109109
110110      drawgfx_transpen(bitmap,cliprect,machine.gfx[0],
111111            2 * code,
112            ((state->m_spriteram.target()[offs + 2] & 0xf8) >> 3)  ,
112            ((state->m_spriteram[offs + 2] & 0xf8) >> 3)  ,
113113            state->flip_screen_x(),state->flip_screen_y(),
114114            sx,sy + (state->flip_screen_y() ? 8 : -8),0);
115115      drawgfx_transpen(bitmap,cliprect,machine.gfx[0],
116116            2 * code + 1,
117            ((state->m_spriteram.target()[offs + 2] & 0xf8) >> 3)  ,
117            ((state->m_spriteram[offs + 2] & 0xf8) >> 3)  ,
118118            state->flip_screen_x(),state->flip_screen_y(),
119119            sx,sy,0);
120120   }
r14899r14900
135135         drawgfx_opaque(bitmap,
136136               cliprect,
137137               screen.machine().gfx[1],
138               state->m_bgram.target()[index] + 256 * (state->m_bgram.target()[index + 1] & 0xf),
139               state->m_bgram.target()[index + 1] >> 4,
138               state->m_bgram[index] + 256 * (state->m_bgram[index + 1] & 0xf),
139               state->m_bgram[index + 1] >> 4,
140140               0, 0,
141141               x * 32, y * 32);
142142         index += 2;
r14899r14900
150150         drawgfx_transpen(   bitmap,
151151               cliprect,
152152               screen.machine().gfx[0],
153               state->m_videoram.target()[(y * 32 + x) * 2 + 1] + (state->m_videoram.target()[(y * 32 + x) * 2] & 7) * 256,
154               (state->m_videoram.target()[(y * 32 + x) * 2] >> 3),
153               state->m_videoram[(y * 32 + x) * 2 + 1] + (state->m_videoram[(y * 32 + x) * 2] & 7) * 256,
154               (state->m_videoram[(y * 32 + x) * 2] >> 3),
155155               0, 0,
156156               x * 8, y * 8,0);
157157      }
src/mame/drivers/sbrkout.c
r14899r14900
9898static MACHINE_START( sbrkout )
9999{
100100   sbrkout_state *state = machine.driver_data<sbrkout_state>();
101   UINT8 *videoram = state->m_videoram.target();
101   UINT8 *videoram = state->m_videoram;
102102   memory_set_bankptr(machine, "bank1", &videoram[0x380]);
103103   state->m_scanline_timer = machine.scheduler().timer_alloc(FUNC(scanline_callback));
104104   state->m_pot_timer = machine.scheduler().timer_alloc(FUNC(pot_trigger_callback));
r14899r14900
126126static TIMER_CALLBACK( scanline_callback )
127127{
128128   sbrkout_state *state = machine.driver_data<sbrkout_state>();
129   UINT8 *videoram = state->m_videoram.target();
129   UINT8 *videoram = state->m_videoram;
130130   int scanline = param;
131131
132132   /* force a partial update before anything happens */
r14899r14900
299299static TILE_GET_INFO( get_bg_tile_info )
300300{
301301   sbrkout_state *state = machine.driver_data<sbrkout_state>();
302   UINT8 *videoram = state->m_videoram.target();
302   UINT8 *videoram = state->m_videoram;
303303   int code = (videoram[tile_index] & 0x80) ? videoram[tile_index] : 0;
304304   SET_TILE_INFO(0, code, 0, 0);
305305}
r14899r14900
314314
315315WRITE8_MEMBER(sbrkout_state::sbrkout_videoram_w)
316316{
317   UINT8 *videoram = m_videoram.target();
317   UINT8 *videoram = m_videoram;
318318   videoram[offset] = data;
319319   m_bg_tilemap->mark_tile_dirty(offset);
320320}
r14899r14900
330330static SCREEN_UPDATE_IND16( sbrkout )
331331{
332332   sbrkout_state *state = screen.machine().driver_data<sbrkout_state>();
333   UINT8 *videoram = state->m_videoram.target();
333   UINT8 *videoram = state->m_videoram;
334334   int ball;
335335
336336   state->m_bg_tilemap->draw(bitmap, cliprect, 0, 0);
src/mame/drivers/re900.c
r14899r14900
174174
175175READ8_MEMBER(re900_state::rom_r)
176176{
177   return m_rom.target()[offset];
177   return m_rom[offset];
178178}
179179
180180
src/mame/drivers/jackpool.c
r14899r14900
5656      {
5757         for (x=0;x<64;x++)
5858         {
59            int tile = (state->m_vram.target()[count+(0x2000/2)] & 0x7fff);
60            int attr = (state->m_vram.target()[count+(0x2000/2)+0x800] & 0x1f00)>>8;
59            int tile = (state->m_vram[count+(0x2000/2)] & 0x7fff);
60            int attr = (state->m_vram[count+(0x2000/2)+0x800] & 0x1f00)>>8;
6161
6262            drawgfx_opaque(bitmap,cliprect,gfx,tile,attr,0,0,x*8,y*8);
6363            count++;
r14899r14900
6969      {
7070         for (x=0;x<64;x++)
7171         {
72            int tile = (state->m_vram.target()[count] & 0x7fff);
72            int tile = (state->m_vram[count] & 0x7fff);
7373
7474            if(tile != 0)
7575            {
76               int attr = (state->m_vram.target()[count+0x800] & 0x1f00)>>8;
77               int t_pen = (state->m_vram.target()[count+0x800] & 0x1000);
76               int attr = (state->m_vram[count+0x800] & 0x1f00)>>8;
77               int t_pen = (state->m_vram[count+0x800] & 0x1000);
7878
7979               drawgfx_transpen(bitmap,cliprect,gfx,tile,attr,0,0,x*8,y*8,(t_pen) ? 0 : -1);
8080            }
r14899r14900
119119   }
120120
121121//  printf("R %02x\n",offset*2);
122   return m_io.target()[offset];
122   return m_io[offset];
123123}
124124
125125WRITE16_MEMBER(jackpool_state::jackpool_io_w)
126126{
127   COMBINE_DATA(&m_io.target()[offset]);
127   COMBINE_DATA(&m_io[offset]);
128128
129129   switch(offset*2)
130130   {
src/mame/drivers/nmg5.c
r14899r14900
271271
272272WRITE16_MEMBER(nmg5_state::fg_videoram_w)
273273{
274   COMBINE_DATA(&m_fg_videoram.target()[offset]);
274   COMBINE_DATA(&m_fg_videoram[offset]);
275275   m_fg_tilemap->mark_tile_dirty(offset);
276276}
277277
278278WRITE16_MEMBER(nmg5_state::bg_videoram_w)
279279{
280   COMBINE_DATA(&m_bg_videoram.target()[offset]);
280   COMBINE_DATA(&m_bg_videoram[offset]);
281281   m_bg_tilemap->mark_tile_dirty(offset);
282282}
283283
r14899r14900
866866   {
867867      for (x = 0; x < xxx; x++)
868868      {
869         pix = (state->m_bitmap.target()[count] & 0xf000) >> 12;
869         pix = (state->m_bitmap[count] & 0xf000) >> 12;
870870         if (pix) bitmap.pix16(y + yoff, x * 4 + 0 + xoff) = pix + 0x300;
871         pix = (state->m_bitmap.target()[count] & 0x0f00) >> 8;
871         pix = (state->m_bitmap[count] & 0x0f00) >> 8;
872872         if (pix) bitmap.pix16(y + yoff, x * 4 + 1 + xoff) = pix + 0x300;
873         pix = (state->m_bitmap.target()[count] & 0x00f0) >> 4;
873         pix = (state->m_bitmap[count] & 0x00f0) >> 4;
874874         if (pix) bitmap.pix16(y + yoff, x * 4 + 2 + xoff) = pix + 0x300;
875         pix = (state->m_bitmap.target()[count] & 0x000f) >> 0;
875         pix = (state->m_bitmap[count] & 0x000f) >> 0;
876876         if (pix) bitmap.pix16(y + yoff, x * 4 + 3 + xoff) = pix + 0x300;
877877
878878         count++;
r14899r14900
885885{
886886   nmg5_state *state = screen.machine().driver_data<nmg5_state>();
887887
888   state->m_bg_tilemap->set_scrolly(0, state->m_scroll_ram.target()[3] + 9);
889   state->m_bg_tilemap->set_scrollx(0, state->m_scroll_ram.target()[2] + 3);
890   state->m_fg_tilemap->set_scrolly(0, state->m_scroll_ram.target()[1] + 9);
891   state->m_fg_tilemap->set_scrollx(0, state->m_scroll_ram.target()[0] - 1);
888   state->m_bg_tilemap->set_scrolly(0, state->m_scroll_ram[3] + 9);
889   state->m_bg_tilemap->set_scrollx(0, state->m_scroll_ram[2] + 3);
890   state->m_fg_tilemap->set_scrolly(0, state->m_scroll_ram[1] + 9);
891   state->m_fg_tilemap->set_scrollx(0, state->m_scroll_ram[0] - 1);
892892
893893   state->m_bg_tilemap->draw(bitmap, cliprect, 0, 0);
894894
src/mame/drivers/wink.c
r14899r14900
4343static TILE_GET_INFO( get_bg_tile_info )
4444{
4545   wink_state *state = machine.driver_data<wink_state>();
46   UINT8 *videoram = state->m_videoram.target();
46   UINT8 *videoram = state->m_videoram;
4747   int code = videoram[tile_index];
4848   code |= 0x200 * state->m_tile_bank;
4949
r14899r14900
7171
7272WRITE8_MEMBER(wink_state::bgram_w)
7373{
74   UINT8 *videoram = m_videoram.target();
74   UINT8 *videoram = m_videoram;
7575   videoram[offset] = data;
7676   m_bg_tilemap->mark_tile_dirty(offset);
7777}
src/mame/drivers/safarir.c
r14899r14900
5656public:
5757   safarir_state(const machine_config &mconfig, device_type type, const char *tag)
5858      : driver_device(mconfig, type, tag) ,
59      m_bg_scroll(*this, "bg_scroll"){ }
59      m_bg_scroll(*this, "bg_scroll"),
60      m_ram(*this, "ram") { }
6061
6162   UINT8 *m_ram_1;
6263   UINT8 *m_ram_2;
63   size_t m_ram_size;
6464   UINT8 m_ram_bank;
6565   tilemap_t *m_bg_tilemap;
6666   tilemap_t *m_fg_tilemap;
6767   required_shared_ptr<UINT8> m_bg_scroll;
68   required_shared_ptr<UINT8> m_ram;
6869   UINT8 m_port_last;
6970   UINT8 m_port_last2;
7071   samples_device *m_samples;
r14899r14900
201202{
202203   safarir_state *state = screen.machine().driver_data<safarir_state>();
203204
204   state->m_bg_tilemap->set_scrollx(0, *state->m_bg_scroll.target());
205   state->m_bg_tilemap->set_scrollx(0, *state->m_bg_scroll);
205206
206207   state->m_bg_tilemap->draw(bitmap, cliprect, 0, 0);
207208   state->m_fg_tilemap->draw(bitmap, cliprect, 0, 0);
r14899r14900
316317{
317318   safarir_state *state = machine.driver_data<safarir_state>();
318319
319   state->m_ram_1 = auto_alloc_array(machine, UINT8, state->m_ram_size);
320   state->m_ram_2 = auto_alloc_array(machine, UINT8, state->m_ram_size);
320   state->m_ram_1 = auto_alloc_array(machine, UINT8, state->m_ram.bytes());
321   state->m_ram_2 = auto_alloc_array(machine, UINT8, state->m_ram.bytes());
321322   state->m_port_last = 0;
322323   state->m_port_last2 = 0;
323324   state->m_samples = machine.device<samples_device>("samples");
324325
325326   /* setup for save states */
326   state->save_pointer(NAME(state->m_ram_1), state->m_ram_size);
327   state->save_pointer(NAME(state->m_ram_2), state->m_ram_size);
327   state->save_pointer(NAME(state->m_ram_1), state->m_ram.bytes());
328   state->save_pointer(NAME(state->m_ram_2), state->m_ram.bytes());
328329   state->save_item(NAME(state->m_ram_bank));
329330   state->save_item(NAME(state->m_port_last));
330331   state->save_item(NAME(state->m_port_last2));
r14899r14900
340341
341342static ADDRESS_MAP_START( main_map, AS_PROGRAM, 8, safarir_state )
342343   AM_RANGE(0x0000, 0x17ff) AM_ROM
343   AM_RANGE(0x2000, 0x27ff) AM_READWRITE(ram_r, ram_w) AM_SIZE(m_ram_size)
344   AM_RANGE(0x2000, 0x27ff) AM_READWRITE(ram_r, ram_w) AM_SHARE("ram")
344345   AM_RANGE(0x2800, 0x2800) AM_MIRROR(0x03ff) AM_READNOP AM_WRITE(ram_bank_w)
345346   AM_RANGE(0x2c00, 0x2cff) AM_MIRROR(0x03ff) AM_READNOP AM_WRITEONLY AM_SHARE("bg_scroll")
346347   AM_RANGE(0x3000, 0x30ff) AM_MIRROR(0x03ff) AM_WRITE(safarir_audio_w)   /* goes to SN76477 */
src/mame/drivers/pzletime.c
r14899r14900
5757static TILE_GET_INFO( get_mid_tile_info )
5858{
5959   pzletime_state *state = machine.driver_data<pzletime_state>();
60   int tileno = state->m_mid_videoram.target()[tile_index] & 0x0fff;
61   int colour = state->m_mid_videoram.target()[tile_index] & 0xf000;
60   int tileno = state->m_mid_videoram[tile_index] & 0x0fff;
61   int colour = state->m_mid_videoram[tile_index] & 0xf000;
6262   colour = colour >> 12;
6363   SET_TILE_INFO(2, tileno, colour, 0);
6464}
r14899r14900
6666static TILE_GET_INFO( get_txt_tile_info )
6767{
6868   pzletime_state *state = machine.driver_data<pzletime_state>();
69   int tileno = state->m_txt_videoram.target()[tile_index] & 0x0fff;
70   int colour = state->m_txt_videoram.target()[tile_index] & 0xf000;
69   int tileno = state->m_txt_videoram[tile_index] & 0x0fff;
70   int colour = state->m_txt_videoram[tile_index] & 0xf000;
7171   colour = colour >> 12;
7272
7373   SET_TILE_INFO(0, tileno, colour, 0);
r14899r14900
9494
9595   bitmap.fill(screen.machine().pens[0], cliprect); //bg pen
9696
97   state->m_txt_tilemap->set_scrolly(0, state->m_tilemap_regs.target()[0] - 3);
98   state->m_txt_tilemap->set_scrollx(0, state->m_tilemap_regs.target()[1]);
97   state->m_txt_tilemap->set_scrolly(0, state->m_tilemap_regs[0] - 3);
98   state->m_txt_tilemap->set_scrollx(0, state->m_tilemap_regs[1]);
9999
100   state->m_mid_tilemap->set_scrolly(0, state->m_tilemap_regs.target()[2] - 3);
101   state->m_mid_tilemap->set_scrollx(0, state->m_tilemap_regs.target()[3] - 7);
100   state->m_mid_tilemap->set_scrolly(0, state->m_tilemap_regs[2] - 3);
101   state->m_mid_tilemap->set_scrollx(0, state->m_tilemap_regs[3] - 7);
102102
103   if (state->m_video_regs.target()[2] & 1)
103   if (state->m_video_regs[2] & 1)
104104   {
105105      count = 0;
106106
r14899r14900
108108      {
109109         for (x = 0; x < 512; x++)
110110         {
111            if (state->m_bg_videoram.target()[count] & 0x8000)
112               bitmap.pix16((y - 18) & 0xff, (x - 32) & 0x1ff) = 0x300 + (state->m_bg_videoram.target()[count] & 0x7fff);
111            if (state->m_bg_videoram[count] & 0x8000)
112               bitmap.pix16((y - 18) & 0xff, (x - 32) & 0x1ff) = 0x300 + (state->m_bg_videoram[count] & 0x7fff);
113113
114114            count++;
115115         }
r14899r14900
119119   state->m_mid_tilemap->draw(bitmap, cliprect, 0, 0);
120120
121121   {
122      UINT16 *spriteram = state->m_spriteram.target();
122      UINT16 *spriteram = state->m_spriteram;
123123      int offs, spr_offs, colour, sx, sy;
124124
125125      for(offs = 0; offs < 0x2000 / 2; offs += 4)
r14899r14900
147147
148148WRITE16_MEMBER(pzletime_state::mid_videoram_w)
149149{
150   COMBINE_DATA(&m_mid_videoram.target()[offset]);
150   COMBINE_DATA(&m_mid_videoram[offset]);
151151   m_mid_tilemap->mark_tile_dirty(offset);
152152}
153153
154154WRITE16_MEMBER(pzletime_state::txt_videoram_w)
155155{
156   COMBINE_DATA(&m_txt_videoram.target()[offset]);
156   COMBINE_DATA(&m_txt_videoram[offset]);
157157   m_txt_tilemap->mark_tile_dirty(offset);
158158}
159159
r14899r14900
179179{
180180   int i;
181181
182   COMBINE_DATA(&m_video_regs.target()[offset]);
182   COMBINE_DATA(&m_video_regs[offset]);
183183
184184   if (offset == 0)
185185   {
186      if (m_video_regs.target()[0] > 0)
186      if (m_video_regs[0] > 0)
187187      {
188188         for (i = 0; i < 0x300; i++)
189189         {
190            palette_set_pen_contrast(machine(), i, (double)0x8000/(double)m_video_regs.target()[0]);
190            palette_set_pen_contrast(machine(), i, (double)0x8000/(double)m_video_regs[0]);
191191         }
192192      }
193193   }
194194   else if (offset == 1)
195195   {
196      if (m_video_regs.target()[1] > 0)
196      if (m_video_regs[1] > 0)
197197      {
198198         for (i = 0x300; i < 32768 + 0x300; i++)
199199         {
200            palette_set_pen_contrast(machine(), i, (double)0x8000/(double)m_video_regs.target()[1]);
200            palette_set_pen_contrast(machine(), i, (double)0x8000/(double)m_video_regs[1]);
201201         }
202202      }
203203   }
src/mame/drivers/funkball.c
r14899r14900
11111111   kbdc8042_init(machine, &at8042);
11121112
11131113   /* defaults, otherwise it won't boot */
1114   state->m_unk_ram.target()[0x010/4] = 0x2f8d85ff;
1115   state->m_unk_ram.target()[0x018/4] = 0x000018c5;
1114   state->m_unk_ram[0x010/4] = 0x2f8d85ff;
1115   state->m_unk_ram[0x018/4] = 0x000018c5;
11161116}
11171117
11181118static MACHINE_RESET( funkball )
src/mame/drivers/tmspoker.c
r14899r14900
235235
236236WRITE8_MEMBER(tmspoker_state::tmspoker_videoram_w)
237237{
238   m_videoram.target()[offset] = data;
238   m_videoram[offset] = data;
239239   m_bg_tilemap->mark_tile_dirty(offset);
240240}
241241
r14899r14900
249249    ---- ----   seems unused.
250250*/
251251   tmspoker_state *state = machine.driver_data<tmspoker_state>();
252   int code = state->m_videoram.target()[tile_index];
252   int code = state->m_videoram[tile_index];
253253
254254   SET_TILE_INFO( 0 /* bank */, code, 0 /* color */, 0);
255255}
src/mame/drivers/mirax.c
r14899r14900
167167   {
168168      for (x=0;x<32;x++)
169169      {
170         int tile = state->m_videoram.target()[32*y+x];
171         int color = (state->m_colorram.target()[x*2]<<8) | (state->m_colorram.target()[(x*2)+1]);
170         int tile = state->m_videoram[32*y+x];
171         int color = (state->m_colorram[x*2]<<8) | (state->m_colorram[(x*2)+1]);
172172         int x_scroll = (color & 0xff00)>>8;
173173         tile |= ((color & 0xe0)<<3);
174174
r14899r14900
189189static void draw_sprites(running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect)
190190{
191191   mirax_state *state = machine.driver_data<mirax_state>();
192   UINT8 *spriteram = state->m_spriteram.target();
192   UINT8 *spriteram = state->m_spriteram;
193193   int count;
194194
195195   for(count=0;count<0x200;count+=4)
src/mame/drivers/cardline.c
r14899r14900
4545
4646
4747#define DRAW_TILE(machine, offset, transparency) drawgfx_transpen(bitmap, cliprect, (machine).gfx[0],\
48               (state->m_videoram.target()[index+offset] | (state->m_colorram.target()[index+offset]<<8))&0x3fff,\
49               (state->m_colorram.target()[index+offset]&0x80)>>7,\
48               (state->m_videoram[index+offset] | (state->m_colorram[index+offset]<<8))&0x3fff,\
49               (state->m_colorram[index+offset]&0x80)>>7,\
5050               0,0,\
5151               x<<3, y<<3,\
5252               transparency?transparency:(UINT32)-1);
r14899r14900
8080WRITE8_MEMBER(cardline_state::vram_w)
8181{
8282   offset+=0x1000*((m_video&2)>>1);
83   m_videoram.target()[offset]=data;
83   m_videoram[offset]=data;
8484}
8585
8686WRITE8_MEMBER(cardline_state::attr_w)
8787{
8888   offset+=0x1000*((m_video&2)>>1);
89   m_colorram.target()[offset]=data;
89   m_colorram[offset]=data;
9090}
9191
9292WRITE8_MEMBER(cardline_state::video_w)
src/mame/drivers/dlair.c
r14899r14900
225225static SCREEN_UPDATE_IND16( dleuro )
226226{
227227   dlair_state *state = screen.machine().driver_data<dlair_state>();
228   UINT8 *videoram = state->m_videoram.target();
228   UINT8 *videoram = state->m_videoram;
229229   int x, y;
230230
231231   /* redraw the overlay */
src/mame/drivers/jollyjgr.c
r14899r14900
145145
146146WRITE8_MEMBER(jollyjgr_state::jollyjgr_videoram_w)
147147{
148   m_videoram.target()[offset] = data;
148   m_videoram[offset] = data;
149149   m_bg_tilemap->mark_tile_dirty(offset);
150150}
151151
r14899r14900
165165      m_bg_tilemap->set_scrolly(offset >> 1, data);
166166   }
167167
168   m_colorram.target()[offset] = data;
168   m_colorram[offset] = data;
169169}
170170
171171WRITE8_MEMBER(jollyjgr_state::jollyjgr_misc_w)
r14899r14900
437437static TILE_GET_INFO( get_bg_tile_info )
438438{
439439   jollyjgr_state *state = machine.driver_data<jollyjgr_state>();
440   int color = state->m_colorram.target()[((tile_index & 0x1f) << 1) | 1] & 7;
440   int color = state->m_colorram[((tile_index & 0x1f) << 1) | 1] & 7;
441441   int region = (state->m_tilemap_bank & 0x20) ? 2 : 0;
442   SET_TILE_INFO(region, state->m_videoram.target()[tile_index], color, 0);
442   SET_TILE_INFO(region, state->m_videoram[tile_index], color, 0);
443443}
444444
445445static VIDEO_START( jollyjgr )
r14899r14900
465465      {
466466         for(i = 0; i < 8; i++)
467467         {
468            bit0 = (state->m_bitmap.target()[count] >> i) & 1;
469            bit1 = (state->m_bitmap.target()[count + 0x2000] >> i) & 1;
470            bit2 = (state->m_bitmap.target()[count + 0x4000] >> i) & 1;
468            bit0 = (state->m_bitmap[count] >> i) & 1;
469            bit1 = (state->m_bitmap[count + 0x2000] >> i) & 1;
470            bit2 = (state->m_bitmap[count + 0x4000] >> i) & 1;
471471            color = bit0 | (bit1 << 1) | (bit2 << 2);
472472
473473            if(color)
r14899r14900
491491static SCREEN_UPDATE_IND16( jollyjgr )
492492{
493493   jollyjgr_state *state = screen.machine().driver_data<jollyjgr_state>();
494   UINT8 *spriteram = state->m_spriteram.target();
494   UINT8 *spriteram = state->m_spriteram;
495495   int offs;
496496
497497   bitmap.fill(32, cliprect);
r14899r14900
556556    Assume bullets to look the same as on Galaxian hw,
557557    that is, simply 4 pixels. Colours are unknown. */
558558   for (int offs=0;offs<0x10;offs+=2) {
559      UINT8 sy=~state->m_bulletram.target()[offs];
560      UINT8 sx=~state->m_bulletram.target()[offs|1];
559      UINT8 sy=~state->m_bulletram[offs];
560      UINT8 sx=~state->m_bulletram[offs|1];
561561      UINT16 bc=(offs<4)?
562562         32+7: // player, white
563563         32+3; // enemy, yellow
src/mame/drivers/ssfindo.c
r14899r14900
262262         for(y=0;y<256;y++)
263263            for(x=0;x<320;x+=4)
264264            {
265               bitmap.pix16(y, x+0) = state->m_vram.target()[s]&0xff;
266               bitmap.pix16(y, x+1) = (state->m_vram.target()[s]>>8)&0xff;
267               bitmap.pix16(y, x+2) = (state->m_vram.target()[s]>>16)&0xff;
268               bitmap.pix16(y, x+3) = (state->m_vram.target()[s]>>24)&0xff;
265               bitmap.pix16(y, x+0) = state->m_vram[s]&0xff;
266               bitmap.pix16(y, x+1) = (state->m_vram[s]>>8)&0xff;
267               bitmap.pix16(y, x+2) = (state->m_vram[s]>>16)&0xff;
268               bitmap.pix16(y, x+3) = (state->m_vram[s]>>24)&0xff;
269269               s++;
270270            }
271271      }
src/mame/drivers/peplus.c
r14899r14900
371371
372372WRITE8_MEMBER(peplus_state::peplus_crtc_display_w)
373373{
374   UINT8 *videoram = m_videoram.target();
374   UINT8 *videoram = m_videoram;
375375   videoram[m_vid_address] = data;
376   m_palette_ram[m_vid_address] = m_io_port.target()[1];
377   m_palette_ram2[m_vid_address] = m_io_port.target()[3];
376   m_palette_ram[m_vid_address] = m_io_port[1];
377   m_palette_ram2[m_vid_address] = m_io_port[3];
378378
379379   m_bg_tilemap->mark_tile_dirty(m_vid_address);
380380
r14899r14900
384384
385385WRITE8_MEMBER(peplus_state::peplus_io_w)
386386{
387   m_io_port.target()[offset] = data;
387   m_io_port[offset] = data;
388388}
389389
390390WRITE8_MEMBER(peplus_state::peplus_duart_w)
r14899r14900
403403      peplus_load_superdata(machine(), bank_name);
404404   }
405405
406   m_cmos_ram.target()[offset] = data;
406   m_cmos_ram[offset] = data;
407407}
408408
409409WRITE8_MEMBER(peplus_state::peplus_s3000_w)
410410{
411   m_s3000_ram.target()[offset] = data;
411   m_s3000_ram[offset] = data;
412412}
413413
414414WRITE8_MEMBER(peplus_state::peplus_s5000_w)
415415{
416   m_s5000_ram.target()[offset] = data;
416   m_s5000_ram[offset] = data;
417417}
418418
419419WRITE8_MEMBER(peplus_state::peplus_s7000_w)
420420{
421   m_s7000_ram.target()[offset] = data;
421   m_s7000_ram[offset] = data;
422422}
423423
424424WRITE8_MEMBER(peplus_state::peplus_sb000_w)
425425{
426   m_sb000_ram.target()[offset] = data;
426   m_sb000_ram[offset] = data;
427427}
428428
429429WRITE8_MEMBER(peplus_state::peplus_sd000_w)
430430{
431   m_sd000_ram.target()[offset] = data;
431   m_sd000_ram[offset] = data;
432432}
433433
434434WRITE8_MEMBER(peplus_state::peplus_sf000_w)
435435{
436   m_sf000_ram.target()[offset] = data;
436   m_sf000_ram[offset] = data;
437437}
438438
439439WRITE8_MEMBER(peplus_state::peplus_output_bank_a_w)
r14899r14900
491491
492492READ8_MEMBER(peplus_state::peplus_io_r)
493493{
494    return m_io_port.target()[offset];
494    return m_io_port[offset];
495495}
496496
497497READ8_MEMBER(peplus_state::peplus_duart_r)
r14899r14900
502502
503503READ8_MEMBER(peplus_state::peplus_cmos_r)
504504{
505   return m_cmos_ram.target()[offset];
505   return m_cmos_ram[offset];
506506}
507507
508508READ8_MEMBER(peplus_state::peplus_s3000_r)
509509{
510   return m_s3000_ram.target()[offset];
510   return m_s3000_ram[offset];
511511}
512512
513513READ8_MEMBER(peplus_state::peplus_s5000_r)
514514{
515   return m_s5000_ram.target()[offset];
515   return m_s5000_ram[offset];
516516}
517517
518518READ8_MEMBER(peplus_state::peplus_s7000_r)
519519{
520   return m_s7000_ram.target()[offset];
520   return m_s7000_ram[offset];
521521}
522522
523523READ8_MEMBER(peplus_state::peplus_sb000_r)
524524{
525   return m_sb000_ram.target()[offset];
525   return m_sb000_ram[offset];
526526}
527527
528528READ8_MEMBER(peplus_state::peplus_sd000_r)
529529{
530   return m_sd000_ram.target()[offset];
530   return m_sd000_ram[offset];
531531}
532532
533533READ8_MEMBER(peplus_state::peplus_sf000_r)
534534{
535   return m_sf000_ram.target()[offset];
535   return m_sf000_ram[offset];
536536}
537537
538538/* Last Color in Every Palette is bgcolor */
r14899r14900
662662static TILE_GET_INFO( get_bg_tile_info )
663663{
664664   peplus_state *state = machine.driver_data<peplus_state>();
665   UINT8 *videoram = state->m_videoram.target();
665   UINT8 *videoram = state->m_videoram;
666666   int pr = state->m_palette_ram[tile_index];
667667   int pr2 = state->m_palette_ram2[tile_index];
668668   int vr = videoram[tile_index];
r14899r14900
10191019   peplus_state *state = machine.driver_data<peplus_state>();
10201020
10211021   // pepp0158
1022   state->m_program_ram.target()[0xa19f] = 0x22; // RET - Disable Memory Test
1023   state->m_program_ram.target()[0xddea] = 0x22; // RET - Disable Program Checksum
1022   state->m_program_ram[0xa19f] = 0x22; // RET - Disable Memory Test
1023   state->m_program_ram[0xddea] = 0x22; // RET - Disable Program Checksum
10241024   state->m_autohold_addr = 0x5ffe; // AutoHold Address
10251025
10261026   // pepp0188
1027   state->m_program_ram.target()[0x9a8d] = 0x22; // RET - Disable Memory Test
1028   state->m_program_ram.target()[0xf429] = 0x22; // RET - Disable Program Checksum
1027   state->m_program_ram[0x9a8d] = 0x22; // RET - Disable Memory Test
1028   state->m_program_ram[0xf429] = 0x22; // RET - Disable Program Checksum
10291029   state->m_autohold_addr = 0x742f; // AutoHold Address
10301030
10311031   // pepp0516
1032   state->m_program_ram.target()[0x9a24] = 0x22; // RET - Disable Memory Test
1033   state->m_program_ram.target()[0xd61d] = 0x22; // RET - Disable Program Checksum
1032   state->m_program_ram[0x9a24] = 0x22; // RET - Disable Memory Test
1033   state->m_program_ram[0xd61d] = 0x22; // RET - Disable Program Checksum
10341034   state->m_autohold_addr = 0x5e7e; // AutoHold Address
10351035
10361036   if (state->m_autohold_addr)
1037      state->m_program_ram.target()[state->m_autohold_addr] = input_port_read_safe(machine, "AUTOHOLD",0x00) & 0x01;
1037      state->m_program_ram[state->m_autohold_addr] = input_port_read_safe(machine, "AUTOHOLD",0x00) & 0x01;
10381038#endif
10391039}
10401040
src/mame/drivers/ddayjlc.c
r14899r14900
166166   if (!offset)
167167      m_bg_tilemap->set_scrollx(0, data + 8);
168168
169   m_bgram.target()[offset] = data;
169   m_bgram[offset] = data;
170170   m_bg_tilemap->mark_tile_dirty(offset & 0x3ff);
171171}
172172
173173WRITE8_MEMBER(ddayjlc_state::ddayjlc_videoram_w)
174174{
175   m_videoram.target()[offset] = data;
175   m_videoram[offset] = data;
176176}
177177
178178
r14899r14900
371371static TILE_GET_INFO( get_tile_info_bg )
372372{
373373   ddayjlc_state *state = machine.driver_data<ddayjlc_state>();
374   int code = state->m_bgram.target()[tile_index] + ((state->m_bgram.target()[tile_index + 0x400] & 0x08) << 5);
375   int color = (state->m_bgram.target()[tile_index + 0x400] & 0x7);
376   color |= (state->m_bgram.target()[tile_index + 0x400] & 0x40) >> 3;
374   int code = state->m_bgram[tile_index] + ((state->m_bgram[tile_index + 0x400] & 0x08) << 5);
375   int color = (state->m_bgram[tile_index + 0x400] & 0x7);
376   color |= (state->m_bgram[tile_index + 0x400] & 0x40) >> 3;
377377
378378   SET_TILE_INFO(2, code, color, 0);
379379}
r14899r14900
392392
393393   for (i = 0; i < 0x400; i += 4)
394394   {
395      UINT8  flags = state->m_spriteram.target()[i + 2];
396      UINT8  y = 256 - state->m_spriteram.target()[i + 0] - 8;
397      UINT16 code = state->m_spriteram.target()[i + 1];
398      UINT8  x = state->m_spriteram.target()[i + 3] - 16;
395      UINT8  flags = state->m_spriteram[i + 2];
396      UINT8  y = 256 - state->m_spriteram[i + 0] - 8;
397      UINT16 code = state->m_spriteram[i + 1];
398      UINT8  x = state->m_spriteram[i + 3] - 16;
399399      UINT8  xflip = flags & 0x80;
400400      UINT8  yflip = (code & 0x80);
401401      UINT8  color = flags & 0xf;
r14899r14900
411411      for (y = 0; y < 32; y++)
412412         for (x = 0; x < 32; x++)
413413         {
414            c = state->m_videoram.target()[y * 32 + x];
414            c = state->m_videoram[y * 32 + x];
415415            if (x > 1 && x < 30)
416416               drawgfx_transpen(bitmap, cliprect, screen.machine().gfx[1], c + state->m_char_bank * 0x100, 2, 0, 0, x*8, y*8, 0);
417417            else
src/mame/drivers/dorachan.c
r14899r14900
101101      /* the need for +1 is extremely unusual, but definetely correct */
102102      offs_t color_address = ((((offs << 2) & 0x03e0) | (offs >> 8)) + 1) & 0x03ff;
103103
104      UINT8 data = state->m_videoram.target()[offs];
104      UINT8 data = state->m_videoram[offs];
105105
106106      if (state->m_flip_screen)
107107         fore_color = (color_map_base[color_address] >> 3) & 0x07;
src/mame/drivers/quizpun2.c
r14899r14900
120120static TILE_GET_INFO( get_bg_tile_info )
121121{
122122   quizpun2_state *state = machine.driver_data<quizpun2_state>();
123   UINT16 code = state->m_bg_ram.target()[ tile_index * 2 ] + state->m_bg_ram.target()[ tile_index * 2 + 1 ] * 256;
123   UINT16 code = state->m_bg_ram[ tile_index * 2 ] + state->m_bg_ram[ tile_index * 2 + 1 ] * 256;
124124   SET_TILE_INFO(0, code, 0, 0);
125125}
126126
127127static TILE_GET_INFO( get_fg_tile_info )
128128{
129129   quizpun2_state *state = machine.driver_data<quizpun2_state>();
130   UINT16 code  = state->m_fg_ram.target()[ tile_index * 4 ] + state->m_fg_ram.target()[ tile_index * 4 + 1 ] * 256;
131   UINT8  color = state->m_fg_ram.target()[ tile_index * 4 + 2 ];
130   UINT16 code  = state->m_fg_ram[ tile_index * 4 ] + state->m_fg_ram[ tile_index * 4 + 1 ] * 256;
131   UINT8  color = state->m_fg_ram[ tile_index * 4 + 2 ];
132132   SET_TILE_INFO(1, code, color & 0x0f, 0);
133133}
134134
135135WRITE8_MEMBER(quizpun2_state::bg_ram_w)
136136{
137   m_bg_ram.target()[offset] = data;
137   m_bg_ram[offset] = data;
138138   m_bg_tmap->mark_tile_dirty(offset/2);
139139}
140140
141141WRITE8_MEMBER(quizpun2_state::fg_ram_w)
142142{
143   m_fg_ram.target()[offset] = data;
143   m_fg_ram[offset] = data;
144144   m_fg_tmap->mark_tile_dirty(offset/4);
145145}
146146
src/mame/drivers/egghunt.c
r14899r14900
119119{
120120   egghunt_state *state = machine.driver_data<egghunt_state>();
121121   int code = ((state->m_bgram[tile_index * 2 + 1] << 8) | state->m_bgram[tile_index * 2]) & 0x3fff;
122   int colour = state->m_atram.target()[tile_index] & 0x3f;
122   int colour = state->m_atram[tile_index] & 0x3f;
123123
124124   if(code & 0x2000)
125125   {
r14899r14900
161161
162162WRITE8_MEMBER(egghunt_state::egghunt_atram_w)
163163{
164   m_atram.target()[offset] = data;
164   m_atram[offset] = data;
165165   m_bg_tilemap->mark_tile_dirty(offset);
166166}
167167
src/mame/drivers/splus.c
r14899r14900
183183#endif
184184   }
185185
186   m_io_port.target()[offset] = data;
186   m_io_port[offset] = data;
187187}
188188
189189WRITE8_MEMBER(splus_state::splus_load_pulse_w)
190190{
191191
192192//  UINT8 out = 0;
193//    out = ((~m_io_port.target()[1] & 0xf0)>>4); // Output Bank
193//    out = ((~m_io_port[1] & 0xf0)>>4); // Output Bank
194194}
195195
196196WRITE8_MEMBER(splus_state::splus_serial_w)
197197{
198198
199199    UINT8 out = 0;
200    out = ((~m_io_port.target()[1] & 0xe0)>>5); // Output Bank
200    out = ((~m_io_port[1] & 0xe0)>>5); // Output Bank
201201
202202   switch (out)
203203   {
r14899r14900
346346    seg = ((~data & 0xf0)>>4); // Segment Number
347347    val = (~data & 0x0f); // Digit Value
348348
349    // Need to add ~m_io_port.target()[1]-1 to seg value
350    if (seg < 0x0a && (m_io_port.target()[1] & 0xe0) == 0xe0)
349    // Need to add ~m_io_port[1]-1 to seg value
350    if (seg < 0x0a && (m_io_port[1] & 0xe0) == 0xe0)
351351        output_set_digit_value(seg, ls48_map[val]);
352352}
353353
r14899r14900
378378
379379    UINT8 in = 0x00;
380380    UINT8 val = 0x00;
381    in = ((~m_io_port.target()[1] & 0xe0)>>5); // Input Bank
381    in = ((~m_io_port[1] & 0xe0)>>5); // Input Bank
382382
383383   switch (in)
384384   {
r14899r14900
512512
513513READ8_MEMBER(splus_state::splus_m_reel_ram_r)
514514{
515   return m_reel_ram.target()[offset];
515   return m_reel_ram[offset];
516516}
517517
518518READ8_MEMBER(splus_state::splus_io_r)
519519{
520520
521521    if (offset == 3)
522        return m_io_port.target()[offset] & 0xf3; // Ignore Int0 and Int1, or machine will loop forever waiting
522        return m_io_port[offset] & 0xf3; // Ignore Int0 and Int1, or machine will loop forever waiting
523523    else
524       return m_io_port.target()[offset];
524       return m_io_port[offset];
525525}
526526
527527READ8_MEMBER(splus_state::splus_duart_r)
src/mame/drivers/gpworld.c
r14899r14900
5050   gpworld_state(const machine_config &mconfig, device_type type, const char *tag)
5151      : driver_device(mconfig, type, tag),
5252        m_laserdisc(*this, "laserdisc") ,
53      m_sprite_RAM(*this, "sprite_RAM"),
54      m_palette_RAM(*this, "palette_RAM"),
55      m_tile_RAM(*this, "tile_RAM"){ }
53      m_sprite_ram(*this, "sprite_ram"),
54      m_palette_ram(*this, "palette_ram"),
55      m_tile_ram(*this, "tile_ram"){ }
5656
5757   UINT8 m_nmi_enable;
5858   UINT8 m_start_lamp;
r14899r14900
6060   UINT8 m_ldp_write_latch;
6161   UINT8 m_brake_gas;
6262   required_device<pioneer_ldv1000_device> m_laserdisc;
63   required_shared_ptr<UINT8> m_sprite_RAM;
64   required_shared_ptr<UINT8> m_palette_RAM;
65   required_shared_ptr<UINT8> m_tile_RAM;
63   required_shared_ptr<UINT8> m_sprite_ram;
64   required_shared_ptr<UINT8> m_palette_ram;
65   required_shared_ptr<UINT8> m_tile_ram;
6666   DECLARE_READ8_MEMBER(ldp_read);
6767   DECLARE_READ8_MEMBER(pedal_in);
6868   DECLARE_WRITE8_MEMBER(ldp_write);
r14899r14900
9292      {
9393         int current_screen_character = (characterY*64) + characterX;
9494
95         drawgfx_transpen(bitmap, cliprect, machine.gfx[0], state->m_tile_RAM.target()[current_screen_character],
95         drawgfx_transpen(bitmap, cliprect, machine.gfx[0], state->m_tile_ram[current_screen_character],
9696               characterY, 0, 0, characterX*8, characterY*8, 0);
9797      }
9898   }
r14899r14900
130130   /* Heisted from Daphne which heisted it from MAME */
131131   for (i = 0; i < 0x800; i += 8)
132132   {
133      UINT8 *spr_reg = state->m_sprite_RAM + i;
133      UINT8 *spr_reg = state->m_sprite_ram + i;
134134
135135      if (spr_reg[SPR_Y_BOTTOM] && spr_reg[SPR_X_LO] != 0xff)
136136      {
r14899r14900
278278   /* This is all just a (bad) guess */
279279   int pal_index, r, g, b, a;
280280
281   m_palette_RAM.target()[offset] = data;
281   m_palette_ram[offset] = data;
282282
283283   /* "Round down" to the nearest palette entry */
284284   pal_index = offset & 0xffe;
285285
286   g = (m_palette_RAM.target()[pal_index]   & 0xf0) << 0;
287   b = (m_palette_RAM.target()[pal_index]   & 0x0f) << 4;
288   r = (m_palette_RAM.target()[pal_index+1] & 0x0f) << 4;
289   a = (m_palette_RAM.target()[pal_index+1] & 0x80) ? 0 : 255;   /* guess */
286   g = (m_palette_ram[pal_index]   & 0xf0) << 0;
287   b = (m_palette_ram[pal_index]   & 0x0f) << 4;
288   r = (m_palette_ram[pal_index+1] & 0x0f) << 4;
289   a = (m_palette_ram[pal_index+1] & 0x80) ? 0 : 255;   /* guess */
290290
291291   /* logerror("PAL WRITE index : %x  rgb : %d %d %d (real %x) at %x\n", pal_index, r,g,b, data, offset); */
292292
r14899r14900
296296/* PROGRAM MAP */
297297static ADDRESS_MAP_START( mainmem, AS_PROGRAM, 8, gpworld_state )
298298   AM_RANGE(0x0000,0xbfff) AM_ROM
299   AM_RANGE(0xc000,0xc7ff) AM_RAM AM_SHARE("sprite_RAM")
300   AM_RANGE(0xc800,0xcfff) AM_WRITE(palette_write) AM_SHARE("palette_RAM")   /* The memory test reads at 0xc800 */
301   AM_RANGE(0xd000,0xd7ff) AM_RAM AM_SHARE("tile_RAM")
299   AM_RANGE(0xc000,0xc7ff) AM_RAM AM_SHARE("sprite_ram")
300   AM_RANGE(0xc800,0xcfff) AM_WRITE(palette_write) AM_SHARE("palette_ram")   /* The memory test reads at 0xc800 */
301   AM_RANGE(0xd000,0xd7ff) AM_RAM AM_SHARE("tile_ram")
302302   AM_RANGE(0xd800,0xd800) AM_READWRITE(ldp_read,ldp_write)
303303/*  AM_RANGE(0xd801,0xd801) AM_READ_LEGACY(???) */
304304   AM_RANGE(0xda00,0xda00) AM_READ_PORT("INWHEEL")   //8255 here....
src/mame/drivers/jokrwild.c
r14899r14900
121121
122122WRITE8_MEMBER(jokrwild_state::jokrwild_videoram_w)
123123{
124   m_videoram.target()[offset] = data;
124   m_videoram[offset] = data;
125125   m_bg_tilemap->mark_tile_dirty(offset);
126126}
127127
128128
129129WRITE8_MEMBER(jokrwild_state::jokrwild_colorram_w)
130130{
131   m_colorram.target()[offset] = data;
131   m_colorram[offset] = data;
132132   m_bg_tilemap->mark_tile_dirty(offset);
133133}
134134
r14899r14900
141141    xx-- ----   bank select.
142142    ---- xxxx   color code.
143143*/
144   int attr = state->m_colorram.target()[tile_index];
145   int code = state->m_videoram.target()[tile_index] | ((attr & 0xc0) << 2);
144   int attr = state->m_colorram[tile_index];
145   int code = state->m_videoram[tile_index] | ((attr & 0xc0) << 2);
146146   int color = (attr & 0x0f);
147147
148148   SET_TILE_INFO( 0, code , color , 0);
src/mame/drivers/imolagp.c
r14899r14900
496496   imolagp_state *state = device->machine().driver_data<imolagp_state>();
497497
498498#ifdef HLE_COM
499   memcpy(&state->m_slave_workram.target()[0x80], state->m_mComData, state->m_mComCount);
499   memcpy(&state->m_slave_workram[0x80], state->m_mComData, state->m_mComCount);
500500   state->m_mComCount = 0;
501501#endif
502502   device_set_input_line(device, 0, HOLD_LINE);
src/mame/drivers/poker72.c
r14899r14900
4747   {
4848      for (x=0;x<64;x++)
4949      {
50         int tile = ((state->m_vram.target()[count+1] & 0x0f) << 8 ) | (state->m_vram.target()[count+0] & 0xff); //TODO: tile bank
51         int fx = (state->m_vram.target()[count+1] & 0x10);
52         int fy = (state->m_vram.target()[count+1] & 0x20);
53         int color = (state->m_vram.target()[count+1] & 0xc0) >> 6;
50         int tile = ((state->m_vram[count+1] & 0x0f) << 8 ) | (state->m_vram[count+0] & 0xff); //TODO: tile bank
51         int fx = (state->m_vram[count+1] & 0x10);
52         int fy = (state->m_vram[count+1] & 0x20);
53         int color = (state->m_vram[count+1] & 0xc0) >> 6;
5454
5555         tile|= state->m_tile_bank << 12;
5656
r14899r14900
6666WRITE8_MEMBER(poker72_state::poker72_paletteram_w)
6767{
6868   int r,g,b;
69   m_pal.target()[offset] = data;
69   m_pal[offset] = data;
7070
71   r = m_pal.target()[(offset & 0x3ff)+0x000] & 0x3f;
72   g = m_pal.target()[(offset & 0x3ff)+0x400] & 0x3f;
73   b = m_pal.target()[(offset & 0x3ff)+0x800] & 0x3f;
71   r = m_pal[(offset & 0x3ff)+0x000] & 0x3f;
72   g = m_pal[(offset & 0x3ff)+0x400] & 0x3f;
73   b = m_pal[(offset & 0x3ff)+0x800] & 0x3f;
7474
7575   palette_set_color_rgb( machine(), offset & 0x3ff, pal6bit(r), pal6bit(g), pal6bit(b));
7676}
src/mame/drivers/umipoker.c
r14899r14900
6363static TILE_GET_INFO( get_tile_info_0 )
6464{
6565   umipoker_state *state = machine.driver_data<umipoker_state>();
66   int tile = state->m_vram_0.target()[tile_index*2+0];
67   int color = state->m_vram_0.target()[tile_index*2+1] & 0x3f;
66   int tile = state->m_vram_0[tile_index*2+0];
67   int color = state->m_vram_0[tile_index*2+1] & 0x3f;
6868
6969   SET_TILE_INFO(
7070         0,
r14899r14900
7676static TILE_GET_INFO( get_tile_info_1 )
7777{
7878   umipoker_state *state = machine.driver_data<umipoker_state>();
79   int tile = state->m_vram_1.target()[tile_index*2+0];
80   int color = state->m_vram_1.target()[tile_index*2+1] & 0x3f;
79   int tile = state->m_vram_1[tile_index*2+0];
80   int color = state->m_vram_1[tile_index*2+1] & 0x3f;
8181
8282   SET_TILE_INFO(
8383         0,
r14899r14900
8989static TILE_GET_INFO( get_tile_info_2 )
9090{
9191   umipoker_state *state = machine.driver_data<umipoker_state>();
92   int tile = state->m_vram_2.target()[tile_index*2+0];
93   int color = state->m_vram_2.target()[tile_index*2+1] & 0x3f;
92   int tile = state->m_vram_2[tile_index*2+0];
93   int color = state->m_vram_2[tile_index*2+1] & 0x3f;
9494
9595   SET_TILE_INFO(
9696         0,
r14899r14900
102102static TILE_GET_INFO( get_tile_info_3 )
103103{
104104   umipoker_state *state = machine.driver_data<umipoker_state>();
105   int tile = state->m_vram_3.target()[tile_index*2+0];
106   int color = state->m_vram_3.target()[tile_index*2+1] & 0x3f;
105   int tile = state->m_vram_3[tile_index*2+0];
106   int color = state->m_vram_3[tile_index*2+1] & 0x3f;
107107
108108   SET_TILE_INFO(
109109         0,
r14899r14900
159159
160160   machine().scheduler().synchronize(); // force resync
161161
162   return m_z80_wram.target()[offset];
162   return m_z80_wram[offset];
163163}
164164
165165WRITE8_MEMBER(umipoker_state::z80_shared_ram_w)
r14899r14900
167167
168168   machine().scheduler().synchronize(); // force resync
169169
170   m_z80_wram.target()[offset] = data;
170   m_z80_wram[offset] = data;
171171}
172172
173173WRITE16_MEMBER(umipoker_state::umipoker_irq_ack_w)
r14899r14900
187187WRITE16_MEMBER(umipoker_state::umipoker_vram_0_w)
188188{
189189
190   COMBINE_DATA(&m_vram_0.target()[offset]);
190   COMBINE_DATA(&m_vram_0[offset]);
191191   m_tilemap_0->mark_tile_dirty(offset >> 1);
192192}
193193
194194WRITE16_MEMBER(umipoker_state::umipoker_vram_1_w)
195195{
196196
197   COMBINE_DATA(&m_vram_1.target()[offset]);
197   COMBINE_DATA(&m_vram_1[offset]);
198198   m_tilemap_1->mark_tile_dirty(offset >> 1);
199199}
200200
r14899r14900
202202WRITE16_MEMBER(umipoker_state::umipoker_vram_2_w)
203203{
204204
205   COMBINE_DATA(&m_vram_2.target()[offset]);
205   COMBINE_DATA(&m_vram_2[offset]);
206206   m_tilemap_2->mark_tile_dirty(offset >> 1);
207207}
208208
209209WRITE16_MEMBER(umipoker_state::umipoker_vram_3_w)
210210{
211211
212   COMBINE_DATA(&m_vram_3.target()[offset]);
212   COMBINE_DATA(&m_vram_3[offset]);
213213   m_tilemap_3->mark_tile_dirty(offset >> 1);
214214}
215215
src/mame/drivers/gamecstl.c
r14899r14900
152152   gamecstl_state *state = screen.machine().driver_data<gamecstl_state>();
153153   int i, j;
154154   const gfx_element *gfx = screen.machine().gfx[0];
155   UINT32 *cga = state->m_cga_ram.target();
155   UINT32 *cga = state->m_cga_ram;
156156   int index = 0;
157157
158158   bitmap.fill(0, cliprect);
src/mame/drivers/wldarrow.c
r14899r14900
8585      UINT8 y = offs >> 5;
8686      UINT8 x = offs << 3;
8787
88      UINT8 data0 = state->m_videoram_0.target()[offs];
89      UINT8 data1 = state->m_videoram_1.target()[offs];
90      UINT8 data2 = state->m_videoram_2.target()[offs];
88      UINT8 data0 = state->m_videoram_0[offs];
89      UINT8 data1 = state->m_videoram_1[offs];
90      UINT8 data2 = state->m_videoram_2[offs];
9191
9292      /* weird equations, but it matches every flyer screenshot -
9393           perhaphs they used a look-up PROM? */
src/mame/drivers/hotblock.c
r14899r14900
7979   }
8080   else // port 0 = 88 c8
8181   {
82      return m_vram.target()[offset];
82      return m_vram[offset];
8383   }
8484}
8585
r14899r14900
117117   }
118118   else // port 0 = 88 c8
119119   {
120      m_vram.target()[offset] = data;
120      m_vram[offset] = data;
121121   }
122122}
123123
r14899r14900
163163      for(x = 0; x < xxx; x++)
164164      {
165165         if (state->m_port0 & 0x40)
166            bitmap.pix16(y, x) = state->m_vram.target()[count];
166            bitmap.pix16(y, x) = state->m_vram[count];
167167         count++;
168168      }
169169   }
src/mame/drivers/nwk-tr.c
r14899r14900
467467   {
468468      if (mame_stricmp(machine().system().name, "thrilld") == 0)
469469      {
470         m_work_ram.target()[(0x3ffed0/4) + 0] = 0x472a3731;
471         m_work_ram.target()[(0x3ffed0/4) + 1] = 0x33202020;
472         m_work_ram.target()[(0x3ffed0/4) + 2] = 0x2d2d2a2a;
473         m_work_ram.target()[(0x3ffed0/4) + 3] = 0x2a207878;
470         m_work_ram[(0x3ffed0/4) + 0] = 0x472a3731;
471         m_work_ram[(0x3ffed0/4) + 1] = 0x33202020;
472         m_work_ram[(0x3ffed0/4) + 2] = 0x2d2d2a2a;
473         m_work_ram[(0x3ffed0/4) + 3] = 0x2a207878;
474474
475         m_work_ram.target()[(0x3fff40/4) + 0] = 0x47433731;
476         m_work_ram.target()[(0x3fff40/4) + 1] = 0x33000000;
477         m_work_ram.target()[(0x3fff40/4) + 2] = 0x19994a41;
478         m_work_ram.target()[(0x3fff40/4) + 3] = 0x4100a9b1;
475         m_work_ram[(0x3fff40/4) + 0] = 0x47433731;
476         m_work_ram[(0x3fff40/4) + 1] = 0x33000000;
477         m_work_ram[(0x3fff40/4) + 2] = 0x19994a41;
478         m_work_ram[(0x3fff40/4) + 3] = 0x4100a9b1;
479479      }
480480   }
481481
r14899r14900
491491   ppcdrc_set_options(machine.device("maincpu"), PPCDRC_COMPATIBLE_OPTIONS);
492492
493493   /* configure fast RAM regions for DRC */
494   ppcdrc_add_fastram(machine.device("maincpu"), 0x00000000, 0x003fffff, FALSE, state->m_work_ram.target());
494   ppcdrc_add_fastram(machine.device("maincpu"), 0x00000000, 0x003fffff, FALSE, state->m_work_ram);
495495}
496496
497497static ADDRESS_MAP_START( nwktr_map, AS_PROGRAM, 32, nwktr_state )
src/mame/drivers/igs011.c
r14899r14900
249249   }
250250#endif
251251
252   pri_ram = &state->m_priority_ram.target()[(state->m_priority & 7) * 512/2];
252   pri_ram = &state->m_priority_ram[(state->m_priority & 7) * 512/2];
253253
254254   for (y = cliprect.min_y; y <= cliprect.max_y; y++)
255255   {
r14899r14900
24072407   if (vblank_on)
24082408   {
24092409      igs011_state *state = screen.machine().driver_data<igs011_state>();
2410      state->m_vbowl_trackball.target()[0] = state->m_vbowl_trackball.target()[1];
2411      state->m_vbowl_trackball.target()[1] = (input_port_read(screen.machine(), "AN1") << 8) | input_port_read(screen.machine(), "AN0");
2410      state->m_vbowl_trackball[0] = state->m_vbowl_trackball[1];
2411      state->m_vbowl_trackball[1] = (input_port_read(screen.machine(), "AN1") << 8) | input_port_read(screen.machine(), "AN0");
24122412   }
24132413}
24142414
src/mame/drivers/srmp6.c
r14899r14900
363363         logerror("video_regs_w (PC=%06X): %04x = %04x & %04x\n", cpu_get_previouspc(&space.device()), offset*2, data, mem_mask);
364364         break;
365365   }
366   COMBINE_DATA(&m_video_regs.target()[offset]);
366   COMBINE_DATA(&m_video_regs[offset]);
367367}
368368
369369READ16_MEMBER(srmp6_state::video_regs_r)
370370{
371371
372372   logerror("video_regs_r (PC=%06X): %04x\n", cpu_get_previouspc(&space.device()), offset*2);
373   return m_video_regs.target()[offset];
373   return m_video_regs[offset];
374374}
375375
376376
r14899r14900
413413
414414WRITE16_MEMBER(srmp6_state::srmp6_dma_w)
415415{
416   UINT16* dmaram = m_dmaram.target();
416   UINT16* dmaram = m_dmaram;
417417
418418   COMBINE_DATA(&dmaram[offset]);
419419   if (offset==13 && dmaram[offset]==0x40)
r14899r14900
487487READ16_MEMBER(srmp6_state::tileram_r)
488488{
489489
490   return m_chrram.target()[offset];
490   return m_chrram[offset];
491491}
492492
493493WRITE16_MEMBER(srmp6_state::tileram_w)
494494{
495495
496496   //UINT16 tmp;
497   COMBINE_DATA(&m_chrram.target()[offset]);
497   COMBINE_DATA(&m_chrram[offset]);
498498
499499   /* are the DMA registers enabled some other way, or always mapped here, over RAM? */
500500   if (offset >= 0xfff00/2 && offset <= 0xfff1a/2 )
src/mame/drivers/konamim2.c
r14899r14900
262262   UINT32 fb_start = 0xffffffff;
263263   if (state->m_vdl0_address != 0)
264264   {
265      fb_start = *(UINT32*)&state->m_main_ram.target()[(state->m_vdl0_address - 0x40000000) / 8] - 0x40000000;
265      fb_start = *(UINT32*)&state->m_main_ram[(state->m_vdl0_address - 0x40000000) / 8] - 0x40000000;
266266   }
267267
268268   if (fb_start <= 0x800000)
269269   {
270      UINT16 *frame = (UINT16*)&state->m_main_ram.target()[fb_start/8];
270      UINT16 *frame = (UINT16*)&state->m_main_ram[fb_start/8];
271271      for (j=0; j < 384; j++)
272272      {
273273         UINT16 *fb = &frame[(j*512)];
r14899r14900
11351135   AM_RANGE(0x10000000, 0x10000007) AM_READ(cpu_r)
11361136   AM_RANGE(0x10000008, 0x10001007) AM_NOP      // ???
11371137   AM_RANGE(0x20000000, 0x201fffff) AM_ROM AM_SHARE("share2")
1138   AM_RANGE(0x40000000, 0x407fffff) AM_RAM AM_SHARE("share3") AM_SHARE("main_ram")
1138   AM_RANGE(0x40000000, 0x407fffff) AM_RAM AM_SHARE("main_ram")
11391139   AM_RANGE(0xfff00000, 0xffffffff) AM_ROM AM_REGION("boot", 0) AM_SHARE("share2")
11401140ADDRESS_MAP_END
11411141
src/mame/drivers/cball.c
r14899r14900
3232static TILE_GET_INFO( get_tile_info )
3333{
3434   cball_state *state = machine.driver_data<cball_state>();
35   UINT8 code = state->m_video_ram.target()[tile_index];
35   UINT8 code = state->m_video_ram[tile_index];
3636
3737   SET_TILE_INFO(0, code, code >> 7, 0);
3838}
r14899r14900
4141WRITE8_MEMBER(cball_state::cball_vram_w)
4242{
4343
44   m_video_ram.target()[offset] = data;
44   m_video_ram[offset] = data;
4545   m_bg_tilemap->mark_tile_dirty(offset);
4646}
4747
r14899r14900
6262
6363   /* draw sprite */
6464   drawgfx_transpen(bitmap, cliprect, screen.machine().gfx[1],
65      state->m_video_ram.target()[0x399] >> 4,
65      state->m_video_ram[0x399] >> 4,
6666      0,
6767      0, 0,
68      240 - state->m_video_ram.target()[0x390],
69      240 - state->m_video_ram.target()[0x398], 0);
68      240 - state->m_video_ram[0x390],
69      240 - state->m_video_ram[0x398], 0);
7070   return 0;
7171}
7272
r14899r14900
113113READ8_MEMBER(cball_state::cball_wram_r)
114114{
115115
116   return m_video_ram.target()[0x380 + offset];
116   return m_video_ram[0x380 + offset];
117117}
118118
119119
120120WRITE8_MEMBER(cball_state::cball_wram_w)
121121{
122122
123   m_video_ram.target()[0x380 + offset] = data;
123   m_video_ram[0x380 + offset] = data;
124124}
125125
126126
src/mame/drivers/dec8.c
r14899r14900
583583
584584static ADDRESS_MAP_START( lastmisn_map, AS_PROGRAM, 8, dec8_state )
585585   AM_RANGE(0x0000, 0x0fff) AM_RAM AM_SHARE("share1")
586   AM_RANGE(0x1000, 0x13ff) AM_RAM_WRITE(paletteram_xxxxBBBBGGGGRRRR_byte_split_lo_w) AM_SHARE("share3") AM_SHARE("paletteram")
587   AM_RANGE(0x1400, 0x17ff) AM_RAM_WRITE(paletteram_xxxxBBBBGGGGRRRR_byte_split_hi_w) AM_SHARE("share4") AM_SHARE("paletteram2")
586   AM_RANGE(0x1000, 0x13ff) AM_RAM_WRITE(paletteram_xxxxBBBBGGGGRRRR_byte_split_lo_w) AM_SHARE("paletteram")
587   AM_RANGE(0x1400, 0x17ff) AM_RAM_WRITE(paletteram_xxxxBBBBGGGGRRRR_byte_split_hi_w) AM_SHARE("paletteram2")
588588   AM_RANGE(0x1800, 0x1800) AM_READ_PORT("IN0")
589589   AM_RANGE(0x1801, 0x1801) AM_READ_PORT("IN1")
590590   AM_RANGE(0x1802, 0x1802) AM_READ_PORT("IN2")
r14899r14900
609609
610610static ADDRESS_MAP_START( lastmisn_sub_map, AS_PROGRAM, 8, dec8_state )
611611   AM_RANGE(0x0000, 0x0fff) AM_RAM AM_SHARE("share1")
612   AM_RANGE(0x1000, 0x13ff) AM_RAM_WRITE(paletteram_xxxxBBBBGGGGRRRR_byte_split_lo_w) AM_SHARE("share3")
613   AM_RANGE(0x1400, 0x17ff) AM_RAM_WRITE(paletteram_xxxxBBBBGGGGRRRR_byte_split_hi_w) AM_SHARE("share4")
612   AM_RANGE(0x1000, 0x13ff) AM_RAM_WRITE(paletteram_xxxxBBBBGGGGRRRR_byte_split_lo_w) AM_SHARE("paletteram")
613   AM_RANGE(0x1400, 0x17ff) AM_RAM_WRITE(paletteram_xxxxBBBBGGGGRRRR_byte_split_hi_w) AM_SHARE("paletteram2")
614614   AM_RANGE(0x1800, 0x1800) AM_READ_PORT("IN0")
615615   AM_RANGE(0x1801, 0x1801) AM_READ_PORT("IN1")
616616   AM_RANGE(0x1802, 0x1802) AM_READ_PORT("IN2")
r14899r14900
629629
630630static ADDRESS_MAP_START( shackled_map, AS_PROGRAM, 8, dec8_state )
631631   AM_RANGE(0x0000, 0x0fff) AM_RAM AM_SHARE("share1")
632   AM_RANGE(0x1000, 0x13ff) AM_RAM_WRITE(paletteram_xxxxBBBBGGGGRRRR_byte_split_lo_w) AM_SHARE("share3") AM_SHARE("paletteram")
633   AM_RANGE(0x1400, 0x17ff) AM_RAM_WRITE(paletteram_xxxxBBBBGGGGRRRR_byte_split_hi_w) AM_SHARE("share4") AM_SHARE("paletteram2")
632   AM_RANGE(0x1000, 0x13ff) AM_RAM_WRITE(paletteram_xxxxBBBBGGGGRRRR_byte_split_lo_w) AM_SHARE("paletteram")
633   AM_RANGE(0x1400, 0x17ff) AM_RAM_WRITE(paletteram_xxxxBBBBGGGGRRRR_byte_split_hi_w) AM_SHARE("paletteram2")
634634   AM_RANGE(0x1800, 0x1800) AM_READ_PORT("IN0")
635635   AM_RANGE(0x1801, 0x1801) AM_READ_PORT("IN1")
636636   AM_RANGE(0x1802, 0x1802) AM_READ_PORT("IN2")
r14899r14900
653653
654654static ADDRESS_MAP_START( shackled_sub_map, AS_PROGRAM, 8, dec8_state )
655655   AM_RANGE(0x0000, 0x0fff) AM_RAM AM_SHARE("share1")
656   AM_RANGE(0x1000, 0x13ff) AM_RAM_WRITE(paletteram_xxxxBBBBGGGGRRRR_byte_split_lo_w) AM_SHARE("share3")
657   AM_RANGE(0x1400, 0x17ff) AM_RAM_WRITE(paletteram_xxxxBBBBGGGGRRRR_byte_split_hi_w) AM_SHARE("share4")
656   AM_RANGE(0x1000, 0x13ff) AM_RAM_WRITE(paletteram_xxxxBBBBGGGGRRRR_byte_split_lo_w) AM_SHARE("paletteram")
657   AM_RANGE(0x1400, 0x17ff) AM_RAM_WRITE(paletteram_xxxxBBBBGGGGRRRR_byte_split_hi_w) AM_SHARE("paletteram2")
658658   AM_RANGE(0x1800, 0x1800) AM_READ_PORT("IN0")
659659   AM_RANGE(0x1801, 0x1801) AM_READ_PORT("IN1")
660660   AM_RANGE(0x1802, 0x1802) AM_READ_PORT("IN2")
r14899r14900
747747
748748static ADDRESS_MAP_START( csilver_map, AS_PROGRAM, 8, dec8_state )
749749   AM_RANGE(0x0000, 0x0fff) AM_RAM AM_SHARE("share1")
750   AM_RANGE(0x1000, 0x13ff) AM_RAM_WRITE(paletteram_xxxxBBBBGGGGRRRR_byte_split_lo_w) AM_SHARE("share3") AM_SHARE("paletteram")
751   AM_RANGE(0x1400, 0x17ff) AM_RAM_WRITE(paletteram_xxxxBBBBGGGGRRRR_byte_split_hi_w) AM_SHARE("share4") AM_SHARE("paletteram2")
750   AM_RANGE(0x1000, 0x13ff) AM_RAM_WRITE(paletteram_xxxxBBBBGGGGRRRR_byte_split_lo_w) AM_SHARE("paletteram")
751   AM_RANGE(0x1400, 0x17ff) AM_RAM_WRITE(paletteram_xxxxBBBBGGGGRRRR_byte_split_hi_w) AM_SHARE("paletteram2")
752752   AM_RANGE(0x1800, 0x1800) AM_READ_PORT("IN1")
753753   AM_RANGE(0x1801, 0x1801) AM_READ_PORT("IN0")
754754   AM_RANGE(0x1803, 0x1803) AM_READ_PORT("IN2")
r14899r14900
772772
773773static ADDRESS_MAP_START( csilver_sub_map, AS_PROGRAM, 8, dec8_state )
774774   AM_RANGE(0x0000, 0x0fff) AM_RAM AM_SHARE("share1")
775   AM_RANGE(0x1000, 0x13ff) AM_RAM_WRITE(paletteram_xxxxBBBBGGGGRRRR_byte_split_lo_w) AM_SHARE("share3")
776   AM_RANGE(0x1400, 0x17ff) AM_RAM_WRITE(paletteram_xxxxBBBBGGGGRRRR_byte_split_hi_w) AM_SHARE("share4")
775   AM_RANGE(0x1000, 0x13ff) AM_RAM_WRITE(paletteram_xxxxBBBBGGGGRRRR_byte_split_lo_w) AM_SHARE("paletteram")
776   AM_RANGE(0x1400, 0x17ff) AM_RAM_WRITE(paletteram_xxxxBBBBGGGGRRRR_byte_split_hi_w) AM_SHARE("paletteram2")
777777   AM_RANGE(0x1803, 0x1803) AM_READ_PORT("IN2")
778778   AM_RANGE(0x1804, 0x1804) AM_READ_PORT("DSW1")
779779   AM_RANGE(0x1800, 0x1804) AM_WRITE(shackled_int_w)
src/mame/drivers/slotcarn.c
r14899r14900
6363{
6464   int co;
6565
66   co = ((m_ram_attr.target()[offset] & 0x7F) << 3) | (offset & 0x07);
66   co = ((m_ram_attr[offset] & 0x7F) << 3) | (offset & 0x07);
6767   return m_ram_palette[co];
6868}
6969
r14899r14900
7474   machine().primary_screen->update_now();
7575   data &= 0x0f;
7676
77   co = ((m_ram_attr.target()[offset] & 0x7F) << 3) | (offset & 0x07);
77   co = ((m_ram_attr[offset] & 0x7F) << 3) | (offset & 0x07);
7878   m_ram_palette[co] = data;
7979
8080}
r14899r14900
120120   for (cx = 0; cx < x_count; cx++)
121121   {
122122      int i;
123      int attr = state->m_ram_attr.target()[ma & 0x7ff];
123      int attr = state->m_ram_attr[ma & 0x7ff];
124124      int region = (attr & 0x40) >> 6;
125      int addr = ((state->m_ram_video.target()[ma & 0x7ff] | ((attr & 0x80) << 1) | (extra_video_bank_bit)) << 4) | (ra & 0x0f);
125      int addr = ((state->m_ram_video[ma & 0x7ff] | ((attr & 0x80) << 1) | (extra_video_bank_bit)) << 4) | (ra & 0x0f);
126126      int colour = (attr & 0x7f) << 3;
127127      UINT8   *data;
128128
src/mame/drivers/rabbit.c
r14899r14900
9393{
9494public:
9595   rabbit_state(const machine_config &mconfig, device_type type, const char *tag)
96      : driver_device(mconfig, type, tag) { }
96      : driver_device(mconfig, type, tag),
97        m_viewregs0(*this, "viewregs0"),
98        m_viewregs6(*this, "viewregs6"),
99        m_viewregs7(*this, "viewregs7"),
100        m_viewregs9(*this, "viewregs9"),
101        m_viewregs10(*this, "viewregs10"),
102        m_tilemap_regs(*this, "tilemap_regs"),
103        m_spriteregs(*this, "spriteregs"),
104        m_blitterregs(*this, "blitterregs"),
105        m_spriteram(*this, "spriteram") { }
97106
98   UINT32 *m_viewregs0;
99   UINT32 *m_viewregs6;
100   UINT32 *m_viewregs7;
101   UINT32 *m_viewregs9;
102   UINT32 *m_viewregs10;
103   UINT32 *m_tilemap_regs[4];
104   UINT32 *m_spriteregs;
105   UINT32 *m_blitterregs;
107   required_shared_ptr<UINT32> m_viewregs0;
108   required_shared_ptr<UINT32> m_viewregs6;
109   required_shared_ptr<UINT32> m_viewregs7;
110   required_shared_ptr<UINT32> m_viewregs9;
111   required_shared_ptr<UINT32> m_viewregs10;
112   required_shared_ptr_array<UINT32, 4> m_tilemap_regs;
113   required_shared_ptr<UINT32> m_spriteregs;
114   required_shared_ptr<UINT32> m_blitterregs;
106115   bitmap_ind16 *m_sprite_bitmap;
107116   rectangle m_sprite_clip;
108117   int m_vblirqlevel;
109118   int m_bltirqlevel;
110119   int m_banking;
111120   UINT32 *m_tilemap_ram[4];
112   UINT32 *m_spriteram;
121   required_shared_ptr<UINT32> m_spriteram;
113122   tilemap_t *m_tilemap[4];
114123   DECLARE_WRITE32_MEMBER(rabbit_tilemap0_w);
115124   DECLARE_WRITE32_MEMBER(rabbit_tilemap1_w);
r14899r14900
747756   AM_RANGE(0x400980, 0x400983) AM_READ(randomrabbits) // sound chip status?
748757   AM_RANGE(0x400984, 0x400987) AM_READ(randomrabbits) // sound chip status?
749758   /* this lot are probably gfxchip/blitter etc. related */
750   AM_RANGE(0x400010, 0x400013) AM_WRITEONLY AM_BASE(m_viewregs0 )
751   AM_RANGE(0x400100, 0x400117) AM_WRITEONLY AM_BASE(m_tilemap_regs[0] ) // tilemap regs1
752   AM_RANGE(0x400120, 0x400137) AM_WRITEONLY AM_BASE(m_tilemap_regs[1] ) // tilemap regs2
753   AM_RANGE(0x400140, 0x400157) AM_WRITEONLY AM_BASE(m_tilemap_regs[2] ) // tilemap regs3
754   AM_RANGE(0x400160, 0x400177) AM_WRITEONLY AM_BASE(m_tilemap_regs[3] ) // tilemap regs4
755   AM_RANGE(0x400200, 0x40021b) AM_WRITEONLY AM_BASE(m_spriteregs ) // sprregs?
759   AM_RANGE(0x400010, 0x400013) AM_WRITEONLY AM_SHARE("viewregs0" )
760   AM_RANGE(0x400100, 0x400117) AM_WRITEONLY AM_SHARE("tilemap_regs.0" ) // tilemap regs1
761   AM_RANGE(0x400120, 0x400137) AM_WRITEONLY AM_SHARE("tilemap_regs.1" ) // tilemap regs2
762   AM_RANGE(0x400140, 0x400157) AM_WRITEONLY AM_SHARE("tilemap_regs.2" ) // tilemap regs3
763   AM_RANGE(0x400160, 0x400177) AM_WRITEONLY AM_SHARE("tilemap_regs.3" ) // tilemap regs4
764   AM_RANGE(0x400200, 0x40021b) AM_WRITEONLY AM_SHARE("spriteregs" ) // sprregs?
756765   AM_RANGE(0x400300, 0x400303) AM_WRITE(rabbit_rombank_w) // used during rom testing, rombank/area select + something else?
757   AM_RANGE(0x400400, 0x400413) AM_WRITEONLY AM_BASE(m_viewregs6 ) // some global controls? (brightness etc.?)
758   AM_RANGE(0x400500, 0x400503) AM_WRITEONLY AM_BASE(m_viewregs7 )
759   AM_RANGE(0x400700, 0x40070f) AM_WRITE(rabbit_blitter_w) AM_BASE(m_blitterregs )
760   AM_RANGE(0x400800, 0x40080f) AM_WRITEONLY AM_BASE(m_viewregs9 ) // never changes?
766   AM_RANGE(0x400400, 0x400413) AM_WRITEONLY AM_SHARE("viewregs6" ) // some global controls? (brightness etc.?)
767   AM_RANGE(0x400500, 0x400503) AM_WRITEONLY AM_SHARE("viewregs7" )
768   AM_RANGE(0x400700, 0x40070f) AM_WRITE(rabbit_blitter_w) AM_SHARE("blitterregs" )
769   AM_RANGE(0x400800, 0x40080f) AM_WRITEONLY AM_SHARE("viewregs9" ) // never changes?
761770   AM_RANGE(0x400900, 0x40098f) AM_WRITE(rabbit_audio_w)
762771   /* hmm */
763   AM_RANGE(0x479700, 0x479713) AM_WRITEONLY AM_BASE(m_viewregs10 )
772   AM_RANGE(0x479700, 0x479713) AM_WRITEONLY AM_SHARE("viewregs10" )
764773
765774   AM_RANGE(0x440000, 0x47ffff) AM_ROMBANK("bank1") // data (gfx / sound) rom readback for ROM testing
766775   /* tilemaps */
r14899r14900
768777   AM_RANGE(0x484000, 0x487fff) AM_READWRITE(rabbit_tilemap1_r,rabbit_tilemap1_w)
769778   AM_RANGE(0x488000, 0x48bfff) AM_READWRITE(rabbit_tilemap2_r,rabbit_tilemap2_w)
770779   AM_RANGE(0x48c000, 0x48ffff) AM_READWRITE(rabbit_tilemap3_r,rabbit_tilemap3_w)
771   AM_RANGE(0x494000, 0x497fff) AM_RAM AM_BASE(m_spriteram) // sprites?
780   AM_RANGE(0x494000, 0x497fff) AM_RAM AM_SHARE("spriteram") // sprites?
772781   AM_RANGE(0x4a0000, 0x4affff) AM_RAM_WRITE(rabbit_paletteram_dword_w) AM_SHARE("paletteram")
773782   AM_RANGE(0xff0000, 0xffffff) AM_RAM
774783ADDRESS_MAP_END
src/mame/drivers/hvyunit.c
r14899r14900
164164{
165165   hvyunit_state *state = machine.driver_data<hvyunit_state>();
166166
167   int attr = state->m_colorram.target()[tile_index];
168   int code = state->m_videoram.target()[tile_index] + ((attr & 0x0f) << 8);
167   int attr = state->m_colorram[tile_index];
168   int code = state->m_videoram[tile_index] + ((attr & 0x0f) << 8);
169169   int color = (attr >> 4);
170170
171171   SET_TILE_INFO(1, code, color, 0);
r14899r14900
261261WRITE8_MEMBER(hvyunit_state::hu_videoram_w)
262262{
263263
264   m_videoram.target()[offset] = data;
264   m_videoram[offset] = data;
265265   m_bg_tilemap->mark_tile_dirty(offset);
266266}
267267
268268WRITE8_MEMBER(hvyunit_state::hu_colorram_w)
269269{
270270
271   m_colorram.target()[offset] = data;
271   m_colorram[offset] = data;
272272   m_bg_tilemap->mark_tile_dirty(offset);
273273}
274274
src/mame/drivers/royalmah.c
r14899r14900
278278static SCREEN_UPDATE_IND16( royalmah )
279279{
280280   royalmah_state *state = screen.machine().driver_data<royalmah_state>();
281   UINT8 *videoram = state->m_videoram.target();
281   UINT8 *videoram = state->m_videoram;
282282
283283   offs_t offs;
284284
r14899r14900
898898
899899WRITE8_MEMBER(royalmah_state::mjifb_rom_io_w)
900900{
901   UINT8 *videoram = m_videoram.target();
901   UINT8 *videoram = m_videoram;
902902   if (m_mjifb_rom_enable)
903903   {
904904      videoram[offset] = data;
r14899r14900
926926
927927WRITE8_MEMBER(royalmah_state::mjifb_videoram_w)
928928{
929   UINT8 *videoram = m_videoram.target();
929   UINT8 *videoram = m_videoram;
930930   videoram[offset + 0x4000] = data;
931931}
932932
r14899r14900
10071007
10081008WRITE8_MEMBER(royalmah_state::mjdejavu_rom_io_w)
10091009{
1010   UINT8 *videoram = m_videoram.target();
1010   UINT8 *videoram = m_videoram;
10111011   if (m_mjifb_rom_enable)
10121012   {
10131013      videoram[offset] = data;
r14899r14900
11941194
11951195WRITE8_MEMBER(royalmah_state::mjvegasa_rom_io_w)
11961196{
1197   UINT8 *videoram = m_videoram.target();
1197   UINT8 *videoram = m_videoram;
11981198   if ((m_rombank & 0x70) != 0x70)
11991199   {
12001200      videoram[offset] = data;
src/mame/drivers/rotaryf.c
r14899r14900
7272
7373      UINT8 x = offs << 3;
7474      int y = offs >> 5;
75      UINT8 data = state->m_videoram.target()[offs];
75      UINT8 data = state->m_videoram[offs];
7676
7777      for (i = 0; i < 8; i++)
7878      {
src/mame/drivers/miniboy7.c
r14899r14900
174174
175175WRITE8_MEMBER(miniboy7_state::miniboy7_videoram_w)
176176{
177   m_videoram.target()[offset] = data;
177   m_videoram[offset] = data;
178178   m_bg_tilemap->mark_tile_dirty(offset);
179179}
180180
181181WRITE8_MEMBER(miniboy7_state::miniboy7_colorram_w)
182182{
183   m_colorram.target()[offset] = data;
183   m_colorram[offset] = data;
184184   m_bg_tilemap->mark_tile_dirty(offset);
185185}
186186
r14899r14900
193193    ---- --x-   tiles bank.
194194    xx-- ---x   seems unused. */
195195
196   int attr = state->m_colorram.target()[tile_index];
197   int code = state->m_videoram.target()[tile_index];
196   int attr = state->m_colorram[tile_index];
197   int code = state->m_videoram[tile_index];
198198   int bank = (attr & 0x02) >> 1;   /* bit 1 switch the gfx banks */
199199   int color = (attr & 0x3c);   /* bits 2-3-4-5 for color? */
200200
src/emu/device.c
r14899r14900
101101     m_name(name),
102102     m_owner(owner),
103103     m_next(NULL),
104     
104105     m_interface_list(NULL),
105106     m_execute(NULL),
106107     m_memory(NULL),
107108     m_state(NULL),
109     
108110     m_configured_clock(clock),
109111     m_unscaled_clock(clock),
110112     m_clock(clock),
r14899r14900
116118     m_machine_config(mconfig),
117119     m_static_config(NULL),
118120     m_input_defaults(NULL),
119     m_auto_finder_list(NULL),
121
120122     m_machine(NULL),
121123     m_save(NULL),
122124     m_basetag(tag),
123125     m_config_complete(false),
124     m_started(false)
126     m_started(false),
127     m_auto_finder_list(NULL)
125128{
126129   if (owner != NULL)
127130      m_tag.cpy((owner->owner() == NULL) ? "" : owner->tag()).cat(":").cat(tag);
r14899r14900
139142     m_searchpath(shortname),
140143     m_owner(owner),
141144     m_next(NULL),
145     
142146     m_interface_list(NULL),
143147     m_execute(NULL),
144148     m_memory(NULL),
145149     m_state(NULL),
150     
146151     m_configured_clock(clock),
147152     m_unscaled_clock(clock),
148153     m_clock(clock),
r14899r14900
154159     m_machine_config(mconfig),
155160     m_static_config(NULL),
156161     m_input_defaults(NULL),
157     m_auto_finder_list(NULL),
162
158163     m_machine(NULL),
159164     m_save(NULL),
160165     m_basetag(tag),
161166     m_config_complete(false),
162     m_started(false)
167     m_started(false),
168     m_auto_finder_list(NULL)
163169{
164170   if (owner != NULL)
165171      m_tag.cpy((owner->owner() == NULL) ? "" : owner->tag()).cat(":").cat(tag);
r14899r14900
863869{
864870   memory_share *share = m_base.machine().memory().shared(m_base, m_tag);
865871   if (share == NULL)
872   {
873      if (required)
874         throw emu_fatalerror("Shared ptr '%s' not found", m_tag);
866875      return NULL;
876   }
867877   if (share->width() != width)
868878   {
869879      if (required)
src/emu/device.h
r14899r14900
124124typedef void (*write_line_device_func)(device_t *device, int state);
125125
126126
127
128127// ======================> device_t
129128
130129// device_t represents a device
r14899r14900
228227   device_debug *debug() const { return m_debug; }
229228
230229protected:
230   // internal helper classes (defined below)
231   class finder_base;
232   template<class _DeviceClass, bool _Required> class device_finder;
233   template<class _DeviceClass> class optional_device;
234   template<class _DeviceClass> class required_device;
235   template<typename _PointerType, bool _Required> class shared_ptr_finder;
236   template<typename _PointerType> class optional_shared_ptr;
237   template<typename _PointerType> class required_shared_ptr;
238   template<typename _PointerType, int _Count, bool _Required> class shared_ptr_array_finder;
239   template<typename _PointerType, int _Count> class optional_shared_ptr_array;
240   template<typename _PointerType, int _Count> class required_shared_ptr_array;
241
231242   // miscellaneous helpers
232243   void set_machine(running_machine &machine);
233244   void start();
r14899r14900
236247   void pre_save();
237248   void post_load();
238249   void notify_clock_changed();
250   finder_base *register_auto_finder(finder_base &autodev);
239251
240252   //------------------- begin derived class overrides
241253
r14899r14900
288300   const void *         m_static_config;      // static device configuration
289301   const input_device_default *m_input_defaults;   // devices input ports default overrides
290302
291   // helper class to request auto-object discovery in the constructor of a derived class
292   class finder_base
293   {
294      friend class device_t;
303private:
304   // private helpers
305   device_t *add_subdevice(device_type type, const char *tag, UINT32 clock);
306   device_t *replace_subdevice(device_t &old, device_type type, const char *tag, UINT32 clock);
307   void remove_subdevice(device_t &device);
308   device_t *subdevice_slow(const char *tag) const;
295309
296   public:
297      // construction/destruction
298      finder_base(device_t &base, const char *tag);
299      virtual ~finder_base();
310   // private state; accessor use required
311   running_machine *      m_machine;
312   save_manager *         m_save;
313   astring             m_tag;               // full tag for this instance
314   astring             m_basetag;            // base part of the tag
315   bool               m_config_complete;      // have we completed our configuration?
316   bool               m_started;            // true if the start function has succeeded
317   finder_base *         m_auto_finder_list;      // list of objects to auto-find
318};
300319
301      // getters
302      virtual void findit() = 0;
303320
304   protected:
305      // static helpers
306      void *find_memory(UINT8 width, size_t &bytes, bool required);
321// ======================> finder_base
307322
308      // internal state
309      finder_base *m_next;
310      device_t &m_base;
311      const char *m_tag;
312   };
323// helper class to request auto-object discovery in the constructor of a derived class
324class device_t::finder_base
325{
326   friend class device_t;
313327
314   // device finder template
315   template<typename _DeviceClass, bool _Required>
316   class device_finder : public finder_base
317   {
318   public:
319      // construction/destruction
320      device_finder(device_t &base, const char *tag)
321         : finder_base(base, tag),
322           m_target(0) { }
328public:
329   // construction/destruction
330   finder_base(device_t &base, const char *tag);
331   virtual ~finder_base();
323332
324      // operators to make use transparent
325      operator _DeviceClass *() { return m_target; }
326      operator _DeviceClass *() const { return m_target; }
327      _DeviceClass *operator->() { return m_target; }
333   // getters
334   virtual void findit() = 0;
328335
329      // getter for explicit fetching
330      _DeviceClass *target() const { return m_target; }
336protected:
337   // helpers
338   void *find_memory(UINT8 width, size_t &bytes, bool required);
331339
332      // setter for setting the object
333      void set_target(_DeviceClass *target)
334      {
335         m_target = target;
336         if (target == 0 && _Required)
337            throw emu_fatalerror("Unable to find required device '%s'", this->m_tag);
338      }
340   // internal state
341   finder_base *m_next;
342   device_t &m_base;
343   const char *m_tag;
344};
339345
340      // finder
341      virtual void findit() { set_target(m_base.subdevice<_DeviceClass>(m_tag)); }
342346
343   protected:
344      // internal state
345      _DeviceClass *m_target;
346   };
347// ======================> device_finder
347348
348   // optional device finder
349   template<class _DeviceClass>
350   class optional_device : public device_finder<_DeviceClass, false>
351   {
352   public:
353      optional_device(device_t &base, const char *tag) : device_finder<_DeviceClass, false>(base, tag) { }
354   };
349// device finder template
350template<class _DeviceClass, bool _Required>
351class device_t::device_finder : public device_t::finder_base
352{
353public:
354   // construction/destruction
355   device_finder(device_t &base, const char *tag)
356      : finder_base(base, tag),
357        m_target(0) { }
355358
356   // required devices are similar but throw an error if they are not found
357   template<class _DeviceClass>
358   class required_device : public device_finder<_DeviceClass, true>
359   {
360   public:
361      required_device(device_t &base, const char *tag) : device_finder<_DeviceClass, true>(base, tag) { }
362   };
359   // operators to make use transparent
360   operator _DeviceClass *() { return m_target; }
361   operator _DeviceClass *() const { return m_target; }
362   _DeviceClass *operator->() { assert(m_target != NULL); return m_target; }
363363
364   // shared pointer finder template
365   template<typename _PointerType, bool _Required>
366   class shared_ptr_finder : public finder_base
364   // getter for explicit fetching
365   _DeviceClass *target() const { return m_target; }
366
367   // setter for setting the object
368   void set_target(_DeviceClass *target)
367369   {
368   public:
369      // construction/destruction
370      shared_ptr_finder(device_t &base, const char *tag, UINT8 width = 0)
371         : finder_base(base, tag),
372           m_target(0),
373           m_bytes(0),
374           m_allocated(false),
375           m_width((width != 0) ? width : sizeof(_PointerType) * 8) { }
370      m_target = target;
371      if (target == 0 && _Required)
372         throw emu_fatalerror("Unable to find required device '%s'", this->m_tag);
373   }
376374
377      virtual ~shared_ptr_finder() { if (m_allocated) global_free(m_target); }
375   // finder
376   virtual void findit() { set_target(m_base.subdevice<_DeviceClass>(m_tag)); }
378377
379      // operators to make use transparent
380      operator _PointerType *() const { return m_target; }
381      _PointerType operator[](int index) const { return m_target[index]; }
382      _PointerType &operator[](int index) { return m_target[index]; }
383      _PointerType *operator->() { return m_target; }
378protected:
379   // internal state
380   _DeviceClass *m_target;
381};
384382
385      // getter for explicit fetching
386      _PointerType *target() const { return m_target; }
387      UINT32 bytes() const { return m_bytes; }
383// optional device finder
384template<class _DeviceClass>
385class device_t::optional_device : public device_t::device_finder<_DeviceClass, false>
386{
387public:
388   optional_device(device_t &base, const char *tag) : device_finder<_DeviceClass, false>(base, tag) { }
389};
388390
389      // setter for setting the object
390      void set_target(_PointerType *target, size_t bytes)
391      {
392         m_target = target;
393         m_bytes = bytes;
394         if (target == 0 && _Required)
395            throw emu_fatalerror("Unable to find required shared pointer '%s'", this->m_tag);
396      }
391// required devices are similar but throw an error if they are not found
392template<class _DeviceClass>
393class device_t::required_device : public device_t::device_finder<_DeviceClass, true>
394{
395public:
396   required_device(device_t &base, const char *tag) : device_finder<_DeviceClass, true>(base, tag) { }
397};
397398
398      // dynamic allocation of a shared pointer
399      void allocate(UINT32 entries)
400      {
401         assert(!m_allocated);
402         m_allocated = true;
403         m_target = global_alloc_array_clear(_PointerType, entries);
404         m_bytes = entries * sizeof(_PointerType);
405         m_base.save_pointer(m_target, m_tag, entries);
406      }
407399
408      // finder
409      virtual void findit() { m_target = reinterpret_cast<_PointerType *>(find_memory(m_width, m_bytes, _Required)); }
400// ======================> shared_ptr_finder
410401
411   protected:
412      // internal state
413      _PointerType *m_target;
414      size_t m_bytes;
415      bool m_allocated;
416      UINT8 m_width;
417   };
402// shared pointer finder template
403template<typename _PointerType, bool _Required>
404class device_t::shared_ptr_finder : public device_t::finder_base
405{
406public:
407   // construction/destruction
408   shared_ptr_finder(device_t &base, const char *tag, UINT8 width = 0)
409      : finder_base(base, tag),
410        m_target(0),
411        m_bytes(0),
412        m_allocated(false),
413        m_width((width != 0) ? width : sizeof(_PointerType) * 8) { }
418414
419   // optional device finder
420   template<class _PointerType>
421   class optional_shared_ptr : public shared_ptr_finder<_PointerType, false>
415   virtual ~shared_ptr_finder() { if (m_allocated) global_free(m_target); }
416
417   // operators to make use transparent
418   operator _PointerType *() const { return m_target; }
419   _PointerType operator[](int index) const { return m_target[index]; }
420   _PointerType &operator[](int index) { return m_target[index]; }
421   _PointerType *operator->() { return m_target; }
422
423   // getter for explicit fetching
424   _PointerType *target() const { return m_target; }
425   UINT32 bytes() const { return m_bytes; }
426
427   // setter for setting the object
428   void set_target(_PointerType *target, size_t bytes)
422429   {
423   public:
424      optional_shared_ptr(device_t &base, const char *tag, UINT8 width = 0) : shared_ptr_finder<_PointerType, false>(base, tag, width) { }
425   };
430      m_target = target;
431      m_bytes = bytes;
432      if (target == 0 && _Required)
433         throw emu_fatalerror("Unable to find required shared pointer '%s'", this->m_tag);
434   }
426435
427   // required devices are similar but throw an error if they are not found
428   template<class _PointerType>
429   class required_shared_ptr : public shared_ptr_finder<_PointerType, true>
436   // dynamic allocation of a shared pointer
437   void allocate(UINT32 entries)
430438   {
431   public:
432      required_shared_ptr(device_t &base, const char *tag, UINT8 width = 0) : shared_ptr_finder<_PointerType, true>(base, tag, width) { }
433   };
439      assert(!m_allocated);
440      m_allocated = true;
441      m_target = global_alloc_array_clear(_PointerType, entries);
442      m_bytes = entries * sizeof(_PointerType);
443      m_base.save_pointer(m_target, m_tag, entries);
444   }
434445
435   // internal helpers
436   finder_base *register_auto_finder(finder_base &autodev);
446   // finder
447   virtual void findit() { m_target = reinterpret_cast<_PointerType *>(find_memory(m_width, m_bytes, _Required)); }
437448
438   finder_base *      m_auto_finder_list;
449protected:
450   // internal state
451   _PointerType *m_target;
452   size_t m_bytes;
453   bool m_allocated;
454   UINT8 m_width;
455};
439456
440private:
441   // private helpers
442   device_t *add_subdevice(device_type type, const char *tag, UINT32 clock);
443   device_t *replace_subdevice(device_t &old, device_type type, const char *tag, UINT32 clock);
444   void remove_subdevice(device_t &device);
445   device_t *subdevice_slow(const char *tag) const;
457// optional shared pointer finder
458template<class _PointerType>
459class device_t::optional_shared_ptr : public device_t::shared_ptr_finder<_PointerType, false>
460{
461public:
462   optional_shared_ptr(device_t &base, const char *tag, UINT8 width = 0) : shared_ptr_finder<_PointerType, false>(base, tag, width) { }
463};
446464
447   // private state; accessor use required
448   running_machine *      m_machine;
449   save_manager *         m_save;
450   astring             m_tag;               // full tag for this instance
451   astring             m_basetag;            // base part of the tag
452   bool               m_config_complete;      // have we completed our configuration?
453   bool               m_started;            // true if the start function has succeeded
465// required shared pointer finder
466template<class _PointerType>
467class device_t::required_shared_ptr : public device_t::shared_ptr_finder<_PointerType, true>
468{
469public:
470   required_shared_ptr(device_t &base, const char *tag, UINT8 width = 0) : shared_ptr_finder<_PointerType, true>(base, tag, width) { }
454471};
455472
456473
474// ======================> shared_ptr_array_finder
457475
476// shared pointer array finder template
477template<typename _PointerType, int _Count, bool _Required>
478class device_t::shared_ptr_array_finder
479{
480   typedef shared_ptr_finder<_PointerType, _Required> shared_ptr_type;
481   
482public:
483   // construction/destruction
484   shared_ptr_array_finder(device_t &base, const char *basetag, UINT8 width = 0)
485   {
486      for (int index = 0; index < _Count; index++)
487         m_array[index] = global_alloc(shared_ptr_type(base, m_tag[index].format("%s.%d", basetag, index), width));
488   }
489   
490   virtual ~shared_ptr_array_finder()
491   {
492      for (int index = 0; index < _Count; index++)
493         global_free(m_array[index]);
494   }
495
496   // array accessors
497   const shared_ptr_type &operator[](int index) const { assert(index < _Count); return *m_array[index]; }
498   shared_ptr_type &operator[](int index) { assert(index < _Count); return *m_array[index]; }
499
500protected:
501   // internal state
502   shared_ptr_type *m_array[_Count];
503   astring m_tag[_Count];
504};
505
506// optional shared pointer array finder
507template<class _PointerType, int _Count>
508class device_t::optional_shared_ptr_array : public device_t::shared_ptr_array_finder<_PointerType, _Count, false>
509{
510public:
511   optional_shared_ptr_array(device_t &base, const char *tag, UINT8 width = 0) : shared_ptr_array_finder<_PointerType, _Count, false>(base, tag, width) { }
512};
513
514// required shared pointer array finder
515template<class _PointerType, int _Count>
516class device_t::required_shared_ptr_array : public device_t::shared_ptr_array_finder<_PointerType, _Count, true>
517{
518public:
519   required_shared_ptr_array(device_t &base, const char *tag, UINT8 width = 0) : shared_ptr_array_finder<_PointerType, _Count, true>(base, tag, width) { }
520};
521
522
458523// ======================> device_interface
459524
460525// device_interface represents runtime information for a particular device interface
src/emu/memory.c
r14899r14900
182182        Specifies a pointer to a pointer to the base of the memory backing
183183        the current bucket.
184184
185    AM_SIZE(size)
186        Specifies a pointer to a size_t variable which will be filled in
187        with the size, in bytes, of the current bucket.
188
189    AM_BASE_MEMBER(struct, basefield)
190    AM_SIZE_MEMBER(struct, sizefield)
191        Specifies a field within a given struct as where to store the base
192        or size of the current bucket. The struct is assumed to be hanging
193        off of the machine.driver_data pointer.
194
195    AM_BASE_GENERIC(basefield)
196    AM_SIZE_GENERIC(sizefield)
197        Specifies a field within the global generic_pointers struct as
198        where to store the base or size of the current bucket. The global
199        generic_pointer struct lives in machine.generic.
200
201185***************************************************************************/
202186
203187#include <list>
src/emu/diexec.h
r14899r14900
129129   device_execute_interface::static_set_periodic_int(*device, _func, attotime::from_hz(_rate)); \
130130
131131#define MCFG_DEVICE_PERIODIC_INT_DRIVER(_class, _func, _rate) \
132   device_execute_interface::static_set_vblank_int(*device, device_interrupt_delegate(&_class::_func, #_class "::" #_func, downcast<_class *>(&config.root_device())), attotime::from_hz(_rate)); \
132   device_execute_interface::static_set_periodic_int(*device, device_interrupt_delegate(&_class::_func, #_class "::" #_func, downcast<_class *>(&config.root_device())), attotime::from_hz(_rate)); \
133133
134134
135135
src/emu/addrmap.h
r14899r14900
113113   void set_read_type(map_handler_type _type) { m_read.m_type = _type; }
114114   void set_write_type(map_handler_type _type) { m_write.m_type = _type; }
115115   void set_region(const char *tag, offs_t offset) { m_region = tag; m_rgnoffs = offset; }
116   void set_share(const char *tag) { m_share = tag; }
116   void set_share(const char *tag) { assert(m_share == NULL); m_share = tag; }
117117   void set_sizeptr(size_t *_sizeptr) { m_sizeptr = _sizeptr; }
118118   void set_member_baseptr(FPTR offs) { m_baseptroffs_plus1 = offs + 1; }
119119   void set_member_sizeptr(FPTR offs) { m_sizeptroffs_plus1 = offs + 1; }
r14899r14900
748748#define AM_SIZE_LEGACY(_size) \
749749   curentry->set_sizeptr(_size); \
750750
751#define AM_SIZE(_member) \
752   curentry->set_member_sizeptr(myoffsetof(drivdata_class, _member)); \
753751
754
755752// common shortcuts
756753#define AM_ROMBANK(_bank)               AM_READ_BANK(_bank)
757754#define AM_RAMBANK(_bank)               AM_READWRITE_BANK(_bank)
r14899r14900
764761#define AM_RAM_WRITE_LEGACY(_write)         AM_READONLY AM_WRITE_LEGACY(_write)
765762#define AM_RAM_DEVWRITE_LEGACY(_tag, _write) AM_READONLY AM_DEVWRITE_LEGACY(_tag, _write)
766763
767#define AM_BASE_SIZE(_base, _size)         AM_BASE(_base) AM_SIZE(_size)
764#define AM_BASE_SIZE(_base, _size)         AM_BASE(_base) curentry->set_member_sizeptr(myoffsetof(drivdata_class, _size));
768765
769766
770767
src/mess/drivers/lynx.c
r14899r14900
1919   AM_RANGE(0x0000, 0xfbff) AM_RAM AM_BASE(m_mem_0000)
2020   AM_RANGE(0xfc00, 0xfcff) AM_RAM AM_BASE(m_mem_fc00)
2121   AM_RANGE(0xfd00, 0xfdff) AM_RAM AM_BASE(m_mem_fd00)
22   AM_RANGE(0xfe00, 0xfff7) AM_READ_BANK("bank3") AM_WRITEONLY AM_BASE(m_mem_fe00) AM_SIZE( m_mem_fe00_size)
22   AM_RANGE(0xfe00, 0xfff7) AM_READ_BANK("bank3") AM_WRITEONLY AM_BASE_SIZE(m_mem_fe00, m_mem_fe00_size)
2323   AM_RANGE(0xfff8, 0xfff8) AM_RAM
2424   AM_RANGE(0xfff9, 0xfff9) AM_READWRITE_LEGACY(lynx_memory_config_r, lynx_memory_config_w)
2525   AM_RANGE(0xfffa, 0xffff) AM_READ_BANK("bank4") AM_WRITEONLY AM_BASE(m_mem_fffa)
src/mess/drivers/psion.c
r14899r14900
239239   AM_RANGE(0x0000, 0x001f) AM_READWRITE(hd63701_int_reg_r, hd63701_int_reg_w)
240240   AM_RANGE(0x0040, 0x00ff) AM_RAM AM_BASE(m_sys_register)
241241   AM_RANGE(0x0100, 0x03ff) AM_READWRITE(io_r, io_w)
242   AM_RANGE(0x2000, 0x3fff) AM_RAM AM_BASE(m_ram) AM_SIZE(m_ram_size)
242   AM_RANGE(0x2000, 0x3fff) AM_RAM AM_BASE_SIZE(m_ram,m_ram_size)
243243   AM_RANGE(0x8000, 0xffff) AM_ROM
244244ADDRESS_MAP_END
245245
r14899r14900
248248   AM_RANGE(0x0000, 0x001f) AM_READWRITE(hd63701_int_reg_r, hd63701_int_reg_w)
249249   AM_RANGE(0x0040, 0x00ff) AM_RAM AM_BASE(m_sys_register)
250250   AM_RANGE(0x0100, 0x03ff) AM_READWRITE(io_r, io_w)
251   AM_RANGE(0x0400, 0x5fff) AM_RAM AM_BASE(m_ram) AM_SIZE(m_ram_size)
251   AM_RANGE(0x0400, 0x5fff) AM_RAM AM_BASE_SIZE(m_ram,m_ram_size)
252252   AM_RANGE(0x8000, 0xffff) AM_ROM
253253ADDRESS_MAP_END
254254
r14899r14900
257257   AM_RANGE(0x0000, 0x001f) AM_READWRITE(hd63701_int_reg_r, hd63701_int_reg_w)
258258   AM_RANGE(0x0040, 0x00ff) AM_RAM AM_BASE(m_sys_register)
259259   AM_RANGE(0x0100, 0x03ff) AM_READWRITE(io_r, io_w)
260   AM_RANGE(0x0400, 0x3fff) AM_RAM AM_BASE(m_ram) AM_SIZE(m_ram_size)
260   AM_RANGE(0x0400, 0x3fff) AM_RAM AM_BASE_SIZE(m_ram,m_ram_size)
261261   AM_RANGE(0x4000, 0x7fff) AM_RAMBANK("rambank")
262262   AM_RANGE(0x8000, 0xffff) AM_ROM
263263ADDRESS_MAP_END
r14899r14900
267267   AM_RANGE(0x0000, 0x001f) AM_READWRITE(hd63701_int_reg_r, hd63701_int_reg_w)
268268   AM_RANGE(0x0040, 0x00ff) AM_RAM AM_BASE(m_sys_register)
269269   AM_RANGE(0x0100, 0x03ff) AM_READWRITE(io_r, io_w)
270   AM_RANGE(0x0400, 0x7fff) AM_RAM AM_BASE(m_ram) AM_SIZE(m_ram_size)
270   AM_RANGE(0x0400, 0x7fff) AM_RAM AM_BASE_SIZE(m_ram,m_ram_size)
271271   AM_RANGE(0x8000, 0xbfff) AM_ROMBANK("rombank")
272272   AM_RANGE(0xc000, 0xffff) AM_ROM
273273ADDRESS_MAP_END
r14899r14900
277277   AM_RANGE(0x0000, 0x001f) AM_READWRITE(hd63701_int_reg_r, hd63701_int_reg_w)
278278   AM_RANGE(0x0040, 0x00ff) AM_RAM AM_BASE(m_sys_register)
279279   AM_RANGE(0x0100, 0x03ff) AM_READWRITE(io_r, io_w)
280   AM_RANGE(0x0400, 0x3fff) AM_RAM AM_BASE(m_ram) AM_SIZE(m_ram_size)
280   AM_RANGE(0x0400, 0x3fff) AM_RAM AM_BASE_SIZE(m_ram,m_ram_size)
281281   AM_RANGE(0x4000, 0x7fff) AM_RAMBANK("rambank")
282282   AM_RANGE(0x8000, 0xbfff) AM_ROMBANK("rombank")
283283   AM_RANGE(0xc000, 0xffff) AM_ROM

Previous 15994 Revisions Next


© 1998-2018 The MESS Team