aboutsummaryrefslogtreecommitdiffstats
path: root/music/pokeredwavptnvis
diff options
context:
space:
mode:
authoriimarckus <iimarckus@gmail.com>2013-10-13 23:35:43 -0700
committeriimarckus <iimarckus@gmail.com>2013-10-13 23:35:43 -0700
commitad402f12435ab661aa9b745a79d419fcae9340fc (patch)
tree5a410d83d4180cb4179ac03b3ccd00bd1a89de1c /music/pokeredwavptnvis
parentFix CheckIfInOutsideMap comments. (diff)
parentAdd song alternate start labels (diff)
downloadpokeyellow-ad402f12435ab661aa9b745a79d419fcae9340fc.tar.gz
pokeyellow-ad402f12435ab661aa9b745a79d419fcae9340fc.tar.xz
pokeyellow-ad402f12435ab661aa9b745a79d419fcae9340fc.zip
Merge pull request #11 from dannye/music
Music
Diffstat (limited to 'music/pokeredwavptnvis')
-rw-r--r--music/pokeredwavptnvis/Console.cpp54
-rw-r--r--music/pokeredwavptnvis/Console.h29
-rw-r--r--music/pokeredwavptnvis/Makefile18
-rw-r--r--music/pokeredwavptnvis/README.txt17
-rw-r--r--music/pokeredwavptnvis/main.cpp156
5 files changed, 0 insertions, 274 deletions
diff --git a/music/pokeredwavptnvis/Console.cpp b/music/pokeredwavptnvis/Console.cpp
deleted file mode 100644
index 9bac7b1f..00000000
--- a/music/pokeredwavptnvis/Console.cpp
+++ /dev/null
@@ -1,54 +0,0 @@
-#include "Console.h"
-
-using namespace std;
-
-// Basic
-void Console::Get(char* value)
-{
- cin >> value;
-}
-void Console::Get(string& value)
-{
- cin >> value;
-}
-void Console::Print(const char* value)
-{
- cout << value;
-}
-void Console::Error(const char* value)
-{
- cerr << value;
-}
-
-// Upper-Basic
-void Console::PrintLn(const char* value)
-{
- Print(value);
- cout << endl;
-}
-void Console::ErrorLn(const char* value)
-{
- Error(value);
- cerr << endl;
-}
-
-// Higher
-void Console::Ask(const char* question, char* answer)
-{
- Print(question);
- Get(answer);
-}
-void Console::Ask(const char* question, string& answer)
-{
- Print(question);
- Get(answer);
-}
-
-// Better Error Handling
-int Console::atoi_ex(const char* input, bool supress)
-{
- //int convInp = atoi(input);
- //if((supress == false) && (convInp == 0))
- // PrintLn("Warning: the converted integer input is 0, this may not be what you intended");
- // return convInp;
-}
diff --git a/music/pokeredwavptnvis/Console.h b/music/pokeredwavptnvis/Console.h
deleted file mode 100644
index c6fe1833..00000000
--- a/music/pokeredwavptnvis/Console.h
+++ /dev/null
@@ -1,29 +0,0 @@
-#ifndef CONSOLE_H
-#define CONSOLE_H
-
-#include <iostream>
-#include <string>
-
-// Just a Console Utility Library
-class Console
-{
-public:
- // Basic
- static void Get(char* value);
- static void Get(std::string& value);
- static void Print(const char* value);
- static void Error(const char* value);
-
- // Upper-Basic
- static void PrintLn(const char* value);
- static void ErrorLn(const char* value);
-
- // Higher
- static void Ask(const char* question, char* answer);
- static void Ask(const char* question, std::string& answer);
-
- // Better Error Handling
- static int atoi_ex(const char* input, bool supress = false);
-};
-
-#endif // CONSOLE_H
diff --git a/music/pokeredwavptnvis/Makefile b/music/pokeredwavptnvis/Makefile
deleted file mode 100644
index 2b211675..00000000
--- a/music/pokeredwavptnvis/Makefile
+++ /dev/null
@@ -1,18 +0,0 @@
-
-OBJECTS = Console.o main.o
-
-CC = g++
-CFLAGS = -std=c++0x
-
-pokeredwavptnvis: $(OBJECTS)
- $(CC) $(CFLAGS) $(OBJECTS) -o "../../extras/pokeredwavptnvis.exe"
-
-Console.o: Console.h
- $(CC) $(CFLAGS) -c Console.cpp
-
-main.o: main.cpp Console.h
- $(CC) $(CFLAGS) -c main.cpp Console.cpp
-
-clean:
- rm *.o
- rm ../../extras/pokeredwavptnvis.exe
diff --git a/music/pokeredwavptnvis/README.txt b/music/pokeredwavptnvis/README.txt
deleted file mode 100644
index dff29542..00000000
--- a/music/pokeredwavptnvis/README.txt
+++ /dev/null
@@ -1,17 +0,0 @@
-to compile you must have g++ installed
-type: make
-and it will install to the extras folder
-
-if you want to unmake
-type: make clean
-and it will remove make objects and the executable
-
-the program usage is: pokeredwavptnvis [<offset> [<file> | --]
-offset is the rom offset in hexidecimal (FFFF or 0xFFFF)
-file is the rom file, you can use -- for "../baserom.gbc"
-
-to make things quick and easy you can just enter the hexidecimal offset
-pokeredwavptnvis <offset>
-
-you may enter limited interactive mode by not supplying any arguments
-pokeredwavptnvis \ No newline at end of file
diff --git a/music/pokeredwavptnvis/main.cpp b/music/pokeredwavptnvis/main.cpp
deleted file mode 100644
index 035daef5..00000000
--- a/music/pokeredwavptnvis/main.cpp
+++ /dev/null
@@ -1,156 +0,0 @@
-#include <sstream>
-#include <string>
-#include <fstream>
-#include <vector>
-
-#include "Console.h"
-
-using namespace std;
-
-char* rawBytes = 0;
-unsigned int fileLength = 0;
-
-void Read(const char* filename)
-{
- // open File
- fstream tmpFile(filename, ios_base::in | ios_base::binary);
-
- // Get Length
- tmpFile.seekg(0, ios::end);
- fileLength = tmpFile.tellg();
- tmpFile.seekg(0, ios::beg);
-
- // Allocate proper memory
- rawBytes = new char[fileLength];
-
- // Read filedata
- tmpFile.read(rawBytes, fileLength);
- tmpFile.close();
-}
-
-unsigned char GetNibble(unsigned char byte, bool high)
-{
- if(high)
- {
- unsigned char tmp = byte & 0xF0;
- tmp >>= 4;
- return tmp;
- }
- else
- {
- unsigned char tmp = byte & 0x0F;
- return tmp;
- }
-}
-
-// Usage: pokeredwavptnvis [<offset> [<file> | --]]
-// If no parameters or a parameter is missing the program enters limited interactive mode
-int main(int argc, char** argv)
-{
- const unsigned char parameters = 2;
- const unsigned char self = 1;
- const unsigned char _max_argc = parameters + self;
- const string defFileLoc = "../baserom.gbc";
-
- string arg1; // Offset
- string arg2; // File or "--" (if "--" then the file is assumed)
-
- string paramStopAddr;
-
- if(argc >= _max_argc)
- {
- arg1 = argv[1];
- arg2 = argv[2];
- }
- else if(argc == (_max_argc - 1))
- {
- arg1 = argv[1];
- arg2 = defFileLoc;
- }
-
- if(arg1 == "") Console::Ask("What offset in the file in hex: ", arg1);
- if(arg2 == "") Console::Ask("What file: ", arg2);
- if(arg2 == "--") arg2 = defFileLoc; // You can also put "--" for the default file location
-
- stringstream arg1Conv;
- unsigned int arg1ConvNum;
- arg1Conv << arg1;
- arg1Conv << hex;
- arg1Conv >> arg1ConvNum;
-
- Read(arg2.c_str());
- unsigned char* rawBytesFixed = (unsigned char*)rawBytes;
-
- // All the loading is done, create a 32x16 vector
- vector<vector<bool>> image;
- vector<string> lines; // This is the array of output lines
-
- // Initialize the vector image[x][y] and lines
- for(unsigned char i = 0; i < 32; i++)
- {
- image.push_back(vector<bool>());
-
- for(unsigned char j = 0; j < 16; j++)
- {
- image[i].push_back(false);
- lines.push_back("");
- }
- }
-
- unsigned char n1 = 0;
- unsigned char n2 = 0;
-
- vector<unsigned char> expBytes;
- for(unsigned char i = 0; i < 16; i++)
- {
- n1 = GetNibble(rawBytesFixed[arg1ConvNum + i], true);
- n2 = GetNibble(rawBytesFixed[arg1ConvNum + i], false);
-
- expBytes.push_back(n1);
- expBytes.push_back(n2);
- }
-
- // Go through each column in the vector and add a 1 on the appropiate line
- for(unsigned char i = 0; i < 32; i++)
- {
- unsigned char _tmpVal = expBytes[i]; // Here for debugging reasons
- image[i][_tmpVal] = true;
- }
-
- // Now draw the image
- for(unsigned char i = 0; i < 32; i++)
- {
- for(unsigned char j = 0; j < 16; j++)
- {
- if(i == 0)
- {
- if(image[i][j]) lines[j].append("|*");
- else lines[j].append("| ");
- }
- else if((i > 0) && (i < 31))
- {
- if(image[i][j]) lines[j].append(".*");
- else lines[j].append(". ");
- }
- else
- {
- if(image[i][j]) lines[j].append(".*|");
- else lines[j].append(". |");
- }
- }
- }
-
- // Now output the drawn lines (mirrored)
- stringstream tmpCtr;
- Console::PrintLn(" 0 1 2 3 4 5 6 7 8 9 A B C D E F 0 1 2 3 4 5 6 7 8 9 A B C D E F");
- Console::PrintLn(" ---------------------------------------------------------------");
- for(unsigned char i = 0xF; (i >= 0x0) && (i < 0x10); i--)
- {
- tmpCtr << hex << uppercase << (short)i;
- Console::Print(tmpCtr.str().c_str());
- Console::PrintLn(lines[i].c_str());
- tmpCtr.str("");
- }
-
- return 0;
-} \ No newline at end of file