Dear all,
How do you work with window streams in Assembler using the Firmware? I've got the following piece of code to set up a Window #1 over the top half of the screen:
ld a, 1 ; Switch to Stream #1
call TXT_STR_SELECT
ld h, 1
ld d, 39
ld l, 2
ld e, 21
call TXT_WIN_ENABLE ; Define a Window over the Playing Area
; as Stream #1
ld a, 0
call TXT_SET_PAPER
ld a, 0 ; Swap back to the default Stream (#0)
call TXT_STR_SELECT
However, selecting the stream using TXT STR SELECT and then clearing it with TXT CLEAR WINDOW doesn't seem to clear it. (these defines are to the corresponding firmware calls from SOFT968)
ld a, 1 ; Switch to Stream #1
call TXT_STR_SELECT
ld a, 0
call TXT_SET_PAPER
call TXT_CLEAR_WINDOW ; Clear it
ld a, 0
call TXT_STR_SELECT ; Switch back to Default Stream (#0)
What am I missing?
Seems to work ok for me.
I simply added the TxtClearWindow call to one of my routines which uses streams and the selected window was cleared.
This is the firmware call I used;
/*
036 &BB6C TXT CLEAR WINDOW
Action: Clears the window (of the current stream) and moves the
cursor to the top left corner of the window
Entry: No entry conditions
Exit: AF, BC, DE and HL are corrupt, and alI others are
preserved
*/
TxtClearWindow=#BB6C
And this is the code where I call it and sure enough it clears that window. Only difference is I don't have the Set Paper call before it, I just clear the window.
; Print PIO Port A Value in Window 1
;
;
PrintPIOPortA:
;Select window 1
ld a,1
call FwTxtStrSelect
ld a, (PIOPortA)
call Bin2Hex
;Print Most Significant Char
ld a,h
call FwTxtWrChar
;Print List Significant Char
ld a,l
call FwTxtWrChar
ld a,#0D
call FwTxtOutput
ld a,#0A
call FwTxtOutput
call TxtClearWindow
ret
You can see the effect below where the window for Port A is now cleared, should have text in it.
Port A window cleared.JPG
Let me look at my code further, and remove the paper call, there might be a logic issue or something. That example you have is very well explained. Thank you once again!
Still doesn't work for some reason, but I think it might be a timing issue. In any case, I'm not going to worry about it. There WAS a missing call to erase some old characters anyway, so things weren't right anyway.
You defined txt clear window as;
TXT_CLEAR_WINDOW EQU #BB63 ; Clear the current Window
I have it as BB6C.
BB63 is TXT SET GRAPHIC.
Ahahahahaha! How did I miss that! That's exactly what the problem was!
I'm such a pillock.
THANK YOU.