+  RHDN Forum Archive
|-+  Romhacking
| |-+  General Romhacking
| | |-+  Tactics Ogre; techniques to "hide" bits of BG1 and BG3?
Pages: [1] 2
Author Topic: Tactics Ogre; techniques to "hide" bits of BG1 and BG3?  (Read 2170 times)
Gideon Zhi
Guest
« on: April 09, 2007, 04:09:58 am »

So let me first start by showing an image.


This is what that fancy-looking intro scroll looks like. It's stored on BG1 and BG3 - the greenish background bits are on BG3, while the text itself is on BG1. It's vertical, as per traditional Japanese, and scrolls left-to-right. It does this by adjusting the HPOS of BG1 and BG3 by 40 pixels (decimal; 28 hex); I've already located the table that does this, and it -should- be trivial enough to get it to adjust VPOS instead of HPOS.

That's not my question, though.

My question is of those vertical graphics, only one "line" is visible at a time. It fades them in, then fades them out, shifts the whole thing, then fades it in again. The rest are "hidden" behind something - I'm not sure what, and I'm not sure how. I need to change this vertical "window" or whatever to be horizontal, for my new text to display properly, and I'd like to get this working before I muck with the HPOS adjustment table.

The game appears to be using 2126-7 to create this window. Can someone educate me about these registers? How would I go about transforming this vertical window into a horizontal one?
creaothceann
Guest
« Reply #1 on: April 09, 2007, 04:51:06 am »

2126 is the first pixel of window 1, 2127 is the last pixel.

Anomie's register doc explains how it is used. You need to look at the settings of registers 2123..212F. See "vSNES | SceneViewer | info" for more readable info (though I'm not sure I've implemented everything correctly): TacticsOgre_StoryInfo.png

You'll probably need to use HDMA for a vertical window.
byuu
Guest
« Reply #2 on: April 09, 2007, 10:26:41 am »

Quote from: Gideon Zhi
My question is of those vertical graphics, only one "line" is visible at a time. It fades them in, then fades them out, shifts the whole thing, then fades it in again. The rest are "hidden" behind something - I'm not sure what, and I'm not sure how. I need to change this vertical "window" or whatever to be horizontal, for my new text to display properly, and I'd like to get this working before I muck with the HPOS adjustment table.

The game appears to be using 2126-7 to create this window. Can someone educate me about these registers? How would I go about transforming this vertical window into a horizontal one?

There are two windows, $2126-7 is the first. Essentially, it's a clipping window specifying start and end X positions. You can do all kinds of fun things like invert the windows, and enable both at the same time, and set the combine math to be and/or/xor/nor. A real PITA the way some games use it, heh.

The way it works is that the PPU grabs the values every scanline. So if you write the value at the start of the frame only, you get that same start-end X pixel clipping the entire frame.

Due to the scanline-style behavior, if you want to adjust the values mid-frame, you'll need to write to these registers during hblank (eg HDMA). Since this is a strict enable/disable, however, perhaps you'd rather just add an HDMA channel (if one doesn't already exist) to toggle BG1 on and off on the appropriate lines.

If you absolutely cannot add another HDMA channel (it's tricky, but possible, I can send you my Daikai hack where I added an extra channel to perform gradient fades in textboxes -- you're only really screwed if the game is making use of all eight channels at once, unlikely given how simplistic that effect is), then I can think of some alternatives for you. Most likely, I'd say just don't worry about the clipping. It wouldn't look bad to have all the text there at the same time.

Ah, and don't try and use HDMA channel 0. Games usually reserve one for DMA, and it's usually 0.
Gideon Zhi
Guest
« Reply #3 on: April 09, 2007, 01:14:53 pm »

I can say right now that none of the channels are in use, so HDMA shouldn't be a problem. Guess I get to learn a new skill today, eh? :p
Gideon Zhi
Guest
« Reply #4 on: April 09, 2007, 04:36:12 pm »

Alright, well... I've got my HDMA set up, sort of, but it's not working right. Here's the code...

Code:
  LDA #$00
  STA $4350
  LDA #$2C
  STA $4351

  LDA #$C0
  STA $4352
  LDA #$FF
  STA $4353
  LDA #$9C
  STA $4354

  LDA #$20
  STA $420C
  RTS

;hdma table
  db $60, $02, $20, $07, $60, $02
  db $00

The idea here is to display the 32 scanlines in the middle of the screen on all BGs, and just BG2 for the remainder of the screen. The problem is that it's not turning off BG1 or 3 - even if I db $60, $00 as the first two entries of my hdma table it disables BG2 but the text *still* shows up. What's going on here? :/
Lenophis
Guest
« Reply #5 on: April 09, 2007, 04:38:29 pm »

At the risk of sounding like a complete idiot, I ask this question: what are you testing this on?
Gideon Zhi
Guest
« Reply #6 on: April 09, 2007, 04:42:57 pm »

S9X and ZSNES both.

As an edit, it appears that it IS disabling the scanlines on BG3, just not on BG1.

As another edit, I got it working. Needed to enable HDMA on the subscreen as well as the main screen.
« Last Edit: April 09, 2007, 05:02:40 pm by Gideon Zhi »
byuu
Guest
« Reply #7 on: April 09, 2007, 05:56:37 pm »

Quote from: Gideon Zhi
As another edit, I got it working. Needed to enable HDMA on the subscreen as well as the main screen.

Yeah, write to both $212c and $212d. Games can be tricky in the way they blend the two to create the onscreen image. I swear, there's like 2,000 combinations with all of the different main/sub screens, windows, color windows, color add/sub, window/color window inverting, blending the two windows/color windows together, special tricks like OAM addsub exemption and color halve that only works half the time, etc etc. A real pain in the ass to understand how it all works at once.

Glad you got it working, great job.
Kitsune Sniper
Guest
« Reply #8 on: April 09, 2007, 07:13:37 pm »

Quote from: Gideon Zhi on April 09, 2007, 04:42:57 pm
S9X and ZSNES both.

As an edit, it appears that it IS disabling the scanlines on BG3, just not on BG1.

As another edit, I got it working. Needed to enable HDMA on the subscreen as well as the main screen.


The real question is, does it work in BSNES? Tongue
Piotyr
Guest
« Reply #9 on: April 09, 2007, 08:00:02 pm »

Quote from: Kitsune Sniper on April 09, 2007, 07:13:37 pm
Quote from: Gideon Zhi on April 09, 2007, 04:42:57 pm
S9X and ZSNES both.

As an edit, it appears that it IS disabling the scanlines on BG3, just not on BG1.

As another edit, I got it working. Needed to enable HDMA on the subscreen as well as the main screen.


The real question is, does it work in BSNES? Tongue

DUN DUN DUNNNNNNNNNNNNN!
Disch
Guest
« Reply #10 on: April 09, 2007, 08:19:09 pm »

Quote from: Kitsune Sniper on April 09, 2007, 07:13:37 pm
The real question is, does it work in BSNES? Tongue

The only question is:  Does it work on an SNES?

Behavior in emulators is irrelevent.  ;P
Kitsune Sniper
Guest
« Reply #11 on: April 09, 2007, 09:08:38 pm »

Quote from: Disch on April 09, 2007, 08:19:09 pm
Quote from: Kitsune Sniper on April 09, 2007, 07:13:37 pm
The real question is, does it work in BSNES? Tongue

The only question is:  Does it work on an SNES?

Behavior in emulators is irrelevent.  ;P

Irrelevant. Tongue

And BSNES is the closest you can get to a real SNES, so be quiet. Tongue
Piotyr
Guest
« Reply #12 on: April 09, 2007, 10:27:03 pm »

Quote from: Kitsune Sniper on April 09, 2007, 09:08:38 pm
Quote from: Disch on April 09, 2007, 08:19:09 pm
Quote from: Kitsune Sniper on April 09, 2007, 07:13:37 pm
The real question is, does it work in BSNES? Tongue

The only question is:  Does it work on an SNES?

Behavior in emulators is irrelevent.  ;P

Irrelevant. Tongue

And BSNES is the closest you can get to a real SNES, so be quiet. Tongue

Yeah basicly if it works in bsnes it works 90% of the time on a real snes.
Spikeman
Guest
« Reply #13 on: April 09, 2007, 10:28:59 pm »

I think BSNES is even more accurate than that, especially if you count don't sound. Byuu did a great job with it. Wink
Numonohi_Boi
Guest
« Reply #14 on: April 09, 2007, 10:35:14 pm »

I like what I'm seeing Gid, nice work. I can't wait for the next releases of ZSNES and bsnes. Won't they pretty much render most other SNES emulators obsolete? at least temporarily, besides SNESGT which still provides significantly more Satellaview Emulation.

but while SNES9x is great, does it have any features that the others won't have or do better in the next release?

same with Trac's work, I mean the guy is a genius, but I mean the ones I mentioned are the ones that are bringing the future, no?
Pages: [1] 2  


Powered by SMF 1.1.4 | SMF © 2006-2007, Simple Machines LLC