all repos — mgba @ 9bf77f6653f7c996e624e80667168fdb311ff5a7

mGBA Game Boy Advance Emulator

Call ARMDeinit
Jeffrey Pfau jeffrey@endrift.com
Sun, 20 Apr 2014 00:52:37 -0700
commit

9bf77f6653f7c996e624e80667168fdb311ff5a7

parent

7a4ca414e5c7f5fc0c28739b1008f0096528aa70

4 files changed, 15 insertions(+), 0 deletions(-)

jump to
M src/arm/arm.csrc/arm/arm.c

@@ -72,6 +72,18 @@ cpu->components[i]->init(cpu, cpu->components[i]);

} } +void ARMDeinit(struct ARMCore* cpu) { + if (cpu->master->deinit) { + cpu->master->deinit(cpu->master); + } + int i; + for (i = 0; i < cpu->numComponents; ++i) { + if (cpu->components[i]->deinit) { + cpu->components[i]->deinit(cpu->components[i]); + } + } +} + void ARMSetComponents(struct ARMCore* cpu, struct ARMComponent* master, int extra, struct ARMComponent** extras) { // TODO: Call init/deinit cpu->master = master;
M src/arm/arm.hsrc/arm/arm.h

@@ -145,6 +145,7 @@ struct ARMComponent** components;

}; void ARMInit(struct ARMCore* cpu); +void ARMDeinit(struct ARMCore* cpu); void ARMSetComponents(struct ARMCore* cpu, struct ARMComponent* master, int extra, struct ARMComponent** extras); void ARMReset(struct ARMCore* cpu);
M src/gba/gba-thread.csrc/gba/gba-thread.c

@@ -154,6 +154,7 @@ threadContext->cleanCallback(threadContext);

} threadContext->gba = 0; + ARMDeinit(&cpu); GBADestroy(&gba); ConditionWake(&threadContext->sync.videoFrameAvailableCond);
M src/gba/gba.csrc/gba/gba.c

@@ -102,6 +102,7 @@

void GBACreate(struct GBA* gba) { gba->d.id = GBA_COMPONENT_MAGIC; gba->d.init = GBAInit; + gba->d.deinit = 0; } static void GBAInit(struct ARMCore* cpu, struct ARMComponent* component) {