MausBoy Posted April 13, 2006 Share Posted April 13, 2006 I made this just now to practice scrolling text and sprites across the screen using the background and player sprites. I know it's not impressive but I ran out of space. To use the background scroller with a full alphabet takes up all 4k with only enough room for a few lines of text. Now i'm going to try to port it to the multisprite kernel (for smaller text) and make it a "print" type function, so multiple lines of text can be displayed. Probably something like TXT x y z w - where z is the corresponding character to print and w toggles solid or transparent background. This allows for a psuedo variable-width font, depending on how you increment x. I don't have the patience or the brain power for the compression people are using for the 8bit systems, so this probably won't ever be able to hold more than one screen of text plus the function in one 4k bank. It could also easily be used for some awesome background and psuedo-sprite animations though thanks to the new multisprite kernel with it's variable playfield block size. Has anyone else made anything like this yet in bB? scrolltest.bin Quote Link to comment Share on other sites More sharing options...
+Atarius Maximus Posted April 14, 2006 Share Posted April 14, 2006 I made this just now to practice scrolling text and sprites across the screen using the background and player sprites. I know it's not impressive but I ran out of space. To use the background scroller with a full alphabet takes up all 4k with only enough room for a few lines of text. Now i'm going to try to port it to the multisprite kernel (for smaller text) and make it a "print" type function, so multiple lines of text can be displayed. Probably something like TXT x y z w - where z is the corresponding character to print and w toggles solid or transparent background. This allows for a psuedo variable-width font, depending on how you increment x. I don't have the patience or the brain power for the compression people are using for the 8bit systems, so this probably won't ever be able to hold more than one screen of text plus the function in one 4k bank. It could also easily be used for some awesome background and psuedo-sprite animations though thanks to the new multisprite kernel with it's variable playfield block size.Has anyone else made anything like this yet in bB? Very impressive, MausBoy. It's too bad the code takes up so much space, I could see some really cool uses for it. Any chance you'd post your source so we can take a look at how you did it? Steve Quote Link to comment Share on other sites More sharing options...
MausBoy Posted April 14, 2006 Author Share Posted April 14, 2006 (edited) Thanks AM, it did take a hell of a lot of typing. All I did was plot out the dots on printer paper for each letter, then create a goto for each letter with PFVLINEs and PFPIXELs. Then if your marquee is 5 letters long, you run a loop like: 10 drawscreen time = time + 1 if time < 20 then goto 10 else time = 0 if r > 0 then goto 15 a = a + 1 15 if a = 1 then goto LH if a = 2 then goto LI if a = 3 then goto EX if a = 4 then goto SP if a = 5 then goto SP if a = 6 then a = 1 goto 10 etc (EX is exclamation, SP space) Then the goto's would looke like: LA r = r + 1 if r = 1 || r = 4 then pfvline 0 3 6 on if r = 2 || r = 3 then pfpixel 0 2 on : pfpixel 0 4 on if r = 5 then pfvline 0 2 6 off : r = 0 goto 10 Edited April 14, 2006 by MausBoy Quote Link to comment Share on other sites More sharing options...
supercat Posted April 15, 2006 Share Posted April 15, 2006 LA for r = 1 to 5 if r = 1 || r = 4 then pfvline 0 3 6 on if r = 2 || r = 3 then pfpixel 0 2 on : pfpixel 0 4 on if r = 5 then pfvline 0 2 6 off pfscroll left next r goto 10 That approach will use up gobs and gobs and gobs and gobs of code space. You need to use tables. I'd suggest something like this. The following should include the full alphabet, digits 0-9, blank (CH_SP), period (CH_DT), and apostrophe (CH_AP). The entire character set takes only 151 bytes. ; Assume p and q are initialized to zero. Initialize r to 128. show_column: if q=0 then show_blank r=CharData[q] if r & 1 then pfpixel 0 8 on if r & 2 then pfpixel 0 7 on if r & 4 then pfpixel 0 6 on if r & 8 then pfpixel 0 5 on if r & 16 then pfpixel 0 4 on if r & 32 then pfpixel 0 3 on if r & 64 then pfpixel 0 2 on q=q+1 if r(7) then q=0 goto show_done show_blank: q=Message[p] p=p+1 if q=0 then p=0 show_done: pfscroll left .. continue doing whatever rem Characters should be defined as in the following table. const CH_SP= 1 const CH_EX= 3 const CH_AP= 4 const CH_DT= 5 const CH_0= 6 const CH_1= 10 const CH_2= 14 const CH_3= 18 const CH_4= 22 const CH_5= 26 const CH_6= 30 const CH_7= 34 const CH_8= 38 const CH_9= 42 const CH_A= 46 const CH_B= 50 const CH_C= 54 const CH_D= 58 const CH_E= 62 const CH_F= 66 const CH_G= 70 const CH_H= 74 const CH_I= 78 const CH_J= 79 const CH_K= 83 const CH_L= 87 const CH_M= 91 const CH_N= 96 const CH_O= 100 const CH_P= 104 const CH_Q= 108 const CH_R= 112 const CH_S= 116 const CH_T= 120 const CH_U= 125 const CH_V= 129 const CH_W= 134 const CH_X= 139 const CH_Y= 143 const CH_Z= 147 data CharData 0 $00,$80 $FD $F0 $81 $3E,$41,$41,$BE $00,$21,$7F,$81 $23,$45,$49,$B1 $22,$49,$49,$B6 $0C,$14,$24,$FF $72,$51,$51,$CE $1E,$29,$49,$86 $60,$47,$58,$E0 $36,$49,$49,$B6 $30,$49,$4A,$BC $3F,$48,$48,$BF $7F,$49,$49,$B6 $3E,$41,$41,$A2 $7F,$41,$22,$9C $7F,$49,$49,$C1 $7F,$48,$48,$C0 $3E,$41,$49,$AF $7F,$08,$08,$FF $FF $02,$01,$01,$FE $7F,$08,$14,$E3 $7F,$01,$01,$81 $3F,$00,$00,$00,$BF $3F,$00,$00,$BF $3E,$01,$01,$BE $3F,$00,$00,$80 $3C,$02,$02,$BD $3F,$00,$00,$80 $32,$49,$49,$A6 $40,$40,$7E,$40,$C0 $7E,$00,$00,$FE $70,$0C,$03,$0C,$F0 $7E,$01,$0E,$01,$FE $77,$08,$08,$F7 $70,$09,$0A,$FC $43,$4D,$59,$E1 end data Message CH_H,CH_E,CH_L,CH_L,CH_O,CH_SP,CH_T,CH_H,CH_E,CH_R,CH_E,CH_EX,0 end Quote Link to comment Share on other sites More sharing options...
MausGames Posted April 1, 2009 Share Posted April 1, 2009 Supercat, I really wish I knew what the heck you are talking about here; 151 bytes for the entire alphabet would be great. I just made another scroller when I was messing with Solar Nexus, and still used the same awful method more or less: solarnexusb.bas.bin Quote Link to comment Share on other sites More sharing options...
supercat Posted April 1, 2009 Share Posted April 1, 2009 Supercat, I really wish I knew what the heck you are talking about here; 151 bytes for the entire alphabet would be great. I just made another scroller when I was messing with Solar Nexus, and still used the same awful method more or less: Each byte of data represents one column of seven dots; seven bits the dots, and one bit to mark whether a column is the last one. Characters are one to five columns wide, and the shapes are thus represented by 1-5 bytes. Each byte in the "string" shows where that character's data starts in the shape table. What more help do you need? Quote Link to comment Share on other sites More sharing options...
yuppicide Posted April 4, 2009 Share Posted April 4, 2009 Nice techniques. Maybe I'll use one of them someday. Quote Link to comment Share on other sites More sharing options...
yuppicide Posted April 27, 2009 Share Posted April 27, 2009 Been awhile, but I finally got around to checking this out. Love how it's progressing so far. I love the effect of the stars scrolling and your ship. I love the little cut scene in between before you start the game. Quote Link to comment Share on other sites More sharing options...
yuppicide Posted April 30, 2009 Share Posted April 30, 2009 Would love to figure out how to get Supercat's example working. I tried several times. 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.