First coding attempts...

Page 1/2
| 2

By BlueCrystal

Rookie (23)

BlueCrystal's picture

15-01-2012, 23:19

In october of last year, I made this thread. During the x-mas holidays I managed to find some time and actually start doing some coding.

Being a child of the 90's and growing up with the msx demo scene, I decided to create a demo/scroller (how original..). I tried to make a full screen, 2 layer scroller. Unfortunately, I haven't seen it working on a real msx machine, just bluemsx, thus it could look really crappy or might not even work. It does contain some minor bugs. In the end it is the idea to scroll the background in all directions.

The code is not yet optimized, but as work in progress it is good enough to release it. It is not yet hooked on an interrupt, just using the halt statement to get it 'smooth'.

If you are interested, you can download it here.

Let me know your thoughts!

Login or register to post comments

By ARTRAG

Prophet (3870)

ARTRAG's picture

15-01-2012, 23:57

greetings!!! very good for a screen 5 demo
how do you do it?
a side note:
on bluemsx it hangs under msx turboR

By Google

By mars2000you

Prophet (2646)

mars2000you's picture

16-01-2012, 00:08

greetings!!! very good for a screen 5 demo
how do you do it?
a side note:
on bluemsx it hangs under msx turboR

It works if you press on the 1 key when booting. Conflict with MSX-DOS2 ?

Additional tests : on openMSX, it hangs with MSX2, MSX2+ and MSXturboR (except, in the last case, if you press on the 1 key when booting).

I think tests on real machines are really required.

By Manuel

Enlighted (7235)

Manuel's picture

16-01-2012, 10:33

Pressing the '1' key is needed on turboR indeed. Same on real turboR. I don't have an MSX2 nearby to test on.

However, it doesn't always work when pressing the '1' key. It seems to depend on how long you press it. (Both on real GT and openMSX.)

Oh, I just tried: it's not pressing the '1' key... it's pressing any key. I got it to boot on a GT pressing the 's' key. Smile (The boot sector is DOS1, so the turboR will boot already in Z80 mode with DOS1.)
And, the same thing also helps to get it booted on an MSX2 in openMSX. So, I guess something is wrong timing-wise in the program.

By BlueCrystal

Rookie (23)

BlueCrystal's picture

19-01-2012, 21:12

Hey, thanks Artrag for the nice feedback. Good to hear that you like it.

At this moment, I absolutely have no idea why it hangs.  Could it be that the starting adress is #c000 ? I just took this one as it was in my code lines of 13 years ago. I haven't taken a look at memory locations/how msx memory works at all. The code is just 1.5kb compiled, thus I assume length isn't an issue.

In regard to how it was done?  I guess we aren't in the 90s anymore where all things are a "secret", thus...

The checkered background is build up out of color 8 and 10. Scrolling this background is done by adding one colored line to the directon you want to go and removing one on the other side. The trick (or should I say, the smart idea) is that this is done by drawing a line and using a logical operator on it. Color 8 xor 2 = color 10, color 10 or 2 = color 8, color 8 or 2 = color 10, color 10 xor 2 = 8. In other words, the new line flips the color from 8 to 10 or from 10 to 8.

The original font has just one color, namely 7. But using the xor/or function on it, it also uses 5. But both are defined as the same. Color 7 xor 2 = color 5, color 5 xor 2 = color 7, color 7 or 2 = color 7, color 5 or 2 =  color 7.

This technique provides that you can do anything on the background, without visibly affecting the foreground. But it also limits it to just these colors. I haven't taken a deeper look at it if it also works with different palet numbers.

I have to say, I haven't seen anyone use it before. I do know now that maggoo (iod metal limit, sonic player) did a checkered background scroll (32by32), but he had fixed vertical bars and used color splits to make it scroll.

I would still like to add a new 3rd (top) layer by using sprites, but that is something for the future Smile

By ARTRAG

Prophet (3870)

ARTRAG's picture

19-01-2012, 22:40

Great! Your color trick can work also with other shapes, not only lines.
About the hang, it could be that you use ram that on the TR is used by the msxdos2
IIRC on msxTR the stack is pointer is about 0xD300 (even with one single disk active)

By wolf_

Ambassador (9120)

wolf_'s picture

19-01-2012, 23:05

Megaupload is down as a result of some US Piracy law.

By Latok

msx guru (3022)

Latok's picture

19-01-2012, 23:16

I was trying to download the demo as well just minutes ago, haha. After that, I coincidentally read about Megaupload being shut down...

By BlueCrystal

Rookie (23)

BlueCrystal's picture

19-01-2012, 23:38

By Eugeny_Brychkov

Champion (457)

Eugeny_Brychkov's picture

20-01-2012, 13:53

Sometimes you change current VDP status register to 2 without disabling interrupts. If during execution of the code interrupt occurs, it will read from s#2 instead of s#0 and it may cause system misbehavior. Please ensure that you algorithm always disables interrupts before changing status register ptr, resets back to stat reg #0 before enabling interrupts.
Or, the other way round - in the middle of your code iterrupt is called and stat reg is reset to 0 - you will get wrong value from VDP then.
Or, it will cause just a broken sequence of VDP-CPU communication (and this is most probably what is hapenning).

By NYYRIKKI

Prophet (2771)

NYYRIKKI's picture

20-01-2012, 17:05

I have to say, I haven't seen anyone use it before.
Hmm... At least I used this effect on Diary (http://www.msx.org/downloads/mrc-challenges/bounce/11-diary) but I'm pretty sure I'm not only one...

Page 1/2
| 2
My MSX profile