Jump to content
  • entries
    430
  • comments
    1,870
  • views
    662,779

Pimp my Combat 1


Guest

678 views

Hi there!So, this is just some toying around with the Combat source. The overall plan is to add better "Ace" variants to Combat than my own "Ace" hack did a few years ago :lol:For a start, I used the most advanced iteration of the Combat reverse-engineering from Roger Williams.First thing I noticed, is that it doesn't compile as I find it on my hard disk :-oUpon closer examination, there seems to be a small typo where it reads "BMisDec" instead of "MisDec". Easy fix!(I also quickly made it compile into a binary 100% identical to the one offered at Atari Age.)So for a start, here's a 100% compiling and working source:escape.zipWell, well, so the first tweak that'll happen today will be incredibly simple. I'll bump it up to 4K :)It seems Roger Williams already knew that most people would want to do that, so he already added some advice at the end of his reverse-engineering:

  ; If you were changing this to a 4K cart, you'd  ; want to change this ORG to $FFFC.  You might also  ; want to move AudPitch out of the interrupt vector...  ;    ORG $F7FC, $00    .word $f000            ; Reset IRQ  ;AudPitch    .BYTE  $0F, $11        ; Motor sound pitch table by player

Hey, so I'll do just that! I'll replace that passage with:

AudPitch    .BYTE  $0F, $11        ; Motor sound pitch table by player    ORG $FFFC    .word START    .word START

Ok, compiles... let's check the file size... 4096 bytes... yup that's 4K, yay! :)I start it... and notice a severe bug! :-oSomething is wrong with the playfield at the bottom of the screen!Oha! Next thing I do is checking the original binary. Phew! Thank heavens, the bug is already there! It's not mine! ;)Hm... anyway, let's have a quick look... maybe I can fix it...It's gotta be something to do with the playfield, so I hopp through the source looking at all spots that read "PF"... aha... scoredisplay... blabla... Aha!Found a suspicous passage:

    STA  ENAM0            ; Clear a bunch of registers.    STA  ENAM1    STA  GRP0    STA  GRP1    STA  GRP0              ; In case GRP0 isn't COMPLETELY zeroed.    STA  PF0    STA  PF1    STA  PF2

It's at the very end of a giant subroutine called "Video OUT -- THE KERNAL".Some register cleanup after everything is drawn. The missiles are disabled, the sprites and the playfield get cleared... the playfield is the last thing that gets cleared... hm...Obviously the playfield gets cleared too soon... I think for the moment it's best to complete the scanline first and *then* clear the playfield:

    STA  ENAM0            ; Clear a bunch of registers.    STA  ENAM1    STA  GRP0    STA  GRP1    STA  GRP0              ; In case GRP0 isn't COMPLETELY zeroed.    STA WSYNC    STA  PF0    STA  PF1    STA  PF2

Ha! Worked! Not bad!Ok, instead of 263 scannlines it's drawing 264 now... which at least PAL users will already consider an improvement as well - Heya! Full color Combat! :)Thinking some more about this... why are all those registers actually cleared at all? Can the sprites go to the very bottom? - No!Can the missiles go to the very bottom? - No!Ah... we can do better than that, or? :twisted:

    STA WSYNC    STA  PF0    STA  PF1    STA  PF2    LDA #$02    STA VBLANK

We just clean the playfield and, just in case, turn the electron beam off! :)Ok, for the end of this entry, let's just do some minor code cleanups.I include "macro.h" and replace the mumbo Jumbo at the beginning:

    SEI                    ; Disable interrupts    CLD                    ; Clear decimal bit    LDX  #StkTop    TXS                    ; Init Stack    LDX  #$5D    JSR  ClearMem          ; zero out RAM except address $A2    LDA  #$10      ;    STA  SWCHB+1          ; Port B data direction register and    STA  GameOn            ; GameOn (tho not quite a valid value)...

with

    CLEAN_START

Next I scan the source code for the VSYNC. Here it comes in a subroutine:

VCNTRL    INC  CLOCK          ; Master frame count timer    STA  HMCLR          ; Clear horizontal move registers.    LDA  #2              ; Get this ready...    STA  WSYNC          ; for start of next line...    STA  VBLANK          ; Start vertical blank.    STA  WSYNC    STA  WSYNC          ; and do three lines    STA  WSYNC    STA  VSYNC          ; Now start vertical sync    STA  WSYNC    STA  WSYNC          ; and do three lines    LDA  #0              ; get this ready    STA  WSYNC    STA  VSYNC          ; End of vertical sync pulse    LDA  #43            ; And set VBLANK timer    STA  TIM64T          ; with 64 clock interval.    RTS

So... what does it do... increment a counter... clear collisions... enable VBLANK... execute VSYNC... and start a timer...Ok. Since I already VBLANK after the kernel (Note to self: Combat has no real overscan region?!?), I remove it here and then replace all the VSYNC stuff with another [stella] standard macro:

VCNTRL    INC  CLOCK          ; Master frame count timer    STA  HMCLR          ; Clear horizontal move registers.    VERTICAL_SYNC    LDA  #43            ; And set VBLANK timer    STA  TIM64T          ; with 64 clock interval.    RTS

Actually this little bit of code doesn't really justify a subroutine of it's own anymore, so maybe I'll eliminate it later...Another thing to notice: With getting rid of a bunch of superfluous STA WSYNCs, we're now down to 260 scannlines. Well, at least it's still an even number ;)Ok, so let's have a look back at what I achieved so far:- Fixed two bugs!- Bumped it up to 4K!- Saved a bunch of bytes! It's using more than 30 bytes less than 2K!And here's todays source code:post-3404-1060287362.jpgGreetings,Manuel

15 Comments


Recommended Comments

First thing I noticed, is that it doesn't compile as I find it on my hard disk :D

 

Upon closer examination, there seems to be a small typo where it reads "BMisDec" instead of "MisDec". Easy fix!

:D

This has been documented before;

November 2004 and March 2005. :)

 

Maybe someone should fix the "official" disassembly someday. :cool:

 

And, while we are on the subject, there are other disassemblies that won't compile correctly. Notably Pitfall!, which requires the TIA read address set to $30 for it to compile correctly. I think there are other disassemblies with the same issue.

Link to comment
Notably Pitfall!, which requires the TIA read address set to $30 for it to compile correctly. I think there are other disassemblies with the same issue.

 

Combat as well actually. That's one of the things I meant above when I said I made it compile 100% into the binary offered at AA. The first attachment addresses all those minor tweaks :cool:

Link to comment

I recently had a look at the Ace Arcade again, so it seems the desired/required tweaks would include:

 

- Enable the "Jet-Style" controls for the Bi-Planes as well.

- Fractional speeds for the planes

- Crashes at the screen borders

- Crashes when the two planes hit each other

- Make the plane explode and the pilot parachute

- Eventually add a "shot finale", i.e. a bigger explosion at the end.

- Remove the plane variants that alter NUSIZ (I just think they suck :))

 

And maybe add/try other suggestions I get along the way :cool:

Link to comment
I recently had a look at the Ace Arcade again, so it seems the desired/required tweaks would include:

 

- Enable the "Jet-Style" controls for the Bi-Planes as well.

- Fractional speeds for the planes

- Crashes at the screen borders

- Crashes when the two planes hit each other

- Make the plane explode and the pilot parachute

- Eventually add a "shot finale", i.e. a bigger explosion at the end.

- Remove the plane variants that alter NUSIZ (I just think they suck :))

 

And maybe add/try other suggestions I get along the way :cool:

Maybe this is sacrilege, but given the legal issues with selling Atari hacks (at least via AA) maybe someone should write a new version of Combat from scratch.

 

Then Zach could add his Tank AI to the new version and sell it without any trouble from Atari.

Link to comment

I believe the source code in Paul's minidig has the typo fixed. Anyway, Maunel, if you are looking for new variants of Combat, remember that I've done a version with a high-resolution asymmetrical playfield. You could build on that. So far it only has tanks, but it won't be hard to do a plane version.

 

I'm becoming increasingly open to the idea of a homebrew tank game from scratch. It could be to Combat what Gunfight was to Outlaw. I don't know when I would get around to working on it though. If anyone else wants to do it, I'll be happy to share my techniques and if it helps, AI code.

Link to comment
I believe the source code in Paul's minidig has the typo fixed. Anyway, Maunel, if you are looking for new variants of Combat, remember that I've done a version with a high-resolution asymmetrical playfield. You could build on that. So far it only has tanks, but it won't be hard to do a plane version.

 

I'm becoming increasingly open to the idea of a homebrew tank game from scratch. It could be to Combat what Gunfight was to Outlaw. I don't know when I would get around to working on it though. If anyone else wants to do it, I'll be happy to share my ideas and if it helps, AI code.

I kinda like this idea...what features would folks want in this game?

Link to comment
I kinda like this idea...what features would folks want in this game?

Well, for starters, some subtle momentum like Combat has is important. Look carefully, and you'll see that the tank takes some time to get to full speed and to stop. Also guided missiles are important if a computer is going to have any chance against a human opponent.
Link to comment
I kinda like this idea...what features would folks want in this game?

 

Special secondary uses for the main cannon perhaps? Is a flame thrower out of the question? Something short range but wide angle. I just think it would be really funny to be playing combat with an unknowing friend and suddenly my tank flames his ass. Maybe make it toggle on the difficulty switches or something.

Link to comment
Maybe this is sacrilege, but given the legal issues with selling Atari hacks (at least via AA) maybe someone should write a new version of Combat from scratch.

 

Ah, cool, seems like with Bob we already have a volunteer for that task :cool:

 

My idea of this "Pimp my Combat" here, is something different though. I just think of it sort of as an advanced "Programming Tutorial", a lecture for people that prefer learning from tweaking instead of doing something from scratch. Some smaller tweaks here and there, babystepping everything. Well, it may end as a total rewrite, depending on interest (especially mine! :D) and feedback. I could've placed it in "programming for newbies", but I just feel more comfortable here in my blog :D

 

Anyway, Maunel, if you are looking for new variants of Combat, remember that I've done a version with a high-resolution asymmetrical playfield. You could build on that. So far it only has tanks, but it won't be hard to do a plane version.

 

High-resolution asymmetrical playfield sounds good to me! Let's see how far this one goes, maybe I can slowly adopt things in from your advanced version. I think the next thing I might try is the bomber variants supercat suggested in Bobs thread :)

 

Greetings,

Manuel

Link to comment

I seem to recall reading somewhere that Space War is actually included in the Combat code, but was disabled (perhaps so Atari could sell it as a separate cart?). Is that correct, or have I been standing too close to the microwave again?

Link to comment
I seem to recall reading somewhere that Space War is actually included in the Combat code, but was disabled (perhaps so Atari could sell it as a separate cart?). Is that correct, or have I been standing too close to the microwave again?

I strongly suggest buying a new microwave! :cool:

Link to comment
Maybe this is sacrilege, but given the legal issues with selling Atari hacks (at least via AA) maybe someone should write a new version of Combat from scratch.

Hmm - maybe I should write a new Warlords then instead of hacking the existing version. Maybe call it Medieval Mayhem?

Link to comment
Hmm - maybe I should write a new Warlords then instead of hacking the existing version.  Maybe call it Medieval Mayhem?

 

Should be doable with a 1lk. If you're willing to make the kings be blocks instead of kings, you could even get three bouncyballs on screen at once. Adding some more angles and multi-ball play would IMHO greatly improve Warlords.

Link to comment
Guest
Add a comment...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...