Omnimaga: The Coders Of Tomorrow
Welcome, Guest. Please login or register.
 
Omnimaga: The Coders Of Tomorrow
26 May, 2013, 11:21:21 *
Welcome, Guest. Please login or register.

Login with username, password and session length
 
   home   news downloads projects tutorials misc forums rules new posts irc about Login Register  
+-OmnomIRC

You must Register, be logged in and have at least 40 posts to use this shout-box! If it still doesn't show up afterward, it might be that OmnomIRC is disabled for your group or under maintenance.

Note: You can also use an IRC client like mIRC, X-Chat or Mibbit to connect to an EFnet server and #omnimaga.

Pages: 1 [2] 3   Go Down
  Print  
Author Topic: Sprites and Maps in C 68k -  (Read 2738 times) Bookmark and Share
0 Members and 1 Guest are viewing this topic.
Kiligolo
LV5 Advanced (Next: 300)
*****
Offline Offline

Gender: Male
Last Login: 13 January, 2013, 11:35:54
Date Registered: 11 October, 2010, 18:01:20
Location: France
Posts: 218


Topic starter
Total Post Ratings: +5

View Profile
« Reply #15 on: 30 January, 2012, 19:55:41 »
0

Hi! I have a big problem with dynamic allocation...
Here is the code:

1
2
3
4
5
6
int i, j;
unsigned char ** map = malloc(MAP_Y * sizeof(unsigned char));
for (i = 0; i < MAP_Y; i++)
{
map[i] = malloc(MAP_X * sizeof(unsigned char));
}
and at the end :

1
2
3
4
5
for (i = 0; i < MAP_Y ; i++)
{
free(map[i]);
}
free(map);
When i start the program, the Ti89 display BUSY icon and freeze but when i add ngetchx(); in this part of code:

1
2
3
4
5
6
7
8
int i, j;
unsigned char ** map = malloc(MAP_Y * sizeof(unsigned char));
for (i = 0; i < MAP_Y; i++)
{
                printf("%d",i);
                ngetchx(); //Here
map[i] = malloc(MAP_X * sizeof(unsigned char));
}
The 89 don't freeze and the program start but when i stop the program and i go to Var-Link menu, my asm program is now and expression (64000bytes).
I'm lost
« Last Edit: 30 January, 2012, 19:55:51 by Kiligolo » Logged

Spoiler for Calcul Mental:
Version 1.3 :100%!!
Here is a program that reduces your dependence on the calculator! Click here!
Spoiler for Some screen shots:
       
The screenshots are in french but there is an english version
Pages: 1 [2] 3   Go Up
  Print  
 
Jump to:  

Powered by EzPortal
Powered by MySQL Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Powered by PHP
Page created in 0.151 seconds with 31 queries.
Skin by DJ Omnimaga edited from SMF default theme with the help of tr1p1ea.
All programs, games and songs avaliable on this website are property of their respective owners.
Best viewed in Opera, Firefox, Chrome and Safari with a resolution of 1024x768 or above.