diff options
Diffstat (limited to 'src/devices/cpu/m68000')
-rw-r--r-- | src/devices/cpu/m68000/m68kcpu.cpp | 36 | ||||
-rw-r--r-- | src/devices/cpu/m68000/m68kcpu.h | 4 | ||||
-rw-r--r-- | src/devices/cpu/m68000/m68kmake.cpp | 2 | ||||
-rw-r--r-- | src/devices/cpu/m68000/m68kops.cpp | 2 | ||||
-rw-r--r-- | src/devices/cpu/m68000/makefile | 20 |
5 files changed, 36 insertions, 28 deletions
diff --git a/src/devices/cpu/m68000/m68kcpu.cpp b/src/devices/cpu/m68000/m68kcpu.cpp index dc7e0b14a6f..aaa1db079cf 100644 --- a/src/devices/cpu/m68000/m68kcpu.cpp +++ b/src/devices/cpu/m68000/m68kcpu.cpp @@ -1383,7 +1383,7 @@ UINT16 m68000_base_device::readword_d32_mmu(offs_t address) UINT32 address0 = pmmu_translate_addr(this, address); if (mmu_tmp_buserror_occurred) { return ~0; - } else if (!(address & 1)) { + } else if (WORD_ALIGNED(address)) { return m_space->read_word(address0); } else { UINT32 address1 = pmmu_translate_addr(this, address + 1); @@ -1396,7 +1396,7 @@ UINT16 m68000_base_device::readword_d32_mmu(offs_t address) } } - if (!(address & 1)) + if (WORD_ALIGNED(address)) return m_space->read_word(address); result = m_space->read_byte(address) << 8; return result | m_space->read_byte(address + 1); @@ -1410,7 +1410,7 @@ void m68000_base_device::writeword_d32_mmu(offs_t address, UINT16 data) UINT32 address0 = pmmu_translate_addr(this, address); if (mmu_tmp_buserror_occurred) { return; - } else if (!(address & 1)) { + } else if (WORD_ALIGNED(address)) { m_space->write_word(address0, data); return; } else { @@ -1425,7 +1425,7 @@ void m68000_base_device::writeword_d32_mmu(offs_t address, UINT16 data) } } - if (!(address & 1)) + if (WORD_ALIGNED(address)) { m_space->write_word(address, data); return; @@ -1447,13 +1447,13 @@ UINT32 m68000_base_device::readlong_d32_mmu(offs_t address) } else if ((address +3) & 0xfc) { // not at page boundary; use default code address = address0; - } else if (!(address & 3)) { // 0 + } else if (DWORD_ALIGNED(address)) { // 0 return m_space->read_dword(address0); } else { UINT32 address2 = pmmu_translate_addr(this, address+2); if (mmu_tmp_buserror_occurred) { return ~0; - } else if (!(address & 1)) { // 2 + } else if (WORD_ALIGNED(address)) { // 2 result = m_space->read_word(address0) << 16; return result | m_space->read_word(address2); } else { @@ -1470,9 +1470,9 @@ UINT32 m68000_base_device::readlong_d32_mmu(offs_t address) } } - if (!(address & 3)) + if (DWORD_ALIGNED(address)) return m_space->read_dword(address); - else if (!(address & 1)) + else if (WORD_ALIGNED(address)) { result = m_space->read_word(address) << 16; return result | m_space->read_word(address + 2); @@ -1493,14 +1493,14 @@ void m68000_base_device::writelong_d32_mmu(offs_t address, UINT32 data) } else if ((address +3) & 0xfc) { // not at page boundary; use default code address = address0; - } else if (!(address & 3)) { // 0 + } else if (DWORD_ALIGNED(address)) { // 0 m_space->write_dword(address0, data); return; } else { UINT32 address2 = pmmu_translate_addr(this, address+2); if (mmu_tmp_buserror_occurred) { return; - } else if (!(address & 1)) { // 2 + } else if (WORD_ALIGNED(address)) { // 2 m_space->write_word(address0, data >> 16); m_space->write_word(address2, data); return; @@ -1519,12 +1519,12 @@ void m68000_base_device::writelong_d32_mmu(offs_t address, UINT32 data) } } - if (!(address & 3)) + if (DWORD_ALIGNED(address)) { m_space->write_dword(address, data); return; } - else if (!(address & 1)) + else if (WORD_ALIGNED(address)) { m_space->write_word(address, data >> 16); m_space->write_word(address + 2, data); @@ -1594,7 +1594,7 @@ UINT16 m68000_base_device::readword_d32_hmmu(offs_t address) address = hmmu_translate_addr(this, address); } - if (!(address & 1)) + if (WORD_ALIGNED(address)) return m_space->read_word(address); result = m_space->read_byte(address) << 8; return result | m_space->read_byte(address + 1); @@ -1608,7 +1608,7 @@ void m68000_base_device::writeword_d32_hmmu(offs_t address, UINT16 data) address = hmmu_translate_addr(this, address); } - if (!(address & 1)) + if (WORD_ALIGNED(address)) { m_space->write_word(address, data); return; @@ -1627,9 +1627,9 @@ UINT32 m68000_base_device::readlong_d32_hmmu(offs_t address) address = hmmu_translate_addr(this, address); } - if (!(address & 3)) + if (DWORD_ALIGNED(address)) return m_space->read_dword(address); - else if (!(address & 1)) + else if (WORD_ALIGNED(address)) { result = m_space->read_word(address) << 16; return result | m_space->read_word(address + 2); @@ -1647,12 +1647,12 @@ void m68000_base_device::writelong_d32_hmmu(offs_t address, UINT32 data) address = hmmu_translate_addr(this, address); } - if (!(address & 3)) + if (DWORD_ALIGNED(address)) { m_space->write_dword(address, data); return; } - else if (!(address & 1)) + else if (WORD_ALIGNED(address)) { m_space->write_word(address, data >> 16); m_space->write_word(address + 2, data); diff --git a/src/devices/cpu/m68000/m68kcpu.h b/src/devices/cpu/m68000/m68kcpu.h index 5cec889e002..7860298988f 100644 --- a/src/devices/cpu/m68000/m68kcpu.h +++ b/src/devices/cpu/m68000/m68kcpu.h @@ -626,7 +626,7 @@ static inline unsigned int m68k_read_pcrelative_8(m68000_base_device *m68k, unsi static inline unsigned int m68k_read_pcrelative_16(m68000_base_device *m68k, unsigned int address) { - if(address & 1) + if (!WORD_ALIGNED(address)) return (m68k->readimm16(address-1) << 8) | (m68k->readimm16(address+1) >> 8); @@ -638,7 +638,7 @@ static inline unsigned int m68k_read_pcrelative_16(m68000_base_device *m68k, uns static inline unsigned int m68k_read_pcrelative_32(m68000_base_device *m68k, unsigned int address) { - if(address & 1) + if (!WORD_ALIGNED(address)) return (m68k->readimm16(address-1) << 24) | (m68k->readimm16(address+1) << 8) | diff --git a/src/devices/cpu/m68000/m68kmake.cpp b/src/devices/cpu/m68000/m68kmake.cpp index f36797d76ba..941ae23f0aa 100644 --- a/src/devices/cpu/m68000/m68kmake.cpp +++ b/src/devices/cpu/m68000/m68kmake.cpp @@ -670,7 +670,7 @@ static opcode_struct* find_opcode(char* name, int size, char* spec_proc, char* s opcode_struct* op; - for(op = g_opcode_input_table;op->name != nullptr;op++) + for(op = g_opcode_input_table;op->name[0] != 0;op++) { if( strcmp(name, op->name) == 0 && (size == op->size) && diff --git a/src/devices/cpu/m68000/m68kops.cpp b/src/devices/cpu/m68000/m68kops.cpp index 0505f863c73..4cbeb42d78c 100644 --- a/src/devices/cpu/m68000/m68kops.cpp +++ b/src/devices/cpu/m68000/m68kops.cpp @@ -34872,3 +34872,5 @@ void m68ki_build_opcode_table(void) /* ======================================================================== */ /* ============================== END OF FILE ============================= */ /* ======================================================================== */ + + diff --git a/src/devices/cpu/m68000/makefile b/src/devices/cpu/m68000/makefile index 12b29fa267a..be25a067a78 100644 --- a/src/devices/cpu/m68000/makefile +++ b/src/devices/cpu/m68000/makefile @@ -8,24 +8,30 @@ ifeq ($(OS),os2) EXE := .exe endif +ifndef verbose + SILENT = @ +endif +CC = gcc +CXX = g++ + .PHONY: all clean -all : m68kmake$(EXE) m68kops.c clean +all : m68kmake$(EXE) m68kops.cpp clean: @echo Cleaning... -@rm -f m68kmake$(EXE) -@rm -f m68kmake.o + -@rm -f m68kops.* -m68kmake.o: m68kmake.c - @echo $(notdir $<) - @gcc -x c++ -std=gnu++98 -o "$@" -c "$<" +m68kmake.o: m68kmake.cpp + $(SILENT) $(CC) -x c++ -std=c++11 -o "$@" -c "$<" m68kmake$(EXE) : m68kmake.o @echo Linking $@... - @g++ -lstdc++ $^ -o $@ + $(SILENT) $(CXX) -lstdc++ $^ -o $@ -m68kops.c: m68kmake$(EXE) m68k_in.c +m68kops.cpp: m68kmake$(EXE) m68k_in.cpp @echo Generating M68K source files... - @m68kmake$(EXE) . m68k_in.c + $(SILENT) ./m68kmake$(EXE) . m68k_in.cpp |