Looking for a PAINT routine for MSX2

Pagina 1/4
| 2 | 3 | 4

Door ericb59

Paladin (939)

afbeelding van ericb59

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...

Aangemeld of registreer om reacties te plaatsen

Van Parn

Hero (516)

afbeelding van Parn

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.

Van ericb59

Paladin (939)

afbeelding van ericb59

11-02-2020, 07:42

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

Van akumajo

Resident (43)

afbeelding van akumajo

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.

Van PingPong

Prophet (3513)

afbeelding van PingPong

11-02-2020, 09:19

Van Parn

Hero (516)

afbeelding van Parn

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.

Van Metalion

Paragon (1107)

afbeelding van Metalion

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

Van Dolphin101546015

Master (254)

afbeelding van Dolphin101546015

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

Van Sylvester

Champion (418)

afbeelding van Sylvester

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

Van ericb59

Paladin (939)

afbeelding van ericb59

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

Van Dolphin101546015

Master (254)

afbeelding van Dolphin101546015

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
...
Pagina 1/4
| 2 | 3 | 4