Jump to content

Photo

Solaria's code


8 replies to this topic

#1 NRV OFFLINE  

NRV

    Moonsweeper

  • 354 posts

Posted Sun Apr 15, 2018 1:04 AM

Hi, couldn't resist doing this..

Here is a port of the Solaria "teaser" done for our A8's (ntsc version only for now).
The original palette used the 256 colors of the 7800, so it loses some of the more subtle color variations of the background, but is more or less the same.
Also the scrolling text doesn't start from the bottom.. that maybe can be done, but it would be a pain in the ass x)
It can be moved down right now, but it doesn't look that good starting near the sun (it loses legibility).

solaria_ntsc.png

I used most of the assets that Fragmare posted here http://atariage.com/...csmusic-mockup/

Would post a video and talk more about the code later (source and all files included).

Regards!

Attached File  Solaria.zip   34.23KB   39 downloads

Edited by NRV, Sun Apr 15, 2018 1:15 AM.


#2 Fragmare OFFLINE  

Fragmare

    Chopper Commander

  • 204 posts

Posted Sun Apr 15, 2018 11:19 AM

Hah!  Awesome!  I love it!  :D



#3 NRV OFFLINE  

NRV

    Moonsweeper

  • Topic Starter
  • 354 posts

Posted Sun Apr 15, 2018 11:21 PM

Mini development blog:

The background color is changed every line with a big DLI, that starts at the top of the screen, and ends several scan lines after the bottom of the screen.
After the section of the DLI that controls the background colors, we do a lot of other things, like playing the RMT music, managing the logic state of the demo, or resetting some registers for the next frame.

There is no VBI, and the main code loop only have a "Here jmp Here" instruction.
If you want to see how much time is available per frame, just hold any CONSOL key (and set Altirra's overscan mode to "full").

Apart from changing the background colors, the "main" section of the DLI also modify other color registers, the P/M's (positions, colors and size) and the Prior register (yep, the timing was tight sometimes, so self modifying code was used in some points).
The title and the sun graphics are done in g15 mode. A part of the sun, the heroes and the terrain are done using all the P/M's. The scrolling text is in char mode Antic4.

The demo has 5 internal states:
- The title fade-in is done changing the value of 3 color registers.

- The background fade-in is done changing one pointer, so the DLI code take the background colors from a new table.

- The movement of the sun is done with horizontal fine scrolling (and updating the LMS's in the display list), using a wide screen mode. At the same time the P/M's position is updated.

- The movement of the title image that leaves the screen is done changing the LMS pointer for that area in the display list (no use of VSCROL here). At the same time, to avoid crossing a 4K area, or having a lot of empty memory after the image, I just start writing blank line instructions directly into the display list.

- When starting the movement of the scrolling text we change the display list for another with char lines.
Also we change the wide playfield mode to use narrow mode. This helps with the timing for the DLI, because of the badline for every char line used.
The movement of the text is done using vertical scrolling and updating the top LMS, as usual.
The color masks at the top and bottom are done updating the char colors. The only tricky part is the bottom mask, where you also need to change the P/M's priority per line (between been in top, and been behind).

There is no pal version for now. It would mean changing the colors, adjusting the times for every part and changing the music.
Trying to do 2 RMT's calls in the same frame could be difficult, but PAL has more time per frame. I don't know if that would sound correct.
The only "bad" thing of the NTSC version is that the sun looks "thin", if you use the correct pixel ratio (at least in Altirra).

There are a lot of comments in the code for anyone that want to take a look, but also many hard coded numbers x)
This was a fast, "just program, don't think" job, most of the time :)


Edited by NRV, Mon Apr 16, 2018 12:12 AM.


#4 Heaven/TQA OFFLINE  

Heaven/TQA

    Quadrunner

  • 10,680 posts
  • Location:Baden-Württemberg, Germany

Posted Mon Apr 16, 2018 3:59 AM

Mini development blog:

The background color is changed every line with a big DLI, that starts at the top of the screen, and ends several scan lines after the bottom of the screen.
After the section of the DLI that controls the background colors, we do a lot of other things, like playing the RMT music, managing the logic state of the demo, or resetting some registers for the next frame.

There is no VBI, and the main code loop only have a "Here jmp Here" instruction.
If you want to see how much time is available per frame, just hold any CONSOL key (and set Altirra's overscan mode to "full").

Apart from changing the background colors, the "main" section of the DLI also modify other color registers, the P/M's (positions, colors and size) and the Prior register (yep, the timing was tight sometimes, so self modifying code was used in some points).
The title and the sun graphics are done in g15 mode. A part of the sun, the heroes and the terrain are done using all the P/M's. The scrolling text is in char mode Antic4.

The demo has 5 internal states:
- The title fade-in is done changing the value of 3 color registers.

- The background fade-in is done changing one pointer, so the DLI code take the background colors from a new table.

- The movement of the sun is done with horizontal fine scrolling (and updating the LMS's in the display list), using a wide screen mode. At the same time the P/M's position is updated.

- The movement of the title image that leaves the screen is done changing the LMS pointer for that area in the display list (no use of VSCROL here). At the same time, to avoid crossing a 4K area, or having a lot of empty memory after the image, I just start writing blank line instructions directly into the display list.

- When starting the movement of the scrolling text we change the display list for another with char lines.
Also we change the wide playfield mode to use narrow mode. This helps with the timing for the DLI, because of the badline for every char line used.
The movement of the text is done using vertical scrolling and updating the top LMS, as usual.
The color masks at the top and bottom are done updating the char colors. The only tricky part is the bottom mask, where you also need to change the P/M's priority per line (between been in top, and been behind).

There is no pal version for now. It would mean changing the colors, adjusting the times for every part and changing the music.
Trying to do 2 RMT's calls in the same frame could be difficult, but PAL has more time per frame. I don't know if that would sound correct.
The only "bad" thing of the NTSC version is that the sun looks "thin", if you use the correct pixel ratio (at least in Altirra).

There are a lot of comments in the code for anyone that want to take a look, but also many hard coded numbers x)
This was a fast, "just program, don't think" job, most of the time :)

 

 

cool... but you would add more to the pic... can you move the water little bit? below the scroller.... or make the water "sparkle"?



#5 MrFish ONLINE  

MrFish

    River Patroller

  • 4,765 posts
  • Location:1010-1010

Posted Mon Apr 16, 2018 12:34 PM

can you move the water little bit? below the scroller.... or make the water "sparkle"?

 

I was thinking of this too.



#6 NRV OFFLINE  

NRV

    Moonsweeper

  • Topic Starter
  • 354 posts

Posted Mon Apr 16, 2018 1:03 PM

I agree with both of you, but not for now x)

I also wanted to do that. Doing the movement with fine scrolling should be "easy".
Probably it would be better to merge the movement and the "sparkle" into animation frames, but someone would need to provide them to me :)

At some point I started looking at sunset gif's:
sunset.gif
sunset_moon.gif
sunset2.gif

Other ideas: a falling star at the end, the sun setting down slowly, some stars appearing at the top of the sky, the heroes jumping from the cliff..

Edited by NRV, Mon Apr 16, 2018 1:44 PM.


#7 MrFish ONLINE  

MrFish

    River Patroller

  • 4,765 posts
  • Location:1010-1010

Posted Mon Apr 16, 2018 1:28 PM

the heroes jumping from the cliff..

 

Hahaha...



#8 Fragmare OFFLINE  

Fragmare

    Chopper Commander

  • 204 posts

Posted Mon Apr 16, 2018 9:19 PM

I agree with both of you, but not for now x)

I also wanted to do that. Doing the movement with fine scrolling should be "easy".
Probably it would be better to merge the movement and the "sparkle" into animation frames, but someone would need to provide them to me :)


Other ideas: a falling star at the end, the sun setting down slowly, some stars appearing at the top of the sky, the heroes jumping from the cliff..

 

I'm on it.  You want separate animation frames or palette shifting sparkles?  ;)

 

I like the falling star idea!  I was also thinking of having the shimmering line-scrolling or some small birds at the end maybe, but I didn't know if there would be enough resources left.


Edited by Fragmare, Mon Apr 16, 2018 9:33 PM.


#9 NRV OFFLINE  

NRV

    Moonsweeper

  • Topic Starter
  • 354 posts

Posted Tue Apr 17, 2018 10:31 AM

I'm on it.  You want separate animation frames or palette shifting sparkles?  ;)
 
I like the falling star idea!  I was also thinking of having the shimmering line-scrolling or some small birds at the end maybe, but I didn't know if there would be enough resources left.


Haha, if you are going to do it, full animation frames would be better and more flexible :P
Below the sun area you have 3 color registers available (you used two colors in the current sun reflection).

The falling star could be done with players, in the screen area over the sun.
The top of the sun is done with all the players at the end, so if there are small birds they should fly between the sun and the heroes (small area), or just over the sun.

Also, try to use the even luminances in the 256 color palette (0, 2, 4, .. 14), if you want a direct conversion for the A8 :)




0 user(s) are browsing this forum

0 members, 0 guests, 0 anonymous users