Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Messages - jj2007

Pages: [1] 2 3 ... 8
Offtopic / Re: WhatA Fu** they...
« on: 06. August 2017, 02:46:57 »
GCC is fine but nobody really uses it with an IDE these days

Found something that supports your statement:
more and more compilers are adopting gcc command line options, pragmas, extensions, abi compatibility, and even bugs

That's the trend: GCC for command line compiling, or from an editor (I compile from RichMasm, of course). That is much better than, for example, using VS Community, which is just horribly bloated and incredibly slow.

Recently I managed to use the GCC QuadMath library from MasmBasic. That was tough, because it's barely documented, and under the hood GCC does really strange things. I spent several days debugging the C code until I had a clue how parameters are passed. C compilers can produce really ugly code 8)

P.S.: FreeBasic may soon have QuadMath, too.

I liked the discussion about including Strings.h ;D

Is there a reason you didn't try the link?

I tried the link, immediately after I had read your post.


General questions and discussions / Re: Method or Madness ;-))
« on: 30. May 2017, 10:21:30 »
JJ, after some research, my graphics card is AMD Radeon HD 6319, CPU is AMD E-300 APU 1.3 GHz
How does this info help? I have junk, right?

No, you don't have junk. It's 399 points (mine) against 170 (yours), but that is OK.

But I really wonder what you are measuring. The time it takes to calculate a Bresenham circle? I doubt it, because even with these values, you need to tell the graphics card what to do with it, via the line command. And that command might be a lot slower than the math...

To illustrate the problem, here a snippet that prints 360x the sinus and cosinus, in double precision. That is more than enough to get a precise 300 pixel circle. The second loop is identical, except that it doesn't print the values, i.e. you get the pure calculation time. And it does the second loop 10,000 times. Check yourself how much time it needs on your PC.

include \masm32\MasmBasic\      ; download
  SetGlobals REAL8 px, py, REAL10 pi180=0.01745329251994329577
  For_ ecx=0 To 359
      push ecx
      fld pi180
      fimul stack
      fstp py
      fstp px
      Print Str$(ecx), Str$("\t%Cf  \t", py), Str$("%Cf\n", px)
      pop eax
  push 9999
      xor ecx, ecx
            push ecx
            fld pi180
            fimul stack
            fstp py
            fstp px
            ; no Print Str$(ecx), Str$("\t%f\t", py), Str$("%f\n", px)
            pop eax
            inc ecx
      .Until ecx>=360
      dec stack
  .Until Sign?
  pop edx
  Inkey Str$("10000 calculations took %i ms", NanoTimer(ms))

General questions and discussions / Re: Method or Madness ;-))
« on: 30. May 2017, 00:31:57 »
@B+: Which Windows version, which CPU, which graphics card?

I have a simple i5 with a standard Nvidia... and 100 circles take 20ms

General questions and discussions / Re: Method or Madness ;-))
« on: 29. May 2017, 04:02:11 »
Are you just using Paint to fill the circle?

No, it's GdipAddPathEllipse, a Windows Gdi+ function. As mentioned above, Ellipse is an even faster option, if you just want simple low quality circles.

The file is RTF, it opens in RichMasm, WordPad, MS Word, LibreOffice, ...

Code and examples / Re: Tree Swirl
« on: 28. May 2017, 18:02:09 »

General questions and discussions / Re: Method or Madness ;-))
« on: 28. May 2017, 17:54:00 »
The speed of Small Basic for drawing circles, was unexpected.

Your 156 ms on top of the image are realistic. This is roughly what I get on my core i5 with the attached code, which simply uses the built-in Windows function GdipAddPathEllipse. What is your cpu?

Note that GdipAddPathEllipse is a slow Gdi+ function. The standard GDI Ellipse function is about ten times as fast.

General questions and discussions / Re: Method or Madness ;-))
« on: 26. May 2017, 14:51:54 »
In my experience, the time to draw circles depends exclusively on what the graphics card can deliver. Calculating sinuses costs cycles, of course, but the filling and drawing costs much more.

Do you have an explanation why you see such big differences? Do you have timings?

Attached an example that fills a window with a hundred circles. Here is the source:

include \masm32\MasmBasic\Res\MbGui.asm      ; MasmBasic
  Dim Pens() As DWORD
  Dim Brushes() As DWORD
  For_ ct=0 To 99
      MakePen Pens(ct), Rand(-1), width 9      ; use random colours
      MakeBrush Brushes(ct), Rand(-1)      ; also for the fill
  MakePath      123, Circle(200)      ; radius as n/1000 of window rect
  SetGlobals posX, posY, pen, brush
Event Paint
  For_ ecx=0 To 99      ; ID            pen/brush                  x            y            scaleX            scaleY
      GuiDraw 123, <Pens(ecx)/Brushes(ecx)>, <Rand(500)>, <Rand(550)>, <Rand(800)>, <Rand(800)>
  GuiText 100.0-220, 100.0-22, Str$("%i ms (resize window to refresh)", NanoTimer(ms))      ; ca 20ms on a Core i5

Code and examples / Re: Power basic - Analog Clock
« on: 28. April 2017, 15:07:57 »
Yes .. Power Basic  :D
Jose Roca site have many great programs and examples.

With the Classic PowerBASIC Compiler 9.07 for Windows, it works after two little changes:

#INCLUDE ONCE "\PowerBasic\WinAPI\"

                  BYVAL pszCmdLine AS WSTRINGZ PTR, BYVAL iCmdShow AS LONG) AS LONG
                  BYVAL pszCmdLine AS LONG PTR, BYVAL iCmdShow AS LONG) AS LONG

Community news and announcements / Re: New SpecBAS updates preview
« on: 05. April 2017, 11:40:31 »
a particle engine - handles forces (gravity in this demo, but the syntax will likely change so the user can apply many forces at once) and friction/elasticity for collisions and movement. It's mass-based so suitable for all sorts of applications. PLOT has been upgraded to handle an array of points with colours and radius information inside the array.

You are a madman, Dunny ;D

Offtopic / Re: My Workstation. What's Yours?
« on: 10. March 2017, 01:33:37 »
That's an OpenPandora, running Angstrom Linux with XFCE as the window manager. It's a lovely little machine, and the reason that SpecBAS runs at a default resolution of 800x480 :)

Looks nice in your first post, but in this one (google user content) I just see a small grey circle with a white bar in an otherwise huge empty image... :(

About dialect development / Plug-ins for the RichMasm editor
« on: 01. February 2017, 13:46:03 »
RichMasm has a comfortable plug-in interface, giving access to e.g. the selected text, the handle to the RichEdit control, etc.

Attached the CompileBasic plugin for compiling sources written in a dozen BASIC dialects, plus some C/C++ variants. Extract to \Masm32\MasmBasic\Plugins; after a restart of RichMasm, the plugin will be in the System & Plugins menu. From then on, you can just paste a source code in RichMasm, then hit Ctrl F5 to compile it (provided the paths are set correctly, see CompileBasFiles.ini).

Once your source compiles correctly, a simple F5 will be sufficient. You can always use Ctrl F5 to see the dialog and change any commandline settings.

Pages: [1] 2 3 ... 8