Jump to content

Photo

Smooth scrolling

Scrolling Assembler

347 replies to this topic

#51 nanochess OFFLINE  

nanochess

    Processorus Polyglotus

  • 5,868 posts
  • Coding something good
  • Location:Mexico City

Posted Sat May 18, 2013 1:04 PM

There is a further trick that is so overly complicated that I don't have used it, but you can define characters while the scene is scrolling.

So effectively the complexity of scene would be only limited by your ROM space.

#52 Tursi OFFLINE  

Tursi

    Quadrunner

  • 5,638 posts
  • HarmlessLion
  • Location:BUR

Posted Mon May 20, 2013 12:29 AM

Do you still have the source code you used for your video available? I would like to test if changing the location of the sprite tables in VDP RAM makes a difference. I would also like to try it on my PAL console. Thanks.


Here's the source and an EA#3 object file (Windows text out of Asm994A).

Attached File  bitmaptest.zip   11.7KB   38 downloads

#53 Asmusr OFFLINE  

Asmusr

    River Patroller

  • Topic Starter
  • 3,110 posts
  • Location:Denmark

Posted Mon May 20, 2013 1:35 AM

Thanks Tursi.

#54 TheMole OFFLINE  

TheMole

    Dragonstomper

  • 819 posts
  • Location:Belgium

Posted Mon May 20, 2013 4:52 AM

This is an impressive one for the tms9918a:


#55 Asmusr OFFLINE  

Asmusr

    River Patroller

  • Topic Starter
  • 3,110 posts
  • Location:Denmark

Posted Mon May 20, 2013 9:30 AM

I can confirm that in Tursi's test program the bug does not appear when you have 3 pattern tables and only one color table. I tested it on a European (TMS9929A based) console. Moving the sprite pattern table to >3800 did not change anything.

#56 RXB OFFLINE  

RXB

    River Patroller

  • 3,583 posts
  • Location:Vancouver, Washington, USA

Posted Mon May 20, 2013 1:39 PM

This is an impressive one for the tms9918a:
http://www.youtube.com/watch?v=3wcsjlgz5AI


I thought only the 9938 or 9958 was the MSX chip as I have the manual on the MSX chips and the 9918a is never mentioned as one?
Also I have never heard of a 9918 that had more then 16K but could be expanded by paging RAM to 64K but never 128K?

#57 Tursi OFFLINE  

Tursi

    Quadrunner

  • 5,638 posts
  • HarmlessLion
  • Location:BUR

Posted Mon May 20, 2013 3:09 PM

The MSX1 used a 9918A. That video shows an MSX2, but it could still be running in the 9918A compatible bitmap mode, I don't see anything there that it definitely can't do.

#58 RXB OFFLINE  

RXB

    River Patroller

  • 3,583 posts
  • Location:Vancouver, Washington, USA

Posted Mon May 20, 2013 3:30 PM

Cool but the Smooth Scrolling gave me a idea for a application that leads to a new game.

Features:
1. Uses the 1024K of the SAMS in Classic99 but should be able to run on a normal TI99/4A with HARD drive or multiple disks.
2. Loads screen from SAMS and saves them to SAMS as you move.
3. Just to create the screen map takes 10 minutes using Classic99 in System Maximum on CPU Throttling and RXB.
4. As it can save the screen maps the game can be stopped and restarted where you left off but have to start over at the beginning starting point.
5. Old obstacles and goals are saved as the game progresses. Thus the game can be ended and saved back to disks or hard drives.
6. New game maps can be generated by the player for new games or modify old game obstacles or goals.
7. The game is entirely only able to be run in RXB. (Assembly is possible but highly unlikely as memory not shared by running program and the maps in RXB)

I am not a game writer but wanted to create something not seen before and uses the full potential of the SAMS.

#59 Asmusr OFFLINE  

Asmusr

    River Patroller

  • Topic Starter
  • 3,110 posts
  • Location:Denmark

Posted Sat Jun 8, 2013 3:15 PM

Just an update to show that my space scrolling demo is still (slowly) progressing. There have been some tough pills to swallow in the process of turning the demo into a framework for a game, but it still looks like a doable project.



The frame rate has dropped from 60 to 30 FPS to provide time for a game loop, but to compensate you can now scroll either 1,2 or 4 pixels per frame. At 2 pixels per frame it still looks nice and smooth, but at 4 pixels per frame it becomes quite bumpy.

Because of the >8 sprite bug in half bitmap mode I now update all 3 VDP pattern tables unless an F18A is detected (Classic99 detects an F18A by the method I use). This makes the frame rate drop further to 20 FPS, which is not terrible (see how it looks in Win994a), but my plan is to dynamically switch full pattern table updating on/off depending on whether more than 8 sprites are visible. Has this been tried before? (Note: at the moment I don't think >8 sprites are ever visible).

I have added a basic example of interaction with the scrolling background - you can now shoot the pyramids. This requires more character patterns to be updated so it has to be limited to a few tiles.

I have also added basic support for enemy ships moving around in predefined paths (no interaction yet), and a few animations.

Disk image (E/A 3: SCO) and source code attached.

Attached Files



#60 Mobsie OFFLINE  

Mobsie

    Space Invader

  • 32 posts

Posted Sun Jun 9, 2013 8:57 AM

Perfect!


#61 Willsy OFFLINE  

Willsy

    River Patroller

  • 3,100 posts
  • Location:Uzbekistan (no, really!)

Posted Mon Jun 10, 2013 2:19 AM

Wow! BRILLIANT! :thumbsup: :thumbsup: :thumbsup: :thumbsup: :thumbsup: :thumbsup: :thumbsup:

#62 OX. OFFLINE  

OX.

    Dragonstomper

  • 517 posts

Posted Mon Jun 10, 2013 10:27 AM

Wow! BRILLIANT! :thumbsup: :thumbsup: :thumbsup: :thumbsup: :thumbsup: :thumbsup: :thumbsup:


I second that Wow! Hope it becomes a full game.

#63 RobertLM78 OFFLINE  

RobertLM78

    Stargunner

  • 1,055 posts

Posted Mon Jun 10, 2013 12:06 PM

Pretty awesome RasmusM :cool:. Hope it becomes a full game, too :).

#64 rocky007 OFFLINE  

rocky007

    Moonsweeper

  • 395 posts
  • Location:Belgium

Posted Mon Jun 10, 2013 4:42 PM

very impressive !

#65 Asmusr OFFLINE  

Asmusr

    River Patroller

  • Topic Starter
  • 3,110 posts
  • Location:Denmark

Posted Sun Jul 7, 2013 2:17 PM

In this demo project I wanted to try out two new things on the same kind of space graphics I use in the half-bitmap mode project (which, BTW, is still going strong):
  • Horizontal scrolling
  • Scrolling in normal graphics mode 1
http://www.youtube.com/watch?v=Js4hhBIdJlc

The attractive thing about using mode 1 for scrolling is that it's possible to use pattern table switching, which is not possible in bitmap mode. This demo uses four pattern table buffers, each divided into a low character set (0-127) and a high character set (128-255). This allows you to pre-load up to 128 patterns in 8 scroll positions/frames into VDP RAM. The demo also utilizes two name/screen table buffers - one for the low character set and one for the high character set. The scheme for switching buffers goes like this:
  • Frame 0: Pattern table 0, Name table 0 - low
  • Frame 1: Pattern table 1, Name table 0 - low
  • Frame 2: Pattern table 2, Name table 0 - low
  • Frame 3: Pattern table 3, Name table 0 - low
  • Frame 4: Pattern table 0, Name table 1 - high
  • Frame 5: Pattern table 1, Name table 1 - high
  • Frame 6: Pattern table 2, Name table 1 - high
  • Frame 7: Pattern table 3, Name table 1 - high
In terms of performance only the preparation of the name tables matters. Since we have 4 frames to prepare a table of 768 bytes we need to send only 192 bytes to the VDP RAM per frame. This leaves plenty of CPU cycles for sprites and other stuff - even at 60 FPS. The demo shows different speeds from 15 FPS to 60 FPS at 1 pixel/frame, and the top speed is 60 FPS at 2 pixels/frame. When moving 2 pixels you only have 2 frames to prepare a name table, i.e. 348 bytes per frame.

Another good thing about mode 1 compared to half bitmap mode is that all 32 sprites can be used without running into the 'duplication bug'.

The downside of using mode 1 is the limited colors, of course. Two adjacent tiles in the direction of scrolling must either use the same foreground color or the pattern for one of them must not contain any foreground color pixels (i.e. a 'space'). The same rule applies to the background colors. (Actually, horizontal scrolling in bitmap mode is subject to the same color limitations but applied to each individual scan line.)

I'm going to post an update to the Magellan thread that provides better tools for designing mode 1 scrolling graphics plus an export function for generating the transition map, which I used for this project.

This attachment contains a dsk file with the demo (looks much better in Classic99 and even better on hardware than on the video).
Attached File  hscroll.zip   21.9KB   31 downloads
The source code is also included. Note that the code is overly complicated because of the scrolling at different speeds and because of the wrap around of the map. If these features were not required it could be done much simpler.

#66 --- Ω --- OFFLINE  

--- Ω ---

    Hexacorerunner

  • 13,924 posts
  • Location:82.102.25.76

Posted Sun Jul 7, 2013 2:37 PM

Damn, NOT BAD! :thumbsup:
The graphics sort of remind me of Commander Keen! ;-)

#67 Opry99er OFFLINE  

Opry99er

    Quadrunner

  • 10,731 posts
  • Location:Hustisford, WI

Posted Sun Jul 7, 2013 2:40 PM

Slick, slick, slick!!!

You're killin' it, man!!

#68 OX. OFFLINE  

OX.

    Dragonstomper

  • 517 posts

Posted Sun Jul 7, 2013 4:49 PM

Wow, like Uridium on the C64, you've got to make a game from these demo man!

#69 Ksarul OFFLINE  

Ksarul

    Quadrunner

  • 5,270 posts

Posted Sun Jul 7, 2013 5:52 PM

These are definitely Nice! :)

#70 idflyfish OFFLINE  

idflyfish

    Chopper Commander

  • 137 posts

Posted Sun Jul 7, 2013 6:09 PM

Unbelievable

#71 OX. OFFLINE  

OX.

    Dragonstomper

  • 517 posts

Posted Tue Jul 9, 2013 1:47 PM

Tursi, this demo's a little jerky using Classic99 but nice and smooth using MESS, are these timing issues? Was wondering if there's a fix as it also affects other stuff.

#72 Willsy OFFLINE  

Willsy

    River Patroller

  • 3,100 posts
  • Location:Uzbekistan (no, really!)

Posted Tue Jul 9, 2013 4:27 PM

Wow! You're kicking the shit outta that VDP man! Holy dog biscuits! My flabber has been well and truly gasted!

#73 RXB OFFLINE  

RXB

    River Patroller

  • 3,583 posts
  • Location:Vancouver, Washington, USA

Posted Tue Jul 9, 2013 10:21 PM

VERY IMPRESSIVE!

#74 Opry99er OFFLINE  

Opry99er

    Quadrunner

  • 10,731 posts
  • Location:Hustisford, WI

Posted Tue Jul 9, 2013 10:55 PM

By far the sickest demo I have seen in a long while.... Every time I watch it it impresses me more.

#75 Asmusr OFFLINE  

Asmusr

    River Patroller

  • Topic Starter
  • 3,110 posts
  • Location:Denmark

Posted Wed Jul 10, 2013 4:12 AM

Thank you for all the positive feedback. I see lots of potential for using this technique for games (platform, driving, pinball to name a few ideas), and I hope that some of you will be inspired to make your own projects so we can share ideas and techniques. For now I'm focused on the vertically scrolling, half-bitmap project, which is beginning to look like a game, but I'm still not 100% sure what the objectives of the game are...





Also tagged with one or more of these keywords: Scrolling, Assembler

0 user(s) are browsing this forum

0 members, 0 guests, 0 anonymous users