Commit graph

1442 commits

Author SHA1 Message Date
Corwin d07970a7c0
Release v0.21.0 2024-09-24 20:38:33 +01:00
Corwin 3da5c21813
use SyncUnsafeCell rather than static muts 2024-09-22 16:22:08 +01:00
Corwin 051d9ab85d
use export name 2024-09-22 16:20:18 +01:00
Corwin 56e3de3c62
add SyncUnsafeCell implementation 2024-09-22 16:19:00 +01:00
Gwilym Inzani 84a3c0b6a0
Allowing imported graphics to be exposed as pub mod (#738)
- [X] Changelog updated

This PR adds the possibility for graphics imported through
`include_background_gfx!` to be used as public modules, e.g.:
```rust
/// graphics.rs
agb::include_background_gfx!(pub background, "d77bba", tiles256 => 256 "map.aseprite");

/// main.rs
#![no_std]
#![no_main]

use agb::display::Priority;
use agb::display::tiled::RegularBackgroundSize::Background64x64;
use agb::display::tiled::{TiledMap, TileFormat};

mod graphics;


#[agb::entry]
fn main(mut gba: agb::Gba) -> ! {
    let (tiled, mut vram) = gba.display.video.tiled1();
    let vblank = agb::interrupt::VBlank::get();
    let tileset = &graphics::background::tiles256.tiles;

    vram.set_background_palettes(graphics::background::PALETTES);

    let mut bg = tiled.regular(Priority::P2, Background64x64, TileFormat::EightBpp);

    for y in 0..64u16 {
        for x in 0..64u16 {
            bg.set_tile(&mut vram, (x, y), tileset, graphics::background::tiles256.tile_settings[1]);
        }
    }
    bg.set_visible(true);
    bg.commit(&mut vram);

    loop {
        vblank.wait_for_vblank();
    }
}
```
2024-08-28 15:02:41 +01:00
Gwilym Inzani f25fe7f707 Add docs for pub exports of backgrounds 2024-08-28 14:55:12 +01:00
Gwilym Inzani 7d0ad0d497 State that this is text 2024-08-28 12:27:27 +01:00
Gwilym Inzani 2614fd1af0 Make affine map indexes u16 2024-08-28 12:27:27 +01:00
Corwin 974b08989a add docs 2024-08-28 12:27:27 +01:00
Corwin e1cc3d7773 make affine stuff public, there's no invariant we want to maintain 2024-08-28 12:27:27 +01:00
Gwilym Inzani d045b8c8f2 Shorten the first paragraphs 2024-08-28 12:08:24 +01:00
Gwilym Inzani 6da89991aa asm_const is no longer nightly 2024-08-17 08:39:07 +01:00
Gwilym Inzani 178018c0f0 Remove unnecessary unsafe block 2024-07-24 17:08:02 +01:00
kouta faa46a4f32 Fix linting issues 2024-07-11 14:56:43 -03:00
kouta a9a4a052a9 Remove priority() from TiledMapPrivate as it can now be accessed straight from the underlying type. 2024-07-11 14:34:12 -03:00
kouta 41979460f6 Merge remote-tracking branch 'refs/remotes/raworigin/master' into hotfix/affine-tiles 2024-07-11 14:27:37 -03:00
kouta 1340b992cb Code review 2024-07-10 09:29:07 -03:00
Gwilym Inzani 741c3dedee Fix two build issues with latest rust version 2024-07-10 09:06:52 +01:00
kouta cf2b8be6e0 Fix affine matrix tile setting 2024-07-07 00:53:52 -03:00
Corwin a4d6ba5bc9
Release v0.20.5 2024-06-18 17:49:56 +01:00
Corwin ac2e6b5046
Release v0.20.4 2024-06-13 23:13:02 +01:00
Corwin bc63776b9e
Exclude tests / examples / benches from the published packages (#589)
The package published to crates.io should not include tests / examples /
benches. Previously we ran into issues with having a too large package
from example data, but we avoided this by making the examples smaller. A
better way to avoid this is to not include them at all.

- [x] no changelog update needed
2024-06-13 22:48:00 +01:00
Corwin a6e4be0577
Release v0.20.3 2024-06-12 17:57:39 +01:00
Corwin 5ca9cd5480
fix the overflow bug on kerning / xmin on a new sprite (#725)
- [x] Changelog updated
2024-06-12 17:40:46 +01:00
Corwin 53f0901ceb
fix the overflow bug on kerning / xmin on a new sprite 2024-06-12 17:29:39 +01:00
Corwin 50f2ad6f52
exclude tests / examples / benches from the published packages 2024-06-12 01:19:18 +01:00
Corwin fed560b41b
expose graphics mode 2024-06-11 17:50:22 +01:00
Gwilym Inzani 32c6ed4e35 Ensure the frame pointer is always 0 2024-06-04 21:39:58 +01:00
Gwilym Inzani d9243ded6b The link register points to the next instruction 2024-06-04 21:18:10 +01:00
Gwilym Inzani fde444e253 Fix affine background matrix creation outside of the 1st quadrant 2024-05-27 14:46:55 +01:00
Gwilym Inzani 21658b9b15
Revert "Remove lifetime from dma transfer handle" 2024-05-27 14:16:24 +01:00
Gwilym Inzani c4719a5ce0 Remove unsafe from examples 2024-05-27 13:24:58 +01:00
Gwilym Inzani e9ce8cd2ad hblack_transfer doesn't need to be unsafe 2024-05-27 13:23:49 +01:00
Gwilym Inzani 248f71dbfa Remove lifetime from DMA transfer handle 2024-05-27 13:20:13 +01:00
Gwilym Inzani 30e3718797 Include drawing a leviathan 2024-05-25 21:11:32 +01:00
Gwilym Inzani 24e15f8786 Add a basic version of the example_logo for certain examples 2024-05-25 21:11:32 +01:00
Gwilym Inzani da9ad6d496 Add a 256 colour variant too 2024-05-25 21:11:02 +01:00
Gwilym Inzani bf4a6887a5 Update the background example to search for the colour 2024-05-25 21:11:02 +01:00
Gwilym Inzani b219e00454 Update the test_logo to be a bit nicer 2024-05-25 21:11:02 +01:00
Corwin d05965b98f
Release v0.20.2 2024-05-25 13:20:03 +01:00
Corwin b3d7642071
extract code generation and add test 2024-05-25 12:22:38 +01:00
Corwin 2d34099afc
resize the buffer 2024-05-25 12:07:23 +01:00
Corwin 51b1f909c5
clear screen and handle message overlap 2024-05-25 12:07:23 +01:00
Corwin e06230efd0
Agb examples site (#705)
![image](https://github.com/agbrs/agb/assets/8143879/12163f27-1097-49fd-810c-a00f6cf5d8bf)
2024-05-22 20:56:59 +01:00
Corwin e25a1c7158
remove just build that is non standard 2024-05-22 02:20:39 +01:00
Gwilym Inzani f047b6de94
Put https://agbrs.dev as the homepage for the crate (#704)
- [x] no changelog update needed
2024-05-21 23:51:31 +01:00
Gwilym Inzani 864fd08ec3 Put https://agbrs.dev as the homepage for the crate 2024-05-21 23:43:45 +01:00
Gwilym Inzani ddc3770c70 Use pointers rather than pin to simplify the mixers buffer handling 2024-05-21 23:17:39 +01:00
Corwin 6a5346026a
Release v0.20.1 2024-05-17 23:09:16 +01:00
Corwin 737b547343
Release v0.20.0 2024-05-14 22:57:40 +01:00