Jump to content
RevEng

7800basic beta, the release thread

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

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

mame and a7800 can dump memory from the debugger. There's a primer for the debugger at 7800.8bitdev.org.

 

Specifically you're looking at either the save (bin) or dump (txt) debugger commands.

  • Like 1

Share this post


Link to post
Share on other sites

There haven't been any developer or technical docs released for the XM, so none of the emulators have support the keyboard. It's quite likely we'd also need a copy of the XM bios too, or equivalent code.

Share this post


Link to post
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

Share this post


Link to post
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

Share this post


Link to post
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? 

Share this post


Link to post
Share on other sites

Nope. This thread on AA is the home of 7800basic support, and where all of the active user community is.

  • Thanks 1

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

OK, so I am trying some 320D experiments.  When I compile, I get this:

 

Problem characters in 320D_1a.png

 

Attaching my .bas file and source incgraphics.  Basically, I want to use $44 in even columns and $84 in odd columns, while BAK and P0C1 are both black.   Can someone troubleshoot this?

320D_1a.png

320D_2a.png

320Dtest.bas

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

I haven't really done much in 320D, but if you want to use the register that's normally transparent for a color, then yes. (true for any of the modes)

Share this post


Link to post
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.

Share this post


Link to post
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

Share this post


Link to post
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

Share this post


Link to post
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.

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