A86: Re: Re: Asm questions


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

A86: Re: Re: Asm questions




>>2.  How do you generate random numbers?
>
>With a routine. I think there was one by Jimmy Mardell or something.


Mardell's routine is faster than the ops, though probably not quite as
random (I assume the rom routines use a PI-type algorithm).   I took out all
the pushes/pops, so if you don't want it to trash your registers, put them
back in.  It destroys HL, DE and BC.

; by Jimmy Mardell -- from ZTetris
Random:         ; Creates a random number 0 <= x < A
 ld b,a
 ld a,r
 add a,a
 ld hl,0
 ld d,0
 ld e,a
RMul:
 add hl,de
 djnz RMul
 ld a,h
 ret

>>3.  What is a good program to use to make a title screen?  I'd like to use
>>grayscale, if possible.
>>
>For good 1024 bit screens, use BMP2ASM by Trent Lillehaugen and PIC2RLE by
>David Phillips.  Both can be found in the ticalc DOS programs section.  I
>would strongly recommend understanding grayscale before using it.


Actually, Pic2RLE and BMP2ASM are for use on 1-bit or monochrome pictures.
They are not grayscale (and the Pic2RLE zip includes BMP2ASM, btw).  But
what I think he meant is that doing a grayscale title picture is a whole lot
of work and takes up alot of space.  You will have to install your own
interrupt handler just for the title picture, then uninstall it.  And you
will have to have _twice_ or _four_ times as much memory for the picture.  A
grayscale title picture would probably add at least 2-3k to your program,
where as a Pic2RLE compressed title screen would only add between 400-800
bytes, depending on the compression (the decompressor for RLE compression is
really small, DispRLE is only 32 bytes!).

--
David Phillips <electrum@tfs.net>
ICQ: 13811951
AOL/AIM: Electrum32
86 Central: http://www.tfs.net/~electrum/