Calling competent users who own a laptop

Strictly for discussing ZSNES development and for submitting code. You can also join us on IRC at irc.libera.chat in #zsnes.
Please, no requests here.

Moderator: ZSNES Mods

Post Reply
Nach
ZSNES Developer
ZSNES Developer
Posts: 3904
Joined: Tue Jul 27, 2004 10:54 pm
Location: Solar powered park bench
Contact:

Calling competent users who own a laptop

Post by Nach »

Recently pagefault and I added code to ZSNES for Windows and Linux to allow you to see within ZSNES itself what the status of your battery is, plugged in, % charged, time remaining...

However, we're missing other *nixes here most notably *BSD. I'd prefer if we didn't leave you guys out. If you're able to please help.

Look over the end of uic.c win/winlink.cpp linux/sdllink.cpp for all the battery related code. If you guys can complete the functions for *BSD we'd appreciate it, and after all, it's only for your benefit.

If you're mostly capable, but need help with the ZSNES side of things, feel free to ask or join the dev chat on IRC.
Last edited by Nach on Sun Oct 22, 2006 1:55 am, edited 1 time in total.
May 9 2007 - NSRT 3.4, now with lots of hashing and even more accurate information! Go download it.
_____________
Insane Coding
Nach
ZSNES Developer
ZSNES Developer
Posts: 3904
Joined: Tue Jul 27, 2004 10:54 pm
Location: Solar powered park bench
Contact:

Post by Nach »

Subject was: Calling BSD developers who own a laptop and care.

I since then written code to check laptop data on FreeBSD.
Can people who run FreeBSD on their laptop(s) please get this:
http://nsrt.edgeemu.com/batt.c
Compile it:

Code: Select all

gcc -o batt batt.c
Run it:

Code: Select all

./batt
And paste the output they get and their thoughts on the correctness of it?
May 9 2007 - NSRT 3.4, now with lots of hashing and even more accurate information! Go download it.
_____________
Insane Coding
Nach
ZSNES Developer
ZSNES Developer
Posts: 3904
Joined: Tue Jul 27, 2004 10:54 pm
Location: Solar powered park bench
Contact:

Post by Nach »

Okay, I got DragonFlyBSD (based on FreeBSD) users to test it and they said it worked good.

I now also added support for NetBSD and OpenBSD.

So can all BSD users post telling me what it outputs, how accurate that is, and which BSD they're using?
May 9 2007 - NSRT 3.4, now with lots of hashing and even more accurate information! Go download it.
_____________
Insane Coding
Silensho
Eternal Witness
Posts: 167
Joined: Mon Aug 02, 2004 2:47 pm
Location: I am and am not here.

Post by Silensho »

I don't use Zsnes on a laptop, but I'm sure those who do will be grateful you implemented such feature.
What?
Nach
ZSNES Developer
ZSNES Developer
Posts: 3904
Joined: Tue Jul 27, 2004 10:54 pm
Location: Solar powered park bench
Contact:

Post by Nach »

drizztbsd and myself added code for Mac OS X.

If you're using Windows, a BSD, or OS X on a laptop and have 2+ batteries we really need results of what it says when it's plugged in, and when it's not plugged in.

Compiling instructions:

To compile on Mac OS X:
gcc -o batt batt.c -framework IOKit -framework Foundation

Linux:
gcc -o batt batt.c -lm

All others:
gcc -o batt batt.c


And if you only have 1 battery, we also haven't gotten enough testing on Net or Open BSD, so please send it reports about that too.

Make sure to mention which OS you're using when posting results and any other helpful info.
May 9 2007 - NSRT 3.4, now with lots of hashing and even more accurate information! Go download it.
_____________
Insane Coding
ZPedro
New Member
Posts: 4
Joined: Sat Jul 22, 2006 5:30 pm
Location: France

Post by ZPedro »

Code: Select all

pierre2@MacBook-Pedro:~/Desktop $82> gcc batt.c -o batt -framework IOKit -framework CoreFoundation
pierre2@MacBook-Pedro:~/Desktop $83> ./batt
PC is plugged in
100% charged

pierre2@MacBook-Pedro:~/Desktop $84> ./batt
PC is running off of battery

100% remaining
pierre2@MacBook-Pedro:~/Desktop $85> 
So far so good (only one battery, I don't have any fancy stuff, I of course unplugged my MagSafe connector between the two runs). I'm running OSX in case it wasn't painfully obvious already.
Post Reply