issotm / gbz80toitems3 Goto Github PK
View Code? Open in Web Editor NEWAn online converter translating Game Boy assembly into Pokémon R/B/Y items.
Home Page: https://eldred.fr/gbz80toitems3/
An online converter translating Game Boy assembly into Pokémon R/B/Y items.
Home Page: https://eldred.fr/gbz80toitems3/
Line 1044 in b3d9d05
Should be 192 instead of 196.
The following code:
jr .lab
.lab
produces the item list
Rainbow Badge (hex:18) x255 (hex:FF)
wheras the expected result is
Rainbow Badge x0
This issue also happens with conditional jr instructions.
ldh ($ff80),a
doesn't compile, instead throwing a memAccess is undefined !
internal error.
In all other cases, ldh doesn't work and throws this same error.
(Sorry for the title)
db 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
throws an internal error :
Cannot read property 'used' of undefined
Knowing how code is built, this error was thrown at the linker/item-ifier level (this is where the "used" property is used to compute the "duplicate" warning).
However, this syntax is supposed to be invalid ! This code passed the assembler stage, but that alone is abnormal.
The bug must be located in the way the function readByte
is implemented. It also made me create issue #9, so read my rant there for details on the bug. Or don't, I won't judge you :)
This code is valid :
ld a, ($D2B5)
ld b,b
ld ($D158),a
ld l, $27
inc (hl)
ld l, $23
inc (hl)
ret
but throws the aforementioned error.
The following mnemonics are missing in GBz80 to Items
ld [$nnnn], sp ; (Opcode 08)
ld hl, sp+$nn ; (Opcode F8); *
ld hl, [sp+$nn]
to F8
, which is wrong, because such an instruction does not exist. But you can keep it for compatibility (like jp [hl]
is a synonym of jp hl
).Syntaxes such as dw $C0 DE
compile successfully, even though they should not.
This comes from the assembler, which ignores everything /\w/
- aside from the first of those, since it's the one that separates the instruction from the operands.
Seems to come from wrong label parsing.
Confirmed with all rr, rrc, rl, rlc, etc. instructions.
It's a typo, reg8.indexOf
IS a function.
This code is valid :
ld a, ($D2B5)
ld b,b
ld ($D158),a
ld l, $27
inc (hl)
ld l, $23
inc (hl)
ret
but throws the aforementioned error.
ld hl, $D17C
ld a, $E0
ld (hl), a
sub a, $D9
dec hl
ld c, a
inc b
ld (hl), c
ret
This code doesn't compile correctly.
ThunderStone x124
TM09 x62
TM24 x119
TM14 x217
Secret Key x79
Poké Ball x113
TM01 x[any qty]
is expected, but
ThunderStone x62
TM24 x119
TM14 x217
Secret Key x79
Poké Ball x113
TM01 x[any qty]
is generated instead.
Apparently the argument to ld hl, $D17C
is skipped entirely.
ld
's implementation is a bit of a crying shame, it must be a problem of instruction length - the instruction byte is correct (ThunderStone is output) but the arguments aren't present (2-byte offset)
May not affect ld de, $XXYY
and ld bc, $XXYY
, but if either suffers from the bug the other should, too.
db
's support is limited to only one operand.
This would require separating db
's processing function from readByte
; which would actually make code better (readByte
only processing a byte and not pushing anything to the byte stream, thus simplfying wrapping around it). however, since this function is used so many times, it would be a huge game of bowling through the code.
To add to the fun, I already have limited time on my hands now. This will have to wait (even though I hate it). In the meantime, I ask you to use separate db
instructions. Thanks :)
Of course, all of this applies to dw
.
The code
jp z, label
label:
throws "conditionals is not defined".
The cause is that the list of conditions is stored in a variable called conds, not conditionals.
Currently, GBz80 to Items does not support the shortcut for add a, X
, where X
is a register or an address stored in register hl
. This does not affect the case where X
is a 8 bit integer constant. The mnemonic sub
is not affected.
The following instructions
add a
add b
add c
add d
add h
add l
add [hl]
are equivalent to
add a, a
add a, b
add a, c
add a, d
add a, h
add a, l
add a, [hl]
It didn't give me a line, so I'll just post the whole code:
Ld c,$00
start:
Call $3ffa
Ldh a,($b2)
Cp $10
jr z,left
Cp $20
Jr z,right
Ldh a,($f8)
Cp $02
jr z,end
Jr start
left:
Dec c
Jr start
right:
inc c
Jr start
end:
ld b,c
ld c,$64
call $3e48
ret
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.