OMG! ZIRIA! ZIRIA!! ZIRIA!!! IT ACTUALLY HAPPENED!! 34 YEARS LATER!! The epic/legendary Tengai Makyou/Far East of Eden: Ziria JRPG has finally been localized! Supper the Subtitler struck again! Simply unstoppable, NOTHING can prevent him from TOTAL PCECD localization domination!!!! WHACHA GONNA DO BROTHER?!?!
Main Menu

Homebrew Suggestion: R-Type

Started by nat, 01/23/2011, 02:24 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

nat

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 Bonknuts doesn't log in here anymore as this seems like something he'd be all over.

esteban

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.
IMGIMG IMG  |  IMG  |  IMG IMG

nat

#2
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.

ccovell

Quote from: nat on 01/23/2011, 02:24 AM...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:
IMG
...

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

#4
Quote from: nat on 01/23/2011, 02:58 AMI 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.



Quote from: ccovell on 01/23/2011, 06:50 AMOh, 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)
IMGIMG IMG  |  IMG  |  IMG IMG

ccovell

#5
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.

nat

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 fuck all about ROM hacking/programming.

ccovell

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

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

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

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

Binary-wise, PCE and SGX games are completely identical.  SGX games just have an additional pair of chips to access in the hardware.

nat

Quote from: JKM on 01/25/2011, 09:14 PMIf 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

Really? I may need to look for a SuperGrafx...

ccovell

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.
IMG IMG

termis

Man, that's pretty awesome - not only the flicker reduction, but the full-res mode.  Sharp stuff.

Keranu

Incredible!

By the way... when this is completed, will it be safe to post the download link on the forum? Or would that be considered ROM sharing? Or maybe there will just be a patch?
Quote from: TurboXray on 01/02/2014, 09:21 PMAdding PCE console specific layer on top of that, makes for an interesting challenge (no, not a reference to Ys II).
IMG
Click the banner to learn more about Alex Chiu and his "immortality rings"

nat

Looking great, Chris! Keep it up! My only concern with the full-screen modification.... Will this make the image appear squished vertically when played on a TV with the real hardware?

Publicly posting a link to the hacked ROM on the forum would be against forum rules, but I don't see any reason why sharing via PMs wouldn't be allowed. Publicly posting just a patch link, on the other hand, would be fine.

termis

Quote from: nat on 01/28/2011, 08:17 PMLooking great, Chris! Keep it up! My only concern with the full-screen modification.... Will this make the image appear squished vertically when played on a TV with the real hardware?
I'm by no means an expert on this, but this made me curious too -- I got some screen captures of R-Type off MAME -- and then squashed all the images to 4:3 to emulate what it'd look like on an actual TV, and I think the results actualy looks better with Chris's hack.  It seems like the original Turbo/PCE version is the one that's a bit streched out vertically compared to the original (i.e. take a look at the neck curvature of the boss between the three shots -- the SGX full-res and MAME shots seem to be more true to each other)

Unhacked Turbo vs Hacked SGX vs MAME (all rendered to 4:3 at 320x240)
IMG IMG IMG

nat

Wow, you're right. That's.... unexpected. I like what I'm seeing here.

shubibiman

Wow! If it turns out to work perfectly, you'll have to do that with every single PCE game that flickers  :mrgreen:
Self proclamed Aldynes World Champion

termis

Man, I'm super excited about the potential of this project.  Considering the pics above, it's as if the developers initially started with the intention of displaying the full-res for the whole screen, but then decided to chop off a bit off the vertical borders to limit some of the flickering.  Maybe this worked, but as a side-effect, it brought about the *slightly* stretched look (which I couldn't even really tell until I put 'em up side-by-side to arcade pics), and the rather annoying and unnecessary vertical scroll in the game (I actually find this vertical scroll to be the bigger annoyance).  Either way, what Chris is doing finally seems to do justice to the way R-Type was meant to be on the PCE. 

While asking for possibilities, would it also be relatively easy to apply the same patch to the CD version of the game?  The monster setup of SGX + SCD-ROM would finally have reason to specifically be together, rather than just for compatibility convenience with other PCE setups (that is, there's no SGX CD game so far).  I know your time is not unlimited Chris, so I certainly appreciate what you've done, even if all this doesn't come to fruition any time soon.   :D

...And BTW, Ninja Spirit immediately pops to mind as being able to benefit from this treatment as well -- an awesome game, and flicker's the only thing that detracts from the experience just so slightly.  (Now I'm just pestering you -  :D)

ccovell

Thanks for your comments.  I wanted to make the full vertical resolution of the game visible, the same way as the Playstation compilation does.  Adding extra lines to the display, or extra columns to the sides of the display, does not squish the image, however.  The number of scanlines is fixed on a TV set or monitor, so adding these extra graphics just expands the playfield even more to the edges of the screen.  Therefore, shrinking both the TG and SGX images to the same size (320x240) doesn't accurately reflect how they'll look on a real system.

Anyway, the original TG/PCE version is very letterboxed, for whatever reason the designers chose.  I don't think it's necessarily to eliminate flicker; perhaps it's to keep the wider aspect of the arcade version, or something.

First I'll finish up the TG conversion and then try to apply the hack to the PCE/CD ones.  One major obstacle is that I can't find the RAM variable for the stage you're on (for cheating purposes.)  Would anybody happen to know it?

esteban

Dude, you rock. Absolutely splendid.

Quote from: ccovell on 01/28/2011, 06:41 PMOK, 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.
IMG IMG
IMGIMG IMG  |  IMG  |  IMG IMG

Ceti Alpha

Holy crap! This is amazing! Seriously, great work covell.

So, would this hack of R-Type also allow for parallax?
IMG
"Let the CAW and Mystery of a Journey Unlike Any Other Begin"

SignOfZeta

Quote from: esteban on 01/23/2011, 06:57 AMIt 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?
Battlefield '94 in Tokyo Dome...or whatever its called. That shite Arcade Card wrestling game. It doesn't do chiptune music over the top, but in some stages there is no music and it just has redbook crowd noises. It has, IMO, some of the best crowd noises because of this. Other than that, this game is lame. I have no idea what justifies it being an AC game.

When i first played it I thought similar things. A large percentage of PC Engine redbook music is total garbage. Bad jazz and shitty Yamaha PCM synths. They could do much cooler stuff.
IMG

nat

Quote from: ceti alpha on 01/30/2011, 01:59 AMHoly crap! This is amazing! Seriously, great work covell.

So, would this hack of R-Type also allow for parallax?
I can't imagine parallax beyond what's already in the game (ie, stage 5) would be possible without heavy, heavy modification.

Ceti Alpha

Quote from: nat on 01/30/2011, 04:55 AM
Quote from: ceti alpha on 01/30/2011, 01:59 AMHoly crap! This is amazing! Seriously, great work covell.

So, would this hack of R-Type also allow for parallax?
I can't imagine parallax beyond what's already in the game (ie, stage 5) would be possible without heavy, heavy modification.
Oh for sure. I was really only thinking about the parallax in stages 2 and 5.
IMG
"Let the CAW and Mystery of a Journey Unlike Any Other Begin"

esteban

Quote from: SignOfZeta on 01/30/2011, 03:13 AM
Quote from: esteban on 01/23/2011, 06:57 AMIt 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?
Battlefield '94 in Tokyo Dome...or whatever its called. That shite Arcade Card wrestling game. It doesn't do chiptune music over the top, but in some stages there is no music and it just has redbook crowd noises. It has, IMO, some of the best crowd noises because of this. Other than that, this game is lame. I have no idea what justifies it being an AC game.

When i first played it I thought similar things. A large percentage of PC Engine redbook music is total garbage. Bad jazz and shitty Yamaha PCM synths. They could do much cooler stuff.
Thanks for that example! I was hoping someone would be able to identify a game that used this technique.

Ambient crowd noise...the one thing that Battlefield '94 did well.
IMGIMG IMG  |  IMG  |  IMG IMG

ccovell

Parallax in stages 1 or 2 would take a lot more work, as well as a ROM expansion to 6M, probably...  Anyway, the parallax in stages 3, 5, etc can be restored or else I fail.

Another game with atmospheric sound effects on CD mixed in with the game audio is Sol-Feace.  It has a few annoying sound effects at certain events played overtop of the CD music.

SignOfZeta

BTW, I'm very impressed with your work here, ccovell. I didn't seriously think anyone would do this, and you already have it running.
IMG

spenoza

You know, it just occurred to me that the SGX might be able to put out more sprite action than the CPU is comfortably able to process hit detection for. I suspect the SGX extra sprite display power would therefore probably be best suited to creating sprite-based background details and special effects which would require simple or no hit detection. Or, as in this case and the case of Darius Plus, making a flicker-free experience for a game the base PCE can otherwise handle.

OldRover

That unfortunately is an ages-old presumption. The CPU is more than capable of handling all the maths for hit detection even with two full-on sprite layers. It all comes down to the efficiency of the hit detection routines. The 6280 is more capable than people give it credit for. :)
Turbo Badass Rank: Janne (6 of 12 clears)
Conquered so far: Sinistron, Violent Soldier, Tatsujin, Super Raiden, Shape Shifter, Rayxanber II

spenoza

Yeah, I know it's a competent CPU, but I lost faith in console developers reliably being able to program for specific CPUs long ago. Some can and do, but many don't, and the PCE was not a system that gave great results to shoddy programming. The Genesis/Mega Drive was pretty forgiving, but the PCE made you earn your keep.

Arkhan Asylum

Quote from: guest on 02/01/2011, 02:09 PMYeah, I know it's a competent CPU, but I lost faith in console developers reliably being able to program for specific CPUs long ago. Some can and do, but many don't, and the PCE was not a system that gave great results to shoddy programming. The Genesis/Mega Drive was pretty forgiving, but the PCE made you earn your keep.
Yeah the 68k is C/sloppy friendly. 

The 6280, if you're sloppy, it'll punch you in the mouth and call you names.
This "max-level forum psycho" (:lol:) destroyed TWO PC Engine groups in rage: one by Aaron Lambert on Facebook "Because Chris 'Shadowland' Runyon!," then the other by Aaron Nanto "Because Le NightWolve!" Him and PCE Aarons don't have a good track record together... Both times he blamed the Aarons in a "Look-what-you-made-us-do?!" manner, never himself nor his deranged, destructive, toxic turbo troll gang!

spenoza

Quote from: Psycho Arkhan on 02/10/2011, 12:59 PM
Quote from: guest on 02/01/2011, 02:09 PMYeah, I know it's a competent CPU, but I lost faith in console developers reliably being able to program for specific CPUs long ago. Some can and do, but many don't, and the PCE was not a system that gave great results to shoddy programming. The Genesis/Mega Drive was pretty forgiving, but the PCE made you earn your keep.
Yeah the 68k is C/sloppy friendly. 

The 6280, if you're sloppy, it'll punch you in the mouth and call you names.
Are you saying the 6280 is a CPU playground bully? It doesn't steal developers' lunch money, does it?

Arkhan Asylum

It's more like a drill sergeant. 

A very harsh one!
This "max-level forum psycho" (:lol:) destroyed TWO PC Engine groups in rage: one by Aaron Lambert on Facebook "Because Chris 'Shadowland' Runyon!," then the other by Aaron Nanto "Because Le NightWolve!" Him and PCE Aarons don't have a good track record together... Both times he blamed the Aarons in a "Look-what-you-made-us-do?!" manner, never himself nor his deranged, destructive, toxic turbo troll gang!

esteban

Quote from: ccovell on 01/31/2011, 05:30 AMParallax in stages 1 or 2 would take a lot more work, as well as a ROM expansion to 6M, probably...  Anyway, the parallax in stages 3, 5, etc can be restored or else I fail.

Another game with atmospheric sound effects on CD mixed in with the game audio is Sol-Feace.  It has a few annoying sound effects at certain events played overtop of the CD music.
Ha! I haven't played Sol-Feace since the early 90's. I've played the cartridge version more recently, though.

Thus far, I have yet to find the one gem of a game that does justice to the concept of RedBook SFX + chiptunes.

If you can think of any additional titles (even PC-based games), don't hesitate to share :)
IMGIMG IMG  |  IMG  |  IMG IMG

nat

Chris..... Any progress on this project?

ccovell

I've been working on it a little bit almost every day.  The sprites were no problem, but expanding the vertical res has been a hell of a chore.  The scroll adjustment was easy, but the screen split at the level 1 boss, and through the entire 3rd level, needed a lot of code fixing & dirty hacks.  It feels like limo-stretching a coupe, if you know what I mean.

Anyway, almost everything is successful -- for the 1st half of the game.  Space is quite tight in the 1st bank, so I've had to trim code here and there and relocate it strategically, like an NES or Atari programmer.   :-k

Arkhan Asylum

Quote from: ccovell on 02/12/2011, 08:34 PMAtari programmer.   :-k
I'm convinced Atari 2600 programmers were all smoking some severely powerful weed.

Especially at Activision.
This "max-level forum psycho" (:lol:) destroyed TWO PC Engine groups in rage: one by Aaron Lambert on Facebook "Because Chris 'Shadowland' Runyon!," then the other by Aaron Nanto "Because Le NightWolve!" Him and PCE Aarons don't have a good track record together... Both times he blamed the Aarons in a "Look-what-you-made-us-do?!" manner, never himself nor his deranged, destructive, toxic turbo troll gang!

nat

Quote from: ccovell on 02/12/2011, 08:34 PMI've been working on it a little bit almost every day.  The sprites were no problem, but expanding the vertical res has been a hell of a chore.  The scroll adjustment was easy, but the screen split at the level 1 boss, and through the entire 3rd level, needed a lot of code fixing & dirty hacks.  It feels like limo-stretching a coupe, if you know what I mean.

Anyway, almost everything is successful -- for the 1st half of the game.  Space is quite tight in the 1st bank, so I've had to trim code here and there and relocate it strategically, like an NES or Atari programmer.   :-k
Awesome, thanks for the update.

termis

Good stuff.  I'm looking forward to this myself.

spenoza

This makes me wonder for what other games might this be an effective technique.

nat

I'm sure there are a handful that might benefit, but I think R-Type is far and away the worst "flicker" offender on the system.

At least... of the games that I've played personally.

esteban

Quote from: nat on 02/13/2011, 02:57 PMI'm sure there are a handful that might benefit, but I think R-Type is far and away the worst "flicker" offender on the system.

At least... of the games that I've played personally.
Bloody Wolf is another big offender when it comes to flicker (IIRC). Not that anyone enjoys Bloody Wolf as much as I do, but still...

:)
IMGIMG IMG  |  IMG  |  IMG IMG

_Paul

Quote from: esteban on 02/13/2011, 05:04 PM
Quote from: nat on 02/13/2011, 02:57 PMI'm sure there are a handful that might benefit, but I think R-Type is far and away the worst "flicker" offender on the system.

At least... of the games that I've played personally.
Bloody Wolf is another big offender when it comes to flicker (IIRC). Not that anyone enjoys Bloody Wolf as much as I do, but still...

:)
I do.

nat

I fucking love Bloody Wolf, but I don't recall all that much flicker, to be honest. I don't really remember ANY flicker, for that matter.

esteban

#48
Quote from: guest on 02/13/2011, 05:17 PMI do.
It appears a bunch of us are in love.



Quote from: nat on 02/13/2011, 05:50 PMI fucking love Bloody Wolf, but I don't recall all that much flicker, to be honest. I don't really remember ANY flicker, for that matter.
Tons of flicker (and slow down) in Bloody Wolf, especially when (obviously) several sprites are in the same horizontal/vertical plane.

Then, to make matters worse, toss a special weapon (e.g. grenade, flame thrower): more flicker, plus the resulting explosions lead to flicker.

Or, hop on a motorcycle and you'll notice the flicker/slowdown.

I love Bloody Wolf.



TANGENT: The Bloody Wolf .hes doesn't work for me. Do I have a corrupt file? Because, obviously, I love the tunes from Bloody Wolf, too.
IMGIMG IMG  |  IMG  |  IMG IMG

ParanoiaDragon

Bloody Wolf is one of my favorite games ever, who dogs that game, it's great!  And deffinitly one of the best soundtracks as well!
IMG