diff options
author | 2008-08-19 06:10:43 +0000 | |
---|---|---|
committer | 2008-08-19 06:10:43 +0000 | |
commit | 13a3d3fb89be8b9f3dd628a814f4fa6e1472feaa (patch) | |
tree | 68b946b4035caaeb6621d2456f9dfda015b11a5e /src/emu | |
parent | de5cd6e5a8d170cd65be8c19e9820cafdd4e604c (diff) |
From: Oliver Stoeneberg [mailto:oliverst@online.de]
Subject: Various cleanups
A couple of minor cleanups sitting on my disk for a while:
- removed obsolete ENABLE_DEBUGGER occurance
- removed more unprintable characters in SH-2 disassembler
- memset() usage cleanups
- removed duplicated TMS5110 entry in sound.mak
- use machine in uigfx.c where it's already available
Diffstat (limited to 'src/emu')
-rw-r--r-- | src/emu/cpu/mips/dismips.mak | 2 | ||||
-rw-r--r-- | src/emu/cpu/sh2/sh2dasm.c | 4 | ||||
-rw-r--r-- | src/emu/sound.c | 2 | ||||
-rw-r--r-- | src/emu/sound/c140.c | 2 | ||||
-rw-r--r-- | src/emu/sound/sound.mak | 1 | ||||
-rw-r--r-- | src/emu/sound/vrender0.c | 2 | ||||
-rw-r--r-- | src/emu/uigfx.c | 22 |
7 files changed, 17 insertions, 18 deletions
diff --git a/src/emu/cpu/mips/dismips.mak b/src/emu/cpu/mips/dismips.mak index 945e0867b02..3fa555a0ae6 100644 --- a/src/emu/cpu/mips/dismips.mak +++ b/src/emu/cpu/mips/dismips.mak @@ -1,2 +1,2 @@ ..\..\..\..\dismips.exe: dismips.c mipsdasm.c r3kdasm.c mips3dsm.c ../../../lib/util/corestr.c - gcc -O3 -Wall -I../../../emu -I../../../osd -I../../../lib/util -DINLINE="static __inline__" -DSTANDALONE -DENABLE_DEBUGGER -DLSB_FIRST dismips.c mipsdasm.c r3kdasm.c mips3dsm.c ../../../lib/util/corestr.c -o../../../../dismips + gcc -O3 -Wall -I../../../emu -I../../../osd -I../../../lib/util -DINLINE="static __inline__" -DSTANDALONE -DLSB_FIRST dismips.c mipsdasm.c r3kdasm.c mips3dsm.c ../../../lib/util/corestr.c -o../../../../dismips diff --git a/src/emu/cpu/sh2/sh2dasm.c b/src/emu/cpu/sh2/sh2dasm.c index 868d0670116..cf45d1791a5 100644 --- a/src/emu/cpu/sh2/sh2dasm.c +++ b/src/emu/cpu/sh2/sh2dasm.c @@ -128,7 +128,7 @@ static UINT32 op0000(char *buffer, UINT32 pc, UINT16 opcode) static UINT32 op0001(char *buffer, UINT32 pc, UINT16 opcode) { - sprintf(buffer, "MOV.L %s,@($%02X,%s)\n", regname[Rm], (opcode & 15) * 4, regname[Rn]); + sprintf(buffer, "MOV.L %s,@($%02X,%s)", regname[Rm], (opcode & 15) * 4, regname[Rn]); return 0; } @@ -438,7 +438,7 @@ static UINT32 op0110(char *buffer, UINT32 pc, UINT16 opcode) static UINT32 op0111(char *buffer, UINT32 pc, UINT16 opcode) { - sprintf(buffer, "ADD #$%02X,%s\n", opcode & 0xff, regname[Rn]); + sprintf(buffer, "ADD #$%02X,%s", opcode & 0xff, regname[Rn]); return 0; } diff --git a/src/emu/sound.c b/src/emu/sound.c index f8e8b37ab2d..27ee5ead892 100644 --- a/src/emu/sound.c +++ b/src/emu/sound.c @@ -250,7 +250,7 @@ static void sound_exit(running_machine *machine) /* reset variables */ totalsnd = 0; - memset(&sound, 0, sizeof(sound)); + memset(sound, 0, sizeof(sound)); } diff --git a/src/emu/sound/c140.c b/src/emu/sound/c140.c index fd03ad19941..8a012a27dc9 100644 --- a/src/emu/sound/c140.c +++ b/src/emu/sound/c140.c @@ -482,7 +482,7 @@ static void *c140_start(const char *tag, int sndindex, int clock, const void *co } } - memset(info->REG,0,0x200 ); + memset(info->REG,0,sizeof(info->REG)); { int i; for(i=0;i<MAX_VOICE;i++) init_voice( &info->voi[i] ); diff --git a/src/emu/sound/sound.mak b/src/emu/sound/sound.mak index 5cfc89b742b..6a853a9cae5 100644 --- a/src/emu/sound/sound.mak +++ b/src/emu/sound/sound.mak @@ -596,7 +596,6 @@ SOUNDDEFS += -DHAS_CD2801=$(if $(filter CD2801,$(SOUNDS)),1,0) SOUNDDEFS += -DHAS_TMC0281=$(if $(filter TMC0281,$(SOUNDS)),1,0) SOUNDDEFS += -DHAS_CD2802=$(if $(filter CD2802,$(SOUNDS)),1,0) SOUNDDEFS += -DHAS_M58817=$(if $(filter M58817,$(SOUNDS)),1,0) -SOUNDDEFS += -DHAS_TMS5110=$(if $(filter TMS5110,$(SOUNDS)),1,0) SOUNDDEFS += -DHAS_TMC0285=$(if $(filter TMC0285,$(SOUNDS)),1,0) SOUNDDEFS += -DHAS_TMS5200=$(if $(filter TMS5200,$(SOUNDS)),1,0) SOUNDDEFS += -DHAS_TMS5220=$(if $(filter TMS5220,$(SOUNDS)),1,0) diff --git a/src/emu/sound/vrender0.c b/src/emu/sound/vrender0.c index cd0cf94dd70..8adb48dcf36 100644 --- a/src/emu/sound/vrender0.c +++ b/src/emu/sound/vrender0.c @@ -105,7 +105,7 @@ static void *vrender0_start(const char *tag, int sndindex, int clock, const void intf=config; memcpy(&(VR0->Intf),intf,sizeof(vr0_interface)); - memset(VR0->SOUNDREGS,0,0x10000); + memset(VR0->SOUNDREGS,0,sizeof(VR0->SOUNDREGS)); VR0->stream = stream_create(0, 2, 44100, VR0, VR0_Update); diff --git a/src/emu/uigfx.c b/src/emu/uigfx.c index e05ffd43a90..99993b4b919 100644 --- a/src/emu/uigfx.c +++ b/src/emu/uigfx.c @@ -236,9 +236,9 @@ cancel: static void palette_handler(running_machine *machine, ui_gfx_state *state) { - int total = state->palette.which ? colortable_palette_get_size(Machine->colortable) : Machine->config->total_colors; + int total = state->palette.which ? colortable_palette_get_size(machine->colortable) : machine->config->total_colors; const char *title = state->palette.which ? "COLORTABLE" : "PALETTE"; - const rgb_t *raw_color = palette_entry_list_raw(Machine->palette); + const rgb_t *raw_color = palette_entry_list_raw(machine->palette); render_font *ui_font = ui_get_font(); float cellwidth, cellheight; float chwidth, chheight; @@ -337,7 +337,7 @@ static void palette_handler(running_machine *machine, ui_gfx_state *state) int index = state->palette.offset + y * state->palette.count + x; if (index < total) { - pen_t pen = state->palette.which ? colortable_palette_get_color(Machine->colortable, index) : raw_color[index]; + pen_t pen = state->palette.which ? colortable_palette_get_color(machine->colortable, index) : raw_color[index]; render_ui_add_rect(cellboxbounds.x0 + x * cellwidth, cellboxbounds.y0 + y * cellheight, cellboxbounds.x0 + (x + 1) * cellwidth, cellboxbounds.y0 + (y + 1) * cellheight, 0xff000000 | pen, PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA)); @@ -380,11 +380,11 @@ static void palette_handle_keys(running_machine *machine, ui_gfx_state *state) /* clamp within range */ if (state->palette.which < 0) state->palette.which = 1; - if (state->palette.which > (Machine->colortable != NULL)) - state->palette.which = (Machine->colortable != NULL); + if (state->palette.which > (machine->colortable != NULL)) + state->palette.which = (machine->colortable != NULL); /* cache some info in locals */ - total = state->palette.which ? colortable_palette_get_size(Machine->colortable) : Machine->config->total_colors; + total = state->palette.which ? colortable_palette_get_size(machine->colortable) : machine->config->total_colors; /* determine number of entries per row and total */ rowcount = state->palette.count; @@ -426,7 +426,7 @@ static void gfxset_handler(running_machine *machine, ui_gfx_state *state) { render_font *ui_font = ui_get_font(); int set = state->gfxset.set; - gfx_element *gfx = Machine->gfx[set]; + gfx_element *gfx = machine->gfx[set]; float fullwidth, fullheight; float cellwidth, cellheight; float chwidth, chheight; @@ -511,7 +511,7 @@ static void gfxset_handler(running_machine *machine, ui_gfx_state *state) boxbounds.y1 = boxbounds.y0 + fullheight; /* figure out the title and expand the outer box to fit */ - for (x = 0; x < MAX_GFX_ELEMENTS && Machine->gfx[x] != NULL; x++) ; + for (x = 0; x < MAX_GFX_ELEMENTS && machine->gfx[x] != NULL; x++) ; sprintf(title, "GFX %d/%d %dx%d COLOR %X", state->gfxset.set, x - 1, gfx->width, gfx->height, state->gfxset.color[set]); titlewidth = render_font_get_string_width(ui_font, chheight, render_get_ui_aspect(), title); x0 = 0.0f; @@ -598,7 +598,7 @@ static void gfxset_handle_keys(running_machine *machine, ui_gfx_state *state, in if (ui_input_pressed(machine, IPT_UI_PREV_GROUP)) { for (temp = state->gfxset.set - 1; temp >= 0; temp--) - if (Machine->gfx[temp] != NULL) + if (machine->gfx[temp] != NULL) break; if (temp >= 0) state->gfxset.set = temp; @@ -606,7 +606,7 @@ static void gfxset_handle_keys(running_machine *machine, ui_gfx_state *state, in if (ui_input_pressed(machine, IPT_UI_NEXT_GROUP)) { for (temp = state->gfxset.set + 1; temp < MAX_GFX_ELEMENTS; temp++) - if (Machine->gfx[temp] != NULL) + if (machine->gfx[temp] != NULL) break; if (temp < MAX_GFX_ELEMENTS) state->gfxset.set = temp; @@ -614,7 +614,7 @@ static void gfxset_handle_keys(running_machine *machine, ui_gfx_state *state, in /* cache some info in locals */ set = state->gfxset.set; - gfx = Machine->gfx[set]; + gfx = machine->gfx[set]; /* handle cells per line (minus,plus) */ if (ui_input_pressed(machine, IPT_UI_ZOOM_OUT)) |