You are not logged in.
Pages: 1
The pokemon itself is fully functional. I added the sprites at the end of where the krabby sprites are as that was the only available space but this keeps happening!!
Offline
I bet it's looking in the wrong Bank for the sprite.
This is how the game determines which Bank the sprite is in:
; uncompresses the front or back sprite of the specified mon
; assumes the corresponding mon header is already loaded
; hl contains offset to sprite pointer ($b for front or $d for back)
UncompressMonSprite:: ; 1627 (0:1627)
ld bc,W_MONHEADER
add hl,bc
ld a,[hli]
ld [W_SPRITEINPUTPTR],a ; fetch sprite input pointer
ld a,[hl]
ld [W_SPRITEINPUTPTR+1],a
; define (by index number) the bank that a pokemon's image is in
; index = Mew, bank 1
; index = Kabutops fossil, bank $B
; index < $1F, bank 9
; $1F ≤ index < $4A, bank $A
; $4A ≤ index < $74, bank $B
; $74 ≤ index < $99, bank $C
; $99 ≤ index, bank $D
ld a,[wcf91] ; XXX name for this ram location
ld b,a
cp MEW
ld a,BANK(MewPicFront)
jr z,.GotBank
ld a,b
cp FOSSIL_KABUTOPS
ld a,BANK(FossilKabutopsPic)
jr z,.GotBank
ld a,b
cp TANGELA + 1
ld a,BANK(TangelaPicFront)
jr c,.GotBank
ld a,b
cp MOLTRES + 1
ld a,BANK(MoltresPicFront)
jr c,.GotBank
ld a,b
cp BEEDRILL + 2
ld a,BANK(BeedrillPicFront)
jr c,.GotBank
ld a,b
cp STARMIE + 1
ld a,BANK(StarmiePicFront)
jr c,.GotBank
ld a,BANK(VictreebelPicFront)
.GotBank
jp UncompressSpriteData
My hacks: Pokémon Maize, Pokémon Red: Battle Factory
Offline
I'm using Danny-E33's graphics patch so the code is different in mine:
UncompressMonSprite:: ; 1627 (0:1627)
ld bc,W_MONHEADER
add hl,bc
ld a,[hli]
ld [W_SPRITEINPUTPTR],a ; fetch sprite input pointer
ld a,[hl]
ld [W_SPRITEINPUTPTR+1],a
; define (by index number) the bank that a pokemon's image is in
; index = Mew, bank 1
; index = Kabutops fossil, bank $B
; index < $1F, bank 9
; $1F ≤ index < $4A, bank $A
; $4A ≤ index < $74, bank $B
; $74 ≤ index < $99, bank $C
; $99 ≤ index, bank $D
ld a,[wcf91] ; XXX name for this ram location
cp FOSSIL_KABUTOPS
jr z,.RecallBank
cp FOSSIL_AERODACTYL
jr z,.RecallBank
cp MON_GHOST
jr z,.RecallBank
ld a,[$D0D3]
jr .GotBank
.RecallBank
ld a,BANK(FossilKabutopsPic)
.GotBank
jp UncompressSpriteData
I don't think I'm well aquainted enough with asm to understand this bit.
Offline
If you're using Danny's patch, then the Bank number for each Pokemon's sprite is defined in its BaseStats entry. Here's Bulbasaur's: https://github.com/dannye/pokered-gen-I … basaur.asm
The last line in that file is self-explanatory. Which pokemon did you try adding? Can you show what its BaseStats entry looks like? Perhaps it isn't a Bank issue at all.
EDIT: Are you using the disassembly? If not, then I'm guessing that you just need to simply change that byte in the BaseStats entry for whatever pokemon you're adding.
Last edited by ShantyTown (2015-03-08 20:05:12)
My hacks: Pokémon Maize, Pokémon Red: Battle Factory
Offline
If you're using Danny's patch, then the Bank number for each Pokemon's sprite is defined in its BaseStats entry. Here's Bulbasaur's: https://github.com/dannye/pokered-gen-I … basaur.asm
The last line in that file is self-explanatory. Which pokemon did you try adding? Can you show what its BaseStats entry looks like? Perhaps it isn't a Bank issue at all.
EDIT: Are you using the disassembly? If not, then I'm guessing that you just need to simply change that byte in the BaseStats entry for whatever pokemon you're adding.
PikabluBaseStats:
db DEX_PIKABLU ; pokedex id
db 70 ; base hp
db 20 ; base attack
db 50 ; base defense
db 40 ; base speed
db 35 ; base special
db WATER ; species type 1
db WATER ; species type 2
db 190 ; catch rate
db 82 ; base exp yield
INCBIN "pic/bmon/pikablu.pic",0,1 ; 55, sprite dimensions
dw PikabluPicFront
dw PikabluPicBack
; attacks known at lvl 0
db TACKLE
db 0
db 0
db 0
db 3 ; growth rate
; learnset
db %10100000
db %00111111
db %00001000
db %11010000
db %10000010
db %00101000
db %00010010
db BANK(PikabluPicFront)
Offline
Does anyone have any ideas? Also, the Town Map is no longer working, do you think this is a problem with RAM because I've moved a bit around? I havent touched WRAM though..
Offline
If you have shifted ram, it is possible you broke the routine that ShantyTown pointed out. That would be my fault though.
In wram.asm you should find:
W_MONHLEARNSET:: ; d0cc
; bit field
flag_array 50 + 5
ds 1
You should change this to:
W_MONHLEARNSET:: ; d0cc
; bit field
flag_array 50 + 5
W_MONHPICBANK:: ; d0d3
ds 1
Then change $D0D3 to W_MONHPICBANK in UncompressMonSprite. This might fix it.
Offline
I went ahead and applied that fix to Red++ before it potentially becomes an issue in the future. I haven't run into any similar errors, but good to be safe and learn from others' mistakes.
Last edited by Luna (2015-03-10 17:06:08)
I am not very active on this forum. I only pop in from time to time.
Offline
If you have shifted ram, it is possible you broke the routine that ShantyTown pointed out. That would be my fault though.
In wram.asm you should find:
W_MONHLEARNSET:: ; d0cc ; bit field flag_array 50 + 5 ds 1
You should change this to:
W_MONHLEARNSET:: ; d0cc ; bit field flag_array 50 + 5 W_MONHPICBANK:: ; d0d3 ds 1
Then change $D0D3 to W_MONHPICBANK in UncompressMonSprite. This might fix it.
Applied this and I'm still getting a sprite error. I havent edited wram.asm at all, but I've added new hide_show constants, would this affect it? I've tried putting PikabluPicFront and PikabluePicBack in various different banks to no avail either. Wtf is going on :/
Offline
Are you sure that everything else about the pokemon is working right? It might be that you didn't include the base stats file correctly.
Offline
something something git diff
Offline
Are you sure that everything else about the pokemon is working right? It might be that you didn't include the base stats file correctly.
INCLUDE "data/baseStats/pikablu.asm"
is at the end of base_stats.asm.
Offline
you need to put mew after mewtwo
a list of all the gotchas when starting out would be excellent
Offline
you need to put mew after mewtwo
a list of all the gotchas when starting out would be excellent
gotchas? Mew is after Mewtwo.
EDIT: OMG! Are you for real? Moving the INCLUDE for Mew.asm to after mewtwo and taking it from main.asm fixed it!
Now how do I fix my town map? I've implemented two different maps in this game which change depending on a certain unused bit in the RAM (taken from Mateo's gender tutorial). The GFX work perfectly, except when you press up and down while viewing the map the map order is all messed up!
The code I've changed is as follows:
LoadTownMap: ; 7109b (1c:509b)
call GBPalWhiteOutWithDelay3
call ClearScreen
call UpdateSprites
ld hl, wTileMap
ld b, $12
ld c, $12
call TextBoxBorder
call DisableLCD
; load correct region gfx
ld a, [wd798] ; check ram address
bit 2, a ; check ram address
jr nz, .inVermgfx
ld hl, WorldMapTileGraphics ; $65a8
ld de, vChars2 + $600
ld bc, $100
ld a, BANK(WorldMapTileGraphics)
call FarCopyData2
jr .contMapLoad
.inVermgfx
ld hl, WorldMapTileGraphics2 ; $65a8
ld de, vChars2 + $600
ld bc, $100
ld a, BANK(WorldMapTileGraphics2)
call FarCopyData2
.contMapLoad
ld hl, MonNestIcon ; $56be
ld de, vSprites + $40
ld bc, $8
ld a, BANK(MonNestIcon)
call FarCopyDataDouble
; load correct region map
ld a, [wd798] ; check ram address
bit 2, a ; check ram address
jr nz, .inVerm
ld hl, wTileMap
ld de, CompressedMap ; $5100
jr .asm_710d3
.inVerm
ld hl, wTileMap
ld de, CompressedMap2 ; $5100
.asm_710d3
ld a, [de]
and a
jr z, .asm_710e9
ld b, a
and $f
ld c, a
ld a, b
swap a
and $f
add $60
.asm_710e2
ld [hli], a
dec c
jr nz, .asm_710e2
inc de
jr .asm_710d3
.asm_710e9
call EnableLCD
ld b, $2
call GoPAL_SET
call Delay3
call GBPalNormal
xor a
ld [wTownMapSpriteBlinkingCounter], a
inc a
ld [wTownMapSpriteBlinkingEnabled], a
ret
CompressedMap: ; 71100 (1c:5100)
; you can decompress this file with the redrle program in the extras/ dir
INCBIN "gfx/town_map.rle"
CompressedMap2: ; 71100 (1c:5100)
; you can decompress this file with the redrle program in the extras/ dir
INCBIN "gfx/town_map2.rle"
Last edited by ~Red (2015-03-11 02:38:38)
Offline
a list of all the gotchas when starting out would be excellent
I second this. A sticky thread in the Gen 1 section would probably be the right thing to do.
A few "gotchas" off the top of my head:
1. Mew's BaseStats struct comes after Mewtwo's, before appending new Pokemon.
2. Put new Pokemon pics in the correct Bank. (See UncompressMonSprite)
3. Warps are linked to EVENT_DISP entries, not warps.
4. What does the error "Section XXX is too big" mean?
5. What are the effects of a Dungeon tileset? (e.g. Can't use map connections, can't fly, etc.)
EDIT: Red, to answer your Town Map question, take a look at data/town_map_order.asm.
Last edited by ShantyTown (2015-03-11 04:05:39)
My hacks: Pokémon Maize, Pokémon Red: Battle Factory
Offline
EDIT: Red, to answer your Town Map question, take a look at data/town_map_order.asm.
I haven't changed anything in town_map_order.asm other than the order in which the maps are. The map works fine it just wont let me scroll through the towns/routes. It gets stuck on a loop of S.S.ANNE a few times and then POKEMON LEAGUE and POKEMON TOWER.
EDIT: Nevermind! I downloaded a fresh copy of town_map.asm from the repository and rewrote the code I did for switching the map depending on which side of the Region you're in. It now works pretty perfectly! I also found that in the town_map code there's a few numbers you have to change as the game will just keep scrolling past the list of maps in townmaporder.
Last edited by ~Red (2015-03-12 15:55:58)
Offline
Pages: 1