Skip to content

Commit f639e87

Browse files
committed
Post-merge patches (conflict resolution)
1 parent 8376de5 commit f639e87

11 files changed

Lines changed: 1156 additions & 560 deletions

File tree

40 Bytes
Binary file not shown.

fusepb/FuseX.xcodeproj/project.pbxproj

Lines changed: 71 additions & 39 deletions
Large diffs are not rendered by default.

fusepb/libspectrum.h

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* libspectrum.h: the library for dealing with ZX Spectrum emulator files
2-
Copyright (c) 2001-2018 Philip Kendall, Darren Salt, Fredrick Meunier
2+
Copyright (c) 2001-2023 Philip Kendall, Darren Salt, Fredrick Meunier
33
44
This program is free software; you can redistribute it and/or modify
55
it under the terms of the GNU General Public License as published by
@@ -272,6 +272,7 @@ typedef enum libspectrum_error {
272272
LIBSPECTRUM_ERROR_SIGNATURE,
273273
LIBSPECTRUM_ERROR_SLT, /* .slt data found at end of a .z80 file */
274274
LIBSPECTRUM_ERROR_INVALID, /* Invalid parameter supplied */
275+
LIBSPECTRUM_ERROR_MISSING_ZLIB, /* Missing or not used zlib.h */
275276

276277
LIBSPECTRUM_ERROR_LOGIC = -1,
277278

@@ -453,6 +454,9 @@ typedef enum libspectrum_id_t {
453454

454455
LIBSPECTRUM_ID_SCREEN_MLT, /* .mlt screen file */
455456

457+
/* Below here, present only in FUTURE version */
458+
LIBSPECTRUM_ID_SNAPSHOT_DSNAP, /* .S snapshot (D40/D80) */
459+
456460
} libspectrum_id_t;
457461

458462
/* And 'classes' of file */
@@ -689,35 +693,35 @@ LIBSPECTRUM_API libspectrum_error
689693
libspectrum_creator_set_program( libspectrum_creator *creator,
690694
const char *program );
691695
LIBSPECTRUM_API const char *
692-
libspectrum_creator_program( libspectrum_creator *creator );
696+
libspectrum_creator_program( const libspectrum_creator *creator );
693697

694698
LIBSPECTRUM_API libspectrum_error
695699
libspectrum_creator_set_major( libspectrum_creator *creator,
696700
libspectrum_word major );
697701
LIBSPECTRUM_API libspectrum_word
698-
libspectrum_creator_major( libspectrum_creator *creator );
702+
libspectrum_creator_major( const libspectrum_creator *creator );
699703

700704
LIBSPECTRUM_API libspectrum_error
701705
libspectrum_creator_set_minor( libspectrum_creator *creator,
702706
libspectrum_word minor );
703707
LIBSPECTRUM_API libspectrum_word
704-
libspectrum_creator_minor( libspectrum_creator *creator );
708+
libspectrum_creator_minor( const libspectrum_creator *creator );
705709

706710
LIBSPECTRUM_API libspectrum_error
707711
libspectrum_creator_set_competition_code( libspectrum_creator *creator,
708712
libspectrum_dword competition_code );
709713
LIBSPECTRUM_API libspectrum_dword
710-
libspectrum_creator_competition_code( libspectrum_creator *creator );
714+
libspectrum_creator_competition_code( const libspectrum_creator *creator );
711715

712716
LIBSPECTRUM_API libspectrum_error
713717
libspectrum_creator_set_custom( libspectrum_creator *creator,
714718
libspectrum_byte *data, size_t length );
715719

716720
LIBSPECTRUM_API libspectrum_byte *
717-
libspectrum_creator_custom( libspectrum_creator *creator );
721+
libspectrum_creator_custom( const libspectrum_creator *creator );
718722

719723
LIBSPECTRUM_API size_t
720-
libspectrum_creator_custom_length( libspectrum_creator *creator );
724+
libspectrum_creator_custom_length( const libspectrum_creator *creator );
721725

722726
/*
723727
* Snap handling routines
@@ -1084,6 +1088,10 @@ WIN32_DLL libspectrum_byte * libspectrum_snap_usource_rom( libspectrum_snap *sna
10841088
WIN32_DLL void libspectrum_snap_set_usource_rom( libspectrum_snap *snap, int idx, libspectrum_byte* usource_rom );
10851089
WIN32_DLL size_t libspectrum_snap_usource_rom_length( libspectrum_snap *snap, int idx );
10861090
WIN32_DLL void libspectrum_snap_set_usource_rom_length( libspectrum_snap *snap, int idx, size_t usource_rom_length );
1091+
WIN32_DLL int libspectrum_snap_uspeech_active( libspectrum_snap *snap );
1092+
WIN32_DLL void libspectrum_snap_set_uspeech_active( libspectrum_snap *snap, int uspeech_active );
1093+
WIN32_DLL int libspectrum_snap_uspeech_paged( libspectrum_snap *snap );
1094+
WIN32_DLL void libspectrum_snap_set_uspeech_paged( libspectrum_snap *snap, int uspeech_paged );
10871095
WIN32_DLL int libspectrum_snap_disciple_active( libspectrum_snap *snap );
10881096
WIN32_DLL void libspectrum_snap_set_disciple_active( libspectrum_snap *snap, int disciple_active );
10891097
WIN32_DLL int libspectrum_snap_disciple_paged( libspectrum_snap *snap );

memory_pages.c

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@
4444
#include "peripherals/disk/opus.h"
4545
#include "peripherals/sound/uspeech.h"
4646
#include "peripherals/spectranet.h"
47+
#include "peripherals/fs/xfs.h"
48+
#include "peripherals/nic/spectranext_controller.h"
4749
#include "peripherals/ttx2000s.h"
4850
#include "peripherals/ula.h"
4951
#include "settings.h"
@@ -395,6 +397,14 @@ readbyte( libspectrum_word address )
395397
return spectranet_w5100_read( mapping, address );
396398
if( spectranet_w5100_paged_b && address >= 0x2000 && address < 0x3000 )
397399
return spectranet_w5100_read( mapping, address );
400+
if( spectranet_xfs_paged_a && address >= 0x1000 && address < 0x2000 )
401+
return spectranet_xfs_read( mapping, address );
402+
if( spectranet_xfs_paged_b && address >= 0x2000 && address < 0x3000 )
403+
return spectranet_xfs_read( mapping, address );
404+
if( spectranet_spectranext_config_paged_a && address >= 0x1000 && address < 0x2000 )
405+
return spectranet_spectranext_config_read( mapping, address );
406+
if( spectranet_spectranext_config_paged_b && address >= 0x2000 && address < 0x3000 )
407+
return spectranet_spectranext_config_read( mapping, address );
398408
if( address < 0x1000 )
399409
return spectranet_flash_rom_read( mapping, address );
400410
if( spectranet_flash_paged_a && address >= 0x1000 && address < 0x2000 )
@@ -504,6 +514,22 @@ writebyte_internal( libspectrum_word address, libspectrum_byte b )
504514
spectranet_w5100_write( mapping, address, b );
505515
return;
506516
}
517+
if( spectranet_xfs_paged_a && address >= 0x1000 && address < 0x2000 ) {
518+
spectranet_xfs_write( mapping, address, b );
519+
return;
520+
}
521+
if( spectranet_xfs_paged_b && address >= 0x2000 && address < 0x3000 ) {
522+
spectranet_xfs_write( mapping, address, b );
523+
return;
524+
}
525+
if( spectranet_spectranext_config_paged_a && address >= 0x1000 && address < 0x2000 ) {
526+
spectranet_spectranext_config_write( mapping, address, b );
527+
return;
528+
}
529+
if( spectranet_spectranext_config_paged_b && address >= 0x2000 && address < 0x3000 ) {
530+
spectranet_spectranext_config_write( mapping, address, b );
531+
return;
532+
}
507533
}
508534

509535
if( ttx2000s_paged ) {

peripherals/nic/w5100.c

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
#include <unistd.h>
3333

3434
#include "fuse.h"
35+
#include "utils.h"
3536
#include "ui/ui.h"
3637
#include "w5100.h"
3738
#include "w5100_internals.h"
@@ -101,9 +102,9 @@ w5100_io_thread( void *arg )
101102

102103
FD_SET( selfpipe_socket, &readfds );
103104

104-
for( i = 0; i < 4; i++ )
105-
nic_w5100_socket_add_to_sets( &self->socket[i], &readfds, &writefds,
106-
&max_fd );
105+
for( i = 0; i < 4; i++ )
106+
nic_w5100_socket_add_to_sets( self, &self->socket[i], &readfds, &writefds,
107+
&max_fd );
107108

108109
/* Note that if a socket is closed between when we added it to the sets
109110
above and when we call select() below, it will cause the select to fail
@@ -124,7 +125,7 @@ w5100_io_thread( void *arg )
124125
}
125126

126127
for( i = 0; i < 4; i++ )
127-
nic_w5100_socket_process_io( &self->socket[i], readfds, writefds );
128+
nic_w5100_socket_process_io( self, &self->socket[i], readfds, writefds );
128129
}
129130
else if( compat_socket_get_error() == compat_socket_EBADF ) {
130131
/* Do nothing - just loop again */
@@ -144,6 +145,8 @@ w5100_start_io_thread( nic_w5100_t *self )
144145
{
145146
int error;
146147

148+
utils_networking_init();
149+
147150
if( self->io_thread_running ) return 0;
148151

149152
self->selfpipe = compat_socket_selfpipe_alloc();

0 commit comments

Comments
 (0)