any updates on this?
I haven't been able to work on it much over the past couple of weeks because of midterms. Perhaps I can work on it some more next week. The main problems I'm facing is horrendously slow emulation speed (32 instructions per second vs 6 million instructions per second) and strange quirks when loading large ROMs from storage memory.
souvik1997 wrote:
32 instructions per second vs 6 million instructions per second

...and, without trying to be excessively discouraging, I have a feel that won't get much better... unless there's some giant bug preventing things from running faster and that once fixed it jumps to a much higher speed.
Yeah, that's a pretty significant difference. With that said, though, I don't understand how C on a 60MHz processor could possibly be emulating 32 instructions per second. That just seems too horrifically low.
I'm afraid I'm going to have to drop this in its current state. I have too many things to tend to in school/real life, and I'm barely able to work on any of my projects. The code is under a GPL license on GitHub, so feel free to try to get it in a working state. Right now, the two key problems are loading large ROM files (200KB+) and emulator speed.
I'm rather disappointed to hear this, Souvik. Sad I hope that it becomes feasible for you or someone else to pick this up in the near future and solve whatever is making it so dreadfully slow.
If I ever figure out how to use the SH7724's cache, you might be able to speed up emulation a lot by:
  • Running speed-critical code from the cache (flash runs at a low speed on the peripheral clock, cache runs at the cpu clock)
  • Directly access the ROM from the flash chip. All flash writes should just use BFile calls.
  • You have more than 128KB of RAM available, so no blocks there
I am trying to compile the code that you have, but it keeps giving me this:


Code:
make: Interrupt/Exception caught (code = 0xc00000fd, addr = 0x4227d3)
make: *** [build] Error 255
That seems to be a bug in make, not with my makefile/code. Try downloading a different version.
souvik1997 wrote:
That seems to be a bug in make, not with my makefile/code. Try downloading a different version.

A different version of the SDK? Or just the make? I have 0.3 and I'm pretty sure the new version isn't out yet.
Yeah, pWabbit definitely won't compile under PrizmSDK 0.3. You need the latest version of libfxcg (https://github.com/Jonimoose/libfxcg).
It gives me the same error.
You could try the solution posted here: http://superuser.com/questions/375029/make-interrupt-exception-caught
Adding the SHELL gives me this:

Code:
C:/Users/Kids/Downloads/PrizmSDK-0.3(B)/PrizmSDK-0.3/projects/pWabbit-master/src
/pWabbit.c: At top level:
C:/Users/Kids/Downloads/PrizmSDK-0.3(B)/PrizmSDK-0.3/projects/pWabbit-master/src
/pWabbit.c:16:20: fatal error: menu.hpp: No such file or directory
compilation terminated.
make[1]: *** [pWabbit.o] Error 1
make: *** [build] Error 2
Just remove the #include menu.hpp from pWabbit.c, or get the new file from my git repository. I forgot to add menu.hpp to git, so it didn't upload, but it shouldn't matter because I didn't use the menu system anyway.
Now it says:

Code:
In file included from C:/Users/Kids/Downloads/PrizmSDK-0.3(B)/PrizmSDK-0.3/proje
cts/pWabbit-master/src/pWabbit.c:12:0:
C:/Users/Kids/Downloads/PrizmSDK-0.3(B)/PrizmSDK-0.3/projects/pWabbit-master/inc
ludes/wabbit/hardware/keys.c: At top level:
C:/Users/Kids/Downloads/PrizmSDK-0.3(B)/PrizmSDK-0.3/projects/pWabbit-master/inc
ludes/wabbit/hardware/keys.c:99:3: error: 'KEY_PRGM_DEL' undeclared here (not in
 a function)
C:/Users/Kids/Downloads/PrizmSDK-0.3(B)/PrizmSDK-0.3/projects/pWabbit-master/inc
ludes/wabbit/hardware/keys.c:101:3: error: 'KEY_PRGM_XTHETAT' undeclared here (n
ot in a function)
C:/Users/Kids/Downloads/PrizmSDK-0.3(B)/PrizmSDK-0.3/projects/pWabbit-master/inc
ludes/wabbit/hardware/keys.c:103:3: error: 'KEY_PRGM_FRAC' undeclared here (not
in a function)
C:/Users/Kids/Downloads/PrizmSDK-0.3(B)/PrizmSDK-0.3/projects/pWabbit-master/inc
ludes/wabbit/hardware/keys.c:104:3: error: 'KEY_PRGM_FRAC2DEC' undeclared here (
not in a function)
C:/Users/Kids/Downloads/PrizmSDK-0.3(B)/PrizmSDK-0.3/projects/pWabbit-master/inc
ludes/wabbit/hardware/keys.c:106:3: error: 'KEY_PRGM_VARS' undeclared here (not
in a function)
C:/Users/Kids/Downloads/PrizmSDK-0.3(B)/PrizmSDK-0.3/projects/pWabbit-master/inc
ludes/wabbit/hardware/keys.c:108:3: error: 'KEY_PRGM_EXP' undeclared here (not i
n a function)
C:/Users/Kids/Downloads/PrizmSDK-0.3(B)/PrizmSDK-0.3/projects/pWabbit-master/inc
ludes/wabbit/hardware/keys.c:109:3: error: 'KEY_PRGM_SIN' undeclared here (not i
n a function)
C:/Users/Kids/Downloads/PrizmSDK-0.3(B)/PrizmSDK-0.3/projects/pWabbit-master/inc
ludes/wabbit/hardware/keys.c:110:3: error: 'KEY_PRGM_COS' undeclared here (not i
n a function)
C:/Users/Kids/Downloads/PrizmSDK-0.3(B)/PrizmSDK-0.3/projects/pWabbit-master/inc
ludes/wabbit/hardware/keys.c:111:3: error: 'KEY_PRGM_TAN' undeclared here (not i
n a function)
C:/Users/Kids/Downloads/PrizmSDK-0.3(B)/PrizmSDK-0.3/projects/pWabbit-master/inc
ludes/wabbit/hardware/keys.c:112:3: error: 'KEY_PRGM_CARET' undeclared here (not
 in a function)
C:/Users/Kids/Downloads/PrizmSDK-0.3(B)/PrizmSDK-0.3/projects/pWabbit-master/inc
ludes/wabbit/hardware/keys.c:113:3: error: 'KEY_PRGM_XSQUARED' undeclared here (
not in a function)
C:/Users/Kids/Downloads/PrizmSDK-0.3(B)/PrizmSDK-0.3/projects/pWabbit-master/inc
ludes/wabbit/hardware/keys.c:114:3: error: 'KEY_PRGM_COMMA' undeclared here (not
 in a function)
C:/Users/Kids/Downloads/PrizmSDK-0.3(B)/PrizmSDK-0.3/projects/pWabbit-master/inc
ludes/wabbit/hardware/keys.c:115:3: error: 'KEY_PRGM_LPAREN' undeclared here (no
t in a function)
C:/Users/Kids/Downloads/PrizmSDK-0.3(B)/PrizmSDK-0.3/projects/pWabbit-master/inc
ludes/wabbit/hardware/keys.c:116:3: error: 'KEY_PRGM_RPAREN' undeclared here (no
t in a function)
C:/Users/Kids/Downloads/PrizmSDK-0.3(B)/PrizmSDK-0.3/projects/pWabbit-master/inc
ludes/wabbit/hardware/keys.c:117:3: error: 'KEY_PRGM_DIVIDE' undeclared here (no
t in a function)
C:/Users/Kids/Downloads/PrizmSDK-0.3(B)/PrizmSDK-0.3/projects/pWabbit-master/inc
ludes/wabbit/hardware/keys.c:118:3: error: 'KEY_PRGM_LOG' undeclared here (not i
n a function)
C:/Users/Kids/Downloads/PrizmSDK-0.3(B)/PrizmSDK-0.3/projects/pWabbit-master/inc
ludes/wabbit/hardware/keys.c:122:3: error: 'KEY_PRGM_MULTIPLY' undeclared here (
not in a function)
C:/Users/Kids/Downloads/PrizmSDK-0.3(B)/PrizmSDK-0.3/projects/pWabbit-master/inc
ludes/wabbit/hardware/keys.c:123:3: error: 'KEY_PRGM_LN' undeclared here (not in
 a function)
C:/Users/Kids/Downloads/PrizmSDK-0.3(B)/PrizmSDK-0.3/projects/pWabbit-master/inc
ludes/wabbit/hardware/keys.c:127:3: error: 'KEY_PRGM_SUBTRACT' undeclared here (
not in a function)
C:/Users/Kids/Downloads/PrizmSDK-0.3(B)/PrizmSDK-0.3/projects/pWabbit-master/inc
ludes/wabbit/hardware/keys.c:128:3: error: 'KEY_PRGM_ARROW' undeclared here (not
 in a function)
C:/Users/Kids/Downloads/PrizmSDK-0.3(B)/PrizmSDK-0.3/projects/pWabbit-master/inc
ludes/wabbit/hardware/keys.c:132:3: error: 'KEY_PRGM_ADD' undeclared here (not i
n a function)
C:/Users/Kids/Downloads/PrizmSDK-0.3(B)/PrizmSDK-0.3/projects/pWabbit-master/inc
ludes/wabbit/hardware/keys.c:135:3: error: 'KEY_PRGM_DOT' undeclared here (not i
n a function)
C:/Users/Kids/Downloads/PrizmSDK-0.3(B)/PrizmSDK-0.3/projects/pWabbit-master/inc
ludes/wabbit/hardware/keys.c:136:3: error: 'KEY_PRGM_NEGATE' undeclared here (no
t in a function)
[...]
make[1]: *** [pWabbit.o] Error 1
make: *** [build] Error 2
Put this in PrizmSDK-0.3/include/fxcg/keyboard.h:

Code:
#ifndef __KEYBOARD_H__
#define __KEYBOARD_H__
// Character codes
#define KEY_CHAR_0          0x30
#define KEY_CHAR_1          0x31
#define KEY_CHAR_2          0x32
#define KEY_CHAR_3          0x33
#define KEY_CHAR_4          0x34
#define KEY_CHAR_5          0x35
#define KEY_CHAR_6          0x36
#define KEY_CHAR_7          0x37
#define KEY_CHAR_8          0x38
#define KEY_CHAR_9          0x39
#define KEY_CHAR_DP         0x2e
#define KEY_CHAR_EXP        0x0f
#define KEY_CHAR_PMINUS     0x87
#define KEY_CHAR_PLUS       0x89
#define KEY_CHAR_MINUS      0x99
#define KEY_CHAR_MULT       0xa9
#define KEY_CHAR_DIV        0xb9
#define KEY_CHAR_FRAC       0xbb
#define KEY_CHAR_LPAR       0x28
#define KEY_CHAR_RPAR       0x29
#define KEY_CHAR_COMMA      0x2c
#define KEY_CHAR_STORE      0x0e
#define KEY_CHAR_LOG        0x95
#define KEY_CHAR_LN         0x85
#define KEY_CHAR_SIN        0x81
#define KEY_CHAR_COS        0x82
#define KEY_CHAR_TAN        0x83
#define KEY_CHAR_SQUARE     0x8b
#define KEY_CHAR_POW        0xa8
#define KEY_CHAR_IMGNRY     0x7f50
#define KEY_CHAR_LIST       0x7f51
#define KEY_CHAR_MAT        0x7f40
#define KEY_CHAR_EQUAL      0x3d
#define KEY_CHAR_PI         0xd0
#define KEY_CHAR_ANS        0xc0
#define KEY_CHAR_LBRCKT     0x5b
#define KEY_CHAR_RBRCKT     0x5d
#define KEY_CHAR_LBRACE     0x7b
#define KEY_CHAR_RBRACE     0x7d
#define KEY_CHAR_CR         0x0d
#define KEY_CHAR_CUBEROOT   0x96
#define KEY_CHAR_RECIP      0x9b
#define KEY_CHAR_ANGLE      0x7f54
#define KEY_CHAR_EXPN10     0xb5
#define KEY_CHAR_EXPN       0xa5
#define KEY_CHAR_ASIN       0x91
#define KEY_CHAR_ACOS       0x92
#define KEY_CHAR_ATAN       0x93
#define KEY_CHAR_ROOT       0x86
#define KEY_CHAR_POWROOT    0xb8
#define KEY_CHAR_SPACE      0x20
#define KEY_CHAR_DQUATE     0x22
#define KEY_CHAR_VALR       0xcd
#define KEY_CHAR_THETA      0xce
#define KEY_CHAR_A          0x41
#define KEY_CHAR_B          0x42
#define KEY_CHAR_C          0x43
#define KEY_CHAR_D          0x44
#define KEY_CHAR_E          0x45
#define KEY_CHAR_F          0x46
#define KEY_CHAR_G          0x47
#define KEY_CHAR_H          0x48
#define KEY_CHAR_I          0x49
#define KEY_CHAR_J          0x4a
#define KEY_CHAR_K          0x4b
#define KEY_CHAR_L          0x4c
#define KEY_CHAR_M          0x4d
#define KEY_CHAR_N          0x4e
#define KEY_CHAR_O          0x4f
#define KEY_CHAR_P          0x50
#define KEY_CHAR_Q          0x51
#define KEY_CHAR_R          0x52
#define KEY_CHAR_S          0x53
#define KEY_CHAR_T          0x54
#define KEY_CHAR_U          0x55
#define KEY_CHAR_V          0x56
#define KEY_CHAR_W          0x57
#define KEY_CHAR_X          0x58
#define KEY_CHAR_Y          0x59
#define KEY_CHAR_Z          0x5a


// Control codes
#define KEY_CTRL_NOP        0
#define KEY_CTRL_EXE        30004
#define KEY_CTRL_DEL        30025
#define KEY_CTRL_AC         30015
#define KEY_CTRL_FD         30046
#define KEY_CTRL_UNDO       30045   
#define KEY_CTRL_XTT        30001
#define KEY_CTRL_EXIT       30002
#define KEY_CTRL_SHIFT      30006
#define KEY_CTRL_ALPHA      30007
#define KEY_CTRL_OPTN       30008
#define KEY_CTRL_VARS       30016
#define KEY_CTRL_UP         30018
#define KEY_CTRL_DOWN       30023
#define KEY_CTRL_LEFT       30020
#define KEY_CTRL_RIGHT      30021
#define KEY_CTRL_F1         30009
#define KEY_CTRL_F2         30010
#define KEY_CTRL_F3         30011
#define KEY_CTRL_F4         30012
#define KEY_CTRL_F5         30013
#define KEY_CTRL_F6         30014
#define KEY_CTRL_CATALOG    30100
#define KEY_CTRL_CAPTURE    30055
#define KEY_CTRL_CLIP       30050
#define KEY_CTRL_PASTE      30036
#define KEY_CTRL_INS        30033
#define KEY_CTRL_MIXEDFRAC  30054
#define KEY_CTRL_FRACCNVRT  30026
#define KEY_CTRL_QUIT       30029
#define KEY_CTRL_PRGM       30028
#define KEY_CTRL_SETUP      30037
#define KEY_CTRL_PAGEUP     30052
#define KEY_CTRL_PAGEDOWN   30053
#define KEY_CTRL_MENU       30003
#define KEY_SHIFT_OPTN       30059
#define KEY_CTRL_RESERVE1   30060
#define KEY_CTRL_RESERVE2   30061
#define KEY_SHIFT_LEFT      30062
#define KEY_SHIFT_RIGHT      30063

#define KEY_PRGM_ACON 10
#define KEY_PRGM_DOWN 37
#define KEY_PRGM_EXIT 47
#define KEY_PRGM_F1 79
#define KEY_PRGM_F2 69
#define KEY_PRGM_F3 59
#define KEY_PRGM_F4 49
#define KEY_PRGM_F5 39
#define KEY_PRGM_F6 29
#define KEY_PRGM_LEFT 38
#define KEY_PRGM_NONE 0
#define KEY_PRGM_RETURN 31
#define KEY_PRGM_RIGHT 27
#define KEY_PRGM_UP 28
#define KEY_PRGM_1 72
#define KEY_PRGM_2 62
#define KEY_PRGM_3 52
#define KEY_PRGM_4 73
#define KEY_PRGM_5 63
#define KEY_PRGM_6 53
#define KEY_PRGM_7 74
#define KEY_PRGM_8 64
#define KEY_PRGM_9 54
#define KEY_PRGM_A 76
#define KEY_PRGM_F 26
#define KEY_PRGM_ALPHA 77
#define KEY_PRGM_SHIFT 78
#define KEY_PRGM_MENU 48

#define KEY_PRGM_0 71

#define KEY_PRGM_DPoint 61

#define KEY_PRGM_EXP 51

#define KEY_PRGM_NEGSIGN 41

#define KEY_PRGM_PLUS 42

#define KEY_PRGM_MINUS 32

#define KEY_PRGM_MULT 43

#define KEY_PRGM_DEL 44

#define KEY_PRGM_B 66

#define KEY_PRGM_C 56

#define KEY_PRGM_D 46

#define KEY_PRGM_E 36

#define KEY_PRGM_OPTN 68
#define KEY_PRGM_XTHETAT KEY_PRGM_A
#define KEY_PRGM_FRAC 75
#define KEY_PRGM_FRAC2DEC 65
#define KEY_PRGM_VARS 58
#define KEY_PRGM_SIN KEY_PRGM_D
#define KEY_PRGM_COS KEY_PRGM_E
#define KEY_PRGM_TAN 26
#define KEY_PRGM_CARET 57
#define KEY_PRGM_XSQUARED 67
#define KEY_PRGM_COMMA 35
#define KEY_PRGM_LPAREN 55
#define KEY_PRGM_RPAREN 45
#define KEY_PRGM_DIVIDE 23
#define KEY_PRGM_LOG KEY_PRGM_B
#define KEY_PRGM_LN KEY_PRGM_C
#define KEY_PRGM_SUBTRACT 22
#define KEY_PRGM_ADD 32
#define KEY_PRGM_DOT KEY_PRGM_DPoint
#define KEY_PRGM_NEGATE 31
#define KEY_PRGM_MULTIPLY 33
#define KEY_PRGM_ARROW 25


// in Bkey_GetKeyWait function
#define KEYWAIT_HALTON_TIMEROFF     0
#define KEYWAIT_HALTOFF_TIMEROFF    1
#define KEYWAIT_HALTON_TIMERON      2

#define KEYREP_NOEVENT              0
#define KEYREP_KEYEVENT             1
#define KEYREP_TIMEREVENT           2

#ifdef __cplusplus
extern "C" {
#endif

void Set_FKeys2( unsigned int p1 );
void Set_FKeys1( unsigned int p1, unsigned int*P2 );
void PRGM_GetKey_OS( unsigned char*p );
int GetKey(int*key);
int GetKeyWait_OS(int*column, int*row, int type_of_waiting, int timeout_period, int menu, unsigned short*keycode );
int PRGM_GetKey();

#ifdef __cplusplus
}
#endif

#endif
AHelper wrote:
If I ever figure out how to use the SH7724's cache, you might be able to speed up emulation a lot by:
  • Running speed-critical code from the cache (flash runs at a low speed on the peripheral clock, cache runs at the cpu clock)
  • Directly access the ROM from the flash chip. All flash writes should just use BFile calls.
  • You have more than 128KB of RAM available, so no blocks there
But 187,500 times faster to get even 6MHz? I find it hard to believe there isn't some massive time sink that's being overlooked here. I've be very interested to see some examination of the codebase running under Tari's "emulation" system.
Now it says:

Edit by Kerm: Please just post the error line.

These are the only lines that say error:

Code:
make[1]: *** [pWabbit.o] Error 1
make: *** [build] Error 2
That's not very helpful. Razz Surely there are other lines that have the word "error" in them.
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 2 of 3
» All times are GMT - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement