Re: Video: Lesson P31 - Hardware Sprites on the MSX1!
Posted: Fri Jul 17, 2020 11:46 am
"Unless you have some clever ideas to exploit this (like objects that move with the screen - staying in their 3rd)"
I have though about this again. I do not think you need clever ideas to do vertical scrolling if that is what you meant in your video lesson P52 (https://youtu.be/pobGYc2iPfE) you ask "how are you going to make your game scroll vertically?" near the end of that video or your quote above-, you can do vertical scrolling with unique tiles everywhere as I describe an outline of the method below. I think it is a generic method that can apply to a lot of games.
I think I was wrong before to think that it was important to swap tiles between the 1st and 3rd bank to get a vertical scrolling effect.
The important thing is that there is a way to show 768 unique tiles on screen and that is all you minimally need for vertical scrolling in 8 pixel increments. To do vertical scrolling with 3 tile banks you just need to swap the tiles where the cut off points are at each third of the
screen. For example if we have 768 unique tiles on screen and want to scroll upwards 8 pixels then in the first third of the screen we just need to shift the characters that make of that first third up 1 character, i.e. shift the character of rows 2 to 8 to 1 to 7. but at the 8th line of that first third we need to redefine (equivalent to a swap) 32 characters so it contains the adjacent 32 characters from the first line of the second bank, similar idea for where the second third of the screen meets the last third at the bottom of the screen.
Then we need to redraw a new line of characters right at the bottom of the screen-the bottom line maybe loaded from a game ROM. So for vertically scrolling the screen you need to redefine 24*3 characters over all the tile banks, or 96 characters at a time, this would be a minimum of 96*8*2=1536 memory locations updates in VRAM or RAM, including colour information, to update for every 8 pixel scroll upwards-using screen1 instead of screen 2 will need less updates because there is less colour information. A smaller game area screen will need less VRAM updates. If you use some of the tiles for game fonts e.g. to simply write a 3 digit score number using one line at the top of screen (instead of not using sprites for fonts), then that still means you can display 736 tiles for the game graphics (excluding top line for score)-which is most of the screen; writing a score with a custom font takes 10 tiles -one for each digit. Initially the screen will start with up to 768 unqiue tiles.
Right?
I have though about this again. I do not think you need clever ideas to do vertical scrolling if that is what you meant in your video lesson P52 (https://youtu.be/pobGYc2iPfE) you ask "how are you going to make your game scroll vertically?" near the end of that video or your quote above-, you can do vertical scrolling with unique tiles everywhere as I describe an outline of the method below. I think it is a generic method that can apply to a lot of games.
I think I was wrong before to think that it was important to swap tiles between the 1st and 3rd bank to get a vertical scrolling effect.
The important thing is that there is a way to show 768 unique tiles on screen and that is all you minimally need for vertical scrolling in 8 pixel increments. To do vertical scrolling with 3 tile banks you just need to swap the tiles where the cut off points are at each third of the
screen. For example if we have 768 unique tiles on screen and want to scroll upwards 8 pixels then in the first third of the screen we just need to shift the characters that make of that first third up 1 character, i.e. shift the character of rows 2 to 8 to 1 to 7. but at the 8th line of that first third we need to redefine (equivalent to a swap) 32 characters so it contains the adjacent 32 characters from the first line of the second bank, similar idea for where the second third of the screen meets the last third at the bottom of the screen.
Then we need to redraw a new line of characters right at the bottom of the screen-the bottom line maybe loaded from a game ROM. So for vertically scrolling the screen you need to redefine 24*3 characters over all the tile banks, or 96 characters at a time, this would be a minimum of 96*8*2=1536 memory locations updates in VRAM or RAM, including colour information, to update for every 8 pixel scroll upwards-using screen1 instead of screen 2 will need less updates because there is less colour information. A smaller game area screen will need less VRAM updates. If you use some of the tiles for game fonts e.g. to simply write a 3 digit score number using one line at the top of screen (instead of not using sprites for fonts), then that still means you can display 736 tiles for the game graphics (excluding top line for score)-which is most of the screen; writing a score with a custom font takes 10 tiles -one for each digit. Initially the screen will start with up to 768 unqiue tiles.
Right?