[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Update on the Assembly Language Help
Forget the previous thread on this (called "Hi Again. Another Machine
Language Mission" on csa2 and "Need Some Help..." on csa2p). I've got the
shell around everything, so I just need two routines (well, two and a
half):
One, called GETBMP, which takes an 8 by 8 square on the hires screen,
starting at coordinates in $FA (horizontal low), $FB (horizontal high),
and $FC (vertical), and puts it into eight byte bitmap data (bytes 1-4 at
$06-$09, bytes 5-8 at $3C-$3F), like this:
+---+---+---+---+---+---+---+---+
| | |XXX|XXX|XXX|XXX| | | Byte 1 (Location $06)
+---+---+---+---+---+---+---+---+
| |XXX| | | | |XXX| | Byte 2 (Location $07)
+---+---+---+---+---+---+---+---+
| |XXX| | | | |XXX| | Byte 3 (Location $08)
+---+---+---+---+---+---+---+---+
| |XXX|XXX|XXX|XXX|XXX|XXX| | Byte 4 (Location $09)
+---+---+---+---+---+---+---+---+
| |XXX| | | | |XXX| | Byte 5 (Location $3C)
+---+---+---+---+---+---+---+---+
| |XXX| | | | |XXX| | Byte 6 (Location $3D)
+---+---+---+---+---+---+---+---+
| |XXX| | | | |XXX| | Byte 7 (Location $3E)
+---+---+---+---+---+---+---+---+
| |XXX| | | | |XXX| | Byte 8 (Location $3F)
+---+---+---+---+---+---+---+---+
^
|
Most Significant Bit
Another one, called FINDBMP, which takes the bitmap data from GETBMP and,
starting at location $5000, ending at location $5FFF, and going in
increments of 8, sees if that bitmap data matches anything. If it does,
store the memory address where we found the match in $ED (low) and $EE
(high). If not, store the value $FFFF in $ED and $EE.
The half-routine is this: Take the number stored by FINDBMP, which is at
$ED and $EE. If it is $FFFF (the bitmap data wasn't found), don't bother
with it. Otherwise, subtract $5000 and divide by 8, thus returning the
bitmap's index (0 to 511, or -1 for not found). Let's call this MEMTOIDX.
--
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
****** The New Short & Sweet Signature ******
Mail: processoroverclocked@33mhz.cjb.net
Web : http://chelsea.is.dreaming.org
Chat: http://tamchelchat.cjb.net
Don't forget: Tammy Day on February 15th!
Please change '.com' to '.cjb.net' to respond.