Re: A86: batt checker


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

Re: A86: batt checker




trouble is, if we're talking more than 256 t-states (or times r is normally
incremented), than we totally lose the scale.

it's convenient to use r, because it's a built in counter, but it's really not
going to work unless the mask runs out really quickly.

shouldn't be too hard to just make one of the other registers a counter and
apply the same algorithm, though.


In a message dated 12/2/98 21:37:24 Eastern Standard Time, rabidcow@juno.com
writes:

> no, but i'll test this: (i think this works)
>  
>  .org _asm_exec_ram
>  
>   ld a,%11111000	;the mask the rom uses
>   out (1),a
>   ld c,1
>   ld a,r
>   ld b,a
>  loop:
>   in (c)		;or in f,(c) if you like, could use in d,(c) or something
>   jp po,loop		;mask has po
>   ld a,r
>   sub b
>   ld l,a
>   sub a
>   ld h,a
>   jp $4a33
>  
>  .end
>  
>  on freshly charged batteries, it gives either around 85 or around 213 (it
>  fluctuates) and drops after a bit.  it's given other numbers, too, so i
>  don't thinks that's gonna be easy to use.  ok, now it's giving 222 and
>  94. (i had it off for a bit)
>  
>  that loop is 22 t-state per cycle, 15 the last time through
>  
>  -josh
>  
>  
>  On Wed, 2 Dec 1998 04:55:58 -0500 "Dux Gregis" <assets@eden.rutgers.edu>
>  writes:
>  >
>  >try an acurracy of about 15 t-states! the only problem with this is 
>  >the
>  >unknown timing of in f,(c); does someone want to test this?  (I'm 
>  >unable to
>  >link)