banked breakpoints#135
Conversation
| file = file.substr(file.indexOf('_') + 1); | ||
| var line_nr = parseInt(sym.split('_')[1], 16); | ||
| addr = (addr & 0x3fff) | (bank_nr << 14); | ||
| addr = addr | (bank_nr << 16); |
There was a problem hiding this comment.
now, we are using fully 24 bit address which contains bank
| export function setPC(pc) { | ||
| Module._emulator_set_PC(e, pc); | ||
| } | ||
| export function getBankedPC() { |
There was a problem hiding this comment.
we need new getPC which would take bank into account
| editors[0].focus(); | ||
| updateErrors(); | ||
| updateCpuLine(); | ||
| updateBreakpoints(); |
There was a problem hiding this comment.
this is needed to fix the "switching file error"
| const size_t s_emulator_state_size = sizeof(EmulatorState); | ||
| - | ||
| +#ifdef RGBDS_LIVE | ||
| +#ifndef BREAKPOINTS_MAX_BANKS_NUMBER |
There was a problem hiding this comment.
those constants are for calculating shifts and sizes
lookup bitfield should be fast with em
| +#ifndef BREAKPOINTS_MAX_BANKS_NUMBER | ||
| +#define BREAKPOINTS_MAX_BANKS_NUMBER 1 | ||
| +#endif | ||
| +typedef uint32_t breakpoints_type; |
There was a problem hiding this comment.
you can redefine breakpoint type if we would move to fx 64 bit emscripten
you can aslo check what it does if we would use uint8_t
| - | ||
| +#ifdef RGBDS_LIVE | ||
| +#ifndef BREAKPOINTS_MAX_BANKS_NUMBER | ||
| +#define BREAKPOINTS_MAX_BANKS_NUMBER 1 |
There was a problem hiding this comment.
if we do not pass BREAKPOINTS_MAX_BANKS_NUMBER=256 it should works as it does (but instead using bool array now it is using bitfields)
| } | ||
|
|
||
| +#ifdef RGBDS_LIVE | ||
| +static inline uint32_t emulator_get_banked_PC_inline(Emulator *e) { |
There was a problem hiding this comment.
since there is no such thing as current bank in binjgb we need to calculate bank from what we have and current address ... the code was "invented" from code used to set those bank
|
I'm not seeing any PRs on binjgb's repo? |
|
|
Haha, that PR seems to have been created after I checked. Though, it has also been merged! So this PR can remove the patching of binjgb. |
|
Is don't know ... maybe i should make a new one after you would accept the cmake build's one, as: should be moved to CMakeLists.txt then ...also accepting this PR will mess up cmake build's PR where I removed build-xxxx.sh files |
Fixes #127
Temporary i've added back patching binjgb source 'till my PR would be accepted there.