Skip to content

Commit

Permalink
== N64 ==
Browse files Browse the repository at this point in the history
- Added vertical Scroll
  • Loading branch information
ArtemioUrbina committed Jul 31, 2024
1 parent 9c7e434 commit 41cb9b8
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 23 deletions.
1 change: 1 addition & 0 deletions 240psuite/N64/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ filesystem/sonicTop.sprite: MKSPRITE_FLAGS=--format CI4
filesystem/sonicWater.sprite: MKSPRITE_FLAGS=--format CI4
filesystem/sonicFall.sprite: MKSPRITE_FLAGS=--format CI4
filesystem/sonicFloor.sprite: MKSPRITE_FLAGS=--format CI4
filesystem/kiki.sprite: MKSPRITE_FLAGS=--format CI4
filesystem/shadow.sprite: MKSPRITE_FLAGS=--format CI4
filesystem/buzz.sprite: MKSPRITE_FLAGS=--format CI4
filesystem/buzzshadow.sprite: MKSPRITE_FLAGS=--format CI4
Expand Down
Binary file added 240psuite/N64/assets/kiki.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions 240psuite/N64/filesystem/help/scroll.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ Hedgehog#Y or a single one from

The speed can be varied with the
d-pad, and direction changed with
button #GX#G.
button #GCL#G.

Vertical and horizntal patterns
can be swapped with the #GY#G button,
Vertical and horizontal scrolls
can be swapped with the #GCR#G button,
and #GA#G stops the scroll.

This can be used to notice any
Expand Down
45 changes: 25 additions & 20 deletions 240psuite/N64/tests.c
Original file line number Diff line number Diff line change
Expand Up @@ -265,33 +265,35 @@ void drawScroll() {
int end = 0, x = 0, y = 0, currentframe = 0;
int frameLen[] = { 8, 8, 8 }, animFrame = 0, fallFrame = 0;
image *sonicTop = NULL, *sonicWater = NULL, *sonicFall = NULL;
image *overlay = NULL;
image *overlay = NULL, *kiki = NULL;
joypad_buttons_t keys;

sonicTop = loadImage("rom:/sonicTop.sprite");
sonicWater = loadImage("rom:/sonicWater.sprite");
sonicFall = loadImage("rom:/sonicFall.sprite");
overlay = loadImage("rom:/sonicFloor.sprite");

/*
if(sonicTop)
sonicTop->scale = 0;
if(sonicWater)
sonicWater->scale = 0;
if(sonicFall)
sonicFall->scale = 0;
if(overlay)
overlay->scale = 0;
*/

kiki = loadImage("rom:/kiki.sprite");

while(!end) {
getDisplay();

rdpqStart();
drawSonicBG(x, y, sonicTop, sonicWater, sonicFall);
drawSonicFG(x, y, overlay);
if(!vertical) {
drawSonicBG(x, y, sonicTop, sonicWater, sonicFall);
drawSonicFG(x, y, overlay);
}
else {
if(y > 0)
rdpqDrawImageXY(kiki, (dW-256)/2, y-512);
rdpqDrawImageXY(kiki, (dW-256)/2, y);
if(y <= -272)
rdpqDrawImageXY(kiki, (dW-256)/2, 512+y);
}
rdpqEnd();

char str[50];
sprintf(str, "x: %03d\ny: %03d", x, y);
drawStringS(20, 20, 0xff, 0xff, 0xff, str);
checkMenu(SCROLLHELP, NULL);
waitVsync();

Expand All @@ -313,8 +315,10 @@ void drawScroll() {
if(keys.c_left)
acc *= -1;

if(keys.c_right)
if(keys.c_right) {
vertical = !vertical;
setClearScreen();
}

if(speed > 16)
speed = 16;
Expand All @@ -336,10 +340,10 @@ void drawScroll() {
if(x > 128)
x = -128 + speed;

if(y < -7)
y = 0;
if(y > 7)
y = 0;
if(y >= 512)
y = 0 + speed;
if(y <= -512)
y = 0 - speed;

if(!vertical) {
currentframe ++;
Expand All @@ -362,6 +366,7 @@ void drawScroll() {
freeImage(&sonicWater);
freeImage(&sonicFall);
freeImage(&overlay);
freeImage(&kiki);
}

void drawStripes() {
Expand Down

0 comments on commit 41cb9b8

Please sign in to comment.