Gönderen Konu: Vertical Blank  (Okunma sayısı 7711 defa)

Vertical Blank

« : 24.03.2007 02:05:19 »
Hızlı düğmeleri aç

jimqode

İleti: 215

Çevrimdışı
  • ***
  • Full Member
    • Profili Görüntüle
    • http://
Yine ben!

Yazdigim herseyde ekranin her tarafi ayri oynuyor. Galiba gp2x_video_waitvsync() benim dusundugum sey degil. Buffer'i flip etmeden once bir sekilde vertical blanki beklemek gerek ama nasil?

Asagida problemi kisa ve oz anlatan bir kod veriyorum. ekranda bir anda bir renk gormeyi beklerken renkli yatay bantlar goruyorum. Nette bayagi arandim. LCD registerlerinden birini poll eden bi fonskiyon buldum ama bende kilitlendi orada alet. Belki de o kod gp32 icindi tam bilemiyorum.

Kod: [Seç]
#include <stdio.h>
#include &quot;minimal.h&quot;

int
main (int argc, char* argv[])
{
    gp2x_init(1000, 16, 11025,16,0,60,1);
    while(1)
    {
        memset(gp2x_video_RGB[0].screen16,gp2x_timer_read()<<3,320*240*2);
        gp2x_video_waitvsync();
        gp2x_video_RGB_flip(0);
    }
}

void gp2x_sound_frame(void *blah, void *buff, int samples) {}
/*
Planet Retro - Retrocomputing News and Blogs
*/

Vertical Blank

« Yanıtla #1 : 24.03.2007 08:11:27 »
Hızlı düğmeleri aç

GnoStiC


  • Ziyaretçi
su an yazdigin code'u deneme sansim yok.. pazar gecesi sanirim deneyebilirim.. o zamana kadar hizli bir memset;

Kod: [Seç]
/* Copyright (C) 1998 Free Software Foundation, Inc.
   This file is part of the GNU C Library.
   Contributed by Philip Blundell <philb@gnu.org>

   The GNU C Library is free software; you can redistribute it and/or
   modify it under the terms of the GNU Lesser General Public
   License as published by the Free Software Foundation; either
   version 2.1 of the License, or (at your option) any later version.

   The GNU C Library is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   Lesser General Public License for more details.

   You should have received a copy of the GNU Lesser General Public
   License along with the GNU C Library; if not, write to the Free
   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
   02111-1307 USA.  */

/*#include <sys/syscall.h>*/

        .text
        .global  gp2x_memset;
        .type  gp2x_memset,%function
        .align 4;                                                               \

gp2x_memset:
    mov    a4, a1
    cmp    a3, $8        @ at least 8 bytes to do?
    blt    2f
    orr    a2, a2, a2, lsl $8
    orr    a2, a2, a2, lsl $16
1:
    tst    a4, $3        @ aligned yet?
    strneb    a2, [a4], $1
    subne    a3, a3, $1
    bne    1b
    mov    ip, a2
1:
    cmp    a3, $8        @ 8 bytes still to do?
    blt    2f
    stmia    a4!, {a2, ip}
    sub    a3, a3, $8
    cmp    a3, $8        @ 8 bytes still to do?
    blt    2f
    stmia    a4!, {a2, ip}
    sub    a3, a3, $8
    cmp    a3, $8        @ 8 bytes still to do?
    blt    2f
    stmia    a4!, {a2, ip}
    sub    a3, a3, $8
    cmp    a3, $8        @ 8 bytes still to do?
    stmgeia    a4!, {a2, ip}
    subge    a3, a3, $8
    bge    1b
2:
    movs    a3, a3        @ anything left?
    moveq    pc, lr        @ nope
    rsb    a3, a3, $7
    add    pc, pc, a3, lsl $2
    mov    r0, r0
    strb    a2, [a4], $1
    strb    a2, [a4], $1
    strb    a2, [a4], $1
    strb    a2, [a4], $1
    strb    a2, [a4], $1
    strb    a2, [a4], $1
    strb    a2, [a4], $1
    mov    pc, lr

.size  gp2x_memset,.- gp2x_memset;
Kod: [Seç]
void *gp2x_memset(void *s, int c, size_t n);
#undef memset
#define memset gp2x_memset
« Son Düzenleme: 24.03.2007 11:15:25 Gönderen: GnoStiC »

Vertical Blank

« Yanıtla #2 : 31.03.2007 11:38:09 »
Hızlı düğmeleri aç

jimqode

İleti: 215

Çevrimdışı
  • ***
  • Full Member
    • Profili Görüntüle
    • http://
Bu vertical blank problemini hala cozemedim. dokumanlarda sadece vsync ve hsynci yakalamak icin ilgili registerlari bulabildim ama o sirada cizilen satir numarasini okuyabilecegim bir register bulamadim. yok mudur bir babayigit sunu cozmus olan :)
/*
Planet Retro - Retrocomputing News and Blogs
*/

Vertical Blank

« Yanıtla #3 : 31.03.2007 13:13:30 »
Hızlı düğmeleri aç

GnoStiC


  • Ziyaretçi
bu konuyu tamamen unutmusum, benim hatam. eve gectigimde bilgi veririm.

Vertical Blank

« Yanıtla #4 : 01.04.2007 01:58:09 »
Hızlı düğmeleri aç

GnoStiC


  • Ziyaretçi
senin code'u denedim;
vbl bekleyince tum ekran tek renk,
vbl beklemeyince decrunch efekti gibi yatay cizgiler gormek mumkun..

asagida code ve compile edilmis hali mevcut..

Vertical Blank

« Yanıtla #5 : 01.04.2007 11:41:29 »
Hızlı düğmeleri aç

jimqode

İleti: 215

Çevrimdışı
  • ***
  • Full Member
    • Profili Görüntüle
    • http://
hay allah ya ben bu vsync'i denemistim sonuc alamamıştım. şimdi yanımda değil alet ama en kısa zamanda bakıcam. Gnostic, kod tarzına hastayım bu arada. Senin koduna bakınca ben hep kulağı tersten gösteriyormuşum gibi geliyor :) Bi kutu donut da benden kazandın. Eğer burdaki tüm dunkin donutslar kapanmadıysa alıp göndericem :)
/*
Planet Retro - Retrocomputing News and Blogs
*/