Skip to content

Commit a2d0529

Browse files
committed
Implement int 29h, fast console output.
1 parent d2e06f9 commit a2d0529

File tree

3 files changed

+21
-0
lines changed

3 files changed

+21
-0
lines changed

src/dos.c

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2242,3 +2242,21 @@ void int28(void)
22422242
{
22432243
usleep(1); // TODO: process messages?
22442244
}
2245+
2246+
void int29(void)
2247+
{
2248+
int ax = cpuGetAX();
2249+
// Fast video output
2250+
debug(debug_int, "D-29: AX=%04X\n", ax);
2251+
debug(debug_dos, "D-29: fast console out AX=%04X\n", ax);
2252+
2253+
int ch = ax & 0xFF;
2254+
// If stdout is redirected or video is active, writes to video screen:
2255+
if(devinfo[1] != 0x80D3 || video_active())
2256+
video_putch(ch);
2257+
// Else, write to console
2258+
else if(!handles[1])
2259+
putchar(ch);
2260+
else
2261+
fputc(ch, handles[1]);
2262+
}

src/dos.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,4 @@ void int21(void);
99
void int2f(void);
1010
void int22(void);
1111
void int28(void);
12+
void int29(void);

src/main.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,8 @@ void bios_routine(unsigned inum)
108108
}
109109
else if(inum == 0x28)
110110
int28();
111+
else if(inum == 0x29)
112+
int29();
111113
else if(inum == 0x2A)
112114
int2a();
113115
else if(inum == 0x2f)

0 commit comments

Comments
 (0)