hardware reset freeze megadrive
Moderator: BigEvilCorporation
hardware reset freeze megadrive
Hello all,
i've a little problem in my game, when the user push the reset button, that freeze totaly my megadrive. Do you have idea of what can causing such behavior ? i'm was not doing any z80 bus acces at that time. Maybe DMA...
thanks in advance
i've a little problem in my game, when the user push the reset button, that freeze totaly my megadrive. Do you have idea of what can causing such behavior ? i'm was not doing any z80 bus acces at that time. Maybe DMA...
thanks in advance
-
- Very interested
- Posts: 2440
- Joined: Tue Dec 05, 2006 1:37 pm
- Location: Estonia, Rapla City
- Contact:
In which language your program is written ??? I had problems with uninitialized variables (now I initialize everything not leave as is) which caused some erratic behaviour in one of my ASM program.
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
http://www.tmeeco.eu
Files of all broken links and images of mine are found here : http://www.tmeeco.eu/FileDen
i'm using asm with snasm68k
Stef: i've tried and kega soft reset do exactly the same. i'm using the classic startup code:
i didn't found any doc that a10008 was for the reset
Stef: i've tried and kega soft reset do exactly the same. i'm using the classic startup code:
Code: Select all
MD_Startup_Code:
tst.l $a10008
bne SkipJoyDetect
tst.w $a1000c
SkipJoyDetect:
bne SkipSetup
lea Table,a5
movem.w (a5)+,d5-d7
movem.l (a5)+,a0-a4
move.b -$10ff(a1),d0 ;Check Version Number
andi.b #$0f,d0
beq WrongVersion
move.l #$53454741,$2f00(a1) ;Sega Security Code (SEGA)
WrongVersion:
move.w (a4),d0
moveq #$00,d0
movea.l d0,a6
move a6,usp
moveq #$17,d1 ;Set VDP registers
FillLoop:
move.b (a5)+,d5
move.w d5,(a4)
add.w d7,d5
dbra d1,FillLoop
move.l (a5)+,(a4)
move.w d0,(a3)
move.w d7,(a1)
move.w d7,(a2)
L0250:
btst d0,(a1)
bne L0250
moveq #$25,d2 ; Put initial vaules into a00000
Filla:
move.b (a5)+,(a0)+
dbra d2,Filla
move.w d0,(a2)
move.w d0,(a1)
move.w d7,(a2)
L0262:
move.l d0,-(a6)
dbra d6,L0262
move.l (a5)+,(a4)
move.l (a5)+,(a4)
moveq #$1f,d3 ; Put initial values into c00000
Filc0:
move.l d0,(a3)
dbra d3,Filc0
move.l (a5)+,(a4)
moveq #$13,d4 ; Put initial values into c00000
Fillc1:
move.l d0,(a3)
dbra d4,Fillc1
moveq #$03,d5 ; Put initial values into c00011
Fillc2:
move.b (a5)+,$0011(a3)
dbra d5,Fillc2
move.w d0,(a2)
movem.l (a6),d0-d7/a0-a6
move #$2700,sr
SkipSetup:
bra Continue
Table:
dc.w $8000, $3fff, $0100, $00a0, $0000, $00a1, $1100, $00a1
dc.w $1200, $00c0, $0000, $00c0, $0004, $0414, $302c, $0754
dc.w $0000, $0000, $0000, $812b, $0001, $0100, $00ff, $ff00
dc.w $0080, $4000, $0080, $af01, $d91f, $1127, $0021, $2600
dc.w $f977, $edb0, $dde1, $fde1, $ed47, $ed4f, $d1e1, $f108
dc.w $d9c1, $d1e1, $f1f9, $f3ed, $5636, $e9e9, $8104, $8f01
dc.w $c000, $0000, $4000, $0010, $9fbf, $dfff
Continue:
tst.w $00C00004
move.w #$2300,sr ; user mode
lea $ff0000,a0 ; clear Genesis RAM
moveq #0,d0
clrram: move.w #0,(a0)+
subq.w #2,d0
bne clrram
jmp _main
-
- Very interested
- Posts: 3131
- Joined: Thu Nov 30, 2006 9:46 pm
- Location: France - Sevres
- Contact:
Just by reading the source code, you can see that if $(A10008).l or $(A1000C).w return something != 0
then you pass all the initialisation process (SkipSetup) and only the RAM will be cleared (the VDP and Z80 aren't re initialised).
I guess your main function assumes all is initialised as after Power ON, but after a soft reset only the main RAM will be cleared because A10008 or/and A1000C are != 0
then you pass all the initialisation process (SkipSetup) and only the RAM will be cleared (the VDP and Z80 aren't re initialised).
I guess your main function assumes all is initialised as after Power ON, but after a soft reset only the main RAM will be cleared because A10008 or/and A1000C are != 0
thanks to your point that kega might reproduce the behaviour, i get to the conclusion that the problem is the joypad initialisation, after the ram is cleared, i initiliaze the joypad using the following code :
if i comment those lines, the rom reset properly (but no joypad anymore). What's the best way to handle joypad initialization ?
Code: Select all
PAD3_Init:
moveq #$40,d0
move.b d0,$a10009
move.b d0,$a1000b
move.b d0,$a1000d
...
rts
-
- Very interested
- Posts: 2440
- Joined: Tue Dec 05, 2006 1:37 pm
- Location: Estonia, Rapla City
- Contact:
Wierd ... In GBMD (my game) joypads (and the rest of the stuff) are reinitialized exactly the same way every time the game starts or is reset. I've never experienced any lockups, maybe because I don't initialize 3rd port or I use my own written from scratch routines ?
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
http://www.tmeeco.eu
Files of all broken links and images of mine are found here : http://www.tmeeco.eu/FileDen
nop, except the startup code , it's all my code
but i was reading the joypad during every VBLANK. So as interrupts where not disable my pad reading routine was still active. and during it, i was trying to jump to an unknow location (i'm using a pointer in ram). So now i've handle it properly by disabling the int at the very start
but i was reading the joypad during every VBLANK. So as interrupts where not disable my pad reading routine was still active. and during it, i was trying to jump to an unknow location (i'm using a pointer in ram). So now i've handle it properly by disabling the int at the very start
-
- Very interested
- Posts: 2440
- Joined: Tue Dec 05, 2006 1:37 pm
- Location: Estonia, Rapla City
- Contact:
Now I see...
I have written the startup code (and the rest) from scratch. My joypad code just stores the result in RAM.
I have written the startup code (and the rest) from scratch. My joypad code just stores the result in RAM.
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
http://www.tmeeco.eu
Files of all broken links and images of mine are found here : http://www.tmeeco.eu/FileDen
-
- Very interested
- Posts: 3131
- Joined: Thu Nov 30, 2006 9:46 pm
- Location: France - Sevres
- Contact:
I guess the startup code does that just for cohenrency about the term "software reset". A software reset shouldn't reset hardwarePascal wrote:i found the problem, thanks for your clues stef , it was that interrupts were still activated when i reset. But i needed to redo all the vdp,vram,... clearing , else my rom gonna glitch.
now i'm wondering why the startup code was skipping the initialize of vdp and vram when there's a reset ?
Some game uses software reset and acts differently than for hardware reset.
-
- Very interested
- Posts: 2440
- Joined: Tue Dec 05, 2006 1:37 pm
- Location: Estonia, Rapla City
- Contact:
Any hints on what you'll release ?
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
http://www.tmeeco.eu
Files of all broken links and images of mine are found here : http://www.tmeeco.eu/FileDen
sure it's the demo of
http://www.spoutnickteam.com/ST/viewgames.php3?id=3
i got the first beta, need to heavily test it on the hard and write a manual (boooring ^^)
http://www.spoutnickteam.com/ST/viewgames.php3?id=3
i got the first beta, need to heavily test it on the hard and write a manual (boooring ^^)
-
- Very interested
- Posts: 2440
- Joined: Tue Dec 05, 2006 1:37 pm
- Location: Estonia, Rapla City
- Contact:
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
http://www.tmeeco.eu
Files of all broken links and images of mine are found here : http://www.tmeeco.eu/FileDen