There are some other things I could do during the raster interrupt such as switching to a different character set (giving me 256 different tiles for the status bar than the ones for the rooms) or changing global colors (three of the four colors per tile are globally set). Christian Bauer has documented all the details of the inner workings of the VIC-II, including the precise cycles in each raster line when what memory access happens. That was a surprise considering that the values of the aforementioned registers would have been available already as internal signals to the circuitry without having to fetch any additional data from memory, a slow operation. Evidently there’s a memory access on each raster line that contains a sprite to fetch first a pointer to the pixel data and then the data pointed to. Interestingly, sprite pointers are not implemented as registers-they live in memory in the free space at the end of Screen RAM. The sprite pointer is used by the VIC to find the memory location of the pixel data for the sprite to be drawn. ![]() That also does not work: once the VIC started to draw the sprite, it will continue to do so.Īfter scouting through some forums I finally came across the solution: one needs to update the sprite pointer instead. That can be done, for example, using the register at d001, which controls the y-coordinate of Sprite 0. My second thought was to move the sprite to a different position on the screen. The VIC chip will stubbornly continue to draw the sprite. That sounds simple enough: ask the VIC to trigger an interrupt at the last raster line used for the room, switch off the player sprite, done. My initial thought was to just turn off the sprite in the VIC-II’s “sprite enabled” register, $d015. ![]() Not only would it look wrong to have the player sprite overlap the status bar, but it would also trigger a hardware collision detection interrupt, which the game utilizes to determine if the player hit any obstacles. See my post on raster bars for a discussion of some related techniques. The idea is to switch off the player sprite in the interrupt handler once the room graphics have been drawn by the raster beam. To implement the status bar, I am setting a raster interrupt for the bottom of the screen. That saves some additional bytes of memory per room. Second, now each room is 40×23 characters large (instead of the full screen, 40×25). First, it makes designing the map easier since those two fixed obstacles in each room are no longer a constraint. Now, the last two rows of characters are reserved for the status display, outside of the map area. flying into them would destroy the player’s ship. ![]() They were strictly speaking part of the map, i.e. Previously, there were two rectangles at the bottom left and right that showed information. All these graphics fit nicely into the 256 characters that the machine offers for tile-based graphics.Īnother map-related change is the status display. On top of that, there are now an industrial-looking area with steel beams, an area with grassy hills, and an area with scarce tunnels that are connecting places. The original area from the last version with its stone cellar look is still part of the game, and the game still starts there. To bring a bit more variety into the game and to make the visuals more interesting, there are new areas in the new map.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |