Jump to content
IGNORED

How to display text


Just Jeff

Recommended Posts

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.

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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:

post-3056-0-36459500-1473605259_thumb.png

 

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.

post-3056-0-45236300-1473605595_thumb.png

 

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:

post-3056-0-63335800-1473605799_thumb.png

 

 

Link to comment
Share on other sites

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?

 

post-44582-0-91891200-1473896406_thumb.jpg

	
;-------------------------------------------------------------------------------
; 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

Link to comment
Share on other sites

 

 

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:

 

post-44582-0-29123000-1473963912_thumb.jpg

Edited by BNE Jeff
Link to comment
Share on other sites

That looks right. Do you see assembly-6502 in the corner when you're editing your assembly code?

post-3056-0-24592700-1473967118_thumb.png

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
Link to comment
Share on other sites

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.

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...