diff --git a/include/kernel/context.h b/include/kernel/context.h deleted file mode 100644 index f89e0d7..0000000 --- a/include/kernel/context.h +++ /dev/null @@ -1,40 +0,0 @@ -#ifndef __KERNEL_CONTEXT_H__ -# define __KERNEL_CONTEXT_H__ - -#include -#include - -typedef struct fx9860_context_s -{ - struct { - uint16_t control; - uint16_t autofix; - uint16_t scan_mode; - uint16_t scan_state; - uint16_t interrupt; - uint16_t scan_wait; - uint16_t scan_interval; - uint16_t kyoutdr; - uint16_t kyindr; - } keyboard; - struct { - uint16_t ipra; - uint16_t iprb; - uint16_t iprc; - uint16_t iprd; - uint16_t ipre; - uint16_t iprf; - uint16_t iprg; - uint16_t iprh; - uint16_t ipri; - uint16_t iprj; - uint16_t iprk; - uint16_t iprl; - } intc; -} fx9860_context_t; - -// Context primitive. -extern void fx9860_context_save(fx9860_context_t *context); -extern void fx9860_context_restore(fx9860_context_t *context); - -#endif /*__KERNEL_CONTEXT_H__*/ diff --git a/include/kernel/devices/ubc.h b/include/kernel/devices/ubc.h index 13e3613..966f820 100644 --- a/include/kernel/devices/ubc.h +++ b/include/kernel/devices/ubc.h @@ -4,7 +4,7 @@ #include #include -typedef struct ubc_context_s +struct ubc_context_s { uint32_t reg[16]; uint32_t gbr; @@ -12,7 +12,22 @@ typedef struct ubc_context_s uint32_t mach; uint32_t ssr; uint32_t spc; -} ubc_context_t; +}; + +typedef struct ubc_session_s +{ + struct { + struct { + uint32_t cursor; + } context; + struct { + uint32_t cursor; + } disassembly; + } menu; + struct ubc_context_s *context; + unsigned int key; + int channel; +} ubc_session_t; // Primitives. extern int ubc_open(void); diff --git a/include/kernel/keybios.h b/include/kernel/keybios.h new file mode 100644 index 0000000..ab70dd8 --- /dev/null +++ b/include/kernel/keybios.h @@ -0,0 +1,158 @@ +/*****************************************************************/ +/* */ +/* CASIO fx-9860G SDK Library */ +/* */ +/* File name : keybios.h */ +/* */ +/* Copyright (c) 2006 CASIO COMPUTER CO., LTD. */ +/* */ +/*****************************************************************/ + +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef __KEYBIOS_H__ +#define __KEYBIOS_H__ + + +// Defines + +// 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 //0x7534 +#define KEY_CTRL_DEL 30025 //0x7549 +#define KEY_CTRL_AC 30015 //0x753f +#define KEY_CTRL_FD 30046 //0x755e +#define KEY_CTRL_XTT 30001 //0x7531 +#define KEY_CTRL_EXIT 30002 //0x7532 +#define KEY_CTRL_SHIFT 30006 //0x7536 +#define KEY_CTRL_ALPHA 30007 //0x7537 +#define KEY_CTRL_OPTN 30008 //0x7538 +#define KEY_CTRL_VARS 30016 //0x7540 +#define KEY_CTRL_UP 30018 //0x7542 +#define KEY_CTRL_DOWN 30023 //0x7547 +#define KEY_CTRL_LEFT 30020 //0x7544 +#define KEY_CTRL_RIGHT 30021 //0x7545 +#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_CTRL_RESERVE1 30060 +#define KEY_CTRL_RESERVE2 30061 +#define KEY_CTRL_RESERVE3 30062 + + +// 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 + + +#endif + +#ifdef __cplusplus +} +#endif diff --git a/include/kernel/opcode.h b/include/kernel/opcode.h new file mode 100644 index 0000000..c0b1fe5 --- /dev/null +++ b/include/kernel/opcode.h @@ -0,0 +1,21 @@ +#ifndef __OPCODE_H__ +# define __OPCODE_H__ + +#include +#include + +// Define the number max of arguments +// for intrustions. +#define ARGUMENTS_MAX 3 + +/* opcode - instruction data part. */ +struct opcode_s +{ + const char *name; + uint16_t mask; + uint16_t code; + uint16_t arg_mask[ARGUMENTS_MAX]; + void (*special)(char *buffer, struct opcode_s); +}; + +#endif /*__OPCODE_H__*/ diff --git a/include/kernel/syscall.h b/include/kernel/syscall.h index 3cba057..99aa12b 100644 --- a/include/kernel/syscall.h +++ b/include/kernel/syscall.h @@ -19,6 +19,9 @@ struct rect /* GetKey() - display Casio's VRAM and wait keyboard input. */ void casio_GetKey(unsigned int *key); +/* Bdisp_PutDisp_DD - display Casio's VRAM on screen */ +void casio_Bdisp_PutDisp_DD(void); + /* Bdisp_AllClr_VRAM() - clear entirely the Casio's VRAM */ void casio_Bdisp_AllClr_VRAM(void); @@ -26,7 +29,7 @@ void casio_Bdisp_AllClr_VRAM(void); void casio_Bdisp_AreaClr_VRAM(const struct rect *buf); /* PrintMini() - print string in Casio's VRAM (and display on screen ?) */ -void casio_PrintMini(size_t x, size_t y, char const *str, int mode); +void casio_Bdisp_PrintMini(size_t x, size_t y, char const *str, int mode); /* Bdisp_DrawLine_VRAM() - draw line in Casio's VRAM. */ void casio_Bdisp_DrawLine_VRAM(int x1, int y1, int x2, int y2); @@ -52,13 +55,5 @@ static inline void dclear_area(int x1, int y1, int x2, int y2) struct rect area = {.left = x1, .top = y1, .right = x2, .bottom = y2}; casio_Bdisp_AreaClr_VRAM(&area); } -#define print(x, y, str) casio_PrintMini(x, y, str, 0) -#define getkey casio_GetKey -#define dline_horizontal(y, x1, x2) casio_Bdisp_DrawLine_VRAM(x1, y, x2, y) -#define dclear casio_Bdisp_AllClr_VRAM -#define save_window casio_SaveDisp -#define restore_window casio_RestoreDisp -#define malloc casio_Malloc -#define free casio_Free #endif /*__CASIO_H__*/ diff --git a/include/lib/display.h b/include/lib/display.h index 4e0989c..7dc9e79 100644 --- a/include/lib/display.h +++ b/include/lib/display.h @@ -19,6 +19,9 @@ #define DISPLAY_SCREEN_WIDTH 128 #define DISPLAY_SCREEN_HEIGHT 64 +#define DISPLAY_VLINES_MAX (DISPLAY_SCREEN_HEIGHT / (KERNEL_FONT_REAL_HEIGHT + 1)) +#define DISPLAY_HLINES_MAX (DISPLAY_SCREEN_WIDTH / (KERNEL_FONT_REAL_WIDTH + 1)) + // Primtives extern void dclear(void); extern void dprint(int x, int y, char const *str, ...); diff --git a/src/kernel/bootstrap/fx9860_context.c b/src/kernel/bootstrap/fx9860_context.c deleted file mode 100644 index 3487746..0000000 --- a/src/kernel/bootstrap/fx9860_context.c +++ /dev/null @@ -1,59 +0,0 @@ -#include -#include -#include - -void fx9860_context_save(fx9860_context_t *context) -{ - // Save Interrupt Controller (INTC) - context->intc.ipra = SH7305_INTC.IPRA.WORD; - context->intc.iprb = SH7305_INTC.IPRB.WORD; - context->intc.iprc = SH7305_INTC.IPRC.WORD; - context->intc.iprd = SH7305_INTC.IPRD.WORD; - context->intc.ipre = SH7305_INTC.IPRE.WORD; - context->intc.iprf = SH7305_INTC.IPRF.WORD; - context->intc.iprg = SH7305_INTC.IPRG.WORD; - context->intc.iprh = SH7305_INTC.IPRH.WORD; - context->intc.ipri = SH7305_INTC.IPRI.WORD; - context->intc.iprj = SH7305_INTC.IPRJ.WORD; - context->intc.iprk = SH7305_INTC.IPRK.WORD; - context->intc.iprl = SH7305_INTC.IPRL.WORD; - - // Save Key Scan (KEYSC) context. - context->keyboard.control = SH7305_KEYSC.CONTROL.WORD; - context->keyboard.autofix = SH7305_KEYSC.AUTOFIX.WORD; - context->keyboard.scan_mode = SH7305_KEYSC.SCAN_MODE.WORD; - context->keyboard.scan_state = SH7305_KEYSC.SCAN_STATE.WORD; - context->keyboard.interrupt = SH7305_KEYSC.INTERRUPT.WORD; - context->keyboard.scan_wait = SH7305_KEYSC.SCAN_WAIT.WORD; - context->keyboard.scan_interval = SH7305_KEYSC.SCAN_INTERVAL; - context->keyboard.kyoutdr = SH7305_KEYSC.KYOUTDR.WORD; - context->keyboard.kyindr = SH7305_KEYSC.KYINDR.WORD; -} - -void fx9860_context_restore(fx9860_context_t *context) -{ - // Restore Key Scan (KEYSC) context. - SH7305_KEYSC.CONTROL.WORD = context->keyboard.control; - SH7305_KEYSC.AUTOFIX.WORD = context->keyboard.autofix; - SH7305_KEYSC.SCAN_MODE.WORD = context->keyboard.scan_mode; - SH7305_KEYSC.SCAN_STATE.WORD = context->keyboard.scan_state; - SH7305_KEYSC.INTERRUPT.WORD = context->keyboard.interrupt; - SH7305_KEYSC.SCAN_WAIT.WORD = context->keyboard.scan_wait; - SH7305_KEYSC.SCAN_INTERVAL = context->keyboard.scan_interval; - SH7305_KEYSC.KYOUTDR.WORD = context->keyboard.kyoutdr; - SH7305_KEYSC.KYINDR.WORD = context->keyboard.kyindr; - - // Restore Interrupt Controller (INTC) - SH7305_INTC.IPRA.WORD = context->intc.ipra; - SH7305_INTC.IPRB.WORD = context->intc.iprb; - SH7305_INTC.IPRC.WORD = context->intc.iprc; - SH7305_INTC.IPRD.WORD = context->intc.iprd; - SH7305_INTC.IPRE.WORD = context->intc.ipre; - SH7305_INTC.IPRF.WORD = context->intc.iprf; - SH7305_INTC.IPRG.WORD = context->intc.iprg; - SH7305_INTC.IPRH.WORD = context->intc.iprh; - SH7305_INTC.IPRI.WORD = context->intc.ipri; - SH7305_INTC.IPRJ.WORD = context->intc.iprj; - SH7305_INTC.IPRK.WORD = context->intc.iprk; - SH7305_INTC.IPRL.WORD = context->intc.iprl; -} diff --git a/src/kernel/bootstrap/section_actions.s b/src/kernel/bootstrap/section_actions.s deleted file mode 100644 index 776bd7f..0000000 --- a/src/kernel/bootstrap/section_actions.s +++ /dev/null @@ -1,49 +0,0 @@ -.globl _section_wipe -.global _section_load -.type _section_load, @function -.type _section_wipe, @function - -.align 2 -/* -** section_map(uint32_t *dest, uint32_t *src, size_t size) -** Load section using his symbols. -*/ -_section_load: - shlr2 r6 ! sections are force 4-aligned by the linker. - tst r6, r6 ! check null section... - bt load_loop_end ! ...if null, exit. - -load_loop_entry: - mov.l @r5, r1 ! get "src" data. - mov.l r1, @r4 ! copy into the "dest" section. - add #4, r5 ! update "src" address. - dt r6 ! check the load size. - bf/s load_loop_entry ! loop jump. - add #4, r4 ! update "dest" address. - -load_loop_end: - rts ! clean exit. - nop ! delayed branch. - - -/* -** section_wipe(uint32_t *bsection, size_t size) -** Wipe section using his symbols. -*/ -_section_wipe: - mov #0, r0 ! wipe data. - shlr2 r5 ! the section force 4-aligned by the linker. - tst r5, r5 ! Check null section... - bt wipe_loop_end ! ...if null, exit ! - -wipe_loop_entry: - mov.l r0, @r4 ! wipe section part. - dt r5 ! check the section size. - bf/s wipe_loop_entry ! loop jump. - add #4, r4 ! address update. - -wipe_loop_end: - rts ! clean exit. - nop ! delayed branch. - -.end diff --git a/src/kernel/bootstrap/vhex_context.c b/src/kernel/bootstrap/vhex_context.c deleted file mode 100644 index 0b6c18b..0000000 --- a/src/kernel/bootstrap/vhex_context.c +++ /dev/null @@ -1,52 +0,0 @@ -#include -#include -#include -#include - -void vhex_context_set(void) -{ - // Initialize Interrupt Controller (INTC). - SH7305_INTC.IPRA.WORD = 0x0000; - SH7305_INTC.IPRB.WORD = 0x0000; - SH7305_INTC.IPRC.WORD = 0x0000; - SH7305_INTC.IPRD.WORD = 0x0000; - SH7305_INTC.IPRE.WORD = 0x0000; - SH7305_INTC.IPRF.WORD = 0x0000; - SH7305_INTC.IPRG.WORD = 0x0000; - SH7305_INTC.IPRH.WORD = 0x0000; - SH7305_INTC.IPRI.WORD = 0x0000; - SH7305_INTC.IPRJ.WORD = 0x0000; - SH7305_INTC.IPRK.WORD = 0x0000; - SH7305_INTC.IPRL.WORD = 0x0000; - - // Configure Key Scan (KEYSC) -/* SH7305_INTC.IMR5.KEYI = 1; // Mask KEYSC interrupt. - SH7305_INTC.IPRF.KEYSC = 15; // Disable KEYSC interrupt. - SH7305_KEYSC.CONTROL.KEYIE = 0; // Disable KEYSC interrupt during init. - SH7305_KEYSC.CONTROL.INTMODE = 0b00; // Use default (?) interrupt mode. - SH7305_KEYSC.AUTOFIX.ENABLE = 1; // Enable key bounce fix (?) - SH7305_KEYSC.AUTOFIX.UNKNOWN0 = 0b100; // Unknown, use Casio's value. (autofix) - SH7305_KEYSC.AUTOFIX.UNKNOWN1 = 0b10; // Unknown, use Casio's value. (autofix) - SH7305_KEYSC.SCAN_MODE.UNKNOWN0 = 0b000; // Unknown, use Casio's value. (scan mode) - SH7305_KEYSC.SCAN_MODE.UNKNOWN1 = 0b010; // Unknown, use Casio's value. (scan mode) - SH7305_KEYSC.INTERRUPT.KYCPU_IE = 0b0000100; // Interrupt when one key is pressed or released. - SH7305_KEYSC.SCAN_WAIT.TIME = 0x00; // No time between each interrupt. - SH7305_KEYSC.SCAN_INTERVAL = 0x98; // Unknown, use Casio's value. (scan interval) - SH7305_KEYSC.KYOUTDR.KYO5DT = 0b11; // Trigger when high-impedance state is detected. - SH7305_KEYSC.KYOUTDR.KYO4DT = 0b11; // Trigger when high-impedance state is detected. - SH7305_KEYSC.KYOUTDR.KYO3DT = 0b11; // Trigger when high-impedance state is detected. - SH7305_KEYSC.KYOUTDR.KYO2DT = 0b11; // Trigger when high-impedance state is detected. - SH7305_KEYSC.KYOUTDR.KYO1DT = 0b11; // Trigger when high-impedance state is detected. - SH7305_KEYSC.KYOUTDR.KYO0DT = 0b11; // Trigger when high-impedance state is detected. - SH7305_KEYSC.KYINDR.KYDIR6 = 1; // Scan [F1],[SHIFT],[ALPHA],[x,o,T],[div],[7],[4],[1],[0] - SH7305_KEYSC.KYINDR.KYDIR5 = 1; // Scan [F2],[OPT],[^2],[log],[FD],[8],[5],[2],[.] - SH7305_KEYSC.KYINDR.KYDIR4 = 1; // Scan [F3],[VAR],[^],[ln],[(],[9],[6],[3],[x10] - SH7305_KEYSC.KYINDR.KYDIR3 = 1; // Scan [F4],[MENU],[EXIT],[sin],[)],[DEL],[x],[+],[(-)] - SH7305_KEYSC.KYINDR.KYDIR2 = 1; // Scan [F5],[left],[down],[cos],[,],[%],[-],[EXE] - SH7305_KEYSC.KYINDR.KYDIR1 = 1; // Scan [F6],[up],[right],[tan],[->] - SH7305_KEYSC.KYINDR.KYDIR0 = 1; // Scan [AC/ON] - SH7305_KEYSC.CONTROL.KEYIE = 1; // Enable KEYSC interrupt. - SH7305_INTC.IPRF.KEYSC = 15; // Set KEYSC interrupt priority (max). - SH7305_INTC.IMCR5.KEYI = 1; // Clear KEYSC interrupt mask. -*/ -} diff --git a/src/kernel/dbr/handler.c b/src/kernel/dbr/handler.c index 3eb7289..3163e51 100644 --- a/src/kernel/dbr/handler.c +++ b/src/kernel/dbr/handler.c @@ -1,32 +1,39 @@ #include #include +#include #include #include #include -void ubc_handler(ubc_context_t *context, int channel) -{ - unsigned int key; - dclear(); - dprint(0, 0, - "UBC INTERRUPT !!!!\n" - "context.spc = %p\n" - "context.ssr = %p\n" - "context.stack = %p\n" - "context = %p\n" - "UBC interrupt = %#x\n" - "Channel = %#x\n", - context->spc, - context->ssr, - context->reg[15], - context, - SH7305_UBC.CCMFR.LONG_WORD, - channel - ); - dupdate(); - while (1) +// Internal function. +extern void menu_context(ubc_session_t *session); +extern void menu_disassembly(ubc_session_t *session); + +void ubc_handler(struct ubc_context_s *context, int channel) +{ + void (*menu)(ubc_session_t *session); + ubc_session_t session; + + // Initialize new session. + session.key = 0; + session.channel = channel; + session.context = context; + session.menu.context.cursor = 0; + session.menu.disassembly.cursor = 0; + + // Initialize menu function. + menu = &menu_disassembly; + + // Main loop. + while (session.key != KEY_CTRL_EXIT) { - casio_GetKey(&key); + menu(&session); + casio_GetKey(&session.key); + switch (session.key) + { + case KEY_CTRL_F1: menu = &menu_disassembly; break; + case KEY_CTRL_F2: menu = &menu_context; break; + } } } diff --git a/src/kernel/dbr/handler_pre.s b/src/kernel/dbr/handler_pre.s index 9c7da07..0db218c 100644 --- a/src/kernel/dbr/handler_pre.s +++ b/src/kernel/dbr/handler_pre.s @@ -8,20 +8,21 @@ .align 2 _ubc_handler_pre: ! Stack management. + stc.l spc, @-r15 ! Save SPC regsiter. + stc.l ssr, @-r15 ! Save SSR regsiter. + .word 0b0100111100110010 ! Save SGR register (save r15 address befor break) "stc.l sgr, @-r15" mov.l r8, @-r15 ! Save r8 register. mov.l r9, @-r15 ! Save r9 register. sts.l pr, @-r15 ! Save pr regsiter. mov r15, r0 ! Save stack address. (used for UBC context) ! Generate UBC context - mov r15, r1 ! Get current stack address. - add #12, r1 ! Get stack addres "before" UBC interrupt. stc.l spc, @-r15 ! Get SPC register. stc.l ssr, @-r15 ! Get SSR register. sts.l mach, @-r15 ! Get MACH register. sts.l macl, @-r15 ! Get MACL register. stc.l gbr, @-r15 ! Get GBR register. - mov.l r1, @-r15 ! Get "program" stack before UBC interrupt. + .word 0b0100111100110010 ! Get SGR register (save r15 address befor break) "stc.l sgr, @-r15" mov.l r14, @-r15 ! Get r14 register. mov.l r13, @-r15 ! Get r13 register. mov.l r12, @-r15 ! Get r12 register. @@ -67,10 +68,15 @@ _ubc_handler_pre: ldc r9, sr ! Restore SR register (with SR.BL = 1 and SR.IMASK = 0b1111) ! Clean exit. - add r8, r15 ! Restore stack space. + mov r8, r15 ! Restore stack space. + lds.l @r15+, pr ! Restor PR register. mov.l @r15+, r9 ! Restore r9 register. + mov.l @r15+, r8 ! Restore r8 register. + .word 0b0100111100110110 ! Restore SGR regsiter. "ldc.l @r15+, sgr" + ldc.l @r15+, ssr ! Restore SSR regsiter. + ldc.l @r15+, spc ! Restore SPC regsiter. rte ! Interrupt Exit. - mov.l @r15+, r8 ! (db) Restore r8 register. + nop ! (db) Safety first. .align 4 diff --git a/src/kernel/dbr/menu/context.c b/src/kernel/dbr/menu/context.c new file mode 100644 index 0000000..0b17b1e --- /dev/null +++ b/src/kernel/dbr/menu/context.c @@ -0,0 +1,119 @@ +#include +#include +#include +#include + +// Menu string format. +const char *content_string[] = { + "!!!! UBC INTERRUPT !!!!", + "Special registers:", + "SPC = %p", + "Stack = %p", + "SSR = %#x", + "\n", + "Generale registers:", + "r0 = %#x", + "r1 = %#x", + "r2 = %#x", + "r3 = %#x", + "r4 = %#x", + "r5 = %#x", + "r6 = %#x", + "r7 = %#x", + "r8 = %#x", + "r9 = %#x", + "r10 = %#x", + "r11 = %#x", + "r12 = %#x", + "r13 = %#x", + "r14 = %#x", + "r15 = %#x", + "\n", + "Debug informations:", + "context = %p", + "UBC interrupt = %#x", + "Channel = %#x", + NULL +}; + +// +// cursor_update - Update cursor position key pressed based. +// @note: +// Some limits are hard coded so be careful. +// +static void cursor_update(ubc_session_t *session) +{ + if (session->key == KEY_CTRL_UP && + session->menu.context.cursor > 0) + { + session->menu.context.cursor = session->menu.context.cursor - 1; + return; + } + if (session->key == KEY_CTRL_DOWN && + session->menu.context.cursor < 28 - DISPLAY_VLINES_MAX) + { + session->menu.context.cursor = session->menu.context.cursor + 1; + return; + } +} + +// +// menu_context - Show programe context. +// @note: +// This is not the best way to do the job, +// but for now the goal is the create a fonctionnal +// on-calc debugger. +// +void menu_context(ubc_session_t *session) +{ + // Menu string data + uint32_t content_data[] = { + 0, + 0, + session->context->spc, + session->context->reg[15], + session->context->ssr, + 0, + 0, + session->context->reg[0], + session->context->reg[1], + session->context->reg[2], + session->context->reg[3], + session->context->reg[4], + session->context->reg[5], + session->context->reg[6], + session->context->reg[7], + session->context->reg[8], + session->context->reg[9], + session->context->reg[10], + session->context->reg[11], + session->context->reg[12], + session->context->reg[13], + session->context->reg[14], + session->context->reg[15], + 0, + 0, + (uint32_t)session->context, + SH7305_UBC.CCMFR.LONG_WORD, + session->channel + }; + + // Update cursor position. + cursor_update(session); + + // Clear VRAM. + dclear(); + + // Display menu based on cursor position. + for (int i = 0 ; content_string[i + session->menu.context.cursor] != NULL && + i < DISPLAY_VLINES_MAX ; i = i + 1) + { + dprint(0, i, + content_string[i + session->menu.context.cursor], + content_data[i + session->menu.context.cursor] + ); + } + + // Display VRAM + dupdate(); +} diff --git a/src/kernel/dbr/menu/disassembly.c b/src/kernel/dbr/menu/disassembly.c new file mode 100644 index 0000000..5d9b42a --- /dev/null +++ b/src/kernel/dbr/menu/disassembly.c @@ -0,0 +1,10 @@ +#include +#include + +void menu_disassembly(ubc_session_t *session) +{ + // test + dclear(); + dprint(0, 0, "Disassembly Menu !!"); + dupdate(); +} diff --git a/include/opcode.h b/src/kernel/dbr/opcode.c similarity index 88% rename from include/opcode.h rename to src/kernel/dbr/opcode.c index e806727..9f2abaa 100644 --- a/include/opcode.h +++ b/src/kernel/dbr/opcode.c @@ -1,21 +1,7 @@ -#ifndef __OPCODE_H__ -# define __OPCODE_H__ +#include -#include -#include -#include - -/* opcode - instruction data part. */ -struct opcode -{ - const char *name; - uint16_t mask; - uint16_t code; - uint16_t arg_mask[ARGUMENTS_MAX]; -}; - -// Define ALL SH3 instructions. -static const struct opcode opcode[] = { +// Define ALL SH3 / SH4 instructions. +const struct opcode_s opcode_list[] = { { .name = "add #h'%x,r%d", .mask = 0b1111000000000000, @@ -24,7 +10,8 @@ static const struct opcode opcode[] = { 0b0000000011111111, 0b0000111100000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "add r%d,r%d", @@ -34,7 +21,8 @@ static const struct opcode opcode[] = { 0b0000000011110000, 0b0000111100000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "addc r%d,r%d", @@ -44,7 +32,8 @@ static const struct opcode opcode[] = { 0b0000000011110000, 0b0000111100000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "addv r%d,r%d", @@ -54,7 +43,8 @@ static const struct opcode opcode[] = { 0b0000000011110000, 0b0000111100000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "and #h'%x,r0", @@ -64,7 +54,8 @@ static const struct opcode opcode[] = { 0b000000011111111, 0b0000000000000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "and r%d,r%d", @@ -74,7 +65,8 @@ static const struct opcode opcode[] = { 0b0000000011110000, 0b0000111100000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "and.b #h'%x,@(r0,GBR)", @@ -84,7 +76,8 @@ static const struct opcode opcode[] = { 0b0000000011111111, 0b0000000000000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "bf #h'%x", @@ -94,7 +87,8 @@ static const struct opcode opcode[] = { 0b000000011111111, 0b0000000000000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "bs/s #h'%x", @@ -104,7 +98,8 @@ static const struct opcode opcode[] = { 0b000000011111111, 0b0000000000000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "bra #h'%x", @@ -114,7 +109,8 @@ static const struct opcode opcode[] = { 0b0000111111111111, 0b0000000000000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "braf r%d", @@ -124,7 +120,8 @@ static const struct opcode opcode[] = { 0b000011110000000, 0b0000000000000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "bsr #h'%x", @@ -134,7 +131,8 @@ static const struct opcode opcode[] = { 0b0000111111111111, 0b0000000000000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "bsrf r%d", @@ -144,7 +142,8 @@ static const struct opcode opcode[] = { 0b0000111100000000, 0b0000000000000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "bt #h'%x", @@ -154,7 +153,8 @@ static const struct opcode opcode[] = { 0b0000000011111111, 0b0000000000000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "bt/s #h'%x", @@ -164,7 +164,8 @@ static const struct opcode opcode[] = { 0b0000000011111111, 0b0000000000000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "clrmac", @@ -174,7 +175,8 @@ static const struct opcode opcode[] = { 0b0000000000000000, 0b0000000000000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "clrs", @@ -184,7 +186,8 @@ static const struct opcode opcode[] = { 0b0000000000000000, 0b0000000000000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "clrt", @@ -194,7 +197,8 @@ static const struct opcode opcode[] = { 0b0000000000000000, 0b0000000000000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "cmp/eq #h'%x,r0", @@ -204,7 +208,8 @@ static const struct opcode opcode[] = { 0b0000000011111111, 0b0000000000000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "cmp/eq r%d,r%d", @@ -214,7 +219,8 @@ static const struct opcode opcode[] = { 0b0000000011110000, 0b0000111100000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "cmp/ge r%d,r%d", @@ -224,7 +230,8 @@ static const struct opcode opcode[] = { 0b0000000011110000, 0b0000111100000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "cmp/gt r%d,r%d", @@ -234,7 +241,8 @@ static const struct opcode opcode[] = { 0b0000000011110000, 0b0000111100000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "cmp/hi r%d,r%d", @@ -244,7 +252,8 @@ static const struct opcode opcode[] = { 0b0000000011110000, 0b0000111100000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "cmp/hs r%d,r%d", @@ -254,7 +263,8 @@ static const struct opcode opcode[] = { 0b0000000011110000, 0b0000111100000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "cmp/pl r%d", @@ -264,7 +274,8 @@ static const struct opcode opcode[] = { 0b0000111100000000, 0b0000000000000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "cmp/pz r%d", @@ -274,7 +285,8 @@ static const struct opcode opcode[] = { 0b0000111100000000, 0b0000000000000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "cmp/str r%d,r%d", @@ -284,7 +296,8 @@ static const struct opcode opcode[] = { 0b0000000011110000, 0b0000111100000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "div0s r%d,r%d", @@ -294,7 +307,8 @@ static const struct opcode opcode[] = { 0b0000000011110000, 0b0000111100000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "div0u", @@ -304,7 +318,8 @@ static const struct opcode opcode[] = { 0b0000000000000000, 0b0000000000000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "div1 r%d,r%d", @@ -314,7 +329,8 @@ static const struct opcode opcode[] = { 0b0000000011110000, 0b0000111100000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "dmuls.l r%d,r%d", @@ -324,7 +340,8 @@ static const struct opcode opcode[] = { 0b0000000011110000, 0b0000111100000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "dmulu.l r%d,r%d", @@ -334,7 +351,8 @@ static const struct opcode opcode[] = { 0b0000000011110000, 0b0000111100000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "dt r%d", @@ -344,7 +362,8 @@ static const struct opcode opcode[] = { 0b0000111100000000, 0b0000000000000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "exts.b r%d,r%d", @@ -354,7 +373,8 @@ static const struct opcode opcode[] = { 0b0000000011110000, 0b0000111100000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "exts.w r%d,r%d", @@ -364,7 +384,8 @@ static const struct opcode opcode[] = { 0b0000000011110000, 0b0000111100000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "extu.b r%d,r%d", @@ -374,7 +395,8 @@ static const struct opcode opcode[] = { 0b0000000011110000, 0b0000111100000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "extu.w r%d,r%d", @@ -384,7 +406,8 @@ static const struct opcode opcode[] = { 0b0000000011110000, 0b0000111100000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "fabs fr%d", @@ -394,7 +417,8 @@ static const struct opcode opcode[] = { 0b0000111100000000, 0b0000000000000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "fadd fr%d,fr%d", @@ -404,7 +428,8 @@ static const struct opcode opcode[] = { 0b0000000011110000, 0b0000111100000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "fcmp/eq fr%d,fr%d", @@ -414,7 +439,8 @@ static const struct opcode opcode[] = { 0b0000000011110000, 0b0000111100000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "fcmp/gt fr%d,fr%d", @@ -424,7 +450,8 @@ static const struct opcode opcode[] = { 0b0000000011110000, 0b0000111100000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "fdiv fr%d,fr%d", @@ -434,7 +461,8 @@ static const struct opcode opcode[] = { 0b0000000011110000, 0b0000111100000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "fldi0 fr%d", @@ -444,7 +472,8 @@ static const struct opcode opcode[] = { 0b0000111100000000, 0b0000000000000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "fldi1 fr%d", @@ -454,7 +483,8 @@ static const struct opcode opcode[] = { 0b0000111100000000, 0b0000000000000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "flds fr%d,FPUL", @@ -464,7 +494,8 @@ static const struct opcode opcode[] = { 0b0000111100000000, 0b0000000000000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "float FPUL,fr%d", @@ -474,7 +505,8 @@ static const struct opcode opcode[] = { 0b0000111100000000, 0b0000000000000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "fmac FR0,fr%d,fr%d", @@ -484,7 +516,8 @@ static const struct opcode opcode[] = { 0b0000000011110000, 0b0000111100000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "fmov fr%d,fr%d", @@ -494,7 +527,8 @@ static const struct opcode opcode[] = { 0b0000000011110000, 0b0000111100000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "fmov.s @(r0,r%d),fr%d", @@ -504,7 +538,8 @@ static const struct opcode opcode[] = { 0b0000000011110000, 0b0000111100000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "fmov.s @r%d+,fr%d", @@ -514,7 +549,8 @@ static const struct opcode opcode[] = { 0b0000000011110000, 0b0000111100000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "fmov.s @r%d,fr%d", @@ -524,7 +560,8 @@ static const struct opcode opcode[] = { 0b0000000011110000, 0b0000111100000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "fmov.s fr%d,@(r0,r%d)", @@ -534,7 +571,8 @@ static const struct opcode opcode[] = { 0b0000000011110000, 0b0000111100000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "fmov.s fr%d,@-r%d", @@ -544,7 +582,8 @@ static const struct opcode opcode[] = { 0b0000000011110000, 0b0000111100000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "fmov.s fr%d,@r%d", @@ -554,7 +593,8 @@ static const struct opcode opcode[] = { 0b0000000011110000, 0b0000111100000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "fmul fr%d,fr%d", @@ -564,7 +604,8 @@ static const struct opcode opcode[] = { 0b0000000011110000, 0b0000111100000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "fneg fr%d", @@ -574,7 +615,8 @@ static const struct opcode opcode[] = { 0b0000111100000000, 0b0000000000000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "fsqrt fr%d", @@ -584,7 +626,8 @@ static const struct opcode opcode[] = { 0b0000111100000000, 0b0000000000000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "fsts FPUL,fr%d", @@ -594,7 +637,8 @@ static const struct opcode opcode[] = { 0b0000111100000000, 0b0000000000000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "fsub fr%d,fr%d", @@ -604,7 +648,8 @@ static const struct opcode opcode[] = { 0b0000000011110000, 0b0000111100000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "ftrc fr%d,FPUL", @@ -614,7 +659,8 @@ static const struct opcode opcode[] = { 0b0000111100000000, 0b0000000000000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "jmp @r%d", @@ -624,7 +670,8 @@ static const struct opcode opcode[] = { 0b0000111100000000, 0b0000000000000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "jsr @r%d", @@ -634,7 +681,8 @@ static const struct opcode opcode[] = { 0b0000111100000000, 0b0000000000000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "ldc r%d,GBR", @@ -644,7 +692,8 @@ static const struct opcode opcode[] = { 0b0000111100000000, 0b0000000000000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "ldc r%d,SR", @@ -654,7 +703,8 @@ static const struct opcode opcode[] = { 0b0000111100000000, 0b0000000000000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "ldc r%d,VBR", @@ -664,7 +714,8 @@ static const struct opcode opcode[] = { 0b0000111100000000, 0b0000000000000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "ldc r%d,SSR", @@ -674,7 +725,8 @@ static const struct opcode opcode[] = { 0b0000111100000000, 0b0000000000000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "ldc r%d,SPC", @@ -684,7 +736,8 @@ static const struct opcode opcode[] = { 0b0000111100000000, 0b0000000000000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "ldc r%d,MOD", @@ -694,7 +747,8 @@ static const struct opcode opcode[] = { 0b0000111100000000, 0b0000000000000000, 0b0000000000000000 - } + }, + .special = NULL }, //FIXME: find difference between "ldc rm,RE" and "ldc rm,RS" { @@ -705,7 +759,8 @@ static const struct opcode opcode[] = { 0b0000111100000000, 0b0000000000000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "ldc r%d,R0_BANK", @@ -715,7 +770,8 @@ static const struct opcode opcode[] = { 0b0000111100000000, 0b0000000000000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "ldc r%d,R1_BANK", @@ -725,7 +781,8 @@ static const struct opcode opcode[] = { 0b0000111100000000, 0b0000000000000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "ldc r%d,R2_BANK", @@ -735,7 +792,8 @@ static const struct opcode opcode[] = { 0b0000111100000000, 0b0000000000000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "ldc r%d,R3_BANK", @@ -745,7 +803,8 @@ static const struct opcode opcode[] = { 0b0000111100000000, 0b0000000000000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "ldc r%d,R4_BANK", @@ -755,7 +814,8 @@ static const struct opcode opcode[] = { 0b0000111100000000, 0b0000000000000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "ldc r%d,R5_BANK", @@ -765,7 +825,8 @@ static const struct opcode opcode[] = { 0b0000111100000000, 0b0000000000000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "ldc r%d,R6_BANK", @@ -775,7 +836,8 @@ static const struct opcode opcode[] = { 0b0000111100000000, 0b0000000000000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "ldc r%d,R7_BANK", @@ -785,7 +847,8 @@ static const struct opcode opcode[] = { 0b0000111100000000, 0b0000000000000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "ldc.l @r%d+,GBR", @@ -795,7 +858,8 @@ static const struct opcode opcode[] = { 0b0000111100000000, 0b0000000000000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "ldc.l @r%d+,SR", @@ -805,7 +869,8 @@ static const struct opcode opcode[] = { 0b0000111100000000, 0b0000000000000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "ldc.l @r%d+,VBR", @@ -815,7 +880,8 @@ static const struct opcode opcode[] = { 0b0000111100000000, 0b0000000000000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "ldc.l @r%d+,SSR", @@ -825,7 +891,8 @@ static const struct opcode opcode[] = { 0b0000111100000000, 0b0000000000000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "ldc.l @r%d+,SPC", @@ -835,7 +902,8 @@ static const struct opcode opcode[] = { 0b0000111100000000, 0b0000000000000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "ldc.l @r%d+,MOD", @@ -845,7 +913,8 @@ static const struct opcode opcode[] = { 0b0000111100000000, 0b0000000000000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "ldc.l @r%d+,RE", @@ -855,7 +924,8 @@ static const struct opcode opcode[] = { 0b0000111100000000, 0b0000000000000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "ldc.l @r%d+,RS", @@ -865,7 +935,8 @@ static const struct opcode opcode[] = { 0b0000111100000000, 0b0000000000000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "ldc.l @r%d+,R0_BANK", @@ -875,7 +946,8 @@ static const struct opcode opcode[] = { 0b0000111100000000, 0b0000000000000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "ldc.l @r%d+,R1_BANK", @@ -885,7 +957,8 @@ static const struct opcode opcode[] = { 0b0000111100000000, 0b0000000000000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "ldc.l @r%d+,R2_BANK", @@ -895,7 +968,8 @@ static const struct opcode opcode[] = { 0b0000111100000000, 0b0000000000000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "ldc.l @%d+,R3_BANK", @@ -905,7 +979,8 @@ static const struct opcode opcode[] = { 0b0000111100000000, 0b0000000000000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "ldc.l @r%d+,R4_BANK", @@ -915,7 +990,8 @@ static const struct opcode opcode[] = { 0b0000111100000000, 0b0000000000000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "ldc.l @r%d+,R5_BANK", @@ -925,7 +1001,8 @@ static const struct opcode opcode[] = { 0b0000111100000000, 0b0000000000000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "ldc.l @r%d+,R7_BANK", @@ -935,7 +1012,8 @@ static const struct opcode opcode[] = { 0b0000111100000000, 0b0000000000000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "ldc.l @r%d+,R7_BANK", @@ -945,7 +1023,8 @@ static const struct opcode opcode[] = { 0b0000111100000000, 0b0000000000000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "ldre @(#h'%x,PC)", @@ -955,7 +1034,8 @@ static const struct opcode opcode[] = { 0b0000000011111111, 0b0000000000000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "ldrs @(#h'%x,PC)", @@ -965,7 +1045,8 @@ static const struct opcode opcode[] = { 0b0000000011111111, 0b0000000000000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "lds r%d,FPSCR", @@ -975,7 +1056,8 @@ static const struct opcode opcode[] = { 0b0000111100000000, 0b0000000000000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "lds r%d,FPUL", @@ -985,7 +1067,8 @@ static const struct opcode opcode[] = { 0b0000111100000000, 0b0000000000000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "lds r%d,MACH", @@ -995,7 +1078,8 @@ static const struct opcode opcode[] = { 0b0000111100000000, 0b0000000000000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "lds r%d,MACL", @@ -1005,7 +1089,8 @@ static const struct opcode opcode[] = { 0b0000111100000000, 0b0000000000000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "lds r%d,PR", @@ -1015,7 +1100,8 @@ static const struct opcode opcode[] = { 0b0000111100000000, 0b0000000000000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "lds r%d,A0", @@ -1025,7 +1111,8 @@ static const struct opcode opcode[] = { 0b0000111100000000, 0b0000000000000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "lds r%d,DSR", @@ -1035,7 +1122,8 @@ static const struct opcode opcode[] = { 0b0000111100000000, 0b0000000000000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "lds r%d,X0", @@ -1045,7 +1133,8 @@ static const struct opcode opcode[] = { 0b0000111100000000, 0b0000000000000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "lds r%d,X1", @@ -1055,7 +1144,8 @@ static const struct opcode opcode[] = { 0b0000111100000000, 0b0000000000000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "lds r%d,Y0", @@ -1065,7 +1155,8 @@ static const struct opcode opcode[] = { 0b0000111100000000, 0b0000000000000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "lds r%d,Y1", @@ -1075,7 +1166,8 @@ static const struct opcode opcode[] = { 0b0000111100000000, 0b0000000000000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "lds.l @r%d+,FPSCR", @@ -1085,7 +1177,8 @@ static const struct opcode opcode[] = { 0b0000111100000000, 0b0000000000000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "lds.l @r%d+,FPUL", @@ -1095,7 +1188,8 @@ static const struct opcode opcode[] = { 0b0000111100000000, 0b0000000000000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "lds.l @r%d+,MACH", @@ -1105,7 +1199,8 @@ static const struct opcode opcode[] = { 0b0000111100000000, 0b0000000000000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "lds.l @r%d+,MACL", @@ -1115,7 +1210,8 @@ static const struct opcode opcode[] = { 0b0000111100000000, 0b0000000000000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "lds.l @r%d+,PR", @@ -1125,7 +1221,8 @@ static const struct opcode opcode[] = { 0b0000111100000000, 0b0000000000000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "lds.l @r%d+,DSR", @@ -1135,7 +1232,8 @@ static const struct opcode opcode[] = { 0b0000111100000000, 0b0000000000000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "lds.l @r%d+,A0", @@ -1145,7 +1243,8 @@ static const struct opcode opcode[] = { 0b0000111100000000, 0b0000000000000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "lds.l @r%d+,X0", @@ -1155,7 +1254,8 @@ static const struct opcode opcode[] = { 0b0000111100000000, 0b0000000000000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "lds.l @r%d+,X1", @@ -1165,7 +1265,8 @@ static const struct opcode opcode[] = { 0b0000111100000000, 0b0000000000000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "lds.l @r%d+,Y0", @@ -1175,7 +1276,8 @@ static const struct opcode opcode[] = { 0b0000111100000000, 0b0000000000000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "lds.l @r%d+,Y1", @@ -1185,7 +1287,8 @@ static const struct opcode opcode[] = { 0b0000111100000000, 0b0000000000000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "ldtlb", @@ -1195,7 +1298,8 @@ static const struct opcode opcode[] = { 0b0000000000000000, 0b0000000000000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "mac.l @r%d+,@r%d+", @@ -1205,7 +1309,8 @@ static const struct opcode opcode[] = { 0b0000000011110000, 0b0000111100000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "mac.w @r%d+,@r%d+", @@ -1215,7 +1320,8 @@ static const struct opcode opcode[] = { 0b0000000011110000, 0b0000111100000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "mov #h'%x,r%d", @@ -1225,7 +1331,8 @@ static const struct opcode opcode[] = { 0b0000000011111111, 0b0000111100000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "mov r%d,r%d", @@ -1235,7 +1342,8 @@ static const struct opcode opcode[] = { 0b0000000011110000, 0b0000111100000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "mov.b @(#h'%x,GBR),r0", @@ -1245,7 +1353,8 @@ static const struct opcode opcode[] = { 0b0000000011111111, 0b0000000000000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "mov.b @(#h'%x,r%d),r0", @@ -1255,7 +1364,8 @@ static const struct opcode opcode[] = { 0b0000000000001111, 0b0000000011110000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "mov.b @(r0,r%d),r%d", @@ -1265,7 +1375,8 @@ static const struct opcode opcode[] = { 0b0000000011110000, 0b0000111100000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "mov.b @r%d+,r%d", @@ -1275,7 +1386,8 @@ static const struct opcode opcode[] = { 0b0000000011110000, 0b0000111100000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "mov.b @r%d,r%d", @@ -1285,7 +1397,8 @@ static const struct opcode opcode[] = { 0b0000000011110000, 0b0000111100000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "mov.b r0,@(#h'%x,GBR)", @@ -1295,7 +1408,8 @@ static const struct opcode opcode[] = { 0b0000000011111111, 0b0000000000000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "mov.b r0,@(#h'%x,r%d)", @@ -1305,7 +1419,8 @@ static const struct opcode opcode[] = { 0b0000000000001111, 0b0000000011110000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "mov.b r%d,@(r0,r%d)", @@ -1315,7 +1430,8 @@ static const struct opcode opcode[] = { 0b0000000011110000, 0b0000111100000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "mov.b r%d,@-r%d", @@ -1325,7 +1441,8 @@ static const struct opcode opcode[] = { 0b0000000011110000, 0b0000111100000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "mov.b r%d,@r%d", @@ -1335,7 +1452,8 @@ static const struct opcode opcode[] = { 0b0000000011110000, 0b0000111100000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "mov.l @(#h'%x,GBR),r0", @@ -1345,7 +1463,8 @@ static const struct opcode opcode[] = { 0b0000000011111111, 0b0000000000000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "mov.l @(#h'%x,PC),r%d", @@ -1355,7 +1474,8 @@ static const struct opcode opcode[] = { 0b0000000011111111, 0b0000111100000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "mov.l @(#h'%x,r%d),r%d", @@ -1365,7 +1485,8 @@ static const struct opcode opcode[] = { 0b0000000000001111, 0b0000000011110000, 0b0000111100000000 - } + }, + .special = NULL }, { .name = "mov.l @(r0,r%d),r%d", @@ -1375,7 +1496,8 @@ static const struct opcode opcode[] = { 0b0000000011110000, 0b0000111100000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "mov.l @r%d+,r%d", @@ -1385,7 +1507,8 @@ static const struct opcode opcode[] = { 0b0000000011110000, 0b0000111100000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "mov.l @r%d,r%d", @@ -1395,7 +1518,8 @@ static const struct opcode opcode[] = { 0b0000000011110000, 0b0000111100000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "mov.l r0,@(#h'%x,GBR)", @@ -1405,7 +1529,8 @@ static const struct opcode opcode[] = { 0b0000000011111111, 0b0000000000000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "mov.l r%d,@(#h'%x,r%d)", @@ -1415,7 +1540,8 @@ static const struct opcode opcode[] = { 0b0000000000001111, 0b0000000011110000, 0b0000111100000000 - } + }, + .special = NULL }, { .name = "mov.l r%d,@(r0,r%d)", @@ -1425,7 +1551,8 @@ static const struct opcode opcode[] = { 0b0000000011110000, 0b0000111100000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "mov.l r%d,@-r%d", @@ -1435,7 +1562,8 @@ static const struct opcode opcode[] = { 0b0000000011110000, 0b0000111100000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "mov.l r%d,@r%d", @@ -1445,7 +1573,8 @@ static const struct opcode opcode[] = { 0b0000000011110000, 0b0000111100000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "mov.w @(#h'%x,GBR),r0", @@ -1455,7 +1584,8 @@ static const struct opcode opcode[] = { 0b0000000011111111, 0b0000000000000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "mov.w @(#h'%x,PC),r%d", @@ -1465,7 +1595,8 @@ static const struct opcode opcode[] = { 0b0000000011111111, 0b0000111100000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "mov.w @(r0,r%d),r%d", @@ -1475,7 +1606,8 @@ static const struct opcode opcode[] = { 0b0000000011110000, 0b0000111100000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "mov.w @r%d+,r%d", @@ -1485,7 +1617,8 @@ static const struct opcode opcode[] = { 0b0000000011110000, 0b0000111100000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "mov.w @r%d,r%d", @@ -1495,7 +1628,8 @@ static const struct opcode opcode[] = { 0b0000000011110000, 0b0000111100000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "mov.w r0,@(#h'%x,GBR)", @@ -1505,7 +1639,8 @@ static const struct opcode opcode[] = { 0b0000000011111111, 0b0000000000000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "mov.w r0,@(#h'%x,,r%d)", @@ -1515,7 +1650,8 @@ static const struct opcode opcode[] = { 0b0000000000001111, 0b0000000011110000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "mov.w r%d,@(r0,r%d)", @@ -1525,7 +1661,8 @@ static const struct opcode opcode[] = { 0b0000000011110000, 0b0000111100000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "mov.w r%d,@-r%d", @@ -1535,7 +1672,8 @@ static const struct opcode opcode[] = { 0b0000000011110000, 0b0000111100000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "mov.w r%d,@r%d", @@ -1545,7 +1683,8 @@ static const struct opcode opcode[] = { 0b0000000011110000, 0b0000111100000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "mova @(#h'%x,PC),r0", @@ -1555,7 +1694,8 @@ static const struct opcode opcode[] = { 0b0000000011111111, 0b0000000000000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "movt r%d", @@ -1565,7 +1705,8 @@ static const struct opcode opcode[] = { 0b0000111100000000, 0b0000000000000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "mul.l r%d,r%d", @@ -1575,7 +1716,8 @@ static const struct opcode opcode[] = { 0b0000000011110000, 0b0000111100000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "muls.w r%d,r%d", @@ -1585,7 +1727,8 @@ static const struct opcode opcode[] = { 0b0000000011110000, 0b0000111100000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "mulu.w r%d,r%d", @@ -1595,7 +1738,8 @@ static const struct opcode opcode[] = { 0b0000000011110000, 0b0000111100000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "neg r%d,@-r%d", @@ -1605,7 +1749,8 @@ static const struct opcode opcode[] = { 0b0000000011110000, 0b0000111100000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "negc r%d,r%d", @@ -1615,7 +1760,8 @@ static const struct opcode opcode[] = { 0b0000000011110000, 0b0000111100000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "nop", @@ -1625,7 +1771,8 @@ static const struct opcode opcode[] = { 0b0000000000000000, 0b0000000000000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "not r%d,r%d", @@ -1635,7 +1782,8 @@ static const struct opcode opcode[] = { 0b0000000011110000, 0b0000111100000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "or #h'%x,r0", @@ -1645,7 +1793,8 @@ static const struct opcode opcode[] = { 0b0000000011111111, 0b0000000000000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "or r%d,r%d", @@ -1655,7 +1804,8 @@ static const struct opcode opcode[] = { 0b0000000011110000, 0b0000111100000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "or.b #h'%x,@(r0,GBR)", @@ -1665,7 +1815,8 @@ static const struct opcode opcode[] = { 0b0000000011111111, 0b0000000000000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "pref @r%d", @@ -1675,7 +1826,8 @@ static const struct opcode opcode[] = { 0b0000111100000000, 0b0000000000000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "rotcl r%d", @@ -1685,7 +1837,8 @@ static const struct opcode opcode[] = { 0b0000111100000000, 0b0000000000000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "rotcr r%d", @@ -1695,7 +1848,8 @@ static const struct opcode opcode[] = { 0b0000111100000000, 0b0000000000000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "rotl r%d", @@ -1705,7 +1859,8 @@ static const struct opcode opcode[] = { 0b0000111100000000, 0b0000000000000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "rotr r%d", @@ -1715,7 +1870,8 @@ static const struct opcode opcode[] = { 0b0000111100000000, 0b0000000000000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "rte", @@ -1725,7 +1881,8 @@ static const struct opcode opcode[] = { 0b0000000000000000, 0b0000000000000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "rts", @@ -1735,7 +1892,8 @@ static const struct opcode opcode[] = { 0b0000000000000000, 0b0000000000000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "setrc r%d", @@ -1745,7 +1903,8 @@ static const struct opcode opcode[] = { 0b0000111100000000, 0b0000000000000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "setrc #h'%x", @@ -1755,7 +1914,8 @@ static const struct opcode opcode[] = { 0b0000000011111111, 0b0000000000000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "sets", @@ -1765,7 +1925,8 @@ static const struct opcode opcode[] = { 0b0000000000000000, 0b0000000000000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "sett", @@ -1775,7 +1936,8 @@ static const struct opcode opcode[] = { 0b0000000000000000, 0b0000000000000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "shad r%d,r%d", @@ -1785,7 +1947,8 @@ static const struct opcode opcode[] = { 0b0000000011110000, 0b0000111100000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "shal r%d", @@ -1795,7 +1958,8 @@ static const struct opcode opcode[] = { 0b0000111100000000, 0b0000000000000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "shar r%d", @@ -1805,7 +1969,8 @@ static const struct opcode opcode[] = { 0b0000111100000000, 0b0000000000000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "shld r%d,r%d", @@ -1815,7 +1980,8 @@ static const struct opcode opcode[] = { 0b0000000011110000, 0b0000111100000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "shll r%d", @@ -1825,7 +1991,8 @@ static const struct opcode opcode[] = { 0b0000111100000000, 0b0000000000000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "shll2 r%d", @@ -1835,7 +2002,8 @@ static const struct opcode opcode[] = { 0b0000111100000000, 0b0000000000000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "shll8 r%d", @@ -1845,7 +2013,8 @@ static const struct opcode opcode[] = { 0b0000111100000000, 0b0000000000000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "shll16 r%d", @@ -1855,7 +2024,8 @@ static const struct opcode opcode[] = { 0b0000111100000000, 0b0000000000000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "shlr r%d", @@ -1865,7 +2035,8 @@ static const struct opcode opcode[] = { 0b0000111100000000, 0b0000000000000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "shlr2 r%d", @@ -1875,7 +2046,8 @@ static const struct opcode opcode[] = { 0b0000111100000000, 0b0000000000000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "shlr8 r%d", @@ -1885,7 +2057,8 @@ static const struct opcode opcode[] = { 0b0000111100000000, 0b0000000000000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "shlr16 r%d", @@ -1895,7 +2068,8 @@ static const struct opcode opcode[] = { 0b0000111100000000, 0b0000000000000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "sleep", @@ -1905,7 +2079,8 @@ static const struct opcode opcode[] = { 0b0000000000000000, 0b0000000000000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "stc GBR,r%d", @@ -1915,7 +2090,8 @@ static const struct opcode opcode[] = { 0b0000111100000000, 0b0000000000000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "stc SR,r%d", @@ -1925,7 +2101,8 @@ static const struct opcode opcode[] = { 0b0000111100000000, 0b0000000000000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "stc VBR,r%d", @@ -1935,7 +2112,8 @@ static const struct opcode opcode[] = { 0b0000111100000000, 0b0000000000000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "stc SSR,r%d", @@ -1945,7 +2123,8 @@ static const struct opcode opcode[] = { 0b0000111100000000, 0b0000000000000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "stc SPC,r%d", @@ -1955,7 +2134,8 @@ static const struct opcode opcode[] = { 0b0000111100000000, 0b0000000000000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "stc MOD,r%d", @@ -1965,7 +2145,8 @@ static const struct opcode opcode[] = { 0b0000111100000000, 0b0000000000000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "stc RE,r%d", @@ -1975,7 +2156,8 @@ static const struct opcode opcode[] = { 0b0000111100000000, 0b0000000000000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "stc RS,r%d", @@ -1985,7 +2167,8 @@ static const struct opcode opcode[] = { 0b0000111100000000, 0b0000000000000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "stc R0_BANK,r%d", @@ -1995,7 +2178,8 @@ static const struct opcode opcode[] = { 0b0000111100000000, 0b0000000000000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "stc R1_BANK,r%d", @@ -2005,7 +2189,8 @@ static const struct opcode opcode[] = { 0b0000111100000000, 0b0000000000000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "stc R2_BANK,r%d", @@ -2015,7 +2200,8 @@ static const struct opcode opcode[] = { 0b0000111100000000, 0b0000000000000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "stc R3_BANK,r%d", @@ -2025,7 +2211,8 @@ static const struct opcode opcode[] = { 0b0000111100000000, 0b0000000000000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "stc R4_BANK,r%d", @@ -2035,7 +2222,8 @@ static const struct opcode opcode[] = { 0b0000111100000000, 0b0000000000000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "stc R5_BANK,r%d", @@ -2045,7 +2233,8 @@ static const struct opcode opcode[] = { 0b0000111100000000, 0b0000000000000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "stc R6_BANK,r%d", @@ -2055,7 +2244,8 @@ static const struct opcode opcode[] = { 0b0000111100000000, 0b0000000000000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "stc R7_BANK,r%d", @@ -2065,7 +2255,8 @@ static const struct opcode opcode[] = { 0b0000111100000000, 0b0000000000000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "stc.l GBR,@r-%d", @@ -2075,7 +2266,8 @@ static const struct opcode opcode[] = { 0b0000111100000000, 0b0000000000000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "stc.l SR,@r-%d", @@ -2085,7 +2277,8 @@ static const struct opcode opcode[] = { 0b0000111100000000, 0b0000000000000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "stc.l VBR,@r-%d", @@ -2095,7 +2288,8 @@ static const struct opcode opcode[] = { 0b0000111100000000, 0b0000000000000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "stc.l SSR,@r-%d", @@ -2105,7 +2299,8 @@ static const struct opcode opcode[] = { 0b0000111100000000, 0b0000000000000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "stc.l SPC,@r-%d", @@ -2115,7 +2310,8 @@ static const struct opcode opcode[] = { 0b0000111100000000, 0b0000000000000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "stc.l MOD,@r-%d", @@ -2125,7 +2321,8 @@ static const struct opcode opcode[] = { 0b0000111100000000, 0b0000000000000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "stc.l RE,@r-%d", @@ -2135,7 +2332,8 @@ static const struct opcode opcode[] = { 0b0000111100000000, 0b0000000000000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "stc.l RS,@r-%d", @@ -2145,7 +2343,8 @@ static const struct opcode opcode[] = { 0b0000111100000000, 0b0000000000000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "stc.l R0_BANK,@r-%d", @@ -2155,7 +2354,8 @@ static const struct opcode opcode[] = { 0b0000111100000000, 0b0000000000000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "stc.l R1_BANK,@r-%d", @@ -2165,7 +2365,8 @@ static const struct opcode opcode[] = { 0b0000111100000000, 0b0000000000000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "stc.l R2_BANK,@r-%d", @@ -2175,7 +2376,8 @@ static const struct opcode opcode[] = { 0b0000111100000000, 0b0000000000000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "stc.l R3_BANK,@r-%d", @@ -2185,7 +2387,8 @@ static const struct opcode opcode[] = { 0b0000111100000000, 0b0000000000000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "stc.l R4_BANK,@r-%d", @@ -2195,7 +2398,8 @@ static const struct opcode opcode[] = { 0b0000111100000000, 0b0000000000000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "stc.l R5_BANK,@r-%d", @@ -2205,7 +2409,8 @@ static const struct opcode opcode[] = { 0b0000111100000000, 0b0000000000000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "stc.l R6_BANK,@r-%d", @@ -2215,7 +2420,8 @@ static const struct opcode opcode[] = { 0b0000111100000000, 0b0000000000000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "stc.l R7_BANK,@r-%d", @@ -2225,7 +2431,8 @@ static const struct opcode opcode[] = { 0b0000111100000000, 0b0000000000000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "sts FPSCR,r%d", @@ -2235,7 +2442,8 @@ static const struct opcode opcode[] = { 0b0000111100000000, 0b0000000000000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "sts FPUL,r%d", @@ -2245,7 +2453,8 @@ static const struct opcode opcode[] = { 0b0000111100000000, 0b0000000000000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "sts MACH,r%d", @@ -2255,7 +2464,8 @@ static const struct opcode opcode[] = { 0b0000111100000000, 0b0000000000000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "sts MACL,r%d", @@ -2265,7 +2475,8 @@ static const struct opcode opcode[] = { 0b0000111100000000, 0b0000000000000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "sts PR,r%d", @@ -2275,7 +2486,8 @@ static const struct opcode opcode[] = { 0b0000111100000000, 0b0000000000000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "sts DSR,r%d", @@ -2285,7 +2497,8 @@ static const struct opcode opcode[] = { 0b0000111100000000, 0b0000000000000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "sts A0,r%d", @@ -2295,7 +2508,8 @@ static const struct opcode opcode[] = { 0b0000111100000000, 0b0000000000000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "sts X0,r%d", @@ -2305,7 +2519,8 @@ static const struct opcode opcode[] = { 0b0000111100000000, 0b0000000000000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "sts X1,r%d", @@ -2315,7 +2530,8 @@ static const struct opcode opcode[] = { 0b0000111100000000, 0b0000000000000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "sts Y0,r%d", @@ -2325,7 +2541,8 @@ static const struct opcode opcode[] = { 0b0000111100000000, 0b0000000000000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "sts Y1,r%d", @@ -2335,7 +2552,8 @@ static const struct opcode opcode[] = { 0b0000111100000000, 0b0000000000000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "sts.l FPSCR,@-r%d", @@ -2345,7 +2563,8 @@ static const struct opcode opcode[] = { 0b0000111100000000, 0b0000000000000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "sts.l FPUL,@-r%d", @@ -2355,7 +2574,8 @@ static const struct opcode opcode[] = { 0b0000111100000000, 0b0000000000000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "sts.l MACH,@-r%d", @@ -2365,7 +2585,8 @@ static const struct opcode opcode[] = { 0b0000111100000000, 0b0000000000000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "sts.l MACL,@-r%d", @@ -2375,7 +2596,8 @@ static const struct opcode opcode[] = { 0b0000111100000000, 0b0000000000000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "sts.l PR,@-r%d", @@ -2385,7 +2607,8 @@ static const struct opcode opcode[] = { 0b0000111100000000, 0b0000000000000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "sts.l DSR,@-r%d", @@ -2395,7 +2618,8 @@ static const struct opcode opcode[] = { 0b0000111100000000, 0b0000000000000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "sts.l A0,@-r%d", @@ -2405,7 +2629,8 @@ static const struct opcode opcode[] = { 0b0000111100000000, 0b0000000000000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "sts.l X0,@-r%d", @@ -2415,7 +2640,8 @@ static const struct opcode opcode[] = { 0b0000111100000000, 0b0000000000000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "sts.l X1,@-r%d", @@ -2425,7 +2651,8 @@ static const struct opcode opcode[] = { 0b0000111100000000, 0b0000000000000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "sts.l Y0,@-r%d", @@ -2435,7 +2662,8 @@ static const struct opcode opcode[] = { 0b0000111100000000, 0b0000000000000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "sts.l Y1,@-r%d", @@ -2445,7 +2673,8 @@ static const struct opcode opcode[] = { 0b0000111100000000, 0b0000000000000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "sub r%d,r%d", @@ -2455,7 +2684,8 @@ static const struct opcode opcode[] = { 0b0000000011110000, 0b0000111100000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "subc r%d,r%d", @@ -2465,7 +2695,8 @@ static const struct opcode opcode[] = { 0b0000000011110000, 0b0000111100000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "subv r%d,r%d", @@ -2475,7 +2706,8 @@ static const struct opcode opcode[] = { 0b0000000011110000, 0b0000111100000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "swap.b r%d,r%d", @@ -2485,7 +2717,8 @@ static const struct opcode opcode[] = { 0b0000000011110000, 0b0000111100000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "swap.w r%d,r%d", @@ -2495,7 +2728,8 @@ static const struct opcode opcode[] = { 0b0000000011110000, 0b0000111100000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "tas.b @r%d", @@ -2505,7 +2739,8 @@ static const struct opcode opcode[] = { 0b0000111100000000, 0b0000000000000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "trapa #h'%x", @@ -2515,7 +2750,8 @@ static const struct opcode opcode[] = { 0b0000000011111111, 0b0000000000000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "tst #h'%x,r0", @@ -2525,7 +2761,8 @@ static const struct opcode opcode[] = { 0b0000000011111111, 0b0000000000000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "tst r%d,r%d", @@ -2535,7 +2772,8 @@ static const struct opcode opcode[] = { 0b0000000011110000, 0b0000111100000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "tst.b #h'%x,@(r0,GBR)", @@ -2545,7 +2783,8 @@ static const struct opcode opcode[] = { 0b0000000011111111, 0b0000000000000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "xor #h'%x,r0", @@ -2555,7 +2794,8 @@ static const struct opcode opcode[] = { 0b0000000011111111, 0b0000000000000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "xor r%d,r%d", @@ -2565,7 +2805,8 @@ static const struct opcode opcode[] = { 0b0000000011110000, 0b0000111100000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "wor.b #h'%x,@(r0,GBR)", @@ -2575,7 +2816,8 @@ static const struct opcode opcode[] = { 0b0000000011111111, 0b0000000000000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = "xtrct r%d,r%d", @@ -2585,7 +2827,8 @@ static const struct opcode opcode[] = { 0b0000000011110000, 0b0000111100000000, 0b0000000000000000 - } + }, + .special = NULL }, { .name = NULL, @@ -2595,9 +2838,10 @@ static const struct opcode opcode[] = { 0b0000000000000000, 0b0000000000000000, 0b0000000000000000 - } + }, + .special = NULL }, }; -#endif /*__OPCODE_H__*/ + diff --git a/src/kernel/hardware/t6k11/display.s b/src/kernel/hardware/t6k11/display.s deleted file mode 100644 index d47a28b..0000000 --- a/src/kernel/hardware/t6k11/display.s +++ /dev/null @@ -1,55 +0,0 @@ -.global _t6k11_display -.type _t6k11_display, @function - -.text -.align 2 -/* - _t6k11_display(void *vram) - This function will display the vram on the screen. - This is the T6K11 drivers, DO NOT USE this function if you are - not absolutly sure that what you are doing. - - TODO: use DMA ? -*/ -# register organisation: -# r0 Y axis loop. -# r1 LCD register selector. -# r2 LCD data register. -# r3 X axis loop. -# r4 VRAM address. -_t6k11_display: - mov.l r8, @-r15 - mov.l r9, @-r15 - mov.l 1f, r1 - mov.l 2f, r2 - mov #4, r6 - mov #0, r7 - mov #7, r8 - mov #192, r5 - mov #64, r0 - loop_y: - - mov.b r6, @r1 - mov.b r5, @r2 - mov.b r6, @r1 - mov.b r7, @r2 - mov.b r8, @r1 - mov #16, r3 - loop_x: - - mov.b @r4+, r9 - mov.b r9, @r2 - - dt r3 - bf loop_x - - dt r0 - bf.s loop_y - add #1, r5 - mov.l @r15+, r9 - rts - mov.l @r15+, r8 - -.align 4 -1: .long 0xb4000000 /* LCD register selector */ -2: .long 0xb4010000 /* LCD data register */ diff --git a/src/kernel/vbr/exception.c b/src/kernel/vbr/exception.c deleted file mode 100644 index 799a9dc..0000000 --- a/src/kernel/vbr/exception.c +++ /dev/null @@ -1,38 +0,0 @@ -/*#include - -__attribute__((section(".vhex.exception"), interrupt_handler)) -void exception_handler(void) -{ - uint32_t spc; - uint32_t ssr; - uint32_t sr; - - - // Get some registers's data. - __asm__ volatile ( - "stc spc, %0;" - "stc ssr, %1;" - "stc sr, %2" - : "=r"(spc), "=r"(ssr), "=r"(sr) - : - : - ); - - // Write exception informations. - dclear(); - dprint(0, 0, - "Ho crap ! Exception !\n" - "tra: %#x\n" - "expevt: %#x\n" - "spc: %#x\n" - "ssr: %#x\n" - "sr: %#x", - *((uint32_t *)0xff000020), - *((uint32_t *)0xff000024), - spc, - ssr, - sr - ); - dupdate(); - while (1); -}*/ diff --git a/src/kernel/vbr/interrupt.c b/src/kernel/vbr/interrupt.c deleted file mode 100644 index c343829..0000000 --- a/src/kernel/vbr/interrupt.c +++ /dev/null @@ -1,10 +0,0 @@ -/*#include - -__attribute__((section(".vhex.interrupt"), interrupt_handler)) -void interrupt_handler(void) -{ - dclear(); - dprint(0, 0, "Interrupt handler (%#x)\n", *(uint32_t*)0xff000028); - dupdate(); - while (1); -}*/ diff --git a/src/kernel/vbr/tlb.c b/src/kernel/vbr/tlb.c deleted file mode 100644 index 8efe5de..0000000 --- a/src/kernel/vbr/tlb.c +++ /dev/null @@ -1,38 +0,0 @@ -/*#include - -__attribute__((section(".glados.tlb"), interrupt_handler)) -void tlb_handler(void) -{ - uint32_t spc; - uint32_t ssr; - uint32_t sr; - - - // Get some registers's data. - __asm__ volatile ( - "stc spc, %0;" - "stc ssr, %1;" - "stc sr, %2" - : "=r"(spc), "=r"(ssr), "=r"(sr) - : - : - ); - - // Write exception informations. - dclear(); - dprint(0, 0, - "Ho crap ! Exception !\n" - "tra: %#x\n" - "expevt: %#x\n" - "spc: %#x\n" - "ssr: %#x\n" - "sr: %#x", - *((uint32_t *)0xff000020), - *((uint32_t *)0xff000024), - spc, - ssr, - sr - ); - dupdate(); - while (1); -}*/ diff --git a/src/lib/display/dprint.c b/src/lib/display/dprint.c index b790ca5..f6e4af8 100644 --- a/src/lib/display/dprint.c +++ b/src/lib/display/dprint.c @@ -16,6 +16,8 @@ void dprint(int x, int y, char const *str, ...) va_end(ap); i = -1; + x = x * (KERNEL_FONT_REAL_WIDTH + 1); + y = y * (KERNEL_FONT_REAL_HEIGHT + 1); default_pos_x = x; while (buffer[++i] != '\0') { diff --git a/src/lib/display/dupdate.c b/src/lib/display/dupdate.c index 89e4d8a..653bf54 100644 --- a/src/lib/display/dupdate.c +++ b/src/lib/display/dupdate.c @@ -1,8 +1,7 @@ #include -#include +#include -//FIXME: Check OS 3.00 ! void dupdate(void) { - t6k11_display(vram); + casio_Bdisp_PutDisp_DD(); } diff --git a/vhex.g1a b/vhex.g1a index 177556d..ab91e8e 100644 Binary files a/vhex.g1a and b/vhex.g1a differ