Page 1 of 1

reset the z80 twice in one prod? whaaaaa?

Posted: Thu Feb 06, 2014 3:37 am
by sigflup
Is there a way to reset the z80 at least twice in one program? I'm having trouble doing this.

Posted: Thu Feb 06, 2014 9:12 am
by TmEE co.(TM)
Write to the reset register... The YM shares reset with Z80 so it becomes ineffective too.
You may also try to put Bus Requests into the mix. I don't recall having issues here.

Posted: Thu Feb 06, 2014 9:13 am
by Stef
I don't understand what you mean...
Doing Z80_startReset() followed by Z80_endReset() (speaking about SGDK methods) after some cycles will complete the Z80 reset process. If you do it severals time then you reset severals time the Z80 but what is the point ?

Posted: Thu Feb 06, 2014 9:26 am
by sigflup
in my code I can only do this once, I'm pretty sure

Posted: Thu Feb 06, 2014 9:52 am
by Stef
I do need to reset it when i change the Z80 driver and i never experienced issues. Do you wait enough cycles during you reset ?
The way i'm doing it :

get_Z80bus
upload stuff with 68000
start_reset
release_Z80bus
end_reset

but i guess if you just want to reset it :
start_reset
wait a bit
end_reset

Posted: Thu Feb 06, 2014 10:06 am
by sigflup
I'm not on sgdk. but I know I'm doing just how Z80_upload does it

request bus
wait
start reset
release bus
wait bus taken
end reset

I used that as a reference.

You've never experienced this issue? Hmm... I think I have to debug more

Posted: Thu Feb 06, 2014 10:18 am
by Stef
sigflup wrote: request bus
wait
start reset
release bus
wait bus taken
end reset

I used that as a reference.

You've never experienced this issue? Hmm... I think I have to debug more
It should be :
request bus
wait bus taken

// do your stuff
// ..

start reset
release bus
wait bus released
end reset

And if you only want to reset Z80 for some reason :
start reset

if bus taken
{
release bus
wait bus released
}
else
{
waitSomeTime
}

end reset

Posted: Fri Feb 07, 2014 5:57 am
by Oerg866
New demo? :P Cant wait =)

Posted: Fri Feb 07, 2014 12:27 pm
by sigflup
First of all, thanks stef!
Oerg866 wrote:New demo? :P Cant wait =)
it's a small musicdisk for datastorm. It's done now. I gave myself 3 days to complete it. Mind you, it's not that complex but it's cute.