Have an idea where this might go
Have an idea where this might go
Currently working on a scrolling routine and it's working fairly well though it's just wrapped around just now, and the bottom half of it'll be cut off when using it for a game. At the moment it's running on a BBC emulator but I'm going to move it over to an electron emulator at some point.
Got a few ideas of what I might use it for.
A demo of it running at the moment.
https://youtube.com/shorts/ZeoV1Q8p4jE?feature=share
Got a few ideas of what I might use it for.
A demo of it running at the moment.
https://youtube.com/shorts/ZeoV1Q8p4jE?feature=share
Re: Have an idea where this might go
Looks like a good start, but I don't think that the elk has that much flexibility in its ULA.
I've not seen anyone make a video by capturing Android before
I've not seen anyone make a video by capturing Android before
Re: Have an idea where this might go
Unfortunately as far as I know there's not an elk emulator for Android so I'm using this beeb-x to code on the go. This demo doesn't make use of any particular hardware features so should be ok on the electron except a bit slower but if I make a game out of this, the display is only going to be half the height so only got half as much to draw.
- Diminished
- Posts: 1235
- Joined: Fri Dec 08, 2017 9:47 pm
- Contact:
Re: Have an idea where this might go
Looks a lot better than any of my previous attempts at demos ...
Re: Have an idea where this might go
It's not really meant as a demo as such, needs better artwork and some music. But now I need a way of drawing game level maps into it.
Re: Have an idea where this might go
Running on electrem on the PC it runs at just over 13 FPS, or with just the top half its 24 FPS. That's including a couple of calculations for the position and calling the routine from basic each frame.
On the BBC emulator it's 42 for half screen height and 24 for full screen height.
On the BBC emulator it's 42 for half screen height and 24 for full screen height.
Re: Have an idea where this might go
Sorry, I thought that you were using hardware scrolling.
Re: Have an idea where this might go
No problem, I don't know much about the BBC's hardware, is it capable of hardware scrolling with position per pixel?
Is it possible to switch the ULA's display processing on and off, since I'm only wanting to display anything on the top half of the screen could I get faster ram access by switching it off on the bottom half?
Is it possible to switch the ULA's display processing on and off, since I'm only wanting to display anything on the top half of the screen could I get faster ram access by switching it off on the bottom half?
Re: Have an idea where this might go
This is it running on the Electrem emulator.
It's double buffered with vsync and half the screen being blanked. I've just put in wait for the vsync and a delay to get the blanking position in the right place (on electrem at least) so the frame rate is down to 16.67fps.
https://youtu.be/kuY20dXXdb8
It's double buffered with vsync and half the screen being blanked. I've just put in wait for the vsync and a delay to get the blanking position in the right place (on electrem at least) so the frame rate is down to 16.67fps.
https://youtu.be/kuY20dXXdb8
Re: Have an idea where this might go
Cool!
0xC0DE
"I program my home computer / Beam myself into the future"
Follow me on Twitter
Visit my YouTube channel featuring my games and demos for Acorn Electron and BBC Micro
"I program my home computer / Beam myself into the future"
Follow me on Twitter
Visit my YouTube channel featuring my games and demos for Acorn Electron and BBC Micro
Re: Have an idea where this might go
Just by setting the wait condition immediately after drawing is finished and placing the wait loop immediately before drawing starts it's up to 20fps now.
I'm a bit confused though, 20 doesn't go into 50, unless it's because of what I'm doing and it's alternating between 2 and 3 refreshes for each update or something.
I'm a bit confused though, 20 doesn't go into 50, unless it's because of what I'm doing and it's alternating between 2 and 3 refreshes for each update or something.
Re: Have an idea where this might go
Nice work! It's impressive to see all that stuff move around so quickly - and quite smoothly, too!
Re: Have an idea where this might go
Thanks, hopefully it'll be even better once I get the mapping working so it's not just a repeating pattern, but how much that'll slow it down remains to be seen.
Edit: with the main loop now in assembly the whole thing runs at 25fps!
Edit: with the main loop now in assembly the whole thing runs at 25fps!
Re: Have an idea where this might go
Very good.
It will be interesting to see what you do with this next. Also, to see what you can do if you don't need to redraw everything.
It will be interesting to see what you do with this next. Also, to see what you can do if you don't need to redraw everything.
Re: Have an idea where this might go
I'm looking into if I can improve on this at all at the moment, there may be some ways but the improvements will only be very small and the solutions quite complex so probably time to move onto the other steps.
Maybe with less filling the entire screen full screen scrolling of levels could be possible, that's not what I'm aiming for right now but could be something to look into later.
Maybe with less filling the entire screen full screen scrolling of levels could be possible, that's not what I'm aiming for right now but could be something to look into later.
Re: Have an idea where this might go
Working out a few things so this is a bit of test code, it scrolls the whole mode 5 screen left by 1,2 or 3 pixels. It's pretty slow though and probably not really much use. But I'm looking for ways to fill in the new edges of my fast scrolling.
Code: Select all
10 MODE 5
20 DIM Q% 1000
30 FOR I%=0 TO 3 STEP 3
40 P%=Q%
50 [OPT I%
60 .shlut EQUD&000B1116
70 .sh EQUB0
80 .temp EQUB0
90 .init
100 LDX #0:.lut STX temp:LDA #0 110LSR temp:BCC n0:CLC:ADC#1:.n0 LSR temp:BCC n1:CLC:ADC#16:.n1 LSR temp:BCC n2:CLC:ADC#2:.n2 LSR temp:BCC n3:CLC:ADC#32:.n3 LSR temp:BCC n4:CLC:ADC#4:.n4 LSR temp:BCC n5:CLC:ADC#64:.n5 LSR temp:BCC n6:CLC:ADC#8:.n6 LSR temp:BCC n7:CLC
120 ADC #128:.n7:STA &3600,X:TAY:TXA:STA &3700,Y:INX:BNE lut
130RTS
140.scroll
150LDA #&58:STA r0+2:STA r1+2:STA w+2
160LDX sh:LDA shlut,X:STA jump+1
170LDY #0:.loop
180.r0 LDX &5808,Y:LDA &3700,X:STA &70
190.r1 LDX &5800,Y:LDA &3700,X
200CLC:.jump BCC jump
210LSR A:ROR &70:LSR A:ROR &70
220LDX &70:JMP done
230ASL &70:ROL A:ASL &70:ROL A
240ASL &70:ROL A:ASL &70:ROL A
250TAX:.done LDA &3600,X
260.w STA &5800,Y
270INY:BNE loop
280LDA r0+2:CLC:ADC #1
290STA r0+2:STA r1+2:STA w+2
300BPL loop:RTS
310 ]:NEXT
320 REM sh=pixels to scroll 0-3
330 ?sh=1
340 CALL init
350 FOR I%=0 TO 20
360 CALL scroll
370 NEXT
Re: Have an idea where this might go
This seems a lot better, does away with the lookup tables. Tidied up the code a bit too and it does a bit of self modifying.
Are there better ways of doing this, the byte shifting part is what I'm after.
Are there better ways of doing this, the byte shifting part is what I'm after.
Code: Select all
//Mode 5 shifting screen left by 1-3 pixels
.mask EQUD &113377FF
.setup1 EQUD &4A4A4A4A
.setup0 EQUD &0AEAEAEA:EQUW &0A0A
.shift EQUB 1 //No. Of pixels to shift (0-3)
.scrollleft
LDX shift
LDA mask,X :STA msk0+1
EOR #&FF :STA msk1+1
LDA setup0,X :STA msk0+2
LDA setup0+1,X:STA msk0+3
LDA setup0+2,X:STA msk0+4
LDA setup1,X :STA msk1+2
LDA setup1+1,X:STA msk1+3
LDA setup1+2,X:STA msk1+4
LDY #0:LDX #&58
.oloop
STX r0+2
STX r1+2
STX w+2
.iloop
.r1 LDA &5808,Y
.msk1 AND #0:NOP:NOP:NOP
STA rhb+1
.r0 LDA &5800,Y
.msk0 AND #0:NOP:NOP:NOP
.rhb ORA #0
.w STA &5800,Y
INY:BNE iloop
INX:BPL oloop
RTS
Re: Have an idea where this might go
If I were to write this I would unroll the loops at least a few times and write separate functions for each amount of pixels you want to move.
0xC0DE
"I program my home computer / Beam myself into the future"
Follow me on Twitter
Visit my YouTube channel featuring my games and demos for Acorn Electron and BBC Micro
"I program my home computer / Beam myself into the future"
Follow me on Twitter
Visit my YouTube channel featuring my games and demos for Acorn Electron and BBC Micro
Re: Have an idea where this might go
Thanks, if it was for the full screen scrolling then yes, but the full screen thing is just for testing ideas on the shifting. When it's actually going to be used in the scrolling routine that I've posted videos of it'll only have to shift into 64 or 128 bytes depending on direction of scrolling, and used in the loop alongside code for reading the bytes from map/tile data.
Re: Have an idea where this might go
This has been a bit of a pain to get working but finally got it, although it's still just wrapping vertically when scrolling up and down but the horizontal scrolling goes across the map.
https://youtu.be/X8iBoQdtV4g
Edit: just noticed I've left the pointer over the middle of it
And the video freezes at one point, that's something happening on YT, maybe it's still doing some processing.
https://youtu.be/X8iBoQdtV4g
Edit: just noticed I've left the pointer over the middle of it
And the video freezes at one point, that's something happening on YT, maybe it's still doing some processing.
Re: Have an idea where this might go
I can imagine a nice sideways-scrolling shooter based on this!
Re: Have an idea where this might go
I've had a few ideas, platformer, something top down, shooter.
One good thing about it is that sprites don't have to be removed, but it might also be possible to draw something like damage or enemy remains onto the background and they'll stay there until they go off screen.
One good thing about it is that sprites don't have to be removed, but it might also be possible to draw something like damage or enemy remains onto the background and they'll stay there until they go off screen.
Re: Have an idea where this might go
Running this in electrem I've been running out of space, as it is just now it runs but when I tried it in elkulator it couldn't get past assembling the code.
I've saved the assembled code to a file and written a short basic program which sets some things up, loads the code and runs it and it works fine.
Is this down to different versions of the OS?
Now because of running out of space, I'm going to have to start breaking up the assembled code and saving it probably over several files, going to take some thinking about the best way to go about this, anyone got any tips?
I've saved the assembled code to a file and written a short basic program which sets some things up, loads the code and runs it and it works fine.
Is this down to different versions of the OS?
Now because of running out of space, I'm going to have to start breaking up the assembled code and saving it probably over several files, going to take some thinking about the best way to go about this, anyone got any tips?
Re: Have an idea where this might go
Switch to BeebAsm
0xC0DE
"I program my home computer / Beam myself into the future"
Follow me on Twitter
Visit my YouTube channel featuring my games and demos for Acorn Electron and BBC Micro
"I program my home computer / Beam myself into the future"
Follow me on Twitter
Visit my YouTube channel featuring my games and demos for Acorn Electron and BBC Micro
Re: Have an idea where this might go
Thanks, I've downloaded that and had to get the msvcp100.dll but can't get it to run, "application failed to initialize properly" does it work on XP?
Re: Have an idea where this might go
I haven't used XP in over a decade or more
I use Win 10 + VSCode + BeebAsm
I use Win 10 + VSCode + BeebAsm
0xC0DE
"I program my home computer / Beam myself into the future"
Follow me on Twitter
Visit my YouTube channel featuring my games and demos for Acorn Electron and BBC Micro
"I program my home computer / Beam myself into the future"
Follow me on Twitter
Visit my YouTube channel featuring my games and demos for Acorn Electron and BBC Micro
Re: Have an idea where this might go
As 0xCODE said, definitely the way to go with coding.
I first started coding directly on a beeb, then switched to running Windows 10 + VSCode + BeebAsm through Parallels VMware.
NB I never seemed to get it running directly through a Mac
I first started coding directly on a beeb, then switched to running Windows 10 + VSCode + BeebAsm through Parallels VMware.
NB I never seemed to get it running directly through a Mac
Pitfall, Gridrunner, Matrix: Gridrunner 2, LaserZone, AcornViewer, AcornPad
Re: Have an idea where this might go
Yep, looks much more convenient to code in but still can't get it running on XP laptop, tried several the dll's and now I don't get the dll missing or application failed messages but it still shuts down immediately without any messages now.
I've a win10 desktop that I can try it on but much prefer it on the laptop, are there any other similar options to beebasm?
I've a win10 desktop that I can try it on but much prefer it on the laptop, are there any other similar options to beebasm?