Skip to content

Commit 6c4d5f2

Browse files
committed
performance fix for forth83 - don't sleep if -n is set. also, minor cleanup
1 parent 4439064 commit 6c4d5f2

File tree

2 files changed

+11
-6
lines changed

2 files changed

+11
-6
lines changed

ntvcm.cxx

+10-5
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,10 @@
4545
#include <djl_con.hxx>
4646
#include <djl_cycle.hxx>
4747

48-
#define AUTHOR "David Lee"
49-
#define FILENAME "ntvcm"
50-
#define VERSION "0.1"
48+
#define FILENAME "ntvcm"
49+
#define VERSION "0.1"
5150
#if !defined(BUILD)
52-
#define BUILD ""
51+
#define BUILD ""
5352
#endif
5453
#if !defined(COMMIT_ID)
5554
#define COMMIT_ID ""
@@ -1604,7 +1603,13 @@ char get_next_kbd_char()
16041603

16051604
bool is_kbd_char_available()
16061605
{
1607-
return ( ( g_fileInputOffset < g_fileInputText.size() ) || g_consoleConfig.throttled_kbhit() );
1606+
if ( g_fileInputOffset < g_fileInputText.size() )
1607+
return true;
1608+
1609+
if ( g_sleepOnKbdLoop )
1610+
return g_consoleConfig.throttled_kbhit();
1611+
1612+
return g_consoleConfig.portable_kbhit();
16081613
} //is_kbd_char_available
16091614

16101615
bool cpm_read_console( char * buf, size_t bufsize, uint8_t & out_len )

x80.hxx

+1-1
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,7 @@ extern void x80_invoke_out( uint8_t x ); // called for the out instruction
260260
extern void x80_invoke_in( uint8_t x ); // called for the in instruction
261261
extern void x80_invoke_halt( void ); // called when the 8080 hlt (on Z80 halt) instruction is executed
262262
extern uint8_t x80_invoke_hook( void ); // called with the OPCODE_HOOK instruction is executed
263+
extern void x80_hard_exit( const char * pcerror, uint8_t arg1, uint8_t arg2 ); // called on failures to exit the app
263264

264265
// emulator API
265266

@@ -268,4 +269,3 @@ extern void x80_trace_instructions( bool trace ); // enable/disable
268269
extern void x80_end_emulation(); // stop the emulation
269270
extern void x80_trace_state( void ); // trace the registers
270271
extern const char * x80_render_operation( uint16_t address ); // return a string with the disassembled instruction at address
271-
extern void x80_hard_exit( const char * pcerror, uint8_t arg1, uint8_t arg2 ); // called on failures to exit the app

0 commit comments

Comments
 (0)