Changeset 557
- Timestamp:
- Jul 27, 2011, 8:23:54 PM (14 years ago)
- Location:
- cmedia/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
cmedia/trunk/Cmpci/cmpci.c
r556 r557 452 452 #endif 453 453 454 int prog_dmabuf(struct cm_state *s, unsigned rec); 455 void update_mixer(struct cm_state *s); 456 void set_device_state(struct cm_state *s); 454 __static__ int prog_dmabuf(struct cm_state *s, unsigned rec); 455 __static__ void update_mixer(struct cm_state *s); 457 456 458 457 … … 546 545 void maskw(unsigned short addr, unsigned mask, unsigned value); 547 546 #pragma aux maskw = \ 547 "xor eax, eax" \ 548 548 "in ax, dx" \ 549 549 "and eax, ecx" \ … … 569 569 modify exact nomemory [ecx] \ 570 570 value [cl]; 571 572 void set_device_state(struct cm_state *s); 571 573 572 574 #endif -
cmedia/trunk/Lib32/debug.c
r354 r557 51 51 static char hextab[]="0123456789ABCDEF"; 52 52 53 53 #ifdef DEBUG 54 #define MAGIC_COMM_PORT 0x3f8 // pulled from word ptr 40:0 55 //#define MAGIC_COMM_PORT 0x2f8 // pulled from word ptr 40:0 56 57 58 #define UART_DATA 0x00 // UART Data port 59 #define UART_INT_ENAB 0x01 // UART Interrupt enable 60 #define UART_INT_ID 0x02 // interrupt ID 61 #define UART_LINE_CTRL 0x03 // line control registers 62 #define UART_MODEM_CTRL 0x04 // modem control register 63 #define UART_LINE_STAT 0x05 // line status register 64 #define UART_MODEM_STAT 0x06 // modem status regiser 65 #define UART_DIVISOR_LO 0x00 // divisor latch least sig 66 #define UART_DIVISOR_HI 0x01h // divisor latch most sig 67 68 #define DELAY nop 69 #endif 70 71 #ifdef DEBUG //--------------------------- CharOut - 72 void CharOut(char c) 73 { 74 _asm { 75 76 mov dx, MAGIC_COMM_PORT // address of PS/2's first COM port 77 add dx, UART_LINE_STAT 78 79 ReadyCheck: 80 in al, dx // wait for comm port ready signal 81 82 DELAY 83 DELAY 84 DELAY 85 86 test al, 020h 87 jz ReadyCheck 88 89 // Send the character 90 91 add dx, UART_DATA - UART_LINE_STAT 92 mov al,c 93 out dx, al 94 95 DELAY 96 DELAY 97 DELAY 98 } 99 } 100 #endif 101 102 #ifdef DEBUG //------------------------- StringOut - 103 void StringOut(char *DbgStr) 104 { 105 while (*DbgStr) 106 CharOut(*DbgStr++); 107 108 if (fLineTerminate) 109 { 110 CharOut(CR); // append carriage return, 111 CharOut(LF); // linefeed 112 } 113 } 114 #endif 54 115 //-------------------- DecLongToASCII - 55 116 char * DecLongToASCII(char *StrPtr, ULONG lDecVal, USHORT Option) … … 334 395 } 335 396 336 #ifdef DEBUG //------------------------- StringOut -337 void StringOut(char *DbgStr)338 {339 while (*DbgStr)340 CharOut(*DbgStr++);341 342 if (fLineTerminate)343 {344 CharOut(CR); // append carriage return,345 CharOut(LF); // linefeed346 }347 }348 #endif349 350 #ifdef DEBUG351 #define MAGIC_COMM_PORT 0x3f8 // pulled from word ptr 40:0352 //#define MAGIC_COMM_PORT 0x2f8 // pulled from word ptr 40:0353 354 355 #define UART_DATA 0x00 // UART Data port356 #define UART_INT_ENAB 0x01 // UART Interrupt enable357 #define UART_INT_ID 0x02 // interrupt ID358 #define UART_LINE_CTRL 0x03 // line control registers359 #define UART_MODEM_CTRL 0x04 // modem control register360 #define UART_LINE_STAT 0x05 // line status register361 #define UART_MODEM_STAT 0x06 // modem status regiser362 #define UART_DIVISOR_LO 0x00 // divisor latch least sig363 #define UART_DIVISOR_HI 0x01h // divisor latch most sig364 365 #define DELAY nop366 #endif367 368 #ifdef DEBUG //--------------------------- CharOut -369 void CharOut(char c)370 {371 _asm {372 373 mov dx, MAGIC_COMM_PORT // address of PS/2's first COM port374 add dx, UART_LINE_STAT375 376 ReadyCheck:377 in al, dx // wait for comm port ready signal378 379 DELAY380 DELAY381 DELAY382 383 test al, 020h384 jz ReadyCheck385 386 // Send the character387 388 add dx, UART_DATA - UART_LINE_STAT389 mov al,c390 out dx, al391 392 DELAY393 DELAY394 DELAY395 }396 }397 #endif
Note:
See TracChangeset
for help on using the changeset viewer.