Rev 5203 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 5203 | Rev 8523 | ||
---|---|---|---|
Line 22... | Line 22... | ||
22 | __asm__ volatile("int $0x40" : "=a"(counter) : "a"(26), "b"(9)); |
22 | __asm__ volatile("int $0x40" : "=a"(counter) : "a"(26), "b"(9)); |
23 | tp->millitm = (counter % 100) * 10; |
23 | tp->millitm = (counter % 100) * 10; |
24 | return 0; |
24 | return 0; |
25 | } |
25 | } |
Line 26... | Line 26... | ||
26 | 26 | ||
27 | 27 | /* |
|
28 | #include |
28 | #include |
29 | 29 | */ |
|
30 | #ifndef _WIN32 |
30 | #ifndef _WIN32 |
31 | #include |
31 | #include |
32 | #include |
32 | #include |
Line 33... | Line 33... | ||
33 | #endif |
33 | #endif |
34 | 34 | ||
35 | #ifndef NO_GRAPHICS |
35 | #ifndef NO_GRAPHICS |
Line 36... | Line 36... | ||
36 | #include |
36 | #include |
37 | #endif |
37 | #endif |
38 | 38 | ||
Line 274... | Line 274... | ||
274 | 274 | ||
275 | spkr_en = io_ports[0x61] & 3; |
275 | spkr_en = io_ports[0x61] & 3; |
276 | } |
276 | } |
Line 277... | Line 277... | ||
277 | #endif |
277 | #endif |
278 | 278 | ||
279 | #define printf con_printf |
- | |
280 | #define gets con_gets |
279 | #include |
Line 281... | Line 280... | ||
281 | #undef main |
280 | #define kbhit con_kbhit |
282 | #include "console.c" |
281 | #define getch con_getch |
283 | 282 | ||
- | 283 | // Emulator entry point |
|
284 | // Emulator entry point |
284 | int main(int argc, char **argv) |
Line 285... | Line 285... | ||
285 | int main(int argc, char **argv) |
285 | { |
286 | { |
286 | load_console(); |
287 | CONSOLE_INIT("8086"); |
287 | con_set_title("8086tiny"); |
288 | 288 | ||
Line 693... | Line 693... | ||
693 | OPCODE 48: // Emulator-specific 0F xx opcodes |
693 | OPCODE 48: // Emulator-specific 0F xx opcodes |
694 | switch ((char)i_data0) |
694 | switch ((char)i_data0) |
695 | { |
695 | { |
696 | OPCODE_CHAIN 0: // PUTCHAR_AL |
696 | OPCODE_CHAIN 0: // PUTCHAR_AL |
697 | write(1, regs8, 1); |
697 | write(1, regs8, 1); |
698 | printf("%c", regs8[0]); |
698 | // printf("%c", regs8[0]); |
699 | OPCODE 1: // GET_RTC |
699 | OPCODE 1: // GET_RTC |
700 | time(&clock_buf); |
700 | time(&clock_buf); |
701 | ftime(&ms_clock); |
701 | ftime(&ms_clock); |
702 | memcpy(mem + SEGREG(REG_ES, REG_BX,), localtime(&clock_buf), sizeof(struct tm)); |
702 | memcpy(mem + SEGREG(REG_ES, REG_BX,), localtime(&clock_buf), sizeof(struct tm)); |
703 | CAST(short)mem[SEGREG(REG_ES, REG_BX, 36+)] = ms_clock.millitm; |
703 | CAST(short)mem[SEGREG(REG_ES, REG_BX, 36+)] = ms_clock.millitm; |