#include #include #include "emu.h" #ifdef USE_ENC28J60 #include byte ENC28J60::buffer[1514]; //uint8_t net_mac[6] = { 0x90, 0xAD, 0xBE, 0xEF, 0x13, 0x37 }; uint8_t net_mac[6] = { 0x2C, 0xFD, 0x13, 0x37, 0x13, 0x37 }; extern union _bytewordregs_ regs; extern uint16_t segregs[6]; struct netstruct { uint8_t enabled; uint8_t canrecv; uint16_t pktlen; } net; void net_handler() { uint32_t i; uint16_t j; //if (ethif==254) return; //networking not enabled switch (regs.byteregs[regah]) { //function number case 0x00: //enable packet reception net.enabled = 1; net.canrecv = 1; return; case 0x01: //send packet of CX at DS:SI //if (verbose) { //Serial.println("Sending packet of %u bytes.", regs.wordregs[regcx]); //} //sendpkt (&RAM[ ( (uint32_t) segregs[regds] << 4) + (uint32_t) regs.wordregs[regsi]], regs.wordregs[regcx]); i = ( (uint32_t) segregs[regds] << 4) + (uint32_t) regs.wordregs[regsi]; for (j=0; j 0) { for (i=0; i