Author Topic: Homebrew Suggestion: R-Type  (Read 3105 times)

nat

  • Hero Member
  • *****
  • Posts: 7085
Homebrew Suggestion: R-Type
« on: January 22, 2011, 06:24:55 PM »
Here's a homebrew suggestion for all you coders out there who are looking for something to tackle.

Modify the R-Type ROM to take advantage of the extra VDC in the SGX. As we all know, the flicker in R-Type is atrocious. I'd love to see someone modify the existing game to use the 2nd VDC for half the sprites, thus eliminating the flicker. You know... the same way the Darius hybrid cartridge does.

It's too bad malducci doesn't log in here anymore as this seems like something he'd be all over.

esteban

  • Hero Member
  • *****
  • Posts: 24063
Re: Homebrew Suggestion: R-Type
« Reply #1 on: January 22, 2011, 06:49:47 PM »
I second the suggestion. :)

And, what was the difference between the JP HuCard vs. US HuCard vs. JP CD-ROM versions of R-Type concerning flicker and screen resolution?

Point me to a thread, my friend.
  |    | 

nat

  • Hero Member
  • *****
  • Posts: 7085
Re: Homebrew Suggestion: R-Type
« Reply #2 on: January 22, 2011, 06:58:15 PM »
I can't/am too lazy to find a thread about the differences, but I do know off the top of my head:

The U.S. and CD versions have a slightly (read: 5 pixel) shorter horizontal resolution than the JP cart version in the hopes of reducing flicker. We know how that turned out. I can't see a noticeable difference in flicker between the two. You can, however, see the reduced resolution if you own both the U.S. and JP carts. The viewable area on the U.S. version is cut just a tiny bit short on the right side of the screen where the viewable area on the JP version extends right to the edge of the screen.
« Last Edit: January 22, 2011, 06:59:57 PM by nat »

ccovell

  • Hero Member
  • *****
  • Posts: 2245
Re: Homebrew Suggestion: R-Type
« Reply #3 on: January 22, 2011, 10:50:59 PM »
...thus eliminating the flicker. You know... the same way the Darius hybrid cartridge does.


Oh, by the way, has anyone ever checked out what lengths Darius Plus goes to when hooked into the SGX?  Here's an illustration:

...

A hack to R-Type might or might not work... The quickest way to do it would be to have the sprite updating code send updates to the VDC1 and VDC2 alternatingly each frame.  It might work... but the VRAM writing code still has to load sprite tiles to both VDCs at the same time.

esteban

  • Hero Member
  • *****
  • Posts: 24063
Re: Homebrew Suggestion: R-Type
« Reply #4 on: January 22, 2011, 10:57:05 PM »
I can't/am too lazy to find a thread about the differences, but I do know off the top of my head:

The U.S. and CD versions have a slightly (read: 5 pixel) shorter horizontal resolution than the JP cart version in the hopes of reducing flicker. We know how that turned out. I can't see a noticeable difference in flicker between the two. You can, however, see the reduced resolution if you own both the U.S. and JP carts. The viewable area on the U.S. version is cut just a tiny bit short on the right side of the screen where the viewable area on the JP version extends right to the edge of the screen.

Ahhhh, thank you. I have the JP HuCards and CD. Not sure if I still have the US HuCard.



Oh, by the way, has anyone ever checked out what lengths Darius Plus goes to when hooked into the SGX?  Here's an illustration...

Fantastic. Your illustration was very clear and informative. :)






Tangent: R-Type Complete CD has Red Book soundtrack replacing chiptunes. I happen to like the Red Book, but I know many people do not. An option to play PSG in lieu of Red Book would have been nice, I suppose (Vasteel, for example, provides this option, but it is geared to speed up the flow of the game).

Selecting "Chiptunes only", however, always struck me as being wasteful. Surely the developers could find a way to utilize Red Book for another purpose?

It sounds odd, but I always thought it would be "neat" to use Red Book to provide an ambient soundscape that would play alongside a traditional  PSG chiptune soundtrack. The PSG and Red Book would not be synchronized and would loop at different times. I know this sounds retrograde and backward-thinking (since it isn't the most efficient use of Red Book), but do you know of any early CD-ROM game (on any platform) that did this?

Will R-Type Complete Homebrew CD be the first to offer this dubious option? (just kidding)
« Last Edit: January 23, 2011, 12:07:45 AM by esteban »
  |    | 

ccovell

  • Hero Member
  • *****
  • Posts: 2245
Re: Homebrew Suggestion: R-Type
« Reply #5 on: January 24, 2011, 01:14:18 AM »
Is anybody tackling the challenge?

I'm not looking for more projects to do (I have enough already!) but I couldn't help but do a little research.

Here are my notes so far.

VDC sprite write code is at ~$6CFE-$6D73.

VDC1 sprite table is at $0800-$08FF in VRAM

$0E-$11 in RAM holds the data for one sprite at a time during writing.

$15 in RAM is the magic number, as it's loaded with 64 each frame (at $6BC2) and counted down for SATB writing and OAM cycling (ie: the flicker routine).  Change that number to 128, and R-Type happily writes 128 sprite entries.

Simply writing the 2nd half of these 128 sprite entries to the SGX's VDC will not eliminate flicker entirely; it'll just make sure that no/few sprites blank out during the game (ie: SGX VDC just handles overflow).  Flicker can only be reduced (I reckon) by having each alternate sprite written to VDC2.  Some smart code has to be written in there by somebody to do that...

If there's an error in my methodology (VDC2 handling alternate sprites vs. handling overflow) please let me know.
« Last Edit: January 24, 2011, 01:43:23 AM by ccovell »

nat

  • Hero Member
  • *****
  • Posts: 7085
Re: Homebrew Suggestion: R-Type
« Reply #6 on: January 24, 2011, 04:32:15 PM »
I think this is a great start. I'd really love to help out, but the whole reason I presented this to you tech guys is because I know f*ck all about ROM hacking/programming.

ccovell

  • Hero Member
  • *****
  • Posts: 2245
Re: Homebrew Suggestion: R-Type
« Reply #7 on: January 25, 2011, 01:41:42 AM »
Alright, alright, I'll do this hack.   :)

I started it late last night and it was so fun figuring out how to hack the game, I did more of it today.  First up was adding SGX detection, VPC initialization routines, and modifying the VDC register setup routines to do both VDCs in sequence, one after the other.  Of course, if it's a regular PC-Engine, it'll do only the first VDC.  That's all for now.

nat

  • Hero Member
  • *****
  • Posts: 7085
Re: Homebrew Suggestion: R-Type
« Reply #8 on: January 25, 2011, 12:12:51 PM »
My man!

Out of curiosity.... Which ROM are you using? The full-game U.S. ROM or one of the half-game JP ROMs?

ccovell

  • Hero Member
  • *****
  • Posts: 2245
Re: Homebrew Suggestion: R-Type
« Reply #9 on: January 25, 2011, 01:00:52 PM »
I'm starting with the full US ROM first.  Unfortunately, the hack has to be done twice to the US ROM anyway, as it's basically both Japanese ROMs simply appended together, with a little tie-in code.  Try it: if you run the game from the 2nd 256k of the US ROM, you'll start out in Stage 5 with 255 lives.

GohanX

  • Hero Member
  • *****
  • Posts: 1140
Re: Homebrew Suggestion: R-Type
« Reply #10 on: January 25, 2011, 01:14:06 PM »
If we could get a hacked rom, how would you play it on real hardware? Do the pce flash carts work with SuperGrafx games?

ccovell

  • Hero Member
  • *****
  • Posts: 2245
Re: Homebrew Suggestion: R-Type
« Reply #11 on: January 25, 2011, 01:42:47 PM »
Binary-wise, PCE and SGX games are completely identical.  SGX games just have an additional pair of chips to access in the hardware.

nat

  • Hero Member
  • *****
  • Posts: 7085
Re: Homebrew Suggestion: R-Type
« Reply #12 on: January 25, 2011, 03:19:49 PM »
If we could get a hacked rom, how would you play it on real hardware? Do the pce flash carts work with SuperGrafx games?

What ccovell said. If he is successful, I'll just load up the game on my flash cart and play it on the real hardware that way.

GohanX

  • Hero Member
  • *****
  • Posts: 1140
Re: Homebrew Suggestion: R-Type
« Reply #13 on: January 26, 2011, 11:16:23 AM »
Really? I may need to look for a SuperGrafx...

ccovell

  • Hero Member
  • *****
  • Posts: 2245
Re: Homebrew Suggestion: R-Type
« Reply #14 on: January 28, 2011, 10:41:47 AM »
OK, this hack is coming along nicely.  Many routines had to be changed, from VRAM tile writing, to sprite positioning, and even scrolling and screen setup.  I've also begun hacking the vertical res, scrolling code & logic to make the game completely full-screen, as the arcade version was.  Let me know if you like it.

A flicker comparison between R-Type (U) on the left and the SG hack on the right.