cleaning more dead or commented code

This commit is contained in:
Gwenhael Le Moine 2023-09-16 17:50:08 +02:00
parent fbf0180114
commit a8724da1b7
No known key found for this signature in database
GPG key ID: FDFE3669426707A7
3 changed files with 28 additions and 43 deletions

View file

@ -489,16 +489,18 @@ void write_nibble_sx( long addr, int val ) {
} }
return; return;
} }
if ( device.display_touched ) if ( device.display_touched )
return; return;
if ( addr >= display.disp_start && addr < display.disp_end ) {
if ( addr >= display.disp_start && addr < display.disp_end )
ui__disp_draw_nibble( addr, val ); ui__disp_draw_nibble( addr, val );
}
if ( display.lines == 63 ) if ( display.lines == 63 )
return; return;
if ( addr >= display.menu_start && addr < display.menu_end ) {
if ( addr >= display.menu_start && addr < display.menu_end )
ui__menu_draw_nibble( addr, val ); ui__menu_draw_nibble( addr, val );
}
} }
void write_nibble_gx( long addr, int val ) { void write_nibble_gx( long addr, int val ) {
@ -600,14 +602,6 @@ void write_nibble_gx( long addr, int val ) {
saturn.port2[ ( ( saturn.bank_switch << 18 ) + saturn.port2[ ( ( saturn.bank_switch << 18 ) +
( addr - 0xb0000 ) ) & ( addr - 0xb0000 ) ) &
port2_mask ] = val; port2_mask ] = val;
/*
if (port2_size > (saturn.bank_switch << 18))
{
if (port2_is_ram)
saturn.port2[(saturn.bank_switch << 18)
+ (addr - 0xb0000)] = val;
}
*/
return; return;
} }
return; return;
@ -636,14 +630,6 @@ void write_nibble_gx( long addr, int val ) {
saturn.port2[ ( ( saturn.bank_switch << 18 ) + saturn.port2[ ( ( saturn.bank_switch << 18 ) +
( addr - 0xc0000 ) ) & ( addr - 0xc0000 ) ) &
port2_mask ] = val; port2_mask ] = val;
/*
if (port2_size > (saturn.bank_switch << 18))
{
if (port2_is_ram)
saturn.port2[(saturn.bank_switch << 18)
+ (addr - 0xc0000)] = val;
}
*/
return; return;
} }
return; return;
@ -668,28 +654,22 @@ void write_nibble_gx( long addr, int val ) {
saturn.port2[ ( ( saturn.bank_switch << 18 ) + saturn.port2[ ( ( saturn.bank_switch << 18 ) +
( addr - 0xc0000 ) ) & ( addr - 0xc0000 ) ) &
port2_mask ] = val; port2_mask ] = val;
/*
if (port2_size > (saturn.bank_switch << 18))
{
if (port2_is_ram)
saturn.port2[(saturn.bank_switch << 18)
+ (addr - 0xc0000)] = val;
}
*/
return; return;
} }
return; return;
} }
if ( device.display_touched ) if ( device.display_touched )
return; return;
if ( addr >= display.disp_start && addr < display.disp_end ) {
if ( addr >= display.disp_start && addr < display.disp_end )
ui__disp_draw_nibble( addr, val ); ui__disp_draw_nibble( addr, val );
}
if ( display.lines == 63 ) if ( display.lines == 63 )
return; return;
if ( addr >= display.menu_start && addr < display.menu_end ) {
if ( addr >= display.menu_start && addr < display.menu_end )
ui__menu_draw_nibble( addr, val ); ui__menu_draw_nibble( addr, val );
}
} }
int read_nibble_sx( long addr ) { int read_nibble_sx( long addr ) {
@ -1155,13 +1135,6 @@ long read_nibbles( long addr, int len ) {
return val; return val;
} }
void write_nibbles( long addr, long val, int len ) {
while ( len-- > 0 ) {
write_nibble( addr++, val );
val >>= 4;
}
}
void dev_memory_init( void ) { void dev_memory_init( void ) {
if ( opt_gx ) { if ( opt_gx ) {
read_nibble = read_nibble_gx; read_nibble = read_nibble_gx;
@ -1172,5 +1145,6 @@ void dev_memory_init( void ) {
read_nibble_crc = read_nibble_crc_sx; read_nibble_crc = read_nibble_crc_sx;
write_nibble = write_nibble_sx; write_nibble = write_nibble_sx;
} }
memset( &device, 0, sizeof( device ) ); memset( &device, 0, sizeof( device ) );
} }

View file

@ -283,7 +283,6 @@ extern int ( *read_nibble_crc )( long addr );
/* emu_memory.c */ /* emu_memory.c */
/****************/ /****************/
extern long read_nibbles( long addr, int len ); extern long read_nibbles( long addr, int len );
void write_nibbles( long addr, long val, int len );
extern void dev_memory_init( void ); /* */ extern void dev_memory_init( void ); /* */
/*****************/ /*****************/

View file

@ -3,29 +3,41 @@
#include "emulator.h" /* word_4; word_20; */ #include "emulator.h" /* word_4; word_20; */
/**************/ /*************************************************/
/* public API */ /* public API: if it's there it's used elsewhere */
/**************/ /*************************************************/
/*************************/
/* used in: emu_memory.c */ /* used in: emu_memory.c */
/*************************/
extern void ui__disp_draw_nibble( word_20 addr, word_4 val ); extern void ui__disp_draw_nibble( word_20 addr, word_4 val );
extern void ui__menu_draw_nibble( word_20 addr, word_4 val ); extern void ui__menu_draw_nibble( word_20 addr, word_4 val );
/* extern void ui__draw_nibble( int c, int r, int val ); */ /* extern void ui__draw_nibble( int c, int r, int val ); */
/*****************************************/
/* used in: emu_actions.c, emu_emulate.c */ /* used in: emu_actions.c, emu_emulate.c */
/*****************************************/
extern int ui__get_event( void ); extern int ui__get_event( void );
/*****************************************************/
/* used in: emu_actions.c, emu_emulate.c, debugger.c */ /* used in: emu_actions.c, emu_emulate.c, debugger.c */
/*****************************************************/
extern void ui__update_LCD( void ); extern void ui__update_LCD( void );
/**************************/
/* used in: emu_emulate.c */ /* used in: emu_emulate.c */
/**************************/
extern void ui__adjust_contrast( void ); extern void ui__adjust_contrast( void );
extern void ui__draw_annunc( void ); extern void ui__draw_annunc( void );
/*********************************/
/* used in: debugger.c, ui_sdl.c */ /* used in: debugger.c, ui_sdl.c */
/*********************************/
extern void ui__init_LCD( void ); extern void ui__init_LCD( void );
/*******************/
/* used in: main.c */ /* used in: main.c */
/*******************/
extern void init_ui( void ); extern void init_ui( void );
#endif /* !_X48_GUI_H */ #endif /* !_X48_GUI_H */