Programming the Sony HBI-V1
This page was last modified 15:41, 7 February 2012 by Manuel. Based on work by NYYRIKKI.

This is reverse enginered information about usage in Assember:

#7E00-#7EFF: Read buffer. Will return 256*256 picture. After one byte is read, next one will be returned. (LDIR/OTIR is used to read multiple bytes at a time)
 
 
#7FFC R/W: %ABC***XX
A Read: Busy or something like that (Z=Idle, NZ=Busy) Usually you can skip with ESC key.
B Read: Sync something (Wait to be NZ and wait to be back Z)
C Read: Sync something else (Wait to be Z and wait to be back NZ) (Video refresh?)
XX Write: Command
		00 = Terminate
		01 = Digitize
		10 = Digitize with delay
		11 = ??
 
 
#7FFD R/W: %A**DXXYY
A Read: Even/Odd frame
D Read: Video signal detected (NZ = No video signal)
XX Write: Start block Y
YY Write: Start block X
 
#7FFE Write: %XXYYYZZZ
XX = Screen mode
	00 = SCREEN 12
	01 = SCREEN 10/11
	10 = SCREEN 8
	11 = Other / Clear memory
 
YYY = Block size Y
ZZZ = Block size X
 
#7FFF Write: 8bit data (???)
 
To reset, write 0 to #7FFF - #7FFC (=backwards)
 
 
 
 
BIOS Routines:
--------------
 
#4010 "SONY HBI-V1 V10",0
 
#4020 Digitize
 
	Input:
	C	0 = Copy to VDP
	B	0 = Don't loop
	E	Nuber of frames to wait (0 = No wait)
	HL	Pointer to 7 bytes parameter table
 
	Table pointed by HL:
 
	n	0-255
	n+1	0-3	Screen mode
	n+2	0-7 	Block size Y ???
	n+3	0-7	Block size X ???
	n+4	0-3	Start block Y ???
	n+5	0-3	Start block X ???
	n+6	0-3	Command
 
#4023 DCOPY or something like that
 
	Input:
	HL	Pointer to parameter table 
 
	Table pointed by HL:
	Lucky guess: x,y,x,y,x,y
 
#4026 YJK color adjust (Similar to CALL YJK)
	Input:
 
	Color table pointed by HL
 
#4029 DCLS
	Input:
 
	None
 
	Explanation:
	Calls digitize routine (#4020) with following values:
 
	BC=1
	E=0
	Table pointed by HL: 0,3,0,0,0,0,1
 
#402C Start digitize software
	Input:
 
	None
 
	Explanation:
	Same as CALL DG in BASIC. Loads the BASIC program from ROM.
 
#402F Send command to hardware
	Input:
	HL	Pointer to 7 bytes parameter table
 
	Table pointed by HL:
	Same as in Digitize routine.
 
#4032 Copy Digitizer RAM to VRAM.
	Input:
 
	None

In BASIC there are following commands available:

_DFONT (X,Y,Z$) - write text onto screen
[B = toggle 'bold'
[P = some YJK manipulation or something, haven't figured it out yet
[R = toggle 'reverse'
something with I and T
 
_TOBAS - reboot system
 
_DCLS - clear internal VRAM
ERR=19 - no video signal
 
_DG - start internal digitizer software
 
_AD (A,B,C,D,E,F,G) - automatic digitize & copy to VRAM
A = block size X
B = block size Y
C = start block X
D = start block Y
E = wait?
F = ?
G = interlace
 
_MD (A,B,C,D,G) - manual digitize
A = block size X
B = block size Y
C = start block X
D = start block Y
G = interlace?
 
_FMD - ?
 
_DCOPY (X,Y)-(X,Y)TO(X,Y) - copy area from internal VRAM to VRAM)
 
_YJK (Y,J,K) - YJK color adjust
 
---
 
block size X/Y:
0 = 1/1 = full screen
1 = 1/2 = full screen, resized to fit 2 times
2 = 1/3 = full screen, resized to fit 3 times
3 = 1/4 = full screen, resized to fit 4 times
4 = 3/4 = 1/3 screen, resized to fit 4 times
5 = 2/2 = half screen, twice displayed
6 = 2/3 = half screen, resized to fit 3 times
7 = 2/4 = half screen, resized to fit 4 times
 
start block X/Y:
0 = update 0-X parts
1 = update 1-X parts
2 = update 2-X parts
3 = update 3-X parts
 
wait?
X = wait X interrupts before digitizing?
 
Unknown:
0 = ?
1 = ?
 
interlace:
0 = digitize all lines
1 = digitize even lines
2 = digitize odd lines