News: 11 March 2016 - Forum Rules
Current Moderators - DarkSol, KingMike, MathOnNapkins, Azkadellia, Danke

Author Topic: Tiny Toon Adventures (NES) Hack - Use Select in-level to cycle characters  (Read 4879 times)

defectivePrinceNaoto

  • Jr. Member
  • **
  • Posts: 5
    • View Profile
This is my first released NES rom hack.

This modification for Tiny Toon Adventures (NES) makes it so you can use SELECT to cycle through each of the 4 playable characters instead of just swapping between Buster and your chosen character when you pick up the star ball powerup. The order you cycle through them depends on who you choose as your helper, but picking Furball (the cat) should consistently work like so:

Buster --> Furball --> Dizzy --> Plucky --> Buster

For use with Tiny Toon Adventures (U) [!].nes

http://www30.zippyshare.com/v/3QbqL3hL/file.html

The next step of this hack will hopefully be a level editor.  The original game is nice (it was a perennial rental for me as a kid), but because the character switching is so arbitrary, the level design doesn't really ever take advantage of any of the characters' abilities.

mz

  • Sr. Member
  • ****
  • Posts: 434
  • Whore
    • View Profile
Sounds very interesting.

For level editing, you may want to try this utility: http://www.romhacking.net/utilities/967/
There has to be a better life.

dACE

  • Sr. Member
  • ****
  • Posts: 353
    • View Profile
Really neat - works fine in Fceux.

...BUT...the patched rom refuses to load in Nestopia - is this something you might want to look into?

Also, are you supposed to have to press select twice to do the actual switch?
The first time you press select - you get a preview of the character you will switch to - the next press triggers the actual switch.

Wouldn't it be faster/easier to only have to press select once?

Anyway - good work!

/dACE

defectivePrinceNaoto

  • Jr. Member
  • **
  • Posts: 5
    • View Profile
Thank you for trying it out!

Really neat - works fine in Fceux.

...BUT...the patched rom refuses to load in Nestopia - is this something you might want to look into?

Also, are you supposed to have to press select twice to do the actual switch?
The first time you press select - you get a preview of the character you will switch to - the next press triggers the actual switch.

Wouldn't it be faster/easier to only have to press select once?

Anyway - good work!

/dACE

Hrmm, I'll have to figure out a way around that. Since I'm working with limited space (from the end of their routine where they poll buttons to the vectors at $FFFA).  I may be able to find another empty space to work with though; this was just a decent chunk of unused data that was guaranteed to exist every time buttons were polled (this is a MMC3 cart, so PRG data swaps around a bit).  Because of what I was working with, I was just able to fit in the following method to switch around who you would swap to next:

* Load current player character ($002B; Buster = 00, Plucky = 01, Dizzy = 10, Furball = 11)
* Increment the value by $02
* AND that value with 11 (to strip off bits that would put it over $03)
* Store the new value back at $002B
* Run the routines that swap the character in $002B with the one in $002C

I need to look at it some more.  In the logic above, I didn't even have a free byte to clear the CARRY flag before adding $02 .. but I think I can clean things up a bit in case that is causing an issue.  Any way, this leads to unreliable behavior if you ..  I guess I could just remove the character select screen logic entirely and have it go right to the level.  Then I could use the extra space created there to do more proper logic, prevent SELECT from running the swap routines outside of levels (I just tested and it looks like this will either cause visual ), etc.,

I've only tested in FCEUX for Windows and NES.emu on Android.  I can check out Nestopia and see if I can find the issue there.  I guess it's possible I took out some init code that FCEUX automatically corrects?  I wonder if anyone is able to test this on a flash cart and see if it works there?

Something interesting to note is that they poll both controllers..  I'm going to have to see if P2's inputs are ever used, but I could overwrite that code to free up a few dozen bytes. I'm guessing it's probably just a standard 'check buttons' routine that Konami used around that time, but who knows -- maybe there's some dummied out content to find :)

Mz:  Thank you for the tip.  I checked out that editor, and I think I can use it to quickly set up new levels.  The objects (powerups and enemies) aren't documented, but I should be able to suss them out and create some docs for it.

KingMike

  • Forum Moderator
  • Hero Member
  • *****
  • Posts: 6885
  • *sigh* A changed avatar. Big deal.
    • View Profile
One problem is that you're writing to cart WRAM ($6000-7FFF) that the game doesn't technically have. Emulators will usually emulate WRAM whether a game actually has it or not (as it doesn't interfere with most games), but maybe Nestopia is stricter on it. (in NEStopia, choose Edit iNES header, look at the ROM, and then you'll notice PRG-RAM is set to "Disabled")
(although MMC3 I think can explicitly disable PRG-RAM, I didn't bother to check if the game does it)
You're writing your hack in the PRG bankswapping routine (so if Nestopia is accurately emulating no WRAM it's going to bankswap in junk after your routine)
"My watch says 30 chickens" Google, 2018

Dr. Floppy

  • Restricted Access
  • Hero Member
  • *
  • Posts: 972
  • Make America GREAT Again!
    • View Profile
    • BaddestHacks.net
Quote
Hrmm, I'll have to figure out a way around that. Since I'm working with limited space (from the end of their routine where they poll buttons to the vectors at $FFFA).

?

Joypad input is almost always reflected someplace within zero-page. The only thing at $FFFA-B is the address of the NMI Handler.

I just checked: Joypad #1 button presses are reflected at zp$F8. Held-button status is reflected at zp$FA. You'll be wanting to load the value at zp$F8 and check the status of d5. If set, branch to your routine.

defectivePrinceNaoto

  • Jr. Member
  • **
  • Posts: 5
    • View Profile
One problem is that you're writing to cart WRAM ($6000-7FFF) that the game doesn't technically have. Emulators will usually emulate WRAM whether a game actually has it or not (as it doesn't interfere with most games), but maybe Nestopia is stricter on it. (in NEStopia, choose Edit iNES header, look at the ROM, and then you'll notice PRG-RAM is set to "Disabled")
(although MMC3 I think can explicitly disable PRG-RAM, I didn't bother to check if the game does it)
You're writing your hack in the PRG bankswapping routine (so if Nestopia is accurately emulating no WRAM it's going to bankswap in junk after your routine)

Ah gotcha. I interpreted the docs to mean that all carts had WRAM, but that only battery backed carts kept what was written there after losing power. I'll try adjusting the header and see if that gets it working on Nestopia. Or I guess the better solution is to find a few free bytes elsewhere to store those flags instead.

?

Joypad input is almost always reflected someplace within zero-page. The only thing at $FFFA-B is the address of the NMI Handler.

I just checked: Joypad #1 button presses are reflected at zp$F8. Held-button status is reflected at zp$FA. You'll be wanting to load the value at zp$F8 and check the status of d5. If set, branch to your routine.

I meant to say that the controllers are read around $FFA0. Thank you for looking up those addresses for me. I'll rewrite to read those instead.

When I first started on this a couple weeks ago, I was just trying to get it to work. It's been fun/educational, but I've mostly just guessed and hacked away until I had something that fit and didn't crash. I appreciate you guys helping me learn better ways to accomplish this sort of thing.

Dr. Floppy

  • Restricted Access
  • Hero Member
  • *
  • Posts: 972
  • Make America GREAT Again!
    • View Profile
    • BaddestHacks.net
I'm bored, so:

Code: [Select]
A5 F8
29 20
D0 01
60      (this assumes you used a JSR command to jump to this routine)
A5 2B
18
69 01
29 03
85 2B
[However you want to go to that zp$2C handler stuff.]

There's a nice chunk of unused space at $1CD74-9F. It's in what appears to be the fixed bank, so there should be no need to worry about bankswapping.

Ti_

  • Jr. Member
  • **
  • Posts: 39
    • View Profile
Add somewhere in init code:
Code: [Select]
LDA #$80
STA $A001 ; MMC3 PRG-RAM Enable

After that $6000-$7FFF will work in Nestopia.

defectivePrinceNaoto

  • Jr. Member
  • **
  • Posts: 5
    • View Profile
Thank you for all of your help!  I will try implementing these into a new version of the patch and use the extra space to make the process of character switching more consistent.

By the way, is there a way to upload the patch to this site directly?  When I tried before, it was asking for a URL and would not accept something like a Zippyshare link.

mz

  • Sr. Member
  • ****
  • Posts: 434
  • Whore
    • View Profile
By the way, is there a way to upload the patch to this site directly?  When I tried before, it was asking for a URL and would not accept something like a Zippyshare link.
You can try uploading it here before submitting it: http://www.romhacking.net/scratchpad/
There has to be a better life.

sics

  • Full Member
  • ***
  • Posts: 199
  • Contact me!
    • View Profile
    • Deviantart: Terwilf
 Además algunos usuarios también utilizan Ze Bucket para imágenes, archivos y otras cosas que no cumplen con los requisitos de Scratchpad;)

Midna

  • Hero Member
  • *****
  • Posts: 703
  • Resident Panel de Pon Nut
    • View Profile
Además algunos usuarios también utilizan Ze Bucket para imágenes, archivos y otras cosas que no cumplen con los requisitos de Scratchpad;)

¡Hola! Comprendo que español es tu primer idioma, pero parece que el creador de esta tema no lo habla, así que debes probablemente hablar (¿o escribir?) en inglés si no es demasiado de un problema. ¡Gracias! : )

mz

  • Sr. Member
  • ****
  • Posts: 434
  • Whore
    • View Profile
Midna, I'm pretty sure that sics can read English, or he wouldn't have replied that, so there's no need to keep using Spanish.

Anyway, here's a rough translation of what he said:
Quote
Furthermore, some users also use Ze Bucket for images, files and other things that don't meet the Scratchpad's requirements.
There has to be a better life.

sics

  • Full Member
  • ***
  • Posts: 199
  • Contact me!
    • View Profile
    • Deviantart: Terwilf
El que no es capaz de hablar ingles soy yo, gracias de todas formas.  :-\

PresidentLeever

  • Hero Member
  • *****
  • Posts: 625
    • View Profile
    • Mini-Revver
Nice, looking forward to the updated version.
Mini-reviews, retro sound chip tribute, romhacks and general listage at my site: Mini-Revver.

defectivePrinceNaoto

  • Jr. Member
  • **
  • Posts: 5
    • View Profile
Just wanted to give an updated.  The patch should work in Nestopia now, thanks to the init code that was provided by Ti_.

I also have character swapping working correctly in a linear fashion.  However, this gets thrown off if you collect one of the swapping powerups. I'm either going to have to hack in something with the swap code to disallow swaps not initiated by pressing SELECT, or change the level loading code so that that powerup is not spawned.  The former is pretty simple to do and should be dependable, but I'd really like to tackle the latter if I can figure it out in a reasonable amount of time.

Anyway, here's the current version of the patch.  It should work on Nestopia, and if you select Plucky (the duck) as your partner then SELECT will cycle through characters as intended until you pick up a swapping powerup.  Thank you again for all of your feedback and help!:

http://www68.zippyshare.com/v/TU0RZVKz/file.html

PresidentLeever

  • Hero Member
  • *****
  • Posts: 625
    • View Profile
    • Mini-Revver
I picked plucky and swapping works fine but the UI shows a different character than the one that's being selected.

There's also a taller platform than usual in the first screen of the first level (so you need to use the cat) so maybe I got the wrong rom though?
Size is 262 160 bytes before patching.

Removing the select power up sounds nice, but aren't they used as a semi-hidden reward in some levels? Would be kind of a bummer to have nothing in those spots.
« Last Edit: May 06, 2015, 07:33:15 am by PresidentLeever »
Mini-reviews, retro sound chip tribute, romhacks and general listage at my site: Mini-Revver.

Maeson

  • Sr. Member
  • ****
  • Posts: 278
    • View Profile
The UI should show you what character will be next as you press Select, not the one that you're using at that moment.

About the platform/wall thing... Yeah, I see it too.

The idea of the patch is great, though, it will make the game more fun overall!
I'm off for some time. If for some weird, strange, and important reason, you need to talk to me, just send me a PM and probably I'll read it whenever I come back.