ASM, Poking, and Screen 12

If you have questions about any aspect of QBasic programming, or would like to help fellow programmers solve their problems, check out this board!

Moderators: Pete, Mods

Post Reply
User avatar
Halifax
Coder
Posts: 21
Joined: Thu Apr 07, 2005 4:20 pm
Location: utah

ASM, Poking, and Screen 12

Post by Halifax »

well im using a picture-less battle system and still i have problems. i have a large (300 by 480) column on the left side that is a huge scroller. however, there is no problem with that it works fine and fast. the problem is my DrawBox sub. it takes the LOCATEion as input and draw a box, fills the inside, and outlines any text inside according to which color the text is. bt its slow. and i have to do it everytime i print a line. someone told me to switch over to INTEGERs and that certainly helped. i need faster.
ive looked at ASM tutorials and stuff but they never say exactly what ill need and what ill need to do FIRST. so, is there anyway i can replace that which is below with some quick asm thingy?
FOR x% = x1% * 8 - 2 TO x2% * 8 - 1
FOR y% = y1% * 16 - 1 TO y2% * 16 - 1

SELECT CASE POINT(x%, y%)
CASE 0: PSET (x%, y%), 4
CASE 7
IF POINT(x% - 1, y%) <> 7 THEN PSET (x% - 1, y%), 5
IF POINT(x% + 1, y%) <> 7 THEN PSET (x% + 1, y%), 5
IF POINT(x%, y% - 1) <> 7 THEN PSET (x%, y% - 1), 5
IF POINT(x%, y% + 1) <> 7 THEN PSET (x%, y% + 1), 5
CASE 8
IF POINT(x% - 1, y%) <> 8 THEN PSET (x% - 1, y%), 6
IF POINT(x% + 1, y%) <> 8 THEN PSET (x% + 1, y%), 6
IF POINT(x%, y% - 1) <> 8 THEN PSET (x%, y% - 1), 6
IF POINT(x%, y% + 1) <> 8 THEN PSET (x%, y% + 1), 6
CASE 9
IF POINT(x% - 1, y%) <> 9 THEN PSET (x% - 1, y%), 10
IF POINT(x% + 1, y%) <> 9 THEN PSET (x% + 1, y%), 10
IF POINT(x%, y% - 1) <> 9 THEN PSET (x%, y% - 1), 10
IF POINT(x%, y% + 1) <> 9 THEN PSET (x%, y% + 1), 10
CASE 14
IF POINT(x% - 1, y%) <> 14 THEN PSET (x% - 1, y%), 15
IF POINT(x% + 1, y%) <> 14 THEN PSET (x% + 1, y%), 15
IF POINT(x%, y% - 1) <> 14 THEN PSET (x%, y% - 1), 15
IF POINT(x%, y% + 1) <> 14 THEN PSET (x%, y% + 1), 15

CASE ELSE
END SELECT

NEXT y%
NEXT x%
And you will come to find that we are all one mind, capable of all that's imagined and all conceivable - Maynard
User avatar
{Nathan}
Veteran
Posts: 1169
Joined: Thu Aug 19, 2004 6:08 pm
Location: The wetlands of central Ohio, USA
Contact:

Post by {Nathan} »

How many times do I need to tell you people! Notice how nearly everyone that posts code in plain text gets no replies (exept for me yelling at you). So post it in a code box and we may reply.
Image
guest

Post by guest »

Nathan1993 wrote:How many times do I need to tell you people! Notice how nearly everyone that posts code in plain text gets no replies (exept for me yelling at you). So post it in a code box and we may reply.
if ya want a code box explain how to do it...
User avatar
{Nathan}
Veteran
Posts: 1169
Joined: Thu Aug 19, 2004 6:08 pm
Location: The wetlands of central Ohio, USA
Contact:

Post by {Nathan} »

Under the subject, there is a button with "Code" written on it. Click it. You will get (bracket)code(bracket). Now, paste your code in (do this all on new lines, also)... I will explain. Now press code again. so it should look like this:

Code: Select all

My code!!!
So, this is how it should look.

Code: Select all

[code] (your code should start on same line) CODE HERE!!!
(last line of code)
[/code]
Image
Antoni
Veteran
Posts: 132
Joined: Wed Jun 15, 2005 3:01 pm
Contact:

Post by Antoni »

Nathan1993 wrote:How many times do I need to tell you people! Notice how nearly everyone that posts code in plain text gets no replies (exept for me yelling at you). So post it in a code box and we may reply.
Obey the moderator, guys....

Halifax:
Mode 12h is very quirky, as each color in a pixel is in a diferent memory plane, to draw a pixel you must make four writes to memory and four outs....unless you use the latches and registers of VGA. This is a complete $$$ field, don't know if nowadays with the SVGA modes it's worth the pain. A good reference for it is Michael Abrash's Black Book of Graphics Programming, (plenty of assembler and mode 12) .It used to be at Doctor Dobbs's but they now require registration so I did'nt check. Notice it's a 160 Mb download, in 50 separate chapters.

If you want high resolutions I recommend you to use FB, because it has access to SVGA linear modes in high resolutions.
Post Reply