oliverschmidt | 76872e8 | 2004-12-26 14:13:34 +0000 | [diff] [blame] | 1 | ; |
| 2 | ; Bank switching code for Contiki (Apple2 version) |
| 3 | ; |
| 4 | |
oliverschmidt | a330e33 | 2005-01-22 03:00:27 +0000 | [diff] [blame] | 5 | .segment "CONTIKI" |
| 6 | |
oliverschmidt | 027febe | 2006-05-17 15:55:29 +0000 | [diff] [blame] | 7 | .export VTABZ |
| 8 | |
oliverschmidt | 477570f | 2005-03-29 20:35:51 +0000 | [diff] [blame] | 9 | VTABZ: |
oliverschmidt | 477570f | 2005-03-29 20:35:51 +0000 | [diff] [blame] | 10 | ; Switch in ROM and call VTABZ |
oliverschmidt | 76872e8 | 2004-12-26 14:13:34 +0000 | [diff] [blame] | 11 | bit $C082 |
oliverschmidt | 477570f | 2005-03-29 20:35:51 +0000 | [diff] [blame] | 12 | jsr $FC24 |
oliverschmidt | 76872e8 | 2004-12-26 14:13:34 +0000 | [diff] [blame] | 13 | |
oliverschmidt | 84a353b | 2006-04-09 16:47:18 +0000 | [diff] [blame] | 14 | ; Switch in LC bank 2 for R/O and return |
oliverschmidt | a330e33 | 2005-01-22 03:00:27 +0000 | [diff] [blame] | 15 | bit $C080 |
oliverschmidt | 76872e8 | 2004-12-26 14:13:34 +0000 | [diff] [blame] | 16 | rts |
oliverschmidt | 027febe | 2006-05-17 15:55:29 +0000 | [diff] [blame] | 17 | |
| 18 | .ifdef __APPLE2ENH__ |
| 19 | |
| 20 | .code |
| 21 | |
| 22 | main2aux: |
| 23 | ; Switch in $2000-$3FFF from aux memory |
| 24 | bit $C055 ; Page2 |
| 25 | bit $C057 ; HiRes |
| 26 | rts |
| 27 | |
| 28 | aux2main: |
| 29 | ; Switch in $2000-$3FFF from main memory |
| 30 | bit $C056 ; LoRes |
| 31 | bit $C054 ; Page1 |
| 32 | rts |
| 33 | |
| 34 | .export _tcpip_init |
| 35 | .import __tcpip_init |
| 36 | |
| 37 | _tcpip_init: |
| 38 | jsr main2aux |
| 39 | jsr __tcpip_init |
| 40 | jmp aux2main |
| 41 | |
| 42 | .export _tcpip_eventhandler |
| 43 | .import __tcpip_eventhandler |
| 44 | |
| 45 | _tcpip_eventhandler: |
| 46 | jsr main2aux |
| 47 | jsr __tcpip_eventhandler |
| 48 | jmp aux2main |
| 49 | |
| 50 | .export _tcpip_pollhandler |
| 51 | .import __tcpip_pollhandler |
| 52 | |
| 53 | _tcpip_pollhandler: |
| 54 | jsr main2aux |
| 55 | jsr __tcpip_pollhandler |
| 56 | jmp aux2main |
| 57 | |
| 58 | .export _htons |
| 59 | .import __htons |
| 60 | |
| 61 | _htons: |
| 62 | jsr main2aux |
| 63 | jsr __htons |
| 64 | jmp aux2main |
| 65 | |
| 66 | .export _uiplib_ipaddrconv |
| 67 | .import __uiplib_ipaddrconv |
| 68 | |
| 69 | _uiplib_ipaddrconv: |
| 70 | jsr main2aux |
| 71 | jsr __uiplib_ipaddrconv |
| 72 | jmp aux2main |
| 73 | |
| 74 | .export _tcp_markconn |
| 75 | .import __tcp_markconn |
| 76 | |
| 77 | _tcp_markconn: |
| 78 | jsr main2aux |
| 79 | jsr __tcp_markconn |
| 80 | jmp aux2main |
| 81 | |
| 82 | .export _tcp_listen |
| 83 | .import __tcp_listen |
| 84 | |
| 85 | _tcp_listen: |
| 86 | jsr main2aux |
| 87 | jsr __tcp_listen |
| 88 | jmp aux2main |
| 89 | |
| 90 | .export _tcp_unlisten |
| 91 | .import __tcp_unlisten |
| 92 | |
| 93 | _tcp_unlisten: |
| 94 | jsr main2aux |
| 95 | jsr __tcp_unlisten |
| 96 | jmp aux2main |
| 97 | |
| 98 | .export _tcp_connect |
| 99 | .import __tcp_connect |
| 100 | |
| 101 | _tcp_connect: |
| 102 | jsr main2aux |
| 103 | jsr __tcp_connect |
| 104 | jmp aux2main |
| 105 | |
| 106 | .export _udp_new |
| 107 | .import __udp_new |
| 108 | |
| 109 | _udp_new: |
| 110 | jsr main2aux |
| 111 | jsr __udp_new |
| 112 | jmp aux2main |
| 113 | |
| 114 | .export _tcpip_input |
| 115 | .import __tcpip_input |
| 116 | |
| 117 | _tcpip_input: |
| 118 | jsr main2aux |
| 119 | jsr __tcpip_input |
| 120 | jmp aux2main |
| 121 | |
| 122 | .export _tcpip_poll_udp |
| 123 | .import __tcpip_poll_udp |
| 124 | |
| 125 | _tcpip_poll_udp: |
| 126 | jsr main2aux |
| 127 | jsr __tcpip_poll_udp |
| 128 | jmp aux2main |
| 129 | |
| 130 | .export __ek_post_synch |
| 131 | .import _ek_post_synch |
| 132 | |
| 133 | __ek_post_synch: |
| 134 | jsr aux2main |
| 135 | jsr _ek_post_synch |
| 136 | jmp main2aux |
| 137 | |
| 138 | .endif |