Skip to content

Commit

Permalink
Working test harness for screenkernal
Browse files Browse the repository at this point in the history
  • Loading branch information
johanberntsson committed Feb 29, 2024
1 parent 0b07f61 commit bb3ee4d
Show file tree
Hide file tree
Showing 4 changed files with 129 additions and 14 deletions.
94 changes: 94 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
all: x16

x16:
#ruby make.rb -s examples/dragontroll.z5 -t:x16
acme --cpu 65c02 -o testx16.bin --format cbm testx16.asm
x16-emulator/x16emu -prg testx16.bin -run -scale 2

mega65:
ruby make.rb -t:mega65 ./games/infocom/sherlock.z5 -u -s -ch:100 -sb:0 -dm:0
#ruby make.rb examples/Aventyr.z5 -ch -s -t:mega65 -smooth
#ruby make.rb games/infocom/planetfall.z5 -s -t:mega65 -sw:0
#ruby make.rb -debug -v -ch -s games/infocom/hollywood.z3 -t:mega65 -sw:0
#ruby make.rb -s -v -ch -t:mega65 z6/shogun-r322-s890706.z6
#ruby make.rb -s -v -ch -t:mega65 -asa . testsnd.z5
#~/mega65/mega65_ftp -c "put testsnd.d81" -c "quit"
#ruby make.rb -s -ch -t:mega65 -asw lurking games/infocom/lurkinghorror-r221-s870918.z3
#mv mega65_lurkinghorror-r221-s870918.d81 lurking.d81
#~/mega65/m65 -F
#~/mega65/mega65_ftp -c "put lurking.d81" -c "mount lurking.d81" -c "quit"
#ruby make.rb -v -ch -t:mega65 -asw sherlock games/infocom/sherlock.z5
#mv mega65_sherlock.d81 sherlock.d81
#~/mega65/mega65_ftp -c "put sherlock.d81" -c "quit"
#ruby make.rb -s -v -ch -t:mega65 -asw sherlock testsound.z5
#ruby make.rb -s -v -t:mega65 -snd 003.aiff testbench.z5
#ruby make.rb infocom/trinity-r15-s870628.z4 -t:mega65 -81 -s
#ruby make.rb -debug -s infocom/zork1-invclues-r52-s871125.z5 -t:mega65
#ruby make.rb -s infocom/zork1-invclues-r52-s871125.z5 -t:mega65
#ruby make.rb -s ./games/infocom/amfvUnprotected.z4 -t:mega65
#ruby make.rb -s infocom/beyondzork.z5 -81 -t:mega65
#ruby make.rb -s -P examples/dragontroll.z5 -t:mega65
#ruby make.rb -s examples/dejavu.z3 -t:mega65
#ruby make.rb games/eas.z5 -s -t:mega65
#ruby make.rb -rc:7=11,8=15 -dc:7:8 infocom/planetfall.z5 -s -t:mega65
#ruby make.rb -d71 -s infocom/planetfall.z5 -ss1:"Super Mario Murders" -ss2:"A coin-op mystery" -ss3:"by" -ss4:"John \"Popeye\" Johnsson" -sw:8 -t:mega65
#ruby make.rb -s games/infocom/hollywood.z3 -f fonts/en/ClairsysOzmoo-Regular-US.fnt -t:mega65

c128:
#ruby make.rb -s z6/shogun-r322-s890706.z6 -t:c128 -81
#ruby make.rb infocom/trinity-r15-s870628.z4 -t:c128 -81 -s
#ruby make.rb -s ./games/infocom/amfvUnprotected.z4 -t:c128
#ruby make.rb -s infocom/zork1-invclues-r52-s871125.z5 -t:c128
#ruby make.rb -s infocom/beyondzork.z5 -t:c128
#ruby make.rb -s examples/dragontroll.z5 -t:c128
#ruby make.rb -s examples/dejavu.z3 -t:c128
#ruby make.rb -s games/infocom/borderzone.z5 -t:c128 -u
#ruby make.rb -cb:5 -s games/infocom/hollywood.z3 -t:c128
#ruby make.rb -ch -s games/infocom/sherlock.z5 -t:c128 -u
ruby make.rb examples/minizork.z3 -t:c128 -u:r -s
#ruby make.rb -ch -s games/infocom/hollywood.z3 -t:c128 -sb:6 -u

c64:
#ruby make.rb examples/Aventyr.z5 -f fonts/sv/ClairsysOzmoo-Bold-SV.fnt -cm:sv -ch -s -81
#ruby make.rb -t:c64 games/infocom/hollywood.z3 -s -ch:100 -sb:0 -dm:0 -smooth
#ruby make.rb custard.z7 -81 -s
#ruby make.rb green.z2 -ch:20 -u -s
#ruby make.rb infocom/minizork.z3 -ch:20 -s -smooth
#ruby make.rb infocom/minizork.z3 -v -i loaderpic.kla
ruby make.rb examples/minizork.z3 -u -s
#ruby make.rb -v games/drakmagi.z5
#ruby make.rb -ch -s infocom/zork1-invclues-r52-s871125.z5
#ruby make.rb games/infocom/planetfall.z5 -s -sw:0
#ruby make.rb -debug -ch -s games/infocom/hollywood.z3
#ruby make.rb -b -p:0 -ch -s games/infocom/hollywood.z3
#ruby make.rb -s ./test/strictz.z3
#ruby make.rb -s ./test/strictz.z5
#ruby make.rb -s ./test/czech.z3
#ruby make.rb -s ./games/infocom/amfvUnprotected.z4 -81
#ruby make.rb -s infocom/beyondzork.z5 -81
#ruby make.rb -s -P examples/dragontroll.z5
#ruby make.rb -s games/infocom/borderzone.z5 -81
#ruby make.rb -s examples/dejavu.z3
#ruby make.rb -cb:5 -s games/infocom/hollywood.z3
#ruby make.rb -S1 -s games/infocom/hollywood.z3
#ruby make.rb -s games/infocom/hollywood.z3 -f fonts/clairsys.fnt
#ruby make.rb -s -p:0 infocom/zork2.z3
#ruby make.rb -s games/infocom/zork1.z3
#ruby make.rb -s games/infocom/nord_and_bert.z4 -81
#ruby make.rb -ch infocom/planetfall.z5 -s

plus4:
#ruby make.rb -ch -s infocom/zork1-invclues-r52-s871125.z5 -t:plus4
#ruby make.rb infocom/trinity-r15-s870628.z4 -t:plus4 -81 -s
#ruby make.rb -s ./games/infocom/amfvUnprotected.z4 -81 -t:plus4
#ruby make.rb -s infocom/beyondzork.z5 -81 -t:plus4
#ruby make.rb -s -P -r examples/dragontroll.z5 -t:plus4
#ruby make.rb -s -P -r examples/dejavu.z3 -t:plus4
ruby make.rb -s games/infocom/hollywood.z3 -t:plus4
#ruby make.rb -s games/infocom/hollywood.z3 -f fonts/clairsys.fnt -t:plus4
#ruby make.rb infocom/planetfall.z5 -s -t:plus4
#ruby make.rb -s games/infocom/nord_and_bert.z4 -t:plus4 -81
#ruby make.rb -s games/infocom/borderzone.z5 -t:plus4 -81

clean:
rm -f *d64 *d71 *d81
7 changes: 7 additions & 0 deletions asm/vera.asm
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,10 @@ VERA_L1_config = $9f34
VERA_L1_mapbase = $9f35
VERA_L1_tilebase = $9f36

;VRAM_layer1_map = $1B000
;VRAM_layer0_map = $00000
;VRAM_lowerchars = $0B000
;VRAM_lower_rev = VRAM_lowerchars + 128*8
;VRAM_petscii = $1F000
;VRAM_palette = $1FA00

18 changes: 14 additions & 4 deletions make.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
$commandline_quotemark = "\""
else
# Paths on Linux
$X16 = "x16-emulator/x16emu"
$X64 = "x64 -autostart-delay-random"
$X128 = "x128 -autostart-delay-random"
#$X128 = "x128 -80col -autostart-delay-random"
Expand Down Expand Up @@ -1042,7 +1043,9 @@ def name_to_c64(name)
def build_interpreter()
necessarysettings = " --setpc #{$start_address} -DCACHE_PAGES=#{$CACHE_PAGES} -DSTACK_PAGES=#{$stack_pages} -D#{$ztype}=1"
necessarysettings += " -DCONF_TRK=#{$CONFIG_TRACK}" if $CONFIG_TRACK
if $target == 'mega65' then
if $target == 'x16' then
necessarysettings += " --cpu 65c02"
elsif $target == 'mega65' then
necessarysettings += " --cpu m65"
else
necessarysettings += " --cpu 6510"
Expand Down Expand Up @@ -1324,7 +1327,9 @@ def add_boot_file(finaldiskname, diskimage_filename)
end

def play(filename)
if $target == "mega65" then
if $target == "x16" then
command = "#{$X16} -run \"#{filename}\""
elsif $target == "mega65" then
if defined? $MEGA65 then
command = "#{$MEGA65} -8 \"#{filename}\""
else
Expand Down Expand Up @@ -2093,7 +2098,7 @@ def print_usage
puts " [-dt:\"text\"] [-rd] [-as(a|w) <soundpath>] "
puts " [-u[:0|1|r]] <storyfile>"
puts " -t: specify target machine. Available targets are c64 (default), c128, plus4 and mega65."
puts " -S1|-S2|-D2|-D3|-71|-71D|-81|-P: build mode. Defaults to S1 (71 for C128, 81 for MEGA65). See docs."
puts " -S1|-S2|-D2|-D3|-71|-81|-P: build mode. Defaults to S1 (71 for C128, 81 for MEGA65). See docs."
puts " -v: Verbose mode. Print as much details as possible about what make.rb is doing."
puts " -p: preload a maximum of n virtual memory blocks to make game faster at start."
puts " -b: only preload virtual memory blocks that can be included in the boot file."
Expand Down Expand Up @@ -2221,11 +2226,16 @@ def print_usage
elsif ARGV[i] =~ /^-p:(\d+)$/ then
preload_max_vmem_blocks = $1.to_i
limit_preload_vmem_blocks = true
elsif ARGV[i] =~ /^-t:(c64|c128|mega65|plus4)$/ then
elsif ARGV[i] =~ /^-t:(c64|c128|mega65|plus4|x16)$/ then
$target = $1
if $target == "mega65" then
# $start_address = 0x1001
$start_address = 0x1800
elsif $target == "x16" then
$start_address = 0x0801
$memory_end_address = 0xa000
$unbanked_ram_end_address = $memory_end_address
$normal_ram_end_address = $memory_end_address
elsif $target == "plus4" then
$start_address = 0x1001
$memory_end_address = 0xfc00
Expand Down
24 changes: 14 additions & 10 deletions testx16.asm
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
; To compile and run using acme and x16emu
;
; acme -o testx16.bin testx16.asm
; acme --cpu 65c02 -o testx16.bin --format cbm testx16.asm
; x16-emulator/x16emu -prg testx16.bin -run

COL2 = 0
Expand All @@ -27,10 +27,9 @@ STATCOL = FGCOL
STATCOLDM = FGCOLDM
TARGET_X16 = 1


*=$0801
!byte $01,$08,$0b,$08,$01,$00,$9e,$32,$30,$36,$31,$00,$00,$00
jmp .testvera
!byte $0b,$08,$01,$00,$9e,$32,$30,$36,$31,$00,$00,$00
jmp .testx16

scroll_delay !byte 0
streams_print_output
Expand All @@ -40,21 +39,26 @@ print_num_signed
print_num_unsigned
write_header_byte
rts

!source "asm/constants.asm"
!source "asm/vera.asm"
!source "asm/constants-header.asm"
!source "asm/utilities.asm"
!source "asm/screenkernal.asm"

.testx16
lda #14
jsr $ffd2
jsr s_init
lda #65
jsr s_printchar
RTS
lda #14
jsr $ffd2
jsr s_init
lda #65 ; 'a'
jsr s_printchar
rts

.testvera
lda #14
jsr $ffd2
lda #65
jmp $ffd2
;jsr .testx16
lda #$1c
jsr $ffd2
Expand Down

0 comments on commit bb3ee4d

Please sign in to comment.