44
55#include "fujinet-network.h"
66
7- #ifdef BUILD_ATARI
7+ #ifdef __ATARI__
88#include "fujinet-network-atari.h"
99#include "fujinet-bus-atari.h"
1010#endif
1111
12- #ifdef BUILD_APPLE2
12+ #ifdef __APPLE2__
1313#include "fujinet-network-apple2.h"
1414#include "fujinet-bus-apple2.h"
1515#include "apple2/src/bus/inc/sp.h"
@@ -27,20 +27,20 @@ int16_t network_read(char *devicespec, uint8_t *buf, uint16_t len)
2727 uint16_t fetch_size = 0 ;
2828 uint16_t amount_left = len ;
2929 uint16_t total_read = 0 ;
30- #ifdef BUILD_ATARI
30+ #ifdef __ATARI__
3131 uint8_t unit = 0 ;
3232#endif
3333
3434 if (len == 0 || buf == NULL ) {
35- #ifdef BUILD_ATARI
35+ #ifdef __ATARI__
3636 return fn_error (132 ); // invalid command
3737#endif
38- #ifdef BUILD_APPLE2
38+ #ifdef __APPLE2__
3939 return fn_error (SP_ERR_BAD_CMD );
4040#endif
4141 }
4242
43- #ifdef BUILD_APPLE2
43+ #ifdef __APPLE2__
4444 // check we have the SP network value
4545 if (sp_network == 0 ) {
4646 return fn_error (SP_ERR_BAD_UNIT );
@@ -50,18 +50,18 @@ int16_t network_read(char *devicespec, uint8_t *buf, uint16_t len)
5050 fn_bytes_read = 0 ;
5151 fn_device_error = 0 ;
5252
53- #ifdef BUILD_ATARI
53+ #ifdef __ATARI__
5454 unit = network_unit (devicespec );
5555#endif
5656
5757 while (1 ) {
5858 // exit condition
5959 if (amount_left == 0 ) break ;
6060
61- #ifdef BUILD_ATARI
61+ #ifdef __ATARI__
6262 r = network_status_unit (unit , & fn_network_bw , & fn_network_conn , & fn_network_error );
6363#endif
64- #ifdef BUILD_APPLE2
64+ #ifdef __APPLE2__
6565 r = network_status_no_clr (devicespec , & fn_network_bw , & fn_network_conn , & fn_network_error );
6666#endif
6767
@@ -79,16 +79,16 @@ int16_t network_read(char *devicespec, uint8_t *buf, uint16_t len)
7979
8080 fetch_size = MIN (amount_left , fn_network_bw );
8181
82- #ifdef BUILD_APPLE2
82+ #ifdef __APPLE2__
8383 // need to validate this is only required for apple
8484 fetch_size = MIN (fetch_size , MAX_READ_SIZE );
8585#endif
8686
87- #ifdef BUILD_ATARI
87+ #ifdef __ATARI__
8888 sio_read (unit , buf , fetch_size );
8989#endif
9090
91- #ifdef BUILD_APPLE2
91+ #ifdef __APPLE2__
9292 sp_read (sp_network , fetch_size );
9393 memcpy (buf , sp_payload , fetch_size );
9494#endif
0 commit comments