+  RHDN Forum Archive
|-+  Romhacking
| |-+  ROM Hacking Discussion
| | |-+  A Few Questions with FF6
Pages: [1]
Author Topic: A Few Questions with FF6  (Read 2 times)
The Tuxedo
Guest
« on: March 14, 2009, 02:17:17 am »

Hey there. I recently just started hacking FF6. I've downloaded quite a few utilities as well as the text tables. Anyway, I have a few quetions. But before I ask, I suppose I should give a little bit of background.
I have hacked some games before, but they were all for the GBA (Fire Emblem, Pokemon, etc.). I don't think I'll be that slow picking up on some of the terms. I'm familiar with pointers and such, though this HiROM LoROM stuff might mix me up a bit compared to the GBA pointers.


The first question has to do with the text pointers. I've read this, but I'm starting to think that the pointers in FF6 aren't the same. The text starts at 0xD0200, which I believe is 0xCD0000 in HiROM. We reverse that to 0000CD. I search for it, but I find that there are 16 of them. I just replace them all (I just switch it with another text pointer (at 0xD02A0)), but when I play the game the text is exactly the same as the original. Are the pointers in FF6 different? Sorry if I'm a little slow with the SNES.

The second question has to do with inserting a title screen. I looked at this as well as this, but to no avail. If Lenophis is reading this, would you mind posting the file you posted in this topic? I attempted to do it myself before using that file, but when I did it, the ROM somehow gets corrupted. When I start SNES9x it says that it is now LoROM. I have no idea how that happens. Same thing occurs when I use the one posted in that topic. I have worked slightly with ASM on the GBA if that means anything, but not enough where I can write my own code. Mostly just debugging the old code and deciphering it.

Thanks in advance to anyone who assists me. I really appreciate it.
Lenophis
Guest
« Reply #1 on: March 14, 2009, 02:55:12 am »

Quote from: The Tuxedo on March 14, 2009, 02:17:17 am
The first question has to do with the text pointers. I've read this, but I'm starting to think that the pointers in FF6 aren't the same.
There's three sets of pointers, one for each of the three different sets of the text. One block is for the dialogue (at CC/E602, which is at 0x0CE602 in the rom, add 0x200 if there is a header), another block for the battle dialogue (at D0/D000, which is at 0x10D000 in the rom, add 0x200 if there is a header), and the last block for battle events (at D1/F000, pointers at D1/F7A0, which is at 0x11F000 in the rom, add 0x200 if there is a header). To know if you have a header, go the to beginning of the rom. There should be a large block of a lot of 0's. If so, header. Alternatively, if you can edit your rom with FF3usME, then you have a header since it depends on having one.

Quote
The second question has to do with inserting a title screen. I looked at this as well as this, but to no avail. If Lenophis is reading this, would you mind posting the file you posted in this topic?
I suppose I can.

Code:
hirom


;variable locations

!CodeOffset = $F10000

!SetBank = #$F2
!SetBank2 = #$F2 ;should always be 1 more than SetBank1 (not sure if it's same with HiRom)
!SetOffset = #$0000
!SetOffset2 = #$8000

!MapBank = #$F4
!MapOffset = #$0000

!ColBank = #$F5
!ColOffset = #$0000

;includes for intro
org $F20000
incbin introfiles/intro.set

org $F40000
incbin introfiles/intro.map

org $F50000
incbin introfiles/intro.col


;start of rom position, should be 00:FF00 if it's HiRom (use LunarAdress to tell which it is)
org $C00019
JMP !CodeOffset
NOP

;start initialization
org !CodeOffset
SEI
CLC
XCE
SEP #$30
PHB
LDA #$00
PHA
PLB
LDA #$80
STA $2100
LDA #$00
STA $2101
STA $2102
STA $2103
STA $2105
STA $2106
STA $2107
STA $2108
STA $2109
STA $210A
STA $210B
STA $210C
STA $210D
STA $210D
STA $210E
STA $210E
STA $210F
STA $210F
STA $2110
STA $2110
STA $2111
STA $2111
STA $2112
STA $2112
STA $2113
STA $2113
STA $2114
STA $2114

LDA #$80
STA $2115
LDA #$00
STA $2116
STA $2117
STA $211A
STA $211B
LDA #$01
STA $211B
LDA #$00
STA $211C
STA $211C
STA $211D
STA $211D
STA $211E
LDA #$01
STA $211E
LDA #$00
STA $211F
STA $211F
STA $2120
STA $2120
STA $2121
STA $2123
STA $2124
STA $2125
STA $2126
STA $2127
STA $2128
STA $2129
STA $212A
STA $212B
LDA #$01
STA $212C
LDA #$00
STA $212D
STA $212E
STA $212F
LDA #$30
STA $2130
LDA #$00
STA $2131
LDA #$E0
STA $2132
LDA #$00
STA $2133
LDA #$01 ;auto read joypads
;LDA #$81
STA $4200
LDA #$FF
STA $4201
LDA #$00
STA $4202
STA $4203
STA $4204
STA $4205
STA $4206
STA $4207
STA $4208
STA $4209
STA $420A
STA $420B
STA $420C
STA $420D
REP #$30
SEP #$20
LDA #$03
STA $2105
LDA #$01
STA $212C
LDA #$00
STA $2107
LDA #$01
STA $210B
;JSR $2201
JSR Jump1

;DMA color stuff
LDX #$8000
STX $2116
LDX #$1801
STX $4300
LDX !MapOffset
STX $4302
LDA !MapBank
STA $4304
LDX #$0C00
STX $4305
LDA #$01
STA $420B
LDA #$00
STA $2121
LDX #$2200
STX $4300
LDX !ColOffset
STX $4302
LDA !ColBank
STA $4304
LDX #$0200 ;512 colors
STX $4305
LDA #$01
STA $420B
JSR Jump1


;dma data information for set
;copy first half #$8000
LDX #$1000
STX $2116
LDX #$1801
STX $4300
LDX !SetOffset
STX $4302
LDA !SetBank
STA $4304
LDX #$8000 ;dma transfer size
STX $4305
LDA #$01
STA $420B
JSR Jump1

;dma data information
;copy bottom half #$6000 in size
LDX !SetOffset2
STX $4302
LDA !SetBank2
STA $4304
LDX #$6000
STX $4305
LDA #$01
STA $420B
Jump9:
STA $2100
INA
JSR Jump2

CMP #$10
BCC Jump9

FadeRoutine()
{
CLI
LDX #$0030

Jump3:
SEP #$20
LDY #$FFFF

Jump4:
DEY
BNE Jump4

Jump5:
;LDA $4210
LDA $4212
AND #$80
BEQ Jump5

Jump6:
LDA $4212 ;check vblank
AND #$01
BNE Jump6

REP #$20
LDA $4218
AND #$F0F0 ;check for A, B, X, Y, L, R, start, and select
BNE Jump7
DEX

;Get key press or not
;BNE Jump3 ;don't wait for keypress
BRA Jump3 ;wait for keypress

Jump7:
SEP #$20
LDA $4210
AND #$80
BEQ Jump7
LDA #$0F

Jump10:
STA $2100
DEC A
PHA
JSR Jump2
}



PLA
CMP #$00
BNE Jump10


LDX #$0000

;old code from beginning of unchanged rom
SEI
CLC
XCE
SEP #$20
JMP.l $C0001E


Jump1:
PHA
Jump11:
LDA $4210
AND #$80
BEQ Jump11
PLA
RTS


Jump2:
LDY #$FFFF
Jump8:
DEY
BNE Jump8
RTS



vblank:
pha
php
sep #$20


; lda #$81 ; enable temp NMI
; sta.l $4200

Vloop:
lda.l $4210
and #$80
beq Vloop

; lda #$01 ; disable again
; sta.l $4200

plp
pla
rts

This includes the VRAM fix.

Quote
I attempted to do it myself before using that file, but when I did it, the ROM somehow gets corrupted. When I start SNES9x it says that it is now LoROM.
Likely because of that lorom tag code to jump to LoROM locations in the file you used. You will need a fresh rom though, unless you feel like scouring through what xkas overwrote just so you could get back to where you were. Also, make sure you know if your rom has a header or not, and if it does, add that header tag next to hirom so you don't have the same problem Zeemis did.

* Lenophis feels slightly wigged out
The Tuxedo
Guest
« Reply #2 on: March 14, 2009, 01:01:42 pm »

Thanks Lenophis. The text information helps a lot. The pointers are only 2 bytes. I guess I didn't find it since I was searching for 3 and 4 byte pointers the whole time.

However, the intro thing still doesn't work. I use a clean ROM to apply the asm, but the ROM still becomes a corrupt LoROM (according to SNES9x anyway). I don't understand HiROM and LoROM enough to be able to look through the code and tell what's wrong. Would the image data somehow be making it a LoROM?
It's not that big a deal at the moment though. I'm mainly just messing with the data to see what the possibilities and limitations are before I start making a hack. Thanks for the help though. I appreciate it.
Lenophis
Guest
« Reply #3 on: March 14, 2009, 04:18:07 pm »

It's possible that the rom needs to be expanded before using this intro. Use Lunar Expand or a hex editor to add 0x10000 more bytes to the rom. The end of the rom will either be at offset 0x300200 or 0x300000 (0x300200 will be true if you have a header). Expand to 0x400200 or 0x400000, then use the intro.
The Tuxedo
Guest
« Reply #4 on: March 14, 2009, 05:55:26 pm »

Well, I decided to take a look at the ROM in a hex editor. It turns out that the ROM is made almost entirely of 00s. That doesn't look right...
Is there something wrong with the code? Am I doing something wrong when compiling it? I'll double check once more I suppose.

EDIT: Nevermind. I got it working. I didn't realize you had to have the rom named rom.smc. *facepalm* Thanks for you help though. If I have any other questions, I'll come back.
« Last Edit: March 15, 2009, 12:54:38 am by The Tuxedo »
Lenophis
Guest
« Reply #5 on: March 15, 2009, 12:57:56 am »

Nice to know you got it working.

Quote from: The Tuxedo on March 14, 2009, 05:55:26 pm
If I have any other questions, I'll come back.
I'll answer if I'm able.
Pages: [1]  


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