Author Topic: Fixes and improvements for TGL (NES)  (Read 18478 times)

Shredder

  • Jr. Member
  • **
  • Posts: 55
    • View Profile
Fixes and improvements for TGL (NES)
« on: August 04, 2016, 05:09:30 PM »
All of these patches are compatible with Japan and USA ROMs, including "Secret Edition" hack. European ROM is incompatible :D

1. "TGL compact mapper" - it frees up some space and allows you to use expanded ROM.

2. "TGL eraser fix" - this will fix cheating by EE weapon, i.e. you are no longer gain infinite powerups by using EE. Also it will fix dangerous bug when game freezes if you simultaneously press button to use EE and select/start on weapon selection screen.

3. "TGL wall fix" - fixes "walking through vertical walls" glitch. Originally glitch appears if you press the diagonal when you standing closely to a wall and have increased speed (i.e. 5 or more shields).

4. Utility for expanding ROM.
http://www.romhacking.net/utilities/425/
Using it, you can double size of TGL ROM. But note that to use the new space you need to install "TGL compact mapper" patch. Bank switching program in TGL located at D705 - D7A9 (RAM). For example, after installing "compact mapper patch", addresses D705 - D723 are used for switching banks #00, #03, #04, #05 and 06. Addresses D724 - D765 are free and can be used for your needs. New banks (07-0E) can be switched by writing 87-8E into D76D-D774 respectively. Following code, for example, switches bank №08 for using:

Code: [Select]
LDA #$08
BNE $D707

See http://wiki.nesdev.com/w/index.php/Programming_UNROM

Easy way to switch banks without using any space in the fixed bank.

Attention! The order of modifying is important. First you have install patches #1-3 (in any order), then expand ROM if needed.

Good hacking! :skull:

"TGL-Secret_blue_boss_rush.zip" - this patch only for "TGL Secret Edition" ROM. It changes final level background, so it would be same Naju surface background like in the very first level - corridor 0.
Download TGL-Secret_blue_boss_rush.zip
« Last Edit: August 27, 2016, 08:14:19 PM by Shredder »

Quoise Games

  • Jr. Member
  • **
  • Posts: 98
    • View Profile
Re: Fixes and improvements for TGL (NES)
« Reply #1 on: August 05, 2016, 09:05:10 AM »
Thank you! I'll be using this when making improvements to TGL Worlds

Charly

  • Jr. Member
  • **
  • Posts: 84
    • View Profile
Re: Fixes and improvements for TGL (NES)
« Reply #2 on: August 07, 2016, 01:30:23 AM »
If you can fix the boss rush theme (instead of sand), would be like Optomon did but with the original color (the very first flight)
Gaming Channel on YouTube, including many TGL stuff.
https://www.youtube.com/channel/UC657r8BxfC5ZceOtDC5nNKQ

Shredder

  • Jr. Member
  • **
  • Posts: 55
    • View Profile
Re: Fixes and improvements for TGL (NES)
« Reply #3 on: August 08, 2016, 12:21:52 AM »
If you can fix the boss rush theme (instead of sand), would be like Optomon did but with the original color (the very first flight)

You mean change music on some boss?

arseniy

  • Administrator
  • Hero Member
  • *****
  • Posts: 2049
  • I like when I do
    • View Profile
Re: Fixes and improvements for TGL (NES)
« Reply #4 on: August 08, 2016, 01:57:38 AM »
If you can fix the boss rush theme (instead of sand), would be like Optomon did but with the original color (the very first flight)

You mean change music on some boss?

I am pretty sure he means the level background. So it would be same Naju surface background like in the very first level - corridor0. In Optomon's version it has different pallete from the original.

Shredder

  • Jr. Member
  • **
  • Posts: 55
    • View Profile
Re: Fixes and improvements for TGL (NES)
« Reply #5 on: August 08, 2016, 05:21:06 AM »
Hmm, a palette in other words. I can try :bluelanderbig:

Shredder

  • Jr. Member
  • **
  • Posts: 55
    • View Profile
Re: Fixes and improvements for TGL (NES)
« Reply #6 on: August 10, 2016, 05:00:22 AM »
I am pretty sure he means the level background. So it would be same Naju surface background like in the very first level - corridor0. In Optomon's version it has different pallete from the original.

Done!

arseniy

  • Administrator
  • Hero Member
  • *****
  • Posts: 2049
  • I like when I do
    • View Profile
Re: Fixes and improvements for TGL (NES)
« Reply #7 on: August 10, 2016, 05:29:00 AM »
Is this for TGL secret or for original game too?
This could be added to the very first post, you know :redlander:

Shredder

  • Jr. Member
  • **
  • Posts: 55
    • View Profile
Re: Fixes and improvements for TGL (NES)
« Reply #8 on: August 10, 2016, 05:59:50 AM »
Is this for TGL secret or for original game too?

Only for TGL Secret.

This could be added to the very first post, you know :redlander:

I added  ;)

arseniy

  • Administrator
  • Hero Member
  • *****
  • Posts: 2049
  • I like when I do
    • View Profile
Re: Fixes and improvements for TGL (NES)
« Reply #9 on: August 10, 2016, 09:40:23 AM »
Is this for TGL secret or for original game too?

Only for TGL Secret.


OK. He meant the original tho  ;)

Charly

  • Jr. Member
  • **
  • Posts: 84
    • View Profile
Re: Fixes and improvements for TGL (NES)
« Reply #10 on: August 12, 2016, 11:45:41 PM »
Is this for TGL secret or for original game too?

Only for TGL Secret.


OK. He meant the original tho  ;)
Actually I mean the original one. Instead of the sand surface for the boss rush, it would be better if it just like Optomon did but forthe different colour, like the prologue of the game :)
Arseniy was right in this case.
Gaming Channel on YouTube, including many TGL stuff.
https://www.youtube.com/channel/UC657r8BxfC5ZceOtDC5nNKQ

Ratix

  • Jr. Member
  • **
  • Posts: 84
    • View Profile
Re: Fixes and improvements for TGL (NES)
« Reply #11 on: August 19, 2016, 05:50:15 AM »
Fix 3 was a very handy feature to have. It had saved a lot of time. These are nice fixes though as it restores balance to the game.

Why is it that after picking up the 5th shield you speed up naturally?

optomon

  • Full Member
  • ***
  • Posts: 144
  • Extracting sunlight from cucumbers since 2003
    • View Profile
Re: Fixes and improvements for TGL (NES)
« Reply #12 on: August 19, 2016, 09:01:40 PM »
I'll bet that fifth shield thing is intentionally programmed. Weird how no one has bothered to check it yet.

Grimgrin

  • Jr. Member
  • **
  • Posts: 79
    • View Profile
Re: Fixes and improvements for TGL (NES)
« Reply #13 on: August 23, 2016, 05:23:30 PM »
Thank you very much!
On TGL compact mapper, I was able to bankswitch the boss music for corridors code indo another bank now I need to fix the problem. To bad that I cant do this in the fixed bank but in MMC5, you can do that in the fixed bank.
Currently extending the game.

Shredder

  • Jr. Member
  • **
  • Posts: 55
    • View Profile
Re: Fixes and improvements for TGL (NES)
« Reply #14 on: August 27, 2016, 08:08:51 PM »
Actually I mean the original one. Instead of the sand surface for the boss rush, it would be better if it just like Optomon did but forthe different colour, like the prologue of the game :)
Arseniy was right in this case.

Sorry, I have no time at this moment. Maybe later :bluelanderbig:

I found a way to switch code banks without using any space in fixed bank.

For example, this is original game code. Highlighted in purple is the part which we replace and relocate to new bank:

$D325:A9 00     LDA #$00
$D327:9D 90 05  STA $0590,X @ $05A7 = #$00
$D32A:BD 90 05  LDA $0590,X @ $05A7 = #$00
$D32D:D0 0F     BNE $D33E
$D32F:BD 00 05  LDA $0500,X @ $0517 = #$D7
$D332:29 7F     AND #$7F
$D334:9D 40 07  STA $0740,X @ $0757 = #$00
$D337:A8        TAY

$D338:B9 41 D4  LDA $D441,Y @ $D445 = #$00
$D33B:9D 00 05  STA $0500,X @ $0517 = #$D7
$D33E:60        RTS

This is new code. Replaced part highlighted in green, it is switching to new bank #07:

$D325:A9 00     LDA #$00
$D327:9D 90 05  STA $0590,X @ $05A7 = #$00
$D32A:BD 90 05  LDA $0590,X @ $05A7 = #$00
$D32D:D0 0F     BNE $D33E
$D32F:A9 7F     LDA #$7F
$D331:48        PHA
$D332:A9 FF     LDA #$FF
$D334:48        PHA
$D335:4C 24 D7  JMP $D724

$D338:B9 41 D4  LDA $D441,Y @ $D498 = #$08
$D33B:9D 00 05  STA $0500,X @ $0517 = #$D7
$D33E:60        RTS

Part of switching subroutine which we point by JMP $D724 in the code above:

$D720:A9 06     LDA #$06
$D722:D0 E3     BNE $D707
$D724:A9 07     LDA #$07
$D726:D0 DF     BNE $D707

This is code we write in the new bank. Part of original relocated code in purple. After it you can place any of your new code. Finally you should return to previous bank (#6 in this example), the backswitching code highlighted in green:

$8000:BD 00 05  LDA $0500,X @ $0506 = #$D2
$8003:29 7F     AND #$7F
$8005:9D 40 07  STA $0740,X @ $0746 = #$00
$8008:A8        TAY

.....................
[HERE YOU CAN PLACE ANY OF YOUR NEW CODE]
.....................
$8009:A9 D3     LDA #$D3
$800B:48        PHA
$800C:A9 37     LDA #$37
$800E:48        PHA
$800F:4C 20 D7  JMP $D720


Now explanation how we point the address where we want to be after switching. Subtract 1 from this address in hexadecimal, then split it into two bytes, first byte put in first LDA, second put in LDA below. For example, 8000 - 1 = 7FFF, the result is:

$D32F:A9 7F     LDA #$7F
$D331:48        PHA
$D332:A9 FF     LDA #$FF
$D334:48        PHA
« Last Edit: August 27, 2016, 08:16:59 PM by Shredder »