Search found 237 matches

by powerofrecall
Tue Apr 26, 2016 3:36 pm
Forum: Megadrive/Genesis
Topic: Alright dudes, I need your help! (soft-reset bug)
Replies: 37
Views: 28224

Re: Alright dudes, I need your help! (soft-reset bug)

Also, I was confused for a bit because the assembly source emitted by the compiler (vbcc) didn't actually contain a clr instruction. It turns out the assembler (vasm) makes the substitution... which is why playing with compiler optimization levels (one of the first things I tried) didn't do anything...
by powerofrecall
Tue Apr 26, 2016 3:14 pm
Forum: Megadrive/Genesis
Topic: Alright dudes, I need your help! (soft-reset bug)
Replies: 37
Views: 28224

Re: Alright dudes, I need your help! (soft-reset bug)

Mask of Destiny wrote:OK, I found the problem.
Nice find by the way! I had actually heard about this issue once upon a time but of course couldn't put two and two together.
by powerofrecall
Tue Apr 26, 2016 3:13 pm
Forum: Megadrive/Genesis
Topic: Alright dudes, I need your help! (soft-reset bug)
Replies: 37
Views: 28224

Re: Alright dudes, I need your help! (soft-reset bug)

Like so

Code: Select all

uint32_t *data = (uint32_t *)VDP_DATA;
I've traced it to at least one function to clear a plane, since it always writes zero to clear it wants to use clr.l to do it.

I'm assuming I need to throw another keyword in there? Or just rewrite it in asm
by powerofrecall
Tue Apr 26, 2016 2:46 am
Forum: Megadrive/Genesis
Topic: Blanking the display for one (or more) scanlines only
Replies: 7
Views: 5329

Re: Blanking the display for one (or more) scanlines only

I was thinking you could probably achieve the effect using h-ints to copy palettes at the appropriate times. You start with an all black palette, then when you hit the right scanline, switch to your color palette. Then when you hit the scanline you want on the bottom, switch back to all-black. You'd...
by powerofrecall
Mon Apr 25, 2016 6:46 pm
Forum: Megadrive/Genesis
Topic: Alright dudes, I need your help! (soft-reset bug)
Replies: 37
Views: 28224

Re: Alright dudes, I need your help! (soft-reset bug)

The code is very conservative and conventional too. Holding z80 for pad reads, using gemsdmastart/gemsdmaend before and after DMA. VRAM is still loaded in software, the DMA is only used for the palette and a copy of the sprite attribute table in RAM. There isn't even any use of sprites in this ROM s...
by powerofrecall
Mon Apr 25, 2016 6:43 pm
Forum: Megadrive/Genesis
Topic: Alright dudes, I need your help! (soft-reset bug)
Replies: 37
Views: 28224

Re: Alright dudes, I need your help! (soft-reset bug)

The fixed one works as intended in every emulator I throw it into including Blastem, but not from Megacart. If I was going to venture some sort of guess it probably has to do with bankswitching or something, but that doesn't explain a lot when commercial games by and large are compatible. Here it is...
by powerofrecall
Mon Apr 25, 2016 6:24 pm
Forum: Megadrive/Genesis
Topic: Alright dudes, I need your help! (soft-reset bug)
Replies: 37
Views: 28224

Re: Alright dudes, I need your help! (soft-reset bug)

I found the problem: a stray move #$2000,sr at the end of one of my VDP functions that I forgot to remove when I restructured my code to run in vblank! I had it set up to disable/enable interrupts before, when I couldn't guarantee an interrupt wouldn't happen, but that shouldn't happen now. The tric...
by powerofrecall
Mon Apr 25, 2016 3:06 pm
Forum: Megadrive/Genesis
Topic: Alright dudes, I need your help! (soft-reset bug)
Replies: 37
Views: 28224

Re: Alright dudes, I need your help! (soft-reset bug)

OK I stepped through it with IDA+GensIDA and I think I found the problem (which ironically, doesn't affect Gens in the slightest). This is something I REALLY should probably know, but: is it forbidden to mess with the SR inside an interrupt? (I mean, I don't know why you would, but is it "bad?") The...
by powerofrecall
Sun Apr 24, 2016 8:43 pm
Forum: Megadrive/Genesis
Topic: Alright dudes, I need your help! (soft-reset bug)
Replies: 37
Views: 28224

Re: Alright dudes, I need your help! (soft-reset bug)

Removing the pad initialization and inserting jumps to _gemsholdz80 and _gemsreleasez80 directly into the pad read code makes everything work (at least in Fusion). I doubt this would work on the real hardware though--right? edit: it leads to broken controls in Exodus, about like you'd predict. So wh...
by powerofrecall
Sun Apr 24, 2016 8:25 pm
Forum: Megadrive/Genesis
Topic: Alright dudes, I need your help! (soft-reset bug)
Replies: 37
Views: 28224

Re: Alright dudes, I need your help! (soft-reset bug)

Here's my pad code, copied & modified from various sources. The pad read functions don't anything with the bus because I'm using the GEMS functions (gemsholdz80/gemsreleasez80) for it: BUSREQ equ $A11100 xdef _pad_init xdef _read_pad_a xdef _read_pad_b ; int read_pad_a(void); ; bit0: up ; bit1: down...
by powerofrecall
Sun Apr 24, 2016 8:19 pm
Forum: Megadrive/Genesis
Topic: Alright dudes, I need your help! (soft-reset bug)
Replies: 37
Views: 28224

Re: Alright dudes, I need your help! (soft-reset bug)

It has something to do with the pad routines. I'm baffled
by powerofrecall
Sun Apr 24, 2016 7:11 pm
Forum: Megadrive/Genesis
Topic: Alright dudes, I need your help! (soft-reset bug)
Replies: 37
Views: 28224

Re: Alright dudes, I need your help! (soft-reset bug)

If I comment out any of the GEMS stuff the code just blows up elsewhere, so I must be handling a reset situation really incorrectly.

What needs to be done for reset?
by powerofrecall
Sun Apr 24, 2016 6:36 pm
Forum: Megadrive/Genesis
Topic: Alright dudes, I need your help! (soft-reset bug)
Replies: 37
Views: 28224

Re: Alright dudes, I need your help! (soft-reset bug)

Disabling interrupts has no effect, either. Still hangs on z80 busreq
by powerofrecall
Sun Apr 24, 2016 6:34 pm
Forum: Megadrive/Genesis
Topic: Alright dudes, I need your help! (soft-reset bug)
Replies: 37
Views: 28224

Re: Alright dudes, I need your help! (soft-reset bug)

Interrupts should be disabled on reset, right? as in, move.w #$2700,sr

Does most startup code not do this??
by powerofrecall
Sun Apr 24, 2016 5:55 pm
Forum: Megadrive/Genesis
Topic: Alright dudes, I need your help! (soft-reset bug)
Replies: 37
Views: 28224

Re: Alright dudes, I need your help! (soft-reset bug)

Here is a ROM. https://mega.nz/#!upRVzQzC!SdqjX3jIn4Wr8FTjfDv_Nk1TPDVHu_iyWJutgH1Rvlk It's a homebrew sound test for X-Men 2: Clone Wars. I have a youtube channel (https://www.youtube.com/user/DUSTINODELLOFFICIAL) where I do recordings of Genesis music from the real machine so it needs to work on th...