Compare commits
	
		
			1 Commits
		
	
	
		
			39eb82596b
			...
			hello_worl
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| c20aa2e0b9 | 
							
								
								
									
										10
									
								
								build_rom.sh
									
									
									
									
									
										Executable file
									
								
							
							
						
						
									
										10
									
								
								build_rom.sh
									
									
									
									
									
										Executable file
									
								
							| @@ -0,0 +1,10 @@ | ||||
| #! /usr/bin/env bash | ||||
|  | ||||
| set -e | ||||
|  | ||||
| padbin 32 build/gba-release/src/player/nostalgia.bin | ||||
| echo NOSTALGIA_MEDIA_HEADER_________ > media_header.txt | ||||
| oxfs format 32 1m nostalgia_media.oxfs | ||||
| ./build/current/src/tools/nost-pack -fs nostalgia_media.oxfs -img charset.png -inode 1 -c | ||||
| cat build/gba-release/src/player/nostalgia.bin media_header.txt nostalgia_media.oxfs > nostalgia.gba | ||||
| gbafix nostalgia.gba | ||||
							
								
								
									
										
											BIN
										
									
								
								charset.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								charset.png
									
									
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							| After Width: | Height: | Size: 1.2 KiB | 
							
								
								
									
										1
									
								
								media_header.txt
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										1
									
								
								media_header.txt
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1 @@ | ||||
| NOSTALGIA_MEDIA_HEADER_________ | ||||
| @@ -11,6 +11,7 @@ | ||||
| #include "addresses.hpp" | ||||
| #include "media.hpp" | ||||
| #include "gba.hpp" | ||||
| #include "../gfx.hpp" | ||||
|  | ||||
| namespace nostalgia { | ||||
| namespace core { | ||||
| @@ -20,6 +21,101 @@ using namespace ox::fs; | ||||
| #define TILE_ADDR  ((CharBlock*) 0x06000000) | ||||
| #define TILE8_ADDR ((CharBlock8*) 0x06000000) | ||||
|  | ||||
| // map ASCII values to the nostalgia charset | ||||
| static char charMap[128] = { | ||||
| 	0, | ||||
| 	0, | ||||
| 	0, | ||||
| 	0, | ||||
| 	0, | ||||
| 	0, | ||||
| 	0, | ||||
| 	0, | ||||
| 	0, | ||||
| 	0, | ||||
| 	0, | ||||
| 	0, | ||||
| 	0, | ||||
| 	0, | ||||
| 	0, | ||||
| 	0, | ||||
| 	0, | ||||
| 	0, | ||||
| 	0, | ||||
| 	0, | ||||
| 	0, | ||||
| 	0, | ||||
| 	0, | ||||
| 	0, | ||||
| 	0, | ||||
| 	0, | ||||
| 	0, | ||||
| 	0, | ||||
| 	0, | ||||
| 	0, | ||||
| 	0, | ||||
| 	0, | ||||
| 	0, | ||||
| 	38, // ! | ||||
| 	0, | ||||
| 	0, | ||||
| 	0, | ||||
| 	0, | ||||
| 	0, | ||||
| 	0, | ||||
| 	0, | ||||
| 	0, | ||||
| 	0, | ||||
| 	0, | ||||
| 	37, // , | ||||
| 	0, | ||||
| 	0, | ||||
| 	0, | ||||
| 	0, | ||||
| 	0, | ||||
| 	0, | ||||
| 	0, | ||||
| 	0, | ||||
| 	0, | ||||
| 	0, | ||||
| 	0, | ||||
| 	0, | ||||
| 	0, | ||||
| 	0, | ||||
| 	0, | ||||
| 	0, | ||||
| 	0, | ||||
| 	0, | ||||
| 	0, | ||||
| 	0, | ||||
| 	1,  // A | ||||
| 	2,  // B | ||||
| 	3,  // C | ||||
| 	4,  // D | ||||
| 	5,  // E | ||||
| 	6,  // F | ||||
| 	7,  // G | ||||
| 	8,  // H | ||||
| 	9,  // I | ||||
| 	10, // J | ||||
| 	11, // K | ||||
| 	12, // L | ||||
| 	13, // M | ||||
| 	14, // N | ||||
| 	15, // O | ||||
| 	16, // P | ||||
| 	17, // Q | ||||
| 	18, // R | ||||
| 	19, // S | ||||
| 	20, // T | ||||
| 	21, // U | ||||
| 	22, // V | ||||
| 	23, // W | ||||
| 	24, // X | ||||
| 	25, // Y | ||||
| 	26, // Z | ||||
| }; | ||||
|  | ||||
| ox::Error initGfx() { | ||||
| 	/* Sprite Mode ----\ */ | ||||
| 	/*             ---\| */ | ||||
| @@ -33,15 +129,20 @@ ox::Error initGfx() { | ||||
| 	REG_BG0CNT |= (1 << 7); // set to use 8 bits per pixel | ||||
| 	if (fs) { | ||||
| 		FileStore32::FsSize_t readSize = 0; | ||||
| 		fs->read(1, 511, 8 * 64 * 36, &TILE8_ADDR[0][1], nullptr); | ||||
| 		fs->read(1, 512, 8 * 64 * 36, &TILE8_ADDR[0][1], nullptr); | ||||
| 		fs->read(1, 0, 512, &MEM_PALLETE_BG[0], &readSize); | ||||
| 	} | ||||
|  | ||||
| 	MEM_BG_MAP[28][106] = 1; | ||||
| 	MEM_BG_MAP[28][107] = 1; | ||||
| 	puts(296, "HELLO, WORLD!"); | ||||
|  | ||||
| 	return 0; | ||||
| } | ||||
|  | ||||
| void puts(int loc, const char *str) { | ||||
| 	for (int i = 0; str[i]; i++) { | ||||
| 		MEM_BG_MAP[28][loc + i] = charMap[(int) str[i]]; | ||||
| 	} | ||||
| } | ||||
|  | ||||
| } | ||||
| } | ||||
|   | ||||
| @@ -14,5 +14,7 @@ namespace core { | ||||
|  | ||||
| ox::Error initGfx(); | ||||
|  | ||||
| void puts(int loc, const char *str); | ||||
|  | ||||
| } | ||||
| } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user