Banner
Views: 235,929,392
Time: 2013-05-19 07:22:40 PM
17 users online: Arctic Avenger, BS187, Daizo Dee Von, Donaldthescotishtwin, EddyCartoon, Fireblast124, Flame8765, krisu, LuigiBlood, o PatPatPat, Payne28, phenolatukas, Pixels, o ShadowPhoenix, Torchkas, wiiqwertyuiop, Z0mbie1337 - Guests: 33 - Bots: 17Users: 22,845 (1,294 active)
Latest: MarioUnlimited
Tip: Check the Documents Section. Tutorials and other useful information can be found there.
Special Creating Eating Block Help
Forum Index - SMW Hacking - General SMW Hacking Help - ASM & Related Topics - Special Creating Eating Block Help
Pages: « 1 »
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:

Code
MAP16_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
Code
BLOCK1 ;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 readme
GENERATE 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?
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.
What happened when you tried that? Nothing?
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
Code
SUBMAP 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 use
0=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:

Code
LDA.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.
wait wait wait wait wait.

wait.

the patch readme says to do this:

GENERATE ARBITRARY MAP16 TILE

Code
LDA.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?


Code
LDA #$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
Code
LDA #$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.
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.
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 Us


Total queries: 27

Menu