Page 3 of 6

Re: Pac-It for Pokemon Mini

Posted: May 21st, 2018, 17:29
by YasaSheep
Your code doesn't make a lot of sense. Tilemap indexes top out at 255 and I don't see why you would store it in a pointer.

Say 0 is at 48 ($30) which is where it is in ASCII.

Code: Select all

mov x1, TILEMAP
mov a, 48
mov [x1], a
This will place a 0 in the upper left corner.

To place it in a certain position, use TILEMAP + offset

Re: Pac-It for Pokemon Mini

Posted: May 21st, 2018, 18:06
by VirtualChris
Thank you! This works a lot better.
In my game, the score is a timer: minutes and seconds. I'm going to have a timer variable. When I'm coding in other platforms, I'd need the timer to count to about 60 to add a second. Would this be the same, and if not, how many ticks does the timer need to do for one second?

Re: Pac-It for Pokemon Mini

Posted: May 22nd, 2018, 03:34
by VirtualChris
Why won't this work?

Code: Select all

Timerr:
		mov		a, [why]
		inc		a
		mov		[why], a
		cmp		a, 60
		jz		ihatethis
	
		ret
		
ihatethis:


	mov x1, TILEMAP+47
	mov a, 98
	mov [x1], a

	ret

Re: Pac-It for Pokemon Mini

Posted: May 22nd, 2018, 13:17
by zoranc
VirtualChris wrote:Why won't this work?
It should. Were is the "why" variable? Is it in the RAM, that is free to use? What happens?

Re: Pac-It for Pokemon Mini

Posted: May 22nd, 2018, 17:38
by VirtualChris
The seconds timer should move up to 1 instead of 0. Instead it ignores the line that tells it to and it stays at 0. I cleaned up the code for the game. I renamed "why" to "ticker" and the place the code is in is now called "game_timer". I thought it should work too, but it won't.
http://www.atari2600land.com/pokemonmini/marill9.zip

Re: Pac-It for Pokemon Mini

Posted: May 22nd, 2018, 17:57
by YasaSheep
I mean you're moving a static tile index into the position, 98, is that the right index? Also, obviously, it wouldn't go above 1, even if 98 was 1, but I assume you know that and this is just test code.

Re: Pac-It for Pokemon Mini

Posted: May 22nd, 2018, 18:21
by VirtualChris
Yes, I know it won't go above 1. The problem is it won't even get to 1. 98 is the right index because 97 is 0. All the numbers are located off screen.

Re: Pac-It for Pokemon Mini

Posted: May 22nd, 2018, 22:32
by VirtualChris
I fixed it!
What happened is I put this in the beginning:

Code: Select all

.orgfill 0x1000   # first part of RAM is VRAM
.orgfill 0x1800
And it works now.
Image

Re: Pac-It for Pokemon Mini

Posted: May 23rd, 2018, 19:32
by VirtualChris
Got a fish in the game.
Image

I have a question. I'd like to make the fish's start movement and whether he starts on the left or right random. Does the Pokemon Mini have a built-in RNG of some sort or do I have to rely on button pressing timing?

Re: Pac-It for Pokemon Mini

Posted: May 24th, 2018, 01:42
by zoranc
I've used button pressing a while ago. Didn't find any better RNG...

I used to run an increment of a variable until a button is pressed. For action game more appropriate would be to have a timer running and on each button press add it to the random seed.