flat assembler
Message board for the users of flat assembler.

Index > DOS > Can you see this on your computer?

Author
Thread Post new topic Reply to topic
windwakr



Joined: 30 Jun 2004
Posts: 827
windwakr 21 Jun 2009, 01:48
I'm fooling around with having 2 seperate fonts onscreen in textmode at once, and just want to know if other people see it fine on their machines.

Sorry for sloppy code, I just wanted to quickly test this.
Code:
org 100h ;Make it .com

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;FORCE XP INTO FULLSCREEN           ;
;Double fonts don't work in a window;
mov ax,13h                          ;
int 10h                             ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

mov ax,03h ;Set 80x25 2 bytes per char
int 10h

mov ax,1130h ;Get location of 8x14 font
mov bh,6     ;es:bp is the font location
int 10h

push es ;set up lodsb
pop ds
mov si,bp

push cs ;set up stosb
pop es
mov di,buffer

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;Routine to Mirror the font      ;
mov cx,256*16                    ;
reverser:                        ;
mov dx,8                         ;
clc                              ;
lodsb                            ;
@@:                              ;
rcr ax,1 ;Only small way i can think of to reverse bits
rcl bx,1                         ;
dec dx                           ;
jnz @b                           ;
mov ax,bx                        ;
stosb                            ;
loop reverser                    ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

mov ax,1100h  ;Set up the font to be used
mov bp,buffer
mov cx,256
xor dx,dx
mov bh,16
mov bl,1
int 10h

mov ax,1103h ;Set it so the brightness bit for foreground..
mov bl,4     ;characters changes which font is used
int  10h

mov ax,1000h ;Disable the second font from being bright
mov bx,0712h
int 10h

push 0B800h ;The text mode screen location in memory
pop es

push cs
pop ds

mov si,str1
mov bl,7
xor di,di
call cspr

mov si,str2
mov bl,00001111b
mov di,24*2
call cspr

xor ax,ax
int 16h

ret

cspr:    ;Crappy
lodsb    ;String
or al,al ;Printing
jz @f    ;Routine   or, CSPR
stosb
mov al,bl
stosb
jmp cspr
@@:
ret

str1 db 'Omg, Mirrored Text!!  |',0
str2 db '  !!txeT derorriM ,gmO',0

buffer: ;the font needs 3584 bytes
    


EDIT: It SHOULD work on all machines that support two onscreen fonts now.

_________________
----> * <---- My star, won HERE


Last edited by windwakr on 21 Jun 2009, 22:48; edited 1 time in total
Post 21 Jun 2009, 01:48
View user's profile Send private message Reply with quote
sinsi



Joined: 10 Aug 2007
Posts: 789
Location: Adelaide
sinsi 21 Jun 2009, 02:29
Code:
mov ax,1130h ;Get location of 8x14 font 
mov bh,2     ;es:bp is the font location 
int 10h 
    

1130 is supposed to return
Quote:
CX = bytes/character of on-screen font (not the requested font!)
Post 21 Jun 2009, 02:29
View user's profile Send private message Reply with quote
windwakr



Joined: 30 Jun 2004
Posts: 827
windwakr 21 Jun 2009, 02:35
Lol, I was reading that earlier, I guess I just wasn't focusing..Thanks.

Edit: EDIT: NEVERMIND, I had ds in a different segment. Good ol' DOS debug.....

EDIT: I still can't get it working right for dosbox or virtualpc, their interrupt must not return the right number, because I can get it working if I directly code 14 into the char height.
Post 21 Jun 2009, 02:35
View user's profile Send private message Reply with quote
sinsi



Joined: 10 Aug 2007
Posts: 789
Location: Adelaide
sinsi 21 Jun 2009, 04:31
You are getting the 8x14 font - try the 8x16 font. I changed one bit of code and it works now in VMWare
Code:
mov ax,1130h ;Get location of 8x14 font 
;mov bh,2     ;es:bp is the font location 
mov bh,6 ; 8x16 font
int 10h 
    


Description: From VMWare Workstation in Win7 x64
Filesize: 1.6 KB
Viewed: 9062 Time(s)

MS-DOS-2009-06-21-13-59-24.png


Post 21 Jun 2009, 04:31
View user's profile Send private message Reply with quote
sinsi



Joined: 10 Aug 2007
Posts: 789
Location: Adelaide
sinsi 21 Jun 2009, 04:36
heh, change the block specifier to 0 and look what happens...


Description: Eye-watering
Filesize: 10.43 KB
Viewed: 9059 Time(s)

MS-DOS-2009-06-21-14-04-16.png


Post 21 Jun 2009, 04:36
View user's profile Send private message Reply with quote
Coddy41



Joined: 18 Jan 2009
Posts: 384
Location: Ohio, USA
Coddy41 21 Jun 2009, 12:19
Shocked thats cool looking, it looks like a DOS meltdown Very Happy
Post 21 Jun 2009, 12:19
View user's profile Send private message Visit poster's website Reply with quote
windwakr



Joined: 30 Jun 2004
Posts: 827
windwakr 21 Jun 2009, 18:25
sinsi, thanks. Grabbing the 8x16 font fixes everything.

EDIT: But DOSBox displays the second font as bright. Does DOSBox not handle this code right, Or do I not have it properly implemented?

It should disable the brightness bit from working, so the second font isnt always bright.
Code:
mov ax,1000h ;Disable the second font from being bright 
mov bx,0712h 
int 10h 
    
Post 21 Jun 2009, 18:25
View user's profile Send private message Reply with quote
windwakr



Joined: 30 Jun 2004
Posts: 827
windwakr 22 Jun 2009, 01:40
Does anyone have any ideas of how to flip the font up-side down? My only idea involves tons of push's, pop's, movsw's, and xchg's.
Post 22 Jun 2009, 01:40
View user's profile Send private message Reply with quote
sinsi



Joined: 10 Aug 2007
Posts: 789
Location: Adelaide
sinsi 22 Jun 2009, 01:57
Code:
;upside down font
        mov cx,256
    .0: mov bx,16
    .1: lodsb
        mov [es:di+bx-1],al
        dec bx
        jnz .1
        add di,16
        loop .0
    

This is fun...
Post 22 Jun 2009, 01:57
View user's profile Send private message Reply with quote
windwakr



Joined: 30 Jun 2004
Posts: 827
windwakr 22 Jun 2009, 02:02
Nice! I wouldn't have been able to think that up.

Code:
mov [es:di+bx-1],al     

I didn't know you could do such complicated memory accesses

[segment:offset +/- bx +/- number]


Last edited by windwakr on 22 Jun 2009, 14:54; edited 1 time in total
Post 22 Jun 2009, 02:02
View user's profile Send private message Reply with quote
rCX



Joined: 29 Jul 2007
Posts: 172
Location: Maryland, USA
rCX 22 Jun 2009, 03:51
Back in the day that would have been a brilliant virus Wink
Post 22 Jun 2009, 03:51
View user's profile Send private message Reply with quote
windwakr



Joined: 30 Jun 2004
Posts: 827
windwakr 22 Jun 2009, 16:58
Does anyone have any info on what "BL > 0fh" does in "ax=1000h int 10h"? I see that when bl <= 0fh it replaces any color that bl specifies with the one in bh. But I don't understand what it does when bl > 0fh. The "mov bx,0712h" in my code was borrowed, so I don't understand it.


EDIT: Ok, after some google'ing I finally found some info on them HERE.
The info starts at "Port-Index: 00h-0fh"(so you can search for that line) and the "Port-Index" would just be bl.

EDIT2: Even more info on page 37 of This PDF.

EDIT3:
Attribute Mode Control Register wrote:
0 Graphics Mode — When this bit is 1, graphics mode is selected and pixel data from the frame buffer
is used to produce the pixel stream
. When this bit is 0, text mode is selected, and text attribute and font
pattern information is used to produce the pixel stream.

Bit 0 of Attribute Mode Control Register....could this be used to send pixel data to a text mode screen?



EDIT4: Wow, The text mode palette can be edited, I didn't know that. You can pick 16 colors out of 262,000 to display on screen, do all machines support this? See palman.com in this file



Code:
(Table 00017)
Values for attribute register number:
10h    attribute mode control register (should let BIOS control this)
11h    overscan color register (see also AX=1001h)
12h    color plane enable register (bits 3-0 enable corresponding
text attribute bit)
13h    horizontal PEL panning register
14h    color select register
    




Would you like a red command prompt?
(WINXP users run this from a command prompt.)
Code:
org 100h

;;;Let WINXP users see it too
mov ax,13h
int 10h
mov ax,03h
int 10h
;;;

mov ax,1000h
mov bx,0407h ;Replace DOS white with blood red Smile
int 10h

ret
    

_________________
----> * <---- My star, won HERE
Post 22 Jun 2009, 16:58
View user's profile Send private message Reply with quote
GhostXoPCorp



Joined: 13 Dec 2008
Posts: 199
Location: 01F0:0100
GhostXoPCorp 23 Jun 2009, 01:33
ok ,where did you learn all of these fonts? they al look very usefull
Post 23 Jun 2009, 01:33
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.