Giter Club home page Giter Club logo

gb-starter-kit's Introduction

Hi!

The name's Eldred, Eldred Habert.

I mainly deal with lower-level stuff, and making tools to help others make great stuff out of them. I'm a regular over at gbdev, if you're interested in making a game on a retro platform for fun, this might be worth checking out!

I'm the main maintainer of RGBDS, the main toolchain for programming on the Game Boy. If you're interested in contributing, we have some beginner-friendly tasks!

I have a Game Boy programming tutorial in progress; if you'd be interested in translating it, you can help! Please open an issue to let me know, and we can get started :)

Thanks for stopping by, have fun on the rest of your browsing journey o/

gb-starter-kit's People

Contributors

eievui5 avatar issotm avatar jl2210 avatar pinobatch avatar win-ini avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

gb-starter-kit's Issues

Document the use of shadow registers like hLCDC and hBGP.

I've seen two people on the Discord confused about the use of shadow registers just in the last week. The first person had the problem that the LCD was immediately disabled after enabling it. The issue turned out to be that the shadow register handler wrote the value of hLCDC (00) on the next VBlank. The second user noted that changes to rBGP would only work, as they put it, if you wrote to the register in an infinite loop.

I would suggest documenting how the shadow registers work and the caveats around using the code included in the gb-starter-kit, so there's a single place to point to if the question arises again. This should probably be mentioned briefly, maybe with an appropriate link, in intro.asm which is likely where a new user will look when using the project for the first time.

I've looked both in the GB ASM style guide and GB ASM tutorial in case anything about it was mentioned there, but nothing as far as I could see.

Rewrite tools/pb8.py and tools/pb16.py in C or C++

This could potentially reuse code from Sameboy's pb12.c and former pb8.c (MIT licensed).

I think C++ would have advantages for making use of <vector>, iterators, for-each loops, C++17 <filesystem>, etc.

In either case, installing gcc or g++ is comparable to installing python3, and would build faster for projects with many compressed resources.

Could not open file obj.cover.o

Hello.
I have some trouble with make a build of our project https://github.com/stanislavche/lsdpack-kit
I can not see logs, only "libpng warning: iCCP: profile 'Samsung - Natural Color Pro 1.0 ICM': 0h: PCS illuminant is not D50" but as I understand it's not an issue.

I'm using Ubuntu 18.04
RGBDS : 0.5.1
GCC 7.5.0
latest libpng

May be you know what can vbe an issue

rgbasm -p 0xFF -isrc/ -isrc/include/ -Wall -Wextra -h -M dep/intro.mk -MG -MP -MQ obj/intro.o -MQ dep/intro.mk -o obj/intro.o src/intro.asm
rgbgfx -u -o res/song2.image src/res/song2.png
libpng warning: iCCP: profile 'Samsung - Natural Color Pro 1.0 ICM': 0h: PCS illuminant is not D50
rgbasm -p 0xFF -isrc/ -isrc/include/ -Wall -Wextra -h -M dep/covers.mk -MG -MP -MQ obj/covers.o -MQ dep/covers.mk -o obj/covers.o src/covers.asm
rgbgfx -u -t res/song2.imagemap src/res/song2.png
libpng warning: iCCP: profile 'Samsung - Natural Color Pro 1.0 ICM': 0h: PCS illuminant is not D50
rgbasm -p 0xFF -isrc/ -isrc/include/ -Wall -Wextra -h -M dep/covers.mk -MG -MP -MQ obj/covers.o -MQ dep/covers.mk -o obj/covers.o src/covers.asm
rgbgfx -u -o res/song3.image src/res/song3.png
libpng warning: iCCP: profile 'Samsung - Natural Color Pro 1.0 ICM': 0h: PCS illuminant is not D50
rgbasm -p 0xFF -isrc/ -isrc/include/ -Wall -Wextra -h -M dep/covers.mk -MG -MP -MQ obj/covers.o -MQ dep/covers.mk -o obj/covers.o src/covers.asm
rgbgfx -u -t res/song3.imagemap src/res/song3.png
libpng warning: iCCP: profile 'Samsung - Natural Color Pro 1.0 ICM': 0h: PCS illuminant is not D50
rgbasm -p 0xFF -isrc/ -isrc/include/ -Wall -Wextra -h -M dep/covers.mk -MG -MP -MQ obj/covers.o -MQ dep/covers.mk -o obj/covers.o src/covers.asm
rgbgfx -u -o res/song4.image src/res/song4.png
libpng warning: iCCP: profile 'Samsung - Natural Color Pro 1.0 ICM': 0h: PCS illuminant is not D50
rgbasm -p 0xFF -isrc/ -isrc/include/ -Wall -Wextra -h -M dep/covers.mk -MG -MP -MQ obj/covers.o -MQ dep/covers.mk -o obj/covers.o src/covers.asm
rgbgfx -u -t res/song4.imagemap src/res/song4.png
libpng warning: iCCP: profile 'Samsung - Natural Color Pro 1.0 ICM': 0h: PCS illuminant is not D50
rgbasm -p 0xFF -isrc/ -isrc/include/ -Wall -Wextra -h -M dep/covers.mk -MG -MP -MQ obj/covers.o -MQ dep/covers.mk -o obj/covers.o src/covers.asm
rgbgfx -u -o res/song5.image src/res/song5.png
libpng warning: iCCP: profile 'Samsung - Natural Color Pro 1.0 ICM': 0h: PCS illuminant is not D50
rgbasm -p 0xFF -isrc/ -isrc/include/ -Wall -Wextra -h -M dep/covers.mk -MG -MP -MQ obj/covers.o -MQ dep/covers.mk -o obj/covers.o src/covers.asm
rgbgfx -u -t res/song5.imagemap src/res/song5.png
libpng warning: iCCP: profile 'Samsung - Natural Color Pro 1.0 ICM': 0h: PCS illuminant is not D50
rgbasm -p 0xFF -isrc/ -isrc/include/ -Wall -Wextra -h -M dep/covers.mk -MG -MP -MQ obj/covers.o -MQ dep/covers.mk -o obj/covers.o src/covers.asm
rgbgfx -u -o res/song6.image src/res/song6.png
libpng warning: iCCP: profile 'Samsung - Natural Color Pro 1.0 ICM': 0h: PCS illuminant is not D50
rgbasm -p 0xFF -isrc/ -isrc/include/ -Wall -Wextra -h -M dep/covers.mk -MG -MP -MQ obj/covers.o -MQ dep/covers.mk -o obj/covers.o src/covers.asm
rgbasm -p 0xFF -isrc/ -isrc/include/ -Wall -Wextra -h -o obj/build_date.o src/res/build_date.asm
rgblink -p 0xFF -d -m bin/boilerplate.map -n bin/boilerplate.sym -o bin/boilerplate.gb obj/covers.o obj/sgb.o obj/player.o obj/header.o obj/vectors.o obj/misc.o obj/crash_handler.o obj/unpb16.o obj/intro.o obj/build_date.o \
&& rgbfix -v -p 0xFF -v -i "BOIL" -k "HB" -l 0x33 -m MBC5 -n 0 -r 0x00 -t BOILERPLATE bin/boilerplate.gb
error: Could not open file obj/covers.o: No such file or directory
Makefile:154: recipe for target 'bin/boilerplate.gb' failed
make[1]: *** [bin/boilerplate.gb] Error 1
make[1]: Leaving directory '/home/stn/pr/lsdpack-kit'
Makefile:78: recipe for target 'rebuild' failed
make: *** [rebuild] Error 2`

Improve file layout

  • Split off header.asm into main.asm where appropriate
  • Evaluate if some files shouldn't be split into more sub-files
  • Break the hierarchy into several sub-directories to improve organisation

Improve interrupt handler layout

  • Ensure each "stub" is in its own section, without padding
  • Put the STAT handler "inline", since the other handlers are not used
  • Put the VBlank handler at $150 so that it can be jr'd to (acceptable because of the header right before)
  • Add "dynamic raster FX" STAT handler

Improve joypad-reading code

Pino's Libbet has a good example of the timings involved. Since we're doing more than just polling, it should be possible to combine the delays with the other operations being performed.

Stack outside of range error

Running into this error when I run Make:

rgbasm -p 0xFF -isrc/ -isrc/include/ -Wall -Wextra -h -o obj/build_date.o src/res/build_date.asm rgblink -p 0xFF -m bin/boilerplate.map -n bin/boilerplate.sym -o bin/boilerplate.gb obj/sgb.o obj/header.o obj/vectors.o obj/misc.o obj/crash_handler.o obj/unpb16.o obj/intro.o obj/build_date.o \ && rgbfix -v -p 0xFF -v -i "BOIL" -k "HB" -l 0x33 -m 0x00 -n 0 -r 0x00 -t BOILERPLATE bin/boilerplate.gb warning: Section "Stack"'s fixed address 0xdfc0 is outside of range [0xc000; 0xcfff] warning: Section "Stack"'s end address 0xe000 is greater than last address 0xd000 error: Sanity checks failed make: *** [Makefile:97: bin/boilerplate.gb] Error 1

I haven't touched any of the files, this is right after I did a 'git clone "repo link" --recursive'. Both includes are there, and make clean doesn't help. RGBDS is v 0.4.0

Update to RGBDS 0.5.0

  • Use DEF syntax
  • Use new macro syntax
  • Apply same changes to gb-boilerplate
  • Use anonymous labels instead of wait_vram

Document the VRAM access timings after `wait_vram`

This would be a PR if not for the fact that I don't trust myself to get the values right. I think the exact numbers depend on whether you're reading or writing, whether you're running on a DMG, CGB single-speed, or CGB double-speed.

Don't hardcode stack address

There's no reason to hardcode it, actually; it's data like any other, and it can go anywhere as long as it's large enough. It would additionally lift the requirement of editing that address when switching between WRAM0-only and WRAMX modes.

Proposal: Relicensing runtime-linked code to avoid copyright notice dependencies on binaries

In short: It is often tough to comply with a copyright notice preservation requirement for binaries when self-contained ROMs are distributed digitally or on cartridge. Most projects do not comply with such requirements even today, leading to mass copyright infringement in homebrew scenes (for example, usage of newlib in GBA/NDS/PSP/Wii/3DS/... homebrew).

For this reason, many projects (my own WIP toolchain collection Wonderful, libnds, smaller things like decompressors) have opted to use, for the library code which is statically linked with the target binary, a license which does not impose such a requirement. Example options include:

  • the zlib license (my personal preference), which preserves the requirement for source code but not binary form,
  • the Boost Software License, which has a similar effect,
  • licenses which do not impose any attribution requirements, like CC0, 0-clause BSD, etc.

As this project is meant to be a "starter kit" for newcomers, it would be great to avoid throwing them head-first into a licensing pitfall. I recommend the zlib license myself, but any of the above will do.

Improve documentation of how the various "systems" work

For example, document why "shadow" registers are used instead of direct writes to the hardware regs.

Avoid big chunks of documentation in the middle of a function, though, because those hinder readability of the code itself.

Make never stops making

...
rgbasm -p 0xFE -isrc/ -isrc/include/ -Wall -Wextra -h -M dep/vectors.mk -MG -MP -MQ obj/vectors.o -MQ dep/vectors.mk -o obj/vectors.o src/vectors.asm
rgbasm -p 0xFE -isrc/ -isrc/include/ -Wall -Wextra -h -M dep/sgb.mk -MG -MP -MQ obj/sgb.o -MQ dep/sgb.mk -o obj/sgb.o src/sgb.asm
rgbasm -p 0xFE -isrc/ -isrc/include/ -Wall -Wextra -h -M dep/misc.mk -MG -MP -MQ obj/misc.o -MQ dep/misc.mk -o obj/misc.o src/misc.asm
rgbasm -p 0xFE -isrc/ -isrc/include/ -Wall -Wextra -h -M dep/header.mk -MG -MP -MQ obj/header.o -MQ dep/header.mk -o obj/header.o src/header.asm
rgbasm -p 0xFE -isrc/ -isrc/include/ -Wall -Wextra -h -M dep/crash_handler.mk -MG -MP -MQ obj/crash_handler.o -MQ dep/crash_handler.mk -o obj/crash_handler.o src/crash_handler.asm
rgbasm -p 0xFE -isrc/ -isrc/include/ -Wall -Wextra -h -M dep/vectors.mk -MG -MP -MQ obj/vectors.o -MQ dep/vectors.mk -o obj/vectors.o src/vectors.asm
rgbasm -p 0xFE -isrc/ -isrc/include/ -Wall -Wextra -h -M dep/sgb.mk -MG -MP -MQ obj/sgb.o -MQ dep/sgb.mk -o obj/sgb.o src/sgb.asm
rgbasm -p 0xFE -isrc/ -isrc/include/ -Wall -Wextra -h -M dep/misc.mk -MG -MP -MQ obj/misc.o -MQ dep/misc.mk -o obj/misc.o src/misc.asm
rgbasm -p 0xFE -isrc/ -isrc/include/ -Wall -Wextra -h -M dep/header.mk -MG -MP -MQ obj/header.o -MQ dep/header.mk -o obj/header.o src/header.asm
rgbasm -p 0xFE -isrc/ -isrc/include/ -Wall -Wextra -h -M dep/crash_handler.mk -MG -MP -MQ obj/crash_handler.o -MQ dep/crash_handler.mk -o obj/crash_handler.o src/crash_handler.asm
rgbasm -p 0xFE -isrc/ -isrc/include/ -Wall -Wextra -h -M dep/vectors.mk -MG -MP -MQ obj/vectors.o -MQ dep/vectors.mk -o obj/vectors.o src/vectors.asm
rgbasm -p 0xFE -isrc/ -isrc/include/ -Wall -Wextra -h -M dep/sgb.mk -MG -MP -MQ obj/sgb.o -MQ dep/sgb.mk -o obj/sgb.o src/sgb.asm
rgbasm -p 0xFE -isrc/ -isrc/include/ -Wall -Wextra -h -M dep/misc.mk -MG -MP -MQ obj/misc.o -MQ dep/misc.mk -o obj/misc.o src/misc.asm
rgbasm -p 0xFE -isrc/ -isrc/include/ -Wall -Wextra -h -M dep/header.mk -MG -MP -MQ obj/header.o -MQ dep/header.mk -o obj/header.o src/header.asm
rgbasm -p 0xFE -isrc/ -isrc/include/ -Wall -Wextra -h -M dep/crash_handler.mk -MG -MP -MQ obj/crash_handler.o -MQ dep/crash_handler.mk -o obj/crash_handler.o src/crash_handler.asm
rgbasm -p 0xFE -isrc/ -isrc/include/ -Wall -Wextra -h -M dep/vectors.mk -MG -MP -MQ obj/vectors.o -MQ dep/vectors.mk -o obj/vectors.o src/vectors.asm
rgbasm -p 0xFE -isrc/ -isrc/include/ -Wall -Wextra -h -M dep/sgb.mk -MG -MP -MQ obj/sgb.o -MQ dep/sgb.mk -o obj/sgb.o src/sgb.asm
rgbasm -p 0xFE -isrc/ -isrc/include/ -Wall -Wextra -h -M dep/misc.mk -MG -MP -MQ obj/misc.o -MQ dep/misc.mk -o obj/misc.o src/misc.asm
rgbasm -p 0xFE -isrc/ -isrc/include/ -Wall -Wextra -h -M dep/header.mk -MG -MP -MQ obj/header.o -MQ dep/header.mk -o obj/header.o src/header.asm
rgbasm -p 0xFE -isrc/ -isrc/include/ -Wall -Wextra -h -M dep/crash_handler.mk -MG -MP -MQ obj/crash_handler.o -MQ dep/crash_handler.mk -o obj/crash_handler.o src/crash_handler.asm
rgbasm -p 0xFE -isrc/ -isrc/include/ -Wall -Wextra -h -M dep/vectors.mk -MG -MP -MQ obj/vectors.o -MQ dep/vectors.mk -o obj/vectors.o src/vectors.asm
rgbasm -p 0xFE -isrc/ -isrc/include/ -Wall -Wextra -h -M dep/sgb.mk -MG -MP -MQ obj/sgb.o -MQ dep/sgb.mk -o obj/sgb.o src/sgb.asm
rgbasm -p 0xFE -isrc/ -isrc/include/ -Wall -Wextra -h -M dep/misc.mk -MG -MP -MQ obj/misc.o -MQ dep/misc.mk -o obj/misc.o src/misc.asm
rgbasm -p 0xFE -isrc/ -isrc/include/ -Wall -Wextra -h -M dep/header.mk -MG -MP -MQ obj/header.o -MQ dep/header.mk -o obj/header.o src/header.asm
^Cmake: *** Deleting file 'dep/header.mk'

I imagine it's suppost to stop at some point? ^^

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.