Still inside the recent 4017h discussion, is the following code correct?
It means the APU step as '1' (by counting from zero) after an immediate clock on 4017h:80h = 1.
Code:
case 4017:
cpu_irqcancel(TIRQ_FRA);
frameIRQ = value;
frameCNT = 0; //APU step 0..3 or 4 [reset]
if(value & 0x80) {
atl_index = 5; //Max steps=5
psg_step_run(); //APU clock [sweep unit]
} else {
atl_index = 4; //Max steps=4
}
frameCYC = 0; //APU divider (1/4th of frame_cycles) [reset]
break;
cpu_irqcancel(TIRQ_FRA);
frameIRQ = value;
frameCNT = 0; //APU step 0..3 or 4 [reset]
if(value & 0x80) {
atl_index = 5; //Max steps=5
psg_step_run(); //APU clock [sweep unit]
} else {
atl_index = 4; //Max steps=4
}
frameCYC = 0; //APU divider (1/4th of frame_cycles) [reset]
break;
It means the APU step as '1' (by counting from zero) after an immediate clock on 4017h:80h = 1.