Skip to content

Commit

Permalink
Fix for MEGA65 (in C64 mode).
Browse files Browse the repository at this point in the history
Include disk images in dist file.
  • Loading branch information
dillof committed May 20, 2022
1 parent 20f7480 commit dac8bec
Show file tree
Hide file tree
Showing 8 changed files with 122 additions and 8 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,5 @@
Joyride-*.zip
src/sym
/src/.deps
/src/joyride.d64
/src/joyride.d81
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
SUBDIRS = src

VERSION = 1.5
VERSION = 1.5.1

FILES = README.md NEWS.md Joyride\ User\ Manual.pdf screenshot.png src/joyride.prg
FILES = README.md NEWS.md Joyride\ User\ Manual.pdf screenshot.png src/joyride.prg src/joyride.d64 src/joyride.d81

DISTFILE = Joyride-${VERSION}.zip

Expand Down
6 changes: 6 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
# Version 1.5.1 (2022-05-21)

- Fix for C64 mode on MEGA65.
-

# Version 1.5 (2020-12-16)

- Add support for PETCSII Robots adapter.
- Add raw view to SuperPad64, Ninja SNES Pad, and Inception.


# Version 1.4 (2020-12-12)

- Add support for Trap Them controller.
Expand Down
22 changes: 20 additions & 2 deletions src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ LD = cl65
LDFLAGS = -t c64 -u __EXEHDR__ -C c64-asm.cfg
# LDFLAGS += -Ln sym

DISK = joyride.d64
DISK_D81 = joyride.d81

DISKS = ${DISK} ${DISK_D81}

PROGRAM = joyride.prg

SOURCES = \
Expand Down Expand Up @@ -53,10 +58,10 @@ SOURCES = \

OBJECTS = ${SOURCES:.s=.o}

all: ${PROGRAM}
all: ${PROGRAM} ${DISKS}

clean:
rm -f ${OBJECTS} ${PROGRAM}
rm -f ${OBJECTS} ${PROGRAM} ${DISKS}


%.o : %.s ${DEPDIR}/%.d | ${DEPDIR}
Expand All @@ -69,6 +74,19 @@ ${DEPFILES}:

include $(wildcard ${DEPFILES})

${DISK}: ${PROGRAM}
disk=${DISK}.$$$$; \
(set -e; \
c1541 -silent -format "joyride,tp" d64 $$disk; \
c1541 $$disk -silent -write "joyride.prg" "joyride"; \
mv $$disk ${DISK})

${DISK_D81}: ${PROGRAM}
disk=${DISK_D81}.$$$$; \
(set -e; \
c1541 -silent -format "joyride,tp" d81 $$disk; \
c1541 $$disk -silent -write "joyride.prg" "joyride"; \
mv $$disk ${DISK_D81})

charset.bin: charset.png
gfx-convert -b 255 charset charset.png charset.bin
Expand Down
1 change: 0 additions & 1 deletion src/irq.s
Original file line number Diff line number Diff line change
Expand Up @@ -116,4 +116,3 @@ addr:
ldy #0
: sty index
rts

41 changes: 41 additions & 0 deletions src/mega65.inc
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
VIC_KEY = VIC + $2F
VIC_TOP_BORDER_POSITION = VIC + $48
VIC_BOTTOM_BORDER_POSITION = VIC + $4A
VIC_TEXT_X_POSITION = VIC + $4C
VIC_TEXT_Y_POSITION = VIC + $4E
VIC_X_POSITION = VIC + $50
VIC_FNRASTER = VIC + $52
VIC_SPRHGTEN = VIC + $55
VIC_SPRHGHT = VIC + $56
VIC_SPRX64EN = VIC + $57
VIC_LINE_STEP = VIC + $58
VIC_CHAR_X_SCALE = VIC + $5A
VIC_CHAR_Y_SCALE = VIC + $5B
VIC_SDBDRWD = VIC + $5C
VIC_CHAR_COUNT = VIC + $5E
VIC_SPRXSMSBS = VIC + $5F
VIC_SCREEN_POINTER = VIC + $60
VIC_SCREEN_BANK = VIC + $62
VIC_COLOR_POINTER = VIC + $65
VIC_CHARSET_POINTER = VIC + $68
VIC_CHARSET_BANK = VIC + $6A
VIC_SPR16EN = VIC + $6B
VIC_SPRITE_POINTER = VIC + $6C
VIC_SPRITE_BANK = VIC + $6E
VIC_BP16ENS = VIC + $71
VIC_SPRYADJ = VIC + $72
VIC_SPRENALPHA = VIC + $74
VIC_SPRALPHAVAL = VIC + $75
VIC_SPRENV400 = VIC + $76
VIC_SPRYMSBS = VIC + $77
VIC_SPRYSMSBS = VIC + $78
VIC_RASCMP = VIC + $79
VIC_DISPLAY_ROWS = VIC + $7B

VIC_PALETTE_RED = VIC + $100

VIC_SCREEN_PTR = VIC_SCREEN_POINTER
VIC_CHARSET_PTR = VIC_CHARSET_POINTER

VIC_KNOCK_IV_1 = $47
VIC_KNOCK_IV_2 = $53
22 changes: 21 additions & 1 deletion src/ports.s
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ top_no_change:
: rts

handle_port1:
.scope
lda VIC_LPEN_X
sta pen_x_new
lda VIC_LPEN_Y
Expand All @@ -87,11 +88,20 @@ handle_port1:
jsr display_logo

; read POT1/POT2
lda machine_type
bpl sid
lda $d620
sta port_pot1
lda $d621
sta port_pot2
jmp end_pot
sid:
lda SID_ADConv1
sta port_pot1
lda SID_ADConv2
sta port_pot2

end_pot:
; read digital input
lda #$00
sta CIA1_DDRA
Expand Down Expand Up @@ -129,16 +139,27 @@ bottom_no_change:
jsr display_port
end_port1:
rts
.endscope

handle_port2:
jsr content_background

; read POT1/POT2
lda machine_type
bpl sid
lda $d622
sta port_pot1
lda $d623
sta port_pot2
jmp end_pot
sid:
lda SID_ADConv1
sta port_pot1
lda SID_ADConv2
sta port_pot2

end_pot:

; read control port 2
lda #$00
sta CIA1_DDRA
Expand Down Expand Up @@ -166,4 +187,3 @@ handle_port2:
jsr display_port
end_port2:
rts

32 changes: 30 additions & 2 deletions src/start.s
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,39 @@


.autoimport +
.export start
.export start, machine_type

.include "joyride.inc"
.include "mega65.inc"

.macpack cbm_ext
.macpack utility

.code

start:
lda #12; COLOR_GREY2
.scope
lda #1
sta VIC_SPR0_X
lda #VIC_KNOCK_IV_1
sta VIC_KEY
lda #VIC_KNOCK_IV_2
sta VIC_KEY
lda #0
sta VIC_PALETTE_RED
lda VIC_SPR0_X
beq not_m65
;; Enable fast CPU for quick depack
lda #65
sta 0
lda #$ff
bne both
not_m65:
lda #0
both:
sta machine_type

lda #12; COLOR_GREY2
sta VIC_BORDERCOLOR

memcpy charset, charset_data, $800
Expand Down Expand Up @@ -86,3 +108,9 @@ start:
sta CIA1_CRA

jmp main_loop
.endscope

.bss

machine_type:
.res 1

0 comments on commit dac8bec

Please sign in to comment.