Skip to content

Commit

Permalink
- Blinking added
Browse files Browse the repository at this point in the history
  • Loading branch information
ArtemioUrbina committed May 7, 2024
1 parent 53ae4e8 commit 70734ba
Show file tree
Hide file tree
Showing 9 changed files with 66 additions and 6 deletions.
11 changes: 8 additions & 3 deletions 240psuite/PCE/240pSuite.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,9 @@ void main()
sel = 0;
redraw = 1;
refresh = 1;

#ifndef SYSCARD1
blinkCount = 0;
#endif

#ifndef CDROM
xres_flags = XRES_SOFT;
Expand Down Expand Up @@ -94,8 +96,9 @@ void main()
#ifdef CDPLAYER
cd_reset();
#endif
while(1)
{
while(1)
{
checkblink();
vsync();

#ifdef CDROM
Expand Down Expand Up @@ -304,6 +307,7 @@ void VideoTests()
disp_off();
while(!end)
{
checkblink();
vsync();

#ifdef CDROM
Expand Down Expand Up @@ -506,6 +510,7 @@ void AudioTests()
disp_off();
while(!end)
{
checkblink();
vsync();

#ifdef CDROM
Expand Down
2 changes: 2 additions & 0 deletions 240psuite/PCE/graphics.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ extern char MB_map[];
extern int MB_bg[];

extern int SD_sp[];
extern int SDb1_sp[];
extern int SDb2_sp[];
extern int bee_sp[];
extern int shadow_sp[];
extern int striped_sp[];
Expand Down
Binary file added 240psuite/PCE/graphics/SD_b1.pcx
Binary file not shown.
Binary file added 240psuite/PCE/graphics/SD_b2.pcx
Binary file not shown.
3 changes: 2 additions & 1 deletion 240psuite/PCE/patterns.c
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,8 @@ void main()

disp_off();
while(!end)
{
{
checkblink();
vsync();

#ifdef SYSCARD1
Expand Down
2 changes: 2 additions & 0 deletions 240psuite/PCE/res.h
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,8 @@


#incspr(SD_sp, "graphics/SD.pcx", 0, 0, 4, 7);
#incspr(SDb1_sp, "graphics/SD_b1.pcx", 0, 0, 2, 1);
#incspr(SDb2_sp, "graphics/SD_b2.pcx", 0, 0, 2, 1);

#incspr(palm_sp, "graphics/sonicpalm.pcx", 0, 0, 5, 7);

Expand Down
3 changes: 2 additions & 1 deletion 240psuite/PCE/tests_sound.c
Original file line number Diff line number Diff line change
Expand Up @@ -975,7 +975,8 @@ void HardwareTests()

disp_off();
while(!end)
{
{
checkblink();
vsync();

#ifdef SYSCARD1
Expand Down
47 changes: 46 additions & 1 deletion 240psuite/PCE/tools.c
Original file line number Diff line number Diff line change
Expand Up @@ -138,12 +138,14 @@ void DrawSP()
}

#define SP_VRAM 0x4000
#define SP_SIZE 0x700
// 0x700 are 0x40 (64) tiles

void LoadSPVRAM()
{
load_palette(17, SD_pal, 1);
#ifndef SYSCARD1
load_vram(SP_VRAM, SD_sp, 0x700);
load_vram(SP_VRAM, SD_sp, SP_SIZE);
#else
cd_loadvram(GPHX_OVERLAY, OFS_SD_tile_bin, SP_VRAM, SIZE_SD_tile_bin);
#endif
Expand All @@ -167,6 +169,49 @@ void DrawSPX2Y2()
}
}

#ifndef SYSCARD1
void LoadSPBlink0()
{
load_vram(SP_VRAM+0x240, SD_sp+0x240, 0x80);
}

void LoadSPBlink1()
{
load_vram(SP_VRAM+0x240, SDb1_sp, 0x80);
}

void LoadSPBlink2()
{
load_vram(SP_VRAM+0x240, SDb2_sp, 0x80);
}

int blinkCount;

#define BLINK_T1 230
#define BLINK_T2 232
#define BLINK_T3 234
#define BLINK_T4 236

#endif

void checkblink()
{
#ifndef SYSCARD1
blinkCount ++;
if(blinkCount == BLINK_T1)
LoadSPBlink1();
if(blinkCount == BLINK_T2)
LoadSPBlink2();
if(blinkCount == BLINK_T3)
LoadSPBlink1();
if(blinkCount == BLINK_T4)
{
LoadSPBlink0();
blinkCount = 0;
}
#endif
}

#endif

unsigned char region;
Expand Down
4 changes: 4 additions & 0 deletions 240psuite/PCE/video.h
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,10 @@ extern int colswap;
extern unsigned char *mem;
extern int runmdf;

#ifndef SYSCARD1
extern int blinkCount;
#endif

void Set256H();
void Set320H();
void Set352H();
Expand Down

0 comments on commit 70734ba

Please sign in to comment.