1
0
mirror of https://github.com/TomHarte/CLK.git synced 2026-04-21 17:16:44 +00:00

Increases const correctness, marks some additional constructors as constexpr, switches std::atomic construction style.

This commit is contained in:
Thomas Harte
2020-05-20 23:34:26 -04:00
parent 41fc6c20a0
commit 512a52e88d
59 changed files with 136 additions and 140 deletions
+1 -1
View File
@@ -15,7 +15,7 @@ void ProcessorBase::reset_power_on() {
last_request_status_ &= ~Interrupt::PowerOn;
}
uint16_t ProcessorBase::get_value_of_register(Register r) {
uint16_t ProcessorBase::get_value_of_register(Register r) const {
switch (r) {
case Register::ProgramCounter: return pc_.full;
case Register::StackPointer: return sp_.full;
@@ -907,7 +907,7 @@ template < class T,
template < class T,
bool uses_bus_request,
bool uses_wait_line> bool Processor <T, uses_bus_request, uses_wait_line>
::get_bus_request_line() {
::get_bus_request_line() const {
return bus_request_line_;
}
@@ -922,7 +922,7 @@ template < class T,
template < class T,
bool uses_bus_request,
bool uses_wait_line> bool Processor <T, uses_bus_request, uses_wait_line>
::get_wait_line() {
::get_wait_line() const {
return wait_line_;
}
@@ -1013,7 +1013,7 @@ template < class T,
#undef isTerminal
bool ProcessorBase::get_halt_line() {
bool ProcessorBase::get_halt_line() const {
return halt_mask_ == 0x00;
}
@@ -1036,7 +1036,7 @@ void ProcessorBase::set_interrupt_line(bool value, HalfCycles offset) {
}
}
bool ProcessorBase::get_interrupt_line() {
bool ProcessorBase::get_interrupt_line() const {
return irq_line_;
}
@@ -1065,7 +1065,7 @@ void ProcessorBase::set_non_maskable_interrupt_line(bool value, HalfCycles offse
}
}
bool ProcessorBase::get_non_maskable_interrupt_line() {
bool ProcessorBase::get_non_maskable_interrupt_line() const {
return nmi_line_;
}
+2 -2
View File
@@ -545,12 +545,12 @@ void ProcessorStorage::assemble_fetch_decode_execute(InstructionPage &target, in
target.fetch_decode_execute_data = target.fetch_decode_execute.data();
}
bool ProcessorBase::is_starting_new_instruction() {
bool ProcessorBase::is_starting_new_instruction() const {
return
current_instruction_page_ == &base_page_ &&
scheduled_program_counter_ == &base_page_.fetch_decode_execute[0];
}
bool ProcessorBase::get_is_resetting() {
bool ProcessorBase::get_is_resetting() const {
return request_status_ & (Interrupt::PowerOn | Interrupt::Reset);
}
+8 -8
View File
@@ -171,7 +171,7 @@ class ProcessorBase: public ProcessorStorage {
@param r The register to set.
@returns The value of the register. 8-bit registers will be returned as unsigned.
*/
uint16_t get_value_of_register(Register r);
uint16_t get_value_of_register(Register r) const;
/*!
Sets the value of a register.
@@ -186,7 +186,7 @@ class ProcessorBase: public ProcessorStorage {
/*!
Gets the value of the HALT output line.
*/
inline bool get_halt_line();
inline bool get_halt_line() const;
/*!
Sets the logical value of the interrupt line.
@@ -200,7 +200,7 @@ class ProcessorBase: public ProcessorStorage {
/*!
Gets the value of the interrupt line.
*/
inline bool get_interrupt_line();
inline bool get_interrupt_line() const;
/*!
Sets the logical value of the non-maskable interrupt line.
@@ -212,7 +212,7 @@ class ProcessorBase: public ProcessorStorage {
/*!
Gets the value of the non-maskable interrupt line.
*/
inline bool get_non_maskable_interrupt_line();
inline bool get_non_maskable_interrupt_line() const;
/*!
Sets the logical value of the reset line.
@@ -224,7 +224,7 @@ class ProcessorBase: public ProcessorStorage {
@returns @c true if the line is logically active; @c false otherwise.
*/
bool get_is_resetting();
bool get_is_resetting() const;
/*!
This emulation automatically sets itself up in power-on state at creation, which has the effect of triggering a
@@ -237,7 +237,7 @@ class ProcessorBase: public ProcessorStorage {
This is not a speedy operation.
*/
bool is_starting_new_instruction();
bool is_starting_new_instruction() const;
};
/*!
@@ -271,7 +271,7 @@ template <class T, bool uses_bus_request, bool uses_wait_line> class Processor:
/*!
Gets the logical value of the bus request line.
*/
bool get_bus_request_line();
bool get_bus_request_line() const;
/*!
Sets the logical value of the wait line, having asserted that this Z80 supports the wait line.
@@ -281,7 +281,7 @@ template <class T, bool uses_bus_request, bool uses_wait_line> class Processor:
/*!
Gets the logical value of the bus request line.
*/
bool get_wait_line();
bool get_wait_line() const;
private:
T &bus_handler_;