Conversation
the problem was tha address inaddr_to_line was masked out and sometimes multiple source could point to given address
| file = file.substr(file.indexOf('_') + 1); | ||
| var line_nr = parseInt(sym.split('_')[1], 16); | ||
| addr = (addr & 0x3fff) | (bank_nr << 14); | ||
| addr = addr | (bank_nr << 14); |
There was a problem hiding this comment.
i know what was the problem ...
the other symbols fx from wram
add
SECTION "FUp", WRAM0[$c100]
fup:
ds 2before
SECTION "Header", ROM0[$100]in https://gbdev.io/rgbds-live/ and try to set breakpoint at jp EntryPoint
now do the same in my version https://selvin.pl/rgbds-live-sameboy/ (I did applied there)
There was a problem hiding this comment.
moving copy in example to bank1
; Subroutine to copy bc bytes from de to hl
SECTION "Copy", ROMX[$4100]
Copy:
ld a, [de]
ld [hli], a
inc de
dec bc
ld a, b
or a, c
jr nz, Copy
retworks on both ...
so using deduction: map file always uses 0000-3fff and adds bank number
so there is no need for & 3fff
There was a problem hiding this comment.
The problem here is that the AND was ensuring that the OR would basically be treating input like bitfields. Removing this AND looks wrong, since now 0:c000 and 3:0000 are identical addresses, for example. (The AND itself was making 0:0000 and 0:c000 be identical instead, which also looks wrong, and I don't have enough context on that code to know which is right.)
There was a problem hiding this comment.
There is no need to put into into addr_to_line when addr > $4000....it is used only for translating breakpoints to line of code, so for symbols sym.startsWith('_SEC') should be another check and not AND... I didn't notice 14 and though that it translates it to 24 bit address
There was a problem hiding this comment.
Hmmm no need for addr > $8000... Now I see
rationale for addr >= 0x8000 we don't care about __SEC_xxx symbols they are only needed for breakpoints and there is no code connected with address for something over 0x8000 yes, you can have code in wram or hram but you cannot link it to the source
Fixes #127