+Spaced Cowboy Posted February 11, 2018 Share Posted February 11, 2018 actually they are quite different: http://manillismo.blogspot.com/2015/03/fedora-hat-diferencias.html Most of those differences probably come down to a phase difference in the algorithm. 1 Quote Link to comment Share on other sites More sharing options...
dmsc Posted February 11, 2018 Share Posted February 11, 2018 Hi! Most of those differences probably come down to a phase difference in the algorithm. And in the rounding differences. Attached are two versions, the old one that does not round in the last operation and a new that does round, the results ar different, but I don't know which is really "better". Original: Rounded: In run-time the rounded one is less than 0.1s slower. fedora-orig.xex fedora-round.xex 7 Quote Link to comment Share on other sites More sharing options...
_The Doctor__ Posted February 11, 2018 Share Posted February 11, 2018 (edited) oddly enough I like the second one better, and that is slightly confusing to me. And in fact I've now downloaded it. Edited February 11, 2018 by _The Doctor__ Quote Link to comment Share on other sites More sharing options...
tebe Posted February 13, 2018 Share Posted February 13, 2018 impressive job DMSC CA65 -> MADS RELOC in attachment fedorahat_mads_reloc.zip 1 Quote Link to comment Share on other sites More sharing options...
JamesD Posted April 22, 2018 Share Posted April 22, 2018 I posted a BASIC patch for the CoCo 3 today that replaces the regular multiply with a version that uses the hardware multiply instruction of the 6809.It speeds up BASIC code without any other changes.This was a quick and dirty test comparison vs regular BASIC, it hasn't been timed yet and it was just thrown together.It will give you an idea of the speed difference. 20% to 30% faster? And there's room for improvement. 3 Quote Link to comment Share on other sites More sharing options...
JamesD Posted April 23, 2018 Share Posted April 23, 2018 It took a while to find the right code in this thread. Here is the Atari code and the CoCo 3 patches including timing It takes just under 14 minutes to complete, down from over 19. That time is better than my original estimate for the 6309 which should now be under 11.2 minutes. 100 SX=144:SY=56:SZ=64:CX=320:CY=192 110 C1=2.2*SY:C2=1.6*SY 120 DIM RR(CX) 130 FOR I=0 TO CX:RR(I)=CY:NEXT I 140 GRAPHICS 8+16:SETCOLOR 2,0,0:COLOR 1 150 CX=CX*0.5:CY=CY*0.46875:FX=SX/64:FZ=SZ/64 160 XF=4.71238905/SX 170 FOR ZI=64 TO -64 STEP -1 180 ZT=ZI*FX:ZS=ZT*ZT 190 XL=INT(SQR(SX*SX-ZS)+0.5) 200 ZX=ZI*FZ+CX:ZY=CY+ZI*FZ 210 FOR XI=0 TO XL 220 A=SIN(SQR(XI*XI+ZS)*XF) 230 Y1=ZY-A*(C1-C2*A*A) 240 X1=XI+ZX 250 IF RR(X1)>Y1 THEN RR(X1)=Y1:PLOT X1,Y1 260 X1=ZX-XI 270 IF RR(X1)>Y1 THEN RR(X1)=Y1:PLOT X1,Y1 280 NEXT XI 290 NEXT ZI 80 TIMER=0 90 POKE 65497,0 140 PMODE 4,1:HSCREEN 2:SCREEN 1,1 250 IF RR(X1)>Y1 THEN RR(X1)=Y1:HSET(X1,Y1) 270 IF RR(X1)>Y1 THEN RR(X1)=Y1:HSET(X1,Y1) 300 PRINT"TIME",TIMER/60 Quote Link to comment Share on other sites More sharing options...
devwebcl Posted May 5, 2018 Share Posted May 5, 2018 It took a while to find the right code in this thread. Here is the Atari code and the CoCo 3 patches including timing It takes just under 14 minutes to complete, down from over 19. That time is better than my original estimate for the 6309 which should now be under 11.2 minutes. 100 SX=144:SY=56:SZ=64:CX=320:CY=192 110 C1=2.2*SY:C2=1.6*SY 120 DIM RR(CX) 130 FOR I=0 TO CX:RR(I)=CY:NEXT I 140 GRAPHICS 8+16:SETCOLOR 2,0,0:COLOR 1 150 CX=CX*0.5:CY=CY*0.46875:FX=SX/64:FZ=SZ/64 160 XF=4.71238905/SX 170 FOR ZI=64 TO -64 STEP -1 180 ZT=ZI*FX:ZS=ZT*ZT 190 XL=INT(SQR(SX*SX-ZS)+0.5) 200 ZX=ZI*FZ+CX:ZY=CY+ZI*FZ 210 FOR XI=0 TO XL 220 A=SIN(SQR(XI*XI+ZS)*XF) 230 Y1=ZY-A*(C1-C2*A*A) 240 X1=XI+ZX 250 IF RR(X1)>Y1 THEN RR(X1)=Y1:PLOT X1,Y1 260 X1=ZX-XI 270 IF RR(X1)>Y1 THEN RR(X1)=Y1:PLOT X1,Y1 280 NEXT XI 290 NEXT ZI 80 TIMER=0 90 POKE 65497,0 140 PMODE 4,1:HSCREEN 2:SCREEN 1,1 250 IF RR(X1)>Y1 THEN RR(X1)=Y1:HSET(X1,Y1) 270 IF RR(X1)>Y1 THEN RR(X1)=Y1:HSET(X1,Y1) 300 PRINT"TIME",TIMER/60 Well done. Still I think executing to the half by it synmetry is much better. Quote Link to comment Share on other sites More sharing options...
JamesD Posted May 5, 2018 Share Posted May 5, 2018 (edited) Well done. Still I think executing to the half by it synmetry is much better. I just ported it, someone else came up with the algorithm. My replacement line 140 has a couple old commands that aren't needed for the Super Extended Color BASIC graphics mode. It guess it only needs the HSCREEN. I've written exactly 3 BASIC programs for the CoCo 3, and all years apart, so I'm not exactly an expert on it. There is a 16x16 bit multiply I could patch that would speed up array indexing. It would speed this up a little as would several other changes I made to the MC-10 ROM. That is now around 8% faster for non-math intensive stuff, so there is clearly room for improvement, but the CoCo has a lot of BASIC software that could break, where the MC-10 did not. For benchmarking it would probably be better to use a faster plot to make timing easier. The end result isn't as pretty though. Fractals, foureir transforms, etc... are some other things this patch would speed up. Edited May 5, 2018 by JamesD Quote Link to comment Share on other sites More sharing options...
tebe Posted May 6, 2018 Share Posted May 6, 2018 (edited) program fedora_hat; uses crt, graph, sysutils; const sx: single = 144; sx_2 : single = 144 * 144; sy: single = 56; half: single = 0.5; sz = 64; cx = 320; cy = 192; var c1, c2, scx, scy, xf, zt, zs, fx, fy, fz, zx, zy, a, ifz: single; i: word; gd, gm, xl, xi, x1, y1: smallint; zi: shortint; tim: cardinal; rr: array [0..cx-1] of smallint; begin gd := D8bit; gm := m640x480; InitGraph(gd,gm,''); tim:=GetTickCount; c1:=2.2*sy; c2:=1.6*sy; for i:=0 to cx-1 do rr[i] := cy; scx:=cx * 0.5; scy:=cy * 0.46875; fx:=sx/64; fz:=sz/64; zt:=fx*64; ifz:=fz*64; xf:=4.71238905/sx; for zi:=64 downto -64 do begin zs:=zt*zt; xl:=trunc(sqrt(sx_2-zs)+half); zx:=ifz+scx; zy:=ifz+scy; for xi:=0 to xl do begin a:=sin(sqrt(xi*xi+zs)*xf); y1:=trunc(zy-a*(c1-c2*a*a)); x1:=trunc(xi+zx); if rr[x1] > y1 then begin rr[x1]:=y1; PutPixel(x1,y1, 15) end; x1:=trunc(zx-xi); if rr[x1] > y1 then begin rr[x1]:=y1; PutPixel(x1,y1, 15) end; end; zt:=zt-fx; ifz:=ifz-fz; end; writeln(GetTickCount - tim,' tick'); repeat until keypressed; end. 22455 ticks = ~7.485 min fedorahat_pascal.zip Edited May 6, 2018 by tebe 4 Quote Link to comment Share on other sites More sharing options...
JamesD Posted May 6, 2018 Share Posted May 6, 2018 22455 ticks = ~7.485 min Nice! I've always preferred C over Pascal, but I liked Pascal better than BASIC. A good compiler is always going to beat interpreters. Having to parse lines and convert numerical constants every time a line is executed really slows down most interpreters. 1 Quote Link to comment Share on other sites More sharing options...
TheGreatGrizz Posted October 21, 2018 Share Posted October 21, 2018 (edited) I tried it using turbo basic xl 1.5 with altirra emulator and it ran 3 times faster if I remember correctly ! About 1 houre instead of 3 houres with atari basic. In quick basic 64 on windows 10 64 bits I think I got over 100 frames per second... on a 4.0 ghz cpu... I intend to try it on VICE emulator for pet cbm computer with hires video card emulator... version 3.2 (or 3.3) ? emulates hires grafx I think... To be continued... Edited October 21, 2018 by TheGreatGrizz Quote Link to comment Share on other sites More sharing options...
Geister Posted October 22, 2018 Share Posted October 22, 2018 I already did a version for the C64 on the VICE emulator. It was nice because the 320X200 resolution matched the calculated extents in the program without having to trap for an out of bounds error as the Atari code has to do. Unfortunately, the lack of any plot or drawto commands in Commodore Basic V2.0 made the graphics very "POKEy" 1 Quote Link to comment Share on other sites More sharing options...
Faicuai Posted October 24, 2018 Share Posted October 24, 2018 (edited) Latest run on Atari800/Incognito (and 800XL/Ultimate): 1. Assembler / Machine code: 00m:16.80s 2. Altirra Basic v1.55: 11m:27.31s 3. TurboBasic v1.50: 12m:15.22s Hand-timed, directly, to avoid fouled-up internal timers. Above results achieved with high-performance ROMs that I posted a while ago, as well as shutting down Antic for max. 6502 throughput (now supported NATIVELY by such ROMs thanks to Atari's own vestigial code left in there since 1983, and no longer needed in Basic or any other high-level code). Edited October 24, 2018 by Faicuai 2 Quote Link to comment Share on other sites More sharing options...
_The Doctor__ Posted October 24, 2018 Share Posted October 24, 2018 would be cool to have you post up the complete fedora with O.S. package in a zip for all to enjoy right here in this thread. perhaps a blurb on how the folks can do the burn and install and all the methods in between. I kind of would like this to become the official rom of the line... 1 Quote Link to comment Share on other sites More sharing options...
Faicuai Posted October 30, 2018 Share Posted October 30, 2018 (edited) would be cool to have you post up the complete fedora with O.S. package in a zip for all to enjoy right here in this thread. perhaps a blurb on how the folks can do the burn and install and all the methods in between. I kind of would like this to become the official rom of the line... Good idea! Been working on putting this together, with some extra bonus items. Here's the most recent update: Assembler / Machine code: 00m:16.80s FastBasic 3.5: 09m:05s (=> includes spatial optimization that chops 10secs. of runtime, about 2,500 FO ops). Altirra Basic v1.55: 11m:27.31s TurboBasic v1.50: 12m:15.22s I am attaching two .ATRs: First one is a hand-picked collection of system BIOS/ROMS, to be used (preferably) on Incognito and/or Ultimate (because it is breeze to upload them there, via SDX and UFlash). They can also be burned in a compatible EPROM chip, if that's what is available. All of these ROMs have been properly signed and will pass checksum tests, where applicable. So far, they will beat the shit (in relative terms) out of practically anything that is out there, math-wise. A special, custom high-performance FP version of Avery's Altirra ROM has been included (for testing / joy purposes). Altirra Basic 1.55 8K rom also included, which combined with the above, puts the A800/XL into early (stock) Intel 8088 / 8086 territory, while STILL being interpreted, and STILL fitting 8K, also matching or exceeding Z80 performance (when it comes to most of these classical benchmarks). Anything that shows "XE0Xi___" is for INCOGNITO (A800), and "XE0Xu___" is for Ultimate (XL). F__ means only 1200XL function-keys revived. FP_ means latter+ FP pack. FPH means latter + XL Help key enabled. BIOS-Ultimate_Incognito.atr Second one is a collection of classical (hand written and/or ported) benchmarks, in both Basic and machine-executable code: .BAS stands for Atari Basic .FAB stands for Fast Basic (FEDORA02.FAB, from the above update is there) .MSB stands for Microsoft Basic .CPM stands for CPM text file to be run with Microsoft Basic 5.29 (CPM). NO NEED to translate with ICDS copy function. Most basic files include extensive cross-platform results in REM section, for your convenience. .OBJ means that is directly executable from SDX / DOS prompt. ICDS utility to transfer from SIO attached ATR into IndusGT (#1) SIO floppy drive. A revised Trub Terminal with better colors. Scratchpad.atr Have fun! Edited October 30, 2018 by Faicuai 3 Quote Link to comment Share on other sites More sharing options...
fujidude Posted October 30, 2018 Share Posted October 30, 2018 (edited) Here is an updated Python 3 version of the program. Should run on any platform which has Python 3 installed: #!/usr/bin/env python3 # -*- coding: utf-8 -*- # ---------------------------------------------------------------------------- # Name: archimedes.py # Purpose: implement the Archimedes' spiral prgoram in Python 3.x # # Author: fujidude for just the Python version, original code # Charles Bachand, pub. Antic magazine, issue 7, pp.60-61. # # Created: 2018-10-29 # ---------------------------------------------------------------------------- # import necessary modules import tkinter import math def end(): rootwin.destroy() rootwin = tkinter.Tk() # main (root) application window based on Tkinter rootwin.wm_title("Archimedes' Spiral") quitBtn = tkinter.Button(rootwin, text="Exit", command=end) quitBtn.pack(side="bottom") graphzone = tkinter.Canvas(rootwin, width=320, height=192, bg="lightblue") graphzone.pack() XP = 144 XR = 4.71238905 XF = XR / XP for ZI in range(-64, 65): ZT = ZI * 2.25 ZS = ZT * ZT XL = int(math.sqrt(20736 - ZS) + 0.5) for XI in range(0 - XL, XL+1): XT = math.sqrt(XI * XI + ZS) * XF YY = (math.sin(XT) + math.sin(XT * 3) * 0.4) * 56 X1 = XI + ZI + 160 Y1 = 90 - YY + ZI graphzone.create_oval(X1, Y1, X1, Y1, fill="white") graphzone.create_line(X1, Y1+1, X1, 191, fill="white") rootwin.mainloop() And then here is a screenshot of it after run: Edited October 30, 2018 by fujidude 1 Quote Link to comment Share on other sites More sharing options...
os9dude Posted January 26, 2019 Share Posted January 26, 2019 My ports to the Tandy Color Computer 1/2 and 3. The 1/2 run in the PMODE 4 screen 256x192 black on white background, using the high speed POKE in there. The CoCo 3 runs in its highest 640x192 BASIC resolution screen, also with the high speed POKE plus a little banner added just for fun once the graph is finished.The TRS-80 Model 4 version I did more or less is the same as the CoCo 3. - - - - - - - - - - 10 ' CoCo 1/2 Archimedes Hat20 '40 ' from the AtariAge Forum50 '90 POKE 65495,0100 SX=116:SY=44:SZ=51:CX=256:CY=192110 DIM RR(CX)120 FOR I=0 TO CX:RR(I)=CY:NEXT I130 PMODE 4:PCLS 1:SCREEN 1,1:COLOR 0140 CX=CX*.5:CY=CY*.46875:FX=SX/64:FZ=SZ/64150 XF=4.71238905/SX160 FOR ZI=64 TO -64 STEP -1170 ZT=ZI*FX:ZS=ZT*ZT180 XL=INT(SQR(SX*SX-ZS)+.5)190 ZX=ZI*FZ+CX:ZY=CY+ZI*FZ200 FOR XI=0 TO XL210 XT=SQR(XI*XI+ZS)*XF220 YY=(SIN(XT)+SIN(XT*3)*.4)*SY230 X1=XI+ZX:Y1=ZY-YY240 IF RR(X1)>Y1 THEN RR(X1)=Y1:PSET(X1,Y1)250 X1=ZX-XI260 IF RR(X1)>Y1 THEN RR(X1)=Y1:PSET(X1,Y1)270 NEXT XI,ZI280 SOUND 180,5290 GOTO 290 - - - - - - - - - - 10 ' CoCo 3 Archimedes Hat15 ' 640x192 HSCREEN Version20 '30 ' from the AtariAge Forum40 '90 POKE 65497,0:ON BRK GOTO 300100 SX=256:SY=56:SZ=64:CX=640:CY=192110 DIM RR(CX)120 FOR I=0 TO CX:RR(I)=CY:NEXT I125 RGB:PALETTE 0,0:PALETTE 1,18130 HSCREEN 3:HCLS 0140 CX=CX*.5:CY=CY*.46875:FX=SX/64:FZ=SZ/64150 XF=4.71238905/SX160 FOR ZI=64 TO -64 STEP -1170 ZT=ZI*FX:ZS=ZT*ZT180 XL=INT(SQR(SX*SX-ZS)+.5)190 ZX=ZI*FZ+CX:ZY=CY+ZI*FZ200 FOR XI=0 TO XL210 XT=SQR(XI*XI+ZS)*XF220 YY=(SIN(XT)+SIN(XT*3)*.4)*SY230 X1=XI+ZX:Y1=ZY-YY240 IF RR(X1)>Y1 THEN RR(X1)=Y1:HSET(X1,Y1)250 X1=ZX-XI260 IF RR(X1)>Y1 THEN RR(X1)=Y1:HSET(X1,Y1)270 NEXT XI,ZI280 SOUND 180,5285 HPRINT(0,0),"El Sombrero de Arquimides"290 GOTO 290300 POKE 65496,0:RGB:END 2 Quote Link to comment Share on other sites More sharing options...
JamesD Posted January 27, 2019 Share Posted January 27, 2019 Pretty sure it was already ported to the CoCo Quote Link to comment Share on other sites More sharing options...
Mike ab3ap Posted May 4, 2022 Share Posted May 4, 2022 I'm 3 years late to the party but will risk reviving a sleeping thread! Only after exploring the hat code, did I learn of the conversation here. For any still interested, here are my reverse engineering and python efforts from a week or so ago: https://udel.edu/~mm/hat 2 Quote Link to comment Share on other sites More sharing options...
Ricky Spanish Posted August 14, 2022 Share Posted August 14, 2022 With stock 1200XL, BASICXE w/ extension disk, did some optimizations to the code, 5min 15sec runtime. Quote Link to comment Share on other sites More sharing options...
Ricky Spanish Posted August 20, 2022 Share Posted August 20, 2022 On 8/14/2022 at 6:18 PM, Ricky Spanish said: With stock 1200XL, BASICXE w/ extension disk, did some optimizations to the code, 5min 15sec runtime. Seems I made an error. I was using an already modified 'fedora' program. Rookie mistake. I since used the real Archimedes Spiral program from ANALOG. With BASICXE w/extensions disk runtime went from the 3 hour original, to 1hr 10mins 25 secs. 1hr 9mins 59 secs with the FAST command. Zero modifications to the program. I must say the original program looks smoother/better than any of the modified ones. In my humble opinion. Quote Link to comment Share on other sites More sharing options...
JamesD Posted October 20, 2022 Share Posted October 20, 2022 I made an update to the CoCo 3 code on my blog. I added 6309 native mode control as well as the hardware multiply patch. The multiply patch won't work on the CoCo 1/2, but the native mode control will if you have a 6309.https://jdiffendaffer.blogspot.com/2022/10/fedora-3d-plot-update.html 1 Quote Link to comment Share on other sites More sharing options...
JamesD Posted October 20, 2022 Share Posted October 20, 2022 On 4/23/2018 at 3:11 PM, JamesD said: It took a while to find the right code in this thread. Here is the Atari code and the CoCo 3 patches including timing It takes just under 14 minutes to complete, down from over 19. That time is better than my original estimate for the 6309 which should now be under 11.2 minutes. I timed it at 11.7 minutes. Okay, I was off by half a minute on the estimate. Quote Link to comment Share on other sites More sharing options...
markmiller Posted November 4, 2023 Share Posted November 4, 2023 I came over to this topic from a discussion about Turbo Basic XL on the Atari 8-bit. I love seeing these 3D "curve" programs on the Atari. When I was growing up, I always saw these on other computers, but not the Atari. I tried compiling the optimizations I saw discussed between @dmsc and @devwebcl, and only saw a performance improvement of a few minutes compared to the interpreted versions. The fastest I was able to get was 14.2 minutes with dmsc's code: 100 SX=144:SY=56:SZ=64:CX=320:CY=192 110 C1=2.2*SY:C2=1.6*SY 120 DIM RR(CX) 130 FOR I=0 TO CX:RR(I)=CY:NEXT I 140 GRAPHICS 8+16:SETCOLOR 2,0,0:COLOR 1 150 CX=CX*0.5:CY=CY*0.46875:FX=SX/64:FZ=SZ/64 160 XF=4.71238905/SX 170 FOR ZI=64 TO -64 STEP -1 180 ZT=ZI*FX:ZS=ZT*ZT 190 XL=INT(SQR(SX*SX-ZS)+0.5) 200 ZX=ZI*FZ+CX:ZY=CY+ZI*FZ 210 FOR XI=0 TO XL 220 A=SIN(SQR(XI*XI+ZS)*XF) 230 Y1=ZY-A*(C1-C2*A*A) 240 X1=XI+ZX 250 IF RR(X1)>Y1 THEN RR(X1)=Y1:PLOT X1,Y1 260 X1=ZX-XI 270 IF RR(X1)>Y1 THEN RR(X1)=Y1:PLOT X1,Y1 280 NEXT XI 290 NEXT ZI This figures, since as someone on here said, compiling doesn't speed up the trig functions, nor drawing on the screen, since one relies on TB's runtime, and the other depends on the OS. So, it's just getting to the same functions faster. I was unable to get the Compute version of "Fedora" (which started this discussion) to run properly after compiling (the runtime complained of an invalid value at Line 90). The interpreted version ran fine. Pretty typical for the compiler... 1 Quote Link to comment Share on other sites More sharing options...
Geister Posted November 4, 2023 Share Posted November 4, 2023 Damn, I must be getting senile. I forgot about a lot of these versions. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.