A creation of pset() and paint() functions with subROM

Door sp4

Master (214)

afbeelding van sp4

27-10-2010, 22:07

Hi, i'm writing the pset() and paint() functions alike at the BASIC using the documentation
about the sub-ROM as follow below:

PAINT (Basic!)

Address : #0069
Function : Paints graphical screen
Input : HL - Basic textpointer
Output : HL - Adapted Basic textpointer
Registers: All

PSET (Basic!)

Address : #006D
Function : Sets a point
Input : HL - Basic textpointer
Output : HL - Adapted Basic textpointer
Registers: All

This two ROM-BIOS call and other BIOS call are explaned in this link http://map.grauw.nl/resources/subrom.php , but i don't know what's the HL register and where it point.

I want know if the address in the HL register point to the x and y coordinates? And if yes i want know if can i put in HL a normal RAM cell address or only CPU registers.
Nobody can answer my questions ?

Aangemeld of registreer om reacties te plaatsen

Van Manuel

Ascended (19270)

afbeelding van Manuel

27-10-2010, 23:12

Did you read up on Z80 assembly? HL is a combination of 2 8-bit Z80 registers Smile

(For the rest, I don't know right now whether these routines can be used.)

Van sp4

Master (214)

afbeelding van sp4

27-10-2010, 23:22

Yes manuel i've undertand that, but i don't know where HL point, i don't know in what address
HL point. Is the address in the HL the beginning address for x and y coordinates or not ?
Do you know it ?
Thank you for your answer.

Van Edwin

Paragon (1182)

afbeelding van Edwin

28-10-2010, 01:27

Routines marked as "Basic" process the actual commands from basic. So HL should point somewhere in a line of tokenised basic code. You could include some of that in your code of course, but it's not really what those entries are for.

If you're on MSX2, you can use the command engine of the VDP to do PSET (you'll have to look up the bios entry for VDP commands yourself, I only use the vdp directly). However, sometimes it may be easier to just write a byte to a VRAM address.

I don't think there is an alternative for PAINT. PAINT algorithms are so horribly slow, that I don't think they are used in any assembly apps other than painting programmes. And those probably use their own algorithms. There is a VDP command for searching colours on a line to assist in the programming of paint algorithms. You'll just have to decide whether you really want it. Tongue

Van sp4

Master (214)

afbeelding van sp4

28-10-2010, 10:56

Ok Edwin i've undertand, but i haven't undertand if i most put x and y coordinates in VRAM ?
Is it also possible to put x and y coordinates in some address cell in the sistem RAM, instead to put it in the VRAM ?
Thanks for your answer.

Van Eugeny_Brychkov

Paragon (1232)

afbeelding van Eugeny_Brychkov

28-10-2010, 21:39

Sp4, to have some result after our conversation, can you please say what you are planning to achieve at the end?