feat: disable unused sprites
This commit is contained in:
parent
4126bd7c9f
commit
17b0a2d97e
|
@ -1,3 +1,4 @@
|
||||||
|
.vscode/
|
||||||
zig-out/
|
zig-out/
|
||||||
zig-cache/
|
zig-cache/
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@ const std = @import("std");
|
||||||
const GBABuilder = @import("lib/ZigGBA/GBA/builder.zig");
|
const GBABuilder = @import("lib/ZigGBA/GBA/builder.zig");
|
||||||
|
|
||||||
pub fn build(b: *std.build.Builder) void {
|
pub fn build(b: *std.build.Builder) void {
|
||||||
const exe = GBABuilder.addGBAExecutable(b, "2d_sprites", "src/2d_sprites.zig");
|
const exe = GBABuilder.addGBAExecutable(b, "sprite2d", "src/sprite2d/main.zig");
|
||||||
exe.emit_asm = if (b.option(bool, "asm", "emit assembly") orelse false) .emit else .default;
|
exe.emit_asm = if (b.option(bool, "asm", "emit assembly") orelse false) .emit else .default;
|
||||||
|
|
||||||
const run_cmd = b.addSystemCommand(&.{"zba"});
|
const run_cmd = b.addSystemCommand(&.{"zba"});
|
||||||
|
|
|
@ -6,6 +6,8 @@ const LCD = @import("gba").LCD;
|
||||||
const OAM = @import("gba").OAM;
|
const OAM = @import("gba").OAM;
|
||||||
const Input = @import("gba").Input;
|
const Input = @import("gba").Input;
|
||||||
|
|
||||||
|
const sprite_mod = @import("sprites.zig");
|
||||||
|
|
||||||
const SquareSpriteTuple = std.meta.Tuple(&[_]type{ Sprite8x8, Sprite16x16, Sprite32x32, Sprite64x64 });
|
const SquareSpriteTuple = std.meta.Tuple(&[_]type{ Sprite8x8, Sprite16x16, Sprite32x32, Sprite64x64 });
|
||||||
const HorizSpriteTuple = std.meta.Tuple(&[_]type{ Sprite16x8, Sprite32x8, Sprite32x16, Sprite64x32 });
|
const HorizSpriteTuple = std.meta.Tuple(&[_]type{ Sprite16x8, Sprite32x8, Sprite32x16, Sprite64x32 });
|
||||||
const VertSpriteTuple = std.meta.Tuple(&[_]type{ Sprite8x16, Sprite8x32, Sprite16x32, Sprite32x64 });
|
const VertSpriteTuple = std.meta.Tuple(&[_]type{ Sprite8x16, Sprite8x32, Sprite16x32, Sprite32x64 });
|
||||||
|
@ -13,65 +15,74 @@ const SpriteTupleTuple = std.meta.Tuple(&[_]type{ SquareSpriteTuple, HorizSprite
|
||||||
const sprites = initSpriteTupleTuple();
|
const sprites = initSpriteTupleTuple();
|
||||||
|
|
||||||
// TODO: ZigGBA should support spaces, slashes, underscores, etc. in ROM Title
|
// TODO: ZigGBA should support spaces, slashes, underscores, etc. in ROM Title
|
||||||
export var gameHeader linksection(".gbaheader") = GBA.Header.setup("2DSPRITE", "PAOD", "00", 0);
|
export var gameHeader linksection(".gbaheader") = GBA.Header.setup("SPRITE", "PAOD", "00", 0);
|
||||||
|
|
||||||
|
const obj_mapping = .TwoDimension;
|
||||||
|
|
||||||
pub fn main() noreturn {
|
pub fn main() noreturn {
|
||||||
LCD.setupDisplayControl(.{
|
LCD.setupDisplayControl(.{
|
||||||
.mode = .Mode0, // No Affine BGs
|
.mode = .Mode0,
|
||||||
.objectLayer = .Show, // Enable Sprites
|
.objectLayer = .Show, // Enable Sprites
|
||||||
.objVramCharacterMapping = .TwoDimension, // 2D Sprite Mapping
|
.objVramCharacterMapping = obj_mapping, // 2D Sprite Mapping
|
||||||
});
|
});
|
||||||
|
|
||||||
OAM.init();
|
// Coppy Sprite Tiles to VRAM and Palette to PALRAM
|
||||||
|
sprites[0][0].load();
|
||||||
|
|
||||||
sprites[0][0].load(); // Copy Mapping to VRAM and Palette to PALRAM
|
// FIXME: There are issues with OAM.Attribute and the ZigGBA API
|
||||||
|
// investigate what these issues are (could it just be my understanding?)
|
||||||
|
const attr_ptr = @intToPtr([*]OAM.Attribute, 0x0700_0000);
|
||||||
|
|
||||||
var sprite: *OAM.Attribute = OAM.allocate();
|
// Attr0 is in the least significant u16
|
||||||
|
const oam_slice = @intToPtr([*]u32, 0x0700_0000)[0 .. 0x400 / @sizeOf(u32)];
|
||||||
|
|
||||||
|
// Set bit 9 on all sprites, therefore disabling them all
|
||||||
|
for (oam_slice) |*attr| attr.* |= 0x0200;
|
||||||
|
|
||||||
|
var sprite = OAM.Attribute{};
|
||||||
sprite.paletteMode = sprites[0][0].paletteMode();
|
sprite.paletteMode = sprites[0][0].paletteMode();
|
||||||
sprite.palette = 0;
|
sprite.palette = 0;
|
||||||
|
sprite.doubleSizeOrVisible = false;
|
||||||
sprite.tileIndex = 0;
|
sprite.tileIndex = 0;
|
||||||
sprite.setSize(sprites[0][0].size());
|
sprite.setSize(sprites[0][0].size());
|
||||||
|
|
||||||
var x: i32 = 96;
|
var x: i32 = 96;
|
||||||
var y: i32 = 32;
|
var y: i32 = 32;
|
||||||
|
|
||||||
var i: i32 = 0;
|
var size_idx: u2 = 0;
|
||||||
var ii: u2 = 0;
|
var shape_idx: u2 = 0;
|
||||||
|
|
||||||
while (true) {
|
while (true) {
|
||||||
LCD.naiveVSync();
|
LCD.naiveVSync();
|
||||||
Input.readInput();
|
Input.readInput();
|
||||||
|
|
||||||
const shoulder = Input.getShoulderJustPressed();
|
const shoulder = @truncate(u2, @bitCast(u32, Input.getShoulderJustPressed()));
|
||||||
|
|
||||||
if (Input.isKeyJustPressed(Input.Keys.A)) ii +%= 1;
|
if (Input.isKeyJustPressed(Input.Keys.A)) shape_idx +%= 1;
|
||||||
if (Input.isKeyJustPressed(Input.Keys.B)) ii -%= 1;
|
if (Input.isKeyJustPressed(Input.Keys.B)) shape_idx -%= 1;
|
||||||
|
|
||||||
if (shoulder != 0 or Input.isKeyJustPressed(Input.Keys.A | Input.Keys.B)) {
|
if (shoulder != 0 or Input.isKeyJustPressed(Input.Keys.A) or Input.isKeyJustPressed(Input.Keys.B)) {
|
||||||
i = (i + shoulder) & 0b11;
|
size_idx +%= shoulder;
|
||||||
ii %= 3;
|
shape_idx %= 3;
|
||||||
|
|
||||||
switch (ii) {
|
switch (shape_idx) {
|
||||||
0 => switch (i) {
|
0 => switch (size_idx) {
|
||||||
0 => loadSprite(0, 0, sprite),
|
0 => loadSprite(0, 0, &sprite),
|
||||||
1 => loadSprite(0, 1, sprite),
|
1 => loadSprite(0, 1, &sprite),
|
||||||
2 => loadSprite(0, 2, sprite),
|
2 => loadSprite(0, 2, &sprite),
|
||||||
3 => loadSprite(0, 3, sprite),
|
3 => loadSprite(0, 3, &sprite),
|
||||||
else => unreachable,
|
|
||||||
},
|
},
|
||||||
1 => switch (i) {
|
1 => switch (size_idx) {
|
||||||
0 => loadSprite(1, 0, sprite),
|
0 => loadSprite(1, 0, &sprite),
|
||||||
1 => loadSprite(1, 1, sprite),
|
1 => loadSprite(1, 1, &sprite),
|
||||||
2 => loadSprite(1, 2, sprite),
|
2 => loadSprite(1, 2, &sprite),
|
||||||
3 => loadSprite(1, 3, sprite),
|
3 => loadSprite(1, 3, &sprite),
|
||||||
else => unreachable,
|
|
||||||
},
|
},
|
||||||
2 => switch (i) {
|
2 => switch (size_idx) {
|
||||||
0 => loadSprite(2, 0, sprite),
|
0 => loadSprite(2, 0, &sprite),
|
||||||
1 => loadSprite(2, 1, sprite),
|
1 => loadSprite(2, 1, &sprite),
|
||||||
2 => loadSprite(2, 2, sprite),
|
2 => loadSprite(2, 2, &sprite),
|
||||||
3 => loadSprite(2, 3, sprite),
|
3 => loadSprite(2, 3, &sprite),
|
||||||
else => unreachable,
|
|
||||||
},
|
},
|
||||||
else => {},
|
else => {},
|
||||||
}
|
}
|
||||||
|
@ -82,7 +93,7 @@ pub fn main() noreturn {
|
||||||
|
|
||||||
sprite.setPosition(x, y);
|
sprite.setPosition(x, y);
|
||||||
|
|
||||||
OAM.update(1);
|
attr_ptr[0] = sprite;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,303 @@
|
||||||
|
/// Square Sprites
|
||||||
|
const square = struct {
|
||||||
|
|
||||||
|
/// 1D-Mapped Square Sprites
|
||||||
|
const d1 = struct {};
|
||||||
|
|
||||||
|
/// 2D-Mapped Square Sprites
|
||||||
|
const d2 = struct {
|
||||||
|
|
||||||
|
/// 2D-Mapped Square Sprites using 4-bit Colour
|
||||||
|
const bpp4 = struct {
|
||||||
|
pub const palette: [8]u32 = [_]u32{
|
||||||
|
0x3DEF0000, 0x00005EF7, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||||
|
};
|
||||||
|
|
||||||
|
const Sprite8x8 = struct {
|
||||||
|
const tile = [8]u32{
|
||||||
|
0x21111112, 0x12111121, 0x11211211, 0x11112111, 0x11121111, 0x11211211, 0x12111121, 0x21111112,
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
const Sprite16x16 = struct {
|
||||||
|
const tile = [32]u32{
|
||||||
|
0x11111112, 0x11111121, 0x11111211, 0x11112111, 0x11121111, 0x11211111, 0x12111111, 0x21111111,
|
||||||
|
0x21111111, 0x12111111, 0x11211111, 0x11121111, 0x11112111, 0x11111211, 0x11111121, 0x11111111,
|
||||||
|
0x11111111, 0x12111111, 0x11211111, 0x11121111, 0x11112111, 0x11111211, 0x11111121, 0x11111112,
|
||||||
|
0x11111112, 0x11111121, 0x11111211, 0x11112111, 0x11121111, 0x11211111, 0x12111111, 0x21111111,
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
const Sprite32x32 = struct {
|
||||||
|
const tile = [128]u32{
|
||||||
|
0x11111112, 0x11111121, 0x11111211, 0x11112111, 0x11121111, 0x11211111, 0x12111111, 0x21111111,
|
||||||
|
0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111,
|
||||||
|
0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111,
|
||||||
|
0x21111111, 0x12111111, 0x11211111, 0x11121111, 0x11112111, 0x11111211, 0x11111121, 0x11111112,
|
||||||
|
0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111,
|
||||||
|
0x11111112, 0x11111121, 0x11111211, 0x11112111, 0x11121111, 0x11211111, 0x12111111, 0x21111111,
|
||||||
|
0x21111111, 0x12111111, 0x11211111, 0x11121111, 0x11112111, 0x11111211, 0x11111121, 0x11111111,
|
||||||
|
0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111,
|
||||||
|
|
||||||
|
0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111,
|
||||||
|
0x11111111, 0x12111111, 0x11211111, 0x11121111, 0x11112111, 0x11111211, 0x11111121, 0x11111112,
|
||||||
|
0x11111112, 0x11111121, 0x11111211, 0x11112111, 0x11121111, 0x11211111, 0x12111111, 0x21111111,
|
||||||
|
0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111,
|
||||||
|
0x21111111, 0x12111111, 0x11211111, 0x11121111, 0x11112111, 0x11111211, 0x11111121, 0x11111112,
|
||||||
|
0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111,
|
||||||
|
0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111,
|
||||||
|
0x11111112, 0x11111121, 0x11111211, 0x11112111, 0x11121111, 0x11211111, 0x12111111, 0x21111111,
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
const Sprite64x64 = struct {
|
||||||
|
const tile = [512]u32{
|
||||||
|
0x11111112, 0x11111121, 0x11111211, 0x11112111, 0x11121111, 0x11211111, 0x12111111, 0x21111111,
|
||||||
|
0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111,
|
||||||
|
0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111,
|
||||||
|
0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111,
|
||||||
|
0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111,
|
||||||
|
0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111,
|
||||||
|
0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111,
|
||||||
|
0x21111111, 0x12111111, 0x11211111, 0x11121111, 0x11112111, 0x11111211, 0x11111121, 0x11111112,
|
||||||
|
|
||||||
|
0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111,
|
||||||
|
0x11111112, 0x11111121, 0x11111211, 0x11112111, 0x11121111, 0x11211111, 0x12111111, 0x21111111,
|
||||||
|
0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111,
|
||||||
|
0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111,
|
||||||
|
0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111,
|
||||||
|
0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111,
|
||||||
|
0x21111111, 0x12111111, 0x11211111, 0x11121111, 0x11112111, 0x11111211, 0x11111121, 0x11111112,
|
||||||
|
0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111,
|
||||||
|
|
||||||
|
0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111,
|
||||||
|
0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111,
|
||||||
|
0x11111112, 0x11111121, 0x11111211, 0x11112111, 0x11121111, 0x11211111, 0x12111111, 0x21111111,
|
||||||
|
0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111,
|
||||||
|
0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111,
|
||||||
|
0x21111111, 0x12111111, 0x11211111, 0x11121111, 0x11112111, 0x11111211, 0x11111121, 0x11111112,
|
||||||
|
0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111,
|
||||||
|
0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111,
|
||||||
|
|
||||||
|
0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111,
|
||||||
|
0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111,
|
||||||
|
0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111,
|
||||||
|
0x11111112, 0x11111121, 0x11111211, 0x11112111, 0x11121111, 0x11211111, 0x12111111, 0x21111111,
|
||||||
|
0x21111111, 0x12111111, 0x11211111, 0x11121111, 0x11112111, 0x11111211, 0x11111121, 0x11111111,
|
||||||
|
0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111,
|
||||||
|
0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111,
|
||||||
|
0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111,
|
||||||
|
|
||||||
|
0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111,
|
||||||
|
0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111,
|
||||||
|
0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111,
|
||||||
|
0x11111111, 0x12111111, 0x11211111, 0x11121111, 0x11112111, 0x11111211, 0x11111121, 0x11111112,
|
||||||
|
0x11111112, 0x11111121, 0x11111211, 0x11112111, 0x11121111, 0x11211111, 0x12111111, 0x21111111,
|
||||||
|
0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111,
|
||||||
|
0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111,
|
||||||
|
0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111,
|
||||||
|
|
||||||
|
0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111,
|
||||||
|
0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111,
|
||||||
|
0x21111111, 0x12111111, 0x11211111, 0x11121111, 0x11112111, 0x11111211, 0x11111121, 0x11111112,
|
||||||
|
0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111,
|
||||||
|
0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111,
|
||||||
|
0x11111112, 0x11111121, 0x11111211, 0x11112111, 0x11121111, 0x11211111, 0x12111111, 0x21111111,
|
||||||
|
0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111,
|
||||||
|
0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111,
|
||||||
|
|
||||||
|
0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111,
|
||||||
|
0x21111111, 0x12111111, 0x11211111, 0x11121111, 0x11112111, 0x11111211, 0x11111121, 0x11111112,
|
||||||
|
0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111,
|
||||||
|
0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111,
|
||||||
|
0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111,
|
||||||
|
0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111,
|
||||||
|
0x11111112, 0x11111121, 0x11111211, 0x11112111, 0x11121111, 0x11211111, 0x12111111, 0x21111111,
|
||||||
|
0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111,
|
||||||
|
|
||||||
|
0x21111111, 0x12111111, 0x11211111, 0x11121111, 0x11112111, 0x11111211, 0x11111121, 0x11111112,
|
||||||
|
0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111,
|
||||||
|
0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111,
|
||||||
|
0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111,
|
||||||
|
0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111,
|
||||||
|
0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111,
|
||||||
|
0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111,
|
||||||
|
0x11111112, 0x11111121, 0x11111211, 0x11112111, 0x11121111, 0x11211111, 0x12111111, 0x21111111,
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
/// 2D-Mapped Square Sprites using 8-bit Colour
|
||||||
|
const bpp8 = struct {};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
/// Horizontal Sprites
|
||||||
|
const horizontal = struct {
|
||||||
|
/// 1D-Mapped Horizontal Sprites
|
||||||
|
const d1 = struct {};
|
||||||
|
|
||||||
|
/// 2D-Mapped Horizontal Sprites
|
||||||
|
const d2 = struct {
|
||||||
|
/// 2D-Mapped Horizontal Sprites using 4-bit Colour
|
||||||
|
const bpp4 = struct {
|
||||||
|
const palette: [8]u32 = [_]u32{
|
||||||
|
0x3DEF0000, 0x00006318, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||||
|
};
|
||||||
|
|
||||||
|
const Sprite16x8 = struct {
|
||||||
|
const tile = [16]u32{
|
||||||
|
0x11111122, 0x11112211, 0x11221111, 0x22111111, 0x11111111, 0x11221111, 0x11112211, 0x11111122,
|
||||||
|
0x22111111, 0x11221111, 0x11112211, 0x11111111, 0x11111122, 0x11112211, 0x11221111, 0x22111111,
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
const Sprite32x8 = struct {
|
||||||
|
const tile = [32]u32{
|
||||||
|
0x11112222, 0x22221111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x22221111, 0x11112222,
|
||||||
|
0x11111111, 0x11111111, 0x11112222, 0x22221111, 0x11111111, 0x11112222, 0x11111111, 0x11111111,
|
||||||
|
0x11111111, 0x11111111, 0x22221111, 0x11111111, 0x11112222, 0x22221111, 0x11111111, 0x11111111,
|
||||||
|
0x22221111, 0x11112222, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11112222, 0x22221111,
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
const Sprite32x16 = struct {
|
||||||
|
const tile = [64]u32{
|
||||||
|
0x11111122, 0x11112211, 0x11221111, 0x22111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111,
|
||||||
|
0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111122, 0x11112211, 0x11221111, 0x22111111,
|
||||||
|
0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x22111111, 0x11221111, 0x11112211, 0x11111111,
|
||||||
|
0x22111111, 0x11221111, 0x11112211, 0x11111122, 0x11111111, 0x11111111, 0x11111111, 0x11111111,
|
||||||
|
0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x22111111, 0x11221111, 0x11112211, 0x11111122,
|
||||||
|
0x11111111, 0x11221111, 0x11112211, 0x11111122, 0x11111111, 0x11111111, 0x11111111, 0x11111111,
|
||||||
|
0x11111122, 0x11112211, 0x11221111, 0x22111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111,
|
||||||
|
0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111122, 0x11112211, 0x11221111, 0x22111111,
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
const Sprite64x32 = struct {
|
||||||
|
const tile = [256]u32{
|
||||||
|
0x11111122, 0x11112211, 0x11221111, 0x22111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111,
|
||||||
|
0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111122, 0x11112211, 0x11221111, 0x22111111,
|
||||||
|
0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111,
|
||||||
|
0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111,
|
||||||
|
0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111,
|
||||||
|
0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111,
|
||||||
|
0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x22111111, 0x11221111, 0x11112211, 0x11111122,
|
||||||
|
0x22111111, 0x11221111, 0x11112211, 0x11111122, 0x11111111, 0x11111111, 0x11111111, 0x11111111,
|
||||||
|
|
||||||
|
0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111,
|
||||||
|
0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111,
|
||||||
|
0x11111122, 0x11112211, 0x11221111, 0x22111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111,
|
||||||
|
0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111122, 0x11112211, 0x11221111, 0x22111111,
|
||||||
|
0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x22111111, 0x11221111, 0x11112211, 0x11111111,
|
||||||
|
0x22111111, 0x11221111, 0x11112211, 0x11111122, 0x11111111, 0x11111111, 0x11111111, 0x11111111,
|
||||||
|
0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111,
|
||||||
|
0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111,
|
||||||
|
|
||||||
|
0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111,
|
||||||
|
0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111,
|
||||||
|
0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x22111111, 0x11221111, 0x11112211, 0x11111122,
|
||||||
|
0x11111111, 0x11221111, 0x11112211, 0x11111122, 0x11111111, 0x11111111, 0x11111111, 0x11111111,
|
||||||
|
0x11111122, 0x11112211, 0x11221111, 0x22111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111,
|
||||||
|
0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111122, 0x11112211, 0x11221111, 0x22111111,
|
||||||
|
0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111,
|
||||||
|
0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111,
|
||||||
|
|
||||||
|
0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x22111111, 0x11221111, 0x11112211, 0x11111122,
|
||||||
|
0x22111111, 0x11221111, 0x11112211, 0x11111122, 0x11111111, 0x11111111, 0x11111111, 0x11111111,
|
||||||
|
0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111,
|
||||||
|
0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111,
|
||||||
|
0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111,
|
||||||
|
0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111,
|
||||||
|
0x11111122, 0x11112211, 0x11221111, 0x22111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111,
|
||||||
|
0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111122, 0x11112211, 0x11221111, 0x22111111,
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
/// Vertical Sprites
|
||||||
|
const vertical = struct {
|
||||||
|
/// 1D-Mapped Vertical Sprites
|
||||||
|
const d1 = struct {};
|
||||||
|
|
||||||
|
/// 2D-Mapped Vertical Sprites
|
||||||
|
const d2 = struct {
|
||||||
|
/// 2D-Mapped Vertical Sprites using 4-bit Colour
|
||||||
|
const bpp4 = struct {
|
||||||
|
const palette: [8]u32 = [_]u32{
|
||||||
|
0x3DEF0000, 0x00006318, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||||
|
};
|
||||||
|
|
||||||
|
const Sprite8x16 = struct {
|
||||||
|
const tile = [16]u32{
|
||||||
|
0x21111112, 0x21111112, 0x12111121, 0x12111121, 0x11211211, 0x11211211, 0x11112111, 0x11112111,
|
||||||
|
0x11121111, 0x11121111, 0x11211211, 0x11211211, 0x12111121, 0x12111121, 0x21111112, 0x21111112,
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
const Sprite8x32 = struct {
|
||||||
|
const tile = [32]u32{
|
||||||
|
0x21111112, 0x21111112, 0x21111112, 0x21111112, 0x12111121, 0x12111121, 0x12111121, 0x12111121,
|
||||||
|
0x11211211, 0x11211211, 0x11211211, 0x11211211, 0x11112111, 0x11112111, 0x11112111, 0x11112111,
|
||||||
|
0x11121111, 0x11121111, 0x11121111, 0x11121111, 0x11211211, 0x11211211, 0x11211211, 0x11211211,
|
||||||
|
0x12111121, 0x12111121, 0x12111121, 0x12111121, 0x21111112, 0x21111112, 0x21111112, 0x21111112,
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
const Sprite16x32 = struct {
|
||||||
|
const tile = [64]u32{
|
||||||
|
0x11111112, 0x11111112, 0x11111121, 0x11111121, 0x11111211, 0x11111211, 0x11112111, 0x11112111,
|
||||||
|
0x21111111, 0x21111111, 0x12111111, 0x12111111, 0x11211111, 0x11211111, 0x11121111, 0x11121111,
|
||||||
|
0x11121111, 0x11121111, 0x11211111, 0x11211111, 0x12111111, 0x12111111, 0x21111111, 0x21111111,
|
||||||
|
0x11112111, 0x11112111, 0x11111211, 0x11111211, 0x11111121, 0x11111121, 0x11111111, 0x11111111,
|
||||||
|
0x11111111, 0x11111111, 0x12111111, 0x12111111, 0x11211111, 0x11211111, 0x11121111, 0x11121111,
|
||||||
|
0x11111112, 0x11111112, 0x11111121, 0x11111121, 0x11111211, 0x11111211, 0x11112111, 0x11112111,
|
||||||
|
0x11112111, 0x11112111, 0x11111211, 0x11111211, 0x11111121, 0x11111121, 0x11111112, 0x11111112,
|
||||||
|
0x11121111, 0x11121111, 0x11211111, 0x11211111, 0x12111111, 0x12111111, 0x21111111, 0x21111111,
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
const Sprite32x64 = struct {
|
||||||
|
const tile = [256]u32{
|
||||||
|
0x11111112, 0x11111112, 0x11111121, 0x11111121, 0x11111211, 0x11111211, 0x11112111, 0x11112111,
|
||||||
|
0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111,
|
||||||
|
0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111,
|
||||||
|
0x21111111, 0x21111111, 0x12111111, 0x12111111, 0x11211111, 0x11211111, 0x11121111, 0x11121111,
|
||||||
|
0x11121111, 0x11121111, 0x11211111, 0x11211111, 0x12111111, 0x12111111, 0x21111111, 0x21111111,
|
||||||
|
0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111,
|
||||||
|
0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111,
|
||||||
|
0x11112111, 0x11112111, 0x11111211, 0x11111211, 0x11111121, 0x11111121, 0x11111112, 0x11111112,
|
||||||
|
|
||||||
|
0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111,
|
||||||
|
0x11111112, 0x11111112, 0x11111121, 0x11111121, 0x11111211, 0x11111211, 0x11112111, 0x11112111,
|
||||||
|
0x21111111, 0x21111111, 0x12111111, 0x12111111, 0x11211111, 0x11211111, 0x11121111, 0x11121111,
|
||||||
|
0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111,
|
||||||
|
0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111,
|
||||||
|
0x11121111, 0x11121111, 0x11211111, 0x11211111, 0x12111111, 0x12111111, 0x21111111, 0x21111111,
|
||||||
|
0x11112111, 0x11112111, 0x11111211, 0x11111211, 0x11111121, 0x11111121, 0x11111111, 0x11111111,
|
||||||
|
0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111,
|
||||||
|
|
||||||
|
0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111,
|
||||||
|
0x11111111, 0x11111111, 0x12111111, 0x12111111, 0x11211111, 0x11211111, 0x11121111, 0x11121111,
|
||||||
|
0x11111112, 0x11111112, 0x11111121, 0x11111121, 0x11111211, 0x11111211, 0x11112111, 0x11112111,
|
||||||
|
0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111,
|
||||||
|
0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111,
|
||||||
|
0x11112111, 0x11112111, 0x11111211, 0x11111211, 0x11111121, 0x11111121, 0x11111112, 0x11111112,
|
||||||
|
0x11121111, 0x11121111, 0x11211111, 0x11211111, 0x12111111, 0x12111111, 0x21111111, 0x21111111,
|
||||||
|
0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111,
|
||||||
|
|
||||||
|
0x21111111, 0x21111111, 0x12111111, 0x12111111, 0x11211111, 0x11211111, 0x11121111, 0x11121111,
|
||||||
|
0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111,
|
||||||
|
0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111,
|
||||||
|
0x11111112, 0x11111112, 0x11111121, 0x11111121, 0x11111211, 0x11111211, 0x11112111, 0x11112111,
|
||||||
|
0x11112111, 0x11112111, 0x11111211, 0x11111211, 0x11111121, 0x11111121, 0x11111112, 0x11111112,
|
||||||
|
0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111,
|
||||||
|
0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111, 0x11111111,
|
||||||
|
0x11121111, 0x11121111, 0x11211111, 0x11211111, 0x12111111, 0x12111111, 0x21111111, 0x21111111,
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
Loading…
Reference in New Issue