Add gb_dma_close

This commit is contained in:
condret 2024-10-27 19:34:08 +01:00
parent fe0a183ae5
commit ca3b4e4168

View File

@ -248,3 +248,14 @@ void gb_dma_update (GBDMA *dma, RIO *io, ut32 cycles, bool pre_exec) {
dma->seek &= (~GB_DMA_ACTIVE); dma->seek &= (~GB_DMA_ACTIVE);
} }
} }
void gb_dma_close (GBDMA *dma, RIO *io) {
if (!dma || !io) {
return;
}
r_io_bank_use (io, dma->default_bank_id);
r_io_bank_del (io, dma->dma_bank_id);
r_io_fd_close (io, dma->dma_bus_fd);
r_io_fd_close (io, dma->dma_fd);
free (dma);
}