Search found 713 matches

by Pupil
Mon Jul 02, 2012 12:54 pm
Forum: Coding Questions
Topic: assembly question
Replies: 14
Views: 2431

Re: assembly question

If you're only moving data from one place to another, why not use the built in 'CopyMemory()' function instead?

If pitch is same for source and destination I think something like this would work OK:

Code: Select all

CopyMemory(SourceAdress, DestAdress, (width*4+pitch)*height)
by Pupil
Fri Jan 06, 2012 12:28 pm
Forum: Coding Questions
Topic: OK I give up! (nice easy one for a guru)
Replies: 6
Views: 2332

Re: OK I give up! (nice easy one for a guru)

PB adds a stub at the beginning of the procedure that handles register preservation etc. Your code is located after all this. There's an option in the compiler that outputs the generated ASM for you to modify and optionally reassemble (you should check out this option to see what's being added at ...
by Pupil
Sun Aug 28, 2011 8:49 pm
Forum: Coding Questions
Topic: SetFilePointer_
Replies: 3
Views: 1446

Re: SetFilePointer_

You need to use quads to calculate the offset. Also using a structure like this might help:

Structure LargeInt
Low.l
Hi.l
EndStructure

Structure LargeOffset
StructureUnion
q.q
ll.LargeInt
EndStructureUnion
EndStructure

Offset.LargeOffset\q = 500*1024*1024*1024

SetFilePointer_(hFile ...
by Pupil
Sun Aug 28, 2011 1:28 pm
Forum: Coding Questions
Topic: Memory manipulation
Replies: 10
Views: 2958

Re: Memory manipulation

Glad you got things working! Regarding your little misstake, i can only say -been there, done that... again ... again ... and again :)
by Pupil
Sun Aug 28, 2011 8:52 am
Forum: Coding Questions
Topic: Memory manipulation
Replies: 10
Views: 2958

Re: Memory manipulation

The HTTP header always ends with the sequence $0d $0a $0d $0a, ie a double CARRIAGE RETURN. You should search for this, everything after this is data and you should be able to just save the buffer from this point to the end of the buffer. I would also check against the 'content-length' entry in the ...
by Pupil
Sun Aug 15, 2010 11:22 am
Forum: General Discussion
Topic: Serial data issue
Replies: 4
Views: 1760

Re: Serial data issue

Have you ruled out overflow for Rx/Tx buffer and such? I would suggest that you for testing purposes create a simple echo program in the micro controller that just sends back everything that it receives. By doing this you'll be able to see what's being sent when two keys are pressed simultaneously ...
by Pupil
Sun Jul 18, 2010 10:24 pm
Forum: Coding Questions
Topic: Register a C Function array for LUA
Replies: 21
Views: 7014

Re: Register a C Function array for LUA

What i meant was to call 'luaL_register()' like this:
luaL_register(L, 0, RL)
by Pupil
Sun Jul 18, 2010 2:01 pm
Forum: Coding Questions
Topic: Register a C Function array for LUA
Replies: 21
Views: 7014

Re: Register a C Function array for LUA

Possibly you need to pass a zero pointer, i.e. not a pointer to an empty string as you do with #NULL$ and Chr(0).
by Pupil
Sat Jan 23, 2010 3:39 pm
Forum: Coding Questions
Topic: Getting Directory Size SPEED Question
Replies: 4
Views: 1579

Re: Getting Directory Size SPEED Question

Use a quad for the file size instead..

something like this should display correct size:

Code: Select all

debug PeekQ(@find\nFileSizeHigh)
by Pupil
Sun Jun 21, 2009 1:54 pm
Forum: Coding Questions
Topic: API - SendInput
Replies: 13
Views: 9960

It seems I have to apologize as well, because I didn't check the output thoroughly enough myself. I missed that the euro character was not correctly sent. So I've investigated a bit further and found that if you replace the following line:

PokeS(@newchar, Chr(PeekB(@Text+i)), #PB_Unicode)

With ...
by Pupil
Sun Jun 21, 2009 10:08 am
Forum: Coding Questions
Topic: API - SendInput
Replies: 13
Views: 9960

For the 'l' missing i said that a key up event should be sent in case of two same chars following. this should fix the missin 'l':

#KEYEVENTF_UNICODE = 4

Global Dim SendInputData.INPUT(0)

Procedure SendInput(Text.s)

Protected i,j, k.l, newchar.l, char.l

k=Len(Text)

If k
ReDim ...
by Pupil
Sat Jun 20, 2009 7:54 pm
Forum: Coding Questions
Topic: API - SendInput
Replies: 13
Views: 9960

Note that you're sending the virtual keycodes with the method you're currently using, this means that you can only use capital letters with the conversion you use now. i.e:

SendInput("HELLO")

However these capital letters will be sent as lower case letters to the thread receiving the events.

I ...
by Pupil
Sun Jun 07, 2009 11:59 am
Forum: Coding Questions
Topic: Cannot Load Source File Error
Replies: 14
Views: 2919

However it seems to me that having in excess of 126 include files in a project is rather pointless and cutting down the amount should be an easy task.

Pointless?

To whom?

That is your opinion, nothing more.

Well, as i said that it seemed pointless to ME. One could assume that I am the one ...
by Pupil
Sun Jun 07, 2009 11:08 am
Forum: Coding Questions
Topic: Cannot Load Source File Error
Replies: 14
Views: 2919

Probably have to do with how the PB Debugger keeps track of which line and include that is currently executed. I think they use a long to keep track of current line and current include, 8-bit for indexing the includes and 24 bit for the linecount. Assuming i'm right about this i think that if the PB ...
by Pupil
Sat May 30, 2009 4:51 pm
Forum: Coding Questions
Topic: Please convert to ASM
Replies: 19
Views: 3471

I'm thinking that you should optimize the algorithm somewhat, as far as i can see this should be enough for the first procedure:

Procedure Odbierz(liczba.b,numer)
liczba.b+128
t0.l = liczba.b >> (numer-1)
a0.d = t0/2
t0 = a0
a = Round(a0, #PB_Round_UP) - t0
ProcedureReturn a
EndProcedure ...