summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/bus/nes
diff options
context:
space:
mode:
author Vas Crabb <vas@vastheman.com>2022-04-03 03:05:53 +1000
committer Vas Crabb <vas@vastheman.com>2022-04-03 03:07:28 +1000
commit530c5abb5da585ac71f9c643c9d6a2171280fe67 (patch)
tree978357b74d3506db174181e74bb3f4d81c421f64 /src/devices/bus/nes
parentc4f9ff9790382c1c5b99a2ffbb2a14e04d4c7cea (diff)
Revert initialisation of device members in headers.
This is problematic in several ways: * Initialising things at construction that aren't needed until after start slows down -romident, -validate, -listxml, etc. Slot cards can be a particular drain on -listxml and -validate as they're instantiated for every compatible slot. It's more pronounced for array members, too. * Splitting member initialisation between declaration in headers and constructors in source files means you have to look at two places to check for the initial value, and you always need to check the constructor even if an initialiser is present in the header because the constructor initaliser list takes precedence. (This isn't as much of an issue for driver classes because the constructor is most often inlined at declaration, so it isn't far from the member declarations.) * Initialisers in headers for frequently-used devices increases the frequency of recompiling dependent devices/drivers as they're exposed to any changes in initialisers. * Initialisers in frequently-used headers increase build times because there's more for the compiler to parse/cache. (This affects makedep.py as well for single-driver builds, but that's a single pass.) It's not a lot individually, but it adds up given the size of MAME, which keeps increasing. We've already had one contributor banned from GitHub actions for resource usage, we don't want to waste compiler time unnecessarily.
Diffstat (limited to 'src/devices/bus/nes')
-rw-r--r--src/devices/bus/nes/disksys.h2
-rw-r--r--src/devices/bus/nes/jy.h38
-rw-r--r--src/devices/bus/nes/kaiser.h16
-rw-r--r--src/devices/bus/nes/mmc3_clones.h4
-rw-r--r--src/devices/bus/nes/nes_slot.h6
-rw-r--r--src/devices/bus/nes/pirate.h12
-rw-r--r--src/devices/bus/nes/vrc_clones.h6
7 files changed, 42 insertions, 42 deletions
diff --git a/src/devices/bus/nes/disksys.h b/src/devices/bus/nes/disksys.h
index c7d3b6d0d3d..61bd9dd2048 100644
--- a/src/devices/bus/nes/disksys.h
+++ b/src/devices/bus/nes/disksys.h
@@ -57,7 +57,7 @@ private:
uint16_t m_irq_count, m_irq_count_latch;
int m_irq_enable, m_irq_repeat, m_irq_transfer;
int m_disk_reg_enable;
- bool m_sound_en = false;
+ bool m_sound_en;
uint8_t m_fds_motor_on;
uint8_t m_fds_door_closed;
diff --git a/src/devices/bus/nes/jy.h b/src/devices/bus/nes/jy.h
index 3a30cdcca15..ac4cf8e397e 100644
--- a/src/devices/bus/nes/jy.h
+++ b/src/devices/bus/nes/jy.h
@@ -42,27 +42,27 @@ protected:
virtual void update_mirror() { update_mirror_typea(); }
inline uint8_t unscramble(uint8_t bank);
- uint8_t m_mul[2]{};
- uint8_t m_latch = 0;
- uint8_t m_reg[4]{};
- uint8_t m_chr_latch[2]{}; // type C uses a more complex CHR 4K mode, and these vars are only changed for those games
- uint8_t m_mmc_prg_bank[4]{};
- uint16_t m_mmc_nt_bank[4]{};
- uint16_t m_mmc_vrom_bank[8]{};
- uint16_t m_extra_chr_bank = 0;
- uint16_t m_extra_chr_mask = 0;
- int m_bank_6000 = 0;
-
- uint8_t m_irq_mode = 0;
- uint8_t m_irq_count = 0;
- uint8_t m_irq_prescale = 0;
- uint8_t m_irq_prescale_mask = 0;
- uint8_t m_irq_flip = 0;
- int m_irq_enable = 0;
- int m_irq_up = 0, m_irq_down = 0;
+ uint8_t m_mul[2];
+ uint8_t m_latch;
+ uint8_t m_reg[4];
+ uint8_t m_chr_latch[2]; // type C uses a more complex CHR 4K mode, and these vars are only changed for those games
+ uint8_t m_mmc_prg_bank[4];
+ uint16_t m_mmc_nt_bank[4];
+ uint16_t m_mmc_vrom_bank[8];
+ uint16_t m_extra_chr_bank;
+ uint16_t m_extra_chr_mask;
+ int m_bank_6000;
+
+ uint8_t m_irq_mode;
+ uint8_t m_irq_count;
+ uint8_t m_irq_prescale;
+ uint8_t m_irq_prescale_mask;
+ uint8_t m_irq_flip;
+ int m_irq_enable;
+ int m_irq_up, m_irq_down;
static const device_timer_id TIMER_IRQ = 0;
- emu_timer *irq_timer = nullptr;
+ emu_timer *irq_timer;
attotime timer_freq;
};
diff --git a/src/devices/bus/nes/kaiser.h b/src/devices/bus/nes/kaiser.h
index 31bef65627b..5962a77dd13 100644
--- a/src/devices/bus/nes/kaiser.h
+++ b/src/devices/bus/nes/kaiser.h
@@ -23,7 +23,7 @@ protected:
virtual void device_start() override;
private:
- u8 m_latch = 0;
+ u8 m_latch;
};
@@ -63,7 +63,7 @@ protected:
virtual void device_start() override;
private:
- uint8_t m_latch = 0;
+ uint8_t m_latch;
};
@@ -88,11 +88,11 @@ protected:
virtual void device_start() override;
virtual void device_timer(emu_timer &timer, device_timer_id id, int param) override;
- u8 m_reg[8]{};
+ u8 m_reg[8];
private:
void prg_update();
- u8 m_latch = 0;
+ u8 m_latch;
u16 m_irq_count, m_irq_count_latch;
int m_irq_enable;
@@ -136,7 +136,7 @@ protected:
virtual void device_start() override;
private:
- u8 m_latch = 0;
+ u8 m_latch;
const u8 m_a15_flip;
};
@@ -171,7 +171,7 @@ protected:
virtual void device_timer(emu_timer &timer, device_timer_id id, int param) override;
private:
- uint8_t m_latch = 0;
+ uint8_t m_latch;
uint16_t m_irq_count;
uint8_t m_irq_status;
@@ -218,7 +218,7 @@ protected:
virtual void device_start() override;
private:
- u8 m_latch = 0;
+ u8 m_latch;
};
@@ -327,7 +327,7 @@ protected:
private:
void update_prg();
- uint8_t m_latch = 0;
+ uint8_t m_latch;
uint8_t m_reg[8];
};
diff --git a/src/devices/bus/nes/mmc3_clones.h b/src/devices/bus/nes/mmc3_clones.h
index 87e57474143..d6da92864d6 100644
--- a/src/devices/bus/nes/mmc3_clones.h
+++ b/src/devices/bus/nes/mmc3_clones.h
@@ -187,7 +187,7 @@ protected:
virtual void device_start() override;
private:
- int m_prot = 0;
+ int m_prot;
};
@@ -320,7 +320,7 @@ protected:
virtual void device_start() override;
private:
- uint8_t m_prot = 0;
+ uint8_t m_prot;
};
diff --git a/src/devices/bus/nes/nes_slot.h b/src/devices/bus/nes/nes_slot.h
index c5fd2021eef..63b562ecfee 100644
--- a/src/devices/bus/nes/nes_slot.h
+++ b/src/devices/bus/nes/nes_slot.h
@@ -315,7 +315,7 @@ public:
// PRG
inline int prg_8k_bank_num(int bank);
inline void update_prg_banks(int prg_bank_start, int prg_bank_end);
- memory_bank *m_prg_bank_mem[4]{};
+ memory_bank *m_prg_bank_mem[4];
int m_prg_bank[4];
uint32_t m_prg_chunks;
uint32_t m_prg_mask;
@@ -338,7 +338,7 @@ public:
//because some of these change multiple times per scanline!
int m_chr_src[8]; //defines source of base pointer
int m_chr_orig[8]; //defines offset of 0x400 byte segment at base pointer
- uint8_t *m_chr_access[8]{}; //source translated + origin -> valid pointer!
+ uint8_t *m_chr_access[8]; //source translated + origin -> valid pointer!
uint32_t m_vrom_chunks;
uint32_t m_vram_chunks;
@@ -372,7 +372,7 @@ public:
int m_nt_src[4];
int m_nt_orig[4];
int m_nt_writable[4];
- uint8_t *m_nt_access[4]{}; //quick banking structure for a maximum of 4K of RAM/ROM/ExRAM
+ uint8_t *m_nt_access[4]; //quick banking structure for a maximum of 4K of RAM/ROM/ExRAM
void set_nt_page(int page, int source, int bank, int writable);
void set_nt_mirroring(int mirroring);
diff --git a/src/devices/bus/nes/pirate.h b/src/devices/bus/nes/pirate.h
index 6e11ca29255..a94f541b498 100644
--- a/src/devices/bus/nes/pirate.h
+++ b/src/devices/bus/nes/pirate.h
@@ -64,7 +64,7 @@ protected:
virtual void device_start() override;
private:
- uint8_t m_latch = 0;
+ uint8_t m_latch;
uint8_t m_ram[0xb00];
};
@@ -174,7 +174,7 @@ protected:
virtual void device_start() override;
private:
- uint8_t m_latch = 0;
+ uint8_t m_latch;
};
@@ -198,7 +198,7 @@ protected:
private:
void update_banks();
- u8 m_latch = 0;
+ u8 m_latch;
u8 m_reg[6];
u16 m_irq_count, m_irq_count_latch;
@@ -224,7 +224,7 @@ protected:
virtual void device_start() override;
private:
- uint16_t m_latch = 0;
+ uint16_t m_latch;
};
@@ -247,7 +247,7 @@ protected:
private:
u8 m_jumper;
- u16 m_latch = 0;
+ u16 m_latch;
u8 m_reg;
};
@@ -272,7 +272,7 @@ protected:
virtual void device_start() override;
private:
- uint8_t m_latch = 0;
+ uint8_t m_latch;
};
#endif
diff --git a/src/devices/bus/nes/vrc_clones.h b/src/devices/bus/nes/vrc_clones.h
index a659c670701..780dc6ae0cb 100644
--- a/src/devices/bus/nes/vrc_clones.h
+++ b/src/devices/bus/nes/vrc_clones.h
@@ -148,7 +148,7 @@ protected:
virtual void device_start() override;
private:
- u8 m_reg = 0;
+ u8 m_reg;
};
@@ -203,7 +203,7 @@ protected:
private:
u16 m_irq_count;
- u8 m_irq_latch = 0;
+ u8 m_irq_latch;
int m_irq_enable;
static const device_timer_id TIMER_IRQ = 0;
@@ -230,7 +230,7 @@ protected:
virtual void device_start() override;
private:
- u8 m_chr_mask = 0, m_chr_match;
+ u8 m_chr_mask, m_chr_match;
};
// ======================> nes_hengg_shjy3_device