I believe Disch is the one who told me of this, but I've created a routine in 6502 that will load this map successfully. How the compression works:
Mapdata:
.db $85,$24
This is only part of the .db segment by the way. Okay, the decompression will read the first byte, and it will read that bit 7 is set, and it will then take the 2nd digit of the first byte, and that will be the number of times the following tile number will be displayed. So with just that, 24 will be displayed 5 times. Understand? Okay. Here we have more tiles, but these next ones are uncompressed tiles:
Mapdata:
.db $85,$24,$03,$45,$24,$59
Notice that the third byte says 03. It is set up so that if bit 7 is 0, then take the second digit, which is 3, and display the next 3 as uncompressed tiles. Understand? okay. Here's the decompression code:
And amount is a variable that holds the amount of bytes are in the "mapdata" array/arrays. And in my quick demo, I just had it jsring to this routine until amount was 0. Tell me if you have any questions. Just thought I'd be somewhat helpful to people that were wondering about this.
Edit:
Also, another thing. This will be kind of confusing. You must set "amount" to equal as many different tile#'s there are minus two, not how many bytes there are.
Mapdata:
.db $85,$24
This is only part of the .db segment by the way. Okay, the decompression will read the first byte, and it will read that bit 7 is set, and it will then take the 2nd digit of the first byte, and that will be the number of times the following tile number will be displayed. So with just that, 24 will be displayed 5 times. Understand? Okay. Here we have more tiles, but these next ones are uncompressed tiles:
Mapdata:
.db $85,$24,$03,$45,$24,$59
Notice that the third byte says 03. It is set up so that if bit 7 is 0, then take the second digit, which is 3, and display the next 3 as uncompressed tiles. Understand? okay. Here's the decompression code:
Code:
namload:
dec amount
it:
lda mapdata,x
bmi putit
asl a
asl a
asl a
asl a
lsr a
lsr a
lsr a
lsr a
tay
inx
putmore:
lda mapdata,x
sta $2007
inx
dey
bne putmore
inx
lda #$00
sta $2005
sta $2005
rts
putit:
asl a
asl a
asl a
asl a
lsr a
lsr a
lsr a
lsr a
tay
inx
here:
lda mapdata,x
sta $2007
dey
bne here
inx
lda #$00
sta $2005
sta $2005
rts
dec amount
it:
lda mapdata,x
bmi putit
asl a
asl a
asl a
asl a
lsr a
lsr a
lsr a
lsr a
tay
inx
putmore:
lda mapdata,x
sta $2007
inx
dey
bne putmore
inx
lda #$00
sta $2005
sta $2005
rts
putit:
asl a
asl a
asl a
asl a
lsr a
lsr a
lsr a
lsr a
tay
inx
here:
lda mapdata,x
sta $2007
dey
bne here
inx
lda #$00
sta $2005
sta $2005
rts
And amount is a variable that holds the amount of bytes are in the "mapdata" array/arrays. And in my quick demo, I just had it jsring to this routine until amount was 0. Tell me if you have any questions. Just thought I'd be somewhat helpful to people that were wondering about this.
Edit:
Also, another thing. This will be kind of confusing. You must set "amount" to equal as many different tile#'s there are minus two, not how many bytes there are.