Jump to content
IGNORED

7800basic beta, the release thread


RevEng

Recommended Posts

I think you should just be able to change CHARBASE to whatever the high byte is for the starting address of your tiles in RAM. You would need extra RAM on the cartridge as it would take 4k for a 16 high zone (16 lines * 256 bytes per page) to store everything.

  • Thanks 2
Link to comment
Share on other sites

13 hours ago, SmittyB said:

I think you should just be able to change CHARBASE to whatever the high byte is for the starting address of your tiles in RAM. You would need extra RAM on the cartridge as it would take 4k for a 16 high zone (16 lines * 256 bytes per page) to store everything.

Good to know.  Is there a function in any of the 7800 emulators to do a binary dump of the RAM contents?  And I would need 8k of RAM for mine as I will be double buffering the font.

Link to comment
Share on other sites

Sure, a7800 handles those, and a bunch of other controls. There's some very preliminary support for keypads in 7800basic (also paddles, driving controls, trakballs, amiga/st mice) but as of right now I haven't sufficiently bug-tested or updated the docs+code samples.

  • Like 1
  • Thanks 1
Link to comment
Share on other sites

On 6/27/2019 at 5:13 AM, Synthpopalooza said:

Keypad it is then

As I had a lot of trouble trying to understand keypads I've copied the code I use below in case it helps you or anyone else in the future. It's based on code I found posted in the 2600 forums back in 2012 by alex_79 so I can't take credit for it. It reads 1 button at a time and if multiple are pressed it will return the lower-rightmost. It's possible to expand this to read 3 keys simultaneously as long as each is in a different column due to hardware limitations of the keypad circuitry.

 

	rem ------------------------
	rem Read Keypad - Credit to alex_79
	rem ------------------------
	rem +++++++++++++
	rem + 1 + 2 + 3 +
	rem +++++++++++++
	rem + 4 + 5 + 6 +
	rem +++++++++++++
	rem + 7 + 8 + 9 +
	rem +++++++++++++
	rem +10 +11 +12 +
	rem +++++++++++++
readKeypad
	rem disable 2-button mode on 2nd joy port...
	SWCHB=$ff:CTLSWB=$04:SWCHB=$00

	rem SWACNT - 0 = Input, 1 = Output
	asm
	;Set pins to output Right=#$0F, Left=#$F0 
	lda    #$0F ;0F
	sta    SWACNT

keypadReadkeypad
	lda    #$0F ;Right=#$0F, Left=#$F0 
	ldx    #12 ;12
	clc
keypadNextRow
	ror
	sta    SWCHA
	ldy    #255 ;150 loops minimum, more delay = more reliable results
keypadWait ;5*150 = 750 cycles (418us)
	dey ;2 cycles
	bne keypadWait ;3
	

	bit INPT5 ;Right=INPT5 ;Left=INPT4
	bpl keypadKeypressed
	dex

	bit INPT3 ;Right=INPT3 ;Left=INPT1
	bpl keypadKeypressed
	dex
	
	bit INPT2 ;Right=INPT2 ;Left=INPT0
	bpl keypadKeypressed
	dex
	
	bne keypadNextRow
keypadKeypressed
	stx keypadCurrentKey ;Store result for later reading
	
	;Reset SWACNT for joysticks (Set all pins to inputs)
	lda    #$00
    sta    SWACNT
end
	return

 

  • Thanks 1
Link to comment
Share on other sites

Got an e-mail today. Here's part of it:

Quote

I have been looking into porting some games over to 7800 Basic and may need some help if I get stuck. I am not allowed to use AtariAge, I am wondering if there is another website where I can get help from?

 

Is there another web site where a person can get help with 7800basic? 

Link to comment
Share on other sites

Sounds like the best he'll be able to do is have someone forward his questions for him or do some extensive searches in the forum to see if the question has already been answered. At the very least there's been a lot of odd issues we've already resolved.  At the very least they should re-read this thread entirely if needed. They should also keep Random Terrain's 7800Basic page bookmarked as it's excellent for looking stuff up.

  • Like 1
Link to comment
Share on other sites

Rename your files to being with a letter. incgraphic filenames can't start with characters... it's a limitation inherited from dasm. From the guide...

 

The graphic plotting commands will access your image by its filename, without the .png extension. Because of this, it has certain restrictions on the file naming to avoid confusing the 7800basic compiler…

 

  • Each name should be unique.
  • Each name should contain only letters and digits.
  • Each name should begin with a letter character.
Link to comment
Share on other sites

320B and 320D use the same CTRL "read mode", so you don't need to change that. The thing that distinguishes a particular object being either 320B or 320D is in the object's DL entry. (the "write mode") 7800basic's plot* functions will handle that for you, so long as you specified 320D with incraphic.

Link to comment
Share on other sites

So I don't think I am doing this correctly.  I am including the incgraphics.

 

So the idea is, I want columns 0, 2, 4, 6 to be red,  and columns 1, 3, 5, 7 to be cyan.  Problem is, the second lot of graphics, where the cyan should appear in the odd columns, all show solid black.

 

I am thinking the problem might lie with the layout of 320D, or I don't have kangaroo mode set properly.

 

Any ideas?

 

 

mode320D_1a.png

mode320D_2a.png

320Dtest.bas 320Dtest.bas.a78 320Dtest.bas.asm 320Dtest.bas.bin

Link to comment
Share on other sites

I figured it out ... the graphics need all four colors.  Even though I am setting BG and P0C1 to black, in the incgraphic there need to be distinct colors for P0C1 on columns 1 and 3.

 

This was the result of my experiment:  https://atariage.com/forums/topic/292439-character-flipping-for-extra-colors-a-primer/?do=findComment&comment=4304605

 

It's an interlace test that allows for a fully functional 3 color plus BG 320 display mode across 4 palettes, but with less DMA costs than 320B.  It just remains to be seen how it looks on real hardware.

320Dtest.bas.a78 320Dfont.bas.a78

Edited by Synthpopalooza
Link to comment
Share on other sites

  • 3 weeks later...

Apologies for the long post.

I've been running into a bit of a problem importing graphics which seems to put the compilation process into an infinite loop after the graphics data info but before "7800basic compilation complete.". I've just updated from '7800basic.0.6beta20170712' to '7800basic.0.6beta20190613' and it has the same problem but interestingly the situation where it used to spit out the below errors as part of the error log now just goes into the suspected infinite loop as well.

The issue is that I've got 4 16*16 images I'm trying to import, so 16 160A chunks (for lack of a better word) and I can import them into 2 banks, and if I import 1 more of the 4 images in another bank it gives the below errors on the older version and gets stuck on the newer version, 1 more than that and it gets stuck compiling on both versions which is why I suspect an infinite loop. It doesn't seem to be related to any specific bank as I can import any mixture of the 4 graphics across the banks and as long as I don't go above 8 in total it compiles. It doesn't seem to be related to the images themselves or the filenames.

end brace required
end brace required
(81298): error: Unknown Mnemonic '®hu'.
(81299): error: Unknown Mnemonic '®hu'.
(81612): error: Unknown Mnemonic '-mtune=generic'.
(81613): error: Unknown Mnemonic '-mtune=generic'.
(81618): error: Unknown Mnemonic 'int_mult_lo'.
(81619): error: Unknown Mnemonic 'int_mult_hi'.
(81632): error: Unknown Mnemonic 'int_mult_lo'.
(81633): error: Unknown Mnemonic 'int_mult_hi'.
(81788): error: Unknown Mnemonic '5'.
(81789): error: Unknown Mnemonic '5'.
(81792): error: Unknown Mnemonic 'int_mult_lo'.
(81793): error: Unknown Mnemonic 'int_mult_hi'.
(81794): error: Unknown Mnemonic 'char_mult_lo'.
(81795): error: Unknown Mnemonic 'char_mult_hi'.
(81826): error: Unknown Mnemonic 'int_mult_lo'.
(81827): error: Unknown Mnemonic 'int_mult_hi'.
(81828): error: Unknown Mnemonic 'double_mult_lo'.
(81829): error: Unknown Mnemonic 'double_mult_hi'.
(81854): error: Unknown Mnemonic 'char_mult_lo'.
(81855): error: Unknown Mnemonic 'char_mult_hi'.
(81878): error: Unknown Mnemonic '-g'.
(81879): error: Unknown Mnemonic '-g'.
(81882): error: Unknown Mnemonic '-g'.
(81883): error: Unknown Mnemonic '-g'.
(81888): error: Unknown Mnemonic 'int_mult_lo'.
(81889): error: Unknown Mnemonic 'int_mult_hi'.
(81906): error: Unknown Mnemonic '-m32'.
(81907): error: Unknown Mnemonic '-m32'.
(81910): error: Unknown Mnemonic 'int_mult_lo'.
(81911): error: Unknown Mnemonic 'int_mult_hi'.
(81918): error: Unknown Mnemonic 'unsigned'.
(81919): error: Unknown Mnemonic 'unsigned'.
(81924): error: Unknown Mnemonic '��_mult_lo'.
(81925): error: Unknown Mnemonic '��_mult_hi'.
(81932): error: Unknown Mnemonic 'BYTE_mult_lo'.
(81933): error: Unknown Mnemonic 'BYTE_mult_hi'.
(81962): error: Unknown Mnemonic '-std=gnu99_mult_lo'.
(81963): error: Unknown Mnemonic '-std=gnu99_mult_hi'.
(81968): error: Unknown Mnemonic 'int_mult_lo'.
(81969): error: Unknown Mnemonic 'int_mult_hi'.

 

If it helps, I'm using the 144k bankswitching scheme with banks 3 through 7 (inclusive) containing the same graphics and they all report 26*16 bytes of graphics space free which is more than enough for the 16 chunks I'm trying to import. When it compiles it reports this amount of ROM used. The negative values are where I'm using a DMA hole in that bank (a minor bug? Doesn't seem to affect anything, just makes judging space available difficult).

4186 bytes of ROM space left in the main area of bank 1.
             4096 bytes of ROM space left in DMA hole 0.
   -6144 bytes of ROM space left in the main area of bank 2.
             2048 bytes of ROM space left in DMA hole 0.
   3411 bytes of ROM space left in the main area of bank 3.
             4096 bytes of ROM space left in DMA hole 0.
   3034 bytes of ROM space left in the main area of bank 4.
             4096 bytes of ROM space left in DMA hole 0.
   918 bytes of ROM space left in the main area of bank 5.
             4096 bytes of ROM space left in DMA hole 0.
   -4879 bytes of ROM space left in the main area of bank 6.
             3313 bytes of ROM space left in DMA hole 0.
   -4580 bytes of ROM space left in the main area of bank 7.
             3612 bytes of ROM space left in DMA hole 0.
   14329 bytes of ROM space left in the main area of bank 8.
   0 bytes of ROM space left in the main area of bank 9.
             4096 bytes of ROM space left in DMA hole 0.

 

Link to comment
Share on other sites

Wow, that's a whole bunch of yuck. It looks like uninitialized memory is somehow getting included in the generated 6502 assembly.

 

I'd like to see the *.list.txt file, if you can share it. If that does't help, I may need the entire source, so I can easily recreate the issue and track it down. PM is fine.

  • Thanks 1
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...