Quantcast
Channel: Cemetech
Viewing all articles
Browse latest Browse all 75370

z80 Assembly :: RE: A Random integer routine, non-library

$
0
0
Author: Compynerd255
Posted: 05 Jan 2013 05:51:55 pm (GMT -5)

ACagliano wrote:
bump....!!

Also, slightly off topic:

1. Should bullet code and enemy AI position updates (in a game) occur once per cycle of the main loop, or via a custom interrupt routine? What is the recommendation for this?

2. If the answer to #1 is interrupts, is there a distinct way to invoke a custom interrupt within an APP? Or would this being an APP cause you to recommend "cycle" for #1 Wink ?

You can totally do interrupts in an APP just like you can in a program, and you can do them the same way: just copy the interrupt stub to the appropriate location, set the vector, and start IM 2. However, I would not do the actual updates of bullets and enemies in an interrupt routine, simply because it takes too many processor cycles to run all that logic. Instead, I would update a timer variable and have your enemies move a certain amount each tick.
_________________
Visit Betafreak Games: http://www.betafreak.com
Help Me Pay for College:
- Sign up for Fastweb through my referal link!


Viewing all articles
Browse latest Browse all 75370

Trending Articles