spriteähnlcihe gebilde auf dem cpc

  • hallo, ich suche immer noch ein asm-beispiel für spriteähnliche gebilde auf dem cpc. habe ein beispiel in asm gefunden, das flackert aber dermaßen, das es unbrauchbar sit.


    weiterhin habe ich noch keine vernünftige lösung für ein forth-porgramm gefunden.


    mfg

  • Zitat


    CPCAI 8/9 1992


    schick mal ein ausführlichn link rüber.
    danke.


    mfg

  • Sorry, I just want to help you but I don't speak german language, so if you speak in english, i will probably help you... Are tou speaking about Cpc+ Sprite or Cpc Sprite coding way ?

    Cpc+ Mario is coming soon...


    AsT / Impact.

  • hello, thanks you. i'm Cpc Sprite coding !!! have you her code sprite whis cpc ?


    mfg peter

  • No problem ! What do you want to know exactly ? How to plot a sprite on the screen ?

    Cpc+ Mario is coming soon...


    AsT / Impact.

  • hello, yes. with asm-code!


    ps: I can only very little English.


    thanks.


    mfg peter

  • So, enter in sprite's world :


    The most simply method is :




    I Hope I could help you in your quest... For more explanation... ask me ![/code]

    Cpc+ Mario is coming soon...


    AsT / Impact.

  • Sorry but i've just seen an error :


    you must read :


    LOOP instead of BOUC ; a french translation... Sorry for this big mistake !

    Cpc+ Mario is coming soon...


    AsT / Impact.


  • The next easiest thing to do is to repeat this for every byte :

    Code
    ld a,(de)           ; get sprite graphics
    xor (hl)             ; XOR with screen graphics
    ld (hl),a            ; write back to screen
    inc de               ; increment sprite graphics pointer
    inc hl                ; increment screen pointer


    Above code becomes:



    Notice I changed the function of DE and HL.


    If you use this routine you will see the sprite will change colour if it moves over background, but the same routine can be used to erase the sprite from the screen.


    :)

  • For more optization you can use :


    INC L instead of INC HL


    and


    INC E instead of INC DE...


    you'll win 2 nops per bytes so in this example you'll win 2x4 nops -> 8 Nops for each lines...

    Cpc+ Mario is coming soon...


    AsT / Impact.