diff options
Diffstat (limited to 'src/emu')
| -rw-r--r-- | src/emu/cpu/arm7/arm7.c | 2 | ||||
| -rw-r--r-- | src/emu/cpu/arm7/arm7core.c | 2 | ||||
| -rw-r--r-- | src/emu/cpu/dsp56k/dsp56k.h | 6 | ||||
| -rw-r--r-- | src/emu/cpu/dsp56k/dsp56mem.c | 6 | ||||
| -rw-r--r-- | src/emu/cpu/esrip/esrip.c | 6 | ||||
| -rw-r--r-- | src/emu/cpu/m37710/m37710.c | 4 | ||||
| -rw-r--r-- | src/emu/cpu/pdp1/tx0.c | 6 | ||||
| -rw-r--r-- | src/emu/machine/i2cmem.c | 4 | ||||
| -rw-r--r-- | src/emu/video.c | 4 | ||||
| -rw-r--r-- | src/emu/video/tms9928a.c | 116 |
10 files changed, 86 insertions, 70 deletions
diff --git a/src/emu/cpu/arm7/arm7.c b/src/emu/cpu/arm7/arm7.c index b1113898a14..3287b5f4ee0 100644 --- a/src/emu/cpu/arm7/arm7.c +++ b/src/emu/cpu/arm7/arm7.c @@ -86,7 +86,7 @@ static CPU_INIT( arm7 ) arm_state *cpustate = get_safe_token(device); // must call core - arm7_core_init("arm7", device); + arm7_core_init(device, "arm7"); cpustate->irq_callback = irqcallback; cpustate->device = device; diff --git a/src/emu/cpu/arm7/arm7core.c b/src/emu/cpu/arm7/arm7core.c index 089f1705bc1..4a25be4debf 100644 --- a/src/emu/cpu/arm7/arm7core.c +++ b/src/emu/cpu/arm7/arm7core.c @@ -507,7 +507,7 @@ static int storeDec(arm_state *cpustate, UINT32 pat, UINT32 rbv) ***************************************************************************/ // CPU INIT -static void arm7_core_init(const char *cpuname, const device_config *device) +static void arm7_core_init(const device_config *device, const char *cpuname) { arm_state *cpustate = get_safe_token(device); diff --git a/src/emu/cpu/dsp56k/dsp56k.h b/src/emu/cpu/dsp56k/dsp56k.h index ca637f201b7..bf0dd85cb91 100644 --- a/src/emu/cpu/dsp56k/dsp56k.h +++ b/src/emu/cpu/dsp56k/dsp56k.h @@ -243,9 +243,9 @@ typedef struct PUBLIC FUNCTIONS ***************************************************************************/ -void dsp56k_host_interface_write(device_config* device, UINT8 offset, UINT8 data); -UINT8 dsp56k_host_interface_read(device_config* device, UINT8 offset); +void dsp56k_host_interface_write(const device_config* device, UINT8 offset, UINT8 data); +UINT8 dsp56k_host_interface_read(const device_config* device, UINT8 offset); -UINT16 dsp56k_get_peripheral_memory(device_config* device, UINT16 addr); +UINT16 dsp56k_get_peripheral_memory(const device_config* device, UINT16 addr); #endif /* __DSP56K_H__ */ diff --git a/src/emu/cpu/dsp56k/dsp56mem.c b/src/emu/cpu/dsp56k/dsp56mem.c index fac1b2f89ed..440f7543642 100644 --- a/src/emu/cpu/dsp56k/dsp56mem.c +++ b/src/emu/cpu/dsp56k/dsp56mem.c @@ -610,7 +610,7 @@ static void dsp56k_host_interface_reset(dsp56k_core* cpustate) /* These two functions are exposed to the outside world */ /* They represent the host side of the dsp56k's host interface */ -void dsp56k_host_interface_write(device_config* device, UINT8 offset, UINT8 data) +void dsp56k_host_interface_write(const device_config* device, UINT8 offset, UINT8 data) { dsp56k_core* cpustate = get_safe_token(device); @@ -706,7 +706,7 @@ void dsp56k_host_interface_write(device_config* device, UINT8 offset, UINT8 data } } -UINT8 dsp56k_host_interface_read(device_config* device, UINT8 offset) +UINT8 dsp56k_host_interface_read(const device_config* device, UINT8 offset) { dsp56k_core* cpustate = get_safe_token(device); @@ -934,7 +934,7 @@ static void dsp56k_io_reset(dsp56k_core* cpustate) /* MISC*/ -UINT16 dsp56k_get_peripheral_memory(device_config* device, UINT16 addr) +UINT16 dsp56k_get_peripheral_memory(const device_config* device, UINT16 addr) { // TODO // THIS COMES BACK dsp56k_core* cpustate = get_safe_token(device); return dsp56k_peripheral_ram[A2O(addr)]; diff --git a/src/emu/cpu/esrip/esrip.c b/src/emu/cpu/esrip/esrip.c index c28286ed929..c4fc697a166 100644 --- a/src/emu/cpu/esrip/esrip.c +++ b/src/emu/cpu/esrip/esrip.c @@ -368,7 +368,7 @@ static int get_lbrm(esrip_state *cpustate) return (val >> sel) & 1; } -INLINE int check_jmp(esrip_state *cpustate, running_machine *machine, UINT8 jmp_ctrl) +INLINE int check_jmp(esrip_state *cpustate, UINT8 jmp_ctrl) { int ret = 0; @@ -382,7 +382,7 @@ INLINE int check_jmp(esrip_state *cpustate, running_machine *machine, UINT8 jmp_ /* T3 */ case 6: ret = BIT(cpustate->t, 2); break; /* T4 */ case 1: ret = BIT(cpustate->t, 3); break; /* /LBRM */ case 5: ret = !get_lbrm(cpustate); break; - /* /HBLANK */ case 3: ret = !get_hblank(machine); break; + /* /HBLANK */ case 3: ret = !get_hblank(cpustate->device->machine); break; /* JMP */ case 7: ret = 0; break; } @@ -1762,7 +1762,7 @@ static CPU_EXECUTE( esrip ) if ((((cpustate->l5 >> 3) & 0x1f) & 0x18) != 0x18) { - if ( check_jmp(cpustate, device->machine, (cpustate->l5 >> 3) & 0x1f) ) + if ( check_jmp(cpustate, (cpustate->l5 >> 3) & 0x1f) ) next_pc = cpustate->l1; else next_pc = cpustate->pc + 1; diff --git a/src/emu/cpu/m37710/m37710.c b/src/emu/cpu/m37710/m37710.c index eef145d2640..6bad5319737 100644 --- a/src/emu/cpu/m37710/m37710.c +++ b/src/emu/cpu/m37710/m37710.c @@ -303,7 +303,7 @@ static void m37710_external_tick(m37710i_cpu_struct *cpustate, int timer, int st } } -static void m37710_recalc_timer(m37710i_cpu_struct *cpustate, running_machine *machine, int timer) +static void m37710_recalc_timer(m37710i_cpu_struct *cpustate, int timer) { int tval; static const int tcr[8] = { 0x56, 0x57, 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d }; @@ -505,7 +505,7 @@ static void m37710_internal_w(m37710i_cpu_struct *cpustate, int offset, UINT8 da if ((data & (1<<i)) && !(cpustate->m37710_regs[offset] & (1<<i))) { cpustate->m37710_regs[offset] |= (1<<i); - m37710_recalc_timer(cpustate, cpustate->device->machine, i); + m37710_recalc_timer(cpustate, i); } } diff --git a/src/emu/cpu/pdp1/tx0.c b/src/emu/cpu/pdp1/tx0.c index 14251fa8a3c..83e3568c5d4 100644 --- a/src/emu/cpu/pdp1/tx0.c +++ b/src/emu/cpu/pdp1/tx0.c @@ -127,7 +127,7 @@ static void tx0_write(tx0_state *cpustate, offs_t address, int data) ; } -static void tx0_init_common(int is_64kw, const device_config *device, cpu_irq_callback irqcallback) +static void tx0_init_common(const device_config *device, cpu_irq_callback irqcallback, int is_64kw) { tx0_state *cpustate = get_safe_token(device); @@ -143,12 +143,12 @@ static void tx0_init_common(int is_64kw, const device_config *device, cpu_irq_ca static CPU_INIT( tx0_64kw ) { - tx0_init_common(1, device, irqcallback); + tx0_init_common(device, irqcallback, 1); } static CPU_INIT( tx0_8kw) { - tx0_init_common(0, device, irqcallback); + tx0_init_common(device, irqcallback, 0); } static CPU_RESET( tx0 ) diff --git a/src/emu/machine/i2cmem.c b/src/emu/machine/i2cmem.c index 8450ed311ca..cc72ee8b268 100644 --- a/src/emu/machine/i2cmem.c +++ b/src/emu/machine/i2cmem.c @@ -406,7 +406,7 @@ int i2cmem_read( running_machine *machine, int chip, int line ) return 0; } -static void nvram_handler_i2cmem( int chip, running_machine *machine, mame_file *file, int read_or_write ) +static void nvram_handler_i2cmem( running_machine *machine, mame_file *file, int read_or_write, int chip ) { struct i2cmem_chip *c; @@ -428,4 +428,4 @@ static void nvram_handler_i2cmem( int chip, running_machine *machine, mame_file } } -NVRAM_HANDLER( i2cmem_0 ) { nvram_handler_i2cmem( 0, machine, file, read_or_write ); } +NVRAM_HANDLER( i2cmem_0 ) { nvram_handler_i2cmem( machine, file, read_or_write, 0 ); } diff --git a/src/emu/video.c b/src/emu/video.c index aefd99440ef..fba4efc98ce 100644 --- a/src/emu/video.c +++ b/src/emu/video.c @@ -1343,7 +1343,7 @@ DEVICE_GET_INFO( video_screen ) static TIMER_CALLBACK( vblank_begin_callback ) { int i; - device_config *screen = (device_config *)ptr; + const device_config *screen = (const device_config *)ptr; screen_state *state = get_safe_token(screen); /* reset the starting VBLANK time */ @@ -1363,7 +1363,7 @@ static TIMER_CALLBACK( vblank_begin_callback ) /* if no VBLANK period, call the VBLANK end callback immedietely, otherwise reset the timer */ if (state->vblank_period == 0) - vblank_end_callback(machine, screen, 0); + vblank_end_callback(machine, ptr, 0); else timer_adjust_oneshot(state->vblank_end_timer, video_screen_get_time_until_vblank_end(screen), 0); } diff --git a/src/emu/video/tms9928a.c b/src/emu/video/tms9928a.c index 615f2d982e3..ee292dbefc2 100644 --- a/src/emu/video/tms9928a.c +++ b/src/emu/video/tms9928a.c @@ -100,17 +100,17 @@ static const rgb_t TMS9928A_palette[16] = /* ** Forward declarations of internal functions. */ -static void draw_mode0 (running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect); -static void draw_mode1 (running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect); -static void draw_mode2 (running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect); -static void draw_mode12 (running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect); -static void draw_mode3 (running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect); -static void draw_mode23 (running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect); -static void draw_modebogus (running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect); -static void draw_sprites (running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect); +static void draw_mode0 (const device_config *screen, bitmap_t *bitmap, const rectangle *cliprect); +static void draw_mode1 (const device_config *screen, bitmap_t *bitmap, const rectangle *cliprect); +static void draw_mode2 (const device_config *screen, bitmap_t *bitmap, const rectangle *cliprect); +static void draw_mode12 (const device_config *screen, bitmap_t *bitmap, const rectangle *cliprect); +static void draw_mode3 (const device_config *screen, bitmap_t *bitmap, const rectangle *cliprect); +static void draw_mode23 (const device_config *screen, bitmap_t *bitmap, const rectangle *cliprect); +static void draw_modebogus (const device_config *screen, bitmap_t *bitmap, const rectangle *cliprect); +static void draw_sprites (const device_config *screen, bitmap_t *bitmap, const rectangle *cliprect); static void change_register (running_machine *machine, int reg, UINT8 data); -static void (*const ModeHandlers[])(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect) = { +static void (*const ModeHandlers[])(const device_config *screen, bitmap_t *bitmap, const rectangle *cliprect) = { draw_mode0, draw_mode1, draw_mode2, draw_mode12, draw_mode3, draw_modebogus, draw_mode23, draw_modebogus }; @@ -403,7 +403,7 @@ VIDEO_UPDATE( tms9928a ) bitmap_fill(bitmap, cliprect, screen->machine->pens[BackColour]); else { - (*ModeHandlers[TMS_MODE])(screen->machine, tms.tmpbmp, cliprect); + (*ModeHandlers[TMS_MODE])(screen, tms.tmpbmp, cliprect); copybitmap(bitmap, tms.tmpbmp, 0, 0, LEFT_BORDER, TOP_BORDER, cliprect); { @@ -421,9 +421,9 @@ VIDEO_UPDATE( tms9928a ) bitmap_fill (bitmap, &rt, BackColour); rt.min_x = LEFT_BORDER+256; rt.max_x = LEFT_BORDER+256+RIGHT_BORDER-1; bitmap_fill (bitmap, &rt, BackColour); - } + } if (TMS_SPRITES_ENABLED) - draw_sprites(screen->machine, bitmap, cliprect); + draw_sprites(screen, bitmap, cliprect); } return 0; @@ -449,13 +449,15 @@ int TMS9928A_interrupt(running_machine *machine) { return b; } -static void draw_mode1 (running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect) { +static void draw_mode1 (const device_config *screen, bitmap_t *bitmap, const rectangle *cliprect) { int pattern,x,y,yy,xx,name,charcode; UINT8 fg,bg,*patternptr; - rectangle rt; + rectangle rt; + const pen_t *pens; - fg = machine->pens[tms.Regs[7] / 16]; - bg = machine->pens[tms.Regs[7] & 15]; + pens = screen->machine->pens; + fg = pens[tms.Regs[7] / 16]; + bg = pens[tms.Regs[7] & 15]; /* colours at sides must be reset */ rt.min_y = 0; rt.max_y = 191; @@ -482,13 +484,15 @@ static void draw_mode1 (running_machine *machine, bitmap_t *bitmap, const rectan } } -static void draw_mode12 (running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect) { +static void draw_mode12 (const device_config *screen, bitmap_t *bitmap, const rectangle *cliprect) { int pattern,x,y,yy,xx,name,charcode; UINT8 fg,bg,*patternptr; - rectangle rt; + const pen_t *pens; + rectangle rt; - fg = machine->pens[tms.Regs[7] / 16]; - bg = machine->pens[tms.Regs[7] & 15]; + pens = screen->machine->pens; + fg = pens[tms.Regs[7] / 16]; + bg = pens[tms.Regs[7] & 15]; /* colours at sides must be reset */ rt.min_y = 0; rt.max_y = 191; @@ -515,10 +519,12 @@ static void draw_mode12 (running_machine *machine, bitmap_t *bitmap, const recta } } -static void draw_mode0 (running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect) { +static void draw_mode0 (const device_config *screen, bitmap_t *bitmap, const rectangle *cliprect) { int pattern,x,y,yy,xx,name,charcode,colour; UINT8 fg,bg,*patternptr; + const pen_t *pens; + pens = screen->machine->pens; name = 0; for (y=0;y<24;y++) { for (x=0;x<32;x++) { @@ -526,8 +532,8 @@ static void draw_mode0 (running_machine *machine, bitmap_t *bitmap, const rectan name++; patternptr = tms.vMem + tms.pattern + charcode*8; colour = tms.vMem[tms.colour+charcode/8]; - fg = machine->pens[colour / 16]; - bg = machine->pens[colour & 15]; + fg = pens[colour / 16]; + bg = pens[colour & 15]; for (yy=0;yy<8;yy++) { pattern=*patternptr++; for (xx=0;xx<8;xx++) { @@ -539,11 +545,13 @@ static void draw_mode0 (running_machine *machine, bitmap_t *bitmap, const rectan } } -static void draw_mode2 (running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect) { +static void draw_mode2 (const device_config *screen, bitmap_t *bitmap, const rectangle *cliprect) { int colour,name,x,y,yy,pattern,xx,charcode; UINT8 fg,bg; + const pen_t *pens; UINT8 *colourptr,*patternptr; + pens = screen->machine->pens; name = 0; for (y=0;y<24;y++) { for (x=0;x<32;x++) { @@ -556,8 +564,8 @@ static void draw_mode2 (running_machine *machine, bitmap_t *bitmap, const rectan for (yy=0;yy<8;yy++) { pattern = *patternptr++; colour = *colourptr++; - fg = machine->pens[colour / 16]; - bg = machine->pens[colour & 15]; + fg = pens[colour / 16]; + bg = pens[colour & 15]; for (xx=0;xx<8;xx++) { *BITMAP_ADDR16(bitmap, y*8+yy, x*8+xx) = (pattern & 0x80) ? fg : bg; pattern *= 2; @@ -567,10 +575,12 @@ static void draw_mode2 (running_machine *machine, bitmap_t *bitmap, const rectan } } -static void draw_mode3 (running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect) { +static void draw_mode3 (const device_config *screen, bitmap_t *bitmap, const rectangle *cliprect) { int x,y,yy,yyy,name,charcode; UINT8 fg,bg,*patternptr; + const pen_t *pens; + pens = screen->machine->pens; name = 0; for (y=0;y<24;y++) { for (x=0;x<32;x++) { @@ -578,8 +588,8 @@ static void draw_mode3 (running_machine *machine, bitmap_t *bitmap, const rectan name++; patternptr = tms.vMem+tms.pattern+charcode*8+(y&3)*2; for (yy=0;yy<2;yy++) { - fg = machine->pens[(*patternptr / 16)]; - bg = machine->pens[((*patternptr++) & 15)]; + fg = pens[(*patternptr / 16)]; + bg = pens[((*patternptr++) & 15)]; for (yyy=0;yyy<4;yyy++) { *BITMAP_ADDR16(bitmap, y*8+yy*4+yyy, x*8+0) = fg; *BITMAP_ADDR16(bitmap, y*8+yy*4+yyy, x*8+1) = fg; @@ -595,10 +605,12 @@ static void draw_mode3 (running_machine *machine, bitmap_t *bitmap, const rectan } } -static void draw_mode23 (running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect) { +static void draw_mode23 (const device_config *screen, bitmap_t *bitmap, const rectangle *cliprect) { int x,y,yy,yyy,name,charcode; UINT8 fg,bg,*patternptr; + const pen_t *pens; + pens = screen->machine->pens; name = 0; for (y=0;y<24;y++) { for (x=0;x<32;x++) { @@ -607,8 +619,8 @@ static void draw_mode23 (running_machine *machine, bitmap_t *bitmap, const recta patternptr = tms.vMem + tms.pattern + ((charcode+(y&3)*2+(y/8)*256)&tms.patternmask)*8; for (yy=0;yy<2;yy++) { - fg = machine->pens[(*patternptr / 16)]; - bg = machine->pens[((*patternptr++) & 15)]; + fg = pens[(*patternptr / 16)]; + bg = pens[((*patternptr++) & 15)]; for (yyy=0;yyy<4;yyy++) { *BITMAP_ADDR16(bitmap, y*8+yy*4+yyy, x*8+0) = fg; *BITMAP_ADDR16(bitmap, y*8+yy*4+yyy, x*8+1) = fg; @@ -624,12 +636,14 @@ static void draw_mode23 (running_machine *machine, bitmap_t *bitmap, const recta } } -static void draw_modebogus (running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect) { +static void draw_modebogus (const device_config *screen, bitmap_t *bitmap, const rectangle *cliprect) { UINT8 fg,bg; int x,y,n,xx; + const pen_t *pens; - fg = machine->pens[tms.Regs[7] / 16]; - bg = machine->pens[tms.Regs[7] & 15]; + pens = screen->machine->pens; + fg = pens[tms.Regs[7] / 16]; + bg = pens[tms.Regs[7] & 15]; for (y=0;y<192;y++) { xx=0; @@ -651,12 +665,14 @@ static void draw_modebogus (running_machine *machine, bitmap_t *bitmap, const re ** ** This code should be optimized. One day. */ -static void draw_sprites (running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect) { +static void draw_sprites (const device_config *screen, bitmap_t *bitmap, const rectangle *cliprect) { UINT8 *attributeptr,*patternptr,c; int p,x,y,size,i,j,large,yy,xx,limit[192], illegalsprite,illegalspriteline; UINT16 line,line2; + const pen_t *pens; + pens = screen->machine->pens; attributeptr = tms.vMem + tms.spriteattribute; size = (tms.Regs[1] & 2) ? 16 : 8; large = (int)(tms.Regs[1] & 1); @@ -710,10 +726,10 @@ static void draw_sprites (running_machine *machine, bitmap_t *bitmap, const rect } if (c && ! (tms.dBackMem[yy*256+xx] & 0x02)) { - tms.dBackMem[yy*256+xx] |= 0x02; - if (bitmap) - *BITMAP_ADDR16(bitmap, TOP_BORDER+yy, LEFT_BORDER+xx) = machine->pens[c]; - } + tms.dBackMem[yy*256+xx] |= 0x02; + if (bitmap) + *BITMAP_ADDR16(bitmap, TOP_BORDER+yy, LEFT_BORDER+xx) = pens[c]; + } } } line *= 2; @@ -747,12 +763,12 @@ static void draw_sprites (running_machine *machine, bitmap_t *bitmap, const rect } else { tms.dBackMem[yy*256+xx] = 0x01; } - if (c && ! (tms.dBackMem[yy*256+xx] & 0x02)) - { - tms.dBackMem[yy*256+xx] |= 0x02; + if (c && ! (tms.dBackMem[yy*256+xx] & 0x02)) + { + tms.dBackMem[yy*256+xx] |= 0x02; if (bitmap) - *BITMAP_ADDR16(bitmap, TOP_BORDER+yy, LEFT_BORDER+xx) = machine->pens[c]; - } + *BITMAP_ADDR16(bitmap, TOP_BORDER+yy, LEFT_BORDER+xx) = pens[c]; + } } if (((xx+1) >=0) && ((xx+1) < 256)) { if (tms.dBackMem[yy*256+xx+1]) { @@ -760,12 +776,12 @@ static void draw_sprites (running_machine *machine, bitmap_t *bitmap, const rect } else { tms.dBackMem[yy*256+xx+1] = 0x01; } - if (c && ! (tms.dBackMem[yy*256+xx+1] & 0x02)) - { - tms.dBackMem[yy*256+xx+1] |= 0x02; + if (c && ! (tms.dBackMem[yy*256+xx+1] & 0x02)) + { + tms.dBackMem[yy*256+xx+1] |= 0x02; if (bitmap) - *BITMAP_ADDR16(bitmap, TOP_BORDER+yy, LEFT_BORDER+xx+1) = machine->pens[c]; - } + *BITMAP_ADDR16(bitmap, TOP_BORDER+yy, LEFT_BORDER+xx+1) = pens[c]; + } } } line *= 2; |
