On Mon, 11 Oct 1999 17:36:58 +0200, Manuel Bilderbeek wrote:
So, you can "rotate
left"
16 characters all contents, instead of copy the last two positions to the
first
two.
This is brilliant! I should shift the VRAM contents 16 bytes (actually more,
since there's also some characters between 2 filenames (actually dirnames))
to the left... But then again: it is probably going wrong because of things
like WIDTH... Or isn't it? (And I'd need some kind of COPY routine for
screen 0 in VRAM...)
By the way: the width is NOT 80. The program first pokes a width 78 (or so),
then executes the FILES command, then pokes the width to 80 again and then
it 'draws' (with those line-characters) a rectangular around the files. At
least, that's how I remember it.
I was looking on the VRAM using BrMSX... Well, the width have no changes
on how VRAM is treated (if you are always above 40 columns, of course). The
only changes is where you can write, but the memory remains on the same way
(at least, what I saw is the memory work just like if we have 80 columns /-:)
The only change is that some spaces are put before and after the "real" screen.
Well... I'd done a little (and fast) routine using only LDIRVM and LDIRMV,
it runs on the address E800h (you can change this) and do the job ONLY when
on 78 characters (there is some changes on the numbers if you use a different
# of columns). It works also based on the Ok response. If you clear the OK
before execute the routine, all the screen will be rotated. The sequence should
be:
BLOAD "SCROLL.BIN"
DEFUSR=HE800
WIDTH(78)
FILES
A=USR(0)
And then change columns numbers and draw everything. When using FILES
inside a program, the Ok will not appear, so, ALL the screen will be
"switched". If you want to avoid it, just write:
BLOAD "SCROLL.BIN"
DEFUSR=HE800
WIDTH(78)
FILES
PRINT " "
A=USR(0)
And when the routine finds a name ended started with space it will
stop.
Well, you can optimize it if you want, but I just think you shoud disable
the screen while printing, because its fast, but causes an unconfortable
sensation.
The routine for CL80 for MSDOS is below. Just compile it using
CL80 and then remove the three first bytes, and rename it to something
.BIN. Attached is the compiled version also, ready to be loaded.
B_DCOMPREQU 00020h
B_LDIRVMEQU 0005Ch
B_LDIRMVEQU 00059h
B_ERAFNKEQU 000CCh
B_FILVRMEQU 00056h
.z80
.PHASE 0E800h-7
START:
DB 0FEh
DW START1
DW START1END
DW START1
START1:
CALLB_ERAFNK
LD HL,1*80 ; initial line*80
; Line 0 is "x:\path" line
PUSHHL
PUSHHL
PUSHHL
PUSHHL
; Comeca o LDIR
LDIRA:
LD DE,26 ;(position in the line)
ADD HL,DE ; Arrange VRAM address
LD DE,WORK ; Points RAM buffer address
LD BC,53 ; Number of characters
CALLB_LDIRMV; Go!
POP DE ; Recall line initial address
LD HL,WORK ; Points to RAM buffer address
LD BC,53 ; Number of characters
CALLB_LDIRVM; Go!
POP HL ; Recall line initial address
LD DE,80 ; Points to the 1st char on the next line
ADD HL,DE
LD DE,24*80; (number of lines*80)
CALLB_DCOMPR; Copare...
JP Z,BACKENDSCR; Back to basic if equal (25th line)
LD DE,WORK ; Points buffer
LD BC,26 ; Number of characters
CALLB_LDIRMV; Go!
LD A,(WORK+1) ; (geth the 2nd letter)
CP ' ' ; Verify end of dir (espaco)
JP Z,BACKOK; Get out
LD A,(WORK+2) ; (get 3rd letter)
CP 'k' ; Verify if it is k (from Ok)
JP Z,BACKOK; If it is, get out!
POP HL ; Recall line initial Address
LD DE,52 ; Points to destination on line
ADD HL,DE
EX DE,HL
LD HL,WORK ; Points buffer
LD BC,26 ; Number of characters
CALLB_LDIRVM; Go!... Line ready.
POP HL ; Gets line initial Address
LD DE,80 ; Indicates number of characters in line
ADD HL,DE ; Points to the second line
PUSHHL
PUSHHL
PUSHHL
PUSHHL
JP LDIRA
BACKOK:
POP HL ; Get address of line
LD DE,52 ; Points to destination on line
ADD HL,DE
LD A,' ' ; write spaces
LD BC,26