all repos — mgba @ 498aa541fc660c8755cda99cf8889171b3bd5381

mGBA Game Boy Advance Emulator

src/ds/bios.c (view raw)

 1/* Copyright (c) 2013-2016 Jeffrey Pfau
 2 *
 3 * This Source Code Form is subject to the terms of the Mozilla Public
 4 * License, v. 2.0. If a copy of the MPL was not distributed with this
 5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 6#include <mgba/internal/ds/bios.h>
 7
 8#include <mgba/internal/arm/arm.h>
 9
10mLOG_DEFINE_CATEGORY(DS_BIOS, "DS BIOS", "ds.bios");
11
12const uint32_t DS7_BIOS_CHECKSUM = 0x1280F0D5;
13const uint32_t DS9_BIOS_CHECKSUM = 0x2AB23573;
14
15void DS7Swi16(struct ARMCore* cpu, int immediate) {
16	mLOG(DS_BIOS, DEBUG, "SWI7: %02X r0: %08X r1: %08X r2: %08X r3: %08X",
17	    immediate, cpu->gprs[0], cpu->gprs[1], cpu->gprs[2], cpu->gprs[3]);
18
19	ARMRaiseSWI(cpu);
20}
21
22void DS7Swi32(struct ARMCore* cpu, int immediate) {
23	DS7Swi16(cpu, immediate >> 16);
24}
25
26void DS9Swi16(struct ARMCore* cpu, int immediate) {
27	mLOG(DS_BIOS, DEBUG, "SWI9: %02X r0: %08X r1: %08X r2: %08X r3: %08X",
28	    immediate, cpu->gprs[0], cpu->gprs[1], cpu->gprs[2], cpu->gprs[3]);
29
30	ARMRaiseSWI(cpu);
31}
32
33void DS9Swi32(struct ARMCore* cpu, int immediate) {
34	DS9Swi16(cpu, immediate >> 16);
35}