functions basically you have a set of numbered background tiles and a so called tile map that combines these tiles into a background image then you have a set of sprites from which you can draw up to NUMBER_TOKEN freely on top of the background and there are some additional features for example to draw scoreboards and once again i want to recommend the ultimate gameboy talk by michelle style if you want to learn more about these but there's nothing to directly draw specific pixels onto the screen this is why most gameboy games have this distinct look stuff is arranged on a grid with repeating tiles and players and monsters are moving on top so in order to draw an arbitrary image we have to split it into tiles which are each NUMBER_TOKENxNUMBER_TOKEN pixels with a color depth of two bits to make up the four shades of grey that the original game boy offers each tile takes up NUMBER_TOKEN bytes and we then have to create a tile map that simply pushes the tiles back together to recreate the original image right almost there is a little catch the tile map only uses one byte per tile to define which image should be drawn so it can only select from NUMBER_TOKEN distinct tiles but the game boy has a resolution of whopping NUMBER_TOKEN by NUMBER_TOKEN pixels which translates to NUMBER_TOKEN by NUMBER_TOKEN tiles so we require a total of NUMBER_TOKEN tiles which incidentally is more than NUMBER_TOKEN if you look at the title screens of most games you will notice that usually this means that those screens either reuse several tiles or that they just have a lot of empty space around them this workaround is okay if you specifically design a title screen for the game boy but not if you want to display arbitrary images or videos luckily there's a well-known workaround for this you can select the memory range for the background tiles by changing a bit in the display status register the NUMBER_TOKEN values of the tile map can either point to the memory address hex NUMBER_TOKEN and count upwards from there or they can point to the address hex NUMBER_TOKEN and the bytes are interpreted as signed integers allowing it to point to NUMBER_TOKEN tiles after and NUMBER_TOKEN tiles before that address yes the ones before that address overlap with the other range this gives us NUMBER_TOKEN tiles that are only available in one state NUMBER_TOKEN tiles in the other state and NUMBER_TOKEN tiles that are shared between both states NUMBER_TOKEN in total which incidentally is more than NUMBER_TOKEN. so if you have the data for NUMBER_TOKEN tiles in memory you can use a tile map with addresses relative to hex NUMBER_TOKEN for the upper half of the screen and addresses relative to hex NUMBER_TOKEN for the lower half since the ppu draws the image line by line you can actually register an interrupt that allows you to simply change the display status register halfway through the image to switch to the other address now while this method is known among game boy developers you still do not often see full screen images because the capacity of a cartridge is rather limited in our case with a wi-fi cartridge that's not an issue but each image of the video will require different tile data so we ideally want to load those NUMBER_TOKEN tiles about NUMBER_TOKEN to NUMBER_TOKEN times per second with NUMBER_TOKEN bytes per tile that's a total of NUMBER_TOKEN bytes per frame and at NUMBER_TOKEN fps that would mean NUMBER_TOKEN kilobyte per second in the gameboy world that's a lot of data that's about eight times the entire tetris game per second so no more comfortable c it's time for some hand to hand assembly i am not the most experienced with assembly code
NO_SEGMENT_TOKEN