PureBasic 6.30 beta 1 is ready !

Developed or developing a new product in PureBasic? Tell the world about it.
PeDe
Enthusiast
Enthusiast
Posts: 284
Joined: Sun Nov 26, 2017 3:13 pm

Re: PureBasic 6.30 beta 1 is ready !

Post by PeDe »

I have a tool that makes several HID Brymen BC-86X adapters available on the network. I removed my own HID and Libusb code and replaced it with the new PB HID library. On an old notebook with a Pentium M CPU and Linux LMDE6 32-bit, the tool has now been working flawlessly for several hours.

Peter
Fred
Administrator
Administrator
Posts: 18220
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Re: PureBasic 6.30 beta 1 is ready !

Post by Fred »

Nice !
User avatar
skywalk
Addict
Addict
Posts: 4218
Joined: Wed Dec 23, 2009 10:14 pm
Location: Boston, MA

Re: PureBasic 6.30 beta 1 is ready !

Post by skywalk »

I completely forgot about Placeholder text.
Now I can drop so many tool tips and callbacks. :P

And import c libs is gonna be fun. Need idle's help. 8)
The nice thing about standards is there are so many to choose from. ~ Andrew Tanenbaum
User avatar
diceman
User
User
Posts: 67
Joined: Tue Apr 10, 2018 9:42 pm

Re: PureBasic 6.30 beta 1 is ready !

Post by diceman »

Thanks, great to see new updates to my favorite language. <3
Please, please, please don't forget about the "RotateSprite"-Bug, though. :)

viewtopic.php?t=87215
Now these points of data make a beautiful line,
And we're out of Beta, we're releasing on time.
Quin
Addict
Addict
Posts: 1133
Joined: Thu Mar 31, 2022 7:03 pm
Location: Colorado, United States
Contact:

Re: PureBasic 6.30 beta 1 is ready !

Post by Quin »

Very nice update! Thanks, Fred and team!
User avatar
DeanH
Enthusiast
Enthusiast
Posts: 278
Joined: Wed May 07, 2008 4:57 am
Location: Adelaide, South Australia
Contact:

Re: PureBasic 6.30 beta 1 is ready !

Post by DeanH »

Thank you for the update. I have tweaked the original PackerCallback code to work. Only had to change two lines.

Code: Select all

UseZipPacker()
;UseLZMAPacker()
;UseBriefLZPacker()

; ------------------------------------------------------------
;
;   PureBasic - Compressor example file
;
;    (c) 2002 - Fantaisie Software
;
; ------------------------------------------------------------
;
; This procedure is a 'Callback'. This means there will be called
; automatically by the program at regular interval, so we could
; see the progress of the compression
; 
Procedure PackerProgress(SourcePosition, DestinationPosition)
	Shared FileLength 
	Result.f = (SourcePosition/FileLength)*100
	SetGadgetState(0, Round(Result,0))
	While (WindowEvent()) : Wend  ; Process all the window event befor quit
	ProcedureReturn 1
EndProcedure

If OpenWindow(0, 100, 200, 300, 40, "Packer - Progress Window")
	ProgressBarGadget(0, 10, 10, 280, 20, 0, 100)
	If ReadFile(0, OpenFileRequester("Choose a file to compress", "", "*.*", 0))
		FileLength = Lof(0)
		; Allocate the 2 memory buffers needed for compression..
		*Source = AllocateMemory(FileLength)
		*Target = AllocateMemory(FileLength+8)
		If FileLength And *Source And *Target
			ReadData(0, *Source, FileLength) ; Read the whole file in the memory buffer
			PackerCallback(@PackerProgress())
			; Compress our file, which is in memory (and use a timer to see the time spend by compression..)
			CompressedLength = CompressMemory(*Source, FileLength, *Target, FileLength)
			If CompressedLength
				DecompressedLength = UncompressMemory(*Target, CompressedLength, *Source, FileLength)
				If DecompressedLength = FileLength
					MessageRequester("Info", "De/Compression succeded:"+#LF$+#LF$+"Old size: "+Str(FileLength)+#LF$+"New size:"+Str(CompressedLength))
				EndIf      
			Else
				MessageRequester("Error", "Can't compress the file")
			EndIf 
		EndIf
		FreeMemory(*Source)
		FreeMemory(*Target)
		CloseFile(0)
	EndIf
EndIf
User avatar
jacdelad
Addict
Addict
Posts: 2010
Joined: Wed Feb 03, 2021 12:46 pm
Location: Riesa

Re: PureBasic 6.30 beta 1 is ready !

Post by jacdelad »

Does PackerCallback work for unpacking too? Does it support all packing (and maybe unpacking) routines (memory, file...)?
Good morning, that's a nice tnetennba!

PureBasic 6.21/Windows 11 x64/Ryzen 7900X/32GB RAM/3TB SSD
Synology DS1821+/DX517, 130.9TB+50.8TB+2TB SSD
PeDe
Enthusiast
Enthusiast
Posts: 284
Joined: Sun Nov 26, 2017 3:13 pm

Re: PureBasic 6.30 beta 1 is ready !

Post by PeDe »

DeanH wrote: Thu Sep 04, 2025 5:12 am Thank you for the update. I have tweaked the original PackerCallback code to work.
With PB x86, you need the Quad data type for the parameters of the callback procedure, otherwise you will get an error message:

Code: Select all

[ERROR] PackerCallback(): The Procedure specified in '@ProcedureName()' does not have the required argument or returntype.

Procedure PackerProgress(SourcePosition.q, DestinationPosition.q) -> OK for 32/64-bit
Peter
User avatar
DeanH
Enthusiast
Enthusiast
Posts: 278
Joined: Wed May 07, 2008 4:57 am
Location: Adelaide, South Australia
Contact:

Re: PureBasic 6.30 beta 1 is ready !

Post by DeanH »

PeDe wrote: Thu Sep 04, 2025 6:49 am
DeanH wrote: Thu Sep 04, 2025 5:12 am Thank you for the update. I have tweaked the original PackerCallback code to work.
With PB x86, you need the Quad data type for the parameters of the callback procedure, otherwise you will get an error message:

Code: Select all

[ERROR] PackerCallback(): The Procedure specified in '@ProcedureName()' does not have the required argument or returntype.

Procedure PackerProgress(SourcePosition.q, DestinationPosition.q) -> OK for 32/64-bit
Peter
I just took the exact code in the original documentation with PB4.6, copied that into the 64-bit version of 6.30 beta 1 and changed the two lines. The revised doc should reflect what you have said.

It does not show a progressbar when unpacking. I tried it. The original doc says it only does when packing but not unpacking. That's what I found. It would be nice if it could. I am grateful for this new bit, though. As a test, I packed two files, each about 500Mb. Showed progress for each one separately.
zikitrake
Addict
Addict
Posts: 875
Joined: Thu Mar 25, 2004 2:15 pm
Location: Spain

Re: PureBasic 6.30 beta 1 is ready !

Post by zikitrake »

Thank you so much!
This is a never-ending process of improving and improving Purebasic.
Thank you very much for all your hard work over the years!
PB 6.21 beta, PureVision User
PeDe
Enthusiast
Enthusiast
Posts: 284
Joined: Sun Nov 26, 2017 3:13 pm

Re: PureBasic 6.30 beta 1 is ready !

Post by PeDe »

DeanH wrote: Thu Sep 04, 2025 7:03 am I just took the exact code in the original documentation with PB4.6, copied that into the 64-bit version of 6.30 beta 1 and changed the two lines. The revised doc should reflect what you have said.
It's interesting that this function already existed in PB v4.61 or earlier. However, the second parameter ‘DestinationPosition’ now returns the total size of the uncompressed data.

Peter
User_Russian
Addict
Addict
Posts: 1535
Joined: Wed Nov 12, 2008 5:01 pm
Location: Russia

Re: PureBasic 6.30 beta 1 is ready !

Post by User_Russian »

The function HIDError() is not supported in Linux? The function return text not implemented yet instead of an error description.
Strange situation. Function ExamineHIDs(#USB_VID, #USB_PID) found the device and returns the number 1. But function OpenHID(#HID, #USB_VID, #USB_PID) cannot open the device and returns 0. Running on superuser (sudo in terminal) does not solve the problem.

In MacOS, similar problem. Function ExamineHIDs() found the device, but function OpenHID() cannot open the device and returns 0. HIDError() return text Device with requested VID/PID/(SerialNumber) not found

On Windows this code works great.
User_Russian
Addict
Addict
Posts: 1535
Joined: Wed Nov 12, 2008 5:01 pm
Location: Russia

Re: PureBasic 6.30 beta 1 is ready !

Post by User_Russian »

Test code.

Code: Select all

Debug OpenHID(0, #USB_VID, #USB_PID)

ExamineHIDs(#USB_VID, #USB_PID)
If NextHID()
  Debug OpenHIDPath(0, HIDInfo(#PB_HID_Path))
  Debug HIDInfo(#PB_HID_Path)
EndIf
In MacOS function OpenHID() returs 0, but the function OpenHIDPath() returns non-zero and successfully opens the device and successfully transfers data with it using ReceiveHIDFeatureReport(). Probably in function OpenHID() there is a bug.

In Linux functions OpenHID() and OpenHIDPath() returns 0.

Added.
If in Linux, run the application with superuser rights, then the function OpenHIDPath() opens the device. OpenHID() return 0.
This is probably a bug function OpenHID() in Linux and MacOS.
Clanzer
New User
New User
Posts: 1
Joined: Thu Sep 04, 2025 5:05 pm

Re: PureBasic 6.30 beta 1 is ready !

Post by Clanzer »

Same here, HID commands work great in Windows 10 but under not Ubuntu 20.0.4

Ubuntu can Enumerate the plugged in HID devices and display them but connection error when using OpenHid

Image
Post Reply