A85: score


[Prev][Next][Index][Thread]

A85: score




Greetings,
        I am having a problems trying to implement a score feature that
keeps track of scores 0-65536.  So far all that I have suceeded in doing
is 0-255, and that's no fun.  I think that I have isolated the problem.
Whenever I start the game and it displays the high score (stored in perm.
memory at (hiscore) ) it says that the high score is something like 48000
something.  Everything else works like the score incrementing 0-65536.
        Is there a way to reset what is at this memory to 0 without
reseting
the high score to 0 every time it is ran?  Or am I just displaying it
wrong
with D_HL_DECI ?  Please help me.  BTW: It's zshell not usgard
                                                - Mike
                                        
; some temp vars (not all of them)

score = $80EE                   ; score (# of times crossed to other
side)
score2 = $80EF
lives = $80F0                      ; # of lives left (start with 3)
guycnd = $80F1                  ; condition of guy 0=dead 1=alive
mgvar = $80F2                    ; delay for keypad read for MOVE_GUY
hiscr = $80F3                       ; high score temp memory
hiscr2 = $80F4                    ; I alotted 2 bytes

SCOREDISP:
        ld hl, hiscore          ; destination
        ld de, (PROGRAM_ADDR)   ; current location
        add hl, de              ; get offset ; hl contains data
        ld a, h                 ; before I had it do...
        ld (hiscr), a           ;        ld (hiscr), hl
        ld a, l                 ; I need to move perm mem to temp mem
        ld (hiscr2), a          ; I alotted (hiscr) and (hiscr2) for the
                                ; 16 bit score value

        ld hl, $1000            ; display high score for main menu
        ld ($800C), hl          ; (in the top right)
        ld hl, (hiscr)          ; It keeps displaying crap values and not
0
        ROM_CALL(D_HL_DECI)     ;
        ret                     ; return

hiscore:
     .dw 0                      ;score is up to 64K


_____________________________________________________________________
You don't need to buy Internet access to use free Internet e-mail.
Get completely free e-mail from Juno at http://www.juno.com
Or call Juno at (800) 654-JUNO [654-5866]


Follow-Ups: References: