Re: A86: Hi! It's Bubbaloo13 (grayscale)


[Prev][Next][Index][Thread]

Re: A86: Hi! It's Bubbaloo13 (grayscale)




> if you move the stack, you have to either set up your own error handler,
> or be very careful to make sure no errors occur such as fp div by zero,
> potential link errors if you use _getkey (which i guess you wouldn't),
> any sort of "undefined" or "data type" errors, etc.  in other words, use
> only simple rom calls.

In the game I wrote this for, FP calls weren't really my top priority :)

> just another reason why i like having the second plane at $f000.  along
> with the fact that i'd rather not go to all the work of copying the
> stack.

I like to have a contiguous buffer, because it makes scrolling and other
effects much simpler.

> i've got a pretty spiffy grayscale routine myself, you know.  it flickers
> though, i need to move a few things out of the interrupt routine for it
> to be of any use.  but you get seperate up/down key messages and a fifo
> key event buffer!  isn't that fun! :P  i was even working on adding
> automatic link communication.

That sounds pretty cool.  Whether it flickers or not doesn't really have
anything to do with how fast/slow the routine is, unless it is so slow that
you start missing interrupts (which would be very bad).  It's the mixing
ratio.  2:1 is the only way that I've found to get flicker free grayscale,
although it still flickers a bit in flourescent light, but you can't do much
about that.  2:3 looks a bit better, but the flicker is noticable.  If you
want to use it for just a title screen, then 2:3 would probably be best, but
for a game, definitely go with 1:2.  Of course, for just a title screen, you
can skip the handler and save space with a loop like this:

; copy pictures to say $f600 and $fc00
loop:
 halt
 halt
 halt
 ld a,$36
 out (0),a
 halt
 halt
 ld a,$3c
 out (0),a
 call _get_key
 or a                ; _get_key does not set Z for keys like enter
 jr nz,loop

> what's a "port drift bug"?

If you disable interrupts entirely or write your own IM 2 handler that does
not call the one in the ROM, then the keyboard port won't get reset.  This
causes sparatic drifiting of certain keys, such as the down arrow.  To
remedy this, you have to reset the port in your code, such as everytime
through the main loop:

 ld a,$ff
 out (0),a




References: