VOGONS


First post, by Goalatio

User metadata
Rank Newbie
Rank
Newbie

Hi, I am trying to display the 256 colorset usable by the BIOS in DOSBOX 0.73
It works.. but only for half of the colors. The other half is a giant mass of blinking squares. This works anywhere outside of DOSbox. Here's the code.

[org 0100h]


[section .text]

mov bl,01

MAIN:
cmp word [counter],255
je DONE
cmp byte [keep_neat],16
je ENDLINE
mov cx,1
mov al,0
mov ah,9
int 10h
mov dx,blank
call WRITE
inc bl
inc byte [keep_neat]
inc word [counter]
jmp MAIN

DONE:
mov ah,4ch
mov al,0
int 21h

WRITE:
mov ah,9
int 21h
ret

ENDLINE:
mov dx,eol
call WRITE
mov byte [keep_neat],0
jmp MAIN



[section .data]
counter dw 0
blank db "0", "$"
keep_neat db 0
eol db 13, 10, "$"

Compiled via NASM16

It's passion that drives me.

Reply 2 of 12, by Goalatio

User metadata
Rank Newbie
Rank
Newbie

Windows XP, I don't have a DOS pc to try it on. DOSbox is the only thing that I have found that this error occurs on. I'll take a screenshot if that helps.

Attachments

  • colors_pic.JPG
    Filename
    colors_pic.JPG
    File size
    26.22 KiB
    Views
    1619 views
    File license
    Fair use/fair dealing exception

It's passion that drives me.

Reply 5 of 12, by wd

User metadata
Rank DOSBox Author
Rank
DOSBox Author

I see no reason that it should not work in DOS.

Uhm yeah so either do that (and subsequently write a mail to microsoft why
their gfx emulation is screwed) or stop complaining about unverified bugs.

Reply 7 of 12, by wd

User metadata
Rank DOSBox Author
Rank
DOSBox Author

Usually testing it against bochs (elpin bios) or some virtualizer (vmware, vpc, virtualbox)
with installed msdos or freedos gives you a way better impression of what may actually
be right and what not (in case you don't "believe" dosbox).
Btw. you can turn off the blinking using an int10 call (al=3, bl=0/1).

Reply 8 of 12, by Servo

User metadata
Rank Newbie
Rank
Newbie

My assembly is extremely rusty so I may be completely off base here, but it looks like the problem is you aren't setting the video mode to one capable of 256 colors. On a real dos machine (and DOSBox) by default you'll have a 16 color text mode, so once you go past the first 16 colors you'll run into odd stuff like the same colors only flashing, etc. I believe a dos prompt in XP behaves differently. I think to get this working you would have to explicitly set to something capable of 256 colors by first doing something like:
mov ah, 0
mov al, 13
int 10h

Reply 9 of 12, by ripsaw8080

User metadata
Rank DOSBox Author
Rank
DOSBox Author

I think the OP meant 256 text color attributes, and wanted to see intense background colors rather than blinking text. The high bit of the attribute can mean either blinking or intense background depending on a bit in one of the video registers, and the BIOS call wd pointed out can toggle it.

Reply 10 of 12, by Goalatio

User metadata
Rank Newbie
Rank
Newbie

Confirmed that enabling background intensity allows use of 256 color attributes, thank you sir.

[org 0100h]


[section .text]
mov ax,1003h
mov bl,0
mov bh,0
int 10h

mov bl,01

MAIN:
cmp word [counter],255
je DONE
cmp byte [keep_neat],16
je ENDLINE
mov cx,1
mov al,0
mov ah,9
int 10h
mov dx,blank
call WRITE
inc bl
inc byte [keep_neat]
inc word [counter]
jmp MAIN

DONE:
mov ah,4ch
mov al,0
int 21h

WRITE:
mov ah,9
int 21h
ret

ENDLINE:
mov dx,eol
call WRITE
mov byte [keep_neat],0
jmp MAIN



[section .data]
counter dw 0
blank db "0", "$"
keep_neat db 0
eol db 13, 10, "$"

Attachments

  • colors_pic_2.JPG
    Filename
    colors_pic_2.JPG
    File size
    30.06 KiB
    Views
    1488 views
    File license
    Fair use/fair dealing exception

It's passion that drives me.

Reply 12 of 12, by Servo

User metadata
Rank Newbie
Rank
Newbie
ripsaw8080 wrote:

I think the OP meant 256 text color attributes, and wanted to see intense background colors rather than blinking text. The high bit of the attribute can mean either blinking or intense background depending on a bit in one of the video registers, and the BIOS call wd pointed out can toggle it.

Ah, that makes a lot more sense then 😀