final restyling of the custom charset

This commit is contained in:
giomba 2020-04-06 22:00:15 +02:00
parent fcdea3cc08
commit 90cc0dbabd
4 changed files with 102 additions and 108 deletions

View File

@ -6,7 +6,7 @@ RES=res.bin/amour.sid res.bin/levels.bin
.PHONY: debug env clean .PHONY: debug env clean
bin/snake.prg: env $(ASM) $(RES) bin/snake.prg: env $(ASM) $(RES)
dasm src/main.asm -Isrc/ -DSYSTEM=64 -DDEBUG=0 -obin/snake.prg dasm src/main.asm -Isrc/ -DSYSTEM=64 -DDEBUG=0 -sbuild/symbols.txt -obin/snake.prg
clean: clean:
rm -rf {build,bin,res.bin} rm -rf {build,bin,res.bin}

View File

@ -5,26 +5,6 @@ multicolor SUBROUTINE
; Prepare data struct for MultiColor mode ; Prepare data struct for MultiColor mode
; ---------------------------------------------------------------------- ; ----------------------------------------------------------------------
multicolorInit: multicolorInit:
; Make font higher half the inverse of lower one
; TODO: merge these edits with actual font binary
ldx #$00
.tggsCopy
dex
lda tggsFont,x
eor #$ff
sta $2400,x
lda tggsFont + $100,x
eor #$ff
sta $2500,x
lda tggsFont + $200,x
eor #$ff
sta $2600,x
lda tggsFont + $300,x
eor #$ff
sta $2700,x
cpx #$0
bne .tggsCopy
; Tell VIC-II to use: ; Tell VIC-II to use:
; - screen text memory at $400 = $400 * 1 ; - screen text memory at $400 = $400 * 1
; - characters ROM at $2000 = $400 * 8 ; - characters ROM at $2000 = $400 * 8

View File

@ -3,7 +3,7 @@
; Do some math to calculate tile address in video memory ; Do some math to calculate tile address in video memory
; using x,y coordinates ; using x,y coordinates
; Formula: addr = $400 + y * SCREEN_W + x ; Formula: addr = $400 + y * SCREEN_W + x
calcTileMem: calcTileMem SUBROUTINE
; Save registers ; Save registers
pha pha
txa txa
@ -50,7 +50,7 @@ calcTileEnd: ; now multiplication is ended, so add X
; Print a byte in hexadecimal ; Print a byte in hexadecimal
; A input register for byte to print ; A input register for byte to print
; Y input register for printing colum (on first line) ; Y input register for printing colum (on first line)
printByte: printByte SUBROUTINE
; Copy parameter also in X ; Copy parameter also in X
tax tax
@ -70,7 +70,7 @@ printByte:
; Print null-terminated string on status bar ; Print null-terminated string on status bar
; address of string is given in input using memory location printStatusString ; address of string is given in input using memory location printStatusString
printStatus: printStatus SUBROUTINE
ldy #0 ldy #0
printStatusLoop: printStatusLoop:
lda (printStatusString),y lda (printStatusString),y
@ -87,37 +87,55 @@ printStatusSkipSpace:
printStatusEnd: printStatusEnd:
rts rts
printIntro SUBROUTINE
; Print string for intro ; Print string for intro
; Input parameters: ; Input parameters:
; printIntroString pointer to string to be printed (source) ; printIntroString pointer to string to be printed (source)
; introScreenStart pointer to text video memory on screen where to print (dest) ; introScreenStart pointer to text video memory on screen where to print (dest)
printIntro:
ldy #0 ldy #0
printIntroLoop: .loop:
lda (printIntroString),y ; get char from string lda (printIntroString),y ; get char from string
beq printIntroEnd ; 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 printIntroCheckPunct bne .checkP1
lda #$0 lda #$0
jmp printIntroEndCheck jmp .print
printIntroCheckPunct: .checkP1:
cmp #$40 ; is char greater or equal to #$40 = #64 = `@' ? cmp #$28 ; is char '(' ?
bcc printIntroEndCheck ; if not, it is less, thus it must be bne .checkP2
; a full stop, comma, colon or something lda #$1b
; that actually has the same value in both jmp .print
; true ASCII and in PET screen codes .checkP2:
; otherwise, it is greater than `@`, so must cmp #$29 ; is char ')' ?
; subtract 64 because CBM and its encodings bne .checkP3
; are simply a big shit lda #$1c
; TODO -- actually must be fixed with new charset jmp .print
.checkP3
cmp #$2e ; is char '.' ?
bne .checkNumber
lda #$1d
jmp .print
.checkNumber: ; is char a number?
cmp #$2f
bcc .nextCheck
cmp #$3a
bcs .nextCheck
sec
sbc #$30
clc
adc #$40
jmp .print
.nextCheck:
.isLetter:
; defaults to an uppercase letter of ASCII set
sec sec
sbc #$40 sbc #$40
.print:
printIntroEndCheck:
sta (introScreenStart),y ; put screen code to screen sta (introScreenStart),y ; put screen code to screen
iny ; next char in string iny ; next char in string
jmp printIntroLoop jmp .loop
printIntroEnd: .end:
rts rts
; Increment a pointer in the zeropage ; Increment a pointer in the zeropage

View File

@ -269,57 +269,54 @@
BYTE #%00000000 BYTE #%00000000
; char 0x1b, 27 ; char 0x1b, 27
BYTE #%00111100 BYTE #%00011100
BYTE #%01000010 BYTE #%00110000
BYTE #%10011001 BYTE #%00100000
BYTE #%10100001 BYTE #%01100000
BYTE #%10100001 BYTE #%00100000
BYTE #%10011001 BYTE #%00110000
BYTE #%01000010 BYTE #%00011100
BYTE #%00111100 BYTE #%00000000
; char 0x1c, 28 ; char 0x1c, 28
BYTE #%00000101 BYTE #%00111000
BYTE #%00101001 BYTE #%00001100
BYTE #%00101011 BYTE #%00000100
BYTE #%10101111 BYTE #%00000110
BYTE #%01111111 BYTE #%00000100
BYTE #%01011010 BYTE #%00001100
BYTE #%01101010 BYTE #%00111000
BYTE #%10111010 BYTE #%00000000
; char 0x1d, 29 ; char 0x1d, 29
BYTE #%00000101 BYTE #%00000000
BYTE #%01011010 BYTE #%00000000
BYTE #%10101010 BYTE #%00000000
BYTE #%10101111 BYTE #%00000000
BYTE #%11101101 BYTE #%00000000
BYTE #%11110101 BYTE #%00111000
BYTE #%10110110 BYTE #%00111000
BYTE #%10111010 BYTE #%00000000
; char 0x1e, 30 ; char 0x1e, 30
BYTE #%00000000 BYTE #%11111111
BYTE #%11010000 BYTE #%10000001
BYTE #%01011000 BYTE #%10000001
BYTE #%11101011 BYTE #%10000001
BYTE #%11111110 BYTE #%10000001
BYTE #%10101111 BYTE #%10000001
BYTE #%10101011 BYTE #%10000001
BYTE #%10111111 BYTE #%11111111
; char 0x1f, 31 ; char 0x1f, 31
BYTE #%11111110 BYTE #%11111111
BYTE #%01101111 BYTE #%10000001
BYTE #%01101011 BYTE #%10000001
BYTE #%01011010 BYTE #%10000001
BYTE #%11101111 BYTE #%10000001
BYTE #%00101010 BYTE #%10000001
BYTE #%00011010 BYTE #%10000001
BYTE #%00000101 BYTE #%11111111
; char 0x20, 32 ; char 0x20, 32
BYTE #%11111111 BYTE #%11111111
@ -592,33 +589,34 @@
BYTE #%11111111 BYTE #%11111111
; char 0x3b, 59 ; char 0x3b, 59
BYTE #%11111111 ; char 0x1b, 27
BYTE #%10000001 BYTE #%11100011
BYTE #%10000001 BYTE #%11001111
BYTE #%10000001 BYTE #%11011111
BYTE #%10000001 BYTE #%10011111
BYTE #%10000001 BYTE #%11011111
BYTE #%10000001 BYTE #%11001111
BYTE #%11100011
BYTE #%11111111 BYTE #%11111111
; char 0x3c, 60 ; char 0x3c, 60
BYTE #%11111111 BYTE #%11000111
BYTE #%10000001 BYTE #%11110011
BYTE #%10000001 BYTE #%11111011
BYTE #%10000001 BYTE #%11111001
BYTE #%10000001 BYTE #%11111011
BYTE #%10000001 BYTE #%11110011
BYTE #%10000001 BYTE #%11000111
BYTE #%11111111 BYTE #%11111111
; char 0x3d, 61 ; char 0x3d, 61
BYTE #%11111111 BYTE #%11111111
BYTE #%10000001 BYTE #%11111111
BYTE #%10000001 BYTE #%11111111
BYTE #%10000001 BYTE #%11111111
BYTE #%10000001 BYTE #%11111111
BYTE #%10000001 BYTE #%11000111
BYTE #%10000001 BYTE #%11000111
BYTE #%11111111 BYTE #%11111111
; char 0x3e, 62 ; char 0x3e, 62
@ -641,8 +639,6 @@
BYTE #%10000001 BYTE #%10000001
BYTE #%11111111 BYTE #%11111111
; char 0x40, 64 ; char 0x40, 64
BYTE #%00111000 BYTE #%00111000
BYTE #%01101100 BYTE #%01101100