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

Author Topic: Mario Land Colour hack is done  (Read 18690 times)

Drakon

  • Sr. Member
  • ****
  • Posts: 277
    • View Profile
    • 16 Bit Gamer
Mario Land Colour hack is done
« on: February 14, 2013, 08:22:03 pm »
http://www.youtube.com/watch?v=G4nWpx8WpIE

Here's the patch:

http://www.mediafire.com/?hh8682trdyeiey1



(NOTE: Development and "finished" topic merged by mod.)

Marioland 1 new gfx colorized patch running on a real gameboy in full colour:



http://www.youtube.com/watch?v=an3I6Tt0zE4&feature=youtu.be

*patch in a later post*

It crashes at the end of a stage.  I can make it stop crashing but then the tiles aren't drawn with the right pallettes.  I changed the asm a bit to make the rom go from being 1 megabyte down to a comfy 128k.  I also changed some asm programming to make it display colours properly.  I used the bgb emulator / debugger to work on this rom learning many things from people in #gbdev.  I don't have the skill to fix this crashing bug.  I was hoping someone here might be able to help.
« Last Edit: June 19, 2013, 08:33:36 am by Drakon »

MathUser2929

  • Hero Member
  • *****
  • Posts: 1544
    • View Profile
Re: Mario Land Colour hack is done
« Reply #1 on: February 15, 2013, 10:19:45 am »
If you do get this fixed provide a link so the patch can be submitted to the site.

ChronoMoogle

  • Sr. Member
  • ****
  • Posts: 358
  • Super Famicom all the way.
    • View Profile
    • SNESfreaks
Re: Mario Land Colour hack is done
« Reply #2 on: February 15, 2013, 10:47:06 am »
Nice hack! Has this also been programmed to work on GBC?

Zoinkity

  • Hero Member
  • *****
  • Posts: 562
    • View Profile
Re: Mario Land Colour hack is done
« Reply #3 on: February 15, 2013, 10:55:16 am »
If I may ask, what colorizer model are you using?  Did you go dedicated CGB or one of the dual mode models?

Was that memory corruption at the top of the screen near the end of the stage?  Also, does the crash bug at the end of the stage apply to other stages as well?  If a glitch in the bonus stage can be ruled out that would simplify things.

MathUser2929

  • Hero Member
  • *****
  • Posts: 1544
    • View Profile
Re: Mario Land Colour hack is done
« Reply #4 on: February 15, 2013, 12:23:17 pm »
I made that hack. I used one of the later versions of GB Colorizer to make it. It colored alot of tiles wrong so I had to redraw them to use different colors, or redraw the sprites compeltely.

Drakon

  • Sr. Member
  • ****
  • Posts: 277
    • View Profile
    • 16 Bit Gamer
Re: Mario Land Colour hack is done
« Reply #5 on: February 15, 2013, 02:20:18 pm »
Nice hack! Has this also been programmed to work on GBC?

Yes it's running as a gbc game on my gba, you can see in the video it's loading the gbc bios.

If I may ask, what colorizer model are you using?  Did you go dedicated CGB or one of the dual mode models?

Was that memory corruption at the top of the screen near the end of the stage?  Also, does the crash bug at the end of the stage apply to other stages as well?  If a glitch in the bonus stage can be ruled out that would simplify things.

Like mathuser says he used the colorizer.  I set the rom header for it to run as a dedicated cgb.  The corruption seems to be caused by poorly written colorization code.

This rom wouldn't run at all until I moved the code from 1mbyte down to to 128k.  It was using some mbc1 specific instructions that weren't working on the real thing so that took some a little reprogramming.

The issue with the colorizer code is that it relies on emulator only exploits which don't work the same on the real hardware.  The colorizer code relies on being able to constantly access the vram (video ram) at any time you want, you can't do this on the real thing but you can do in emulators.  Download the mathuser patch and run it in the bgb emulator with inaccessible vram set to "emulate as in reality" to see how it looks on the the real thing.  With the help of DuoDream I added programming that waits for video ram access before drawing things which fixes the drawing on the real machine but that's also what causes the game to crash.
« Last Edit: February 15, 2013, 02:44:35 pm by Drakon »

Spikeman

  • Hero Member
  • *****
  • Posts: 1063
  • *unce unce unce*
    • View Profile
    • None at the moment, check out my Last.fm page instead?
Re: Mario Land Colour hack is done
« Reply #6 on: February 19, 2013, 02:27:12 am »
So wait, does the bug also occur in BGB? If so, it's just a matter of doing some debugging and seeing what's going on. My instinct is that it has to do with some of the code you added that runs during vblank, for example if you switch banks during the vblank interrupt, the code will return to the wrong spot and cause a crash.

Edit: Btw, the mediafire download is broken. If the bug occurs in BGB and you reupload the patch I can take a look.
Open Source Hacking Projects: Guru Logic Champ, Telefang 2, (Want more? Check out my GitHub!)

Drakon

  • Sr. Member
  • ****
  • Posts: 277
    • View Profile
    • 16 Bit Gamer
Re: Mario Land Colour hack is done
« Reply #7 on: February 19, 2013, 10:03:30 pm »
So wait, does the bug also occur in BGB? If so, it's just a matter of doing some debugging and seeing what's going on. My instinct is that it has to do with some of the code you added that runs during vblank, for example if you switch banks during the vblank interrupt, the code will return to the wrong spot and cause a crash.

Edit: Btw, the mediafire download is broken. If the bug occurs in BGB and you reupload the patch I can take a look.

Yes it happens in bgb.  Here's the rom:

ROM link removed by a mod.
Please create a patch.

Thanks for the tip about switching banks during vblank I wasn't aware of that bug.  Are you saying I should program it to wait for v-blank to be over before continuing?

There's another bug where you jump on the flying things that shoot spears (they look like bees) and then you land on them.  In bgb this crashes the game on the real thing it shoots them off the screen.  I know why this happens, the colorizer inserted some custom functions that overwrote a mostly empty area of asm code that is used when you land on those bees.
« Last Edit: February 20, 2013, 01:11:34 am by KingMike »

KingMike

  • Forum Moderator
  • Hero Member
  • *****
  • Posts: 6894
  • *sigh* A changed avatar. Big deal.
    • View Profile
Re: Mario Land Colour hack is done
« Reply #8 on: February 20, 2013, 01:12:22 am »
Please distribute your mods in a patch form.
If a lot of data is moved around in the ROM, you should use a format like xdelta.
If not, any other format should work.
I've helpfully created an patch this time, based on the 1.0 ROM.
"My watch says 30 chickens" Google, 2018

MathUser2929

  • Hero Member
  • *****
  • Posts: 1544
    • View Profile
Re: Mario Land Colour hack is done
« Reply #9 on: February 20, 2013, 12:30:01 pm »
I think it overwrote some of the code for the tumbling rocks too. When I colorized the game the rocks would turn into smashed goombas instead when stepped on. I liked the change tho so I changed the rock graphics into a goomba in a bubble. Not ridable but oh well.

Drakon

  • Sr. Member
  • ****
  • Posts: 277
    • View Profile
    • 16 Bit Gamer
Re: Mario Land Colour hack is done
« Reply #10 on: February 20, 2013, 07:48:00 pm »
Please distribute your mods in a patch form.
If a lot of data is moved around in the ROM, you should use a format like xdelta.
If not, any other format should work.
I've helpfully created an patch this time, based on the 1.0 ROM.

Gah sorry, this's a hack of the 1.1 rom I'll make the patch now.

*edit*

patch link:

http://www.mediafire.com/?ws4v6m6jg6vsch5

This's for version 1.1 of the game.

I think it overwrote some of the code for the tumbling rocks too. When I colorized the game the rocks would turn into smashed goombas instead when stepped on. I liked the change tho so I changed the rock graphics into a goomba in a bubble. Not ridable but oh well.

Yes that too I forgot about that.  That stuff should be fixable too right now I just want to get it running on the real thing.  Relocating a bunch of code that gets called to can be a pain but I'm sure it's doable, I managed to get the game down to 128k by relocating code and data.

MathUser2929

  • Hero Member
  • *****
  • Posts: 1544
    • View Profile
Re: Mario Land Colour hack is done
« Reply #11 on: February 21, 2013, 08:41:06 am »
If you do fix the boulders, can you make a seperate patch that keeps the poppable bubble? I kinda liked that change so.

Drakon

  • Sr. Member
  • ****
  • Posts: 277
    • View Profile
    • 16 Bit Gamer
Re: Mario Land Colour hack is done
« Reply #12 on: February 22, 2013, 08:45:45 am »
If you do fix the boulders, can you make a seperate patch that keeps the poppable bubble? I kinda liked that change so.

Actually what I really want is just the game colorized with nothing else changed.  If I ever manage to fix these bugs then the next step would be to fix the colorizer bugs (bees, boulders), and lastly revert all the non-colorized changes you made.  I'm not going to bother fixing anything until the game is running in full colour without crashing or having the top of the screen drawing funny.  Talking to spikeman over pm he really seems to know gb asm well.  I only know a very tiny bit I'm hoping he can clean up my code to make this work.

MathUser2929

  • Hero Member
  • *****
  • Posts: 1544
    • View Profile
Re: Mario Land Colour hack is done
« Reply #13 on: February 22, 2013, 10:37:36 am »
You mean you're gonna revert the enemy layout, change back the rocks, change the ground near the boulders back to spikes. I don't like all those changes. Are you gonna revert the graphic changes too? Couldn't you just colorize it yourself then fix that?

ChronoMoogle

  • Sr. Member
  • ****
  • Posts: 358
  • Super Famicom all the way.
    • View Profile
    • SNESfreaks
Re: Mario Land Colour hack is done
« Reply #14 on: February 22, 2013, 10:46:26 am »
I think most players would prefer a unaltered game with colored graphics.
However, if the original creator of a hack wouldn't want that it's another story. O__o

MathUser2929

  • Hero Member
  • *****
  • Posts: 1544
    • View Profile
Re: Mario Land Colour hack is done
« Reply #15 on: February 22, 2013, 12:57:18 pm »
If they want a unaltered colorized version of the game, then why not hack the original game instead of hacking someones hack. I used the enemy rearrangement hack as a base for my hack. I made it cause I wanted a special edition of the game that wasn't exactly the same. If he's gonna undo all my changes then he should just colorize his own ROM and then apply fixes, rather then undoing everything.

Drakon

  • Sr. Member
  • ****
  • Posts: 277
    • View Profile
    • 16 Bit Gamer
Re: Mario Land Colour hack is done
« Reply #16 on: February 22, 2013, 06:38:13 pm »
You mean you're gonna revert the enemy layout, change back the rocks, change the ground near the boulders back to spikes. I don't like all those changes. Are you gonna revert the graphic changes too? Couldn't you just colorize it yourself then fix that?

I don't want to bother colorizing the entire game when you've already done the whole thing.  It would probably be easier for me to revert your changes than to colorize the whole thing myself.

MathUser2929

  • Hero Member
  • *****
  • Posts: 1544
    • View Profile
Re: Mario Land Colour hack is done
« Reply #17 on: February 22, 2013, 07:24:20 pm »
If you revert the graphics, there will be miscolored tiles. I had to redraw some sprites to use only 2 colors because each tile was colored differently within the same sprite. Anyway, if you do revert everything and wanna submit it to RHDN submit it as a new hack and not a update of mine. You can probably reference mine on the description for those that want to play the game with changes.

Also, I found GBColorizer very easy to use. I was a beginner hacker back then so. But as you've seen, colorizing introduces problems.

Drakon

  • Sr. Member
  • ****
  • Posts: 277
    • View Profile
    • 16 Bit Gamer
Re: Mario Land Colour hack is done
« Reply #18 on: February 22, 2013, 09:23:23 pm »
If you revert the graphics, there will be miscolored tiles. I had to redraw some sprites to use only 2 colors because each tile was colored differently within the same sprite. Anyway, if you do revert everything and wanna submit it to RHDN submit it as a new hack and not a update of mine. You can probably reference mine on the description for those that want to play the game with changes.

Also, I found GBColorizer very easy to use. I was a beginner hacker back then so. But as you've seen, colorizing introduces problems.

The graphical changes don't bug me so much, mostly just the edited levels.

February 24, 2013, 12:09:44 pm - (Auto Merged - Double Posts are not allowed before 7 days.)
I've been working with spikeman the last couple of days.  Spikeman managed to fix both the end of stage crash as well as the glitching background drawing on the top 20% of the screen area.  Today I took a crack at the game and I fixed a lot of bugs introduced by the colorizer code.  Now you can jump on the bees and they die normally.  Also you can once again jump on the boulders and ride them.  You can also jump on cannons and cannon bullets and everything acts as normal.  The only thing I see that still glitches out a little is during shmup boss fights, everything else seems to be debugged.
« Last Edit: February 24, 2013, 12:09:44 pm by Drakon »

Spikeman

  • Hero Member
  • *****
  • Posts: 1063
  • *unce unce unce*
    • View Profile
    • None at the moment, check out my Last.fm page instead?
Re: Mario Land Colour hack is done
« Reply #19 on: February 25, 2013, 02:07:57 am »
Another update: We managed to fix most of the remaining bugs by entirely relocating the Colorizer code to bank 5. I managed to fit the code that calls the bank 5 code (and saves and restores the banks so interrupts still work) in about 20 bytes so we could fit it at the beginning of the ROM (the game doesn't use any RST lower than 28, so there are 0x28 free bytes available in bank 0. Most of the glitches caused by colorizer itself were because it overwrote a bunch of zero bytes later in bank 0, however these were important data for what happens when objects collide (eg. when you try to ride a boulder, or when you shoot a boss). A bunch of the glitches we caused when trying to relocate code were by not being careful enough about restoring the bank to the right place.

The one remaining glitch that I know of is that the timer now acts a bit glitchy - I think this is because there was an "ei" instruction in the timer interrupt handler, which we disabled because it was causing a lot of crashes, which funnily enough is because original code just assumes that any interrupts that occur WITHIN the timer interrupt won't change the bank. So perhaps the original code could be modified to fix this.

Anyway, I have one question for anyone familiar with GBcolorizer - is there any way to edit ROMs that have already been colorized and change the colors around? This page has a lot of cool concept art, and IMO the color choices there look a lot better than the ones MathUser used in his hack (no offense).

Oh, and here's a screenshot of one bug that occured due to careless bank switching:


Edit: It looks like the only way to modify previous color data is if you have the .gbp file Colorizer makes. MathUser, do you still have this file/would you be kind enough to upload it for me?
« Last Edit: February 25, 2013, 02:44:19 am by Spikeman »
Open Source Hacking Projects: Guru Logic Champ, Telefang 2, (Want more? Check out my GitHub!)