1. 640*480 memory modes

Okay, I was wondering if there was any way to use the memory-copying
techniques in graphics_mode 19. Can anyone help?

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
The Reaper  (J. Lays)   http://www.geocities.com/TimesSquare/Alley/4444/
reaper at auracom.com      Check out my Euphoria Games page at:
            -= http://www.geocities.com/TimesSquare/Alley/4444/eugames.html
      ........................
     . .. -||..........__......  "Some will live life
      . /  ||......../-- \\.::::  Unwilling to ask why,
   . ..|   ||...... /    | |.:::  And they will be forgotten,
     .|  _-||.......||   / /.:::: After they die."
    ..| |..||...... -\_- \ |\-.:::
     .| |.[< \ .../            \.::
      .||.|||\|\ |  -      - .  \.::::
     ...|.\|| |  \  |        |   |.:::.
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

new topic     » topic index » view message » categorize

2. Re: 640*480 memory modes

The Reaper wrote:

> Okay, I was wondering if there was any way to use the memory-copying
> techniques in graphics_mode 19. Can anyone help?

    ?? Mode 19, is normal MCGA, you mean SVGA ??    Well thanx to Pete
Eberlein (if you looked at his SVGA tricks mail...)   it is possible to
do this...

    * You can copy 320*200 bytes at once.... (max)
    * Also in SVGA you can only acces from #A0000 until #A0000+(320*200)

    * But with this interrupt trick you can set where you want #A0000 to
be on the svga screen..
-- Code begins..
    integer bank_start, bytes_per_line, bank_granularity

    procedure svga_offset (sequence p)
    sequence regs, dummy_s
        regs = repeat(0,10)
        regs[REG_AX] = #4F05
        regs[REG_BX] = #0000
        regs[REG_DX] = floor(p[2] * bytes_per_line + p[1] /
bank_granularity
        dummy_s = dos_interrupt(#10, regs)
        bank_start = regs[REG_DX] * bank_granularity
end procedure

procedure svga_setup(integer mode)
    atom data
    sequence regs
    data = allocate_low(256)
    regs = repeat(0,10)
    regs[REG_AX] = #4F01
    regs[REG_CX] = mode
    regs[REG_ES] = floor(data / 16)
    regs[REG_DI] = and_bits(data, 15)
    regs = dos_interrupt(#10, regs)
    bank_granularity = (peek(data + 4) + 256 * peek(data + 5)) * 1024
    bytes_per_line = peek(data + #10) + 256 * peek(data + #11)
    free_low(data)
end procedure
-- code ends (full credits to Pete Eberlein)

You can now use it like this:

    ? graphics_mode (257)
    svga_setup(257)
    svga_offset({100,100})
    mem_set (#A0000,4,320*200)

It will set the screen to color 4, from position {100,100} until 320*200
bytes(max)
It shouldn't be too hard to copy a virtual screen to the svga... you can
use this routine, to copy a equal size virtual screen to the svga screen
of 640*400 (this is more an example..)
svga_offset ({0,0})
mem_copy (#A0000, my_vs, 320*200)
svga_offset({0,100})
mem_copy(#A0000,my_vs, 320*200)
svga_offset({0,200})
mem_copy(#A0000,my_vs, 320*200)
svga_offset({0,300})
mem_copy(#A0000,my_vs, 320*200)
-- Eh voila, overhead is 4 interrupts and 4 times as much to copy..

Compare to euphoria this is lightning fast, euphoria's overhead is...
    * function calling (call display_image, assuming the virtual screen
is in a sequence)
    * atom to byte converting (not so big deal, it is already saved as
4-byte integer, simply the first or last is copied, i believe)
    * interrupt for *every* pixel after the first 320*200 pixels (thus
100 lines)

The last of euphoria's overhead is giant, and a real slowdown... try
this code and see how fast it is.. bet you'll be suprised..! I suppose a
speed increase (compared to virtual screen in sequence, and then
display_imaged to the screen) of about 300%, just guessing...try!

I learned all this from hacking Pete's svga tricks file....
Maybe you should do the same.. ??

Ralf Nieuwenhuijsen
nieuwen at xs4all.nl

> http://www.geocities.com/TimesSquare/Alley/4444/eugames.html

Eh... what about an update someday ??

new topic     » goto parent     » topic index » view message » categorize

3. Re: 640*480 memory modes

At 07:04  21/10/97 +0100, you wrote:

>    ?? Mode 19, is normal MCGA, you mean SVGA ??    Well thanx to Pete
>Eberlein (if you looked at his SVGA tricks mail...)   it is possible to
>do this...

Um... thanks for all the info. Unfortunatly, I made a mistake. I wanted to
use Mode 18 (sorry). I want (okay, need) to have 640*480, but I'd prefer NOT
to use SVGA (no work on some cards), so I'd have to live with only 18
colors. So, two questions...

1) Will what you sent me work with Mode 18?

2) I saw a graphics mode in your NEXTGFX.E called mode 20, 640*400*256, but
was a Graphix mode, not SVGA. What about that? Thanks.

>Eh... what about an update someday ??

How about someone making some REAL games, eh? (just kidding, I'm haven't
done much lately either. That will change by Dec. 1st)

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
The Reaper  (J. Lays)   http://www.geocities.com/TimesSquare/Alley/4444/
reaper at auracom.com      Check out my Euphoria Games page at:
            -= http://www.geocities.com/TimesSquare/Alley/4444/eugames.html
      ........................
     . .. -||..........__......  "Some will live life
      . /  ||......../-- \\.::::  Unwilling to ask why,
   . ..|   ||...... /    | |.:::  And they will be forgotten,
     .|  _-||.......||   / /.:::: After they die."
    ..| |..||...... -\_- \ |\-.:::
     .| |.[< \ .../            \.::
      .||.|||\|\ |  -      - .  \.::::
     ...|.\|| |  \  |        |   |.:::.
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

new topic     » goto parent     » topic index » view message » categorize

4. Re: 640*480 memory modes

Reaper wrote:

>>    ?? Mode 19, is normal MCGA, you mean SVGA ??    Well thanx to Pete
>>Eberlein (if you looked at his SVGA tricks mail...)   it is possible to
>>do this...
>
>Um... thanks for all the info. Unfortunatly, I made a mistake. I wanted to
>use Mode 18 (sorry). I want (okay, need) to have 640*480, but I'd prefer NOT
>to use SVGA (no work on some cards), so I'd have to live with only 18
>colors. So, two questions...
>

I remembered, a few months ago i uploaded virtual page library used in the
mode 18, to the Euphoria homepage (user contribution). that library was
made by other korean euphorian (Mr. Siil Park) and has been included in
my "arcade" program...

I also have 256 color (SVGA) virtual page library, which was also made by
Mr. Park. I have no experience of using it, but i heard he used VESA mode
for it. SVGA mode usually does not work well in my computer and in Park's
computer also. however, at least, his 256 SVGA library works in my computer
works well. i saw he used dos interrupt, bank switching... etc in his source.
if you want, i will sent it to you (it includes demo example).

hope this a little help to you.

Bye... from Lee woo seob

new topic     » goto parent     » topic index » view message » categorize

5. Re: 640*480 memory modes

On 22 Oct 97 , The Reaper wrote:

> but I'd prefer NOT to use SVGA (no work on some cards), so I'd have
> to live with only 18 colors. So, two questions...
                        ^^^^^^^^^^
Wrong again ;) You meant 16 colors, do you?

Regards,
  Daniel Berstein
  danielberstein at usa.net
  http://www27.pair.com/daber/architek

new topic     » goto parent     » topic index » view message » categorize

6. Re: 640*480 memory modes

Lee woo seob wrote:

> I also have 256 color (SVGA) virtual page library, which was also made
> by
> Mr. Park. I have no experience of using it, but i heard he used VESA
> mode
> for it. SVGA mode usually does not work well in my computer and in
> Park's
> computer also. however, at least, his 256 SVGA library works in my
> computer
> works well. i saw he used dos interrupt, bank switching... etc in his
> source.
> if you want, i will sent it to you (it includes demo example).

I am very interestes in that code, could you post it or send it to me,
please... (i would really like that, to have a look)

And about the graphix mode 20, of type Grafix, it is there so you could
specify how nextGFX should configure and control their graphix output,
for some reason you may not want to use SVGA-optimized code, but the
normal built-in graphical routines (like pixel and get_pixel, etc)
.NextGFX will use those built-in routine when in a GRAPHIX mode, when it
is in a MCGA mode it will use code optimized for MCGA-mode19, when in
ModeX it will use special ModeX routines (note ModeX is only available
through SetMode, see the documentation) SVGA modes are optimized for
SVGA. (in the way i decribed before)
    I am not sure how the memory is ordered in mode 18 (euphoria mode
18)
    Maybe somebody got some docs on this ? Or just knows the answer ?

    I suppose that it holds 2 pixels per byte (the highest 4 bits are
the color value of the first and the lowest of the second) But i have
not tested nor read this. It just seems logical. If somebody knows more,
please tell me, there has to be some way this can also be optimized!

Also i will release un update on nextGFX this weekend, i still have to
document, test and make a nice demo. That update will support virtual
screen handling, using command lists, which are compiled to know as much
as we can before we have to execute the command list. The most difficult
part is handlers, which give you acces to some of the variablen and
values of the commands, after all, they have to be dynamic (for
scrolling for example, you want the offset addres of the big image to be
dynamic, that means that you can change it quickly using a few routines,
after it has been compiled!)
    When the update is totally done, tested and documented, i will post
the code the irv again and to Robert.

    BTW Were there any questions about the documentation or was it clear
??
    English is not my natural language, so i suppose that it could be
confusing at some points.

Ralf Nieuwenhuijsen
nieuwen at xs4all.nl

new topic     » goto parent     » topic index » view message » categorize

7. Re: 640*480 memory modes

At 03:42  23/10/97 +0100, you wrote:

I understand about mode 20. Thanks, Ralf.

Loo woo seob, anything you can send me about mode 18 or the other modes you
were talking about would be appreciated.

And, yes Pete, Mode 18 only has 16 colors. Sigh... smile

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
The Reaper  (J. Lays)   http://www.geocities.com/TimesSquare/Alley/4444/
reaper at auracom.com      Check out my Euphoria Games page at:
            -= http://www.geocities.com/TimesSquare/Alley/4444/eugames.html
      ........................
     . .. -||..........__......  "Some will live life
      . /  ||......../-- \\.::::  Unwilling to ask why,
   . ..|   ||...... /    | |.:::  And they will be forgotten,
     .|  _-||.......||   / /.:::: After they die."
    ..| |..||...... -\_- \ |\-.:::
     .| |.[< \ .../            \.::
      .||.|||\|\ |  -      - .  \.::::
     ...|.\|| |  \  |        |   |.:::.
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

new topic     » goto parent     » topic index » view message » categorize

8. Re: 640*480 memory modes

The Reaper wrote:
>
> Loo woo seob, anything you can send me about mode 18 or the other modes you
> were talking about would be appreciated.

Lee, May I have a copy of the svga library too?

> And, yes Pete, Mode 18 only has 16 colors. Sigh... smile

Did I say something?  smile
It was Daniel Berstein that pointed out the number of colors.

Here's what I know about mode 18, 640x480x16.  Video memory is set up
like 8 pixels per byte.  Each bit written to memory is copied to any
combination of the 4 video planes (red, green, blue, intensity).  Which
planes bits are copied to is determined by the video map mask register.
So to write a magenta pixel to the screen set the map mask to 5 and
write a 1 to memory.  If the memory isn't already known to be 0's then
you have to not the map mask register and write a 0 to memory.  But
there are other write modes that the video processor can do, like one
optimized for bit-block-transfers and one for single pixel methods.  In
my opinion, 16-color modes are not worth the headache of switching
planes and manipulating bits and all that.  Sixteen-color routines would
have to be coded in machine language to be fast enough for any real
use.  So I suggest sticking with SVGA.

Happy Coding,
--
                   _____         _____        _____
    ________      /\    \       /\    \      /\    \
   /   \    \    /  \____\     /  \____\    /  \____\
  /  _  \____\  /   / ___/_   /   /____/   /   / ___/_
 /  / \  [___] /   / /\____\ /    \    \  /   / /\____\
 \  \_/ /    / \   \/ / ___/_\     \    \ \   \/ / ___/_
  \    /____/   \    / /\    \\/\   \    \ \    / /\    \
   \   \    \    \   \/  \____\  \   \    \ \   \/  \____\
    \   \    \    \      /    /   \   \____\ \      /    /
     \   \____\    \    /    /     \  /    /  \    /    /
      \  /    /     \  /    /       \/____/    \  /    /
       \/____/       \/____/xseal at harborside.com\/____/

new topic     » goto parent     » topic index » view message » categorize

9. Re: 640*480 memory modes

On 23 Oct 97 , The Reaper wrote:


> And, yes Pete, Mode 18 only has 16 colors. Sigh... smile

Je, je, je.. WRONG again ;)

I (daniel) made that comment... smile

Regards,
  Daniel Berstein
  danielberstein at usa.net
  http://www27.pair.com/daber/architek

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu