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 #### Custom charset
Index | Description Index | Description
----------------|------------- ----------------|-------------
```$00 - $1F``` | A-Z (space first) ```$00 - $7F``` | unused (space for SID)
```$20 - $3F``` | A-Z, reversed (space first) ```$80 - $9F``` | A-Z (space first)
```$40 - $4F``` | hex digits ```$A0 - $BF``` | A-Z, reversed (space first)
```$50 - $5F``` | hex digits, reversed ```$C0 - $CF``` | hex digits
```$60 - ``` | game tiles ```$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 ; Tiles
; ----- ; -----
EMPTY_TILE = $60 EMPTY_TILE = $e0
SNAKE_TILE = $61 SNAKE_TILE = $e1
FOOD_TILE = $62 FOOD_TILE = $e2
WALL_TILE = $63 WALL_TILE = $e3
; Tiles colors ; Tiles colors
; Note: these colors will be picked by the level select routine ; Note: these colors will be picked by the level select routine
@ -101,4 +101,4 @@ levelsList:
#if VERBOSE = 1 #if VERBOSE = 1
ECHO "initdata.asm @ ",LASTINIT,"len:",(. - LASTINIT) ECHO "initdata.asm @ ",LASTINIT,"len:",(. - LASTINIT)
#endif #endif

View File

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

View File

@ -25,15 +25,16 @@
SEG sidSegment SEG sidSegment
org $1000 org $1000
sidtune: sidtune:
INCBIN "../res.bin/amour.sid" INCBIN "../res.bin/amour2.sid"
#if VERBOSE = 1 #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 #endif
; Font Data ; Font Data
; ---------------------------------------------------------------------- ; ----------------------------------------------------------------------
SEG fontSegment SEG fontSegment
org $2000 org $2400
; This binary data that defines the font is exactly 2kB long ($800) ; This binary data that defines the font is exactly 2kB long ($800)
INCLUDE "font.asm" INCLUDE "font.asm"

View File

@ -166,10 +166,10 @@ checkEndStatus:
; Play music ; 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 ; jsr sidtune + 3
; Increase random value ; Increase random value
inc random inc random
@ -192,4 +192,4 @@ checkEndStatus:
#if VERBOSE = 1 #if VERBOSE = 1
ECHO "program.asm @ ",LASTINIT,"len:",(. - LASTINIT) ECHO "program.asm @ ",LASTINIT,"len:",(. - LASTINIT)
#endif #endif

View File

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

View File

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