****************************************************************************
****************************************************************************
**                                                               
**  Platinum Edition (Player handling routines)
**
**  This software is in the public domain.  There is no warranty.
**
**  by Patrick Davidson (pad@calc.org, http://pad.calc.org/)
**
**  Last updated August 2, 2001
**
****************************************************************************
****************************************************************************

MAX_X   set     195-12  
MIN_X   set     60      
MAX_Y   set     115-7   
MIN_Y   set     90     

******************************************** DRAW THE PLAYER'S SHIP

Draw_Player:
        move.w  player_xc(a5),d0        ; Load coordinates
        move.w  player_yc(a5),d1        

        GETKEY  0,2,0,7                 ; Move down
        bne.s   player_notgoingdown     
        addq.w  #2,d1     
        cmp.w   #MAX_Y,d1   
        ble.s   player_notgoingdown     
        moveq   #MAX_Y,d1

player_notgoingdown:

        GETKEY  0,0,0,5                 ; Move up
        bne.s   player_notgoingup       
        subq.w  #2,d1     
        cmp.w   #MIN_Y,d1       
        bge.s   player_notgoingup       
        moveq   #MIN_Y,d1       
player_notgoingup:

        GETKEY  0,3,0,6                 ; Move right
        bne.s   player_notgoingright    
        addq.w  #2,d0     
        cmp.w   #MAX_X,d0   
        ble.s   player_notgoingright    
        move.w  #MAX_X,d0
player_notgoingright:

        GETKEY  0,1,0,4                 ; Move left
        bne.s   player_notgoingleft     
        subq.w  #2,d0     
        cmp.w   #MIN_X,d0       
        bge.s   player_notgoingleft     
        moveq   #MIN_X,d0       
player_notgoingleft:

        move.w  d0,player_xc(a5)
        cmp.w   #3,difficulty(a5)
        bne.s   \ok
        moveq   #109,d1
\ok:    move.w  d1,player_yc(a5)

        move.w  player_image(a5),d2
        bra     Xor_Sprite_D2

******************************************** LOAD SHIP DEFINTIONS

Load_Player:
        move.w  #13,player_width(a5)  
        move.w  #8,player_height(a5)
        rts