How do you use the Windows SDK tools?

Hello!
I also am working on Windows environemtn.
I also found that deleting the buldleID line is only the way to eliminate that error.
I did not have auto mount problem by somehow. I am using FW with SDK v0.10.1.

Our C tooling for Windows is not complete yet. A Windows simulator capable of running Lua games should ship with the next SDK, I think.

There is a known bug in the current Windows version of pdc that requires the pdxinfo file to have Unix (LF) line endings, or the bundleID cannot be parsed properly. Hope to address this soon.

That seems like the trick. I successfully could compile with using LF instead of CR+LF.

I also am looking forward to get C tool! (And simulator :slight_smile: )

Hi Steven,

"A Windows simulator capable of running Lua games"

  • can a 100% C language generated game running under Windows simulator ?

...or are you referring the next release of PlaydateSDK Windows Simulator only can run LUA created games ?

Please advise.

The initial release of the Windows simulator will likely only support 100% Lua games, but we'll keep working on it.

Actually having some issues with it myself - I'm getting "System.IO.IOException: The device is not ready." when I use pdutil install.

@notnite is the device unlocked?

My problem seems to be compiling the dang thing itself. The exact code builds fine and runs on my Mac, but not on Windows.

Hi folks! Absolute complete newbie here, asking the simplest of the simple questions. I've only worked with Arduino and CircuitPy where programs can be loaded directly from the equivalent of Nova, so I have no experience with command line!

If the new SDK is coming out really soon (with the Windows simulator and maybe the load-to-device tool), I'll gladly wait out attempting my Hello Worlds.

Otherwise, how does one begin to use pdc.exe or pdutil.exe with CMD?
I typed in the filepath of pdc.exe in CMD, and then it gave me the instructions davemakes posted in the first post. Awesome, making progress! I then tried to type in the appropriate information for my test file, and got:
"'-pdc' is not recognized as an internal or external command,
operable program or batch file."

I've gotta be missing something somewhere! I always used complete filepaths. Also, the filepath never changed from my C:\Users(me) after I initially typed in the .exe.

Thanks everyone! (Again I can probably postpone until the fancy Windows emulator comes out, but it would be fun to get started).

Oh no. I had hoped the Windows SDK would have been ready before June. I guess I can drag out the old Mac until it's prime-time. But seriously...it's a super old macbook LOL.

I would definitely rather have my 3900X main dev rig :slight_smile:

@stevenf We've installed 0.10.2 and tried out the Windows simulator! Two of my team members, @Jada and @ryan.splendorr have had to move to Windows due to the Mac version no longer being compatible with older version of macOS. One, @Tony_Ghostbrite, has been working on Windows since he joined us a month ago, just using the command line tools to build and then manually copying the folder over to the datadisk via copy+paste. Today we spent over 3 hours on a group call, working through everyone's individual issues getting their devices up to date, and getting their Windows machines to mostly-reliably build and install.

Issues we've run into:

  1. The Windows simulator opens, and opens the .pdx project, BUT doesn't render things to the screen properly. We can see things draw briefly when we press buttons, but then the screen goes blank. That's with this pdx: project-bottle.pdx.zip (14.7 MB)
  2. We have not been able to install or run the pdx using the menu in the Windows simulator. Choosing install seems to mount the datadisk, but then didn't put the project on the device or reset the device's state afterward.
  3. Installing our project with pdutil install doesn't work reliably. We very often see errors with copying files. Getting errors like
Playdate device detected on COM3
Installing "C:\Users\username\Documents\project-bottle\Builds\project-bottle.pdx"...
Waiting for drive to appear...
Playdate data disk mounted as F:\
Copying files.........................
Unhandled Exception: System.IO.IOException: The file 'F:\Games\project-bottle.pdx\images\alembicChamber_JahnAnim.pdt' already exists.
   at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
   at System.IO.File.InternalCopy(String sourceFileName, String destFileName, Boolean overwrite, Boolean checkHost)
   at System.IO.FileInfo.CopyTo(String destFileName, Boolean overwrite)
   at pdutil.Playdate.DirectoryCopy(String sourceDirName, String destDirName, Boolean copySubDirs)
   at pdutil.Playdate.DirectoryCopy(String sourceDirName, String destDirName, Boolean copySubDirs)
   at pdutil.Playdate.Install(String comPortName, String pdxPath)
   at pdutil.Program.Main(String[] args)
  1. Possible drive corruption caused by the install command. One of our devs, @Tony_Ghostbrite, has seen multiple instances of the game folder getting corrupted at some point in this process. The only way to resolve it has been to rename the corrupted game folder, and copy a new one to the Games folder on the Playdate.
  2. Inconsistent mounting and ejecting behavior. Especially if the install command gets interrupted by a file write error, Windows can start to have trouble reading the Playdate as a drive. We've seen "there is a problem with this USB drive, would you like to repair it" notifications, but generally disconnecting and reconnecting the Playdate has resolved them.
  3. For some reason, @Jada's pdc keeps compiling a build that shows an error in her git branch, dev_jada. When switching to the development branch, which doesn't show the error on anyone else's device, then running pdc and pdutil install, the version of the game installed to her device throws the same error. It seems like pdc is building from the wrong version of the files, from another git branch, but I have no idea how that could be possible. She's using GitKraken as a git UI, and is definitely on the development branch according to git.

UPDATE: After manually deleting the old project folder from the device, and pasting in a new pdx folder, she saw an error saying that there were already some files with the same name in place(!). This suggests disk corruption; she's also getting "there's something wrong with this disk" errors in Windows. We tried renaming the pdx folder on device and copying a new one in, and got the same error again. I'm pretty sure the failing pdutil install command is causing disk corruption on the playdate.

AND, as far as I can tell, all of the install and disk errors are related to files appearing to exist in the place where one is being copied to.

Everybody's running SDK 0.10.2, on Windows 10, with probably the most recent updates :slight_smile:

@ryan.splendorr, @Tony_Ghostbrite, @Jada, is there anything I missed here that y'all can add?

Thanks, Nick. We're looking into these issues now.

1 Like

Regarding #6, I can't explain that either. pdc uses plain C calls to access files, and has no special knowledge of the structure of git repositories, etc. It sounds like either the files on disk are the wrong ones, or somehow a stale pdx is getting transferred to the device.

1 Like

Thanks for looking into it, @stevenf! Let me know if access to our repo would help, I can share it on Gitlab.

And yeah, it looooks like it’s just a stale PDX getting sent, or maybe pdutil isn’t successfully overwriting stuff on the device since it’s encountering some disk weirdness. Jada was able to copy a new one from Mac to the Play date and it worked as expected.

From my brief experience (I have no device yet, just the Windows simulator), it looks like the pdc.exe utility on Windows is not overwriting any *.pdx files when using the same output directory repeatedly. I can make a change to my main.lua file, run the compiler command (PowerShell: .\pdc.exe <main.lua location> <output.pdx>), and it will overwrite the pdxinfo file, but nothing else. I have the CoreLibs folder copied in my source, so it replicates the lua->pdx files too, but those *.pdx files remain the same timestamps between rebuilds as well.

Temporary workaround is just to kill that <output.pdx> directory before your build process. I have not had any time to work up any complex build scripts, as this is just my first 30 minutes trying to develop something.

1 Like

Interesting! As far as I can tell, we are able to build new .pdx files with pdc. We're able to get a new pdx built, but not automatically transfer to the device.

pdutil install either fails with an existing file error, or succeeds but doesn't (usually?) install the newer .pdx. We've had the most success just mounting with pdutil datadisk, deleting the pdx folder, then pasting the new one into the Games folder.

With 0.10.2 on macOS I believe I've had the stale pdx issue from simulator a couple of times this week. I just kept repeating until it ran the new version. Not very helpful, sorry.

Rather than wait for the next SDK release, we've posted an updated set of Windows tools today that should address some of the issues reported here.

See this thread for more info: https://devforum.play.date/t/playdate-sdk-0-10-2-windows-hotfix/1056

1 Like