mirror of
https://github.com/zoriya/ComSquare.git
synced 2026-05-13 03:15:21 +00:00
Implementing some addressing modes
This commit is contained in:
@@ -38,8 +38,7 @@ Test(AddrMode, Direct)
|
||||
pair.second.cartridge->_data[0] = 0x15;
|
||||
pair.second.cpu->_registers.pac = 0x808000;
|
||||
pair.second.cpu->_registers.d = 0x1000;
|
||||
cr_assert_eq(pair.second.cpu->_getDirectAddr(), 0x1015, "Returned address was %i but was expecting 0x1015.",
|
||||
pair.second.cpu->_getDirectAddr());
|
||||
cr_assert_eq(pair.second.cpu->_getDirectAddr(), 0x1015, "Returned address was %i but was expecting 0x1015.", pair.second.cpu->_getDirectAddr());
|
||||
cr_assert_eq(pair.second.cpu->_registers.pac, 0x808001);
|
||||
}
|
||||
|
||||
@@ -59,7 +58,7 @@ Test(AddrMode, AbsoluteLong)
|
||||
auto pair = Init();
|
||||
pair.second.cartridge->_data[0] = 0x1C;
|
||||
pair.second.cartridge->_data[1] = 0x90;
|
||||
pair.second.cartridge->_data[1] = 0xFF;
|
||||
pair.second.cartridge->_data[2] = 0xFF;
|
||||
pair.second.cpu->_registers.pac = 0x808000;
|
||||
pair.second.cpu->_registers.dbr = 0x88;
|
||||
cr_assert_eq(pair.second.cpu->_getAbsoluteLongAddr(), 0xFF901C, "Returned address was %i but was expecting 0xFF901C.", pair.second.cpu->_getAbsoluteLongAddr());
|
||||
@@ -70,8 +69,8 @@ Test(AddrMode, DirectIndirectIndexed)
|
||||
{
|
||||
auto pair = Init();
|
||||
pair.second.cartridge->_data[0] = 0x10;
|
||||
pair.second.sram->_data[0x1000] = 0x30;
|
||||
pair.second.sram->_data[0x1001] = 0x40;
|
||||
pair.second.wram->_data[0x1000] = 0x30;
|
||||
pair.second.wram->_data[0x1001] = 0x40;
|
||||
pair.second.cpu->_registers.pac = 0x808000;
|
||||
pair.second.cpu->_registers.dbr = 0x80;
|
||||
pair.second.cpu->_registers.y = 0x0001;
|
||||
|
||||
Reference in New Issue
Block a user