[major] entirely removed debugger and realine dependency

This commit is contained in:
Gwenhael Le Moine 2023-09-07 12:39:01 +02:00
parent 5205e2c6d9
commit 3e78821d4a
No known key found for this signature in database
GPG key ID: FDFE3669426707A7
16 changed files with 7 additions and 4736 deletions

View file

@ -16,7 +16,7 @@ jobs:
- name: update deps
run: sudo apt-get -y update
- name: install deps
run: sudo apt install pkgconf libx11-dev libxext-dev libreadline-dev libsdl1.2-compat-dev libsdl-gfx1.2-dev
run: sudo apt install pkgconf libx11-dev libxext-dev libsdl1.2-compat-dev libsdl-gfx1.2-dev
- name: make x11
run: make clean && make GUI=x11
- name: make sdl1

View file

@ -43,14 +43,6 @@ DOTOS = src/main.o \
src/x48_resources.o \
src/x48.o
### debugger
DOTOS += src/debugger.o \
src/debugger_disasm.o \
src/debugger_rpl.o
CFLAGS += $(shell pkg-config --cflags readline)
LIBS += $(shell pkg-config --libs readline)
### /debugger
.PHONY: all clean clean-all pretty-code install
all: dist/mkcard dist/checkrom dist/dump2rom dist/x48ng

View file

@ -11,7 +11,7 @@ This is my fork of x48-0.6.4 where I deviate from the original code and do my ow
2. removed the code supporting Solaris, HP-UX, etc.
3. removed the autotools-based build system and wrote a simple Makefile instead
4. added a x48ng.desktop file and an icon
5. make including the debugger an option at compilation
5. removed the debugger (use the original x48 if you need it)
## Bugs to fix

6
dist/X48NG.ad vendored
View file

@ -37,9 +37,3 @@
*resetOnStartup: False
*romFileName: rom.dump
*homeDirectory: .x48ng
!
! resources controlling the debugger
!
*useDebugger: True
*disassemblerMnemonics: class

10
dist/x48ng.man.1 vendored
View file

@ -96,10 +96,6 @@ where options include:
[\-/+serial] turn on/off serial interface
.br
[\-line <devicename>] use serial line <devicename> for IR connection
.br
[\-/+debug turn on/off debugger
.br
[\-disasm <string> use <string> ('HP' or 'class') mnemonics
.br
[\-reset perform a reset (PC = 0) on startup
.br
@ -253,12 +249,6 @@ You can not change the size of \fIx48ng\fR, but you can set the location of \fIx
.TP
.B *homeDirectory:
.TP
.B *useDebugger:
.TP
.B *disassemblerMnemonics:
.TP
.B *Netbook:

File diff suppressed because it is too large Load diff

View file

@ -1,145 +0,0 @@
#ifndef _DEBUGGER_H
#define _DEBUGGER_H 1
#include "hp48.h"
#define USER_INTERRUPT 1
#define ILLEGAL_INSTRUCTION 2
#define BREAKPOINT_HIT 4
#define TRAP_INSTRUCTION 8
/*
* exec_flags values
*/
#define EXEC_BKPT 1
extern int enter_debugger;
extern int in_debugger;
extern int exec_flags;
extern void init_debugger( void );
extern int debug( void );
extern void emulate_debug( void );
extern int step_instruction( void );
extern char* str_nibbles( word_20 addr, int n );
/*************************/
/* debugger_disasm.h */
/*************************/
/* #ifndef _DISASM_H */
/* #define _DISASM_H 1 */
#define HP_MNEMONICS 0
#define CLASS_MNEMONICS 1
extern int disassembler_mode;
extern const char* mode_name[];
extern char* append_str( char* buf, const char* string );
extern char* append_tab( char* buf );
extern char* append_tab_16( char* buf );
extern word_20 disassemble( word_20 addr, char* out );
/* #endif /\* !_DISASM_H *\/ */
/*************************/
/* debugger_rpl.h */
/*************************/
/* #ifndef _RPL_H */
/* #define _RPL_H 1 */
/*
* Addresses in SX ROM
*/
#define ROMPTAB_SX 0x707d9
#define ROMPTAB_GX 0x809a3
/*
* Object Prologs
*/
#define DOBINT 0x02911 /* System Binary */
#define DOREAL 0x02933 /* Real */
#define DOEREL 0x02955 /* Extended Real */
#define DOCMP 0x02977 /* Complex */
#define DOECMP 0x0299d /* Extended Complex */
#define DOCHAR 0x029bf /* Character */
#define DOARRY 0x029e8 /* Array */
#define DOLNKARRY 0x02a0a /* Linked Array */
#define DOCSTR 0x02a2c /* String */
#define DOHSTR 0x02a4e /* Binary Integer */
#define DOLIST 0x02a74 /* List */
#define DORRP 0x02a96 /* Directory */
#define DOSYMB 0x02ab8 /* Algebraic */
#define DOEXT 0x02ada /* Unit */
#define DOTAG 0x02afc /* Tagged */
#define DOGROB 0x02b1e /* Graphic Object */
#define DOLIB 0x02b40 /* Library */
#define DOBAK 0x02b62 /* Backup */
#define DOEXT0 0x02b88 /* Library Data */
#define DOACPTR 0x02baa /* */
#define DOEXT2 0x02bcc /* */
#define DOEXT3 0x02bee /* */
#define DOEXT4 0x02c10 /* */
#define DOCOL 0x02d9d /* Program */
#define DOCODE 0x02dcc /* Code */
#define DOIDNT 0x02e48 /* Global Name */
#define DOLAM 0x02e6d /* Local Name */
#define DOROMP 0x02e92 /* XLib Name */
/*
* Terminates composite objects
*/
#define SEMI 0x0312b /* Semi */
/*
* Unit Operators
*/
#define UM_MUL 0x10b5e /* Unit Operator * */
#define UM_DIV 0x10b68 /* Unit Operator / */
#define UM_POW 0x10b72 /* Unit Operator ^ */
#define UM_PRE 0x10b7c /* Unit Operator prefix */
#define UM_END 0x10b86 /* Unit Operator _ */
typedef struct hp_real {
word_20 x;
word_32 ml;
word_32 mh;
word_4 m;
word_1 s;
} hp_real;
extern char* decode_rpl_obj( word_20 addr, char* buf );
extern void decode_rpl_obj_2( word_20 addr, char* typ, char* dat );
extern char* skip_ob( word_20* addr, char* string );
extern char* dec_rpl_obj( word_20* addr, char* string );
extern char* dec_bin_int( word_20* addr, char* string );
extern char* dec_real( word_20* addr, char* string );
extern char* dec_long_real( word_20* addr, char* string );
extern char* dec_complex( word_20* addr, char* string );
extern char* dec_long_complex( word_20* addr, char* string );
extern char* dec_char( word_20* addr, char* string );
extern char* dec_array( word_20* addr, char* string );
extern char* dec_lnk_array( word_20* addr, char* string );
extern char* dec_string( word_20* addr, char* string );
extern char* dec_hex_string( word_20* addr, char* string );
extern char* dec_list( word_20* addr, char* string );
extern char* dec_symb( word_20* addr, char* string );
extern char* dec_unit( word_20* addr, char* string );
extern char* dec_library( word_20* addr, char* string );
extern char* dec_library_data( word_20* addr, char* string );
extern char* dec_acptr( word_20* addr, char* string );
extern char* dec_prog( word_20* addr, char* string );
extern char* dec_code( word_20* addr, char* string );
extern char* dec_global_ident( word_20* addr, char* string );
extern char* dec_local_ident( word_20* addr, char* string );
extern char* dec_xlib_name( word_20* addr, char* string );
extern char* dec_unit_op( word_20* addr, char* string );
/* #endif /\* !_RPL_H *\/ */
#endif /* !_DEBUGGER_H */

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -6,8 +6,6 @@
#include "timer.h"
#include "x48.h"
#include "debugger.h" /* enter_debugger, TRAP_INSTRUCTION, ILLEGAL_INSTRUCTION */
extern int throttle;
static long jumpaddr;
@ -2196,7 +2194,6 @@ inline int step_instruction( void ) {
op3 = read_nibbles( saturn.PC + 4, 1 );
saturn.PC += 5;
if ( op3 != 0 ) {
enter_debugger |= TRAP_INSTRUCTION;
return 1;
}
} else {
@ -2220,9 +2217,6 @@ inline int step_instruction( void ) {
}
instructions++;
if ( stop )
enter_debugger |= ILLEGAL_INSTRUCTION;
return stop;
}
@ -2431,7 +2425,5 @@ void emulate( void ) {
}
if ( schedule_event-- <= 0 )
schedule();
} while (
!enter_debugger
);
} while (1);
}

View file

@ -8,8 +8,6 @@
#include "timer.h"
#include "x48.h"
#include "debugger.h" /* in_debugger, enter_debugger */
static int interrupt_called = 0;
extern long nibble_masks[ 16 ];
@ -273,9 +271,6 @@ void do_shutdown( void ) {
saturn.int_pending = 0;
}
if ( in_debugger )
wake = 1;
else
wake = 0;
alarms = 0;
@ -335,9 +330,6 @@ void do_shutdown( void ) {
alarms++;
}
if ( enter_debugger )
wake = 1;
} while ( wake == 0 );
stop_timer( IDLE_TIMER );

View file

@ -13,8 +13,6 @@
#include "x48.h"
#include "x48_resources.h"
#include "debugger.h" /* enter_debugger, USER_INTERRUPT, exec_flags, emulate_debug, debug */
#if defined( GUI_IS_X11 )
char* progname;
#endif
@ -24,9 +22,6 @@ char** saved_argv;
void signal_handler( int sig ) {
switch ( sig ) {
case SIGINT: /* Ctrl-C */
enter_debugger |= USER_INTERRUPT;
break;
case SIGALRM:
got_alarm = 1;
break;
@ -150,12 +145,7 @@ int main( int argc, char** argv ) {
/* Start emulation loop */
/************************/
do {
if ( !exec_flags )
emulate();
else
emulate_debug();
debug();
} while ( 1 );
return 0;

View file

@ -6,7 +6,6 @@
#include "romio.h"
#include "timer.h"
#include "debugger.h" /* used for in_debugger */
typedef struct x48_timer_t {
word_1 run;
@ -317,10 +316,9 @@ t1_t2_ticks get_t1_t2( void ) {
access_time -= stop;
if ( adj_time_pending || in_debugger ) {
if ( adj_time_pending ) {
/*
* We have been inside an interrupt for very long, maybe
* or we are sleeping in the debugger.
* Don't adjust the time, can't come from user, anyhow.
*/

View file

@ -63,10 +63,6 @@ static XrmOptionDescRec options[] = {
{ "-rom", "*romFileName", XrmoptionSepArg, ( void* )0 },
{ "-home", "*homeDirectory", XrmoptionSepArg, ( void* )0 },
{ "-debug", "*useDebugger", XrmoptionNoArg, ( void* )"False" },
{ "+debug", "*useDebugger", XrmoptionNoArg, ( void* )"True" },
{ "-disasm", "*disassemblerMnemonics", XrmoptionSepArg, ( void* )0 },
{ "-xrm", ( char* )0, XrmoptionResArg, ( void* )0 },
{ "-netbook", "*netbook", XrmoptionNoArg, ( void* )"False" },
{ "+netbook", "*netbook", XrmoptionNoArg, ( void* )"True" },
@ -114,8 +110,6 @@ static char* defaults[] = {
"*resetOnStartup: False",
"*romFileName: rom.dump",
"*homeDirectory: .x48ng",
"*useDebugger: True",
"*disassemblerMnemonics: class",
0 };
static int CompletionType = -1;
@ -1182,8 +1176,6 @@ int first_key = 0;
int last_button = -1;
extern char* get_stack();
#if defined( GUI_IS_X11 )
typedef struct icon_t {
unsigned int w;
@ -6389,12 +6381,6 @@ int get_ui_event( void ) {
}
}
}
else if ( xev.xbutton.button == Button3 ) {
/* TODO Make cut from the screen work. */
get_stack();
} /* else {
printf("In display %d\n", xev.xbutton.button);
} */
} else {
if ( xev.xbutton.button == Button1 ||
xev.xbutton.button == Button2 ||

View file

@ -7,13 +7,10 @@
#include "x48_errors.h"
#include "x48_resources.h"
#include "debugger.h" /* `disassembler_mode` & `CLASS_MNEMONICS` */
int verbose;
int useTerminal;
int useSerial;
int useXShm;
int useDebugger;
int netbook;
int throttle;
int initialize;
@ -67,7 +64,6 @@ where options include:\n\
-/+terminal turn on/off pseudo terminal interface\n\
-/+serial turn on/off serial interface\n\
-line <devicename> use serial line <devicename> for IR connection\n\
-/+debug turn on/off debugger\n\
-disasm <string> use <string> (\'HP\' or \'class\') mnemonics\n\
-reset perform a reset (PC = 0) on startup\n\
-initialize force initialization x48ng from ROM-dump\n\
@ -93,7 +89,7 @@ void show_copyright( void ) {
fprintf( stdout, "\n\
COPYRIGHT\n\
\n\
x48ng is an Emulator/Debugger for the HP-48 Handheld Calculator.\n\
x48ng is an Emulator for the HP-48 Handheld Calculator.\n\
\n\
This program is free software; you can redistribute it and/or modify\n\
it under the terms of the GNU General Public License as published by\n\
@ -159,27 +155,6 @@ char* get_string_resource( char* name, char* class ) {
return get_string_resource_from_db( rdb, name, class );
}
int get_mnemonic_resource( char* name, char* class ) {
char *tmp, buf[ 100 ];
char* s = get_string_resource( name, class );
char* os = s;
if ( !s )
return CLASS_MNEMONICS;
for ( tmp = buf; *s; s++ )
*tmp++ = isupper( *s ) ? tolower( *s ) : *s;
*tmp = 0;
free( os );
if ( !strcmp( buf, "hp" ) )
return HP_MNEMONICS;
if ( !strcmp( buf, "class" ) )
return CLASS_MNEMONICS;
fprintf( stderr, "%s must be one of \'HP\' or \'class\', not %s.\n", name,
buf );
return CLASS_MNEMONICS;
}
int get_boolean_resource( char* name, char* class ) {
char *tmp, buf[ 100 ];
char* s = get_string_resource( name, class );
@ -364,8 +339,6 @@ void get_resources( void ) {
useSerial = 0;
initialize = 0;
resetOnStartup = 0;
useDebugger = 1;
disassembler_mode = CLASS_MNEMONICS; // HP_MNEMONICS
netbook = 0;
throttle = 0;
@ -391,10 +364,6 @@ void get_resources( void ) {
romFileName = get_string_resource( "romFileName", "RomFileName" );
homeDirectory = get_string_resource( "homeDirectory", "HomeDirectory" );
useDebugger = get_boolean_resource( "useDebugger", "UseDebugger" );
disassembler_mode = get_mnemonic_resource( "disassemblerMnemonics",
"DisassemblerMnemonics" );
netbook = get_boolean_resource( "netbook", "Netbook" );
throttle = get_boolean_resource( "throttle", "Throttle" );

View file

@ -10,7 +10,6 @@ extern int verbose;
extern int useTerminal;
extern int useSerial;
extern int useXShm;
extern int useDebugger;
extern int netbook;
extern int throttle;
extern int initialize;
@ -40,7 +39,6 @@ extern char* get_string_resource_from_db( XrmDatabase db, char* name,
char* class );
extern char* get_string_resource( char* name, char* class );
extern int get_boolean_resource( char* name, char* class );
extern int get_mnemonic_resource( char* name, char* class );
extern Visual* get_visual_resource( Display* dpy, char* name, char* class,
unsigned int* depth );
extern XFontStruct* get_font_resource( Display* dpy, char* res_name,