Jump to content
IGNORED

Asymmetrical Playfield+ 48-pixel sprite AT THE SAME TIME!


Andrew Davie

Recommended Posts

I've managed to get a scrolling, asymmetric ChronoColour(TM) playfield working at the same time as a 48-pixel sprite routine.

Video shows it in action. I start scrolling about the 8 second mark.

The sprites can be anything, really - not limited to the small pieces shown here. The whole thing could be a giant chesspiece.

I don't use PF0, and as you can see I'm using a mirrored playfield. The playfield scrolling can be all one direction, or in opposite directions as shown here.

If you look carefully, you can confirm that the left/right sides of the playfield are distinct/different. Pieces are shifting to random squares as all this is happening.

This is the very first working version. I have some ideas as to how to shift the 48-pixel sprites leftwards, but even if I can't, this might be usable as-is.

Took me a few days; I wasn't sure if it would be possible when I started.

Looks better to the naked eye; the 20Hz colour shimmer of ChronoColour(TM) is difficult to screen-grab effectively.

If you don't want the multicolour screen then obviously a plain single-colour will be less shimmery.

 

 

Yay me!

 

  • Like 5
Link to comment
Share on other sites

2 minutes ago, Karl G said:

What is your secret? I can't even imagine coming close to having enough time to update four playfield registers with a 48 pixel routine.

Don't forget also changing PF colour and both sprite colours every line!!

Edit: ALSO sleeping for 5 cycles because I had just so many spare cycles I didn't know what to do with them.

Edited by Andrew Davie
Link to comment
Share on other sites

1 hour ago, Karl G said:

What is your secret?

Let me bask in the glory of being the only one to know. Just a little bit. I'll share soon.

 

This video shows the 48-pixel sprite grid as a large object, just to show it is all working properly.

The limitations are that the sprite is effectively transparent; you see the playfield behind it. If you want a more solid look you have to mask the playfield pixels behind the large sprite to 0 (black). Not a major issue, but not done in this demo.

 

  • Like 6
  • Thanks 1
Link to comment
Share on other sites

48 minutes ago, Andrew Davie said:

Bobby Fischer

 

fischer.png.c99761e8540936a30170de2c77f340fb.png

 

 

would be a impressive demo, if you start the chess board with his favorite opening (Sicilian Defense) and then start to move the playfield to end with one of his famous endings.

Link to comment
Share on other sites

Might be of interest to some; the Bobby Fischer image was originally black and white. I ran it through an amazing online photo colouriser first, then cropped and adjusted saturation/contrast. Then I ran it through the BYO greeting cart software, and took the resultant byte value source code directly to the new demo code (only having to convert from dasm format to C format), and Bob's your Uncle.

 

Original...

fischerbw.thumb.jpeg.4a68bbd826a1292de8bdf5ae40aee2b8.jpeg

 

Colourised by AI...

 

fischer.jpeg.8ad05adbe9d9a27afff57e57846c3a83.jpeg

  • Like 4
Link to comment
Share on other sites

Here is a binary. It has maybe a 75% chance of running on actual hardware - Harmony only at this stage.

If you do run it on actual harmony, please take a photo of the screen for me. I haven't seen it on hardware yet, and I'd love to see what it looks like. You want a low shutter speed, if you can manage that, but I'll take what I can get.

 

Use left/right on the joystick to scroll and speedup/slow down.  As you see, the ChronoColour(TM) system doesn't lend itself to scrolling. It's OK at low speeds, but it gets the jaggies when speed increases. I think the speed needs to be syncronised with the 3-frame cycling of the colour changes; maybe something to tackle in the future.  You see I have fixed up that screen-split, so it's now scrolling in the same direction for left/right halves of the screen. I also put some vertical movement on the Fischer face just to show that can be done too.

 

The trick is the use of the CDFJ bank-switching scheme. This scheme offers what are called "data streams".  They allow a stream of bytes for sprites and playfield to be retrieved with just a "lda #" for each, and no need for indexing. Also, the CDFJ scheme does away with the scanline loop/counter, as it implements something like "smart jumps" which do all that for you as a part of the bankswitch scheme itself. This means you can remove the expensive indexing of graphics data and replace with a two-cycle fetch for all of GRP0/GRP1/GRP0/GRP1/GRP0/GRP1 and PF1/PF2/PF1/PF2.  That leaves (just) enough cycles in the 76 to do all of those as well as colour changes for COLUPF, COLUP0, COLUP1 and still have 5 cycles to spare.

Here's the actual kernel...

 


    ; This is the entire chessboard display

;@3
        
                    lda #_DS_PF1_LEFT
                    sta PF1                         ; 5
                    lda #_DS_GRP0a
                    sta GRP0                        ; 5
                    lda #_DS_GRP1a
                    sta GRP1                        ; 5
                    lda #_DS_GRP0b
                    sta GRP0                        ; 5

                    lda #_DS_GRP1c                  ; 2
                    tay                             ; 2

                    lda #_DS_PF2_LEFT
                    sta PF2                         ; 5

                    lda #_DS_GRP0c                  ; 2
                    tax                             ; 2
                    lda #_DS_PF1_RIGHT
                    sta PF1                         ; 5
;@41
                    lda #_DS_PF2_RIGHT              ; 2
                    nop                             ; 2
                    sta PF2                         ; 3 

                    lda #_DS_GRP1b                  ; 2
                    sta GRP1                        ; 3
                    stx GRP0                        ; 3
                    sty GRP1                        ; 3
                    sta GRP0                        ; 3

;@63
                    lda #_DS_COLUPF                 ; 2
                    sta COLUP0                      ; 3
                    sta COLUP1                      ; 3
                    sta COLUPF                      ; 3
;@75

                    SLEEP 3
                    jmp FASTJMP1                    ; 3
;@3--> start of line again :)

Don't trust the cycle counting; I haven't been through to revise since the final version.

So, that's it in a nutshell. It shows the power of the CDFJ bankswitching scheme and the data streams it provides.

 

 

fischerChess.bin

  • Like 1
Link to comment
Share on other sites

Awesome demo!

 

It works on my 4 switch using Harmony cart just fine.

 

Here's a video of it running (excuse the dirty room... it's on the "to-do" list :) )

 

I couldn't get it to upload here so I uploaded to youtube as unlisted. Let me know if you want me to delete it and I will.

 

Video:

 

  • Like 1
Link to comment
Share on other sites

2 minutes ago, slacker said:

Awesome demo!

It works on my 4 switch using Harmony cart just fine.

Here's a video of it running (excuse the dirty room... it's on the "to-do" list :) )

Thanks for the video. Looks great!  I think I saw a glitch around 8s...?  Timing is tight so I have to see how I can improve things.

But still, that shimmer wasn't too bad at all, at least in this video.

 

Link to comment
Share on other sites

19 minutes ago, Andrew Davie said:

Thanks for the video. Looks great!  I think I saw a glitch around 8s...?  Timing is tight so I have to see how I can improve things.

But still, that shimmer wasn't too bad at all, at least in this video.

 

Oh wow. I didn't even notice it while I was filming it. Yeah, it looks like there was a quick screen scroll then. I'll have to give it some more playing around to confirm how often it happens.

It looks really good in person! I need to load it up on a CRT to get a better look of things as the flat panels never do video from real hardware justice from my experience.

Link to comment
Share on other sites

1 hour ago, slacker said:

Oh wow. I didn't even notice it while I was filming it. Yeah, it looks like there was a quick screen scroll then. I'll have to give it some more playing around to confirm how often it happens.

It looks really good in person! I need to load it up on a CRT to get a better look of things as the flat panels never do video from real hardware justice from my experience.

Actually what happened was the whole screen jumped downwards by about a row.

In the first half, screen is too high... then it "corrects" and is OK.  Strange, but almost certainly a timing issue with the code.

  • Thanks 1
Link to comment
Share on other sites

This binary corrects some of the errors I have noticed.

The screen is now the "full" 32 pixels wide. Previously 2 PF pixels were blank where they didn't need to be.

I have adjusted the screen size from 262 scanlines to 276. This gives the drawing code a bit more leeway.

I have optimised the drawing code. Again. It should be a tad faster.

I've increased the brightness slightly, based on that off-TV video from @slacker

Bobby is no longer bobby, so to speak.

 

I expect this version to show fewer glitches on real hardware. Hopefully none.

 

 

 

fischerChess20210320b.bin

Link to comment
Share on other sites

11 hours ago, Andrew Davie said:

This means you can remove the expensive indexing of graphics data and replace with a two-cycle fetch for all of GRP0/GRP1/GRP0/GRP1/GRP0/GRP1 and PF1/PF2/PF1/PF2.  That leaves (just) enough cycles in the 76 to do all of those as well as colour changes for COLUPF, COLUP0, COLUP1 and still have 5 cycles to spare.

Just enough time for an AUDV update, for soft-synth or sample playing. :)

 

(probably not worth the overscan/vblank update requirements, though)

 

Link to comment
Share on other sites

18 minutes ago, RevEng said:

Just enough time for an AUDV update, for soft-synth or sample playing. :)

 

(probably not worth the overscan/vblank update requirements, though)

 

Very much on my mind.  Drop the sprites, have a fullscreen movie player.

Modify the PlusCart for a CDFJ-similar scheme, but in the background stream packets from a SD card to a buffer.

Play sound at 1 sample/scanline.   I think it's trending towards eventually having some sort of movie player with digitised sound streaming off a SD card, as it's really (in my view) only a matter of writing the bankswitch driver and a few simple tools.

One major thing I think is needed is to change the PlusCart servicing of the address buss from a polling system to an interrupt system.  That is, the interrupt is triggered by address change, and it's serviced, and the ARM goes back to doing whatever it was doing. In this case, streaming video/sound from a SD card.

 

Link to comment
Share on other sites

45 minutes ago, Andrew Davie said:

Very much on my mind.  Drop the sprites, have a fullscreen movie player.

Modify the PlusCart for a CDFJ-similar scheme, but in the background stream packets from a SD card to a buffer.

Play sound at 1 sample/scanline.   I think it's trending towards eventually having some sort of movie player with digitised sound streaming off a SD card, as it's really (in my view) only a matter of writing the bankswitch driver and a few simple tools.

One major thing I think is needed is to change the PlusCart servicing of the address buss from a polling system to an interrupt system.  That is, the interrupt is triggered by address change, and it's serviced, and the ARM goes back to doing whatever it was doing. In this case, streaming video/sound from a SD card.

 

Why from the SD-Card?
All the videos are in the internet at youtube ;-)

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...