aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.gitignore2
-rw-r--r--.themebin0 -> 6 bytes
-rw-r--r--Makefile18
-rw-r--r--README.md7
-rw-r--r--ako00bin0 -> 2048 bytes
-rw-r--r--ako01bin0 -> 2048 bytes
-rw-r--r--anxiety.asm106
-rw-r--r--mos_api.inc197
-rw-r--r--palette.gpl260
-rw-r--r--spritesheet.xcfbin0 -> 68543 bytes
-rw-r--r--winona.chrbin0 -> 4096 bytes
-rw-r--r--winona.chr.nmtbin0 -> 768 bytes
12 files changed, 590 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..7e5922f
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,2 @@
+*.bin
+*.lst
diff --git a/.theme b/.theme
new file mode 100644
index 0000000..9cab0a8
--- /dev/null
+++ b/.theme
Binary files differ
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..b23ffe5
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,18 @@
+ASM = ez80asm -l -b 00
+
+NAME = anxiety
+BINARY = $(NAME).bin
+DEPS = mos_api.inc
+
+SD_PATH = /opt/fab-agon-emulator/sdcard
+
+all: $(BINARY)
+
+$(BINARY): $(NAME).asm $(DEPS)
+ $(ASM) $<
+
+clean:
+ rm -f $(BINARY) *.lst
+
+install: $(BINARY)
+ cp $(BINARY) $(SD_PATH)
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..292a249
--- /dev/null
+++ b/README.md
@@ -0,0 +1,7 @@
+## Dependencies
+
+- [ez80asm](https://github.com/envenomator/agon-ez80asm)
+
+## Acknowledgements
+
+- https://github.com/schur/Agon-Light-Assembly
diff --git a/ako00 b/ako00
new file mode 100644
index 0000000..9b4b3ed
--- /dev/null
+++ b/ako00
Binary files differ
diff --git a/ako01 b/ako01
new file mode 100644
index 0000000..b89df6b
--- /dev/null
+++ b/ako01
Binary files differ
diff --git a/anxiety.asm b/anxiety.asm
new file mode 100644
index 0000000..f8c120a
--- /dev/null
+++ b/anxiety.asm
@@ -0,0 +1,106 @@
+ macro buf_cmd buffer_id, command
+ .db 23, 0, $a0
+ .dw buffer_id
+ .db command
+ endmacro
+
+chr_buf: .equ 1
+tile_buf: .equ 2
+prog_buf: .equ 3
+
+ .include "mos_api.inc"
+
+ .assume adl = 1
+ .org $40000
+
+ jr start
+ .align 64 ; fill with 0 up to MOS header
+ .db "MOS" ; MOS header
+ .db 0 ; version 0
+ .db 1 ; ADL mode
+
+start:
+ ei
+
+ ld hl, mode ; location of screen mode restore
+ mos mos_sysvars ; load pointer to sysvars in IX
+ ld a, (ix + sysvar_scrMode) ; get current screen mode
+ ld (hl), a ; save it in command stream
+
+ ld hl, init
+ ld bc, cmd_end - init
+ rst.lis $18
+
+wait_for_key:
+ mos mos_getkey
+ or a
+ jr z, wait_for_key ; Loop until key is pressed
+
+ ld hl, cmd_end
+ ld bc, tiles - cmd_end
+ rst.lis $18
+
+ ret
+
+init:
+ ; set mode 640x480x4 (double-buffered)
+ .db 22, 129
+
+ ; clear buffers
+ buf_cmd chr_buf, 2
+ buf_cmd tile_buf, 2
+ buf_cmd prog_buf, 2
+
+ ; write CHR blocks to buffer
+ buf_cmd chr_buf, 0
+ .dw 2048
+ .incbin "ako00"
+
+ buf_cmd chr_buf, 0
+ .dw 2048
+ .incbin "ako01"
+
+ ; consolidate blocks
+ buf_cmd chr_buf, 14
+
+ buf_cmd prog_buf, 0
+ .dw prog_end - prog_start
+prog_start:
+ ; buf_cmd
+prog_end:
+
+ ; ; select bitmap
+ ; .db 23, 27, $20
+ ; ; buffer id
+ ; .dw buffer
+
+ ; ; create bitmap from buffer
+ ; .db 23, 27, $21
+ ; ; width and height
+ ; .dw 640, 480
+ ; ; format
+ ; .db 2
+
+ ; ; select bitmap
+ ; .db 23, 27, $20
+ ; ; buffer id
+ ; .dw buffer
+
+ ; ; display
+ ; .db 23, 27, 3
+ ; .dw 0, 0
+
+ ; set palette
+ .db 19, 0, 255, 128, 0, 0
+ .db 19, 1, 255, 0, 255, 0
+
+ ; flip buffer
+ .db 23, 0, $c3
+
+cmd_end:
+ ; set mode back
+ .db 22
+mode:
+ .db 1
+tiles:
+; tiles_end:
diff --git a/mos_api.inc b/mos_api.inc
new file mode 100644
index 0000000..cf645b0
--- /dev/null
+++ b/mos_api.inc
@@ -0,0 +1,197 @@
+;
+; Title: AGON MOS - API for user projects
+; Author: Dean Belfield
+; Created: 03/08/2022
+; Last Updated: 11/11/2023
+;
+; Modinfo:
+; 05/08/2022: Added mos_feof
+; 09/08/2022: Added system variables: cursorX, cursorY
+; 18/08/2022: Added system variables: scrchar, scrpixel, audioChannel, audioSuccess, vpd_pflags
+; 05/09/2022: Added mos_ren, vdp_pflag_mode
+; 24/09/2022: Added mos_getError, mos_mkdir
+; 13/10/2022: Added mos_oscli
+; 23/02/2023: Added more sysvars, fixed typo in sysvar_audioSuccess, offsets for sysvar_scrCols, sysvar_scrRows
+; 04/03/2023: Added sysvar_scrpixelIndex
+; 08/03/2023: Renamed sysvar_keycode to sysvar_keyascii, added sysvar_vkeycode
+; 15/03/2023: Added mos_copy, mos_getrtc, mos_setrtc, rtc, vdp_pflag_rtc
+; 21/03/2023: Added mos_setintvector, sysvars for keyboard status, vdu codes for vdp
+; 22/03/2023: The VDP commands are now indexed from 0x80
+; 29/03/2023: Added mos_uopen, mos_uclose, mos_ugetc, mos_uputc
+; 13/04/2023: Added FatFS file structures (FFOBJID, FIL, DIR, FILINFO)
+; 15/04/2023: Added mos_getfil, mos_fread, mos_fwrite and mos_flseek
+; 19/05/2023: Added sysvar_scrMode
+; 05/06/2023: Added sysvar_rtcEnable
+; 03/08/2023: Added mos_setkbvector
+; 10/08/2023: Added mos_getkbmap
+; 11/11/2023: Added mos_i2c_open, mos_i2c_close, mos_i2c_write and mos_i2c_read
+
+; VDP control (VDU 23, 0, n)
+;
+vdp_gp: equ 80h
+vdp_keycode: equ 81h
+vdp_cursor: equ 82h
+vdp_scrchar: equ 83h
+vdp_scrpixel: equ 84h
+vdp_audio: equ 85h
+vdp_mode: equ 86h
+vdp_rtc: equ 87h
+vdp_keystate: equ 88h
+vdp_logicalcoords: equ C0h
+vdp_terminalmode: equ FFh
+
+; MOS high level functions
+;
+mos_getkey: equ 00h
+mos_load: equ 01h
+mos_save: equ 02h
+mos_cd: equ 03h
+mos_dir: equ 04h
+mos_del: equ 05h
+mos_ren: equ 06h
+mos_mkdir: equ 07h
+mos_sysvars: equ 08h
+mos_editline: equ 09h
+mos_fopen: equ 0Ah
+mos_fclose: equ 0Bh
+mos_fgetc: equ 0Ch
+mos_fputc: equ 0Dh
+mos_feof: equ 0Eh
+mos_getError: equ 0Fh
+mos_oscli: equ 10h
+mos_copy: equ 11h
+mos_getrtc: equ 12h
+mos_setrtc: equ 13h
+mos_setintvector: equ 14h
+mos_uopen: equ 15h
+mos_uclose: equ 16h
+mos_ugetc: equ 17h
+mos_uputc: equ 18h
+mos_getfil: equ 19h
+mos_fread: equ 1Ah
+mos_fwrite: equ 1Bh
+mos_flseek: equ 1Ch
+mos_setkbvector: equ 1Dh
+mos_getkbmap: equ 1Eh
+mos_i2c_open: equ 1Fh
+mos_i2c_close: equ 20h
+mos_i2c_write: equ 21h
+mos_i2c_read: equ 22h
+
+
+; FatFS file access functions
+;
+ffs_fopen: equ 80h
+ffs_fclose: equ 81h
+ffs_fread: equ 82h
+ffs_fwrite: equ 83h
+ffs_flseek: equ 84h
+ffs_ftruncate: equ 85h
+ffs_fsync: equ 86h
+ffs_fforward: equ 87h
+ffs_fexpand: equ 88h
+ffs_fgets: equ 89h
+ffs_fputc: equ 8Ah
+ffs_fputs: equ 8Bh
+ffs_fprintf: equ 8Ch
+ffs_ftell: equ 8Dh
+ffs_feof: equ 8Eh
+ffs_fsize: equ 8Fh
+ffs_ferror: equ 90h
+
+; FatFS directory access functions
+;
+ffs_dopen: equ 91h
+ffs_dclose: equ 92h
+ffs_dread: equ 93h
+ffs_dfindfirst: equ 94h
+ffs_dfindnext: equ 95h
+
+; FatFS file and directory management functions
+;
+ffs_stat: equ 96h
+ffs_unlink: equ 97h
+ffs_rename: equ 98h
+ffs_chmod: equ 99h
+ffs_utime: equ 9Ah
+ffs_mkdir: equ 9Bh
+ffs_chdir: equ 9Ch
+ffs_chdrive: equ 9Dh
+ffs_getcwd: equ 9Eh
+
+; FatFS volume management and system configuration functions
+;
+ffs_mount: equ 9Fh
+ffs_mkfs: equ A0h
+ffs_fdisk: equ A1h
+ffs_getfree: equ A2h
+ffs_getlabel: equ A3h
+ffs_setlabel: equ A4h
+ffs_setcp: equ A5h
+
+; File access modes
+;
+fa_read: equ 01h
+fa_write: equ 02h
+fa_open_existing: equ 00h
+fa_create_new: equ 04h
+fa_create_always: equ 08h
+fa_open_always: equ 10h
+fa_open_append: equ 30h
+
+; System variable indexes for api_sysvars
+; Index into _sysvars in globals.asm
+;
+sysvar_time: equ 00h ; 4: Clock timer in centiseconds (incremented by 2 every VBLANK)
+sysvar_vpd_pflags: equ 04h ; 1: Flags to indicate completion of VDP commands
+sysvar_keyascii: equ 05h ; 1: ASCII keycode, or 0 if no key is pressed
+sysvar_keymods: equ 06h ; 1: Keycode modifiers
+sysvar_cursorX: equ 07h ; 1: Cursor X position
+sysvar_cursorY: equ 08h ; 1: Cursor Y position
+sysvar_scrchar: equ 09h ; 1: Character read from screen
+sysvar_scrpixel: equ 0Ah ; 3: Pixel data read from screen (R,B,G)
+sysvar_audioChannel: equ 0Dh ; 1: Audio channel
+sysvar_audioSuccess: equ 0Eh ; 1: Audio channel note queued (0 = no, 1 = yes)
+sysvar_scrWidth: equ 0Fh ; 2: Screen width in pixels
+sysvar_scrHeight: equ 11h ; 2: Screen height in pixels
+sysvar_scrCols: equ 13h ; 1: Screen columns in characters
+sysvar_scrRows: equ 14h ; 1: Screen rows in characters
+sysvar_scrColours: equ 15h ; 1: Number of colours displayed
+sysvar_scrpixelIndex: equ 16h ; 1: Index of pixel data read from screen
+sysvar_vkeycode: equ 17h ; 1: Virtual key code from FabGL
+sysvar_vkeydown: equ 18h ; 1: Virtual key state from FabGL (0=up, 1=down)
+sysvar_vkeycount: equ 19h ; 1: Incremented every time a key packet is received
+sysvar_rtc: equ 1Ah ; 6: Real time clock data
+sysvar_spare: equ 20h ; 2: Spare, previously used by rtc
+sysvar_keydelay: equ 22h ; 2: Keyboard repeat delay
+sysvar_keyrate: equ 24h ; 2: Keyboard repeat reat
+sysvar_keyled: equ 26h ; 1: Keyboard LED status
+sysvar_scrMode: equ 27h ; 1: Screen mode
+sysvar_rtcEnable: equ 28h ; 1: RTC enable flag (0: disabled, 1: use ESP32 RTC)
+sysvar_mouseX: equ 29h ; 2: Mouse X position
+sysvar_mouseY: equ 2Bh ; 2: Mouse Y position
+sysvar_mouseButtons: equ 2Dh ; 1: Mouse button state
+sysvar_mouseWheel: equ 2Eh ; 1: Mouse wheel delta
+sysvar_mouseXDelta: equ 2Fh ; 2: Mouse X delta
+sysvar_mouseYDelta: equ 31h ; 2: Mouse Y delta
+
+; Flags for the VPD protocol
+;
+vdp_pflag_cursor: equ 00000001b
+vdp_pflag_scrchar: equ 00000010b
+vdp_pflag_point: equ 00000100b
+vdp_pflag_audio: equ 00001000b
+vdp_pflag_mode: equ 00010000b
+vdp_pflag_rtc: equ 00100000b
+vdp_pflag_mouse: equ 01000000b
+; vdp_pflag_buffered: equ 10000000b
+
+;
+; Macro for calling the API
+; Parameters:
+; - function: One of the function numbers listed above
+;
+ macro mos function
+ ld a,function
+ rst.lis $08
+ endmacro
diff --git a/palette.gpl b/palette.gpl
new file mode 100644
index 0000000..460ee19
--- /dev/null
+++ b/palette.gpl
@@ -0,0 +1,260 @@
+GIMP Palette
+Name: pallette.gpl
+Columns: 16
+#
+255 255 255 Untitled
+255 25 63 Untitled
+21 237 65 Untitled
+0 97 253 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+0 0 0 Untitled
+109 109 109 Untitled
+170 170 170 Untitled
+255 255 255 Untitled
diff --git a/spritesheet.xcf b/spritesheet.xcf
new file mode 100644
index 0000000..a77845b
--- /dev/null
+++ b/spritesheet.xcf
Binary files differ
diff --git a/winona.chr b/winona.chr
new file mode 100644
index 0000000..ea461f8
--- /dev/null
+++ b/winona.chr
Binary files differ
diff --git a/winona.chr.nmt b/winona.chr.nmt
new file mode 100644
index 0000000..37f7c70
--- /dev/null
+++ b/winona.chr.nmt
Binary files differ