Skip to content

Commit 90bf08c

Browse files
committed
Adding framwork for PET. Platform function are dummies so far
1 parent 05dbfef commit 90bf08c

File tree

5 files changed

+156
-0
lines changed

5 files changed

+156
-0
lines changed

pet/base.p8

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
%import sound
2+
%import joystick
3+
%import keyboard
4+
5+
base {
6+
7+
; Define playfield limits
8+
const ubyte LBORDER = 0
9+
const ubyte RBORDER = 30;
10+
const ubyte UBORDER = 0
11+
const ubyte DBORDER = UBORDER + 24;
12+
13+
; Not needed on PET
14+
sub platform_setup() {
15+
}
16+
17+
; Not needed on PET
18+
sub draw_extra_border() {
19+
}
20+
21+
}

pet/joystick.p8

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
; No PET joystick support yet
2+
;
3+
joystick {
4+
5+
ubyte joy_info
6+
7+
sub init() {
8+
joy_info = 0
9+
}
10+
11+
sub pull_info() {
12+
joy_info = 0
13+
}
14+
15+
sub pushing_start() -> ubyte {
16+
return joy_info
17+
}
18+
19+
sub pushing_fire() -> ubyte {
20+
return joy_info
21+
}
22+
23+
sub pushing_left() -> ubyte {
24+
return joy_info
25+
}
26+
27+
sub pushing_right() -> ubyte{
28+
return joy_info
29+
}
30+
31+
}

pet/keyboard.p8

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
; Custom keyboard input handler to allow for smooth movement with keyboard
2+
; control. Need to be able to
3+
; a) see if movement a key is kept pressed down and
4+
; b) allow fire key be pressed together with one of the movement keys
5+
;
6+
; Assembly function returs a bit pattern where
7+
; - bit 0 = L_SHIFT pressed (fire)
8+
; - bit 1 = K pressed (left)
9+
; - bit 2 = L pressed (right)
10+
;
11+
; Note that K takes presedence over L so if K is pressed, we don't check for L.
12+
;
13+
14+
keyboard {
15+
16+
ubyte key
17+
18+
sub pull_info() {
19+
key = cbm.GETIN()
20+
}
21+
22+
sub pushing_fire() -> bool {
23+
return key == 'z'
24+
}
25+
26+
sub pushing_left() -> bool {
27+
return key == 'k' or key == 157
28+
}
29+
30+
sub pushing_right() -> bool {
31+
return key == 'l' or key == 29
32+
}
33+
34+
}

pet/page_usage.p8

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
; Roller page
2+
; - show controls for Commodore 64
3+
4+
page_usage {
5+
6+
ubyte[] chars_1 = [
7+
$20,$20,$20,$20,$20,$6F,$6F,$6F,$6F,$6F,$6F,$6F,$61,$E1,$6F,$6F,$6F,$6F,$6F,$6F,$6F,$6F,$6F,$6F,$6F,$6F,$6F,$6F,$6F,$6F,$6F,$6F,$6F,$6F,$6F,$20,$20,$20,$20,$20,
8+
$20,$20,$20,$20,$20,$20,$70,$40,$40,$43,$43,$43,$6E,$70,$43,$43,$43,$43,$43,$43,$43,$43,$72,$43,$43,$43,$43,$43,$43,$43,$43,$43,$43,$6E,$20,$20,$20,$20,$20,$20,
9+
$40,$40,$40,$40,$40,$40,$42,$20,$03,$0D,$04,$20,$5D,$42,$0A,$0F,$19,$13,$14,$09,$03,$0B,$42,$20,$0B,$05,$19,$02,$0F,$01,$12,$04,$20,$5D,$20,$20,$20,$20,$20,$20,
10+
$40,$40,$40,$40,$40,$40,$6B,$40,$40,$40,$40,$40,$73,$6B,$43,$43,$43,$43,$43,$43,$43,$43,$5B,$43,$43,$43,$43,$43,$43,$43,$43,$43,$43,$73,$20,$20,$40,$20,$20,$20,
11+
$20,$20,$20,$20,$20,$20,$42,$13,$14,$01,$12,$14,$5D,$42,$20,$20,$20,$20,$20,$20,$20,$20,$42,$20,$20,$13,$10,$01,$03,$05,$20,$20,$20,$5D,$20,$20,$20,$20,$20,$20,
12+
$20,$20,$20,$20,$20,$20,$42,$06,$09,$12,$05,$20,$5D,$42,$20,$20,$10,$0F,$12,$14,$20,$20,$42,$0C,$05,$06,$14,$20,$13,$08,$09,$06,$14,$5D,$20,$20,$20,$20,$20,$20 ]
13+
14+
ubyte[] chars_2 = [
15+
$40,$40,$40,$40,$40,$40,$42,$0C,$05,$06,$14,$20,$5D,$42,$20,$20,$20,$32,$20,$20,$20,$20,$42,$20,$20,$20,$20,$0B,$20,$20,$20,$20,$20,$5D,$20,$20,$20,$20,$20,$20,
16+
$40,$40,$40,$40,$40,$40,$42,$12,$09,$07,$08,$14,$5D,$42,$20,$20,$20,$20,$20,$40,$40,$20,$42,$20,$20,$20,$20,$0C,$20,$20,$20,$20,$20,$5D,$20,$20,$20,$20,$20,$20,
17+
$20,$20,$20,$40,$40,$40,$6D,$43,$43,$43,$43,$40,$7D,$6D,$43,$43,$43,$43,$43,$43,$43,$43,$71,$43,$43,$43,$43,$43,$43,$43,$40,$40,$40,$7D,$20,$20,$20,$20,$20,$20,
18+
$20,$20,$20,$20,$20,$77,$77,$77,$77,$77,$77,$77,$61,$E1,$77,$77,$77,$77,$77,$77,$77,$77,$77,$77,$77,$77,$77,$77,$77,$77,$77,$77,$77,$77,$77,$20,$20,$20,$20,$20,
19+
$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,
20+
$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20 ]
21+
22+
ubyte[] colors_1 = [
23+
$01,$00,$01,$00,$00,$03,$03,$03,$03,$03,$03,$03,$03,$03,$03,$03,$03,$03,$03,$03,$03,$03,$03,$03,$03,$03,$03,$03,$03,$03,$03,$03,$03,$03,$03,$00,$00,$00,$00,$00,
24+
$03,$03,$03,$03,$03,$03,$0D,$0D,$0D,$0D,$0D,$0D,$0D,$0D,$0D,$0D,$0D,$0D,$0D,$0D,$0D,$0D,$0D,$0D,$0D,$0D,$0D,$0D,$0D,$0D,$0D,$0D,$0D,$0D,$0D,$0D,$03,$0D,$03,$03,
25+
$00,$00,$00,$00,$00,$00,$0D,$00,$01,$01,$01,$01,$0D,$0D,$01,$01,$01,$01,$01,$01,$01,$01,$0D,$0D,$01,$01,$01,$01,$01,$01,$01,$01,$0D,$0D,$07,$07,$0A,$07,$0A,$0A,
26+
$00,$00,$00,$00,$00,$00,$0D,$0D,$0D,$0D,$0D,$0D,$0D,$0D,$0D,$0D,$0D,$0D,$0D,$0D,$0D,$0D,$0D,$0D,$0D,$0D,$0D,$0D,$0D,$0D,$0D,$0D,$0D,$0D,$07,$07,$00,$07,$0A,$0A,
27+
$07,$07,$07,$07,$07,$07,$0D,$0E,$0E,$0E,$0E,$0E,$0D,$0D,$01,$01,$01,$01,$01,$01,$01,$01,$0D,$0E,$0E,$0A,$0A,$0A,$0A,$0A,$0E,$0E,$0E,$0D,$07,$07,$07,$07,$07,$07,
28+
$07,$07,$07,$07,$07,$07,$0D,$0E,$0E,$0E,$0E,$0E,$0D,$0D,$01,$0A,$0A,$0A,$0A,$0A,$01,$01,$0D,$0A,$0A,$0A,$0A,$0A,$0A,$0A,$0A,$0A,$0A,$0D,$07,$07,$07,$07,$07,$07 ]
29+
30+
ubyte[] colors_2 = [
31+
$00,$00,$00,$00,$00,$00,$0D,$0E,$0E,$0E,$0E,$0E,$0D,$0D,$01,$01,$01,$0A,$01,$01,$01,$01,$0D,$0A,$0A,$0A,$0A,$0A,$0A,$0A,$0A,$0A,$0A,$0D,$0A,$0A,$0A,$0A,$0A,$0A,
32+
$00,$00,$00,$00,$00,$00,$0D,$0E,$0E,$0E,$0E,$0E,$0D,$0D,$07,$07,$07,$07,$07,$00,$00,$07,$0D,$0A,$0A,$0A,$0A,$0A,$0A,$0A,$0A,$0A,$0A,$0D,$0A,$00,$0A,$0A,$0A,$0A,
33+
$01,$00,$01,$00,$00,$00,$0D,$0D,$0D,$0D,$0D,$0D,$0D,$0D,$0D,$0D,$0D,$0D,$0D,$0D,$0D,$0D,$0D,$0D,$0D,$0D,$0D,$0D,$0D,$0D,$0D,$0D,$0D,$0D,$0E,$0E,$0E,$0E,$0E,$0E,
34+
$01,$00,$01,$00,$00,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$00,$00,$00,$00,$00,
35+
$07,$07,$07,$07,$07,$07,$07,$07,$07,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,
36+
$0E,$0E,$0E,$0E,$0E,$0E,$0E,$0E,$0E,$07,$0E,$0E,$0E,$0E,$0E,$0E,$0E,$0E,$0E,$0E,$0E,$0E,$0E,$0E,$0E,$0E,$0E,$0E,$0E,$0E,$0E,$0E,$0E,$0E,$0E,$0E,$0E,$0E,$0E,$0E ]
37+
38+
}

pet/sound.p8

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
;
2+
; PET sound effects
3+
;
4+
; Just dummy functions for now
5+
;
6+
sound {
7+
ubyte sound_priority = 0
8+
9+
sub init() {
10+
}
11+
12+
sub check() {
13+
}
14+
15+
sub fire() {
16+
}
17+
18+
sub hit() {
19+
}
20+
21+
sub bomb() {
22+
}
23+
24+
sub small_explosion() {
25+
}
26+
27+
sub large_explosion() {
28+
}
29+
30+
sub score_sound_and_delay() {
31+
}
32+
}

0 commit comments

Comments
 (0)