![]() | ||
Views: 5,993,707 | Homepage | Main | Rules/FAQ | Memberlist | Active users | Last posts | Calendar | Stats | Online users | Search | 11-29-23 08:53 AM |
Guest: |
0 users reading GBAtek addendum/errata | 1 guest | 1 bot |
Main - Development - GBAtek addendum/errata | Hide post layouts | New reply |
Arisotura |
| ||
![]() Big fire melon magical melon girl Level: 55 ![]() Posts: 801/870 EXP: 1266863 Next: 47326 Since: 03-28-17 From: France Last post: 8 days ago Last view: 7 days ago |
I'm letting the DSi discharge, while running a test program that keeps track of change in the battery register
so far: when charging: 8F full -> empty: 0F 0B 07 03 (light red) 01 (light red, blinking) so bit0 = not-critical bit? bit1 = 'power good' bit, in the sense of the old DS bit2-3: level from 0 to 3 ---- DSi BPTWL Battery Level register and DS Powerman Battery Status 0F, 0B, 07 (full, three bars, two bars) = 0 (okay) 03, 01 (one red bar, one flashing red bar) = 1 (low) ____________________ Kuribo64 |
Rayyan |
| ||
![]() Big melon Administrator Level: 28 ![]() Posts: 208/237 EXP: 129099 Next: 2239 Since: 06-25-20 From: UK Last post: 168 days ago Last view: 1 day ago |
GBATEK seems to have info on this: 0x20 1 Battery flags. When zero the battery is at critical level, arm7 does a shutdown. Bit7 is set when the battery is charging. Battery levels in the low 4-bits: battery icon bars full 0xF, 3 bars 0xB, 2 bars 0x7, one solid red bar 0x3, and one blinking red bar 0x1. When plugging in or removing recharge cord, this value increases/decreases between the real battery level and 0xF, thus the battery level while bit7 is set is useless. ____________________
How to write an emulator
1. throw code to be emulated somewhere 2. make memory system that allows accessing that code 3. emulate CPU 4. have fun implementing all the other hardware -- Arisotura, Tuesday 5th January 2021, 22:00:17 |
Generic aka RSDuck |
| ||
![]() Big fire melon Administrator Level: 43 ![]() Posts: 508/583 EXP: 546775 Next: 18271 Since: 10-12-19 Last post: 38 days ago Last view: 1 day ago |
DSlite specific registers, provided by Gericom:
#pragma once //As far as I know these registers should only exist on a DSLite //On boot, the firmware writes 0xFFFF to REG_REGCNT, locking both //reading and writing of the registers below, and making them //impossible to be used (since REG_REGCNT is write-once) //In order to prevent this flashme can be used. When the direct-boot //keycombo A+B+START+SELECT is held while booting the lock write //will not happen, and as such the registers remain usable //Lockout register for nitro2 features, WRITE-ONLY and WRITE-ONCE!! #define REG_REGCNT (*(vu16*)0x04001080) #define REGCNT_WE0 (1 << 0) //disables writing to REG_DISPCNT2 #define REGCNT_WE1 (1 << 1) //disables writing to REG_DISPSW #define REGCNT_WE2 (1 << 2) //disables writing to REG_CLK11M #define REGCNT_RE0 (1 << 8) //disables reading from REG_DISPCNT2 #define REGCNT_RE1 (1 << 9) //disables reading from REG_DISPSW #define REGCNT_RE2 (1 << 10) //disables reading from REG_CLK11M //Selects dual or single screen mode #define REG_DISPCNT2 (*(vu16*)0x04001090) #define DISPCNT2_MOD_DUAL_SCREEN 0 //default mode with 2 screens #define DISPCNT2_MOD_SINGLE_SCREEN 1 //disables the top screen and enables some special features //Configures single screen mode //Note that main and sub here refer to the main and sub screens as configurable in this register //and NOT the main and sub engines #define REG_DISPSW (*(vu16*)0x040010A0) //Selects the display mode #define DISPSW_WIN_SHIFT 0 #define DISPSW_WIN_MASK (3 << DISPSW_WIN_SHIFT) #define DISPSW_WIN(x) ((x) << DISPSW_WIN_SHIFT) #define DISPSW_WIN_MAIN_ONLY 0 //displays only the main screen #define DISPSW_WIN_MAIN_FULL_SUB 1 //blends the main screen with the sub screen #define DISPSW_WIN_MAIN_HALF_SUB_BOTTOM_LEFT 2 //displays the sub screen at 128x96 in the bottom-left corner with optional blending #define DISPSW_WIN_MAIN_HALF_SUB_BOTTOM_RIGHT 3 //displays the sub screen at 128x96 in the bottom-right corner with optional blending #define DISPSW_A_SHIFT 4 #define DISPSW_A_MASK (3 << DISPSW_A_SHIFT) #define DISPSW_A(x) ((x) << DISPSW_A_SHIFT) //Blending for DISPSW_WIN_MAIN_FULL_SUB mode #define DISPSW_A_FULL_7_1 0 //main 7/8, sub 1/8 #define DISPSW_A_FULL_6_2 1 //main 6/8, sub 2/8 #define DISPSW_A_FULL_5_3 2 //main 5/8, sub 3/8 #define DISPSW_A_FULL_4_4 3 //main 4/8, sub 4/8 //Blending for DISPSW_WIN_MAIN_HALF_SUB modes #define DISPSW_A_HALF_3_1 0 //main 3/4, sub 1/4 #define DISPSW_A_HALF_2_2 1 //main 2/4, sub 2/4 #define DISPSW_A_HALF_1_3 2 //main 1/4, sub 3/4 #define DISPSW_A_HALF_0_4 3 //main 0/4, sub 4/4 //select the screen to output on tv when tv-out is on #define DISPSW_M0_SHIFT 8 #define DISPSW_M0_MASK (1 << DISPSW_M0_SHIFT) #define DISPSW_M0(x) ((x) << DISPSW_M0_SHIFT) #define DISPSW_M0_TV_SUB 0 //output the sub screen to tv-out #define DISPSW_M0_TV_MAIN 1 //output the main screen to tv-out //select which screens picture is main and which is sub #define DISPSW_M1_SHIFT 9 #define DISPSW_M1_MASK (1 << DISPSW_M1_SHIFT) #define DISPSW_M1(x) ((x) << DISPSW_M1_SHIFT) #define DISPSW_M1_MAIN_BOTTOM_SUB_TOP 0 //main = bottom screen, sub = top screen #define DISPSW_M1_MAIN_TOP_SUB_BOTTOM 1 //main = top screen, sub = bottom screen //tv-out enable/disable #define DISPSW_TVOUT_SHIFT 14 #define DISPSW_TVOUT_MASK (1 << DISPSW_TVOUT_SHIFT) #define DISPSW_TVOUT(x) ((x) << DISPSW_TVOUT_SHIFT) #define DISPSW_TVOUT_DISABLED 0 //disables tv-out, top screen will be white #define DISPSW_TVOUT_ENABLED 1 //enabled tv-out, top screen signals are used to output 10 bit digital NTSC //key input enable/disable //in single screen mode three of the top screen signals are used as button inputs to configure the output //the hardware will change the register values of WIN, A and M01 when the buttons are pressed //this feature can be disabled by setting this bit #define DISPSW_KEYLOCK_SHIFT 15 #define DISPSW_KEYLOCK_MASK (1 << DISPSW_KEYLOCK_SHIFT) #define DISPSW_KEYLOCK(x) ((x) << DISPSW_KEYLOCK_SHIFT) #define DISPSW_KEYLOCK_DISABLED 0 //allow configuring the display mode using the buttons #define DISPSW_KEYLOCK_ENABLED 1 //the buttons will do nothing //Enables/disables outputting an 11MHz clock on the CLK11M pin of the SOC //I believe this signal is not actually connected to anything #define REG_CLK11M (*(vu16*)0x040010B0) #define CLK11M_CK11_LOW 0 #define CLK11M_CK11_ACTIVE 1 ____________________ Take me to your heart / never let me go! "clearly you need to mow more lawns and buy a better pc" - Hydr8gon |
StrikerX3 |
| ||
Newcomer Normal user Level: 2 Posts: 1/1 EXP: 14 Next: 32 Since: 04-22-23 Last post: 218 days ago Last view: 52 days ago |
Recently I've been implementing the ARM9 cache on my NDS emulator and made several tests on real hardware (a 3DS) to figure out how exactly it works, because the ARM manuals are as unhelpful as ever. My emulator fully implements the instruction and data caches (minus the lockdown feature), actually storing and retrieving data from a separate block of memory and having the cache do line fetches and flushes, and partially implements the write buffer -- the FIFO exists, but is drained as soon as anything goes into it. All ROMs I tested seem to run normally, with around 5-40% performance loss depending on the title compared to no cache emulation. The larger losses happen on titles that already ran crazy fast (500+ fps), so they're still very much playable in real time.
Shoutouts to Gericom, Generic, asie and AntonioND on the gbadev Discord, they gave great feedback, suggestions, insights and coding help on this research. So, here are my findings on the ARM9 cache. NDS ARM9 cache inner workingsThe basics
Write buffer
Replacement strategiesNOTE: research is ongoing on this subject. This is a summary of the behavior I observed from collected data. Data was collected from my 3DS with a test program that:
Known facts
Here are a few hypotheses on how the replacement counter(s) might be implemented. Hypothesis 1: one shared counter for both strategies
Hypothesis 2: separate counters for each strategy
Here's the messy code of the test ROM I used if you want to play around. Can be compiled with devkitPro using the Makefile (dkp), or BlocksDS with the regular Makefile + Makefile.include. main.cpp must be in a folder called source. The replacement strategy tests mess with the PU table and assume region 3 is the GBA cart area or the DSi switchable IWRAM; I haven't checked if the PU regions are the same when compiled with dkP, so it might not work. |
Arisotura |
| ||
![]() Big fire melon magical melon girl Level: 55 ![]() Posts: 862/870 EXP: 1266863 Next: 47326 Since: 03-28-17 From: France Last post: 8 days ago Last view: 7 days ago |
PoroCYon |
| ||
![]() Half-eaten melon Normal user Level: 11 ![]() Posts: 23/24 EXP: 4490 Next: 1495 Since: 12-01-19 From: .be Last post: 107 days ago Last view: 104 days ago |
I found some more misc stuff, so:
Second NTR cartridge registersGBATEK is right that there's a second cartridge slot at 0x040021Ax (with its own AUXSPICNT/DAT, ROMCTRL, etc, and data-in at 0x04102010), but this has some consequences that are not always listed:
SCFG
CAM_MCNT (A9)
ConsoleID formatThis one seems to be a die/wafer/lot ID number (which you can also see in eg. MSP430 TLV data), with format (from LSB to MSB):
WIFIWAITCNTbit 7: MCLK disable? |
PoroCYon |
| ||
![]() Half-eaten melon Normal user Level: 11 ![]() Posts: 24/24 EXP: 4490 Next: 1495 Since: 12-01-19 From: .be Last post: 107 days ago Last view: 104 days ago |
Nintendo DSi XL testpoint namesThe testpoints on the regular DSi mobo (CPU-TWL-01) are named, the one on the DSi XL (CPU-UTL-01) aren't. So I went over them all with a continuity tester to figure it out. Took me ~12h spread across 4 days. |
Arisotura |
| ||
![]() Big fire melon magical melon girl Level: 55 ![]() Posts: 867/870 EXP: 1266863 Next: 47326 Since: 03-28-17 From: France Last post: 8 days ago Last view: 7 days ago |
entry 0x67 in firmware user settings
it's the RTC clock adjust value on DSi it is stored at offset 0x88 in HWINFO_N.dat also 2FFFDE8/2FFFDEC aren't specifically the RTC date/time, these addresses are used for RTC IO in general ____________________ Kuribo64 |
AntonioND |
| ||
Newcomer Normal user Level: 1 Posts: 1/1 EXP: 0 Next: 11 Since: 11-29-23 Last post: 6 hours ago Last view: 6 hours ago |
MMIO[82C0h/82C2h+(0..1)*80h] - BTDMP Receive/Transmit FIFO Status (R)
... 4 FIFO Empty (0=No, 1=Empty, 0x16bit words) This is incorrect. The bit is 0 when the FIFO is empty, 1 when it isn't empty. I would need to verify it more, but I've seen that with a couple of quick tests. |
Main - Development - GBAtek addendum/errata | Hide post layouts | New reply |
Page rendered in 0.147 seconds. (2048KB of memory used) MySQL - queries: 28, rows: 93/93, time: 0.024 seconds. ![]() © 2005-2008 Acmlm, Xkeeper, blackhole89 et al. |