Jump to content
carlsson

2020 BASIC 10Liner Contest

Recommended Posts

16 minutes ago, Preppie said:

Someone asked for the code of the 8way scroller, now my secret is out lol.  No way I can do this is 10-lines of FastBasic.... or is there?

8wayscrollTEST.tur 4.2 kB · 1 download

Just as it is now, it won't qualify for a 10liner because of the VBI() array contents and the runvbi=usr($688).

 

But I'm sure it could be converted to plain FastBasic. It might be not as fine as now, but I think that steps of double width/height will do very well too. With "Wazers" I was about to fine-scroll horizontally each line (at different speeds), but I finally discarded the idea because constant 4 color clocks for horizontal scroll was fine for what I wanted (and fit in PUR-120 category).

Share this post


Link to post
Share on other sites

Yeah, the VBI is the secret :)  But I put a comment at the end of the code that would run it in pure FB, although it doesn't work as well.

 

Scolling a full screen in FB is a little difficult.  Using a loop to change the Display List is way too slow.  You can unroll the loop (as in the comment to this code) but it's still a little slow (and uses a lot of code if your aim is a 10-liner), maybe ok if you're just doing a half screen scroll, or if you take it down to 25 fps instead of 50.

 

The technique I used in the runner program was inspired by 'where's my cheese' :)  ie. if you're only coding 10 lines then you have RAM to burn.  So I pre-created a load of display lists and swapped them in with a MOVE command.  Doing this in a side scroller is fine, but when you start scrolling 4 ways the amount of display lists to pre-render is massive - maybe I can figure out another technique.

   

  • Like 1

Share this post


Link to post
Share on other sites

@Vitoco, Interesting to see how the system with the highest number of games this year is the Commodore 264 series, i.e., Commodore 16/116/+4, with 29 games (if I have correctly counted them). So the C16 beats the C64 this year.
Most of the C16 games are by "Charlemagne", 2 by "raze", 2 by me and a few others by other contributors.

"Charlemagne" has produced the highest number of different games and all of them on the Commodore 264 series.

Share this post


Link to post
Share on other sites

@vitoco, it seems you were a little optimistic on the number of platforms. I count to 26 if you consider QB64, VBA for MS Office and VBScript three different "BASIC" languages all running on Microsoft Windows.

  • Commodore 16 & Plus/4: 31
  • MSX 1: 30
  • Commodore 64: 27
  • Atari 8-bit: 18
  • ZX Spectrum: 11
  • Amstrad CPC: 10
  • Commodore VIC-20: 8
  • BBC Micro, Commodore 128, MSX 2 and Sharp MZ-80A: 4 each
  • Microsoft Windows, TRS-80 MC-10 and VTech Laser 210: 3 each
  • Apple II and Thomson MO6: 2 each
  • Commodore PET, Dragon 32, Mattel Aquarius, Oric-1, TI-99/4A, TRS-80 CoCo 2, TRS-80 Level II, Thomson TO8/TO9+, VTech Laser 310 and ZX-81: 1 each

One of the BBC Entries is listed to run on Electron too.

 

Still a big number though of course Microsoft Windows is very far away from an 8-bit computer with built-in BASIC. I suppose an IBM PC 5150 might qualify if you can argue that the 8088 is a 8/16-bit CPU. I'm a little surprised that the TI-99/4A community who ran their own 10Liners contest last year didn't participate in the PUR-120 and upwards categories since TI Extended BASIC would be allowed in that category.

Share this post


Link to post
Share on other sites
7 hours ago, Preppie said:

I put a comment at the end of the code that would run it in pure FB, although it doesn't work as well.

I saw that line, but I couldn't run your code.

 

19 hours ago, Preppie said:

Scolling a full screen in FB is a little difficult.  Using a loop to change the Display List is way too slow.  You can unroll the loop (as in the comment to this code) but it's still a little slow (and uses a lot of code if your aim is a 10-liner), maybe ok if you're just doing a half screen scroll, or if you take it down to 25 fps instead of 50.

 

I wrote my own 8 ways fine scrolling test using a 64x63 "map" (~4K of RAM) displayed using a GR.2-like doisplay list, and you are right, it is quite slow in pure FastBasic with a FOR-NEXT loop to update each pointer:

graphics 0

data dlist() byte = $70,$70,$70,
data byte = $77,$00,$00,
data byte = $77,$00,$00,
data byte = $77,$00,$00,
data byte = $77,$00,$00,
data byte = $77,$00,$00,
data byte = $77,$00,$00,
data byte = $77,$00,$00,
data byte = $77,$00,$00,
data byte = $77,$00,$00,
data byte = $77,$00,$00,
data byte = $77,$00,$00,
data byte = $77,$00,$00,
data byte = $57,$00,$00,
data byte = $41,$00,$00

dl=adr(dlist)
dlptr=dl+4
dlact=$5900
dlactptr=dlact+4
dpoke dl+43,dlact

dlcache=$6000

pfdata=$9020

? "Initializing playfield data..."
mset pfdata,$FC0,3
for j=1 to 61
  for i=1 to 62
    poke pfdata+j*64+i,j+64*(i mod 4)
  next i
next j

move dl,dlact,45
dpoke 560,dlact

x=256
y=512
repeat
  s=15-stick(0)
  x=x-(s&4>0)*(x>80)+(s&8>0)*(x<432)
  y=y-2*(s&1>0)*(y>48)+2*(s&2>0)*(y<862)
  a=x-80
  b=y-48
  a1=a/8
  a2=8-a mod 8
  b1=b/16
  b2=b mod 16
  d=dlptr
  m=pfdata+a1+b1*64-1
  for i=0 to 12
    dpoke d,m
    d=d+3
    m=m+64
  next i
  pause 0
  move dlptr,dlactptr,38
  poke $D404,a2
  poke $D405,b2
until key()

 

19 hours ago, Preppie said:

The technique I used in the runner program was inspired by 'where's my cheese' :)  ie. if you're only coding 10 lines then you have RAM to burn.  So I pre-created a load of display lists and swapped them in with a MOVE command.  Doing this in a side scroller is fine, but when you start scrolling 4 ways the amount of display lists to pre-render is massive - maybe I can figure out another technique.

   

I modified the code and replaced the FOR-NEXT loop with pre-cached display lists. It took me less than 9K to get all 2250 "portions" of DL. The result was a lot better:

graphics 0

data dlist() byte = $70,$70,$70,
data byte = $77,$00,$00,
data byte = $77,$00,$00,
data byte = $77,$00,$00,
data byte = $77,$00,$00,
data byte = $77,$00,$00,
data byte = $77,$00,$00,
data byte = $77,$00,$00,
data byte = $77,$00,$00,
data byte = $77,$00,$00,
data byte = $77,$00,$00,
data byte = $77,$00,$00,
data byte = $77,$00,$00,
data byte = $57,$00,$00,
data byte = $41,$00,$00

dl=adr(dlist)
dlptr=dl+4
dlact=$5900
dlactptr=dlact+4
dpoke dl+43,dlact

dlcache=$6000

pfdata=$9020

? "Initializing DL cache..."
mset dlcache,$3000,$77
d=dlcache
for i=0 to 44
  m=pfdata+i-1
  for j=0 to 62
    dpoke d,m
    m=m+64
    d=d+3
  next j
next i

? "Initializing playfield data..."
mset pfdata,$FC0,3
for j=1 to 61
  for i=1 to 62
    poke pfdata+j*64+i,j+64*(i mod 4)
  next i
next j

move dl,dlact,45
dpoke 560,dlact

x=256
y=512
repeat
  s=15-stick(0)
  x=x-(s&4>0)*(x>80)+(s&8>0)*(x<432)
  y=y-2*(s&1>0)*(y>48)+2*(s&2>0)*(y<862)
  a=x-80
  b=y-48
  a1=a/8
  a2=8-a mod 8
  b1=b/16
  b2=b mod 16
  move dlcache+3*(b1+a1*63),dlptr,38
  dlist(39)=$57
  pause 0
  move dlptr,dlactptr,38
  poke $D404,a2
  poke $D405,b2
until key()

Notes:

- I used a 64x63 map to keep it bellow 4096 bytes and avoid the 4K boundary problem of display lists.

- In the cache, I stored a DL list of the first column for all the rows, then the second column and so on.

- To use it, I copied (MOVE) just the selected rows to a temporary DL (in DATA array) and update the ANTIC command for the last line (with the vertical scroll bit unset). After the PAUSE 0 (VBI sync), I updated the active DL and both horizontal and vertical fine scroll registers.

- X and Y user coordinates are expressed in pixels, and the view starts in the center of the map. To compute the upper-left byte of the map to be displayed, half a screen nedds to be substracted.

- To get nice diagonal movement in GR.2, I had to multiply the delta values by 2 on each step.

 

  • Like 1

Share this post


Link to post
Share on other sites
55 minutes ago, carlsson said:

@vitoco, it seems you were a little optimistic on the number of platforms. I count to 26 if you consider QB64, VBA for MS Office and VBScript three different "BASIC" languages all running on Microsoft Windows.

Well... it was a very quick stats analisys. I don't know about different Commodore platforms, but I just grouped them all. The same for the remaining ones. About Windows entries, all of them went directly to the WILD category!!!

 

I wish Bunsen could publish better stats, including that one with countries ;-)

 

  • Like 1

Share this post


Link to post
Share on other sites

It made me look up some oddballs which can be assumed to be unique formats and not just compatible with something else, to see what the total number might reach. I came up with these 20, though some of them I don't know a lot about:

 

ABC-80
Acorn Atom
CBM-II
COMX-35
Camputers Lynx
Casio PV-2000
EXL-100
Enterprise 64
Microbee 32
Nintendo Family BASIC
Sega SC-3000
Sharp MZ-700 (MZ-800 ?)
Sinclair QL (if we allow 8/16-bit hybrids)
Sord M5
Spectravideo SVI-318/328
Tomy Tutor
VTech Creativision
VTech Laser 2001
VTech Laser 500/700
Victor Lambda

 

So surely there could be 45 more or less qualified formats (not counting Microsoft Windows, Amiga, Atari ST, Macintosh etc, and also not counting strictly cross compiling BASICs on Atari 2600, Intellivision etc).

Share this post


Link to post
Share on other sites

Nice work Vitoco, this works well for smaller areas of gr.2 but I think I've solved it to work with a big scrolling area without the need for a large cache.

 

I haven't coded it yet but I'll try and explain the idea:

 

Let's say you're doing a gr0/antic 4 scroll of 19 lines.  Each line is a page of memory and we're scrolling through 60 lines verticaly. 

 

We need 3 cached DLs, one for the screen we're displaying now (60 lines x3 bytes), and 1 for when we move left and another for right for a total of 540 bytes cached DLs. 

 

Vertical movement is easy as we just select the correct line of the DL to MOVE into active status, horizontal is a little more work.

 

During the 3 fine scroll frames we update the right (or left) cached DL using 7 pokes on each of the fine scroll frames (19 lines plus 1 at top and bottom for a diagnal move) so that when we get to the coarse scroll the DL has been constructed and we can just use a MOVE command.  We then adjust pointers to the cached DLs so that, if we're moving right, the current DL becomes the left, the newly constructed right becomes the current and the old left DL now becomes the new right side one which will get constructed again as we scroll right.

 

This spreads the load over all frames instead of having to do it all in a single frame, and crucially allows us to use a MOVE which is way faster than multiple pokes/dpoke so that you can get the DL updated at the top of the screen.

 

 

 

 

Share this post


Link to post
Share on other sites
15 hours ago, vitoco said:

 

I wish Bunsen could publish better stats, including that one with countries ;-)

 

Yes, I will do. But now is not the time to do it. Please have some more patience. ;-)

Share this post


Link to post
Share on other sites

Yes. I also think that Laser VZ210 and VZ310 are very much alike. There is a definitive difference once you get into the 350/500/700/750 series though.

 

I'm sure someone could use MAX BASIC (in the PUR-120 category, since it is not buit-in) and make entries that are different from C64. Same about BASIC for the rare P128/P500 machines which have a 6509 but otherwise VIC-II and SID so in particular from a BASIC point of view would be very much alike C64 though with a different memory map not identical. Machines like SX-64 and Educator 64 are just C64 in other form factors so those could not be considered own formats.

 

I wonder about CP/M, which of course is an operating system with a lowest common denominator on the formats it runs on, but would be a special case.

Share this post


Link to post
Share on other sites
On 3/23/2020 at 2:37 PM, Preppie said:

Vertical movement is easy as we just select the correct line of the DL to MOVE into active status, horizontal is a little more work.

Playing with horizontal scrolling, I wrote the following demo:

 

 

 

This was programmed in FastBasic 4.3, and I used DLI to control 3 different sections, each with its own fine scrolling value for the HSCROL register, trying to recreate Moon Patrol's paralax effect. Of course, many registers are being updated in a buffer during the execution of the routines, but then are all updated at the same time after a single PAUSE 0 with some MOVE statements into the registers, including the updated DL from the buffer.

On 3/23/2020 at 2:37 PM, Preppie said:

We need 3 cached DLs, one for the screen we're displaying now (60 lines x3 bytes), and 1 for when we move left and another for right for a total of 540 bytes cached DLs.

If things gets slow at adding some more elements (trying to convert this into a game), I think that using 2 DLs is a solution in this case, updating the non-active one as a buffer and activating with a DPOKE at 560 instead of a MOVE after the PAUSE 0. Then, the other DL becames the buffer.

 

  • Like 8

Share this post


Link to post
Share on other sites

That looks great, nice work.  Don't know why I didn't think of simply changing the DL pointer, sometimes you can't see the forest for the trees :)

 

Share this post


Link to post
Share on other sites

BTW, I've uploaded videos from all my 2020 entries:

 

Entry #17: Journey to the golden Mothership

 

Entry #87: Wazers

 

Entry #126: Coronavirus

 

Entry #139: Follow Simona

 

Entry #140: Repeat after Simona

 

Entry #144: Tunnel Hunt

 

Enjoy!!! 😁

 

 

  • Like 7

Share this post


Link to post
Share on other sites

Congrats to all entrants and winners, especially Angrydill for his 2nd in Extreme256 and Vitoco for doing the double win in Pur-120 & Extreme-256!

 

 

  • Like 1
  • Thanks 1

Share this post


Link to post
Share on other sites

Exactly, congratulations to all entrants and to winners.

@skr made a nice award ceremony on youtube.

  • Like 2

Share this post


Link to post
Share on other sites
Exactly, congratulations to all entrants and to winners.
[mention=21666]skr[/mention] made a nice award ceremony on youtube.
Do you have a link to the YouTube award ceremony? I'm not finding it.


Sent from my E6533 using Tapatalk

Share this post


Link to post
Share on other sites

As it was my first Youtube-Stream, I did not make it public and asked everybody to invite other people. Bunsen put it on Twitter, so I thought, most people should be covered.

 

I´ve streamed for 3 hours now and wait for YouTube to finish processing of the stream. When it´s done, I´ll put it as video on my channel and tell you the timecodes, where I did the announcement of the winners.

I started talking German and English, but at some point I forgot to talk German at all.

 

Stay tuned for the link to the recorded video.

 

Edit: That now should be visible to the public: https://youtu.be/XxSSgHi81b4

BASIC 10 Liners starts at 33 minutes.

Edit again: Something´s wrong, still working on the correct version.

  • Like 4
  • Thanks 4

Share this post


Link to post
Share on other sites

Wow, Sascha, your first stream. And then 3 hours straight away ... Everything seemed sovereign and professional.

Thank you for presenting the results ... and of course all your judging time and other support!

 

Congratulations to the winners and all participiants. All did a very good job. It was hell of fun to play all these games but also hell of time consuming.

  • Like 1
  • Thanks 1

Share this post


Link to post
Share on other sites
4 hours ago, skr said:

I started talking German and English, but at some point I forgot to talk German at all.

I forgot to watch, but it seems like you did the opposite of what was advertised:

 

 

  • Like 1

Share this post


Link to post
Share on other sites

Monty cassette will work if all drives disconnected and just cassette is on... that means simulated and emulated drives as well...

Edited by _The Doctor__

Share this post


Link to post
Share on other sites
11 hours ago, carlsson said:

I forgot to watch, but it seems like you did the opposite of what was advertised:

 

 

Yes, my plan got screwed up even before the stream started, as there were many non German speaking in the waiting queue. I´m just trying to add German subtitles for the section about the BASIC 10Liners. ;)

Share this post


Link to post
Share on other sites
10 hours ago, _The Doctor__ said:

Monty cassette will work if all drives disconnected and just cassette is on... that means simulated and emulated drives as well...

Mario130XE told me set the U1MB to 576KB Ram (Stock OS and BASIC), and that really did the trick. With this setting it finished loading and I can play it from Tape. :) 

  • Like 1

Share this post


Link to post
Share on other sites
17 hours ago, _The Doctor__ said:

Monty cassette will work if all drives disconnected and just cassette is on... that means simulated and emulated drives as well...

 

Well, with the fileversion of MOTR on diskette it was the other way around (at least for me!) - this did not work and always crashed/hanged after the titlescreen with a loud noise, until I disconnected my data recorder. (And the SIO-cable of it works alright!) Strange heh, since they also published it on tape...?!?

 

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...