Jump to content
IGNORED

avp alien hack (comlynx)


sage

Recommended Posts

 

AVP Hacking

 

(some notes I wrote down years ago, think I might share them ...)

 

Using the "official" ROM from 1993.

 

Goal:
Find out why Alien mode is deactivated.
Activate Alien Mode in Menu. Maybe do a cheat for level select.

 

Help:
We know its there because someone (http://zenade.angelfire.com/AVP/lynx/avp.html) found out
how to activate it by patching into memory as well as selecting the level nr.
But this Cheat is not really telling where and how to patch ... ?
We further know that it was possible to select the alien in the menu in older ROM versions.
(which I do not have available...)

 

Findings:
Alien Mode is in and "just" deactivated in the menu. It can be activated and the item picture in
the menu is appearing, too. There is some conditional branch before the picture is displayed. But
it is not clear yet what is this condition... My guess: COMLYNX Mode!
Comlynx? Indeed there is support for Comlynx in AvP!
Just connect a second lynx and one player can select marine while the other is predator.
But: It does not seem to work. At least not with my two Lynxes.
Add: With three Lynxes every player gets adifferent character ... means the Alien pops up in the menu as expected.

 

Investigating:
First, extract files from rom. We get something like 200 file entries, but a lot of them are zero entries.
File 0 is the title picture (as always).
Trivia: It is not a single sprite but four, background, alien, vs, predator are seperate sprites.
File 1: main code/basic fuction stays resident.
File 2,3,5,7: menu and actual game ... swapped in at the same address as needed.
File 2 contains Intro?
File 3 contains the selection menu!
File 5 is engine.
File 7 contains the Game Over screen. Remark: switched pics???

Most of the other files are sprite data, but sometimes with some additional data (table?) in front of it.

Lets concentrate on the file 3 and look for the menu selection part. And there it is...

        LDX $06        
        LDA #$00       
L2E22:
        ORA $0A,X      
        DEX            
        BPL L2E22       
        BIT #$03       
        BNE L2E6B      
        BIT #$10 ; Left/Right      
        BEQ L2E46       
        LDA L2E7A ; CURRENT SELECTION     
        DEC            
        CPX #$02  ; And this is crazy... because x is always -1 here!!     
        BPL L2E3B ; And this is crazy... if this should be cmp this makes more sence... but limits      
        AND #$01  ; And this is crazy... the value to 0 and 1 for the selected character
        BRA L2E41 ; And this is crazy...      
L2E3B:
        CMP #$00       
        BPL L2E41       
        LDA #$02       
L2E41:
        STA L2E7A ; Store selection     
        BRA L2E5F       
L2E46:
        BIT #$20 ; Left/Right      
        BEQ L2E5F      
        LDA L2E7A      
        INC            
        CMP #$02  ; And this is crazy, too ... must be CPX as above??      
        BPL L2E56 ; And this is crazy, too ... doesnt make sence     
        AND #$01  ; And this is crazy, too ...     
        BRA L2E5C ; And this is crazy, too ...      
L2E56:
        CMP #$02       
        BMI L2E5C       
        LDA #$00       
L2E5C:
        STA L2E7A ; Store selection     
L2E5F:
        LDA L2E7B ; Animation of Frame or similar?     
        INC            
        AND #$03       
        STA L2E7B      
        JMP L2DBF      
        
        ; The following is interesting, too
L2E6B:
        LDX $07        
        LDA L2E7A      
        STA $10,X      
        STA $AD        
        JSR $058e      
        JMP $1822      

        ; And if we check a bit of code before, we find the following
        ; This is run when we first enter the menu...

        LDX $07        
        TXA            
        STA $10,X      
        STA L2E7A      

What do we learn from this?
a) there is a bug in the avp code ;-)
b) selection can be 0,1,2 BUT ther is this CPX on something which limits this to 0 and 1 (alien is 2!)
c) on start this value is read from $07
Some very nice piece of code is:

   LDX L2E7A   
   LDY #$07
   LDA L2D88,X
   STA ($AB),Y
   LDY #$09
   LDA L2D8B,X
   STA ($AB),Y
   LDA $AB     
   LDX $AC     
   JSR $056e   

this code is plotting the selection frame ... based on a three entry look-up table. three characters!
We learn: L056E is plotting a sprite! looking where it is used will find an additional piece of code
which draws one sprite only under a condition:
   

   LDA $06     
   CMP #$02
   BMI L2DE4    
   LDA #$b0
   LDX #$52
   JSR $056e   
L2DE4:

What sprite is it? yes, the alien head for the menu. (not shown: right above that was the plotting of marine and predator)

 

What do we learn?
Based on the value of $06 the alien head is (not) shown in the menu.
The same value is used on some loop above the selection code to OR some values which are tested for left/right.
What does this mean, why do we want to make an OR if we have only one Lynx... and why is all this keypad reading and
storing (not shown at all) done so terribly complicated... based on some indizes... could it mean...yes indeed!!!
Checking the main code result in a lot of SERDAT occurances... means: COMLYNX code!!!!
=> a short check with two Lynxes, yes we have comlynx support.
And the complicated code for selection "just" synchronizes the selection between two(?) Lynxes.

 

Edited by sage
  • Like 3
Link to comment
Share on other sites

  • 2 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   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...