Picross game

Want to talks about games you like, would like to see developed on the Oric, it's here.
User avatar
Iapetus
Flying Officer
Posts: 135
Joined: Thu Mar 19, 2009 10:47 pm

Picross game

Post by Iapetus »

I want to code a game for the oric, and nothing better than a puzzle game to start with...

I am coding this game for the c64 and vic20, and I am planning to do it also on the commodore plus4 and ofcourse on the oric, and this is the version I want to start now to reach the level of the other two.

Here you can see a couple of screens from the other versions(the vic20 and other versions will be a picross game but not the same game as the c64 version, but the engine is the same of course)

Image

and the video http://www.youtube.com/watch?v=5tqbgIOKa10

Image

Now, yesterday I worked on some graphics for the oric version, I had some help from Twi about the attributes etc. Thank you.

My problem at the moment is the following, I have written a small program to show just one tile on screen but I am not managing to make it work, what I did was the following, as my assembler outputs a raw file but which first two bytes are the address where to load the code into memory I used an hex editor to remove those two bytes and then used the tool Header.exe to create a .tap file(header -a1 game.o game.tap $500), when I tried to load it with cload "game" euphoric would hang or wouldn't run the program as intended. I presume I must be doing something wrong here. Months ago when I created a small program it worked I must have done something differently I am not sure what.

Other thing, for this game I need a clock, on the c64/vic20 versions I use an irq interrupt with a counter for the effect. How can I do this on the oric? Can you guys give me some link to the subject of interrupts plz.

the code I am trying is the following (this is just a test not the code for the game, at first I coded some nasty routine with even self modifying code but as it was crashing I thought as this was a test to go for some simple code with no loops :P )

Code: Select all

		
.pc = $500
jsr $ec33

		sei

		

		lda #$03

		sta $a000

		sta $a000+40*2

		sta $a000+40*4

		sta $a000+40*6

		

		lda #$02

		sta $a000+40

		sta $a000+40*3

		sta $a000+40*5

		sta $a000+40*7

		

		

		ldy #$00

		lda tile0,y

		sta $a001+40

		iny

		lda tile0,y

		sta $a001+40*2

		iny

		lda tile0,y

		sta $a001+40*3

		iny

		lda tile0,y

		sta $a001+40*4

		iny

		lda tile0,y

		sta $a001+40*5

		iny

		lda tile0,y

		sta $a001+40*6

		jmp*



tile0:		.byte %11000000

		.byte %01000000

		.byte %01011110	

		.byte %00000100	

		.byte %01011010		

		.byte %00000100
Thank you
User avatar
Dbug
Site Admin
Posts: 4461
Joined: Fri Jan 06, 2006 10:00 pm
Location: Oslo, Norway
Contact:

Re: Picross game

Post by Dbug »

Algarbi wrote:My problem at the moment is the following, I have written a small program to show just one tile on screen but I am not managing to make it work, what I did was the following, as my assembler outputs a raw file but which first two bytes are the address where to load the code into memory I used an hex editor to remove those two bytes and then used the tool Header.exe to create a .tap file(header -a1 game.o game.tap $500), when I tried to load it with cload "game" euphoric would hang or wouldn't run the program as intended.
Strange, I don't see anything wrong in what you did.
Could you send me both game.o and game.tap so I can take a look at what the problem is ?
I assume you are using the Oric Atmos mode, not Oric 1, because the jsr $ec33 is a direct ROM call that matches the Atmos rom (will crash on Oric 1 or Telestrat).
User avatar
Iapetus
Flying Officer
Posts: 135
Joined: Thu Mar 19, 2009 10:47 pm

Re: Picross game

Post by Iapetus »

Dbug wrote:
Algarbi wrote:My problem at the moment is the following, I have written a small program to show just one tile on screen but I am not managing to make it work, what I did was the following, as my assembler outputs a raw file but which first two bytes are the address where to load the code into memory I used an hex editor to remove those two bytes and then used the tool Header.exe to create a .tap file(header -a1 game.o game.tap $500), when I tried to load it with cload "game" euphoric would hang or wouldn't run the program as intended.
Strange, I don't see anything wrong in what you did.
Could you send me both game.o and game.tap so I can take a look at what the problem is ?
I assume you are using the Oric Atmos mode, not Oric 1, because the jsr $ec33 is a direct ROM call that matches the Atmos rom (will crash on Oric 1 or Telestrat).
Thank you for your help dbug, I can compile and run the code now.

How can I go on Hires mode without using that direct rom call? I would like this to work in Oric one too.
User avatar
Dbug
Site Admin
Posts: 4461
Joined: Fri Jan 06, 2006 10:00 pm
Location: Oslo, Norway
Contact:

Post by Dbug »

The simplest way is to:
- poke the value 30 or 31 (Attribute for GRAPHICS 50HZ) in some visible part of the screen memory (I suggest the last byte of the screen, like $BFDF)
- wait 1/50th of second (about 20000 clock cycles), just to be sure that the ULA got the time to read this byte
- the next frame will be in HIRES.

You can go back to TEXT by poking 26 or 27 instead.

Of course by doing that this way, the screen is not cleared, and the character set are not "moved", so you may want to clear the HIRES area (from $A000 to $A000+40*200) with the value 64 (the neutral "paper" value), and set some character set data from $9800 to $9c00.
User avatar
Iapetus
Flying Officer
Posts: 135
Joined: Thu Mar 19, 2009 10:47 pm

Post by Iapetus »

Dbug wrote:The simplest way is to:
- poke the value 30 or 31 (Attribute for GRAPHICS 50HZ) in some visible part of the screen memory (I suggest the last byte of the screen, like $BFDF)
- wait 1/50th of second (about 20000 clock cycles), just to be sure that the ULA got the time to read this byte
- the next frame will be in HIRES.

You can go back to TEXT by poking 26 or 27 instead.

Of course by doing that this way, the screen is not cleared, and the character set are not "moved", so you may want to clear the HIRES area (from $A000 to $A000+40*200) with the value 64 (the neutral "paper" value), and set some character set data from $9800 to $9c00.
Thank you DBug, will this also get rid of the white text window at the bottom?
Last edited by Iapetus on Sat Oct 03, 2009 1:41 pm, edited 1 time in total.
User avatar
Dbug
Site Admin
Posts: 4461
Joined: Fri Jan 06, 2006 10:00 pm
Location: Oslo, Norway
Contact:

Post by Dbug »

It will not get rid of the text at the bottom.
Actually you should be happy to have that, invaluable to have these three lines of text to display debugging data for example :)
The easiest way to get rid of it, is just to paint it in black :)

This area is common to HIRES and TEXT memory layout, so it starts at $BB80+25*40.

What I suggest is that you put the value 16 (BLACK PAPER ATTRIBUTE) in all this area, just be careful with the last byte, because it is where you put the "GRAPHIC/TEXT" attribute change, if you overwrite it before the ULA got the time to read it, it will be ignored.

During the switch from TEXT to HIRES you will generally see artefacts on screen, specially when using the ROM call, because it is not very smart in the way it does things.

Never noticed that the screen displayed a lot of @@@@@@@@@@@@@@ characters all over the screen during the transition ? It's because the ROM erases the HIRES screen with the value 64 while the video still actually displays the TEXT content.

The way I am doing it in my demos, is:
- Fill the whole memory area from $A000 to $BFDF with black paper attributes (16), because it will be displayed as a black block of pixels whatever the video mode.
- Poke 30 in $BFDF
- Wait 20000 cycles

By doing it this way, you have no glitches, only perfect pictch black :)
User avatar
Iapetus
Flying Officer
Posts: 135
Joined: Thu Mar 19, 2009 10:47 pm

Post by Iapetus »

Dbug wrote:It will not get rid of the text at the bottom.
Actually you should be happy to have that, invaluable to have these three lines of text to display debugging data for example :)
The easiest way to get rid of it, is just to paint it in black :)

This area is common to HIRES and TEXT memory layout, so it starts at $BB80+25*40.

What I suggest is that you put the value 16 (BLACK PAPER ATTRIBUTE) in all this area, just be careful with the last byte, because it is where you put the "GRAPHIC/TEXT" attribute change, if you overwrite it before the ULA got the time to read it, it will be ignored.

During the switch from TEXT to HIRES you will generally see artefacts on screen, specially when using the ROM call, because it is not very smart in the way it does things.

Never noticed that the screen displayed a lot of @@@@@@@@@@@@@@ characters all over the screen during the transition ? It's because the ROM erases the HIRES screen with the value 64 while the video still actually displays the TEXT content.

The way I am doing it in my demos, is:
- Fill the whole memory area from $A000 to $BFDF with black paper attributes (16), because it will be displayed as a black block of pixels whatever the video mode.
- Poke 30 in $BFDF
- Wait 20000 cycles

By doing it this way, you have no glitches, only perfect pictch black :)
Thank you for the help.

I need to read more on the oric... :oops: I have downloaded these books: "Atmos vos programmes", "Getting more from your Oric" and "Oric Atmos and Oric1 - Graphics and Machine Code Techniques". I think that I can learn to read the keyboard etc from these (I hope) and other stuff needed to code a game.
User avatar
ibisum
Wing Commander
Posts: 1652
Joined: Fri Apr 03, 2009 8:56 am
Location: Vienna, Austria
Contact:

Post by ibisum »

Hey, from where did you download those books? Look very interesting to me .
User avatar
Dbug
Site Admin
Posts: 4461
Joined: Fri Jan 06, 2006 10:00 pm
Location: Oslo, Norway
Contact:

Post by Dbug »

There are number of books available for download on Defence Force in the Oric Library:
http://www.defence-force.org/computing/ ... /index.htm

- Oric 1 user manual
- Oric Atmos manual
- Hyperbasic manual
- Sedoric manual
- Microdisc manual
- Cumana manual
- MCP40 operational manual
- Oric Atmos and Oric 1 Graphics and Machine code techniques
- Oric Atmos, votre micro ordinateur
- Getting more from your oric
- Oric Atmos, vos programmes
- Des extensions à construire pour votre Oric Atmos

Some are in French, some in English.
Have fun :)
User avatar
Iapetus
Flying Officer
Posts: 135
Joined: Thu Mar 19, 2009 10:47 pm

Post by Iapetus »

Great library, thank you for all the work in setting it up :)
User avatar
Iapetus
Flying Officer
Posts: 135
Joined: Thu Mar 19, 2009 10:47 pm

Post by Iapetus »

I did some work on this today, especially routines to paint the tiles and attributes. Tomorrow I am hoping to implement the guide lines with the numbers on the side and under the board.

This doesn't look much but it is how it looks now :lol:

Image
User avatar
Dbug
Site Admin
Posts: 4461
Joined: Fri Jan 06, 2006 10:00 pm
Location: Oslo, Norway
Contact:

Post by Dbug »

Well, I see that you started playing with interlaced ink changes plus inverse video, you are on the path to enlightment !
User avatar
Iapetus
Flying Officer
Posts: 135
Joined: Thu Mar 19, 2009 10:47 pm

Post by Iapetus »

Added the code to calculate and print the horizontal guidelines

Now looking at the pic I realize that I will not be able to do the same for the vertical guidelines(the paper colours) :( , I think I will have to have the numbers there with no paper and use the inverse when the player is over that line but the problem is, that there will be a lot of bytes to set and reset the inverse bit.... hmmm

pic:

Image
User avatar
Chema
Game master
Posts: 3020
Joined: Tue Jan 17, 2006 10:55 am
Location: Gijón, SPAIN
Contact:

Post by Chema »

Dbug wrote:Well, I see that you started playing with interlaced ink changes plus inverse video, you are on the path to enlightment !
Indeed. I always wanted to play with those and never managed to get anything decent. It is impressive to see what you guys can do with the Oric attributes.

Keep on the good work!
User avatar
Twilighte
Game master
Posts: 819
Joined: Sat Jan 07, 2006 12:07 am
Location: Luton, UK
Contact:

Post by Twilighte »

Dbug wrote:Well, I see that you started playing with interlaced ink changes plus inverse video, you are on the path to enlightment !
hehe, and many pot holes await you on your quest for glory.
Post Reply