You can subscribe to this list here.
2003 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(35) |
Dec
(2) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2004 |
Jan
(37) |
Feb
(10) |
Mar
|
Apr
(2) |
May
(17) |
Jun
(1) |
Jul
(14) |
Aug
(14) |
Sep
(4) |
Oct
|
Nov
(14) |
Dec
(4) |
2005 |
Jan
(6) |
Feb
|
Mar
|
Apr
(6) |
May
|
Jun
|
Jul
|
Aug
|
Sep
(1) |
Oct
|
Nov
(92) |
Dec
(12) |
2006 |
Jan
(3) |
Feb
(4) |
Mar
|
Apr
(5) |
May
(3) |
Jun
(15) |
Jul
(3) |
Aug
(1) |
Sep
(29) |
Oct
(1) |
Nov
(6) |
Dec
(5) |
2007 |
Jan
(2) |
Feb
(2) |
Mar
|
Apr
(3) |
May
(14) |
Jun
(2) |
Jul
(16) |
Aug
(73) |
Sep
(12) |
Oct
(9) |
Nov
(27) |
Dec
(3) |
2008 |
Jan
(4) |
Feb
(4) |
Mar
(3) |
Apr
(8) |
May
(23) |
Jun
(4) |
Jul
(1) |
Aug
(3) |
Sep
(7) |
Oct
(5) |
Nov
(1) |
Dec
(1) |
2009 |
Jan
|
Feb
(10) |
Mar
|
Apr
(4) |
May
(4) |
Jun
(10) |
Jul
|
Aug
(1) |
Sep
|
Oct
(7) |
Nov
|
Dec
(1) |
2010 |
Jan
|
Feb
(1) |
Mar
|
Apr
(6) |
May
|
Jun
(3) |
Jul
(11) |
Aug
(1) |
Sep
|
Oct
(15) |
Nov
(1) |
Dec
(5) |
2011 |
Jan
(4) |
Feb
(1) |
Mar
(6) |
Apr
|
May
(22) |
Jun
|
Jul
(8) |
Aug
(2) |
Sep
|
Oct
|
Nov
|
Dec
(2) |
2012 |
Jan
|
Feb
(10) |
Mar
(1) |
Apr
(6) |
May
(27) |
Jun
(48) |
Jul
(30) |
Aug
(4) |
Sep
|
Oct
(3) |
Nov
(1) |
Dec
(11) |
2013 |
Jan
(4) |
Feb
(7) |
Mar
(6) |
Apr
(18) |
May
(28) |
Jun
(20) |
Jul
|
Aug
(4) |
Sep
(1) |
Oct
(1) |
Nov
(2) |
Dec
(7) |
2014 |
Jan
(3) |
Feb
(2) |
Mar
(4) |
Apr
(9) |
May
(11) |
Jun
(10) |
Jul
|
Aug
(18) |
Sep
(12) |
Oct
(17) |
Nov
(10) |
Dec
(16) |
2015 |
Jan
(5) |
Feb
(1) |
Mar
(5) |
Apr
(4) |
May
(28) |
Jun
(2) |
Jul
|
Aug
|
Sep
(6) |
Oct
|
Nov
(2) |
Dec
(1) |
2016 |
Jan
(14) |
Feb
|
Mar
(3) |
Apr
|
May
|
Jun
(3) |
Jul
(4) |
Aug
(4) |
Sep
(1) |
Oct
(1) |
Nov
|
Dec
(1) |
2017 |
Jan
(11) |
Feb
|
Mar
(21) |
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(1) |
2018 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
(2) |
Sep
(4) |
Oct
(4) |
Nov
|
Dec
(1) |
2019 |
Jan
(1) |
Feb
|
Mar
|
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
(13) |
Sep
(4) |
Oct
|
Nov
|
Dec
|
2020 |
Jan
(10) |
Feb
(9) |
Mar
(5) |
Apr
(4) |
May
(3) |
Jun
(18) |
Jul
(4) |
Aug
(2) |
Sep
(20) |
Oct
(2) |
Nov
|
Dec
|
2021 |
Jan
|
Feb
|
Mar
|
Apr
(2) |
May
(1) |
Jun
(2) |
Jul
(1) |
Aug
(2) |
Sep
|
Oct
|
Nov
|
Dec
(2) |
2022 |
Jan
(1) |
Feb
(2) |
Mar
(2) |
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
(5) |
Sep
|
Oct
(1) |
Nov
|
Dec
(1) |
2023 |
Jan
(10) |
Feb
(7) |
Mar
(29) |
Apr
(31) |
May
(29) |
Jun
(34) |
Jul
(3) |
Aug
(24) |
Sep
(22) |
Oct
(10) |
Nov
(38) |
Dec
(27) |
2024 |
Jan
(15) |
Feb
(8) |
Mar
(4) |
Apr
(20) |
May
(33) |
Jun
(18) |
Jul
(15) |
Aug
(23) |
Sep
(26) |
Oct
(32) |
Nov
(6) |
Dec
(4) |
2025 |
Jan
(7) |
Feb
(1) |
Mar
(1) |
Apr
(4) |
May
(46) |
Jun
(19) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <at...@us...> - 2008-04-04 21:44:39
|
Revision: 564 http://cadcdev.svn.sourceforge.net/cadcdev/?rev=564&view=rev Author: atani Date: 2008-04-04 14:44:27 -0700 (Fri, 04 Apr 2008) Log Message: ----------- Adding svn:ignore for most generated files Property Changed: ---------------- dcload/dcload-ip/example-src/ dcload/dcload-ip/host-src/tool/ dcload/dcload-ip/target-src/1st_read/ dcload/dcload-ip/target-src/dcload/ dcload/dcload-serial/example-src/ dcload/dcload-serial/host-src/misc/ dcload/dcload-serial/host-src/tool/ dcload/dcload-serial/target-src/1st_read/ dcload/dcload-serial/target-src/dcload/ kos/ kos/addons/lib/dreamcast/ kos/doc/manual/ kos/examples/dreamcast/2ndmix/ kos/kernel/arch/dreamcast/kernel/ kos/kernel/arch/dreamcast/sound/arm/ kos/kernel/exports/ kos/kernel/stubs/ kos/lib/dreamcast/ kos/utils/dc-chain/ kos/utils/gba-crcfix/ kos/utils/genromfs/ kos/utils/vqenc/ kos/utils/wav2adpcm/ kos-ports/libmp3/xingmp3/ kos-ports/liboggvorbis/liboggvorbis/libogg/build/ kos-ports/liboggvorbis/liboggvorbis/libogg/src/ kos-ports/liboggvorbis/liboggvorbis/libvorbis/build/ kos-ports/liboggvorbis/liboggvorbis/libvorbis/lib/ kos-ports/liboggvorbis/liboggvorbisplay/lib/ kos-ports/lua/lib/ Property changes on: dcload/dcload-ip/example-src ___________________________________________________________________ Name: svn:ignore + *.bin *.srec Property changes on: dcload/dcload-ip/host-src/tool ___________________________________________________________________ Name: svn:ignore + dc-tool Property changes on: dcload/dcload-ip/target-src/1st_read ___________________________________________________________________ Name: svn:ignore + *.bin *.srec Property changes on: dcload/dcload-ip/target-src/dcload ___________________________________________________________________ Name: svn:ignore + *.bin *.srec Property changes on: dcload/dcload-serial/example-src ___________________________________________________________________ Name: svn:ignore + *.bin *.srec Property changes on: dcload/dcload-serial/host-src/misc ___________________________________________________________________ Name: svn:ignore + lzo Property changes on: dcload/dcload-serial/host-src/tool ___________________________________________________________________ Name: svn:ignore + dc-tool Property changes on: dcload/dcload-serial/target-src/1st_read ___________________________________________________________________ Name: svn:ignore + *.bin *.srec Property changes on: dcload/dcload-serial/target-src/dcload ___________________________________________________________________ Name: svn:ignore + *.bin *.srec *.lzo Property changes on: kos ___________________________________________________________________ Name: svn:ignore + environ.sh Property changes on: kos/addons/lib/dreamcast ___________________________________________________________________ Name: svn:ignore + *.a Property changes on: kos/doc/manual ___________________________________________________________________ Name: svn:ignore + kos_html.zip kos_html kgl_html.zip kgl_html kos.pdf kos.aux kos.log Property changes on: kos/examples/dreamcast/2ndmix ___________________________________________________________________ Name: svn:ignore + romdisk.img Property changes on: kos/kernel/arch/dreamcast/kernel ___________________________________________________________________ Name: svn:ignore + arch_exports.c Property changes on: kos/kernel/arch/dreamcast/sound/arm ___________________________________________________________________ Name: svn:ignore + prog.elf Property changes on: kos/kernel/exports ___________________________________________________________________ Name: svn:ignore + kernel_exports.c Property changes on: kos/kernel/stubs ___________________________________________________________________ Name: svn:ignore + * Property changes on: kos/lib/dreamcast ___________________________________________________________________ Name: svn:ignore + *.a Property changes on: kos/utils/dc-chain ___________________________________________________________________ Name: svn:ignore + logs Property changes on: kos/utils/gba-crcfix ___________________________________________________________________ Name: svn:ignore + gba-crcfix Property changes on: kos/utils/genromfs ___________________________________________________________________ Name: svn:ignore + genromfs Property changes on: kos/utils/vqenc ___________________________________________________________________ Name: svn:ignore + vqenc Property changes on: kos/utils/wav2adpcm ___________________________________________________________________ Name: svn:ignore + wav2adpcm Property changes on: kos-ports/libmp3/xingmp3 ___________________________________________________________________ Name: svn:ignore + *.a Property changes on: kos-ports/liboggvorbis/liboggvorbis/libogg/build ___________________________________________________________________ Name: svn:ignore + * Property changes on: kos-ports/liboggvorbis/liboggvorbis/libogg/src ___________________________________________________________________ Name: svn:ignore + *.o *.a Property changes on: kos-ports/liboggvorbis/liboggvorbis/libvorbis/build ___________________________________________________________________ Name: svn:ignore + * Property changes on: kos-ports/liboggvorbis/liboggvorbis/libvorbis/lib ___________________________________________________________________ Name: svn:ignore + * Property changes on: kos-ports/liboggvorbis/liboggvorbisplay/lib ___________________________________________________________________ Name: svn:ignore + * Property changes on: kos-ports/lua/lib ___________________________________________________________________ Name: svn:ignore + *.a This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ljs...@us...> - 2008-03-21 03:00:46
|
Revision: 563 http://cadcdev.svn.sourceforge.net/cadcdev/?rev=563&view=rev Author: ljsebald Date: 2008-03-20 20:00:39 -0700 (Thu, 20 Mar 2008) Log Message: ----------- A bunch of changes to the UDP code that all amount to just about nothing really gained. Included in this are the following: - Make net_udp_send_raw use the new net_ipv4_send function to more clearly separate the layers of the network stack. - Clean up issues that the UDP code had with odd sized packets and needing to checksum over an extra byte (from when net_ipv4_checksum didn't handle odd-sized messages). - Removed some debug messages that would get spewed to the console needlessly (for things like dropped packets and such). Modified Paths: -------------- kos/kernel/net/net_udp.c Modified: kos/kernel/net/net_udp.c =================================================================== --- kos/kernel/net/net_udp.c 2008-03-21 02:38:35 UTC (rev 562) +++ kos/kernel/net/net_udp.c 2008-03-21 03:00:39 UTC (rev 563) @@ -603,12 +603,17 @@ } int net_udp_input(netif_t *src, ip_hdr_t *ip, const uint8 *data, int size) { - uint8 buf[size + 13]; + uint8 buf[size + 12]; ip_pseudo_hdr_t *ps = (ip_pseudo_hdr_t *)buf; uint16 checksum; struct udp_sock *sock; struct udp_pkt *pkt; + if(size <= sizeof(udp_hdr_t)) { + /* Discard the packet, since it is too short to be of any interest. */ + return -1; + } + ps->src_addr = ip->src; ps->dst_addr = ip->dest; ps->zero = 0; @@ -616,29 +621,18 @@ memcpy(&ps->src_port, data, size); ps->length = htons(size); - /* check this.... */ - if(size & 0x01) { - ps->data[size - sizeof(udp_hdr_t)] = 0; - checksum = ps->checksum; - ps->checksum = 0; - ps->checksum = net_ipv4_checksum(buf, size + 13); - } - else { - checksum = ps->checksum; - ps->checksum = 0; - ps->checksum = net_ipv4_checksum(buf, size + 12); - } + checksum = ps->checksum; + ps->checksum = 0; + ps->checksum = net_ipv4_checksum(buf, size + 12); if(checksum != ps->checksum) { - dbglog(DBG_KDEBUG, "net_udp: discarding UDP packet with invalid " - "checksum\n" - " calculated 0x%04X, sent 0x%04X\n", - ps->checksum, checksum); + /* The checksums don't match, bail out */ return -1; } if(mutex_trylock(udp_mutex)) { - dbglog(DBG_KDEBUG, "net_udp: discarding packet due to locked mutex\n"); + /* Considering this function is usually called in an IRQ, if the + mutex is locked, there isn't much that can be done. */ return -1; } @@ -670,18 +664,16 @@ } } - dbglog(DBG_KDEBUG, "net_udp: Discarding packet for non-opened socket\n"); mutex_unlock(udp_mutex); - return 0; + return -1; } int net_udp_send_raw(netif_t *net, uint32 src_ip, uint16 src_port, uint32 dst_ip, uint16 dst_port, const uint8 *data, int size) { - uint8 buf[size + 13 + sizeof(udp_hdr_t)]; + uint8 buf[size + 12 + sizeof(udp_hdr_t)]; ip_pseudo_hdr_t *ps = (ip_pseudo_hdr_t *) buf; - ip_hdr_t ip; if(net == NULL && net_default_dev == NULL) { errno = ENETDOWN; @@ -700,7 +692,6 @@ ps->src_addr = src_ip; } - buf[size + 12 + sizeof(udp_hdr_t)] = 0; memcpy(ps->data, data, size); size += sizeof(udp_hdr_t); @@ -712,34 +703,12 @@ ps->dst_port = dst_port; ps->hdrlength = ps->length; ps->checksum = 0; + ps->checksum = net_ipv4_checksum(buf, size + 12); - /* Compute the UDP checksum */ - if(size & 0x01) { - ps->checksum = net_ipv4_checksum(buf, size + 13); - } - else { - ps->checksum = net_ipv4_checksum(buf, size + 12); - } - - /* Fill in the IPv4 Header */ - ip.version_ihl = 0x45; - ip.tos = 0; - ip.length = htons(size + 20); - ip.packet_id = 0; - ip.flags_frag_offs = htons(0x4000); - ip.ttl = 64; - ip.protocol = 17; - ip.checksum = 0; - ip.src = ps->src_addr; - ip.dest = ps->dst_addr; - - /* Compute the IPv4 checksum */ - ip.checksum = net_ipv4_checksum((uint8 *) &ip, sizeof(ip_hdr_t)); - - /* send it away.... */ - if(net_ipv4_send_packet(net, &ip, buf + 12, size)) { - /* If net_ipv4_send_packet() returns anything but 0, its an error, - errno should be set already from it. */ + /* Pass everything off to the network layer to do the rest. */ + if(net_ipv4_send(net, buf + 12, size, 0, 64, IPPROTO_UDP, ps->src_addr, + ps->dst_addr)) { + /* If the packet send fails, errno will be set already. */ return -1; } else { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ljs...@us...> - 2008-03-21 02:38:37
|
Revision: 562 http://cadcdev.svn.sourceforge.net/cadcdev/?rev=562&view=rev Author: ljsebald Date: 2008-03-20 19:38:35 -0700 (Thu, 20 Mar 2008) Log Message: ----------- A little bit of reformatting, as well as a new function in net_ipv4.c Modified Paths: -------------- kos/kernel/net/net_ipv4.c kos/kernel/net/net_ipv4.h Modified: kos/kernel/net/net_ipv4.c =================================================================== --- kos/kernel/net/net_ipv4.c 2008-03-10 02:12:30 UTC (rev 561) +++ kos/kernel/net/net_ipv4.c 2008-03-21 02:38:35 UTC (rev 562) @@ -2,7 +2,7 @@ kernel/net/net_ipv4.c - Copyright (C) 2005, 2006, 2007 Lawrence Sebald + Copyright (C) 2005, 2006, 2007, 2008 Lawrence Sebald Portions adapted from KOS' old net_icmp.c file: Copyright (c) 2002 Dan Potter @@ -20,8 +20,8 @@ /* Perform an IP-style checksum on a block of data */ uint16 net_ipv4_checksum(const uint8 *data, int bytes) { - uint32 sum = 0; - int i; + uint32 sum = 0; + int i; /* Make sure we don't do any unaligned memory accesses */ if(((uint32)data) & 0x01) { @@ -57,138 +57,161 @@ } } - return sum ^ 0xFFFF; + return sum ^ 0xFFFF; } /* Determine if a given IP is in the current network */ static int is_in_network(const uint8 src[4], const uint8 dest[4], const uint8 netmask[4]) { - int i; + int i; - for(i = 0; i < 4; i++) { - if((dest[i] & netmask[i]) != (src[i] & netmask[i])) - return 0; - } + for(i = 0; i < 4; i++) { + if((dest[i] & netmask[i]) != (src[i] & netmask[i])) + return 0; + } - return 1; + return 1; } /* Send a packet on the specified network adaptor */ int net_ipv4_send_packet(netif_t *net, ip_hdr_t *hdr, const uint8 *data, int size) { - uint8 dest_ip[4]; - uint8 dest_mac[6]; - uint8 pkt[size + sizeof(ip_hdr_t) + sizeof(eth_hdr_t)]; - eth_hdr_t *ehdr; + uint8 dest_ip[4]; + uint8 dest_mac[6]; + uint8 pkt[size + sizeof(ip_hdr_t) + sizeof(eth_hdr_t)]; + eth_hdr_t *ehdr; - if(net == NULL) { - net = net_default_dev; - } + if(net == NULL) { + net = net_default_dev; + } - net_ipv4_parse_address(ntohl(hdr->dest), dest_ip); + net_ipv4_parse_address(ntohl(hdr->dest), dest_ip); - /* Is this the loopback address (127.0.0.1)? */ - if(ntohl(hdr->dest) == 0x7F000001) { - /* Fill in the ethernet header */ - ehdr = (eth_hdr_t *)pkt; - memset(ehdr->dest, 0, 6); - memset(ehdr->src, 0, 6); + /* Is this the loopback address (127.0.0.1)? */ + if(ntohl(hdr->dest) == 0x7F000001) { + /* Fill in the ethernet header */ + ehdr = (eth_hdr_t *)pkt; + memset(ehdr->dest, 0, 6); + memset(ehdr->src, 0, 6); - ehdr->dest[0] = 0xCF; - ehdr->src[0] = 0xCF; + ehdr->dest[0] = 0xCF; + ehdr->src[0] = 0xCF; - ehdr->type[0] = 0x08; - ehdr->type[1] = 0x00; + ehdr->type[0] = 0x08; + ehdr->type[1] = 0x00; - /* Put the IP header / data into our ethernet packet */ - memcpy(pkt + sizeof(eth_hdr_t), hdr, - 4 * (hdr->version_ihl & 0x0f)); - memcpy(pkt + sizeof(eth_hdr_t) + 4 * (hdr->version_ihl & 0x0f), - data, size); - - /* Send it away */ - net_input(NULL, pkt, sizeof(eth_hdr_t) + sizeof(ip_hdr_t) + - size); + /* Put the IP header / data into our ethernet packet */ + memcpy(pkt + sizeof(eth_hdr_t), hdr, + 4 * (hdr->version_ihl & 0x0f)); + memcpy(pkt + sizeof(eth_hdr_t) + 4 * (hdr->version_ihl & 0x0f), + data, size); + + /* Send it away */ + net_input(NULL, pkt, sizeof(eth_hdr_t) + sizeof(ip_hdr_t) + + size); - return 0; - } - - /* Is it in our network? */ - if(!is_in_network(net->ip_addr, dest_ip, net->netmask)) { - memcpy(dest_ip, net->gateway, 4); - } + return 0; + } + + /* Is it in our network? */ + if(!is_in_network(net->ip_addr, dest_ip, net->netmask)) { + memcpy(dest_ip, net->gateway, 4); + } - /* Get our destination's MAC address */ - if(net_arp_lookup(net, dest_ip, dest_mac) == -1) { - errno = ENETUNREACH; - return -1; - } + /* Get our destination's MAC address */ + if(net_arp_lookup(net, dest_ip, dest_mac) == -1) { + errno = ENETUNREACH; + return -1; + } - /* Fill in the ethernet header */ - ehdr = (eth_hdr_t *)pkt; - memcpy(ehdr->dest, dest_mac, 6); - memcpy(ehdr->src, net->mac_addr, 6); - ehdr->type[0] = 0x08; - ehdr->type[1] = 0x00; + /* Fill in the ethernet header */ + ehdr = (eth_hdr_t *)pkt; + memcpy(ehdr->dest, dest_mac, 6); + memcpy(ehdr->src, net->mac_addr, 6); + ehdr->type[0] = 0x08; + ehdr->type[1] = 0x00; - /* Put the IP header / data into our ethernet packet */ - memcpy(pkt + sizeof(eth_hdr_t), hdr, 4 * (hdr->version_ihl & 0x0f)); - memcpy(pkt + sizeof(eth_hdr_t) + 4 * (hdr->version_ihl & 0x0f), data, - size); + /* Put the IP header / data into our ethernet packet */ + memcpy(pkt + sizeof(eth_hdr_t), hdr, 4 * (hdr->version_ihl & 0x0f)); + memcpy(pkt + sizeof(eth_hdr_t) + 4 * (hdr->version_ihl & 0x0f), data, + size); - /* Send it away */ - net->if_tx(net, pkt, sizeof(ip_hdr_t) + size + sizeof(eth_hdr_t), - NETIF_BLOCK); + /* Send it away */ + net->if_tx(net, pkt, sizeof(ip_hdr_t) + size + sizeof(eth_hdr_t), + NETIF_BLOCK); - return 0; + return 0; } +int net_ipv4_send(netif_t *net, const uint8 *data, int size, int id, int ttl, + int proto, uint32 src, uint32 dst) { + ip_hdr_t hdr; + + /* Fill in the IPv4 Header */ + hdr.version_ihl = 0x45; + hdr.tos = 0; + hdr.length = htons(size + 20); + hdr.packet_id = id; + hdr.flags_frag_offs = htons(0x4000); + hdr.ttl = ttl; + hdr.protocol = proto; + hdr.checksum = 0; + hdr.src = src; + hdr.dest = dst; + + hdr.checksum = net_ipv4_checksum((uint8 *)&hdr, sizeof(ip_hdr_t)); + + return net_ipv4_send_packet(net, &hdr, data, size); +} + int net_ipv4_input(netif_t *src, const uint8 *pkt, int pktsize) { - ip_hdr_t *ip; - int i; - uint8 *data; + ip_hdr_t *ip; + int i; + uint8 *data; + int hdrlen; - /* Get pointers */ - ip = (ip_hdr_t*) pkt; - data = (uint8 *) (pkt + 4 * (ip->version_ihl & 0x0f)); + if(pktsize < sizeof(ip_hdr_t)) + /* This is obviously a bad packet, drop it */ + return -1; - /* Check ip header checksum */ - i = ip->checksum; - ip->checksum = 0; - ip->checksum = net_ipv4_checksum((uint8 *)ip, 4 * - (ip->version_ihl & 0x0f)); + ip = (ip_hdr_t*) pkt; + hdrlen = (ip->version_ihl & 0x0F) << 2; - if(i != ip->checksum) { - dbglog(DBG_KDEBUG, "net_ipv4: Discarding recieved IP packet " - "with invalid checksum\n"); - return 0; - } + if(pktsize < hdrlen) + /* The packet is smaller than the listed header length, bail */ + return -1; - switch(ip->protocol) { - case 1: - net_icmp_input(src, ip, data, ntohs(ip->length) - - (ip->version_ihl & 0x0f) * 4); - break; - case 17: - net_udp_input(src, ip, data, ntohs(ip->length) - - (ip->version_ihl & 0x0f) * 4); - break; - default: - dbglog(DBG_KDEBUG, "net_ipv4: Discarding recieved IP " - "packet with unkown protocol: %d\n", - ip->protocol); - } + data = (uint8 *) (pkt + hdrlen); - return 0; + /* Check ip header checksum */ + i = ip->checksum; + ip->checksum = 0; + ip->checksum = net_ipv4_checksum((uint8 *)ip, hdrlen); + + if(i != ip->checksum) { + /* The checksums don't match, bail */ + return -1; + } + + switch(ip->protocol) { + case IPPROTO_ICMP: + return net_icmp_input(src, ip, data, ntohs(ip->length) - hdrlen); + + case IPPROTO_UDP: + return net_udp_input(src, ip, data, ntohs(ip->length) - hdrlen); + } + + /* There's no handler for this packet type, bail out */ + return -1; } uint32 net_ipv4_address(const uint8 addr[4]) { - return (addr[0] << 24) | (addr[1] << 16) | (addr[2] << 8) | (addr[3]); + return (addr[0] << 24) | (addr[1] << 16) | (addr[2] << 8) | (addr[3]); } void net_ipv4_parse_address(uint32 addr, uint8 out[4]) { - out[0] = (uint8) ((addr >> 24) & 0xFF); - out[1] = (uint8) ((addr >> 16) & 0xFF); - out[2] = (uint8) ((addr >> 8) & 0xFF); - out[3] = (uint8) (addr & 0xFF); + out[0] = (uint8) ((addr >> 24) & 0xFF); + out[1] = (uint8) ((addr >> 16) & 0xFF); + out[2] = (uint8) ((addr >> 8) & 0xFF); + out[3] = (uint8) (addr & 0xFF); } Modified: kos/kernel/net/net_ipv4.h =================================================================== --- kos/kernel/net/net_ipv4.h 2008-03-10 02:12:30 UTC (rev 561) +++ kos/kernel/net/net_ipv4.h 2008-03-21 02:38:35 UTC (rev 562) @@ -1,7 +1,7 @@ /* KallistiOS ##version## kernel/net/net_ipv4.h - Copyright (C) 2005, 2007 Lawrence Sebald + Copyright (C) 2005, 2007, 2008 Lawrence Sebald */ @@ -44,7 +44,10 @@ #undef packed uint16 net_ipv4_checksum(const uint8 *data, int bytes); -int net_ipv4_send_packet(netif_t *net, ip_hdr_t *hdr, const uint8 *data, int size); +int net_ipv4_send_packet(netif_t *net, ip_hdr_t *hdr, const uint8 *data, + int size); +int net_ipv4_send(netif_t *net, const uint8 *data, int size, int id, int ttl, + int proto, uint32 src, uint32 dst); int net_ipv4_input(netif_t *src, const uint8 *pkt, int pktsize); #endif /* __LOCAL_NET_IPV4_H */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ljs...@us...> - 2008-03-10 02:12:36
|
Revision: 561 http://cadcdev.svn.sourceforge.net/cadcdev/?rev=561&view=rev Author: ljsebald Date: 2008-03-09 19:12:30 -0700 (Sun, 09 Mar 2008) Log Message: ----------- Committing patch 1900235 - Newlib patch for dc-chain. Modified Paths: -------------- kos/utils/dc-chain/patches/newlib-1.12.0-kos.diff Modified: kos/utils/dc-chain/patches/newlib-1.12.0-kos.diff =================================================================== --- kos/utils/dc-chain/patches/newlib-1.12.0-kos.diff 2008-02-17 01:40:49 UTC (rev 560) +++ kos/utils/dc-chain/patches/newlib-1.12.0-kos.diff 2008-03-10 02:12:30 UTC (rev 561) @@ -119,7 +119,7 @@ +typedef struct { int a, b, c; } _LOCK_RECURSIVE_T; + +#define __LOCK_INIT(class,lock) class _LOCK_T lock = 0; -+#define __LOCK_INIT_RECURSIVE(class,lock) class _LOCK_T lock = { 0, 0, 0 }; ++#define __LOCK_INIT_RECURSIVE(class,lock) class _LOCK_RECURSIVE_T lock = { 0, 0, 0 }; +#define __lock_init(lock) __newlib_lock_init(&(lock)) +#define __lock_init_recursive(lock) __newlib_lock_init_recursive(&(lock)) +#define __lock_close(lock) __newlib_lock_close(&(lock)) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <c99...@us...> - 2008-02-17 01:40:55
|
Revision: 560 http://cadcdev.svn.sourceforge.net/cadcdev/?rev=560&view=rev Author: c99koder Date: 2008-02-16 17:40:49 -0800 (Sat, 16 Feb 2008) Log Message: ----------- Support for building gdb and insight for dc-chain, patch contributed by Christian Henz Modified Paths: -------------- kos/utils/dc-chain/Makefile Modified: kos/utils/dc-chain/Makefile =================================================================== --- kos/utils/dc-chain/Makefile 2008-02-17 01:23:00 UTC (rev 559) +++ kos/utils/dc-chain/Makefile 2008-02-17 01:40:49 UTC (rev 560) @@ -16,6 +16,8 @@ # build-sh4-gcc: build-sh4-gcc-pass1 build-sh4-newlib build-sh4-gcc-pass2 # build-arm-gcc: build-arm-gcc-pass1 # build-sh4-newlib: build-sh4-newlib-only fixup-sh4-newlib +# gdb +# insight # User configuration sh_target=sh-elf @@ -29,6 +31,8 @@ binutils_ver=2.17 gcc_ver=3.4.6 newlib_ver=1.12.0 +gdb_ver=6.7.1 +insight_ver=6.7.1 thread_model=posix erase=0 verbose=0 @@ -167,6 +171,95 @@ # ---- }}}} + +# GDB building + +gdb-$(gdb_ver).tar.bz2: + @echo "+++ Downloading GDB..." + wget -c ftp://ftp.gnu.org/gnu/gdb/gdb-$(gdb_ver).tar.bz2 + +unpack_gdb: gdb-$(gdb_ver).tar.bz2 unpack_gdb_stamp + +unpack_gdb_stamp: + @echo "+++ Unpacking GDB..." + rm -f $@ + rm -rf gdb-$(gdb_ver) + tar jxf gdb-$(gdb_ver).tar.bz2 + touch $@ + +build_gdb: log = $(logdir)/gdb-$(gdb_ver).log +build_gdb: logdir +build_gdb: unpack_gdb build_gdb_stamp + +build_gdb_stamp: + @echo "+++ Building GDB..." + rm -f $@ + > $(log) + rm -rf build-gdb-$(gdb_ver) + mkdir build-gdb-$(gdb_ver) + cd build-gdb-$(gdb_ver); ../gdb-$(gdb_ver)/configure \ + --prefix=$(sh_prefix) \ + --target=$(sh_target) $(to_log) + make -C build-gdb-$(gdb_ver) $(to_log) + touch $@ + +install_gdb: log = $(logdir)/gdb-$(gdb_ver).log +install_gdb: logdir +install_gdb: build_gdb install_gdb_stamp + +install_gdb_stamp: + @echo "+++ Installing GDB..." + rm -f $@ + make -C build-gdb-$(gdb_ver) install $(to_log) + touch $@ + +gdb: install_gdb + + +# INSIGHT building + +insight-$(insight_ver).tar.bz2: + @echo "+++ Downloading INSIGHT..." + wget -c ftp://sourceware.org/pub/insight/releases/insight-$(insight_ver).tar.bz2 + +unpack_insight: insight-$(insight_ver).tar.bz2 unpack_insight_stamp + +unpack_insight_stamp: + @echo "+++ Unpacking INSIGHT..." + rm -f $@ + rm -rf insight-$(insight_ver) + tar jxf insight-$(insight_ver).tar.bz2 + touch $@ + +build_insight: log = $(logdir)/insight-$(insight_ver).log +build_insight: logdir +build_insight: unpack_insight build_insight_stamp + +build_insight_stamp: + @echo "+++ Building INSIGHT..." + rm -f $@ + > $(log) + rm -rf build-insight-$(insight_ver) + mkdir build-insight-$(insight_ver) + cd build-insight-$(insight_ver); ../insight-$(insight_ver)/configure \ + --prefix=$(sh_prefix) \ + --target=$(sh_target) $(to_log) + make -C build-insight-$(insight_ver) $(to_log) + touch $@ + +install_insight: log = $(logdir)/insight-$(insight_ver).log +install_insight: logdir +install_insight: build_insight install_insight_stamp + +install_insight_stamp: + @echo "+++ Installing INSIGHT..." + rm -f $@ + make -C build-insight-$(insight_ver) install $(to_log) + touch $@ + +insight: install_insight + + # ---- support {{{ clean: @@ -176,6 +269,8 @@ -rm -rf build-gcc-$(arm_target)-$(gcc_ver) -rm -rf build-binutils-$(sh_target)-$(binutils_ver) -rm -rf build-binutils-$(arm_target)-$(binutils_ver) + -rm -rf build-gdb-$(gdb_ver) install_gdb_stamp build_gdb_stamp + -rm -rf build-insight-$(gdb_ver) install_insight_stamp build_insight_stamp logdir: @mkdir -p $(logdir) @@ -208,6 +303,8 @@ .PHONY: $(newlib_patches) $(binutils_patches) $(gcc_patches) $(kos_patches) .PHONY: all build patch build-sh4 build-arm $(build_sh4_targets) $(build_arm_targets) clean .PHONY: build-binutils build-newlib build-gcc-pass1 build-gcc-pass2 fixup-sh4-newlib +.PHONY: gdb install_gdb build_gdb unpack_gdb +.PHONY: insight install_insight build_insight unpack_insight # ---- }}}} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <c99...@us...> - 2008-02-17 01:23:05
|
Revision: 559 http://cadcdev.svn.sourceforge.net/cadcdev/?rev=559&view=rev Author: c99koder Date: 2008-02-16 17:23:00 -0800 (Sat, 16 Feb 2008) Log Message: ----------- This is the patch BERO submitted a few years ago and fixed to work with the current KOS (i.e. irq_enable_exc). It also has OneThirty8's fixes for the timer. Contributed by fackue Modified Paths: -------------- kos-ports/SDL/base/src/audio/dc/SDL_dcaudio.c kos-ports/SDL/base/src/audio/dc/aica.c kos-ports/SDL/base/src/joystick/dc/SDL_sysjoystick.c kos-ports/SDL/base/src/timer/dc/SDL_systimer.c Modified: kos-ports/SDL/base/src/audio/dc/SDL_dcaudio.c =================================================================== --- kos-ports/SDL/base/src/audio/dc/SDL_dcaudio.c 2008-02-17 01:15:24 UTC (rev 558) +++ kos-ports/SDL/base/src/audio/dc/SDL_dcaudio.c 2008-02-17 01:23:00 UTC (rev 559) @@ -42,6 +42,24 @@ #include "aica.h" #include <dc/spu.h> +#define G2_LOCK(OLD) \ + do { \ + if (!irq_inside_int()) \ + OLD = irq_disable(); \ + irq_enable(); \ + /* suspend any G2 DMA here... */ \ + while((*(volatile unsigned int *)0xa05f688c) & 0x20) \ + ; \ + } while(0) + +#define G2_UNLOCK(OLD) \ + do { \ + /* resume any G2 DMA here... */ \ + if (!irq_inside_int()) \ + irq_restore(OLD); \ + } while(0) + + /* Audio driver functions */ static int DCAUD_OpenAudio(_THIS, SDL_AudioSpec *spec); static void DCAUD_WaitAudio(_THIS); @@ -120,7 +138,7 @@ uint32 *right = (uint32*)(rightpos+SPU_RAM_BASE); size = (size+7)/8; while(size--) { - unsigned lval,rval; + unsigned lval,rval,old; lval = *src++; rval = *src++; lval|= (*src++)<<8; @@ -129,9 +147,14 @@ rval|= (*src++)<<16; lval|= (*src++)<<24; rval|= (*src++)<<24; - g2_write_32(*left++,lval); - g2_write_32(*right++,rval); g2_fifo_wait(); + G2_LOCK(old); + *left++=lval; + *right++=rval; + G2_UNLOCK(old); + // g2_write_32(*left++,lval); + // g2_write_32(*right++,rval); + // g2_fifo_wait(); } } @@ -142,14 +165,19 @@ uint32 *right = (uint32*)(rightpos+SPU_RAM_BASE); size = (size+7)/8; while(size--) { - unsigned lval,rval; + unsigned lval,rval,old; lval = *src++; rval = *src++; lval|= (*src++)<<16; rval|= (*src++)<<16; - g2_write_32(*left++,lval); - g2_write_32(*right++,rval); g2_fifo_wait(); + G2_LOCK(old); + *left++=lval; + *right++=rval; + G2_UNLOCK(old); + // g2_write_32(*left++,lval); + // g2_write_32(*right++,rval); + // g2_fifo_wait(); } } Modified: kos-ports/SDL/base/src/audio/dc/aica.c =================================================================== --- kos-ports/SDL/base/src/audio/dc/aica.c 2008-02-17 01:15:24 UTC (rev 558) +++ kos-ports/SDL/base/src/audio/dc/aica.c 2008-02-17 01:23:00 UTC (rev 559) @@ -26,6 +26,7 @@ do { \ if (!irq_inside_int()) \ OLD = irq_disable(); \ + irq_enable(); \ /* suspend any G2 DMA here... */ \ while((*(volatile unsigned int *)0xa05f688c) & 0x20) \ ; \ @@ -43,6 +44,7 @@ int i, j, old; /* Initialize AICA channels */ + g2_fifo_wait(); G2_LOCK(old); SNDREG32(0x2800) = 0x0000; @@ -57,7 +59,6 @@ } SNDREG32(0x2800) = 0x000f; - g2_fifo_wait(); G2_UNLOCK(old); } @@ -164,6 +165,7 @@ asm("nop"); } */ + g2_fifo_wait(); G2_LOCK(old); /* Envelope setup. The first of these is the loop point, e.g., where the sample starts over when it loops. The second @@ -211,7 +213,6 @@ /* Enable playback */ /* CHNREG32(ch, 0) |= 0xc000; */ - g2_fifo_wait(); #if 0 for (i=0xff; i>=vol; i--) { @@ -225,8 +226,8 @@ /* Stop the sound on a given channel */ void aica_stop(int ch) { + g2_fifo_wait(); g2_write_32(CHNREGADDR(ch, 0),(g2_read_32(CHNREGADDR(ch, 0)) & ~0x4000) | 0x8000); - g2_fifo_wait(); } @@ -236,27 +237,28 @@ /* Set channel volume */ void aica_vol(int ch,int vol) { // g2_write_8(CHNREGADDR(ch, 41),AICA_VOL(vol)); + g2_fifo_wait(); g2_write_32(CHNREGADDR(ch, 40),(g2_read_32(CHNREGADDR(ch, 40))&0xffff00ff)|(AICA_VOL(vol)<<8) ); - g2_fifo_wait(); } /* Set channel pan */ void aica_pan(int ch,int pan) { // g2_write_8(CHNREGADDR(ch, 36),AICA_PAN(pan)); + g2_fifo_wait(); g2_write_32(CHNREGADDR(ch, 36),(g2_read_32(CHNREGADDR(ch, 36))&0xffffff00)|(AICA_PAN(pan)) ); - g2_fifo_wait(); } /* Set channel frequency */ void aica_freq(int ch,int freq) { + g2_fifo_wait(); g2_write_32(CHNREGADDR(ch, 24),AICA_FREQ(freq)); - g2_fifo_wait(); } /* Get channel position */ int aica_get_pos(int ch) { #if 1 /* Observe channel ch */ + g2_fifo_wait(); g2_write_32(SNDREGADDR(0x280c),(g2_read_32(SNDREGADDR(0x280c))&0xffff00ff) | (ch<<8)); g2_fifo_wait(); /* Update position counters */ Modified: kos-ports/SDL/base/src/joystick/dc/SDL_sysjoystick.c =================================================================== --- kos-ports/SDL/base/src/joystick/dc/SDL_sysjoystick.c 2008-02-17 01:15:24 UTC (rev 558) +++ kos-ports/SDL/base/src/joystick/dc/SDL_sysjoystick.c 2008-02-17 01:23:00 UTC (rev 559) @@ -124,6 +124,7 @@ void SDL_SYS_JoystickUpdate(SDL_Joystick *joystick) { +/* const int sdl_buttons[] = { CONT_C, CONT_B, @@ -134,6 +135,17 @@ CONT_X, CONT_D }; +*/ +const int sdl_buttons[] = { + CONT_A, + CONT_B, + CONT_X, + CONT_Y, + CONT_START, + CONT_C, + CONT_D, + CONT_Z, +}; uint8 addr; cont_cond_t cond,*prev_cond; @@ -142,7 +154,7 @@ addr = SYS_Joystick_addr[joystick->index]; if (cont_get_cond(addr,&cond)<0) return; - buttons = cond.buttons; + buttons = cond.buttons ^0xffff; prev_buttons = joystick->hwdata->prev_buttons; changed = buttons^prev_buttons; Modified: kos-ports/SDL/base/src/timer/dc/SDL_systimer.c =================================================================== --- kos-ports/SDL/base/src/timer/dc/SDL_systimer.c 2008-02-17 01:15:24 UTC (rev 558) +++ kos-ports/SDL/base/src/timer/dc/SDL_systimer.c 2008-02-17 01:23:00 UTC (rev 559) @@ -47,12 +47,12 @@ void SDL_StartTicks(void) { /* Set first ticks value */ - start = jiffies; + start = timer_ms_gettime64(); } Uint32 SDL_GetTicks(void) { - return((jiffies-start)*1000/HZ); + return(timer_ms_gettime64()-start); } void SDL_Delay(Uint32 ms) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <c99...@us...> - 2008-02-17 01:15:32
|
Revision: 558 http://cadcdev.svn.sourceforge.net/cadcdev/?rev=558&view=rev Author: c99koder Date: 2008-02-16 17:15:24 -0800 (Sat, 16 Feb 2008) Log Message: ----------- dcload-ip Malloc fixes and MinGW32 support There were quite a few cases where dcload-ip didn't have a call to free after a malloc. This patch fixes most (if not all) those errors. It also includes some better error checking. This takes care of all warnings. This also adds MinGW32 support using native WinSocks. This patch has been tested by Cyle Terry and all seems to be working. Modified Paths: -------------- dcload/dcload-ip/Makefile.cfg dcload/dcload-ip/host-src/tool/commands.h dcload/dcload-ip/host-src/tool/dc-io.h dcload/dcload-ip/host-src/tool/dc-tool.c dcload/dcload-ip/host-src/tool/dcload-types.h dcload/dcload-ip/host-src/tool/syscalls.c dcload/dcload-ip/host-src/tool/syscalls.h dcload/dcload-ip/host-src/tool/unlink.c Modified: dcload/dcload-ip/Makefile.cfg =================================================================== --- dcload/dcload-ip/Makefile.cfg 2008-02-14 03:15:15 UTC (rev 557) +++ dcload/dcload-ip/Makefile.cfg 2008-02-17 01:15:24 UTC (rev 558) @@ -8,8 +8,8 @@ # the ones in your system # these must point to your sh-elf bfd, not the system one -BFDLIB = -L/usr/local/dcdev/lib -lbfd -liberty -BFDINCLUDE = /usr/local/dcdev/include +BFDLIB = -L/opt/dc/sh-elf/lib -lbfd -liberty -lintl +BFDINCLUDE = /opt/dc/sh-elf/include # cygwin # these must point to your sh-elf bfd, not the system one @@ -34,8 +34,8 @@ HOSTCFLAGS += $(VERFLAGS) # the ip of your dreamcast - set to 0.0.0.0 if you want to use arp on pc -DREAMCAST_IP = 000.000.000.000 -#DREAMCAST_IP = 192.168.0.4 +#DREAMCAST_IP = 000.000.000.000 +DREAMCAST_IP = 192.168.11.6 #DREAMCAST_IP = 10.0.0.32 # dir to install dc-tool in Modified: dcload/dcload-ip/host-src/tool/commands.h =================================================================== --- dcload/dcload-ip/host-src/tool/commands.h 2008-02-14 03:15:15 UTC (rev 557) +++ dcload/dcload-ip/host-src/tool/commands.h 2008-02-17 01:15:24 UTC (rev 558) @@ -1,13 +1,15 @@ #ifndef __COMMANDS_H__ #define __COMMANDS_H__ -typedef struct { - unsigned char id[4] __attribute__ ((packed)); - unsigned int address __attribute__ ((packed)); - unsigned int size __attribute__ ((packed)); - unsigned char data[1] __attribute__ ((packed)); -} command_t; +struct _command_t { + unsigned char id[4]; + unsigned int address; + unsigned int size; + unsigned char data[1]; +} __attribute__ ((packed)); +typedef struct _command_t command_t; + #define CMD_EXECUTE "EXEC" /* execute */ #define CMD_LOADBIN "LBIN" /* begin receiving binary */ #define CMD_PARTBIN "PBIN" /* part of a binary */ @@ -23,3 +25,4 @@ #define COMMAND_LEN 12 #endif + Modified: dcload/dcload-ip/host-src/tool/dc-io.h =================================================================== --- dcload/dcload-ip/host-src/tool/dc-io.h 2008-02-14 03:15:15 UTC (rev 557) +++ dcload/dcload-ip/host-src/tool/dc-io.h 2008-02-17 01:15:24 UTC (rev 558) @@ -1,11 +1,14 @@ #ifndef __DC_IO_H__ #define __DC_IO_H__ -void recv_data(void *data, unsigned int dcaddr, unsigned int total, unsigned int quiet); -void send_data(unsigned char *addr, unsigned int dcaddr, unsigned int size); +int recv_data(void *data, unsigned int dcaddr, unsigned int total, unsigned int quiet); +int send_data(unsigned char *addr, unsigned int dcaddr, unsigned int size); int recv_response(unsigned char *buffer, int timeout); -void send_command(unsigned char *command, unsigned int addr, unsigned int size, unsigned char *data, unsigned int dsize); +int send_command(char *command, unsigned int addr, unsigned int size, unsigned char *data, unsigned int dsize); + +/* Convinience macro */ +#define send_cmd(v, w, x, y, z) if(send_command(v, w, x, y, z) == -1) return -1 + #endif - Modified: dcload/dcload-ip/host-src/tool/dc-tool.c =================================================================== --- dcload/dcload-ip/host-src/tool/dc-tool.c 2008-02-14 03:15:15 UTC (rev 557) +++ dcload/dcload-ip/host-src/tool/dc-tool.c 2008-02-17 01:15:24 UTC (rev 558) @@ -1,4 +1,4 @@ -/* +/* * dc-tool, a tool for use with the dcload ethernet loader * * Copyright (C) 2001 Andrew Kieschnick <an...@au...> @@ -10,7 +10,7 @@ * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License @@ -27,18 +27,12 @@ #include <string.h> #ifdef _WIN32 #include <windows.h> +#endif #include <sys/time.h> #include <unistd.h> #include <utime.h> -#else -#include <sys/time.h> -#include <unistd.h> -#include <utime.h> -#endif -#ifdef __MINGW32__ -#include <winsock2.h> -#include <ws2tcpip.h> -#else +#ifndef __MINGW32__ +#include <errno.h> #include <arpa/inet.h> #include <sys/socket.h> #include <netinet/in.h> @@ -50,8 +44,11 @@ #include "commands.h" int _nl_msg_cat_cntr; -int gdb_server_socket = -1; +#define DEBUG(x, ...) fprintf(stderr, "DEBUG: "); fprintf(stderr, x, __VA_ARGS__) + +#define CatchError(x) if(x) return -1; + #define VERSION DCLOAD_VERSION #ifndef O_BINARY @@ -66,7 +63,7 @@ /* * Copyright (c) 1987, 1993, 1994 - * The Regents of the University of California. All rights reserved. + * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -78,8 +75,8 @@ * documentation and/or other materials provided with the distribution. * 3. All advertising materials mentioning features or use of this software * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. + * This product includes software developed by the University of + * California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. @@ -87,7 +84,7 @@ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) @@ -99,7 +96,7 @@ #if defined(LIBC_SCCS) && !defined(lint) #if 0 -static char sccsid[] = "@(#)getopt.c 8.3 (Berkeley) 4/27/95"; +static char sccsid[] = "@(#)getopt.c 8.3 (Berkeley) 4/27/95"; #endif static const char rcsid[] = "$FreeBSD$"; #endif /* LIBC_SCCS and not lint */ @@ -114,17 +111,12 @@ #define BADARG (int)':' #define EMSG "" -char *__progname="prboom_server"; +char *__progname="dc-tool"; /* - * getopt -- - * Parse argc/argv argument vector. + * getopt -- Parse argc/argv argument vector. */ -int -getopt(nargc, nargv, ostr) - int nargc; - char * const *nargv; - const char *ostr; +int getopt(int nargc, char * const *nargv, const char *ostr) { extern char *__progname; static char *place = EMSG; /* option letter processing */ @@ -157,7 +149,7 @@ (void)fprintf(stderr, "%s: illegal option -- %c\n", __progname, optopt); return (BADCH); - } + } if (*++oli != ':') { /* don't need argument */ optarg = NULL; if (!*place) @@ -171,7 +163,7 @@ if (*ostr == ':') ret = BADARG; else - ret = BADCH; + ret = BADCH; if (opterr) (void)fprintf(stderr, "%s: option requires an argument -- %c\n", @@ -185,10 +177,33 @@ } return (optopt); /* dump back option letter */ } +#endif + +#ifndef __MINGW32__ +int dcsocket = 0; +int gdb_server_socket = -1; #else -#include <unistd.h> +#define bzero(b,len) (memset((b), '\0', (len)), (void) 0) +SOCKET dcsocket = 0; +SOCKET gdb_server_socket = -1; #endif +void cleanup(char **fnames) +{ + int counter = 0; + + for(; counter < 4; counter++) + if(fnames[counter] != 0) + free(fnames[counter]); + if(dcsocket) +#ifndef __MINGW32__ + close(dcsocket); +#else + closesocket(dcsocket); + WSACleanup(); +#endif +} + extern char *optarg; unsigned int time_in_usec() @@ -200,13 +215,11 @@ return (unsigned int)(thetime.tv_sec * 1000000) + (unsigned int)thetime.tv_usec; } -int dcsocket; - /* 250000 = 0.25 seconds */ #define PACKET_TIMEOUT 250000 /* receive total bytes from dc and store in data */ -void recv_data(void *data, unsigned int dcaddr, unsigned int total, unsigned int quiet) +int recv_data(void *data, unsigned int dcaddr, unsigned int total, unsigned int quiet) { unsigned char buffer[2048]; unsigned char *i; @@ -218,24 +231,31 @@ memset(map, 0, (total+1023)/1024); - if (!quiet) - send_command(CMD_SENDBIN, dcaddr, total, NULL, 0); - else - send_command(CMD_SENDBINQ, dcaddr, total, NULL, 0); - + if (!quiet) { + send_cmd(CMD_SENDBIN, dcaddr, total, NULL, 0); + } + else { + send_cmd(CMD_SENDBINQ, dcaddr, total, NULL, 0); + } + start = time_in_usec(); while (((time_in_usec() - start) < PACKET_TIMEOUT)&&(packets < ((total+1023)/1024 + 1))) { memset(buffer, 0, 2048); - while(((retval = read(dcsocket, buffer, 2048)) == -1)&&((time_in_usec() - start) < PACKET_TIMEOUT)); + + while(((retval = recv(dcsocket, (void *)buffer, 2048, 0)) == -1)&&((time_in_usec() - start) < PACKET_TIMEOUT)); + if (retval > 0) { start = time_in_usec(); if (memcmp(((command_t *)buffer)->id, CMD_DONEBIN, 4)) { if ( ((ntohl(((command_t *)buffer)->address) - dcaddr)/1024) >= ((total + 1024)/1024) ) { - printf("Obviously bad packet, avoiding segfault\n"); fflush(stdout); - } else { + printf("Obviously bad packet, avoiding segfault\n"); + fflush(stdout); + } + else { map[ (ntohl(((command_t *)buffer)->address) - dcaddr)/1024 ] = 1; i = data + (ntohl(((command_t *)buffer)->address) - dcaddr); + memcpy(i, buffer + 12, ntohl(((command_t *)buffer)->size)); } } @@ -245,60 +265,74 @@ for(c = 0; c < (total+1023)/1024; c++) if (!map[c]) { - if ( (total - c*1024) >= 1024) - send_command(CMD_SENDBINQ, dcaddr + c*1024, 1024, NULL, 0); - else - send_command(CMD_SENDBINQ, dcaddr + c*1024, total - c*1024, NULL, 0); + if ( (total - c*1024) >= 1024) { + send_cmd(CMD_SENDBINQ, dcaddr + c*1024, 1024, NULL, 0); + } + else { + send_cmd(CMD_SENDBINQ, dcaddr + c*1024, total - c*1024, NULL, 0); + } + start = time_in_usec(); - while(((retval = read(dcsocket, buffer, 2048)) == -1)&&((time_in_usec() - start) < PACKET_TIMEOUT)); + while(((retval = recv(dcsocket, (void *)buffer, 2048, 0)) == -1)&&((time_in_usec() - start) < PACKET_TIMEOUT)); + if (retval > 0) { start = time_in_usec(); + if (memcmp(((command_t *)buffer)->id, CMD_DONEBIN, 4)) { map[ (ntohl(((command_t *)buffer)->address) - dcaddr)/1024 ] = 1; /* printf("recv_data: got chunk for %p, %d bytes\n", - (void *)ntohl(((command_t *)buffer)->address), ntohl(((command_t *)buffer)->size)); */ + (void *)ntohl(((command_t *)buffer)->address), ntohl(((command_t *)buffer)->size)); */ i = data + (ntohl(((command_t *)buffer)->address) - dcaddr); + memcpy(i, buffer + 12, ntohl(((command_t *)buffer)->size)); } // Get the DONEBIN - while(((retval = read(dcsocket, buffer, 2048)) == -1)&&((time_in_usec() - start) < PACKET_TIMEOUT)); + while(((retval = recv(dcsocket, (void *)buffer, 2048, 0)) == -1)&&((time_in_usec() - start) < PACKET_TIMEOUT)); } // Force us to go back and recheck // XXX This should be improved after recv_data can return errors. c = -1; } + + free(map); + + return 0; } /* send size bytes to dc from addr to dcaddr*/ -void send_data(unsigned char * addr, unsigned int dcaddr, unsigned int size) +int send_data(unsigned char * addr, unsigned int dcaddr, unsigned int size) { - unsigned char buffer[2048]; - unsigned char * i; + unsigned char buffer[2048] = {0}; + unsigned char * i = 0; unsigned int a = dcaddr; - unsigned int start; + unsigned int start = 0; int count = 0; if (!size) - return; + return -1; do - send_command(CMD_LOADBIN, dcaddr, size, NULL, 0); + { + send_cmd(CMD_LOADBIN, dcaddr, size, NULL, 0); + } while(recv_response(buffer, PACKET_TIMEOUT) == -1); while(memcmp(((command_t *)buffer)->id, CMD_LOADBIN, 4)) { printf("send_data: error in response to CMD_LOADBIN, retrying... %c%c%c%c\n",buffer[0],buffer[1],buffer[2],buffer[3]); do - send_command(CMD_LOADBIN, dcaddr, size, NULL, 0); + send_cmd(CMD_LOADBIN, dcaddr, size, NULL, 0); while (recv_response(buffer, PACKET_TIMEOUT) == -1); } for(i = addr; i < addr + size; i += 1024) { - if (((addr + size) - i) >= 1024) - send_command(CMD_PARTBIN, dcaddr, 1024, i, 1024); - else - send_command(CMD_PARTBIN, dcaddr, (addr + size) - i, i, (addr + size) - i); + if ((addr + size - i) >= 1024) { + send_cmd(CMD_PARTBIN, dcaddr, 1024, i, 1024); + } + else { + send_cmd(CMD_PARTBIN, dcaddr, (addr + size) - i, i, (addr + size) - i); + } dcaddr += 1024; /* give the DC a chance to empty its rx fifo @@ -308,8 +342,8 @@ if (count == 15) { start = time_in_usec(); while ((time_in_usec() - start) < PACKET_TIMEOUT/51); - count = 0; - } + count = 0; + } } start = time_in_usec(); @@ -317,31 +351,35 @@ while ((time_in_usec() - start) < PACKET_TIMEOUT/10); do - send_command(CMD_DONEBIN, 0, 0, NULL, 0); + send_cmd(CMD_DONEBIN, 0, 0, NULL, 0); while (recv_response(buffer, PACKET_TIMEOUT) == -1); while(memcmp(((command_t *)buffer)->id, CMD_DONEBIN, 4)) { printf("send_data: error in response to CMD_DONEBIN, retrying...\n"); + do - send_command(CMD_LOADBIN, dcaddr, size, NULL, 0); + send_cmd(CMD_LOADBIN, dcaddr, size, NULL, 0); while (recv_response(buffer, PACKET_TIMEOUT) == -1); } while ( ntohl(((command_t *)buffer)->size) != 0) { -/* printf("%d bytes at 0x%x were missing, resending\n", ntohl(((command_t *)buffer)->size),ntohl(((command_t *)buffer)->address)); */ - send_command(CMD_PARTBIN, ntohl(((command_t *)buffer)->address), ntohl(((command_t *)buffer)->size), addr + (ntohl(((command_t *)buffer)->address) - a), ntohl(((command_t *)buffer)->size)); +/* printf("%d bytes at 0x%x were missing, resending\n", ntohl(((command_t *)buffer)->size),ntohl(((command_t *)buffer)->address)); */ + send_cmd(CMD_PARTBIN, ntohl(((command_t *)buffer)->address), ntohl(((command_t *)buffer)->size), addr + (ntohl(((command_t *)buffer)->address) - a), ntohl(((command_t *)buffer)->size)); do - send_command(CMD_DONEBIN, 0, 0, NULL, 0); + send_cmd(CMD_DONEBIN, 0, 0, NULL, 0); while (recv_response(buffer, PACKET_TIMEOUT) == -1); - + while(memcmp(((command_t *)buffer)->id, CMD_DONEBIN, 4)) { printf("send_data: error in response to CMD_DONEBIN, retrying...\n"); + do - send_command(CMD_LOADBIN, dcaddr, size, NULL, 0); + send_cmd(CMD_LOADBIN, dcaddr, size, NULL, 0); while (recv_response(buffer, PACKET_TIMEOUT) == -1); } } + + return 0; } void usage(void) @@ -362,17 +400,36 @@ printf("-r Reset (only works when dcload is in control)\n"); printf("-g Start a GDB server\n"); printf("-h Usage information (you\'re looking at it)\n\n"); - exit(0); } -int open_socket(unsigned char *hostname) +/* Got to make sure WinSock is initalized */ +#ifdef __MINGW32__ +int start_ws() { + WSADATA wsaData; + int failed = 0; + failed = WSAStartup(MAKEWORD(2,2), &wsaData); + if ( failed != NO_ERROR ) { + perror("WSAStartup"); + return 1; + } + + return 0; +} +#endif + +int open_socket(char *hostname) +{ struct sockaddr_in sin; - struct hostent * host; + struct hostent *host = 0; - dcsocket = socket(AF_INET, SOCK_DGRAM, 0); + dcsocket = socket(AF_INET, SOCK_DGRAM, IPPROTO_IP); +#ifndef __MINGW32__ if (dcsocket < 0) { +#else + if (dcsocket == INVALID_SOCKET) { +#endif perror("socket"); return -1; } @@ -397,10 +454,17 @@ #ifdef __MINGW32__ unsigned long flags = 1; - ioctlsocket(dcsocket, FIONBIO, &flags); + int failed = 0; + failed = ioctlsocket(dcsocket, FIONBIO, &flags); + if ( failed == SOCKET_ERROR ) { + perror("ioctlsocket"); + return -1; + } #else fcntl(dcsocket, F_SETFL, O_NONBLOCK); #endif + + return 0; } int recv_response(unsigned char *buffer, int timeout) @@ -409,15 +473,16 @@ int rv = -1; while( ((time_in_usec() - start) < timeout) && (rv == -1)) - rv = read(dcsocket, buffer, 2048); + rv = recv(dcsocket, (void *)buffer, 2048, 0); return rv; } -void send_command(unsigned char *command, unsigned int addr, unsigned int size, unsigned char *data, unsigned int dsize) +int send_command(char *command, unsigned int addr, unsigned int size, unsigned char *data, unsigned int dsize) { unsigned char c_buff[2048]; unsigned int tmp; + int error = 0; memcpy(c_buff, command, 4); tmp = htonl(addr); @@ -427,26 +492,45 @@ if (data != 0) memcpy(c_buff + 12, data, dsize); - write(dcsocket, c_buff, 12 + dsize); + error = send(dcsocket, (void *)c_buff, 12+dsize, 0); + + if(error == -1) { +#ifndef __MINGW32__ + if(errno == EAGAIN) + return 0; + fprintf(stderr, "error: %s\n", strerror(errno)); +#else + /* WSAEWOULDBLOCK is a non-fatal error, so continue */ + if(WSAGetLastError() == WSAEWOULDBLOCK) + return 0; + + fprintf(stderr, "error: %d\n", WSAGetLastError()); +#endif + + return -1; + } + + return 0; } -unsigned int upload(unsigned char *filename, unsigned int address) +unsigned int upload(char *filename, unsigned int address) { int inputfd; - int size; + int size = 0; + int sectsize; unsigned char *inbuf; struct timeval starttime, endtime; - unsigned char c; double stime, etime; bfd *somebfd; somebfd = bfd_openr(filename, 0); - if (somebfd) { /* try bfd first */ + if (somebfd) { if (bfd_check_format(somebfd, bfd_object)) { + /* try bfd first */ asection *section; - + printf("File format is %s, ", somebfd->xvec->name); address = somebfd->start_address; size = 0; @@ -454,68 +538,69 @@ gettimeofday(&starttime, 0); - for (section = somebfd->sections; section != NULL; section = section->next) + for (section = somebfd->sections; section != NULL; section = section->next) { if ((section->flags & SEC_HAS_CONTENTS) && (section->flags & SEC_LOAD)) { + sectsize = bfd_section_size(somebfd, section); printf("Section %s, ",section->name); - printf("lma 0x%x, ",section->lma); - printf("size %d\n",bfd_section_size(somebfd, section)); - if (bfd_section_size(somebfd, section)) { - size += bfd_section_size(somebfd, section); - inbuf = malloc(bfd_section_size(somebfd, section)); - bfd_get_section_contents(somebfd, section, inbuf, 0, bfd_section_size(somebfd, section)); + printf("lma 0x%x, ", (unsigned int)section->lma); + printf("size %d\n",sectsize); - send_data(inbuf, section->lma, bfd_section_size(somebfd, section)); + if (sectsize) { + size += sectsize; + inbuf = malloc(sectsize); + bfd_get_section_contents(somebfd, section, inbuf, 0, sectsize); + if(send_data(inbuf, section->lma, sectsize) == -1) + return -1; + free(inbuf); } - } + } + } + bfd_close(somebfd); } else { + /* if that fails, send raw bin */ + //! Close the bfd here too? + inputfd = open(filename, O_RDONLY | O_BINARY); -/* if that fails, send raw bin */ - - printf("File format is raw binary, start address is 0x%x\n", address); - inputfd = open(filename, O_RDONLY | O_BINARY); - if (inputfd < 0) { perror(filename); - exit(-1); + return -1; } - + + printf("File format is raw binary, start address is 0x%x\n", address); + size = lseek(inputfd, 0, SEEK_END); lseek(inputfd, 0, SEEK_SET); - + inbuf = malloc(size); - read(inputfd, inbuf, size); - close(inputfd); - + gettimeofday(&starttime, 0); - send_data(inbuf, address, size); - + if(send_data(inbuf, address, size) == -1) + return -1; } + } gettimeofday(&endtime, 0); stime = starttime.tv_sec + starttime.tv_usec / 1000000.0; etime = endtime.tv_sec + endtime.tv_usec / 1000000.0; - printf("transferred at %f bytes / sec\n", (double) size / (etime - stime)); + printf("transferred %d bytes at %f bytes / sec\n", size, (double) size / (etime - stime)); fflush(stdout); - } return address; } -void download(unsigned char *filename, unsigned int address, +int download(char *filename, unsigned int address, unsigned int size, unsigned int quiet) { int outputfd; - unsigned char c; - unsigned int wrkmem = 0x8cff0000; unsigned char *data; struct timeval starttime, endtime; double stime, etime; @@ -524,7 +609,7 @@ if (outputfd < 0) { perror(filename); - exit(-1); + return -1; } data = malloc(size); @@ -542,30 +627,32 @@ printf("transferred at %f bytes / sec\n", (double) size / (etime - stime)); fflush(stdout); - + write(outputfd, data, size); close(outputfd); + free(data); + return 0; } -void execute(unsigned int address, unsigned int console, unsigned int cdfsredir) +int execute(unsigned int address, unsigned int console, unsigned int cdfsredir) { unsigned char buffer[2048]; printf("Sending execute command (0x%x, console=%d, cdfsredir=%d)...",address,console,cdfsredir); do - send_command(CMD_EXECUTE, address, (cdfsredir << 1) | console, NULL, 0); + send_cmd(CMD_EXECUTE, address, (cdfsredir << 1) | console, NULL, 0); while (recv_response(buffer, PACKET_TIMEOUT) == -1); printf("executing\n"); + return 0; } -void do_console(unsigned char *path, unsigned char *isofile) +int do_console(char *path, char *isofile) { - unsigned char command; - int isofd; + int isofd = 0; unsigned char buffer[2048]; if (isofile) { @@ -584,95 +671,123 @@ fflush(stdout); while(recv_response(buffer, PACKET_TIMEOUT) == -1); - + if (!(memcmp(buffer, CMD_EXIT, 4))) - exit(0); + return -1; if (!(memcmp(buffer, CMD_FSTAT, 4))) - dc_fstat(buffer); + CatchError(dc_fstat(buffer)); if (!(memcmp(buffer, CMD_WRITE, 4))) - dc_write(buffer); + CatchError(dc_write(buffer)); if (!(memcmp(buffer, CMD_READ, 4))) - dc_read(buffer); + CatchError(dc_read(buffer)); if (!(memcmp(buffer, CMD_OPEN, 4))) - dc_open(buffer); + CatchError(dc_open(buffer)); if (!(memcmp(buffer, CMD_CLOSE, 4))) - dc_close(buffer); + CatchError(dc_close(buffer)); if (!(memcmp(buffer, CMD_CREAT, 4))) - dc_creat(buffer); + CatchError(dc_creat(buffer)); if (!(memcmp(buffer, CMD_LINK, 4))) - dc_link(buffer); + CatchError(dc_link(buffer)); if (!(memcmp(buffer, CMD_UNLINK, 4))) - dc_unlink(buffer); + CatchError(dc_unlink(buffer)); if (!(memcmp(buffer, CMD_CHDIR, 4))) - dc_chdir(buffer); + CatchError(dc_chdir(buffer)); if (!(memcmp(buffer, CMD_CHMOD, 4))) - dc_chmod(buffer); + CatchError(dc_chmod(buffer)); if (!(memcmp(buffer, CMD_LSEEK, 4))) - dc_lseek(buffer); + CatchError(dc_lseek(buffer)); if (!(memcmp(buffer, CMD_TIME, 4))) - dc_time(buffer); + CatchError(dc_time(buffer)); if (!(memcmp(buffer, CMD_STAT, 4))) - dc_stat(buffer); + CatchError(dc_stat(buffer)); if (!(memcmp(buffer, CMD_UTIME, 4))) - dc_utime(buffer); + CatchError(dc_utime(buffer)); if (!(memcmp(buffer, CMD_BAD, 4))) - printf("command 15 should not happen... (but it did)\n"); + fprintf(stderr, "command 15 should not happen... (but it did)\n"); if (!(memcmp(buffer, CMD_OPENDIR, 4))) - dc_opendir(buffer); + CatchError(dc_opendir(buffer)); if (!(memcmp(buffer, CMD_CLOSEDIR, 4))) - dc_closedir(buffer); + CatchError(dc_closedir(buffer)); if (!(memcmp(buffer, CMD_READDIR, 4))) - dc_readdir(buffer); + CatchError(dc_readdir(buffer)); if (!(memcmp(buffer, CMD_CDFSREAD, 4))) - dc_cdfs_redir_read_sectors(isofd, buffer); + CatchError(dc_cdfs_redir_read_sectors(isofd, buffer)); if (!(memcmp(buffer, CMD_GDBPACKET, 4))) - dc_gdbpacket(buffer); + CatchError(dc_gdbpacket(buffer)); } + + return 0; } int open_gdb_socket(int port) { struct sockaddr_in server_addr; - + server_addr.sin_family = AF_INET; server_addr.sin_port = htons( port ); server_addr.sin_addr.s_addr = htonl( INADDR_LOOPBACK ); - if ( (gdb_server_socket = socket( PF_INET, SOCK_STREAM, IPPROTO_TCP )) < 0 ) { + gdb_server_socket = socket( PF_INET, SOCK_STREAM, IPPROTO_TCP ); +#ifdef __MINGW32__ + if ( gdb_server_socket == INVALID_SOCKET) { +#else + if ( gdb_server_socket < 0 ) { +#endif perror( "error creating gdb server socket" ); return -1; } - if ( bind( gdb_server_socket, (struct sockaddr*)&server_addr, sizeof( server_addr ) ) < 0 ) { + int checkbind = bind( gdb_server_socket, (struct sockaddr*)&server_addr, sizeof( server_addr ) ); +#ifdef __MINGW32__ + if( checkbind == SOCKET_ERROR ) { +#else + if ( checkbind < 0 ) { +#endif perror( "error binding gdb server socket" ); return -1; } - if ( listen( gdb_server_socket, 0 ) < 0 ) { + int checklisten = listen( gdb_server_socket, 0 ); +#ifdef __MINGW32__ + if ( checklisten == SOCKET_ERROR ) { +#else + if ( checklisten < 0 ) { +#endif perror( "error listening to gdb server socket" ); return -1; } + + return 0; } int main(int argc, char *argv[]) { unsigned int address = 0x8c010000; unsigned int size = 0; - unsigned char *filename = 0; - unsigned char *path = 0; unsigned int console = 1; unsigned int quiet = 0; unsigned char command = 0; - char *hostname = DREAMCAST_IP; unsigned int cdfs_redir = 0; - unsigned char *isofile = 0; int someopt; - if (argc < 2) + /* Dynamically allocated, so it should be freed */ + char *filename = 0; + char *isofile = 0; + char *path = 0; + char *hostname = DREAMCAST_IP; + char *cleanlist[4] = { 0, 0, 0, 0 }; + + if (argc < 2) { usage(); + return 0; + } + #ifdef __MINGW32__ - someopt = getopt(argc, argv, "x:u:d:a:s:t:i:npqhrg"); + if(start_ws()) + return -1; + + someopt = getopt(argc, argv, "x:u:d:a:s:t:i:npqhrg"); #else someopt = getopt(argc, argv, "x:u:d:a:s:t:c:i:npqhrg"); #endif @@ -680,40 +795,45 @@ switch (someopt) { case 'x': if (command) { - printf("You can only specify one of -x, -u, -d, and -r\n"); - exit(0); + fprintf(stderr, "You can only specify one of -x, -u, -d, and -r\n"); + goto doclean; } command = 'x'; filename = malloc(strlen(optarg) + 1); + cleanlist[0] = filename; strcpy(filename, optarg); break; case 'u': if (command) { - printf("You can only specify one of -x, -u, -d, and -r\n"); - exit(0); + fprintf(stderr, "You can only specify one of -x, -u, -d, and -r\n"); + goto doclean; } command = 'u'; filename = malloc(strlen(optarg) + 1); + cleanlist[0] = filename; strcpy(filename, optarg); break; case 'd': if (command) { - printf("You can only specify one of -x, -u, -d, and -r\n"); - exit(0); + fprintf(stderr, "You can only specify one of -x, -u, -d, and -r\n"); + goto doclean; } command = 'd'; filename = malloc(strlen(optarg) + 1); + cleanlist[0] = filename; strcpy(filename, optarg); break; #ifndef __MINGW32__ case 'c': path = malloc(strlen(optarg) + 1); + cleanlist[1] = path; strcpy(path, optarg); break; #endif case 'i': cdfs_redir = 1; isofile = malloc(strlen(optarg) + 1); + cleanlist[2] = isofile; strcpy(isofile, optarg); break; case 'a': @@ -724,6 +844,7 @@ break; case 't': hostname = malloc(strlen(optarg) + 1); + cleanlist[3] = hostname; strcpy(hostname, optarg); break; case 'n': @@ -734,11 +855,13 @@ break; case 'h': usage(); + cleanup(cleanlist); + return 0; break; case 'r': if (command) { - printf("You can only specify one of -x, -u, -d, and -r\n"); - exit(0); + fprintf(stderr, "You can only specify one of -x, -u, -d, and -r\n"); + goto doclean; } command = 'r'; break; @@ -747,6 +870,9 @@ open_gdb_socket(2159); break; default: + /* The user obviously mistyped something */ + usage(); + goto doclean; break; } #ifdef __MINGW32__ @@ -756,58 +882,73 @@ #endif } + if (quiet) + printf("Quiet download\n"); + if (cdfs_redir & (!console)) console = 1; - if (console & command=='x') + if (console & (command=='x')) printf("Console enabled\n"); - if (quiet) - printf("Quiet download\n"); - #ifndef __MINGW32__ if (path) printf("Chroot enabled\n"); #endif - if (cdfs_redir & command=='x') + if (cdfs_redir & (command=='x')) printf("Cdfs redirection enabled\n"); if (open_socket(hostname)<0) { - return 1; + fprintf(stderr, "Error opening socket\n"); + goto doclean; } switch (command) { case 'x': printf("Upload <%s>\n", filename); address = upload(filename, address); + + if (address == -1) + goto doclean; + printf("Executing at <0x%x>\n", address); - execute(address, console, cdfs_redir); + if(execute(address, console, cdfs_redir)) + goto doclean; if (console) do_console(path, isofile); break; case 'u': printf("Upload <%s> at <0x%x>\n", filename, address); - upload(filename, address); + if(upload(filename, address)) + goto doclean; break; case 'd': if (!size) { - printf - ("You must specify a size (-s <size>) with download (-d <filename>)\n"); - exit(0); + fprintf(stderr, "You must specify a size (-s <size>) with download (-d <filename>)\n"); + goto doclean; } - printf("Download %d bytes at <0x%x> to <%s>\n", size, address, - filename); - download(filename, address, size, quiet); + printf("Download %d bytes at <0x%x> to <%s>\n", size, address, filename); + if(download(filename, address, size, quiet) == -1) + goto doclean; break; case 'r': printf("Reseting...\n"); - send_command(CMD_REBOOT, 0, 0, NULL, 0); + if(send_command(CMD_REBOOT, 0, 0, NULL, 0) == -1) + goto doclean; break; default: usage(); break; } - exit(0); + + cleanup(cleanlist); + return 0; + +/* Failed (I hate gotos...) */ +doclean: + cleanup(cleanlist); + return -1; } + Modified: dcload/dcload-ip/host-src/tool/dcload-types.h =================================================================== --- dcload/dcload-ip/host-src/tool/dcload-types.h 2008-02-14 03:15:15 UTC (rev 557) +++ dcload/dcload-ip/host-src/tool/dcload-types.h 2008-02-17 01:15:24 UTC (rev 558) @@ -13,7 +13,7 @@ /* dcload stat */ -typedef struct { +typedef struct { unsigned short st_dev; unsigned short st_ino; int st_mode; @@ -35,4 +35,3 @@ #endif - Modified: dcload/dcload-ip/host-src/tool/syscalls.c =================================================================== --- dcload/dcload-ip/host-src/tool/syscalls.c 2008-02-14 03:15:15 UTC (rev 557) +++ dcload/dcload-ip/host-src/tool/syscalls.c 2008-02-17 01:15:24 UTC (rev 558) @@ -1,4 +1,4 @@ -/* +/* * This file is part of the dcload Dreamcast ethernet loader * * Copyright (C) 2001 Andrew Kieschnick <an...@au...> @@ -10,7 +10,7 @@ * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License @@ -26,10 +26,14 @@ #include <stdlib.h> #include <sys/time.h> #include <unistd.h> +#include <time.h> #include <utime.h> #include <dirent.h> +#include <string.h> #ifdef __MINGW32__ #include <windows.h> +#else +#include <netinet/in.h> #endif #include "syscalls.h" #include "dc-io.h" @@ -41,7 +45,7 @@ #endif /* syscalls for dcload-ip - * + * * 1. receive all parameters from dc * 2. get any data from dc using recv_data (dc passes address/size of buffer) * 3. send any data to dc using send_data (dc passess address/size of buffer) @@ -56,7 +60,7 @@ return x; } -void dc_fstat(unsigned char * buffer) +int dc_fstat(unsigned char * buffer) { struct stat filestat; int retval; @@ -65,7 +69,7 @@ /* value0 = fd, value1 = addr, value2 = size */ retval = fstat(ntohl(command->value0), &filestat); - + dcstat.st_dev = dc_order(filestat.st_dev); dcstat.st_ino = dc_order(filestat.st_ino); dcstat.st_mode = dc_order(filestat.st_mode); @@ -84,28 +88,34 @@ send_data((unsigned char *)&dcstat, ntohl(command->value1), ntohl(command->value2)); - send_command(CMD_RETVAL, retval, retval, NULL, 0); + send_cmd(CMD_RETVAL, retval, retval, NULL, 0); + + return 0; } -void dc_write(unsigned char * buffer) +int dc_write(unsigned char * buffer) { unsigned char *data; int retval; command_3int_t *command = (command_3int_t *)buffer; /* value0 = fd, value1 = addr, value2 = size */ - + data = malloc(ntohl(command->value2)); recv_data(data, ntohl(command->value1), ntohl(command->value2), 1); retval = write(ntohl(command->value0), data, ntohl(command->value2)); - send_command(CMD_RETVAL, retval, retval, NULL, 0); + if(send_command(CMD_RETVAL, retval, retval, NULL, 0) == -1) { + free(data); + return -1; + } free(data); + return 0; } -void dc_read(unsigned char * buffer) +int dc_read(unsigned char * buffer) { unsigned char *data; int retval; @@ -117,22 +127,24 @@ send_data(data, ntohl(command->value1), ntohl(command->value2)); - send_command(CMD_RETVAL, retval, retval, NULL, 0); + if(send_command(CMD_RETVAL, retval, retval, NULL, 0)) { + free(data); + return -1; + } free(data); + return 0; } -void dc_open(unsigned char * buffer) +int dc_open(unsigned char * buffer) { int retval; - int flags; int ourflags = 0; - int mode; command_2int_string_t *command = (command_2int_string_t *)buffer; /* value0 = flags value1 = mode string = name */ - + /* translate flags */ - + if (ntohl(command->value0) & 0x0001) ourflags |= O_WRONLY; if (ntohl(command->value0) & 0x0002) @@ -145,38 +157,41 @@ ourflags |= O_TRUNC; if (ntohl(command->value0) & 0x0800) ourflags |= O_EXCL; - + retval = open(command->string, ourflags | O_BINARY, ntohl(command->value1)); - send_command(CMD_RETVAL, retval, retval, NULL, 0); + send_cmd(CMD_RETVAL, retval, retval, NULL, 0); + + return 0; } -void dc_close(unsigned char * buffer) +int dc_close(unsigned char * buffer) { int retval; command_int_t *command = (command_int_t *)buffer; retval = close(ntohl(command->value0)); - send_command(CMD_RETVAL, retval, retval, NULL, 0); + send_cmd(CMD_RETVAL, retval, retval, NULL, 0); + + return 0; } -void dc_creat(unsigned char * buffer) +int dc_creat(unsigned char * buffer) { - int namelen; - unsigned char *pathname; int retval; - int mode; command_int_string_t *command = (command_int_string_t *)buffer; retval = creat(command->string, ntohl(command->value0)); - send_command(CMD_RETVAL, retval, retval, NULL, 0); + send_cmd(CMD_RETVAL, retval, retval, NULL, 0); + + return 0; } -void dc_link(unsigned char * buffer) +int dc_link(unsigned char * buffer) { - unsigned char *pathname1, *pathname2; + char *pathname1, *pathname2; int retval; command_string_t *command = (command_string_t *)buffer; @@ -190,62 +205,71 @@ retval = link(pathname1, pathname2); #endif - send_command(CMD_RETVAL, retval, retval, NULL, 0); + send_cmd(CMD_RETVAL, retval, retval, NULL, 0); + + return 0; } -void dc_unlink(unsigned char * buffer) +int dc_unlink(unsigned char * buffer) { int retval; command_string_t *command = (command_string_t *)buffer; retval = unlink(command->string); - send_command(CMD_RETVAL, retval, retval, NULL, 0); + send_cmd(CMD_RETVAL, retval, retval, NULL, 0); + + return 0; } -void dc_chdir(unsigned char * buffer) +int dc_chdir(unsigned char * buffer) { int retval; command_string_t *command = (command_string_t *)buffer; retval = chdir(command->string); - send_command(CMD_RETVAL, retval, retval, NULL, 0); + send_cmd(CMD_RETVAL, retval, retval, NULL, 0); + + return 0; } -void dc_chmod(unsigned char * buffer) +int dc_chmod(unsigned char * buffer) { int retval; command_int_string_t *command = (command_int_string_t *)buffer; - + retval = chmod(command->string, ntohl(command->value0)); - send_command(CMD_RETVAL, retval, retval, NULL, 0); + send_cmd(CMD_RETVAL, retval, retval, NULL, 0); + + return 0; } -void dc_lseek(unsigned char * buffer) +int dc_lseek(unsigned char * buffer) { - int filedes; - int offset; - int whence; int retval; command_3int_t *command = (command_3int_t *)buffer; retval = lseek(ntohl(command->value0), ntohl(command->value1), ntohl(command->value2)); - send_command(CMD_RETVAL, retval, retval, NULL, 0); + send_cmd(CMD_RETVAL, retval, retval, NULL, 0); + + return 0; } -void dc_time(unsigned char * buffer) +int dc_time(unsigned char * buffer) { time_t t; time(&t); - send_command(CMD_RETVAL, t, t, NULL, 0); + send_cmd(CMD_RETVAL, t, t, NULL, 0); + + return 0; } -void dc_stat(unsigned char * buffer) +int dc_stat(unsigned char * buffer) { struct stat filestat; int retval; @@ -272,17 +296,18 @@ send_data((unsigned char *)&dcstat, ntohl(command->value0), ntohl(command->value1)); - send_command(CMD_RETVAL, retval, retval, NULL, 0); + send_cmd(CMD_RETVAL, retval, retval, NULL, 0); + + return 0; } -void dc_utime(unsigned char * buffer) +int dc_utime(unsigned char * buffer) { struct utimbuf tbuf; int retval; command_3int_string_t *command = (command_3int_string_t *)buffer; if (ntohl(command->value0)) { - tbuf.actime = ntohl(command->value1); tbuf.modtime = ntohl(command->value2); @@ -290,30 +315,36 @@ } else { retval = utime(command->string, 0); } - send_command(CMD_RETVAL, retval, retval, NULL, 0); + send_cmd(CMD_RETVAL, retval, retval, NULL, 0); + + return 0; } -void dc_opendir(unsigned char * buffer) +int dc_opendir(unsigned char * buffer) { DIR *somedir; command_string_t *command = (command_string_t *)buffer; somedir = opendir(command->string); - send_command(CMD_RETVAL, (unsigned int)somedir, (unsigned int)somedir, NULL, 0); + send_cmd(CMD_RETVAL, (unsigned int)somedir, (unsigned int)somedir, NULL, 0); + + return 0; } -void dc_closedir(unsigned char * buffer) +int dc_closedir(unsigned char * buffer) { int retval; command_int_t *command = (command_int_t *)buffer; retval = closedir((DIR *) ntohl(command->value0)); - send_command(CMD_RETVAL, retval, retval, NULL, 0); + send_cmd(CMD_RETVAL, retval, retval, NULL, 0); + + return 0; } -void dc_readdir(unsigned char * buffer) +int dc_readdir(unsigned char * buffer) { struct dirent *somedirent; dcload_dirent_t dcdirent; @@ -340,14 +371,16 @@ # endif #endif strcpy(dcdirent.d_name, somedirent->d_name); - + send_data((unsigned char *)&dcdirent, ntohl(command->value1), ntohl(command->value2)); } - - send_command(CMD_RETVAL, (unsigned int)somedirent, (unsigned int)somedirent, NULL, 0); + + send_cmd(CMD_RETVAL, (unsigned int)somedirent, (unsigned int)somedirent, NULL, 0); + + return 0; } -void dc_cdfs_redir_read_sectors(int isofd, unsigned char * buffer) +int dc_cdfs_redir_read_sectors(int isofd, unsigned char * buffer) { int start; unsigned char * buf; @@ -363,50 +396,70 @@ send_data(buf, ntohl(command->value1), ntohl(command->value2)); - send_command(CMD_RETVAL, 0, 0, NULL, 0); + send_cmd(CMD_RETVAL, 0, 0, NULL, 0); + + return 0; } #define GDBBUFSIZE 1024 +#ifdef __MINGW32__ +extern SOCKET gdb_server_socket; +#else extern int gdb_server_socket; +#endif -void dc_gdbpacket(unsigned char * buffer) +int dc_gdbpacket(unsigned char * buffer) { size_t in_size, out_size; - - static int socket_fd = -1; static char gdb_buf[GDBBUFSIZE]; + int retval = 0; +#ifdef __MINGW32__ + /* Winsock SOCKET is defined as an unsigned int, so -1 won't work here */ + static SOCKET socket_fd = 0; - int count, size, retval; + if (gdb_server_socket == INVALID_SOCKET) { +#else + static int socket_fd = 0; - if (gdb_server_socket < 0) { - send_command(CMD_RETVAL, -1, -1, NULL, 0); - return; + if (gdb_server_socket < 0) { +#endif + send_cmd(CMD_RETVAL, -1, -1, NULL, 0); } - if (socket_fd < 0) { + if (socket_fd == 0) { printf( "waiting for gdb client connection...\n" ); - if ( (socket_fd = accept( gdb_server_socket, NULL, NULL )) < 0) { + socket_fd = accept( gdb_server_socket, NULL, NULL ); +#ifdef __MINGW32__ + if ( socket_fd != INVALID_SOCKET) +#endif + if ( socket_fd == 0) { perror("error accepting gdb server connection"); - return; + return -1; } } command_2int_string_t *command = (command_2int_string_t *)buffer; /* value0 = in_size, value1 = out_size, string = packet */ - retval = 0; - in_size = ntohl(command->value0); out_size = ntohl(command->value1); if (in_size) - write(socket_fd, command->string, in_size); + send(socket_fd, command->string, in_size, 0); if (out_size) { - retval = read(socket_fd, gdb_buf, out_size > GDBBUFSIZE ? GDBBUFSIZE : out_size); + retval = recv(socket_fd, gdb_buf, out_size > GDBBUFSIZE ? GDBBUFSIZE : out_size, 0); + if (retval == 0) - socket_fd = -1; + socket_fd = -1; } - - send_command(CMD_RETVAL, retval, retval, gdb_buf, retval); +#ifdef __MINGW32__ + if(retval == SOCKET_ERROR) { + fprintf(stderr, "Got socket error: %d\n", WSAGetLastError()); + return -1; + } +#endif + send_cmd(CMD_RETVAL, retval, retval, (unsigned char *)gdb_buf, retval); + + return 0; } Modified: dcload/dcload-ip/host-src/tool/syscalls.h =================================================================== --- dcload/dcload-ip/host-src/tool/syscalls.h 2008-02-14 03:15:15 UTC (rev 557) +++ dcload/dcload-ip/host-src/tool/syscalls.h 2008-02-17 01:15:24 UTC (rev 558) @@ -10,7 +10,7 @@ * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License @@ -22,28 +22,28 @@ #ifndef __SYSCALLS_H__ #define __SYSCALLS_H__ -void dc_fstat(unsigned char * buffer); -void dc_write(unsigned char * buffer); -void dc_read(unsigned char * buffer); -void dc_open(unsigned char * buffer); -void dc_close(unsigned char * buffer); -void dc_creat(unsigned char * buffer); -void dc_link(unsigned char * buffer); -void dc_unlink(unsigned char * buffer); -void dc_chdir(unsigned char * buffer); -void dc_chmod(unsigned char * buffer); -void dc_lseek(unsigned char * buffer); -void dc_time(unsigned char * buffer); -void dc_stat(unsigned char * buffer); -void dc_utime(unsigned char * buffer); +int dc_fstat(unsigned char * buffer); +int dc_write(unsigned char * buffer); +int dc_read(unsigned char * buffer); +int dc_open(unsigned char * buffer); +int dc_close(unsigned char * buffer); +int dc_creat(unsigned char * buffer); +int dc_link(unsigned char * buffer); +int dc_unlink(unsigned char * buffer); +int dc_chdir(unsigned char * buffer); +int dc_chmod(unsigned char * buffer); +int dc_lseek(unsigned char * buffer); +int dc_time(unsigned char * buffer); +int dc_stat(unsigned char * buffer); +int dc_utime(unsigned char * buffer); -void dc_opendir(unsigned char * buffer); -void dc_readdir(unsigned char * buffer); -void dc_closedir(unsigned char * buffer); +int dc_opendir(unsigned char * buffer); +int dc_readdir(unsigned char * buffer); +int dc_closedir(unsigned char * buffer); -void dc_cdfs_redir_read_sectors(int isofd, unsigned char * buffer); +int dc_cdfs_redir_read_sectors(int isofd, unsigned char * buffer); -void dc_gdbpacket(unsigned char * buffer); +int dc_gdbpacket(unsigned char * buffer); #define CMD_EXIT "DC00" #define CMD_FSTAT "DC01" @@ -67,44 +67,51 @@ #define CMD_CDFSREAD "DC19" #define CMD_GDBPACKET "DC20" -typedef struct { - unsigned char id[4] __attribute__ ((packed)); - unsigned int value0 __attribute__ ((packed)); - unsigned int value1 __attribute__ ((packed)); - unsigned int value2 __attribute__ ((packed)); -} command_3int_t; +struct _command_3int_t { + unsigned char id[4]; + unsigned int value0; + unsigned int value1; + unsigned int value2; +} __attribute__ ((__packed__)); -typedef struct { - unsigned char id[4] __attribute__ ((packed)); - unsigned int value0 __attribute__ ((packed)); - unsigned int value1 __attribute__ ((packed)); - unsigned char string[1] __attribute__ ((packed)); -} command_2int_string_t; +struct _command_2int_string_t { + unsigned char id[4]; + unsigned int value0; + unsigned int value1; + char string[1]; +} __attribute__ ((__packed__)); -typedef struct { - unsigned char id[4] __attribute__ ((packed)); - unsigned int value0 __attribute__ ((packed)); -} command_int_t; +struct _command_int_t { + unsigned char id[4]; + unsigned int value0; +} __attribute__ ((__packed__)); -typedef struct { - unsigned char id[4] __attribute__ ((packed)); - unsigned int value0 __attribute__ ((packed)); - unsigned char string[1] __attribute__ ((packed)); -} command_int_string_t; +struct _command_int_string_t { + unsigned char id[4]; + unsigned int value0; + char string[1]; +} __attribute__ ((__packed__)); -typedef struct { - unsigned char id[4] __attribute__ ((packed)); - unsigned char string[1] __attribute__ ((packed)); -} command_string_t; +struct _command_string_t { + unsigned char id[4]; + char string[1]; +} __attribute__ ((__packed__)); -typedef struct { - unsigned char id[4] __attribute__ ((packed)); - unsigned int value0 __attribute__ ((packed)); - unsigned int value1 __attribute__ ((packed)); - unsigned int value2 __attribute__ ((packed)); - unsigned char string[1] __attribute__ ((packed)); -} command_3int_string_t; +struct _command_3int_string_t { + unsigned char id[4]; + unsigned int value0; + unsigned int value1; + unsigned int value2; + char string[1]; +} __attribute__ ((__packed__)); +typedef struct _command_3int_t command_3int_t; +typedef struct _command_2int_string_t command_2int_string_t; +typedef struct _command_int_t command_int_t; +typedef struct _command_int_string_t command_int_string_t; +typedef struct _command_string_t command_string_t; +typedef struct _command_3int_string_t command_3int_string_t; + /* fstat fd, addr, size * write fd, addr, size * read fd, addr, size @@ -127,3 +134,4 @@ */ #endif + Modified: dcload/dcload-ip/host-src/tool/unlink.c =================================================================== --- dcload/dcload-ip/host-src/tool/unlink.c 2008-02-14 03:15:15 UTC (rev 557) +++ dcload/dcload-ip/host-src/tool/unlink.c 2008-02-17 01:15:24 UTC (rev 558) @@ -11,14 +11,13 @@ #endif #endif -int -unlink_if_ordinary (const char *name) +int unlink_if_ordinary (const char *name) { struct stat st; - + if (lstat (name, &st) == 0 && (S_ISREG (st.st_mode) || S_ISLNK (st.st_mode))) return unlink (name); - + return 1; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ljs...@us...> - 2008-02-14 03:15:50
|
Revision: 557 http://cadcdev.svn.sourceforge.net/cadcdev/?rev=557&view=rev Author: ljsebald Date: 2008-02-13 19:15:15 -0800 (Wed, 13 Feb 2008) Log Message: ----------- Got rid of the condvar in the UDP code... It wasn't really right in the first place to use it, so now its gone. Modified Paths: -------------- kos/kernel/net/net_udp.c Modified: kos/kernel/net/net_udp.c =================================================================== --- kos/kernel/net/net_udp.c 2008-01-27 01:49:46 UTC (rev 556) +++ kos/kernel/net/net_udp.c 2008-02-14 03:15:15 UTC (rev 557) @@ -1,7 +1,7 @@ /* KallistiOS ##version## kernel/net/net_udp.c - Copyright (C) 2005, 2006, 2007 Lawrence Sebald + Copyright (C) 2005, 2006, 2007, 2008 Lawrence Sebald */ @@ -11,7 +11,7 @@ #include <arpa/inet.h> #include <kos/net.h> #include <kos/mutex.h> -#include <kos/cond.h> +#include <kos/genwait.h> #include <sys/queue.h> #include <kos/dbgio.h> #include <kos/fs_socket.h> @@ -44,7 +44,6 @@ static struct udp_sock_list net_udp_sockets = LIST_HEAD_INITIALIZER(0); static mutex_t *udp_mutex = NULL; -static condvar_t *udp_packets_ready = NULL; int net_udp_accept(net_socket_t *hnd, struct sockaddr *addr, socklen_t *addr_len) { @@ -232,7 +231,7 @@ } if(TAILQ_EMPTY(&udpsock->packets)) { - cond_wait(udp_packets_ready, udp_mutex); + genwait_wait(udpsock, "net_udp_recv", 0, NULL); } pkt = TAILQ_FIRST(&udpsock->packets); @@ -296,7 +295,7 @@ } while(TAILQ_EMPTY(&udpsock->packets)) { - cond_wait(udp_packets_ready, udp_mutex); + genwait_wait(udpsock, "net_udp_recvfrom", 0, NULL); } pkt = TAILQ_FIRST(&udpsock->packets); @@ -663,7 +662,7 @@ TAILQ_INSERT_TAIL(&sock->packets, pkt, pkt_queue); - cond_broadcast(udp_packets_ready); + genwait_wake_one(sock); mutex_unlock(udp_mutex); @@ -755,22 +754,10 @@ return -1; } - udp_packets_ready = cond_create(); - - if(udp_packets_ready == NULL) { - mutex_destroy(udp_mutex); - udp_mutex = NULL; - - return -1; - } - return 0; } void net_udp_shutdown() { if(udp_mutex != NULL) mutex_destroy(udp_mutex); - - if(udp_packets_ready != NULL) - cond_destroy(udp_packets_ready); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <c99...@us...> - 2008-01-27 01:49:52
|
Revision: 556 http://cadcdev.svn.sourceforge.net/cadcdev/?rev=556&view=rev Author: c99koder Date: 2008-01-26 17:49:46 -0800 (Sat, 26 Jan 2008) Log Message: ----------- Enable native line endings on source files Property Changed: ---------------- dcload/dcload-ip/Makefile dcload/dcload-ip/Makefile.cfg dcload/dcload-ip/example-src/Makefile dcload/dcload-ip/example-src/asm.h dcload/dcload-ip/example-src/console-test.c dcload/dcload-ip/example-src/crt0.S dcload/dcload-ip/example-src/dc.x dcload/dcload-ip/example-src/dcload-syscall.h dcload/dcload-ip/example-src/dcload-syscall.s dcload/dcload-ip/example-src/dcload-syscalls.c dcload/dcload-ip/example-src/dcload-syscalls.h dcload/dcload-ip/example-src/exception-test.c dcload/dcload-ip/example-src/gethostinfo.c dcload/dcload-ip/example-src/memcpy.S dcload/dcload-ip/host-src/Makefile dcload/dcload-ip/host-src/tool/Makefile dcload/dcload-ip/host-src/tool/commands.h dcload/dcload-ip/host-src/tool/dc-io.h dcload/dcload-ip/host-src/tool/dc-tool.c dcload/dcload-ip/host-src/tool/dcload-types.h dcload/dcload-ip/host-src/tool/syscalls.c dcload/dcload-ip/host-src/tool/syscalls.h dcload/dcload-ip/host-src/tool/unlink.c dcload/dcload-ip/make-cd/Makefile dcload/dcload-ip/target-inc/_ansi.h dcload/dcload-ip/target-inc/_syslist.h dcload/dcload-ip/target-inc/ar.h dcload/dcload-ip/target-inc/assert.h dcload/dcload-ip/target-inc/ctype.h dcload/dcload-ip/target-inc/dirent.h dcload/dcload-ip/target-inc/errno.h dcload/dcload-ip/target-inc/fastmath.h dcload/dcload-ip/target-inc/fcntl.h dcload/dcload-ip/target-inc/grp.h dcload/dcload-ip/target-inc/ieeefp.h dcload/dcload-ip/target-inc/locale.h dcload/dcload-ip/target-inc/machine/fastmath.h dcload/dcload-ip/target-inc/machine/ieeefp.h dcload/dcload-ip/target-inc/machine/setjmp-dj.h dcload/dcload-ip/target-inc/machine/setjmp.h dcload/dcload-ip/target-inc/machine/time.h dcload/dcload-ip/target-inc/machine/types.h dcload/dcload-ip/target-inc/malloc.h dcload/dcload-ip/target-inc/math.h dcload/dcload-ip/target-inc/paths.h dcload/dcload-ip/target-inc/process.h dcload/dcload-ip/target-inc/pwd.h dcload/dcload-ip/target-inc/reent.h dcload/dcload-ip/target-inc/regdef.h dcload/dcload-ip/target-inc/setjmp.h dcload/dcload-ip/target-inc/signal.h dcload/dcload-ip/target-inc/stdio.h dcload/dcload-ip/target-inc/stdlib.h dcload/dcload-ip/target-inc/string.h dcload/dcload-ip/target-inc/sys/_types.h dcload/dcload-ip/target-inc/sys/config.h dcload/dcload-ip/target-inc/sys/dirent.h dcload/dcload-ip/target-inc/sys/errno.h dcload/dcload-ip/target-inc/sys/fcntl.h dcload/dcload-ip/target-inc/sys/file.h dcload/dcload-ip/target-inc/sys/param.h dcload/dcload-ip/target-inc/sys/reent.h dcload/dcload-ip/target-inc/sys/resource.h dcload/dcload-ip/target-inc/sys/signal.h dcload/dcload-ip/target-inc/sys/stat-dj.h dcload/dcload-ip/target-inc/sys/stat.h dcload/dcload-ip/target-inc/sys/syscall.h dcload/dcload-ip/target-inc/sys/time.h dcload/dcload-ip/target-inc/sys/timeb.h dcload/dcload-ip/target-inc/sys/times.h dcload/dcload-ip/target-inc/sys/types.h dcload/dcload-ip/target-inc/sys/unistd.h dcload/dcload-ip/target-inc/sys/utime.h dcload/dcload-ip/target-inc/sys/wait.h dcload/dcload-ip/target-inc/termios.h dcload/dcload-ip/target-inc/time.h dcload/dcload-ip/target-inc/unctrl.h dcload/dcload-ip/target-inc/unistd.h dcload/dcload-ip/target-inc/utime.h dcload/dcload-ip/target-inc/utmp.h dcload/dcload-ip/target-src/1st_read/1st_read.c dcload/dcload-ip/target-src/1st_read/Makefile dcload/dcload-ip/target-src/1st_read/asm.h dcload/dcload-ip/target-src/1st_read/crt0.S dcload/dcload-ip/target-src/1st_read/dc.x dcload/dcload-ip/target-src/1st_read/disable.s dcload/dcload-ip/target-src/1st_read/memcpy.S dcload/dcload-ip/target-src/Makefile dcload/dcload-ip/target-src/dcload/Makefile dcload/dcload-ip/target-src/dcload/adapter.c dcload/dcload-ip/target-src/dcload/adapter.h dcload/dcload-ip/target-src/dcload/asm.h dcload/dcload-ip/target-src/dcload/bswap.h dcload/dcload-ip/target-src/dcload/bswap.s dcload/dcload-ip/target-src/dcload/cdfs.h dcload/dcload-ip/target-src/dcload/cdfs_redir.s dcload/dcload-ip/target-src/dcload/cdfs_syscalls.c dcload/dcload-ip/target-src/dcload/commands.c dcload/dcload-ip/target-src/dcload/commands.h dcload/dcload-ip/target-src/dcload/dcload-crt0.s dcload/dcload-ip/target-src/dcload/dcload.c dcload/dcload-ip/target-src/dcload/dcload.h dcload/dcload-ip/target-src/dcload/dcload.x dcload/dcload-ip/target-src/dcload/disable.h dcload/dcload-ip/target-src/dcload/disable.s dcload/dcload-ip/target-src/dcload/exception.s dcload/dcload-ip/target-src/dcload/go.h dcload/dcload-ip/target-src/dcload/go.s dcload/dcload-ip/target-src/dcload/lan_adapter.c dcload/dcload-ip/target-src/dcload/lan_adapter.h dcload/dcload-ip/target-src/dcload/memcmp.c dcload/dcload-ip/target-src/dcload/memcpy.S dcload/dcload-ip/target-src/dcload/memset.S dcload/dcload-ip/target-src/dcload/net.c dcload/dcload-ip/target-src/dcload/net.h dcload/dcload-ip/target-src/dcload/packet.c dcload/dcload-ip/target-src/dcload/packet.h dcload/dcload-ip/target-src/dcload/rtl8139.c dcload/dcload-ip/target-src/dcload/rtl8139.h dcload/dcload-ip/target-src/dcload/scif.c dcload/dcload-ip/target-src/dcload/scif.h dcload/dcload-ip/target-src/dcload/syscalls.c dcload/dcload-ip/target-src/dcload/syscalls.h dcload/dcload-ip/target-src/dcload/video.h dcload/dcload-ip/target-src/dcload/video.s dcload/dcload-serial/Makefile dcload/dcload-serial/Makefile.cfg dcload/dcload-serial/example-src/Makefile dcload/dcload-serial/example-src/console-test.c dcload/dcload-serial/example-src/crt0.S dcload/dcload-serial/example-src/dc.x dcload/dcload-serial/example-src/dcload-syscall.h dcload/dcload-serial/example-src/dcload-syscall.s dcload/dcload-serial/example-src/dcload-syscalls.c dcload/dcload-serial/example-src/dcload-syscalls.h dcload/dcload-serial/example-src/exception-test.c dcload/dcload-serial/host-src/Makefile dcload/dcload-serial/host-src/misc/Makefile dcload/dcload-serial/host-src/misc/lzo.c dcload/dcload-serial/host-src/tool/Makefile dcload/dcload-serial/host-src/tool/dc-io.h dcload/dcload-serial/host-src/tool/dc-tool.c dcload/dcload-serial/host-src/tool/syscalls.c dcload/dcload-serial/host-src/tool/syscalls.h dcload/dcload-serial/host-src/tool/unlink.c dcload/dcload-serial/make-cd/Makefile dcload/dcload-serial/minilzo.106/Makefile dcload/dcload-serial/minilzo.106/lzoconf.h dcload/dcload-serial/minilzo.106/minilzo.c dcload/dcload-serial/minilzo.106/minilzo.h dcload/dcload-serial/minilzo.106/testmini.c dcload/dcload-serial/target-inc/_ansi.h dcload/dcload-serial/target-inc/_syslist.h dcload/dcload-serial/target-inc/ar.h dcload/dcload-serial/target-inc/assert.h dcload/dcload-serial/target-inc/ctype.h dcload/dcload-serial/target-inc/dirent.h dcload/dcload-serial/target-inc/errno.h dcload/dcload-serial/target-inc/fastmath.h dcload/dcload-serial/target-inc/fcntl.h dcload/dcload-serial/target-inc/grp.h dcload/dcload-serial/target-inc/ieeefp.h dcload/dcload-serial/target-inc/locale.h dcload/dcload-serial/target-inc/machine/fastmath.h dcload/dcload-serial/target-inc/machine/ieeefp.h dcload/dcload-serial/target-inc/machine/setjmp-dj.h dcload/dcload-serial/target-inc/machine/setjmp.h dcload/dcload-serial/target-inc/machine/time.h dcload/dcload-serial/target-inc/machine/types.h dcload/dcload-serial/target-inc/malloc.h dcload/dcload-serial/target-inc/math.h dcload/dcload-serial/target-inc/paths.h dcload/dcload-serial/target-inc/process.h dcload/dcload-serial/target-inc/pwd.h dcload/dcload-serial/target-inc/reent.h dcload/dcload-serial/target-inc/regdef.h dcload/dcload-serial/target-inc/setjmp.h dcload/dcload-serial/target-inc/signal.h dcload/dcload-serial/target-inc/stdio.h dcload/dcload-serial/target-inc/stdlib.h dcload/dcload-serial/target-inc/string.h dcload/dcload-serial/target-inc/sys/_types.h dcload/dcload-serial/target-inc/sys/config.h dcload/dcload-serial/target-inc/sys/dirent.h dcload/dcload-serial/target-inc/sys/errno.h dcload/dcload-serial/target-inc/sys/fcntl.h dcload/dcload-serial/target-inc/sys/file.h dcload/dcload-serial/target-inc/sys/param.h dcload/dcload-serial/target-inc/sys/reent.h dcload/dcload-serial/target-inc/sys/resource.h dcload/dcload-serial/target-inc/sys/signal.h dcload/dcload-serial/target-inc/sys/stat-dj.h dcload/dcload-serial/target-inc/sys/stat.h dcload/dcload-serial/target-inc/sys/syscall.h dcload/dcload-serial/target-inc/sys/time.h dcload/dcload-serial/target-inc/sys/timeb.h dcload/dcload-serial/target-inc/sys/times.h dcload/dcload-serial/target-inc/sys/types.h dcload/dcload-serial/target-inc/sys/unistd.h dcload/dcload-serial/target-inc/sys/utime.h dcload/dcload-serial/target-inc/sys/wait.h dcload/dcload-serial/target-inc/termios.h dcload/dcload-serial/target-inc/time.h dcload/dcload-serial/target-inc/unctrl.h dcload/dcload-serial/target-inc/unistd.h dcload/dcload-serial/target-inc/utime.h dcload/dcload-serial/target-inc/utmp.h dcload/dcload-serial/target-src/1st_read/1st_read.c dcload/dcload-serial/target-src/1st_read/Makefile dcload/dcload-serial/target-src/1st_read/asm.h dcload/dcload-serial/target-src/1st_read/crt0.S dcload/dcload-serial/target-src/1st_read/dc.x dcload/dcload-serial/target-src/1st_read/disable.s dcload/dcload-serial/target-src/1st_read/memcmp.c dcload/dcload-serial/target-src/1st_read/memcpy.S dcload/dcload-serial/target-src/1st_read/memmove.c dcload/dcload-serial/target-src/1st_read/memset.S dcload/dcload-serial/target-src/Makefile dcload/dcload-serial/target-src/dcload/Makefile dcload/dcload-serial/target-src/dcload/asm.h dcload/dcload-serial/target-src/dcload/cdfs_redir.s dcload/dcload-serial/target-src/dcload/cdfs_syscalls.c dcload/dcload-serial/target-src/dcload/dcload-crt0.s dcload/dcload-serial/target-src/dcload/dcload.c dcload/dcload-serial/target-src/dcload/dcload.x dcload/dcload-serial/target-src/dcload/disable.s dcload/dcload-serial/target-src/dcload/exception.s dcload/dcload-serial/target-src/dcload/go.s dcload/dcload-serial/target-src/dcload/memcmp.c dcload/dcload-serial/target-src/dcload/memcpy.S dcload/dcload-serial/target-src/dcload/memmove.c dcload/dcload-serial/target-src/dcload/memset.S dcload/dcload-serial/target-src/dcload/scif.c dcload/dcload-serial/target-src/dcload/scif.h dcload/dcload-serial/target-src/dcload/syscalls.c dcload/dcload-serial/target-src/dcload/video.h dcload/dcload-serial/target-src/dcload/video.s Property changes on: dcload/dcload-ip/Makefile ___________________________________________________________________ Name: svn:eol-style + native Property changes on: dcload/dcload-ip/Makefile.cfg ___________________________________________________________________ Name: svn:eol-style + native Property changes on: dcload/dcload-ip/example-src/Makefile ___________________________________________________________________ Name: svn:eol-style + native Property changes on: dcload/dcload-ip/example-src/asm.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: dcload/dcload-ip/example-src/console-test.c ___________________________________________________________________ Name: svn:eol-style + native Property changes on: dcload/dcload-ip/example-src/crt0.S ___________________________________________________________________ Name: svn:eol-style + native Property changes on: dcload/dcload-ip/example-src/dc.x ___________________________________________________________________ Name: svn:eol-style + native Property changes on: dcload/dcload-ip/example-src/dcload-syscall.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: dcload/dcload-ip/example-src/dcload-syscall.s ___________________________________________________________________ Name: svn:eol-style + native Property changes on: dcload/dcload-ip/example-src/dcload-syscalls.c ___________________________________________________________________ Name: svn:eol-style + native Property changes on: dcload/dcload-ip/example-src/dcload-syscalls.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: dcload/dcload-ip/example-src/exception-test.c ___________________________________________________________________ Name: svn:eol-style + native Property changes on: dcload/dcload-ip/example-src/gethostinfo.c ___________________________________________________________________ Name: svn:eol-style + native Property changes on: dcload/dcload-ip/example-src/memcpy.S ___________________________________________________________________ Name: svn:eol-style + native Property changes on: dcload/dcload-ip/host-src/Makefile ___________________________________________________________________ Name: svn:eol-style + native Property changes on: dcload/dcload-ip/host-src/tool/Makefile ___________________________________________________________________ Name: svn:eol-style + native Property changes on: dcload/dcload-ip/host-src/tool/commands.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: dcload/dcload-ip/host-src/tool/dc-io.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: dcload/dcload-ip/host-src/tool/dc-tool.c ___________________________________________________________________ Name: svn:eol-style + native Property changes on: dcload/dcload-ip/host-src/tool/dcload-types.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: dcload/dcload-ip/host-src/tool/syscalls.c ___________________________________________________________________ Name: svn:eol-style + native Property changes on: dcload/dcload-ip/host-src/tool/syscalls.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: dcload/dcload-ip/host-src/tool/unlink.c ___________________________________________________________________ Name: svn:eol-style + native Property changes on: dcload/dcload-ip/make-cd/Makefile ___________________________________________________________________ Name: svn:eol-style + native Property changes on: dcload/dcload-ip/target-inc/_ansi.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: dcload/dcload-ip/target-inc/_syslist.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: dcload/dcload-ip/target-inc/ar.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: dcload/dcload-ip/target-inc/assert.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: dcload/dcload-ip/target-inc/ctype.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: dcload/dcload-ip/target-inc/dirent.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: dcload/dcload-ip/target-inc/errno.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: dcload/dcload-ip/target-inc/fastmath.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: dcload/dcload-ip/target-inc/fcntl.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: dcload/dcload-ip/target-inc/grp.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: dcload/dcload-ip/target-inc/ieeefp.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: dcload/dcload-ip/target-inc/locale.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: dcload/dcload-ip/target-inc/machine/fastmath.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: dcload/dcload-ip/target-inc/machine/ieeefp.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: dcload/dcload-ip/target-inc/machine/setjmp-dj.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: dcload/dcload-ip/target-inc/machine/setjmp.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: dcload/dcload-ip/target-inc/machine/time.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: dcload/dcload-ip/target-inc/machine/types.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: dcload/dcload-ip/target-inc/malloc.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: dcload/dcload-ip/target-inc/math.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: dcload/dcload-ip/target-inc/paths.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: dcload/dcload-ip/target-inc/process.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: dcload/dcload-ip/target-inc/pwd.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: dcload/dcload-ip/target-inc/reent.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: dcload/dcload-ip/target-inc/regdef.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: dcload/dcload-ip/target-inc/setjmp.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: dcload/dcload-ip/target-inc/signal.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: dcload/dcload-ip/target-inc/stdio.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: dcload/dcload-ip/target-inc/stdlib.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: dcload/dcload-ip/target-inc/string.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: dcload/dcload-ip/target-inc/sys/_types.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: dcload/dcload-ip/target-inc/sys/config.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: dcload/dcload-ip/target-inc/sys/dirent.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: dcload/dcload-ip/target-inc/sys/errno.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: dcload/dcload-ip/target-inc/sys/fcntl.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: dcload/dcload-ip/target-inc/sys/file.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: dcload/dcload-ip/target-inc/sys/param.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: dcload/dcload-ip/target-inc/sys/reent.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: dcload/dcload-ip/target-inc/sys/resource.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: dcload/dcload-ip/target-inc/sys/signal.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: dcload/dcload-ip/target-inc/sys/stat-dj.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: dcload/dcload-ip/target-inc/sys/stat.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: dcload/dcload-ip/target-inc/sys/syscall.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: dcload/dcload-ip/target-inc/sys/time.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: dcload/dcload-ip/target-inc/sys/timeb.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: dcload/dcload-ip/target-inc/sys/times.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: dcload/dcload-ip/target-inc/sys/types.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: dcload/dcload-ip/target-inc/sys/unistd.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: dcload/dcload-ip/target-inc/sys/utime.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: dcload/dcload-ip/target-inc/sys/wait.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: dcload/dcload-ip/target-inc/termios.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: dcload/dcload-ip/target-inc/time.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: dcload/dcload-ip/target-inc/unctrl.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: dcload/dcload-ip/target-inc/unistd.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: dcload/dcload-ip/target-inc/utime.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: dcload/dcload-ip/target-inc/utmp.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: dcload/dcload-ip/target-src/1st_read/1st_read.c ___________________________________________________________________ Name: svn:eol-style + native Property changes on: dcload/dcload-ip/target-src/1st_read/Makefile ___________________________________________________________________ Name: svn:eol-style + native Property changes on: dcload/dcload-ip/target-src/1st_read/asm.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: dcload/dcload-ip/target-src/1st_read/crt0.S ___________________________________________________________________ Name: svn:eol-style + native Property changes on: dcload/dcload-ip/target-src/1st_read/dc.x ___________________________________________________________________ Name: svn:eol-style + native Property changes on: dcload/dcload-ip/target-src/1st_read/disable.s ___________________________________________________________________ Name: svn:eol-style + native Property changes on: dcload/dcload-ip/target-src/1st_read/memcpy.S ___________________________________________________________________ Name: svn:eol-style + native Property changes on: dcload/dcload-ip/target-src/Makefile ___________________________________________________________________ Name: svn:eol-style + native Property changes on: dcload/dcload-ip/target-src/dcload/Makefile ___________________________________________________________________ Name: svn:eol-style + native Property changes on: dcload/dcload-ip/target-src/dcload/adapter.c ___________________________________________________________________ Name: svn:eol-style + native Property changes on: dcload/dcload-ip/target-src/dcload/adapter.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: dcload/dcload-ip/target-src/dcload/asm.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: dcload/dcload-ip/target-src/dcload/bswap.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: dcload/dcload-ip/target-src/dcload/bswap.s ___________________________________________________________________ Name: svn:eol-style + native Property changes on: dcload/dcload-ip/target-src/dcload/cdfs.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: dcload/dcload-ip/target-src/dcload/cdfs_redir.s ___________________________________________________________________ Name: svn:eol-style + native Property changes on: dcload/dcload-ip/target-src/dcload/cdfs_syscalls.c ___________________________________________________________________ Name: svn:eol-style + native Property changes on: dcload/dcload-ip/target-src/dcload/commands.c ___________________________________________________________________ Name: svn:eol-style + native Property changes on: dcload/dcload-ip/target-src/dcload/commands.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: dcload/dcload-ip/target-src/dcload/dcload-crt0.s ___________________________________________________________________ Name: svn:eol-style + native Property changes on: dcload/dcload-ip/target-src/dcload/dcload.c ___________________________________________________________________ Name: svn:eol-style + native Property changes on: dcload/dcload-ip/target-src/dcload/dcload.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: dcload/dcload-ip/target-src/dcload/dcload.x ___________________________________________________________________ Name: svn:eol-style + native Property changes on: dcload/dcload-ip/target-src/dcload/disable.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: dcload/dcload-ip/target-src/dcload/disable.s ___________________________________________________________________ Name: svn:eol-style + native Property changes on: dcload/dcload-ip/target-src/dcload/exception.s ___________________________________________________________________ Name: svn:eol-style + native Property changes on: dcload/dcload-ip/target-src/dcload/go.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: dcload/dcload-ip/target-src/dcload/go.s ___________________________________________________________________ Name: svn:eol-style + native Property changes on: dcload/dcload-ip/target-src/dcload/lan_adapter.c ___________________________________________________________________ Name: svn:eol-style + native Property changes on: dcload/dcload-ip/target-src/dcload/lan_adapter.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: dcload/dcload-ip/target-src/dcload/memcmp.c ___________________________________________________________________ Name: svn:eol-style + native Property changes on: dcload/dcload-ip/target-src/dcload/memcpy.S ___________________________________________________________________ Name: svn:eol-style + native Property changes on: dcload/dcload-ip/target-src/dcload/memset.S ___________________________________________________________________ Name: svn:eol-style + native Property changes on: dcload/dcload-ip/target-src/dcload/net.c ___________________________________________________________________ Name: svn:eol-style + native Property changes on: dcload/dcload-ip/target-src/dcload/net.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: dcload/dcload-ip/target-src/dcload/packet.c ___________________________________________________________________ Name: svn:eol-style + native Property changes on: dcload/dcload-ip/target-src/dcload/packet.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: dcload/dcload-ip/target-src/dcload/rtl8139.c ___________________________________________________________________ Name: svn:eol-style + native Property changes on: dcload/dcload-ip/target-src/dcload/rtl8139.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: dcload/dcload-ip/target-src/dcload/scif.c ___________________________________________________________________ Name: svn:eol-style + native Property changes on: dcload/dcload-ip/target-src/dcload/scif.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: dcload/dcload-ip/target-src/dcload/syscalls.c ___________________________________________________________________ Name: svn:eol-style + native Property changes on: dcload/dcload-ip/target-src/dcload/syscalls.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: dcload/dcload-ip/target-src/dcload/video.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: dcload/dcload-ip/target-src/dcload/video.s ___________________________________________________________________ Name: svn:eol-style + native Property changes on: dcload/dcload-serial/Makefile ___________________________________________________________________ Name: svn:eol-style + native Property changes on: dcload/dcload-serial/Makefile.cfg ___________________________________________________________________ Name: svn:eol-style + native Property changes on: dcload/dcload-serial/example-src/Makefile ___________________________________________________________________ Name: svn:eol-style + native Property changes on: dcload/dcload-serial/example-src/console-test.c ___________________________________________________________________ Name: svn:eol-style + native Property changes on: dcload/dcload-serial/example-src/crt0.S ___________________________________________________________________ Name: svn:eol-style + native Property changes on: dcload/dcload-serial/example-src/dc.x ___________________________________________________________________ Name: svn:eol-style + native Property changes on: dcload/dcload-serial/example-src/dcload-syscall.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: dcload/dcload-serial/example-src/dcload-syscall.s ___________________________________________________________________ Name: svn:eol-style + native Property changes on: dcload/dcload-serial/example-src/dcload-syscalls.c ___________________________________________________________________ Name: svn:eol-style + native Property changes on: dcload/dcload-serial/example-src/dcload-syscalls.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: dcload/dcload-serial/example-src/exception-test.c ___________________________________________________________________ Name: svn:eol-style + native Property changes on: dcload/dcload-serial/host-src/Makefile ___________________________________________________________________ Name: svn:eol-style + native Property changes on: dcload/dcload-serial/host-src/misc/Makefile ___________________________________________________________________ Name: svn:eol-style + native Property changes on: dcload/dcload-serial/host-src/misc/lzo.c ___________________________________________________________________ Name: svn:eol-style + native Property changes on: dcload/dcload-serial/host-src/tool/Makefile ___________________________________________________________________ Name: svn:eol-style + native Property changes on: dcload/dcload-serial/host-src/tool/dc-io.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: dcload/dcload-serial/host-src/tool/dc-tool.c ___________________________________________________________________ Name: svn:eol-style + native Property changes on: dcload/dcload-serial/host-src/tool/syscalls.c ___________________________________________________________________ Name: svn:eol-style + native Property changes on: dcload/dcload-serial/host-src/tool/syscalls.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: dcload/dcload-serial/host-src/tool/unlink.c ___________________________________________________________________ Name: svn:eol-style + native Property changes on: dcload/dcload-serial/make-cd/Makefile ___________________________________________________________________ Name: svn:eol-style + native Property changes on: dcload/dcload-serial/minilzo.106/Makefile ___________________________________________________________________ Name: svn:eol-style + native Property changes on: dcload/dcload-serial/minilzo.106/lzoconf.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: dcload/dcload-serial/minilzo.106/minilzo.c ___________________________________________________________________ Name: svn:eol-style + native Property changes on: dcload/dcload-serial/minilzo.106/minilzo.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: dcload/dcload-serial/minilzo.106/testmini.c ___________________________________________________________________ Name: svn:eol-style + native Property changes on: dcload/dcload-serial/target-inc/_ansi.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: dcload/dcload-serial/target-inc/_syslist.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: dcload/dcload-serial/target-inc/ar.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: dcload/dcload-serial/target-inc/assert.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: dcload/dcload-serial/target-inc/ctype.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: dcload/dcload-serial/target-inc/dirent.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: dcload/dcload-serial/target-inc/errno.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: dcload/dcload-serial/target-inc/fastmath.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: dcload/dcload-serial/target-inc/fcntl.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: dcload/dcload-serial/target-inc/grp.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: dcload/dcload-serial/target-inc/ieeefp.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: dcload/dcload-serial/target-inc/locale.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: dcload/dcload-serial/target-inc/machine/fastmath.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: dcload/dcload-serial/target-inc/machine/ieeefp.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: dcload/dcload-serial/target-inc/machine/setjmp-dj.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: dcload/dcload-serial/target-inc/machine/setjmp.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: dcload/dcload-serial/target-inc/machine/time.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: dcload/dcload-serial/target-inc/machine/types.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: dcload/dcload-serial/target-inc/malloc.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: dcload/dcload-serial/target-inc/math.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: dcload/dcload-serial/target-inc/paths.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: dcload/dcload-serial/target-inc/process.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: dcload/dcload-serial/target-inc/pwd.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: dcload/dcload-serial/target-inc/reent.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: dcload/dcload-serial/target-inc/regdef.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: dcload/dcload-serial/target-inc/setjmp.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: dcload/dcload-serial/target-inc/signal.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: dcload/dcload-serial/target-inc/stdio.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: dcload/dcload-serial/target-inc/stdlib.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: dcload/dcload-serial/target-inc/string.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: dcload/dcload-serial/target-inc/sys/_types.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: dcload/dcload-serial/target-inc/sys/config.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: dcload/dcload-serial/target-inc/sys/dirent.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: dcload/dcload-serial/target-inc/sys/errno.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: dcload/dcload-serial/target-inc/sys/fcntl.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: dcload/dcload-serial/target-inc/sys/file.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: dcload/dcload-serial/target-inc/sys/param.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: dcload/dcload-serial/target-inc/sys/reent.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: dcload/dcload-serial/target-inc/sys/resource.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: dcload/dcload-serial/target-inc/sys/signal.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: dcload/dcload-serial/target-inc/sys/stat-dj.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: dcload/dcload-serial/target-inc/sys/stat.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: dcload/dcload-serial/target-inc/sys/syscall.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: dcload/dcload-serial/target-inc/sys/time.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: dcload/dcload-serial/target-inc/sys/timeb.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: dcload/dcload-serial/target-inc/sys/times.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: dcload/dcload-serial/target-inc/sys/types.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: dcload/dcload-serial/target-inc/sys/unistd.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: dcload/dcload-serial/target-inc/sys/utime.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: dcload/dcload-serial/target-inc/sys/wait.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: dcload/dcload-serial/target-inc/termios.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: dcload/dcload-serial/target-inc/time.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: dcload/dcload-serial/target-inc/unctrl.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: dcload/dcload-serial/target-inc/unistd.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: dcload/dcload-serial/target-inc/utime.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: dcload/dcload-serial/target-inc/utmp.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: dcload/dcload-serial/target-src/1st_read/1st_read.c ___________________________________________________________________ Name: svn:eol-style + native Property changes on: dcload/dcload-serial/target-src/1st_read/Makefile ___________________________________________________________________ Name: svn:eol-style + native Property changes on: dcload/dcload-serial/target-src/1st_read/asm.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: dcload/dcload-serial/target-src/1st_read/crt0.S ___________________________________________________________________ Name: svn:eol-style + native Property changes on: dcload/dcload-serial/target-src/1st_read/dc.x ___________________________________________________________________ Name: svn:eol-style + native Property changes on: dcload/dcload-serial/target-src/1st_read/disable.s ___________________________________________________________________ Name: svn:eol-style + native Property changes on: dcload/dcload-serial/target-src/1st_read/memcmp.c ___________________________________________________________________ Name: svn:eol-style + native Property changes on: dcload/dcload-serial/target-src/1st_read/memcpy.S ___________________________________________________________________ Name: svn:eol-style + native Property changes on: dcload/dcload-serial/target-src/1st_read/memmove.c ___________________________________________________________________ Name: svn:eol-style + native Property changes on: dcload/dcload-serial/target-src/1st_read/memset.S ___________________________________________________________________ Name: svn:eol-style + native Property changes on: dcload/dcload-serial/target-src/Makefile ___________________________________________________________________ Name: svn:eol-style + native Property changes on: dcload/dcload-serial/target-src/dcload/Makefile ___________________________________________________________________ Name: svn:eol-style + native Property changes on: dcload/dcload-serial/target-src/dcload/asm.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: dcload/dcload-serial/target-src/dcload/cdfs_redir.s ___________________________________________________________________ Name: svn:eol-style + native Property changes on: dcload/dcload-serial/target-src/dcload/cdfs_syscalls.c ___________________________________________________________________ Name: svn:eol-style + native Property changes on: dcload/dcload-serial/target-src/dcload/dcload-crt0.s ___________________________________________________________________ Name: svn:eol-style + native Property changes on: dcload/dcload-serial/target-src/dcload/dcload.c ___________________________________________________________________ Name: svn:eol-style + native Property changes on: dcload/dcload-serial/target-src/dcload/dcload.x ___________________________________________________________________ Name: svn:eol-style + native Property changes on: dcload/dcload-serial/target-src/dcload/disable.s ___________________________________________________________________ Name: svn:eol-style + native Property changes on: dcload/dcload-serial/target-src/dcload/exception.s ___________________________________________________________________ Name: svn:eol-style + native Property changes on: dcload/dcload-serial/target-src/dcload/go.s ___________________________________________________________________ Name: svn:eol-style + native Property changes on: dcload/dcload-serial/target-src/dcload/memcmp.c ___________________________________________________________________ Name: svn:eol-style + native Property changes on: dcload/dcload-serial/target-src/dcload/memcpy.S ___________________________________________________________________ Name: svn:eol-style + native Property changes on: dcload/dcload-serial/target-src/dcload/memmove.c ___________________________________________________________________ Name: svn:eol-style + native Property changes on: dcload/dcload-serial/target-src/dcload/memset.S ___________________________________________________________________ Name: svn:eol-style + native Property changes on: dcload/dcload-serial/target-src/dcload/scif.c ___________________________________________________________________ Name: svn:eol-style + native Property changes on: dcload/dcload-serial/target-src/dcload/scif.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: dcload/dcload-serial/target-src/dcload/syscalls.c ___________________________________________________________________ Name: svn:eol-style + native Property changes on: dcload/dcload-serial/target-src/dcload/video.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: dcload/dcload-serial/target-src/dcload/video.s ___________________________________________________________________ Name: svn:eol-style + native This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <c99...@us...> - 2008-01-27 01:30:39
|
Revision: 555 http://cadcdev.svn.sourceforge.net/cadcdev/?rev=555&view=rev Author: c99koder Date: 2008-01-26 17:30:37 -0800 (Sat, 26 Jan 2008) Log Message: ----------- Fix a few problems with r554 Modified Paths: -------------- dcload/dcload-ip/host-src/tool/dc-tool.c dcload/dcload-serial/host-src/tool/dc-tool.c Modified: dcload/dcload-ip/host-src/tool/dc-tool.c =================================================================== --- dcload/dcload-ip/host-src/tool/dc-tool.c 2008-01-26 19:54:59 UTC (rev 554) +++ dcload/dcload-ip/host-src/tool/dc-tool.c 2008-01-27 01:30:37 UTC (rev 555) @@ -574,7 +574,7 @@ perror(isofile); } -#ifndef __MINGW32__ +#ifndef __MINGW32__ if (path) if (chroot(path)) perror(path); Modified: dcload/dcload-serial/host-src/tool/dc-tool.c =================================================================== --- dcload/dcload-serial/host-src/tool/dc-tool.c 2008-01-26 19:54:59 UTC (rev 554) +++ dcload/dcload-serial/host-src/tool/dc-tool.c 2008-01-27 01:30:37 UTC (rev 555) @@ -38,8 +38,8 @@ #include <winsock.h> #else #include <arpa/inet.h> +#include <sys/socket.h> #endif -#include <sys/socket.h> #include "minilzo.h" #include "syscalls.h" #include "dc-io.h" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <at...@us...> - 2008-01-26 19:55:01
|
Revision: 554 http://cadcdev.svn.sourceforge.net/cadcdev/?rev=554&view=rev Author: atani Date: 2008-01-26 11:54:59 -0800 (Sat, 26 Jan 2008) Log Message: ----------- fixed libs3m library location, applied MinGW patches for dctool Modified Paths: -------------- dcload/dcload-ip/Makefile.cfg dcload/dcload-ip/host-src/tool/dc-tool.c dcload/dcload-ip/host-src/tool/syscalls.c dcload/dcload-serial/Makefile.cfg dcload/dcload-serial/host-src/tool/dc-tool.c dcload/dcload-serial/host-src/tool/syscalls.c kos-ports/libs3m/Makefile Modified: dcload/dcload-ip/Makefile.cfg =================================================================== --- dcload/dcload-ip/Makefile.cfg 2007-12-20 00:20:54 UTC (rev 553) +++ dcload/dcload-ip/Makefile.cfg 2008-01-26 19:54:59 UTC (rev 554) @@ -16,6 +16,11 @@ #BFDLIB = -L/usr/local/lib -lbfd -liberty -lintl #BFDINCLUDE = /usr/local/include +# MinGW +# these must point to your sh-elf bfd, not the system one +#BFDLIB = -L/usr/local/lib -lbfd -liberty -lws2_32 -lwsock32 +#BFDINCLUDE = /usr/local/include + # sh-elf-stuff TARGETCC = sh-elf-gcc TARGETCFLAGS = -O2 -ml -m4-single-only Modified: dcload/dcload-ip/host-src/tool/dc-tool.c =================================================================== --- dcload/dcload-ip/host-src/tool/dc-tool.c 2007-12-20 00:20:54 UTC (rev 553) +++ dcload/dcload-ip/host-src/tool/dc-tool.c 2008-01-26 19:54:59 UTC (rev 554) @@ -35,10 +35,15 @@ #include <unistd.h> #include <utime.h> #endif +#ifdef __MINGW32__ +#include <winsock2.h> +#include <ws2tcpip.h> +#else #include <arpa/inet.h> #include <sys/socket.h> #include <netinet/in.h> #include <netdb.h> +#endif #include "syscalls.h" #include "dc-io.h" @@ -350,7 +355,9 @@ printf("-t <ip> Communicate with <ip> (default is: %s)\n",DREAMCAST_IP); printf("-n Do not attach console and fileserver\n"); printf("-q Do not clear screen before download\n"); +#ifndef __MINGW32__ printf("-c <path> Chroot to <path> (must be super-user)\n"); +#endif printf("-i <isofile> Enable cdfs redirection using iso image <isofile>\n"); printf("-r Reset (only works when dcload is in control)\n"); printf("-g Start a GDB server\n"); @@ -388,7 +395,12 @@ return -1; } +#ifdef __MINGW32__ + unsigned long flags = 1; + ioctlsocket(dcsocket, FIONBIO, &flags); +#else fcntl(dcsocket, F_SETFL, O_NONBLOCK); +#endif } int recv_response(unsigned char *buffer, int timeout) @@ -561,10 +573,12 @@ if (isofd < 0) perror(isofile); } - + +#ifndef __MINGW32__ if (path) if (chroot(path)) perror(path); +#endif while (1) { fflush(stdout); @@ -657,7 +671,11 @@ if (argc < 2) usage(); +#ifdef __MINGW32__ + someopt = getopt(argc, argv, "x:u:d:a:s:t:i:npqhrg"); +#else someopt = getopt(argc, argv, "x:u:d:a:s:t:c:i:npqhrg"); +#endif while (someopt > 0) { switch (someopt) { case 'x': @@ -687,10 +705,12 @@ filename = malloc(strlen(optarg) + 1); strcpy(filename, optarg); break; +#ifndef __MINGW32__ case 'c': path = malloc(strlen(optarg) + 1); strcpy(path, optarg); break; +#endif case 'i': cdfs_redir = 1; isofile = malloc(strlen(optarg) + 1); @@ -729,7 +749,11 @@ default: break; } +#ifdef __MINGW32__ + someopt = getopt(argc, argv, "x:u:d:a:s:t:i:nqhr"); +#else someopt = getopt(argc, argv, "x:u:d:a:s:t:c:i:nqhr"); +#endif } if (cdfs_redir & (!console)) @@ -741,8 +765,10 @@ if (quiet) printf("Quiet download\n"); +#ifndef __MINGW32__ if (path) printf("Chroot enabled\n"); +#endif if (cdfs_redir & command=='x') printf("Cdfs redirection enabled\n"); Modified: dcload/dcload-ip/host-src/tool/syscalls.c =================================================================== --- dcload/dcload-ip/host-src/tool/syscalls.c 2007-12-20 00:20:54 UTC (rev 553) +++ dcload/dcload-ip/host-src/tool/syscalls.c 2008-01-26 19:54:59 UTC (rev 554) @@ -28,6 +28,9 @@ #include <unistd.h> #include <utime.h> #include <dirent.h> +#ifdef __MINGW32__ +#include <windows.h> +#endif #include "syscalls.h" #include "dc-io.h" #include "dcload-types.h" @@ -71,8 +74,10 @@ dcstat.st_gid = dc_order(filestat.st_gid); dcstat.st_rdev = dc_order(filestat.st_rdev); dcstat.st_size = dc_order(filestat.st_size); +#ifndef __MINGW32__ dcstat.st_blksize = dc_order(filestat.st_blksize); dcstat.st_blocks = dc_order(filestat.st_blocks); +#endif dcstat.st_atime_priv = dc_order(filestat.st_atime); dcstat.st_mtime_priv = dc_order(filestat.st_mtime); dcstat.st_ctime_priv = dc_order(filestat.st_ctime); @@ -178,7 +183,12 @@ pathname1 = command->string; pathname2 = &command->string[strlen(command->string)+1]; +#ifdef __MINGW32__ + /* Copy the file on Windows */ + retval = CopyFileA(pathname1, pathname2, 0); +#else retval = link(pathname1, pathname2); +#endif send_command(CMD_RETVAL, retval, retval, NULL, 0); } @@ -252,8 +262,10 @@ dcstat.st_gid = dc_order(filestat.st_gid); dcstat.st_rdev = dc_order(filestat.st_rdev); dcstat.st_size = dc_order(filestat.st_size); +#ifndef __MINGW32__ dcstat.st_blksize = dc_order(filestat.st_blksize); dcstat.st_blocks = dc_order(filestat.st_blocks); +#endif dcstat.st_atime_priv = dc_order(filestat.st_atime); dcstat.st_mtime_priv = dc_order(filestat.st_mtime); dcstat.st_ctime_priv = dc_order(filestat.st_ctime); Modified: dcload/dcload-serial/Makefile.cfg =================================================================== --- dcload/dcload-serial/Makefile.cfg 2007-12-20 00:20:54 UTC (rev 553) +++ dcload/dcload-serial/Makefile.cfg 2008-01-26 19:54:59 UTC (rev 554) @@ -26,6 +26,11 @@ #BFDLIB = -L$(TARGETPREFIX)/lib -lbfd -liberty -lintl #BFDINCLUDE = $(TARGETPREFIX)/include +# MinGW +# these must point to your sh-elf bfd, not the system one +#BFDLIB = -L$(TARGETPREFIX)/lib -lbfd -liberty -lwsock32 +#BFDINCLUDE = $(TARGETPREFIX)/include + # sh-elf-stuff # if your compiler doesn't have a -m2 target, you can probably replace # it with -m4-single-only and be ok, but -m2 is less problematic. @@ -46,7 +51,7 @@ # port each time. #SERIALDEVICE = /dev/cu.usbserial-5B24 -# cygwin +# cygwin & MinGW #SERIALDEVICE = COM1 # dir to install dc-tool in Modified: dcload/dcload-serial/host-src/tool/dc-tool.c =================================================================== --- dcload/dcload-serial/host-src/tool/dc-tool.c 2007-12-20 00:20:54 UTC (rev 553) +++ dcload/dcload-serial/host-src/tool/dc-tool.c 2008-01-26 19:54:59 UTC (rev 554) @@ -34,7 +34,11 @@ #include <sys/time.h> #include <unistd.h> #include <utime.h> +#ifdef __MINGW32__ +#include <winsock.h> +#else #include <arpa/inet.h> +#endif #include <sys/socket.h> #include "minilzo.h" #include "syscalls.h" @@ -669,7 +673,9 @@ printf("-n Do not attach console and fileserver\n"); printf("-p Use dumb terminal rather than console/fileserver\n"); printf("-q Do not clear screen before download\n"); +#ifndef __MINGW32__ printf("-c <path> Chroot to <path> (must be super-user)\n"); +#endif printf("-i <isofile> Enable cdfs redirection using iso image <isofile>\n"); printf("-g Start a GDB server\n"); printf("-h Usage information (you\'re looking at it)\n\n"); @@ -850,11 +856,12 @@ perror(isofile); } +#ifndef __MINGW32__ if (path) if (chroot(path)) perror(path); +#endif - while (1) { fflush(stdout); serial_read(&command, 1); @@ -976,7 +983,11 @@ if (argc < 2) usage(); +#ifdef __MINGW32__ + someopt = getopt(argc, argv, "x:u:d:a:s:t:b:i:npqheEg"); +#else someopt = getopt(argc, argv, "x:u:d:a:s:t:b:c:i:npqheEg"); +#endif while (someopt > 0) { switch (someopt) { case 'x': @@ -1006,10 +1017,12 @@ filename = malloc(strlen(optarg) + 1); strcpy(filename, optarg); break; +#ifndef __MINGW32__ case 'c': path = malloc(strlen(optarg) + 1); strcpy(path, optarg); break; +#endif case 'i': cdfs_redir = 1; isofile = malloc(strlen(optarg) + 1); @@ -1054,7 +1067,11 @@ default: break; } +#ifdef __MINGW32__ + someopt = getopt(argc, argv, "x:u:d:a:s:t:b:i:npqhe"); +#else someopt = getopt(argc, argv, "x:u:d:a:s:t:b:c:i:npqhe"); +#endif } if ((command == 'x') || (command == 'u')) { @@ -1074,8 +1091,10 @@ if (quiet) printf("Quiet download\n"); +#ifndef __MINGW32__ if (path) printf("Chroot enabled\n"); +#endif if (cdfs_redir) printf("Cdfs redirection enabled\n"); Modified: dcload/dcload-serial/host-src/tool/syscalls.c =================================================================== --- dcload/dcload-serial/host-src/tool/syscalls.c 2007-12-20 00:20:54 UTC (rev 553) +++ dcload/dcload-serial/host-src/tool/syscalls.c 2008-01-26 19:54:59 UTC (rev 554) @@ -28,7 +28,11 @@ #include <unistd.h> #include <utime.h> #include <dirent.h> +#ifdef __MINGW32__ +#include <winsock2.h> +#else #include <arpa/inet.h> +#endif #include "syscalls.h" #include "dc-io.h" @@ -54,8 +58,13 @@ send_uint(filestat.st_gid); send_uint(filestat.st_rdev); send_uint(filestat.st_size); +#ifdef __MINGW32__ + send_uint(0); + send_uint(0); +#else send_uint(filestat.st_blksize); send_uint(filestat.st_blocks); +#endif send_uint(filestat.st_atime); send_uint(filestat.st_mtime); send_uint(filestat.st_ctime); @@ -195,7 +204,12 @@ recv_data(pathname2, namelen2, 0); +#ifdef __MINGW32__ + /* Copy the file on Windows */ + retval = CopyFileA(pathname1, pathname2, 0); +#else retval = link(pathname1, pathname2); +#endif send_uint(retval); @@ -311,8 +325,13 @@ send_uint(filestat.st_gid); send_uint(filestat.st_rdev); send_uint(filestat.st_size); +#ifdef __MINGW32__ + send_uint(0); + send_uint(0); +#else send_uint(filestat.st_blksize); send_uint(filestat.st_blocks); +#endif send_uint(filestat.st_atime); send_uint(filestat.st_mtime); send_uint(filestat.st_ctime); Modified: kos-ports/libs3m/Makefile =================================================================== --- kos-ports/libs3m/Makefile 2007-12-20 00:20:54 UTC (rev 553) +++ kos-ports/libs3m/Makefile 2008-01-26 19:54:59 UTC (rev 554) @@ -5,15 +5,10 @@ # # $Id: Makefile,v 1.1.1.1 2001/09/26 07:05:09 bardtx Exp $ +TARGET = libs3m.a OBJS = sfxmgr.o SUBDIRS = -KOS_LOCAL_CFLAGS = -I$(KOS_BASE)/include/s3m +include $(KOS_BASE)/addons/Makefile.prefab -myall: $(OBJS) - rm -f $(KOS_BASE)/lib/libs3m.a - $(KOS_AR) rcs $(KOS_BASE)/lib/libs3m.a $(OBJS) -include $(KOS_BASE)/Makefile.prefab - - This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: Cyle T. <cyl...@gm...> - 2008-01-26 05:06:15
|
This patch changes the old lib path directory to the new. |
From: <at...@us...> - 2007-12-20 00:20:58
|
Revision: 553 http://cadcdev.svn.sourceforge.net/cadcdev/?rev=553&view=rev Author: atani Date: 2007-12-19 16:20:54 -0800 (Wed, 19 Dec 2007) Log Message: ----------- apply patch to use fnmatch.h for CYGWIN. Modified Paths: -------------- kos/utils/genromfs/genromfs.c Modified: kos/utils/genromfs/genromfs.c =================================================================== --- kos/utils/genromfs/genromfs.c 2007-12-13 19:35:40 UTC (rev 552) +++ kos/utils/genromfs/genromfs.c 2007-12-20 00:20:54 UTC (rev 553) @@ -71,7 +71,7 @@ #include <unistd.h> /* Userland prototypes of the Unix std system calls */ #include <fcntl.h> /* Flag value for file handling functions */ #include <time.h> -#ifdef _WIN32 +#if defined(_WIN32) && !defined(__CYGWIN__) # include <getopt.h> #else # include <fnmatch.h> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ljs...@us...> - 2007-12-13 19:35:45
|
Revision: 552 http://cadcdev.svn.sourceforge.net/cadcdev/?rev=552&view=rev Author: ljsebald Date: 2007-12-13 11:35:40 -0800 (Thu, 13 Dec 2007) Log Message: ----------- Changed what was /// comments (that got changed to /* ... */ in r551) to /** ... */ comments. Modified Paths: -------------- kos/include/kos/dbgio.h Modified: kos/include/kos/dbgio.h =================================================================== --- kos/include/kos/dbgio.h 2007-12-12 01:12:25 UTC (rev 551) +++ kos/include/kos/dbgio.h 2007-12-13 19:35:40 UTC (rev 552) @@ -15,46 +15,46 @@ #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; @@ -65,57 +65,57 @@ /* 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 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
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. |
From: <at...@us...> - 2007-11-24 05:20:50
|
Revision: 550 http://cadcdev.svn.sourceforge.net/cadcdev/?rev=550&view=rev Author: atani Date: 2007-11-23 21:20:47 -0800 (Fri, 23 Nov 2007) Log Message: ----------- * version number support * fix include paths for gui stuff Modified Paths: -------------- tiki/dc/Makefile tiki/include/Tiki/tiki.h tiki/nds/Makefile tiki/osx/English.lproj/InfoPlist.strings tiki/osx/Tiki.xcodeproj/project.pbxproj tiki/sdl/Makefile tiki/src/gui/button.cpp tiki/src/gui/graphic.cpp tiki/src/gui/radiobutton.cpp tiki/src/gui/spinner.cpp tiki/src/gui/text.cpp tiki/src/gui/widget.cpp tiki/src/gui/window.cpp tiki/src/net/http/useragent.cpp tiki/win32/tiki.vcproj Added Paths: ----------- tiki/osx/Info.plist.in tiki/src/base/version.cpp.in Removed Paths: ------------- tiki/osx/Info.plist tiki/src/gui/widget.h Property Changed: ---------------- tiki/src/base/ Modified: tiki/dc/Makefile =================================================================== --- tiki/dc/Makefile 2007-11-22 15:52:45 UTC (rev 549) +++ tiki/dc/Makefile 2007-11-24 05:20:47 UTC (rev 550) @@ -1,5 +1,6 @@ BASE_AUDIO_OBJ=$(patsubst %.cpp,%.o,$(wildcard ../src/audio/oggvorbis/*.cpp)) BASE_BASE_OBJ=$(patsubst %.cpp,%.o,$(wildcard ../src/base/*.cpp)) +BASE_BASE_OBJ+= ../src/base/version.o BASE_GL_OBJ=$(patsubst %.cpp,%.o,$(wildcard ../src/gl/*.cpp)) BASE_GL_OBJ+=$(patsubst %.cpp,%.o,$(wildcard ../src/gl/anims/*.cpp)) BASE_GL_OBJ+=$(patsubst %.cpp,%.o,$(wildcard ../src/gl/drawables/*.cpp)) @@ -21,7 +22,7 @@ $(KOS_AR) ru libtiki.a $(BASE_OBJS) clean: clean_subdirs - -rm -f $(BASE_OBJS) libtiki.a + -rm -f $(BASE_OBJS) libtiki.a ../src/base/version.cpp $(MAKE) TIKI_PLAT=dc -C$(CURDIR)/../examples clean examples: @@ -42,4 +43,7 @@ zip -9r ../tiki-$(SVN_VERSION)-dc.zip Library Samples rm -rf ../dist/$(SVN_VERSION)/tmp +../src/base/version.cpp: ../src/base/version.cpp.in + sed "s/\$$WCREV\\$$/`svnversion .`/" < ../src/base/version.cpp.in > ../src/base/version.cpp + include Makefile.rules Modified: tiki/include/Tiki/tiki.h =================================================================== --- tiki/include/Tiki/tiki.h 2007-11-22 15:52:45 UTC (rev 549) +++ tiki/include/Tiki/tiki.h 2007-11-24 05:20:47 UTC (rev 550) @@ -44,6 +44,9 @@ // Bring STL string into the namespace. using std::string; + const string getVersion(); + const string getPlatformName(); + // Global init/shutdown functions. bool init( int argc, char **argv ); void shutdown(); Modified: tiki/nds/Makefile =================================================================== --- tiki/nds/Makefile 2007-11-22 15:52:45 UTC (rev 549) +++ tiki/nds/Makefile 2007-11-24 05:20:47 UTC (rev 550) @@ -2,6 +2,7 @@ # BASE_AUDIO_OBJ=$(patsubst %.cpp,%.o,$(wildcard ../src/audio/*.cpp)) BASE_AUDIO_OBJ=$(patsubst %.cpp,%.o,$(wildcard ../src/audio/oggvorbis/*.cpp)) BASE_BASE_OBJ=$(patsubst %.cpp,%.o,$(wildcard ../src/base/*.cpp)) +BASE_BASE_OBJ+=../src/base/version.o BASE_GL_OBJ=$(patsubst %.cpp,%.o,$(wildcard ../src/gl/*.cpp)) BASE_GL_OBJ+=$(patsubst %.cpp,%.o,$(wildcard ../src/gl/anims/*.cpp)) BASE_GL_OBJ+=$(patsubst %.cpp,%.o,$(wildcard ../src/gl/drawables/*.cpp)) @@ -56,7 +57,7 @@ $(AR) ru libtiki.a $(BASE_OBJS) $(THIRD_PARTY_OBJS) clean: clean_subdirs - -rm -f $(BASE_OBJS) $(THIRD_PARTY_OBJS) libtiki.a + -rm -f $(BASE_OBJS) $(THIRD_PARTY_OBJS) libtiki.a ../src/base/version.cpp $(MAKE) -C tikiarm7 clean TOPDIR=$(CURDIR) $(MAKE) TIKI_PLAT=nds -C$(CURDIR)/../examples clean @@ -86,5 +87,8 @@ zip -9r ../tiki-$(SVN_VERSION)-nds.zip Library Samples rm -rf ../dist/$(SVN_VERSION)/tmp +../src/base/version.cpp: ../src/base/version.cpp.in + sed "s/\$$WCREV\\$$/`svnversion .`/" < ../src/base/version.cpp.in > ../src/base/version.cpp + DEPSDIR=$(CURDIR) include Makefile.rules Modified: tiki/osx/English.lproj/InfoPlist.strings =================================================================== (Binary files differ) Deleted: tiki/osx/Info.plist =================================================================== --- tiki/osx/Info.plist 2007-11-22 15:52:45 UTC (rev 549) +++ tiki/osx/Info.plist 2007-11-24 05:20:47 UTC (rev 550) @@ -1,24 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> -<plist version="1.0"> -<dict> - <key>CFBundleDevelopmentRegion</key> - <string>English</string> - <key>CFBundleExecutable</key> - <string>Tiki</string> - <key>CFBundleIconFile</key> - <string></string> - <key>CFBundleIdentifier</key> - <string>com.cagames.Tiki</string> - <key>CFBundleInfoDictionaryVersion</key> - <string>6.0</string> - <key>CFBundlePackageType</key> - <string>FMWK</string> - <key>CFBundleSignature</key> - <string>????</string> - <key>CFBundleVersion</key> - <string>1.0</string> - <key>NSPrincipalClass</key> - <string></string> -</dict> -</plist> Copied: tiki/osx/Info.plist.in (from rev 549, tiki/osx/Info.plist) =================================================================== --- tiki/osx/Info.plist.in (rev 0) +++ tiki/osx/Info.plist.in 2007-11-24 05:20:47 UTC (rev 550) @@ -0,0 +1,24 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> +<plist version="1.0"> +<dict> + <key>CFBundleDevelopmentRegion</key> + <string>English</string> + <key>CFBundleExecutable</key> + <string>Tiki</string> + <key>CFBundleIconFile</key> + <string></string> + <key>CFBundleIdentifier</key> + <string>com.cagames.Tiki</string> + <key>CFBundleInfoDictionaryVersion</key> + <string>6.0</string> + <key>CFBundlePackageType</key> + <string>FMWK</string> + <key>CFBundleSignature</key> + <string>????</string> + <key>CFBundleVersion</key> + <string>0.0.$WCREV$</string> + <key>NSPrincipalClass</key> + <string></string> +</dict> +</plist> Modified: tiki/osx/Tiki.xcodeproj/project.pbxproj =================================================================== --- tiki/osx/Tiki.xcodeproj/project.pbxproj 2007-11-22 15:52:45 UTC (rev 549) +++ tiki/osx/Tiki.xcodeproj/project.pbxproj 2007-11-24 05:20:47 UTC (rev 550) @@ -8,40 +8,25 @@ /* Begin PBXBuildFile section */ 223226810A165A600035025E /* console.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 223226800A165A600035025E /* console.cpp */; }; - 223226830A165A7A0035025E /* console.h in Headers */ = {isa = PBXBuildFile; fileRef = 223226820A165A7A0035025E /* console.h */; }; 2290A0FD09302D7500B7D80C /* cursor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2290A0FB09302D7500B7D80C /* cursor.cpp */; }; 2290A0FE09302D7500B7D80C /* pointerArrow.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2290A0FC09302D7500B7D80C /* pointerArrow.cpp */; }; - 2290A10109302D9F00B7D80C /* cursor.h in Headers */ = {isa = PBXBuildFile; fileRef = 2290A0FF09302D9F00B7D80C /* cursor.h */; }; - 2290A10209302D9F00B7D80C /* pointerArrow.h in Headers */ = {isa = PBXBuildFile; fileRef = 2290A10009302D9F00B7D80C /* pointerArrow.h */; }; 6400608E0CDF9DC800969916 /* init_flags_default.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6400608D0CDF9DC800969916 /* init_flags_default.cpp */; }; - 6406D0440CF3C737002D832F /* button.h in Headers */ = {isa = PBXBuildFile; fileRef = 6406D0430CF3C737002D832F /* button.h */; }; 6406D04D0CF3CBEC002D832F /* widget.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6406D04B0CF3CBEC002D832F /* widget.cpp */; }; 6406D0540CF3CDF6002D832F /* button.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6406D0530CF3CDF6002D832F /* button.cpp */; }; - 640C2C30092EB8C40032DE40 /* alpharotate.h in Headers */ = {isa = PBXBuildFile; fileRef = 640C2C2F092EB8C40032DE40 /* alpharotate.h */; }; - 642E949A0CF54A780005C8A5 /* radiobutton.h in Headers */ = {isa = PBXBuildFile; fileRef = 642E94990CF54A780005C8A5 /* radiobutton.h */; }; - 642E949E0CF54B550005C8A5 /* window.h in Headers */ = {isa = PBXBuildFile; fileRef = 642E949D0CF54B550005C8A5 /* window.h */; }; 642E94AE0CF54DB90005C8A5 /* radiobutton.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 642E94AD0CF54DB90005C8A5 /* radiobutton.cpp */; }; 642E94D00CF54EF10005C8A5 /* window.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 642E94CF0CF54EF10005C8A5 /* window.cpp */; }; 642E94E50CF54FF20005C8A5 /* text.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 642E94E40CF54FF20005C8A5 /* text.cpp */; }; 642E94E80CF5501D0005C8A5 /* graphic.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 642E94E70CF5501D0005C8A5 /* graphic.cpp */; }; - 642E95860CF561D20005C8A5 /* spinner.h in Headers */ = {isa = PBXBuildFile; fileRef = 642E95850CF561D20005C8A5 /* spinner.h */; }; 642E958B0CF5642F0005C8A5 /* spinner.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 642E958A0CF5642F0005C8A5 /* spinner.cpp */; }; 6444BEE60932A3D800A29768 /* texturetile.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6444BEE50932A3D700A29768 /* texturetile.cpp */; }; - 6444BEE80932A3F200A29768 /* texturetile.h in Headers */ = {isa = PBXBuildFile; fileRef = 6444BEE70932A3F200A29768 /* texturetile.h */; }; 644D23550CDFE82D00E7F291 /* lightbarmenu.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 644D23540CDFE82D00E7F291 /* lightbarmenu.cpp */; }; - 644D23570CDFE83C00E7F291 /* lightbarmenu.h in Headers */ = {isa = PBXBuildFile; fileRef = 644D23560CDFE83C00E7F291 /* lightbarmenu.h */; }; - 64618A5B0CEBE9A000881556 /* widget.h in Headers */ = {isa = PBXBuildFile; fileRef = 64618A5A0CEBE9A000881556 /* widget.h */; }; 6499FE6A0C862377008D9FEF /* tinyxml.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6499FE660C862377008D9FEF /* tinyxml.cpp */; }; - 6499FE6B0C862377008D9FEF /* tinyxml.h in Headers */ = {isa = PBXBuildFile; fileRef = 6499FE670C862377008D9FEF /* tinyxml.h */; }; 6499FE6C0C862377008D9FEF /* tinyxmlerror.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6499FE680C862377008D9FEF /* tinyxmlerror.cpp */; }; 6499FE6D0C862377008D9FEF /* tinyxmlparser.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6499FE690C862377008D9FEF /* tinyxmlparser.cpp */; }; 6499FE710C8623A3008D9FEF /* base64.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6499FE6F0C8623A3008D9FEF /* base64.cpp */; }; 6499FE720C8623A3008D9FEF /* date.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6499FE700C8623A3008D9FEF /* date.cpp */; }; - 6499FE760C8623D6008D9FEF /* base64.h in Headers */ = {isa = PBXBuildFile; fileRef = 6499FE740C8623D6008D9FEF /* base64.h */; }; - 6499FE770C8623D6008D9FEF /* date.h in Headers */ = {isa = PBXBuildFile; fileRef = 6499FE750C8623D6008D9FEF /* date.h */; }; - 6499FEA40C8640CA008D9FEF /* cookiejar.h in Headers */ = {isa = PBXBuildFile; fileRef = 6499FEA30C8640CA008D9FEF /* cookiejar.h */; }; 6499FEA60C8640E5008D9FEF /* cookiejar.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6499FEA50C8640E5008D9FEF /* cookiejar.cpp */; }; - 64D758F4092EB9A5002667EE /* sleep.h in Headers */ = {isa = PBXBuildFile; fileRef = 64D758F3092EB9A5002667EE /* sleep.h */; }; + 649CF73E0CF7E00400CC8D65 /* version.cpp.in in Sources */ = {isa = PBXBuildFile; fileRef = 649CF73D0CF7E00400CC8D65 /* version.cpp.in */; }; 64ED75F50C7CFAE500D16D5C /* address.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 64ED75F10C7CFAE500D16D5C /* address.cpp */; }; 64ED75F60C7CFAE500D16D5C /* socket.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 64ED75F20C7CFAE500D16D5C /* socket.cpp */; }; 64ED75F70C7CFAE500D16D5C /* tcpserversocket.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 64ED75F30C7CFAE500D16D5C /* tcpserversocket.cpp */; }; @@ -49,22 +34,7 @@ 64ED75FD0C7CFB1800D16D5C /* request.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 64ED75FA0C7CFB1800D16D5C /* request.cpp */; }; 64ED75FE0C7CFB1800D16D5C /* response.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 64ED75FB0C7CFB1800D16D5C /* response.cpp */; }; 64ED75FF0C7CFB1800D16D5C /* useragent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 64ED75FC0C7CFB1800D16D5C /* useragent.cpp */; }; - 64ED76190C7CFB4C00D16D5C /* address.h in Headers */ = {isa = PBXBuildFile; fileRef = 64ED76130C7CFB4C00D16D5C /* address.h */; }; - 64ED761A0C7CFB4C00D16D5C /* buffer.h in Headers */ = {isa = PBXBuildFile; fileRef = 64ED76140C7CFB4C00D16D5C /* buffer.h */; }; - 64ED761B0C7CFB4C00D16D5C /* socket.h in Headers */ = {isa = PBXBuildFile; fileRef = 64ED76150C7CFB4C00D16D5C /* socket.h */; }; - 64ED761C0C7CFB4C00D16D5C /* tcpserversocket.h in Headers */ = {isa = PBXBuildFile; fileRef = 64ED76160C7CFB4C00D16D5C /* tcpserversocket.h */; }; - 64ED761D0C7CFB4C00D16D5C /* tcpsocket.h in Headers */ = {isa = PBXBuildFile; fileRef = 64ED76170C7CFB4C00D16D5C /* tcpsocket.h */; }; - 64ED761E0C7CFB4C00D16D5C /* udpsocket.h in Headers */ = {isa = PBXBuildFile; fileRef = 64ED76180C7CFB4C00D16D5C /* udpsocket.h */; }; - 64ED76230C7CFB6200D16D5C /* cookie.h in Headers */ = {isa = PBXBuildFile; fileRef = 64ED761F0C7CFB6200D16D5C /* cookie.h */; }; - 64ED76240C7CFB6200D16D5C /* request.h in Headers */ = {isa = PBXBuildFile; fileRef = 64ED76200C7CFB6200D16D5C /* request.h */; }; - 64ED76250C7CFB6200D16D5C /* response.h in Headers */ = {isa = PBXBuildFile; fileRef = 64ED76210C7CFB6200D16D5C /* response.h */; }; - 64ED76260C7CFB6200D16D5C /* useragent.h in Headers */ = {isa = PBXBuildFile; fileRef = 64ED76220C7CFB6200D16D5C /* useragent.h */; }; - 64ED76290C7CFB7E00D16D5C /* endian.h in Headers */ = {isa = PBXBuildFile; fileRef = 64ED76270C7CFB7E00D16D5C /* endian.h */; }; - 64ED762A0C7CFB7E00D16D5C /* net.h in Headers */ = {isa = PBXBuildFile; fileRef = 64ED76280C7CFB7E00D16D5C /* net.h */; }; 64ED762C0C7CFB9400D16D5C /* platnet.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 64ED762B0C7CFB9400D16D5C /* platnet.cpp */; }; - 64ED762E0C7CFBA100D16D5C /* platnet.h in Headers */ = {isa = PBXBuildFile; fileRef = 64ED762D0C7CFBA100D16D5C /* platnet.h */; }; - 64F19E9A0CF5391F0093AEAD /* text.h in Headers */ = {isa = PBXBuildFile; fileRef = 64F19E990CF5391F0093AEAD /* text.h */; }; - 64F19ECB0CF53D740093AEAD /* graphic.h in Headers */ = {isa = PBXBuildFile; fileRef = 64F19ECA0CF53D740093AEAD /* graphic.h */; }; 8DC2EF530486A6940098B216 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 089C1666FE841158C02AAC07 /* InfoPlist.strings */; }; 8DC2EF570486A6940098B216 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7B1FEA5585E11CA2CBB /* Cocoa.framework */; }; C4287F7C07C9491100D238E1 /* image.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C4287F7B07C9491100D238E1 /* image.cpp */; }; @@ -176,7 +146,6 @@ C4B1829D0856B2E600B46BDA /* vorbisfile.c in Sources */ = {isa = PBXBuildFile; fileRef = C4B182860856B2E600B46BDA /* vorbisfile.c */; }; C4B1829E0856B2E600B46BDA /* window.c in Sources */ = {isa = PBXBuildFile; fileRef = C4B182870856B2E600B46BDA /* window.c */; }; C4B5838D0794CFC7004D22F2 /* init_shutdown.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C4B5838C0794CFC7004D22F2 /* init_shutdown.cpp */; }; - C4EAEB2008678F1F003F5342 /* TikiAll.h in Headers */ = {isa = PBXBuildFile; fileRef = C4EAEB1F08678F1F003F5342 /* TikiAll.h */; settings = {ATTRIBUTES = (Private, ); }; }; C4ED4B98079CE776006E3DF0 /* sndoggvorbis.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C4ED4B97079CE776006E3DF0 /* sndoggvorbis.cpp */; }; C4F5148E0799FBA10001D0D0 /* endian.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C4F5148D0799FBA10001D0D0 /* endian.cpp */; }; C4F514AE079A02AE0001D0D0 /* AudioUnit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C4F514AC079A02AE0001D0D0 /* AudioUnit.framework */; }; @@ -255,6 +224,7 @@ 6499FE750C8623D6008D9FEF /* date.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = date.h; path = ../include/Tiki/net/util/date.h; sourceTree = SOURCE_ROOT; }; 6499FEA30C8640CA008D9FEF /* cookiejar.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = cookiejar.h; path = ../include/Tiki/net/http/cookiejar.h; sourceTree = SOURCE_ROOT; }; 6499FEA50C8640E5008D9FEF /* cookiejar.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = cookiejar.cpp; path = ../src/net/http/cookiejar.cpp; sourceTree = SOURCE_ROOT; }; + 649CF73D0CF7E00400CC8D65 /* version.cpp.in */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.cpp; fileEncoding = 4; path = version.cpp.in; sourceTree = "<group>"; }; 64D758F3092EB9A5002667EE /* sleep.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = sleep.h; path = ../include/Tiki/anims/sleep.h; sourceTree = SOURCE_ROOT; }; 64ED75F10C7CFAE500D16D5C /* address.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = address.cpp; path = ../src/net/address.cpp; sourceTree = SOURCE_ROOT; }; 64ED75F20C7CFAE500D16D5C /* socket.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = socket.cpp; path = ../src/net/socket.cpp; sourceTree = SOURCE_ROOT; }; @@ -279,7 +249,6 @@ 64ED762D0C7CFBA100D16D5C /* platnet.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = platnet.h; path = include/Tiki/platnet.h; sourceTree = "<group>"; }; 64F19E990CF5391F0093AEAD /* text.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = text.h; path = ../include/Tiki/gui/text.h; sourceTree = SOURCE_ROOT; }; 64F19ECA0CF53D740093AEAD /* graphic.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = graphic.h; path = ../include/Tiki/gui/graphic.h; sourceTree = SOURCE_ROOT; }; - 8DC2EF5A0486A6940098B216 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist; path = Info.plist; sourceTree = "<group>"; }; 8DC2EF5B0486A6940098B216 /* Tiki.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Tiki.framework; sourceTree = BUILT_PRODUCTS_DIR; }; C40D72C1083723B50084B52D /* design_v2.rtf */ = {isa = PBXFileReference; lastKnownFileType = text.rtf; name = design_v2.rtf; path = ../notes/design_v2.rtf; sourceTree = SOURCE_ROOT; }; C40D72C2083723B50084B52D /* drawing_model.txt */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; name = drawing_model.txt; path = ../notes/drawing_model.txt; sourceTree = SOURCE_ROOT; }; @@ -533,7 +502,6 @@ 089C1665FE841158C02AAC07 /* Resources */ = { isa = PBXGroup; children = ( - 8DC2EF5A0486A6940098B216 /* Info.plist */, 089C1666FE841158C02AAC07 /* InfoPlist.strings */, ); name = Resources; @@ -718,6 +686,7 @@ C480A22E0835BEA6006AEE4B /* object.cpp */, C45D0B90083F030200F9F467 /* timeline.cpp */, C45D0B91083F030200F9F467 /* timepoint.cpp */, + 649CF73D0CF7E00400CC8D65 /* version.cpp.in */, ); name = base; path = ../src/base; @@ -1178,54 +1147,12 @@ }; /* End PBXGroup section */ -/* Begin PBXHeadersBuildPhase section */ - 8DC2EF500486A6940098B216 /* Headers */ = { - isa = PBXHeadersBuildPhase; - buildActionMask = 2147483647; - files = ( - C4EAEB2008678F1F003F5342 /* TikiAll.h in Headers */, - 640C2C30092EB8C40032DE40 /* alpharotate.h in Headers */, - 64D758F4092EB9A5002667EE /* sleep.h in Headers */, - 2290A10109302D9F00B7D80C /* cursor.h in Headers */, - 2290A10209302D9F00B7D80C /* pointerArrow.h in Headers */, - 6444BEE80932A3F200A29768 /* texturetile.h in Headers */, - 223226830A165A7A0035025E /* console.h in Headers */, - 64ED76190C7CFB4C00D16D5C /* address.h in Headers */, - 64ED761A0C7CFB4C00D16D5C /* buffer.h in Headers */, - 64ED761B0C7CFB4C00D16D5C /* socket.h in Headers */, - 64ED761C0C7CFB4C00D16D5C /* tcpserversocket.h in Headers */, - 64ED761D0C7CFB4C00D16D5C /* tcpsocket.h in Headers */, - 64ED761E0C7CFB4C00D16D5C /* udpsocket.h in Headers */, - 64ED76230C7CFB6200D16D5C /* cookie.h in Headers */, - 64ED76240C7CFB6200D16D5C /* request.h in Headers */, - 64ED76250C7CFB6200D16D5C /* response.h in Headers */, - 64ED76260C7CFB6200D16D5C /* useragent.h in Headers */, - 64ED76290C7CFB7E00D16D5C /* endian.h in Headers */, - 64ED762A0C7CFB7E00D16D5C /* net.h in Headers */, - 64ED762E0C7CFBA100D16D5C /* platnet.h in Headers */, - 6499FE6B0C862377008D9FEF /* tinyxml.h in Headers */, - 6499FE760C8623D6008D9FEF /* base64.h in Headers */, - 6499FE770C8623D6008D9FEF /* date.h in Headers */, - 6499FEA40C8640CA008D9FEF /* cookiejar.h in Headers */, - 644D23570CDFE83C00E7F291 /* lightbarmenu.h in Headers */, - 64618A5B0CEBE9A000881556 /* widget.h in Headers */, - 6406D0440CF3C737002D832F /* button.h in Headers */, - 64F19E9A0CF5391F0093AEAD /* text.h in Headers */, - 64F19ECB0CF53D740093AEAD /* graphic.h in Headers */, - 642E949A0CF54A780005C8A5 /* radiobutton.h in Headers */, - 642E949E0CF54B550005C8A5 /* window.h in Headers */, - 642E95860CF561D20005C8A5 /* spinner.h in Headers */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXHeadersBuildPhase section */ - /* Begin PBXNativeTarget section */ 8DC2EF4F0486A6940098B216 /* Tiki */ = { isa = PBXNativeTarget; buildConfigurationList = C4B181A70856AE7000B46BDA /* Build configuration list for PBXNativeTarget "Tiki" */; buildPhases = ( - 8DC2EF500486A6940098B216 /* Headers */, + 649CF7110CF7DD0C00CC8D65 /* ShellScript */, 8DC2EF520486A6940098B216 /* Resources */, 8DC2EF540486A6940098B216 /* Sources */, 8DC2EF560486A6940098B216 /* Frameworks */, @@ -1272,6 +1199,23 @@ /* End PBXResourcesBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */ + 649CF7110CF7DD0C00CC8D65 /* ShellScript */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + "$(SRCROOT)/../src/base/version.cpp.in", + "$(SRCROOT)/Info.plist.in", + ); + outputPaths = ( + "$(SRCROOT)/../src/base/version.cpp", + "$(SRCROOT)/Info.plist", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "sed \"s/\\$WCREV\\\\$/`svnversion .`/\" < $SRCROOT/../src/base/version.cpp.in > $SRCROOT/../src/base/version.cpp\nsed \"s/\\$WCREV\\\\$/`svnversion .`/\" < $SRCROOT/Info.plist.in > $SRCROOT/Info.plist"; + }; C4EC17C5084441E40005E60B /* ShellScript */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; @@ -1446,6 +1390,7 @@ 642E94E50CF54FF20005C8A5 /* text.cpp in Sources */, 642E94E80CF5501D0005C8A5 /* graphic.cpp in Sources */, 642E958B0CF5642F0005C8A5 /* spinner.cpp in Sources */, + 649CF73E0CF7E00400CC8D65 /* version.cpp.in in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; Modified: tiki/sdl/Makefile =================================================================== --- tiki/sdl/Makefile 2007-11-22 15:52:45 UTC (rev 549) +++ tiki/sdl/Makefile 2007-11-24 05:20:47 UTC (rev 550) @@ -2,6 +2,7 @@ BASE_AUDIO_OBJ=$(patsubst %.cpp,%.o,$(wildcard ../src/audio/*.cpp)) BASE_AUDIO_OBJ+=$(patsubst %.cpp,%.o,$(wildcard ../src/audio/oggvorbis/*.cpp)) BASE_BASE_OBJ=$(patsubst %.cpp,%.o,$(wildcard ../src/base/*.cpp)) +BASE_BASE_OBJ+=../src/base/version.o BASE_GL_OBJ=$(patsubst %.cpp,%.o,$(wildcard ../src/gl/*.cpp)) BASE_GL_OBJ+=$(patsubst %.cpp,%.o,$(wildcard ../src/gl/anims/*.cpp)) BASE_GL_OBJ+=$(patsubst %.cpp,%.o,$(wildcard ../src/gl/drawables/*.cpp)) @@ -56,7 +57,7 @@ $(AR) ru libtiki.a $(BASE_OBJS) $(THIRD_PARTY_OBJS) clean: clean_subdirs - -rm -f $(BASE_OBJS) $(THIRD_PARTY_OBJS) libtiki.a + -rm -f $(BASE_OBJS) $(THIRD_PARTY_OBJS) libtiki.a ../src/base/version.cpp $(MAKE) TIKI_PLAT=sdl -C$(CURDIR)/../examples clean examples: @@ -90,4 +91,7 @@ gzip ../tiki-$(SVN_VERSION)-sdl.tar rm -rf ../dist/$(SVN_VERSION)/tmp +../src/base/version.cpp: ../src/base/version.cpp.in + sed "s/\$$WCREV\\$$/`svnversion .`/" < ../src/base/version.cpp.in > ../src/base/version.cpp + include Makefile.rules Property changes on: tiki/src/base ___________________________________________________________________ Name: svn:ignore - *.d + *.d version.cpp Added: tiki/src/base/version.cpp.in =================================================================== --- tiki/src/base/version.cpp.in (rev 0) +++ tiki/src/base/version.cpp.in 2007-11-24 05:20:47 UTC (rev 550) @@ -0,0 +1,35 @@ +/* + Tiki + + version.cpp + + Copyright (C)2007 Atani Software +*/ + +#include "pch.h" + +namespace Tiki { + const std::string TikiFrameworkVersion = "0.0.$WCREV$"; + const string getVersion() { + return TikiFrameworkVersion; + } + + const std::string TikiFrameworkPlatform = +#if TIKI_PLAT == TIKI_WIN32 + "Windows"; +#elif TIKI_PLAT == TIKI_NDS + "Nintendo DS"; +#elif TIKI_PLAT == TIKI_SDL + "SDL"; +#elif TIKI_PLAT == TIKI_OSX + "Mac OS X"; +#elif TIKI_PLAT == TIKI_DC + "Sega Dreamcast"; +#else + "Unknown"; +#endif + const string getPlatformName() { + return TikiFrameworkPlatform; + } +} + Modified: tiki/src/gui/button.cpp =================================================================== --- tiki/src/gui/button.cpp 2007-11-22 15:52:45 UTC (rev 549) +++ tiki/src/gui/button.cpp 2007-11-24 05:20:47 UTC (rev 550) @@ -7,8 +7,8 @@ */ #include "pch.h" -#include "Tiki/widget.h" -#include "Tiki/button.h" +#include "Tiki/gui/widget.h" +#include "Tiki/gui/button.h" using namespace Tiki::GUI; using namespace Tiki::GL; @@ -20,4 +20,4 @@ void Button::render(Drawable::ObjType mode) { -} \ No newline at end of file +} Modified: tiki/src/gui/graphic.cpp =================================================================== --- tiki/src/gui/graphic.cpp 2007-11-22 15:52:45 UTC (rev 549) +++ tiki/src/gui/graphic.cpp 2007-11-24 05:20:47 UTC (rev 550) @@ -7,7 +7,7 @@ */ #include "pch.h" -#include "Tiki/graphic.h" +#include "Tiki/gui/graphic.h" using namespace Tiki::GUI; using namespace Tiki::GL; @@ -19,4 +19,4 @@ void Graphic::render(Drawable::ObjType mode) { -} \ No newline at end of file +} Modified: tiki/src/gui/radiobutton.cpp =================================================================== --- tiki/src/gui/radiobutton.cpp 2007-11-22 15:52:45 UTC (rev 549) +++ tiki/src/gui/radiobutton.cpp 2007-11-24 05:20:47 UTC (rev 550) @@ -7,7 +7,7 @@ */ #include "pch.h" -#include "Tiki/radiobutton.h" +#include "Tiki/gui/radiobutton.h" using namespace Tiki::GUI; using namespace Tiki::GL; @@ -28,4 +28,4 @@ void RadioButtonGroup::render(Drawable::ObjType mode) { -} \ No newline at end of file +} Modified: tiki/src/gui/spinner.cpp =================================================================== --- tiki/src/gui/spinner.cpp 2007-11-22 15:52:45 UTC (rev 549) +++ tiki/src/gui/spinner.cpp 2007-11-24 05:20:47 UTC (rev 550) @@ -7,7 +7,7 @@ */ #include "pch.h" -#include "Tiki/spinner.h" +#include "Tiki/gui/spinner.h" using namespace Tiki::GUI; using namespace Tiki::GL; @@ -19,4 +19,4 @@ void Spinner::render(Drawable::ObjType mode) { -} \ No newline at end of file +} Modified: tiki/src/gui/text.cpp =================================================================== --- tiki/src/gui/text.cpp 2007-11-22 15:52:45 UTC (rev 549) +++ tiki/src/gui/text.cpp 2007-11-24 05:20:47 UTC (rev 550) @@ -7,7 +7,7 @@ */ #include "pch.h" -#include "Tiki/text.h" +#include "Tiki/gui/text.h" using namespace Tiki::GUI; using namespace Tiki::GL; @@ -18,4 +18,4 @@ void Text::render(Drawable::ObjType mode) { -} \ No newline at end of file +} Modified: tiki/src/gui/widget.cpp =================================================================== --- tiki/src/gui/widget.cpp 2007-11-22 15:52:45 UTC (rev 549) +++ tiki/src/gui/widget.cpp 2007-11-24 05:20:47 UTC (rev 550) @@ -7,7 +7,7 @@ */ #include "pch.h" -#include "Tiki/widget.h" +#include "Tiki/gui/widget.h" using namespace Tiki::GUI; @@ -22,4 +22,4 @@ } m_cachedPos = pos; return m_cachedPos; -} \ No newline at end of file +} Deleted: tiki/src/gui/widget.h =================================================================== --- tiki/src/gui/widget.h 2007-11-22 15:52:45 UTC (rev 549) +++ tiki/src/gui/widget.h 2007-11-24 05:20:47 UTC (rev 550) @@ -1,9 +0,0 @@ -/* - * widget.h - * Tiki - * - * Created by Atani on 11/20/07. - * Copyright 2007 __MyCompanyName__. All rights reserved. - * - */ - Modified: tiki/src/gui/window.cpp =================================================================== --- tiki/src/gui/window.cpp 2007-11-22 15:52:45 UTC (rev 549) +++ tiki/src/gui/window.cpp 2007-11-24 05:20:47 UTC (rev 550) @@ -7,7 +7,7 @@ */ #include "pch.h" -#include "Tiki/window.h" +#include "Tiki/gui/window.h" using namespace Tiki::GUI; @@ -19,4 +19,4 @@ void Window::run() { -} \ No newline at end of file +} Modified: tiki/src/net/http/useragent.cpp =================================================================== --- tiki/src/net/http/useragent.cpp 2007-11-22 15:52:45 UTC (rev 549) +++ tiki/src/net/http/useragent.cpp 2007-11-24 05:20:47 UTC (rev 550) @@ -1,483 +1,473 @@ -/* - Tiki - - useragent.cpp - - Copyright (C)2007 Atani Software -*/ - -#include "pch.h" -#include "Tiki/tiki.h" -#include "Tiki/net.h" -#include "Tiki/net/http/useragent.h" - -#include <sstream> -#include <math.h> - -namespace Tiki { - -namespace Net { - -namespace Http { - -using namespace Tiki::Net::TCP; - -using std::string; -using std::list; -using std::stringstream; -using std::istringstream; -using std::ios; - -TIKI_OBJECT_NAME( HttpUserAgent ) -TIKI_OBJECT_BEGIN( Object, HttpUserAgent ) -TIKI_OBJECT_OUTLET( "progressUpdate" ) -TIKI_OBJECT_END( HttpUserAgent ) - -HttpUserAgent::HttpUserAgent() { -#if TIKI_PLAT == TIKI_WIN32 - m_userAgentName = "Tiki/1.0 (Windows)"; -#elif TIKI_PLAT == TIKI_NDS - m_userAgentName = "Tiki/1.0 (Nintendo DS)"; -#elif TIKI_PLAT == TIKI_SDL - m_userAgentName = "Tiki/1.0 (SDL)"; -#elif TIKI_PLAT == TIKI_OSX - m_userAgentName = "Tiki/1.0 (Mac OS X)"; -#else - m_userAgentName = "Tiki/1.0 (Unknown)"; -#endif - m_proxyHost = ""; - m_proxyPort = 8080; - m_ignoreCookies = true; - m_cookieJar = NULL; -} - -Response *HttpUserAgent::get(Request *req) { - - Response *response = new Response(); - response->setUrl(req->getUrl()); - response->setResultCode(200); - - string hostname; - int port; - string resource; - - parseUrl(req->getUrl(), hostname, resource, port); - - TCPSocket *socket; - if(m_proxyHost.empty()) { - socket = new TCPSocket(new Address(hostname, port)); - } - else { - socket = new TCPSocket(new Address(m_proxyHost, m_proxyPort)); - } - - socket->setNonBlocking(false); - - socket->open(); - if(!socket->isOpen()) { - Tiki::Debug::printf("connect failed\n"); - response->setResultCode(504); - return response; - } - - string requestText; - buildRequest(hostname, resource, port, "GET", req, requestText); - - Tiki::Debug::printf("Sending request...\n"); - Tiki::Debug::printf(requestText.c_str()); - socket->send(requestText); - - readResponse(response, socket); - - socket->close(); - - delete socket; - - return response; -} - -Response *HttpUserAgent::post(Request *req) { - Response *response = new Response(); - response->setUrl(req->getUrl()); - response->setResultCode(200); - - string hostname; - int port; - string resource; - - parseUrl(req->getUrl(), hostname, resource, port); - - TCPSocket *socket; - if(m_proxyHost.empty()) { - socket = new TCPSocket(new Address(hostname, port)); - } - else { - socket = new TCPSocket(new Address(m_proxyHost, m_proxyPort)); - } - - socket->setNonBlocking(false); - - socket->open(); - if(!socket->isOpen()) { - Tiki::Debug::printf("connect failed\n"); - response->setResultCode(504); - return response; - } - - string requestText; - buildRequest(hostname, resource, port, "POST", req, requestText); - - Tiki::Debug::printf("Sending request...\n"); - socket->send(requestText); - - size_t maxSize = requestText.length(); - size_t sentSize = maxSize; - list<string> content = req->getContentPartNames(); - for(list<string>::iterator iter = content.begin(); - iter != content.end(); - ++iter) { - Buffer *buf = req->getContentPart(*iter); - if(buf->getUsedDataLen() > 0) { - maxSize += buf->getUsedDataLen(); - } - } - if(content.size() > 1 || req->isForcedMultiPartUpload()) { - string status = ""; - socket->recv(status); - - for(list<string>::iterator iter = content.begin(); - iter != content.end(); - ++iter) { - Buffer *buf = req->getContentPart(*iter); - if(buf->getUsedDataLen() > 0) { - stringstream temp; - temp << "--" << req->getBoundaryMarker() << "\r\n"; - temp << "Content-Disposition: form-data; name=\""; - if(!buf->getFieldName().empty()) { - temp << buf->getFieldName(); - } - else { - temp << "File"; - } - temp << "\"; filename=\"" << buf->getFileNameShort() << "\"\r\nContent-Type: " << buf->getContentType() << "\r\n\r\n"; - string headerText = temp.str(); - //Tiki::Debug::printf("CONTENT_HEADER:\n%s", headerText.c_str()); - socket->send(headerText); - socket->send(buf); - sentSize += buf->getUsedDataLen(); - SocketProgress *progress = new SocketProgress(maxSize, 0, sentSize); - emit( "progressUpdate", progress ); - delete progress; - } - } - string footerText = "\r\n--"; - footerText.append(req->getBoundaryMarker()); - footerText.append("--\r\n"); - socket->send(footerText); - } - else if(content.size() == 1) { - Buffer *buf = req->getContentPart(*content.begin()); - if(buf->getUsedDataLen() > 0) { - socket->send(buf); - SocketProgress *progress = new SocketProgress(maxSize, 0, buf->getUsedDataLen()); - emit( "progressUpdate", progress ); - delete progress; - } - - } - - readResponse(response, socket); - - socket->close(); - - delete socket; - - return response; -} - -void HttpUserAgent::parseUrl(const string url, string &host, string &resource, int &port) { - string temp_url = url; - - // set defaults - host = ""; - port = 80; - resource = "/index.html"; - - if(temp_url.find("http://") == 0) { - temp_url = temp_url.substr(string("http://").length()); - } - else if(temp_url.find("https://") == 0) { - temp_url = temp_url.substr(string("https://").length()); - } - host = temp_url.substr(0, temp_url.find("/")); - if(temp_url.find("/") != string::npos) { - resource = temp_url.substr(temp_url.find("/")); - } - if(host.find(":") != string::npos) { - string portstr = url.substr(host.find(":")); - port = atoi(portstr.c_str()); - host = host.substr(0, host.find(":")); - } -} - -void HttpUserAgent::buildRequest(const string host, const string resource, const int port, - const string mode, Request *request, string &requestText) { - - stringstream req; - if(m_proxyHost.empty()) { - req << mode << " " << resource << " HTTP/1.1\r\n"; - req << "Host: " << host << "\r\n"; - } - else { - // proxy connection - req << mode << " " << request->getUrl(); - if(port != 80) { - req << ":" << port; - } - req << " HTTP/1.1\r\n"; - req << "Host: " << host << "\r\n"; - } - list<string> params = request->getHeaderParamNames(); - for(list<string>::const_iterator param = params.begin(); - param != params.end(); - ++param) { - req << *param << ": " << request->getHeaderParam(*param) << "\r\n"; - } - - if(!m_userAgentName.empty()) { - req << "User-Agent: " << m_userAgentName << "\r\n"; - } - - if(m_cookieJar != NULL) { - list<Cookie *> cookies = m_cookieJar->getCookies(host, resource); - for(list<Cookie *>::iterator iter = cookies.begin(); - iter != cookies.end(); - ++iter) { - req << "Cookie: $Version=" << (*iter)->getVersion() << "; "; - req << (*iter)->getName() << "=" << (*iter)->getValue() << "; "; - req << "$Path=" << (*iter)->getPath() << "\r\n"; - } - } - - list<string> content = request->getContentPartNames(); - if(!mode.compare("POST") && (content.size() > 1 || request->isForcedMultiPartUpload())) { - uint64 totalSize = 8 + request->getBoundaryMarker().length(); // account for the ending boundary - for(list<string>::iterator iter = content.begin(); - iter != content.end(); - ++iter) { - Buffer *buf = request->getContentPart(*iter); - if(buf->getUsedDataLen() > 0) { - totalSize += request->getBoundaryMarker().length() + 4; - totalSize += buf->getUsedDataLen(); - stringstream temp; - temp << "Content-Disposition: form-data; name=\""; - if(!buf->getFieldName().empty()) { - temp << buf->getFieldName(); - } - else { - temp << "File"; - } - temp << "\"; filename=\"" << buf->getFileNameShort() << "\"\r\nContent-Type: " << buf->getContentType() << "\r\n\r\n"; - - // add section header size - totalSize += temp.str().length(); - } - } - - req << "Content-Length: " << totalSize << "\r\n"; - req << "Expect: 100-continue\r\n"; - req << "Content-Type: multipart/form-data; boundary=" << request->getBoundaryMarker() << "\r\n"; - } - else if(!mode.compare("POST") && content.size() == 1) { - Buffer *buf = request->getContentPart(*content.begin()); - req << "Content-Type: " << buf->getContentType() << "\r\n"; - req << "Content-Length: " << buf->getUsedDataLen() << "\r\n"; - } - req << "\r\n"; - - requestText = req.str(); -} - -void HttpUserAgent::readResponse(Response *response, TCPSocket *socket) { - string host, resource; - int port; - parseUrl(response->getUrl(), host, resource, port); - - string status = ""; - socket->recv(status); - - for(string::size_type i = 0; i < status.length(); i++) { - if(status.at(i) == ' ') { - response->setResultCode(atoi(status.c_str()+i + 1)); - break; - } - } - - size_t responseSize = -1; - size_t receivedSoFar = 0; - while(1) { - string line = ""; - socket->recv(line); - receivedSoFar += line.size(); - if(line.size() == 0) { - // done with headers - break; - } - if(line.find(":") != string::npos) { - string field = line.substr(0, line.find(":")); - string value = line.substr(line.find(":") + 1); - while(value.at(0) == ' ') { - value = value.substr(1); - } - - if(!field.compare("Set-Cookie")) { - if(!isIgnoreCookies()) { - m_cookieJar->addCookie(value, host, resource); - } - } - else if(!field.compare("Content-Length")) { - responseSize = atoi(value.c_str()); - response->setHeaderParam(field, value); - } - else { - response->setHeaderParam(field, value); - } - } - if(responseSize != -1) { - SocketProgress *progress = new SocketProgress(responseSize, receivedSoFar, 0); - emit( "progressUpdate", progress ); - delete progress; - } - } - - Buffer *fullBuf; - if(responseSize == -1) - { - fullBuf = new Buffer(1); - } - else - { - fullBuf = new Buffer(responseSize); - } - - if(!response->getHeaderParam("Transfer-Encoding").compare("chunked")) { - Tiki::Debug::printf("Encoding is chunked\n"); - // evil chunked encoding - size_t totalSize = 0; - - size_t sizeDecoded = 0; - do - { - sizeDecoded = 0; - string size = ""; - socket->recv(size); - if(size.empty()) { - sizeDecoded = 1; - continue; - } - - istringstream sizestream(string("0x") + size); - sizestream.unsetf(ios::dec); - sizestream.setf(ios::skipws); - sizestream >> sizeDecoded; - responseSize = receivedSoFar + sizeDecoded; - - if(sizeDecoded > 0) { - Buffer *chunkBuf = new Buffer(sizeDecoded); - socket->recv(chunkBuf); - receivedSoFar += chunkBuf->getUsedDataLen(); - SocketProgress *progress = new SocketProgress(responseSize, receivedSoFar, 0); - emit( "progressUpdate", progress ); - delete progress; - if(chunkBuf->getUsedDataLen() < sizeDecoded) - { - size_t needed = sizeDecoded - chunkBuf->getUsedDataLen(); - Buffer *chunkBuf2; - if(needed > 4096) { - chunkBuf2 = new Buffer(4096); - } - else { - chunkBuf2 = new Buffer(needed); - } - while(needed > 0) { - if(needed < chunkBuf2->getDataLen()) { - delete chunkBuf2; - chunkBuf2 = new Buffer(needed); - } - socket->recv(chunkBuf2); - chunkBuf->append(chunkBuf2); - if(chunkBuf2->getUsedDataLen() > 0) { - receivedSoFar += chunkBuf2->getUsedDataLen(); - SocketProgress *progress = new SocketProgress(responseSize, receivedSoFar, 0); - emit( "progressUpdate", progress ); - delete progress; - } - needed -= chunkBuf2->getUsedDataLen(); - } - delete chunkBuf2; - } - totalSize += chunkBuf->getUsedDataLen(); - fullBuf->append(chunkBuf); - delete chunkBuf; - } - } while(sizeDecoded > 0); - } - else if(response->getHeaderParam("Content-Length").compare("")) { - Tiki::Debug::printf("Encoding is inline\n"); - size_t sizeDecoded = atoi(response->getHeaderParam("Content-Length").c_str()); - - Buffer *chunkBuf = new Buffer(sizeDecoded); - socket->recv(chunkBuf); - receivedSoFar += chunkBuf->getUsedDataLen(); - SocketProgress *progress = new SocketProgress(responseSize, receivedSoFar, 0); - emit( "progressUpdate", progress ); - delete progress; - if(chunkBuf->getUsedDataLen() < sizeDecoded) - { - sizeDecoded -= chunkBuf->getUsedDataLen(); - Buffer *chunkBuf2; - if(sizeDecoded > 4096) { - chunkBuf2 = new Buffer(4096); - } - else { - chunkBuf2 = new Buffer(sizeDecoded); - } - while(sizeDecoded > 0) { - if(sizeDecoded < chunkBuf2->getDataLen()) { - delete chunkBuf2; - chunkBuf2 = new Buffer(sizeDecoded); - } - socket->recv(chunkBuf2); - chunkBuf->append(chunkBuf2); - if(chunkBuf2->getUsedDataLen() > 0) { - receivedSoFar += chunkBuf2->getUsedDataLen(); - SocketProgress *progress = new SocketProgress(responseSize, receivedSoFar, 0); - emit( "progressUpdate", progress ); - delete progress; - } - sizeDecoded -= chunkBuf2->getUsedDataLen(); - } - delete chunkBuf2; - } - fullBuf->append(chunkBuf); - - delete chunkBuf; - } - else { - Tiki::Debug::printf("Encoding is unknown\n"); - Tiki::Debug::printf("Dumping headers\nHEADER NAME -> VALUE"); - for(list<string>::iterator iter = response->getHeaderParamNames().begin(); - iter != response->getHeaderParamNames().end(); - ++iter) { - Tiki::Debug::printf("%s -> %s\n", (*iter).c_str(), response->getHeaderParam(*iter).c_str()); - } - } - response->addContentPart(fullBuf, DEFAULT_CONTENT_PART); -} - -}; // namespace Http - -}; // namespace Net - -}; // namespace Tiki - +/* + Tiki + + useragent.cpp + + Copyright (C)2007 Atani Software +*/ + +#include "pch.h" +#include "Tiki/tiki.h" +#include "Tiki/net.h" +#include "Tiki/net/http/useragent.h" + +#include <sstream> +#include <math.h> + +namespace Tiki { + +namespace Net { + +namespace Http { + +using namespace Tiki::Net::TCP; + +using std::string; +using std::list; +using std::stringstream; +using std::istringstream; +using std::ios; + +TIKI_OBJECT_NAME( HttpUserAgent ) +TIKI_OBJECT_BEGIN( Object, HttpUserAgent ) +TIKI_OBJECT_OUTLET( "progressUpdate" ) +TIKI_OBJECT_END( HttpUserAgent ) + +HttpUserAgent::HttpUserAgent() { + m_userAgentName = string("Tiki/") + Tiki::getVersion() + string(" (") + Tiki::getPlatformName() + string(")"); + m_proxyHost = ""; + m_proxyPort = 8080; + m_ignoreCookies = true; + m_cookieJar = NULL; +} + +Response *HttpUserAgent::get(Request *req) { + + Response *response = new Response(); + response->setUrl(req->getUrl()); + response->setResultCode(200); + + string hostname; + int port; + string resource; + + parseUrl(req->getUrl(), hostname, resource, port); + + TCPSocket *socket; + if(m_proxyHost.empty()) { + socket = new TCPSocket(new Address(hostname, port)); + } + else { + socket = new TCPSocket(new Address(m_proxyHost, m_proxyPort)); + } + + socket->setNonBlocking(false); + + socket->open(); + if(!socket->isOpen()) { + Tiki::Debug::printf("connect failed\n"); + response->setResultCode(504); + return response; + } + + string requestText; + buildRequest(hostname, resource, port, "GET", req, requestText); + + Tiki::Debug::printf("Sending request...\n"); + Tiki::Debug::printf(requestText.c_str()); + socket->send(requestText); + + readResponse(response, socket); + + socket->close(); + + delete socket; + + return response; +} + +Response *HttpUserAgent::post(Request *req) { + Response *response = new Response(); + response->setUrl(req->getUrl()); + response->setResultCode(200); + + string hostname; + int port; + string resource; + + parseUrl(req->getUrl(), hostname, resource, port); + + TCPSocket *socket; + if(m_proxyHost.empty()) { + socket = new TCPSocket(new Address(hostname, port)); + } + else { + socket = new TCPSocket(new Address(m_proxyHost, m_proxyPort)); + } + + socket->setNonBlocking(false); + + socket->open(); + if(!socket->isOpen()) { + Tiki::Debug::printf("connect failed\n"); + response->setResultCode(504); + return response; + } + + string requestText; + buildRequest(hostname, resource, port, "POST", req, requestText); + + Tiki::Debug::printf("Sending request...\n"); + socket->send(requestText); + + size_t maxSize = requestText.length(); + size_t sentSize = maxSize; + list<string> content = req->getContentPartNames(); + for(list<string>::iterator iter = content.begin(); + iter != content.end(); + ++iter) { + Buffer *buf = req->getContentPart(*iter); + if(buf->getUsedDataLen() > 0) { + maxSize += buf->getUsedDataLen(); + } + } + if(content.size() > 1 || req->isForcedMultiPartUpload()) { + string status = ""; + socket->recv(status); + + for(list<string>::iterator iter = content.begin(); + iter != content.end(); + ++iter) { + Buffer *buf = req->getContentPart(*iter); + if(buf->getUsedDataLen() > 0) { + stringstream temp; + temp << "--" << req->getBoundaryMarker() << "\r\n"; + temp << "Content-Disposition: form-data; name=\""; + if(!buf->getFieldName().empty()) { + temp << buf->getFieldName(); + } + else { + temp << "File"; + } + temp << "\"; filename=\"" << buf->getFileNameShort() << "\"\r\nContent-Type: " << buf->getContentType() << "\r\n\r\n"; + string headerText = temp.str(); + //Tiki::Debug::printf("CONTENT_HEADER:\n%s", headerText.c_str()); + socket->send(headerText); + socket->send(buf); + sentSize += buf->getUsedDataLen(); + SocketProgress *progress = new SocketProgress(maxSize, 0, sentSize); + emit( "progressUpdate", progress ); + delete progress; + } + } + string footerText = "\r\n--"; + footerText.append(req->getBoundaryMarker()); + footerText.append("--\r\n"); + socket->send(footerText); + } + else if(content.size() == 1) { + Buffer *buf = req->getContentPart(*content.begin()); + if(buf->getUsedDataLen() > 0) { + socket->send(buf); + SocketProgress *progress = new SocketProgress(maxSize, 0, buf->getUsedDataLen()); + emit( "progressUpdate", progress ); + delete progress; + } + + } + + readResponse(response, socket); + + socket->close(); + + delete socket; + + return response; +} + +void HttpUserAgent::parseUrl(const string url, string &host, string &resource, int &port) { + string temp_url = url; + + // set defaults + host = ""; + port = 80; + resource = "/index.html"; + + if(temp_url.find("http://") == 0) { + temp_url = temp_url.substr(string("http://").length()); + } + else if(temp_url.find("https://") == 0) { + temp_url = temp_url.substr(string("https://").length()); + } + host = temp_url.substr(0, temp_url.find("/")); + if(temp_url.find("/") != string::npos) { + resource = temp_url.substr(temp_url.find("/")); + } + if(host.find(":") != string::npos) { + string portstr = url.substr(host.find(":")); + port = atoi(portstr.c_str()); + host = host.substr(0, host.find(":")); + } +} + +void HttpUserAgent::buildRequest(const string host, const string resource, const int port, + const string mode, Request *request, string &requestText) { + + stringstream req; + if(m_proxyHost.empty()) { + req << mode << " " << resource << " HTTP/1.1\r\n"; + req << "Host: " << host << "\r\n"; + } + else { + // proxy connection + req << mode << " " << request->getUrl(); + if(port != 80) { + req << ":" << port; + } + req << " HTTP/1.1\r\n"; + req << "Host: " << host << "\r\n"; + } + list<string> params = request->getHeaderParamNames(); + for(list<string>::const_iterator param = params.begin(); + param != params.end(); + ++param) { + req << *param << ": " << request->getHeaderParam(*param) << "\r\n"; + } + + if(!m_userAgentName.empty()) { + req << "User-Agent: " << m_userAgentName << "\r\n"; + } + + if(m_cookieJar != NULL) { + list<Cookie *> cookies = m_cookieJar->getCookies(host, resource); + for(list<Cookie *>::iterator iter = cookies.begin(); + iter != cookies.end(); + ++iter) { + req << "Cookie: $Version=" << (*iter)->getVersion() << "; "; + req << (*iter)->getName() << "=" << (*iter)->getValue() << "; "; + req << "$Path=" << (*iter)->getPath() << "\r\n"; + } + } + + list<string> content = request->getContentPartNames(); + if(!mode.compare("POST") && (content.size() > 1 || request->isForcedMultiPartUpload())) { + uint64 totalSize = 8 + request->getBoundaryMarker().length(); // account for the ending boundary + for(list<string>::iterator iter = content.begin(); + iter != content.end(); + ++iter) { + Buffer *buf = request->getContentPart(*iter); + if(buf->getUsedDataLen() > 0) { + totalSize += request->getBoundaryMarker().length() + 4; + totalSize += buf->getUsedDataLen(); + stringstream temp; + temp << "Content-Disposition: form-data; name=\""; + if(!buf->getFieldName().empty()) { + temp << buf->getFieldName(); + } + else { + temp << "File"; + } + temp << "\"; filename=\"" << buf->getFileNameShort() << "\"\r\nContent-Type: " << buf->getContentType() << "\r\n\r\n"; + + // add section header size + totalSize += temp.str().length(); + } + } + + req << "Content-Length: " << totalSize << "\r\n"; + req << "Expect: 100-continue\r\n"; + req << "Content-Type: multipart/form-data; boundary=" << request->getBoundaryMarker() << "\r\n"; + } + else if(!mode.compare("POST") && content.size() == 1) { + Buffer *buf = request->getContentPart(*content.begin()); + req << "Content-Type: " << buf->getContentType() << "\r\n"; + req << "Content-Length: " << buf->getUsedDataLen() << "\r\n"; + } + req << "\r\n"; + + requestText = req.str(); +} + +void HttpUserAgent::readResponse(Response *response, TCPSocket *socket) { + string host, resource; + int port; + parseUrl(response->getUrl(), host, resource, port); + + string status = ""; + socket->recv(status); + + for(string::size_type i = 0; i < status.length(); i++) { + if(status.at(i) == ' ') { + response->setResultCode(atoi(status.c_str()+i + 1)); + break; + } + } + + size_t responseSize = -1; + size_t receivedSoFar = 0; + while(1) { + string line = ""; + socket->recv(line); + receivedSoFar += line.size(); + if(line.size() == 0) { + // done with headers + break; + } + if(line.find(":") != string::npos) { + string field = line.substr(0, line.find(":")); + string value = line.substr(line.find(":") + 1); + while(value.at(0) == ' ') { + value = value.substr(1); + } + + if(!field.compare("Set-Cookie")) { + if(!isIgnoreCookies()) { + m_cookieJar->addCookie(value, host, resource); + } + } + else if(!field.compare("Content-Length")) { + responseSize = atoi(value.c_str()); + response->setHeaderParam(field, value); + } + else { + response->setHeaderParam(field, value); + } + } + if(responseSize != -1) { + SocketProgress *progress = new SocketProgress(responseSize, receivedSoFar, 0); + emit( "progressUpdate", progress ); + delete progress; + } + } + + Buffer *fullBuf; + if(responseSize == -1) + { + fullBuf = new Buffer(1); + } + else + { + fullBuf = new Buffer(responseSize); + } + + if(!response->getHeaderParam("Transfer-Encoding").compare("chunked")) { + Tiki::Debug::printf("Encoding is chunked\n"); + // evil chunked encoding + size_t totalSize = 0; + + size_t sizeDecoded = 0; + do + { + sizeDecoded = 0; + string size = ""; + socket->recv(size); + if(size.empty()) { + sizeDecoded = 1; + continue; + } + + istringstream sizestream(string("0x") + size); + sizestream.unsetf(ios::dec); + sizestream.setf(ios::skipws); + sizestream >> sizeDecoded; + responseSize = receivedSoFar + sizeDecoded; + + if(sizeDecoded > 0) { + Buffer *chunkBuf = new Buffer(sizeDecoded); + socket->recv(chunkBuf); + receivedSoFar += chunkBuf->getUsedDataLen(); + SocketProgress *progress = new SocketProgress(responseSize, receivedSoFar, 0); + emit( "progressUpdate", progress ); + delete progress; + if(chunkBuf->getUsedDataLen() < sizeDecoded) + { + size_t needed = sizeDecoded - chunkBuf->getUsedDataLen(); + Buffer *chunkBuf2; + if(needed > 4096) { + chunkBuf2 = new Buffer(4096); + } + else { + chunkBuf2 = new Buffer(needed); + } + while(needed > 0) { + if(needed < chunkBuf2->getDataLen()) { + delete chunkBuf2; + chunkBuf2 = new Buffer(needed); + } + socket->recv(chunkBuf2); + chunkBuf->append(chunkBuf2); + if(chunkBuf2->getUsedDataLen() > 0) { + receivedSoFar += chunkBuf2->getUsedDataLen(); + SocketProgress *progress = new SocketProgress(responseSize, receivedSoFar, 0); + emit( "progressUpdate", progress ); + delete progress; + } + needed -= chunkBuf2->getUsedDataLen(); + } + delete chunkBuf2; + } + totalSize += chunkBuf->getUsedDataLen(); + fullBuf->append(chunkBuf); + delete chunkBuf; + } + } while(sizeDecoded > 0); + } + else if(response->getHeaderParam("Content-Length").compare("")) { + Tiki::Debug::printf("Encoding is inline\n"); + size_t sizeDecoded = atoi(response->getHeaderParam("Content-Length").c_str()); + + Buffer *chunkBuf = new Buffer(sizeDecoded); + socket->recv(chunkBuf); + receivedSoFar += chunkBuf->getUsedDataLen(); + SocketProgress *progress = new SocketProgress(responseSize, receivedSoFar, 0); + emit( "progressUpdate", progress ); + delete progress; + if(chunkBuf->getUsedDataLen() < sizeDecoded) + { + sizeDecoded -= chunkBuf->getUsedDataLen(); + Buffer *chunkBuf2; + if(sizeDecoded > 4096) { + chunkBuf2 = new Buffer(4096); + } + else { + chunkBuf2 = new Buffer(sizeDecoded); + } + while(sizeDecoded > 0) { + if(sizeDecoded < chunkBuf2->getDataLen()) { + delete chunkBuf2; + chunkBuf2 = new Buffer(sizeDecoded); + } + socket->recv(chunkBuf2); + chunkBuf->append(chunkBuf2); + if(chunkBuf2->getUsedDataLen() > 0) { + receivedSoFar += chunkBuf2->getUsedDataLen(); + SocketProgress *progress = new SocketProgress(responseSize, receivedSoFar, 0); + emit( "progressUpdate", progress ); + delete progress; + } + sizeDecoded -= chunkBuf2->getUsedDataLen(); + } + delete chunkBuf2; + } + fullBuf->append(chunkBuf); + + delete chunkBuf; + } + else { + Tiki::Debug::printf("Encoding is unknown\n"); + Tiki::Debug::printf("Dumping headers\nHEADER NAME -> VALUE"); + for(list<string>::iterator iter = response->getHeaderParamNames().begin(); + iter != response->getHeaderParamNames().end(); + ++iter) { + Tiki::Debug::printf("%s -> %s\n", (*iter).c_str(), response->getHeaderParam(*iter).c_str()); + } + } + response->addContentPart(fullBuf, DEFAULT_CONTENT_PART); +} + +}; // namespace Http + +}; // namespace Net + +}; // namespace Tiki + Modified: tiki/win32/tiki.vcproj =================================================================== --- tiki/win32/tiki.vcproj 2007-11-22 15:52:45 UTC (rev 549) +++ tiki/win32/tiki.vcproj 2007-11-24 05:20:47 UTC (rev 550) @@ -243,6 +243,37 @@ RelativePath="..\src\base\timepoint.cpp" > </File> + <File + RelativePath="..\src\base\version.cpp.in" + > + <FileConfiguration + Name="Debug|Win32" + > + <Tool + Name="VCCustomBuildTool" + CommandLine=""c:\Program Files\TortoiseSVN\bin\SubWCRev.exe" . ..\src\base\version.cpp.in ..\src\base\version.cpp
" + Outputs="..\src\base\version.cpp" + /> + <Tool + Name="VCCLCompilerTool" + UsePrecompiledHeader="0" + /> + </FileConfiguration> + <FileConfiguration + Name="Release|Win32" + > + <Tool + Name="VCCustomBuildTool" + CommandLine=""c:\Program Files\TortoiseSVN\bin\SubWCRev.exe" . ..\src\base\version.cpp.in ..\src\base\version.cpp
" + Outputs="..\src\base\version.cpp" + /> + <Tool + Name="VCCLCompilerTool" + UsePrecompiledHeader="0" + /> + </FileConfiguration> + + </File> </Filter> <Filter Name="gl" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <at...@us...> - 2007-11-22 15:52:46
|
Revision: 549 http://cadcdev.svn.sourceforge.net/cadcdev/?rev=549&view=rev Author: atani Date: 2007-11-22 07:52:45 -0800 (Thu, 22 Nov 2007) Log Message: ----------- fix gui compilation Modified Paths: -------------- tiki/include/Tiki/gui/window.h Modified: tiki/include/Tiki/gui/window.h =================================================================== --- tiki/include/Tiki/gui/window.h 2007-11-22 15:32:09 UTC (rev 548) +++ tiki/include/Tiki/gui/window.h 2007-11-22 15:52:45 UTC (rev 549) @@ -12,7 +12,7 @@ #include "Tiki/hid.h" #include "Tiki/list.h" #include "Tiki/eventcollector.h" -#include "Tiki/gui/container.h" +#include "Tiki/gui/widget.h" namespace Tiki { @@ -49,4 +49,4 @@ }; // namespace Tiki -#endif // __TIKI_GUI_WINDOW_H \ No newline at end of file +#endif // __TIKI_GUI_WINDOW_H This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <at...@us...> - 2007-11-22 15:32:11
|
Revision: 548 http://cadcdev.svn.sourceforge.net/cadcdev/?rev=548&view=rev Author: atani Date: 2007-11-22 07:32:09 -0800 (Thu, 22 Nov 2007) Log Message: ----------- fix nds build Modified Paths: -------------- tiki/nds/src/init_shutdown.cpp Modified: tiki/nds/src/init_shutdown.cpp =================================================================== --- tiki/nds/src/init_shutdown.cpp 2007-11-22 08:18:01 UTC (rev 547) +++ tiki/nds/src/init_shutdown.cpp 2007-11-22 15:32:09 UTC (rev 548) @@ -132,9 +132,6 @@ Audio::Stream::shutdownGlobal(); Audio::Sound::shutdownGlobal(); } - if(g_tiki_init_flags & TIKI_INIT_DEBUG_CONSOLE && debug_console != NULL) { - delete debug_console; - } } void setName( const char *windowName, const char *iconName ) {} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <at...@us...> - 2007-11-22 08:18:07
|
Revision: 547 http://cadcdev.svn.sourceforge.net/cadcdev/?rev=547&view=rev Author: atani Date: 2007-11-22 00:18:01 -0800 (Thu, 22 Nov 2007) Log Message: ----------- initial draft of Tiki::GUI system, not functional (yet) Modified Paths: -------------- tiki/osx/Tiki.xcodeproj/project.pbxproj Added Paths: ----------- tiki/include/Tiki/gui/ tiki/include/Tiki/gui/button.h tiki/include/Tiki/gui/graphic.h tiki/include/Tiki/gui/radiobutton.h tiki/include/Tiki/gui/spinner.h tiki/include/Tiki/gui/text.h tiki/include/Tiki/gui/widget.h tiki/include/Tiki/gui/window.h tiki/src/gui/ tiki/src/gui/button.cpp tiki/src/gui/graphic.cpp tiki/src/gui/radiobutton.cpp tiki/src/gui/spinner.cpp tiki/src/gui/text.cpp tiki/src/gui/widget.cpp tiki/src/gui/widget.h tiki/src/gui/window.cpp Added: tiki/include/Tiki/gui/button.h =================================================================== --- tiki/include/Tiki/gui/button.h (rev 0) +++ tiki/include/Tiki/gui/button.h 2007-11-22 08:18:01 UTC (rev 547) @@ -0,0 +1,73 @@ +/* + Tiki + + button.h + + Copyright (C)2007 Atani Software +*/ + +#ifndef __TIKI_GUI_BUTTON_H +#define __TIKI_GUI_BUTTON_H + +#include "Tiki/gui/widget.h" +#include "Tiki/font.h" +#include "Tiki/texture.h" + +namespace Tiki { + +namespace GUI { + +/** + * + * + */ +class Button : public Widget { + public: + Button(const std::string text, GL::Font *font, float size = 24.0f, const std::string name = "") : + Widget(name.size() < 1 ? std::string("btn_") + text : name) { + m_text = text; + m_font = font; + m_image = NULL; + } + + const std::string & getText() const { + return m_text; + } + + void setText(const std::string text) { + m_text = text; + } + + const GL::Texture * getImage() const { + return m_image; + } + + void setImage(GL::Texture * image) { + m_image = image; + } + + const GL::Font * getFont() const { + return m_font; + } + + void setFont(GL::Font * font) { + m_font = font; + } + + virtual void render(GL::Drawable::ObjType mode); + + protected: + TIKI_OBJECT_DECLS( Button ) + + private: + std::string m_text; + GL::Font *m_font; + GL::Texture *m_image; + mutable Vector m_cachedBoundingBox[2]; +}; + +}; // namespace GUI + +}; // namespace Tiki + +#endif // __TIKI_GUI_BUTTON_H \ No newline at end of file Added: tiki/include/Tiki/gui/graphic.h =================================================================== --- tiki/include/Tiki/gui/graphic.h (rev 0) +++ tiki/include/Tiki/gui/graphic.h 2007-11-22 08:18:01 UTC (rev 547) @@ -0,0 +1,52 @@ +/* + Tiki + + graphic.h + + Copyright (C)2007 Atani Software +*/ + + +#ifndef __TIKI_GUI_GRAPHIC_H +#define __TIKI_GUI_GRAPHIC_H + +#include "Tiki/drawable.h" +#include "Tiki/texture.h" +#include "Tiki/drawables/banner.h" +#include "Tiki/gui/widget.h" + +namespace Tiki { + +namespace GUI { + +class Graphic : public Widget { + public: + Graphic(GL::Texture *texture, const std::string name = "") : + Widget(name.size() < 1 ? std::string("image_")/* + texture->getFileName()*/ : name) { + switch(texture->getPxlfmt()) { + case GL::Texture::ARGB8888: + case GL::Texture::ARGB4444: + case GL::Texture::ARGB1555: + case GL::Texture::RGBA8888: + m_image = new GL::Banner(GL::Drawable::Trans, texture); + break; + default: + m_image = new GL::Banner(GL::Drawable::Opaque, texture); + } + } + + virtual void render(GL::Drawable::ObjType mode); + + protected: + TIKI_OBJECT_DECLS( Graphic ) + + private: + RefPtr<GL::Banner> m_image; + +}; // class Graphic + +}; // namespace GUI + +}; // namespace Tiki + +#endif // __TIKI_GUI_GRAPHIC_H Added: tiki/include/Tiki/gui/radiobutton.h =================================================================== --- tiki/include/Tiki/gui/radiobutton.h (rev 0) +++ tiki/include/Tiki/gui/radiobutton.h 2007-11-22 08:18:01 UTC (rev 547) @@ -0,0 +1,55 @@ +/* + Tiki + + radiobutton.h + + Copyright (C)2007 Atani Software +*/ + + +#ifndef __TIKI_GUI_RADIOBUTTON_H +#define __TIKI_GUI_RADIOBUTTON_H + +#include "Tiki/font.h" +#include "Tiki/drawables/label.h" +#include "Tiki/gui/widget.h" + +namespace Tiki { + +namespace GUI { + +class RadioButton : public Widget { + public: + RadioButton(const std::string & text, GL::Font * font, float size = 24.0f, const std::string & name = "") : + Widget(name.size() < 1 ? std::string("radio_") + text : name) { + m_text = new GL::Label(font, text, size, false, false); + } + + virtual void render(GL::Drawable::ObjType mode); + + protected: + TIKI_OBJECT_DECLS( RadioButton ) + + private: + RefPtr<GL::Label> m_text; +}; + +class RadioButtonGroup : public Widget { + + public: + RadioButtonGroup(const std::string name = ""); + virtual void render(GL::Drawable::ObjType mode); + + protected: + TIKI_OBJECT_DECLS( RadioButtonGroup ) + + private: + List<RadioButton> m_options; + +}; // class RadioButtonGroup + +}; // namespace GUI + +}; // namespace Tiki + +#endif // __TIKI_GUI_TEXT_H \ No newline at end of file Added: tiki/include/Tiki/gui/spinner.h =================================================================== --- tiki/include/Tiki/gui/spinner.h (rev 0) +++ tiki/include/Tiki/gui/spinner.h 2007-11-22 08:18:01 UTC (rev 547) @@ -0,0 +1,42 @@ +/* + Tiki + + spinner.h + + Copyright (C)2007 Atani Software +*/ + + +#ifndef __TIKI_GUI_SPINNER_H +#define __TIKI_GUI_SPINNER_H + +#include "Tiki/font.h" +#include "Tiki/drawables/label.h" +#include "Tiki/gui/widget.h" +#include "Tiki/gui/button.h" + +namespace Tiki { + +namespace GUI { + +class Spinner : public Widget { + public: + Spinner(int minValue, int maxValue, GL::Font * font, float size = 24.0f, const std::string name = "") : + Widget(name.size() < 1 ? std::string("spinner_")/* + text */ : name) { + //m_label = new GL::Label(font, text, size, false, false); + } + + virtual void render(GL::Drawable::ObjType mode); + + protected: + TIKI_OBJECT_DECLS( Spinner ) + + private: + +}; // class Spinner + +}; // namespace GUI + +}; // namespace Tiki + +#endif // __TIKI_GUI_SPINNER_H \ No newline at end of file Added: tiki/include/Tiki/gui/text.h =================================================================== --- tiki/include/Tiki/gui/text.h (rev 0) +++ tiki/include/Tiki/gui/text.h 2007-11-22 08:18:01 UTC (rev 547) @@ -0,0 +1,42 @@ +/* + Tiki + + text.h + + Copyright (C)2007 Atani Software +*/ + + +#ifndef __TIKI_GUI_TEXT_H +#define __TIKI_GUI_TEXT_H + +#include "Tiki/font.h" +#include "Tiki/drawables/label.h" +#include "Tiki/gui/widget.h" + +namespace Tiki { + +namespace GUI { + +class Text : public Widget { + public: + Text(const std::string & text, GL::Font * font, float size = 24.0f, const std::string name = "") : + Widget(name.size() < 1 ? std::string("text_") + text : name) { + m_label = new GL::Label(font, text, size, false, false); + } + + virtual void render(GL::Drawable::ObjType mode); + + protected: + TIKI_OBJECT_DECLS( Text ) + + private: + RefPtr<GL::Label> m_label; + +}; // class Label + +}; // namespace GUI + +}; // namespace Tiki + +#endif // __TIKI_GUI_TEXT_H \ No newline at end of file Added: tiki/include/Tiki/gui/widget.h =================================================================== --- tiki/include/Tiki/gui/widget.h (rev 0) +++ tiki/include/Tiki/gui/widget.h 2007-11-22 08:18:01 UTC (rev 547) @@ -0,0 +1,74 @@ +/* + Tiki + + widget.h + + Copyright (C)2007 Atani Software +*/ + +#ifndef __TIKI_GUI_WIDGET_H +#define __TIKI_GUI_WIDGET_H + +#include "Tiki/object.h" +#include "Tiki/vector.h" +#include "Tiki/drawable.h" +#include "Tiki/list.h" +#include "Tiki/hid.h" + +namespace Tiki { + +namespace GUI { + +/** + * + * + */ +class Widget : public Object { + public: + Widget(const std::string name) : m_name(name) { } + virtual ~Widget() {} + + virtual void render(GL::Drawable::ObjType mode) { } + + const std::string & getName() const { + return m_name; + } + + const Widget * getParent() const { + return m_parent; + } + + const Vector & getPosition() const; + + const Vector & getTranslate() const { + return m_trans; + } + + void setTranslate(const Vector & trans) { + m_trans = trans; + } + + /// Add a new Widget + void addChild( Widget *t ); + + /// Remove a child Widget + void removeChild( Widget * t ); + + virtual void processEvent(const Hid::Event & event) { } + + protected: + TIKI_OBJECT_DECLS( Widget ) + std::string m_name; + Vector m_trans; + mutable Vector m_cachedPos; + + private: + Widget *m_parent; + List<Tiki::GUI::Widget> m_children; +}; // class Widget + +}; // namespace GUI + +}; // namespace Tiki + +#endif // __TIKI_GUI_WIDGET_H \ No newline at end of file Added: tiki/include/Tiki/gui/window.h =================================================================== --- tiki/include/Tiki/gui/window.h (rev 0) +++ tiki/include/Tiki/gui/window.h 2007-11-22 08:18:01 UTC (rev 547) @@ -0,0 +1,52 @@ +/* + Tiki + + window.h + + Copyright (C)2007 Atani Software +*/ + +#ifndef __TIKI_GUI_WINDOW_H +#define __TIKI_GUI_WINDOW_H + +#include "Tiki/hid.h" +#include "Tiki/list.h" +#include "Tiki/eventcollector.h" +#include "Tiki/gui/container.h" + +namespace Tiki { + +namespace GUI { + +/** + * + * + */ +class Window : public Widget { + public: + Window(); + virtual ~Window(); + + void run(); + + bool isActive() const { + return m_active; + } + + void setActive(bool active = true) { + m_active = active; + } + + protected: + TIKI_OBJECT_DECLS( Window ) + + private: + RefPtr<Hid::EventCollector> m_ec; + bool m_active; +}; + +}; // namespace GUI + +}; // namespace Tiki + +#endif // __TIKI_GUI_WINDOW_H \ No newline at end of file Modified: tiki/osx/Tiki.xcodeproj/project.pbxproj =================================================================== --- tiki/osx/Tiki.xcodeproj/project.pbxproj 2007-11-15 18:21:33 UTC (rev 546) +++ tiki/osx/Tiki.xcodeproj/project.pbxproj 2007-11-22 08:18:01 UTC (rev 547) @@ -14,11 +14,23 @@ 2290A10109302D9F00B7D80C /* cursor.h in Headers */ = {isa = PBXBuildFile; fileRef = 2290A0FF09302D9F00B7D80C /* cursor.h */; }; 2290A10209302D9F00B7D80C /* pointerArrow.h in Headers */ = {isa = PBXBuildFile; fileRef = 2290A10009302D9F00B7D80C /* pointerArrow.h */; }; 6400608E0CDF9DC800969916 /* init_flags_default.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6400608D0CDF9DC800969916 /* init_flags_default.cpp */; }; + 6406D0440CF3C737002D832F /* button.h in Headers */ = {isa = PBXBuildFile; fileRef = 6406D0430CF3C737002D832F /* button.h */; }; + 6406D04D0CF3CBEC002D832F /* widget.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6406D04B0CF3CBEC002D832F /* widget.cpp */; }; + 6406D0540CF3CDF6002D832F /* button.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6406D0530CF3CDF6002D832F /* button.cpp */; }; 640C2C30092EB8C40032DE40 /* alpharotate.h in Headers */ = {isa = PBXBuildFile; fileRef = 640C2C2F092EB8C40032DE40 /* alpharotate.h */; }; + 642E949A0CF54A780005C8A5 /* radiobutton.h in Headers */ = {isa = PBXBuildFile; fileRef = 642E94990CF54A780005C8A5 /* radiobutton.h */; }; + 642E949E0CF54B550005C8A5 /* window.h in Headers */ = {isa = PBXBuildFile; fileRef = 642E949D0CF54B550005C8A5 /* window.h */; }; + 642E94AE0CF54DB90005C8A5 /* radiobutton.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 642E94AD0CF54DB90005C8A5 /* radiobutton.cpp */; }; + 642E94D00CF54EF10005C8A5 /* window.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 642E94CF0CF54EF10005C8A5 /* window.cpp */; }; + 642E94E50CF54FF20005C8A5 /* text.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 642E94E40CF54FF20005C8A5 /* text.cpp */; }; + 642E94E80CF5501D0005C8A5 /* graphic.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 642E94E70CF5501D0005C8A5 /* graphic.cpp */; }; + 642E95860CF561D20005C8A5 /* spinner.h in Headers */ = {isa = PBXBuildFile; fileRef = 642E95850CF561D20005C8A5 /* spinner.h */; }; + 642E958B0CF5642F0005C8A5 /* spinner.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 642E958A0CF5642F0005C8A5 /* spinner.cpp */; }; 6444BEE60932A3D800A29768 /* texturetile.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6444BEE50932A3D700A29768 /* texturetile.cpp */; }; 6444BEE80932A3F200A29768 /* texturetile.h in Headers */ = {isa = PBXBuildFile; fileRef = 6444BEE70932A3F200A29768 /* texturetile.h */; }; 644D23550CDFE82D00E7F291 /* lightbarmenu.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 644D23540CDFE82D00E7F291 /* lightbarmenu.cpp */; }; 644D23570CDFE83C00E7F291 /* lightbarmenu.h in Headers */ = {isa = PBXBuildFile; fileRef = 644D23560CDFE83C00E7F291 /* lightbarmenu.h */; }; + 64618A5B0CEBE9A000881556 /* widget.h in Headers */ = {isa = PBXBuildFile; fileRef = 64618A5A0CEBE9A000881556 /* widget.h */; }; 6499FE6A0C862377008D9FEF /* tinyxml.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6499FE660C862377008D9FEF /* tinyxml.cpp */; }; 6499FE6B0C862377008D9FEF /* tinyxml.h in Headers */ = {isa = PBXBuildFile; fileRef = 6499FE670C862377008D9FEF /* tinyxml.h */; }; 6499FE6C0C862377008D9FEF /* tinyxmlerror.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6499FE680C862377008D9FEF /* tinyxmlerror.cpp */; }; @@ -51,6 +63,8 @@ 64ED762A0C7CFB7E00D16D5C /* net.h in Headers */ = {isa = PBXBuildFile; fileRef = 64ED76280C7CFB7E00D16D5C /* net.h */; }; 64ED762C0C7CFB9400D16D5C /* platnet.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 64ED762B0C7CFB9400D16D5C /* platnet.cpp */; }; 64ED762E0C7CFBA100D16D5C /* platnet.h in Headers */ = {isa = PBXBuildFile; fileRef = 64ED762D0C7CFBA100D16D5C /* platnet.h */; }; + 64F19E9A0CF5391F0093AEAD /* text.h in Headers */ = {isa = PBXBuildFile; fileRef = 64F19E990CF5391F0093AEAD /* text.h */; }; + 64F19ECB0CF53D740093AEAD /* graphic.h in Headers */ = {isa = PBXBuildFile; fileRef = 64F19ECA0CF53D740093AEAD /* graphic.h */; }; 8DC2EF530486A6940098B216 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 089C1666FE841158C02AAC07 /* InfoPlist.strings */; }; 8DC2EF570486A6940098B216 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7B1FEA5585E11CA2CBB /* Cocoa.framework */; }; C4287F7C07C9491100D238E1 /* image.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C4287F7B07C9491100D238E1 /* image.cpp */; }; @@ -214,11 +228,23 @@ 2290A10009302D9F00B7D80C /* pointerArrow.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = pointerArrow.h; path = ../include/Tiki/drawables/pointerArrow.h; sourceTree = SOURCE_ROOT; }; 32DBCF5E0370ADEE00C91783 /* Tiki_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Tiki_Prefix.pch; sourceTree = "<group>"; }; 6400608D0CDF9DC800969916 /* init_flags_default.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = init_flags_default.cpp; sourceTree = "<group>"; }; + 6406D0430CF3C737002D832F /* button.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = button.h; path = ../include/Tiki/gui/button.h; sourceTree = SOURCE_ROOT; }; + 6406D04B0CF3CBEC002D832F /* widget.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = widget.cpp; path = ../src/gui/widget.cpp; sourceTree = SOURCE_ROOT; }; + 6406D0530CF3CDF6002D832F /* button.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = button.cpp; path = ../src/gui/button.cpp; sourceTree = SOURCE_ROOT; }; 640C2C2F092EB8C40032DE40 /* alpharotate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = alpharotate.h; path = ../include/Tiki/anims/alpharotate.h; sourceTree = SOURCE_ROOT; }; + 642E94990CF54A780005C8A5 /* radiobutton.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = radiobutton.h; path = ../include/Tiki/gui/radiobutton.h; sourceTree = SOURCE_ROOT; }; + 642E949D0CF54B550005C8A5 /* window.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = window.h; path = ../include/Tiki/gui/window.h; sourceTree = SOURCE_ROOT; }; + 642E94AD0CF54DB90005C8A5 /* radiobutton.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = radiobutton.cpp; path = ../src/gui/radiobutton.cpp; sourceTree = SOURCE_ROOT; }; + 642E94CF0CF54EF10005C8A5 /* window.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = window.cpp; path = ../src/gui/window.cpp; sourceTree = SOURCE_ROOT; }; + 642E94E40CF54FF20005C8A5 /* text.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = text.cpp; path = ../src/gui/text.cpp; sourceTree = SOURCE_ROOT; }; + 642E94E70CF5501D0005C8A5 /* graphic.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = graphic.cpp; path = ../src/gui/graphic.cpp; sourceTree = SOURCE_ROOT; }; + 642E95850CF561D20005C8A5 /* spinner.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = spinner.h; path = ../include/Tiki/gui/spinner.h; sourceTree = SOURCE_ROOT; }; + 642E958A0CF5642F0005C8A5 /* spinner.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = spinner.cpp; path = ../src/gui/spinner.cpp; sourceTree = SOURCE_ROOT; }; 6444BEE50932A3D700A29768 /* texturetile.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = texturetile.cpp; path = ../src/gl/drawables/texturetile.cpp; sourceTree = SOURCE_ROOT; }; 6444BEE70932A3F200A29768 /* texturetile.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = texturetile.h; path = ../include/Tiki/drawables/texturetile.h; sourceTree = SOURCE_ROOT; }; 644D23540CDFE82D00E7F291 /* lightbarmenu.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = lightbarmenu.cpp; path = ../src/gl/drawables/lightbarmenu.cpp; sourceTree = SOURCE_ROOT; }; 644D23560CDFE83C00E7F291 /* lightbarmenu.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = lightbarmenu.h; path = ../include/Tiki/drawables/lightbarmenu.h; sourceTree = SOURCE_ROOT; }; + 64618A5A0CEBE9A000881556 /* widget.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = widget.h; path = ../include/Tiki/gui/widget.h; sourceTree = SOURCE_ROOT; }; 6499FE660C862377008D9FEF /* tinyxml.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = tinyxml.cpp; path = ../3rdparty/tinyxml/tinyxml.cpp; sourceTree = SOURCE_ROOT; }; 6499FE670C862377008D9FEF /* tinyxml.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = tinyxml.h; path = ../3rdparty/tinyxml/tinyxml.h; sourceTree = SOURCE_ROOT; }; 6499FE680C862377008D9FEF /* tinyxmlerror.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = tinyxmlerror.cpp; path = ../3rdparty/tinyxml/tinyxmlerror.cpp; sourceTree = SOURCE_ROOT; }; @@ -251,6 +277,8 @@ 64ED76280C7CFB7E00D16D5C /* net.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = net.h; path = ../include/Tiki/net.h; sourceTree = SOURCE_ROOT; }; 64ED762B0C7CFB9400D16D5C /* platnet.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = platnet.cpp; path = src/platnet.cpp; sourceTree = "<group>"; }; 64ED762D0C7CFBA100D16D5C /* platnet.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = platnet.h; path = include/Tiki/platnet.h; sourceTree = "<group>"; }; + 64F19E990CF5391F0093AEAD /* text.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = text.h; path = ../include/Tiki/gui/text.h; sourceTree = SOURCE_ROOT; }; + 64F19ECA0CF53D740093AEAD /* graphic.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = graphic.h; path = ../include/Tiki/gui/graphic.h; sourceTree = SOURCE_ROOT; }; 8DC2EF5A0486A6940098B216 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist; path = Info.plist; sourceTree = "<group>"; }; 8DC2EF5B0486A6940098B216 /* Tiki.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Tiki.framework; sourceTree = BUILT_PRODUCTS_DIR; }; C40D72C1083723B50084B52D /* design_v2.rtf */ = {isa = PBXFileReference; lastKnownFileType = text.rtf; name = design_v2.rtf; path = ../notes/design_v2.rtf; sourceTree = SOURCE_ROOT; }; @@ -540,6 +568,34 @@ name = "Other Sources"; sourceTree = "<group>"; }; + 6406D0490CF3CBCE002D832F /* gui */ = { + isa = PBXGroup; + children = ( + 6406D0530CF3CDF6002D832F /* button.cpp */, + 642E94E70CF5501D0005C8A5 /* graphic.cpp */, + 642E94AD0CF54DB90005C8A5 /* radiobutton.cpp */, + 642E958A0CF5642F0005C8A5 /* spinner.cpp */, + 642E94E40CF54FF20005C8A5 /* text.cpp */, + 6406D04B0CF3CBEC002D832F /* widget.cpp */, + 642E94CF0CF54EF10005C8A5 /* window.cpp */, + ); + name = gui; + sourceTree = "<group>"; + }; + 64618A590CEBE97000881556 /* gui */ = { + isa = PBXGroup; + children = ( + 64618A5A0CEBE9A000881556 /* widget.h */, + 6406D0430CF3C737002D832F /* button.h */, + 64F19E990CF5391F0093AEAD /* text.h */, + 64F19ECA0CF53D740093AEAD /* graphic.h */, + 642E94990CF54A780005C8A5 /* radiobutton.h */, + 642E949D0CF54B550005C8A5 /* window.h */, + 642E95850CF561D20005C8A5 /* spinner.h */, + ); + name = gui; + sourceTree = "<group>"; + }; 6499FE520C8622D4008D9FEF /* tinyXML */ = { isa = PBXGroup; children = ( @@ -623,14 +679,15 @@ C42BD273078FC90300061670 /* Include */ = { isa = PBXGroup; children = ( - 64ED76110C7CFB2200D16D5C /* net */, C4AD531B0793CF3400E1B779 /* AutoIncluded */, C48ACAD2079B7121005DF20E /* audio */, C4AD50FD0793ABEC00E1B779 /* base */, C4F5155B079A0BDD0001D0D0 /* gl */, + 64618A590CEBE97000881556 /* gui */, C4539918079A44B300F3A584 /* hid */, C48814E4079F88460038D5B0 /* image */, C4F51576079A0C9A0001D0D0 /* math */, + 64ED76110C7CFB2200D16D5C /* net */, ); name = Include; sourceTree = "<group>"; @@ -638,13 +695,14 @@ C42BD2AD078FC94800061670 /* Source */ = { isa = PBXGroup; children = ( - 64ED75F00C7CFAC500D16D5C /* net */, C4AD52E30793CDC100E1B779 /* audio */, C42BD2D6078FC9BF00061670 /* base */, C4F51516079A0B1C0001D0D0 /* gl */, + 6406D0490CF3CBCE002D832F /* gui */, C4539923079A455600F3A584 /* hid */, C48814FE079F8A3B0038D5B0 /* image */, C4F5157D079A0CFB0001D0D0 /* math */, + 64ED75F00C7CFAC500D16D5C /* net */, C472B72C079B0FBA00F0C00A /* thread */, ); name = Source; @@ -1150,6 +1208,13 @@ 6499FE770C8623D6008D9FEF /* date.h in Headers */, 6499FEA40C8640CA008D9FEF /* cookiejar.h in Headers */, 644D23570CDFE83C00E7F291 /* lightbarmenu.h in Headers */, + 64618A5B0CEBE9A000881556 /* widget.h in Headers */, + 6406D0440CF3C737002D832F /* button.h in Headers */, + 64F19E9A0CF5391F0093AEAD /* text.h in Headers */, + 64F19ECB0CF53D740093AEAD /* graphic.h in Headers */, + 642E949A0CF54A780005C8A5 /* radiobutton.h in Headers */, + 642E949E0CF54B550005C8A5 /* window.h in Headers */, + 642E95860CF561D20005C8A5 /* spinner.h in Headers */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1374,6 +1439,13 @@ 6499FEA60C8640E5008D9FEF /* cookiejar.cpp in Sources */, 6400608E0CDF9DC800969916 /* init_flags_default.cpp in Sources */, 644D23550CDFE82D00E7F291 /* lightbarmenu.cpp in Sources */, + 6406D04D0CF3CBEC002D832F /* widget.cpp in Sources */, + 6406D0540CF3CDF6002D832F /* button.cpp in Sources */, + 642E94AE0CF54DB90005C8A5 /* radiobutton.cpp in Sources */, + 642E94D00CF54EF10005C8A5 /* window.cpp in Sources */, + 642E94E50CF54FF20005C8A5 /* text.cpp in Sources */, + 642E94E80CF5501D0005C8A5 /* graphic.cpp in Sources */, + 642E958B0CF5642F0005C8A5 /* spinner.cpp in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; Added: tiki/src/gui/button.cpp =================================================================== --- tiki/src/gui/button.cpp (rev 0) +++ tiki/src/gui/button.cpp 2007-11-22 08:18:01 UTC (rev 547) @@ -0,0 +1,23 @@ +/* + Tiki + + button.cpp + + Copyright (C)2007 Atani Software +*/ + +#include "pch.h" +#include "Tiki/widget.h" +#include "Tiki/button.h" + +using namespace Tiki::GUI; +using namespace Tiki::GL; + +TIKI_OBJECT_NAME( Button ) +TIKI_OBJECT_BEGIN( Widget, Button ) +TIKI_OBJECT_OUTLET( "click" ) +TIKI_OBJECT_END( Button ) + +void Button::render(Drawable::ObjType mode) { + +} \ No newline at end of file Added: tiki/src/gui/graphic.cpp =================================================================== --- tiki/src/gui/graphic.cpp (rev 0) +++ tiki/src/gui/graphic.cpp 2007-11-22 08:18:01 UTC (rev 547) @@ -0,0 +1,22 @@ +/* + Tiki + + graphic.cpp + + Copyright (C)2007 Atani Software +*/ + +#include "pch.h" +#include "Tiki/graphic.h" + +using namespace Tiki::GUI; +using namespace Tiki::GL; + +TIKI_OBJECT_NAME( Graphic ) +TIKI_OBJECT_BEGIN( Widget, Graphic ) +TIKI_OBJECT_OUTLET( "click" ) +TIKI_OBJECT_END( Graphic ) + +void Graphic::render(Drawable::ObjType mode) { + +} \ No newline at end of file Added: tiki/src/gui/radiobutton.cpp =================================================================== --- tiki/src/gui/radiobutton.cpp (rev 0) +++ tiki/src/gui/radiobutton.cpp 2007-11-22 08:18:01 UTC (rev 547) @@ -0,0 +1,31 @@ +/* + Tiki + + radiobutton.cpp + + Copyright (C)2007 Atani Software +*/ + +#include "pch.h" +#include "Tiki/radiobutton.h" + +using namespace Tiki::GUI; +using namespace Tiki::GL; + +TIKI_OBJECT_NAME( RadioButton ) +TIKI_OBJECT_BEGIN( Widget, RadioButton ) +TIKI_OBJECT_OUTLET( "select" ) +TIKI_OBJECT_END( RadioButton ) + +TIKI_OBJECT_NAME( RadioButtonGroup ) +TIKI_OBJECT_BEGIN( Widget, RadioButtonGroup ) +TIKI_OBJECT_OUTLET( "selection_change" ) +TIKI_OBJECT_END( RadioButtonGroup ) + +void RadioButton::render(Drawable::ObjType mode) { + +} + +void RadioButtonGroup::render(Drawable::ObjType mode) { + +} \ No newline at end of file Added: tiki/src/gui/spinner.cpp =================================================================== --- tiki/src/gui/spinner.cpp (rev 0) +++ tiki/src/gui/spinner.cpp 2007-11-22 08:18:01 UTC (rev 547) @@ -0,0 +1,22 @@ +/* + Tiki + + spinner.cpp + + Copyright (C)2007 Atani Software +*/ + +#include "pch.h" +#include "Tiki/spinner.h" + +using namespace Tiki::GUI; +using namespace Tiki::GL; + +TIKI_OBJECT_NAME( Spinner ) +TIKI_OBJECT_BEGIN( Widget, Spinner ) +TIKI_OBJECT_OUTLET( "valueChange" ) +TIKI_OBJECT_END( Spinner ) + +void Spinner::render(Drawable::ObjType mode) { + +} \ No newline at end of file Added: tiki/src/gui/text.cpp =================================================================== --- tiki/src/gui/text.cpp (rev 0) +++ tiki/src/gui/text.cpp 2007-11-22 08:18:01 UTC (rev 547) @@ -0,0 +1,21 @@ +/* + Tiki + + text.cpp + + Copyright (C)2007 Atani Software +*/ + +#include "pch.h" +#include "Tiki/text.h" + +using namespace Tiki::GUI; +using namespace Tiki::GL; + +TIKI_OBJECT_NAME( Text ) +TIKI_OBJECT_BEGIN( Widget, Text ) +TIKI_OBJECT_END( Text ) + +void Text::render(Drawable::ObjType mode) { + +} \ No newline at end of file Added: tiki/src/gui/widget.cpp =================================================================== --- tiki/src/gui/widget.cpp (rev 0) +++ tiki/src/gui/widget.cpp 2007-11-22 08:18:01 UTC (rev 547) @@ -0,0 +1,25 @@ +/* + Tiki + + widget.cpp + + Copyright (C)2007 Atani Software +*/ + +#include "pch.h" +#include "Tiki/widget.h" + +using namespace Tiki::GUI; + +TIKI_OBJECT_NAME( Widget ) +TIKI_OBJECT_BEGIN( Object, Widget ) +TIKI_OBJECT_END( Widget ) + +const Vector & Widget::getPosition() const { + Vector pos = getTranslate(); + if(m_parent) { + pos += m_trans; + } + m_cachedPos = pos; + return m_cachedPos; +} \ No newline at end of file Added: tiki/src/gui/widget.h =================================================================== --- tiki/src/gui/widget.h (rev 0) +++ tiki/src/gui/widget.h 2007-11-22 08:18:01 UTC (rev 547) @@ -0,0 +1,9 @@ +/* + * widget.h + * Tiki + * + * Created by Atani on 11/20/07. + * Copyright 2007 __MyCompanyName__. All rights reserved. + * + */ + Added: tiki/src/gui/window.cpp =================================================================== --- tiki/src/gui/window.cpp (rev 0) +++ tiki/src/gui/window.cpp 2007-11-22 08:18:01 UTC (rev 547) @@ -0,0 +1,22 @@ +/* + Tiki + + window.cpp + + Copyright (C)2007 Atani Software +*/ + +#include "pch.h" +#include "Tiki/window.h" + +using namespace Tiki::GUI; + +TIKI_OBJECT_NAME( Window ) +TIKI_OBJECT_BEGIN( Widget, Window ) +TIKI_OBJECT_OUTLET( "idle" ) +TIKI_OBJECT_OUTLET( "inputEvent" ) +TIKI_OBJECT_END( Window ) + +void Window::run() { + +} \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <at...@us...> - 2007-11-15 18:21:35
|
Revision: 546 http://cadcdev.svn.sourceforge.net/cadcdev/?rev=546&view=rev Author: atani Date: 2007-11-15 10:21:33 -0800 (Thu, 15 Nov 2007) Log Message: ----------- removed debug_console bits, moved ascii_font init bit into SubConsole constructor, made CXXFLAGS consume existing flags for NDS builds (allows projects to specify them in the calling makefile) Modified Paths: -------------- tiki/include/Tiki/drawables/console.h tiki/nds/Makefile.rules tiki/nds/src/init_shutdown.cpp tiki/src/gl/drawables/console.cpp Modified: tiki/include/Tiki/drawables/console.h =================================================================== --- tiki/include/Tiki/drawables/console.h 2007-11-14 00:50:31 UTC (rev 545) +++ tiki/include/Tiki/drawables/console.h 2007-11-15 18:21:33 UTC (rev 546) @@ -72,9 +72,7 @@ } void disable(int code) { - if(m_features & code) { - m_features ^= code; - } + m_features &= ~code; } int getFeatures() { Modified: tiki/nds/Makefile.rules =================================================================== --- tiki/nds/Makefile.rules 2007-11-14 00:50:31 UTC (rev 545) +++ tiki/nds/Makefile.rules 2007-11-15 18:21:33 UTC (rev 546) @@ -17,7 +17,7 @@ TIKI_BASE_LIBS=-ltiki -L$(DEVKITPRO)/libnds/lib -ldswifi9 -lfat -lnds9 -CXXFLAGS=-I$(DEVKITPRO)/libnds/include +CXXFLAGS+=-I$(DEVKITPRO)/libnds/include CXXFLAGS+=-I$(TIKI_DIR)/include CXXFLAGS+=-I$(TIKI_DIR)/nds/include -g CXXFLAGS+=-I$(TIKI_DIR)/3rdparty/zlib Modified: tiki/nds/src/init_shutdown.cpp =================================================================== --- tiki/nds/src/init_shutdown.cpp 2007-11-14 00:50:31 UTC (rev 545) +++ tiki/nds/src/init_shutdown.cpp 2007-11-15 18:21:33 UTC (rev 546) @@ -24,10 +24,6 @@ SendCommandToArm7( 0x87654321 ); } -Tiki::GL::NDSSubScreenConsole *debug_console = NULL; -extern const u8 ascii_font_bin[]; -extern const u32 ascii_font_bin_size; - namespace Tiki { bool init( int argc, char **argv ) { @@ -38,14 +34,6 @@ if(g_tiki_init_flags & TIKI_INIT_DEBUG_CONSOLE) { consoleDemoInit(); - /* - videoSetModeSub( MODE_0_2D | DISPLAY_BG0_ACTIVE | DISPLAY_BG1_ACTIVE ); - SUB_BG0_CR = BG_64x32 | BG_COLOR_16 | BG_MAP_BASE( 0 ) | BG_TILE_BASE( 1 ); - SUB_BG1_CR = BG_64x32 | BG_COLOR_16 | BG_MAP_BASE( 2 ) | BG_TILE_BASE( 1 ); - vramSetBankC( VRAM_C_SUB_BG ); - memcpy( ( void * )BG_TILE_RAM_SUB( 1 ), ascii_font_bin, ascii_font_bin_size ); - debug_console = new Tiki::GL::NDSSubScreenConsole( 32, 24 ); - */ } // Setup the Main screen for 3D Modified: tiki/src/gl/drawables/console.cpp =================================================================== --- tiki/src/gl/drawables/console.cpp 2007-11-14 00:50:31 UTC (rev 545) +++ tiki/src/gl/drawables/console.cpp 2007-11-15 18:21:33 UTC (rev 546) @@ -38,12 +38,13 @@ m_charData.resize( rows * cols, 0 ); m_colorData.resize( rows * cols, 0 ); - m_texture->select(); - + if(m_texture != NULL) { + m_texture->select(); #if TIKI_PLAT != TIKI_DC && TIKI_PLAT != TIKI_NDS - glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST ); - glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST ); + glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST ); + glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST ); #endif + } m_cursor_x = 0; m_cursor_y = 0; @@ -527,7 +528,17 @@ #if TIKI_PLAT == TIKI_NDS -NDSSubScreenConsole::NDSSubScreenConsole(int cols, int rows) : Console(cols, rows, NULL) { + +extern const u8 ascii_font_bin[]; +extern const u32 ascii_font_bin_size; + +NDSSubScreenConsole::NDSSubScreenConsole(int cols, int rows) : Console(cols, rows, NULL) { + videoSetModeSub( MODE_0_2D | DISPLAY_BG0_ACTIVE | DISPLAY_BG1_ACTIVE ); + SUB_BG0_CR = BG_64x32 | BG_COLOR_16 | BG_MAP_BASE( 0 ) | BG_TILE_BASE( 1 ); + SUB_BG1_CR = BG_64x32 | BG_COLOR_16 | BG_MAP_BASE( 2 ) | BG_TILE_BASE( 1 ); + vramSetBankC( VRAM_C_SUB_BG ); + dmaCopy( ( uint16 * )BG_TILE_RAM_SUB( 1 ), (uint16 *)ascii_font_bin, ascii_font_bin_size ); + BG_PALETTE_SUB[ ( 16 * 0 ) + 1 ] = RGB15( 0, 0, 0 ); BG_PALETTE_SUB[ ( 16 * 1 ) + 1 ] = RGB15( 0, 0, 15 ); BG_PALETTE_SUB[ ( 16 * 2 ) + 1 ] = RGB15( 0, 15, 0 ); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <at...@us...> - 2007-11-14 00:50:34
|
Revision: 545 http://cadcdev.svn.sourceforge.net/cadcdev/?rev=545&view=rev Author: atani Date: 2007-11-13 16:50:31 -0800 (Tue, 13 Nov 2007) Log Message: ----------- event support for Console ANSI detect sequence Modified Paths: -------------- tiki/include/Tiki/drawables/console.h tiki/include/Tiki/net/socket.h tiki/src/gl/drawables/console.cpp Modified: tiki/include/Tiki/drawables/console.h =================================================================== --- tiki/include/Tiki/drawables/console.h 2007-11-14 00:28:15 UTC (rev 544) +++ tiki/include/Tiki/drawables/console.h 2007-11-14 00:50:31 UTC (rev 545) @@ -159,6 +159,8 @@ Frame::finish(); } + TIKI_OBJECT_DECLS( Console ) + private: RefPtr<Texture> m_texture; Color m_palette[8]; Modified: tiki/include/Tiki/net/socket.h =================================================================== --- tiki/include/Tiki/net/socket.h 2007-11-14 00:28:15 UTC (rev 544) +++ tiki/include/Tiki/net/socket.h 2007-11-14 00:50:31 UTC (rev 545) @@ -104,7 +104,7 @@ return m_sent; } protected: - TIKI_OBJECT_DECLS( Socket ) + TIKI_OBJECT_DECLS( SocketProgress ) private: size_t m_expected; size_t m_received; Modified: tiki/src/gl/drawables/console.cpp =================================================================== --- tiki/src/gl/drawables/console.cpp 2007-11-14 00:28:15 UTC (rev 544) +++ tiki/src/gl/drawables/console.cpp 2007-11-14 00:50:31 UTC (rev 545) @@ -15,6 +15,11 @@ using namespace Tiki::GL; +TIKI_OBJECT_NAME( Console ) +TIKI_OBJECT_BEGIN( Drawable, Console ) +TIKI_OBJECT_OUTLET( "ansidetect_request" ) +TIKI_OBJECT_END( Console ) + Console::Console( int cols, int rows, Texture * texture ) { m_texture = texture; @@ -409,7 +414,7 @@ m_save_x = m_save_y = 0; break; case 'n': // ANSI detect - //remoteHost->write("\x1b[1;1R", 6); + emit( "ansidetect_request", this ); break; case 'k': case 'K': // clear EOL This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <at...@us...> - 2007-11-14 00:28:17
|
Revision: 544 http://cadcdev.svn.sourceforge.net/cadcdev/?rev=544&view=rev Author: atani Date: 2007-11-13 16:28:15 -0800 (Tue, 13 Nov 2007) Log Message: ----------- enable/disable features for Console Modified Paths: -------------- tiki/examples/console/TikiSnake/src/snake.cpp tiki/examples/net/httpclient/src/main.cpp tiki/examples/sound/sfx/src/main.cpp tiki/include/Tiki/drawables/console.h tiki/src/gl/drawables/console.cpp Property Changed: ---------------- tiki/examples/events/ Modified: tiki/examples/console/TikiSnake/src/snake.cpp =================================================================== --- tiki/examples/console/TikiSnake/src/snake.cpp 2007-11-11 20:50:23 UTC (rev 543) +++ tiki/examples/console/TikiSnake/src/snake.cpp 2007-11-14 00:28:15 UTC (rev 544) @@ -79,8 +79,8 @@ ct->setSize(screenExtents.x, screenExtents.y); screenExtents *= 0.5f; ct->setTranslate(screenExtents); - ct->setAutoScroll( 0 ); - ct->setAutoWrap( 0 ); + ct->disable( AUTO_SCROLL ); + ct->disable( AUTO_WRAP ); //initialize the board for ( x = 0;x < BOARD_X;x++ ) { Property changes on: tiki/examples/events ___________________________________________________________________ Name: svn:ignore - Debug Release build *.user *.nds *.ds.gba + Debug Release build *.user *.nds *.ds.gba tikievents Modified: tiki/examples/net/httpclient/src/main.cpp =================================================================== --- tiki/examples/net/httpclient/src/main.cpp 2007-11-11 20:50:23 UTC (rev 543) +++ tiki/examples/net/httpclient/src/main.cpp 2007-11-14 00:28:15 UTC (rev 544) @@ -89,8 +89,8 @@ console->setSize(screenExtents.x, screenExtents.y); screenExtents *= 0.5f; console->setTranslate(screenExtents); - console->setAutoWrap( true ); - console->setAutoScroll( true ); + console->enable( AUTO_WRAP ); + console->enable( AUTO_SCROLL ); console->color( BLACK, GREY ); console->clear(); Modified: tiki/examples/sound/sfx/src/main.cpp =================================================================== --- tiki/examples/sound/sfx/src/main.cpp 2007-11-11 20:50:23 UTC (rev 543) +++ tiki/examples/sound/sfx/src/main.cpp 2007-11-14 00:28:15 UTC (rev 544) @@ -88,8 +88,8 @@ console->setSize(screenExtents.x, screenExtents.y); screenExtents *= 0.5f; console->setTranslate(screenExtents); - console->setAutoWrap( true ); - console->setAutoScroll( true ); + console->enable( AUTO_WRAP ); + console->enable( AUTO_SCROLL ); console->color( BLACK, GREY ); console->clear(); Modified: tiki/include/Tiki/drawables/console.h =================================================================== --- tiki/include/Tiki/drawables/console.h 2007-11-11 20:50:23 UTC (rev 543) +++ tiki/include/Tiki/drawables/console.h 2007-11-14 00:28:15 UTC (rev 544) @@ -40,6 +40,17 @@ INVISIBLE = 0xA000 }; + enum ConsoleFeatures { + BACKSPACE_PROCESSING = 0x0001, + NEWLINE_PROCESSING = 0x0002, + CARRIAGE_RETURN_PROCESSING = 0x0004, + CLEAR_SCREEN_PROCESSING = 0x0008, + ANSI_PROCESSING = 0x0010, + AUTO_SCROLL = 0x0020, + AUTO_WRAP = 0x0040, + AUTO_REFRESH = 0x0080 + }; + /** Console -- Console displays an array of fixed width characters. */ class Console : public Drawable { public: @@ -56,22 +67,20 @@ void scroll(int rows, int top, int left, int bottom, int right); void scroll(int rows); - void setAutoScroll(bool s) { - m_autoScroll = s; + void enable(int code) { + m_features |= code; } - void setAutoWrap(bool w) { - m_autoWrap = w; + void disable(int code) { + if(m_features & code) { + m_features ^= code; + } } - void setAutoRefresh(bool r) { - m_autoRefresh = r; + int getFeatures() { + return m_features; } - void setANSI(bool a) { - m_ansi = a; - } - char getChar(int x, int y) { assert(x<m_cols && y<m_rows); return m_charData[(y*m_cols) + x]; @@ -92,17 +101,17 @@ m_colorData[(y*m_cols) + x] = attr; } - int getRows() { - return m_rows; - } - - int getCols() { - return m_cols; + int getRows() { + return m_rows; } - - Tiki::Math::Vector getSize() const { - return Tiki::Math::Vector(m_w, m_h, 0.0f); + + int getCols() { + return m_cols; } + + Tiki::Math::Vector getSize() const { + return Tiki::Math::Vector(m_w, m_h, 0.0f); + } Console& operator <<(std::string input) { printf("%s",input.c_str()); @@ -153,8 +162,7 @@ private: RefPtr<Texture> m_texture; Color m_palette[8]; - bool m_autoScroll, m_autoWrap, m_autoRefresh; - bool m_ansi; + int m_features; int m_cursor_x, m_cursor_y; int m_save_x, m_save_y; int m_attr; Modified: tiki/src/gl/drawables/console.cpp =================================================================== --- tiki/src/gl/drawables/console.cpp 2007-11-11 20:50:23 UTC (rev 543) +++ tiki/src/gl/drawables/console.cpp 2007-11-14 00:28:15 UTC (rev 544) @@ -42,12 +42,11 @@ m_cursor_x = 0; m_cursor_y = 0; + + enable( BACKSPACE_PROCESSING | NEWLINE_PROCESSING | CARRIAGE_RETURN_PROCESSING ); + enable( AUTO_SCROLL ); + enable( AUTO_WRAP ); - m_autoScroll = true; - m_autoWrap = true; - m_ansi = false; - m_autoRefresh = false; - color( GREY, BLACK ); clear(); } @@ -80,7 +79,7 @@ m_cursor_y = 0; ansiptr = 0; - if ( m_autoRefresh ) + if ( m_features & AUTO_REFRESH ) refresh(); } @@ -105,7 +104,7 @@ } } - if ( m_autoRefresh ) + if ( m_features & AUTO_REFRESH ) refresh(); } @@ -160,7 +159,7 @@ processAnsiString(); } } - else if ( buf[ i ] == '\x1b' && m_ansi ) + else if ( buf[ i ] == '\x1b' && ( m_features & ANSI_PROCESSING ) ) { ansistr[ 0 ] = buf[ i ]; ansiptr = 1; @@ -186,18 +185,19 @@ m_cursor_x = 0; continue; } - else if ( buf[ i ] == 12 ) - { // funky old style clearscreen + else if ( buf[ i ] == 12 && ( m_features & CLEAR_SCREEN_PROCESSING ) ) + { + // funky old style clearscreen clear(); continue; } - if ( m_cursor_x >= m_cols && m_autoWrap ) + if ( m_cursor_x >= m_cols && ( m_features & AUTO_WRAP ) ) { m_cursor_y++; m_cursor_x = 0; } - if ( m_cursor_y >= m_rows && m_autoScroll ) + if ( m_cursor_y >= m_rows && ( m_features & AUTO_SCROLL ) ) { scroll( 1 ); m_cursor_y = m_rows - 1; @@ -213,7 +213,7 @@ } } - if ( m_autoRefresh ) + if ( m_features & AUTO_REFRESH ) refresh(); } @@ -540,8 +540,7 @@ BG_PALETTE_SUB[ ( 16 * 14 ) + 1 ] = RGB15( 31, 31, 0 ); BG_PALETTE_SUB[ ( 16 * 15 ) + 1 ] = RGB15( 31, 31, 31 ); - setANSI(true); - setAutoRefresh(true); + enable( ANSI_PROCESSING | AUTO_REFRESH ); } // use the following value to ensure the background is visible when rendered This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <at...@us...> - 2007-11-11 20:50:37
|
Revision: 543 http://cadcdev.svn.sourceforge.net/cadcdev/?rev=543&view=rev Author: atani Date: 2007-11-11 12:50:23 -0800 (Sun, 11 Nov 2007) Log Message: ----------- added NDS support to color3, updated paths in xcode project Modified Paths: -------------- tiki/include/Tiki/color.h tiki/include/Tiki/color3.h tiki/osx/Tiki.xcodeproj/project.pbxproj Modified: tiki/include/Tiki/color.h =================================================================== --- tiki/include/Tiki/color.h 2007-11-11 20:14:56 UTC (rev 542) +++ tiki/include/Tiki/color.h 2007-11-11 20:50:23 UTC (rev 543) @@ -86,7 +86,6 @@ #else glColor(pack1555(r, g, b, a)); #endif - } static uint32 pack( float a, float r, float g, float b ) { Modified: tiki/include/Tiki/color3.h =================================================================== --- tiki/include/Tiki/color3.h 2007-11-11 20:14:56 UTC (rev 542) +++ tiki/include/Tiki/color3.h 2007-11-11 20:50:23 UTC (rev 543) @@ -56,9 +56,12 @@ } void select() const { - glColor4f( r, g, b, 1.0f ); +#if TIKI_PLAT != TIKI_NDS + glColor4f( r, g, b, 1.0 ); +#else + glColor(Color.pack1555(r, g, b, 1.0)); +#endif } - float r, g, b; }; Modified: tiki/osx/Tiki.xcodeproj/project.pbxproj =================================================================== --- tiki/osx/Tiki.xcodeproj/project.pbxproj 2007-11-11 20:14:56 UTC (rev 542) +++ tiki/osx/Tiki.xcodeproj/project.pbxproj 2007-11-11 20:50:23 UTC (rev 543) @@ -653,10 +653,10 @@ C42BD2D6078FC9BF00061670 /* base */ = { isa = PBXGroup; children = ( - 6400608D0CDF9DC800969916 /* init_flags_default.cpp */, C4AD53070793CE9F00E1B779 /* debug.cpp */, C4F5148D0799FBA10001D0D0 /* endian.cpp */, C4AD52290793B4CD00E1B779 /* file.cpp */, + 6400608D0CDF9DC800969916 /* init_flags_default.cpp */, C480A22E0835BEA6006AEE4B /* object.cpp */, C45D0B90083F030200F9F467 /* timeline.cpp */, C45D0B91083F030200F9F467 /* timepoint.cpp */, @@ -686,12 +686,12 @@ C42BD4B0078FCB0A00061670 /* Source */ = { isa = PBXGroup; children = ( - 64ED762B0C7CFB9400D16D5C /* platnet.cpp */, - C498925907EE98040050854A /* platgl.cpp */, - C498925707EE97E70050854A /* TikiMain.m */, C4B5838C0794CFC7004D22F2 /* init_shutdown.cpp */, C453994A079A509100F3A584 /* plathid.mm */, + C498925907EE98040050854A /* platgl.cpp */, + 64ED762B0C7CFB9400D16D5C /* platnet.cpp */, C472B717079AFA0200F0C00A /* platthread.cpp */, + C498925707EE97E70050854A /* TikiMain.m */, C4539A1B079AF3D100F3A584 /* tikitime.cpp */, ); name = Source; @@ -700,9 +700,9 @@ C42BD4B1078FCB0E00061670 /* Include */ = { isa = PBXGroup; children = ( - 64ED762D0C7CFBA100D16D5C /* platnet.h */, C4AD527D0793C96A00E1B779 /* glhdrs.h */, C42BD4B3078FCB5A00061670 /* pch.h */, + 64ED762D0C7CFBA100D16D5C /* platnet.h */, C472B719079AFA1600F0C00A /* platthread.h */, C4F51501079A05B70001D0D0 /* TikiMain.h */, C4AD510E0793AC2F00E1B779 /* tikitypes.h */, @@ -713,9 +713,9 @@ C42BD4F1078FCEA200061670 /* Notes */ = { isa = PBXGroup; children = ( + C42BD4F4078FCEC300061670 /* design.rtf */, C40D72C1083723B50084B52D /* design_v2.rtf */, C40D72C2083723B50084B52D /* drawing_model.txt */, - C42BD4F4078FCEC300061670 /* design.rtf */, ); name = Notes; sourceTree = "<group>"; @@ -779,17 +779,17 @@ C4AD50FD0793ABEC00E1B779 /* base */ = { isa = PBXGroup; children = ( + C4AD50E30793ABA000E1B779 /* debug.h */, 64ED76270C7CFB7E00D16D5C /* endian.h */, - 64ED76280C7CFB7E00D16D5C /* net.h */, - C4EAEB1F08678F1F003F5342 /* TikiAll.h */, - C4AD50E30793ABA000E1B779 /* debug.h */, C4AD522B0793B4E300E1B779 /* file.h */, C4AD50EB0793ABA000E1B779 /* list.h */, + 64ED76280C7CFB7E00D16D5C /* net.h */, C480A2360835BEF0006AEE4B /* object.h */, C4AD50EE0793ABA000E1B779 /* refcnt.h */, C4ACBDA30837CFFD00FA287E /* scene.h */, C40D72F9083730CB0084B52D /* tee.h */, C472B702079AF7A300F0C00A /* thread.h */, + C4EAEB1F08678F1F003F5342 /* TikiAll.h */, C4AD50F10793ABA000E1B779 /* tikitime.h */, C40D72CE083729BD0084B52D /* timeline.h */, C40D72D108372B3A0084B52D /* timepoint.h */, @@ -1007,7 +1007,6 @@ children = ( C4F5154B079A0B9E0001D0D0 /* alphafader.cpp */, C4F5154C079A0B9E0001D0D0 /* expxymover.cpp */, - 644D23540CDFE82D00E7F291 /* lightbarmenu.cpp */, C4F5154D079A0B9E0001D0D0 /* logxymover.cpp */, C4F5154E079A0B9E0001D0D0 /* tintfader.cpp */, ); @@ -1017,10 +1016,11 @@ C4F51549079A0B840001D0D0 /* drawables */ = { isa = PBXGroup; children = ( + C4F51553079A0BAE0001D0D0 /* banner.cpp */, 223226800A165A600035025E /* console.cpp */, - C4F51553079A0BAE0001D0D0 /* banner.cpp */, 2290A0FB09302D7500B7D80C /* cursor.cpp */, C4F51554079A0BAE0001D0D0 /* label.cpp */, + 644D23540CDFE82D00E7F291 /* lightbarmenu.cpp */, 2290A0FC09302D7500B7D80C /* pointerArrow.cpp */, 6444BEE50932A3D700A29768 /* texturetile.cpp */, ); @@ -1039,7 +1039,6 @@ C4F5155B079A0BDD0001D0D0 /* gl */ = { isa = PBXGroup; children = ( - 644D23560CDFE83C00E7F291 /* lightbarmenu.h */, C4F51568079A0C480001D0D0 /* anims */, C4F51569079A0C4E0001D0D0 /* drawables */, C4F5156A079A0C560001D0D0 /* triggers */, @@ -1059,11 +1058,11 @@ C4F51568079A0C480001D0D0 /* anims */ = { isa = PBXGroup; children = ( + C4F5156B079A0C6C0001D0D0 /* alphafader.h */, 640C2C2F092EB8C40032DE40 /* alpharotate.h */, - 64D758F3092EB9A5002667EE /* sleep.h */, - C4F5156B079A0C6C0001D0D0 /* alphafader.h */, C4F5156C079A0C6C0001D0D0 /* expxymover.h */, C4F5156D079A0C6C0001D0D0 /* logxymover.h */, + 64D758F3092EB9A5002667EE /* sleep.h */, C4F5156E079A0C6C0001D0D0 /* tintfader.h */, ); name = anims; @@ -1072,13 +1071,14 @@ C4F51569079A0C4E0001D0D0 /* drawables */ = { isa = PBXGroup; children = ( + C4F5156F079A0C7D0001D0D0 /* banner.h */, 223226820A165A7A0035025E /* console.h */, - 6444BEE70932A3F200A29768 /* texturetile.h */, 2290A0FF09302D9F00B7D80C /* cursor.h */, - 2290A10009302D9F00B7D80C /* pointerArrow.h */, - C4F5156F079A0C7D0001D0D0 /* banner.h */, C4F51570079A0C7D0001D0D0 /* label.h */, C4ACBDA00837CF6400FA287E /* layer.h */, + 644D23560CDFE83C00E7F291 /* lightbarmenu.h */, + 2290A10009302D9F00B7D80C /* pointerArrow.h */, + 6444BEE70932A3F200A29768 /* texturetile.h */, ); name = drawables; sourceTree = "<group>"; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <c99...@us...> - 2007-11-11 20:14:59
|
Revision: 542 http://cadcdev.svn.sourceforge.net/cadcdev/?rev=542&view=rev Author: c99koder Date: 2007-11-11 12:14:56 -0800 (Sun, 11 Nov 2007) Log Message: ----------- Tiki: Add getSize, getRows, and getCols methods to Console Modified Paths: -------------- tiki/include/Tiki/drawables/console.h Modified: tiki/include/Tiki/drawables/console.h =================================================================== --- tiki/include/Tiki/drawables/console.h 2007-11-10 19:06:26 UTC (rev 541) +++ tiki/include/Tiki/drawables/console.h 2007-11-11 20:14:56 UTC (rev 542) @@ -40,7 +40,7 @@ INVISIBLE = 0xA000 }; - /** ConsoleText -- ConsoleText displays an array of fixed width characters. */ + /** Console -- Console displays an array of fixed width characters. */ class Console : public Drawable { public: Console(int cols, int rows, Texture * texture); @@ -92,6 +92,18 @@ m_colorData[(y*m_cols) + x] = attr; } + int getRows() { + return m_rows; + } + + int getCols() { + return m_cols; + } + + Tiki::Math::Vector getSize() const { + return Tiki::Math::Vector(m_w, m_h, 0.0f); + } + Console& operator <<(std::string input) { printf("%s",input.c_str()); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <c99...@us...> - 2007-11-10 19:08:08
|
Revision: 541 http://cadcdev.svn.sourceforge.net/cadcdev/?rev=541&view=rev Author: c99koder Date: 2007-11-10 11:06:26 -0800 (Sat, 10 Nov 2007) Log Message: ----------- TIki: NDS: Start the wifi timers so the ARM7 doesn't hang Modified Paths: -------------- tiki/nds/src/init_shutdown.cpp Modified: tiki/nds/src/init_shutdown.cpp =================================================================== --- tiki/nds/src/init_shutdown.cpp 2007-11-07 20:11:05 UTC (rev 540) +++ tiki/nds/src/init_shutdown.cpp 2007-11-10 19:06:26 UTC (rev 541) @@ -11,6 +11,7 @@ #include "Tiki/sound.h" #include "Tiki/stream.h" #include "Tiki/hid.h" +#include "Tiki/net.h" #include "Tiki/drawables/console.h" #include <nds.h> @@ -110,6 +111,8 @@ Hid::init(); } + Tiki::Net::init(); + Tiki::Debug::printf("Initializing ARM7\n"); // enable & clear FIFO REG_IPC_FIFO_CR = IPC_FIFO_ENABLE | IPC_FIFO_SEND_CLEAR; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |