From: <ljs...@us...> - 2007-12-12 01:12:29
|
Revision: 551 http://cadcdev.svn.sourceforge.net/cadcdev/?rev=551&view=rev Author: ljsebald Date: 2007-12-11 17:12:25 -0800 (Tue, 11 Dec 2007) Log Message: ----------- Committing C-style comments patch from quzar. Modified Paths: -------------- kos/include/kos/dbgio.h kos/kernel/arch/dreamcast/hardware/flashrom.c kos/kernel/arch/dreamcast/hardware/scif.c kos/kernel/arch/dreamcast/hardware/video.c kos/kernel/arch/dreamcast/include/dc/flashrom.h kos/kernel/arch/dreamcast/include/dc/fmath.h Modified: kos/include/kos/dbgio.h =================================================================== --- kos/include/kos/dbgio.h 2007-11-24 05:20:47 UTC (rev 550) +++ kos/include/kos/dbgio.h 2007-12-12 01:12:25 UTC (rev 551) @@ -15,110 +15,110 @@ #include <arch/types.h> -/// This struct represents a single dbgio interface. This should represent -/// a generic pollable console interface. We will store an ordered list of -/// these statically linked into the program and fall back from one to the -/// next until one returns true for detected(). Note that the last device in -/// this chain is the null console, which will always return true. +/* This struct represents a single dbgio interface. This should represent + a generic pollable console interface. We will store an ordered list of + these statically linked into the program and fall back from one to the + next until one returns true for detected(). Note that the last device in + this chain is the null console, which will always return true. */ typedef struct dbgio_handler { - /// Name of the dbgio handler + /* Name of the dbgio handler */ const char * name; - /// Returns 1 if the device is available and usable, or 0 if it - /// appears not to be. + /* Returns 1 if the device is available and usable, or 0 if it + appears not to be. */ int (*detected)(); - /// Init the interface with default parameters. + /* Init the interface with default parameters. */ int (*init)(); - /// Shut down the interface + /* Shut down the interface */ int (*shutdown)(); - /// Set polled/IRQ usage + /* Set polled/IRQ usage */ int (*set_irq_usage)(int mode); - /// Read one char from the console or -1 if there's nothing to read, - /// or an error condition exists (check errno). + /* Read one char from the console or -1 if there's nothing to read, + or an error condition exists (check errno). */ int (*read)(); - /// Write one char to the console (may need to call flush()). - /// Returns the number of chars written or -1 on error. + /* Write one char to the console (may need to call flush()). + Returns the number of chars written or -1 on error. */ int (*write)(int c); - /// Flush any queued written bytes. Returns -1 on error. + /* Flush any queued written bytes. Returns -1 on error. */ int (*flush)(); - /// Send an entire buffer. Returns the number of chars written or - /// -1 on error. If xlat is non-zero, then newline transformations - /// may occur. + /* Send an entire buffer. Returns the number of chars written or + -1 on error. If xlat is non-zero, then newline transformations + may occur. */ int (*write_buffer)(const uint8 *data, int len, int xlat); - /// Read a buffer (block). Returns the number of chars read or - /// -1 on error. + /* Read a buffer (block). Returns the number of chars read or + -1 on error. */ int (*read_buffer)(uint8 *data, int len); } dbgio_handler_t; -// These two should be initialized in arch. +/* These two should be initialized in arch. */ extern dbgio_handler_t * dbgio_handlers[]; extern int dbgio_handler_cnt; -// This is defined by the shared code, in case there's no valid handler. +/* This is defined by the shared code, in case there's no valid handler. */ extern dbgio_handler_t dbgio_null; -/// Manually select a new dbgio interface by name. Returns 0 on success or -/// -1 on error. Note that even if the given device isn't detected, this -/// will still let you select it. +/* Manually select a new dbgio interface by name. Returns 0 on success or + -1 on error. Note that even if the given device isn't detected, this + will still let you select it. */ int dbgio_dev_select(const char * name); -/// Returns the name of the currently selected device. +/* Returns the name of the currently selected device. */ const char * dbgio_dev_get(); -/// Initialize the dbgio console. The device selection process is as -/// described above. +/* Initialize the dbgio console. The device selection process is as + described above. */ int dbgio_init(); -/// Set IRQ usage - we default to polled +/* Set IRQ usage - we default to polled */ int dbgio_set_irq_usage(int mode); #define DBGIO_MODE_POLLED 0 #define DBGIO_MODE_IRQ 1 -/// Read one char from the console or -1 if there's nothing to read, -/// or an error condition exists (check errno). +/* Read one char from the console or -1 if there's nothing to read, + or an error condition exists (check errno). */ int dbgio_read(); -/// Write one char to the console (may need to call flush()). -/// Returns the number of chars written or -1 on error. +/* Write one char to the console (may need to call flush()). + Returns the number of chars written or -1 on error. */ int dbgio_write(int c); -/// Flush any queued written bytes. Returns -1 on error. +/* Flush any queued written bytes. Returns -1 on error. */ int dbgio_flush(); -/// Send an entire buffer. Returns the number of chars written or -/// -1 on error. +/* Send an entire buffer. Returns the number of chars written or + -1 on error. */ int dbgio_write_buffer(const uint8 *data, int len); -/// Read a buffer (block). Returns the number of chars read or -/// -1 on error. +/* Read a buffer (block). Returns the number of chars read or + -1 on error. */ int dbgio_read_buffer(uint8 *data, int len); -/// Send an entire buffer. Returns the number of chars written or -/// -1 on error. Newline translations may occur. +/* Send an entire buffer. Returns the number of chars written or + -1 on error. Newline translations may occur. */ int dbgio_write_buffer_xlat(const uint8 *data, int len); -/// Send a string (null-terminated). Returns the number of chars -/// written or -1 on error. +/* Send a string (null-terminated). Returns the number of chars + written or -1 on error. */ int dbgio_write_str(const char *str); -/// Disable debug I/O globally +/* Disable debug I/O globally */ void dbgio_disable(); -/// Enable debug I/O globally +/* Enable debug I/O globally */ void dbgio_enable(); -/// Printf functionality +/* Printf functionality */ int dbgio_printf(const char *fmt, ...) __printflike(1, 2); __END_DECLS -#endif // __KOS_DBGIO_H +#endif /* __KOS_DBGIO_H */ Modified: kos/kernel/arch/dreamcast/hardware/flashrom.c =================================================================== --- kos/kernel/arch/dreamcast/hardware/flashrom.c 2007-11-24 05:20:47 UTC (rev 550) +++ kos/kernel/arch/dreamcast/hardware/flashrom.c 2007-12-12 01:12:25 UTC (rev 551) @@ -158,7 +158,7 @@ that's easiest to deal with. Block 0 is the magic block, so we won't check that. */ for (i=0; i<bmcnt*8; i++) { - // Little shortcut + /* Little shortcut */ if (bitmap[i / 8] == 0) i += 8; @@ -273,58 +273,58 @@ typedef struct { union { struct { - // Block 0xE0 - uint16 blockid; // Should be 0xE0 - uint8 prodname[4]; // SEGA - uint8 unk1; // 0x13 - uint8 method; - uint8 unk2[2]; // 0x00 0x00 - uint8 ip[4]; // These are all in big-endian notation + /* Block 0xE0 */ + uint16 blockid; /* Should be 0xE0 */ + uint8 prodname[4]; /* SEGA */ + uint8 unk1; /* 0x13 */ + uint8 method; + uint8 unk2[2]; /* 0x00 0x00 */ + uint8 ip[4]; /* These are all in big-endian notation */ uint8 nm[4]; uint8 bc[4]; uint8 dns1[4]; uint8 dns2[4]; uint8 gw[4]; - uint8 unk3[4]; // All zeros - char hostname[24]; // Host name + uint8 unk3[4]; /* All zeros */ + char hostname[24]; /* Host name */ uint16 crc; } e0; struct { - // Block E2 - uint16 blockid; // Should be 0xE2 + /* Block E2 */ + uint16 blockid; /* Should be 0xE2 */ uint8 unk[12]; char email[48]; uint16 crc; } e2; struct { - // Block E4 - uint16 blockid; // Should be 0xE4 + /* Block E4 */ + uint16 blockid; /* Should be 0xE4 */ uint8 unk[32]; char smtp[28]; uint16 crc; } e4; struct { - // Block E5 - uint16 blockid; // Should be 0xE5 + /* Block E5 */ + uint16 blockid; /* Should be 0xE5 */ uint8 unk[36]; char pop3[24]; uint16 crc; } e5; struct { - // Block E6 - uint16 blockid; // Should be 0xE6 + /* Block E6 */ + uint16 blockid; /* Should be 0xE6 */ uint8 unk[40]; char pop3_login[20]; uint16 crc; } e6; struct { - // Block E7 - uint16 blockid; // Should be 0xE7 + /* Block E7 */ + uint16 blockid; /* Should be 0xE7 */ uint8 unk[12]; char pop3_passwd[32]; char proxy_host[16]; @@ -332,8 +332,8 @@ } e7; struct { - // Block E8 - uint16 blockid; // Should be 0xE8 + /* Block E8 */ + uint16 blockid; /* Should be 0xE8 */ uint8 unk1[48]; uint16 proxy_port; uint16 unk2; @@ -342,8 +342,8 @@ } e8; struct { - // Block E9 - uint16 blockid; // Should be 0xE9 + /* Block E9 */ + uint16 blockid; /* Should be 0xE9 */ uint8 unk[40]; char ppp_passwd[20]; uint16 crc; @@ -356,12 +356,12 @@ isp_settings_t * isp = (isp_settings_t *)buffer; int found = 0; - // Clean out the output config buffer. + /* Clean out the output config buffer. */ memset(out, 0, sizeof(flashrom_ispcfg_t)); - // Get the E0 config block + /* Get the E0 config block */ if (flashrom_get_block(FLASHROM_PT_BLOCK_1, FLASHROM_B1_IP_SETTINGS, buffer) >= 0) { - // Fill in values from it + /* Fill in values from it */ out->method = isp->e0.method; memcpy(out->ip, isp->e0.ip, 4); memcpy(out->nm, isp->e0.nm, 4); @@ -375,45 +375,45 @@ found++; } - // Get the email config block + /* Get the email config block */ if (flashrom_get_block(FLASHROM_PT_BLOCK_1, FLASHROM_B1_EMAIL, buffer) >= 0) { - // Fill in the values from it + /* Fill in the values from it */ memcpy(out->email, isp->e2.email, 48); out->email_valid = 1; found++; } - // Get the smtp config block + /* Get the smtp config block */ if (flashrom_get_block(FLASHROM_PT_BLOCK_1, FLASHROM_B1_SMTP, buffer) >= 0) { - // Fill in the values from it + /* Fill in the values from it */ memcpy(out->smtp, isp->e4.smtp, 28); out->smtp_valid = 1; found++; } - // Get the pop3 config block + /* Get the pop3 config block */ if (flashrom_get_block(FLASHROM_PT_BLOCK_1, FLASHROM_B1_POP3, buffer) >= 0) { - // Fill in the values from it + /* Fill in the values from it */ memcpy(out->pop3, isp->e5.pop3, 24); out->pop3_valid = 1; found++; } - // Get the pop3 login config block + /* Get the pop3 login config block */ if (flashrom_get_block(FLASHROM_PT_BLOCK_1, FLASHROM_B1_POP3LOGIN, buffer) >= 0) { - // Fill in the values from it + /* Fill in the values from it */ memcpy(out->pop3_login, isp->e6.pop3_login, 20); out->pop3_login_valid = 1; found++; } - // Get the pop3 passwd config block + /* Get the pop3 passwd config block */ if (flashrom_get_block(FLASHROM_PT_BLOCK_1, FLASHROM_B1_POP3PASSWD, buffer) >= 0) { - // Fill in the values from it + /* Fill in the values from it */ memcpy(out->pop3_passwd, isp->e7.pop3_passwd, 32); memcpy(out->proxy_host, isp->e7.proxy_host, 16); @@ -421,9 +421,9 @@ found++; } - // Get the PPP login config block + /* Get the PPP login config block */ if (flashrom_get_block(FLASHROM_PT_BLOCK_1, FLASHROM_B1_PPPLOGIN, buffer) >= 0) { - // Fill in the values from it + /* Fill in the values from it */ out->proxy_port = isp->e8.proxy_port; memcpy(out->ppp_login, isp->e8.ppp_login, 8); @@ -431,9 +431,9 @@ found++; } - // Get the PPP passwd config block + /* Get the PPP passwd config block */ if (flashrom_get_block(FLASHROM_PT_BLOCK_1, FLASHROM_B1_PPPPASSWD, buffer) >= 0) { - // Fill in the values from it + /* Fill in the values from it */ memcpy(out->ppp_passwd, isp->e9.ppp_passwd, 20); out->ppp_passwd_valid = 1; Modified: kos/kernel/arch/dreamcast/hardware/scif.c =================================================================== --- kos/kernel/arch/dreamcast/hardware/scif.c 2007-11-24 05:20:47 UTC (rev 550) +++ kos/kernel/arch/dreamcast/hardware/scif.c 2007-12-12 01:12:25 UTC (rev 551) @@ -42,7 +42,7 @@ static int serial_baud = DEFAULT_SERIAL_BAUD, serial_fifo = DEFAULT_SERIAL_FIFO; -// This will get set to zero if we fail to send. +/* This will get set to zero if we fail to send. */ static int serial_enabled = 1; /* Set serial parameters; this is not platform independent like I want @@ -52,7 +52,7 @@ serial_fifo = fifo; } -// Receive ring buffer +/* Receive ring buffer */ #define BUFSIZE 1024 static uint8 recvbuf[BUFSIZE]; static int rb_head = 0, rb_tail = 0, rb_cnt = 0; @@ -67,11 +67,11 @@ rb_head = (rb_head + 1) % BUFSIZE; rb_cnt++; - // If we're within 32 bytes of being out of space, pause for - // the moment. + /* If we're within 32 bytes of being out of space, pause for + the moment. */ if (!rb_paused && (BUFSIZE - rb_cnt) < 32) { rb_paused = 1; - SCSPTR2 = 0x20; // Set CTS=0 + SCSPTR2 = 0x20; /* Set CTS=0 */ } } @@ -81,7 +81,7 @@ rb_tail = (rb_tail + 1) % BUFSIZE; rb_cnt--; - // If we're paused and clear again, re-enabled receiving. + /* If we're paused and clear again, re-enabled receiving. */ if (rb_paused && (BUFSIZE - rb_cnt) >= 64) { rb_paused = 0; SCSPTR2 = 0x00; @@ -104,14 +104,14 @@ out if possible. If our internal ring buffer comes close to overflowing, the best we can do is twiddle RTS/CTS for a while. */ static void scif_err_irq(irq_t src, irq_context_t * cxt) { - // Clear status bits + /* Clear status bits */ SCSCR2 &= ~0x08; SCSCR2 |= 0x08; printf("scif_err_irq called\n"); - // Did we get an error condition? - if (SCFSR2 & 0x9c) { // Check ER, BRK, FER, PER + /* Did we get an error condition? */ + if (SCFSR2 & 0x9c) { /* Check ER, BRK, FER, PER */ printf("SCFSR2 status was %04x\n", SCFSR2); /* Try to clear it */ SCFCR2 = 0x06; @@ -128,29 +128,26 @@ } static void scif_data_irq(irq_t src, irq_context_t * cxt) { - // Clear status bits + /* Clear status bits */ SCSCR2 &= ~0x40; SCSCR2 |= 0x40; - //printf("scif_data_irq called\n"); - - // Check for received data available. + /* Check for received data available. */ if (SCFSR2 & 3) { while (SCFDR2 & 0x1f) { int c = SCFRDR2; - //printf("received char '%d'\n", c); rb_push_char(c); } SCFSR2 &= ~3; } } -// Are we using IRQs? +/* Are we using IRQs? */ static int scif_irq_usage = 0; int scif_set_irq_usage(int on) { scif_irq_usage = on; - // Clear out the buffer in any case + /* Clear out the buffer in any case */ rb_reset(); if (scif_irq_usage) { @@ -176,26 +173,26 @@ return 0; } -// We are always detected, though we might end up realizing there's no -// cable connected later... +/* We are always detected, though we might end up realizing there's no + cable connected later... */ int scif_detected() { return 1; } -// We use this for the dbgio interface because we always init SCIF. +/* We use this for the dbgio interface because we always init SCIF. */ int scif_init_fake() { return 0; } /* Initialize the SCIF port; baud_rate must be at least 9600 and no more than 57600. 115200 does NOT work for most PCs. */ -// recv trigger to 1 byte +/* recv trigger to 1 byte */ int scif_init() { int i; /* int fifo = 1; */ - // If dcload-serial is active, then do nothing here, or we'll - // screw that up. + /* If dcload-serial is active, then do nothing here, or we'll + screw that up. */ if (dcload_type == DCLOAD_TYPE_SER) return 0; @@ -209,7 +206,7 @@ SCSMR2 = 0; /* If baudrate unset, set baudrate, N = P0/(32*B)-1 */ - // B = P0/32*(N+1) + /* B = P0/32*(N+1) */ if (SCBRR2 == 0xff) SCBRR2 = (50000000 / (32 * serial_baud)) - 1; @@ -252,7 +249,7 @@ } if (scif_irq_usage) { - // Do we have anything ready? + /* Do we have anything ready? */ if (rb_space_used() <= 0) { errno = EAGAIN; return -1; @@ -266,10 +263,10 @@ return -1; } - // Get the input char + /* Get the input char */ c = SCFRDR2; - // Ack + /* Ack */ SCFSR2 &= ~0x92; return c; @@ -366,7 +363,7 @@ return i; } -// Tie all of that together into a dbgio package. +/* Tie all of that together into a dbgio package. */ dbgio_handler_t dbgio_scif = { "scif", scif_detected, Modified: kos/kernel/arch/dreamcast/hardware/video.c =================================================================== --- kos/kernel/arch/dreamcast/hardware/video.c 2007-11-24 05:20:47 UTC (rev 550) +++ kos/kernel/arch/dreamcast/hardware/video.c 2007-12-12 01:12:25 UTC (rev 551) @@ -11,20 +11,20 @@ #include <string.h> #include <stdio.h> -//----------------------------------------------------------------------------- +/*-----------------------------------------------------------------------------*/ CVSID("$Id: video.c,v 1.11.2.2 2003/08/02 01:52:31 bardtx Exp $"); -//----------------------------------------------------------------------------- +/*-----------------------------------------------------------------------------*/ -//----------------------------------------------------------------------------- -// This table is indexed w/ DM_* +/*-----------------------------------------------------------------------------*/ + /* This table is indexed w/ DM_* */ vid_mode_t vid_builtin[DM_MODE_COUNT] = { - // NULL mode.. - // DM_INVALID = 0 + /* NULL mode.. */ + /* DM_INVALID = 0 */ { 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, { 0, 0, 0, 0 } }, - // 320x240 VGA 60Hz - // DM_320x240_VGA + /* 320x240 VGA 60Hz */ + /* DM_320x240_VGA */ { DM_320x240, 320, 240, @@ -40,8 +40,8 @@ { 0, 0, 0, 0 } }, - // 320x240 NTSC 60Hz - // DM_320x240_NTSC + /* 320x240 NTSC 60Hz */ + /* DM_320x240_NTSC */ { DM_320x240, 320, 240, @@ -57,8 +57,8 @@ { 0, 0, 0, 0 } }, - // 640x480 VGA 60Hz - // DM_640x480_VGA + /* 640x480 VGA 60Hz */ + /* DM_640x480_VGA */ { DM_640x480, 640, 480, @@ -74,8 +74,8 @@ { 0, 0, 0, 0 } }, - // 640x480 NTSC 60Hz IL - // DM_640x480_NTSC_IL + /* 640x480 NTSC 60Hz IL */ + /* DM_640x480_NTSC_IL */ { DM_640x480, 640, 480, @@ -91,13 +91,13 @@ { 0, 0, 0, 0 } }, - // 800x608 NTSC 60Hz (VGA) [BROKEN!] - // DM_800x608_VGA + /* 800x608 NTSC 60Hz (VGA) [BROKEN!] */ + /* DM_800x608_VGA */ { DM_800x608, 320, 240, VID_INTERLACE, - 1/*CT_ANY*/, // This will block the mode from being set. + 1/*CT_ANY*/, /* This will block the mode from being set. */ 0, 262, 857, 164, 24, @@ -108,8 +108,8 @@ { 0, 0, 0, 0 } }, - // 640x480 PAL 50Hz IL - // DM_640x480_PAL_IL + /* 640x480 PAL 50Hz IL */ + /* DM_640x480_PAL_IL */ { DM_640x480, 640, 480, @@ -125,8 +125,8 @@ { 0, 0, 0, 0 } }, - // 256x256 PAL 50Hz IL (seems to output the same w/o VID_PAL, ie. in NTSC IL mode) - // DM_256x256_PAL_IL + /* 256x256 PAL 50Hz IL (seems to output the same w/o VID_PAL, ie. in NTSC IL mode) */ + /* DM_256x256_PAL_IL */ { DM_256x256, 256, 256, @@ -142,8 +142,8 @@ { 0, 0, 0, 0 } }, - // 768x480 NTSC 60Hz IL (thanks DCGrendel) - // DM_768x480_NTSC_IL + /* 768x480 NTSC 60Hz IL (thanks DCGrendel) */ + /* DM_768x480_NTSC_IL */ { DM_768x480, 768, 480, @@ -159,8 +159,8 @@ { 0, 0, 0, 0 } }, - // 768x576 PAL 50Hz IL (DCG) - // DM_768x576_PAL_IL + /* 768x576 PAL 50Hz IL (DCG) */ + /* DM_768x576_PAL_IL */ { DM_768x576, 768, 576, @@ -176,8 +176,8 @@ { 0, 0, 0, 0 } }, - // 768x480 PAL 50Hz IL - // DM_768x480_PAL_IL + /* 768x480 PAL 50Hz IL */ + /* DM_768x480_PAL_IL */ { DM_768x480, 768, 480, @@ -193,8 +193,8 @@ { 0, 0, 0, 0 } }, - // 320x240 PAL 50Hz (thanks Marco Martins aka Mekanaizer) - // DM_320x240_PAL + /* 320x240 PAL 50Hz (thanks Marco Martins aka Mekanaizer) */ + /* DM_320x240_PAL */ { DM_320x240, 320, 240, @@ -210,21 +210,21 @@ { 0, 0, 0, 0 } }, - // END - // DM_SENTINEL + /* END */ + /* DM_SENTINEL */ { 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, { 0, 0, 0, 0 } } - // DM_MODE_COUNT + /* DM_MODE_COUNT */ }; -//----------------------------------------------------------------------------- +/*-----------------------------------------------------------------------------*/ volatile uint32 *regs = (uint32*)0xA05F8000; vid_mode_t currmode = { 0 }; vid_mode_t *vid_mode = 0; uint16 *vram_s; uint32 *vram_l; -//----------------------------------------------------------------------------- +/*-----------------------------------------------------------------------------*/ /* Checks the attached cable type (to the A/V port). Returns one of the following: 0 == VGA @@ -242,34 +242,34 @@ *porta = (*porta & 0xfff0ffff) | 0x000a0000; - // Read port8 and port9 + /* Read port8 and port9 */ return (*((uint16*)(porta + 1)) >> 8) & 3; } -//----------------------------------------------------------------------------- +/*-----------------------------------------------------------------------------*/ void vid_set_mode(int dm, int pm) { vid_mode_t mode; int i, ct, found; ct = vid_check_cable(); - // Check to see if we should use a direct mode index, a generic - // mode check, or if it's just invalid. + /* Check to see if we should use a direct mode index, a generic + mode check, or if it's just invalid. */ if (dm > DM_INVALID && dm < DM_SENTINEL) { memcpy(&mode, &vid_builtin[dm], sizeof(vid_mode_t)); } else if (dm >= DM_GENERIC_FIRST && dm <= DM_GENERIC_LAST) { found = 0; for (i=1; i<DM_SENTINEL; i++) { - // Is it the right generic mode? + /* Is it the right generic mode? */ if (vid_builtin[i].generic != dm) continue; - // Do we have the right cable type? + /* Do we have the right cable type? */ if (vid_builtin[i].cable_type != CT_ANY && vid_builtin[i].cable_type != ct) continue; - // Ok, nothing else to check right now -- we've got our mode + /* Ok, nothing else to check right now -- we've got our mode */ memcpy(&mode, &vid_builtin[i], sizeof(vid_mode_t)); found = 1; break; @@ -283,40 +283,40 @@ return; } - // We set this here so actual mode is bit-depth independent.. + /* We set this here so actual mode is bit-depth independent.. */ mode.pm = pm; - // This is also to be generic + /* This is also to be generic */ mode.cable_type = ct; - // This will make a private copy of our "mode" + /* This will make a private copy of our "mode" */ vid_set_mode_ex(&mode); } -//----------------------------------------------------------------------------- +/*-----------------------------------------------------------------------------*/ void vid_set_mode_ex(vid_mode_t *mode) { static uint8 bpp[4] = { 2, 2, 0, 4 }; uint16 ct; uint32 data; - // Verify cable type for video mode. + /* Verify cable type for video mode. */ ct = vid_check_cable(); if (mode->cable_type != CT_ANY) { if (mode->cable_type != ct) { - // Maybe this should have the ability to be forced (thru param) - // so you can set a mode with VGA params with RGB cable type? - //ct=mode->cable_type; + /* Maybe this should have the ability to be forced (thru param) + so you can set a mode with VGA params with RGB cable type? */ + /*ct=mode->cable_type; */ dbglog(DBG_ERROR, "vid_set_mode: Mode not allowed for this cable type (%i!=%i)\n", mode->cable_type, ct); return; } } - // Blank screen and reset display enable (looks nicer) - regs[0x3A] |= 8; // Blank - regs[0x11] &= ~1; // Display disable + /* Blank screen and reset display enable (looks nicer) */ + regs[0x3A] |= 8; /* Blank */ + regs[0x11] &= ~1; /* Display disable */ - // Clear interlace flag if VGA (this maybe should be in here?) + /* Clear interlace flag if VGA (this maybe should be in here?) */ if (ct == CT_VGA) { mode->flags &= ~VID_INTERLACE; if (mode->flags & VID_LINEDOUBLE) @@ -329,7 +329,7 @@ vid_border_color(0, 0, 0); - // Pixelformat + /* Pixelformat */ data = (mode->pm << 2); if (ct == CT_VGA) { data |= 1 << 23; @@ -338,10 +338,10 @@ } regs[0x11] = data; - // Linestride + /* Linestride */ regs[0x13] = (mode->width * bpp[mode->pm]) / 8; - // Display size + /* Display size */ data = ((mode->width * bpp[mode->pm]) / 4) - 1; if (ct == CT_VGA || (!(mode->flags & VID_INTERLACE))) { data |= (1 << 20) | ((mode->height - 1) << 10); @@ -351,14 +351,14 @@ } regs[0x17] = data; - // vblank irq + /* vblank irq */ if(ct == CT_VGA) { regs[0x33] = (mode->scanint1 << 16) | (mode->scanint2 << 1); } else { regs[0x33] = (mode->scanint1 << 16) | mode->scanint2; } - // Interlace stuff + /* Interlace stuff */ data = 0x100; if (mode->flags & VID_INTERLACE) { data |= 0x10; @@ -370,21 +370,21 @@ } regs[0x34] = data; - // Border window + /* Border window */ regs[0x35] = (mode->borderx1 << 16) | mode->borderx2; regs[0x37] = (mode->bordery1 << 16) | mode->bordery2; - // Scanlines and clocks. + /* Scanlines and clocks. */ regs[0x36] = (mode->scanlines << 16) | mode->clocks; - // Horizontal pixel doubling + /* Horizontal pixel doubling */ if (mode->flags & VID_PIXELDOUBLE) { regs[0x3A] |= 0x100; } else { regs[0x3A] &= ~0x100; } - // Bitmap window + /* Bitmap window */ regs[0x3B] = mode->bitmapx; data = mode->bitmapy; if (mode->flags & VID_PAL) { @@ -393,43 +393,43 @@ data = (data << 16) | mode->bitmapy; regs[0x3C] = data; - // Everything is ok + /* Everything is ok */ memcpy(&currmode, mode, sizeof(vid_mode_t)); vid_mode = &currmode; vid_set_start(0); - // Set cable type + /* Set cable type */ if (mode->cable_type & 1) { *((vuint32*)0xa0702c00) |= 0x300; } else { *((vuint32*)0xa0702c00) &= ~0x300; } - // Re-enable the display + /* Re-enable the display */ regs[0x3A] &= ~8; regs[0x11] |= 1; } -//----------------------------------------------------------------------------- +/*-----------------------------------------------------------------------------*/ void vid_set_start(uint32 base) { static uint8 bpp[4] = { 2, 2, 0, 4 }; - // Set vram base of current framebuffer + /* Set vram base of current framebuffer */ base &= 0x007FFFFF; regs[0x14] = base; - // These are nice to have. + /* These are nice to have. */ vram_s = (uint16*)(0xA5000000|base); vram_l = (uint32*)(0xA5000000|base); - // Set odd-field if interlaced. + /* Set odd-field if interlaced. */ if (vid_mode->flags & VID_INTERLACE) { regs[0x15] = base + (currmode.width * bpp[currmode.pm]); } } -//----------------------------------------------------------------------------- +/*-----------------------------------------------------------------------------*/ void vid_flip(int fb) { uint16 oldfb; @@ -448,14 +448,14 @@ vid_set_start(vid_mode->fb_base[vid_mode->fb_curr]); } -//----------------------------------------------------------------------------- +/*-----------------------------------------------------------------------------*/ void vid_border_color(int r, int g, int b) { regs[0x0040/4] = ((r & 0xFF) << 16) | ((g & 0xFF) << 8) | (b & 0xFF); } -//----------------------------------------------------------------------------- +/*-----------------------------------------------------------------------------*/ /* Clears the screen with a given color [This is the old KOS function by Dan.] @@ -484,7 +484,7 @@ } } -//----------------------------------------------------------------------------- +/*-----------------------------------------------------------------------------*/ /* Clears all of video memory as quickly as possible [This is the old KOS function by Dan.] @@ -495,7 +495,7 @@ sq_clr((uint32 *)0xa5000000, 8*1024*1024); } -//----------------------------------------------------------------------------- +/*-----------------------------------------------------------------------------*/ /* Waits for a vertical refresh to start. This is the period between when the scan beam reaches the bottom of the picture, and when it starts again at the top. @@ -512,17 +512,17 @@ ; } -//----------------------------------------------------------------------------- +/*-----------------------------------------------------------------------------*/ void vid_init(int disp_mode, int pixel_mode) { - // Set mode and clear vram + /* Set mode and clear vram */ vid_set_mode(disp_mode, pixel_mode); vid_clear(0, 0, 0); vid_flip(0); } -//----------------------------------------------------------------------------- +/*-----------------------------------------------------------------------------*/ void vid_shutdown() { - // Play nice with loaders, like KOS used to do. + /* Play nice with loaders, like KOS used to do. */ vid_init(DM_640x480, PM_RGB565); } Modified: kos/kernel/arch/dreamcast/include/dc/flashrom.h =================================================================== --- kos/kernel/arch/dreamcast/include/dc/flashrom.h 2007-11-24 05:20:47 UTC (rev 550) +++ kos/kernel/arch/dreamcast/include/dc/flashrom.h 2007-12-12 01:12:25 UTC (rev 551) @@ -28,23 +28,23 @@ /** An enumeration of partitions available in the flashrom. */ -#define FLASHROM_PT_SYSTEM 0 //< Factory settings (read-only, 8K) -#define FLASHROM_PT_RESERVED 1 //< reserved (all 0s, 8K) -#define FLASHROM_PT_BLOCK_1 2 //< Block allocated (16K) -#define FLASHROM_PT_SETTINGS 3 //< Game settings (block allocated, 32K) -#define FLASHROM_PT_BLOCK_2 4 //< Block allocated (64K) +#define FLASHROM_PT_SYSTEM 0 /*< Factory settings (read-only, 8K) */ +#define FLASHROM_PT_RESERVED 1 /*< reserved (all 0s, 8K) */ +#define FLASHROM_PT_BLOCK_1 2 /*< Block allocated (16K) */ +#define FLASHROM_PT_SETTINGS 3 /*< Game settings (block allocated, 32K) */ +#define FLASHROM_PT_BLOCK_2 4 /*< Block allocated (64K) */ /** An enumeration of logical blocks available in the flashrom. */ -#define FLASHROM_B1_SYSCFG 0x05 //< System config (BLOCK_1) -#define FLASHROM_B1_IP_SETTINGS 0xE0 //< IP settings for BBA (BLOCK_1) -#define FLASHROM_B1_EMAIL 0xE2 //< Email address (BLOCK_1) -#define FLASHROM_B1_SMTP 0xE4 //< SMTP server setting (BLOCK_1) -#define FLASHROM_B1_POP3 0xE5 //< POP3 server setting (BLOCK_1) -#define FLASHROM_B1_POP3LOGIN 0xE6 //< POP3 login setting (BLOCK_1) -#define FLASHROM_B1_POP3PASSWD 0xE7 //< POP3 password setting + proxy (BLOCK_1) -#define FLASHROM_B1_PPPLOGIN 0xE8 //< PPP username + proxy (BLOCK_1) -#define FLASHROM_B1_PPPPASSWD 0xE9 //< PPP passwd (BLOCK_1) +#define FLASHROM_B1_SYSCFG 0x05 /*< System config (BLOCK_1) */ +#define FLASHROM_B1_IP_SETTINGS 0xE0 /*< IP settings for BBA (BLOCK_1) */ +#define FLASHROM_B1_EMAIL 0xE2 /*< Email address (BLOCK_1) */ +#define FLASHROM_B1_SMTP 0xE4 /*< SMTP server setting (BLOCK_1) */ +#define FLASHROM_B1_POP3 0xE5 /*< POP3 server setting (BLOCK_1) */ +#define FLASHROM_B1_POP3LOGIN 0xE6 /*< POP3 login setting (BLOCK_1) */ +#define FLASHROM_B1_POP3PASSWD 0xE7 /*< POP3 password setting + proxy (BLOCK_1) */ +#define FLASHROM_B1_PPPLOGIN 0xE8 /*< PPP username + proxy (BLOCK_1) */ +#define FLASHROM_B1_PPPPASSWD 0xE9 /*< PPP passwd (BLOCK_1) */ /** Implements the FLASHROM_INFO syscall; given a partition ID, @@ -101,9 +101,9 @@ This struct will be filled by calling the flashrom_get_syscfg call below. */ typedef struct flashrom_syscfg { - int language; //< Language setting (see defines above) - int audio; //< 0 == mono, 1 == stereo - int autostart; //< 0 == off, 1 == on + int language; /*< Language setting (see defines above) */ + int audio; /*< 0 == mono, 1 == stereo */ + int autostart; /*< 0 == off, 1 == on */ } flashrom_syscfg_t; /** @@ -136,37 +136,37 @@ This struct will be filled by calling flashrom_get_isp_settings below. Thanks to Sam Steele for this info. */ typedef struct flashrom_ispcfg { - int ip_valid; //< >0 if the IP settings are valid - int method; //< DHCP, Static, dialup(?), PPPoE - uint8 ip[4]; //< Host IP address - uint8 nm[4]; //< Netmask - uint8 bc[4]; //< Broadcast address - uint8 gw[4]; //< Gateway address - uint8 dns[2][4]; //< DNS servers (2) - char hostname[24]; //< DHCP/Host name + int ip_valid; /*< >0 if the IP settings are valid */ + int method; /*< DHCP, Static, dialup(?), PPPoE */ + uint8 ip[4]; /*< Host IP address */ + uint8 nm[4]; /*< Netmask */ + uint8 bc[4]; /*< Broadcast address */ + uint8 gw[4]; /*< Gateway address */ + uint8 dns[2][4]; /*< DNS servers (2) */ + char hostname[24]; /*< DHCP/Host name */ - int email_valid; //< >0 if the email setting is valid - char email[48]; //< Email address + int email_valid; /*< >0 if the email setting is valid */ + char email[48]; /*< Email address */ - int smtp_valid; //< >0 if the smtp setting is valid - char smtp[28]; //< SMTP server + int smtp_valid; /*< >0 if the smtp setting is valid */ + char smtp[28]; /*< SMTP server */ - int pop3_valid; //< >0 if the pop3 setting is valid - char pop3[24]; //< POP3 server + int pop3_valid; /*< >0 if the pop3 setting is valid */ + char pop3[24]; /*< POP3 server */ - int pop3_login_valid; //< >0 if the login setting is valid - char pop3_login[20]; //< POP3 login + int pop3_login_valid; /*< >0 if the login setting is valid */ + char pop3_login[20]; /*< POP3 login */ - int pop3_passwd_valid; //< >0 if the passwd/proxy setting is valid - char pop3_passwd[32]; //< POP3 passwd - char proxy_host[16]; //< Proxy server hostname + int pop3_passwd_valid; /*< >0 if the passwd/proxy setting is valid */ + char pop3_passwd[32]; /*< POP3 passwd */ + char proxy_host[16]; /*< Proxy server hostname */ - int ppp_login_valid; //< >0 if the PPP login/proxy setting is valid - int proxy_port; //< Proxy server port - char ppp_login[8]; //< PPP login + int ppp_login_valid; /*< >0 if the PPP login/proxy setting is valid */ + int proxy_port; /*< Proxy server port */ + char ppp_login[8]; /*< PPP login */ - int ppp_passwd_valid; //< >0 if the PPP passwd setting is valid - char ppp_passwd[20]; //< PPP password + int ppp_passwd_valid; /*< >0 if the PPP passwd setting is valid */ + char ppp_passwd[20]; /*< PPP password */ } flashrom_ispcfg_t; /** Modified: kos/kernel/arch/dreamcast/include/dc/fmath.h =================================================================== --- kos/kernel/arch/dreamcast/include/dc/fmath.h 2007-11-24 05:20:47 UTC (rev 550) +++ kos/kernel/arch/dreamcast/include/dc/fmath.h 2007-12-12 01:12:25 UTC (rev 551) @@ -102,7 +102,7 @@ : "=f" (__value) : "f" (__arg) : "fpul", "fr0"); \ __value; }) -// Floating point inner product (dot product) +/* Floating point inner product (dot product) */ #define __fipr(x, y, z, w, a, b, c, d) ({ \ register float __x __asm__("fr0") = (x); \ register float __y __asm__("fr1") = (y); \ @@ -120,7 +120,7 @@ ); \ __w; }) -// Floating point inner product w/self (square of vector magnitude) +/* Floating point inner product w/self (square of vector magnitude) */ #define __fipr_magnitude_sqr(x, y, z, w) ({ \ register float __x __asm__("fr4") = (x); \ register float __y __asm__("fr5") = (y); \ @@ -133,13 +133,13 @@ ); \ __w; }) -// Returns v1 dot v2 (inner product) +/* Returns v1 dot v2 (inner product) */ extern inline float fipr(float x, float y, float z, float w, float a, float b, float c, float d) { return __fipr(x, y, z, w, a, b, c, d); } -// Returns v1 dot v1 (square of magnitude) +/* Returns v1 dot v1 (square of magnitude) */ extern inline float fipr_magnitude_sqr(float x, float y, float z, float w) { return __fipr_magnitude_sqr(x, y, z, w); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |