mirror of https://github.com/mgba-emu/mgba.git
Call ARMDeinit
This commit is contained in:
parent
7a4ca414e5
commit
9bf77f6653
|
@ -72,6 +72,18 @@ void ARMInit(struct ARMCore* cpu) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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) {
|
void ARMSetComponents(struct ARMCore* cpu, struct ARMComponent* master, int extra, struct ARMComponent** extras) {
|
||||||
// TODO: Call init/deinit
|
// TODO: Call init/deinit
|
||||||
cpu->master = master;
|
cpu->master = master;
|
||||||
|
|
|
@ -145,6 +145,7 @@ struct ARMCore {
|
||||||
};
|
};
|
||||||
|
|
||||||
void ARMInit(struct ARMCore* cpu);
|
void ARMInit(struct ARMCore* cpu);
|
||||||
|
void ARMDeinit(struct ARMCore* cpu);
|
||||||
void ARMSetComponents(struct ARMCore* cpu, struct ARMComponent* master, int extra, struct ARMComponent** extras);
|
void ARMSetComponents(struct ARMCore* cpu, struct ARMComponent* master, int extra, struct ARMComponent** extras);
|
||||||
|
|
||||||
void ARMReset(struct ARMCore* cpu);
|
void ARMReset(struct ARMCore* cpu);
|
||||||
|
|
|
@ -154,6 +154,7 @@ static THREAD_ENTRY _GBAThreadRun(void* context) {
|
||||||
}
|
}
|
||||||
|
|
||||||
threadContext->gba = 0;
|
threadContext->gba = 0;
|
||||||
|
ARMDeinit(&cpu);
|
||||||
GBADestroy(&gba);
|
GBADestroy(&gba);
|
||||||
|
|
||||||
ConditionWake(&threadContext->sync.videoFrameAvailableCond);
|
ConditionWake(&threadContext->sync.videoFrameAvailableCond);
|
||||||
|
|
|
@ -102,6 +102,7 @@ static void _checkOverrides(struct GBA* gba, uint32_t code);
|
||||||
void GBACreate(struct GBA* gba) {
|
void GBACreate(struct GBA* gba) {
|
||||||
gba->d.id = GBA_COMPONENT_MAGIC;
|
gba->d.id = GBA_COMPONENT_MAGIC;
|
||||||
gba->d.init = GBAInit;
|
gba->d.init = GBAInit;
|
||||||
|
gba->d.deinit = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void GBAInit(struct ARMCore* cpu, struct ARMComponent* component) {
|
static void GBAInit(struct ARMCore* cpu, struct ARMComponent* component) {
|
||||||
|
|
Loading…
Reference in New Issue