This would be great! Can you maybe make it with pictures and examples on Custom Blocks/Sprites?
Sure. But it might take a while, because I am helping Delmaru right now.My Assembly for the SNES tutorial (it's actually finished now!)
No problem. I can wait.
Alright, tutorial is released! You can find it Here.My Assembly for the SNES tutorial (it's actually finished now!)
That's a pretty nice tutorial Ersanio. It covers all of the basics, which is great.
Speaking of tutorials, I'm actually having a bit of a problem with high bytes and low bytes again. I tried this simple command to make the block to nothing but act like 130:
LDA #$0130
STA $03
RTS
Basically, it is -supposed- to load the cement block value, and store it to the block # from the Map16 editor. However, it instead crashes SMW.
Now, I noticed there wss a high and low byte table near the end of the RAM map .. is that where I store/load these values from? If anyone knows, that would be fantastic.
Thanks.
Originally posted by S.N.N.
Speaking of tutorials, I'm actually having a bit of a problem with high bytes and low bytes again. I tried this simple command to make the block to nothing but act like 130:
LDA #$0130
STA $03
RTS
Basically, it is -supposed- to load the cement block value, and store it to the block # from the Map16 editor. However, it instead crashes SMW.
Now, I noticed there wss a high and low byte table near the end of the RAM map .. is that where I store/load these values from? If anyone knows, that would be fantastic.
Thanks.
----------------------------------------------------------------------------------------------------
Your loading wrong. Im not sure where your going with that STA, but its a wrong load. This is the proper code...
LDY #$01 ; Load the high byte into the Y Register like you should
LDA #$30 ; Load the low byte into the Accumulator
STA $1693 ; Store 30 into the place in RAM map where low byte goes
RTS
A block is made up of 4 digits (0000) that determine what it acts like. The first 2 go into the Y Register, and the other 2 go into 1693.
Yeah, that's what I figured the problem was. I didn't load from the Y register though, so that's what the other conflict would have been .. thanks.
By the way, does anyone know anything about how a block changes it's state (such as a coin vanishing?) Just curious.
Coin vanishing and such is usually done by making a block change to the next in Map16. Which is pretty fuzzy itself. D:
Originally posted by Boing
Coin vanishing and such is usually done by making a block change to the next in Map16. Which is pretty fuzzy itself. D:
How would you do that? Like, get the graphics itself to change...
I kinda wonder this myself, I assume it must write to VRAM at some point, I will try to make a disassambly of it, it should be much easier to understand than a .bin file :S
OK thanks Bio.
I can barely understand the Hex. Is there a conversion chart somewhere?
Conversion chart? Do you mean ASM to hex? You can find it right here!My Assembly for the SNES tutorial (it's actually finished now!)
I kinda wonder this myself, I assume it must write to VRAM at some point, I will try to make a disassambly of it, it should be much easier to understand than a .bin file :S
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Ripped from chblock.bin
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
ADDR_008012: LDA #$30
ADDR_008014: PHA
PLB
REP #$30 ; Index (16 bit) Accum (16 bit)
PHX
LDA $9A
STA $0C
LDA $98
STA $0E
LDA.W #$0000
SEP #$20 ; Accum (8 bit)
LDA $5B
STA $09
LDA $1933
BEQ ADDR_008031
LSR $09
ADDR_008031: LDY $0E
LDA $09
AND #$01
BEQ ADDR_008047
LDA $9B
STA $00
LDA $99
STA $9B
LDA $00
STA $99
LDY $0C
ADDR_008047: CPY.W #$0200
BCS ADDR_008000
LDA $1933
ASL
TAX
LDA $BEA8,X
STA $65
LDA $BEA9,X
STA $66
STZ $67
LDA $1925
ASL
TAY
LDA ($65),Y
STA $04
INY
LDA ($65),Y
STA $05
STZ $06
LDA $9B
STA $07
ASL
CLC
ADC $07
TAY
LDA ($04),Y
STA $6B
STA $6E
INY
LDA ($04),Y
STA $6C
STA $6F
LDA #$7E
STA $6D
INC A
STA $70
LDA $09
AND #$01
BEQ ADDR_008099
LDA $99
LSR
LDA $9B
AND #$01
BRA ADDR_00809E
ADDR_008099: LDA $9B
LSR
LDA $99
ADDR_00809E: ROL
ASL
ASL
ORA #$20
STA $04
CPX.W #$0000
BEQ ADDR_0080AF
CLC
ADC #$10
STA $04
ADDR_0080AF: LDA $98
AND #$F0
CLC
ASL
ROL
STA $05
ROL
AND #$03
ORA $04
STA $06
LDA $9A
AND #$F0
LSR
LSR
LSR
STA $04
LDA $05
AND #$C0
ORA $04
STA $07
REP #$20 ; Accum (16 bit)
LDA $09
AND.W #$0001
BNE ADDR_0080F2
LDA $1A
SEC
SBC.W #$0080
TAX
LDY $1C
LDA $1933
BEQ ADDR_008109
LDX $1E
LDA $20
SEC
SBC.W #$0080
TAY
BRA ADDR_008109
This was in the source of Mikeyk's coins. Of course, I can't get it to work because I'm having trouble with the reloc offsets. :S Unexpected end tag (</hr>) at 6554, expected </pre>
What a long routine o_O, we should try to recode it to remove the JSRs in it so we won't need to mess with the annoying reloc offset
Reloc stands for "Relocation" correct?
I got some help from Smallhacker at Board 2, but I'm still having trouble.
Originally posted by Smallhacker
The 65c816 opcodes JSR, JSL, JMP and JML requires the absolute address of the target.
However, if the target is inside the block code, there is no way to know in advance where the code will be inserted. Therefore, you make the "absolute addresses" relative to the start of the block, then add the address of the address to the reloc list. When BlockTool inserts the block, it will find a place to insert the data to, check the reloc offsets, add the start address of the block code to the relative addresses and insert.
How make the Blue Carryable Block, don't change color when you carry him?
Originally posted by pieguy1372
What are the reloc offsets for and how do I use them?