nic_w5100_t* nic_w5100_alloc( void ) { int error; int i; nic_w5100_t *self; compat_socket_networking_init(); self = libspectrum_new( nic_w5100_t, 1 ); self->selfpipe = compat_socket_selfpipe_alloc(); for( i = 0; i < 4; i++ ) nic_w5100_socket_init( &self->socket[i], i ); nic_w5100_reset( self ); self->stop_io_thread = 0; error = pthread_create( &self->thread, NULL, w5100_io_thread, self ); if( error ) { ui_error( UI_ERROR_ERROR, "w5100: error %d creating thread", error ); fuse_abort(); } return self; }
static void w5100_write_mr( nic_w5100_t *self, libspectrum_byte b ) { nic_w5100_debug( "w5100: writing 0x%02x to MR\n", b ); if( b & 0x80 ) nic_w5100_reset( self ); if( b & 0x7f ) nic_w5100_error( UI_ERROR_WARNING, "w5100: unsupported value 0x%02x written to MR\n", b ); }
static void spectranet_reset( int hard_reset ) { if( !periph_is_active( PERIPH_TYPE_SPECTRANET ) ) { spectranet_available = 0; spectranet_paged = 0; return; } spectranet_available = 1; spectranet_paged = !settings_current.spectranet_disable; if( hard_reset ) spectranet_hard_reset(); if( spectranet_paged ) { machine_current->ram.romcs = 1; machine_current->memory_map(); } nic_w5100_reset( w5100 ); }