Language…
12 users online: Connnnair, Daizo Dee Von,  Deeke, JackBooWow248, JaizePLS, LilSquiggz, MarioAndLuigi404, petercream1976,  Ringo, sholmes, Teaser, TheJank - Guests: 87 - Bots: 340
Users: 66,001 (2,159 active)
Latest user: EL_SUM1456

Official Hex/ASM/Etc. Help Thread

  • Pages:
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 418
  • 419
  • 420
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 blog. I could post stuff now and then

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 blog. I could post stuff now and then

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 blog. I could post stuff now and then

My Assembly for the SNES tutorial (it's actually finished now!)
Yeah, thats what I meant. Thanks.
this thread isn't for this>_<
Originally posted by Bio
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
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

ChangeBlock:
PHP
REP #$30 ; Index (16 bit) Accum (16 bit)
LDA.W $0003
CLC
ADC.W #$0001
JSR ADDR_00814A
PLP
RTS

ADDR_008000: PLX
PLB
PLP
RTS
ADDR_008004:
PHP
SEP #$20 ; Accum (8 bit)
PHB
LDA.L $7EBD05
BNE ADDR_008012
LDA #$00
BRA ADDR_008014

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

ADDR_0080F2: LDX $1A
LDA $1C
SEC
SBC.W #$0080
TAY
LDA $1933
BEQ ADDR_008109
LDA $1E
SEC
SBC.W #$0080
TAX
LDY $20
ADDR_008109: STX $08
STY $0A
LDA $98
AND.W #$01F0
STA $04
LDA $9A
LSR
LSR
LSR
LSR
AND.W #$000F
ORA $04
TAY
PLA
SEP #$20 ; Accum (8 bit)
STA [$6B],Y
XBA
STA [$6E],Y
XBA
REP #$20 ; Accum (16 bit)
ASL
TAY
PHK
PER.W #$0015
LDA.L $7EBD05
BNE ADDR_008140
PEA $804C
JMP.L $00C0FB

BRA ADDR_008147

ADDR_008140: PEA $805F
JMP.L $30C0FF

ADDR_008147: PLB
PLP
RTS
ADDR_00814A:
PHP
REP #$30 ; Index (16 bit) Accum (16 bit)
PHY
PHX
TAX
LDA $03
PHA
JSR ADDR_008004
PLA
STA $03
PLX
PLY
PLP
RTS
</hr>

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. :P

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?


*sighs* Anyone?
Your layout has been removed.
  • Pages:
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 418
  • 419
  • 420