You are not logged in.


#1 2005-07-02 05:41:40

Nelson
Member
Registered: 2005-07-02
Posts: 35
PM

Mode 13h text printing (Primitive).

Code:

printFont:
    push eax
   
    mov bx, ax
    mov cx, dx
   
    jmp .startLoop
   
    .startLoop:   
        lodsb
       
        cmp al, '*'
        je .equalsStar
       
        cmp al, ' '
        je .equalsSpace
       
        cmp al, 0x00
        je .equalsNL
       
        cmp al, 0x10
        je .equalsEnd
           
    .equalsStar:
        inc bx
        mov al, 0x03
        call put_0x13_pixel
       
        jmp .startLoop
       
    .equalsSpace:
        inc bx
        mov al, 0x00
        call put_0x13_pixel
       
        jmp .startLoop
       
    .equalsNL:
        inc cx
        pop eax
        mov bx, ax
        push eax
       
        jmp .startLoop
       
    .equalsEnd:
        ret

and how to use it:

Code:

        LetterA:
            db '***',0x00
            db '*  *',0x00
            db '***',0x00
            db '*  *',0x00, 0x10
           
        font_test:
            mov      ax, 1                   ; clear the screen
            call      set_mode_0x13     ; set mode 0x13
       
            mov esi, LetterA
            call printFont

For some reason it never returns *tear* but it DOES work smile

Have fun.

Offline

 

#2 2005-07-02 12:04:05

Dex4u
Active member
Registered: 2005-02-19
Posts: 132
PM

Re: Mode 13h text printing (Primitive).

It does not return because of your stack, add pop eax  on ending like this:

Code:

.equalsEnd:
        pop   eax
        ret

But still a nice bit of code smile.

Offline

 

#3 2005-07-02 15:49:10

Nelson
Member
Registered: 2005-07-02
Posts: 35
PM

Re: Mode 13h text printing (Primitive).

Haha, can't believe I didn't think of that. Thanks smile

Offline

 

#4 2005-07-02 17:26:10

Nelson
Member
Registered: 2005-07-02
Posts: 35
PM

Re: Mode 13h text printing (Primitive).

http://www.javaop.com/uploads/guest/BOSNice.PNG

smile Me playing around with the fonts and a window code I wrote

Offline

 

#5 2005-07-21 17:13:07

bubach
Administrator
From: Trollhättan, Sweden
Registered: 2005-02-15
Posts: 367
PM  Website

Re: Mode 13h text printing (Primitive).

Cool, I missed this thread.. smile
So, have you implemented the mouse code to this yet? tongue
Keep up the great work..

/ Christoffer

Offline

 

#6 2005-08-01 00:47:00

Nelson
Member
Registered: 2005-07-02
Posts: 35
PM

Re: Mode 13h text printing (Primitive).

Well I started working on it having very little knowledge in how a mouse driver worked.
I plan to read more into it and attempt to write one directly to ASM instead of porting Sanik's over.

I believe I still have the code
Yep: http://www.advancedcontent.net/warrior/ … /mouse.inc

Offline

 

#7 2005-08-01 15:38:00

Dex4u
Active member
Registered: 2005-02-19
Posts: 132
PM

Re: Mode 13h text printing (Primitive).

Sorry Nelson,
i did not know you was working on a mouse driver for BOS, as i have just ported the driver from "Dex4u" over to BOS, i have sent the code to bubach for testing, seting up as he wants.
If i had known you was working on a driver, i would not of ported my mouse driver.

Offline

 

#8 2005-08-01 19:42:35

Nelson
Member
Registered: 2005-07-02
Posts: 35
PM

Re: Mode 13h text printing (Primitive).

No problem, it's the fact that it got done.
Had you done it or I done it doesn't make a difference.
Good job.

Offline

 

#9 2005-08-01 19:47:28

bubach
Administrator
From: Trollhättan, Sweden
Registered: 2005-02-15
Posts: 367
PM  Website

Re: Mode 13h text printing (Primitive).

Yeah, thanks a lot!
Gonna test it asap. But unfortunate, i started working again ( just for this week, though ).. Too bad that I need money for cool tech stuff, otherwise I could have spended all my summer hacking on BOS instead.. tongue

Offline

 

#10 2005-08-01 19:55:30

Nelson
Member
Registered: 2005-07-02
Posts: 35
PM

Re: Mode 13h text printing (Primitive).

I got summer school so no more late nights with me and an assembler unfortunately sad

Offline

 

#11 2005-08-01 20:17:44

Dex4u
Active member
Registered: 2005-02-19
Posts: 132
PM

Re: Mode 13h text printing (Primitive).

No work, no play, is a saying in the UK.

Offline

 

 

Board footer

Powered by PunBB
BOS homepage © Copyright 2005 Christoffer Bubach
Strict XHTML and valid CSS.