Jump to content

Photo

Defining A-F in score_graphics.asm


17 replies to this topic

#1 lord_mike OFFLINE  

lord_mike

    Chopper Commander

  • 164 posts

Posted Thu May 22, 2008 2:21 PM

According to the Batari Basic Command Reference:

You can modify score_graphics.asm to include definitions for digits "A-F" and set the score digits manually.


but, it does not give instrucitons how to do that, and searches on this forum came up empty. There are only 10 digits defined, if I try to create any more, I get the following error:

2600 Basic compilation complete.
DASM V2.20.07, Macro Assembler 1988-2003
bytes of ROM space left
--> loop2 f200
2285 bytes of ROM space left
2285 bytes of ROM space left
segment: fffc vs current org: 10004
pftest.bas.asm (1998): error: Origin Reverse-indexed.
Aborting assembly


I'm guessing that I have to change some of the ORG tags to compensate for the extra digits, but how do I calculate that?

Edited by lord_mike, Thu May 22, 2008 2:23 PM.


#2 SeaGtGruff OFFLINE  

SeaGtGruff

    Quadrunner

  • 5,455 posts
  • Location:Georgia, USA

Posted Thu May 22, 2008 4:06 PM

According to the Batari Basic Command Reference:

You can modify score_graphics.asm to include definitions for digits "A-F" and set the score digits manually.


but, it does not give instrucitons how to do that, and searches on this forum came up empty. There are only 10 digits defined, if I try to create any more, I get the following error:

2600 Basic compilation complete.
DASM V2.20.07, Macro Assembler 1988-2003
bytes of ROM space left
--> loop2 f200
2285 bytes of ROM space left
2285 bytes of ROM space left
segment: fffc vs current org: 10004
pftest.bas.asm (1998): error: Origin Reverse-indexed.
Aborting assembly


I'm guessing that I have to change some of the ORG tags to compensate for the extra digits, but how do I calculate that?

Yes, you will need to change the ORGs and RORGs to do that. For each additional character that you want to define, you must reduce the ORGs and RORGs by 8 bytes, since each character shape uses 8 bytes. I'll post an example later tonight.

Michael

#3 SeaGtGruff OFFLINE  

SeaGtGruff

    Quadrunner

  • 5,455 posts
  • Location:Georgia, USA

Posted Thu May 22, 2008 9:01 PM

Following is the standard score_graphics.asm file:

; feel free to modify the score graphics - just keep each digit 8 high
; and keep the conditional compilation stuff intact
 ifconst ROM2k
   ORG $F7AC
 else
   ifconst bankswitch
	 if bankswitch == 8
	   ORG $2F94-bscode_length
	   RORG $FF94-bscode_length
	 endif
	 if bankswitch == 16
	   ORG $4F94-bscode_length
	   RORG $FF94-bscode_length
	 endif
	 if bankswitch == 32
	   ORG $8F94-bscode_length
	   RORG $FF94-bscode_length
	 endif
   else
	 ORG $FF9C
   endif
 endif


scoretable
	   .byte %00111100
	   .byte %01100110
	   .byte %01100110
	   .byte %01100110
	   .byte %01100110
	   .byte %01100110
	   .byte %01100110
	   .byte %00111100

	   .byte %01111110
	   .byte %00011000
	   .byte %00011000
	   .byte %00011000
	   .byte %00011000
	   .byte %00111000
	   .byte %00011000
	   .byte %00001000

	   .byte %01111110
	   .byte %01100000
	   .byte %01100000
	   .byte %00111100
	   .byte %00000110
	   .byte %00000110
	   .byte %01000110
	   .byte %00111100

	   .byte %00111100
	   .byte %01000110
	   .byte %00000110
	   .byte %00000110
	   .byte %00011100
	   .byte %00000110
	   .byte %01000110
	   .byte %00111100

	   .byte %00001100
	   .byte %00001100
	   .byte %01111110
	   .byte %01001100
	   .byte %01001100
	   .byte %00101100
	   .byte %00011100
	   .byte %00001100

	   .byte %00111100
	   .byte %01000110
	   .byte %00000110
	   .byte %00000110
	   .byte %00111100
	   .byte %01100000
	   .byte %01100000
	   .byte %01111110

	   .byte %00111100
	   .byte %01100110
	   .byte %01100110
	   .byte %01100110
	   .byte %01111100
	   .byte %01100000
	   .byte %01100010
	   .byte %00111100

	   .byte %00110000
	   .byte %00110000
	   .byte %00110000
	   .byte %00011000
	   .byte %00001100
	   .byte %00000110
	   .byte %01000010
	   .byte %00111110

	   .byte %00111100
	   .byte %01100110
	   .byte %01100110
	   .byte %01100110
	   .byte %00111100
	   .byte %01100110
	   .byte %01100110
	   .byte %00111100

	   .byte %00111100
	   .byte %01000110
	   .byte %00000110
	   .byte %00111110
	   .byte %01100110
	   .byte %01100110
	   .byte %01100110
	   .byte %00111100 


 ifconst ROM2k
   ORG $F7FC
 else
   ifconst bankswitch
	 if bankswitch == 8
	   ORG $2FF4-bscode_length
	   RORG $FFF4-bscode_length
	 endif
	 if bankswitch == 16
	   ORG $4FF4-bscode_length
	   RORG $FFF4-bscode_length
	 endif
	 if bankswitch == 32
	   ORG $8FF4-bscode_length
	   RORG $FFF4-bscode_length
	 endif
   else
	 ORG $FFFC
   endif
 endif
To add space for more digits, you need to modify the first set of ORGs and RORGs. The following values will reserve room for six (6) more 8x8 "digits" ($A through $F in the BCD format):

ifconst ROM2k
   ORG $F77C  ; was ORG $F7AC
 else
   ifconst bankswitch
	 if bankswitch == 8
	   ORG $2F64-bscode_length  ; was ORG $2F94-bscode_length
	   RORG $FF64-bscode_length  ; was RORG $FF94-bscode_length
	 endif
	 if bankswitch == 16
	   ORG $4F64-bscode_length  ; was ORG $4F94-bscode_length
	   RORG $FF64-bscode_length  ; was RORG $FF94-bscode_length
	 endif
	 if bankswitch == 32
	   ORG $8F64-bscode_length  ; was ORG $8F94-bscode_length
	   RORG $FF64-bscode_length  ; was RORG $FF94-bscode_length
	 endif
   else
	 ORG $FF6C  ; was ORG $FF9C
   endif
 endif
Then you would want to define the six (6) additional shapes at the end of the existing digits. For example, suppose you want to add the hex digits "A" through "F":

.byte %00111100  ; this is the shape data for "9" already in the file
	   .byte %01000110
	   .byte %00000110  ; the new characters would go below it as shown
	   .byte %00111110
	   .byte %01100110
	   .byte %01100110
	   .byte %01100110
	   .byte %00111100

	   .byte %01100110  ; hex digit "A"
	   .byte %01100110
	   .byte %01100110
	   .byte %01111110
	   .byte %01100110
	   .byte %01100110
	   .byte %00111100
	   .byte %00011000

	   .byte %01111100  ; hex digit "B"
	   .byte %01100110
	   .byte %01100110
	   .byte %01100110
	   .byte %01111100
	   .byte %01100110
	   .byte %01100110
	   .byte %01111100

	   .byte %00111100  ; hex digit "C"
	   .byte %01100110
	   .byte %01100000
	   .byte %01100000
	   .byte %01100000
	   .byte %01100000
	   .byte %01100110
	   .byte %00111100

	   .byte %01111000  ; hex digit "D"
	   .byte %01101100
	   .byte %01100110
	   .byte %01100110
	   .byte %01100110
	   .byte %01100110
	   .byte %01101100
	   .byte %01111000

	   .byte %01111110  ; hex digit "E"
	   .byte %01100000
	   .byte %01100000
	   .byte %01100000
	   .byte %01111100
	   .byte %01100000
	   .byte %01100000
	   .byte %01111110

	   .byte %01100000  ; hex digit "F"
	   .byte %01100000
	   .byte %01100000
	   .byte %01100000
	   .byte %01111100
	   .byte %01100000
	   .byte %01100000
	   .byte %01111110
Michael

#4 MausGames OFFLINE  

MausGames

    Dragonstomper

  • 871 posts
  • Location:MO, USA

Posted Thu May 22, 2008 9:39 PM

Thank you MR, I always wanted to try that!

#5 lord_mike OFFLINE  

lord_mike

    Chopper Commander

  • Topic Starter
  • 164 posts

Posted Thu May 22, 2008 10:59 PM

Thank you from me as well!!! :)

#6 batari OFFLINE  

batari

    )66]U('=I;B$*

  • 6,501 posts
  • begin 644 contest

Posted Thu May 22, 2008 11:38 PM

I thought I'd mention that you can add more than 6 shapes to the score digits with some tricks. The caveats are that this needs to be done in vblank (i.e. with the vblank command) and all score graphics need to live in the last page of ROM ($FF00 or above) so you can only fit about 8-12 more depending on the size of the ROM.

You will need to adjust the ORG/RORGs back some more in score_graphics.asm, but not less than $FF00, and make sure you put the extra digits at the very end (after the "F" digit.) Then at the beginning of code, place:

const scpointer=<score_digits+128

Then set the pointers in vblank, using something like this:
scorepointers[x]=scpointer+8*y

x is the digit number 0-5 (I think these are not in order) and y is the digit beyond "F" that you wish to use.

Edited by batari, Thu May 22, 2008 11:40 PM.


#7 lord_mike OFFLINE  

lord_mike

    Chopper Commander

  • Topic Starter
  • 164 posts

Posted Thu May 22, 2008 11:48 PM

Hmm... still not working... with your edits to the score_graphics.asm file, I still get this error:

2600 Basic compilation complete.
DASM V2.20.07, Macro Assembler ©1988-2003
bytes of ROM space left
Unrecoverable error(s) in pass, aborting assembly!
Complete.


Nothing more specific than that... my code compiles with the normal score_graphics.asm file...

#8 batari OFFLINE  

batari

    )66]U('=I;B$*

  • 6,501 posts
  • begin 644 contest

Posted Fri May 23, 2008 12:07 AM

The problem is that when posting code here, the code tag removes single-space indentation. This happens all the time :(

Here is a fixed, downloadable version of SeaGtGruff's modified file.

Attached Files



#9 Random Terrain OFFLINE  

Random Terrain

    Visual batari Basic User

  • 25,017 posts
  • Controlled Randomness
    Replay Value
    Nonlinear
  • Location:North Carolina (USA)

Posted Fri May 23, 2008 9:14 AM

According to the Batari Basic Command Reference:

You can modify score_graphics.asm to include definitions for digits "A-F" and set the score digits manually.


but, it does not give instrucitons how to do that, and searches on this forum came up empty. There are only 10 digits defined, if I try to create any more, I get the following error:

The link on both bB pages now point to this thread.

#10 lord_mike OFFLINE  

lord_mike

    Chopper Commander

  • Topic Starter
  • 164 posts

Posted Fri May 23, 2008 11:53 AM

The problem is that when posting code here, the code tag removes single-space indentation. This happens all the time :(

Here is a fixed, downloadable version of SeaGtGruff's modified file.


Thanks, Batari! Much obliged!!! :)

#11 atari2600land ONLINE  

atari2600land

    Game Gear>Game Boy

  • 8,263 posts
  • Location:Salem, Oregon

Posted Wed May 28, 2008 1:38 PM

I'm working on a playable Texas-Hold-'Em mockup. I need one more shape in the score. Right now, I have a modified score asm with the following (ace-ten, jack, queen, king, spade, heart, diamond.) I need to fit the club suit in there, but I need some help in doing that. Here's what I have so far. I can't even fathom how to go about doing that. I put this in this topic in case someone wants to add more shapes to the score.

Attached Thumbnails

  • theshot.png

Attached Files



#12 CurtisP OFFLINE  

CurtisP

    Chopper Commander

  • 211 posts

Posted Sat Jul 19, 2008 10:38 PM

I'm working on a playable Texas-Hold-'Em mockup. I need one more shape in the score. Right now, I have a modified score asm with the following (ace-ten, jack, queen, king, spade, heart, diamond.) I need to fit the club suit in there, but I need some help in doing that. Here's what I have so far. I can't even fathom how to go about doing that. I put this in this topic in case someone wants to add more shapes to the score.


It looks like you are using my playerscores routine. The beyond 16 trick won't work with it as is. I can probably modify it though.

#13 jrok OFFLINE  

jrok

    Stargunner

  • 1,149 posts

Posted Tue Mar 31, 2009 9:51 AM

Is there a way to modify the scoretable to display additional BCD numbers (for instance, to display an eight digit score, title or inventory?)

Thanks,
Jarod.

#14 SeaGtGruff OFFLINE  

SeaGtGruff

    Quadrunner

  • 5,455 posts
  • Location:Georgia, USA

Posted Tue Mar 31, 2009 3:05 PM

Is there a way to modify the scoretable to display additional BCD numbers (for instance, to display an eight digit score, title or inventory?)

Thanks,
Jarod.

When you say "to display an eight digit score," do you mean showing eight digits within the six-player, 48-pixel score, or 6 pixels across per digit instead of 8 pixels across?

You can't modify the scoretable per se, because it wouldn't be big enough, but you can create custom data tables and then point the score display to the characters you want to display. I posted some mods for that a while back, regarding using the score to display a six-item inventory strip, or a bitmapped title blurb, etc. I'll see if I can't put together another demo of it, because the original mod was for bB v0.99 or v0.35 (I forget), and I had to change it for v1.00, so now it works a little bit differently (but still basically the same).

Michael

#15 jrok OFFLINE  

jrok

    Stargunner

  • 1,149 posts

Posted Tue Mar 31, 2009 3:56 PM

Is there a way to modify the scoretable to display additional BCD numbers (for instance, to display an eight digit score, title or inventory?)

Thanks,
Jarod.

When you say "to display an eight digit score," do you mean showing eight digits within the six-player, 48-pixel score, or 6 pixels across per digit instead of 8 pixels across?

You can't modify the scoretable per se, because it wouldn't be big enough, but you can create custom data tables and then point the score display to the characters you want to display. I posted some mods for that a while back, regarding using the score to display a six-item inventory strip, or a bitmapped title blurb, etc. I'll see if I can't put together another demo of it, because the original mod was for bB v0.99 or v0.35 (I forget), and I had to change it for v1.00, so now it works a little bit differently (but still basically the same).

Michael


I remember that demo. That was very nice. I guess I was wondering if an 8-player, 64-pixel display would be possible.

Jarod

#16 SeaGtGruff OFFLINE  

SeaGtGruff

    Quadrunner

  • 5,455 posts
  • Location:Georgia, USA

Posted Tue Mar 31, 2009 5:30 PM

I remember that demo. That was very nice. I guess I was wondering if an 8-player, 64-pixel display would be possible.

Jarod

Yes, it would [edit: see PS below], but you'd have to manage the storing, updating, and displaying of the score by yourself. That is, bB's builtin score is six digits, and you can use it to display an eight-digit score, but when you say "the score," you're really talking about a topic that involves six interrelated things--

(1) the RAM bytes that are used to store the score;

(2) the program routines that are used to perform mathematical operations on the score (e.g., adding points to it, or subtracting points from it);

(3) the ROM or RAM data tables that are used to define the graphical shapes (i.e., digits, letters, symbols, etc.) that will be displayed in the score;

(4) the program routines that are used to display the score on the screen by carefully positioning the players and then updating the player graphics seven times per scan line (i.e., six times for the six player copies, plus one extra time because VDEL is on);

(5) the RAM bytes that point to the locations of the specific shapes in the shape table that are to be drawn; and

(6) the program routines that are used to set those pointers based on the value of the score.

If you want to do an eight-digit score, you'll need to manage all of that yourself. The trickiest part would be dealing with the fact that you're trying to display eight six-pixel-wide shapes using six eight-pixel-wide sprites, so you'd either need to define ROM tables for all the different combinations of shapes in all the different positions-- which would take up a lot of ROM-- or better yet, copy the shapes into RAM, bit-shift them according to their positions, and use logical operations to merge multiple shapes together. You'd need 48 bytes of RAM for that, and copying the ROM shapes into RAM would take up a good bit of your game's VBLANK time-- although you could program it so that the RAM gets updated only whenever the score changes, rather than being updated during each frame even if the score didn't change. And if you moved the ROM shapes into RAM like that, then you wouldn't need to use pointers, because you'd always be pulling the display data from the same RAM locations.

Michael

[edit: PS-- Sorry, I don't think a 64-pixel score would be possible, at least not using player graphics. But you can do it using the playfield to draw the score, as was done in several games (e.g., Space Invaders).]

Edited by SeaGtGruff, Tue Mar 31, 2009 5:33 PM.


#17 SeaGtGruff OFFLINE  

SeaGtGruff

    Quadrunner

  • 5,455 posts
  • Location:Georgia, USA

Posted Tue Mar 31, 2009 6:27 PM

If you're using Superchip bankswitching (set romsize 8kSC, 16kSC, or 32kSC), the playfield is moved to Superchip RAM, freeing 48 bytes of zero-page RAM-- the exact number of bytes needed to store a bitmapped eight-digit score! And as I mentioned in my previous post, you wouldn't need to use the score pointers anymore, which frees some more zero-page RAM. So that would let you store an eight-digit BCD score in four bytes, and move the digit shapes into the 48 bytes of RAM as needed. This would be a cool enhancement, so I'll play with it and try to come up with a mod for it-- but no promises.

Michael

#18 jrok OFFLINE  

jrok

    Stargunner

  • 1,149 posts

Posted Tue Mar 31, 2009 6:39 PM

If you're using Superchip bankswitching (set romsize 8kSC, 16kSC, or 32kSC), the playfield is moved to Superchip RAM, freeing 48 bytes of zero-page RAM-- the exact number of bytes needed to store a bitmapped eight-digit score! And as I mentioned in my previous post, you wouldn't need to use the score pointers anymore, which frees some more zero-page RAM. So that would let you store an eight-digit BCD score in four bytes, and move the digit shapes into the 48 bytes of RAM as needed. This would be a cool enhancement, so I'll play with it and try to come up with a mod for it-- but no promises.

Michael


I am using the superchip.

No promises expected Sir Rideout. That would really, really cool though. :cool: You're the best, man.

Cheers,
Jarod




0 user(s) are browsing this forum

0 members, 0 guests, 0 anonymous users