KevKelley Posted January 18, 2019 Share Posted January 18, 2019 I have been messing around with the DPC+ kernel after seeing some of the benefits of using it versus what I had done with the standard kernel so I decided to try and start out a program in it but I couldn't seem to get it to work. I tried copying the sample code from Random Terrain page as a start (as well as playing around with it) and read through the table of contents and numerous threads but couldn't find anything that helped. Basically when I ran it in Stella the screen was black. Not sure if I was missing something. I can try and post the code in the morning. I was hoping to play around and get it on my own but I am stumped and my laptop died. Quote Link to comment Share on other sites More sharing options...
+mksmith Posted January 18, 2019 Share Posted January 18, 2019 Did you set the colors using pfcolors: feature? You need to set each individual line Quote Link to comment Share on other sites More sharing options...
KevKelley Posted January 18, 2019 Author Share Posted January 18, 2019 I had. When I inserted the code from the playgirl editor I had noticed it was all the same so I just changed some of the lines to see of that made a difference. Ill play around with that some more to see if I missed something. With DPC+ does it have to be a different dimension than in the standard kernel? I had noticed the example had a really long playfield. Quote Link to comment Share on other sites More sharing options...
+mksmith Posted January 18, 2019 Share Posted January 18, 2019 (edited) rem batari Basic Program rem created 22/12/2018 12:49:19 PM by Visual bB Version 1.0.0.568 rem ***************************************************** bank 1 rem ***************************************************** temp1 = temp1 set tv ntsc set kernel DPC+ set smartbranching on set optimization inlinerand set kernel_options collision(playfield,player1) rem DEFINE VARS HERE goto START_RESTART bank2 rem ***************************************************** bank 2 rem ***************************************************** temp1 = temp1 START_RESTART rem gray sunset bkcolors: $02 $02 $02 $04 $06 $08 $0E $00 end rem colored sunset rem $88 bkcolors: $78 $68 $58 $48 $38 $28 $18 end playfield: ................................ ................................ ................................ ................................ ................................ ................................ ................................ ................................ .......X................X....... ......XXX..............XXX...... .....XXXXX............XXXXX..... ....XXXXXXX..........XXXXXXX.... ..XXXXXXXXXXX......XXXXXXXXXXX.. XXXXXXXXXXXXXXX..XXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX end pfcolors: $00 $00 $00 $00 $00 $00 $00 end scorecolors: $1E $1C $1A $1A $18 $18 $16 $16 end MAIN_LOOP rem playfield configuration DF6FRACINC = 255 ; Background colors. DF4FRACINC = 255 ; Playfield colors. DF0FRACINC = 255 ; Column 0. DF1FRACINC = 255 ; Column 1. DF2FRACINC = 255 ; Column 2. DF3FRACINC = 255 ; Column 3. rem draw drawscreen rem INSERT GAMEPLAY LOGIC goto MAIN_LOOP rem ***************************************************** bank 3 rem ***************************************************** temp1 = temp1 rem ***************************************************** bank 4 rem ***************************************************** temp1 = temp1 rem ***************************************************** bank 5 rem ***************************************************** temp1 = temp1 rem ***************************************************** bank 6 rem ***************************************************** temp1 = temp1 rem You may be able to place your TitleScreen here with no consequences I believe the playfield area is narrower but the spriate can go fullscreen. This works for me: Edited January 19, 2019 by mksmith Quote Link to comment Share on other sites More sharing options...
+Muddyfunster Posted January 19, 2019 Share Posted January 19, 2019 Kev, DPC+ allows more resolution options vertically for the playfield. RT's site has some good documentation here : http://www.randomterrain.com/atari-2600-memories-batari-basic-commands.html#dpc_playfield You can set the resolution using DFxFRACINC and basically have more resolution lines for your playfield. There is a table that shows you what DFxFRACINC settings to use for different resolution combinations. There are some code examples that I found really helpful for figuring it out. Quote Link to comment Share on other sites More sharing options...
KevKelley Posted January 19, 2019 Author Share Posted January 19, 2019 Kev, DPC+ allows more resolution options vertically for the playfield. RT's site has some good documentation here : http://www.randomterrain.com/atari-2600-memories-batari-basic-commands.html#dpc_playfield You can set the resolution using DFxFRACINC and basically have more resolution lines for your playfield. There is a table that shows you what DFxFRACINC settings to use for different resolution combinations. There are some code examples that I found really helpful for figuring it out. Those are what I was playing around with. When I had copied the code the screen would be black in Stella. I was inspired to take a stab at the DPC+ after playing with Tyre Trax. I was gonna play with the code posted above when I got the chance but I think the only thing different in mine was the size of the playfield and a couple of the DFxFRACINC values were lower). Quote Link to comment Share on other sites More sharing options...
+Muddyfunster Posted January 19, 2019 Share Posted January 19, 2019 If you only had a black screen, it sounds like you might not have been calling your drawscreen. One thing I learnt was that you have to have the DFxFRACINC statement called each frame. The example below will give you a screen like the first level in Tyre Trax. The code starts and then jumps to the Label called Main, then it goes and gets all the information for the playfield (GOSUB SET_PF). Once it has the info needed (background colour, playfield colour and playfield layout) it goes back to the main code block. Then there is a just simple loop to draw the screen using the required DFxFRACINC settings. Remember, you don't have to set the PF every frame usually. Doing that takes up a huge amount of cycles. In Tyre Trax, the PF is set for each level and then that's it. The only changes are the river, which I animate using pfpixel Also note, as I've set my DFxFRACINC to 255 for the playfield and the colour resolution, that means I can have a finer resolution (176 rows at 1 scanline high) and colour change every 2 lines. rem batari Basic Program rem created 12/10/2018 01:11:19 by Visual bB Version 1.0.0.568 rem ***************************************************** rem ***************************************************** rem DPC playfield example from Tyre Trax bank 1 rem ***************************************************** temp1 = temp1 set tv ntsc set kernel DPC+ set smartbranching on set optimization inlinerand set kernel_options collision(playfield,player1) rem DEFINE VARS HERE goto Main bank2 rem ***************************************************** bank 2 rem ***************************************************** temp1 = temp1 Main gosub set_pf mainloop rem set the PF resolution DF0FRACINC = 255 DF1FRACINC = 255 DF2FRACINC = 255 DF3FRACINC = 255 DF4FRACINC = 255 DF6FRACINC = 255 drawscreen goto mainloop set_pf pfcolors: $0E $70 $70 $70 $70 $70 $70 $70 $70 $70 $70 $70 $70 $70 $70 $0E $70 $70 $70 $70 $70 $70 $70 $D2 $D2 $D2 $D2 $D2 $D2 $D2 $D2 $D2 $D2 $70 $70 $84 $84 $84 $84 $84 $84 $84 $84 $84 $84 $84 $84 $84 $70 $D2 $D2 $D2 $D2 $D2 $D2 $D2 $D2 $D2 $D2 $D2 $70 $70 $70 $70 $70 $70 $70 $70 $70 $70 $70 $70 $70 $70 $70 $70 $70 $70 $70 $70 $70 $70 $70 $70 $70 $70 $70 $70 end bkcolors: $94 $94 $94 $94 $94 $94 $94 $94 $94 $94 $94 $94 $94 $94 $94 $94 $96 $96 $96 $98 $98 $8C $7C $4C $3C $2C $1E $CE $DC $D2 $E6 $E6 $F4 $06 $06 $82 $80 $80 $80 $80 $80 $80 $80 $80 $80 $80 $80 $80 $82 $D4 $D4 $D4 $D4 $D4 $D4 $D8 $D8 $EA $EA $EA $EA $EA $EA $EA $EA $EA $EA $EA $EA $EA $EA $EA $EA $EA $EA $EA $EA $EA $EA $DA $DA $DA $D6 $D6 $D6 $D6 $00 $D4 end playfield: ................................ ................................ ................................ ................................ ................................ ................................ ................................ ................................ ................................ ................................ ................................ ................................ ................................ ................................ ................................ ................................ ................................ ................................ ................................ ................................ ................................ ................................ ................................ ................................ ................................ ................................ ................................ ................................ ................................ ................................ ................................ ................................ ................................ ................................ ................................ ................................ ................................ ................................ ................................ ................................ ................................ ................................ ................................ ................................ ................................ ................................ ................................ ................................ ................................ ................................ ................................ ................................ .......X................X....... ......XXX..............XXX...... .....XXXXX............XXXXX..... ....XXXXXXX..........XXXXXXX.... ..XXXXXXXXXXX......XXXXXXXXXXX.. XXXXXXXXXXXXXXX..XXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX ................................ ................................ ................................ ................................ ................................ ................................ ................................ ................................ ................................ ................................ ................................ ................................ ................................ ................................ ................................ ................................ ................................ ................................ ................................ ................................ ................................ ................................ ................................ ................................ ................................ ................................ ................................ ................................ ................................ end return thisbank rem ***************************************************** bank 3 rem ***************************************************** temp1 = temp1 rem ***************************************************** bank 4 rem ***************************************************** temp1 = temp1 rem ***************************************************** bank 5 rem ***************************************************** temp1 = temp1 rem ***************************************************** bank 6 rem ***************************************************** temp1 = temp1 Quote Link to comment Share on other sites More sharing options...
+Muddyfunster Posted January 19, 2019 Share Posted January 19, 2019 mksmith example works just fine too. Not sure why the examples aren't working for you. Try using my example or mksmiths example, get that running before altering it. What version of Stella are you running? Quote Link to comment Share on other sites More sharing options...
+Random Terrain Posted January 19, 2019 Share Posted January 19, 2019 What version of Stella, batari Basic, and VbB. Quote Link to comment Share on other sites More sharing options...
KevKelley Posted January 20, 2019 Author Share Posted January 20, 2019 Stella 5.1.3 VbB v1 Build 568 batari Basic 1.1 I got the code posted here to work and had even plugged in my own playfield and got that to work. Looking over the code that I had I think I had either screwed up when I copied it the first time or did something when I was initially editing it into my own program. Not sure why I didn't identify it at the time - I guess staring at a screen got my brain stumped. Thank you. Now I am trying to play around with the heights/colors/appearance. I had one question. I had initially designed my playfield in the vbB playfield editor but when I compiled the program it appeared the width extended a little further then what I had made. Is this normal and something that is just programmed around? I didn't see anything on the website so didn't know if this would be something considered common knowledge and I am just missing it. I attached the .bas of the game for reference if needed. BBPv11919.bas Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.