From: <fr...@us...> - 2021-03-20 02:56:33
|
This is an automated email from the git hooks/post-receive-user script. fredm pushed a commit to branch master in repository fuse. View the commit online: https://sourceforge.net/p/fuse-emulator/fuse/ci/fe8398c068b951b4b3a4672eca19d888ca1c4397/ The following commit(s) were added to refs/heads/master by this push: new fe8398c0 Speed up readbyte() fe8398c0 is described below commit fe8398c068b951b4b3a4672eca19d888ca1c4397 Author: Jindřich Makovička <mak...@gm...> AuthorDate: Sat Mar 20 13:55:04 2021 +1100 Speed up readbyte() Check the address first and only test for the peripherals if the address is in the relevant range. --- ChangeLog | 3 +++ memory_pages.c | 26 ++++++++++++++------------ 2 files changed, 17 insertions(+), 12 deletions(-) diff --git a/ChangeLog b/ChangeLog index b13c8570..b8a1a8b8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,9 @@ * Fuse 1.?.? released. + * Emulation core improvements: + * Speed up reading emulated memory locations (Jindřich Makovička). + * UI improvements: * Timex: don't abort if the Timex dock cartridge image is not found (Alberto Garcia). diff --git a/memory_pages.c b/memory_pages.c index ddc79a32..c7543627 100644 --- a/memory_pages.c +++ b/memory_pages.c @@ -385,19 +385,21 @@ readbyte( libspectrum_word address ) if( mapping->contended ) tstates += ula_contention[ tstates ]; tstates += 3; - if( opus_active && address >= 0x2800 && address < 0x3800 ) - return opus_read( address ); + if( address < 0x4000 ) { + if( opus_active && address >= 0x2800 && address < 0x3800 ) + return opus_read( address ); + + if( spectranet_paged ) { + if( spectranet_w5100_paged_a && address >= 0x1000 && address < 0x2000 ) + return spectranet_w5100_read( mapping, address ); + if( spectranet_w5100_paged_b && address >= 0x2000 && address < 0x3000 ) + return spectranet_w5100_read( mapping, address ); + } - if( spectranet_paged ) { - if( spectranet_w5100_paged_a && address >= 0x1000 && address < 0x2000 ) - return spectranet_w5100_read( mapping, address ); - if( spectranet_w5100_paged_b && address >= 0x2000 && address < 0x3000 ) - return spectranet_w5100_read( mapping, address ); - } - - if( ttx2000s_paged ) { - if( address >= 0x2000 && address < 0x4000 ) - return ttx2000s_sram_read( address ); + if( ttx2000s_paged ) { + if( address >= 0x2000 && address < 0x4000 ) + return ttx2000s_sram_read( address ); + } } return mapping->page[ address & MEMORY_PAGE_SIZE_MASK ]; |