Page 2 of 4 FirstFirst 1234 LastLast
Results 11 to 20 of 40

Thread: another day, another problem (touchpad).

  1. #11

    another day, another problem (touchpad).

    thank you for replying :D

    i hope you get back to coding your ds soon, it's really fun :D

  2. #12

    another day, another problem (touchpad).

    Quote Originally Posted by 21o6
    i have fiddled around a bit with the coordinates.

    it's not 100% exact, but it's waay better than only doing div 16 and really
    sufficient when used on hardware.

    Code:
    touchxy.px := (touchxy.px div 14) - 19;
    touchxy.py := (touchxy.py div 19) - 10;
    this gives me the best result, the X/Y-range goes from 0..251:0..191.

    Tested with no$gba and my phat NDS.
    Please note that your emulator will probably give slightly different results.

    i hope this will get obselete soon

    oh and... does anybody actually need this stuff? 100+ views but nobody's posting.
    Sorry, but I don't get the clue... This code:

    [pascal]Program Touch;
    {$APPTYPE ARM9}
    {$DEFINE ARM9}
    {$MODE OBJFPC}
    uses
    cTypes;
    {$INCLUDE NDS.INC}
    var
    touchXY: touchPosition;
    begin
    irqInit();
    irqSet(IRQ_VBLANK, nil);
    irqEnable(IRQ_VBLANK);
    videoSetMode(0);
    videoSetModeSub(MODE_0_2D or DISPLAY_BG0_ACTIVE);
    vramSetBankC(VRAM_C_SUB_BG);
    SUB_BG0_CR^ := BG_MAP_BASE(31);
    BG_PALETTE_SUB[255] := RGB15(31,31,31);
    consoleInitDefault(pu16(SCREEN_BASE_BLOCK_SUB(31)) , pu16(CHAR_BASE_BLOCK_SUB(0)), 16);
    while true do
    begin
    swiWaitForVBlank();
    touchXY := touchReadXY();
    iprintf(#27 + '[16;0H' + 'Touch x, px = %04X, %03i' + #10, [touchXY.x, touchXY.px]);
    iprintf('Touch y, py = %04X, %03i' + #10, [touchXY.y, touchXY.py]);
    end;
    end.[/pascal]

    gives to me your same results without dividing anything. On DS phat, for px and py I get values in the range 1-252, 1-192 :scratch:
    Get your fpc4gba copy now!
    Get your fpc4nds copy now!

  3. #13

    another day, another problem (touchpad).

    tested it on emulator and hardware ... x is increasing, y is empty and
    px/py are way out of bounds.

    so it's my compiler's fault?

  4. #14

    another day, another problem (touchpad).

    Quote Originally Posted by 21o6
    tested it on emulator and hardware ... x is increasing, y is empty and
    px/py are way out of bounds.

    so it's my compiler's fault?
    At this point I think so :think:
    Please, try this file on your ds
    Get your fpc4gba copy now!
    Get your fpc4nds copy now!

  5. #15

    another day, another problem (touchpad).

    yep, you'r .nds works.

    oh great ...

    now what? recompile fpc4nds AGAIN? i don't think that'll help...

  6. #16

    another day, another problem (touchpad).

    Quote Originally Posted by 21o6
    yep, you'r .nds works.

    oh great ...

    now what? recompile fpc4nds AGAIN? i don't think that'll help...
    Try to download the sources from SVN now, because I have uploaded some changes I had in my local SVN repository. If you have some compiling problems, please let me know and I'll try to help you
    Get your fpc4gba copy now!
    Get your fpc4nds copy now!

  7. #17

    another day, another problem (touchpad).

    downloaded the new package 0809, recompiled fpc without errors...

    result = the same

    :(

  8. #18

    another day, another problem (touchpad).

    That's very strange... Try to do a "make clean PPC_TARGET=arm" before compiling all stuff
    Get your fpc4gba copy now!
    Get your fpc4nds copy now!

  9. #19

    another day, another problem (touchpad).

    tried it. it did more stuff than before, but that didn't change anything.

  10. #20

    another day, another problem (touchpad).

    maybe there's something i forgot to tell. let's see:

    i am using your build_fpc4nds.bat.
    i have updated devkitpro with it's automated installer.
    i am using the latest source of fpc (using the address from the batch-file)
    and the latest libndsfpc.

    directorys are:
    d:\fpc for the fpc-source
    d:\fpc4nds for youknowwhat
    d:\arm-nds for binutils.

    looking at the output when compiling fpc, there is no error, just a bunch
    of warnings, for example something like tthread.inc is a stub and such.

    my fpc.cfg, located in d:\fpc4nds\bin\arm-nds is:

    -Tnds
    -FuD:\fpc4nds\units\arm-nds
    -XParm-nds-
    -FDD:\fpc4nds
    -FDD:\fpc4nds\bin\arm-nds
    -FiD:\fpc4nds\libnds
    -FlC:\devkitpro\libnds\lib
    -FlC:\devkitpro\devkitARM\lib\gcc\arm-eabi\4.1.1
    -FlC:\devkitpro\devkitARM\lib\gcc\arm-eabi\4.1.1\thumb
    -FlC:\devkitpro\devkitARM\arm-eabi\lib
    -FlC:\devkitpro\devkitARM\arm-eabi\lib\thumb

    my batch-file for compiling arm9 is:

    ppcarmnds %1.pp9 -Sg
    @j:\nds\no$gba %1

    ... ppcarmnds is located in d:\fpc4nds\bin\arm-nds, which is included
    in the path.

    my batch-file for compiling arm9 and arm7 is

    ppcarmnds %1.pp9 -Sg
    ppcarmnds %1.pp7 -Sg
    ndstool -c %1.nds -9 %1.arm9.bin -7 %1.arm7.bin
    j:\nds\no$gba %1

    PATH is:

    PATH=c:\devkitPro\msys\bin;C:\WINDOWS\system32;C:\ WINDOWS;C:\WINDOWS\System32\Wb
    em;C:\FPC214\bin\i386-Win32;D:\FPC4NDS\bin\arm-nds;c:\devkitpro\devkitarm\bin

    ... i have tried only with PATH=d:\fpc4nds\bin\arm-nds too.

    oh, btw ... i can't compile the snow-demo you've made.
    it says:

    snow.pp(46,19) Error: Duplicate identifier "QRAN_SHIFT"
    snow.pp(47,41) Error: Duplicate identifier "QRAN_MASK"
    snow.pp(48,26) Error: Duplicate identifier "QRAN_MAX"
    snow.pp(49,24) Error: Duplicate identifier "QRAN_A"
    snow.pp(50,27) Error: Duplicate identifier "QRAN_C"
    snow.pp(258,40) Error: Identifier not found "VRAM_A_MAIN_BG_0x6000000"
    snow.pp(259,40) Error: Identifier not found "VRAM_B_MAIN_BG_0x6020000"
    snow.pp(260,39) Error: Identifier not found "VRAM_C_SUB_BG_0x6200000"

    maybe that give's you a clue. the converted 3d-examples you provided
    did work properly (didn't test anything else yet).

    i guess that's it. only thing i can try now is formating my hdd and
    reinstalling XP ... sounds like a great idea xD

Page 2 of 4 FirstFirst 1234 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •