Jump to content
IGNORED

Defining A-F in score_graphics.asm


lord_mike

Recommended Posts

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

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

texasholdem1.zip

post-9475-1212003382_thumb.png

Link to comment
Share on other sites

  • 1 month later...
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.

Link to comment
Share on other sites

  • 8 months later...
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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

  • 13 years later...

You need to add dim statements for all 3 bytes that make up the score, then you can assign to those variables individually:

 

   dim _sc1 = score
   dim _sc2 = score+1
   dim _sc3 = score+2

 

If you then wanted the score to show all 6 of the graphics you defined for A-F, you could do something like this:

 

   _sc1 = $AB
   _sc2 = $CD
   _sc3 = $EF

 

  • Like 1
Link to comment
Share on other sites

On 22/5/2008 at 19:06, SeaGtGruff said:

Sí, deberá cambiar los ORG y los RORG para hacerlo. Para cada carácter adicional que desee definir, debe reducir los ORG y RORG en 8 bytes, ya que cada forma de carácter utiliza 8 bytes. Voy a publicar un ejemplo más tarde esta noche.

 

Miguel

I need help with a batari basic error the error is that every time I want to compile something it tells me that it can't find the .bas.bin file and it doesn't let it compile even though I check the box to create that file

Link to comment
Share on other sites

4 hours ago, T Studios said:

I need help with a batari basic error the error is that every time I want to compile something it tells me that it can't find the .bas.bin file and it doesn't let it compile even though I check the box to create that file

 

Have you tried this:

 

https://www.randomterrain.com/atari-2600-memories-batari-basic-vbb.html#trouble_defaultbasbin

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