Romhacking.net

Romhacking => ROM Hacking Discussion => Topic started by: defectivePrinceNaoto on April 30, 2015, 10:35:46 am

Title: Tiny Toon Adventures (NES) Hack - Use Select in-level to cycle characters
Post by: defectivePrinceNaoto on April 30, 2015, 10:35:46 am
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.
Title: Re: Tiny Toon Adventures (NES) Hack - Use Select in-level to cycle characters
Post by: mz on April 30, 2015, 12:13:36 pm
Sounds very interesting.

For level editing, you may want to try this utility: http://www.romhacking.net/utilities/967/
Title: Re: Tiny Toon Adventures (NES) Hack - Use Select in-level to cycle characters
Post by: dACE on April 30, 2015, 05:13:15 pm
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
Title: Re: Tiny Toon Adventures (NES) Hack - Use Select in-level to cycle characters
Post by: defectivePrinceNaoto on April 30, 2015, 05:43:28 pm
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.
Title: Re: Tiny Toon Adventures (NES) Hack - Use Select in-level to cycle characters
Post by: KingMike on April 30, 2015, 06:25:57 pm
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)
Title: Re: Tiny Toon Adventures (NES) Hack - Use Select in-level to cycle characters
Post by: Dr. Floppy on April 30, 2015, 08:33:58 pm
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.
Title: Re: Tiny Toon Adventures (NES) Hack - Use Select in-level to cycle characters
Post by: defectivePrinceNaoto on April 30, 2015, 10:39:17 pm
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.
Title: Re: Tiny Toon Adventures (NES) Hack - Use Select in-level to cycle characters
Post by: Dr. Floppy on May 01, 2015, 01:02:22 am
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.
Title: Re: Tiny Toon Adventures (NES) Hack - Use Select in-level to cycle characters
Post by: Ti_ on May 01, 2015, 02:53:41 am
Add somewhere in init code:
Code: [Select]
LDA #$80
STA $A001 ; MMC3 PRG-RAM Enable

After that $6000-$7FFF will work in Nestopia.
Title: Re: Tiny Toon Adventures (NES) Hack - Use Select in-level to cycle characters
Post by: defectivePrinceNaoto on May 01, 2015, 12:26:47 pm
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.
Title: Re: Tiny Toon Adventures (NES) Hack - Use Select in-level to cycle characters
Post by: mz on May 01, 2015, 01:41:05 pm
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/
Title: Re: Tiny Toon Adventures (NES) Hack - Use Select in-level to cycle characters
Post by: sics on May 02, 2015, 11:06:50 am
 Además algunos usuarios también utilizan Ze Bucket (http://www.bwass.org/bucket/) para imágenes, archivos y otras cosas que no cumplen con los requisitos de Scratchpad (http://www.romhacking.net/scratchpad/).  ;)
Title: Re: Tiny Toon Adventures (NES) Hack - Use Select in-level to cycle characters
Post by: Midna on May 02, 2015, 11:25:24 am
Además algunos usuarios también utilizan Ze Bucket (http://www.bwass.org/bucket/) para imágenes, archivos y otras cosas que no cumplen con los requisitos de Scratchpad (http://www.romhacking.net/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! : )
Title: Re: Tiny Toon Adventures (NES) Hack - Use Select in-level to cycle characters
Post by: mz on May 02, 2015, 11:33:55 am
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 (http://www.bwass.org/bucket/) for images, files and other things that don't meet the Scratchpad (http://www.romhacking.net/scratchpad/)'s requirements.
Title: Re: Tiny Toon Adventures (NES) Hack - Use Select in-level to cycle characters
Post by: sics on May 03, 2015, 12:23:30 am
El que no es capaz de hablar ingles soy yo, gracias de todas formas.  :-\
Title: Re: Tiny Toon Adventures (NES) Hack - Use Select in-level to cycle characters
Post by: PresidentLeever on May 04, 2015, 12:41:05 pm
Nice, looking forward to the updated version.
Title: Re: Tiny Toon Adventures (NES) Hack - Use Select in-level to cycle characters
Post by: defectivePrinceNaoto on May 05, 2015, 10:36:14 am
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
Title: Re: Tiny Toon Adventures (NES) Hack - Use Select in-level to cycle characters
Post by: PresidentLeever on May 06, 2015, 07:28:12 am
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.
Title: Re: Tiny Toon Adventures (NES) Hack - Use Select in-level to cycle characters
Post by: Maeson on May 06, 2015, 05:49:13 pm
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!
Title: Re: Tiny Toon Adventures (NES) Hack - Use Select in-level to cycle characters
Post by: pangenttech on October 28, 2020, 01:24:01 am
 Has anyone still got this hack, or could recreate it?
Title: Re: Tiny Toon Adventures (NES) Hack - Use Select in-level to cycle characters
Post by: bogaabogaa on November 01, 2020, 07:30:04 am
I recreated it and do provide the source file so you can patch from ASM or do more changes.

I provide a IPS too. The characters rotate but the preview shows the wrong companion. Sure this could be done more clean but it works and you can play as what character you like any time.

(Deleted since there is a release)

Database match: Tiny Toon Adventures (USA)
Database: No-Intro: Nintendo Entertainment System (v. 20180803-121122)
File SHA-1: 110796622E50C2E8C20B1430ACADC5BAE5F36586
File CRC32: B34ED396
ROM SHA-1: 3C011E4EA5EB7E93299347F8009E5BDF51E223EB
ROM CRC32: 99DDDB04

(https://i.imgur.com/HWZrmpX.png)
Title: Re: Tiny Toon Adventures (NES) Hack - Use Select in-level to cycle characters
Post by: pangenttech on November 02, 2020, 01:49:02 am
Thank you! I'm hoping to use it for this hack, which relies heavily on the cat character rather than Buster.

http://www.romhacking.net/hacks/5498/

I discussed this a bit here.

http://www.romhacking.net/forum/index.php?topic=31669.msg403075#msg403075
Title: Re: Tiny Toon Adventures (NES) Hack - Use Select in-level to cycle characters
Post by: bogaabogaa on November 03, 2020, 08:54:49 am
My version of the toon switcher can be found here. I released the patch here: http://www.romhacking.net/hacks/5503/
It works well for the level hack too  ;)