MSX1 boot "logo"

Page 11/13
4 | 5 | 6 | 7 | 8 | 9 | 10 | | 12 | 13

By [WYZ]

Champion (406)

[WYZ]'s picture

13-05-2018, 18:56

Your way to get the logo is far better, of course. My point of view is based on tiles, faster but takes more than twice bytes and without an inherent animation . So that the reason I need a color table. Just filling 8 bytes with $F1 (or $1F )

By Grauw

Ascended (8442)

Grauw's picture

13-05-2018, 23:21

Grauw wrote:

But I think storing vector data (like NYYRIKKI’s) may be a good contender. With just 50 line segments (=100 bytes) you can already get pretty accurate. The rendering speed needs to improve though, polygon scan line rendering algorithm seems a good choice. The output would be the data as I store it now. Do need code for edge sorting and scan line rendering though, that takes space as well.

I did an experiment with this, drawing the logo edges with Bresenham, ROM size is 357 bytes after… Seems feasible to add an insertion sort & fill within 512 bytes total.

Update:

Ok, it’s working, and the size of a binary with only the last effect is 439 bytes. With a bit of a roughly drawn logo, but plenty of space to increase the vector resolution. The code needs clean-up and optimisation, and the Bresenham and vectors need to be tuned, but… shows that it’s possible!

Code: https://bitbucket.org/grauw/msx1logo/
Demo: https://bitbucket.org/grauw/msx1logo/downloads/msx1logo-vect...

By NYYRIKKI

Enlighted (5382)

NYYRIKKI's picture

14-05-2018, 01:06

I also did kind of "proof of concept"... The code is for MSX2 and last line is just a quick and dirty, bad looking fix for circle, that is obviously not the correct way to handle this even as a start... but anyway... if someone wants to loan the idea and make it work:

https://msxpen.com/codes/-LCQikkt4AeDQr7DzCsN

Edit: I did not check yet what grauw did, but sounds like he might be working on something similar, but more serious... Now I anyway get some sleep.

By Thom

Hero (582)

Thom's picture

14-05-2018, 11:05

The right half of the M and X are mirrors of their left halves, you'll get the lower half of the S by mirroring the upper half along the x-axis. However, I guess the extra bytes of code needed will exceed the fewer bytes of line segments.

By gdx

Prophet (3029)

gdx's picture

14-05-2018, 12:19

A mix between coordinate data and vector data (136 bytes):

10 COLOR,4,4: SCREEN2: DEFINTA-Z
20 LINE(22,40)-(233,118),1,BF
30 Y1=49: Y2=110: READ X1
40 L=15: GOSUB120: X1=X2: GOSUB170: X1=X2
50 GOTO40
60 Y=Y2
70 READ X,L: IF X=0 THEN 100
80 LINE(X,Y)-STEP(L,0),15:Y=Y-1
90 GOTO70
100 READ X1: L=17: GOSUB170: READ X1: GOSUB120
110 GOTO210
120 READ X2: IF X2=0 THEN RETURN60
130 FOR Y=Y2 TO Y1 STEP -1
140 X=X1+(X2-X1)*((Y2-Y)/(Y2-Y1)): LINE(X,Y)-STEP(L,0),15
150 NEXT Y: RETURN
160 '
170 READ X2
180 FOR Y=Y1 TO Y2
190 X=X1+(X2-X1)*((Y1-Y)/(Y1-Y2)): LINE(X,Y)-STEP(L,0),15
200 NEXT Y: RETURN
210 IF STRIG(0) THEN END ELSE 210
220 'M
230 DATA 41,55,69,84,97,0
240 'S
250 DATA 108,34,108,38,108,40,108,42,108,43,108,44,108,45,108,46,108,47,108,48
260 DATA 108,48,108,49,108,49,108,50,108,50,108,50,138,21,140,19,141,18,141,18
270 DATA 141,18,140,19,138,21,124,35,121,38,119,39,117,41,115,42,114,43,113,43
280 DATA 112,44,111,44,110,44,110,43,109,43,109,42,108,41,108,39,108,36,107,20
290 DATA 107,18,107,17,107,17,107,17,107,18,107,20,108,60,108,60,108,60,109,59
300 DATA 109,59,110,58,110,58,111,57,111,57,112,56,113,55,114,54,115,53,117,51
310 DATA 119,49,122,46,0,0
320 'X
330 DATA 159,200,153,199

By wimpie3

Champion (259)

wimpie3's picture

14-05-2018, 12:35

Very original solution! Alas a bit slow in basic :-)

By ARTRAG

Enlighted (6243)

ARTRAG's picture

14-05-2018, 16:50

By Manuel

Ascended (15747)

Manuel's picture

14-05-2018, 20:48

gdx: very elegant! Perhaps some trickery or math can also be used for the very regular S curve.... As Thom said, there is lots of symmetry to exploit here Smile

By gdx

Prophet (3029)

gdx's picture

15-05-2018, 11:45

wimpie3 wrote:

Very original solution! Alas a bit slow in basic

It's about 3~4 sec faster if the calculations X2-X1: Y2-Y1 and Y1-Y2 are done out of the loop FOR...NEXT using variables like below.

.
.
.
130 XR=X2-X1: YR=Y2-Y1 :FOR Y=Y2 TO Y1 STEP -1
140 LINE(X1+XR*(Y2-Y)/YR,Y)-STEP(L,0),15
.
.
.
170 READ X2: XR=X2-X1 :YR=Y1-Y2
180 FOR Y=Y1 TO Y2
190 LINE(X1+XR*(Y1-Y)/YR,Y)-STEP(L,0),15
.
.
.

But the goal was to reduce the data for someone to do that in assembler if needed.

By PingPong

Prophet (3447)

PingPong's picture

15-05-2018, 12:23

gdx wrote:
wimpie3 wrote:

Very original solution! Alas a bit slow in basic

It's about 3~4 sec faster if the calculations X2-X1: Y2-Y1 and Y1-Y2 are done out of the loop FOR...NEXT using variables like below.

.
.
.
130 XR=X2-X1: YR=Y2-Y1 :FOR Y=Y2 TO Y1 STEP -1
140 LINE(X1+XR*(Y2-Y)/YR,Y)-STEP(L,0),15
.
.
.
170 READ X2: XR=X2-X1 :YR=Y1-Y2
180 FOR Y=Y1 TO Y2
190 LINE(X1+XR*(Y1-Y)/YR,Y)-STEP(L,0),15
.
.
.

But the goal was to reduce the data for someone to do that in assembler if needed.

just for curiousity.... Someone tryed to run this code with xbasic?

Page 11/13
4 | 5 | 6 | 7 | 8 | 9 | 10 | | 12 | 13