[help needed] NEC PC9801 Emulator [updated] - Windows Mobile Development and Hacking General

Hi,
I have a touch HD (blackstone) and I wanted to run the Pocket PC official port of "Neko Project" on it :
http://retropc.net/yui/np2wce.html
It a NEC PC9801 Emulator (an old japanese PC like computer, with a lot of cool games ).
Two problems :
- the mouse module is disabled, probably because the target Pocket PC dont have a touch screen, the code looks like this (WinCE/MOUSEMNG.CPP)
BYTE mousemng_getstat(SINT16 *x, SINT16 *y, int clear) {
*x = 0;
*y = 0;
(void)clear;
return(0xa0);
}
Its clearly different from the file Win9x/MOUSEMNG.CPP for the win32 port
- the second problem, there is no 800x480 resolution support, this could be corrected in this file I think : WinCE/NP2.H
My request, can anyone (with a good experience on Windows Mobile coding) help me correct these two problems ? the source code is available on the link above (the file np2_081as.zip).
I'm somewhat good at coding in Win32 API but have never coded on Pocket PC...
Thanks in advance
Bye

UP please ?

Hi, here's a little update,
I managed to change the resolution to 480x800, no need to use wvgafix now
I even managed to detect the exact mouse position, but when I click nothing happens
Here is the source code, can anyone take a look and help me correcting the mouse part ? I tryed to copy the code from the win9x source but it didnt work...
http://rapidshare.com/files/185069548/np2.zip
Thanks in advance

UP please ?

Related

intro!

Hi Guys,
I'm going through the forum, I'm new to embedded developement, I've been able to do my first MessageBox("Hello World") in C using VS2005.
I want to understand how all this works, like :
- Accessing any "mass storage" device ? (the root FS ?, /, c:\, whatevername )
- Dumping the whole registry + values.
- Logging Process and activity even while "device locked" (new process, etc..)
And having more knownledge about the internals and devices, booting etc..
I'm kind of lost and my embedded knowledge is very thin..
The PPC i have is running WM5 on QTEK9100 (SPVM3000)..
Any pointers, posts, sources, small explication are more than welcome...
Hope you can help,
Regards,
r.
Welcome!
Wow those sure are some heavy requests for someone who is just starting.
How much experience do you have with C and Win32 APIs?
To start you off here is an excellent site for Windows Mobile programming tips and tricks:
www.pocketpcdn.com
Couple more pointers:
Device root is "\", no drives (SD cards mounted as folders) kind of like Linux.
All path are absolute - no ".\" or ".."
You can use standard C or Win32 functions for file operations.
Registry functions are also same as Desktop windows except you have to use the "Ex" version of of the function.
Example:
RegOpenKey - not implemented, use RegOpenKeyEx.
For process lists etc, google for ToolHelp32.
Thanks,
I'm at ease w/ ANSI C, have some familiarity w/ Win32 APIs,
but as far as I'm seeing I'm trying to code on Win32 Intel First,
then i try to "port" it to PocketPC Mobile, sometime it works
sometime functions doesn't even exists... MSDN doesn't seems very consistent over Win32 vs WM, but as I'm new I guess i'm missing a lot..
WinMain() prototype changes according to your target...otherwise
VS2005 yell about Overloading WinMain, It is VERY annnoying..anyway
Thanks for the links and the *Ex trick, I'll try to get deeper with this.
I have a strange problem trying to do my Own MessageBoxPrintf:
int MessageBoxPrintf(int, const char * title, const char * fmt, ...)
{
va_list ap;
char * buffer = NULL;
/* formatting and fixed size yes...*/
buffer = (char *) malloc (1024 * sizeof(char));
if (!buffer)
return -1;
memset(buffer, 0, 1024);
va_start(ap, fmt);
vsprintf(buffer, fmt, ap);
va_end(ap);
MessageBox(NULL, (LPCWSTR)buffer, (LPCWSTR)title, type);
return 0;
}
It does compile, but it display craps, since there is no stderr,stdout,stdin and
that I'm mostly coding on Win32/VMware, I don't know how to debug on my PPC (no USB connection), and I have no idea what's wrong.. it might be obvious, but it's late..
As I don't know what LPCWSTR stand for, I assumed char * and it did work on Win32 (XP) without hassle (except LPCWSTR types which are wrong for Win32 Target), so why it doesn't on WM5... is a mystery for me now..
Hope to be on speed ASAP to be able to release some stuff..
Thanks for your help,
Cheers,
r.
all WinAPI function on Pocket PC works with Unicode strings. So you have to convert from ANSI to Unicode.
ok, does the TEXT() macros convert to Unicode string, it seems not.
How to convert from ANSI to Unicode ?
you can work directly with wchar_t or use tchar that can be ansi or unicode, otherwise look for MultiByteToWideChar or CString object _T and TEXT Macro aren't for converting ansi but they makes unicode prefix strings... for example MessageBox(hWnd,_T("Hello World"),_T("my messagebox"),MB_OK);
I hope this help and don't forget MSDN have all replies
have fun,
Guybrush
ok it works! thanks!
just another question, how to dump the "disk" or how those devices are booting ROM?/Flash?
Currently I'm copying all the files from / to the SD card mount point is there anything else?
again thanks for your help.
++
r.

Samsung Mobile SDK / G-Sensor and VB.Net

As you know, Samsung has released a SDK for mobile phones (search Samsung Mobile Innovator on your prefered search engine).
I wrote a VB.Net class using this SDK.
I find Samsung API it is better than HTCEmu because each position goes from -1 to 1, and does not need any specific DLL.
Just have a look and tell me what you think about it.
Public Properties :
- X, Y and Z : coordinates of the vector (it was easier for my need than the vector itself => i should add a vector property)
- EventEnable : if you set it to true, an event "Refresh" will be sent every 200ms
PS : first line "Imports System.Runtime.InteropServices" is useless but I forgot to delete it.
I'll give it a go and let you know
Thanks
how about it, is everyone think Samsung will be faster than before with it?
elfii said:
how about it, is everyone think Samsung will be faster than before with it?
Click to expand...
Click to collapse
I do not think it is faster.
Hey i need some help
hey Every body....!! Any body knows which Samsung Mobile Phones are best for using office and for home... which have a long bettery time....
Thx in advance...
Can anyone write a tutorial on how to use this?
What is the question ?
you shall import acceleromtre.vb in your visual studio project. (Samsung SDK has to be installed before)
you shall declare "Dim aaaaa as new Accelerometre"
and then to have coordinates you can use aaaa.X, aaaa.Y, and aaaa.z
OK, so how would I write a simple code to detect that the omnia was tilted slightly to the left. Can you provide a sample for that?
Yeah so I DIM the thing and did what you said.
I got this: aaaa.Accelerometre.SmiAccelerometerGetVector
So in order for me to do some work, I will need to put code in like this:
If aaaa.Accelerometre.SmiAccelerometerGetVector.x = aaaa.Accelerometre.SmiAccelerometerGetVector.x -1 then
PUT ACTIONS HERE.
Does that sound right?
I'm sorry but it looks wrong.
- You have to use aaaaaaa.X, not aaaaa.accelero.smistufff.X
- in your exampe (if a.X = a.X -1), your condition will never be true (the condition (a.X=a.X) is always true but is not really interesting !
- you should use a list of values (for example, you record the value each 200ms) and compare them in order to detect the device has been tilted.
Ah! I see. Thanks.
I think you will have to try different values in order to find the best values to confirm a tilt.
Yeah I figured. It stinks that I have to compile the software over and over and install it on my WM pda just to test it.
Oh well.
Thanks again.
forum.xda-developers.com/showthread.php?t=497514
forum.xda-developers.com/showthread.php?t=497514

[Python] HTC G-Sensor

Hiya,
Here's a quick hack: a small Python library that allows you to read the G-sensor values on HTC devices.
Currently it does not support Omnia as I don't have access to neither the device nor a good description of the process.
The API is simple:
Code:
import htc_gsensor
s = htc_gsensor.HTCGSensor()
data = s.get_values()
print '-------------\nG: [%f, %f, %f]\nR: %f, %f' % (
data.gravity_x,
data.gravity_y,
data.gravity_z,
data.rotation_x,
data.rotation_y
)
License: LGPL 2.1+
Hope you find it useful (or fun to play with).
patrys said:
Hiya,
Here's a quick hack: a small Python library that allows you to read the G-sensor values on HTC devices.
Currently it does not support Omnia as I don't have access to neither the device nor a good description of the process.
The API is simple:
Code:
import htc_gsensor
s = htc_gsensor.HTCGSensor()
data = s.get_values()
print '-------------\nG: [%f, %f, %f]\nR: %f, %f' % (
data.gravity_x,
data.gravity_y,
data.gravity_z,
data.rotation_x,
data.rotation_y
)
License: LGPL 2.1+
Hope you find it useful (or fun to play with).
Click to expand...
Click to collapse
how do i use it ? any suggestion and install instruction will be helpful....a exe to test will be great
It's a Python module. It's only useful for software developers, not regular users.
To test you need to install Python CE, copy the module (unzipped .py file) to the device and launch it from the file manager.
how about the touch sensor?
Hello how can i use the touch sensor within python?
thanks
António
Thanks man, I will give it a try...
By the way, I do not understand why the community is not very much interested in PythonCE, as far as I see even MortScript has far more popularity.
Come on people, Python rocks, we should use it more often, it is so powerfull and so easy to use.
patrys said:
Hiya,
Here's a quick hack: a small Python library that allows you to read the G-sensor values on HTC devices.
Currently it does not support Omnia as I don't have access to neither the device nor a good description of the process.
The API is simple:
Code:
import htc_gsensor
s = htc_gsensor.HTCGSensor()
data = s.get_values()
print '-------------\nG: [%f, %f, %f]\nR: %f, %f' % (
data.gravity_x,
data.gravity_y,
data.gravity_z,
data.rotation_x,
data.rotation_y
)
License: LGPL 2.1+
Hope you find it useful (or fun to play with).
Click to expand...
Click to collapse
Now that's cool hah - Not my device, but always glad to see another Python user

[UNDER DEVELOPMENT]Windows Mobile 6 Bluetooth and Wiimote

I am currently trying to develop some software that allows to use a wiimote or a ps3 controller (ex. for fpsece).
all in vb.net
I currently discovered that I am unable to connect. I have already found a similar project that stopped because of the same problem!
I have read that the problem is the missing HID/S2CAP support of 32feet.net
The other software uses BlueTools so there may be the same problem!.
Does anyone know something that allows me to connect to my wiimote?! Maybe some SDK with HID/S2CAP support?!
You own an HD2 and another WinMob device and want to help? Take a look here: http://forum.xda-developers.com/showpost.php?p=5553883&postcount=10
Sorry, i cant help you but i will love control a wii with my HD...
I am speaking of the other way round , but I could also try that ^^.
I am talking about to control your HD with a Wiimote
It would be easy, if there is any idea how succesfull connect to the wiimote
I have found something here: http://www.eggheadcafe.com/software/aspnet/31158420/big5bxf276hrqkrnsut.aspx
I will see if it helps
Mhh, to bad, I cannot find the source files I would need
They maybe in the "Windows CE 5 platform builder" But the Online Setup I was able to get doesn't work anymore
scilor said:
I am speaking of the other way round , but I could also try that ^^.
I am talking about to control your HD with a Wiimote
It would be easy, if there is any idea how succesfull connect to the wiimote
Click to expand...
Click to collapse
Control your Wii with HD... It would be a great app.. if you can write it...
Thanks my Friend.
I was looking at doing this at one point. The HD2 with its Widcomm bluetooth stack supports BT HID, and the later WM6.5.X builds have Bth_HID in the SYS.
Pairing doesn't get you very far though. I found some C++ code for using the Wiimotes, but I haven't transfered it yet.
@l3v5y Why you have always the same ideas I do
The Bluetooth Stack of the HD2 seems to be a little bit buggy:
If I try to use a Bluetooth chat, it just works from my HD2 to my Kaiser, not the other way round. It is as my HD2 blocks all incoming Bluetooth connections
Any idea?
please setup a team , winmo need you
cheer
Ok, I have attached the Bluetooth Chat here.
It would be nice if other HD2 users could test it(You will need the HD2 and another WinMob Phone with a Widcomm Stack). Please always post the Roms of the devices, especailly the HD2's.
If it is only occurs on some ROMS, it would be fine, so I will do a Rom upgrade for further testing
My results where:
HD2 - T-Mobile ROM 1.43.11.2 (70315) Ger
Kaiser - Custom Rom WinMob 6.5
Message HD2 to Kaiser: Works fine, but takes a second.
Message Kaiser to HD2: Connection error, no message!
I found following in the thread of WiiMöb: http://wiimob.codeplex.com/Thread/View.aspx?ThreadId=10953
"But it seems likely that any purely bluetooth work was a red herring, and we just need to tackle BTHHID.DLL and devise a P/Invoke library that will get us a Filehandle to the device through the HID stack."
Hi everybody,
I'm also looking for a solution for that.
As I had similar problems with my Notebook (Widcomm-BT-Stack), I could solve it with a different BT stack. But I don't want to part with the Widcomm on my HD2.
I think the main problem is that the OK softbutton is disabled as long as there is no passcode in the inputbox. It only gets enabled if you enter somthing, which would never match up with the empty passcode of the WiiMote (somthing <> nothing ;-).
If the OK softbutton was enabled even with empty passcode box, the codeless pairing might actually work.
Is there anybody capable of unlocking this OK button?
Please
ScruffR
The problem is that the WM Devices misses a special HID driver . You may connect it with out a passcode with some tricks but this won't help because you cannot connect to the device
Look at this Symbian project http://www.symbianresources.com/projects/wiirider.php - maybe that will help. I got the same problem like everybody - can't pair device :s
We cannot connect the WiMote low-level easily, that is the big problem. If we could it would be easy.
...I'm assuming this has been abandoned? :/
Until someone finds a way to get a stream, the development is stopped
There is a way to connect to the Wii Remote with a WM 6 device.
The driver you want to look for should come with WM 5 and 6 devices. It has the prefix "BHI" it is not meant for production use, and it somewhat bare-bones, however you can successfully connect to the Wii Remote with it.
The registry path for this driver is:
HKLM\Software\Microsoft\Bluetooth\Hid\Hid_Class
and
HKLM\Software\Microsoft\Bluetooth\Hid\Instance
If you activate these drivers using the Win32 ActivateDeviceEx command (upon hard reset you don't have to do this), you should be able to open up a file stream to the driver.
Code:
HANDLE read_test = CreateFile(L"BHI0:", 0, 0, NULL, OPEN_EXISTING, 0, NULL);
Code:
unsigned __int64 wii_addr = 0x002659F4EEEDL; // BT_ADDR, 64 bits (8 bytes)
Then, I call the DeviceIoControl function to connect to the Wii Remote:
Code:
bool device_io_success = DeviceIoControl(read_test, 1, &wii_addr, sizeof(wii_addr), NULL, 0, NULL,NULL);
e = GetLastError();
Just replace the wii_addr with your Wii Remote's Bluetooth address.
The source code for this driver can be found by googling:
"bthhid.cxx source code" it should be the first link.
The set of APIs it provides is minimal, and I was not able to get any other function to work besides HIDConnect.
I'm still working on getting some sort of data from it.
Let me know if this works for you,
Mike
Could you send me a link to the source? I am finding any
I will take a look later, maybe we get it running
Unfortunately, I can't post the link due to spam restrictions (I just joined the forums recently). However, I have attached the folder that includes all the source files with this post.
This folder comes with Windows CE Platform Builder. It is located here (if you have Platform Builder installed):
C:\WINCE500\PRIVATE\WINCEOS\COMM\BLUETOOTH\PROFILES\HID
If you navigate to the BASE folder, you will find bthid.cpp. This is the main source that contains the stream driver implementation.
The main section of this file to examine is around line 2500 on down. These are the functions that are exposed when you create a file handle to the driver.
Let me know how it works out,
Mike

Facing Issue while finding a file on my handheld device through my Desktop App

Hi,
I am facing issue while finding a file (CeFindFirstFile(..)) on my handheld device through my Desktop application. My Desktop application is VB.NET application and OS is Windows 7. On the other hand, OS on handheld device is Windows CE. Every time CeFindFirstFile() returns -1 and error#18 with the getlasterror().
Have used function like:
lngRetVal = CeFindFirstFile(str_path, sCE_Find_Data)
and used path string for the variable str_path in several different ways. Let me know in case you need further information.
Appreciate your help in this regard.
Thanks,
JP

Categories

Resources