Jump to content

Photo

7800basic beta, the release thread


742 replies to this topic

#726 SmittyB OFFLINE  

SmittyB

    Chopper Commander

  • 133 posts

Posted Tue Aug 29, 2017 5:51 AM

Speaking of bankswitching is there an example of a bare-bones program using it? I may want to convert to bankswitching but I don't know how well it would work for me and I think I'd have to do a lot of restructuring of my code.

Do plotted graphics/banners stay the same once drawn or do they change too if the bank is switched out?
If not would it be possible to store graphics across multiple banks, swapping between them to draw everything, as long as the graphics for tiled characters are duplicated across each?

#727 RevEng OFFLINE  

RevEng

    River Patroller

  • Topic Starter
  • 4,701 posts
  • Bitnik
  • Location:Canada

Posted Tue Aug 29, 2017 7:46 AM

Looks I don't have an example right now. I'll have to fix that when I get a chance.

The syntax is pretty straightforward...
 
 set romsize 128k
 rem we always start in bank 1. no need to declare it.
 [a bunch of code]
 goto maingame bank2

 bank 2
maingame
 [a bunch of code that belongs to bank 2]

 bank 4
 rem we skipped bank 3, so it's empty
 [a bunch of code for bank 4]

 bank 8
 rem this is the last bank in the rom. it's always present

Do plotted graphics/banners stay the same once drawn or do they change too if the bank is switched out?

If not would it be possible to store graphics across multiple banks, swapping between them to draw everything, as long as the graphics for tiled characters are duplicated across each?


Any graphics displayed from the current bank will change when you bankswitch. If you plan ahead, as you suggest, you can use this to replace the graphics for different game levels/areas.

#728 Synthpopalooza OFFLINE  

Synthpopalooza

    Stargunner

  • 1,420 posts
  • Location:knoxville, TN

Posted Sun Sep 3, 2017 7:33 PM

OK, I am having problems again ... I am trying to put in a table to read starting values for the player's sprite, which will change each level.

 

When I compile, the compiler barfs ... and this is what I get back:

 

 

7800basic compilation complete.
User-defined 7800.asm found in current directory
old value: $0190  new value: $0144
old value: $018c  new value: $0143
old value: $018a  new value: $0142
old value: $0188  new value: $0141
7800basic_variable_redefs.h (384): error: EQU: Value mismatch.
7800basic_variable_redefs.h (386): error: EQU: Value mismatch.
7800basic_variable_redefs.h (388): error: EQU: Value mismatch.
7800basic_variable_redefs.h (390): error: EQU: Value mismatch.
C:\Users\Coddington\Downloads\7800basic\ramcharmap5a.bas.asm (5098): error: Value in 'lda (startposdata),y' must be <$100.
C:\Users\Coddington\Downloads\7800basic\ramcharmap5a.bas.asm (5106): error: Value in 'lda (startposdata),y' must be <$100.

Unrecoverable error(s) in pass, aborting assembly!
Complete.
Cartridge data file must be at least 4K!

7800header 0.7 Jun  6 2017 19:03:32
*** ERROR: The file size of C:\Users\Coddington\Downloads\7800basic\ramcharmap5a
.bas.bin is 0 bytes.

 

Attached Files



#729 RevEng OFFLINE  

RevEng

    River Patroller

  • Topic Starter
  • 4,701 posts
  • Bitnik
  • Location:Canada

Posted Sun Sep 3, 2017 8:18 PM

Looks like I need to add this to the documentation... the variable(s) you use with sdata needs to be based on the a-z ones, not var### or other locations.

The underlying technical reason is sread/sdata uses 6502 indirect addressing, and so they need zero-page memory.

#730 Synthpopalooza OFFLINE  

Synthpopalooza

    Stargunner

  • 1,420 posts
  • Location:knoxville, TN

Posted Sun Sep 3, 2017 9:37 PM

Well, snap ... time to retool things.  :)



#731 Synthpopalooza OFFLINE  

Synthpopalooza

    Stargunner

  • 1,420 posts
  • Location:knoxville, TN

Posted Mon Sep 4, 2017 7:32 PM

I have some questions about the 320C and 320D modes. I.am thinking of doing some graphics mode experiments.

* Which palettes are referenced in these modes, and which character columns are they used in?
* How many pixels wide per character, single and double wide?
* What is the DMA overhead on these modes compared to 320A and 320B?
* If I were to design an incgraphics png, do I place the appropriate colors in the appropriate colum, and 7800basic will sort it out?

I have an idea for a 16 color 320 mode but I need this info to see if I can do it.

#732 RevEng OFFLINE  

RevEng

    River Patroller

  • Topic Starter
  • 4,701 posts
  • Bitnik
  • Location:Canada

Posted Tue Sep 5, 2017 12:11 PM

I have some questions about the 320C and 320D modes. I.am thinking of doing some graphics mode experiments.

* Which palettes are referenced in these modes, and which character columns are they used in?
* How many pixels wide per character, single and double wide?


These are covered in the Graphics Mode table in the 7800basic Guide.
 

* What is the DMA overhead on these modes compared to 320A and 320B?


Technically DMA timing doesn't actually differ between modes. What does differ is the number of pixels any given graphics character/byte will display, so some modes let you cover the same screen area with fewer bytes. (and therefore incur less DMA penalty)

To compare the pixel-to-byte efficiency, just look at the "width of 1 character" info in the previously mentioned Graphics Mode table. A mode that displays 4 pixels per byte, will use ~1/2 the DMA time (to cover the same area) compared to a mode that displays 2 pixels per byte.

 

* If I were to design an incgraphics png, do I place the appropriate colors in the appropriate colum, and 7800basic will sort it out?

I have an idea for a 16 color 320 mode but I need this info to see if I can do it.


Yes, it will sort it out. Just bear in mind that 7800basic can't stop you from breaking the rules in your PNG.

If you're wanting to flicker modes, either the character width will need to be identical between the 2 modes, or you'll need to also update the character map every other frame.

#733 Synthpopalooza OFFLINE  

Synthpopalooza

    Stargunner

  • 1,420 posts
  • Location:knoxville, TN

Posted Tue Sep 5, 2017 2:58 PM

The idea I had runs something like this ...

The 320C mode requires every 2 pixel columns to be of the same palette ... so:

* Put monochrome values $03,$09,$0f into palette #1
* put $49, $89, $b9 into palette 4. (Red green blue)
Then on each cycle:

* Swap character sets
* Swap the palettes out so that palette 1 becomes chroma and palette 4 becomes luma.

I believe by doing this you can get a 320 pixel mode at 16 colors, the two color palettes will interlace on the vertical columns to avoid full frame flicker. I may try it tonight ...

Edited by Synthpopalooza, Tue Sep 5, 2017 4:00 PM.


#734 Synthpopalooza OFFLINE  

Synthpopalooza

    Stargunner

  • 1,420 posts
  • Location:knoxville, TN

Posted Tue Sep 5, 2017 10:03 PM

OK, question about displaying scores:

 

I tried to add score functionality to my code, but it seems not to update the score ... nothing gets printed.  It should update by 100 when a block is painted, 500 when a coin is picked up, 1000 when the adrenaline pill on level 10 is picked up, or 1000 when a level is completed.

 

I wonder if you could have a look at the code and see what I am doing wrong.  The idea is, I want to print all 6 digits of the score0 variable at location 0,1 (including the leading zeros, if any) using palette 1, everytime the score is updated.

 

 

Attached Files



#735 Mord OFFLINE  

Mord

    River Patroller

  • 2,562 posts
  • Location:Canada

Posted Wed Sep 6, 2017 2:47 AM

Not sure what's wrong with it myself, it seems to display fine. (note: I'm looking at it with prosystem, which can be kinda off at times in certain situations)

 

Got a screenshot for what you're seeing?



#736 RevEng OFFLINE  

RevEng

    River Patroller

  • Topic Starter
  • 4,701 posts
  • Bitnik
  • Location:Canada

Posted Wed Sep 6, 2017 5:30 AM

Also seems to be displaying fine in a7800.

#737 Synthpopalooza OFFLINE  

Synthpopalooza

    Stargunner

  • 1,420 posts
  • Location:knoxville, TN

Posted Wed Sep 6, 2017 8:40 AM

On my end, every time you paint a block or pick up an item, the score doesn't update and show how many points you have. I will have a look later today and get a screenshot.

#738 Synthpopalooza OFFLINE  

Synthpopalooza

    Stargunner

  • 1,420 posts
  • Location:knoxville, TN

Posted Wed Sep 6, 2017 4:07 PM

Going back to 320D ...

It looks promising as a 4 color alternative to 320B if we use flickering, as it seems to use less bytes than 320B per character.

The other question I have is: Does this mode allow you 8 unique palette settings like 320A? How are the colors mapped out? For example, would palette 1 map out like this:

Even columns = P1C0 P1C1
Odd columns = P1C2 P1C3

and is this mapping constant for the other 7 palettes?

#739 Mord OFFLINE  

Mord

    River Patroller

  • 2,562 posts
  • Location:Canada

Posted Thu Sep 7, 2017 4:21 AM

Going back to 320D ...

It looks promising as a 4 color alternative to 320B if we use flickering, as it seems to use less bytes than 320B per character.

The other question I have is: Does this mode allow you 8 unique palette settings like 320A? How are the colors mapped out? For example, would palette 1 map out like this:

Even columns = P1C0 P1C1
Odd columns = P1C2 P1C3

and is this mapping constant for the other 7 palettes?

 

Just doublechecked info from the maria document I have, but unfortunately you don't have access to all 8 palettes in 320D. Just like in 320B, which it's based on, only the top palette bit is used for determining palette so you only get palette P0 and P4.  (My world was crushed when I realized that for 320B way back. :D)



#740 Synthpopalooza OFFLINE  

Synthpopalooza

    Stargunner

  • 1,420 posts
  • Location:knoxville, TN

Posted Thu Sep 7, 2017 8:05 AM

So that means we get p1/p4 and then the reverse, p4/p1?

Not bad ... the equivalent of 320B, two unique palettes, and through flickering you get the same colors as 320B but with less DMA overhead.

Edited by Synthpopalooza, Thu Sep 7, 2017 8:06 AM.


#741 Synthpopalooza OFFLINE  

Synthpopalooza

    Stargunner

  • 1,420 posts
  • Location:knoxville, TN

Posted Fri Sep 8, 2017 3:08 PM

Ok a question about arrays and bitwise variables ...

playerflags[0] accesses it as an array.
playerflags{0} accesses it as bitwise.

Is there anyway to do both at the same time? E.g. playerflags[0]{0} ...

#742 RevEng OFFLINE  

RevEng

    River Patroller

  • Topic Starter
  • 4,701 posts
  • Bitnik
  • Location:Canada

Posted Fri Sep 8, 2017 4:28 PM

No. You'd have to use an intermediate variable to do that...

temp1=playerflags[0]:temp1{0}=1:playerflags[0]=temp1

...but it's generally more efficient to use bitwise operations instead of bitwise arrays, which you can use with arrays.

#743 Synthpopalooza OFFLINE  

Synthpopalooza

    Stargunner

  • 1,420 posts
  • Location:knoxville, TN

Posted Sun Sep 10, 2017 8:51 PM

OK, more problems ... :)

 

#1:  The coin counter is not updating properly ... it shows "100" when one coin is picked up, then shows nothing if more than 10 are picked up.

 

#2:  My player seems to explode and lose a life immediately when the binary is first run ... any ideas on what is triggering this?

 

 

Attached Files






0 user(s) are browsing this forum

0 members, 0 guests, 0 anonymous users