Balloon Fight hack - Would this actually work on hardware?

Are you new to 6502, NES, or even programming in general? Post any of your questions here. Remember - the only dumb question is the question that remains unasked.

Moderator: Moderators

mikaelmoizt
Posts: 120
Joined: Sat Apr 12, 2014 12:11 pm
Location: Gothenburg, Sweden

Balloon Fight hack - Would this actually work on hardware?

Post by mikaelmoizt »

I am really getting deep into this interesting world of NES coding and hacking. The only downside is that I would like to try my hacks on real hardware, not just emulation, but lack any kind of equipment and/or knowledge to do so. Since these are all new things for me, please excuse my extreme n00bism.

So I made a hack for Balloon Fight (JU) where you can play a 2-player trip game.
The original rom is a NROM-128 16k which I made into NROM-256 by adding a new iNES header, and then reorienting code to work like the original game.
Too many small details to explain, please take a look at my code if you like. Assembles with ASM6, Balloon Fight (JU) rom is needed. IPS ready to go.

Maybe you like to try it out? Does it work? :wink:
Attachments
ballonfighthack-0.png
ballonfighthack-0.png (2.58 KiB) Viewed 9107 times
ballonfighthack.ips
(23 KiB) Downloaded 414 times
ballonfighthack.asm
(6.43 KiB) Downloaded 330 times
I´ve got %01100011 problems but the BITs aint one.
User avatar
NovaSquirrel
Posts: 500
Joined: Fri Feb 27, 2009 2:35 pm
Location: Fort Wayne, Indiana
Contact:

Re: Balloon Fight hack - Would this actually work on hardwar

Post by NovaSquirrel »

Tried it on my PowerPak. It works for the most part, but pressing the reset button locks the game up on a black screen. Also, the menu seems to have a 5th position? Picking it just seems to start a 1-player Balloon Trip game.

Edit: The reset problem happens with the vanilla unpatched Balloon Fight too, so not your fault.
User avatar
Vectrex2809
Posts: 102
Joined: Mon Jul 14, 2014 6:05 am
Location: Tokyo, Japan

Re: Balloon Fight hack - Would this actually work on hardwar

Post by Vectrex2809 »

Ooooh! Love me some Balloon Fight. Gotta check it out. However, I don't have a PowerPak so I can't help (Even though I'd like to), but trust me, it can be a pain to debug your stuff on real hardware.
User avatar
Gilbert
Posts: 577
Joined: Sun Dec 12, 2010 10:27 pm
Location: Hong Kong
Contact:

Re: Balloon Fight hack - Would this actually work on hardwar

Post by Gilbert »

I actually misread the title as Balloon Fight back.

I think it sounds awesome to have a parody or hack of this game called Balloons Fight Back or Balloon Fights back. :lol:
mikaelmoizt
Posts: 120
Joined: Sat Apr 12, 2014 12:11 pm
Location: Gothenburg, Sweden

Re: Balloon Fight hack - Would this actually work on hardwar

Post by mikaelmoizt »

NovaSquirrel wrote:Tried it on my PowerPak. It works for the most part, but pressing the reset button locks the game up on a black screen. Also, the menu seems to have a 5th position? Picking it just seems to start a 1-player Balloon Trip game.

Edit: The reset problem happens with the vanilla unpatched Balloon Fight too, so not your fault.
Thanks for trying it out. Yeah, the fifth option is intentional - adding yet another mode for someone to add what ever functions into the game. More than 15k of nop's in upper bank, that is a lot to play around with 8-)
I´ve got %01100011 problems but the BITs aint one.
tepples
Posts: 22796
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Re: Balloon Fight hack - Would this actually work on hardwar

Post by tepples »

You could always do a CHR RAM conversion, with or without tile compression. This way you can replace tiles as you need them in case you need more background detail. (But then BF has a bunch of unused tiles anyway.)
mikaelmoizt
Posts: 120
Joined: Sat Apr 12, 2014 12:11 pm
Location: Gothenburg, Sweden

Re: Balloon Fight hack - Would this actually work on hardwar

Post by mikaelmoizt »

tepples wrote:You could always do a CHR RAM conversion, with or without tile compression. This way you can replace tiles as you need them in case you need more background detail. (But then BF has a bunch of unused tiles anyway.)
For educational purposes, I will look into this. If I understand this correct, you are referring to a BNROM hack?
I´ve got %01100011 problems but the BITs aint one.
tepples
Posts: 22796
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Re: Balloon Fight hack - Would this actually work on hardwar

Post by tepples »

It could be interpreted as BNROM or as NROM-256 rewired to take a 6264. Either way, the same board RHDE uses.
User avatar
Dwedit
Posts: 5021
Joined: Fri Nov 19, 2004 7:35 pm
Contact:

Re: Balloon Fight hack - Would this actually work on hardwar

Post by Dwedit »

I noticed that in two-player balloon trip, the game immediately ends if the first player dies, but it doesn't matter how well the second player is doing. Also, the second player starts out very low, and player 2's score does not display. And bad things happening to either player kill the music.
Here come the fortune cookies! Here come the fortune cookies! They're wearing paper hats!
mikaelmoizt
Posts: 120
Joined: Sat Apr 12, 2014 12:11 pm
Location: Gothenburg, Sweden

Re: Balloon Fight hack - Would this actually work on hardwar

Post by mikaelmoizt »

Dwedit wrote:I noticed that in two-player balloon trip, the game immediately ends if the first player dies, but it doesn't matter how well the second player is doing. Also, the second player starts out very low, and player 2's score does not display. And bad things happening to either player kill the music.
Ah. Well, right now the two player trip mode is just a result of number of players set to "2" and game mode to "trip", so I am not surprised there are some things not working correctly.
I haven't yet added anything to support the 2 player mode, just the possibility to select it and play. So there are some work to do apparently.

Thanks for trying it out 8-)
I´ve got %01100011 problems but the BITs aint one.
tepples
Posts: 22796
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Re: Balloon Fight hack - Would this actually work on hardwar

Post by tepples »

Is there a way to expand the ROM without making the IPS so big? In ca65 there's a way to .incbin a portion of a file, and I use that in my Solar Wars UNROM hack to insert 32K of blank space before the existing PRG ROM. You appear to do the same thing in the asm6 source of your hack. Or if you know the user is overwhelmingly likely to have Python installed, such as on Linux, you could write a Python script that inserts 16384 bytes at offset $0010 in the file, putting everything in the right place for the IPS to line up properly. Even dd, which is present in most UNIX-like operating systems, could be used for this. But not everyone who wants to try this has ca65, ASM6, dd, or Python installed to expand the ROM before applying the IPS, especially on Windows.
JRoatch
Formerly 43110
Posts: 423
Joined: Wed Feb 05, 2014 7:01 am
Contact:

Re: Balloon Fight hack - Would this actually work on hardwar

Post by JRoatch »

I'm guessing if the expanded blank space is at the end of the ROM then the IPS would result in a series of RLE block.

Otherwise if the patch involves moving ranges of data around even by 1 byte, a format like vcdiff is much more suited. For example, a vcdiff patch of your UNROM hack is about 16K. xdelta 3 is a popular tool for vcdiff.
tepples
Posts: 22796
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Re: Balloon Fight hack - Would this actually work on hardwar

Post by tepples »

Because of the memory layout of Balloon Fight, the empty space has to be at the beginning. In fact, most expansion patches for NES games will require insertion of blank space at the beginning because of the demands of XIP ROM on a 6502.

Dwedit suggested the xdelta UI (.vcdiff) and beat (.bps) tools, which appear to support rearrangement. But I don't think most emulators that can apply IPS on the fly can apply those. But it's still better than an IPS file that contains effectively the entire ROM.

So can we get a vcdiff for this patch?
mikaelmoizt
Posts: 120
Joined: Sat Apr 12, 2014 12:11 pm
Location: Gothenburg, Sweden

Re: Balloon Fight hack - Would this actually work on hardwar

Post by mikaelmoizt »

tepples wrote:Is there a way to expand the ROM without making the IPS so big?
Perhaps.
As far as I understand

Code: Select all

incbin "16kgame.nes"
Includes entire game with first 16 bytes header, will mirror $8000-$bfff and $c000-$ffff - working just fine

Code: Select all

incbin "16kgame.nes",$10
Skips header so you need to write it yourself. However -

Code: Select all

(ines header with 2xprg)
org $c000 ; or base $c000
incbin "16kgame.nes",$10


Will not work. Stuck at $8000.

Since reorienting the 16k of code into upper bank, ofcourse, will cause (almost) every instruction working in absolute mode to be wrong, you somehow have to fill the space down to lower bank to get the correct address OR change (almost) every absolute mode instruction in the game to fit upper bank orientation.. :roll:
With that method the ips would be 1 byte + changes in addresses I guess?
I´ve got %01100011 problems but the BITs aint one.
mikaelmoizt
Posts: 120
Joined: Sat Apr 12, 2014 12:11 pm
Location: Gothenburg, Sweden

Re: Balloon Fight hack - Would this actually work on hardwar

Post by mikaelmoizt »

(xdelta extension not allowed for upload.. rename my file)

So..
What.. the.. 278 bytes?!
Attachments
balloonfight.txt
(278 Bytes) Downloaded 305 times
I´ve got %01100011 problems but the BITs aint one.
Post Reply