peek &hf3b1

Page 2/2
1 |

By BiFi

Enlighted (4348)

BiFi's picture

17-08-2005, 18:25

Sometimes you need to do something yourself... That POKE &HF3B1,value only works with the top value lines. to scroll the lower part, you can do 2 things:

  1. copy the lower part to RAM from the next line and copy it back with 80 spaces added to it
  2. copy the upper part to RAM, let the BIOS do its scrolling work and restore the upper part

I'd suggest doing the first as the second looks pretty ugly.

I did something like this about 10 years ago when I was investigating MIDI... I wrote a split screen chat to do something useful with the MIDI routines that came up during those investigations. Though the lower part was done completely in BASIC back then Smile

I just checked the BASIC file. It used a VT-52 code to scroll the lower part: ESC+J

By AuroraMSX

Paragon (1902)

AuroraMSX's picture

17-08-2005, 18:32

Well, that also doesnt work for the lower part of the screen.

i tried everything but everytime its only the upperpart of the screen that scrolls.

i just can't seem to have the lower part do anything.. i can only vpoke to it. but vpoking code 27+asc(M or L) is quite useless Sad

though its an interesting site. didnt know using escapes was possible like this Smile

Ehm, VPOKEing and escape codes don't match. You'll have to use plain old LOCATE and PRINT Smile

scroll bottom half of the screen one line up:

LOCATE 1,13: PRINT CHR$(27)+"M";

Scroll top part (or actually, scroll complete screen up, and then bottom part back down):

LOCATE 1,1: PRINT CHR$(27)+"M";: LOCATE 1,13: PRINT CHR$(27)+"L"

(I can't remember if top left of the screen is 1,1 or 0,0 for LOCATE. Change accrodingly...)

By BiFi

Enlighted (4348)

BiFi's picture

17-08-2005, 18:36

LOCATE 0,0 in MSX-BASIC
LOCATE 1,1 in GW-BASIC (or other PC BASICs)

By DarQ

Paragon (1038)

DarQ's picture

17-08-2005, 18:43

i think i will use BiFi's approach. if needed i will copy vram upwards to have the lower part scroll as well...
although aurora's idea is nice too.

By BiFi

Enlighted (4348)

BiFi's picture

17-08-2005, 20:23

after checking with the VT-52 docs... I used that ESC+J to clear the screen from the location I provided... it was really too long ago when I seen the program last Smile

I also saw a ESC+M in the program... that indeed I used to scroll the bottom part... it deletes a line...

By Sonic_aka_T

Enlighted (4130)

Sonic_aka_T's picture

17-08-2005, 23:49

I don't think what you want to do can be done in BASIC. Fortunately though, it's pretty easy in ASM. (Everything is Tongue) Anyhoo, see if this little piece of code does the trick... I haven't tested it, but it should probably do the trick. Assemble with your favorite assembler and change the address if needed. You can still use LOCATE and PRINT in BASIC, but you can also use the function provided here while poking the X/Y coordinates to the vram_address thingy as shown. Hope it helps...

Screen_Width: EQU 80
Upper_Screen: EQU Screen_Width*0
Lower_Screen: EQU Screen_Width*12

	ORG	$C000

	JP	Initialize		; DEFUSR=&HC000: A=USR(0)
	JP	Print_Text		; DEFUSR=&HC003: T$="Hi!": A=USR(T$)
	JP	Scroll_Upper		; DEFUSR=&HC006: A=USR(0)
	JP	Scroll_Lower		; DEFUSR=&HC009: A=USR(0)

VramAddress:
	DW	$0000			; POKE &HC00C, (Y*Screen_Width)+X

Initialize:
	LD	HL,0+Screen_Width*11
	LD	DE,1+Screen_Width*11
	LD	BC,Screen_Width-1
	LD	(HL),$20
	LDIR
	XOR	A
	CALL	$005F
	JP	$00CC

Print_Text:
	CP	$03			; DEFUSR Arg is string
	RET	NZ
	LD	A,(DE)			; Length of String
	INC	DE
	LD	C,A
	LD	A,(DE)			; Low Byte Address
	INC	DE
	LD	L,A
	LD	A,(DE)			; High Byte Address
	LD	H,A
	LD	B,0
	LD	DE,(VramAddress)	; VRAM Address
	JP	$005C

Scroll_Upper:
	LD	HL,Upper_Screen+Screen_Width
	LD	DE,Screen_Buffer
	LD	BC,11*Screen_Width
	CALL	$0059
	LD	HL,Screen_Buffer
	LD	DE,Upper_Screen
	LD	BC,12*Screen_Width
	JP	$005C

Scroll_Lower:
	LD	HL,Lower_Screen+Screen_Width
	LD	DE,Screen_Buffer
	LD	BC,11*Screen_Width
	CALL	$0059
	LD	HL,Screen_Buffer
	LD	DE,Lower_Screen
	LD	BC,12*Screen_Width
	JP	$005C

Screen_Buffer:
	DS	Screen_Width*12

By DarQ

Paragon (1038)

DarQ's picture

18-08-2005, 01:01

aha, this is very interesting sonic! i will try it, and learn from it.. so i can code my own routine in the end

By Sonic_aka_T

Enlighted (4130)

Sonic_aka_T's picture

18-08-2005, 02:02

You're welcome? Wink

Page 2/2
1 |