Version 4.6a with the new ability to shift/pan the screen up/down using the X/Y buttons. This allows for 16 extra pixels to be shifted into view for games that utilize a significant number of extra scanlines.

This commit is contained in:
Dave Bernazzani 2024-05-07 07:27:38 -04:00
parent 7a5fdc4db2
commit 8fe0219f2c
3 changed files with 22 additions and 5 deletions

Binary file not shown.

View file

@ -1,4 +1,4 @@
VERSION=4.6
VERSION=4.6a
TARGNAME=A7800DS
#---------------------------------------------------------------------------------

View file

@ -173,12 +173,15 @@ void FadeToColor(unsigned char ucSens, unsigned short ucBG, unsigned char ucScr,
#define tchepres(a) \
keyboard_data[GameConf.DS_Pad[a]] = 1;
int16_t temp_shift __attribute__((section(".dtcm"))) = 0;
uint8_t shiftTime = 0;
ITCM_CODE void vblankIntr()
{
if (bRefreshXY)
if (bRefreshXY || temp_shift)
{
cxBG = (myCartInfo.xOffset << 8);
cyBG = (myCartInfo.yOffset << 8);
cyBG = (myCartInfo.yOffset + temp_shift) << 8;
xdxBG = ((320 / myCartInfo.xScale) << 8) | (320 % myCartInfo.xScale) ;
ydyBG = ((video_height / myCartInfo.yScale) << 8) | (video_height % myCartInfo.yScale);
@ -193,6 +196,20 @@ ITCM_CODE void vblankIntr()
REG_BG3PD = ydyBG;
bRefreshXY = false;
if (temp_shift)
{
++shiftTime;
if (shiftTime > 40)
{
if (temp_shift < 0) temp_shift++; else temp_shift--;
if (temp_shift == 0)
{
shiftTime = 0;
bRefreshXY = 1; // Force the next vBlank interrupt to put screen right
}
}
}
}
}
@ -1084,8 +1101,8 @@ ITCM_CODE void dsMainLoop(void)
{
if ( (keys_pressed & KEY_A) ) { tchepres(4); snes_adaptor &= 0xFEFF;} // BUTTON #1
if ( (keys_pressed & KEY_B) ) { tchepres(5); snes_adaptor &= 0xFFFE;} // BUTTON #2
if ( (keys_pressed & KEY_Y) ) { tchepres(4); snes_adaptor &= 0xFFFD;} // BUTTON #1
if ( (keys_pressed & KEY_X) ) { tchepres(5); snes_adaptor &= 0xFDFF;} // BUTTON #2
if ( (keys_pressed & KEY_Y) ) { temp_shift = 16;} // Shift Screen Down
if ( (keys_pressed & KEY_X) ) { temp_shift = -16;} // Shift Screen Up
}
if ((keys_pressed & KEY_R) || (keys_pressed & KEY_L))