Browse Source

Make bsw128 variant bootable

- Use exomizer to make a RUN-able compressed kernal image

 - Consolidated input driver linker configs into 64 and 128 versions
   (they live at different base addresses)

 - Incorporate mouse driver in bsw128 kernal image

 - Add logic to build a bootable image from cbmfiles GEOS128.D64
master
Richard Halkyard 6 months ago
parent
commit
d8a915680e
15 changed files with 51 additions and 66 deletions
  1. +1
    -0
      .gitignore
  2. +35
    -24
      Makefile
  3. +1
    -1
      input/amigamse.s
  4. +1
    -1
      input/inputdrv.cfg
  5. +8
    -0
      input/inputdrv_bsw128.cfg
  6. +0
    -7
      input/joydrv.cfg
  7. +1
    -1
      input/joydrv.s
  8. +0
    -7
      input/koalapad.cfg
  9. +1
    -1
      input/koalapad.s
  10. +0
    -7
      input/lightpen.cfg
  11. +1
    -1
      input/lightpen.s
  12. +0
    -7
      input/mse1351.cfg
  13. +1
    -1
      input/mse1351.s
  14. +0
    -7
      input/pcanalog.cfg
  15. +1
    -1
      input/pcanalog.s

+ 1
- 0
.gitignore View File

@@ -1,3 +1,4 @@
GEOS64.D64
GEOS128.D64
desktop.cvt
build

+ 35
- 24
Makefile View File

@@ -7,15 +7,14 @@ AS = ca65
LD = ld65
C1541 = c1541
PUCRUNCH = pucrunch
D64_TEMPLATE = GEOS64.D64
EXOMIZER = exomizer
D64_RESULT = geos.d64
DESKTOP_CVT = desktop.cvt

ifeq ($(VARIANT),bsw128)
D64_TEMPLATE = GEOS128.D64
DESKTOP_CVT = 128 desktop.cvt
else
D64_TEMPLATE = GEOS64.D64
DESKTOP_CVT = desktop.cvt
endif

ASFLAGS = -I inc -I .
@@ -239,7 +238,7 @@ DRIVER_SOURCES= \
input/joydrv.bin \
input/amigamse.bin \
input/lightpen.bin \
input/mse1351.bin \
input/mse1531.bin \
input/koalapad.bin \
input/pcanalog.bin

@@ -275,7 +274,7 @@ ALL_BINS= \
$(BUILD_DIR)/input/joydrv.bin \
$(BUILD_DIR)/input/amigamse.bin \
$(BUILD_DIR)/input/lightpen.bin \
$(BUILD_DIR)/input/mse1351.bin \
$(BUILD_DIR)/input/mse1531.bin \
$(BUILD_DIR)/input/koalapad.bin \
$(BUILD_DIR)/input/pcanalog.bin

@@ -308,15 +307,15 @@ $(BUILD_DIR)/$(D64_RESULT): $(BUILD_DIR)/kernal_compressed.prg
else \
echo format geos,00 d64 $@ | $(C1541) >/dev/null; \
echo write $< geos128 | $(C1541) $@ >/dev/null; \
if [ -e "$(DESKTOP_CVT)" ]; then echo geoswrite "$(DESKTOP_CVT)" | $(C1541) $@; fi >/dev/null; \
if [ -e $(DESKTOP_CVT) ]; then echo geoswrite $(DESKTOP_CVT) | $(C1541) $@; fi >/dev/null; \
echo \*\*\* Created fresh $@.; \
fi;
else
$(BUILD_DIR)/$(D64_RESULT): $(BUILD_DIR)/kernal_compressed.prg
@if [ -e $(D64_TEMPLATE) ]; then \
cp $(D64_TEMPLATE) $@; \
echo delete geos geoboot | $(C1541) $@ >/dev/null; \
echo write $< geos | $(C1541) $@ >/dev/null; \
echo delete geos geoboot | $(C1541) $@ ;\
echo write $< geos | $(C1541) $@ ;\
echo \*\*\* Created $@ based on $(D64_TEMPLATE).; \
else \
echo format geos,00 d64 $@ | $(C1541) >/dev/null; \
@@ -324,12 +323,14 @@ $(BUILD_DIR)/$(D64_RESULT): $(BUILD_DIR)/kernal_compressed.prg
if [ -e $(DESKTOP_CVT) ]; then echo geoswrite $(DESKTOP_CVT) | $(C1541) $@; fi >/dev/null; \
echo \*\*\* Created fresh $@.; \
fi;
endif

$(BUILD_DIR)/kernal_compressed.prg: $(BUILD_DIR)/kernal_combined.prg
@echo Creating $@
ifeq ($(VARIANT), bsw128)
# pucrunch can't compress for C128 :(
cp $< $@
# start address ($4800) is underneath BASIC ROM on the 128; turn off BASIC
# and KERNAL before jumping to unpacked code
$(EXOMIZER) sfx 0x4800 -t128 -Di_ram_exit='$$3e' -o $@ $<
else
$(PUCRUNCH) -f -c64 -x0x5000 $< $@ 2> /dev/null
endif
@@ -342,8 +343,12 @@ ifeq ($(VARIANT), bsw128)
cat $(BUILD_DIR)/kernal/relocator.bin /dev/zero | dd bs=1 count=1024 >> $(BUILD_DIR)/tmp.bin 2> /dev/null
# kernal.bin($5000) @ $5000-$5400 -> $4C00
cat $(BUILD_DIR)/kernal/kernal.bin /dev/zero | dd bs=1 count=1024 >> $(BUILD_DIR)/tmp.bin 2> /dev/null
# kernal.bin($5000) @ $C000-$0000 -> $5000
cat $(BUILD_DIR)/kernal/kernal.bin /dev/zero | dd bs=1 count=16384 skip=28672 >> $(BUILD_DIR)/tmp.bin 2> /dev/null
# kernal.bin($5000) @ $C000-$FD00 -> $5000
cat $(BUILD_DIR)/kernal/kernal.bin /dev/zero | dd bs=1 count=15616 skip=28672 >> $(BUILD_DIR)/tmp.bin 2> /dev/null
# input*.bin($FD00) @ $FD00-$FE80 -> $8D00
cat $(BUILD_DIR)/input/$(INPUT).bin /dev/zero | dd bs=1 count=384 >> $(BUILD_DIR)/tmp.bin 2> /dev/null
# kernal.bin($5000) @ $FE80-$0000 -> $8E80
cat $(BUILD_DIR)/kernal/kernal.bin /dev/zero | dd bs=1 count=384 skip=44672 >> $(BUILD_DIR)/tmp.bin 2> /dev/null
# drv*.bin($9000) @ $9000-$9D80 -> $9000
cat $(BUILD_DIR)/drv/$(DRIVE).bin /dev/zero | dd bs=1 count=3456 >> $(BUILD_DIR)/tmp.bin 2> /dev/null
# kernal.bin($5000) @ $9D80-$A000 -> $9D80
@@ -365,6 +370,12 @@ else
@mv $(BUILD_DIR)/tmp.bin $(BUILD_DIR)/kernal_combined.prg
endif

ifeq ($(VARIANT),bsw128)
INPUTCFG = input/inputdrv_bsw128.cfg
else
INPUTCFG = input/inputdrv.cfg
endif

$(BUILD_DIR)/drv/drv1541.bin: $(BUILD_DIR)/drv/drv1541.o drv/drv1541.cfg $(DEPS)
$(LD) -C drv/drv1541.cfg $(BUILD_DIR)/drv/drv1541.o -o $@

@@ -374,23 +385,23 @@ $(BUILD_DIR)/drv/drv1571.bin: $(BUILD_DIR)/drv/drv1571.o drv/drv1571.cfg $(DEPS)
$(BUILD_DIR)/drv/drv1581.bin: $(BUILD_DIR)/drv/drv1581.o drv/drv1581.cfg $(DEPS)
$(LD) -C drv/drv1581.cfg $(BUILD_DIR)/drv/drv1581.o -o $@

$(BUILD_DIR)/input/amigamse.bin: $(BUILD_DIR)/input/amigamse.o input/amigamse.cfg $(DEPS)
$(LD) -C input/amigamse.cfg $(BUILD_DIR)/input/amigamse.o -o $@
$(BUILD_DIR)/input/amigamse.bin: $(BUILD_DIR)/input/amigamse.o $(INPUTCFG) $(DEPS)
$(LD) -C $(INPUTCFG) $(BUILD_DIR)/input/amigamse.o -o $@

$(BUILD_DIR)/input/joydrv.bin: $(BUILD_DIR)/input/joydrv.o input/joydrv.cfg $(DEPS)
$(LD) -C input/joydrv.cfg $(BUILD_DIR)/input/joydrv.o -o $@
$(BUILD_DIR)/input/joydrv.bin: $(BUILD_DIR)/input/joydrv.o $(INPUTCFG) $(DEPS)
$(LD) -C $(INPUTCFG) $(BUILD_DIR)/input/joydrv.o -o $@

$(BUILD_DIR)/input/lightpen.bin: $(BUILD_DIR)/input/lightpen.o input/lightpen.cfg $(DEPS)
$(LD) -C input/lightpen.cfg $(BUILD_DIR)/input/lightpen.o -o $@
$(BUILD_DIR)/input/lightpen.bin: $(BUILD_DIR)/input/lightpen.o $(INPUTCFG) $(DEPS)
$(LD) -C $(INPUTCFG) $(BUILD_DIR)/input/lightpen.o -o $@

$(BUILD_DIR)/input/mse1351.bin: $(BUILD_DIR)/input/mse1351.o input/mse1351.cfg $(DEPS)
$(LD) -C input/mse1351.cfg $(BUILD_DIR)/input/mse1351.o -o $@
$(BUILD_DIR)/input/mse1531.bin: $(BUILD_DIR)/input/mse1531.o $(INPUTCFG) $(DEPS)
$(LD) -C $(INPUTCFG) $(BUILD_DIR)/input/mse1531.o -o $@

$(BUILD_DIR)/input/koalapad.bin: $(BUILD_DIR)/input/koalapad.o input/koalapad.cfg $(DEPS)
$(LD) -C input/koalapad.cfg $(BUILD_DIR)/input/koalapad.o -o $@
$(BUILD_DIR)/input/koalapad.bin: $(BUILD_DIR)/input/koalapad.o $(INPUTCFG) $(DEPS)
$(LD) -C $(INPUTCFG) $(BUILD_DIR)/input/koalapad.o -o $@

$(BUILD_DIR)/input/pcanalog.bin: $(BUILD_DIR)/input/pcanalog.o input/pcanalog.cfg $(DEPS)
$(LD) -C input/pcanalog.cfg $(BUILD_DIR)/input/pcanalog.o -o $@
$(BUILD_DIR)/input/pcanalog.bin: $(BUILD_DIR)/input/pcanalog.o $(INPUTCFG) $(DEPS)
$(LD) -C $(INPUTCFG) $(BUILD_DIR)/input/pcanalog.o -o $@

$(BUILD_DIR)/%.o: %.s
@mkdir -p `dirname $@`

+ 1
- 1
input/amigamse.s View File

@@ -9,7 +9,7 @@
.include "jumptab.inc"
.include "c64.inc"

.segment "amigamse"
.segment "inputdrv"

MouseInit:
jmp _MouseInit

input/amigamse.cfg → input/inputdrv.cfg View File

@@ -3,5 +3,5 @@ MEMORY {
}

SEGMENTS {
amigamse: load = MOUSE_BASE, type = ro;
inputdrv: load = MOUSE_BASE, type = ro;
}

+ 8
- 0
input/inputdrv_bsw128.cfg View File

@@ -0,0 +1,8 @@
MEMORY {
# MOUSE_BASE: start = $FE80, size = $0180, file = %O;
MOUSE_BASE: start = $FD00, size = $0180, file = %O;
}

SEGMENTS {
inputdrv: load = MOUSE_BASE, type = ro;
}

+ 0
- 7
input/joydrv.cfg View File

@@ -1,7 +0,0 @@
MEMORY {
MOUSE_BASE: start = $FE80, size = $0180, file = %O;
}

SEGMENTS {
joydrv: load = MOUSE_BASE, type = ro;
}

+ 1
- 1
input/joydrv.s View File

@@ -9,7 +9,7 @@
.include "jumptab.inc"
.include "c64.inc"

.segment "joydrv"
.segment "inputdrv"

MouseInit:
jmp _MouseInit

+ 0
- 7
input/koalapad.cfg View File

@@ -1,7 +0,0 @@
MEMORY {
MOUSE_BASE: start = $FE80, size = $0180, file = %O;
}

SEGMENTS {
koalapad: load = MOUSE_BASE, type = ro;
}

+ 1
- 1
input/koalapad.s View File

@@ -5,7 +5,7 @@

; TODO: reassemble

.segment "koalapad"
.segment "inputdrv"

.byte $4c, $90, $fe, $4c, $9a, $fe, $4c, $9b, $fe, $00, $08, $08, $00, $00, $00, $00
.byte $a9, $00, $85, $3b, $a9, $08, $85, $3a, $85, $3c, $60, $24, $30, $30, $03, $4c

+ 0
- 7
input/lightpen.cfg View File

@@ -1,7 +0,0 @@
MEMORY {
MOUSE_BASE: start = $FE80, size = $0180, file = %O;
}

SEGMENTS {
lightpen: load = MOUSE_BASE, type = ro;
}

+ 1
- 1
input/lightpen.s View File

@@ -10,7 +10,7 @@
.include "jumptab.inc"
.include "c64.inc"

.segment "lightpen"
.segment "inputdrv"

MouseInit:
jmp _MouseInit

+ 0
- 7
input/mse1351.cfg View File

@@ -1,7 +0,0 @@
MEMORY {
MOUSE_BASE: start = $FE80, size = $0180, file = %O;
}

SEGMENTS {
mse1351: load = MOUSE_BASE, type = ro;
}

+ 1
- 1
input/mse1351.s View File

@@ -8,7 +8,7 @@
.include "geosmac.inc"
.include "c64.inc"

.segment "mse1351"
.segment "inputdrv"

MouseInit:
jmp _MouseInit

+ 0
- 7
input/pcanalog.cfg View File

@@ -1,7 +0,0 @@
MEMORY {
MOUSE_BASE: start = $FE80, size = $0180, file = %O;
}

SEGMENTS {
pcanalog: load = MOUSE_BASE, type = ro;
}

+ 1
- 1
input/pcanalog.s View File

@@ -3,7 +3,7 @@
;
; pcanalog input driver

.segment "pcanalog"
.segment "inputdrv"

.byte $4c, $94, $fe, $4c, $a0, $fe, $4c, $a1, $fe, $00, $2d, $33, $39, $07, $05, $39
.byte $3e, $43, $08, $04, $a9, $00, $85, $3b, $a9, $00, $85, $3a, $a9, $00, $85, $3c

Loading…
Cancel
Save