Jump to content



1

Hello World?


5 replies to this topic

#1 yuppicide OFFLINE  

yuppicide

    I am the Black Knight. Give me your money!

  • 6,933 posts
  • Location:New Jersey

Posted Mon Aug 10, 2009 7:09 PM

Is there a "Hello World" type demo for 2600 ASM?

I am really just looking for a way to randomly display blocks of text.. like paragraphs on the screen. Once it displays pressing the fire button would make a new one display.

I would do something in bAtari Basic since I can draw playfields easily, but I'd like more text than that way is able to display.

Edited by yuppicide, Mon Aug 10, 2009 7:11 PM.


#2 Nukey Shay OFFLINE  

Nukey Shay

    Sheik Yerbouti

  • 20,458 posts
  • Location:The land of Gorch

Posted Tue Aug 11, 2009 5:34 AM

How about the TIA Painter's demos? The asymmetrical one would be easy to alter into block letters for a message. To save romspace, you can use an imbedded loop when drawing the playfield (so that each line of data is repeated ~n times). Here's an example that does that (replace the lines in the asymmetrical source code):

;////////////// Start To Draw Playfield ///////////////////////////////		  

	   LDY #23			  ;2 @64 set 24 lines
Draw_Picture_Loop:
	   LDX #7			   ;2 @62 set 8 scanlines for each pixel
Block_Pixels_Loop:
	   LDA (pf0_vector),Y   ;5 @67 load PF0 before the scanline...
	   STA WSYNC			;3
	   STA PF0			  ;3 @3
	   LDA (pf1_vector),Y   ;5 @8
	   STA PF1			  ;3 @11
	   LDA (pf2_vector),Y   ;5 @16
	   STA PF2			  ;3 @19
	   LDA (pf0_vector),Y   ;5 @24 load PF0 before the scanline...
	   ASL				  ;2 @26  so there's time to reuse ROM
	   ASL				  ;2 @28
	   ASL				  ;2 @30
	   ASL				  ;2 @32
	   STA PF0			  ;3 @35
	   LDA (pf4_vector),Y   ;5 @40
	   STA PF1			  ;3 @43
	   LDA (pf5_vector),Y   ;5 @48
	   STA PF2			  ;3 @51
	   DEX				  ;2 @53
	   BPL Block_Pixels_Loop;2 @55
	   DEY				  ;2 @57
	   BPL Draw_Picture_Loop;2 @59

;////////////// End Of Display ////////////////////////////////////////

24 lines at 8 pixels high each = 192 scanlines...that would be sufficient for smallish messages...10 letters across (3 point + a blank space) by 4 rows (5-point) with a blank row after each. Fudge the numbers around a bit if you want more rows. You could also use a pixel-height variable and number-or-rows variable if you want that to be adjustable for stuff that needs more lines than others...just use those instead of the immediate values in the first couple lines. There's 6 cycles to spare before the WSYNC, so it's safe.

Before executing the kernel, set aside a group of 5 vectors (pf0_vector, etc) and store the LSB/MSB of your data tables to them. Indirect-Y addressing does the rest.

#3 Nukey Shay OFFLINE  

Nukey Shay

    Sheik Yerbouti

  • 20,458 posts
  • Location:The land of Gorch

Posted Tue Aug 11, 2009 5:39 AM

BTW PF0 only requires the upper nybble. The routine above saves space by reusing the same bytes to hold PF3 in the lower nybble. That saves 1/6 table space and eliminates the need for a 6th vector.

#4 yuppicide OFFLINE  

yuppicide

    I am the Black Knight. Give me your money!

  • 6,933 posts
  • Location:New Jersey

Posted Tue Aug 11, 2009 6:58 AM

I've been to his website before, but never seen that page.. only other parts.. some nice demos on there. I'm going to read over them when I get out of work thanks.

#5 Thomas Jentzsch OFFLINE  

Thomas Jentzsch

    Thrust, Jammed, SWOOPS!

  • 16,745 posts
  • Always left from right here!
  • Location:Düsseldorf, Germany

Posted Tue Aug 11, 2009 7:54 AM

:idea: Look for "How to draw a playfield"

#6 yuppicide OFFLINE  

yuppicide

    I am the Black Knight. Give me your money!

  • 6,933 posts
  • Location:New Jersey

Posted Wed Aug 12, 2009 10:25 PM

I'm going to fool around this weekend.

Basically I want a program to show randomly generated quotes. I won't say what exactly as I'd like to keep that under wraps until I actually make it.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users