Skip to content

Commit

Permalink
revert experimental disassembler stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
floooh committed Nov 24, 2023
1 parent 4527fe2 commit a26431c
Show file tree
Hide file tree
Showing 4 changed files with 116 additions and 261 deletions.
10 changes: 5 additions & 5 deletions ui/ui_dasm.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
~~~C
#define CHIPS_UI_IMPL
~~~
before you include this file in *one* C++ file to create the
before you include this file in *one* C++ file to create the
implementation.
Select the supported CPUs with the following macros (at least
Expand All @@ -18,7 +18,7 @@
UI_DASM_USE_M6502
Optionally provide the following macros with your own implementation
~~~C
CHIPS_ASSERT(c)
~~~
Expand Down Expand Up @@ -51,7 +51,7 @@
2. Altered source versions must be plainly marked as such, and must not
be misrepresented as being the original software.
3. This notice may not be removed or altered from any source
distribution.
distribution.
#*/
#include <stdint.h>
#include <stdbool.h>
Expand Down Expand Up @@ -202,7 +202,7 @@ static void _ui_dasm_disasm(ui_dasm_t* win) {
m6502dasm_op(win->cur_addr, _ui_dasm_in_cb, _ui_dasm_out_cb, win);
}
#elif defined(UI_DASM_USE_Z80)
z80dasm_op(win->cur_addr, _ui_dasm_in_cb, win, _ui_dasm_out_cb, win);
z80dasm_op(win->cur_addr, _ui_dasm_in_cb, _ui_dasm_out_cb, win);
#else
m6502dasm_op(win->cur_addr, _ui_dasm_in_cb, _ui_dasm_out_cb, win);
#endif
Expand Down Expand Up @@ -275,7 +275,7 @@ static bool _ui_dasm_jumptarget(ui_dasm_t* win, uint16_t pc, uint16_t* out_addr)
else if (win->bin_pos == 2) {
switch (win->bin_buf[0]) {
/* relative branch */
case 0x10: case 0x30: case 0x50: case 0x70:
case 0x10: case 0x30: case 0x50: case 0x70:
case 0x90: case 0xB0: case 0xD0: case 0xF0:
*out_addr = pc + (int8_t)win->bin_buf[1];
return true;
Expand Down
4 changes: 2 additions & 2 deletions ui/ui_dbg.h
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,7 @@ static inline uint16_t _ui_dbg_disasm(ui_dbg_t* win, uint16_t pc) {
win->dasm.str_pos = 0;
win->dasm.bin_pos = 0;
#if defined(UI_DBG_USE_Z80)
z80dasm_op(pc, _ui_dbg_dasm_in_cb, win, _ui_dbg_dasm_out_cb, win);
z80dasm_op(pc, _ui_dbg_dasm_in_cb, _ui_dbg_dasm_out_cb, win);
#elif defined(UI_DBG_USE_M6502)
m6502dasm_op(pc, _ui_dbg_dasm_in_cb, _ui_dbg_dasm_out_cb, win);
#endif
Expand All @@ -404,7 +404,7 @@ static inline uint16_t _ui_dbg_disasm_len(ui_dbg_t* win, uint16_t pc) {
win->dasm.str_pos = 0;
win->dasm.bin_pos = 0;
#if defined(UI_DBG_USE_Z80)
uint16_t next_pc = z80dasm_op(pc, _ui_dbg_dasm_in_cb, win, 0, 0);
uint16_t next_pc = z80dasm_op(pc, _ui_dbg_dasm_in_cb, 0, win);
#elif defined(UI_DBG_USE_M6502)
uint16_t next_pc = m6502dasm_op(pc, _ui_dbg_dasm_in_cb, 0, win);
#endif
Expand Down
157 changes: 0 additions & 157 deletions util/disassembler.h

This file was deleted.

Loading

0 comments on commit a26431c

Please sign in to comment.