Prevent non-debug writes to CTA
This commit is contained in:
		
							parent
							
								
									18b2c589e6
								
							
						
					
					
						commit
						d802d39d8d
					
				| 
						 | 
					@ -481,10 +481,12 @@ static void vipWriteIO(
 | 
				
			||||||
            break;
 | 
					            break;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        case 0x5F830>>1: /* CTA */
 | 
					        case 0x5F830>>1: /* CTA */
 | 
				
			||||||
 | 
					            if (debug) {
 | 
				
			||||||
                if ((mask & 0xFF00) == 0)
 | 
					                if ((mask & 0xFF00) == 0)
 | 
				
			||||||
                    sim->vip.cta.cta_r = value >> 8;
 | 
					                    sim->vip.cta.cta_r = value >> 8;
 | 
				
			||||||
                if ((mask & 0x00FF) == 0)
 | 
					                if ((mask & 0x00FF) == 0)
 | 
				
			||||||
                    sim->vip.cta.cta_l = value;
 | 
					                    sim->vip.cta.cta_l = value;
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
            break;
 | 
					            break;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        case 0x5F842>>1: /* XPCTRL */
 | 
					        case 0x5F842>>1: /* XPCTRL */
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -513,6 +513,8 @@ static int dasmLine(VB *sim, uint32_t *address, uint32_t pc,
 | 
				
			||||||
    line->isPC       = *address == pc;
 | 
					    line->isPC       = *address == pc;
 | 
				
			||||||
    for (x = 0; x < line->codeLength; x++)
 | 
					    for (x = 0; x < line->codeLength; x++)
 | 
				
			||||||
        line->code[x] = vbRead(sim, *address + x, VB_U8);
 | 
					        line->code[x] = vbRead(sim, *address + x, VB_U8);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    /* Advance to the next instruction or PC, whichever is sooner */
 | 
				
			||||||
    *address += pc != *address && pc - *address < line->codeLength ?
 | 
					    *address += pc != *address && pc - *address < line->codeLength ?
 | 
				
			||||||
        pc - *address : line->codeLength;
 | 
					        pc - *address : line->codeLength;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -657,6 +659,8 @@ static VBU_DasmLine* dasmDisassemble(VB *sim, uint32_t address,
 | 
				
			||||||
        size = vbuCodeSize(sim, addr);
 | 
					        size = vbuCodeSize(sim, addr);
 | 
				
			||||||
        if (address - addr < size)
 | 
					        if (address - addr < size)
 | 
				
			||||||
            break;
 | 
					            break;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        /* Advance to the next instruction or PC, whichever is sooner */
 | 
				
			||||||
        addr += addr != pc && pc - addr < size ? pc - addr : size;
 | 
					        addr += addr != pc && pc - addr < size ? pc - addr : size;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue