This page is a mirror of Tepples' nesdev forum mirror (URL TBD).
Last updated on Oct-18-2019 Download

My Battle City Hack Project (WIP)

My Battle City Hack Project (WIP)
by on (#243168)
So, I've downloaded the source code of my childhood game Battle City and I hope to warm myself up for 6502 stuff.

Here are the features I am currently working on:
  • Players start with 5 lives
  • If a player gets shot by an enemy while having more than one life, they lose a life, but instead of respawning and reverting to the normal tank, they get stunned (blinking) for a second, get a shield (helmet) for a few seconds to escape the attack and a ricochet sound effect will play to warn the player.
  • Upon losing the last life, the player's tank explodes! (but I'll see if the player will keep the old tank upon the game over replenishment or start with a normal tank)
  • Friendly fire is reflected and the penalized player will be forced to respawn and revert back to the normal tank! (Take that, Vix! No more of this)
  • In 2P, if a player gets game over, 1 life will be borrowed to them from the surviving player when the next stage starts (the surviving player will must have had at least 2 lives)
  • Change life number display from 0-based to 1-based (0 = dead, 1 = last life) since it's a quantity number and not an index number! (LEARN C++!!!) Besides, the game internally shows 1 for last life in the hex editor!

Here's a little snippet of code I have inserted:
Code:
; Lifesharing Hack by RetroZvoc
; If one of two players has got a game over,
; the other player can give them a life.
      LDA Player1_Lives
      BNE + ; Player 1 isn't dead
      ; Player 1 has no lives!
      ; Player 2 will try to give one
      LDA Player2_Lives
      BEQ +++ ; This is not supposed to happen
      DEC
      BEQ ++ ; Player 2 has, but cannot borrow
      INC Player1_Lives
      STA Player2_Lives
      JMP ++
+: ; Player 1 has lives, spawn tank
      LDX #0 ; Spawn Player 1's Tank
      JSR Make_Respawn
      LDA Player2_Lives
      BNE ++ ; Player 2 isn't dead
      ; Player 2 has no lives!
      ; Player 1 will try to give one
      LDA Player1_Lives
      DEC
      BEQ +++ ; Player 1 cannot borrow a life
      INC Player2_Lives
      STA Player1_Lives
++: ; Player 2 has lives, spawn tank
      LDX #1 ; Spawn Player 2's Tank
      JSR Make_Spawn
+++:


Haven't tested or compiled anything. I'm looking at what goodies the code has. I'm surprised at how many jump tables there are for various tank states. So many jump tables. Great optimization in comparison to the if/else/switch/case. I just hope there's a good handling of out-of-bounds errors. XD

Also, why is the commented text filled with various humanly-unreadable čšđščđžđčšćđžčđžšćčščšžđ-like characters? Is this Chinese? *looks* Oh, it's Russian. XD Russian hackers. I cannot read Cyrillic, especially not in this corrupted format. What text encoding should I use? I could try to decypher Russian because it's similar to Croatian or I could just copypaste to Google Translator.

Please tell me what you think.
I would also like to know what does that Pistol powerup do. I've never seen it in my game. There's also a boat/sailing powerup in some alternate version. How do I activate those?
Thank you so much for your feedback!