Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,9 @@ if(TARGET binjgb)
LINK_FLAGS ""
RUNTIME_OUTPUT_DIRECTORY "${RGBDS_LIVE_OUT_DIR}"
)
target_compile_definitions(binjgb PRIVATE
"-DBREAKPOINTS_MAX_BANKS_NUMBER=256"
)
target_link_options(binjgb PRIVATE
"-sMALLOC=emmalloc"
"-sEXIT_RUNTIME=0"
Expand Down
2 changes: 1 addition & 1 deletion js/compiler.js
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ function buildDone(rom_file, map_file) {
var file = sym.substr(sym.indexOf('_') + 1);
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);
Comment thread
Rangi42 marked this conversation as resolved.
Resolved
addr_to_line[addr] = [file, line_nr];
} else if (sym == 'emustart' || sym == 'emuStart' || sym == 'emu_start') {
start_address = addr;
Expand Down
3 changes: 3 additions & 0 deletions js/emulator.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,9 @@ export function getPC() {
export function setPC(pc) {
Module._emulator_set_PC(e, pc);
}
export function getBankedPC() {
return Module._emulator_get_banked_PC(e);
}
export function getSP() {
return Module._emulator_get_SP(e);
}
Expand Down
2 changes: 1 addition & 1 deletion js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ const cpuDom = {
function updateCpuState(afterSingleStep) {
emulator.renderScreen();

var pc = emulator.getPC();
var pc = emulator.getBankedPC();
cpuDom.pc.innerText = toHex(pc, 4);
cpuDom.sp.innerText = toHex(emulator.getSP(), 4);
cpuDom.a.innerText = toHex(emulator.getA(), 2);
Expand Down