Just Jeff Posted September 10, 2016 Share Posted September 10, 2016 Hi! Does anyone know a good way to display small text? I have a kernel area about twenty lines high that I would like to use to display a word or two.. Maybe a nice vertical or horizontal scroll, not necessary though... Thanks! Quote Link to comment Share on other sites More sharing options...
BigO Posted September 10, 2016 Share Posted September 10, 2016 Some references here may interest you: http://atariage.com/forums/topic/135992-wanting-to-program-a-text-based-game-for-the-2600/?hl=%2Btext+%2Bengine&do=findComment&comment=1640309 1 Quote Link to comment Share on other sites More sharing options...
Nukey Shay Posted September 11, 2016 Share Posted September 11, 2016 Impossible to answer without being given the limitations present at that time. One approach that takes very little time/resources to pull off is to reuse a standard 48-pixel score display subroutine and flicker at 30hz to create 96 pixels. The "cost" is barely more than the romspace used holding the bitmaps. Quote Link to comment Share on other sites More sharing options...
Just Jeff Posted September 11, 2016 Author Share Posted September 11, 2016 Impossible to answer without being given the limitations present at that time. One approach that takes very little time/resources to pull off is to reuse a standard 48-pixel score display subroutine and flicker at 30hz to create 96 pixels. The "cost" is barely more than the romspace used holding the bitmaps. There doesn't need to be anything else but the text. Is a 48 pixel display something that uses player one and player two with three copies? Quote Link to comment Share on other sites More sharing options...
+SpiceWare Posted September 11, 2016 Share Posted September 11, 2016 There doesn't need to be anything else but the text. Is a 48 pixel display something that uses player one and player two with three copies? Yep, you've probably seen that arrangement used for 6 digit score display. It can be used to display graphics that are 48 pixels across by however many down you need. See the source from the Main Menu blog entry for Medieval Mayhem. The routine's called Show48graphic and is used numerous times to display the main menu. This was back when I was learning the 2600 so I didn't yet have habits like adding the : at the end of labels (to make it easier to find a subroutine vs all the locations it's called from). Also the indentation in the source will probably be inconsistent, like this: That's before I figured out to turn on jEdit's Soft (emulated with spaces) tabs setting. Using real tabs causes things to line up differently in different editors as some may use tab to line up on 4 character boundaries, others 8 character boundaries, etc. The graphics are also using my old notation of _ and X instead of 0 and 1. The definitions for that are in graphics.h. I did it that way because it was easier to "see" the graphics in code than it was with 0s and 1s. Eventually I figured out how to have jEdit colorize the binary values for me, so I now use standard binary notation: Quote Link to comment Share on other sites More sharing options...
Just Jeff Posted September 14, 2016 Author Share Posted September 14, 2016 Thanks! I've been working hard on this.. I was able to successfully display "Fireballs" but the HMOVE was messing up the game-play below it. So I changed the positioning routine so it happens in V blank. It fixed the game-play, but for some reason the fine tune portion of the marquee doesn't work though. (I think) It looks totally correct to me. I can't figure it out. Can anyone see my error? ;------------------------------------------------------------------------------- ; Marquee Display ;------------------------------------------------------------------------------- ShowFireballsLogo ;------------------------Spliced in sta WSYNC ;Jeff added lda #3 ; 2 10 sta NUSIZ0 ; 3 13 set triple copies of P0 sta NUSIZ1 ; 3 16 set triple copies of P1 sta VDELP0 ; 3 19 turn on vertical delay for P0 sta VDELP1 ; 3 22 turn on vertical delay for P1 ;lda #$F0 ; 2 24 ;sta HMP0 ; 3 27 x adjust for P0 nop 0 ; 3 30 nop ; 2 32 nop ; 2 34 nop ; 2 36 ;sta RESP0 ; 3 39 set x for P0 nop ;sta RESP1 ; 3 42 set x for P1 sta WSYNC ;sta HMOVE ; fine adjust for P0 ;--------------------------- sta WSYNC lda #0 sta COLUBK lda #$0E ; white sta COLUP0 sta COLUP1 lda #<Fireballs sta G48 lda #>Fireballs sta G48+1 lda #<(Fireballs+15) sta G48+2 lda #>(Fireballs+15) sta G48+3 lda #<(Fireballs+30) sta G48+4 lda #>(Fireballs+30) sta G48+5 lda #<(Fireballs+45) sta G48+6 lda #>(Fireballs+45) sta G48+7 lda #<(Fireballs+60) sta G48+8 lda #>(Fireballs+60) sta G48+9 lda #<(Fireballs+75) sta G48+10 lda #>(Fireballs+75) sta G48+11 ldy #14 ; jsr Show48graphic Show48graphic SUBROUTINE ; call with Y holding the lines-1 to show ; G48 thru G48+$B must be preloaded with pointers to the ; 48 pixel graphic image STY TempVar1 sta WSYNC .graphicLoop ldy TempVar1 ;+3 63 189 lda (G48),y ;+5 68 204 sta GRP0 ;+3 71 213 D1 -- -- -- sta WSYNC ;go lda (G48+$2),y ;+5 5 15 sta GRP1 ;+3 8 24 D1 D1 D2 -- lda (G48+$4),y ;+5 13 39 sta GRP0 ;+3 16 48 D3 D1 D2 D2 lda (G48+$6),y ;+5 21 63 sta TempVar2 ;+3 24 72 lda (G48+$,y ;+5 29 87 tax ;+2 31 93 lda (G48+$A),y ;+5 36 108 tay ;+2 38 114 lda TempVar2 ;+3 41 123 ! sta GRP1 ;+3 44 132 D3 D3 D4 D2! stx GRP0 ;+3 47 141 D5 D3! D4 D4 sty GRP1 ;+3 50 150 D5 D5 D6 D4! sta GRP0 ;+3 53 159 D4* D5! D6 D6 dec TempVar1 ;+5 58 174 ! bpl .graphicLoop ;+2 60 180 ; sta WSYNC ;JUST ADDED lda #0 sta GRP0 sta GRP1 sta GRP0 sta GRP1 ; rts and... PositionObjectsX: PositionForMarquee: lda #50 ; Position of P0 graphics ldx #0 ; Player 0 index jsr PosObject lda #58 ; Payer 1 position of graphics ldx #1 ; Player 1 index jsr PosObject sta HMOVE ldx #4 ;#1 ; 2 position players 0 and 1, missiles, ball POloop: lda ObjectX,x ; 4 get the object's X position jsr PosObject ; 6 set coarse X position and fine-tune amount ; 29 time of PosObjext after its WSYNC dex ; 2 DEcrement X ;bpl POloop ; 2 Branch PLus so we position all objects cpx #1 ; Don't do players now. bne POloop ;sta WSYNC ; 3 wait for end of scanline ;sta HMOVE ; 3 3Tell TIA to use fine-tune values to set final X positions ; Moved to the kernel rts ; 6 9 after 2 wsyncs and... ;------------------------------------------------------------------------------- ; PosObject ;------------------------------------------------------------------------------- PosObject: sec sta WSYNC DivideLoop sbc #15 ; 2 2 - each time thru this loop takes 5 cycles, which is bcs DivideLoop ; 2 4 - the same amount of time it takes to draw 15 pixels eor #7 ; 2 6 - The EOR & ASL statements convert the remainder asl ; 2 8 - of position/15 to the value needed to fine tune asl ; 2 10 - the X position asl ; 2 12 asl ; 2 14 sta.wx HMP0,X ; 5 19 - store fine tuning of X sta RESP0,X ; 4 23 - set coarse X position of object rts ; 6 29 - ReTurn from Subroutine BP4.zip Quote Link to comment Share on other sites More sharing options...
Nukey Shay Posted September 15, 2016 Share Posted September 15, 2016 One thing stands out above...you did not precede HMOVE with a WSYNC in your PositionForMarquee section. You can't just call HMOVE anyplace in a scanline. 1 Quote Link to comment Share on other sites More sharing options...
Kylearan Posted September 15, 2016 Share Posted September 15, 2016 Without looking deeper into the code: Have you made sure the time-sensitive loops (.graphicLoop, DivideLoop) don't cross a page boundary, which would make the respective branch instructions cost an extra cycle and mess up your timing? 1 Quote Link to comment Share on other sites More sharing options...
Just Jeff Posted September 15, 2016 Author Share Posted September 15, 2016 Nukey Shay.. That's definitely it. You can see in my second snippet of code I jsr PosObject then I sta HMOVE. Classic rookie mistake. .. Thanks Quote Link to comment Share on other sites More sharing options...
Just Jeff Posted September 15, 2016 Author Share Posted September 15, 2016 Much better, but still a little timing issue towards the end.. BP4.bin BP4x.asm Quote Link to comment Share on other sites More sharing options...
Papa Posted September 15, 2016 Share Posted September 15, 2016 Cool! I downloaded the .asm so later on I can test out my new headache medicine (..and so it wouldn't look like people run from machine code *skipping gingerly) . jk You can lead a horse to water but you can't make him HMOVE without WSYNCing. 1 Quote Link to comment Share on other sites More sharing options...
+SpiceWare Posted September 15, 2016 Share Posted September 15, 2016 Your players for the 48 pixel graphic are positioned at 50 and 58, move them to 56 and 64. Quote Link to comment Share on other sites More sharing options...
Just Jeff Posted September 15, 2016 Author Share Posted September 15, 2016 Yup. That did it.. Thanks again! BP4.bin Quote Link to comment Share on other sites More sharing options...
Just Jeff Posted September 15, 2016 Author Share Posted September 15, 2016 (edited) I did it that way because it was easier to "see" the graphics in code than it was with 0s and 1s. Eventually I figured out how to have jEdit colorize the binary values for me, so I now use standard binary notation: Did I do it correctly here? I don't see any highlighting in my graphics: Edited September 15, 2016 by BNE Jeff Quote Link to comment Share on other sites More sharing options...
+SpiceWare Posted September 15, 2016 Share Posted September 15, 2016 That looks right. Do you see assembly-6502 in the corner when you're editing your assembly code?You might be seeing assembly-x86 instead, as it uses the same file extension and that first-line-glob doesn't always work. If so you can either tell jEdit to use the right one via: Click on Utilities menu Click on Buffer Options... (towards the bottom) About the middle of the Buffer Options screen you'll find Edit Mode:, change it to 2600-assembly Click OK you can also disable the included assembly-x86 mode. Click on Utilities menu Click on jEdit Home Directory Click on Modes open catalog Find:<MODE NAME="assembly-x86" FILE="assembly-x86.xml"FILE_NAME_GLOB="*.asm" /> Disable it by deleting the * from *.asm:<MODE NAME="assembly-x86" FILE="assembly-x86.xml"FILE_NAME_GLOB=".asm" /> Save changes Quote Link to comment Share on other sites More sharing options...
Just Jeff Posted September 16, 2016 Author Share Posted September 16, 2016 Ok... So I checked that yesterday and it was showing Assemby 6502. This morning I was setting the computer up and I saw the yellow very faintly. Turns out, if I push the screen way forward, I can see the yellow. If I pull it back up, no yellow. Quote Link to comment Share on other sites More sharing options...
+SpiceWare Posted September 16, 2016 Share Posted September 16, 2016 Hmm - looks like you're using the default colors. Try changing them. Also make note of the note, as that's what makes the images in binary values really pop out: Note: make sure the token type INVALID has a different background color. My mode files use INVALID to make the graphics in binary data stand out. Quote Link to comment Share on other sites More sharing options...
Just Jeff Posted September 17, 2016 Author Share Posted September 17, 2016 OK I changed them. Its better now. Thanks! 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.