gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

Beginners > Insight problems

#28745 - greyboy - Fri Nov 05, 2004 9:02 am

I have read some stuff about insight problems but can't seem to find the solution to my problem. Are people generally having a lot of problems with Insight/VBA? On a windows machine, using the tools from http://www.devkit.tk/, I got everything running and do -g and -O0 when I compile/link. Anyhow, if I step through my while loop (which draws pixels), it doesn't show on the screen until 3 loops, and then it'll show 3 pixels. It's as if it's delayed. On top of that, when I press Run, it basically doesn't run and says "no response from target".

Can anybody help? Is insight/vba the best source-level debug combo to use?

Thanks

#28760 - zazery - Fri Nov 05, 2004 4:58 pm

If it's a simple loop to display pixels you should have no problem compiling the code if you compiled it right. If you post your source code and make file I'm sure we can help you better.

#28787 - yaustar - Sat Nov 06, 2004 12:12 am

I think you may want the command 'Continue' (which goes to the next break point)
_________________
[Blog] [Portfolio]

#28798 - greyboy - Sat Nov 06, 2004 12:32 pm

Thanks for the tip on the 'continue'. I still can't figure why it only draws to the vba display every 3 frames though (the example below update 3 pixels to the drawn line at a time). VBA also crashes every time I disconnect. I have been using TONCs (Cearn) library.

code:
Code:

int main()
{
   int x;
   REG_DISPCNT= VID_MODE3 | VID_BG2;
   x=120;
   while (1)
   {
      x++;
      if (x > 240 ) x = 0;
      vid_mem[x]= 0x001f;
      vid_vsync();
   }
   return 0;
}


my makefile:
Code:


#
# thegame.mak
#

# --- Project details ---
PROJ    := thegame
UDIR    := ../tonclib
GDIR    := ../../gfx

COBJS   := main.o
UOBJS   := $(UDIR)/core.o $(UDIR)/keypad.o $(UDIR)/vid.o \
   $(UDIR)/oam.o $(UDIR)/bg.o

OBJS= $(UOBJS) $(COBJS)

# --- boot type ---
MB = 1
ifeq ($(MB),1)
EXT     := mb.gba
SPECS   := -specs=gba_mb.specs
else
EXT     := gba
SPECS   := -specs=gba.specs
endif

# --- Compiling ---
CROSS= arm-elf-
AS= $(CROSS)as
CC= $(CROSS)gcc
LD= $(CROSS)gcc
OBJCOPY= $(CROSS)objcopy

MODEL   := -mthumb-interwork -mthumb

ASFLAGS := -mthumb-interwork
CFLAGS  := -I./ -I$(UDIR) $(MODEL) -O0 -Wall -g # optimize with -O2
LDFLAGS := $(SPECS) $(MODEL) -g

# --- Build ---
build: $(PROJ).$(EXT)

$(PROJ).$(EXT) : $(PROJ).elf
   $(OBJCOPY) -v -O binary $< $@
   -@gbafix $@

$(PROJ).elf : $(OBJS)
   $(LD) $(LDFLAGS) $(OBJS) -o $@

$(COBJS) : %.o : %.c
   $(CC) $(CFLAGS) -c $< -o $@

$(UOBJS) : %.o : %.c
   $(CC) $(CFLAGS) -c $< -o $@
   
# --- Clean ---
.PHONY : clean
clean :
   @rm -fv $(COBJS)
   @rm -fv $(PROJ).$(EXT)
   @rm -fv $(PROJ).elf

#EOF


[/code]

#28800 - tepples - Sat Nov 06, 2004 2:41 pm

Have you checked the "frameskip" setting?
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#28828 - greyboy - Sun Nov 07, 2004 7:51 am

Thanks, tepples, for the tip. For second there, I wasn't sure if what you said was just sarcasm. :) I fixed the frameskip and it seems to be working fine except for crashing when I close insight, but I can live with that.

#29257 - Omega81 - Mon Nov 15, 2004 1:14 pm

Whats the frame skip setting for?
_________________
Keep it real, keep it Free, Keep it GNU

#29259 - identitycrisisuk - Mon Nov 15, 2004 1:44 pm

Omega81 wrote:
Whats the frame skip setting for?

To really p!$$ you off is generally my experience of it. A little while ago I had the same problem as I was wondering why everything I wrote was so jerky. I expected it to be slow but couldn't understand why they weren't at least running smoothly. I'd previously set the frame skip to max as I was only playing turn based games on VBA and it didn't really matter if it skipped frames, as long as it was playable and the music didn't mess up horribly. I'm guessing it's there as a speed issue for people (like me) whose computers aren't up to scratch.