Re: A85: score


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

Re: A85: score




Your problem was that you were mixing up your addresses and your hi score.
I made the corrections, if I didn't explain them too good reply and I'll
explain more.  It's important to have a clear picture of what's going on.

On Mon, 27 Apr 1998 nine1one@juno.com wrote:
...
 ;this part was wrong

>         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
> 
 ;the first time you had it half right. sort of.
 ;it should be

 ld a,(hl)     ;load first 8 bits at hl or hiscore
 ld (hiscr),a  ;load first 8 bits into perm mem
 inc hl        ;move to next address (next 8 bits)
 ld a,(hl)     ;load second 8 bits at hl into a
 ld (hiscr2),a ;load second 8 bits into hiscr2. now all 16 are saved.


>         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
 ;if you still get the wrong score try reversing the order of my
 ;corrections.  Load hiscr2 first then inc hl then load hiscr.  But it
 ;should already work.

> 0
>         ROM_CALL(D_HL_DECI)     ;
>         ret                     ; return
> 
> hiscore:
>      .dw 0                      ;score is up to 64K
> 


-Humberto Yeverino Jr.

"Small potatos make the steak look bigger."

http://www.engr.csufresno.edu/~humberto/Home.html
humberto@engr.csufresno.edu

<font size=3>For browsers:<br>
<a href="http://www.engr.csufresno.edu/~humberto/Home.html">
Have a look.</a></font><br>


References: