 |
|
 |
|
| Special Creating Eating Block Help |
|
Forum Index - SMW Hacking - General SMW Hacking Help - ASM & Related Topics - Special Creating Eating Block Help |
|
Pages: 1  |
|
|
|
| Posted on 2012-02-09 03:33:16 PM |
Link | Quote |
|
I made this special version of the creating eating block that not only allows me to choose what direction to go in but also what tile to generate. Unfortunately, I've need to generate certain tiles that aren't specified by $9C. The structure of it looks more or less like this:
CodeMAP16_NUMY db $03,$04,$05,$06,$00,$03,$04,$05,$06
X_SPEED dcb $10,$F0,$00,$00,$00,$10,$F0,$00,$00
Y_SPEED dcb $00,$00,$10,$F0,$00,$00,$00,$10,$F0
DIRECTION dcb $00,$00,$01,$00,$02,$00,$00,$00,$03,$00,$00
stuff happens, then
Code
LDA X_SPEED,y ; \ set x speed
STA $B6,x ; /
LDA Y_SPEED,y ; \ set y speed
STA $AA,x ; /
LDA MAP16_NUMY,y ; \ set direction-based tile-gen table
STA $185E ; / for Block1 code later (done while y is still correct)
decides weather or not to be a creating or an eating block, then
CodeBLOCK1 ;block chosen to gen already selected when sprite speed was set
LDA $185E ;choosing tile to generate from table
STA $9C ;
LDA $E4,x ;sprite xpos low (table)
STA $9A ;blockgen xpos of contact low
LDA $14E0,x ;sprite xpos high (table)
STA $9B ;blockgen xpos of contact high
LDA $D8,x ;sprite ypos low (table)
STA $98 ;blockgen ypos of contact low
LDA $14D4,x ;sprite ypos high (table)
STA $99 ;blockgen ypos of contact high
JSL $00BEB0 ; generate Map16 tile routine
RTS
BLOCK2 LDA #$02 ;
STA $185E ; tile from map16
LDA $185E ;choosing tile to generate from table
STA $9C ;
LDA $E4,x ;sprite xpos low (table)
STA $9A ;blockgen xpos of contact low
LDA $14E0,x ;sprite xpos high (table)
STA $9B ;blockgen xpos of contact high
LDA $D8,x ;sprite ypos low (table)
STA $98 ;blockgen ypos of contact low
LDA $14D4,x ;sprite ypos high (table)
STA $99 ;blockgen ypos of contact high
JSL $00BEB0 ; generate Map16 tile routine
RTS
so the problem is, this only lets me generate certain map16 tiles. To fix this I had to use that tile generation expansion patch, but according to the readme I have to do so like this:
Originally posted by readmeGENERATE ARBITRARY MAP16 TILE
LDA.b #$FF
STA.b $9C
;;STORE YOUR 16-BIT BLOCK NUMBER into $0660/1
JSL $00BEB0
and that doesn't work with what I did at all. how do I fix this?
|
|
| Posted on 2012-02-10 05:40:00 PM |
Link | Quote |
|
So, am I not providing enough information, or is this too ridiculous of a question to ask ...what am I doing wrong? Like, I'm not trying to bump to force an answer here. I just want to know what is wrong if anything with my question.
EDIT: let me rephrase then. can someone show me what the readme's analog to the type of tile generation I am using would look like?
|
| Last edited on 2012-02-11 01:26:04 AM by jesus. |
|
| Posted on 2012-02-18 08:24:03 AM |
Link | Quote |
|
|
What happened when you tried that? Nothing?
|
|
| Posted on 2012-02-19 06:07:59 PM |
Link | Quote |
|
it does exactly what it is programmed to do.
In the normal version, there is a "path" table where the first digit of each value determines the direction to go in (0=right, 1=left, 2=up 3=down) and the second digit determines the number of times to go in that direction.
Example: if the path table said this
CodeSUBMAP PATH db $05,$3A,$15,$22,$FF
the block snake would go right 5 times, up 10 times, left 5 times, down 2 times, then disappear (FF destroys the sprite)
In my version I changed what the first digit does in the path table. now it works like this
Originally posted by new version of 1st digit use0=right+generate block from $9C indexed by the first value of MAP16NUM_Y,
1=left+generate block from $9C indexed by the second value of MAP16NUM_Y,
2=up+generate block from $9C indexed by the third value of MAP16NUM_Y,
3=down+generate block from $9C...(and so on)
4=right+generate block from $9C...
5=left+generate block from $9C...
6=up+generate block from $9C...
7=down+generate block from $9C...
the idea is that I generate different line guide tiles depending on the digit I enter. However, the problem is that the line guide tiles aren't availible as options INSIDE table $9C. In order to generate them, I found out I had to apply a special patch, and draw them like this:
CodeLDA.b #$FF
STA.b $9C
;;STORE YOUR 16-BIT BLOCK NUMBER into $0660/1
JSL $00BEB0
So my sprite works per se, but it doesn't do what I want it to, and that's what I need help doing.
|
|
| Posted on 2012-03-09 04:50:09 PM |
Link | Quote |
|
wait wait wait wait wait.
wait.
the patch readme says to do this:
GENERATE ARBITRARY MAP16 TILE
CodeLDA.b #$FF
STA.b $9C
;;STORE YOUR 16-BIT BLOCK NUMBER into $0660/1
JSL $00BEB0
so if I am generating a single block type, can't I just do this?
CodeLDA #$FF ;enable hijack in patch
STA $9C ;
LDA $E4,x ;
STA $9A ; set the position
LDA $14E0,x ;
STA $9B ; of the tile
LDA $D8,x ;
STA $98 ; that will be generated
LDA $14D4,x ;
STA $99 ;
LDA #$70 ;tell hijack what to generate
STA $0601 ;
LDA #$39 ;map16 number 3970
STA $0600
JSL $00BEB0 ; generate Map16 tile routine
|
|
| Posted on 2012-03-09 04:59:18 PM |
Link | Quote |
|
CodeLDA #$FF ;enable hijack in patch
STA $9C ;
LDA $E4,x ;
STA $9A ; set the position
LDA $14E0,x ;
STA $9B ; of the tile
LDA $D8,x ;
STA $98 ; that will be generated
LDA $14D4,x ;
STA $99 ;
LDA #$70 ;tell hijack what to generate
STA $0601 ;
LDA #$39 ;map16 number 3970
STA $0600
JSL $00BEB0 ; generate Map16 tile routine
1: I'd put the LDA #$FF STA $9C just above the LDA #$70 there. It looks less messy that way.
2: $0660, not $0600.
3: The SNES is little endian. #$39 goes in $0660 and #$70 goes in $0661.
|
|
| Posted on 2012-03-10 12:31:51 PM |
Link | Quote |
|
Holy crap I finally understand the difference between Little Endian and Big Endian.
(also, thanks for the help alcaro!)
|
| Last edited on 2012-03-10 12:32:28 PM by jesus. |
|
| Posted on 2012-03-12 03:12:12 AM |
Link | Quote |
|
aaaagh, after finally getting it to actually generate lineguides, the thing falls apart and won't go in the direction I tell it to.
You know what, could someone with l33t ASM knowledge help me out via PM or otherwise? Frankly, I'm not good enough yet to solve this.
Pastebin because I have no idea what part of the code is malfuncioning
EDIT: I think It has something to do with the tables.
|
| Last edited on 2012-03-12 09:14:49 AM by jesus. |
|
|
Pages: 1  |
|
|
|
|
Forum Index - SMW Hacking - General SMW Hacking Help - ASM & Related Topics - Special Creating Eating Block Help |
|
|
 |
|
 |
The purpose of this site is not to distribute copyrighted material, but to honor one of our favourite games.
Copyright © 2005 - 2013 - SMW Central Legal Information - Link To UsTotal queries: 27
|
|
|
|