Re: A86: contrast


[Next][Index][Thread]

Re: A86: contrast




Ok this is my thoughts on this (I've already read like 7 emails on it).

The problem you're having with outputting is that, as other people 
mentioned, _vputs writes text on the screen based on the values at (hl), 
increasing until it sees a zero.  Now, theoretically to output the contents 
of a register, the only ROM routine for a variable-width is call _vputmap.  
It outputs a at the _oenCol and _penRow locations.  However, the data stored 
at $C008 isn't in ASCII, so even if you tried a call _vputmap you'd still 
get trash.  So here is a routine chicane uses.

DispHL:
	ld de,-1
	ld (_curRow),de
	call _dispahl
	dec hl
	call _vputs
	ret

What appears to happen is that the cursor is set to -1 (255 if i'm not 
mistaken), which obviously makes the text get printed off the page.  Then a 
call is made to _dispahl, which converts the value of the 24-bit register 
ahl into ascii and prints it.  After that i'm not sure what happens, perhaps 
instead of popping hl to its original value like most rom calls do, it 
returns the ascii to a and hl.  Either way, it is now ready for printing.

About key holding down (assuming you don't have it working), Jimmy Mardell 
wrote a tutorial on checking if a key is held down.  Go to
http://www.acc.umu.se/~yarin/ and go to the zshell school.  It's at the end 
of the last chapter.  It's mostly a hardware thing, so you won't need to 
worry about discrepancies between the 85 and 86 too much.

Hope I helped!

-Diego

P.S. the routine below is kinda fishy.  I'm not sure what unpack_hl does... 
maybe i should check.
----Original Message Follows----
From: "Andrew T" <ironman_294@hotmail.com>
Reply-To: assembly-86@lists.ticalc.org
To: assembly-86@lists.ticalc.org
Subject: Re: A86: contrast
Date: Thu, 30 Sep 1999 22:12:09 GMT


Well that didn't work so i tryed something like this...and it didnt
work.....what have i done worng? ld a,($c008)
ld a,($c008)
ld l,a       ;ld hl,a
ld h,0
call UNPACK_HL
add a,'0'    ;make it ascii
ld (con),a
ld hl,con    ;now hl pints to contrast
call _vputs  ;but its putting out a blank
              ;saw it done in kollums.asm

con:
.db $00,$00


______________________________________________________
Get Your Private, Free Email at http://www.hotmail.com


Follow-Ups: