Code: Select all
ground:
.db $ef, $f0;first row
.db $f0, $ef;second row
.db $00 ;pallete
sky:
.db $f1,$f1
.db $f1,$f1
.db $02
rock:
.db $f1,$f1
.db $f1,$f2
.db $02
Moderator: Moderators
Code: Select all
ground:
.db $ef, $f0;first row
.db $f0, $ef;second row
.db $00 ;pallete
sky:
.db $f1,$f1
.db $f1,$f1
.db $02
rock:
.db $f1,$f1
.db $f1,$f2
.db $02
Code: Select all
TopLeft:
.db $ef, $f1, $f1
TopRight:
.db $f0, $f1, $f1
BottomLeft:
.db $f0, $f1, $f1
BottomRight:
.db $ef, $f1, $f2
Palettes:
.db $00, $02, $02
Code: Select all
TopLeft:
.db M0T0, M1T0, M2T0, M3T0, ...
TopRight:
.db M0T1, M1T1, M2T1, M3T1, ...
BottomLeft:
.db M0T2, M1T2, M2T2, M3T2, ...
BottomRight:
.db M0T3, M1T3, M2T3, M3T3, ...
Palettes:
.db PAL0, PAL1, PAL2, PAL3, ...
Code: Select all
rock = 3
M3T0 = $f1
M3T1 = $f1
M3T2 = $f1
M3T3 = $f2
PAL3 = $02
Code: Select all
CreateMetatileSet 42 ;reserves space for 42 metatiles
RegisterMetatile $f1, $f1, $f1, f2, $02, rock ;assigns values to placeholders, copies index to "rock" and increments index
RegisterMetatile $ef, $f0, $f0, $ef, $00, ground
;(...)
Code: Select all
MAXOBJECTS = 16
ObjectType: .res MAXOBJECTS
ObjectXLow: .res MAXOBJECTS
ObjectXHigh: .res MAXOBJECTS
;(...)
In all honesty from personal experience, lines of code don't take up nearly as much space on the cartridge as you think they do. When I ported my Aquarium Simulator from NROM to MMC1, I found that the entire source code I had so far (including the uncompressed tilemaps) which was over 1000 lines of code, fit into $E000-$FFFF with room to spare! It's the data blocks that are the real hogs of cartridge ROM.Kitty_Space_Program wrote: ↑Tue Dec 08, 2020 3:49 pmIt went really well, especially considering there wasn't any tutorial lol. It took about 200 lines of assembly code for both nametables, I assume that's a lot, but it works. *knocks on wood*
Code: Select all
attribute_data:
.byte $FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF
.byte $FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF
.byte $FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF
.byte $FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF
.byte $FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF
.byte $FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF
.byte $FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF
.byte $FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF
Code: Select all
attribute_title_rle ;Format: Number of consecutive tiles, tile ID.
.db $40,$FF
attribute_title_rle_size:
.db $02 ;Format: How many entries are in the above table.
Hmmm… size could be redundant if your secondary loop is only used for size #$40 attribute-bytes.puppydrum64 wrote: ↑Mon May 31, 2021 10:39 am I'm not sure if the size is a redundant property, I used it as a secondary loop counter so the routine knows when to end.
Code: Select all
ldx #16;starting at 16 when below reads from screenArray-16 makes the first value read from screenArray+0; it’s easier to run 240 times
- lda screenArray-16, x
sta $2007
inx;11-80
bpl -; :)
Hmmm… while getting coffee, my trick seems to work for #$40 too.
Code: Select all
ldx #$40
- lda attributes-64, x
sta somewhere interesting
inx;41-80
bpl - ;loop will now end when inx sets 7th bit of X register