summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author Aaron Giles <aaron@aarongiles.com>2008-07-31 08:30:22 +0000
committer Aaron Giles <aaron@aarongiles.com>2008-07-31 08:30:22 +0000
commite8f2759a0c9e0bdd82a214bdad6e965be32760c6 (patch)
tree700142bf373ecfa7c9a575695d862c6801e83ffd
parente0409bc7b193758db47acad49695d37545a6e258 (diff)
(From Atari Ace. Note that I only took the first patch, which applied
to whole functions. The other one I'm not so sure about. Commented code is usually hilighted differently, making it very easy to spot.) Hi mamedev, This set of patches has one aim only, to identify chunks of code that have been disabled by the use of C/C++ comments, and to disable them instead by using the preprocessor. The C comment approach to disabling code isn't safe (embedded comments will trip it up), and the C++ comment approach isn't elegant (you shouldn't need to touch every line to disable a chunk of code). Using #if...#endif is preferable always, excepting perhaps if (0) { ... }. The patch has three parts. The first only handles cases where full functions were disabled. The second handles cases where parts of functions were disabled. The third then tries to restore the whitespace that the use of comments converted from tabs to spaces via srcclean.exe. It also cleans up the whitespace in a handful of the files in areas outside of the original two patches. ~aa
-rw-r--r--src/emu/cpu/lr35902/lr35902.c6
-rw-r--r--src/emu/sound/2413intf.c4
-rw-r--r--src/emu/video/tms9928a.c6
-rw-r--r--src/mame/drivers/ddenlovr.c4
-rw-r--r--src/mame/drivers/galaxian.c2
-rw-r--r--src/mame/drivers/galpanic.c5
-rw-r--r--src/mame/drivers/hng64.c12
-rw-r--r--src/mame/drivers/m90.c4
-rw-r--r--src/mame/drivers/meritm.c4
-rw-r--r--src/mame/drivers/mitchell.c4
-rw-r--r--src/mame/drivers/model2.c10
-rw-r--r--src/mame/drivers/nmk16.c4
-rw-r--r--src/mame/drivers/pturn.c4
-rw-r--r--src/mame/drivers/seibuspi.c4
-rw-r--r--src/mame/drivers/stvinit.c5
-rw-r--r--src/mame/drivers/suprgolf.c5
-rw-r--r--src/mame/drivers/wgp.c4
-rw-r--r--src/mame/machine/dc.c6
-rw-r--r--src/mame/video/gcpinbal.c4
19 files changed, 54 insertions, 43 deletions
diff --git a/src/emu/cpu/lr35902/lr35902.c b/src/emu/cpu/lr35902/lr35902.c
index 1b131b12031..44b5f8e257f 100644
--- a/src/emu/cpu/lr35902/lr35902.c
+++ b/src/emu/cpu/lr35902/lr35902.c
@@ -379,10 +379,12 @@ static void lr35902_set_irq_line (int irqline, int state)
}
}
-/*static void lr35902_clear_pending_interrupts (void)
+#ifdef UNUSED_FUNCTION
+static void lr35902_clear_pending_interrupts (void)
{
Regs.w.IF = 0;
-}*/
+}
+#endif
static void lr35902_set_info(UINT32 state, cpuinfo *info)
{
diff --git a/src/emu/sound/2413intf.c b/src/emu/sound/2413intf.c
index cadd9d94e7e..ada4340737f 100644
--- a/src/emu/sound/2413intf.c
+++ b/src/emu/sound/2413intf.c
@@ -22,7 +22,7 @@ struct ym2413_info
void * chip;
};
-/*
+#ifdef UNUSED_FUNCTION
void YM2413DAC_update(int chip,stream_sample_t **inputs, stream_sample_t **_buffer,int length)
{
INT16 *buffer = _buffer[0];
@@ -34,7 +34,7 @@ void YM2413DAC_update(int chip,stream_sample_t **inputs, stream_sample_t **_buff
}
while (length--) *(buffer++) = out;
}
-*/
+#endif
static void ym2413_stream_update(void *param, stream_sample_t **inputs, stream_sample_t **buffers, int length)
{
diff --git a/src/emu/video/tms9928a.c b/src/emu/video/tms9928a.c
index 4efeaa62009..ab418363675 100644
--- a/src/emu/video/tms9928a.c
+++ b/src/emu/video/tms9928a.c
@@ -377,9 +377,11 @@ static void change_register (running_machine *machine, int reg, UINT8 val) {
** Interface functions
*/
-/*void TMS9928A_int_callback (void (*callback)(int)) {
+#ifdef UNUSED_FUNCTION
+void TMS9928A_int_callback (void (*callback)(int)) {
tms.INTCallback = callback;
-}*/
+}
+#endif
void TMS9928A_set_spriteslimit (int limit) {
tms.LimitSprites = limit;
diff --git a/src/mame/drivers/ddenlovr.c b/src/mame/drivers/ddenlovr.c
index 39354099826..0e65d3edf10 100644
--- a/src/mame/drivers/ddenlovr.c
+++ b/src/mame/drivers/ddenlovr.c
@@ -6646,12 +6646,12 @@ static INTERRUPT_GEN( quizchq_irq )
cpunum_set_input_line_and_vector(machine, 0, 0, HOLD_LINE, 0xee);
}
-/*
+#ifdef UNUSED_FUNCTION
static INTERRUPT_GEN( rtc_irq )
{
cpunum_set_input_line_and_vector(machine, 0, 0, HOLD_LINE, 0xfc);
}
-*/
+#endif
static MACHINE_DRIVER_START( quizchq )
diff --git a/src/mame/drivers/galaxian.c b/src/mame/drivers/galaxian.c
index e1e9f93a3af..952d6891900 100644
--- a/src/mame/drivers/galaxian.c
+++ b/src/mame/drivers/galaxian.c
@@ -2849,7 +2849,7 @@ static DRIVER_INIT( turtles )
}
-#ifdef UNUSED_CODE
+#ifdef UNUSED_FUNCTION
static DRIVER_INIT( amidar )
{
/* no existing amidar sets run on Amidar hardware as described by Amidar schematics! */
diff --git a/src/mame/drivers/galpanic.c b/src/mame/drivers/galpanic.c
index 5de24b09ab8..f52d39fd0d2 100644
--- a/src/mame/drivers/galpanic.c
+++ b/src/mame/drivers/galpanic.c
@@ -342,12 +342,13 @@ static ADDRESS_MAP_START( galhustl_writemem, ADDRESS_SPACE_PROGRAM, 16 )
AM_RANGE(0xe80000, 0xe8ffff) AM_WRITE(SMH_RAM)
ADDRESS_MAP_END
-/*
+#ifdef UNUSED_FUNCTION
READ16_HANDLER( zipzap_random_read )
{
return mame_rand(machine);
}
-*/
+#endif
+
static ADDRESS_MAP_START( zipzap_readmem, ADDRESS_SPACE_PROGRAM, 16 )
AM_RANGE(0x000000, 0x4fffff) AM_READ(SMH_ROM)
AM_RANGE(0x500000, 0x51ffff) AM_READ(SMH_RAM)
diff --git a/src/mame/drivers/hng64.c b/src/mame/drivers/hng64.c
index 464212812ac..1315cc5a736 100644
--- a/src/mame/drivers/hng64.c
+++ b/src/mame/drivers/hng64.c
@@ -505,12 +505,12 @@ static UINT8 *hng64_com_mmu_mem;
extern UINT32 hng64_hackTilemap3, hng64_hackTm3Count, hng64_rowScrollOffset;
-/*
+#ifdef UNUSED_FUNCTION
WRITE32_HANDLER( trap_write )
{
logerror("Remapped write... %08x %08x\n",offset,data);
}
-*/
+#endif
static WRITE32_HANDLER( hng64_videoram_w )
@@ -818,13 +818,13 @@ static READ32_HANDLER( dl_r )
return hng64_dl[offset] ;
}
-/*
+#ifdef UNUSED_FUNCTION
WRITE32_HANDLER( activate_3d_buffer )
{
COMBINE_DATA (&active_3d_buffer[offset]) ;
mame_printf_debug("COMBINED %d\n", active_3d_buffer[offset]) ;
}
-*/
+#endif
// Transition Control memory.
static WRITE32_HANDLER( tcram_w )
@@ -1184,7 +1184,7 @@ static WRITE8_HANDLER( hng64_comm_io_mmu )
KL5C80_virtual_mem_sync();
}
-/*
+#ifdef UNUSED_FUNCTION
READ8_HANDLER( hng64_comm_shared_r )
{
// I'm thinking 0x54 comes from an interrupt on the MIPS CPU? Or maybe the Toshiba one?
@@ -1211,7 +1211,7 @@ WRITE8_HANDLER( hng64_comm_shared_w )
logerror("COM CPU wrote to com_shared_a : %08x\n", hng64_com_shared_a);
}
-*/
+#endif
static ADDRESS_MAP_START( hng_comm_map, ADDRESS_SPACE_PROGRAM, 8 )
AM_RANGE(0x0000,0xffff) AM_READWRITE( hng64_comm_memory_r, hng64_comm_memory_w )
diff --git a/src/mame/drivers/m90.c b/src/mame/drivers/m90.c
index 9fb5ce51ff1..2eabf2eb23a 100644
--- a/src/mame/drivers/m90.c
+++ b/src/mame/drivers/m90.c
@@ -84,12 +84,12 @@ static WRITE16_HANDLER( quizf1_bankswitch_w )
}
}
-/*
+#ifdef UNUSED_FUNCTION
static WRITE16_HANDLER( unknown_w )
{
printf("%04x ",data);
}
-*/
+#endif
/***************************************************************************/
diff --git a/src/mame/drivers/meritm.c b/src/mame/drivers/meritm.c
index 42c825c38a8..ea75bca4d4a 100644
--- a/src/mame/drivers/meritm.c
+++ b/src/mame/drivers/meritm.c
@@ -804,12 +804,12 @@ static const z80pio_interface meritm_io_pio_intf =
0
};
-/*
+#ifdef UNUSED_FUNCTION
static void meritm_pio1_portb_input_changed_callback(void *param, UINT32 oldval, UINT32 newval)
{
z80pio_p_w(1, 1, (UINT8)newval);
}
-*/
+#endif
static const struct z80_irq_daisy_chain meritm_daisy_chain[] =
{
diff --git a/src/mame/drivers/mitchell.c b/src/mame/drivers/mitchell.c
index b83085788f3..d062ef800ea 100644
--- a/src/mame/drivers/mitchell.c
+++ b/src/mame/drivers/mitchell.c
@@ -440,12 +440,12 @@ ADDRESS_MAP_END
static int sample_buffer = 0;
static int sample_select = 0;
-/*
+#ifdef UNUSED_FUNCTION
static WRITE8_HANDLER( spangbl_msm5205_data_w )
{
sample_buffer = data;
}
-*/
+#endif
static ADDRESS_MAP_START( spangb_sound_memmap, ADDRESS_SPACE_PROGRAM, 8 )
AM_RANGE(0x0000, 0x3fff) AM_ROM
diff --git a/src/mame/drivers/model2.c b/src/mame/drivers/model2.c
index 9e540733d85..c274ebba1f8 100644
--- a/src/mame/drivers/model2.c
+++ b/src/mame/drivers/model2.c
@@ -656,7 +656,7 @@ static WRITE32_HANDLER( geo_ctl1_w )
}
-/*
+#ifdef UNUSED_FUNCTION
static WRITE32_HANDLER( geo_sharc_ctl1_w )
{
// did hi bit change?
@@ -733,7 +733,7 @@ static WRITE32_HANDLER(geo_sharc_iop_w)
geo_iop_write_num++;
}
}
-*/
+#endif
static void push_geo_data(UINT32 data)
@@ -860,11 +860,13 @@ static READ32_HANDLER(hotd_unk_r)
return 0x000c0000;
}
-/*static READ32_HANDLER(sonic_unk_r)
+#ifdef UNUSED_FUNCTION
+static READ32_HANDLER(sonic_unk_r)
{
return 0x001a0000;
}
-*/
+#endif
+
static READ32_HANDLER(daytona_unk_r)
{
return 0x00400000;
diff --git a/src/mame/drivers/nmk16.c b/src/mame/drivers/nmk16.c
index d796cd2385e..3dacc3c0a1f 100644
--- a/src/mame/drivers/nmk16.c
+++ b/src/mame/drivers/nmk16.c
@@ -634,12 +634,12 @@ anything to compare,infact
nmk16_mainram[_protinput_+1] = (_input_ & 0x0000ffff);\
}
-/*
+#ifdef UNUSED_FUNCTION
static READ16_HANDLER( mcu_shared_r )
{
return nmk16_mcu_shared_ram[offset];
}
-*/
+#endif
//td - hmf
//008D9E - 00796e
diff --git a/src/mame/drivers/pturn.c b/src/mame/drivers/pturn.c
index b25083a05db..68b64b7fc93 100644
--- a/src/mame/drivers/pturn.c
+++ b/src/mame/drivers/pturn.c
@@ -169,7 +169,7 @@ static VIDEO_UPDATE(pturn)
return 0;
}
-/*
+#ifdef UNUSED_FUNCTION
READ8_HANDLER (pturn_protection_r)
{
return 0x66;
@@ -179,7 +179,7 @@ READ8_HANDLER (pturn_protection2_r)
{
return 0xfe;
}
-*/
+#endif
static WRITE8_HANDLER( pturn_videoram_w )
{
diff --git a/src/mame/drivers/seibuspi.c b/src/mame/drivers/seibuspi.c
index 18246ef3f6d..248426c486a 100644
--- a/src/mame/drivers/seibuspi.c
+++ b/src/mame/drivers/seibuspi.c
@@ -1918,7 +1918,7 @@ static READ32_HANDLER ( viprp1o_speedup_r )
return spimainram[(0x001d49c-0x800)/4];
}
-/*
+#ifdef UNUSED_FUNCTION
// causes input problems?
READ32_HANDLER ( ejanhs_speedup_r )
{
@@ -1926,7 +1926,7 @@ READ32_HANDLER ( ejanhs_speedup_r )
if (activecpu_get_pc()==0x03032c7) cpu_spinuntil_int(); // idle
return spimainram[(0x002d224-0x800)/4];
}
-*/
+#endif
static READ32_HANDLER ( rf2_speedup_r )
{
diff --git a/src/mame/drivers/stvinit.c b/src/mame/drivers/stvinit.c
index 97890199b4d..dada5d9be39 100644
--- a/src/mame/drivers/stvinit.c
+++ b/src/mame/drivers/stvinit.c
@@ -740,13 +740,14 @@ static READ32_HANDLER( groovef_speedup_r )
return stv_workram_h[0x0c64ec/4];
}
-/*
+
+#ifdef UNUSED_FUNCTION
static READ32_HANDLER( groovef_second_cpu_off_r )
{
if (activecpu_get_pc()==0x060060c2) cpunum_set_input_line(machine, 1, INPUT_LINE_HALT, ASSERT_LINE);
return 0;
}
-*/
+#endif
static void groovef_slave_speedup( UINT32 data )
{
diff --git a/src/mame/drivers/suprgolf.c b/src/mame/drivers/suprgolf.c
index 4a8ae6af849..be13afc804d 100644
--- a/src/mame/drivers/suprgolf.c
+++ b/src/mame/drivers/suprgolf.c
@@ -31,12 +31,13 @@ static TILE_GET_INFO( get_tile_info )
0);
}
-/*
+#ifdef UNUSED_FUNCTION
static READ8_HANDLER( rom_bank_select_r )
{
return suprgolf_rom_bank;
}
-*/
+#endif
+
static WRITE8_HANDLER( rom_bank_select_w )
{
UINT8 *region_base = memory_region(machine, "user1");
diff --git a/src/mame/drivers/wgp.c b/src/mame/drivers/wgp.c
index 4caa0d8e815..f5f6f94a17c 100644
--- a/src/mame/drivers/wgp.c
+++ b/src/mame/drivers/wgp.c
@@ -460,12 +460,12 @@ static WRITE16_HANDLER( cpua_ctrl_w ) /* assumes Z80 sandwiched between 68Ks */
/* 68000 A */
-/*
+#ifdef UNUSED_FUNCTION
static TIMER_CALLBACK( wgp_interrupt4 )
{
cpunum_set_input_line(machine, 0,4,HOLD_LINE);
}
-*/
+#endif
static TIMER_CALLBACK( wgp_interrupt6 )
{
diff --git a/src/mame/machine/dc.c b/src/mame/machine/dc.c
index 8bc30af682a..b8826784866 100644
--- a/src/mame/machine/dc.c
+++ b/src/mame/machine/dc.c
@@ -804,12 +804,14 @@ WRITE64_HANDLER( dc_rtc_w )
mame_printf_verbose("RTC: [%08x=%x] write %llx to %x, mask %llx\n", 0x710000 + reg*4, dat, data, offset, mem_mask);
}
-/*static void dc_rtc_increment(void)
+#ifdef UNUSED_FUNCTION
+static void dc_rtc_increment(void)
{
dc_rtcregister[RTC2] = (dc_rtcregister[RTC2] + 1) & 0xFFFF;
if (dc_rtcregister[RTC2] == 0)
dc_rtcregister[RTC1] = (dc_rtcregister[RTC1] + 1) & 0xFFFF;
-}*/
+}
+#endif
MACHINE_START( dc )
{
diff --git a/src/mame/video/gcpinbal.c b/src/mame/video/gcpinbal.c
index d79c68312ed..19a8a84d6cd 100644
--- a/src/mame/video/gcpinbal.c
+++ b/src/mame/video/gcpinbal.c
@@ -120,7 +120,7 @@ WRITE16_HANDLER( gcpinbal_tilemaps_word_w )
}
-/*
+#ifdef UNUSED_FUNCTION
READ16_HANDLER( gcpinbal_ctrl_word_r )
{
@@ -169,7 +169,7 @@ WRITE16_HANDLER( gcpinbal_ctrl_word_w )
}
}
-*/
+#endif
/****************************************************************