bugfix in 16bit write in 8bit ram
This commit is contained in:
parent
4bf74d7664
commit
2d7bc9df92
|
@ -152,7 +152,8 @@ void cpu_write32(cpu_status_t* status, uint32_t addr, uint32_t data){
|
|||
|
||||
void cpu_write16(cpu_status_t* status, uint32_t addr, uint16_t data){
|
||||
if(addr >=0x08100000 && addr <= 0x08100000+524288){
|
||||
memcpy(&status->ram[addr-0x08100000],&data, 2);
|
||||
status->ram[addr-0x08100000] = (data >> 8) & 0xFF;
|
||||
status->ram[addr-0x08100000+1] = data & 0xFF;
|
||||
}
|
||||
/*else if(addr >=0x00300200 && addr <= 0x00300200+status->program_size){
|
||||
memcpy(&status->rom[addr-0x00300200], &addr, 2);
|
||||
|
@ -227,7 +228,7 @@ int cpu_execute(cpu_status_t* status){
|
|||
else if(nibble[0] == 0b0000 && nibble[3] == 0b1110) instruction_movl_r0_r_r(status);
|
||||
else if(nibble[0] == 0b0000 && nibble[3] == 0b0110) instruction_movl_r_r0_r(status);
|
||||
else if(nibble[0] == 0b1100 && nibble[1] == 0b0110) instruction_movl_disp_gbr_r0(status);
|
||||
// good
|
||||
|
||||
else if(nibble[0] == 0b1000 && nibble[1] == 0b0001) instruction_movw_r0_disp_r(status);
|
||||
else if(nibble[0] == 0b1000 && nibble[1] == 0b0101) instruction_movw_disp_r_r0(status);
|
||||
else if(nibble[0] == 0b1001) instruction_movw_disp_pc_r0(status);
|
||||
|
@ -238,7 +239,7 @@ int cpu_execute(cpu_status_t* status){
|
|||
else if(nibble[0] == 0b0000 && nibble[3] == 0b1101) instruction_movw_r0_r_r(status);
|
||||
else if(nibble[0] == 0b1100 && nibble[1] == 0b0101) instruction_movw_disp_gbr_r0(status);
|
||||
else if(nibble[0] == 0b0000 && nibble[3] == 0b0101) instruction_movw_r_r0_r(status);
|
||||
|
||||
// good
|
||||
else if(nibble[0] == 0b0110 && nibble[3] == 0b0000) instruction_movb_ar_r(status);
|
||||
else if(nibble[0] == 0b0010 && nibble[3] == 0b0000) instruction_movb_r_ar(status);
|
||||
else if(nibble[0] == 0b0110 && nibble[3] == 0b0100) instruction_movb_arp_r(status);
|
||||
|
|
Loading…
Reference in New Issue