Created
January 8, 2025 05:11
-
-
Save bricklife/0e9bfd957bce41d3fc07c1b60497c55e to your computer and use it in GitHub Desktop.
GBA div test
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int main() { | |
*(unsigned long*) 0x4000000 = 0x403; | |
unsigned short* vram = (unsigned short*) 0x6000000; | |
for(int x = 0; x < 240; x++) { | |
for(int y = 0; y < 160; y++) { | |
vram[x + y * 240] = (x * 100) / (y + 1); | |
} | |
} | |
while(1) {}; | |
return 1; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@main | |
struct GameMain { | |
static func main() { | |
let REG_DISPCNT = UnsafeMutablePointer<UInt16>(bitPattern: 0x04000000)! | |
REG_DISPCNT.pointee = 0x403 | |
let vram = UnsafeMutablePointer<UInt16>(bitPattern: 0x06000000)! | |
for x in 0..<240 { | |
for y in 0..<160 { | |
vram[x + y * 240] = UInt16((x * 100) / (y + 1)) | |
} | |
} | |
while true {} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment