diff --git a/apps/telnet65.s b/apps/telnet65.s index db3afb2..c20412b 100644 --- a/apps/telnet65.s +++ b/apps/telnet65.s @@ -3,6 +3,7 @@ .include "../inc/common.i" .include "../inc/commonprint.i" .include "../inc/net.i" +.include "../inc/error.i" .export start diff --git a/inc/common.i b/inc/common.i index 6b36d61..73b8219 100644 --- a/inc/common.i +++ b/inc/common.i @@ -1,7 +1,3 @@ -.ifndef COMMON__I__ - -COMMON__I__ = 1 - ; load A/X macro .macro ldax arg .if (.match (.left (1, arg), #)) ; immediate mode @@ -42,8 +38,6 @@ COMMON__I__ = 1 pla .endmacro -.endif - ; -- LICENSE FOR common.i -- diff --git a/inc/commonprint.i b/inc/commonprint.i index 03bbdbf..198c287 100644 --- a/inc/commonprint.i +++ b/inc/commonprint.i @@ -2,11 +2,7 @@ SCREEN_WIDTH = 40 .endif -.ifndef KPR_API_VERSION_NUMBER - .define EQU = - .include "zeropage.inc" - .include "../inc/kipper_constants.i" -.endif +.include "zeropage.inc" .export print_hex .export print_ip_config diff --git a/inc/error.i b/inc/error.i new file mode 100644 index 0000000..f22fb14 --- /dev/null +++ b/inc/error.i @@ -0,0 +1,33 @@ +KPR_ERROR_PORT_IN_USE = $80 +KPR_ERROR_TIMEOUT_ON_RECEIVE = $81 +KPR_ERROR_TRANSMIT_FAILED = $82 +KPR_ERROR_TRANSMISSION_REJECTED_BY_PEER = $83 +KPR_ERROR_INPUT_TOO_LARGE = $84 +KPR_ERROR_DEVICE_FAILURE = $85 +KPR_ERROR_ABORTED_BY_USER = $86 +KPR_ERROR_LISTENER_NOT_AVAILABLE = $87 +KPR_ERROR_CONNECTION_RESET_BY_PEER = $89 +KPR_ERROR_CONNECTION_CLOSED = $8A +KPR_ERROR_MALFORMED_URL = $A0 +KPR_ERROR_DNS_LOOKUP_FAILED = $A1 + + + +; -- LICENSE FOR error.i -- +; The contents of this file are subject to the Mozilla Public License +; Version 1.1 (the "License"); you may not use this file except in +; compliance with the License. You may obtain a copy of the License at +; http://www.mozilla.org/MPL/ +; +; Software distributed under the License is distributed on an "AS IS" +; basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +; License for the specific language governing rights and limitations +; under the License. +; +; The Original Code is ip65. +; +; The Initial Developer of the Original Code is Jonno Downes, +; jonno@jamtronix.com. +; Portions created by the Initial Developer are Copyright (C) 2009 +; Jonno Downes. All Rights Reserved. +; -- LICENSE END -- diff --git a/inc/kipper_constants.i b/inc/kipper_constants.i deleted file mode 100644 index 85cff1e..0000000 --- a/inc/kipper_constants.i +++ /dev/null @@ -1,39 +0,0 @@ -; constants for accessing the KPR API file -; to use this file under CA65 add ".define EQU =" to your code before this file is included. - -KPR_API_VERSION_NUMBER EQU $01 - -; error codes (as returned by KPR_GET_LAST_ERROR) -KPR_ERROR_PORT_IN_USE EQU $80 -KPR_ERROR_TIMEOUT_ON_RECEIVE EQU $81 -KPR_ERROR_TRANSMIT_FAILED EQU $82 -KPR_ERROR_TRANSMISSION_REJECTED_BY_PEER EQU $83 -KPR_ERROR_INPUT_TOO_LARGE EQU $84 -KPR_ERROR_DEVICE_FAILURE EQU $85 -KPR_ERROR_ABORTED_BY_USER EQU $86 -KPR_ERROR_LISTENER_NOT_AVAILABLE EQU $87 -KPR_ERROR_CONNECTION_RESET_BY_PEER EQU $89 -KPR_ERROR_CONNECTION_CLOSED EQU $8A -KPR_ERROR_MALFORMED_URL EQU $A0 -KPR_ERROR_DNS_LOOKUP_FAILED EQU $A1 - - - -; -- LICENSE FOR kipper_constants.i -- -; The contents of this file are subject to the Mozilla Public License -; Version 1.1 (the "License"); you may not use this file except in -; compliance with the License. You may obtain a copy of the License at -; http://www.mozilla.org/MPL/ -; -; Software distributed under the License is distributed on an "AS IS" -; basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the -; License for the specific language governing rights and limitations -; under the License. -; -; The Original Code is ip65. -; -; The Initial Developer of the Original Code is Jonno Downes, -; jonno@jamtronix.com. -; Portions created by the Initial Developer are Copyright (C) 2009 -; Jonno Downes. All Rights Reserved. -; -- LICENSE END -- diff --git a/ip65/dhcp.s b/ip65/dhcp.s index 4e18525..afd97f9 100644 --- a/ip65/dhcp.s +++ b/ip65/dhcp.s @@ -10,11 +10,7 @@ MAX_DHCP_MESSAGES_SENT = 12 ; timeout after sending 12 messages will be about 15 seconds (1+2+3...)/4 .include "../inc/common.i" - -.ifndef KPR_API_VERSION_NUMBER - .define EQU = - .include "../inc/kipper_constants.i" -.endif +.include "../inc/error.i" .export dhcp_init .import dhcp_server diff --git a/ip65/dns.s b/ip65/dns.s index d4c4f83..95f1c7d 100644 --- a/ip65/dns.s +++ b/ip65/dns.s @@ -4,11 +4,7 @@ MAX_DNS_MESSAGES_SENT = 8 ; timeout after sending 8 messages will be about .include "zeropage.inc" .include "../inc/common.i" - -.ifndef KPR_API_VERSION_NUMBER - .define EQU = - .include "../inc/kipper_constants.i" -.endif +.include "../inc/error.i" .export dns_set_hostname .export dns_resolve diff --git a/ip65/http.s b/ip65/http.s index 60624b9..3ad9f8a 100644 --- a/ip65/http.s +++ b/ip65/http.s @@ -6,11 +6,6 @@ .include "zeropage.inc" .include "../inc/common.i" -.ifndef KPR_API_VERSION_NUMBER - .define EQU = - .include "../inc/kipper_constants.i" -.endif - .export http_parse_request .export http_get_value diff --git a/ip65/httpd.s b/ip65/httpd.s index 647d19a..02472b2 100644 --- a/ip65/httpd.s +++ b/ip65/httpd.s @@ -3,11 +3,7 @@ .include "zeropage.inc" .include "../inc/common.i" - -.ifndef KPR_API_VERSION_NUMBER - .define EQU = - .include "../inc/kipper_constants.i" -.endif +.include "../inc/error.i" HTTPD_TIMEOUT_SECONDS = 5 ; what's the maximum time we let 1 connection be open for? diff --git a/ip65/icmp.s b/ip65/icmp.s index 2d9df17..73d9533 100644 --- a/ip65/icmp.s +++ b/ip65/icmp.s @@ -1,11 +1,7 @@ ; ICMP implementation .include "../inc/common.i" - -.ifndef KPR_API_VERSION_NUMBER - .define EQU = - .include "../inc/kipper_constants.i" -.endif +.include "../inc/error.i" .export icmp_init .export icmp_process diff --git a/ip65/ip65.s b/ip65/ip65.s index 7f4d1ee..b13b732 100644 --- a/ip65/ip65.s +++ b/ip65/ip65.s @@ -1,11 +1,7 @@ ; ip65 main routines .include "../inc/common.i" - -.ifndef KPR_API_VERSION_NUMBER - .define EQU = - .include "../inc/kipper_constants.i" -.endif +.include "../inc/error.i" .export ip65_init .export ip65_process diff --git a/ip65/parser.s b/ip65/parser.s index f11abaf..3ee49f4 100644 --- a/ip65/parser.s +++ b/ip65/parser.s @@ -8,11 +8,6 @@ .include "zeropage.inc" .include "../inc/common.i" -.ifndef KPR_API_VERSION_NUMBER - .define EQU = - .include "../inc/kipper_constants.i" -.endif - target_string = ptr1 search_string = ptr2 diff --git a/ip65/sntp.s b/ip65/sntp.s index c86e5c8..94e9c66 100644 --- a/ip65/sntp.s +++ b/ip65/sntp.s @@ -3,11 +3,7 @@ MAX_SNTP_MESSAGES_SENT = 8 .include "../inc/common.i" - -.ifndef KPR_API_VERSION_NUMBER - .define EQU = - .include "../inc/kipper_constants.i" -.endif +.include "../inc/error.i" .export sntp_ip .export sntp_utc_timestamp diff --git a/ip65/tcp.s b/ip65/tcp.s index 3b3dfa1..2044bd5 100644 --- a/ip65/tcp.s +++ b/ip65/tcp.s @@ -9,11 +9,7 @@ MAX_TCP_PACKETS_SENT = 8 ; timeout after sending 8 messages will be about .include "zeropage.inc" .include "../inc/common.i" - -.ifndef KPR_API_VERSION_NUMBER - .define EQU = - .include "../inc/kipper_constants.i" -.endif +.include "../inc/error.i" .import ip65_error diff --git a/ip65/tftp.s b/ip65/tftp.s index 95af5cf..dcb86a1 100644 --- a/ip65/tftp.s +++ b/ip65/tftp.s @@ -6,11 +6,7 @@ TFTP_TIMER_MASK = $F8 ; mask lower two bits, means we wait for 8 x1/4 .include "zeropage.inc" .include "../inc/common.i" - -.ifndef KPR_API_VERSION_NUMBER - .define EQU = - .include "../inc/kipper_constants.i" -.endif +.include "../inc/error.i" .export tftp_load_address .export tftp_ip diff --git a/ip65/udp.s b/ip65/udp.s index 6563a33..b19e83c 100644 --- a/ip65/udp.s +++ b/ip65/udp.s @@ -1,11 +1,7 @@ ; UDP (user datagram protocol) functions .include "../inc/common.i" - -.ifndef KPR_API_VERSION_NUMBER - .define EQU = - .include "../inc/kipper_constants.i" -.endif +.include "../inc/error.i" .import ip65_error diff --git a/ip65/url.s b/ip65/url.s index 84cf946..81b92b3 100644 --- a/ip65/url.s +++ b/ip65/url.s @@ -2,11 +2,7 @@ .include "zeropage.inc" .include "../inc/common.i" - -.ifndef KPR_API_VERSION_NUMBER - .define EQU = - .include "../inc/kipper_constants.i" -.endif +.include "../inc/error.i" TIMEOUT_SECONDS = 15