Skip to content

Commit

Permalink
Merge branch 'v0.2' of https://github.com/PSI-Rockin/CorgiDS into v0.2
Browse files Browse the repository at this point in the history
  • Loading branch information
Simon committed Jan 21, 2018
2 parents 5f447b7 + da49762 commit 76c1d4f
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 17 deletions.
5 changes: 4 additions & 1 deletion src/cartridge.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,10 @@ uint32_t byteswap_word(uint32_t word)
return result;
}

NDS_Cart::NDS_Cart(Emulator* e) : e(e) {}
NDS_Cart::NDS_Cart(Emulator* e) : e(e)
{
power_on();
}

void NDS_Cart::key1_encrypt(uint32_t *data)
{
Expand Down
4 changes: 2 additions & 2 deletions src/gba/gbarw.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -350,8 +350,8 @@ void Emulator::gba_write_halfword(uint32_t address, uint16_t halfword)
//Update waitstates
static const int SRAM_states[] = {4, 3, 2, 8};
int SRAM_state = SRAM_states[WAITCNT & 0x3];
arm7.update_code_waitstate(2, SRAM_state, SRAM_state, SRAM_state, SRAM_state);
arm7.update_data_waitstate(2, SRAM_state, SRAM_state, SRAM_state, SRAM_state);
arm7.update_code_waitstate(0xE, SRAM_state, SRAM_state, SRAM_state, SRAM_state);
arm7.update_data_waitstate(0xE, SRAM_state, SRAM_state, SRAM_state, SRAM_state);

static const int wait0n_states[] = {4, 3, 2, 8};
static const int wait0s_states[] = {2, 1};
Expand Down
4 changes: 0 additions & 4 deletions src/gpu.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -582,10 +582,6 @@ void GPU::write_ARM7(uint32_t address, T value)
template <typename T>
void GPU::write_gba(uint32_t address, T value)
{
//I don't know if the NDS uses separate VRAM for GBA mode or if it re-uses VRAM banks
//Might as well re-use the banks, since it makes no difference either way
if (address == 0x0600FB4A)
printf("\n[GPU] Write to $%08X: $%08X", address, value);
if (address < 0x06010000)
*(T*)&GBA_BG[address & 0xFFFF] = value;
else
Expand Down
6 changes: 0 additions & 6 deletions src/qt/emuthread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,6 @@ void EmuThread::load_slot2(uint8_t* data, uint64_t size)
{
load_mutex.lock();
e.load_slot2(data, size);
if (Config::gba_direct_boot)
{
e.power_on();
e.start_gba_mode(false);
unpause(GAME_NOT_STARTED);
}
load_mutex.unlock();
}

Expand Down
18 changes: 14 additions & 4 deletions src/qt/emuwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -361,21 +361,31 @@ void EmuWindow::load_GBA_ROM()
uint8_t* data = new uint8_t[ROM_size];
file.read((char*)data, ROM_size);
file.close();
emuthread.load_slot2(data, ROM_size);
delete[] data;
printf("Slot 2 successfully loaded.");
spu_audio.clear_buffer();
Config::enable_framelimiter = true;
Config::hle_bios = false;
Config::frameskip = 0;
emuthread.load_slot2(data, ROM_size);
delete[] data;
printf("Slot 2 successfully loaded.\n");

if (Config::gba_direct_boot)
{
e->power_on();
e->start_gba_mode(false);
emuthread.unpause(GAME_NOT_STARTED);
}
}
else
QMessageBox::critical(this, "Error", "Unable to load GBA ROM");
}
audio->start(&spu_audio);
emuthread.unpause(PAUSE_EVENT::LOADING_ROM);
}

void EmuWindow::about()
{
QMessageBox::about(this, "CorgiDS v0.1", "Created by PSISP.");
QMessageBox::about(this, "CorgiDS v0.2", "Created by PSISP.");
}

void EmuWindow::preferences()
Expand Down

0 comments on commit 76c1d4f

Please sign in to comment.