Forum     

Go Back   Digit Technology Discussion Forum > Portables, Peripherals and Electronics > QnA (read only)
Register FAQ Calendar Mark Forums Read

QnA (read only) Mods please help transfer the contents of this forum to proper sections. :)


 
 
LinkBack Thread Tools Search this Thread Display Modes
Old 26-08-2007, 05:44 PM   #1 (permalink)
Wise Old Owl
 
a_k_s_h_a_y's Avatar
 
Join Date: May 2007
Location: bangalore
Posts: 1,923
Red face creating our own text editor..some help plzzz


guys am creating a text editor !! and now first thing that i am trying to do is write characters into the video buffer which starts at 0XB000000L (obvioulsy colour monitor) !!

first thing i will implement is type and save feature only that too with fixed name....u see am a C newb..

i try to write into video buffer but nothing is displayed the cursor is properly moved coz the second part of the prog works !!
can u tell me where the error ??
here is the code

Code:
#include <stdio.h>
#include <dos.h>

main(void)
{
    char *vram_start=(char)0xb8000000l;
    char *v;
    char a[100],scan,ascii;
    int i,j,x=0,y=0;
    union REGS ii,oo;
    v=vram_start+x*160+y*2;
    while(1)
    {
        while(!kbhit());
        ii.h.ah=0;
        int86(22,&ii,&oo);
        scan=oo.h.ah;
        *v=scan;
        v++;
        ascii=oo.h.al;
        *v=150;
        *v=ascii;
        v++;
        *v=152;
        x++;
        ii.h.ah=2;
        ii.h.dh=y;
        ii.h.dl=x;
        ii.h.bh=0;
        int86(0x10,&ii,&oo);
    }
}
the cursor properly moves the next position on screen but no char printed which i hit on keyboard !!
plzz help..thank u !

also plzz explain the concept of video buffer and the scan code of keys and ascii code of keys in detail also what is scan code of various keys..and wht about ascii code of F1 ?? ( i did write a prog to print ascii codes...but there obs u cant know which is the one for F1.. )
__________________
Sony Ericsson Flashing, Modding, Patching, Hacking And More !
http://www.akshayy.com/sonyericsson/

Last edited by a_k_s_h_a_y; 26-08-2007 at 05:50 PM.
a_k_s_h_a_y is offline  
Advertisements. Register and be a member of the community to get rid of them.
Advertisement

Old 26-08-2007, 05:56 PM   #2 (permalink)
Google Bot
 
Pathik's Avatar
 
Join Date: Aug 2005
Posts: 9,772
Default Re: creating our own text editor..some help plzzz

^^ dunno much about C but if u want to make GUi apps then better use java or visual c# .net
Pathik is offline  
Old 26-08-2007, 05:59 PM   #3 (permalink)
Wise Old Owl
 
a_k_s_h_a_y's Avatar
 
Join Date: May 2007
Location: bangalore
Posts: 1,923
Default Re: creating our own text editor..some help plzzz

no no its dos text editor ! later make it windows text editor !
i heard that all system software better written in C....is this true ??
i even read that OS is written in C so this text editor also better in C na !
__________________
Sony Ericsson Flashing, Modding, Patching, Hacking And More !
http://www.akshayy.com/sonyericsson/
a_k_s_h_a_y is offline  
Old 26-08-2007, 06:05 PM   #4 (permalink)
Google Bot
 
Pathik's Avatar
 
Join Date: Aug 2005
Posts: 9,772
Default Re: creating our own text editor..some help plzzz

I dont think that a text editor ll ever interact much with the system..
Pathik is offline  
Old 26-08-2007, 09:22 PM   #5 (permalink)
Human Spambot
 
swatkat's Avatar
 
Join Date: Mar 2004
Location: India
Posts: 2,033
Default Re: creating our own text editor..some help plzzz

Hi,
If you are using NT based OS (NT,2000,XP and above), it's not possible to directly access hardware buffers from User Mode. Moreover, NT based systems don't even have "real" DOS. Accessing hardware is done through drivers in these OSes.
So, to display characters or doing other stuff in Command Line, you need to use console APIs, or standard CRT functions. More info about console APIs:
http://msdn2.microsoft.com/en-us/library/ms682010.aspx
http://msdn2.microsoft.com/en-us/library/ms686971.aspx
http://msdn2.microsoft.com/en-us/library/ms682073.aspx
__________________
http://swatrant.blogspot.com/
swatkat is offline  
Old 26-08-2007, 10:52 PM   #6 (permalink)
Wise Old Owl
 
a_k_s_h_a_y's Avatar
 
Join Date: May 2007
Location: bangalore
Posts: 1,923
Default Re: creating our own text editor..some help plzzz

^^^ hey thanks a lot yaar...there is lot to read in that website

our HOD told we hv to sue ISR no 22 and get the job done.....i just wanted some one tell error in my prog.....coz my friend wrote almost something same and it worked for him....got to ask him for wht's the correct way !!
__________________
Sony Ericsson Flashing, Modding, Patching, Hacking And More !
http://www.akshayy.com/sonyericsson/
a_k_s_h_a_y is offline  
 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
text editor?? NagpurDaMunda QnA (read only) 8 19-03-2007 07:06 PM
New Text/Code editor koolbluez Technology News 15 08-02-2007 07:33 PM
HELP-problem in nokia text message editor cerebral_stroke Buying Advice 3 19-01-2007 07:18 AM
Can't open ANY text editor! Simple_Graduate Software Q&A 3 21-10-2006 11:35 AM
Opensource / Freeware text editor prajal Open Source 6 04-10-2006 09:09 PM

 
Latest Threads
- by Tenida
- by Charan

Advertisement




All times are GMT +5.5. The time now is 10:31 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.

Search Engine Optimization by vBSEO 3.3.2