Skip to content

Commit

Permalink
Version 1.0.2 that supports Kit(B)
Browse files Browse the repository at this point in the history
- Supports SSD1309 based displays a part of KITB
- Builds firmware separately for the original Kit vs the new Kit
  • Loading branch information
peternoyes committed Jun 5, 2019
1 parent 617000c commit 9413168
Show file tree
Hide file tree
Showing 5 changed files with 48 additions and 13 deletions.
16 changes: 10 additions & 6 deletions src/Makefile
Original file line number Diff line number Diff line change
@@ -1,21 +1,25 @@
ASM_SOURCES = entry.s65 zeropage.s65 display.s65 util.s65 io.s65 api.s65 text.s65

all: flash_code firmware
all: flash_code firmware_kita firmware_kitb

FLASH_DIR = flash
.PHONY: flash_code
flash_code:
$(MAKE) -C $(FLASH_DIR)

# Compilation of assembler files
%.o: %.s65
ca65 --cpu 6502 -o $@ -l $(@:.o=.lst) $<
%_kita.o: %.s65
ca65 --cpu 6502 -D KITA -o $@ -l $(@:.o=.lst) $<

all: firmware
%_kitb.o: %.s65
ca65 --cpu 6502 -D KITB -o $@ -l $(@:.o=.lst) $<

firmware: $(ASM_SOURCES:.s65=.o)
firmware_kita: $(ASM_SOURCES:.s65=_kita.o)
cl65 -C firmware.cfg -m firmware.map -o $@ $^

firmware_kitb: $(ASM_SOURCES:.s65=_kitb.o)
cl65 -C firmware.cfg -m firmware.map -o $@ $^

clean:
rm -f firmware *.s *.o *.lst *.map
rm -f firmware_* *.s *.o *.lst *.map
$(MAKE) -C $(FLASH_DIR) clean
2 changes: 1 addition & 1 deletion src/api.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
// Specify version compiled against. Semantic versioning enforcement takes place in CHECK_VERSION
#define MAJOR 1
#define MINOR 0
#define REVISION 1
#define REVISION 2

#define SPI_WREN 0x06
#define SPI_WRDI 0x04
Expand Down
2 changes: 1 addition & 1 deletion src/api.s65
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

MAJOR = $1
MINOR = $0
REVISION = $1
REVISION = $2

.setcpu "6502"

Expand Down
23 changes: 21 additions & 2 deletions src/display.s65
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,15 @@
.code
ssd1305_init:
dc SSD1305_DISPLAYOFF ; $AE
dco SSD1305_SETLOWCOLUMN, $4 ; low col = 0 (This doesn't seem right)
dco SSD1305_SETHIGHCOLUMN, $4 ; hi col = 0
.if .defined(KITA)
dco SSD1305_SETLOWCOLUMN, $4 ; low col = 4
dco SSD1305_SETHIGHCOLUMN, $4 ; hi col = 4
.elseif .defined(KITB)
dco SSD1305_SETLOWCOLUMN, $0 ; low col = 0
dco SSD1305_SETHIGHCOLUMN, $0 ; hi col = 0
.else
.error "Must define KITA or KITB"
.endif
dco SSD1305_SETSTARTLINE, $0 ; line #0
dc $2E ; Stop scrolling
dc SSD1305_SETCONTRAST ; $81
Expand Down Expand Up @@ -1398,7 +1405,13 @@ display:
stx ptr2
adc ptr2
sta SSD1305_COMMAND ; Set Page
.if .defined(KITA)
dc $02
.elseif .defined(KITB)
dc $00
.else
.error "Must define KITA or KITB"
.endif
dc $10

; loop y < 128
Expand All @@ -1413,7 +1426,13 @@ display:
stx ptr2
adc ptr2
sta SSD1305_COMMAND ; Set Page
.if .defined(KITA)
dc $02
.elseif .defined(KITB)
dc $00
.else
.error "Must define KITA or KITB"
.endif
dc $10
; loop y < 256
@byte_loop2: lda (ptr1), y
Expand Down
18 changes: 15 additions & 3 deletions src/entry.s65
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,19 @@ flashing: .byte "Flashing...", $0
loading: .byte "Loading...", $0
game: .byte "Game", $0
system: .byte "System", $0
info_1: .byte "Version: 1.0.1", $0
info_1: .byte "Version: 1.0.2", $0
.if .defined(KITA)
info_2: .byte "Product: Kit", $0
version: .byte "1.0.1", $0
product: .byte "kit", $0
.elseif .defined(KITB)
info_2: .byte "Product: Kit(B)", $0
.else
.error "Must define KITA or KITB"
.endif
version: .byte "1.0.2", $0
.if .defined(KITA)
product: .byte "kit", $0
.elseif .defined(KITB)
product: .byte "kitb", $0
.else
.error "Must define KITA or KITB"
.endif

0 comments on commit 9413168

Please sign in to comment.