Looking for a PAINT routine for MSX2

Page 1/4
| 2 | 3 | 4

By ericb59

Paladin (961)

ericb59's picture

10-02-2020, 13:01

Hello,

Perhaps someone here already worked on a PAINT (FloodFill) routine in ASM for the MSX2 VDP ?
Perhaps a routine that use the SRCH VDP command ?

I'm looking for such routine to include it inside FUSION-C

Thanks you...

Login or register to post comments

By Parn

Hero (565)

Parn's picture

10-02-2020, 21:47

Seeing as no one answered yet, I'd like to leave my two cents. In the Red Book there is a fairly detailed explanation of how MSX-BASIC's PAINT routines work. Maybe you could use those to implement your own routine. I believe there would be a considerable performance improvement by using VDP commands (and I guess MSX2's BASIC routines do this as well). I would love to help if I had more knowledge about the subject, though.

By ericb59

Paladin (961)

ericb59's picture

11-02-2020, 07:42

Thank you. I will check The Red Book about this paint routine.

By akumajo

Resident (43)

akumajo's picture

11-02-2020, 07:43

Some time ago I looked for an assembler routine and I found nothing really effective.
I had started to think about a 'paint' algorithm using the VDP 'line' command, the tricky part being to detect the points forming the outline of the shape to fill, especially for forms with cavities.

By PingPong

Prophet (3530)

PingPong's picture

11-02-2020, 09:19

By Parn

Hero (565)

Parn's picture

11-02-2020, 12:52

You guys probably know this, but the SRCH VDP command is especially suited to scanline fill algorithms, since it can detect edges both left and right from a given coordinate.

By Metalion

Paragon (1155)

Metalion's picture

11-02-2020, 13:30

The SRCH VDP command is not very efficient, as it only looks right or left.
You better use a simple algorythm like this one : https://en.wikipedia.org/wiki/Flood_fill

By Dolphin101546015

Champion (271)

Dolphin101546015's picture

11-02-2020, 15:54

ericb59 wrote:

Hello,

Perhaps someone here already worked on a PAINT (FloodFill) routine in ASM for the MSX2 VDP ?
Perhaps a routine that use the SRCH VDP command ?

I'm looking for such routine to include it inside FUSION-C

Thanks you...

I have one in C
Example preview
Example of traces test

If you interesting, I ready prepare some LIB for you.
Telegram me: http://t.me/Dolphin_Soft

By Sylvester

Champion (433)

Sylvester's picture

11-02-2020, 21:37

Check the solidc lib that is ported to sdcc: https://smecers.appspot.com/SDCC_msx/index.htm

Also the original msx-c lib contains a paint routine in glib.mac and glib.h

By ericb59

Paladin (961)

ericb59's picture

12-02-2020, 13:46

@Sylvester The Original Solid-C Paint routine is included in FUSION-C, but, it's far to be an efficient routine.
The one in MSX-C by ASCII, is not a Paint routine, but a call to the Basic Paint routine.

@ Metalion A pure 'C' flood fill routine brings the MSX to its knees easily. And I'm not able to code such routine in ASM myself. That’s why I’m looking for alternatives

@Dolphin101546015, Video examples looks awesome, I will contact you asap.

Thank all

By Dolphin101546015

Champion (271)

Dolphin101546015's picture

12-02-2020, 21:26

Sylvester wrote:

Also the original msx-c lib contains a paint routine in glib.mac and glib.h

...
	ld	a,(SCRMOD)
	cp	4+1
	jr	c,pnt_old
	ld	ix,N_PAINT
	call	_CALSUB##
	jr	pnt_done
pnt_old:
	ld	ix,O_PAINT
	call	_CALBAS##
pnt_done:
	pop	af
	ld	(BASROM),a
	ret
...
Page 1/4
| 2 | 3 | 4