Skeetendo

’Cause all games were better on the GBC

You are not logged in.

#1 2015-04-24 01:43:54

~Red
Member
Registered: 2010-10-16
Post 242/276

Moving at half speed towards the top of the map..

So ive created a script which replaces a tile on the map if a certain flag is met. It is called at the very beginning of the map script. However, when said tile is on screen the game horrifically slows down. Any ideas why?

PokemonTower7Script: ; 60d05 (18:4d05)
    call BlockTings
    call EnableAutoTextBoxDrawing
    ld hl, PokemonTower7TrainerHeaders
    ld de, PokemonTower7ScriptPointers
    ld a, [W_POKEMONTOWER7CURSCRIPT]
    call ExecuteCurMapScriptInTable
    ld [W_POKEMONTOWER7CURSCRIPT], a
    ret

BlockTings:
    ld a, [W_SAVEDKREWELLA] ; load new flag
    bit 0, a
    jr nz, .end
    ret
.end
    ld a, $2
    ld [wNewTileBlockID], a
    ld c, $6
    ld b, $1
    predef ReplaceTileBlock
    ret

PokemonTower7ScriptPointers:
    dw CheckFightingMapTrainers
    dw DisplayEnemyTrainerTextAndStartBattle
    dw EndTrainerBattle
    dw PokemonTower7Script3
    dw PokemonTower7Script4

Offline

#2 2015-04-25 03:17:55

Tauwasser
Member
Registered: 2010-10-16
Post 436/447

Re: Moving at half speed towards the top of the map..

Because the ASM scripts are regularly evaluated in RBGY. So you redraw the map over and over again. Do it once, use a flag that resets on map change.

cYa,

Tauwasser

Offline

Board footer

Powered by FluxBB