Changes

Jump to navigation Jump to search
1,440 bytes added ,  23:13, 25 November 2021
Add and update some newly researched PDC regs
Line 186: Line 186:  
| Window Y start (LgyFb)
 
| Window Y start (LgyFb)
 
| Offsets the viewing window on the display's physical Y co-ordinate relative to the first visible scanline.
 
| Offsets the viewing window on the display's physical Y co-ordinate relative to the first visible scanline.
 +
|-
 +
| 0x1C
 +
| H Interrupt timing
 +
| Made up from two u16 values, PDC interrupt line is asserted when HCount == low u16, and most likely deasserted when HCount == high u16.
 +
 +
There seems to be some limitations though:
 +
* low u16 must be smaller than high u16
 +
* if low u16 is less than HTotal then high u16 must also be smaller than HTotal
 +
* setting low u16 to >= HTotal disables the interrupt ever firing
 +
 +
This is configured by gsp in a way so that low u16 equals to HTotal, meaning the HSync interrupt will never fire.
 
|-
 
|-
 
| 0x20
 
| 0x20
Line 223: Line 234:  
| Vertical data offset(?)
 
| Vertical data offset(?)
 
| ??? Seems to offset the screen upwards if this value is high enough. If this value is higher or equal to *some value* (aka. if less than one scanline is displayed on the screen) then the screen will lose synchronization.
 
| ??? Seems to offset the screen upwards if this value is high enough. If this value is higher or equal to *some value* (aka. if less than one scanline is displayed on the screen) then the screen will lose synchronization.
 +
|-
 +
| 0x40
 +
| V Interrupt timing
 +
| Similar to H Interrupt timing (0x1C), except the comparison is done against VCount, the limitations are emposed on VTotal, and the interrupt that fires is VSync.
 +
 +
One important note is that it seems like the VSync interrupt always fires at HCount == 0, and there doesn't seem to be a register to control this behavior.
 
|-
 
|-
 
| 0x44
 
| 0x44
Line 237: Line 254:  
|-
 
|-
 
| 0x50
 
| 0x50
| Horizontal position counter
+
| HCount
| read-only
+
| Horizontal "beam position" counter. Note that this value does not equal to the current pixel being drawn.
 
|-
 
|-
 
| 0x54
 
| 0x54
| Horizontal scanline (HBlank) counter
+
| VCount
| read-only
+
| Vertical "beam position" counter. Note that the scanline being drawn isn't equal to this value.
 
|-
 
|-
 
| 0x5C
 
| 0x5C
Line 274: Line 291:  
| PDC control
 
| PDC control
 
| Bit 0: Enable display controller.
 
| Bit 0: Enable display controller.
Bit 8: H(Blank?) IRQ mask (0 = enabled).
+
Bit 8: HBlank IRQ mask (0 = enabled).
 
Bit 9: VBlank IRQ mask (0 = enabled).
 
Bit 9: VBlank IRQ mask (0 = enabled).
 
Bit 10: Error IRQ mask? (0 = enabled).
 
Bit 10: Error IRQ mask? (0 = enabled).
Line 300: Line 317:  
| Framebuffer stride
 
| Framebuffer stride
 
| Distance in bytes between the start of two framebuffer rows (must be a multiple of 8).
 
| Distance in bytes between the start of two framebuffer rows (must be a multiple of 8).
 +
 +
In other words, this can be interpreted as the amount to add to the framebuffer pointer after displaying a scanline.
 +
 +
Setting this to zero will cause only the first line of the image to be displayed repeated on the entire display. With the HSync interrupt it's possible to "race the beam" to (ab)use this feature.
 +
 +
Because of this simplicity, writing a negative value here VFlips the image (which appears as a HFlip if the 3DS is held properly)
 
|-
 
|-
 
| 0x94
 
| 0x94
215

edits

Navigation menu