Super Mario on the BBC?

suggest games that you’ve always wanted to see on acorn platforms
Commie_User
Posts: 1309
Joined: Wed Jan 27, 2016 12:50 am
Contact:

Re: Super Mario on the BBC?

Post by Commie_User »

oss003 wrote:I have attached the .ATM and .CSW files of Mario for the Atom.
Was the CSW for me in particular? In case the BBC was compatible, my tape-centred machine didn't latch onto the data, while the UEF piped out to my other one - which does take standard images and MMC - only resulted in a blank screen and a cursor.

Though I did wonder of cross-compatibility. Certainly looked it.



Those sprites ARE from the Game Boy originally, I'm certain.
User avatar
tricky
Posts: 7698
Joined: Tue Jun 21, 2011 9:25 am
Contact:

Re: Super Mario on the BBC?

Post by tricky »

Oss003, did you get the map sorted for 2 pixels per frame?
All you should have to do is skip every other ldx,jsr draw, like the cloud.
To halve the tile data, the map data would also need a tweak, each byte has the page in the lower bits and there offset within the page in the upper bits, so rotating them one bit to the right and removing every other 8 bytes of data should work.
User avatar
oss003
Posts: 3849
Joined: Tue Jul 14, 2009 12:57 pm
Location: Netherlands
Contact:

Re: Super Mario on the BBC?

Post by oss003 »

tricky wrote:Oss003, did you get the map sorted for 2 pixels per frame?
All you should have to do is skip every other ldx,jsr draw, like the cloud.
To halve the tile data, the map data would also need a tweak, each byte has the page in the lower bits and there offset within the page in the upper bits, so rotating them one bit to the right and removing every other 8 bytes of data should work.
Ok, I'll give it a try.

One question about the 2 timers:
The first timer fires an IRQ when the FirstPeriod is expired and the second one is for checking the framerate time
How does this work and why are you using 2 timers?

Greetings
Kees
User avatar
oss003
Posts: 3849
Joined: Tue Jul 14, 2009 12:57 pm
Location: Netherlands
Contact:

Re: Super Mario on the BBC?

Post by oss003 »

Commie_User wrote:Was the CSW for me in particular? In case the BBC was compatible, my tape-centred machine didn't latch onto the data, while the UEF piped out to my other one - which does take standard images and MMC - only resulted in a blank screen and a cursor.
Yep, but it's the Atom version so won't work on a BBC.
The ATM file works in Atomulator.

Greetings
Kees
User avatar
tricky
Posts: 7698
Joined: Tue Jun 21, 2011 9:25 am
Contact:

Re: Super Mario on the BBC?

Post by tricky »

It's actually just the one timer, it's using an idea from RichTW. The first time is from the vsync, to just before the ground. The second time is actually the latched value for the first timer which will be loaded automatically 2 cycles after the timer triggers at the same place each frame. This gives the timing with only one timer and I don't even need the vsync!
Goodluck!
User avatar
1024MAK
Posts: 12783
Joined: Mon Apr 18, 2011 5:46 pm
Location: Looking forward to summer in Somerset, UK...
Contact:

Re: Super Mario on the BBC?

Post by 1024MAK »

@Commie_User - although both machines use a 6502 CPU, nearly everything else is different between a BBC Micro and an Atom. For example, the memory map is different, the video hardware system is completely different, as is the sound.

Mark
Commie_User
Posts: 1309
Joined: Wed Jan 27, 2016 12:50 am
Contact:

Re: Super Mario on the BBC?

Post by Commie_User »

1024MAK wrote:@Commie_User - although both machines use a 6502 CPU, nearly everything else is different between a BBC Micro and an Atom. For example, the memory map is different, the video hardware system is completely different, as is the sound.

Mark
B..b....but I saw the exact same thing! Running on the Atom video, I saw it I did! :wink:

I often have a stab at these things. I figured since I was only the one who asked for a CSW, something might have happened on my own Acorn.

Fingers crossed for a bunch of glitches.
User avatar
oss003
Posts: 3849
Joined: Tue Jul 14, 2009 12:57 pm
Location: Netherlands
Contact:

Re: Super Mario on the BBC?

Post by oss003 »

There are a lot of differences between the BBC and the Atom so what I did was converting Tricky's program so that it runs on an Atom.
The major changes are made in the display routines because the Atom screen differs from the BBC screen in resolution, colours and addressing method.

Greetings
Kees
User avatar
oss003
Posts: 3849
Joined: Tue Jul 14, 2009 12:57 pm
Location: Netherlands
Contact:

Re: Super Mario on the BBC?

Post by oss003 »

Ok, SID music and some Mario animation added.
The animation has to be finetuned because the sprite isn't updated if the background is white.

https://youtu.be/dCEwvcRX7Mw

Still have to do the 2 pixel scroll....

Greetings
Kees
User avatar
timmy
Posts: 172
Joined: Thu Apr 27, 2006 1:19 pm
Contact:

Re: Super Mario on the BBC?

Post by timmy »

Loving this thread guys!

Keep up the stirlin work Tricky & Kees!! :-)
User avatar
oss003
Posts: 3849
Joined: Tue Jul 14, 2009 12:57 pm
Location: Netherlands
Contact:

Re: Super Mario on the BBC?

Post by oss003 »

Animation is finetuned and expanded with one extra sprite.
The mario sprite on the screen is cleared in the wait_frame routine before shifting the background 1 pixel and plotting the mario sprite.

This is the mario sprite data:

Code: Select all

;----------------------------------------------------------------------------
; Data mario data
;----------------------------------------------------------------------------

mario_spr0_l:					; Mario white mask0
	.byte $00,$00,$00,$00,$00,$00,$00,$03
	.byte $07,$0e,$09,$03,$33,$31,$3b,$0e
	.byte $07,$01,$18,$3b,$37,$37,$3b,$8c
	.byte $00,$00,$00,$00,$00,$1e,$1f,$00
mario_spr0_r:
	.byte $00,$00,$00,$00,$00,$00,$f0,$f8
	.byte $00,$00,$f8,$a8,$a8,$fc,$7c,$00
	.byte $80,$f0,$00,$a0,$d4,$c4,$a4,$60
	.byte $00,$00,$40,$80,$00,$e0,$70,$00
mario_msk0_l:					; Mario black mask0
	.byte $ff,$ff,$ff,$ff,$ff,$ff,$fc,$f8
	.byte $f0,$e0,$e0,$c0,$80,$80,$80,$c0
	.byte $e0,$e0,$c0,$80,$80,$80,$80,$c0
	.byte $c0,$c0,$c0,$e0,$e0,$c0,$c0,$c0
mario_msk0_r:
	.byte $ff,$ff,$ff,$ff,$ff,$0f,$07,$03
	.byte $01,$00,$01,$03,$03,$01,$01,$01
	.byte $03,$07,$0f,$03,$01,$01,$01,$03
	.byte $07,$0f,$0f,$1f,$1f,$0f,$07,$07

mario_spr1_l:					; Mario white mask1
	.byte $00,$00,$00,$00,$00,$00,$00,$03
	.byte $07,$0e,$09,$03,$33,$31,$3b,$0e
	.byte $07,$01,$18,$3d,$3b,$3b,$3d,$1e
	.byte $00,$00,$00,$00,$06,$07,$03,$00
mario_spr1_r:
	.byte $00,$00,$00,$00,$00,$00,$f0,$f8
	.byte $00,$00,$f8,$a8,$a8,$fc,$7c,$00
	.byte $80,$f0,$00,$ad,$ea,$e2,$d2,$30
	.byte $00,$00,$00,$00,$00,$c0,$e0,$00
mario_msk1_l:					; Mario black mask1
	.byte $ff,$ff,$ff,$ff,$ff,$ff,$fc,$f8
	.byte $f0,$e0,$e0,$c0,$80,$80,$80,$c0
	.byte $e0,$e0,$c0,$80,$80,$80,$80,$c0
	.byte $e0,$e0,$f0,$f8,$f0,$f0,$f0,$fc
mario_msk1_r:
	.byte $ff,$ff,$ff,$ff,$ff,$0f,$07,$03
	.byte $01,$00,$01,$03,$03,$01,$01,$01
	.byte $03,$07,$07,$01,$00,$00,$00,$01
	.byte $07,$07,$0f,$0f,$1f,$1f,$0f,$0f

mario_spr2_l:					; Mario white mask2
	.byte $00,$00,$00,$00,$00,$00,$01,$07
	.byte $0e,$1c,$13,$07,$67,$63,$76,$1c
	.byte $0f,$03,$1c,$38,$37,$2f,$2f,$17
	.byte $40,$40,$40,$60,$60,$40,$00,$00
mario_spr2_r:
	.byte $00,$00,$00,$00,$00,$00,$e0,$f0
	.byte $00,$00,$f0,$50,$50,$f8,$f8,$00
	.byte $00,$e0,$00,$e6,$76,$82,$a8,$68
	.byte $00,$00,$00,$00,$00,$f0,$f8,$00
mario_msk2_l:					; Mario black mask2
	.byte $ff,$ff,$ff,$ff,$ff,$fe,$f8,$f0
	.byte $e0,$c0,$c0,$80,$00,$00,$00,$80
	.byte $c0,$e0,$c0,$80,$80,$80,$80,$00
	.byte $00,$00,$00,$00,$0c,$1c,$3c,$fc
mario_msk2_r:
	.byte $ff,$ff,$ff,$ff,$ff,$1f,$0f,$07
	.byte $03,$01,$03,$07,$07,$03,$03,$03
	.byte $07,$0f,$09,$00,$00,$00,$01,$03
	.byte $03,$07,$07,$0f,$0f,$07,$03,$03

mario_spr3_l:					; Mario white mask3
	.byte $00,$00,$00,$00,$00,$00,$00,$03
	.byte $07,$0e,$09,$03,$33,$31,$3b,$0e
	.byte $07,$01,$38,$77,$6f,$6f,$67,$30
	.byte $00,$00,$00,$00,$30,$3d,$1e,$00
mario_spr3_r:
	.byte $00,$00,$00,$00,$00,$00,$f0,$f8
	.byte $00,$00,$f8,$a8,$a8,$fc,$7c,$00
	.byte $80,$f0,$00,$60,$b0,$84,$4a,$c6
	.byte $06,$06,$06,$0c,$00,$00,$00,$00
mario_msk3_l:					; Mario black mask3
	.byte $ff,$ff,$ff,$ff,$ff,$ff,$fc,$f8
	.byte $f0,$e0,$e0,$c0,$80,$80,$80,$c0
	.byte $e0,$c0,$80,$00,$00,$00,$00,$80
	.byte $c0,$c0,$c0,$80,$80,$80,$80,$e0
mario_msk3_r:
	.byte $ff,$ff,$ff,$ff,$ff,$0f,$07,$03
	.byte $01,$00,$01,$03,$03,$01,$01,$01
	.byte $03,$07,$0f,$0f,$03,$00,$00,$00
	.byte $00,$00,$00,$0e,$f1,$ff,$ff,$ff

spr_l_lb:
	.byte <mario_spr1_l,<mario_spr3_l,<mario_spr1_l,<mario_spr2_l
spr_l_hb:
	.byte >mario_spr1_l,>mario_spr3_l,>mario_spr1_l,>mario_spr2_l
spr_r_lb:
	.byte <mario_spr1_r,<mario_spr3_r,<mario_spr1_r,<mario_spr2_r
spr_r_hb:
	.byte >mario_spr1_r,>mario_spr3_r,>mario_spr1_r,>mario_spr2_r
msk_l_lb:
	.byte <mario_msk1_l,<mario_msk3_l,<mario_msk1_l,<mario_msk2_l
msk_l_hb:
	.byte >mario_msk1_l,>mario_msk3_l,>mario_msk1_l,>mario_msk2_l
msk_r_lb:
	.byte <mario_msk1_r,<mario_msk3_r,<mario_msk1_r,<mario_msk2_r
msk_r_hb:
	.byte >mario_msk1_r,>mario_msk3_r,>mario_msk1_r,>mario_msk2_r

https://youtu.be/YKC-Ad6CUHk

And I changed the background colour back to green ..... :wink:

Greetings
Kees
User avatar
Arcadian
Site Admin
Posts: 4223
Joined: Fri Nov 24, 2000 12:16 pm
Contact:

Re: Super Mario on the BBC?

Post by Arcadian »

Even though I barely understand any of the tech talk, it's fascinating to see such great minds conspiring to etch out a Mario engine!

Loving the green Mario on the Atom! Tricky how about trying a cyan version on the Beeb to differentiate? (well it worked for Imogen!)
Please subscribe to the ABug YouTube channel!
User avatar
tricky
Posts: 7698
Joined: Tue Jun 21, 2011 9:25 am
Contact:

Re: Super Mario on the BBC?

Post by tricky »

OK, probably my last post on this one.
Here is a screenshot showing the time taken to process the different parts of a frame.
The big one isn't show, which, is when the main part of the level needs to move to the next character. There is a "quick" way to do it and if I ever get around to it, I will post the update with source, but it is quite a lot of work.
Instead of that, I have tried a different approach, where I search for the first char/tile not in the first column and shift the lda/stas, then update the addresses (-=8) and finally, unpack the new column on the right. This is generally quicker, but is still too slow for a real game.
timing.png
The experienced 8-bit programmers here will recognise this type of timing, but for those who don't, it is how we used to time routines BITD and is good, because it shows when something might flicker/tear, which is when the thing being drawn overlaps the time it is being drawn.
Here you can see that setting the timer to start above the floor is OK because by the time the sound has been processed and the clouds drawn, we are just below ground level and the level itself can be drawn, which in turn means that by the time the level is drawn, the floor won't overlap with the time it is being drawn.
If this was a real platform game where the player could jump or move quickly, there would be a bit before the clouds where the old player's position would be cleared, I would actually check if the player was below the clouds and clear them after the clouds if they were, this means that they wouldn't flicker on the floor, or when jumping into the clouds. Currently, they might flicker if they fell down the hole, but that wouldn't last for long.
EDIT: I use the same method to decide when I can draw the frog in my Frogger game and do a similar thing by splitting the screen into four layers for the vertical scrolling framework I am writing.
The attached .ssd is cyan and black, just for Arcadian ;)

Watch in "HD" for 50fps https://youtu.be/cvoTZyCKWhU
Attachments
hscroll.zip
new shift and update map code - in cyan and black
(32.64 KiB) Downloaded 137 times
Last edited by tricky on Sat Nov 26, 2016 12:49 pm, edited 1 time in total.
JSeymour
Posts: 3
Joined: Wed Nov 16, 2016 8:45 am
Contact:

Re: Super Mario on the BBC?

Post by JSeymour »

Really interesting! Didn't think the Beeb had it in her!
User avatar
tricky
Posts: 7698
Joined: Tue Jun 21, 2011 9:25 am
Contact:

Re: Super Mario on the BBC?

Post by tricky »

Thanks,, I'll try and dig out my original Starfield code, it's where the idea came from.
User avatar
oss003
Posts: 3849
Joined: Tue Jul 14, 2009 12:57 pm
Location: Netherlands
Contact:

Re: Super Mario on the BBC?

Post by oss003 »

Looks great Tricky =D> =D>

I also thought that such nice horizontal scrolling was not possible but you did it.
Only one remark, you call it a Super Mario demo ........... but where is Mario :shock: ?

:wink:
Greetings
Kees
User avatar
tricky
Posts: 7698
Joined: Tue Jun 21, 2011 9:25 am
Contact:

Re: Super Mario on the BBC?

Post by tricky »

He just popped out, to be honest, I couldn't find an anim I liked!
See if you can find him in this demo!
This is as close as I can remember to one of the first bits I did for Jeltron.
This should work convert well on to the Electron and should easily fit in the off-screen time on the Atom :D
.ssd, asm and code to generate the .asm included.
Have a play with the .pat0..7 "frames" if you are feeling adventurous.

EDIT: This is what.

Watch in "HD" for 50fps https://youtu.be/Tbt0y8UfILc
Attachments
GuessWhat.zip
.ssd, asm and code to generate the .asm included.
(17.53 KiB) Downloaded 123 times
Last edited by tricky on Sat Nov 26, 2016 1:05 pm, edited 1 time in total.
Commie_User
Posts: 1309
Joined: Wed Jan 27, 2016 12:50 am
Contact:

Re: Super Mario on the BBC?

Post by Commie_User »

And I've got some music. Alright, being a programming dunce, it's an MP3 of a Mario mix.

But it's using the Cybertron samples again, so it may give a rough idea of what any music could sound like. And being rough, you can tell the voices apart.

Good old Cybertron Mission. One of the best soundbanks I've raided all this month.
Mario.mp3
(1.14 MiB) Downloaded 117 times
http://www.midishrine.com/index.php?id=58
Commie_User
Posts: 1309
Joined: Wed Jan 27, 2016 12:50 am
Contact:

Re: Super Mario on the BBC?

Post by Commie_User »

Or what about this, if Tricky wants to go for the biggest BBC heist in his life?
Mario Castle LA Scoring Strings.mp3
(1.15 MiB) Downloaded 134 times
It's amazing how good orcehstra software is nowadays. Well take that and put it to audio cassette, using the BBC motor control to activate it at the start of a level and halt it at the end! Kind-of how the Atari tape module worked for multimedia in the console Bronze Age.

Ah, the dreams of the future. Not in my lifetime, alas.

Image
User avatar
tricky
Posts: 7698
Joined: Tue Jun 21, 2011 9:25 am
Contact:

Re: Super Mario on the BBC?

Post by tricky »

Sorry, music really isn't my thing.
Commie_User
Posts: 1309
Joined: Wed Jan 27, 2016 12:50 am
Contact:

Re: Super Mario on the BBC?

Post by Commie_User »

It needn't be in this case. I downloaded some MIDI files and let the PC take the strain: http://www.midishrine.com/index.php?id=59



Mario 2 LA Scoring Strings.mp3
(1.37 MiB) Downloaded 109 times
Samples really are incredible now. Classic music from when game tunes really WERE compositions and symphonies.
ThomasHarte
Posts: 563
Joined: Sat Dec 23, 2000 5:56 pm
Contact:

Re: Super Mario on the BBC?

Post by ThomasHarte »

Commie_User wrote:
tricky wrote:I don't believe that is actually an original 2600.
I don't think you can even do the text for the score.

Oh it's true, alright. I downloaded it and it runs well in Stella, the emulator. I've included it so nobody else has to go through the create account rubbish of the download server. You just type anything in but, still.

And don't knock the Atari. It had some incredibly accomplished graphics and polished games. Robot Tank is a wonderfully smooth, realistic first person shooter, while the original official Mario Bros was quite detailed for what it was.

Bit more here: https://thewanderingnerd.wordpress.com/ ... ts-part-2/
The six-digit score thing is a relatively common trick used even during the 2600's original commercial life; each sprite can be repeated three times with a one-sprite gap between so you can get a six digit score by having the first digit be the first sprite, the second digit be the second sprite, the third digit be a repetition of the first sprite, the fourth be a repetition of the second, etc. Then you rewrite the second sprite's contents during columns in which the first is displaying, rewrite the first's during columns in which the second is displaying.

The Atari's WSYNC signal — write to it and it'll assert the 6502's wait line until the right margin begins — makes racing the beam less onerous than perhaps you might instinctively assume. It's much more trouble to write interesting whole-screen display routines plus gameplay and state in the limited storage available than it is to do each single cool graphics thing in isolation.
Post Reply

Return to “new ideas wishlist & general chat”