reset the z80 twice in one prod? whaaaaa?

Ask anything your want about Megadrive/Genesis programming.

Moderator: BigEvilCorporation

Post Reply
sigflup
Very interested
Posts: 111
Joined: Mon Sep 06, 2010 12:05 pm
Contact:

reset the z80 twice in one prod? whaaaaa?

Post by sigflup » Thu Feb 06, 2014 3:37 am

Is there a way to reset the z80 at least twice in one program? I'm having trouble doing this.

TmEE co.(TM)
Very interested
Posts: 2440
Joined: Tue Dec 05, 2006 1:37 pm
Location: Estonia, Rapla City
Contact:

Post by TmEE co.(TM) » Thu Feb 06, 2014 9:12 am

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.
Mida sa loed ? Nagunii aru ei saa ;)
http://www.tmeeco.eu
Files of all broken links and images of mine are found here : http://www.tmeeco.eu/FileDen

Stef
Very interested
Posts: 3131
Joined: Thu Nov 30, 2006 9:46 pm
Location: France - Sevres
Contact:

Post by Stef » Thu Feb 06, 2014 9:13 am

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 ?

sigflup
Very interested
Posts: 111
Joined: Mon Sep 06, 2010 12:05 pm
Contact:

Post by sigflup » Thu Feb 06, 2014 9:26 am

in my code I can only do this once, I'm pretty sure

Stef
Very interested
Posts: 3131
Joined: Thu Nov 30, 2006 9:46 pm
Location: France - Sevres
Contact:

Post by Stef » Thu Feb 06, 2014 9:52 am

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

sigflup
Very interested
Posts: 111
Joined: Mon Sep 06, 2010 12:05 pm
Contact:

Post by sigflup » Thu Feb 06, 2014 10:06 am

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

Stef
Very interested
Posts: 3131
Joined: Thu Nov 30, 2006 9:46 pm
Location: France - Sevres
Contact:

Post by Stef » Thu Feb 06, 2014 10:18 am

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

Oerg866
Very interested
Posts: 211
Joined: Sat Apr 19, 2008 10:58 am
Location: Frankfurt, Germany
Contact:

Post by Oerg866 » Fri Feb 07, 2014 5:57 am

New demo? :P Cant wait =)

sigflup
Very interested
Posts: 111
Joined: Mon Sep 06, 2010 12:05 pm
Contact:

Post by sigflup » Fri Feb 07, 2014 12:27 pm

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.

Post Reply