logo
 drop

Main

Community

Submissions

Help

86590066 visitors

Author Topic: Adding an intro to an SNES ROM  (Read 2828 times)

JCE3000GT

  • Sr. Member
  • ****
  • Posts: 302
  • Location: Little Elm, TX
  • SARS
    • View Profile
    • JCE3000GT.com
Adding an intro to an SNES ROM
« on: May 19, 2012, 11:17:41 pm »
Ok so I've downloaded the guide by DaMarsMan and followed it the best I could without success.  I want to add an intro to several of my rom hacks, some are lorom some are hirom.  I think the problem was with the intro.asm file but I'm not sure.  I've since deleted it out of frustration, haha, so its time to start over.    :banghead:

So does anyone have experience with adding intros that can give me a hand? 

henke37

  • Sr. Member
  • ****
  • Posts: 411
  • Location: Sweden
    • View Profile
Re: Adding an intro to an SNES ROM
« Reply #1 on: May 20, 2012, 11:39:35 am »
The theory is kinda simple, find some free space for your intro, add a jump to it from the beginning and then toss the idea in the rubbish bin.

Adding intros to anything is generally disliked. Just make a standalone demo release instead.

JCE3000GT

  • Sr. Member
  • ****
  • Posts: 302
  • Location: Little Elm, TX
  • SARS
    • View Profile
    • JCE3000GT.com
Re: Adding an intro to an SNES ROM
« Reply #2 on: May 20, 2012, 06:58:37 pm »
The theory is kinda simple, find some free space for your intro, add a jump to it from the beginning and then toss the idea in the rubbish bin.

Adding intros to anything is generally disliked. Just make a standalone demo release instead.

Your opinion aside...perhaps you misunderstand what I'm trying to do.  When you boot up some english translation rom hacks you find an intro screen usually with the group who worked on it, the title of the game and etc.  What's what I'm tying to add to my rom hacks.  Here is an example of one intro from a well-known rom hack:





*edit*
I've been able to get the assembly portion working but the graphic--not matter what it is--will not display correctly.  It comes up all garbled...

*edit 2*

Here's a copy of my intro.asm file.  The screen comes up either garbled or solid red depending on which graphic I try to use and it does allow you to press "A" to continue to the game and then the game loads perfectly. 

Code: [Select]
lorom

;table english.tbl,myTable


;this file made for xkas
;graphics start at 308000



;variable locations (these are lowrom addresses) (these addresses should match the ones on

the include below)

!CodeOffset = $10D000

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

!MapBank = #$32
!MapOffset = #$8000

!ColBank = #$32
!ColOffset = #$9000

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

org $148000
incbin introfiles/intro.map

org $168000
incbin introfiles/intro.col


;start of rom position, should be 00:FF00 if it's HiRom (use LunarAdress to tell which it

is)
org $000000
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
STX $4305
LDA #$01
STA $420B
JSR Jump1

;dma data information
;copy bottom half #$6000 in size
LDX !SetOffset
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
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
CLC
XCE
SEP #$30
STZ $4200
JMP.l $008005


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

Here's a copy of the first few lines of the trace from the original unmodified rom:

Code: [Select]
$00/8000 18          CLC                     A:0000 X:0000 Y:0000 P:EnvMXdIzc
$00/8001 FB          XCE                     A:0000 X:0000 Y:0000 P:EnvMXdIzc
$00/8002 20 47 82    JSR $8247  [$00:8247]   A:0000 X:0000 Y:0000 P:envMXdIzC
$00/8247 E2 30       SEP #$30                A:0000 X:0000 Y:0000 P:envMXdIzC
$00/8249 9C 00 42    STZ $4200  [$00:4200]   A:0000 X:0000 Y:0000 P:envMXdIzC
$00/824C A9 80       LDA #$80                A:0000 X:0000 Y:0000 P:envMXdIzC
$00/824E 8D 00 21    STA $2100  [$00:2100]   A:0080 X:0000 Y:0000 P:eNvMXdIzC
$00/8251 60          RTS                     A:0080 X:0000 Y:0000 P:eNvMXdIzC
$00/8005 22 00 80 0D JSL $0D8000[$0D:8000]   A:0080 X:0000 Y:0000 P:eNvMXdIzC
$0D/8000 4C 2C 80    JMP $802C  [$00:802C]   A:0080 X:0000 Y:0000 P:eNvMXdIzC
« Last Edit: May 20, 2012, 10:19:12 pm by JCE3000GT »

Gideon Zhi

  • IRC Staff
  • Hero Member
  • *****
  • Posts: 3131
  • Location: Seattle
    • View Profile
    • Aeon Genesis
Re: Adding an intro to an SNES ROM
« Reply #3 on: May 21, 2012, 02:11:49 pm »
Code: [Select]
!SetBank = #$30
!SetBank2 = #$31 ;should always be 1 more than SetBank1 (not sure if it's same with HiRom)
!SetOffset = #$8000

!MapBank = #$32
!MapOffset = #$8000

!ColBank = #$32
!ColOffset = #$9000

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

org $148000
incbin introfiles/intro.map

org $168000
incbin introfiles/intro.col

This is wrong. org commands are addressing-specific. You're sticking your graphics in LoROM banks 12, 14, and 16, but then you're looking at them in banks 30, 31, and 32.

JCE3000GT

  • Sr. Member
  • ****
  • Posts: 302
  • Location: Little Elm, TX
  • SARS
    • View Profile
    • JCE3000GT.com
Re: Adding an intro to an SNES ROM
« Reply #4 on: May 22, 2012, 12:53:06 am »
Code: [Select]
!SetBank = #$30
!SetBank2 = #$31 ;should always be 1 more than SetBank1 (not sure if it's same with HiRom)
!SetOffset = #$8000

!MapBank = #$32
!MapOffset = #$8000

!ColBank = #$32
!ColOffset = #$9000

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

org $148000
incbin introfiles/intro.map

org $168000
incbin introfiles/intro.col

This is wrong. org commands are addressing-specific. You're sticking your graphics in LoROM banks 12, 14, and 16, but then you're looking at them in banks 30, 31, and 32.

As always Gideon, thank you for your assistance.  I cannot believe I missed that!  Guess I was in too big of a hurry to change those from default.  You've always been one of my favorite fellow ROM hackers even back in the day on ZD.  :D  I got it working for the first game in question.   :beer:

Now, help me figure out why Star Fox doesn't even recognize that I've inserted an intro.   :laugh:  I'll keep at that one and post what I've got if I cannot figure it out. 

JCE3000GT

  • Sr. Member
  • ****
  • Posts: 302
  • Location: Little Elm, TX
  • SARS
    • View Profile
    • JCE3000GT.com
Re: Adding an intro to an SNES ROM
« Reply #5 on: May 30, 2012, 05:24:01 pm »
For those who are interested on what I was on about here is the first intro and the primary reason for me creating this topic. 

http://www.youtube.com/watch?v=6D_9GIUaQnY


Hiei-

  • Sr. Member
  • ****
  • Posts: 260
    • View Profile
Re: Adding an intro to an SNES ROM
« Reply #6 on: June 02, 2012, 08:33:50 pm »
Be careful, intros often prevent romhacks from working on the real hardware.

It might not be the case of this one, but the best is to test it.

JCE3000GT

  • Sr. Member
  • ****
  • Posts: 302
  • Location: Little Elm, TX
  • SARS
    • View Profile
    • JCE3000GT.com
Re: Adding an intro to an SNES ROM
« Reply #7 on: June 02, 2012, 11:35:19 pm »
Be careful, intros often prevent romhacks from working on the real hardware.

It might not be the case of this one, but the best is to test it.

Way ahead of you.  We are going to create a prototype to test it.   :thumbsup:

Gideon Zhi

  • IRC Staff
  • Hero Member
  • *****
  • Posts: 3131
  • Location: Seattle
    • View Profile
    • Aeon Genesis
Re: Adding an intro to an SNES ROM
« Reply #8 on: June 03, 2012, 12:47:55 am »
You could just try it on bsnes.

But if it's KingMike's code from the doc/utility/combo/whatever, I can basically guarantee that it works provided that you didn't make any major adjustments. It's the code I've been using for the Aeon Genesis intro for several years and probably over a dozen patches, and they all work on hardware.

JCE3000GT

  • Sr. Member
  • ****
  • Posts: 302
  • Location: Little Elm, TX
  • SARS
    • View Profile
    • JCE3000GT.com
Re: Adding an intro to an SNES ROM
« Reply #9 on: June 03, 2012, 01:43:55 am »
You could just try it on bsnes.

But if it's KingMike's code from the doc/utility/combo/whatever, I can basically guarantee that it works provided that you didn't make any major adjustments. It's the code I've been using for the Aeon Genesis intro for several years and probably over a dozen patches, and they all work on hardware.

Awesome.  I tested with BSNES and so far all the intro's load just fine.   :beer:

Now I do have two questions though, how do I make the intro screen use a mosaic intro/outtro versus just a fade? And when I change the fade speed it only affects the fade out and not the fade in. 


KingMike

  • Forum Moderator
  • Hero Member
  • *****
  • Posts: 4880
  • *sigh* A changed avatar. Big deal.
    • View Profile
Re: Adding an intro to an SNES ROM
« Reply #10 on: June 03, 2012, 12:34:52 pm »
You could just try it on bsnes.

But if it's KingMike's code from the doc/utility/combo/whatever, I can basically guarantee that it works provided that you didn't make any major adjustments. It's the code I've been using for the Aeon Genesis intro for several years and probably over a dozen patches, and they all work on hardware.

I don't remember writing an intro sample code... but, okay. :)
Quote
Sir Howard Stringer, chief executive of Sony, on Christmas sales of the PS3:
"It's a little fortuitous that the Wii is running out of hardware."

Gideon Zhi

  • IRC Staff
  • Hero Member
  • *****
  • Posts: 3131
  • Location: Seattle
    • View Profile
    • Aeon Genesis
Re: Adding an intro to an SNES ROM
« Reply #11 on: June 03, 2012, 02:16:43 pm »
Or DaMarsMan's or whoever's alright get off my back raaar

Hiei-

  • Sr. Member
  • ****
  • Posts: 260
    • View Profile
Re: Adding an intro to an SNES ROM
« Reply #12 on: June 08, 2012, 05:54:32 pm »
Way ahead of you.  We are going to create a prototype to test it.   :thumbsup:

Just for that ? If it's just to test the intro, you could also ask someone to test it for you. Probably lots of people here have the ability to test it (personally, I do).

JCE3000GT

  • Sr. Member
  • ****
  • Posts: 302
  • Location: Little Elm, TX
  • SARS
    • View Profile
    • JCE3000GT.com
Re: Adding an intro to an SNES ROM
« Reply #13 on: June 08, 2012, 11:41:09 pm »
Just for that ? If it's just to test the intro, you could also ask someone to test it for you. Probably lots of people here have the ability to test it (personally, I do).

The prototype cart will be created for more than just the intro.  I need to test all the SPC imports and data changes to ensure a smooth running cartridge since it will be reproduced and available for sale in the near future.