polyrhythm!

This commit is contained in:
Shaffy 2022-11-01 10:11:15 +01:00
parent 7ef07a7ec9
commit 49b1a99b74
25 changed files with 5185 additions and 22 deletions

2
.gitignore vendored
View File

@ -1,3 +1,5 @@
# Unneeded
*_oameditor.bin
# GBA Rom
*.gba
# GBA save

View File

@ -0,0 +1,108 @@
#include <iostream>
#include "bitmap.h"
void printInstructions() {
std::cout << "R-IQ Tile Fixer.exe -[a][d] input.BMP output.BMP tile.BIN\n\n";
std::cout << "-a: Assembles input into output using the tile arrangement.\n"; //From scramble to original.
std::cout << "-d: Dissasemble input into a output tilemap using the tile arrangement.\n\n"; //From original to scramble.
std::cout << "input and ouput MUST be a 24-bit bitmap.\nAnd tile must be a memory dump of address 0x600E800 of (atleast) size 1276 bytes.\n\n(C)Shaffy - 2022.\n";
}
int main(int argc, char* argv[])
{
if (argc < 5) {
printInstructions();
return 1;
}
if (argv[1][0] != '-') {
printInstructions();
return 1;
}
const char* inputString = argv[2];
const char* outputString = argv[3];
const char* tileString = argv[4];
std::fstream file("polyrhythm.bin", std::ios::in | std::ios::binary);
if (argv[1][1] == 'a') {
bitmap_image image(inputString);
bitmap_image image_fix(240, 160);
std::fstream file(tileString, std::ios::in | std::ios::binary);
std::cout << "Loaded! width: " << image.width() << " height: " << image.height() << std::endl;
for (unsigned int j = 0; j < 20; j++) {
for (unsigned int i = 0; i < 30; i++) {
char bytes[2];
file.read(bytes, 2);
unsigned short tileNumber = (((unsigned char)bytes[1] << 8) | ((unsigned char)bytes[0]));
int tileColumn = tileNumber / 30;
int tileRow = tileNumber % 30;
//std::cout << "Tile no." << std::dec << (int)tileNumber << " in tex coords (" << tileRow * 8 << ';' << tileColumn * 8 << ") at img pos (" << i * 8 << ';' << j * 8 << ")";
//std::cout << " - VRAM: 0x" << std::hex << 0x0600E800 + (((j * 30) + i) * 2) << std::endl;
for (unsigned int a = 0; a < 8; a++) { //x
for (unsigned int b = 0; b < 8; b++) { //y
rgb_t pixel = image.get_pixel((tileRow * 8) + a, (tileColumn * 8) + b);
image_fix.set_pixel((i * 8) + a, (j * 8) + b, pixel);
}
}
}
file.seekp(4, file.cur);
}
file.close();
image_fix.save_image(outputString);
}
else if (argv[1][1] == 'd') {
bitmap_image image(inputString);
bitmap_image image_fix(240, 824); //Make it big enough...
std::fstream file(tileString, std::ios::in | std::ios::binary);
std::cout << "Loaded! width: " << image.width() << " height: " << image.height() << std::endl;
for (unsigned int j = 0; j < 20; j++) {
for (unsigned int i = 0; i < 30; i++) {
char bytes[2];
file.read(bytes, 2);
unsigned short tileNumber = (((unsigned char)bytes[1] << 8) | ((unsigned char)bytes[0]));
int tileColumn = tileNumber / 30;
int tileRow = tileNumber % 30;
//std::cout << "Tile no." << std::dec << (int)tileNumber << " in tex coords (" << tileRow * 8 << ';' << tileColumn * 8 << ") at img pos (" << i * 8 << ';' << j * 8 << ")";
//std::cout << " - VRAM: 0x" << std::hex << 0x0600E800 + (((j * 30) + i) * 2) << std::endl;
for (unsigned int a = 0; a < 8; a++) { //x
for (unsigned int b = 0; b < 8; b++) { //y
rgb_t pixel = image.get_pixel((i * 8) + a, (j * 8) + b);
image_fix.set_pixel((tileRow * 8) + a, (tileColumn * 8) + b, pixel);
}
}
}
file.seekp(4, file.cur);
}
file.close();
image_fix.save_image(outputString);
}
else {
printInstructions();
return 1;
}
std::cout << "Done!" << std::endl;
return 0;
}

File diff suppressed because it is too large Load Diff

View File

@ -7,6 +7,7 @@ However from what I remember:
- nmap: Texture extractor(?)
- RhythmHeavenOAMEditor: It's in the name.
- crystaltile2: GFX editor.
- R-IQ Tile Fixer: Reassemble BG from their tile arrangement and vice-versa.
The IPS adds probably some obscure binhacks for some emulator (vba?) to log the location of the sprite.
And the Lua script probably is the thing that works with it.

File diff suppressed because one or more lines are too long

View File

@ -1,12 +1,3 @@
# Notice
**I am not fully working on this project anymore**, I don't know if anyone will continue/continued it...
I am just finalizing what I feel like I should of did years ago...<br>
The only thing I am willing to contribute to this after that are bug fixes, so please do not ask for support about this, I will not answer, and go instead ask more people and/or fork it on your own.<br>
*Also, please take note that the release b13 and state of the old source code might be broken.*
# Rhythm Heaven Silver
![Rhythm Heaven Silver](media/rhs.png?raw=true "Rhythm Heaven Silver")

View File

@ -0,0 +1,21 @@
Hands down the stupidest one yet, the intro2.bin is easy since it is just a sprite, with an OAM so even if it was
scrambled it was fine.
But the intro1.bin is completely scrambled, and it is loaded as a background, which left me with two choices:
- Recompile the background by hand (600 tiles!!!)
- Figure out how the game reassamble the background and make a program to do it for me.
Of course I choosed option 2;
By checking the pointer to the sprite (C0212C -> 2C21C008), we can see that C0212C gets
loaded into the VRAM (0x6000000), and some other pointer gets loaded into 0x600E800, which made me assume, it was
that arrangement, however the pointer in the ROM didn't really point to anything useful.
But loading the Polyrhythm title card inside the memory editor at that memory space, made me realize it was
infact the arrangement being loaded there, editing it showed me it was 4 bytes for one tile left to right,
up to down.
So what I've done is include two C++ source file for you to compile if you wanna try to change the graphics.
(The source is pretty easy to understand)
- Shaffy

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -14922,11 +14922,45 @@ In conclusion, thanks for playing the game. It's[l
no fun making something that nobody else[l
cares about. Enjoy![l
[l
- the Rhythm Heaven Silver Team[l
[l
Oh, is it my turn to write a message like that?[l
Hello, my name's Shaffy![l
I maintain this patch nowadays...[l
Everything you've read (or not) at the top[l
is not true anymore, but I am keeping this up[l
for archive.[l
[l
I don't translate much but I try to rewrite the[l
script, and translate the few GFX left.[l
But if this translation has English SFX[l
in the future then thanks me[l
(or... not...), because I am[l
actively working on that.[l
[l
Working on this patch alone, I can definitely[l
say if the team before me didn't do[l
80% of the work, we really wouldn't be there![l
[l
I also would like to thanks everyone[l
who supported the patch so far, everyone[l
who talked about it, etc...[l
[l
Anyway, I hope you enjoy it,[l
and keep supporting Rhythm Heaven![l
[l
[color=gray]- Shaffy[l
[l
[l
[l
[l
[l
Patch update:[l
//New format
[color=0(normal)]https://twitter.com/rh0updates/[l
(^ Not updated anymore(?))[l
[color=0(normal)]https://twitter.com/ShaffySwitcher/[l
[color=0(normal)]https://github.com/ShaffySwitcher/[l
[color=gray]beta 14: 2022-10-28[;
Version: [color=gray]beta 14: 2022-10-28[;
#WRITE(RtPtr, $9D7E74)
// 0x8058ee8
//リズム天国へようこそ![;