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 ... 9
1
Code and examples / Re: Happy New Year 2018
« on: 02. January 2018, 18:53:56 »
Nice demo, B+!
Happy New Year to everybody :)

2
Community news and announcements / Re: MasmBasic
« on: 26. December 2017, 02:09:14 »
MasmBasic got updated, see download and installation. Inter alia, many standard Windows controls are now easily accessible via the GuiControl command:
Code: [Select]
include \masm32\MasmBasic\Res\MbGui.asm
  GuiControl MyEdit, "richedit", NoTag$(FileRead$("http://retrogamecoding.org/board/index.php?board=17.0"))
GuiEnd

This is sufficient to create a full-fledged Windows application. Here is a more elaborate example of an application with 18 controls, like edit, static, richedit, syslink, date & time, progressbar, trackbar, etc.


Btw with 5319 characters in 80 lines, the source for this demo would have fit into the 100 Line-of-Code Programming Language Competition:
The limit is 255 characters X 100 lines = 25500 characters, that is a clear limit.

3
Offtopic / Re: Merry Christmas !
« on: 26. December 2017, 01:49:48 »
... and (upcoming) a Happy New Year!  :)

4
Community news and announcements / Re: MasmBasic
« on: 10. November 2017, 00:48:57 »
Then it's normally one macro only. However, the wide versions (wOpen, wPrint, ...) count as separate macros.

5
Version 8 November 2017 is ready to be installed. Changes:

- updated help file, with now 400+ macros documented (also online - use Ctrl F to find commands; but remember the best help option is to use RichMasm, hover over a keyword like Open, then right-click on the word and copy the line that fits your case)

- fDate$() and fTime$() can now take a third parameter to force any language:

include \masm32\MasmBasic\MasmBasic.inc
  Init
  Print "Right now, ", fDate$(0, "dddd dd MMMM yyyy "), fTime$(0, "HH:mm:ss"), Str$(", we are in ISO week %i\n", IsoWeek())
  Print fDate$(0, "dddd dd MMMM yyyy ", russian), fTime$(0, "HH:mm"), Str$(", мы находимся в ИСО неделе %i", IsoWeek())
  wMsgBox 0, wCat$(wfDate$(0, "dddd dd MMMM yyyy ", hindi)+wfTime$(0)), "This is Unicode:", MB_OK
EndOfCode

Output:
Right now, Wednesday 08 November 2017 04:55:26, we are in ISO week 45
среда 08 ноября 2017 04:55, мы находимся в ИСО неделе 45


- SetInt can now move the content of ST(0) to xmm0:
  fldpi
  Print Str$("PI=\t%Jf\n", ST(0))
  fmul FP4(100.0)
  SetInt ecx
  Print Str$("100*PI=\t %i\n", ecx)
  fldpi
  fmul FP8(10.0e16)
  SetInt xmm0
  Print Str$("100*PI=\t %i\n", xmm0)


Code: [Select]
Output:
PI=     3.141592653589793238
100*PI=  314
10e16*PI=314159265358979324

- finally, the ternary operator If? can now also take the Zero? and Carry? flags as input (testbed attached):

  xor ecx, ecx
  Print Str$("zero flag set: %i\txor ecx, ecx\n", If?(zero?, 111, 222))         ; prints first number, 111
  or ecx, -1
  Print Str$("zero flag set: %i\tor ecx, -1\n", If?(zero?, 111, 222))   ; prints second number, 222
  stc
  Print Str$("carry set: %i\tstc\n", If?(Carry?, 111, 222))     ; carry is set, prints 111
  clc
  Print Str$("carry set: %i\tclc\n", If?(Carry?, 111, 222))     ; carry clear, prints 222

6
Code and examples / Map viewer
« on: 23. October 2017, 00:40:01 »
A simple map viewer, full source and exe attached (building requires MasmBasic 23 Oct 2017 or later). Extract all files to a folder and launch the exe.

To make it run properly, an instance of M$ Excel should be running. In case you don't have Office: Microsoft's free Excel Viewer works perfectly.

The map viewer example does the following in just under 100 lines of code:
- grab data from an Excel spreadsheet
- translate the data into a colour code, from green=good, yellow=medium to red=bad
- display everything as a map, including tooltips as shown below.

Tested so far on Win7-64 and Win10, grateful for feedback. Hit F1 to see the data as a list.

7
Code and examples / Re: Fall Foliage
« on: 23. October 2017, 00:34:30 »
Looks pretty realistic - compliments :)

8
Fantastic, Dunny!

9
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:
Quote
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.

10
I liked the discussion about including Strings.h ;D

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

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

12
Do:the:rules:allow:multiple:instructions:on:one:line?

13
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\MasmBasic.inc      ; download
  SetGlobals REAL8 px, py, REAL10 pi180=0.01745329251994329577
  Init
  For_ ecx=0 To 359
      push ecx
      fld pi180
      fimul stack
      fsincos
      fstp py
      fstp px
      Print Str$(ecx), Str$("\t%Cf  \t", py), Str$("%Cf\n", px)
      pop eax
  Next
  NanoTimer()
  push 9999
  .Repeat
      xor ecx, ecx
      .Repeat
            push ecx
            fld pi180
            fimul stack
            fsincos
            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))
EndOfCode

14
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

15
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, ...

Pages: [1] 2 3 ... 9