I'm new to assembler and have chosen to cut my teeth with fasm. I have gotten the hang of mode 13h. Thats cool, but I want access to a larger colour pallet and different screen resolutions. How can I go about this? Am I asking the right question or is there more to this than simply entering a different graphics mode?
Posted on 2007-01-28 19:41:38 by rain_storm
I suggest you to trash DOS and play with win32asm :) DirectX is way better than INT13h ;)

But if you really wish: int10 is used to play with the video adapter.
Posted on 2007-01-28 20:35:06 by ti_mo_n
Thanks for the advice I think I will scrap DOS no point in going any further trying to learn a language when there are better alternatives. I knew there had to be a better way
Posted on 2007-01-28 20:49:16 by rain_storm
Read about SuperVGA specifications in Ralph Brown's Interrupt List, INT 0x10. Below is the code that I have written for the new version of my library which enumerates the available modes supported by your SuperVGA driver:

Posted on 2007-01-28 21:53:39 by XCHG
For DOS, you should look into VESA2/VESA3. Dunno how good card support is these days, I have the impression there's only support for the basics since dos is dead.

The sane thing is do move to DirectX or OpenGL. These days, even 2D stuff tends to be done with 3D, to take full advantage of hardware acceleration... But you can program for, say, DX7/DirectDraw, and that will still work with most recent DX9.whatever since it's mostly backwards compatible.
Posted on 2007-01-29 00:33:47 by f0dder
Thanks for the replies. Anybody got a link to good tutorials for DirectX?
Posted on 2007-01-29 10:29:20 by rain_storm
First, start by learning win32asm in general, then add some OOP to your ASM, then learn DX. Going to DX directly will only discourage you.
Posted on 2007-01-29 16:17:27 by ti_mo_n
I was informed that the demoscene put restrictions on the files and you are not always allowed to use include when entering a competition. a fellow demoscener explained to me that direct x would limit the compos I could enter. he also showed how to manipulate the pallet this is more what I was talking about

org 100h

mov al, 13h      ; enter graphics mode
int 10h
mov ax, 0A000h    ; get screen buffer offset
mov ds, ax        ; and put it in ds

mov dx,03C8h      ; get colour pallet offset
xor al,al        ; clear al
out dx,al        ; send zero to vga card
inc dx            ; now dx points to pallet

; really bad pallet generator
reds:
  mov al, bl    ; get brightness
  out dx, al    ; red
  xor al, al    ; only red
  out dx, al    ; green
  out dx, al    ; blue

  mov al, bl    ; get brightness
  out dx, al    ; red
  xor al, al    ; only red
  out dx, al    ; green
  out dx, al    ; blue

  mov al, bl    ; get brightness
  out dx, al    ; red
  xor al, al    ; only red
  out dx, al    ; green
  out dx, al    ; blue

  mov al, bl    ; get brightness
  out dx, al    ; red
  xor al, al    ; only red
  out dx, al    ; green
  out dx, al    ; blue

  inc bl        ; make it a bit brighter
  cmp bl, 64    ; check for max brightness
  jb  reds      ; loop if not max brightness

draw:
  mov , dl  ; put colour on screen
  add dx, 04h    ; next colour
  inc si        ; next pixel
  cmp si, 0FFFFh ; compare against screen buffer limit
  jb  draw      ; loop
  add dx, 01h    ; scroll one colour for next frame

  mov ah, 01h    ; check for key press
  int 16h
  jz  draw      ; loop

  mov ax, 0003h  ; enter text mode
  int 10h
  mov ah, 4Ch    ; exit to o/s
  int 21h

he was saying that it was mode x that I should be looking into first then go for direct x. Not perfect but at least its something.
Posted on 2007-02-14 18:18:40 by rain_storm