Sonic and Sega Retro Message Board: Take the Saxman Challenge! - Sonic and Sega Retro Message Board

Jump to content

Hey there, Guest!  (Log In · Register) Help
Page 1 of 1
    Locked
    Locked Forum

Take the Saxman Challenge! $10 US goes to the first to figure this out (for real)

#1 User is offline saxman 

Posted 21 November 2013 - 12:32 AM

  • Oldbie
  • Posts: 2625
  • Joined: 08-April 04
  • Gender:Male
  • Location:United States of America
  • Wiki edits:136
I'm offering $10 via PayPal to the first person to figure this out. I tried to figure it out about a year ago and gave up in frustration. I also didn't get very much feedback from those I approached for help. I have attempted it again recently, but have yet to break the ice.

I want to turn off the V-Int entirely and use the H-Int exclusively to handle all interrupts. I have code I have written:

http://www.4shared.c...4F/s2_hint.html
(if download won't work, I can e-mail it.)

The source file replaces the 's2.asm' file from the 2007 disassembly.

It starts at the H_Int label (line 1465) and checks which phase it needs to handle (page interrupt or line interrupt). It works when used as a straight forward replacement for the V-Int, but it gets messy when attempting to handle H-Ints (used when drawing water).

Go to ARZ1 and you'll see immediately how problematic it is. I tracked it in a debugger and it appears the interrupt timing is unstable at times. What I think is happening is something is preventing the interrupts from being triggered on time, resulting in the timer being reloaded from register 10 and thus getting out of sync. As a result of this, the color lines tend to not match with the water at all, will blink repeatedly, and many other quirks. I would like to believe that this is possible, but I have not been able to pull it off correctly.

I'm serious about the money. Please, take a look at this and see if you can figure out what I'm missing here! I am good on my word and will pay the money upon successfully getting this concept working correctly without slow-downs, flickering, etc. I'm not overly concerned with 2P split-screen at the moment. It that's broken, that's fine. It's the water I'm concerned with.
This post has been edited by saxman: 21 November 2013 - 09:19 AM

#2 User is offline Retroman 

Posted 21 November 2013 - 04:59 AM

  • Posts: 486
  • Joined: 18-September 09
  • Gender:Male
Maybe these ones can help?
http://forums.sonicr...showtopic=31401
http://forums.sonicr...h&fromMainBar=1

I don't really know anything about rom hacking, so I am of no use here. There's a Some Changes for Sonic 2 Bug Fix Thread here:
http://forums.sonicr...showtopic=29029
This post has been edited by Retroman: 21 November 2013 - 05:26 AM

#3 User is offline Oerg866 

Posted 21 November 2013 - 02:13 PM

  • Posts: 1735
  • Joined: 07-September 06
  • Gender:Male
  • Location:Frankfurt, Germany
  • Wiki edits:3
I'll take a look. Please hold.

EDIT: Bah, can't download it. No facebook, twitter or G+ here. Please mail it to me.
This post has been edited by Oerg866: 21 November 2013 - 02:19 PM

#4 User is offline TmEE 

Posted 21 November 2013 - 03:18 PM

  • Hot music ~~~~
  • Posts: 1716
  • Joined: 06-January 08
  • Gender:Male
  • Location:Estonia, Rapla City
  • Project:Big Neighbor Disturber, Laser Raster Scan Projector
  • Wiki edits:11
Stuff about interrupts :

The interrupt counter is reloaded only in VBL or when the int actually happens, but not when you write the Line count value.
That means you will have to update the line count ahead of time.

In VBL you set the first target line, and when active frame starts you have to write the next target line.
Now when interrupt happens the VDP will read your previously written line count and sometime after your interrupt handler code is being run, where you will write in the next target line count. Writing the next line should be very first thing you do in the handler, as chances are your code is too slow and next line begins which will use the unupdated value, messing everything up.

You will know when the last line is sent in, so you could for example set a flag at that point which you can compare and act accordingly. Alternatively you may also completely forget about doing VBL stuff with an interrupt and poll the VDP instead in main code, it will make your HBL handler less complex too and also less sensitive to the "takes too much time" problem I described earlier.

EDIT: One more thing : Interrupt starts when current instrution finishes. There's only 488 68K cycles per line, and if you execute a division or mul that take tons of cycles you may very well end up int being triggered at quarter line in. That is the interrupt jitter part - look at the "takes too much time" aspect again :P

EDIT2: I looked at your code a bit.
Save those registers when you start using them.
And it seems you assume line count is reloaded when the reg is written to. That is the failure point.
You also do a ton of checks, and when they end you are likely on the next line and too late to do anything about line count, and things crumble down.
This post has been edited by TmEE: 21 November 2013 - 05:25 PM

#5 User is offline MarkeyJester 

Posted 21 November 2013 - 06:48 PM

  • Clouded in obscurity.
  • Posts: 1595
  • Joined: 22-July 08
  • Gender:Male
  • Location:Japan
  • Wiki edits:16
I think I remember you posting this before.

http://mrjester.hapisan.com/s2.asm

That's the best I can do, unfortunately I don't have time to fix the final bugs right now as I'm due off for work... It works for the most part, but obviously when the game gets busy in a few places it goes to shit. But hey, it's progress... Donno if you wanna strip it appart or whatever.

I probably asked this last time, but I'll ask again as my memory isn't the best. Why are you trying to make it so it no longer uses V-blank?

Page 1 of 1
    Locked
    Locked Forum

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users