Code: Select all
ObjectTable: .res *-ObjectSlot*16Moderator: Moderators
Code: Select all
ObjectTable: .res *-ObjectSlot*16Code: Select all
ObjectTable: .res.sizeof(ObjectSlot)x16Code: Select all
ObjectTable: .res .sizeof(ObjectSlot)*16Code: Select all
SpriteBuf1: .res $200
SpriteBuf1Size= *-SpriteBuf1Code: Select all
.assert (SpriteBufSize < $10000), error, "SpriteBufs area too big for SNES DMA transfer"Code: Select all
.assert (*-SpriteBuf1+*-SpriteBuf2 < $10000), error, "SpriteBufs area too big for SNES DMA transfer"Code: Select all
SpriteBuf1: .res $200 ;Sprite buffer for OAM DMA, 512 ($200) bytes
SpriteBuf2: .res $20 ;Sprite buffer for OAM DMA, 32 ($20) bytesHow does this minus where something is equal the size of something?whatever the assembler thinks PC or the current 16-bit address is
You don't seem to understand what * actually does, or what it is for.Espozo wrote:However, for some reason unknown to me, it triggers the error. Is this not right? There's no way it could be too big:Code: Select all
.assert (*-SpriteBuf1+*-SpriteBuf2 < $10000), error, "SpriteBufs area too big for SNES DMA transfer"
Actually, wait, what? (referring to "*")Code: Select all
SpriteBuf1: .res $200 ;Sprite buffer for OAM DMA, 512 ($200) bytes SpriteBuf2: .res $20 ;Sprite buffer for OAM DMA, 32 ($20) bytes
How does this minus where something is equal the size of something?whatever the assembler thinks PC or the current 16-bit address is
Have fun replacing them all again to fix the problems you've just created for yourself.Espozo wrote:So I went and replaced every instance of SpriteBuf1Size with *-SpriteBuf1. I also had something that was SpriteBuf1Size+SpriteBuf2Size, that was just called "SpriteBufSize".
Code: Select all
SpriteBuf1Size = $200
SpriteBuf1: .res SpriteBuf1SizeCode: Select all
SpriteBuf1: .res $200
SpriteBuf1Size= *-SpriteBuf1
Code: Select all
lda *-SpriteBuf1
He got it from me, where I misread *16 as -16, which he promptly noticed, which just makes (his) misunderstanding even more confusing.tokumaru wrote:I don't know where you got that "* minus something is the size of something" thing from, but like Nicole showed, this is only true if you do this calculation immediately after "something" is defined. Do this anywhere else you'll not get the size of "something".