Author Topic: QB64x64 (12-22-2018)  (Read 11956 times)

0 Members and 1 Guest are viewing this topic.

Offline RhoSigma

  • QB64 Developer
  • Forum Resident
  • Posts: 565
    • View Profile
Re: QB64x64 (12-22-2018)
« Reply #15 on: December 22, 2018, 12:37:46 pm »
Hi Steve, here some more info for you...

Your latest request to check the x64 version from 06-17-2015:
-> everything working just fine for me

Your previous x64 version from 07-21-2018:
-> still everything working just fine for me

Your latest x64 version from 12-22-2018 (after your LINE related fix):
-> LINE , LINE..., B, LINE..., BF seems ok now
-> but LINE with style% argument seems to ignore the given style%, lines are always fully drawn
« Last Edit: January 22, 2019, 02:48:40 am by RhoSigma »
My Projects:   https://qb64forum.alephc.xyz/index.php?topic=809
GuiTools - A graphic UI framework (can do multiple UI forms/windows in one program)
Libraries - ImageProcess, StringBuffers (virt. files), MD5/SHA2-Hash, LZW etc.
Bonus - Blankers, QB64/Notepad++ setup pack

Offline SMcNeill

  • QB64 Developer
  • Forum Resident
  • Posts: 3972
    • View Profile
    • Steve’s QB64 Archive Forum
Re: QB64x64 (12-22-2018)
« Reply #16 on: December 22, 2018, 01:11:48 pm »
I noticed the line style was off.  It should be fixed now.  (Or else I uploaded the wrong 7z file.)  I’ll recheck things on my end again.

********

Reply #11 (Best Answer) should have the fix for line and style both.  If it doesn’t, I’ll dig a little more.
« Last Edit: December 22, 2018, 01:16:29 pm by SMcNeill »
https://github.com/SteveMcNeill/Steve64 — A github collection of all things Steve!

Offline bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
    • View Profile
Re: QB64x64 (12-22-2018)
« Reply #17 on: December 22, 2018, 05:34:49 pm »
Steve, again problems with download of 7z file. I think it originates with browser (Opera) and your link from here but Windows is showing very new kind of Dialog window I've never seen before, maybe buggy or maybe extraction isn't working correctly?
« Last Edit: December 22, 2018, 05:37:50 pm by bplus »

Offline SMcNeill

  • QB64 Developer
  • Forum Resident
  • Posts: 3972
    • View Profile
    • Steve’s QB64 Archive Forum
Re: QB64x64 (12-22-2018)
« Reply #18 on: December 23, 2018, 12:10:09 am »
Steve, again problems with download of 7z file. I think it originates with browser (Opera) and your link from here but Windows is showing very new kind of Dialog window I've never seen before, maybe buggy or maybe extraction isn't working correctly?

Was compressed in Bzip instead of lhza2 (whatever the 2 exact abbreviations are, I didn't bother to go recheck)...   Try this version: it’s zipped in the other format — https://www.dropbox.com/s/56a267uav7cub9d/QB64x64%20%2812-22-2018%29.7z?dl=1
https://github.com/SteveMcNeill/Steve64 — A github collection of all things Steve!

Offline Cobalt

  • QB64 Developer
  • Forum Resident
  • Posts: 878
  • At 60 I become highly radioactive!
    • View Profile
Re: QB64x64 (12-22-2018)
« Reply #19 on: December 23, 2018, 12:12:40 am »
is this just Unzip and run? or do I need to do something first, getting "c++ compilation failed" trying to run the speed test code from the other post(why so slow)
Granted after becoming radioactive I only have a half-life!

Offline SMcNeill

  • QB64 Developer
  • Forum Resident
  • Posts: 3972
    • View Profile
    • Steve’s QB64 Archive Forum
Re: QB64x64 (12-22-2018)
« Reply #20 on: December 23, 2018, 12:44:18 am »
It should be unzip and run, unless I'm going old and crazy -- which is always a possibility.
https://github.com/SteveMcNeill/Steve64 — A github collection of all things Steve!

Offline Qwerkey

  • Forum Resident
  • Posts: 755
    • View Profile
Re: QB64x64 (12-22-2018)
« Reply #21 on: December 23, 2018, 05:55:00 am »
Mine also crashed inside a FUNCTION

Code: QB64: [Select]
  1. FUNCTION ToHardware& (ImgName$, X1%, Y1%)
  2.     TempImg& = _NEWIMAGE(X1%, Y1%, 32)
  3.     _PUTIMAGE (0, 0)-(X1% - 1, Y1% - 1), _LOADIMAGE(ImgName$, 32), TempImg&
  4.     ToHardware& = _COPYIMAGE(TempImg&, 33)
  5.     _FREEIMAGE TempImg&

at the _PUTIMAGE line.

* might want to check this for a memory leak as well.  There’s no way to FREEIMAGE the _LOADIMAGE when _PUTIMAGE is done. 

I think that I must be still be making elementary mistakes.

Code: QB64: [Select]
  1. FUNCTION ToHardware& (ImgName$, X1%, Y1%)
  2.     TempImg& = _NEWIMAGE(X1%, Y1%, 32)
  3.     _PUTIMAGE (0, 0)-(X1% - 1, Y1% - 1), _LOADIMAGE(ImgName$, 32), TempImg&
  4.     ToHardware& = _COPYIMAGE(TempImg&, 33)
  5.     _FREEIMAGE TempImg&
  6.  
  7. FUNCTION ToHardware1& (ImgName$, X1%, Y1%)
  8.     TempImg& = _NEWIMAGE(X1%, Y1%, 32)
  9.     Temp2mg& = _LOADIMAGE(ImgName$, 32)
  10.     _PUTIMAGE (0, 0)-(X1% - 1, Y1% - 1), Temp2mg&, TempImg&
  11.     ToHardware1& = _COPYIMAGE(TempImg&, 33)
  12.     _FREEIMAGE Temp2mg&
  13.     _FREEIMAGE TempImg&

Originally my FUNCTION was as in ToHardware1&, where Temp2mg& is explicitly freed after use.  But then I thought I'd optimise program lines and moved the _LOADIMAGE directly into the _PUTIMAGE, thinking that _FREEIMAGE would not then be required.  So you must always do _FREEIMAGE and never put _LOADIMAGE into a _PUTIMAGE?  I will use this method in future.

Offline Qwerkey

  • Forum Resident
  • Posts: 755
    • View Profile
Re: QB64x64 (12-22-2018)
« Reply #22 on: December 23, 2018, 06:54:01 am »
With your latest version and _FREEIMAGE used everywhere, all works well.

Offline Qwerkey

  • Forum Resident
  • Posts: 755
    • View Profile
Re: QB64x64 (12-22-2018)
« Reply #23 on: December 23, 2018, 07:47:35 am »
From Fellippe: Can't mix variables with CONST.

Is this not allowed:
Code: QB64: [Select]
  1. CONST XGrid%% = 24, YGrid%% = 16, BlockSize%% = 51, MidExit%% = XGrid%% \ 2

where the last CONST is defined as half the value of the first?

I've used it in my code and it gives the correct value.

Offline Qwerkey

  • Forum Resident
  • Posts: 755
    • View Profile
Re: QB64x64 (12-22-2018)
« Reply #24 on: December 23, 2018, 07:53:47 am »
Steve, would you just remind me?  (Obviously, I wouldn't be so dim as to not actually know the answer!!).  What is the actual benefit of running the 64-bit version for those of us with 64-bit machines and OS?

FellippeHeitor

  • Guest
Re: QB64x64 (12-22-2018)
« Reply #25 on: December 23, 2018, 08:07:07 am »
CONSTs can use CONSTs.

CONST FALSE = 0, TRUE = NOT FALSE

It's variables that can't get in the equation. CONSTs are fixed relacements, never changing and precalculated. Variables will change during execution.

Offline SMcNeill

  • QB64 Developer
  • Forum Resident
  • Posts: 3972
    • View Profile
    • Steve’s QB64 Archive Forum
Re: QB64x64 (12-22-2018)
« Reply #26 on: December 23, 2018, 08:22:45 am »
Steve, would you just remind me?  (Obviously, I wouldn't be so dim as to not actually know the answer!!).  What is the actual benefit of running the 64-bit version for those of us with 64-bit machines and OS?

Easiest answer is this one: https://www.qb64.org/forum/index.php?topic=895.0

64-bit OSes don’t natively run 32-bit programs.  They have an emulation layer called Windows-On-Windows (System WOW), which you can think of as being an automatic DOSbox working behind the scenes.  https://en.m.wikipedia.org/wiki/WoW64

When you run a 32-bit program, WoW64 basically translates it to 64-bit and then runs it for you.

So the advantages you find in creating 64-bit apps are:
1) Usually smaller compile sizes, from my experience
2) Faster run times and less overhead as WoW isn’t needed to “translate” your program.
3) Removed memory limits.  32-bit programs are limited to about 1.5GB memory; 64-bit and the sky’s the limit.
https://github.com/SteveMcNeill/Steve64 — A github collection of all things Steve!

Offline SMcNeill

  • QB64 Developer
  • Forum Resident
  • Posts: 3972
    • View Profile
    • Steve’s QB64 Archive Forum
Re: QB64x64 (12-22-2018)
« Reply #27 on: December 23, 2018, 08:42:44 am »
Mine also crashed inside a FUNCTION

Code: QB64: [Select]
  1. FUNCTION ToHardware& (ImgName$, X1%, Y1%)
  2.     TempImg& = _NEWIMAGE(X1%, Y1%, 32)
  3.     _PUTIMAGE (0, 0)-(X1% - 1, Y1% - 1), _LOADIMAGE(ImgName$, 32), TempImg&
  4.     ToHardware& = _COPYIMAGE(TempImg&, 33)
  5.     _FREEIMAGE TempImg&

at the _PUTIMAGE line.

* might want to check this for a memory leak as well.  There’s no way to FREEIMAGE the _LOADIMAGE when _PUTIMAGE is done. 

I think that I must be still be making elementary mistakes.

Code: QB64: [Select]
  1. FUNCTION ToHardware& (ImgName$, X1%, Y1%)
  2.     TempImg& = _NEWIMAGE(X1%, Y1%, 32)
  3.     _PUTIMAGE (0, 0)-(X1% - 1, Y1% - 1), _LOADIMAGE(ImgName$, 32), TempImg&
  4.     ToHardware& = _COPYIMAGE(TempImg&, 33)
  5.     _FREEIMAGE TempImg&
  6.  
  7. FUNCTION ToHardware1& (ImgName$, X1%, Y1%)
  8.     TempImg& = _NEWIMAGE(X1%, Y1%, 32)
  9.     Temp2mg& = _LOADIMAGE(ImgName$, 32)
  10.     _PUTIMAGE (0, 0)-(X1% - 1, Y1% - 1), Temp2mg&, TempImg&
  11.     ToHardware1& = _COPYIMAGE(TempImg&, 33)
  12.     _FREEIMAGE Temp2mg&
  13.     _FREEIMAGE TempImg&

Originally my FUNCTION was as in ToHardware1&, where Temp2mg& is explicitly freed after use.  But then I thought I'd optimise program lines and moved the _LOADIMAGE directly into the _PUTIMAGE, thinking that _FREEIMAGE would not then be required.  So you must always do _FREEIMAGE and never put _LOADIMAGE into a _PUTIMAGE?  I will use this method in future.

Let’s change the example to something physical, to help illustrate the issue.

Instead of NEWIMAGE, let’s SawWood and make a plank.
Instead of LOADIMAGE, let’s PickUpPlank.
Instead of PUTIMAGE, let’s PaintPlank.
Instead of FREEIMAGE, let’s DropPlank

ThisBoard = SawWood(2,4,10) ‘saw wood to make a 2x4, 10 feet long.
PaintPlank (Top)-(Bottom), ThisBoard, PickUpPlank(“OffGround”)
DropPlank ThisBoard

Now, with this odd set of real world instructions, we:
1) Saw a new 2x4.
2) Paint the new 2x4 the same color as another plank we pick up off the ground.
3) Then we drop the new 2x4.

Now question:  How many times do you think you can repeat this process?  You never actually drop the board you picked up from the ground; you’re still holding it...

And compare my little example to your original code (FUNCTION ToHardware).  ;)



*ANY TIME* you load a resource in memory, you want to be able to free it when finished.  If not, you create a memory leak which will eventually doom your program.
« Last Edit: December 23, 2018, 08:44:07 am by SMcNeill »
https://github.com/SteveMcNeill/Steve64 — A github collection of all things Steve!

Offline Qwerkey

  • Forum Resident
  • Posts: 755
    • View Profile
Re: QB64x64 (12-22-2018)
« Reply #28 on: December 23, 2018, 09:58:46 am »
CONSTs can use CONSTs.

CONST FALSE = 0, TRUE = NOT FALSE

It's variables that can't get in the equation. CONSTs are fixed relacements, never changing and precalculated. Variables will change during execution.
Thanks for the confirmation, Fellippe.  From the Wiki, I wasn't totally sure.  I always think of a CONST as a variable whose value can't change, and therefore CONST is a subset of the type Variable.


Offline Qwerkey

  • Forum Resident
  • Posts: 755
    • View Profile
Re: QB64x64 (12-22-2018)
« Reply #29 on: December 23, 2018, 10:05:14 am »
Steve, thanks for the clarifications.  Would I be correct in assuming that I should now be using QB64x64 (12-22-2018) instead of GL1.2(32-bit original release)?  I never use the daily builds.