BASIC Week on reddit ..

In this forum you can write about anything that does not fit in other forums.
This includes generic Oric talkings and things that are totaly unrelated but want to share with people here :)
User avatar
ibisum
Wing Commander
Posts: 1646
Joined: Fri Apr 03, 2009 8:56 am
Location: Vienna, Austria
Contact:

BASIC Week on reddit ..

Post by ibisum »

On this subreddit:

http://www.reddit.com/r/retrobattlestations/

.. its BASIC week, where all owners of retro battlestations (redditspeak for old computers) are encouraged to participate in celebrating their working, old machines, by porting a BASIC listing to their machines.

I haven't seen any Oric's on there yet - anyone want to give it a go?

The BASIC app to be ported is here:

https://github.com/FozzTexx/vectro

Should be pretty fun .. wish I had time to do it myself, though.
User avatar
Dbug
Site Admin
Posts: 4444
Joined: Fri Jan 06, 2006 10:00 pm
Location: Oslo, Norway
Contact:

Re: BASIC Week on reddit ..

Post by Dbug »

That looks like a pretty 'basic' program :)
User avatar
Dbug
Site Admin
Posts: 4444
Joined: Fri Jan 06, 2006 10:00 pm
Location: Oslo, Norway
Contact:

Re: BASIC Week on reddit ..

Post by Dbug »

I got the code to run, need to clean it a bit because it's pretty miserably crappy, and probably need to open a reddit account because I do not have one.

Edit: BASIC week is from September 9 to September 13.

:p
User avatar
Dbug
Site Admin
Posts: 4444
Joined: Fri Jan 06, 2006 10:00 pm
Location: Oslo, Norway
Contact:

Re: BASIC Week on reddit ..

Post by Dbug »

Here is the code:

Code: Select all

100 ' Setup graphics and initialize some constants
105 ' ORIC VERSION by Mickael Pointier (dbug@defence-force.org)
110 HIRES
130 SW = 240
131 SH = 200
132 SC = SW / 1750
133 XF = SW / 2
140 IF SH / 1000 < SC THEN SC = SH / 1000
150 ' Read the vector graphics from DATA and draw the picture
160 READ P$
170 IF P$ = "EOI" THEN END
180 IF P$ = "C" OR P$ = "E" THEN GOSUB 1010
190 IF P$ = "L" THEN GOSUB 1510
200 GOTO 160
1000 ' Draw circle or ellipse
1010 READ XC,YC,XR:YR = XR: IF P$ = "E" THEN READ YR
1020 READ AS,AE
1030 XC = XC * SC:YC = YC * SC:XR = XR * SC:YR = YR * SC
1040 A2 = XR * XR:B2 = YR * YR:F2 = 4 * A2
1050 X = 0:Y = YR:SI = 2 * B2 + A2 * (1 - 2 * YR)
1060 IF B2 * X > A2 * Y THEN GOTO 1110
1070 SP = X / Y:AN = ATN (SP):DG = 90 - AN * 180 / PI: GOSUB 1190
1080 IF SI >= 0 THEN SI = SI + F2 * (1 - Y):Y = Y - 1
1090 SI = SI + B2 * (4 * X + 6)
1100 X = X + 1: GOTO 1060
1110 F2 = 4 * B2
1120 X = XR:Y = 0:SI = 2 * A2 + B2 * (1 - 2 * XR)
1130 IF A2 * Y > B2 * X THEN RETURN
1140 SP = Y / X:AN = ATN (SP):DG = AN * 180 / PI: GOSUB 1190
1150 IF SI >= 0 THEN SI = SI + F2 * (1 - X):X = X - 1
1160 SI = SI + A2 * (4 * Y + 6)
1170 Y = Y + 1: GOTO 1130
1180 ' Plot point on arc
1190 NS = AS:NE = AE: IF AS < 0 THEN NS = AS + 360:NE = AE + 360
1200 IF DG >= AS AND DG <= AE THEN CURSET XC+X+XF,YC-Y,1
1210 IF 180 - DG >= AS AND 180 - DG <= AE THEN CURSET XC-X+XF,YC-Y,1
1220 IF DG >= NS - 180 AND DG <= NE - 180 THEN CURSET XC-X+XF,YC+Y,1
1230 IF 180 - DG >= NS - 180 AND 180 - DG <= NE - 180 THEN CURSET XC+X+XF,YC+Y,1
1240 RETURN
1500 ' Draw a line
1510 READ X1,Y1,X2,Y2
1520 X1 = INT(XF+(X1*SC))
1521 Y1 = INT(   (Y1*SC))
1522 X2 = INT(XF+(X2*SC))
1523 Y2 = INT(   (Y2*SC))
1525 CURSET X1,Y1,1
1530 DRAW X2-X1,Y2-Y1,1
1540 RETURN
5000 ' This is the image data
5010 DATA L,-350,24,-45,0
5020 DATA L,-450,24,-89,38
5030 DATA L,-55,77,-88,499
5040 DATA L,-129,533,-365,514
5050 DATA L,-365,517,-88,560
5060 DATA L,-11,35,-48,528
5070 DATA L,23,30,-18,529
5080 DATA L,56,99,-18,530
5090 DATA L,124,111,56,99
5100 DATA L,38,24,124,111
5110 DATA L,-64,807,101,679
5120 DATA L,-140,983,101,679
5130 DATA L,-858,786,-185,998
5140 DATA L,-864,752,-197,911
5150 DATA L,-62,687,-158,892
5160 DATA L,-226,836,-138,667
5170 DATA L,-689,586,-150,645
5180 DATA L,-340,640,-689,586
5190 DATA L,-724,633,-354,685
5200 DATA L,-360,701,-724,633
5210 DATA L,-774,676,-375,747
5220 DATA L,-380,765,-774,676
5230 DATA L,-239,796,-328,776
5240 DATA L,-320,757,-230,773
5250 DATA L,-214,729,-295,713
5260 DATA L,-286,695,-206,706
5270 DATA L,-190,663,-263,652
5280 DATA L,-365,788,-367,801
5290 DATA L,-367,801,-359,789
5300 DATA L,-225,827,-226,836
5310 DATA L,-62,687,-64,807
5320 DATA C,-41,31,31,-7,94
5330 DATA C,-90,73,36,-6,87
5340 DATA C,-126,496,38,266,354
5350 DATA C,-82,526,34,261,356
5360 DATA C,32,30,9,44,175
5370 DATA C,-261,553,461,78,93
5380 DATA C,-177,151,50,6,78
5390 DATA C,-811,219,688,-19,6
5400 DATA C,-205,420,50,269,341
5410 DATA C,-190,-999,1469,259,269
5420 DATA C,-264,-1083,1539,262,271
5430 DATA C,-212,414,41,271,339
5440 DATA C,-710,226,573,-21,8
5450 DATA C,-184,148,41,8,78
5460 DATA C,-331,859,768,78,86
5470 DATA C,-49,293,495,163,188
5480 DATA C,-256,278,295,154,196
5490 DATA C,-191,874,38,261,331
5500 DATA C,-865,759,7,80,183
5510 DATA C,-849,764,24,170,246
5520 DATA C,-175,952,47,257,318
5530 DATA C,-150,659,15,-41,89
5540 DATA C,-342,659,19,-25,81
5550 DATA C,-351,657,28,263,342
5560 DATA C,-363,721,20,-26,78
5570 DATA C,-371,721,26,260,342
5580 DATA C,-384,784,20,-12,78
5590 DATA C,-267,686,34,84,155
5600 DATA C,-285,680,15,147,267
5610 DATA C,-199,683,24,254,341
5620 DATA C,-198,683,22,-19,68
5630 DATA C,-217,747,18,-16,80
5640 DATA C,-300,746,33,82,163
5650 DATA C,-317,742,15,159,255
5660 DATA C,-226,746,28,261,347
5670 DATA C,-333,807,31,80,147
5680 DATA C,-256,824,31,-6,77
5690 DATA C,772,75,53,0,360
5700 DATA L,718,64,584,32
5710 DATA L,584,32,535,188
5720 DATA E,531,390,302,197,0,360
5730 DATA C,260,298,67,40,246
5740 DATA C,806,298,67,-69,141
5750 DATA C,426,351,49,0,360
5760 DATA C,639,351,49,0,360
5770 DATA E,533,458,115,54,200,340
5780 DATA E,531,673,151,313,142,263
5790 DATA E,531,673,151,313,-82,37
5800 DATA E,419,708,109,132,104,263
5810 DATA E,644,708,109,132,-83,76
5820 DATA E,400,961,75,61,62,192
5830 DATA E,663,961,75,61,-11,118
5840 DATA L,327,976,736,976
5850 DATA EOI
You can just save it as a .BAS file and use Bas2Tap to make a tape file from it.
User avatar
iss
Wing Commander
Posts: 1641
Joined: Sat Apr 03, 2010 5:43 pm
Location: Bulgaria
Contact:

Re: BASIC Week on reddit ..

Post by iss »

Thanks for info and listing!
This is result running in my emul8D :).
basicweek.jpg
basicweek.jpg (27.3 KiB) Viewed 10442 times
User avatar
ibisum
Wing Commander
Posts: 1646
Joined: Fri Apr 03, 2009 8:56 am
Location: Vienna, Austria
Contact:

Re: BASIC Week on reddit ..

Post by ibisum »

Great work Dbug! Oh, and: d'oh!! :)

Okay we missed it by a day - but I'm pretty sure the folks over there would still enjoy seeing it. ;)
User avatar
Dbug
Site Admin
Posts: 4444
Joined: Fri Jan 06, 2006 10:00 pm
Location: Oslo, Norway
Contact:

Re: BASIC Week on reddit ..

Post by Dbug »

If somebody feels putting that on reddit, just go ahead, apparently one needs to take a photo of a real Oric showing that.
I don't have the time or the patience to do it :)

You got the code, it works, it's slow as crap :D
User avatar
coco.oric
Squad Leader
Posts: 720
Joined: Tue Aug 11, 2009 9:50 am
Location: North of France
Contact:

Re: BASIC Week on reddit ..

Post by coco.oric »

I'm following reddit retrostations now !
I hope that i'll compete next time :lol:
coco.oric as DidierV, CEO Member
Historic owner of Oric, Apple II, Atari ST, Amiga
Post Reply