Log inRegister an accountBrowse CSDbHelp & documentationFacts & StatisticsThe forumsAvailable RSS-feeds on CSDbSupport CSDb Commodore 64 Scene Database
You are not logged in - nap
CSDb User Forums


Forums > C64 Coding > Putting 4x4 blocks to a mapdatas
2004-08-16 14:03
Richard

Registered: Dec 2001
Posts: 621
Putting 4x4 blocks to a mapdatas

I have been working with my Real Speed We Need game project. The old version of the game project reads a map, which was designed using some map editor which only uses 256 chars wide, and not blocks/tiles - something I can do.

I have been using Charpad 1.0 to draw the new game graphics and I wish to display maps by using the 4x4 blocks/tiles. I have drawn a test map using the charpad tool and I wish to use these 4x4 blocks and colour datas to paste into my map and scroll the map across the screen.

Please can you help me or show me an example routine on how to read the 4x4 blocks/tiles and then paste these to areas where the map should display on screen properly?

I can only code in C64ASM/Turbo Assembler, as I am very unfamiliar with other assemblers.

Thanks.
2004-08-16 15:23
Sorex
Account closed

Registered: Nov 2003
Posts: 43
since we don't know the structure of that data file charpad is spitting out we can't be much of a help with a real example on those files.

upload it somewhere including that tool so that we know how it's supposed to look
2004-08-16 16:58
Richard

Registered: Dec 2001
Posts: 621
Example pics are on my web site:

http://www.redesign.sk/tnd64/real_speed_we_need.html

Please look at the last picture. This is an example of me designing a map using the Charpad.

Most game maps other people use are split into blocks (after desiging the chars). Each selected block is then pasted on to a map. I'm intending to use 256 blocks wide for the whole game (not chars), but I don't know what source code would display the map, using 4x4 blocks, put together. Lasse's routines are to advanced for me to understand. I need something more simple to understand. I been searching through Project 64, and cannot find anything about this either.

Please can anyone help?
2004-08-16 17:25
Oswald

Registered: Apr 2002
Posts: 5094
been reading this ?

http://www.student.oulu.fi/~loorni/covert/rants.htm

anyway displaying the blocks is pretty simple.

You should have a game map, with the block indexes.

16 table (4x4) showing what chars are the blocks build of.

so for example the code could look like for pasting a block to the topleft of the screen:

ldx blockindex
lda table1,x
sta 0400
lda table2,x
sta 0401
lda table3,x
sta 0402
lda table4,x
sta 0403 ;end of first row

lda table5,x
sta 0428,x
...
lda table8,x
sta 042b ;end of 2nd row


lda table9,x
sta 0450,x
...
lda table12,x
sta 0453 ;end of 3nd row


.... and so on

hope this helps.
2004-08-17 09:41
Richard

Registered: Dec 2001
Posts: 621
@Oswald

So if I used chars $01,$02,$03,$04,$05,$06,$07,$08,$09,$0a,$0b,$0c,$0d,$0e,$0f,$10
in block 1 (below example)

A B C D
E F G H
I J K L
M N O P

Would I need to create a data table for that particular block:

i.e.

block_1 .byte $01,$02,$03,$04
.byte $05,$06,$07,$08
.byte $09,$0A,$0B,$0C
.byte $0D,$0E,$0F,$10 ?
2004-08-17 10:01
Majikeyric

Registered: Sep 2002
Posts: 83
Yes, all your blocks won't contain linear char values.
2004-08-17 10:09
Majikeyric

Registered: Sep 2002
Posts: 83
Quote: @Oswald

So if I used chars $01,$02,$03,$04,$05,$06,$07,$08,$09,$0a,$0b,$0c,$0d,$0e,$0f,$10
in block 1 (below example)

A B C D
E F G H
I J K L
M N O P

Would I need to create a data table for that particular block:

i.e.

block_1 .byte $01,$02,$03,$04
.byte $05,$06,$07,$08
.byte $09,$0A,$0B,$0C
.byte $0D,$0E,$0F,$10 ?


The datas of the table of your block must be splitted into 16 tables :

Table1:
$01 ; first char of block 1 ('A')
$xx ; first char of block 2
...
$xx ; first char of block 255

Table2:
$02 ; second char of block 1 ('B')
$xx ; second char of block 2
...
$xx ; second char of block 255

Table3:

And so on...
2004-08-17 10:10
JackAsser

Registered: Jun 2002
Posts: 2014
Exactly!

According to Oswald's example the tables would be like:

table1 .byte $01, ... (more macro blocks here)
table2 .byte $02, ... (more macro blocks here)
table3 .byte $03, ... (more macro blocks here)
table4 .byte $04, ... (more macro blocks here)
.
.
.
table15 .byte $10, ... (more macro blocks here)

Please try to understand the indexed addressing and try to figure out how it fetches the data, then the tables would become clear to you, especially how the X-register is used as macro block index.

/JackAsser

RefreshSubscribe to this thread:

You need to be logged in to post in the forum.

Search the forum:
Search   for   in  
All times are CET.
Search CSDb
Advanced
Users Online
cba
Andy/AEG
rambo/Therapy/ Resou..
AnonymousMOS
iceout/Avatar/HF
jicas/Patagonia
kenji/dream
JEZ
Mr. Lee
Meikel aka ZUX/Sparks
Bieno/Commodore Plus
Guests online: 103
Top Demos
1 Next Level  (9.7)
2 13:37  (9.7)
3 Mojo  (9.7)
4 Coma Light 13  (9.6)
5 The Demo Coder  (9.6)
6 Edge of Disgrace  (9.6)
7 What Is The Matrix 2  (9.6)
8 Uncensored  (9.6)
9 Comaland 100%  (9.6)
10 Wonderland XIV  (9.6)
Top onefile Demos
1 No Listen  (9.7)
2 Layers  (9.6)
3 Cubic Dream  (9.6)
4 Party Elk 2  (9.6)
5 Copper Booze  (9.6)
6 X-Mas Demo 2024  (9.5)
7 Dawnfall V1.1  (9.5)
8 Rainbow Connection  (9.5)
9 Onscreen 5k  (9.5)
10 Morph  (9.5)
Top Groups
1 Performers  (9.3)
2 Booze Design  (9.3)
3 Oxyron  (9.3)
4 Censor Design  (9.3)
5 Triad  (9.3)
Top Original Suppliers
1 Derbyshire Ram  (9.7)
2 Fungus  (9.3)
3 Black Beard  (9.2)
4 Baracuda  (9.2)
5 hedning  (9.1)

Home - Disclaimer
Copyright © No Name 2001-2024
Page generated in: 0.04 sec.