Forums

Sega Master System / Mark III / Game Gear
SG-1000 / SC-3000 / SF-7000 / OMV
Home - Forums - Games - Scans - Maps - Cheats - Credits
Music - Videos - Development - Hacks - Translations - Homebrew

View topic - Emulicious - "inconsistent state" ?

Reply to topic
Author Message
  • Joined: 01 Jul 2016
  • Posts: 55
Reply with quote
Emulicious - "inconsistent state" ?
Post Posted: Fri Mar 31, 2017 11:27 am
Hi,

Fighting on some VDP corruptions (LineInterrupt + HScroll), I discovered a feature on Emulitious :
"Break on inconsistent state after interrupt"

It seems it exctly points my problem....but I don't know why my game is on such state !

So, what exactly is an "inconsistent state" ?
unsaved z80 registers ? VDP reg on conflict ?

Identify the real bugs is 50% of get them fixed ;)

thanks
  View user's profile Send private message Visit poster's website
  • Joined: 05 Sep 2013
  • Posts: 3827
  • Location: Stockholm, Sweden
Reply with quote
Post Posted: Fri Mar 31, 2017 11:51 am
I suspect it means you're accessing (reading) VDP status/data when a write address/register operation is pending (as it's always performed with TWO writes)

but don't take my word for that. Calindro will surely clarify this better.

what are you trying to do, anyway?
  View user's profile Send private message Visit poster's website
  • Joined: 14 Apr 2013
  • Posts: 624
Reply with quote
Post Posted: Fri Mar 31, 2017 1:49 pm
"Inconsistent state" refers to a change of state (changed register/changed bank register) caused by an interrupt. In most cases you will want the state before an interrupt to be restored after the interrupt. If an interrupt handler doesn't do it this breakpoint suspends execution. When this breakpoint suspends execution Emulicious should tell you the reason in the Debugger Window and in the log in the Breakpoint Window.
  View user's profile Send private message Visit poster's website
  • Joined: 01 Jul 2016
  • Posts: 55
Reply with quote
Post Posted: Fri Mar 31, 2017 10:51 pm
Last edited by KanedaFr on Fri Mar 31, 2017 11:17 pm; edited 1 time in total
oh, so it doesn't help me :(

I'm trying to mimic the horizontal scroll lock (Reg0 bit 6) on GG, since it doesn't work, or at least not on the "visible" rows.

To do that, I used LineInterrupt :
on line 0, I set the hscroll to 0 (reg8)
on line 32 (3 invisible row + first real one of the GG), I set hscroll to my real scroll value...then disable lineInterrupt

It's what Emulicious sees as "inconsiste state" : I update the VDPReg inside lineInterrupt :(

I hoped it could explain why VDP is corrupted but wrong path...I need to find another one :(
  View user's profile Send private message Visit poster's website
  • Joined: 14 Apr 2013
  • Posts: 624
Reply with quote
Post Posted: Fri Mar 31, 2017 10:54 pm
KanedaFr wrote
oh, so it doesn't help me :(

I'm trying to mimic the horizontal scroll lock (Reg0 bit 6) on GG, since it doesn't work, or at least not on the "visible" rows.

To do that, I use LineInterrupt :
on line 0, I set the hscroll to 0 (reg8)
on line 32 (3 invisible row + first real one of the GG), I set hscroll to my real scroll value...then disable lineInterrupt

It's what Emulicious sees as "inconsiste state" : I update the VDRReg inside lineInterrupt :(

I hoped it could explain why VDP is corrupted but wrong path...I need to find another one :(

The breakpoint is not VDP related. It doesn't see changes of VDPRegs. Did you check the Breakpoints Window? The reason for the breakpoint to suspend will be logged there.

If you want you can send me your rom and I'll take a look on what might cause your issues.
  View user's profile Send private message Visit poster's website
  • Joined: 01 Jul 2016
  • Posts: 55
Reply with quote
Post Posted: Fri Mar 31, 2017 11:23 pm
OHHHH
I didn't notice the breakpoint window log!!
This emulator is full of (good) surprises !!!!

HL changed from DFE7 to DFE5

or
IY changed from DFE8 to DFE6


hmmm...
  View user's profile Send private message Visit poster's website
  • Joined: 01 Jul 2016
  • Posts: 55
Reply with quote
Post Posted: Sat Apr 01, 2017 12:21 am
For anyone following this thread : be sure to update Emulicious ;)
  View user's profile Send private message Visit poster's website
  • Joined: 05 Sep 2013
  • Posts: 3827
  • Location: Stockholm, Sweden
Reply with quote
Post Posted: Sat Apr 01, 2017 4:52 pm
KanedaFr wrote
To do that, I used LineInterrupt :
on line 0, I set the hscroll to 0 (reg8)
on line 32 (3 invisible row + first real one of the GG), I set hscroll to my real scroll value...then disable lineInterrupt


although this isn't wrong, I suggest you set hscroll to zero when you're in vblank, so that next screen will start with no hscroll, and you enable lineIRQ. Then, after the 32th line has been drawn, your line interrupt get fired (you should set 32 as value) and you then set the desired hscroll value, then disable lineIRQ.

if at the end of the interrupt some register value isn't what it was before, then there's something really weird going on.
  View user's profile Send private message Visit poster's website
  • Joined: 01 Jan 2014
  • Posts: 331
Reply with quote
Post Posted: Sun Apr 02, 2017 1:00 am
If you have a line interrupt at 0 then you also have one at 1.
What Sverx says is the easiest unless you need additional line interrupts after that.

Right now my guess is your stack is being throttle but hard to know without seeing rom.
  View user's profile Send private message
  • Joined: 01 Jul 2016
  • Posts: 55
Reply with quote
Post Posted: Sun Apr 02, 2017 1:16 am
sverx wrote
KanedaFr wrote
To do that, I used LineInterrupt :
on line 0, I set the hscroll to 0 (reg8)
on line 32 (3 invisible row + first real one of the GG), I set hscroll to my real scroll value...then disable lineInterrupt


although this isn't wrong, I suggest you set hscroll to zero when you're in vblank, so that next screen will start with no hscroll, and you enable lineIRQ. Then, after the 32th line has been drawn, your line interrupt get fired (you should set 32 as value) and you then set the desired hscroll value, then disable lineIRQ.

if at the end of the interrupt some register value isn't what it was before, then there's something really weird going on.



It's what I done first....but perhaps I missed the point that I enable lineinterrupt at the end of my game loop...so perhaps AFTER some lines were already drawn.

I more and more suspect a too long main loop....
  View user's profile Send private message Visit poster's website
  • Joined: 14 Apr 2013
  • Posts: 624
Reply with quote
Post Posted: Sun Apr 02, 2017 3:28 pm
The "inconsistent state" breakpoint now also identifies your problem. I hope it can help you fix it.
  View user's profile Send private message Visit poster's website
Reply to topic



Back to the top of this page

Back to SMS Power!