Jump to content
IGNORED

7800basic beta, the release thread


RevEng

Recommended Posts

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?

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

 

ramcharmap5a.bas

ramcharmap5a.bas.asm

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

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.

 

 

ramcharmap5c.bas

ramcharmap5c.bas.a78

ramcharmap5c.bas.bin

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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)

  • Like 1
Link to comment
Share on other sites

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?

 

 

ramcharmap5b.bas

ramcharmap5b.bas.a78

ramcharmap5b.bas.bin

Link to comment
Share on other sites

  • 2 months later...

Been a bit busy lately, and just checking in.

 

@peteym5...

 

The underlying compiler for 7800basic is DASM, which is often used in the 7800 and 2600 scene. There's a (somewhat incomplete) DASM syntax page here.

 

For byte data, the DASM command would be ".byte" or "dc.b". Use quotes around text for encoding strings. For words, you can use ".word" or "dc.w".

 

There isn't an equivalent pseudo op to the MADS DTA. You'd specify the data types as above.

 

 

@synthpop...

 

Are you still stuck with these issues?

Link to comment
Share on other sites

  • 3 weeks later...

"UNRESOLVED SYMBOL LIST" needs to list what the unresolved symbols are during compile. When programs start getting longer and more complicated, it becomes too tedious to go through hundreds of lines of source code to find the label name that may be a typo, spelled wrong, or not defined yet.

Link to comment
Share on other sites

It does list the unresolved symbols. There is extra output due to 7800basic symbols that haven't resolved, and don't need to, so perhaps your typo was amidst that list.

 

Normally 7800basic filters out it's own symbols from that list, but lately I've worked on features without updating the filter list. I'll update it, next release.

Link to comment
Share on other sites

That'll make identifying those typos a little easier.

 

If I could request a feature it would be a version of plotmap with fine Y placement. I know this would be considerably harder to implement and manage compared to the existing plotmap, but I think fine vertical scrolling would make a big difference to the kinds of games that can be written providing the programmer is aware of the extra strain that it would add.

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