Welcome, Guest. Please login or register.

Author Topic: Help. sprites are making me mad.  (Read 5605 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline bbond007Topic starter

  • Hero Member
  • *****
  • Join Date: Mar 2009
  • Posts: 1517
    • Show only replies by bbond007
Re: Help. sprites are making me mad.
« Reply #14 from previous page: March 18, 2012, 12:02:20 AM »
Quote from: ChaosLord;684179
I use AddIntServer() and things work for me.  I do my animated overlay sprite, music playback routine and some other stuff with it.

i compiled and linked this in without even changing one line...
just called vblank_start(). not doing anything with the signal....
instant crash.


http://ftp://ftp.back2roots.org/pub/back2roots/cds/xetec/fish_n_more_vol3/fishdisks/101-125/disk_105/drunkenmouse/vblank.c

so the i tried this program:
#include
int main()
{
   vblank_start();
   scanf("%c");
   vblank_end();
}

this is really discouraging.
« Last Edit: March 18, 2012, 12:17:42 AM by bbond007 »
 

Offline Piru

  • \' union select name,pwd--
  • Hero Member
  • *****
  • Join Date: Aug 2002
  • Posts: 6946
    • Show only replies by Piru
    • http://www.iki.fi/sintonen/
Re: Help. sprites are making me mad.
« Reply #15 on: March 18, 2012, 12:52:35 AM »
Quote from: bbond007;684231
   scanf("%c");
That for sure can crash. It reads a char and places it to random location in memory.

The example code is very very old. It lacks __interrupt __saveds for the interrupt code (vbinter).

Quote
I'm also not understanding vBlankInterrupt.is_data is used for. Is it like DOS where when you have an interrupt you have no clue where your data segment points? That can't be right.
is_Data is used to pass a user controlled data to the interrupt routine (it arrives in A1 register). Typically this is used if the code cannot use static variables (and thus __saveds cannot be used), for example where there might be several different interrupts  added, each with unique instance data.
« Last Edit: March 18, 2012, 01:02:55 AM by Piru »
 

Offline bbond007Topic starter

  • Hero Member
  • *****
  • Join Date: Mar 2009
  • Posts: 1517
    • Show only replies by bbond007
Re: Help. sprites are making me mad.
« Reply #16 on: March 18, 2012, 02:48:41 AM »
Quote from: Piru;684237
That for sure can crash. It reads a char and places it to random location in memory.

The example code is very very old. It lacks __interrupt __saveds for the interrupt code (vbinter).


yeah, too bad it crashes before i type the char... i'll try __interrupt (i did have __saveds)..

thanks!

as an interesting note, i see that i don't have to worry about screen->TopEdge it seems, MoveSprite always positions the sprites relative to the screen. so just calling it is enough to get the desired effect.

I ended up just replacing my Wait(signal) with Delay(1) so my main loop constantly runs (calling MoveSprite) but that is not good form i'm sure.


UPDATE:
__interupt fixed the problem!

i  bet it would even have fixed the  AddTOF() method....

thanks! results look better :)
« Last Edit: March 18, 2012, 03:14:18 AM by bbond007 »
 

Offline ChaosLord

  • Hero Member
  • *****
  • Join Date: Nov 2003
  • Posts: 2608
    • Show only replies by ChaosLord
    • http://totalchaoseng.dbv.pl/news.php
Re: Help. sprites are making me mad.
« Reply #17 on: March 18, 2012, 06:52:45 PM »
I was going to mention __interrupt as soon as u said SASC but when I searched my 100,000s of lines of source code I could not find it anywhere. (?)  So I got puzzled and forgot about it.... **scratching head**

Quote
as an interesting note, i see that i don't have to worry about  screen->TopEdge it seems, MoveSprite always positions the sprites  relative to the screen. so just calling it is enough to get the desired  effect.
hehehe kewl trick.  I might possibly use that one myself.
Wanna try a wonderfull strategy game with lots of handdrawn anims,
Magic Spells and Monsters, Incredible playability and lastability,
English speech, etc. Total Chaos AGA
 

Offline ChaosLord

  • Hero Member
  • *****
  • Join Date: Nov 2003
  • Posts: 2608
    • Show only replies by ChaosLord
    • http://totalchaoseng.dbv.pl/news.php
Re: Help. sprites are making me mad.
« Reply #18 on: March 18, 2012, 09:11:58 PM »
I found out why I have no __interrupt in my sources.

Because Real Men(tm) code their interrupts in asm! :D
Wanna try a wonderfull strategy game with lots of handdrawn anims,
Magic Spells and Monsters, Incredible playability and lastability,
English speech, etc. Total Chaos AGA
 

Offline bbond007Topic starter

  • Hero Member
  • *****
  • Join Date: Mar 2009
  • Posts: 1517
    • Show only replies by bbond007
Re: Help. sprites are making me mad.
« Reply #19 on: March 18, 2012, 09:36:57 PM »
Quote from: ChaosLord;684331
I found out why I have no __interrupt in my sources.

Because Real Men(tm) code their interrupts in asm! :D


assembler, blah...  i have had enough crashes for now.

i did get my sprite toolbar working... happy with the results.

thanks for the help!
« Last Edit: March 18, 2012, 09:40:25 PM by bbond007 »