News: 11 March 2016 - Forum Rules

Author Topic: Alleyway DX - GBC version of Alleyway  (Read 4566 times)

marc_max

  • Jr. Member
  • **
  • Posts: 91
    • View Profile
Re: Alleyway DX - GBC version of Alleyway
« Reply #20 on: January 22, 2022, 03:53:45 am »
J0nas - You want to use a trampoline function in bank 0.

For one of my homebrew games I used one that takes 2 parameters, the bank # and address of the fn you want to call. It:

  • reads the current bank
  • pushes that onto the stack
  • changes to the requested bank
  • calls the requested fn
  • when it returns it pop the original bank and switches back to that, then returns

I've also seen similar fns that take a position into a jump table. So you call the Bank9Trampoline with 12, and then it switches to bank 9, and looks in the jump table at the start of bank 9 for the address of fn 12 and calls that.

If you need to make some space, hopefully there are some graphics you can move from bank 0 to somewhere else, otherwise you are stuck moving code around
Yep. That's the cleanest way to do it without having to messing with code moving :-) That's exactly how I rewrote the entire Mega Man World 5 DX code, as I was running out of space.

It is really useful to have some free space in bank 0 though. Also, look for the game's original memory and video management subroutines as they are usually on bank 0 and you can reuse them.


Neat trick! I didn't realize. That should only require a minimum amount of free space in bank 0. Where do you learn this kind of stuff?

The only downside would be that the routine in the added ROM bank doesn't have access to the data in the ROM bank that was originally switched in. But that's probably not much of an issue, as you could put a copy of that data in the added ROM bank.

The problem with that approach is that you have to set up all the values in the startup routine and can't change them later on. You can do it that way, but it won't look good. If you want to colorize a game properly, you have to change values at runtime.
It really depends on the game. Simple games like Dr. Mario or Alleyway could work without changing palettes, but player will thank for palette changing between levels.
Then there is also de fade in/fade out issue, which could lead to momentary glitched screen if you do not implement it.

But it's not just about setting palettes, it also requires to edit the sprite OAM and the VRAM map tile attributes so you can set which OBJ or BG palettes the sprites and background tiles will use. And, unfortunately, there isn't an universal method, as every game was coded in a different way, so the process of intercepting and injecting code is totally different in every game.

GB-CG

  • Jr. Member
  • **
  • Posts: 3
  • Hardware tester
    • View Profile
Re: Alleyway DX - GBC version of Alleyway
« Reply #21 on: January 22, 2022, 11:05:07 am »
Thanks for making this. Not sure what's up with your screenshots but on my GBA and GB Player running GB Interface with the 'Identity' color matrix setting, the background color is B3C8FB instead of EDF0F7.

Left (B3C8FB) is mine, right (EDF0F7) is the RHDN one.

MojoDodo

  • Jr. Member
  • **
  • Posts: 14
    • View Profile
Re: Alleyway DX - GBC version of Alleyway
« Reply #22 on: January 22, 2022, 04:03:39 pm »
The screenshots were taken with bgb emulator, and maybe had some GBC filter on it.

But I'll change the next version so the "full color" palette has a lighter blue background color

Thanks for making this. Not sure what's up with your screenshots but on my GBA and GB Player running GB Interface with the 'Identity' color matrix setting, the background color is B3C8FB instead of EDF0F7.

Left (B3C8FB) is mine, right (EDF0F7) is the RHDN one.


lilpuddy31

  • Jr. Member
  • **
  • Posts: 61
    • View Profile
Re: Alleyway DX - GBC version of Alleyway
« Reply #23 on: January 22, 2022, 05:01:25 pm »
Were you able to figure out the Mgba issue?

GB-CG

  • Jr. Member
  • **
  • Posts: 3
  • Hardware tester
    • View Profile
Re: Alleyway DX - GBC version of Alleyway
« Reply #24 on: January 22, 2022, 05:56:33 pm »
The screenshots were taken with bgb emulator, and maybe had some GBC filter on it.

But I'll change the next version so the "full color" palette has a lighter blue background color
OK. I meant to say that your screenshots looked quite desaturated compared to the actual gameplay, it's a lot more vibrant. Works perfectly on hardware too (so far).

MojoDodo

  • Jr. Member
  • **
  • Posts: 14
    • View Profile
Re: Alleyway DX - GBC version of Alleyway
« Reply #25 on: January 22, 2022, 06:42:24 pm »
Were you able to figure out the Mgba issue?

Yes, it is a horizontal dma I am using to try to update the tiles. It will be fixed in the next version of the patch, but I'm not sure when that will be available.
here is a 7 day link to a quick and dirty ips for the original unmodified rom that removes the hdma. It is a WIP, so there might be some other issues.
https://filebin.net/zssk566ozsseuvoc

GB-CG : Good to hear you are happy with it. The vibrancy really depends on the screen and system you are playing on. The gbc original screen is very washed out compared to newer screens. I'm waiting on a flash cart so I can test on real hardware, and until it arrives, my palettes are just best guesses.
« Last Edit: January 22, 2022, 07:18:02 pm by MojoDodo »

lilpuddy31

  • Jr. Member
  • **
  • Posts: 61
    • View Profile
Re: Alleyway DX - GBC version of Alleyway
« Reply #26 on: January 22, 2022, 11:19:18 pm »
Yes, it is a horizontal dma I am using to try to update the tiles. It will be fixed in the next version of the patch, but I'm not sure when that will be available.
here is a 7 day link to a quick and dirty ips for the original unmodified rom that removes the hdma. It is a WIP, so there might be some other issues.
https://filebin.net/zssk566ozsseuvoc

Played through for about a half hour using the Mgba core of RetroArch, haven't noticed any issues yet

KingMike

  • Forum Moderator
  • Hero Member
  • *****
  • Posts: 7412
  • *sigh* A changed avatar. Big deal.
    • View Profile
Re: Alleyway DX - GBC version of Alleyway
« Reply #27 on: January 23, 2022, 10:34:26 am »
GB-CG : Good to hear you are happy with it. The vibrancy really depends on the screen and system you are playing on. The gbc original screen is very washed out compared to newer screens. I'm waiting on a flash cart so I can test on real hardware, and until it arrives, my palettes are just best guesses.
Indeed, that was the reason emulators should have two palette options. One for the actual colors games use, and another to simulate the GBC/GBA LCD.
"My watch says 30 chickens" Google, 2018