Tenliner Challenge - #6 Shangri-La

Tenliner Challenge - #6 Shangri-La

by Jorito on 08-11-2012, 21:40
Topic: Challenges
Languages:

Exactly a month after announcing our Tenliner challenge the number of participating entries has grown with the addition of Shangri-La. In contrast with the other entries, Shangri-La is not a game but a demo. The demo takes up 9 lines of MSX-BASIC and again makes great use of the mediafile. It was made in a few evenings by BlueCrystal, who refound his love for the MSX a year ago, and includes some cool artwork and a multilayer scroll. The demo runs on MSX2 or higher, but for the best effect an MSX turbo R is recommended.

You have until December 17th to submit your entry and join the other competitors for the prizes. We are eagerly awaiting your entry!

Relevant link: Shangri-La

Media browser (4)

  • Tenliner Challenge - #6 Shangri-La
  • Tenliner Challenge - #6 Shangri-La
  • Tenliner Challenge - #6 Shangri-La
  • Tenliner Challenge - #6 Shangri-La

Comments (11)

By Manuel

Ascended (19465)

Manuel's picture

08-11-2012, 22:08

Very impressive!

By Maggoo

Paragon (1217)

Maggoo's picture

09-11-2012, 15:17

Nice !

By kanima

Master (194)

kanima's picture

10-11-2012, 17:39

The powah of BASIC! Smile

By turbor

Hero (520)

turbor's picture

10-11-2012, 21:22

Unbelievable creativity is shown here. A full 3 parts demo in just 10 lines. Cool!

By fukenko

Champion (357)

fukenko's picture

11-11-2012, 01:44

Nice demo! It reminds me of great works of "AV forum" of MSX・FAN!

By MSX4ever

Master (253)

MSX4ever's picture

11-11-2012, 18:21

Marvelous and that in Basic !!!

By BlueCrystal

Expert (105)

BlueCrystal's picture

13-11-2012, 09:04

Thank you all for the compliments. It was quite tricky to start coding in basic again. I had quite some looking up to do how stuff worked. Thankfully, the internet is a good place for this. The book from Graham Bland on Hans Otten's site was very helpful.
I was thinking of adding a 5th scroll layer in the last part by using sprites, but simultaneous movement of multiple sprites is just so slow in basic... On the other hand, I was quite surprised by the speed of the copy command. That was faster than I thought. I did not expect to get the hands animation at such a smooth level. Blockfil using the line command is also quite fast, although drawing a single line isn't.

@maggoo, the checkered background in the lastpart, was actually inspired by the sonic replayer from Metal Limit. I always liked big moving things on the screen (which ofcourse you can't do in screen5). Although the replayer did it in a very different way, this is also a nice trick Smile

The really nice thing of basic is actually its limitations. My original thoughts were to use a vdp(24) scroll in the last part. But as basic does not allow you to access the lower part of the screen (line 212 and below) (atleast, I thought - I did not check). One has to come up with different ideas.
Maybe one day I'll rewrite this to assembly and add that fifth sprite layer.

By Manuel

Ascended (19465)

Manuel's picture

13-11-2012, 22:10

Would be really instructive if you explain this program line by line, statement by statement Smile

By BlueCrystal

Expert (105)

BlueCrystal's picture

18-11-2012, 14:51

@Manuel, it is basic, c'mon... you can figure it out yourself Smile But I'll try to explain. The last part just comes down to one big logical operator trick, using xor 2 and xor 3. Therefore, you'll need to choose your colors wisely as they are very limited.

The checkered background is color 8 and 10. It appears to scroll by updating the outerline of each block. In this case there is a line update from xpos 0 to xpos 255 by the line command (x,y)-(x2,y2),2,,xor. This will flip color 8 to 10 and 10 to 8.

The white text on screen is color 15 and 7. The operator xor 2 changes these to 13 and 5. As these colors are also set to white, you will not see the change.

The blue vertical bar is drawn over the screen using a line command with xor 3. Here we decide if the bar goes in front or behind the text (or even the background). The table below should clarify it a bit more.

Color xor2 xor3 Comment
0 2 3 Black (border)
1 3 2 Not used
2 2 1 Not used
3 1 0 Not used
4 6 7 vertical bar color
5 7 6 White
6 4 5 vertical bar color
7 5 4 white
8 10 11 Checkered background
9 11 10 Checkered background / vertical bar color
10 8 9 Checkered background
11 9 8 Checkered background / vertical bar color
12 14 15 White / vertical bar color
13 15 14 White
14 12 13 White / vertical bar color
15 13 12 white

By setting color 12 and 14, or 4 and 6 to white (text) or blue(vertical bar), you can determine if the blue vertical bar goes before and behind the text. Updating these color schedules during the program (which I didn't), allows even more cool tricks.

@MRC team
User Nestor Sancho Bejarano was so kind to dive into my program and optimize it. The speed has been greatly increased. Is there a possiblity to replace the current version with the optimized one?

By Jorito

Mr. Ambassadors (1790)

Jorito's picture

18-11-2012, 17:52

BlueCrystal wrote:

@MRC team
User Nestor Sancho Bejarano was so kind to dive into my program and optimize it. The speed has been greatly increased. Is there a possiblity to replace the current version with the optimized one?

Submit the updated version as a new download and we'll take care of it (add it as an extra file to your entry). But I think that your original version is the version that will participate in the challenge, as the optimized version is not your work. I'd have to check that with the rest of the team though.

But in any case, please submit the update Smile

By anonymous

incognito ergo sum (116)

anonymous's picture

19-11-2012, 21:36

BlueCrystal wrote:

User Nestor Sancho Bejarano was so kind to dive into my program and optimize it. The speed has been greatly increased. Is there a possiblity to replace the current version with the optimized one?

The Shangri-La download has been updated; the disk image now also contains an OPTIM.BAS with the optimized version by Nestor Sancho Bejarano. In accordance with BlueCrystal's wishes, his original entry is the participating entry to the challenge. The optimized version is for your enjoyment.

Beware the powerrrrrrr of MSX-BASIC!