updated sid tune

new sid tune is bigger than 4k, so charset had to be moved
now (part of) first half of the charset actually is used by the sid
and ignored by the VIC; chars had to be redefined
This commit is contained in:
giomba 2021-04-12 23:28:34 +02:00
parent a82c9e94fe
commit c8199e7144
8 changed files with 38 additions and 1316 deletions

View File

@ -68,9 +68,10 @@ Address | PRG | Description
#### Custom charset
Index | Description
----------------|-------------
```$00 - $1F``` | A-Z (space first)
```$20 - $3F``` | A-Z, reversed (space first)
```$40 - $4F``` | hex digits
```$50 - $5F``` | hex digits, reversed
```$60 - ``` | game tiles
```$00 - $7F``` | unused (space for SID)
```$80 - $9F``` | A-Z (space first)
```$A0 - $BF``` | A-Z, reversed (space first)
```$C0 - $CF``` | hex digits
```$D0 - $DF``` | hex digits, reversed
```$E0 - ``` | game tiles

File diff suppressed because it is too large Load Diff

View File

@ -38,10 +38,10 @@ SCREEN_H = 24
; Tiles
; -----
EMPTY_TILE = $60
SNAKE_TILE = $61
FOOD_TILE = $62
WALL_TILE = $63
EMPTY_TILE = $e0
SNAKE_TILE = $e1
FOOD_TILE = $e2
WALL_TILE = $e3
; Tiles colors
; Note: these colors will be picked by the level select routine

View File

@ -60,7 +60,7 @@ statusLevelLoad SUBROUTINE
; Upper bar -- fill with spaces, color yellow
ldx #39
.loop:
lda #$0
lda #$80
sta $400,x
lda #7
sta $d800,x
@ -139,9 +139,9 @@ writeLevelElement:
lda levelT
sta (levelVideoPointer),y
; tiles colors can be found in an array
; position in array = tile value - $60
; position in array = tile value - $e0
sec
sbc #$60
sbc #$e0
tax
lda tilesColors,x
sta (levelColorPointer),y

View File

@ -25,15 +25,16 @@
SEG sidSegment
org $1000
sidtune:
INCBIN "../res.bin/amour.sid"
INCBIN "../res.bin/amour2.sid"
#if VERBOSE = 1
ECHO "End of SIDtune at ",.,"Space left:",($2000 - .)
ECHO "top $2000: End of SIDtune at ",.,"Space left:",($2000 - .)
ECHO "top $2400: End of SIDtune at ",.,"Space left:",($2400 - .)
#endif
; Font Data
; ----------------------------------------------------------------------
SEG fontSegment
org $2000
org $2400
; This binary data that defines the font is exactly 2kB long ($800)
INCLUDE "font.asm"

View File

@ -166,10 +166,10 @@ checkEndStatus:
; Play music
jsr sidtune + 3
jsr sidtune + 3
jsr sidtune + 3
jsr sidtune + 3
jsr sidtune + 3
; jsr sidtune + 3
; jsr sidtune + 3
; jsr sidtune + 3
; jsr sidtune + 3
; Increase random value
inc random

View File

@ -9,7 +9,7 @@ LASTINIT SET .
clearScreen SUBROUTINE
ldx #$ff
.loop:
lda #$00
lda #$80
sta $400,x
sta $500,x
sta $600,x
@ -81,12 +81,12 @@ printByte SUBROUTINE
lsr
lsr
lsr
ora #$40 ; add 64 (see font)
ora #$c0 ; add 192 (see font)
sta $400,y ; print msb char
txa ; Take least significant nibble (use previous copy)
and #$0f
ora #$40 ; add 64 (see font)
ora #$c0 ; add 192 (see font)
sta $401,y ; print lsb char
rts
@ -104,22 +104,22 @@ printString SUBROUTINE
beq .end ; if zero, then end (string must be null-terminated)
cmp #$20 ; is space?
bne .checkP1
lda #$0
lda #$80
jmp .print
.checkP1:
cmp #$28 ; is char '(' ?
bne .checkP2
lda #$1b
lda #$9b
jmp .print
.checkP2:
cmp #$29 ; is char ')' ?
bne .checkP3
lda #$1c
lda #$9c
jmp .print
.checkP3
cmp #$2e ; is char '.' ?
bne .checkNumber
lda #$1d
lda #$9d
jmp .print
.checkNumber: ; is char a number?
cmp #$2f
@ -129,14 +129,14 @@ printString SUBROUTINE
sec
sbc #$30
clc
adc #$40
adc #$c0
jmp .print
.nextCheck:
.isLetter:
; defaults to an uppercase letter of ASCII set
sec
sbc #$40
clc
adc #$40
.print:
sta (dstScreenPointer),y ; put screen code to screen
iny ; next char in string

View File

@ -7,11 +7,11 @@ void flush(char last, int count) {
char tile, color;
switch(last) {
case 'x':
tile = (char)0x63; break;
tile = (char)0xe3; break;
case 'f':
tile = (char)0x62; break;
tile = (char)0xe2; break;
default:
tile = (char)0x60; break;
tile = (char)0xe0; break;
}
cout << tile << (char)count;
}